changeset 25:f713da8bc051

Added SWT Linux GTK
author Frank Benoit <benoit@tionex.de>
date Fri, 20 Mar 2009 23:03:58 +0100
parents b7a1d02a0e1f
children f589fc20a5f9
files java/src/java/lang/Math.d java/src/java/lang/String.d java/src/java/lang/StringBuffer.d java/src/java/lang/util.d org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages.properties org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_ar.properties org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_cs.properties org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_da.properties org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_de.properties org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_el.properties org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_es.properties org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_fi.properties org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_fr.properties org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_hu.properties org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_it.properties org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_iw.properties org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_ja.properties org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_ko.properties org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_nl.properties org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_no.properties org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_pl.properties org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_pt.properties org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_pt_BR.properties org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_ru.properties org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_sv.properties org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_tr.properties org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_zh.properties org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_zh_HK.properties org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_zh_TW.properties org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/SWT.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/SWTError.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/SWTException.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/accessibility/ACC.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/accessibility/Accessible.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/accessibility/AccessibleAdapter.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/accessibility/AccessibleControlAdapter.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/accessibility/AccessibleControlEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/accessibility/AccessibleControlListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/accessibility/AccessibleEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/accessibility/AccessibleFactory.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/accessibility/AccessibleListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/accessibility/AccessibleObject.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/accessibility/AccessibleTextAdapter.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/accessibility/AccessibleTextEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/accessibility/AccessibleTextListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/accessibility/all.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/all.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/AppFileLocProvider.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/Browser.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/CloseWindowListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/Download.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/DownloadFactory.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/DownloadFactory_1_8.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/Download_1_8.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/FilePicker.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/FilePickerFactory.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/FilePickerFactory_1_8.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/FilePicker_1_8.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/HelperAppLauncherDialog.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/HelperAppLauncherDialogFactory.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/HelperAppLauncherDialog_1_9.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/InputStream.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/LocationAdapter.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/LocationEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/LocationListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/Mozilla.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/MozillaDelegate.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/OpenWindowListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/ProgressAdapter.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/ProgressEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/ProgressListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/PromptDialog.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/PromptService2.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/PromptService2Factory.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/SimpleEnumerator.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/StatusTextEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/StatusTextListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/TitleEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/TitleListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/VisibilityWindowAdapter.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/VisibilityWindowListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/WebBrowser.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/WindowCreator2.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/WindowEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/all.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/AnimatedProgress.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/BidiSegmentEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/BidiSegmentListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/Bullet.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/BusyIndicator.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/CBanner.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/CBannerLayout.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/CCombo.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/CLabel.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/CLayoutData.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/CTabFolder.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/CTabFolder2Adapter.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/CTabFolder2Listener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/CTabFolderAdapter.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/CTabFolderEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/CTabFolderLayout.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/CTabFolderListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/CTabItem.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/ControlEditor.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/DefaultContent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/ExtendedModifyEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/ExtendedModifyListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/LineBackgroundEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/LineBackgroundListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/LineStyleEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/LineStyleListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/MovementEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/MovementListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/PaintObjectEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/PaintObjectListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/PopupList.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/ST.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/SashForm.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/SashFormData.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/SashFormLayout.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/ScrolledComposite.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/ScrolledCompositeLayout.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/StackLayout.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/StyleRange.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/StyledText.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/StyledTextContent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/StyledTextDropTargetEffect.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/StyledTextEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/StyledTextListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/StyledTextPrintOptions.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/StyledTextRenderer.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/TableCursor.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/TableEditor.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/TableTree.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/TableTreeEditor.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/TableTreeItem.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/TextChangeListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/TextChangedEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/TextChangingEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/TreeEditor.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/VerifyKeyListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/ViewForm.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/ViewFormLayout.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/all.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/ByteArrayTransfer.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/Clipboard.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/ClipboardProxy.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/DND.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/DNDEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/DNDListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/DragSource.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/DragSourceAdapter.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/DragSourceEffect.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/DragSourceEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/DragSourceListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/DropTarget.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/DropTargetAdapter.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/DropTargetEffect.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/DropTargetEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/DropTargetListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/FileTransfer.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/HTMLTransfer.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/ImageTransfer.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/RTFTransfer.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/TableDragSourceEffect.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/TableDropTargetEffect.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/TextTransfer.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/Transfer.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/TransferData.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/TreeDragSourceEffect.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/TreeDropTargetEffect.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/URLTransfer.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/all.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/ArmEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/ArmListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/ControlAdapter.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/ControlEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/ControlListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/DisposeEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/DisposeListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/DragDetectEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/DragDetectListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/ExpandAdapter.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/ExpandEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/ExpandListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/FocusAdapter.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/FocusEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/FocusListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/HelpEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/HelpListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/KeyAdapter.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/KeyEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/KeyListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/MenuAdapter.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/MenuDetectEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/MenuDetectListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/MenuEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/MenuListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/ModifyEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/ModifyListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/MouseAdapter.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/MouseEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/MouseListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/MouseMoveListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/MouseTrackAdapter.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/MouseTrackListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/MouseWheelListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/PaintEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/PaintListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/SelectionAdapter.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/SelectionEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/SelectionListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/ShellAdapter.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/ShellEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/ShellListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/TraverseEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/TraverseListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/TreeAdapter.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/TreeEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/TreeListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/TypedEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/VerifyEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/VerifyListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/all.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Color.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Cursor.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Device.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/DeviceData.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Drawable.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Font.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/FontData.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/FontMetrics.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/GC.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/GCData.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/GlyphMetrics.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Image.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/ImageData.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/ImageDataLoader.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/ImageLoader.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/ImageLoaderEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/ImageLoaderListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/LineAttributes.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/PaletteData.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Path.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/PathData.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Pattern.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Point.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/RGB.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Rectangle.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Region.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Resource.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/TextLayout.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/TextStyle.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Transform.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/all.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/BidiUtil.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/CloneableCompatibility.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/Compatibility.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/Converter.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/LONG.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/Library.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/Lock.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/Platform.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/SWTEventListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/SWTEventObject.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/SerializableCompatibility.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/accessibility/gtk/ATK.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/X.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/XInput.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/XTest.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/Xlib.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/Xrender.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/Xutil.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/atk.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/cairo.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/cairo_pdf.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/cairo_ps.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/cairo_xlib.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/cairo_xlib_xrender.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/gdk.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/gdkx.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/glib_object.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/glx.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/gmodule.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/gtk.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/gtk_unix_print_2_0.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/pango.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/pangocairo.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/cairo/Cairo.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/gtk/OS.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/FileFormat.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/GIFFileFormat.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGAppn.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGArithmeticConditioningTable.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGComment.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGDecoder.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGEndOfImage.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGFileFormat.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGFixedSizeSegment.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGFrameHeader.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGHuffmanTable.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGQuantizationTable.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGRestartInterval.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGScanHeader.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGSegment.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGStartOfImage.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGVariableSizeSegment.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/LEDataInputStream.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/LEDataOutputStream.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/LZWCodec.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/LZWNode.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/OS2BMPFileFormat.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PNGFileFormat.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngChunk.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngChunkReader.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngDecodingDataStream.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngDeflater.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngEncoder.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngFileReadState.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngHuffmanTable.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngHuffmanTables.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngIdatChunk.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngIendChunk.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngIhdrChunk.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngInputStream.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngLzBlockReader.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngPlteChunk.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngTrnsChunk.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/TIFFDirectory.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/TIFFFileFormat.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/TIFFModifiedHuffmanCodec.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/TIFFRandomFileAccess.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/WinBMPFileFormat.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/WinICOFileFormat.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/Common.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/XPCOM.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/XPCOMInit.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/gfxIImageFrame.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/imgIContainer.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/imgIContainerObserver.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsEmbedString.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsError.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIAppShell.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIAtom.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIAuthInformation.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIAuthPrompt.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIAuthPromptCallback.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIBaseWindow.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIBinaryInputStream.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIBinaryOutputStream.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsICancelable.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsICategoryManager.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIChannel.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIChromeEventHandler.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsICollection.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIComponentManager.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIComponentRegistrar.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIContentViewer.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIContextMenuListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIContextMenuListener2.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsICookie.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsICookie2.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsICookieManager.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsICookieManager2.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsID.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMAbstractView.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMAttr.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMBarProp.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMCDATASection.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMCharacterData.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMComment.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMDOMImplementation.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMDocument.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMDocumentFragment.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMDocumentType.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMDocumentView.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMElement.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMEntityReference.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMEventGroup.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMEventListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMEventTarget.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMKeyEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMMouseEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMNamedNodeMap.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMNode.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMNodeList.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMProcessingInstruction.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMRange.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMSerializer.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMSerializer_1_7.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMStorage.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMStorageItem.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMText.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMUIEvent.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMWindow.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMWindow2.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMWindowCollection.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDebug.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDirectoryService.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDocShell.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDocShellLoadInfo.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDocShellTreeItem.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDocShellTreeOwner.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDocumentCharsetInfo.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDownload.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDownload_1_8.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIEmbeddingSiteWindow.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIEmbeddingSiteWindow2.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIEnumerator.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIEventQueue.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIEventTarget.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIFactory.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIFile.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIFilePicker.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIFilePicker_1_8.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIFileURL.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIHelperAppLauncher.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIHelperAppLauncherDialog.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIHelperAppLauncherDialog_1_9.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIHelperAppLauncher_1_8.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIHelperAppLauncher_1_9.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIHistoryEntry.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIIOService.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIIOService2.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIInputStream.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIInterfaceRequestor.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIJSContextStack.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsILoadGroup.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsILocalFile.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIMIMEInfo.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIMemory.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIModule.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIObjectInputStream.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIObjectOutputStream.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIObserver.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIObserverService.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIOutputStream.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIPrefBranch.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIPrefBranch2.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIPrefLocalizedString.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIPrefService.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIProgressDialog.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIProgressDialog_1_8.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIPrompt.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIPromptService.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIPromptService2.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIProperties.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIProtocolHandler.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIRequest.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIRequestObserver.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsISHEntry.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsISHistory.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsISHistoryListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsISecureBrowserUI.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsISelection.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsISerializable.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIServiceManager.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsISimpleEnumerator.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIStreamListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIStringEnumerator.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsISupports.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsISupportsArray.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsITooltipListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsITraceRefcnt.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsITransfer.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIURI.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIURIContentListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIURL.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWeakReference.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWebBrowser.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWebBrowserChrome.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWebBrowserChromeFocus.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWebBrowserFocus.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWebNavigation.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWebNavigationInfo.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWebProgress.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWebProgressListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWebProgressListener2.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWindowCreator.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWindowCreator2.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWindowWatcher.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsStringAPI.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/prinrval.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/prio.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/prlink.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/prtime.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/opengl/glx/GLX.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/layout/FillData.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/layout/FillLayout.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/layout/FormAttachment.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/layout/FormData.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/layout/FormLayout.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/layout/GridData.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/layout/GridLayout.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/layout/RowData.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/layout/RowLayout.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/layout/all.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/opengl/GLCanvas.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/opengl/GLData.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/opengl/all.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/printing/PrintDialog.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/printing/Printer.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/printing/PrinterData.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/printing/all.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/program/Program.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/program/all.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/std.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Button.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Canvas.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Caret.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/ColorDialog.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Combo.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Composite.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Control.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/CoolBar.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/CoolItem.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/DateTime.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Decorations.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Dialog.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/DirectoryDialog.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Display.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Event.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/EventTable.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/ExpandBar.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/ExpandItem.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/FileDialog.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/FontDialog.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Group.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/IME.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/ImageList.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Item.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Label.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Layout.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Link.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/List.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Listener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Menu.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/MenuItem.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/MessageBox.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Monitor.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/ProgressBar.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/RunnableLock.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Sash.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Scale.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/ScrollBar.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Scrollable.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Shell.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Slider.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Spinner.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Synchronizer.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/TabFolder.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/TabItem.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Table.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/TableColumn.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/TableItem.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Text.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/ToolBar.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/ToolItem.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/ToolTip.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Tracker.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Tray.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/TrayItem.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Tree.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/TreeColumn.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/TreeItem.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/TypedListener.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Widget.d org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/all.d rakefile
diffstat 570 files changed, 200328 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/java/src/java/lang/Math.d	Fri Mar 20 14:09:41 2009 +0100
+++ b/java/src/java/lang/Math.d	Fri Mar 20 23:03:58 2009 +0100
@@ -18,10 +18,12 @@
     static long   abs(long   a){ return a > 0 ? a : -a; }
 
     static double min(double a, double b){ return a < b ? a : b; }
+    static double min(double a, int    b){ return a < b ? a : b; }
     static float  min(float  a, float  b){ return a < b ? a : b; }
     static float  min(float  a, int    b){ return a < b ? a : b; }
     static float  min(int    a, float  b){ return a < b ? a : b; }
     static int    min(byte   a, byte   b){ return a < b ? a : b; }
+    static int    min(byte   a, int    b){ return a < b ? a : b; }
     static int    min(int    a, int    b){ return a < b ? a : b; }
     static int    min(uint   a, int    b){ return a < b ? a : b; }
     static int    min(int    a, uint   b){ return a < b ? a : b; }
@@ -31,6 +33,7 @@
     static long   min(long   a, int    b){ return a < b ? a : b; }
 
     static double max(double a, double b){ return a > b ? a : b; }
+    static double max(double a, int    b){ return a > b ? a : b; }
     static float  max(float  a, float  b){ return a > b ? a : b; }
     static float  max(float  a, int    b){ return a > b ? a : b; }
     static float  max(int    a, float  b){ return a > b ? a : b; }
--- a/java/src/java/lang/String.d	Fri Mar 20 14:09:41 2009 +0100
+++ b/java/src/java/lang/String.d	Fri Mar 20 23:03:58 2009 +0100
@@ -704,18 +704,18 @@
 }
 
 /++
-+ This is like tango.stdc.stringz.toStringz, but in case of an empty input string,
-    + this function returns a pointer to a null value instead of a null ptr.
-    +/
-    public char* toStringzValidPtr( String src ){
-        if( src ){
-            return src.toStringz();
-        }
-        else{
-            static const char[] nullPtr = "\0";
-            return cast(char*)nullPtr.ptr;
-        }
+ + This is like tango.stdc.stringz.toStringz, but in case of an empty input string,
+ + this function returns a pointer to a null value instead of a null ptr.
+ +/
+public char* toStringzValidPtr( String src ){
+    if( src ){
+        return src.toStringz();
     }
+    else{
+        static const char[] nullPtr = "\0";
+        return cast(char*)nullPtr.ptr;
+    }
+}
 
 version(Tango){
     public alias tango.stdc.stringz.toStringz toStringz;
--- a/java/src/java/lang/StringBuffer.d	Fri Mar 20 14:09:41 2009 +0100
+++ b/java/src/java/lang/StringBuffer.d	Fri Mar 20 23:03:58 2009 +0100
@@ -141,6 +141,9 @@
     }
 
 
+    StringBuffer insert(int offset, int i){
+        return insert( offset, String_valueOf(i) );
+    }
     StringBuffer insert(int offset, String str){
         return replace( offset, offset, str );
     }
--- a/java/src/java/lang/util.d	Fri Mar 20 14:09:41 2009 +0100
+++ b/java/src/java/lang/util.d	Fri Mar 20 23:03:58 2009 +0100
@@ -195,6 +195,16 @@
     return res;
 }
 
+T[] arrayIndexRemove(T)(T[] arr, uint n) {
+    if (n is 0)
+        return arr[1..$];
+    if (n > arr.length)
+        return arr;
+    if (n is arr.length-1)
+        return arr[0..n-1];
+    // else
+    return arr[0..n] ~ arr[n+1..$];
+}
 
 struct ImportData{
     void[] data;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages.properties	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,75 @@
+###############################################################################
+# Copyright (c) 2000, 2006 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
+SWT_Yes=Yes
+SWT_No=No
+SWT_OK=OK
+SWT_Cancel=Cancel
+SWT_Abort=Abort
+SWT_Retry=Retry
+SWT_Ignore=Ignore
+SWT_Sample=Sample
+SWT_A_Sample_Text=A Sample Text
+SWT_Selection=Selection
+SWT_Current_Selection=Current Selection
+SWT_Font=Font
+SWT_Color=Color
+SWT_Extended_style=Extended style
+SWT_Size=Size
+SWT_Style=Style
+SWT_Save=Save
+SWT_Character_set=Character set
+SWT_ColorDialog_Title=Colors
+SWT_FontDialog_Title=Fonts
+SWT_FontSet=Font Set
+SWT_NewFont=New Font
+SWT_Remove=Remove
+SWT_Up=Up
+SWT_Down=Down
+SWT_Selection=Selection
+SWT_Charset_Western=western
+SWT_Charset_EastEuropean=eastern
+SWT_Charset_SouthEuropean=southern
+SWT_Charset_NorthEuropean=northern
+SWT_Charset_Cyrillic=cyrillic
+SWT_Charset_Arabic=arabic
+SWT_Charset_Greek=greek
+SWT_Charset_Hebrew=hebrew
+SWT_Charset_Turkish=turkish
+SWT_Charset_Nordic=nordic
+SWT_Charset_Thai=thai
+SWT_Charset_BalticRim=baltic rim
+SWT_Charset_Celtic=celtic
+SWT_Charset_Euro=euro
+SWT_Charset_Romanian=romanian
+SWT_Charset_SimplifiedChinese=simp. chinese
+SWT_Charset_TraditionalChinese=trad. chinese
+SWT_Charset_Japanese=japanese
+SWT_Charset_Korean=korean
+SWT_Charset_Unicode=unicode
+SWT_Charset_ASCII=ASCII
+SWT_InputMethods=Input Methods
+SWT_Password=Password:
+SWT_Username=User Name:
+SWT_Switch=Switch
+SWT_Press=Press
+SWT_Open=Open
+SWT_Close=Close
+SWT_Minimize=Minimize
+SWT_Maximize=Maximize
+SWT_Restore=Restore
+SWT_ShowList=Show List
+SWT_FileDownload=File Download
+SWT_Download_File=Download: {0}
+SWT_Download_Location=Saving {0} from {1}
+SWT_Download_Started=Downloading...
+SWT_Download_Status=Download: {0,number,integer} KB of {1,number,integer} KB
+SWT_Authentication_Required=Authentication Required
+SWT_Enter_Username_and_Password=Enter user name and password for {0} at {1}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_ar.properties	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,64 @@
+#Thu Jun 22 05:04:05 EDT 2006
+SWT_Yes=\u0646\u0639\u0645
+SWT_No=\u0644\u0627
+SWT_OK=\u062D\u0633\u0646\u0627
+SWT_Cancel=\u0627\u0644\u063A\u0627\u0621
+SWT_Abort=\u0627\u0646\u0647\u0627\u0621
+SWT_Retry=\u0627\u0639\u0627\u062F\u0629 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629
+SWT_Ignore=\u062A\u062C\u0627\u0647\u0644
+SWT_Sample=\u0646\u0645\u0648\u0630\u062C
+SWT_A_Sample_Text=\u0646\u0645\u0648\u0630\u062C \u0644\u0644\u0646\u0635
+SWT_Selection=\u0627\u0644\u0627\u062E\u062A\u064A\u0627\u0631
+SWT_Current_Selection=\u0627\u0644\u0627\u062E\u062A\u064A\u0627\u0631 \u0627\u0644\u062D\u0627\u0644\u064A
+SWT_Font=\u0637\u0627\u0642\u0645 \u0627\u0644\u0637\u0628\u0627\u0639\u0629
+SWT_Color=\u0627\u0644\u0644\u0648\u0646
+SWT_Extended_style=\u0627\u0644\u0646\u0645\u0637 \u0627\u0644\u0645\u0645\u062A\u062F
+SWT_Size=\u062A\u063A\u064A\u064A\u0631 \u062D\u062C\u0645
+SWT_Style=\u0627\u0644\u0646\u0645\u0637
+SWT_Save=\u062D\u0641\u0638
+SWT_Character_set=\u0641\u0626\u0629 \u0627\u0644\u062D\u0631\u0648\u0641
+SWT_ColorDialog_Title=\u0627\u0644\u0623\u0644\u0648\u0627\u0646
+SWT_FontDialog_Title=\u0623\u0637\u0642\u0645 \u0627\u0644\u0637\u0628\u0627\u0639\u0629
+SWT_FontSet=\u0637\u0627\u0642\u0645 \u0627\u0644\u0637\u0628\u0627\u0639\u0629 \u0627\u0644\u0645\u062D\u062F\u062F
+SWT_NewFont=\u0637\u0627\u0642\u0645 \u0627\u0644\u0637\u0628\u0627\u0639\u0629 \u0627\u0644\u062C\u062F\u064A\u062F
+SWT_Remove=\u0627\u0632\u0627\u0644\u0629
+SWT_Up=\u0644\u0623\u0639\u0644\u0649
+SWT_Down=\u0644\u0623\u0633\u0641\u0644
+SWT_Selection=\u0627\u0644\u0627\u062E\u062A\u064A\u0627\u0631
+SWT_Charset_Western=western
+SWT_Charset_EastEuropean=eastern
+SWT_Charset_SouthEuropean=southern
+SWT_Charset_NorthEuropean=northern
+SWT_Charset_Cyrillic=cyrillic
+SWT_Charset_Arabic=arabic
+SWT_Charset_Greek=greek
+SWT_Charset_Hebrew=hebrew
+SWT_Charset_Turkish=turkish
+SWT_Charset_Nordic=nordic
+SWT_Charset_Thai=thai
+SWT_Charset_BalticRim=baltic rim
+SWT_Charset_Celtic=celtic
+SWT_Charset_Euro=euro
+SWT_Charset_Romanian=romanian
+SWT_Charset_SimplifiedChinese=simp. chinese
+SWT_Charset_TraditionalChinese=trad. chinese
+SWT_Charset_Japanese=japanese
+SWT_Charset_Korean=korean
+SWT_Charset_Unicode=unicode
+SWT_Charset_ASCII=ASCII
+SWT_InputMethods=\u0637\u0631\u0642 \u0627\u0644\u0645\u062F\u062E\u0644\u0627\u062A
+SWT_Password=\u0643\u0644\u0645\u0629 \u0627\u0644\u0633\u0631\u064A\u0629\:
+SWT_Username=\u0627\u0633\u0645 \u0627\u0644\u0645\u0633\u062A\u062E\u062F\u0645\:
+SWT_Switch=\u062A\u0628\u062F\u064A\u0644
+SWT_Press=\u0636\u063A\u0637
+SWT_Open=\u0641\u062A\u062D
+SWT_Close=\u0627\u063A\u0644\u0627\u0642
+SWT_Minimize=\u062A\u0635\u063A\u064A\u0631
+SWT_Maximize=\u062A\u0643\u0628\u064A\u0631
+SWT_Restore=\u0627\u0633\u062A\u0639\u0627\u062F\u0629
+SWT_ShowList=\u0639\u0631\u0636 \u0643\u0634\u0641
+SWT_FileDownload=\u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0645\u0644\u0641
+SWT_Download_File=\u062A\u062D\u0645\u064A\u0644\: {0}
+SWT_Download_Location=\u062D\u0641\u0638 {0} \u0645\u0646 {1}
+SWT_Download_Started=\u062A\u062D\u0645\u064A\u0644...
+SWT_Download_Status=\u062A\u062D\u0645\u064A\u0644\: {0,number,integer} KB \u0645\u0646 {1,number,integer} KB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_cs.properties	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,64 @@
+#Thu Jun 22 02:30:38 EDT 2006
+SWT_Yes=Ano
+SWT_No=Ne
+SWT_OK=OK
+SWT_Cancel=Storno
+SWT_Abort=P\u0159ed\u010Dasn\u011B ukon\u010Dit
+SWT_Retry=Zopakovat
+SWT_Ignore=Ignorovat
+SWT_Sample=Uk\u00E1zka
+SWT_A_Sample_Text=Vzorov\u00FD text
+SWT_Selection=V\u00FDb\u011Br
+SWT_Current_Selection=Aktu\u00E1ln\u00ED v\u00FDb\u011Br
+SWT_Font=P\u00EDsmo
+SWT_Color=Barva
+SWT_Extended_style=Roz\u0161\u00ED\u0159en\u00FD styl
+SWT_Size=Velikost
+SWT_Style=Styl
+SWT_Save=Ulo\u017Eit
+SWT_Character_set=Znakov\u00E1 sada
+SWT_ColorDialog_Title=Barvy
+SWT_FontDialog_Title=P\u00EDsma
+SWT_FontSet=Sada p\u00EDsem
+SWT_NewFont=Nov\u00E9 p\u00EDsmo
+SWT_Remove=Odebrat
+SWT_Up=Nahoru
+SWT_Down=Dol\u016F
+SWT_Selection=V\u00FDb\u011Br
+SWT_Charset_Western=z\u00E1padn\u00ED
+SWT_Charset_EastEuropean=v\u00FDchodn\u00ED
+SWT_Charset_SouthEuropean=ji\u017En\u00ED
+SWT_Charset_NorthEuropean=severn\u00ED
+SWT_Charset_Cyrillic=azbuka
+SWT_Charset_Arabic=arab\u0161tina
+SWT_Charset_Greek=\u0159e\u010Dtina
+SWT_Charset_Hebrew=hebrej\u0161tina
+SWT_Charset_Turkish=ture\u010Dtina
+SWT_Charset_Nordic=seversk\u00E9 jazyky
+SWT_Charset_Thai=thaj\u0161tina
+SWT_Charset_BalticRim=pobaltsk\u00E9 jazyky
+SWT_Charset_Celtic=kelt\u0161tina
+SWT_Charset_Euro=euro
+SWT_Charset_Romanian=rumun\u0161tina
+SWT_Charset_SimplifiedChinese=zjedn. \u010D\u00EDn\u0161tina
+SWT_Charset_TraditionalChinese=trad. \u010D\u00EDn\u0161tina
+SWT_Charset_Japanese=japon\u0161tina
+SWT_Charset_Korean=korej\u0161tina
+SWT_Charset_Unicode=unik\u00F3d
+SWT_Charset_ASCII=ASCII
+SWT_InputMethods=Metody vstupu
+SWT_Password=Heslo\:
+SWT_Username=Jm\u00E9no u\u017Eivatele\:
+SWT_Switch=P\u0159epnout
+SWT_Press=Stisknout
+SWT_Open=Otev\u0159\u00EDt
+SWT_Close=Zav\u0159\u00EDt
+SWT_Minimize=Minimalizovat
+SWT_Maximize=Maximalizovat
+SWT_Restore=Obnovit
+SWT_ShowList=Zobrazit seznam
+SWT_FileDownload=Sta\u017Een\u00ED souboru
+SWT_Download_File=St\u00E1hnout\: {0}
+SWT_Download_Location=Ukl\u00E1d\u00E1n\u00ED {0} z {1}
+SWT_Download_Started=Prob\u00EDh\u00E1 stahov\u00E1n\u00ED...
+SWT_Download_Status=Sta\u017Eeno\: {0,number,integer} kB z {1,number,integer} kB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_da.properties	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,64 @@
+#Thu Jun 22 03:45:44 EDT 2006
+SWT_Yes=Ja
+SWT_No=Nej
+SWT_OK=OK
+SWT_Cancel=Annull\u00E9r
+SWT_Abort=Afbryd
+SWT_Retry=Pr\u00F8v igen
+SWT_Ignore=Ignor\u00E9r
+SWT_Sample=Eksempel
+SWT_A_Sample_Text=Eksempeltekst
+SWT_Selection=Valg
+SWT_Current_Selection=Aktuelt valg
+SWT_Font=Font
+SWT_Color=Farve
+SWT_Extended_style=Udvidet typografi
+SWT_Size=St\u00F8rrelse
+SWT_Style=Type
+SWT_Save=Gem
+SWT_Character_set=Tegns\u00E6t
+SWT_ColorDialog_Title=Farver
+SWT_FontDialog_Title=Fonte
+SWT_FontSet=Fonts\u00E6t
+SWT_NewFont=Ny font
+SWT_Remove=Fjern
+SWT_Up=Op
+SWT_Down=Ned
+SWT_Selection=Valg
+SWT_Charset_Western=vestligt
+SWT_Charset_EastEuropean=\u00F8steurop\u00E6isk
+SWT_Charset_SouthEuropean=sydeurop\u00E6isk
+SWT_Charset_NorthEuropean=nordeurop\u00E6isk
+SWT_Charset_Cyrillic=kyrillisk
+SWT_Charset_Arabic=arabisk
+SWT_Charset_Greek=gr\u00E6sk
+SWT_Charset_Hebrew=hebraisk
+SWT_Charset_Turkish=tyrkisk
+SWT_Charset_Nordic=nordisk
+SWT_Charset_Thai=thai
+SWT_Charset_BalticRim=baltisk
+SWT_Charset_Celtic=keltisk
+SWT_Charset_Euro=euro
+SWT_Charset_Romanian=rum\u00E6nsk
+SWT_Charset_SimplifiedChinese=fork. kinesisk
+SWT_Charset_TraditionalChinese=ufork. kinesisk
+SWT_Charset_Japanese=japansk
+SWT_Charset_Korean=koreansk
+SWT_Charset_Unicode=unicode
+SWT_Charset_ASCII=ASCII
+SWT_InputMethods=Inputmetoder
+SWT_Password=Kodeord\:
+SWT_Username=Brugernavn\:
+SWT_Switch=Skift
+SWT_Press=Tryk p\u00E5
+SWT_Open=\u00C5bn
+SWT_Close=Luk
+SWT_Minimize=Minim\u00E9r
+SWT_Maximize=Maksim\u00E9r
+SWT_Restore=Gendan
+SWT_ShowList=Vis liste
+SWT_FileDownload=Filoverf\u00F8rsel
+SWT_Download_File=Overf\u00F8r\: {0}
+SWT_Download_Location=Gemmer {0} fra {1}
+SWT_Download_Started=Overf\u00F8rer...
+SWT_Download_Status=Overf\u00F8r\: {0,number,integer} KB af {1,number,integer} KB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_de.properties	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,64 @@
+#Thu Jun 22 01:01:55 EDT 2006
+SWT_Yes=Ja
+SWT_No=Nein
+SWT_OK=OK
+SWT_Cancel=Abbrechen
+SWT_Abort=Stoppen
+SWT_Retry=Erneut versuchen
+SWT_Ignore=Ignorieren
+SWT_Sample=Beispiel
+SWT_A_Sample_Text=Beispieltext
+SWT_Selection=Auswahl
+SWT_Current_Selection=Aktuelle Auswahl
+SWT_Font=Schriftart
+SWT_Color=Farbe
+SWT_Extended_style=Erweiterte Darstellung
+SWT_Size=Gr\u00F6\u00DFe
+SWT_Style=Darstellung
+SWT_Save=Speichern
+SWT_Character_set=Zeichensatz
+SWT_ColorDialog_Title=Farben
+SWT_FontDialog_Title=Schriftarten
+SWT_FontSet=Schriftartenangebot
+SWT_NewFont=Neue Schriftart
+SWT_Remove=Entfernen
+SWT_Up=Nach oben
+SWT_Down=Nach unten
+SWT_Selection=Auswahl
+SWT_Charset_Western=Westlich
+SWT_Charset_EastEuropean=\u00D6stlich
+SWT_Charset_SouthEuropean=S\u00FCdlich
+SWT_Charset_NorthEuropean=Nordisch
+SWT_Charset_Cyrillic=Kyrillisch
+SWT_Charset_Arabic=Arabisch
+SWT_Charset_Greek=Griechisch
+SWT_Charset_Hebrew=Hebr\u00E4isch
+SWT_Charset_Turkish=T\u00FCrkisch
+SWT_Charset_Nordic=Nordisch
+SWT_Charset_Thai=Thai
+SWT_Charset_BalticRim=Baltisch
+SWT_Charset_Celtic=Keltisch
+SWT_Charset_Euro=Euro
+SWT_Charset_Romanian=Rum\u00E4nisch
+SWT_Charset_SimplifiedChinese=Vereinfachtes Chinesisch
+SWT_Charset_TraditionalChinese=Traditionelles Chinesisch
+SWT_Charset_Japanese=Japanisch
+SWT_Charset_Korean=Koreanisch
+SWT_Charset_Unicode=Unicode
+SWT_Charset_ASCII=ASCII
+SWT_InputMethods=Eingabemethoden
+SWT_Password=Kennwort\:
+SWT_Username=Benutzername\:
+SWT_Switch=Umschalten
+SWT_Press=Dr\u00FCcken
+SWT_Open=\u00D6ffnen
+SWT_Close=Schlie\u00DFen
+SWT_Minimize=Minimieren
+SWT_Maximize=Maximieren
+SWT_Restore=Wiederherstellen
+SWT_ShowList=Liste anzeigen
+SWT_FileDownload=Datei herunterladen
+SWT_Download_File=Herunterladen\: {0}
+SWT_Download_Location=Speichern von {0} von {1}
+SWT_Download_Started=Herunterladen...
+SWT_Download_Status=Herunterladen\: {0,number,integer} KB von {1,number,integer} KB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_el.properties	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,64 @@
+#Thu Jun 22 03:45:44 EDT 2006
+SWT_Yes=\u039D\u03B1\u03B9
+SWT_No=\u038C\u03C7\u03B9
+SWT_OK=OK
+SWT_Cancel=\u0391\u03BA\u03CD\u03C1\u03C9\u03C3\u03B7
+SWT_Abort=\u039C\u03B1\u03C4\u03B1\u03AF\u03C9\u03C3\u03B7
+SWT_Retry=\u0395\u03C0\u03B1\u03BD\u03AC\u03BB\u03B7\u03C8\u03B7
+SWT_Ignore=\u03A0\u03B1\u03C1\u03AC\u03B2\u03BB\u03B5\u03C8\u03B7
+SWT_Sample=\u0394\u03B5\u03AF\u03B3\u03BC\u03B1
+SWT_A_Sample_Text=\u0394\u03B5\u03AF\u03B3\u03BC\u03B1 \u03BA\u03B5\u03B9\u03BC\u03AD\u03BD\u03BF\u03C5
+SWT_Selection=\u0395\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE
+SWT_Current_Selection=\u03A4\u03C1\u03AD\u03C7\u03BF\u03C5\u03C3\u03B1 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE
+SWT_Font=\u0393\u03C1\u03B1\u03BC\u03BC\u03B1\u03C4\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC
+SWT_Color=\u03A7\u03C1\u03CE\u03BC\u03B1
+SWT_Extended_style=\u0395\u03BA\u03C4\u03B5\u03C4\u03B1\u03BC\u03AD\u03BD\u03BF \u03C3\u03C4\u03C5\u03BB
+SWT_Size=\u039C\u03AD\u03B3\u03B5\u03B8\u03BF\u03C2
+SWT_Style=\u03A3\u03C4\u03C5\u03BB
+SWT_Save=\u0391\u03C0\u03BF\u03B8\u03AE\u03BA\u03B5\u03C5\u03C3\u03B7
+SWT_Character_set=\u03A3\u03CD\u03BD\u03BF\u03BB\u03BF \u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03C9\u03BD
+SWT_ColorDialog_Title=\u03A7\u03C1\u03CE\u03BC\u03B1\u03C4\u03B1
+SWT_FontDialog_Title=\u0393\u03C1\u03B1\u03BC\u03BC\u03B1\u03C4\u03BF\u03C3\u03B5\u03B9\u03C1\u03AD\u03C2
+SWT_FontSet=\u039F\u03C1\u03B9\u03C3\u03BC\u03CC\u03C2 \u03B3\u03C1\u03B1\u03BC\u03BC\u03B1\u03C4\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC\u03C2
+SWT_NewFont=\u039D\u03AD\u03B1 \u03B3\u03C1\u03B1\u03BC\u03BC\u03B1\u03C4\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC
+SWT_Remove=\u0391\u03C6\u03B1\u03AF\u03C1\u03B5\u03C3\u03B7
+SWT_Up=\u03A0\u03AC\u03BD\u03C9
+SWT_Down=\u039A\u03AC\u03C4\u03C9
+SWT_Selection=\u0395\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE
+SWT_Charset_Western=\u03B4\u03C5\u03C4\u03B9\u03BA\u03CC
+SWT_Charset_EastEuropean=\u03B1\u03BD\u03B1\u03C4\u03BF\u03BB\u03B9\u03BA\u03CC
+SWT_Charset_SouthEuropean=\u03BD\u03CC\u03C4\u03B9\u03BF
+SWT_Charset_NorthEuropean=\u03B2\u03CC\u03C1\u03B5\u03B9\u03BF
+SWT_Charset_Cyrillic=\u03BA\u03C5\u03C1\u03B9\u03BB\u03BB\u03B9\u03BA\u03CC
+SWT_Charset_Arabic=\u03B1\u03C1\u03B1\u03B2\u03B9\u03BA\u03CC
+SWT_Charset_Greek=\u03B5\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03CC
+SWT_Charset_Hebrew=\u03B5\u03B2\u03C1\u03B1\u03CA\u03BA\u03CC
+SWT_Charset_Turkish=\u03C4\u03BF\u03CD\u03C1\u03BA\u03B9\u03BA\u03BF
+SWT_Charset_Nordic=\u03BD\u03BF\u03C1\u03B4\u03B9\u03BA\u03CC
+SWT_Charset_Thai=\u03C4\u03B1\u03CA\u03BB\u03B1\u03BD\u03B4\u03B9\u03BA\u03CC
+SWT_Charset_BalticRim=\u03B1\u03BA\u03C4\u03AE \u03C4\u03B7\u03C2 \u03B2\u03B1\u03BB\u03C4\u03B9\u03BA\u03AE\u03C2
+SWT_Charset_Celtic=\u03BA\u03B5\u03BB\u03C4\u03B9\u03BA\u03CC
+SWT_Charset_Euro=\u03B5\u03C5\u03C1\u03C9\u03C0\u03B1\u03CA\u03BA\u03CC
+SWT_Charset_Romanian=\u03C1\u03BF\u03C5\u03BC\u03AC\u03BD\u03B9\u03BA\u03BF
+SWT_Charset_SimplifiedChinese=\u03B1\u03C0\u03BB\u03BF\u03C0. \u03BA\u03B9\u03BD\u03B5\u03B6\u03B9\u03BA\u03CC
+SWT_Charset_TraditionalChinese=\u03C0\u03B1\u03C1\u03B1\u03B4\u03BF\u03C3. \u03BA\u03B9\u03BD\u03B5\u03B6\u03B9\u03BA\u03CC
+SWT_Charset_Japanese=\u03B9\u03B1\u03C0\u03C9\u03BD\u03B9\u03BA\u03CC
+SWT_Charset_Korean=\u03BA\u03BF\u03C1\u03B5\u03B1\u03C4\u03B9\u03BA\u03CC
+SWT_Charset_Unicode=unicode
+SWT_Charset_ASCII=ASCII
+SWT_InputMethods=\u039C\u03AD\u03B8\u03BF\u03B4\u03BF\u03B9 \u03B5\u03B9\u03C3\u03B1\u03B3\u03C9\u03B3\u03AE\u03C2
+SWT_Password=\u039A\u03C9\u03B4\u03B9\u03BA\u03CC\u03C2 \u03C0\u03C1\u03CC\u03C3\u03B2\u03B1\u03C3\u03B7\u03C2 \:
+SWT_Username=\u038C\u03BD\u03BF\u03BC\u03B1 \u03C7\u03C1\u03AE\u03C3\u03C4\u03B7\:
+SWT_Switch=\u0391\u03BB\u03BB\u03B1\u03B3\u03AE
+SWT_Press=\u03A0\u03AC\u03C4\u03B7\u03BC\u03B1
+SWT_Open=\u0386\u03BD\u03BF\u03B9\u03B3\u03BC\u03B1
+SWT_Close=\u039A\u03BB\u03B5\u03AF\u03C3\u03B9\u03BC\u03BF
+SWT_Minimize=\u0395\u03BB\u03B1\u03C7\u03B9\u03C3\u03C4\u03BF\u03C0\u03BF\u03AF\u03B7\u03C3\u03B7
+SWT_Maximize=\u039C\u03B5\u03B3\u03B9\u03C3\u03C4\u03BF\u03C0\u03BF\u03AF\u03B7\u03C3\u03B7
+SWT_Restore=\u0395\u03C0\u03B1\u03BD\u03B1\u03C6\u03BF\u03C1\u03AC
+SWT_ShowList=\u0395\u03BC\u03C6\u03AC\u03BD\u03B9\u03C3\u03B7 \u03BB\u03AF\u03C3\u03C4\u03B1\u03C2
+SWT_FileDownload=\u039C\u03B5\u03C4\u03B1\u03C6\u03CC\u03C1\u03C4\u03C9\u03C3\u03B7 \u03B1\u03C1\u03C7\u03B5\u03AF\u03BF\u03C5
+SWT_Download_File=\u039C\u03B5\u03C4\u03B1\u03C6\u03CC\u03C1\u03C4\u03C9\u03C3\u03B7\: {0}
+SWT_Download_Location=\u0391\u03C0\u03BF\u03B8\u03AE\u03BA\u03B5\u03C5\u03C3\u03B7 {0} \u03B1\u03C0\u03CC {1}
+SWT_Download_Started=\u039C\u03B5\u03C4\u03B1\u03C6\u03CC\u03C1\u03C4\u03C9\u03C3\u03B7...
+SWT_Download_Status=\u039C\u03B5\u03C4\u03B1\u03C6\u03CC\u03C1\u03C4\u03C9\u03C3\u03B7\: {0,number,integer} KB \u03B1\u03C0\u03CC {1,number,integer} KB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_es.properties	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,64 @@
+#Thu Jun 22 01:01:55 EDT 2006
+SWT_Yes=S\u00ED
+SWT_No=No
+SWT_OK=Aceptar
+SWT_Cancel=Cancelar
+SWT_Abort=Terminar anormalmente
+SWT_Retry=Reintentar
+SWT_Ignore=Omitir
+SWT_Sample=Ejemplo
+SWT_A_Sample_Text=Ejemplo de texto
+SWT_Selection=Selecci\u00F3n
+SWT_Current_Selection=Selecci\u00F3n actual
+SWT_Font=Font
+SWT_Color=Color
+SWT_Extended_style=Estilo ampliado
+SWT_Size=Tama\u00F1o
+SWT_Style=Estilo
+SWT_Save=Guardar
+SWT_Character_set=Juego de caracteres
+SWT_ColorDialog_Title=Colores
+SWT_FontDialog_Title=Fonts
+SWT_FontSet=Conjunto de fonts
+SWT_NewFont=Font nuevo
+SWT_Remove=Eliminar
+SWT_Up=Subir
+SWT_Down=Bajar
+SWT_Selection=Selecci\u00F3n
+SWT_Charset_Western=occidental
+SWT_Charset_EastEuropean=oriental
+SWT_Charset_SouthEuropean=meridional
+SWT_Charset_NorthEuropean=septentrional
+SWT_Charset_Cyrillic=cir\u00EDlico
+SWT_Charset_Arabic=\u00E1rabe
+SWT_Charset_Greek=griego
+SWT_Charset_Hebrew=hebreo
+SWT_Charset_Turkish=turco
+SWT_Charset_Nordic=n\u00F3rdico
+SWT_Charset_Thai=tailand\u00E9s
+SWT_Charset_BalticRim=pa\u00EDses b\u00E1lticos
+SWT_Charset_Celtic=celta
+SWT_Charset_Euro=euro
+SWT_Charset_Romanian=rumano
+SWT_Charset_SimplifiedChinese=chino simplificado
+SWT_Charset_TraditionalChinese=chino tradicional
+SWT_Charset_Japanese=japon\u00E9s
+SWT_Charset_Korean=coreano
+SWT_Charset_Unicode=unicode
+SWT_Charset_ASCII=ASCII
+SWT_InputMethods=M\u00E9todos de entrada
+SWT_Password=Contrase\u00F1a\:
+SWT_Username=Nombre de usuario\:
+SWT_Switch=Pasar
+SWT_Press=Pulsar
+SWT_Open=Abrir
+SWT_Close=Cerrar
+SWT_Minimize=Minimizar
+SWT_Maximize=Maximizar
+SWT_Restore=Restaurar
+SWT_ShowList=Mostrar lista
+SWT_FileDownload=Descarga de archivos
+SWT_Download_File=Descargar\: {0}
+SWT_Download_Location=Guardando {0} de {1}
+SWT_Download_Started=Descargando...
+SWT_Download_Status=Descargar\: {0,number,integer} KB de {1,number,integer} KB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_fi.properties	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,64 @@
+#Thu Jun 22 03:45:44 EDT 2006
+SWT_Yes=Kyll\u00E4
+SWT_No=Ei
+SWT_OK=OK
+SWT_Cancel=Peruuta
+SWT_Abort=Keskeyt\u00E4
+SWT_Retry=Yrit\u00E4 uudelleen
+SWT_Ignore=Ohita
+SWT_Sample=Malli
+SWT_A_Sample_Text=Malliteksti
+SWT_Selection=Valinta
+SWT_Current_Selection=Nykyinen valinta
+SWT_Font=Fontti
+SWT_Color=V\u00E4ri
+SWT_Extended_style=Laajennettu tyyli
+SWT_Size=Koko
+SWT_Style=Tyyli
+SWT_Save=Tallenna
+SWT_Character_set=Merkist\u00F6
+SWT_ColorDialog_Title=V\u00E4rit
+SWT_FontDialog_Title=Fontit
+SWT_FontSet=Fontisto
+SWT_NewFont=Uusi fontti
+SWT_Remove=Poista
+SWT_Up=Yl\u00F6s
+SWT_Down=Alas
+SWT_Selection=Valinta
+SWT_Charset_Western=l\u00E4nsieurooppalainen
+SWT_Charset_EastEuropean=it\u00E4eurooppalainen
+SWT_Charset_SouthEuropean=etel\u00E4eurooppalainen
+SWT_Charset_NorthEuropean=pohjoiseurooppalainen
+SWT_Charset_Cyrillic=kyrillinen
+SWT_Charset_Arabic=arabialainen
+SWT_Charset_Greek=kreikkalainen
+SWT_Charset_Hebrew=heprealainen
+SWT_Charset_Turkish=turkkilainen
+SWT_Charset_Nordic=pohjoismaalainen
+SWT_Charset_Thai=thaimaalainen
+SWT_Charset_BalticRim=balttilainen
+SWT_Charset_Celtic=kelttil\u00E4inen
+SWT_Charset_Euro=eurooppalainen
+SWT_Charset_Romanian=romanialainen
+SWT_Charset_SimplifiedChinese=yksinkertaistettu kiinalainen
+SWT_Charset_TraditionalChinese=perinteinen kiinalainen
+SWT_Charset_Japanese=japanilainen
+SWT_Charset_Korean=korealainen
+SWT_Charset_Unicode=unicode
+SWT_Charset_ASCII=ASCII
+SWT_InputMethods=Sy\u00F6tt\u00F6metodit
+SWT_Password=Salasana\:
+SWT_Username=K\u00E4ytt\u00E4j\u00E4tunnus\:
+SWT_Switch=Vaihda
+SWT_Press=Paina
+SWT_Open=Avaa
+SWT_Close=Sulje
+SWT_Minimize=Pienenn\u00E4
+SWT_Maximize=Suurenna
+SWT_Restore=Palauta
+SWT_ShowList=N\u00E4yt\u00E4 luettelo
+SWT_FileDownload=Tiedoston lataus
+SWT_Download_File=Ladataan kohdetta\: {0}
+SWT_Download_Location=Tallennetaan kohdetta {0} kohteesta {1}
+SWT_Download_Started=Lataus on meneill\u00E4\u00E4n...
+SWT_Download_Status=Lataus\: {0,number,integer} kt / {1,number,integer} kt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_fr.properties	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,64 @@
+#Thu Jun 22 01:01:55 EDT 2006
+SWT_Yes=Oui
+SWT_No=Non
+SWT_OK=OK
+SWT_Cancel=Annuler
+SWT_Abort=Abandonner
+SWT_Retry=Recommencer
+SWT_Ignore=Ignorer
+SWT_Sample=Exemple
+SWT_A_Sample_Text=Exemple de texte
+SWT_Selection=S\u00E9lection
+SWT_Current_Selection=S\u00E9lection actuelle
+SWT_Font=Font
+SWT_Color=Couleur
+SWT_Extended_style=Style \u00E9tendu
+SWT_Size=Taille
+SWT_Style=Style
+SWT_Save=Enregistrer
+SWT_Character_set=Jeu de caract\u00E8res
+SWT_ColorDialog_Title=Couleurs
+SWT_FontDialog_Title=Polices
+SWT_FontSet=Ensemble de polices
+SWT_NewFont=Nouvelle police
+SWT_Remove=Supprimer
+SWT_Up=Monter
+SWT_Down=Descendre
+SWT_Selection=S\u00E9lection
+SWT_Charset_Western=western
+SWT_Charset_EastEuropean=eastern
+SWT_Charset_SouthEuropean=southern
+SWT_Charset_NorthEuropean=northern
+SWT_Charset_Cyrillic=cyrillique
+SWT_Charset_Arabic=arabe
+SWT_Charset_Greek=grec
+SWT_Charset_Hebrew=h\u00E9breu
+SWT_Charset_Turkish=turc
+SWT_Charset_Nordic=nordique
+SWT_Charset_Thai=tha\u00EF
+SWT_Charset_BalticRim=baltique rim
+SWT_Charset_Celtic=celtique
+SWT_Charset_Euro=euro
+SWT_Charset_Romanian=roumain
+SWT_Charset_SimplifiedChinese=chinois simp.
+SWT_Charset_TraditionalChinese=chinois trad.
+SWT_Charset_Japanese=japonais
+SWT_Charset_Korean=cor\u00E9en
+SWT_Charset_Unicode=unicode
+SWT_Charset_ASCII=ASCII
+SWT_InputMethods=M\u00E9thodes d'entr\u00E9e
+SWT_Password=Mot de passe \:
+SWT_Username=Nom d'utilisateur \:
+SWT_Switch=Basculer
+SWT_Press=Appuyer
+SWT_Open=Ouverture
+SWT_Close=Fermer
+SWT_Minimize=R\u00E9duire
+SWT_Maximize=Agrandir
+SWT_Restore=Restaurer
+SWT_ShowList=Afficher la liste
+SWT_FileDownload=T\u00E9l\u00E9chargement de fichier
+SWT_Download_File=T\u00E9l\u00E9chargement \: {0}
+SWT_Download_Location=Sauvegarde de {0} \u00E0 partir de {1}
+SWT_Download_Started=T\u00E9l\u00E9chargement en cours...
+SWT_Download_Status=T\u00E9l\u00E9chargement \: {0,number,integer} ko sur {1,number,integer} ko
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_hu.properties	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,64 @@
+#Thu Jun 22 02:30:38 EDT 2006
+SWT_Yes=Igen
+SWT_No=Nem
+SWT_OK=OK
+SWT_Cancel=M\u00E9gse
+SWT_Abort=Megszak\u00EDt\u00E1s
+SWT_Retry=\u00DAjra
+SWT_Ignore=Mell\u0151z\u00E9s
+SWT_Sample=Minta
+SWT_A_Sample_Text=Mintasz\u00F6veg
+SWT_Selection=Kijel\u00F6l\u00E9s
+SWT_Current_Selection=Jelenlegi kijel\u00F6l\u00E9s
+SWT_Font=Bet\u0171t\u00EDpus
+SWT_Color=Sz\u00EDn
+SWT_Extended_style=Kiterjesztett st\u00EDlus
+SWT_Size=M\u00E9ret
+SWT_Style=St\u00EDlus
+SWT_Save=Ment\u00E9s
+SWT_Character_set=Karakterk\u00E9szlet
+SWT_ColorDialog_Title=Sz\u00EDnek
+SWT_FontDialog_Title=Bet\u0171t\u00EDpusok
+SWT_FontSet=Bet\u0171k\u00E9szlet
+SWT_NewFont=\u00DAj bet\u0171t\u00EDpus
+SWT_Remove=Elt\u00E1vol\u00EDt\u00E1s
+SWT_Up=Fel
+SWT_Down=Le
+SWT_Selection=Kijel\u00F6l\u00E9s
+SWT_Charset_Western=nyugati
+SWT_Charset_EastEuropean=keleti
+SWT_Charset_SouthEuropean=d\u00E9li
+SWT_Charset_NorthEuropean=\u00E9szaki
+SWT_Charset_Cyrillic=cirill
+SWT_Charset_Arabic=arab
+SWT_Charset_Greek=g\u00F6r\u00F6g
+SWT_Charset_Hebrew=h\u00E9ber
+SWT_Charset_Turkish=t\u00F6r\u00F6k
+SWT_Charset_Nordic=skandin\u00E1v
+SWT_Charset_Thai=thai
+SWT_Charset_BalticRim=balti
+SWT_Charset_Celtic=kelta
+SWT_Charset_Euro=eur\u00F3
+SWT_Charset_Romanian=rom\u00E1n
+SWT_Charset_SimplifiedChinese=egysz. k\u00EDnai
+SWT_Charset_TraditionalChinese=hagy. k\u00EDnai
+SWT_Charset_Japanese=jap\u00E1n
+SWT_Charset_Korean=koreai
+SWT_Charset_Unicode=unicode
+SWT_Charset_ASCII=ASCII
+SWT_InputMethods=Beviteli m\u00F3dszerek
+SWT_Password=Jelsz\u00F3\:
+SWT_Username=Felhaszn\u00E1l\u00F3n\u00E9v\:
+SWT_Switch=\u00C1tkapcsol\u00E1s
+SWT_Press=Megnyom\u00E1s
+SWT_Open=Megnyit\u00E1s
+SWT_Close=Bez\u00E1r\u00E1s
+SWT_Minimize=Kis m\u00E9ret
+SWT_Maximize=Teljes m\u00E9ret
+SWT_Restore=Vissza\u00E1ll\u00EDt\u00E1s
+SWT_ShowList=Lista megjelen\u00EDt\u00E9se
+SWT_FileDownload=F\u00E1jllet\u00F6lt\u00E9s
+SWT_Download_File=Let\u00F6lt\u00E9s\: {0}
+SWT_Download_Location={0} ment\u00E9se a k\u00F6vetkez\u0151 helyr\u0151l\: {1}
+SWT_Download_Started=Let\u00F6lt\u00E9s...
+SWT_Download_Status=Let\u00F6lt\u00E9s\: {0,number,integer} / {1,number,integer} KByte
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_it.properties	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,64 @@
+#Thu Jun 22 01:01:55 EDT 2006
+SWT_Yes=S\u00EC
+SWT_No=No
+SWT_OK=OK
+SWT_Cancel=Annulla
+SWT_Abort=Interrompi
+SWT_Retry=Riprova
+SWT_Ignore=Ignora
+SWT_Sample=Esempio
+SWT_A_Sample_Text=Testo di esempio
+SWT_Selection=Selezione
+SWT_Current_Selection=Selezione corrente
+SWT_Font=Tipo di carattere
+SWT_Color=Colore
+SWT_Extended_style=Stile esteso
+SWT_Size=Dimensione
+SWT_Style=Stile
+SWT_Save=Salva
+SWT_Character_set=Insieme di caratteri
+SWT_ColorDialog_Title=Colori
+SWT_FontDialog_Title=Tipi di carattere
+SWT_FontSet=Insieme di tipi di carattere
+SWT_NewFont=Nuovo tipo di carattere
+SWT_Remove=Rimuovi
+SWT_Up=Su
+SWT_Down=Gi\u00F9
+SWT_Selection=Selezione
+SWT_Charset_Western=occidentali
+SWT_Charset_EastEuropean=orientali
+SWT_Charset_SouthEuropean=area del Mediterraneo
+SWT_Charset_NorthEuropean=area settentrionale
+SWT_Charset_Cyrillic=cirillici
+SWT_Charset_Arabic=arabi
+SWT_Charset_Greek=greci
+SWT_Charset_Hebrew=ebraici
+SWT_Charset_Turkish=turchi
+SWT_Charset_Nordic=nordici
+SWT_Charset_Thai=thai
+SWT_Charset_BalticRim=del Baltico
+SWT_Charset_Celtic=celtici
+SWT_Charset_Euro=europei
+SWT_Charset_Romanian=rumeni
+SWT_Charset_SimplifiedChinese=cinesi sempl.
+SWT_Charset_TraditionalChinese=cinesi trad.
+SWT_Charset_Japanese=giapponesi
+SWT_Charset_Korean=coreani
+SWT_Charset_Unicode=unicode
+SWT_Charset_ASCII=ASCII
+SWT_InputMethods=Metodi di input
+SWT_Password=Password\:
+SWT_Username=Nome utente\:
+SWT_Switch=Passa a
+SWT_Press=Premi
+SWT_Open=Apri
+SWT_Close=Chiudi
+SWT_Minimize=Riduci a icona
+SWT_Maximize=Ingrandisci
+SWT_Restore=Ripristina
+SWT_ShowList=Mostra elenco
+SWT_FileDownload=Download file
+SWT_Download_File=Download\: {0}
+SWT_Download_Location=Salvataggio di {0} da {1}
+SWT_Download_Started=Download in corso...
+SWT_Download_Status=Download\: {0,number,integer} KB di {1,number,integer} KB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_iw.properties	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,64 @@
+#Thu Jun 22 05:04:05 EDT 2006
+SWT_Yes=\u05DB\u05DF
+SWT_No=\u05DC\u05D0
+SWT_OK=\u05D0\u05D9\u05E9\u05D5\u05E8
+SWT_Cancel=\u05D1\u05D9\u05D8\u05D5\u05DC
+SWT_Abort=\u05E0\u05D8\u05D9\u05E9\u05D4
+SWT_Retry=\u05E0\u05E1\u05D9\u05D5\u05DF \u05D7\u05D5\u05D6\u05E8
+SWT_Ignore=\u05D4\u05EA\u05E2\u05DC\u05DE\u05D5\u05EA
+SWT_Sample=\u05D3\u05D5\u05D2\u05DE\u05D4
+SWT_A_Sample_Text=\u05EA\u05DE\u05DC\u05D9\u05DC \u05DC\u05D3\u05D5\u05D2\u05DE\u05D4
+SWT_Selection=\u05D1\u05D7\u05D9\u05E8\u05D4
+SWT_Current_Selection=\u05D1\u05D7\u05D9\u05E8\u05D4 \u05E0\u05D5\u05DB\u05D7\u05D9\u05EA
+SWT_Font=\u05D2\u05D5\u05E4\u05DF
+SWT_Color=\u05E6\u05D1\u05E2
+SWT_Extended_style=\u05E1\u05D2\u05E0\u05D5\u05DF \u05DE\u05D5\u05E8\u05D7\u05D1
+SWT_Size=\u05D2\u05D5\u05D3\u05DC
+SWT_Style=\u05E1\u05D2\u05E0\u05D5\u05DF
+SWT_Save=\u05E9\u05DE\u05D9\u05E8\u05D4
+SWT_Character_set=\u05DE\u05E2\u05E8\u05DB\u05EA \u05EA\u05D5\u05D5\u05D9\u05DD
+SWT_ColorDialog_Title=\u05E6\u05D1\u05E2\u05D9\u05DD
+SWT_FontDialog_Title=\u05D2\u05D5\u05E4\u05E0\u05D9\u05DD
+SWT_FontSet=\u05E7\u05D1\u05D5\u05E6\u05EA \u05D2\u05D5\u05E4\u05E0\u05D9\u05DD
+SWT_NewFont=\u05D2\u05D5\u05E4\u05DF \u05D7\u05D3\u05E9
+SWT_Remove=\u05E1\u05D9\u05DC\u05D5\u05E7
+SWT_Up=\u05DC\u05DE\u05E2\u05DC\u05D4
+SWT_Down=\u05DC\u05DE\u05D8\u05D4
+SWT_Selection=\u05D1\u05D7\u05D9\u05E8\u05D4
+SWT_Charset_Western=\u05DE\u05E2\u05E8\u05D1\u05D9
+SWT_Charset_EastEuropean=\u05DE\u05D6\u05E8\u05D7\u05D9
+SWT_Charset_SouthEuropean=\u05D3\u05E8\u05D5\u05DE\u05D9
+SWT_Charset_NorthEuropean=\u05E6\u05E4\u05D5\u05E0\u05D9
+SWT_Charset_Cyrillic=\u05E7\u05D9\u05E8\u05D9\u05DC\u05D9\u05EA
+SWT_Charset_Arabic=\u05E2\u05E8\u05D1\u05D9\u05EA
+SWT_Charset_Greek=\u05D9\u05D5\u05D5\u05E0\u05D9\u05EA
+SWT_Charset_Hebrew=\u05E2\u05D1\u05E8\u05D9\u05EA
+SWT_Charset_Turkish=\u05D8\u05D5\u05E8\u05E7\u05D9\u05EA
+SWT_Charset_Nordic=\u05E9\u05E4\u05D5\u05EA \u05E0\u05D5\u05E8\u05D3\u05D9\u05D5\u05EA
+SWT_Charset_Thai=\u05EA\u05D0\u05D9\u05DC\u05E0\u05D3\u05D9\u05EA
+SWT_Charset_BalticRim=\u05D4\u05D0\u05E8\u05E6\u05D5\u05EA \u05D4\u05D1\u05DC\u05D8\u05D9\u05D5\u05EA
+SWT_Charset_Celtic=\u05E7\u05DC\u05D8\u05D9\u05EA
+SWT_Charset_Euro=\u05D0\u05D9\u05E8\u05D5
+SWT_Charset_Romanian=\u05E8\u05D5\u05DE\u05E0\u05D9\u05EA
+SWT_Charset_SimplifiedChinese=\u05E1\u05D9\u05E0\u05D9\u05EA \u05E4\u05E9\u05D5\u05D8\u05D4
+SWT_Charset_TraditionalChinese=\u05E1\u05D9\u05E0\u05D9\u05EA \u05DE\u05E1\u05D5\u05E8\u05EA\u05D9\u05EA
+SWT_Charset_Japanese=\u05D9\u05E4\u05E0\u05D9\u05EA
+SWT_Charset_Korean=\u05E7\u05D5\u05E8\u05D9\u05D0\u05E0\u05D9\u05EA
+SWT_Charset_Unicode=unicode
+SWT_Charset_ASCII=ASCII
+SWT_InputMethods=\u05E9\u05D9\u05D8\u05D5\u05EA \u05E7\u05DC\u05D8
+SWT_Password=\u05E1\u05D9\u05E1\u05DE\u05D4\:
+SWT_Username=\u05E9\u05DD \u05DE\u05E9\u05EA\u05DE\u05E9\:
+SWT_Switch=\u05D4\u05D7\u05DC\u05E4\u05D4
+SWT_Press=\u05DC\u05D7\u05D9\u05E6\u05D4
+SWT_Open=\u05E4\u05EA\u05D9\u05D7\u05D4
+SWT_Close=\u05E1\u05D2\u05D9\u05E8\u05D4
+SWT_Minimize=\u05DE\u05D6\u05E2\u05D5\u05E8
+SWT_Maximize=\u05D4\u05D2\u05D3\u05DC\u05D4
+SWT_Restore=\u05E9\u05D7\u05D6\u05D5\u05E8
+SWT_ShowList=\u05D4\u05E6\u05D2\u05EA \u05E8\u05E9\u05D9\u05DE\u05D4
+SWT_FileDownload=\u05D4\u05D5\u05E8\u05D3\u05EA \u05E7\u05D5\u05D1\u05E5
+SWT_Download_File=\u05D4\u05D5\u05E8\u05D3\u05D4\:\u200F {0}
+SWT_Download_Location={0} \u05DE\u05DE\u05D9\u05E7\u05D5\u05DD {1} \u05E0\u05E9\u05DE\u05E8 \u05DB\u05E2\u05EA
+SWT_Download_Started=\u05D4\u05D5\u05E8\u05D3\u05D4 \u05DE\u05EA\u05D1\u05E6\u05E2\u05EA...\u200F
+SWT_Download_Status=\u05D4\u05D5\u05E8\u05D3\u05D4\: {0,number,integer} \u05E7"\u05D1 \u05DE\u05EA\u05D5\u05DA {1,number,integer} \u05E7"\u05D1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_ja.properties	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,64 @@
+#Thu Jun 22 01:01:55 EDT 2006
+SWT_Yes=\u306F\u3044
+SWT_No=\u3044\u3044\u3048
+SWT_OK=OK
+SWT_Cancel=\u30AD\u30E3\u30F3\u30BB\u30EB
+SWT_Abort=\u4E2D\u65AD
+SWT_Retry=\u518D\u8A66\u884C
+SWT_Ignore=\u7121\u8996
+SWT_Sample=\u30B5\u30F3\u30D7\u30EB
+SWT_A_Sample_Text=\u30B5\u30F3\u30D7\u30EB\u30FB\u30C6\u30AD\u30B9\u30C8
+SWT_Selection=\u9078\u629E
+SWT_Current_Selection=\u73FE\u5728\u306E\u9078\u629E\u9805\u76EE
+SWT_Font=\u30D5\u30A9\u30F3\u30C8
+SWT_Color=\u8272
+SWT_Extended_style=\u62E1\u5F35\u30B9\u30BF\u30A4\u30EB
+SWT_Size=\u30B5\u30A4\u30BA
+SWT_Style=\u30B9\u30BF\u30A4\u30EB
+SWT_Save=\u4FDD\u7BA1
+SWT_Character_set=\u6587\u5B57\u30BB\u30C3\u30C8
+SWT_ColorDialog_Title=\u8272
+SWT_FontDialog_Title=\u30D5\u30A9\u30F3\u30C8
+SWT_FontSet=\u30D5\u30A9\u30F3\u30C8\u30FB\u30BB\u30C3\u30C8
+SWT_NewFont=\u65B0\u898F\u30D5\u30A9\u30F3\u30C8
+SWT_Remove=\u9664\u53BB
+SWT_Up=\u4E0A\u3078
+SWT_Down=\u4E0B\u3078
+SWT_Selection=\u9078\u629E
+SWT_Charset_Western=\u897F\u30E8\u30FC\u30ED\u30C3\u30D1\u8A00\u8A9E
+SWT_Charset_EastEuropean=\u6771\u30E8\u30FC\u30ED\u30C3\u30D1\u8A00\u8A9E
+SWT_Charset_SouthEuropean=\u5357\u30E8\u30FC\u30ED\u30C3\u30D1\u8A00\u8A9E
+SWT_Charset_NorthEuropean=\u5317\u30E8\u30FC\u30ED\u30C3\u30D1\u8A00\u8A9E
+SWT_Charset_Cyrillic=\u30AD\u30EA\u30EB\u6587\u5B57
+SWT_Charset_Arabic=\u30A2\u30E9\u30D3\u30A2\u8A9E
+SWT_Charset_Greek=\u30AE\u30EA\u30B7\u30E3\u8A9E
+SWT_Charset_Hebrew=\u30D8\u30D6\u30E9\u30A4\u8A9E
+SWT_Charset_Turkish=\u30C8\u30EB\u30B3\u8A9E
+SWT_Charset_Nordic=\u5317\u6B27\u30B2\u30EB\u30DE\u30F3\u7CFB\u8A00\u8A9E
+SWT_Charset_Thai=\u30BF\u30A4\u8A9E
+SWT_Charset_BalticRim=\u30D0\u30EB\u30C8\u8A9E
+SWT_Charset_Celtic=\u30B1\u30EB\u30C8\u8A9E
+SWT_Charset_Euro=\u30E6\u30FC\u30ED
+SWT_Charset_Romanian=\u30EB\u30FC\u30DE\u30CB\u30A2\u8A9E
+SWT_Charset_SimplifiedChinese=\u4E2D\u56FD\u8A9E (\u7C21\u4F53\u5B57)
+SWT_Charset_TraditionalChinese=\u4E2D\u56FD\u8A9E (\u7E41\u4F53\u5B57)
+SWT_Charset_Japanese=\u65E5\u672C\u8A9E
+SWT_Charset_Korean=\u97D3\u56FD\u8A9E
+SWT_Charset_Unicode=\u30E6\u30CB\u30B3\u30FC\u30C9
+SWT_Charset_ASCII=ASCII
+SWT_InputMethods=\u5165\u529B\u30E1\u30BD\u30C3\u30C9
+SWT_Password=\u30D1\u30B9\u30EF\u30FC\u30C9\:
+SWT_Username=\u30E6\u30FC\u30B6\u30FC\u540D\:
+SWT_Switch=\u5207\u308A\u66FF\u3048
+SWT_Press=\u62BC\u3059
+SWT_Open=\u958B\u304F
+SWT_Close=\u9589\u3058\u308B
+SWT_Minimize=\u6700\u5C0F\u5316
+SWT_Maximize=\u6700\u5927\u5316
+SWT_Restore=\u5FA9\u5143
+SWT_ShowList=\u30EA\u30B9\u30C8\u306E\u8868\u793A
+SWT_FileDownload=\u30D5\u30A1\u30A4\u30EB\u30FB\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9
+SWT_Download_File=\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\: {0}
+SWT_Download_Location={1} \u306E {0} \u3092\u4FDD\u7BA1\u4E2D
+SWT_Download_Started=\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u4E2D...
+SWT_Download_Status=\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\: {1,number,integer} KB \u306E\u3046\u3061 {0,number,integer} KB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_ko.properties	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,64 @@
+#Thu Jun 22 01:01:55 EDT 2006
+SWT_Yes=\uC608
+SWT_No=\uC544\uB2C8\uC624
+SWT_OK=\uD655\uC778
+SWT_Cancel=\uCDE8\uC18C
+SWT_Abort=\uC911\uB2E8
+SWT_Retry=\uC7AC\uC2DC\uB3C4
+SWT_Ignore=\uBB34\uC2DC
+SWT_Sample=\uC0D8\uD50C
+SWT_A_Sample_Text=\uC0D8\uD50C \uD14D\uC2A4\uD2B8
+SWT_Selection=\uC120\uD0DD\uC0AC\uD56D
+SWT_Current_Selection=\uD604\uC7AC \uC120\uD0DD\uC0AC\uD56D
+SWT_Font=\uAE00\uAF34
+SWT_Color=\uC0C9\uC0C1
+SWT_Extended_style=\uD655\uC7A5 \uC2A4\uD0C0\uC77C
+SWT_Size=\uD06C\uAE30
+SWT_Style=\uC2A4\uD0C0\uC77C
+SWT_Save=\uC800\uC7A5
+SWT_Character_set=\uBB38\uC790 \uC138\uD2B8
+SWT_ColorDialog_Title=\uC0C9\uC0C1
+SWT_FontDialog_Title=\uAE00\uAF34
+SWT_FontSet=\uAE00\uAF34 \uC138\uD2B8
+SWT_NewFont=\uC0C8 \uAE00\uAF34
+SWT_Remove=\uC81C\uAC70
+SWT_Up=\uC704\uB85C
+SWT_Down=\uC544\uB798\uB85C
+SWT_Selection=\uC120\uD0DD\uC0AC\uD56D
+SWT_Charset_Western=\uC11C\uC720\uB7FD
+SWT_Charset_EastEuropean=\uB3D9\uC720\uB7FD
+SWT_Charset_SouthEuropean=\uB0A8\uC720\uB7FD
+SWT_Charset_NorthEuropean=\uBD81\uC720\uB7FD
+SWT_Charset_Cyrillic=\uC2DC\uB9B4\uC5B4
+SWT_Charset_Arabic=\uC544\uB78D\uC5B4
+SWT_Charset_Greek=\uADF8\uB9AC\uC2A4\uC5B4
+SWT_Charset_Hebrew=\uD5E4\uBE0C\uB8E8\uC5B4
+SWT_Charset_Turkish=\uD130\uD0A4\uC5B4
+SWT_Charset_Nordic=\uC2A4\uCE78\uB514\uB098\uBE44\uC544\uC5B4
+SWT_Charset_Thai=\uD0DC\uAD6D\uC5B4
+SWT_Charset_BalticRim=\uBC1C\uD2B8\uC5B4
+SWT_Charset_Celtic=\uCF08\uD2B8\uC5B4
+SWT_Charset_Euro=\uC720\uB85C
+SWT_Charset_Romanian=\uB8E8\uB9C8\uB2C8\uC544\uC5B4
+SWT_Charset_SimplifiedChinese=\uC911\uAD6D\uC5B4
+SWT_Charset_TraditionalChinese=\uB300\uB9CC\uC5B4
+SWT_Charset_Japanese=\uC77C\uBCF8\uC5B4
+SWT_Charset_Korean=\uD55C\uAD6D\uC5B4
+SWT_Charset_Unicode=\uC720\uB2C8\uCF54\uB4DC
+SWT_Charset_ASCII=ASCII
+SWT_InputMethods=\uC785\uB825 \uBA54\uC18C\uB4DC
+SWT_Password=\uC554\uD638\:
+SWT_Username=\uC0AC\uC6A9\uC790 \uC774\uB984\:
+SWT_Switch=\uC804\uD658
+SWT_Press=\uB204\uB974\uAE30
+SWT_Open=\uC5F4\uAE30
+SWT_Close=\uB2EB\uAE30
+SWT_Minimize=\uCD5C\uC18C\uD654
+SWT_Maximize=\uCD5C\uB300\uD654
+SWT_Restore=\uBCF5\uC6D0
+SWT_ShowList=\uBAA9\uB85D \uD45C\uC2DC
+SWT_FileDownload=\uD30C\uC77C \uB2E4\uC6B4\uB85C\uB4DC
+SWT_Download_File=\uB2E4\uC6B4\uB85C\uB4DC\: {0}
+SWT_Download_Location={1}\uC5D0\uC11C {0} \uC800\uC7A5 \uC911
+SWT_Download_Started=\uB2E4\uC6B4\uB85C\uB4DC \uC911...
+SWT_Download_Status=\uB2E4\uC6B4\uB85C\uB4DC\: {0,number,integer} KB / {1,number,integer} KB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_nl.properties	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,64 @@
+#Thu Jun 22 03:45:44 EDT 2006
+SWT_Yes=Ja
+SWT_No=Nee
+SWT_OK=OK
+SWT_Cancel=Annuleren
+SWT_Abort=Afbreken
+SWT_Retry=Opnieuw proberen
+SWT_Ignore=Negeren
+SWT_Sample=Voorbeeld
+SWT_A_Sample_Text=Een voorbeeldtekst
+SWT_Selection=Selectie
+SWT_Current_Selection=Huidige selectie
+SWT_Font=Lettertype
+SWT_Color=Kleur
+SWT_Extended_style=Uitgebreide stijl
+SWT_Size=Formaat
+SWT_Style=Opmaakprofiel
+SWT_Save=Opslaan
+SWT_Character_set=Tekenset
+SWT_ColorDialog_Title=Kleuren
+SWT_FontDialog_Title=Lettertypen
+SWT_FontSet=Lettertypeset
+SWT_NewFont=Nieuw lettertype
+SWT_Remove=Verwijderen
+SWT_Up=Omhoog
+SWT_Down=Omlaag
+SWT_Selection=Selectie
+SWT_Charset_Western=westers
+SWT_Charset_EastEuropean=oost
+SWT_Charset_SouthEuropean=zuid
+SWT_Charset_NorthEuropean=noord
+SWT_Charset_Cyrillic=Cyrillisch
+SWT_Charset_Arabic=Arabisch
+SWT_Charset_Greek=Grieks
+SWT_Charset_Hebrew=Hebreeuws
+SWT_Charset_Turkish=Turks
+SWT_Charset_Nordic=Noords
+SWT_Charset_Thai=Thai
+SWT_Charset_BalticRim=Baltisch gebied
+SWT_Charset_Celtic=Keltisch
+SWT_Charset_Euro=euro
+SWT_Charset_Romanian=Roemeens
+SWT_Charset_SimplifiedChinese=Vereenv. Chinees
+SWT_Charset_TraditionalChinese=Trad. Chinees
+SWT_Charset_Japanese=Japans
+SWT_Charset_Korean=Koreaans
+SWT_Charset_Unicode=unicode
+SWT_Charset_ASCII=ASCII
+SWT_InputMethods=Invoermethoden
+SWT_Password=Wachtwoord\:
+SWT_Username=Gebruikersnaam\:
+SWT_Switch=Overschakelen
+SWT_Press=Drukken
+SWT_Open=Openen
+SWT_Close=Sluiten
+SWT_Minimize=Minimaliseren
+SWT_Maximize=Maximaliseren
+SWT_Restore=Herstellen
+SWT_ShowList=Lijst afbeelden
+SWT_FileDownload=Bestand downloaden
+SWT_Download_File=Downloaden\: {0}
+SWT_Download_Location={0} uit {1} opslaan
+SWT_Download_Started=Downloaden...
+SWT_Download_Status=Downloaden\: {0,number,integer} kB van {1,number,integer} kB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_no.properties	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,64 @@
+#Thu Jun 22 03:45:44 EDT 2006
+SWT_Yes=Ja
+SWT_No=Nei
+SWT_OK=OK
+SWT_Cancel=Avbryt
+SWT_Abort=Avbryt
+SWT_Retry=Pr\u00F8v p\u00E5 nytt
+SWT_Ignore=Ignorer
+SWT_Sample=Eksempel
+SWT_A_Sample_Text=En eksempeltekst
+SWT_Selection=Valg
+SWT_Current_Selection=Gjeldende valg
+SWT_Font=Font
+SWT_Color=Farge
+SWT_Extended_style=Utvidet stil
+SWT_Size=St\u00F8rrelse
+SWT_Style=Stil
+SWT_Save=Lagre
+SWT_Character_set=Tegnsett
+SWT_ColorDialog_Title=Farger
+SWT_FontDialog_Title=Fonter
+SWT_FontSet=Fontsett
+SWT_NewFont=Ny font
+SWT_Remove=Fjern
+SWT_Up=Opp
+SWT_Down=Ned
+SWT_Selection=Valg
+SWT_Charset_Western=vestlig
+SWT_Charset_EastEuropean=\u00F8stlig
+SWT_Charset_SouthEuropean=s\u00F8rlig
+SWT_Charset_NorthEuropean=nordlig
+SWT_Charset_Cyrillic=kyrillisk
+SWT_Charset_Arabic=arabisk
+SWT_Charset_Greek=gresk
+SWT_Charset_Hebrew=hebraisk
+SWT_Charset_Turkish=tyrkisk
+SWT_Charset_Nordic=nordisk
+SWT_Charset_Thai=thai
+SWT_Charset_BalticRim=baltisk
+SWT_Charset_Celtic=keltisk
+SWT_Charset_Euro=euro
+SWT_Charset_Romanian=rumensk
+SWT_Charset_SimplifiedChinese=foren. kinesisk
+SWT_Charset_TraditionalChinese=trad. kinesisk
+SWT_Charset_Japanese=japansk
+SWT_Charset_Korean=koreansk
+SWT_Charset_Unicode=unicode
+SWT_Charset_ASCII=ASCII
+SWT_InputMethods=Inndatametoder
+SWT_Password=Passord\:
+SWT_Username=Brukernavn\:
+SWT_Switch=Bytt
+SWT_Press=Trykk p\u00E5
+SWT_Open=\u00C5pne
+SWT_Close=Lukk
+SWT_Minimize=Minimer
+SWT_Maximize=Maksimer
+SWT_Restore=Gjenopprett
+SWT_ShowList=Vis liste
+SWT_FileDownload=Filnedlasting
+SWT_Download_File=Last ned\: {0}
+SWT_Download_Location=Lagrer {0} fra {1}
+SWT_Download_Started=Laster ned...
+SWT_Download_Status=Last ned\: {0,number,integer} kB av {1,number,integer} kB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_pl.properties	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,64 @@
+#Thu Jun 22 02:30:38 EDT 2006
+SWT_Yes=Tak
+SWT_No=Nie
+SWT_OK=OK
+SWT_Cancel=Anuluj
+SWT_Abort=Przerwij
+SWT_Retry=Pon\u00F3w
+SWT_Ignore=Ignoruj
+SWT_Sample=Przyk\u0142ad
+SWT_A_Sample_Text=Przyk\u0142adowy tekst
+SWT_Selection=Wyb\u00F3r
+SWT_Current_Selection=Bie\u017C\u0105cy wyb\u00F3r
+SWT_Font=Czcionka
+SWT_Color=Kolor
+SWT_Extended_style=Styl rozszerzony
+SWT_Size=Wielko\u015B\u0107
+SWT_Style=Styl
+SWT_Save=Zapisz
+SWT_Character_set=Zestaw znak\u00F3w
+SWT_ColorDialog_Title=Kolory
+SWT_FontDialog_Title=Czcionki
+SWT_FontSet=Zestaw czcionek
+SWT_NewFont=Nowa czcionka
+SWT_Remove=Usu\u0144
+SWT_Up=W g\u00F3r\u0119
+SWT_Down=W d\u00F3\u0142
+SWT_Selection=Wyb\u00F3r
+SWT_Charset_Western=zachodni
+SWT_Charset_EastEuropean=wschodni
+SWT_Charset_SouthEuropean=po\u0142udniowy
+SWT_Charset_NorthEuropean=p\u00F3\u0142nocny
+SWT_Charset_Cyrillic=cyrylica
+SWT_Charset_Arabic=arabski
+SWT_Charset_Greek=grecki
+SWT_Charset_Hebrew=hebrajski
+SWT_Charset_Turkish=turecki
+SWT_Charset_Nordic=nordycki
+SWT_Charset_Thai=tajski
+SWT_Charset_BalticRim=ba\u0142tycki
+SWT_Charset_Celtic=celtycki
+SWT_Charset_Euro=euro
+SWT_Charset_Romanian=rumu\u0144ski
+SWT_Charset_SimplifiedChinese=chi\u0144ski uproszczony
+SWT_Charset_TraditionalChinese=chi\u0144ski tradycyjny
+SWT_Charset_Japanese=japo\u0144ski
+SWT_Charset_Korean=korea\u0144ski
+SWT_Charset_Unicode=unicode
+SWT_Charset_ASCII=ASCII
+SWT_InputMethods=Metody wej\u015Bcia
+SWT_Password=Has\u0142o\:
+SWT_Username=Nazwa u\u017Cytkownika\:
+SWT_Switch=Prze\u0142\u0105cz
+SWT_Press=Naci\u015Bnij
+SWT_Open=Otw\u00F3rz
+SWT_Close=Zamknij
+SWT_Minimize=Minimalizuj
+SWT_Maximize=Maksymalizuj
+SWT_Restore=Odtw\u00F3rz
+SWT_ShowList=Poka\u017C list\u0119
+SWT_FileDownload=Pobieranie pliku
+SWT_Download_File=Pobierz\: {0}
+SWT_Download_Location=Zapisywanie {0} z {1}
+SWT_Download_Started=Pobieranie...
+SWT_Download_Status=Pobrano\: {0,number,integer} kB z {1,number,integer} kB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_pt.properties	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,64 @@
+#Thu Jun 22 03:45:44 EDT 2006
+SWT_Yes=Sim
+SWT_No=N\u00E3o
+SWT_OK=OK
+SWT_Cancel=Cancelar
+SWT_Abort=Abortar
+SWT_Retry=Tentar de novo
+SWT_Ignore=Ignorar
+SWT_Sample=Exemplo
+SWT_A_Sample_Text=Exemplo de texto
+SWT_Selection=Selec\u00E7\u00E3o
+SWT_Current_Selection=Selec\u00E7\u00E3o actual
+SWT_Font=Tipo de letra
+SWT_Color=Cor
+SWT_Extended_style=Estilo alargado
+SWT_Size=Tamanho
+SWT_Style=Estilo
+SWT_Save=Guardar
+SWT_Character_set=Conjunto de caracteres
+SWT_ColorDialog_Title=Cores
+SWT_FontDialog_Title=Tipos de letra
+SWT_FontSet=Conjunto de tipos de letra
+SWT_NewFont=Novo tipo de letra
+SWT_Remove=Remover
+SWT_Up=Para cima
+SWT_Down=Para baixo
+SWT_Selection=Selec\u00E7\u00E3o
+SWT_Charset_Western=ocidental
+SWT_Charset_EastEuropean=oriental
+SWT_Charset_SouthEuropean=meridional
+SWT_Charset_NorthEuropean=setentrional
+SWT_Charset_Cyrillic=cir\u00EDlico
+SWT_Charset_Arabic=\u00E1rabe
+SWT_Charset_Greek=grego
+SWT_Charset_Hebrew=hebreu
+SWT_Charset_Turkish=turco
+SWT_Charset_Nordic=n\u00F3rdico
+SWT_Charset_Thai=tailand\u00EAs
+SWT_Charset_BalticRim=pa\u00EDses b\u00E1lticos
+SWT_Charset_Celtic=celta
+SWT_Charset_Euro=euro
+SWT_Charset_Romanian=romeno
+SWT_Charset_SimplifiedChinese=chin\u00EAs trad.
+SWT_Charset_TraditionalChinese=chin\u00EAs trad.
+SWT_Charset_Japanese=japon\u00EAs
+SWT_Charset_Korean=coreano
+SWT_Charset_Unicode=unicode
+SWT_Charset_ASCII=ASCII
+SWT_InputMethods=M\u00E9todos de introdu\u00E7\u00E3o de dados
+SWT_Password=Palavra-passe\:
+SWT_Username=Nome do utilizador\:
+SWT_Switch=Comutar
+SWT_Press=Premir
+SWT_Open=Abrir
+SWT_Close=Fechar
+SWT_Minimize=Minimizar
+SWT_Maximize=Maximizar
+SWT_Restore=Restaurar
+SWT_ShowList=Mostrar lista
+SWT_FileDownload=Descarregamento de ficheiros
+SWT_Download_File=Descarregar\: {0}
+SWT_Download_Location=Guardar {0} de {1}
+SWT_Download_Started=A descarregar...
+SWT_Download_Status=Descarregar\: {0,number,integer} KB de {1,number,integer} KB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_pt_BR.properties	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,64 @@
+#Thu Jun 22 01:01:55 EDT 2006
+SWT_Yes=Sim
+SWT_No=N\u00E3o   
+SWT_OK=OK
+SWT_Cancel=Cancelar
+SWT_Abort=Interromper
+SWT_Retry=Tentar Novamente
+SWT_Ignore=Ignorar
+SWT_Sample=Exemplo
+SWT_A_Sample_Text=Um texto de amostra
+SWT_Selection=Sele\u00E7\u00E3o
+SWT_Current_Selection=Sele\u00E7\u00E3o atual
+SWT_Font=Fonte
+SWT_Color=Cor
+SWT_Extended_style=Estilo Estendido
+SWT_Size=Tamanho
+SWT_Style=Estilo
+SWT_Save=Salvar
+SWT_Character_set=Conjunto de Caracteres
+SWT_ColorDialog_Title=Cores
+SWT_FontDialog_Title=Fontes
+SWT_FontSet=Defini\u00E7\u00E3o de Fonte
+SWT_NewFont=Nova Fonte
+SWT_Remove=Remover
+SWT_Up=Para Cima
+SWT_Down=Para Baixo
+SWT_Selection=Sele\u00E7\u00E3o
+SWT_Charset_Western=ocidental
+SWT_Charset_EastEuropean=oriental
+SWT_Charset_SouthEuropean=meridional
+SWT_Charset_NorthEuropean=setentrional
+SWT_Charset_Cyrillic=cir\u00EDlico
+SWT_Charset_Arabic=\u00E1rabe
+SWT_Charset_Greek=grego
+SWT_Charset_Hebrew=hebraico
+SWT_Charset_Turkish=turco
+SWT_Charset_Nordic=n\u00F3rdico
+SWT_Charset_Thai=tai
+SWT_Charset_BalticRim=margem b\u00E1ltica
+SWT_Charset_Celtic=celta
+SWT_Charset_Euro=euro
+SWT_Charset_Romanian=romeno
+SWT_Charset_SimplifiedChinese=chin\u00EAs simplificado
+SWT_Charset_TraditionalChinese=chin\u00EAs simplificado
+SWT_Charset_Japanese=japon\u00EAs
+SWT_Charset_Korean=coreano
+SWT_Charset_Unicode=unicode
+SWT_Charset_ASCII=ASCII
+SWT_InputMethods=M\u00E9todos de Entrada
+SWT_Password=Senha\:
+SWT_Username=Nome do Usu\u00E1rio\:
+SWT_Switch=Chave
+SWT_Press=Pressione
+SWT_Open=Abrir
+SWT_Close=Fechar
+SWT_Minimize=Minimizar
+SWT_Maximize=Maximizar
+SWT_Restore=Restaurar
+SWT_ShowList=Mostrar Lista
+SWT_FileDownload=Download de Arquivo
+SWT_Download_File=Download\: {0}
+SWT_Download_Location=Salvando {0} de {1}
+SWT_Download_Started=Fazendo download...
+SWT_Download_Status=Download\: {0,number,integer} KB de {1,number,integer} KB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_ru.properties	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,64 @@
+#Thu Jun 22 02:30:38 EDT 2006
+SWT_Yes=\u0414\u0430
+SWT_No=\u041D\u0435\u0442
+SWT_OK=OK
+SWT_Cancel=\u041E\u0442\u043C\u0435\u043D\u0430
+SWT_Abort=\u041F\u0440\u0435\u0440\u0432\u0430\u0442\u044C
+SWT_Retry=\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C
+SWT_Ignore=\u0418\u0433\u043D\u043E\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C
+SWT_Sample=\u041F\u0440\u0438\u043C\u0435\u0440
+SWT_A_Sample_Text=\u041F\u0440\u0438\u043C\u0435\u0440 \u0442\u0435\u043A\u0441\u0442\u0430
+SWT_Selection=\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0439 \u044D\u043B\u0435\u043C\u0435\u043D\u0442
+SWT_Current_Selection=\u0422\u0435\u043A\u0443\u0449\u0438\u0439 \u0444\u0440\u0430\u0433\u043C\u0435\u043D\u0442
+SWT_Font=\u0428\u0440\u0438\u0444\u0442
+SWT_Color=\u0426\u0432\u0435\u0442
+SWT_Extended_style=\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u043D\u044B\u0439 \u0441\u0442\u0438\u043B\u044C
+SWT_Size=\u0420\u0430\u0437\u043C\u0435\u0440
+SWT_Style=\u0421\u0442\u0438\u043B\u044C
+SWT_Save=\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C
+SWT_Character_set=\u041A\u043E\u0434\u0438\u0440\u043E\u0432\u043A\u0430
+SWT_ColorDialog_Title=\u0426\u0432\u0435\u0442\u0430
+SWT_FontDialog_Title=\u0428\u0440\u0438\u0444\u0442\u044B
+SWT_FontSet=\u0421\u0435\u043C\u0435\u0439\u0441\u0442\u0432\u043E \u0448\u0440\u0438\u0444\u0442\u043E\u0432
+SWT_NewFont=\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u0448\u0440\u0438\u0444\u0442
+SWT_Remove=\u0423\u0434\u0430\u043B\u0438\u0442\u044C
+SWT_Up=\u0412\u0432\u0435\u0440\u0445
+SWT_Down=\u0412\u043D\u0438\u0437
+SWT_Selection=\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0439 \u044D\u043B\u0435\u043C\u0435\u043D\u0442
+SWT_Charset_Western=\u0437\u0430\u043F\u0430\u0434\u043D\u043E\u0435\u0432\u0440\u043E\u043F\u0435\u0439\u0441\u043A\u0430\u044F
+SWT_Charset_EastEuropean=\u0432\u043E\u0441\u0442\u043E\u0447\u043D\u043E\u0435\u0432\u0440\u043E\u043F\u0435\u0439\u0441\u043A\u0430\u044F
+SWT_Charset_SouthEuropean=\u044E\u0436\u043D\u043E\u0435\u0432\u0440\u043E\u043F\u0435\u0439\u0441\u043A\u0430\u044F
+SWT_Charset_NorthEuropean=\u0441\u0435\u0432\u0435\u0440\u043D\u043E\u0435\u0432\u0440\u043E\u043F\u0435\u0439\u0441\u043A\u0430\u044F
+SWT_Charset_Cyrillic=\u043A\u0438\u0440\u0438\u043B\u043B\u0438\u0446\u0430
+SWT_Charset_Arabic=\u0430\u0440\u0430\u0431\u0441\u043A\u0430\u044F
+SWT_Charset_Greek=\u0433\u0440\u0435\u0447\u0435\u0441\u043A\u0430\u044F
+SWT_Charset_Hebrew=\u0438\u0432\u0440\u0438\u0442
+SWT_Charset_Turkish=\u0442\u0443\u0440\u0435\u0446\u043A\u0430\u044F
+SWT_Charset_Nordic=\u0441\u043A\u0430\u043D\u0434\u0438\u043D\u0430\u0432\u0441\u043A\u0430\u044F
+SWT_Charset_Thai=\u0442\u0430\u0439\u0441\u043A\u0430\u044F
+SWT_Charset_BalticRim=\u0431\u0430\u043B\u0442\u0438\u0439\u0441\u043A\u0430\u044F
+SWT_Charset_Celtic=\u043A\u0435\u043B\u044C\u0442\u0441\u043A\u0430\u044F
+SWT_Charset_Euro=\u0435\u0432\u0440\u043E
+SWT_Charset_Romanian=\u0440\u0443\u043C\u044B\u043D\u0441\u043A\u0430\u044F
+SWT_Charset_SimplifiedChinese=\u043A\u0438\u0442\u0430\u0439\u0441\u043A\u0430\u044F (\u041A\u041D\u0420) 
+SWT_Charset_TraditionalChinese=\u043A\u0438\u0442\u0430\u0439\u0441\u043A\u0430\u044F (\u0422\u0430\u0439\u0432\u0430\u043D\u044C) 
+SWT_Charset_Japanese=\u044F\u043F\u043E\u043D\u0441\u043A\u0430\u044F
+SWT_Charset_Korean=\u043A\u043E\u0440\u0435\u0439\u0441\u043A\u0430\u044F
+SWT_Charset_Unicode=\u044E\u043D\u0438\u043A\u043E\u0434
+SWT_Charset_ASCII=ASCII
+SWT_InputMethods=\u041C\u0435\u0442\u043E\u0434\u044B \u0432\u0432\u043E\u0434\u0430
+SWT_Password=\u041F\u0430\u0440\u043E\u043B\u044C\:
+SWT_Username=\u0418\u043C\u044F \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F\:
+SWT_Switch=\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C
+SWT_Press=\u041D\u0430\u0436\u0430\u0442\u044C
+SWT_Open=\u041E\u0442\u043A\u0440\u044B\u0442\u044C
+SWT_Close=\u0417\u0430\u043A\u0440\u044B\u0442\u044C
+SWT_Minimize=\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C
+SWT_Maximize=\u0420\u0430\u0437\u0432\u0435\u0440\u043D\u0443\u0442\u044C
+SWT_Restore=\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C
+SWT_ShowList=\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0441\u043F\u0438\u0441\u043E\u043A
+SWT_FileDownload=\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0444\u0430\u0439\u043B\u0430
+SWT_Download_File=\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430\: {0}
+SWT_Download_Location=\u0421\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u0435 {0} \u0438\u0437 {1}
+SWT_Download_Started=\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430...
+SWT_Download_Status=\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430\: {0,number,integer} \u0438\u0437 {1,number,integer} \u041A\u0431
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_sv.properties	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,64 @@
+#Thu Jun 22 03:45:44 EDT 2006
+SWT_Yes=Ja
+SWT_No=Nej
+SWT_OK=OK
+SWT_Cancel=Avbryt
+SWT_Abort=Avbryt
+SWT_Retry=F\u00F6rs\u00F6k igen
+SWT_Ignore=Ignorera
+SWT_Sample=Exempel
+SWT_A_Sample_Text=En exempeltext
+SWT_Selection=Urval
+SWT_Current_Selection=Aktuellt urval
+SWT_Font=Teckensnitt
+SWT_Color=F\u00E4rg
+SWT_Extended_style=Ut\u00F6kat format
+SWT_Size=Storlek
+SWT_Style=Format
+SWT_Save=Spara
+SWT_Character_set=Teckenupps\u00E4ttning
+SWT_ColorDialog_Title=F\u00E4rger
+SWT_FontDialog_Title=Teckensnitt
+SWT_FontSet=Teckensnittsupps\u00E4ttning
+SWT_NewFont=Nytt teckensnitt
+SWT_Remove=Ta bort
+SWT_Up=Upp
+SWT_Down=Ned
+SWT_Selection=Urval
+SWT_Charset_Western=v\u00E4steuropeiska
+SWT_Charset_EastEuropean=\u00F6steuropeiska
+SWT_Charset_SouthEuropean=sydeuropeiska
+SWT_Charset_NorthEuropean=nordeuropeiska
+SWT_Charset_Cyrillic=kyrilliska
+SWT_Charset_Arabic=arabiska
+SWT_Charset_Greek=grekiska
+SWT_Charset_Hebrew=hebreiska
+SWT_Charset_Turkish=turkiska
+SWT_Charset_Nordic=nordiska
+SWT_Charset_Thai=thail\u00E4ndska
+SWT_Charset_BalticRim=baltiska
+SWT_Charset_Celtic=keltiska
+SWT_Charset_Euro=euro
+SWT_Charset_Romanian=rum\u00E4nska
+SWT_Charset_SimplifiedChinese=f\u00F6renklad kinesiska
+SWT_Charset_TraditionalChinese=traditionell kinesiska
+SWT_Charset_Japanese=japanska
+SWT_Charset_Korean=koreanska
+SWT_Charset_Unicode=unicode
+SWT_Charset_ASCII=ASCII
+SWT_InputMethods=Inmatningsmetoder
+SWT_Password=L\u00F6senord\:
+SWT_Username=Anv\u00E4ndarnamn\:
+SWT_Switch=V\u00E4xla
+SWT_Press=Tryck p\u00E5
+SWT_Open=\u00D6ppna
+SWT_Close=St\u00E4ng
+SWT_Minimize=Minimera
+SWT_Maximize=Maximera
+SWT_Restore=\u00C5terst\u00E4ll
+SWT_ShowList=Visa lista
+SWT_FileDownload=Filh\u00E4mtning
+SWT_Download_File=H\u00E4mtning\: {0}
+SWT_Download_Location=Spara {0} fr\u00E5n {1}
+SWT_Download_Started=H\u00E4mtar...
+SWT_Download_Status=H\u00E4mtning\: {0,number,integer} KB av {1,number,integer} KB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_tr.properties	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,64 @@
+#Thu Jun 22 03:45:44 EDT 2006
+SWT_Yes=Evet
+SWT_No=Hay\u0131r
+SWT_OK=Tamam
+SWT_Cancel=\u0130ptal
+SWT_Abort=Durdur
+SWT_Retry=Yeniden Dene
+SWT_Ignore=Yoksay
+SWT_Sample=\u00D6rnek
+SWT_A_Sample_Text=\u00D6rnek Metin
+SWT_Selection=Se\u00E7im
+SWT_Current_Selection=Y\u00FCr\u00FCrl\u00FCkteki Se\u00E7im
+SWT_Font=Yaz\u0131y\u00FCz\u00FC
+SWT_Color=Renk
+SWT_Extended_style=Ek Bi\u00E7em
+SWT_Size=B\u00FCy\u00FCkl\u00FCk
+SWT_Style=Bi\u00E7em
+SWT_Save=Sakla
+SWT_Character_set=Karakter k\u00FCmesi
+SWT_ColorDialog_Title=Renkler
+SWT_FontDialog_Title=Yaz\u0131y\u00FCzleri
+SWT_FontSet=Yaz\u0131y\u00FCz\u00FC K\u00FCmesi
+SWT_NewFont=Yeni Yaz\u0131y\u00FCz\u00FC
+SWT_Remove=Kald\u0131r
+SWT_Up=Yukar\u0131
+SWT_Down=A\u015Fa\u011F\u0131
+SWT_Selection=Se\u00E7im
+SWT_Charset_Western=bat\u0131
+SWT_Charset_EastEuropean=do\u011Fu
+SWT_Charset_SouthEuropean=g\u00FCney
+SWT_Charset_NorthEuropean=kuzey
+SWT_Charset_Cyrillic=kiril
+SWT_Charset_Arabic=arap\u00E7a
+SWT_Charset_Greek=yunanca
+SWT_Charset_Hebrew=ibranice
+SWT_Charset_Turkish=t\u00FCrk\u00E7e
+SWT_Charset_Nordic=kuzey avrupa dilleri
+SWT_Charset_Thai=tay
+SWT_Charset_BalticRim=balt\u0131k
+SWT_Charset_Celtic=kelt
+SWT_Charset_Euro=euro
+SWT_Charset_Romanian=romence
+SWT_Charset_SimplifiedChinese=yal\u0131n. \u00E7ince
+SWT_Charset_TraditionalChinese=gelenk. \u00E7ince
+SWT_Charset_Japanese=japonca
+SWT_Charset_Korean=korece
+SWT_Charset_Unicode=unicode
+SWT_Charset_ASCII=ASCII
+SWT_InputMethods=Giri\u015F Y\u00F6ntemleri
+SWT_Password=Parola\:
+SWT_Username=Kullan\u0131c\u0131 Ad\u0131\:
+SWT_Switch=Ge\u00E7
+SWT_Press=Bas
+SWT_Open=A\u00E7
+SWT_Close=Kapat
+SWT_Minimize=Simge Durumuna K\u00FC\u00E7\u00FClt
+SWT_Maximize=Ekran Boyutuna Getir
+SWT_Restore=Geri Y\u00FCkle
+SWT_ShowList=Listeyi G\u00F6ster
+SWT_FileDownload=Dosya A\u015Fa\u011F\u0131 Y\u00FCkle
+SWT_Download_File=A\u015Fa\u011F\u0131 y\u00FCkle\: {0}
+SWT_Download_Location={0} saklan\u0131yor ({1})
+SWT_Download_Started=A\u015Fa\u011F\u0131 y\u00FCkleniyor...
+SWT_Download_Status=A\u015Fa\u011F\u0131 y\u00FCkle\: {0,number,integer} KB / {1,number,integer} KB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_zh.properties	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,64 @@
+#Thu Jun 22 01:01:55 EDT 2006
+SWT_Yes=\u662F
+SWT_No=\u5426
+SWT_OK=\u786E\u5B9A
+SWT_Cancel=\u53D6\u6D88
+SWT_Abort=\u653E\u5F03
+SWT_Retry=\u91CD\u8BD5
+SWT_Ignore=\u5FFD\u7565
+SWT_Sample=\u6837\u672C
+SWT_A_Sample_Text=\u6837\u672C\u6587\u672C
+SWT_Selection=\u6240\u9009\u9879
+SWT_Current_Selection=\u5F53\u524D\u9009\u62E9
+SWT_Font=\u5B57\u4F53
+SWT_Color=\u989C\u8272
+SWT_Extended_style=\u6269\u5C55\u6837\u5F0F
+SWT_Size=\u5927\u5C0F
+SWT_Style=\u6837\u5F0F
+SWT_Save=\u4FDD\u5B58
+SWT_Character_set=\u5B57\u7B26\u96C6
+SWT_ColorDialog_Title=\u989C\u8272
+SWT_FontDialog_Title=\u5B57\u4F53
+SWT_FontSet=\u5B57\u4F53\u96C6
+SWT_NewFont=\u65B0\u5B57\u4F53
+SWT_Remove=\u9664\u53BB
+SWT_Up=\u4E0A\u79FB
+SWT_Down=\u4E0B\u79FB
+SWT_Selection=\u6240\u9009\u9879
+SWT_Charset_Western=\u897F\u65B9
+SWT_Charset_EastEuropean=\u4E1C\u6B27
+SWT_Charset_SouthEuropean=\u5357\u6B27
+SWT_Charset_NorthEuropean=\u5317\u6B27
+SWT_Charset_Cyrillic=Cyrillic
+SWT_Charset_Arabic=\u963F\u62C9\u4F2F\u8BED
+SWT_Charset_Greek=\u5E0C\u814A\u8BED
+SWT_Charset_Hebrew=\u5E0C\u4F2F\u83B1\u8BED
+SWT_Charset_Turkish=\u571F\u8033\u5176\u8BED
+SWT_Charset_Nordic=\u65E5\u8033\u66FC\u8BED
+SWT_Charset_Thai=\u6CF0\u56FD\u8BED
+SWT_Charset_BalticRim=\u6CBF\u6CE2\u7F57\u7684\u6D77\u8BED
+SWT_Charset_Celtic=\u51EF\u5C14\u7279\u8BED
+SWT_Charset_Euro=\u6B27\u5143\u7B26\u53F7
+SWT_Charset_Romanian=\u7F57\u9A6C\u5C3C\u4E9A\u8BED
+SWT_Charset_SimplifiedChinese=\u7B80\u4F53\u4E2D\u6587
+SWT_Charset_TraditionalChinese=\u7E41\u4F53\u4E2D\u6587
+SWT_Charset_Japanese=\u65E5\u8BED
+SWT_Charset_Korean=\u97E9\u56FD\u8BED
+SWT_Charset_Unicode=Unicode
+SWT_Charset_ASCII=ASCII
+SWT_InputMethods=\u8F93\u5165\u65B9\u6CD5
+SWT_Password=\u5BC6\u7801\uFF1A
+SWT_Username=\u7528\u6237\u540D\uFF1A
+SWT_Switch=\u5207\u6362
+SWT_Press=\u6309
+SWT_Open=\u6253\u5F00
+SWT_Close=\u5173\u95ED
+SWT_Minimize=\u6700\u5C0F\u5316
+SWT_Maximize=\u6700\u5927\u5316
+SWT_Restore=\u6062\u590D
+SWT_ShowList=\u663E\u793A\u5217\u8868
+SWT_FileDownload=\u6587\u4EF6\u4E0B\u8F7D
+SWT_Download_File=\u4E0B\u8F7D\uFF1A{0}
+SWT_Download_Location=\u6B63\u5728\u4FDD\u5B58 {1} \u4E2D\u7684 {0}
+SWT_Download_Started=\u6B63\u5728\u4E0B\u8F7D...
+SWT_Download_Status=\u4E0B\u8F7D\uFF1A{0,number,integer} KB\uFF0C\u603B\u5171 {1,number,integer} KB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_zh_HK.properties	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,64 @@
+#Thu Jun 22 01:01:55 EDT 2006
+SWT_Yes=\u662F
+SWT_No=\u5426
+SWT_OK=\u78BA\u5B9A
+SWT_Cancel=\u53D6\u6D88
+SWT_Abort=\u4E2D\u6B62
+SWT_Retry=\u91CD\u8A66
+SWT_Ignore=\u5FFD\u7565
+SWT_Sample=\u7BC4\u4F8B
+SWT_A_Sample_Text=\u6A23\u672C\u6587\u5B57
+SWT_Selection=\u9078\u53D6
+SWT_Current_Selection=\u76EE\u524D\u6240\u9078\u7684\u9805\u76EE
+SWT_Font=\u5B57\u578B
+SWT_Color=\u984F\u8272
+SWT_Extended_style=\u64F4\u5145\u6A23\u5F0F
+SWT_Size=\u5927\u5C0F
+SWT_Style=\u6A23\u5F0F
+SWT_Save=\u5132\u5B58
+SWT_Character_set=\u5B57\u96C6
+SWT_ColorDialog_Title=\u984F\u8272
+SWT_FontDialog_Title=\u5B57\u578B
+SWT_FontSet=\u5B57\u578B\u8A2D\u5B9A
+SWT_NewFont=\u65B0\u5EFA\u5B57\u578B
+SWT_Remove=\u79FB\u9664
+SWT_Up=\u4E0A
+SWT_Down=\u4E0B
+SWT_Selection=\u9078\u53D6
+SWT_Charset_Western=\u897F\u6B50
+SWT_Charset_EastEuropean=\u6771\u6B50
+SWT_Charset_SouthEuropean=\u5357\u6B50
+SWT_Charset_NorthEuropean=\u5317\u6B50
+SWT_Charset_Cyrillic=\u65AF\u62C9\u592B\u6587
+SWT_Charset_Arabic=\u963F\u62C9\u4F2F\u6587
+SWT_Charset_Greek=\u5E0C\u81D8\u6587
+SWT_Charset_Hebrew=\u5E0C\u4F2F\u4F86\u6587
+SWT_Charset_Turkish=\u571F\u8033\u5176\u6587
+SWT_Charset_Nordic=\u65AF\u582A\u7684\u7D0D\u7DAD\u4E9E\u8A9E
+SWT_Charset_Thai=\u6CF0\u6587
+SWT_Charset_BalticRim=\u6CE2\u7F85\u7684\u6D77\u5468\u570D\u570B\u5BB6
+SWT_Charset_Celtic=\u51F1\u723E\u7279\u8A9E
+SWT_Charset_Euro=\u6B50\u6D32
+SWT_Charset_Romanian=\u7F85\u99AC\u5C3C\u4E9E\u6587
+SWT_Charset_SimplifiedChinese=\u7C21\u9AD4\u4E2D\u6587
+SWT_Charset_TraditionalChinese=\u7E41\u9AD4\u4E2D\u6587
+SWT_Charset_Japanese=\u65E5\u6587
+SWT_Charset_Korean=\u97D3\u6587
+SWT_Charset_Unicode=Unicode
+SWT_Charset_ASCII=ASCII
+SWT_InputMethods=\u8F38\u5165\u65B9\u6CD5
+SWT_Password=\u5BC6\u78BC\uFF1A
+SWT_Username=\u4F7F\u7528\u8005\u540D\u7A31\uFF1A
+SWT_Switch=\u5207\u63DB
+SWT_Press=\u6309
+SWT_Open=\u958B\u555F
+SWT_Close=\u95DC\u9589
+SWT_Minimize=\u6700\u5C0F\u5316
+SWT_Maximize=\u6700\u5927\u5316
+SWT_Restore=\u9084\u539F
+SWT_ShowList=\u986F\u793A\u6E05\u55AE
+SWT_FileDownload=\u6A94\u6848\u4E0B\u8F09
+SWT_Download_File=\u4E0B\u8F09\uFF1A{0}
+SWT_Download_Location=\u6B63\u5728\u5F9E {1} \u5132\u5B58 {0}
+SWT_Download_Started=\u6B63\u5728\u4E0B\u8F09...
+SWT_Download_Status=\u4E0B\u8F09\uFF1A{1,number,integer} KB \u4E2D\u7684 {0,number,integer} KB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/res/org.eclipse.swt.internal.SWTMessages_zh_TW.properties	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,64 @@
+#Thu Jun 22 01:01:55 EDT 2006
+SWT_Yes=\u662F
+SWT_No=\u5426
+SWT_OK=\u78BA\u5B9A
+SWT_Cancel=\u53D6\u6D88
+SWT_Abort=\u4E2D\u6B62
+SWT_Retry=\u91CD\u8A66
+SWT_Ignore=\u5FFD\u7565
+SWT_Sample=\u7BC4\u4F8B
+SWT_A_Sample_Text=\u6A23\u672C\u6587\u5B57
+SWT_Selection=\u9078\u53D6
+SWT_Current_Selection=\u76EE\u524D\u6240\u9078\u7684\u9805\u76EE
+SWT_Font=\u5B57\u578B
+SWT_Color=\u984F\u8272
+SWT_Extended_style=\u64F4\u5145\u6A23\u5F0F
+SWT_Size=\u5927\u5C0F
+SWT_Style=\u6A23\u5F0F
+SWT_Save=\u5132\u5B58
+SWT_Character_set=\u5B57\u96C6
+SWT_ColorDialog_Title=\u984F\u8272
+SWT_FontDialog_Title=\u5B57\u578B
+SWT_FontSet=\u5B57\u578B\u8A2D\u5B9A
+SWT_NewFont=\u65B0\u5EFA\u5B57\u578B
+SWT_Remove=\u79FB\u9664
+SWT_Up=\u4E0A
+SWT_Down=\u4E0B
+SWT_Selection=\u9078\u53D6
+SWT_Charset_Western=\u897F\u6B50
+SWT_Charset_EastEuropean=\u6771\u6B50
+SWT_Charset_SouthEuropean=\u5357\u6B50
+SWT_Charset_NorthEuropean=\u5317\u6B50
+SWT_Charset_Cyrillic=\u65AF\u62C9\u592B\u6587
+SWT_Charset_Arabic=\u963F\u62C9\u4F2F\u6587
+SWT_Charset_Greek=\u5E0C\u81D8\u6587
+SWT_Charset_Hebrew=\u5E0C\u4F2F\u4F86\u6587
+SWT_Charset_Turkish=\u571F\u8033\u5176\u6587
+SWT_Charset_Nordic=\u65AF\u582A\u7684\u7D0D\u7DAD\u4E9E\u8A9E
+SWT_Charset_Thai=\u6CF0\u6587
+SWT_Charset_BalticRim=\u6CE2\u7F85\u7684\u6D77\u5468\u570D\u570B\u5BB6
+SWT_Charset_Celtic=\u51F1\u723E\u7279\u8A9E
+SWT_Charset_Euro=\u6B50\u6D32
+SWT_Charset_Romanian=\u7F85\u99AC\u5C3C\u4E9E\u6587
+SWT_Charset_SimplifiedChinese=\u7C21\u9AD4\u4E2D\u6587
+SWT_Charset_TraditionalChinese=\u7E41\u9AD4\u4E2D\u6587
+SWT_Charset_Japanese=\u65E5\u6587
+SWT_Charset_Korean=\u97D3\u6587
+SWT_Charset_Unicode=Unicode
+SWT_Charset_ASCII=ASCII
+SWT_InputMethods=\u8F38\u5165\u65B9\u6CD5
+SWT_Password=\u5BC6\u78BC\uFF1A
+SWT_Username=\u4F7F\u7528\u8005\u540D\u7A31\uFF1A
+SWT_Switch=\u5207\u63DB
+SWT_Press=\u6309
+SWT_Open=\u958B\u555F
+SWT_Close=\u95DC\u9589
+SWT_Minimize=\u6700\u5C0F\u5316
+SWT_Maximize=\u6700\u5927\u5316
+SWT_Restore=\u9084\u539F
+SWT_ShowList=\u986F\u793A\u6E05\u55AE
+SWT_FileDownload=\u6A94\u6848\u4E0B\u8F09
+SWT_Download_File=\u4E0B\u8F09\uFF1A{0}
+SWT_Download_Location=\u6B63\u5728\u5F9E {1} \u5132\u5B58 {0}
+SWT_Download_Started=\u6B63\u5728\u4E0B\u8F09...
+SWT_Download_Status=\u4E0B\u8F09\uFF1A{1,number,integer} KB \u4E2D\u7684 {0,number,integer} KB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/SWT.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,3879 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.SWT;
+
+
+import org.eclipse.swt.internal.Compatibility;
+import org.eclipse.swt.internal.Library;
+import org.eclipse.swt.internal.Platform;
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.SWTException;
+
+import java.lang.all;
+
+import tango.core.Exception;
+version( build ){
+pragma(link, "gtk-x11-2.0" );
+pragma(link, "gdk-x11-2.0" );
+pragma(link, "atk-1.0" );
+pragma(link, "gdk_pixbuf-2.0" );
+pragma(link, "gthread-2.0" );
+pragma(link, "pangocairo-1.0" );
+pragma(link, "fontconfig" );
+pragma(link, "Xtst" );
+pragma(link, "Xext" );
+pragma(link, "Xrender" );
+pragma(link, "Xinerama" );
+pragma(link, "Xi" );
+pragma(link, "Xrandr" );
+pragma(link, "Xcursor" );
+pragma(link, "Xcomposite" );
+pragma(link, "Xdamage" );
+pragma(link, "X11" );
+pragma(link, "Xfixes" );
+pragma(link, "pango-1.0" );
+pragma(link, "gobject-2.0" );
+pragma(link, "gmodule-2.0" );
+pragma(link, "dl" );
+pragma(link, "glib-2.0" );
+pragma(link, "cairo" );
+}
+//version=CARBON;
+
+
+/**
+ * This class provides access to a small number of SWT system-wide
+ * methods, and in addition defines the public constants provided
+ * by SWT.
+ * <p>
+ * By defining constants like UP and DOWN in a single class, SWT
+ * can share common names and concepts at the same time minimizing
+ * the number of classes, names and constants for the application
+ * programmer.
+ * </p><p>
+ * Note that some of the constants provided by this class represent
+ * optional, appearance related aspects of widgets which are available
+ * either only on some window systems, or for a differing set of
+ * widgets on each window system. These constants are marked
+ * as <em>HINT</em>s. The set of widgets which support a particular
+ * <em>HINT</em> may change from release to release, although we typically
+ * will not withdraw support for a <em>HINT</em> once it is made available.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+/* NOTE:
+ *   Good javadoc coding style is to put the values of static const
+ *   constants in the comments. This reinforces the fact that
+ *   consumers are allowed to rely on the value (and they must
+ *   since the values are compiled inline in their code). We
+ *   can <em>not</em> change the values of these constants between
+ *   releases.
+ */
+public class SWT {
+
+    /* Widget Event Constants */
+
+    /**
+     * The null event type (value is 0).
+     *
+     * @since 3.0
+     */
+    public static const int None = 0;
+
+    /**
+     * The key down event type (value is 1).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Control#addKeyListener
+     * @see org.eclipse.swt.widgets.Tracker#addKeyListener
+     * @see org.eclipse.swt.events.KeyListener#keyPressed
+     * @see org.eclipse.swt.events.KeyEvent
+     */
+    public static const int KeyDown = 1;
+
+    /**
+     * The key up event type (value is 2).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Control#addKeyListener
+     * @see org.eclipse.swt.widgets.Tracker#addKeyListener
+     * @see org.eclipse.swt.events.KeyListener#keyReleased
+     * @see org.eclipse.swt.events.KeyEvent
+     */
+    public static const int KeyUp = 2;
+
+    /**
+     * The mouse down event type (value is 3).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Control#addMouseListener
+     * @see org.eclipse.swt.events.MouseListener#mouseDown
+     * @see org.eclipse.swt.events.MouseEvent
+     */
+    public static const int MouseDown = 3;
+
+    /**
+     * The mouse up event type (value is 4).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Control#addMouseListener
+     * @see org.eclipse.swt.events.MouseListener#mouseUp
+     * @see org.eclipse.swt.events.MouseEvent
+     */
+    public static const int MouseUp = 4;
+
+    /**
+     * The mouse move event type (value is 5).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Control#addMouseMoveListener
+     * @see org.eclipse.swt.events.MouseMoveListener#mouseMove
+     * @see org.eclipse.swt.events.MouseEvent
+     */
+    public static const int MouseMove = 5;
+
+    /**
+     * The mouse enter event type (value is 6).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Control#addMouseTrackListener
+     * @see org.eclipse.swt.events.MouseTrackListener#mouseEnter
+     * @see org.eclipse.swt.events.MouseEvent
+     */
+    public static const int MouseEnter = 6;
+
+    /**
+     * The mouse exit event type (value is 7).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Control#addMouseTrackListener
+     * @see org.eclipse.swt.events.MouseTrackListener#mouseExit
+     * @see org.eclipse.swt.events.MouseEvent
+     */
+    public static const int MouseExit = 7;
+
+    /**
+     * The mouse double click event type (value is 8).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Control#addMouseListener
+     * @see org.eclipse.swt.events.MouseListener#mouseDoubleClick
+     * @see org.eclipse.swt.events.MouseEvent
+     */
+    public static const int MouseDoubleClick = 8;
+
+    /**
+     * The paint event type (value is 9).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Control#addPaintListener
+     * @see org.eclipse.swt.events.PaintListener#paintControl
+     * @see org.eclipse.swt.events.PaintEvent
+     */
+    public static const int Paint = 9;
+
+    /**
+     * The move event type (value is 10).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Control#addControlListener
+     * @see org.eclipse.swt.widgets.TableColumn#addControlListener
+     * @see org.eclipse.swt.widgets.Tracker#addControlListener
+     * @see org.eclipse.swt.widgets.TreeColumn#addControlListener
+     * @see org.eclipse.swt.events.ControlListener#controlMoved
+     * @see org.eclipse.swt.events.ControlEvent
+     */
+    public static const int Move = 10;
+
+    /**
+     * The resize event type (value is 11).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Control#addControlListener
+     * @see org.eclipse.swt.widgets.TableColumn#addControlListener
+     * @see org.eclipse.swt.widgets.Tracker#addControlListener
+     * @see org.eclipse.swt.widgets.TreeColumn#addControlListener
+     * @see org.eclipse.swt.events.ControlListener#controlResized
+     * @see org.eclipse.swt.events.ControlEvent
+     */
+    public static const int Resize = 11;
+
+    /**
+     * The dispose event type (value is 12).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Widget#addDisposeListener
+     * @see org.eclipse.swt.events.DisposeListener#widgetDisposed
+     * @see org.eclipse.swt.events.DisposeEvent
+     */
+    public static const int Dispose = 12;
+
+    /**
+     * The selection event type (value is 13).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Button#addSelectionListener
+     * @see org.eclipse.swt.widgets.Combo#addSelectionListener
+     * @see org.eclipse.swt.widgets.CoolItem#addSelectionListener
+     * @see org.eclipse.swt.widgets.Link#addSelectionListener
+     * @see org.eclipse.swt.widgets.List#addSelectionListener
+     * @see org.eclipse.swt.widgets.MenuItem#addSelectionListener
+     * @see org.eclipse.swt.widgets.Sash#addSelectionListener
+     * @see org.eclipse.swt.widgets.Scale#addSelectionListener
+     * @see org.eclipse.swt.widgets.ScrollBar#addSelectionListener
+     * @see org.eclipse.swt.widgets.Slider#addSelectionListener
+     * @see org.eclipse.swt.widgets.TabFolder#addSelectionListener
+     * @see org.eclipse.swt.widgets.Table#addSelectionListener
+     * @see org.eclipse.swt.widgets.TableColumn#addSelectionListener
+     * @see org.eclipse.swt.widgets.ToolItem#addSelectionListener
+     * @see org.eclipse.swt.widgets.TrayItem#addSelectionListener
+     * @see org.eclipse.swt.widgets.Tree#addSelectionListener
+     * @see org.eclipse.swt.widgets.TreeColumn#addSelectionListener
+     * @see org.eclipse.swt.events.SelectionListener#widgetSelected
+     * @see org.eclipse.swt.events.SelectionEvent
+     */
+    public static const int Selection = 13;
+
+    /**
+     * The default selection event type (value is 14).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Combo#addSelectionListener
+     * @see org.eclipse.swt.widgets.List#addSelectionListener
+     * @see org.eclipse.swt.widgets.Spinner#addSelectionListener
+     * @see org.eclipse.swt.widgets.Table#addSelectionListener
+     * @see org.eclipse.swt.widgets.Text#addSelectionListener
+     * @see org.eclipse.swt.widgets.TrayItem#addSelectionListener
+     * @see org.eclipse.swt.widgets.Tree#addSelectionListener
+     * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected
+     * @see org.eclipse.swt.events.SelectionEvent
+     */
+    public static const int DefaultSelection = 14;
+
+    /**
+     * The focus in event type (value is 15).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Control#addFocusListener
+     * @see org.eclipse.swt.events.FocusListener#focusGained
+     * @see org.eclipse.swt.events.FocusEvent
+     */
+    public static const int FocusIn = 15;
+
+    /**
+     * The focus out event type (value is 16).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Control#addFocusListener
+     * @see org.eclipse.swt.events.FocusListener#focusLost
+     * @see org.eclipse.swt.events.FocusEvent
+     */
+    public static const int FocusOut = 16;
+
+    /**
+     * The expand event type (value is 17).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Tree#addTreeListener
+     * @see org.eclipse.swt.events.TreeListener#treeExpanded
+     * @see org.eclipse.swt.events.TreeEvent
+     */
+    public static const int Expand = 17;
+
+    /**
+     * The collapse event type (value is 18).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Tree#addTreeListener
+     * @see org.eclipse.swt.events.TreeListener#treeCollapsed
+     * @see org.eclipse.swt.events.TreeEvent
+     */
+    public static const int Collapse = 18;
+
+    /**
+     * The iconify event type (value is 19).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Shell#addShellListener
+     * @see org.eclipse.swt.events.ShellListener#shellIconified
+     * @see org.eclipse.swt.events.ShellEvent
+     */
+    public static const int Iconify = 19;
+
+    /**
+     * The de-iconify event type (value is 20).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Shell#addShellListener
+     * @see org.eclipse.swt.events.ShellListener#shellDeiconified
+     * @see org.eclipse.swt.events.ShellEvent
+     */
+    public static const int Deiconify = 20;
+
+    /**
+     * The close event type (value is 21).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Shell#addShellListener
+     * @see org.eclipse.swt.events.ShellListener#shellClosed
+     * @see org.eclipse.swt.events.ShellEvent
+     */
+    public static const int Close = 21;
+
+    /**
+     * The show event type (value is 22).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Menu#addMenuListener
+     * @see org.eclipse.swt.events.MenuListener#menuShown
+     * @see org.eclipse.swt.events.MenuEvent
+     */
+    public static const int Show = 22;
+
+    /**
+     * The hide event type (value is 23).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Menu#addMenuListener
+     * @see org.eclipse.swt.events.MenuListener#menuHidden
+     * @see org.eclipse.swt.events.MenuEvent
+     */
+    public static const int Hide = 23;
+
+    /**
+     * The modify event type (value is 24).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Combo#addModifyListener
+     * @see org.eclipse.swt.widgets.Spinner#addModifyListener
+     * @see org.eclipse.swt.widgets.Text#addModifyListener
+     * @see org.eclipse.swt.events.ModifyListener#modifyText
+     * @see org.eclipse.swt.events.ModifyEvent
+     */
+    public static const int Modify = 24;
+
+    /**
+     * The verify event type (value is 25).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.custom.CCombo#addVerifyListener
+     * @see org.eclipse.swt.widgets.Combo#addVerifyListener
+     * @see org.eclipse.swt.custom.StyledText#addVerifyListener
+     * @see org.eclipse.swt.widgets.Text#addVerifyListener
+     * @see org.eclipse.swt.events.VerifyListener#verifyText
+     * @see org.eclipse.swt.events.VerifyEvent
+     */
+    public static const int Verify = 25;
+
+    /**
+     * The activate event type (value is 26).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Shell#addShellListener
+     * @see org.eclipse.swt.events.ShellListener#shellActivated
+     * @see org.eclipse.swt.events.ShellEvent
+     */
+    public static const int Activate = 26;
+
+    /**
+     * The deactivate event type (value is 27).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Shell#addShellListener
+     * @see org.eclipse.swt.events.ShellListener#shellDeactivated
+     * @see org.eclipse.swt.events.ShellEvent
+     */
+    public static const int Deactivate = 27;
+
+    /**
+     * The help event type (value is 28).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Control#addHelpListener
+     * @see org.eclipse.swt.widgets.Menu#addHelpListener
+     * @see org.eclipse.swt.widgets.MenuItem#addHelpListener
+     * @see org.eclipse.swt.events.HelpListener#helpRequested
+     * @see org.eclipse.swt.events.HelpEvent
+     */
+    public static const int Help = 28;
+
+    /**
+     * The drag detect event type (value is 29).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.dnd.DragSource
+     */
+    public static const int DragDetect = 29;
+
+    /**
+     * The arm event type (value is 30).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.MenuItem#addArmListener
+     * @see org.eclipse.swt.events.ArmListener#widgetArmed
+     * @see org.eclipse.swt.events.ArmEvent
+     */
+    public static const int Arm = 30;
+
+    /**
+     * The traverse event type (value is 31).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Control#addTraverseListener
+     * @see org.eclipse.swt.events.TraverseListener#keyTraversed
+     * @see org.eclipse.swt.events.TraverseEvent
+     */
+    public static const int Traverse = 31;
+
+    /**
+     * The mouse hover event type (value is 32).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Control#addMouseTrackListener
+     * @see org.eclipse.swt.events.MouseTrackListener#mouseHover
+     * @see org.eclipse.swt.events.MouseEvent
+     */
+    public static const int MouseHover = 32;
+
+    /**
+     * The hardware key down event type (value is 33).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     */
+    public static const int HardKeyDown = 33;
+
+    /**
+     * The hardware key up event type (value is 34).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     */
+    public static const int HardKeyUp = 34;
+
+    /**
+     * The menu detect event type (value is 35).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @since 3.0
+     */
+    public static const int MenuDetect = 35;
+
+    /**
+     * The set data event type (value is 36).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @see org.eclipse.swt.widgets.Table
+     * @see org.eclipse.swt.widgets.Tree
+     *
+     * @since 3.0
+     */
+    public static const int SetData = 36;
+
+    /**
+     * The mouse wheel event type (value is 37).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @since 3.1
+     */
+    public static const int MouseWheel = 37;
+
+    /**
+     * The settings changed event type (value is 39).
+     * <p>
+     * The settings changed event is sent when an operating system
+     * property, such as a system font or color, has been changed.
+     * The event occurs after the property has been changed, but
+     * before any widget is redrawn.  Applications that cache operating
+     * system properties can use this event to update their caches.
+     * A specific property change can be detected by querying the
+     * new value of a property and comparing it with the equivalent
+     * cached value.  The operating system automatically redraws and
+     * lays out all widgets after this event is sent.
+     * </p>
+     *
+     * @see org.eclipse.swt.widgets.Display#addListener
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @since 3.2
+     */
+    public static const int Settings = 39;
+
+    /**
+     * The erase item event type (value is 40).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @since 3.2
+     */
+    public static const int EraseItem = 40;
+
+    /**
+     * The measure item event type (value is 41).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @since 3.2
+     */
+    public static const int MeasureItem = 41;
+
+    /**
+     * The paint item event type (value is 42).
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @since 3.2
+     */
+    public static const int PaintItem = 42;
+
+    /**
+     * The IME composition event type (value is 43).
+     * <p>
+     * The IME composition event is sent to allow
+     * custom text editors to implement in-line
+     * editing of international text.
+     * </p>
+     *
+     * The detail field indicates the action to be taken:
+     * <p><ul>
+     * <li>{@link SWT#COMPOSITION_CHANGED}</li>
+     * <li>{@link SWT#COMPOSITION_OFFSET}</li>
+     * <li>{@link SWT#COMPOSITION_SELECTION}</li>
+     * </ul></p>
+     *
+     * @see org.eclipse.swt.widgets.Widget#addListener
+     * @see org.eclipse.swt.widgets.Display#addFilter
+     * @see org.eclipse.swt.widgets.Event
+     *
+     * @since 3.4
+     */
+    public static const int ImeComposition = 43;
+
+    /* Event Details */
+
+    /**
+     * The IME composition event detail that indicates
+     * a change in the IME composition. The text field
+     * of the event is the new composition text.
+     * The start and end indicate the offsets where the
+     * composition text should be inserted.
+     * The styles and ranges are stored in the IME
+     * object (value is 1).
+     *
+     * @see SWT#ImeComposition
+     *
+     * @since 3.4
+     */
+    public static const int COMPOSITION_CHANGED = 1;
+
+    /**
+     * The IME composition event detail that indicates
+     * that the IME needs the offset for a given location.
+     * The x and y fields of the event are used by the
+     * application to determine the offset.
+     *
+     * The index field of the event should be set to the
+     * text offset at that location. The count field should
+     * be set to indicate whether the location is closer to
+     * the leading edge (0) or the trailing edge (1) (value is 2).
+     *
+     * @see SWT#ImeComposition
+     * @see org.eclipse.swt.graphics.TextLayout#getOffset(int, int, int[])
+     *
+     * @since 3.4
+     */
+    public static const int COMPOSITION_OFFSET = 2;
+
+    /**
+     * The IME composition event detail that indicates
+     * that IME needs the selected text and its start
+     * and end offsets (value is 3).
+     *
+     * @see SWT#ImeComposition
+     *
+     * @since 3.4
+     */
+    public static const int COMPOSITION_SELECTION = 3;
+
+    /**
+     * Indicates that a user-interface component is being dragged,
+     * for example dragging the thumb of a scroll bar (value is 1).
+     */
+    public static const int DRAG = 1;
+
+    /**
+     * Event detail field that indicates a user-interface component
+     * state is selected (value is 1&lt;&lt;1).
+     *
+     * @since 3.2
+     */
+    public static const int SELECTED = 1 << 1;
+
+    /**
+     * Event detail field that indicates a user-interface component
+     * state is focused (value is 1&lt;&lt;2).
+     *
+     * @since 3.2
+     */
+    public static const int FOCUSED = 1 << 2;
+
+    /**
+     * Event detail field that indicates a user-interface component
+     * draws the background (value is 1&lt;&lt;3).
+     *
+     * @since 3.2
+     */
+    public static const int BACKGROUND = 1 << 3;
+
+    /**
+     * Event detail field that indicates a user-interface component
+     * draws the foreground (value is 1&lt;&lt;4).
+     *
+     * @since 3.2
+     */
+    public static const int FOREGROUND = 1 << 4;
+
+    /**
+     * Event detail field that indicates a user-interface component
+     * state is hot (value is 1&lt;&lt;5).
+     *
+     * @since 3.3
+     */
+    public static const int HOT = 1 << 5;
+
+    /* This code is intentionally commented */
+    //public static const int PRESSED = 1 << 3;
+    //public static const int ACTIVE = 1 << 4;
+    //public static const int DISABLED = 1 << 5;
+    //public static const int HOT = 1 << 6;
+    //public static const int DEFAULTED = 1 << 7;
+
+    /**
+     * Traversal event detail field value indicating that no
+     * traversal action should be taken
+     * (value is 0).
+     */
+    public static const int TRAVERSE_NONE = 0;
+
+    /**
+     * Traversal event detail field value indicating that the
+     * key which designates that a dialog should be cancelled was
+     * pressed; typically, this is the ESC key
+     * (value is 1&lt;&lt;1).
+     */
+    public static const int TRAVERSE_ESCAPE = 1 << 1;
+
+    /**
+     * Traversal event detail field value indicating that the
+     * key which activates the default button in a dialog was
+     * pressed; typically, this is the ENTER key
+     * (value is 1&lt;&lt;2).
+     */
+    public static const int TRAVERSE_RETURN = 1 << 2;
+
+    /**
+     * Traversal event detail field value indicating that the
+     * key which designates that focus should be given to the
+     * previous tab group was pressed; typically, this is the
+     * SHIFT-TAB key sequence
+     * (value is 1&lt;&lt;3).
+     */
+    public static const int TRAVERSE_TAB_PREVIOUS = 1 << 3;
+
+    /**
+     * Traversal event detail field value indicating that the
+     * key which designates that focus should be given to the
+     * next tab group was pressed; typically, this is the
+     * TAB key
+     * (value is 1&lt;&lt;4).
+     */
+    public static const int TRAVERSE_TAB_NEXT = 1 << 4;
+
+    /**
+     * Traversal event detail field value indicating that the
+     * key which designates that focus should be given to the
+     * previous tab item was pressed; typically, this is either
+     * the LEFT-ARROW or UP-ARROW keys
+     * (value is 1&lt;&lt;5).
+     */
+    public static const int TRAVERSE_ARROW_PREVIOUS = 1 << 5;
+
+    /**
+     * Traversal event detail field value indicating that the
+     * key which designates that focus should be given to the
+     * previous tab item was pressed; typically, this is either
+     * the RIGHT-ARROW or DOWN-ARROW keys
+     * (value is 1&lt;&lt;6).
+     */
+    public static const int TRAVERSE_ARROW_NEXT = 1 << 6;
+
+    /**
+     * Traversal event detail field value indicating that a
+     * mnemonic key sequence was pressed
+     * (value is 1&lt;&lt;7).
+     */
+    public static const int TRAVERSE_MNEMONIC = 1 << 7;
+
+    /**
+     * Traversal event detail field value indicating that the
+     * key which designates that the previous page of a multi-page
+     * window should be shown was pressed; typically, this
+     * is the CTRL-PAGEUP key sequence
+     * (value is 1&lt;&lt;8).
+     */
+    public static const int TRAVERSE_PAGE_PREVIOUS = 1 << 8;
+
+    /**
+     * Traversal event detail field value indicating that the
+     * key which designates that the next page of a multi-page
+     * window should be shown was pressed; typically, this
+     * is the CTRL-PAGEDOWN key sequence
+     * (value is 1&lt;&lt;9).
+     */
+    public static const int TRAVERSE_PAGE_NEXT = 1 << 9;
+
+    /**
+     * A constant known to be zero (0), typically used in operations
+     * which take bit flags to indicate that "no bits are set".
+     */
+    public static const int NONE = 0;
+
+    /**
+     * A constant known to be zero (0), used in operations which
+     * take pointers to indicate a null argument.
+     */
+    public static const int NULL = 0;
+
+    /**
+     * Indicates that a default should be used (value is -1).
+     */
+    public static const int DEFAULT = -1;
+
+    /**
+     * Indicates that a property is off (value is 0).
+     *
+     * @since 3.1
+     */
+    public static const int OFF = 0;
+
+    /**
+     * Indicates that a property is on (value is 1).
+     *
+     * @since 3.1
+     */
+    public static const int ON = 1;
+
+    /**
+     * Indicates low quality (value is 1).
+     *
+     * @since 3.1
+     */
+    public static const int LOW = 1;
+
+    /**
+     * Indicates high quality (value is 2).
+     *
+     * @since 3.1
+     */
+    public static const int HIGH = 2;
+
+    /**
+     * Style constant for menu bar behavior (value is 1&lt;&lt;1).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Menu</code></li>
+     * </ul></p>
+     */
+    public static const int BAR = 1 << 1;
+
+    /**
+     * Style constant for drop down menu/list behavior (value is 1&lt;&lt;2).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Menu</code></li>
+     * <li><code>ToolItem</code></li>
+     * <li><code>CoolItem</code></li>
+     * <li><code>Combo</code></li>
+     * </ul></p>
+     */
+    public static const int DROP_DOWN = 1 << 2;
+
+    /**
+     * Style constant for pop up menu behavior (value is 1&lt;&lt;3).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Menu</code></li>
+     * </ul></p>
+     */
+    public static const int POP_UP = 1 << 3;
+
+    /**
+     * Style constant for line separator behavior (value is 1&lt;&lt;1).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Label</code></li>
+     * <li><code>MenuItem</code></li>
+     * <li><code>ToolItem</code></li>
+     * </ul></p>
+     */
+    public static const int SEPARATOR = 1 << 1;
+
+    /**
+     * Style constant for toggle button behavior (value is 1&lt;&lt;1).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Button</code></li>
+     * </ul></p>
+     */
+    public static const int TOGGLE = 1 << 1;
+
+    /**
+     * Style constant for arrow button behavior (value is 1&lt;&lt;2).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Button</code></li>
+     * </ul></p>
+     */
+    public static const int ARROW = 1 << 2;
+
+    /**
+     * Style constant for push button behavior (value is 1&lt;&lt;3).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Button</code></li>
+     * <li><code>MenuItem</code></li>
+     * <li><code>ToolItem</code></li>
+     * </ul></p>
+     */
+    public static const int PUSH = 1 << 3;
+
+    /**
+     * Style constant for radio button behavior (value is 1&lt;&lt;4).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Button</code></li>
+     * <li><code>MenuItem</code></li>
+     * <li><code>ToolItem</code></li>
+     * </ul></p>
+     */
+    public static const int RADIO = 1 << 4;
+
+    /**
+     * Style constant for check box behavior (value is 1&lt;&lt;5).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Button</code></li>
+     * <li><code>MenuItem</code></li>
+     * <li><code>ToolItem</code></li>
+     * <li><code>Table</code></li>
+     * <li><code>Tree</code></li>
+     * </ul></p>
+     */
+    public static const int CHECK = 1 << 5;
+
+    /**
+     * Style constant for cascade behavior (value is 1&lt;&lt;6).
+     * <p><b>Used By:</b><ul>
+     * <li><code>MenuItem</code></li>
+     * </ul></p>
+     */
+    public static const int CASCADE = 1 << 6;
+
+    /**
+     * Style constant for multi-selection behavior in lists
+     * and multiple line support on text fields (value is 1&lt;&lt;1).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Text</code></li>
+     * <li><code>List</code></li>
+     * <li><code>FileDialog</code></li>
+     * </ul></p>
+     */
+    public static const int MULTI = 1 << 1;
+
+    /**
+     * Style constant for single selection behavior in lists
+     * and single line support on text fields (value is 1&lt;&lt;2).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Text</code></li>
+     * <li><code>List</code></li>
+     * <li><code>Table</code></li>
+     * <li><code>Tree</code></li>
+     * </ul></p>
+     */
+    public static const int SINGLE = 1 << 2;
+
+    /**
+     * Style constant for read-only behavior (value is 1&lt;&lt;3).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Combo</code></li>
+     * <li><code>Text</code></li>
+     * </ul></p>
+     */
+    public static const int READ_ONLY = 1 << 3;
+
+    /**
+     * Style constant for automatic line wrap behavior (value is 1&lt;&lt;6).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Label</code></li>
+     * <li><code>Text</code></li>
+     * <li><code>ToolBar</code></li>
+     * <li><code>Spinner</code></li>
+     * </ul></p>
+     */
+    public static const int WRAP = 1 << 6;
+
+    /**
+     * Style constant for search behavior (value is 1&lt;&lt;7).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Text</code></li>
+     * </ul></p>
+     *
+     * @since 3.3
+     */
+    public static const int SEARCH = 1 << 7;
+
+    /**
+     * Style constant for simple (not drop down) behavior (value is 1&lt;&lt;6).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Combo</code></li>
+     * </ul></p>
+     */
+    public static const int SIMPLE = 1 << 6;
+
+    /**
+     * Style constant for password behavior (value is 1&lt;&lt;22).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Text</code></li>
+     * </ul></p>
+     *
+     * @since 3.0
+     */
+    public static const int PASSWORD = 1 << 22;
+
+    /**
+     * Style constant for shadow in behavior (value is 1&lt;&lt;2).
+     * <br>Note that this is a <em>HINT</em>.
+     * <p><b>Used By:</b><ul>
+     * <li><code>Label</code></li>
+     * <li><code>Group</code></li>
+     * </ul></p>
+     */
+    public static const int SHADOW_IN = 1 << 2;
+
+    /**
+     * Style constant for shadow out behavior (value is 1&lt;&lt;3).
+     * <br>Note that this is a <em>HINT</em>.
+     * <p><b>Used By:</b><ul>
+     * <li><code>Label</code></li>
+     * <li><code>Group</code></li>
+     * <li><code>ToolBar</code></li>
+     * </ul></p>
+     */
+    public static const int SHADOW_OUT = 1 << 3;
+
+    /**
+     * Style constant for shadow etched in behavior (value is 1&lt;&lt;4).
+     * <br>Note that this is a <em>HINT</em>. It is ignored on all platforms except Motif.
+     * <p><b>Used By:</b><ul>
+     * <li><code>Group</code></li>
+     * </ul></p>
+     */
+    public static const int SHADOW_ETCHED_IN = 1 << 4;
+
+    /**
+     * Style constant for shadow etched out behavior (value is 1&lt;&lt;6).
+     * <br>Note that this is a <em>HINT</em>. It is ignored on all platforms except Motif.
+     * <p><b>Used By:</b><ul>
+     * <li><code>Group</code></li>
+     * </ul></p>
+     */
+    public static const int SHADOW_ETCHED_OUT = 1 << 6;
+
+    /**
+     * Style constant for no shadow behavior (value is 1&lt;&lt;5).
+     * <br>Note that this is a <em>HINT</em>.
+     * <p><b>Used By:</b><ul>
+     * <li><code>Label</code></li>
+     * <li><code>Group</code></li>
+     * </ul></p>
+     */
+    public static const int SHADOW_NONE = 1 << 5;
+
+    /**
+     * Style constant for progress bar behavior (value is 1&lt;&lt;1).
+     * <p><b>Used By:</b><ul>
+     * <li><code>ProgressBar</code></li>
+     * </ul></p>
+     */
+    public static const int INDETERMINATE = 1 << 1;
+
+    /**
+     * Style constant for tool window behavior (value is 1&lt;&lt;2).
+     * <p>
+     * A tool window is a window intended to be used as a floating toolbar.
+     * It typically has a title bar that is shorter than a normal title bar,
+     * and the window title is typically drawn using a smaller font.
+     * <br>Note that this is a <em>HINT</em>.
+     * </p><p><b>Used By:</b><ul>
+     * <li><code>Decorations</code> and subclasses</li>
+     * </ul></p>
+     */
+    public static const int TOOL = 1 << 2;
+
+    /**
+     * Style constant to ensure no trimmings are used (value is 1&lt;&lt;3).
+     * <br>Note that this overrides all other trim styles.
+     * <p><b>Used By:</b><ul>
+     * <li><code>Decorations</code> and subclasses</li>
+     * </ul></p>
+     */
+    public static const int NO_TRIM = 1 << 3;
+
+    /**
+     * Style constant for resize box trim (value is 1&lt;&lt;4).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Decorations</code> and subclasses</li>
+     * <li><code>Tracker</code></li>
+     * </ul></p>
+     */
+    public static const int RESIZE = 1 << 4;
+
+    /**
+     * Style constant for title area trim (value is 1&lt;&lt;5).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Decorations</code> and subclasses</li>
+     * </ul></p>
+     */
+    public static const int TITLE = 1 << 5;
+
+    /**
+     * Style constant for close box trim (value is 1&lt;&lt;6,
+     * since we do not distinguish between CLOSE style and MENU style).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Decorations</code> and subclasses</li>
+     * </ul></p>
+     */
+    public static const int CLOSE = 1 << 6;
+
+    /**
+     * Style constant for shell menu trim (value is 1&lt;&lt;6,
+     * since we do not distinguish between CLOSE style and MENU style).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Decorations</code> and subclasses</li>
+     * </ul></p>
+     */
+    public static const int MENU = CLOSE;
+
+    /**
+     * Style constant for minimize box trim (value is 1&lt;&lt;7).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Decorations</code> and subclasses</li>
+     * </ul></p>
+     */
+    public static const int MIN = 1 << 7;
+
+    /**
+     * Style constant for maximize box trim (value is 1&lt;&lt;10).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Decorations</code> and subclasses</li>
+     * </ul></p>
+     */
+    public static const int MAX = 1 << 10;
+
+    /**
+     * Style constant for horizontal scrollbar behavior (value is 1&lt;&lt;8).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Scrollable</code> and subclasses</li>
+     * </ul></p>
+     */
+    public static const int H_SCROLL = 1 << 8;
+
+    /**
+     * Style constant for vertical scrollbar behavior (value is 1&lt;&lt;9).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Scrollable</code> and subclasses</li>
+     * </ul></p>
+     */
+    public static const int V_SCROLL = 1 << 9;
+
+    /**
+     * Style constant for no scrollbar behavior (value is 1&lt;&lt;4).
+     * <p>
+     * When neither H_SCROLL or V_SCROLL are specified, controls
+     * are free to create the default scroll bars for the control.
+     * Using NO_SCROLL overrides the default and forces the control
+     * to have no scroll bars.
+     *
+     * <b>Used By:</b><ul>
+     * <li><code>Tree</code></li>
+     * <li><code>Table</code></li>
+     * </ul></p>
+     *
+     * @since 3.4
+     */
+    public static const int NO_SCROLL = 1 << 4;
+
+    /**
+     * Style constant for bordered behavior (value is 1&lt;&lt;11).
+     * <br>Note that this is a <em>HINT</em>.
+     * <p><b>Used By:</b><ul>
+     * <li><code>Control</code> and subclasses</li>
+     * </ul></p>
+     */
+    public static const int BORDER = 1 << 11;
+
+    /**
+     * Style constant indicating that the window manager should clip
+     * a widget's children with respect to its viewable area. (value is 1&lt;&lt;12).
+     * <br>Note that this is a <em>HINT</em>.
+     * <p><b>Used By:</b><ul>
+     * <li><code>Control</code> and subclasses</li>
+     * </ul></p>
+     */
+    public static const int CLIP_CHILDREN = 1 << 12;
+
+    /**
+     * Style constant indicating that the window manager should clip
+     * a widget's siblings with respect to its viewable area. (value is 1&lt;&lt;13).
+     * <br>Note that this is a <em>HINT</em>.
+     * <p><b>Used By:</b><ul>
+     * <li><code>Control</code> and subclasses</li>
+     * </ul></p>
+     */
+    public static const int CLIP_SIBLINGS = 1 << 13;
+
+    /**
+     * Style constant for always on top behavior (value is 1&lt;&lt;14).
+     * <br>Note that this is a <em>HINT</em>.
+     * <p><b>Used By:</b><ul>
+     * <li><code>Shell</code> and subclasses</li>
+     * </ul></p>
+     */
+    public static const int ON_TOP = 1 << 14;
+
+    /**
+     * Trim style convenience constant for the most common top level shell appearance
+     * (value is CLOSE|TITLE|MIN|MAX|RESIZE).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Shell</code></li>
+     * </ul></p>
+     */
+    public static const int SHELL_TRIM = CLOSE | TITLE | MIN | MAX | RESIZE;
+
+    /**
+     * Trim style convenience constant for the most common dialog shell appearance
+     * (value is CLOSE|TITLE|BORDER).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Shell</code></li>
+     * </ul></p>
+     */
+    public static const int DIALOG_TRIM = TITLE | CLOSE | BORDER;
+
+    /**
+     * Style constant for modeless behavior (value is 0).
+     * <br>Note that this is a <em>HINT</em>.
+     * <p><b>Used By:</b><ul>
+     * <li><code>Dialog</code></li>
+     * <li><code>Shell</code></li>
+     * </ul></p>
+     */
+    public static const int MODELESS = 0;
+
+    /**
+     * Style constant for primary modal behavior (value is 1&lt;&lt;15).
+     * <br>Note that this is a <em>HINT</em>.
+     * <p><b>Used By:</b><ul>
+     * <li><code>Dialog</code></li>
+     * <li><code>Shell</code></li>
+     * </ul></p>
+     */
+    public static const int PRIMARY_MODAL = 1 << 15;
+
+    /**
+     * Style constant for application modal behavior (value is 1&lt;&lt;16).
+     * <br>Note that this is a <em>HINT</em>.
+     * <p><b>Used By:</b><ul>
+     * <li><code>Dialog</code></li>
+     * <li><code>Shell</code></li>
+     * </ul></p>
+     */
+    public static const int APPLICATION_MODAL = 1 << 16;
+
+    /**
+     * Style constant for system modal behavior (value is 1&lt;&lt;17).
+     * <br>Note that this is a <em>HINT</em>.
+     * <p><b>Used By:</b><ul>
+     * <li><code>Dialog</code></li>
+     * <li><code>Shell</code></li>
+     * </ul></p>
+     */
+    public static const int SYSTEM_MODAL = 1 << 17;
+
+    /**
+     * Style constant for selection hiding behavior when the widget loses focus (value is 1&lt;&lt;15).
+     * <br>Note that this is a <em>HINT</em>.
+     * <p><b>Used By:</b><ul>
+     * <li><code>Table</code></li>
+     * </ul></p>
+     */
+    public static const int HIDE_SELECTION = 1 << 15;
+
+    /**
+     * Style constant for full row selection behavior and
+     * selection constant indicating that a full line should be
+     * drawn. (value is 1&lt;&lt;16).
+     * <br>Note that for some widgets this is a <em>HINT</em>.
+     * <p><b>Used By:</b><ul>
+     * <li><code>Table</code></li>
+     * <li><code>Tree</code></li>
+     * <li><code>StyledText</code></li>
+     * <li><code>TextLayout</code></li>
+     * </ul></p>
+     */
+    public static const int FULL_SELECTION = 1 << 16;
+
+    /**
+     * Style constant for flat appearance. (value is 1&lt;&lt;23).
+     * <br>Note that this is a <em>HINT</em>.
+     * <p><b>Used By:</b><ul>
+     * <li><code>Button</code></li>
+     * <li><code>ToolBar</code></li>
+     * </ul></p>
+     */
+    public static const int FLAT = 1 << 23;
+
+    /**
+     * Style constant for smooth appearance. (value is 1&lt;&lt;16).
+     * <br>Note that this is a <em>HINT</em>.
+     * <p><b>Used By:</b><ul>
+     * <li><code>ProgressBar</code></li>
+     * <li><code>Sash</code></li>
+     * </ul></p>
+     */
+    public static const int SMOOTH = 1 << 16;
+
+    /**
+     * Style constant for no background behavior (value is 1&lt;&lt;18).
+     * <p>
+     * By default, before a widget paints, the client area is filled with the current background.
+     * When this style is specified, the background is not filled, and the application is responsible
+     * for filling every pixel of the client area.
+     * This style might be used as an alternative to "double-buffering" in order to reduce flicker.
+     * This style does not mean "transparent" - widgets that are obscured will not draw through.
+     * </p><p><b>Used By:</b><ul>
+     * <li><code>Composite</code></li>
+     * </ul></p>
+     */
+    public static const int NO_BACKGROUND = 1 << 18;
+
+    /**
+     * Style constant for no focus from the mouse behavior (value is 1&lt;&lt;19).
+     * <p>
+     * Normally, when the user clicks on a control, focus is assigned to that
+     * control, providing the control has no children.  Some controls, such as
+     * tool bars and sashes, don't normally take focus when the mouse is clicked
+     * or accept focus when assigned from within the program.  This style allows
+     * Composites to implement "no focus" mouse behavior.
+     *
+     * <br>Note that this is a <em>HINT</em>.
+     * </p>
+     * <p><b>Used By:</b><ul>
+     * <li><code>Composite</code></li>
+     * </ul></p>
+     */
+    public static const int NO_FOCUS = 1 << 19;
+
+    /**
+     * Style constant for no redraw on resize behavior (value is 1&lt;&lt;20).
+     * <p>
+     * This style stops the entire client area from being invalidated when the size
+     * of the Canvas changes. Specifically, when the size of the Canvas gets smaller,
+     * the SWT.Paint event is not sent. When it gets bigger, an SWT.Paint event is
+     * sent with a GC clipped to only the new areas to be painted. Without this
+     * style, the entire client area will be repainted.
+     *
+     * <br>Note that this is a <em>HINT</em>.
+     * </p><p><b>Used By:</b><ul>
+     * <li><code>Composite</code></li>
+     * </ul></p>
+     */
+    public static const int NO_REDRAW_RESIZE = 1 << 20;
+
+    /**
+     * Style constant for no paint event merging behavior (value is 1&lt;&lt;21).
+     *
+     * <br>Note that this is a <em>HINT</em>.
+     * <p><b>Used By:</b><ul>
+     * <li><code>Composite</code></li>
+     * </ul></p>
+     */
+    public static const int NO_MERGE_PAINTS = 1 << 21;
+
+    /**
+     * Style constant for preventing child radio group behavior (value is 1&lt;&lt;22).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Composite</code></li>
+     * </ul></p>
+     */
+    public static const int NO_RADIO_GROUP = 1 << 22;
+
+    /**
+     * Style constant for left to right orientation (value is 1&lt;&lt;25).
+     * <p>
+     * When orientation is not explicitly specified, orientation is
+     * inherited.  This means that children will be assigned the
+     * orientation of their parent.  To override this behavior and
+     * force an orientation for a child, explicitly set the orientation
+     * of the child when that child is created.
+     * <br>Note that this is a <em>HINT</em>.
+     * </p>
+     * <p><b>Used By:</b><ul>
+     * <li><code>Control</code></li>
+     * <li><code>Menu</code></li>
+     * <li><code>GC</code></li>
+     * </ul></p>
+     *
+     * @since 2.1.2
+     */
+    public static const int LEFT_TO_RIGHT = 1 << 25;
+
+    /**
+     * Style constant for right to left orientation (value is 1&lt;&lt;26).
+     * <p>
+     * When orientation is not explicitly specified, orientation is
+     * inherited.  This means that children will be assigned the
+     * orientation of their parent.  To override this behavior and
+     * force an orientation for a child, explicitly set the orientation
+     * of the child when that child is created.
+     * <br>Note that this is a <em>HINT</em>.
+     * </p>
+     * <p><b>Used By:</b><ul>
+     * <li><code>Control</code></li>
+     * <li><code>Menu</code></li>
+     * <li><code>GC</code></li>
+     * </ul></p>
+     *
+     * @since 2.1.2
+     */
+    public static const int RIGHT_TO_LEFT = 1 << 26;
+
+    /**
+     * Style constant to indicate coordinate mirroring (value is 1&lt;&lt;27).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Control</code></li>
+     * <li><code>Menu</code></li>
+     * </ul></p>
+     *
+     * @since 2.1.2
+     */
+    public static const int MIRRORED = 1 << 27;
+
+    /**
+     * Style constant to allow embedding (value is 1&lt;&lt;24).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Composite</code></li>
+     * </ul></p>
+     *
+     * @since 3.0
+     */
+    public static const int EMBEDDED = 1 << 24;
+
+    /**
+     * Style constant to allow virtual data (value is 1&lt;&lt;28).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Table</code></li>
+     * <li><code>Tree</code></li>
+     * </ul></p>
+     *
+     * @since 3.0
+     */
+    public static const int VIRTUAL = 1 << 28;
+
+    /**
+     * Style constant to indicate double buffering (value is 1&lt;&lt;29).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Control</code></li>
+     * </ul></p>
+     *
+     * @since 3.1
+     */
+    public static const int DOUBLE_BUFFERED = 1 << 29;
+
+    /**
+     * Style constant for transparent behavior (value is 1&lt;&lt;30).
+     * <p>
+     * By default, before a widget paints, the client area is filled with the current background.
+     * When this style is specified, the background is not filled and widgets that are obscured
+     * will draw through.
+     * </p><p><b>Used By:</b><ul>
+     * <li><code>Composite</code></li>
+     * </ul></p>
+     *
+     * @since 3.4
+     *
+     * WARNING: THIS API IS UNDER CONSTRUCTION AND SHOULD NOT BE USED
+     */
+    public static const int TRANSPARENT = 1 << 30;
+
+    /**
+     * Style constant for align up behavior (value is 1&lt;&lt;7,
+     * since align UP and align TOP are considered the same).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Button</code> with <code>ARROW</code> style</li>
+     * <li><code>Tracker</code></li>
+     * <li><code>Table</code></li>
+     * <li><code>Tree</code></li>
+     * </ul></p>
+     */
+    public static const int UP = 1 << 7;
+
+    /**
+     * Style constant to indicate single underline (value is 0).
+     * <p><b>Used By:</b><ul>
+     * <li><code>TextStyle</code></li>
+     * </ul></p>
+     *
+     * @since 3.4
+     */
+    public static const int UNDERLINE_SINGLE = 0;
+
+    /**
+     * Style constant to indicate double underline (value is 1).
+     * <p><b>Used By:</b><ul>
+     * <li><code>TextStyle</code></li>
+     * </ul></p>
+     *
+     * @since 3.4
+     */
+    public static const int UNDERLINE_DOUBLE = 1;
+
+    /**
+     * Style constant to indicate error underline (value is 2).
+     * <p><b>Used By:</b><ul>
+     * <li><code>TextStyle</code></li>
+     * </ul></p>
+     *
+     * @since 3.4
+     */
+    public static const int UNDERLINE_ERROR = 2;
+
+    /**
+     * Style constant to indicate squiggle underline (value is 3).
+     * <p><b>Used By:</b><ul>
+     * <li><code>TextStyle</code></li>
+     * </ul></p>
+     *
+     * @since 3.4
+     */
+    public static const int UNDERLINE_SQUIGGLE = 3;
+
+    /**
+     * Style constant to indicate solid border (value is 1).
+     * <p><b>Used By:</b><ul>
+     * <li><code>TextStyle</code></li>
+     * </ul></p>
+     *
+     * @since 3.4
+     */
+    public static const int BORDER_SOLID = 1;
+
+    /**
+     * Style constant to indicate dashed border (value is 2).
+     * <p><b>Used By:</b><ul>
+     * <li><code>TextStyle</code></li>
+     * </ul></p>
+     *
+     * @since 3.4
+     */
+    public static const int BORDER_DASH = 2;
+
+    /**
+     * Style constant to indicate dotted border (value is 4).
+     * <p><b>Used By:</b><ul>
+     * <li><code>TextStyle</code></li>
+     * </ul></p>
+     *
+     * @since 3.4
+     */
+    public static const int BORDER_DOT = 4;
+
+    /**
+     * Style constant for align top behavior (value is 1&lt;&lt;7,
+     * since align UP and align TOP are considered the same).
+     * <p><b>Used By:</b><ul>
+     * <li><code>FormAttachment</code> in a <code>FormLayout</code></li>
+     * </ul></p>
+     */
+    public static const int TOP = UP;
+
+    /**
+     * Style constant for align down behavior (value is 1&lt;&lt;10,
+     * since align DOWN and align BOTTOM are considered the same).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Button</code> with <code>ARROW</code> style</li>
+     * <li><code>Tracker</code></li>
+     * <li><code>Table</code></li>
+     * <li><code>Tree</code></li>
+     * </ul></p>
+     */
+    public static const int DOWN               = 1 << 10;
+
+    /**
+     * Style constant for align bottom behavior (value is 1&lt;&lt;10,
+     * since align DOWN and align BOTTOM are considered the same).
+     * <p><b>Used By:</b><ul>
+     * <li><code>FormAttachment</code> in a <code>FormLayout</code></li>
+     * </ul></p>
+     */
+    public static const int BOTTOM             = DOWN;
+
+    /**
+     * Style constant for leading alignment (value is 1&lt;&lt;14).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Button</code></li>
+     * <li><code>Label</code></li>
+     * <li><code>TableColumn</code></li>
+     * <li><code>Tracker</code></li>
+     * <li><code>FormAttachment</code> in a <code>FormLayout</code></li>
+     * </ul></p>
+     *
+     * @since 2.1.2
+     */
+    public static const int LEAD               = 1 << 14;
+
+    /**
+     * Style constant for align left behavior (value is 1&lt;&lt;14).
+     * This is a synonym for LEAD (value is 1&lt;&lt;14).  Newer
+     * applications should use LEAD instead of LEFT to make code more
+     * understandable on right-to-left platforms.
+     */
+    public static const int LEFT               = LEAD;
+
+    /**
+     * Style constant for trailing alignment (value is 1&lt;&lt;17).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Button</code></li>
+     * <li><code>Label</code></li>
+     * <li><code>TableColumn</code></li>
+     * <li><code>Tracker</code></li>
+     * <li><code>FormAttachment</code> in a <code>FormLayout</code></li>
+     * </ul></p>
+     *
+     * @since 2.1.2
+     */
+    public static const int TRAIL              = 1 << 17;
+
+    /**
+     * Style constant for align right behavior (value is 1&lt;&lt;17).
+     * This is a synonym for TRAIL (value is 1&lt;&lt;17).  Newer
+     * applications should use TRAIL instead of RIGHT to make code more
+     * understandable on right-to-left platforms.
+     */
+    public static const int RIGHT              = TRAIL;
+
+    /**
+     * Style constant for align center behavior (value is 1&lt;&lt;24).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Button</code></li>
+     * <li><code>Label</code></li>
+     * <li><code>TableColumn</code></li>
+     * <li><code>FormAttachment</code> in a <code>FormLayout</code></li>
+     * </ul></p>
+     */
+    public static const int CENTER = 1 << 24;
+
+    /**
+     * Style constant for horizontal alignment or orientation behavior (value is 1&lt;&lt;8).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Label</code></li>
+     * <li><code>ProgressBar</code></li>
+     * <li><code>Sash</code></li>
+     * <li><code>Scale</code></li>
+     * <li><code>ScrollBar</code></li>
+     * <li><code>Slider</code></li>
+     * <li><code>ToolBar</code></li>
+     * <li><code>FillLayout</code> type</li>
+     * <li><code>RowLayout</code> type</li>
+     * </ul></p>
+     */
+    public static const int HORIZONTAL = 1 << 8;
+
+    /**
+     * Style constant for vertical alignment or orientation behavior (value is 1&lt;&lt;9).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Label</code></li>
+     * <li><code>ProgressBar</code></li>
+     * <li><code>Sash</code></li>
+     * <li><code>Scale</code></li>
+     * <li><code>ScrollBar</code></li>
+     * <li><code>Slider</code></li>
+     * <li><code>ToolBar</code></li>
+     * <li><code>CoolBar</code></li>
+     * <li><code>FillLayout</code> type</li>
+     * <li><code>RowLayout</code> type</li>
+     * </ul></p>
+     */
+    public static const int VERTICAL = 1 << 9;
+
+    /**
+     * Style constant for date display (value is 1&lt;&lt;5).
+     * <p><b>Used By:</b><ul>
+     * <li><code>DateTime</code></li>
+     * </ul></p>
+     *
+     * @since 3.3
+     */
+    public static const int DATE = 1 << 5;
+
+    /**
+     * Style constant for time display (value is 1&lt;&lt;7).
+     * <p><b>Used By:</b><ul>
+     * <li><code>DateTime</code></li>
+     * </ul></p>
+     *
+     * @since 3.3
+     */
+    public static const int TIME = 1 << 7;
+
+    /**
+     * Style constant for calendar display (value is 1&lt;&lt;10).
+     * <p><b>Used By:</b><ul>
+     * <li><code>DateTime</code></li>
+     * </ul></p>
+     *
+     * @since 3.3
+     */
+    public static const int CALENDAR = 1 << 10;
+
+    /**
+     * Style constant for short date/time format (value is 1&lt;&lt;15).
+     * <p>
+     * A short date displays the month and year.
+     * A short time displays hours and minutes.
+     * <br>Note that this is a <em>HINT</em>.
+     * </p>
+     * <p><b>Used By:</b><ul>
+     * <li><code>DateTime</code></li>
+     * </ul></p>
+     *
+     * @since 3.3
+     */
+    public static const int SHORT = 1 << 15;
+
+    /**
+     * Style constant for medium date/time format (value is 1&lt;&lt;16).
+     * <p>
+     * A medium date displays the day, month and year.
+     * A medium time displays hours, minutes, and seconds.
+     * <br>Note that this is a <em>HINT</em>.
+     * </p>
+     * <p><b>Used By:</b><ul>
+     * <li><code>DateTime</code></li>
+     * </ul></p>
+     *
+     * @since 3.3
+     */
+    public static const int MEDIUM = 1 << 16;
+
+    /**
+     * Style constant for long date/time format (value is 1&lt;&lt;28).
+     * <p>
+     * A long date displays the day, month and year.
+     * A long time displays hours, minutes, and seconds.
+     * The day and month names may be displayed.
+     * <br>Note that this is a <em>HINT</em>.
+     * </p>
+     * <p><b>Used By:</b><ul>
+     * <li><code>DateTime</code></li>
+     * </ul></p>
+     *
+     * @since 3.3
+     */
+    public static const int LONG = 1 << 28;
+
+    /**
+     * Style constant specifying that a Browser should use a Mozilla GRE
+     * for rendering its content (value is 1&lt;&lt;15).
+     * <p>
+     * <p><b>Used By:</b><ul>
+     * <li><code>Browser</code></li>
+     * </ul></p>
+     *
+     * @since 3.3
+     */
+    public static const int MOZILLA = 1 << 15;
+
+    /**
+     * Style constant for balloon behavior (value is 1&lt;&lt;12).
+     * <p><b>Used By:</b><ul>
+     * <li><code>ToolTip</code></li>
+     * </ul></p>
+     *
+     * @since 3.2
+     */
+    public static const int BALLOON = 1 << 12;
+
+    /**
+     * Style constant for vertical alignment or orientation behavior (value is 1).
+     * <p><b>Used By:</b><ul>
+     * <li><code>GridLayout</code> type</li>
+     * </ul></p>
+     */
+    public static const int BEGINNING = 1;
+
+    /**
+     * Style constant for vertical alignment or orientation behavior (value is 4).
+     * <p><b>Used By:</b><ul>
+     * <li><code>GridLayout</code> type</li>
+     * </ul></p>
+     */
+    public static const int FILL = 4;
+
+    /**
+     * Input Method Editor style constant for double byte
+     * input behavior (value is 1&lt;&lt;1).
+     */
+    public static const int DBCS = 1 << 1;
+
+    /**
+     * Input Method Editor style constant for alpha
+     * input behavior (value is 1&lt;&lt;2).
+     */
+    public static const int ALPHA = 1 << 2;
+
+    /**
+     * Input Method Editor style constant for native
+     * input behavior (value is 1&lt;&lt;3).
+     */
+    public static const int NATIVE = 1 << 3;
+
+    /**
+     * Input Method Editor style constant for phonetic
+     * input behavior (value is 1&lt;&lt;4).
+     */
+    public static const int PHONETIC = 1 << 4;
+
+    /**
+     * Input Method Editor style constant for romanicized
+     * input behavior (value is 1&lt;&lt;5).
+     */
+    public static const int ROMAN = 1 << 5;
+
+    /**
+     * ASCII character convenience constant for the backspace character
+     * (value is the <code>char</code> '\b').
+     */
+    public static const char BS = '\b';
+
+    /**
+     * ASCII character convenience constant for the carriage return character
+     * (value is the <code>char</code> '\r').
+     */
+    public static const char CR = '\r';
+
+    /**
+     * ASCII character convenience constant for the delete character
+     * (value is the <code>char</code> with value 127).
+     */
+    public static const char DEL = 0x7F;
+
+    /**
+     * ASCII character convenience constant for the escape character
+     * (value is the <code>char</code> with value 27).
+     */
+    public static const char ESC = 0x1B;
+
+    /**
+     * ASCII character convenience constant for the line feed character
+     * (value is the <code>char</code> '\n').
+     */
+    public static const char LF = '\n';
+
+    /**
+     * ASCII character convenience constant for the tab character
+     * (value is the <code>char</code> '\t').
+     *
+     * @since 2.1
+     */
+    public static const char TAB = '\t';
+
+    /**
+     * keyboard and/or mouse event mask indicating that the ALT key
+     * was pushed on the keyboard when the event was generated
+     * (value is 1&lt;&lt;16).
+     */
+    public static const int ALT = 1 << 16;
+
+    /**
+     * Keyboard and/or mouse event mask indicating that the SHIFT key
+     * was pushed on the keyboard when the event was generated
+     * (value is 1&lt;&lt;17).
+     */
+    public static const int SHIFT = 1 << 17;
+
+    /**
+     * Keyboard and/or mouse event mask indicating that the CTRL key
+     * was pushed on the keyboard when the event was generated
+     * (value is 1&lt;&lt;18).
+     */
+    public static const int CTRL = 1 << 18;
+
+    /**
+     * Keyboard and/or mouse event mask indicating that the CTRL key
+     * was pushed on the keyboard when the event was generated. This
+     * is a synonym for CTRL (value is 1&lt;&lt;18).
+     */
+    public static const int CONTROL = CTRL;
+
+    /**
+     * Keyboard and/or mouse event mask indicating that the COMMAND key
+     * was pushed on the keyboard when the event was generated
+     * (value is 1&lt;&lt;22).
+     *
+     * @since 2.1
+     */
+    public static const int COMMAND = 1 << 22;
+
+    /**
+     * Keyboard and/or mouse event mask indicating all possible
+     * keyboard modifiers.
+     *
+     * To allow for the future, this mask  is intended to be used in
+     * place of code that references  each individual keyboard mask.
+     *  For example, the following expression will determine whether
+     * any modifier is pressed and will continue to work as new modifier
+     * masks are added.
+     *
+     * <code>(stateMask & SWT.MODIFIER_MASK) != 0</code>.
+     *
+     * @since 2.1
+     */
+    public static const int MODIFIER_MASK = ALT | SHIFT | CTRL | COMMAND;
+
+    /**
+     * Keyboard and/or mouse event mask indicating that mouse button one
+     * was pushed when the event was generated. (value is 1&lt;&lt;19).
+     */
+    public static const int BUTTON1 = 1 << 19;
+
+    /**
+     * Keyboard and/or mouse event mask indicating that mouse button two
+     * was pushed when the event was generated. (value is 1&lt;&lt;20).
+     */
+    public static const int BUTTON2 = 1 << 20;
+
+    /**
+     * Keyboard and/or mouse event mask indicating that mouse button three
+     * was pushed when the event was generated. (value is 1&lt;&lt;21).
+     */
+    public static const int BUTTON3 = 1 << 21;
+
+    /**
+     * Keyboard and/or mouse event mask indicating that mouse button four
+     * was pushed when the event was generated. (value is 1&lt;&lt;23).
+     *
+     * @since 3.1
+     */
+    public static const int BUTTON4 = 1 << 23;
+
+    /**
+     * Keyboard and/or mouse event mask indicating that mouse button five
+     * was pushed when the event was generated. (value is 1&lt;&lt;25).
+     *
+     * @since 3.1
+     */
+    public static const int BUTTON5 = 1 << 25;
+
+    /**
+     * Keyboard and/or mouse event mask indicating all possible
+     * mouse buttons.
+     *
+     * To allow for the future, this mask  is intended to be used
+     * in place of code that references each individual button mask.
+     * For example, the following expression will determine whether
+     * any button is pressed and will continue to work as new button
+     * masks are added.
+     *
+     * <code>(stateMask & SWT.BUTTON_MASK) != 0</code>.
+     *
+     * @since 2.1
+     */
+    public static const int BUTTON_MASK = BUTTON1 | BUTTON2 | BUTTON3 | BUTTON4 | BUTTON5;
+
+    /**
+     * Keyboard and/or mouse event mask indicating that the MOD1 key
+     * was pushed on the keyboard when the event was generated.
+     *
+     * This is the primary keyboard modifier for the platform.
+     *
+     * @since 2.1
+     */
+    version(CARBON){
+        public static const int MOD1 = COMMAND;
+    }
+    else{
+        public static const int MOD1 = CONTROL;
+    }
+
+    /**
+     * Keyboard and/or mouse event mask indicating that the MOD2 key
+     * was pushed on the keyboard when the event was generated.
+     *
+     * This is the secondary keyboard modifier for the platform.
+     *
+     * @since 2.1
+     */
+    version(CARBON){
+        public static const int MOD2 = SHIFT;
+    }
+    else{
+        public static const int MOD2 = SHIFT;
+    }
+
+    /**
+     * Keyboard and/or mouse event mask indicating that the MOD3 key
+     * was pushed on the keyboard when the event was generated.
+     *
+     * @since 2.1
+     */
+    version(CARBON){
+        public static const int MOD3 = ALT;
+    }
+    else{
+        public static const int MOD3 = ALT;
+    }
+
+    /**
+     * Keyboard and/or mouse event mask indicating that the MOD4 key
+     * was pushed on the keyboard when the event was generated.
+     *
+     * @since 2.1
+     */
+    version(CARBON){
+        public static const int MOD4 = CONTROL;
+    }
+    else{
+        public static const int MOD4 = 0;
+    }
+
+    /**
+     * Constants to indicate line scrolling (value is 1).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Control</code></li>
+     * </ul></p>
+     *
+     * @since 3.1
+     */
+    public static const int SCROLL_LINE = 1;
+
+    /**
+     * Constants to indicate page scrolling (value is 2).
+     * <p><b>Used By:</b><ul>
+     * <li><code>Control</code></li>
+     * </ul></p>
+     *
+     * @since 3.1
+     */
+    public static const int SCROLL_PAGE = 2;
+
+    /**
+     * Accelerator constant used to differentiate a key code from a
+     * unicode character.
+     *
+     * If this bit is set, then the key stroke
+     * portion of an accelerator represents a key code.  If this bit
+     * is not set, then the key stroke portion of an accelerator is
+     * a unicode character.
+     *
+     * The following expression is false:
+     *
+     * <code>((SWT.MOD1 | SWT.MOD2 | 'T') & SWT.KEYCODE_BIT) != 0</code>.
+     *
+     * The following expression is true:
+     *
+     * <code>((SWT.MOD3 | SWT.F2) & SWT.KEYCODE_BIT) != 0</code>.
+     *
+     * (value is (1&lt;&lt;24))
+     *
+     * @since 2.1
+     */
+    public static const int KEYCODE_BIT = (1 << 24);
+
+    /**
+     * Accelerator constant used to extract the key stroke portion of
+     * an accelerator.
+     *
+     * The key stroke may be a key code or a unicode
+     * value.  If the key stroke is a key code <code>KEYCODE_BIT</code>
+     * will be set.
+     *
+     * @since 2.1
+     */
+    public static const int KEY_MASK = KEYCODE_BIT + 0xFFFF;
+
+    /**
+     * Keyboard event constant representing the UP ARROW key
+     * (value is (1&lt;&lt;24)+1).
+     */
+    public static const int ARROW_UP = KEYCODE_BIT + 1;
+
+    /**
+     * Keyboard event constant representing the DOWN ARROW key
+     * (value is (1&lt;&lt;24)+2).
+     */
+    public static const int ARROW_DOWN = KEYCODE_BIT + 2;
+
+    /**
+     * Keyboard event constant representing the LEFT ARROW key
+     * (value is (1&lt;&lt;24)+3).
+     */
+    public static const int ARROW_LEFT = KEYCODE_BIT + 3;
+
+    /**
+     * Keyboard event constant representing the RIGHT ARROW key
+     * (value is (1&lt;&lt;24)+4).
+     */
+    public static const int ARROW_RIGHT = KEYCODE_BIT + 4;
+
+    /**
+     * Keyboard event constant representing the PAGE UP key
+     * (value is (1&lt;&lt;24)+5).
+     */
+    public static const int PAGE_UP = KEYCODE_BIT + 5;
+
+    /**
+     * Keyboard event constant representing the PAGE DOWN key
+     * (value is (1&lt;&lt;24)+6).
+     */
+    public static const int PAGE_DOWN = KEYCODE_BIT + 6;
+
+    /**
+     * Keyboard event constant representing the HOME key
+     * (value is (1&lt;&lt;24)+7).
+     */
+    public static const int HOME = KEYCODE_BIT + 7;
+
+    /**
+     * Keyboard event constant representing the END key
+     * (value is (1&lt;&lt;24)+8).
+     */
+    public static const int END = KEYCODE_BIT + 8;
+
+    /**
+     * Keyboard event constant representing the INSERT key
+     * (value is (1&lt;&lt;24)+9).
+     */
+    public static const int INSERT = KEYCODE_BIT + 9;
+
+    /**
+     * Keyboard event constant representing the F1 key
+     * (value is (1&lt;&lt;24)+10).
+     */
+    public static const int F1 = KEYCODE_BIT + 10;
+
+    /**
+     * Keyboard event constant representing the F2 key
+     * (value is (1&lt;&lt;24)+11).
+     */
+    public static const int F2 = KEYCODE_BIT + 11;
+
+    /**
+     * Keyboard event constant representing the F3 key
+     * (value is (1&lt;&lt;24)+12).
+     */
+    public static const int F3 = KEYCODE_BIT + 12;
+
+    /**
+     * Keyboard event constant representing the F4 key
+     * (value is (1&lt;&lt;24)+13).
+     */
+    public static const int F4 = KEYCODE_BIT + 13;
+
+    /**
+     * Keyboard event constant representing the F5 key
+     * (value is (1&lt;&lt;24)+14).
+     */
+    public static const int F5 = KEYCODE_BIT + 14;
+
+    /**
+     * Keyboard event constant representing the F6 key
+     * (value is (1&lt;&lt;24)+15).
+     */
+    public static const int F6 = KEYCODE_BIT + 15;
+
+    /**
+     * Keyboard event constant representing the F7 key
+     * (value is (1&lt;&lt;24)+16).
+     */
+    public static const int F7 = KEYCODE_BIT + 16;
+
+    /**
+     * Keyboard event constant representing the F8 key
+     * (value is (1&lt;&lt;24)+17).
+     */
+    public static const int F8 = KEYCODE_BIT + 17;
+
+    /**
+     * Keyboard event constant representing the F9 key
+     * (value is (1&lt;&lt;24)+18).
+     */
+    public static const int F9 = KEYCODE_BIT + 18;
+
+    /**
+     * Keyboard event constant representing the F10 key
+     * (value is (1&lt;&lt;24)+19).
+     */
+    public static const int F10 = KEYCODE_BIT + 19;
+
+    /**
+     * Keyboard event constant representing the F11 key
+     * (value is (1&lt;&lt;24)+20).
+     */
+    public static const int F11 = KEYCODE_BIT + 20;
+
+    /**
+     * Keyboard event constant representing the F12 key
+     * (value is (1&lt;&lt;24)+21).
+     */
+    public static const int F12 = KEYCODE_BIT + 21;
+
+    /**
+     * Keyboard event constant representing the F13 key
+     * (value is (1&lt;&lt;24)+22).
+     *
+     * @since 3.0
+     */
+    public static const int F13 = KEYCODE_BIT + 22;
+
+    /**
+     * Keyboard event constant representing the F14 key
+     * (value is (1&lt;&lt;24)+23).
+     *
+     * @since 3.0
+     */
+    public static const int F14 = KEYCODE_BIT + 23;
+
+    /**
+     * Keyboard event constant representing the F15 key
+     * (value is (1&lt;&lt;24)+24).
+     *
+     * @since 3.0
+     */
+    public static const int F15 = KEYCODE_BIT + 24;
+
+    /**
+     * Keyboard event constant representing the numeric key
+     * pad multiply key (value is (1&lt;&lt;24)+42).
+     *
+     * @since 3.0
+     */
+    public static const int KEYPAD_MULTIPLY = KEYCODE_BIT + 42;
+
+    /**
+     * Keyboard event constant representing the numeric key
+     * pad add key (value is (1&lt;&lt;24)+43).
+     *
+     * @since 3.0
+     */
+    public static const int KEYPAD_ADD = KEYCODE_BIT + 43;
+
+    /**
+     * Keyboard event constant representing the numeric key
+     * pad subtract key (value is (1&lt;&lt;24)+45).
+     *
+     * @since 3.0
+     */
+    public static const int KEYPAD_SUBTRACT = KEYCODE_BIT + 45;
+
+    /**
+     * Keyboard event constant representing the numeric key
+     * pad decimal key (value is (1&lt;&lt;24)+46).
+     *
+     * @since 3.0
+     */
+    public static const int KEYPAD_DECIMAL = KEYCODE_BIT + 46;
+
+    /**
+     * Keyboard event constant representing the numeric key
+     * pad divide key (value is (1&lt;&lt;24)+47).
+     *
+     * @since 3.0
+     */
+    public static const int KEYPAD_DIVIDE = KEYCODE_BIT + 47;
+
+    /**
+     * Keyboard event constant representing the numeric key
+     * pad zero key (value is (1&lt;&lt;24)+48).
+     *
+     * @since 3.0
+     */
+    public static const int KEYPAD_0 = KEYCODE_BIT + 48;
+
+    /**
+     * Keyboard event constant representing the numeric key
+     * pad one key (value is (1&lt;&lt;24)+49).
+     *
+     * @since 3.0
+     */
+    public static const int KEYPAD_1 = KEYCODE_BIT + 49;
+
+    /**
+     * Keyboard event constant representing the numeric key
+     * pad two key (value is (1&lt;&lt;24)+50).
+     *
+     * @since 3.0
+     */
+    public static const int KEYPAD_2 = KEYCODE_BIT + 50;
+
+    /**
+     * Keyboard event constant representing the numeric key
+     * pad three key (value is (1&lt;&lt;24)+51).
+     *
+     * @since 3.0
+     */
+    public static const int KEYPAD_3 = KEYCODE_BIT + 51;
+
+    /**
+     * Keyboard event constant representing the numeric key
+     * pad four key (value is (1&lt;&lt;24)+52).
+     *
+     * @since 3.0
+     */
+    public static const int KEYPAD_4 = KEYCODE_BIT + 52;
+
+    /**
+     * Keyboard event constant representing the numeric key
+     * pad five key (value is (1&lt;&lt;24)+53).
+     *
+     * @since 3.0
+     */
+    public static const int KEYPAD_5 = KEYCODE_BIT + 53;
+
+    /**
+     * Keyboard event constant representing the numeric key
+     * pad six key (value is (1&lt;&lt;24)+54).
+     *
+     * @since 3.0
+     */
+    public static const int KEYPAD_6 = KEYCODE_BIT + 54;
+
+    /**
+     * Keyboard event constant representing the numeric key
+     * pad seven key (value is (1&lt;&lt;24)+55).
+     *
+     * @since 3.0
+     */
+    public static const int KEYPAD_7 = KEYCODE_BIT + 55;
+
+    /**
+     * Keyboard event constant representing the numeric key
+     * pad eight key (value is (1&lt;&lt;24)+56).
+     *
+     * @since 3.0
+     */
+    public static const int KEYPAD_8 = KEYCODE_BIT + 56;
+
+    /**
+     * Keyboard event constant representing the numeric key
+     * pad nine key (value is (1&lt;&lt;24)+57).
+     *
+     * @since 3.0
+     */
+    public static const int KEYPAD_9 = KEYCODE_BIT + 57;
+
+    /**
+     * Keyboard event constant representing the numeric key
+     * pad equal key (value is (1&lt;&lt;24)+61).
+     *
+     * @since 3.0
+     */
+    public static const int KEYPAD_EQUAL = KEYCODE_BIT + 61;
+
+    /**
+     * Keyboard event constant representing the numeric key
+     * pad enter key (value is (1&lt;&lt;24)+80).
+     *
+     * @since 3.0
+     */
+    public static const int KEYPAD_CR = KEYCODE_BIT + 80;
+
+    /**
+     * Keyboard event constant representing the help
+     * key (value is (1&lt;&lt;24)+81).
+     *
+     * NOTE: The HELP key maps to the key labeled "help",
+     * not "F1". If your keyboard does not have a HELP key,
+     * you will never see this key press.  To listen for
+     * help on a control, use SWT.Help.
+     *
+     * @since 3.0
+     *
+     * @see SWT#Help
+     */
+    public static const int HELP = KEYCODE_BIT + 81;
+
+    /**
+     * Keyboard event constant representing the caps
+     * lock key (value is (1&lt;&lt;24)+82).
+     *
+     * @since 3.0
+     */
+    public static const int CAPS_LOCK = KEYCODE_BIT + 82;
+
+    /**
+     * Keyboard event constant representing the num
+     * lock key (value is (1&lt;&lt;24)+83).
+     *
+     * @since 3.0
+     */
+    public static const int NUM_LOCK = KEYCODE_BIT + 83;
+
+    /**
+     * Keyboard event constant representing the scroll
+     * lock key (value is (1&lt;&lt;24)+84).
+     *
+     * @since 3.0
+     */
+    public static const int SCROLL_LOCK = KEYCODE_BIT + 84;
+
+    /**
+     * Keyboard event constant representing the pause
+     * key (value is (1&lt;&lt;24)+85).
+     *
+     * @since 3.0
+     */
+    public static const int PAUSE = KEYCODE_BIT + 85;
+
+    /**
+     * Keyboard event constant representing the break
+     * key (value is (1&lt;&lt;24)+86).
+     *
+     * @since 3.0
+     */
+    public static const int BREAK = KEYCODE_BIT + 86;
+
+    /**
+     * Keyboard event constant representing the print screen
+     * key (value is (1&lt;&lt;24)+87).
+     *
+     * @since 3.0
+     */
+    public static const int PRINT_SCREEN = KEYCODE_BIT + 87;
+
+    /**
+     * The <code>MessageBox</code> style constant for error icon
+     * behavior (value is 1).
+     */
+    public static const int ICON_ERROR = 1;
+
+    /**
+     * The <code>MessageBox</code> style constant for information icon
+     * behavior (value is 1&lt;&lt;1).
+     */
+    public static const int ICON_INFORMATION = 1 << 1;
+
+    /**
+     * The <code>MessageBox</code> style constant for question icon
+     * behavior (value is 1&lt;&lt;2).
+     */
+    public static const int ICON_QUESTION = 1 << 2;
+
+    /**
+     * The <code>MessageBox</code> style constant for warning icon
+     * behavior (value is 1&lt;&lt;3).
+     */
+    public static const int ICON_WARNING = 1 << 3;
+
+    /**
+     * The <code>MessageBox</code> style constant for "working" icon
+     * behavior (value is 1&lt;&lt;4).
+     */
+    public static const int ICON_WORKING = 1 << 4;
+
+    /**
+     * The <code>MessageBox</code> style constant for an OK button;
+     * valid combinations are OK, OK|CANCEL
+     * (value is 1&lt;&lt;5).
+     */
+    public static const int OK = 1 << 5;
+
+    /**
+     * The <code>MessageBox</code> style constant for YES button;
+     * valid combinations are YES|NO, YES|NO|CANCEL
+     * (value is 1&lt;&lt;6).
+     */
+    public static const int YES = 1 << 6;
+
+    /**
+     * The <code>MessageBox</code> style constant for NO button;
+     * valid combinations are YES|NO, YES|NO|CANCEL
+     * (value is 1&lt;&lt;7).
+     */
+    public static const int NO = 1 << 7;
+
+    /**
+     * The <code>MessageBox</code> style constant for a CANCEL button;
+     * valid combinations are OK|CANCEL, YES|NO|CANCEL, RETRY|CANCEL
+     * (value is 1&lt;&lt;8).  This style constant is also used with
+     * <code>Text</code> in combination with SEARCH.
+     *
+     * <p><b>Used By:</b><ul>
+     * <li><code>MessageBox</code></li>
+     * <li><code>Text</code></li>
+     * </ul></p>
+     */
+    public static const int CANCEL = 1 << 8;
+
+    /**
+     * The <code>MessageBox</code> style constant for an ABORT button;
+     * the only valid combination is ABORT|RETRY|IGNORE
+     * (value is 1&lt;&lt;9).
+     */
+    public static const int ABORT = 1 << 9;
+
+    /**
+     * The <code>MessageBox</code> style constant for a RETRY button;
+     *  valid combinations are ABORT|RETRY|IGNORE, RETRY|CANCEL
+     * (value is 1&lt;&lt;10).
+     */
+    public static const int RETRY = 1 << 10;
+
+    /**
+     * The <code>MessageBox</code> style constant for an IGNORE button;
+     * the only valid combination is ABORT|RETRY|IGNORE
+     * (value is 1&lt;&lt;11).
+     */
+    public static const int IGNORE = 1 << 11;
+
+    /**
+     * The <code>FileDialog</code> style constant for open file dialog behavior
+     * (value is 1&lt;&lt;12).
+     */
+    public static const int OPEN = 1 << 12;
+
+    /**
+     * The <code>FileDialog</code> style constant for save file dialog behavior
+     * (value is 1&lt;&lt;13).
+     */
+    public static const int SAVE = 1 << 13;
+
+    /**
+     * The <code>Composite</code> constant to indicate that
+     * an attribute (such as background) is not inherited
+     * by the children (value is 0).
+     *
+     * @since 3.2
+     */
+    public static const int INHERIT_NONE = 0;
+
+    /**
+     * The <code>Composite</code> constant to indicate that
+     * an attribute (such as background) is inherited by
+     * children who choose this value as their "default"
+     * (value is 1).  For example, a label child will
+     * typically choose to inherit the background color
+     * of a composite while a list or table will not.
+     *
+     * @since 3.2
+     */
+    public static const int INHERIT_DEFAULT = 1;
+
+    /**
+     * The <code>Composite</code> constant to indicate that
+     * an attribute (such as background) is inherited by
+     * all children.
+     *
+     * @since 3.2
+     */
+    public static const int INHERIT_FORCE = 2;
+
+    /**
+     * Default color white (value is 1).
+     */
+    public static const int COLOR_WHITE = 1;
+
+    /**
+     * Default color black (value is 2).
+     */
+    public static const int COLOR_BLACK = 2;
+
+    /**
+     * Default color red (value is 3).
+     */
+    public static const int COLOR_RED = 3;
+
+    /**
+     * Default color dark red (value is 4).
+     */
+    public static const int COLOR_DARK_RED = 4;
+
+    /**
+     * Default color green (value is 5).
+     */
+    public static const int COLOR_GREEN = 5;
+
+    /**
+     * Default color dark green (value is 6).
+     */
+    public static const int COLOR_DARK_GREEN = 6;
+
+    /**
+     * Default color yellow (value is 7).
+     */
+    public static const int COLOR_YELLOW = 7;
+
+    /**
+     * Default color dark yellow (value is 8).
+     */
+    public static const int COLOR_DARK_YELLOW = 8;
+
+    /**
+     * Default color blue (value is 9).
+     */
+    public static const int COLOR_BLUE = 9;
+
+    /**
+     * Default color dark blue (value is 10).
+     */
+    public static const int COLOR_DARK_BLUE = 10;
+
+    /**
+     * Default color magenta (value is 11).
+     */
+    public static const int COLOR_MAGENTA = 11;
+
+    /**
+     * Default color dark magenta (value is 12).
+     */
+    public static const int COLOR_DARK_MAGENTA = 12;
+
+    /**
+     * Default color cyan (value is 13).
+     */
+    public static const int COLOR_CYAN = 13;
+
+    /**
+     * Default color dark cyan (value is 14).
+     */
+    public static const int COLOR_DARK_CYAN = 14;
+
+    /**
+     * Default color gray (value is 15).
+     */
+    public static const int COLOR_GRAY = 15;
+
+    /**
+     * Default color dark gray (value is 16).
+     */
+    public static const int COLOR_DARK_GRAY = 16;
+
+    /*
+     * System Colors
+     *
+     * Dealing with system colors is an area where there are
+     * many platform differences.  On some platforms, system
+     * colors can change dynamically while the program is
+     * running.  On other platforms, system colors can be
+     * changed for all instances of a particular widget.
+     * Therefore, the only truly portable method to obtain
+     * a widget color query is to query the color from an
+     * instance of the widget.
+     *
+     *  It is expected that the list of supported colors
+     * will grow over time.
+     */
+
+    /**
+     * System color used to paint dark shadow areas (value is 17).
+     */
+    public static const int COLOR_WIDGET_DARK_SHADOW = 17;
+
+    /**
+     * System color used to paint normal shadow areas (value is 18).
+     */
+    public static const int COLOR_WIDGET_NORMAL_SHADOW = 18;
+
+    /**
+     * System color used to paint light shadow areas (value is 19).
+     */
+    public static const int COLOR_WIDGET_LIGHT_SHADOW = 19;
+
+    /**
+     * System color used to paint highlight shadow areas (value is 20).
+     */
+    public static const int COLOR_WIDGET_HIGHLIGHT_SHADOW = 20;
+
+    /**
+     * System color used to paint foreground areas (value is 21).
+     */
+    public static const int COLOR_WIDGET_FOREGROUND = 21;
+
+    /**
+     * System color used to paint background areas (value is 22).
+     */
+    public static const int COLOR_WIDGET_BACKGROUND = 22;
+
+    /**
+     * System color used to paint border areas (value is 23).
+     */
+    public static const int COLOR_WIDGET_BORDER = 23;
+
+    /**
+     * System color used to paint list foreground areas (value is 24).
+     */
+    public static const int COLOR_LIST_FOREGROUND = 24;
+
+    /**
+     * System color used to paint list background areas (value is 25).
+     */
+    public static const int COLOR_LIST_BACKGROUND = 25;
+
+    /**
+     * System color used to paint list selection background areas (value is 26).
+     */
+    public static const int COLOR_LIST_SELECTION = 26;
+
+    /**
+     * System color used to paint list selected text (value is 27).
+     */
+    public static const int COLOR_LIST_SELECTION_TEXT = 27;
+
+    /**
+     * System color used to paint tooltip text (value is 28).
+     */
+    public static const int COLOR_INFO_FOREGROUND = 28;
+
+    /**
+     * System color used to paint tooltip background areas (value is 29).
+     */
+    public static const int COLOR_INFO_BACKGROUND = 29;
+
+    /**
+     * System color used to paint title text (value is 30).
+     */
+    public static const int COLOR_TITLE_FOREGROUND = 30;
+
+    /**
+     * System color used to paint title background areas (value is 31).
+     */
+    public static const int COLOR_TITLE_BACKGROUND = 31;
+
+    /**
+     * System color used to paint title background gradient (value is 32).
+     */
+    public static const int COLOR_TITLE_BACKGROUND_GRADIENT = 32;
+
+    /**
+     * System color used to paint inactive title text (value is 33).
+     */
+    public static const int COLOR_TITLE_INACTIVE_FOREGROUND = 33;
+
+    /**
+     * System color used to paint inactive title background areas (value is 34).
+     */
+    public static const int COLOR_TITLE_INACTIVE_BACKGROUND = 34;
+
+    /**
+     * System color used to paint inactive title background gradient (value is 35).
+     */
+    public static const int COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT = 35;
+
+    /**
+     * Draw constant indicating whether the drawing operation
+     * should fill the background (value is 1&lt;&lt;0).
+     */
+    public static const int DRAW_TRANSPARENT = 1 << 0;
+
+    /**
+     * Draw constant indicating whether the string drawing operation
+     * should handle line-delimiters (value is 1&lt;&lt;1).
+     */
+    public static const int DRAW_DELIMITER = 1 << 1;
+
+    /**
+     * Draw constant indicating whether the string drawing operation
+     * should expand TAB characters (value is 1&lt;&lt;2).
+     */
+    public static const int DRAW_TAB = 1 << 2;
+
+    /**
+     * Draw constant indicating whether the string drawing operation
+     * should handle mnemonics (value is 1&lt;&lt;3).
+     */
+    public static const int DRAW_MNEMONIC = 1 << 3;
+
+
+    /**
+     * Selection constant indicating that a line delimiter should be
+     * drawn (value is 1&lt;&lt;17).
+     *
+     * <p><b>Used By:</b><ul>
+     * <li><code>TextLayout</code></li>
+     * </ul></p>
+     *
+     * @see #FULL_SELECTION
+     * @see #LAST_LINE_SELECTION
+     *
+     * @since 3.3
+     */
+    public static const int DELIMITER_SELECTION = 1 << 17;
+
+    /**
+     * Selection constant indicating that the last line is selected
+     * to the end and should be drawn using either a line delimiter
+     * or full line selection (value is 1&lt;&lt;20).
+     *
+     * <p><b>Used By:</b><ul>
+     * <li><code>TextLayout</code></li>
+     * </ul></p>
+     *
+     * @see #DELIMITER_SELECTION
+     * @see #FULL_SELECTION
+     *
+     * @since 3.3
+     */
+    public static const int LAST_LINE_SELECTION = 1 << 20;
+
+    /**
+     * SWT error constant indicating that no error number was specified
+     * (value is 1).
+     */
+    public static const int ERROR_UNSPECIFIED = 1;
+
+    /**
+     * SWT error constant indicating that no more handles for an
+     * operating system resource are available
+     * (value is 2).
+     */
+    public static const int ERROR_NO_HANDLES = 2;
+
+    /**
+     * SWT error constant indicating that no more callback resources are available
+     * (value is 3).
+     */
+    public static const int ERROR_NO_MORE_CALLBACKS = 3;
+
+    /**
+     * SWT error constant indicating that a null argument was passed in
+     * (value is 4).
+     */
+    public static const int ERROR_NULL_ARGUMENT = 4;
+
+    /**
+     * SWT error constant indicating that an invalid argument was passed in
+     * (value is 5).
+     */
+    public static const int ERROR_INVALID_ARGUMENT = 5;
+
+    /**
+     * SWT error constant indicating that a value was found to be
+     * outside the allowable range
+     * (value is 6).
+     */
+    public static const int ERROR_INVALID_RANGE = 6;
+
+    /**
+     * SWT error constant indicating that a value which can not be
+     * zero was found to be
+     * (value is 7).
+     */
+    public static const int ERROR_CANNOT_BE_ZERO = 7;
+
+    /**
+     * SWT error constant indicating that the underlying operating
+     * system was unable to provide the value of an item
+     * (value is 8).
+     */
+    public static const int ERROR_CANNOT_GET_ITEM = 8;
+
+    /**
+     * SWT error constant indicating that the underlying operating
+     * system was unable to provide the selection
+     * (value is 9).
+     */
+    public static const int ERROR_CANNOT_GET_SELECTION = 9;
+
+    /**
+     * SWT error constant indicating that the matrix is not invertible
+     * (value is 10).
+     *
+     * @since 3.1
+     */
+    public static const int ERROR_CANNOT_INVERT_MATRIX = 10;
+
+    /**
+     * SWT error constant indicating that the underlying operating
+     * system was unable to provide the height of an item
+     * (value is 11).
+     */
+    public static const int ERROR_CANNOT_GET_ITEM_HEIGHT = 11;
+
+    /**
+     * SWT error constant indicating that the underlying operating
+     * system was unable to provide the text of a widget
+     * (value is 12).
+     */
+    public static const int ERROR_CANNOT_GET_TEXT = 12;
+
+    /**
+     * SWT error constant indicating that the underlying operating
+     * system was unable to set the text of a widget
+     * (value is 13).
+     */
+    public static const int ERROR_CANNOT_SET_TEXT = 13;
+
+    /**
+     * SWT error constant indicating that the underlying operating
+     * system was unable to add an item
+     * (value is 14).
+     */
+    public static const int ERROR_ITEM_NOT_ADDED = 14;
+
+    /**
+     * SWT error constant indicating that the underlying operating
+     * system was unable to remove an item
+     * (value is 15).
+     */
+    public static const int ERROR_ITEM_NOT_REMOVED = 15;
+
+    /**
+     * SWT error constant indicating that the graphics library
+     * is not available
+     * (value is 16).
+     */
+    public static const int ERROR_NO_GRAPHICS_LIBRARY = 16;
+
+    /**
+     * SWT error constant indicating that a particular feature has
+     * not been implemented on this platform
+     * (value is 20).
+     */
+    public static const int ERROR_NOT_IMPLEMENTED = 20;
+
+    /**
+     * SWT error constant indicating that a menu which needed
+     * to have the drop down style had some other style instead
+     * (value is 21).
+     */
+    public static const int ERROR_MENU_NOT_DROP_DOWN = 21;
+
+    /**
+     * SWT error constant indicating that an attempt was made to
+     * invoke an SWT operation which can only be executed by the
+     * user-interface thread from some other thread
+     * (value is 22).
+     */
+    public static const int ERROR_THREAD_INVALID_ACCESS = 22;
+
+    /**
+     * SWT error constant indicating that an attempt was made to
+     * invoke an SWT operation using a widget which had already
+     * been disposed
+     * (value is 24).
+     */
+    public static const int ERROR_WIDGET_DISPOSED = 24;
+
+    /**
+     * SWT error constant indicating that a menu item which needed
+     * to have the cascade style had some other style instead
+     * (value is 27).
+     */
+    public static const int ERROR_MENUITEM_NOT_CASCADE = 27;
+
+    /**
+     * SWT error constant indicating that the underlying operating
+     * system was unable to set the selection of a widget
+     * (value is 28).
+     */
+    public static const int ERROR_CANNOT_SET_SELECTION = 28;
+
+    /**
+     * SWT error constant indicating that the underlying operating
+     * system was unable to set the menu
+     * (value is 29).
+     */
+    public static const int ERROR_CANNOT_SET_MENU = 29;
+
+    /**
+     * SWT error constant indicating that the underlying operating
+     * system was unable to set the enabled state
+     * (value is 30).
+     */
+    public static const int ERROR_CANNOT_SET_ENABLED = 30;
+
+    /**
+     * SWT error constant indicating that the underlying operating
+     * system was unable to provide enabled/disabled state information
+     * (value is 31).
+     */
+    public static const int ERROR_CANNOT_GET_ENABLED = 31;
+
+    /**
+     * SWT error constant indicating that a provided widget can
+     * not be used as a parent in the current operation
+     * (value is 32).
+     */
+    public static const int ERROR_INVALID_PARENT = 32;
+
+    /**
+     * SWT error constant indicating that a menu which needed
+     * to have the menu bar style had some other style instead
+     * (value is 33).
+     */
+    public static const int ERROR_MENU_NOT_BAR = 33;
+
+    /**
+     * SWT error constant indicating that the underlying operating
+     * system was unable to provide count information
+     * (value is 36).
+     */
+    public static const int ERROR_CANNOT_GET_COUNT = 36;
+
+    /**
+     * SWT error constant indicating that a menu which needed
+     * to have the pop up menu style had some other style instead
+     * (value is 37).
+     */
+    public static const int ERROR_MENU_NOT_POP_UP = 37;
+
+    /**
+     * SWT error constant indicating that a graphics operation
+     * was attempted with an image of an unsupported depth
+     * (value is 38).
+     */
+    public static const int ERROR_UNSUPPORTED_DEPTH = 38;
+
+    /**
+     * SWT error constant indicating that an input/output operation
+     * failed during the execution of an SWT operation
+     * (value is 39).
+     */
+    public static const int ERROR_IO = 39;
+
+    /**
+     * SWT error constant indicating that a graphics operation
+     * was attempted with an image having an invalid format
+     * (value is 40).
+     */
+    public static const int ERROR_INVALID_IMAGE = 40;
+
+    /**
+     * SWT error constant indicating that a graphics operation
+     * was attempted with an image having a valid but unsupported
+     * format
+     * (value is 42).
+     */
+    public static const int ERROR_UNSUPPORTED_FORMAT = 42;
+
+    /**
+     * SWT error constant indicating that an attempt was made
+     * to subclass an SWT widget class without implementing the
+     * <code>checkSubclass()</code> method
+     * (value is 43).
+     *
+     * For additional information see the comment in
+     * <code>Widget.checkSubclass()</code>.
+     *
+     * @see org.eclipse.swt.widgets.Widget#checkSubclass
+     */
+    public static const int ERROR_INVALID_SUBCLASS = 43;
+
+    /**
+     * SWT error constant indicating that an attempt was made to
+     * invoke an SWT operation using a graphics object which had
+     * already been disposed
+     * (value is 44).
+     */
+    public static const int ERROR_GRAPHIC_DISPOSED = 44;
+
+    /**
+     * SWT error constant indicating that an attempt was made to
+     * invoke an SWT operation using a device which had already
+     * been disposed
+     * (value is 45).
+     */
+    public static const int ERROR_DEVICE_DISPOSED = 45;
+
+    /**
+     * SWT error constant indicating that an exception happened
+     * when executing a runnable
+     * (value is 46).
+     */
+    public static const int ERROR_FAILED_EXEC = 46;
+
+    /**
+     * SWT error constant indicating that an unsatisfied link
+     * error occurred while attempting to load a library
+     * (value is 47).
+     *
+     * @since 3.1
+     */
+    public static const int ERROR_FAILED_LOAD_LIBRARY = 47;
+
+    /**
+     * SWT error constant indicating that a font is not valid
+     * (value is 48).
+     *
+     * @since 3.1
+     */
+    public static const int ERROR_INVALID_FONT = 48;
+
+    /**
+     * Constant indicating that an image or operation is of type bitmap  (value is 0).
+     */
+    public static const int BITMAP = 0;
+
+    /**
+     * Constant indicating that an image or operation is of type icon  (value is 1).
+     */
+    public static const int ICON = 1;
+
+    /**
+     * The <code>Image</code> constructor argument indicating that
+     * the new image should be a copy of the image provided as
+     * an argument  (value is 0).
+     */
+    public static const int IMAGE_COPY = 0;
+
+    /**
+     * The <code>Image</code> constructor argument indicating that
+     * the new image should have the appearance of a "disabled"
+     * (using the platform's rules for how this should look)
+     * copy of the image provided as an argument  (value is 1).
+     */
+    public static const int IMAGE_DISABLE = 1;
+
+    /**
+     * The <code>Image</code> constructor argument indicating that
+     * the new image should have the appearance of a "gray scaled"
+     * copy of the image provided as an argument  (value is 2).
+     */
+    public static const int IMAGE_GRAY = 2;
+
+    /**
+     * Constant to indicate an error state (value is 1).
+     * <p><b>Used By:</b><ul>
+     * <li><code>ProgressBar</code></li>
+     * </ul></p>
+     *
+     * @since 3.4
+     */
+    public static const int ERROR = 1;
+
+    /**
+     * Constant to a indicate a paused state (value is 4).
+     * <p><b>Used By:</b><ul>
+     * <li><code>ProgressBar</code></li>
+     * </ul></p>
+     *
+     * @since 3.4
+     */
+    public static const int PAUSED = 1 << 2;
+
+    /**
+     * The font style constant indicating a normal weight, non-italic font
+     * (value is 0). This constant is also used with <code>ProgressBar</code>
+     * to indicate a normal state.
+     * <p><b>Used By:</b><ul>
+     * <li><code>ProgressBar</code></li>
+     * </ul></p>
+     */
+    public static const int NORMAL = 0;
+
+    /**
+     * The font style constant indicating a bold weight font
+     * (value is 1&lt;&lt;0).
+     */
+    public static const int BOLD = 1 << 0;
+
+    /**
+     * The font style constant indicating an italic font
+     * (value is 1&lt;&lt;1).
+     */
+    public static const int ITALIC = 1 << 1;
+
+    /**
+     * System arrow cursor  (value is 0).
+     */
+    public static const int CURSOR_ARROW = 0;
+
+    /**
+     * System wait cursor  (value is 1).
+     */
+    public static const int CURSOR_WAIT = 1;
+
+    /**
+     * System cross hair cursor  (value is 2).
+     */
+    public static const int CURSOR_CROSS = 2;
+
+    /**
+     * System app startup cursor  (value is 3).
+     */
+    public static const int CURSOR_APPSTARTING = 3;
+
+    /**
+     * System help cursor  (value is 4).
+     */
+    public static const int CURSOR_HELP = 4;
+
+    /**
+     * System resize all directions cursor (value is 5).
+     */
+    public static const int CURSOR_SIZEALL = 5;
+
+    /**
+     * System resize north-east-south-west cursor  (value is 6).
+     */
+    public static const int CURSOR_SIZENESW = 6;
+
+    /**
+     * System resize north-south cursor  (value is 7).
+     */
+    public static const int CURSOR_SIZENS = 7;
+
+    /**
+     * System resize north-west-south-east cursor  (value is 8).
+     */
+    public static const int CURSOR_SIZENWSE = 8;
+
+    /**
+     * System resize west-east cursor  (value is 9).
+     */
+    public static const int CURSOR_SIZEWE = 9;
+
+    /**
+     * System resize north cursor  (value is 10).
+     */
+    public static const int CURSOR_SIZEN = 10;
+
+    /**
+     * System resize south cursor  (value is 11).
+     */
+    public static const int CURSOR_SIZES = 11;
+
+    /**
+     * System resize east cursor  (value is 12).
+     */
+    public static const int CURSOR_SIZEE = 12;
+
+    /**
+     * System resize west cursor  (value is 13).
+     */
+    public static const int CURSOR_SIZEW = 13;
+
+    /**
+     * System resize north-east cursor (value is 14).
+     */
+    public static const int CURSOR_SIZENE = 14;
+
+    /**
+     * System resize south-east cursor (value is 15).
+     */
+    public static const int CURSOR_SIZESE = 15;
+
+    /**
+     * System resize south-west cursor (value is 16).
+     */
+    public static const int CURSOR_SIZESW = 16;
+
+    /**
+     * System resize north-west cursor (value is 17).
+     */
+    public static const int CURSOR_SIZENW = 17;
+
+    /**
+     * System up arrow cursor  (value is 18).
+     */
+    public static const int CURSOR_UPARROW = 18;
+
+    /**
+     * System i-beam cursor (value is 19).
+     */
+    public static const int CURSOR_IBEAM = 19;
+
+    /**
+     * System "not allowed" cursor (value is 20).
+     */
+    public static const int CURSOR_NO = 20;
+
+    /**
+     * System hand cursor (value is 21).
+     */
+    public static const int CURSOR_HAND = 21;
+
+    /**
+     * Line drawing style for flat end caps (value is 1).
+     *
+     * @see org.eclipse.swt.graphics.GC#setLineCap(int)
+     * @see org.eclipse.swt.graphics.GC#getLineCap()
+     *
+     * @since 3.1
+     */
+    public static const int CAP_FLAT = 1;
+
+    /**
+     * Line drawing style for rounded end caps (value is 2).
+     *
+     * @see org.eclipse.swt.graphics.GC#setLineCap(int)
+     * @see org.eclipse.swt.graphics.GC#getLineCap()
+     *
+     * @since 3.1
+     */
+    public static const int CAP_ROUND = 2;
+
+    /**
+     * Line drawing style for square end caps (value is 3).
+     *
+     * @see org.eclipse.swt.graphics.GC#setLineCap(int)
+     * @see org.eclipse.swt.graphics.GC#getLineCap()
+     *
+     * @since 3.1
+     */
+    public static const int CAP_SQUARE = 3;
+
+    /**
+     * Line drawing style for miter joins (value is 1).
+     *
+     * @see org.eclipse.swt.graphics.GC#setLineJoin(int)
+     * @see org.eclipse.swt.graphics.GC#getLineJoin()
+     *
+     * @since 3.1
+     */
+    public static const int JOIN_MITER = 1;
+
+    /**
+     * Line drawing  style for rounded joins (value is 2).
+     *
+     * @see org.eclipse.swt.graphics.GC#setLineJoin(int)
+     * @see org.eclipse.swt.graphics.GC#getLineJoin()
+     *
+     * @since 3.1
+     */
+    public static const int JOIN_ROUND = 2;
+
+    /**
+     * Line drawing style for bevel joins (value is 3).
+     *
+     * @see org.eclipse.swt.graphics.GC#setLineJoin(int)
+     * @see org.eclipse.swt.graphics.GC#getLineJoin()
+     *
+     * @since 3.1
+     */
+    public static const int JOIN_BEVEL = 3;
+
+    /**
+     * Line drawing style for solid lines  (value is 1).
+     */
+    public static const int LINE_SOLID = 1;
+
+    /**
+     * Line drawing style for dashed lines (value is 2).
+     */
+    public static const int LINE_DASH = 2;
+
+    /**
+     * Line drawing style for dotted lines (value is 3).
+     */
+    public static const int LINE_DOT = 3;
+
+    /**
+     * Line drawing style for alternating dash-dot lines (value is 4).
+     */
+    public static const int LINE_DASHDOT = 4;
+
+    /**
+     * Line drawing style for dash-dot-dot lines (value is 5).
+     */
+    public static const int LINE_DASHDOTDOT = 5;
+
+    /**
+     * Line drawing style for custom dashed lines (value is 6).
+     *
+     * @see org.eclipse.swt.graphics.GC#setLineDash(int[])
+     * @see org.eclipse.swt.graphics.GC#getLineDash()
+     *
+     * @since 3.1
+     */
+    public static const int LINE_CUSTOM = 6;
+
+    /**
+     * Path constant that represents a "move to" operation (value is 1).
+     *
+     * @since 3.1
+     */
+    public static const int PATH_MOVE_TO = 1;
+
+    /**
+     * Path constant that represents a "line to" operation (value is 2).
+     *
+     * @since 3.1
+     */
+    public static const int PATH_LINE_TO = 2;
+
+    /**
+     * Path constant that represents a "quadratic curve to" operation (value is 3).
+     *
+     * @since 3.1
+     */
+    public static const int PATH_QUAD_TO = 3;
+
+    /**
+     * Path constant that represents a "cubic curve to" operation (value is 4).
+     *
+     * @since 3.1
+     */
+    public static const int PATH_CUBIC_TO = 4;
+
+    /**
+     * Path constant that represents a "close" operation (value is 5).
+     *
+     * @since 3.1
+     */
+    public static const int PATH_CLOSE = 5;
+
+    /**
+     * Even odd rule for filling operations (value is 1).
+     *
+     * @since 3.1
+     */
+    public static const int FILL_EVEN_ODD = 1;
+
+    /**
+     * Winding rule for filling operations (value is 2).
+     *
+     * @since 3.1
+     */
+    public static const int FILL_WINDING = 2;
+
+    /**
+     * Image format constant indicating an unknown image type (value is -1).
+     */
+    public static const int IMAGE_UNDEFINED = -1;
+
+    /**
+     * Image format constant indicating a Windows BMP format image (value is 0).
+     */
+    public static const int IMAGE_BMP = 0;
+
+    /**
+     * Image format constant indicating a run-length encoded
+     * Windows BMP format image (value is 1).
+     */
+    public static const int IMAGE_BMP_RLE = 1;
+
+    /**
+     * Image format constant indicating a GIF format image (value is 2).
+     */
+    public static const int IMAGE_GIF = 2;
+
+    /**
+     * Image format constant indicating a ICO format image (value is 3).
+     */
+    public static const int IMAGE_ICO = 3;
+
+    /**
+     * Image format constant indicating a JPEG format image (value is 4).
+     */
+    public static const int IMAGE_JPEG = 4;
+
+    /**
+     * Image format constant indicating a PNG format image (value is 5).
+     */
+    public static const int IMAGE_PNG = 5;
+
+    /**
+     * Image format constant indicating a TIFF format image (value is 6).
+     */
+    public static const int IMAGE_TIFF = 6;
+
+    /**
+     * Image format constant indicating an OS/2 BMP format image (value is 7).
+     */
+    public static const int IMAGE_OS2_BMP = 7;
+
+    /**
+     * GIF image disposal method constants indicating that the
+     * disposal method is unspecified (value is 0).
+     */
+    public static const int DM_UNSPECIFIED = 0x0;
+
+    /**
+     * GIF image disposal method constants indicating that the
+     * disposal method is to do nothing; that is, to leave the
+     * previous image in place (value is 1).
+     */
+    public static const int DM_FILL_NONE = 0x1;
+
+    /**
+     * GIF image disposal method constants indicating that the
+     * the previous images should be covered with the background
+     * color before displaying the next image (value is 2).
+     */
+    public static const int DM_FILL_BACKGROUND = 0x2;
+
+    /**
+     * GIF image disposal method constants indicating that the
+     * disposal method is to restore the previous picture
+     * (value is 3).
+     */
+    public static const int DM_FILL_PREVIOUS = 0x3;
+
+    /**
+     * Image transparency constant indicating that the image
+     * contains no transparency information (value is 0).
+     */
+    public static const int TRANSPARENCY_NONE = 0x0;
+
+    /**
+     * Image transparency constant indicating that the image
+     * contains alpha transparency information (value is 1&lt;&lt;0).
+     */
+    public static const int TRANSPARENCY_ALPHA = 1 << 0;
+
+    /**
+     * Image transparency constant indicating that the image
+     * contains a transparency mask (value is 1&lt;&lt;1).
+     */
+    public static const int TRANSPARENCY_MASK = 1 << 1;
+
+    /**
+     * Image transparency constant indicating that the image
+     * contains a transparent pixel (value is 1&lt;&lt;2).
+     */
+    public static const int TRANSPARENCY_PIXEL = 1 << 2;
+
+    /**
+     * The character movement type (value is 1&lt;&lt;0).
+     * This constant is used to move a text offset over a character.
+     *
+     * @see org.eclipse.swt.graphics.TextLayout#getNextOffset(int, int)
+     * @see org.eclipse.swt.graphics.TextLayout#getPreviousOffset(int, int)
+     *
+     * @since 3.0
+     */
+    public static const int MOVEMENT_CHAR = 1 << 0;
+
+    /**
+     * The cluster movement type (value is 1&lt;&lt;1).
+     * This constant is used to move a text offset over a cluster.
+     * A cluster groups one or more characters. A cluster is
+     * undivisible, this means that a caret offset can not be placed in the
+     * middle of a cluster.
+     *
+     * @see org.eclipse.swt.graphics.TextLayout#getNextOffset(int, int)
+     * @see org.eclipse.swt.graphics.TextLayout#getPreviousOffset(int, int)
+     *
+     * @since 3.0
+     */
+    public static const int MOVEMENT_CLUSTER = 1 << 1;
+
+    /**
+     * The word movement type (value is 1&lt;&lt;2).
+     * This constant is used to move a text offset over a word.
+     * The behavior of this constant depends on the platform and on the
+     * direction of the movement. For example, on Windows the stop is
+     * always at the start of the word. On GTK and Mac the stop is at the end
+     * of the word if the direction is next and at the start of the word if the
+     * direction is previous.
+     *
+     * @see org.eclipse.swt.graphics.TextLayout#getNextOffset(int, int)
+     * @see org.eclipse.swt.graphics.TextLayout#getPreviousOffset(int, int)
+     *
+     * @since 3.0
+     */
+    public static const int MOVEMENT_WORD = 1 << 2;
+
+    /**
+     * The word end movement type (value is 1&lt;&lt;3).
+     * This constant is used to move a text offset to the next or previous
+     * word end. The behavior of this constant does not depend on the platform.
+     *
+     *
+     * @see org.eclipse.swt.graphics.TextLayout#getNextOffset(int, int)
+     * @see org.eclipse.swt.graphics.TextLayout#getPreviousOffset(int, int)
+     *
+     * @since 3.3
+     */
+    public static const int MOVEMENT_WORD_END = 1 << 3;
+
+    /**
+     * The word start movement type (value is 1&lt;&lt;4).
+     * This constant is used to move a text offset to the next or previous
+     * word start. The behavior of this constant does not depend on the platform.
+     *
+     * @see org.eclipse.swt.graphics.TextLayout#getNextOffset(int, int)
+     * @see org.eclipse.swt.graphics.TextLayout#getPreviousOffset(int, int)
+     *
+     * @since 3.3
+     */
+    public static const int MOVEMENT_WORD_START = 1 << 4;
+
+
+/**
+ * Answers a concise, human readable description of the error code.
+ *
+ * @param code the SWT error code.
+ * @return a description of the error code.
+ *
+ * @see SWT
+ */
+static String findErrorText (int code) {
+    switch (code) {
+        case ERROR_UNSPECIFIED:            return "Unspecified error"; //$NON-NLS-1$
+        case ERROR_NO_HANDLES:             return "No more handles"; //$NON-NLS-1$
+        case ERROR_NO_MORE_CALLBACKS:      return "No more callbacks"; //$NON-NLS-1$
+        case ERROR_NULL_ARGUMENT:          return "Argument cannot be null"; //$NON-NLS-1$
+        case ERROR_INVALID_ARGUMENT:       return "Argument not valid"; //$NON-NLS-1$
+        case ERROR_INVALID_RANGE:          return "Index out of bounds"; //$NON-NLS-1$
+        case ERROR_CANNOT_BE_ZERO:         return "Argument cannot be zero"; //$NON-NLS-1$
+        case ERROR_CANNOT_GET_ITEM:        return "Cannot get item"; //$NON-NLS-1$
+        case ERROR_CANNOT_GET_SELECTION:   return "Cannot get selection"; //$NON-NLS-1$
+        case ERROR_CANNOT_GET_ITEM_HEIGHT: return "Cannot get item height"; //$NON-NLS-1$
+        case ERROR_CANNOT_GET_TEXT:        return "Cannot get text"; //$NON-NLS-1$
+        case ERROR_CANNOT_SET_TEXT:        return "Cannot set text"; //$NON-NLS-1$
+        case ERROR_ITEM_NOT_ADDED:         return "Item not added"; //$NON-NLS-1$
+        case ERROR_ITEM_NOT_REMOVED:       return "Item not removed"; //$NON-NLS-1$
+        case ERROR_NOT_IMPLEMENTED:        return "Not implemented"; //$NON-NLS-1$
+        case ERROR_MENU_NOT_DROP_DOWN:     return "Menu must be a drop down"; //$NON-NLS-1$
+        case ERROR_THREAD_INVALID_ACCESS:  return "Invalid thread access"; //$NON-NLS-1$
+        case ERROR_WIDGET_DISPOSED:        return "Widget is disposed"; //$NON-NLS-1$
+        case ERROR_MENUITEM_NOT_CASCADE:   return "Menu item is not a CASCADE"; //$NON-NLS-1$
+        case ERROR_CANNOT_SET_SELECTION:   return "Cannot set selection";  //$NON-NLS-1$
+        case ERROR_CANNOT_SET_MENU:        return "Cannot set menu";  //$NON-NLS-1$
+        case ERROR_CANNOT_SET_ENABLED:     return "Cannot set the enabled state";  //$NON-NLS-1$
+        case ERROR_CANNOT_GET_ENABLED:     return "Cannot get the enabled state";  //$NON-NLS-1$
+        case ERROR_INVALID_PARENT:         return "Widget has the wrong parent";  //$NON-NLS-1$
+        case ERROR_MENU_NOT_BAR:           return "Menu is not a BAR";  //$NON-NLS-1$
+        case ERROR_CANNOT_GET_COUNT:       return "Cannot get count"; //$NON-NLS-1$
+        case ERROR_MENU_NOT_POP_UP:        return "Menu is not a POP_UP"; //$NON-NLS-1$
+        case ERROR_UNSUPPORTED_DEPTH:      return "Unsupported color depth"; //$NON-NLS-1$
+        case ERROR_IO:                     return "i/o error"; //$NON-NLS-1$
+        case ERROR_INVALID_IMAGE:          return "Invalid image"; //$NON-NLS-1$
+        case ERROR_UNSUPPORTED_FORMAT:     return "Unsupported or unrecognized format"; //$NON-NLS-1$
+        case ERROR_INVALID_SUBCLASS:       return "Subclassing not allowed"; //$NON-NLS-1$
+        case ERROR_GRAPHIC_DISPOSED:       return "Graphic is disposed"; //$NON-NLS-1$
+        case ERROR_DEVICE_DISPOSED:        return "Device is disposed"; //$NON-NLS-1$
+        case ERROR_FAILED_EXEC:            return "Failed to execute runnable"; //$NON-NLS-1$
+        case ERROR_FAILED_LOAD_LIBRARY:    return "Unable to load library"; //$NON-NLS-1$
+        case ERROR_CANNOT_INVERT_MATRIX:    return "Cannot invert matrix"; //$NON-NLS-1$
+        case ERROR_NO_GRAPHICS_LIBRARY:    return "Unable to load graphics library"; //$NON-NLS-1$
+        case ERROR_INVALID_FONT:            return "Font not valid"; //$NON-NLS-1$
+        default:
+    }
+    return "Unknown error"; //$NON-NLS-1$
+}
+
+
+/**
+ * Returns the NLS'ed message for the given argument.
+ *
+ * @param key the key to look up
+ * @return the message for the given key
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the key is null</li>
+ * </ul>
+ */
+public static String getMessage(String key) {
+    return Compatibility.getMessage(key);
+}
+
+/**
+ * Returns the SWT platform name.
+ * Examples: "win32", "motif", "gtk", "photon", "carbon"
+ *
+ * @return the SWT platform name
+ */
+public static String getPlatform () {
+    return Platform.PLATFORM;
+}
+
+/**
+ * Returns the SWT version number as an integer.
+ * Example: "SWT051" == 51
+ *
+ * @return the SWT version number
+ */
+public static int getVersion () {
+    return Library.SWT_VERSION;
+}
+
+/**
+ * Throws an appropriate exception based on the passed in error code.
+ *
+ * @param code the SWT error code
+ */
+public static void error (String file, long line, int code) {
+    error (code, null);
+}
+public static void error (int code) {
+    error (code, null);
+}
+
+/**
+ * Throws an appropriate exception based on the passed in error code.
+ * The <code>throwable</code> argument should be either null, or the
+ * throwable which caused SWT to throw an exception.
+ * <p>
+ * In SWT, errors are reported by throwing one of three exceptions:
+ * <dl>
+ * <dd>java.lang.IllegalArgumentException</dd>
+ * <dt>thrown whenever one of the API methods is invoked with an illegal argument</dt>
+ * <dd>org.eclipse.swt.SWTException (extends java.lang.RuntimeException)</dd>
+ * <dt>thrown whenever a recoverable error happens internally in SWT</dt>
+ * <dd>org.eclipse.swt.SWTError (extends java.lang.Error)</dd>
+ * <dt>thrown whenever a <b>non-recoverable</b> error happens internally in SWT</dt>
+ * </dl>
+ * This method provides the logic which maps between error codes
+ * and one of the above exceptions.
+ * </p>
+ *
+ * @param code the SWT error code.
+ * @param throwable the exception which caused the error to occur.
+ *
+ * @see SWTError
+ * @see SWTException
+ * @see IllegalArgumentException
+ */
+public static void error (int code, Exception throwable) {
+    error (code, throwable, null);
+}
+
+/**
+ * Throws an appropriate exception based on the passed in error code.
+ * The <code>throwable</code> argument should be either null, or the
+ * throwable which caused SWT to throw an exception.
+ * <p>
+ * In SWT, errors are reported by throwing one of three exceptions:
+ * <dl>
+ * <dd>java.lang.IllegalArgumentException</dd>
+ * <dt>thrown whenever one of the API methods is invoked with an illegal argument</dt>
+ * <dd>org.eclipse.swt.SWTException (extends java.lang.RuntimeException)</dd>
+ * <dt>thrown whenever a recoverable error happens internally in SWT</dt>
+ * <dd>org.eclipse.swt.SWTError (extends java.lang.Error)</dd>
+ * <dt>thrown whenever a <b>non-recoverable</b> error happens internally in SWT</dt>
+ * </dl>
+ * This method provides the logic which maps between error codes
+ * and one of the above exceptions.
+ * </p>
+ *
+ * @param code the SWT error code.
+ * @param throwable the exception which caused the error to occur.
+ * @param detail more information about error.
+ *
+ * @see SWTError
+ * @see SWTException
+ * @see IllegalArgumentException
+ *
+ * @since 3.0
+ */
+public static void error (int code, Exception throwable, String detail) {
+
+    /*
+    * This code prevents the creation of "chains" of SWTErrors and
+    * SWTExceptions which in turn contain other SWTErrors and
+    * SWTExceptions as their throwable. This can occur when low level
+    * code throws an exception past a point where a higher layer is
+    * being "safe" and catching all exceptions. (Note that, this is
+    * _a_bad_thing_ which we always try to avoid.)
+    *
+    * On the theory that the low level code is closest to the
+    * original problem, we simply re-throw the original exception here.
+    *
+    * NOTE: Exceptions thrown in syncExec and asyncExec must be
+    * wrapped.
+    */
+    if (code != SWT.ERROR_FAILED_EXEC) {
+        if (auto t = cast(SWTError)throwable) throw t;
+        if (auto t = cast(SWTException)throwable) throw t;
+    }
+
+    String message = findErrorText (code);
+    if (detail != null) message ~= detail;
+    switch (code) {
+
+        /* Illegal Arguments (non-fatal) */
+        case ERROR_NULL_ARGUMENT:
+        case ERROR_CANNOT_BE_ZERO:
+        case ERROR_INVALID_ARGUMENT:
+        case ERROR_MENU_NOT_BAR:
+        case ERROR_MENU_NOT_DROP_DOWN:
+        case ERROR_MENU_NOT_POP_UP:
+        case ERROR_MENUITEM_NOT_CASCADE:
+        case ERROR_INVALID_PARENT:
+        case ERROR_INVALID_RANGE: {
+            throw new IllegalArgumentException (message);
+        }
+
+        /* SWT Exceptions (non-fatal) */
+        case ERROR_INVALID_SUBCLASS:
+        case ERROR_THREAD_INVALID_ACCESS:
+        case ERROR_WIDGET_DISPOSED:
+        case ERROR_GRAPHIC_DISPOSED:
+        case ERROR_DEVICE_DISPOSED:
+        case ERROR_INVALID_IMAGE:
+        case ERROR_UNSUPPORTED_DEPTH:
+        case ERROR_UNSUPPORTED_FORMAT:
+        case ERROR_FAILED_EXEC:
+        case ERROR_CANNOT_INVERT_MATRIX:
+        case ERROR_NO_GRAPHICS_LIBRARY:
+        case ERROR_IO: {
+            SWTException exception = new SWTException (code, message);
+            exception.throwable = throwable;
+            throw exception;
+        }
+
+        /* Operation System Errors (fatal, may occur only on some platforms) */
+        case ERROR_CANNOT_GET_COUNT:
+        case ERROR_CANNOT_GET_ENABLED:
+        case ERROR_CANNOT_GET_ITEM:
+        case ERROR_CANNOT_GET_ITEM_HEIGHT:
+        case ERROR_CANNOT_GET_SELECTION:
+        case ERROR_CANNOT_GET_TEXT:
+        case ERROR_CANNOT_SET_ENABLED:
+        case ERROR_CANNOT_SET_MENU:
+        case ERROR_CANNOT_SET_SELECTION:
+        case ERROR_CANNOT_SET_TEXT:
+        case ERROR_ITEM_NOT_ADDED:
+        case ERROR_ITEM_NOT_REMOVED:
+        case ERROR_NO_HANDLES:
+        //FALL THROUGH
+
+        /* SWT Errors (fatal, may occur only on some platforms) */
+        case ERROR_FAILED_LOAD_LIBRARY:
+        case ERROR_NO_MORE_CALLBACKS:
+        case ERROR_NOT_IMPLEMENTED:
+        case ERROR_UNSPECIFIED: {
+            SWTError error = new SWTError (code, message);
+            error.throwable = throwable;
+            throw error;
+        }
+        default:
+    }
+
+    /* Unknown/Undefined Error */
+    SWTError error = new SWTError (code, message);
+    error.throwable = throwable;
+    throw error;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/SWTError.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,164 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.SWTError;
+
+import java.lang.all;
+
+import org.eclipse.swt.SWT;
+
+import tango.core.Exception;
+
+/**
+ * This error is thrown whenever an unrecoverable error
+ * occurs internally in SWT. The message text and error code
+ * provide a further description of the problem. The exception
+ * has a <code>throwable</code> field which holds the underlying
+ * throwable that caused the problem (if this information is
+ * available (i.e. it may be null)).
+ * <p>
+ * SWTErrors are thrown when something fails internally which
+ * either leaves SWT in an unknown state (eg. the o/s call to
+ * remove an item from a list returns an error code) or when SWT
+ * is left in a known-to-be-unrecoverable state (eg. it runs out
+ * of callback resources). SWTErrors should not occur in typical
+ * programs, although "high reliability" applications should
+ * still catch them.
+ * </p><p>
+ * This class also provides support methods used by SWT to match
+ * error codes to the appropriate exception class (SWTError,
+ * SWTException, or IllegalArgumentException) and to provide
+ * human readable strings for SWT error codes.
+ * </p>
+ *
+ * @see SWTException
+ * @see SWT#error(int)
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public class SWTError : PlatformException {
+    /**
+     * The SWT error code, one of SWT.ERROR_*.
+     */
+    public int code;
+
+    /**
+     * The underlying throwable that caused the problem,
+     * or null if this information is not available.
+     */
+    public Exception throwable( Exception e ){
+        this.next = e;
+        return this.next;
+    }
+    public Exception throwable(){
+        return this.next;
+    }
+
+    //static final long serialVersionUID = 3833467327105808433L;
+
+/**
+ * Constructs a new instance of this class with its
+ * stack trace filled in. The error code is set to an
+ * unspecified value.
+ */
+public this () {
+    this (SWT.ERROR_UNSPECIFIED);
+}
+
+/**
+ * Constructs a new instance of this class with its
+ * stack trace and message filled in. The error code is
+ * set to an unspecified value.  Specifying <code>null</code>
+ * as the message is equivalent to specifying an empty string.
+ *
+ * @param message the detail message for the exception
+ */
+public this (String message) {
+    this (SWT.ERROR_UNSPECIFIED, message);
+}
+
+/**
+ * Constructs a new instance of this class with its
+ * stack trace and error code filled in.
+ *
+ * @param code the SWT error code
+ */
+public this (int code) {
+    this (code, SWT.findErrorText (code));
+}
+
+/**
+ * Constructs a new instance of this class with its
+ * stack trace, error code and message filled in.
+ * Specifying <code>null</code> as the message is
+ * equivalent to specifying an empty string.
+ *
+ * @param code the SWT error code
+ * @param message the detail message for the exception
+ */
+public this (int code, String message) {
+    super (message);
+    this.code = code;
+}
+
+/**
+ * Returns the underlying throwable that caused the problem,
+ * or null if this information is not available.
+ * <p>
+ * NOTE: This method overrides Throwable.getCause() that was
+ * added to JDK1.4. It is necessary to override this method
+ * in order for inherited printStackTrace() methods to work.
+ * </p>
+ * @return the underlying throwable
+ *
+ * @since 3.1
+ */
+public Exception getCause() {
+    return throwable;
+}
+
+/**
+ *  Returns the string describing this SWTError object.
+ *  <p>
+ *  It is combined with the message string of the Throwable
+ *  which caused this SWTError (if this information is available).
+ *  </p>
+ *  @return the error message string of this SWTError object
+ */
+public String getMessage () {
+    if (throwable is null)
+        return super.toString();
+    return super.toString () ~ " (" ~ throwable.toString () ~ ")"; //$NON-NLS-1$ //$NON-NLS-2$
+}
+
+/**
+ * Outputs a printable representation of this error's
+ * stack trace on the standard error stream.
+ * <p>
+ * Note: printStackTrace(PrintStream) and printStackTrace(PrintWriter)
+ * are not provided in order to maintain compatibility with CLDC.
+ * </p>
+ */
+public void printStackTrace () {
+    getDwtLogger().error( __FILE__, __LINE__,  "stacktrace follows (if feature compiled in)" );
+    foreach( msg; info ){
+        getDwtLogger().error( __FILE__, __LINE__,  "{}", msg );
+    }
+    if ( throwable !is null) {
+        getDwtLogger().error ( __FILE__, __LINE__, "*** Stack trace of contained error ***"); //$NON-NLS-1$
+        foreach( msg; throwable.info ){
+            getDwtLogger().error( __FILE__, __LINE__,  "{}", msg );
+        }
+    }
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/SWTException.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,157 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.SWTException;
+
+import java.lang.all;
+
+import org.eclipse.swt.SWT;
+
+import tango.core.Exception;
+
+/**
+ * This runtime exception is thrown whenever a recoverable error
+ * occurs internally in SWT. The message text and error code
+ * provide a further description of the problem. The exception
+ * has a <code>throwable</code> field which holds the underlying
+ * exception that caused the problem (if this information is
+ * available (i.e. it may be null)).
+ * <p>
+ * SWTExceptions are thrown when something fails internally,
+ * but SWT is left in a known stable state (eg. a widget call
+ * was made from a non-u/i thread, or there is failure while
+ * reading an Image because the source file was corrupt).
+ * </p>
+ *
+ * @see SWTError
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public class SWTException : Exception {
+    /**
+     * The SWT error code, one of SWT.ERROR_*.
+     */
+    public int code;
+
+    /**
+     * The underlying throwable that caused the problem,
+     * or null if this information is not available.
+     */
+    public Exception throwable( Exception e ){
+        this.next = e;
+        return this.next;
+    }
+    public Exception throwable(){
+        return this.next;
+    }
+
+
+    //static final long serialVersionUID = 3257282552304842547L;
+
+/**
+ * Constructs a new instance of this class with its
+ * stack trace filled in. The error code is set to an
+ * unspecified value.
+ */
+public this () {
+    this (SWT.ERROR_UNSPECIFIED);
+}
+
+/**
+ * Constructs a new instance of this class with its
+ * stack trace and message filled in. The error code is
+ * set to an unspecified value.  Specifying <code>null</code>
+ * as the message is equivalent to specifying an empty string.
+ *
+ * @param message the detail message for the exception
+ */
+public this (String message) {
+    this (SWT.ERROR_UNSPECIFIED, message);
+}
+
+/**
+ * Constructs a new instance of this class with its
+ * stack trace and error code filled in.
+ *
+ * @param code the SWT error code
+ */
+public this (int code) {
+    this (code, SWT.findErrorText (code));
+}
+
+/**
+ * Constructs a new instance of this class with its
+ * stack trace, error code and message filled in.
+ * Specifying <code>null</code> as the message is
+ * equivalent to specifying an empty string.
+ *
+ * @param code the SWT error code
+ * @param message the detail message for the exception
+ */
+public this (int code, String message) {
+    super (message);
+    this.code = code;
+}
+
+/**
+ * Returns the underlying throwable that caused the problem,
+ * or null if this information is not available.
+ * <p>
+ * NOTE: This method overrides Throwable.getCause() that was
+ * added to JDK1.4. It is necessary to override this method
+ * in order for inherited printStackTrace() methods to work.
+ * </p>
+ * @return the underlying throwable
+ *
+ * @since 3.1
+ */
+public Exception getCause() {
+    return throwable;
+}
+
+/**
+ *  Returns the string describing this SWTException object.
+ *  <p>
+ *  It is combined with the message string of the Throwable
+ *  which caused this SWTException (if this information is available).
+ *  </p>
+ *  @return the error message string of this SWTException object
+ */
+public String getMessage () {
+    if (throwable is null) return super.toString ();
+    return super.toString () ~ " (" ~ throwable.toString () ~ ")"; //$NON-NLS-1$ //$NON-NLS-2$
+}
+
+/**
+ * Outputs a printable representation of this exception's
+ * stack trace on the standard error stream.
+ * <p>
+ * Note: printStackTrace(PrintStream) and printStackTrace(PrintWriter)
+ * are not provided in order to maintain compatibility with CLDC.
+ * </p>
+ */
+public void printStackTrace () {
+    getDwtLogger().error( __FILE__, __LINE__,  "stacktrace follows (if feature compiled in)" );
+    foreach( msg; info ){
+        getDwtLogger().error( __FILE__, __LINE__,  "{}", msg );
+    }
+    if ( throwable !is null) {
+        getDwtLogger().error ( __FILE__, __LINE__, "*** Stack trace of contained exception ***"); //$NON-NLS-1$
+        foreach( msg; throwable.info ){
+            getDwtLogger().error( __FILE__, __LINE__,  "{}", msg );
+        }
+    }
+}
+
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/accessibility/ACC.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.accessibility.ACC;
+
+import java.lang.all;
+
+
+/**
+ * Class ACC contains all the constants used in defining an
+ * Accessible object.
+ *
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ * 
+ * @since 2.0
+ */
+public class ACC {
+    public static const int STATE_NORMAL = 0x00000000;
+    public static const int STATE_SELECTED = 0x00000002;
+    public static const int STATE_SELECTABLE = 0x00200000;
+    public static const int STATE_MULTISELECTABLE = 0x1000000;
+    public static const int STATE_FOCUSED = 0x00000004;
+    public static const int STATE_FOCUSABLE = 0x00100000;
+    public static const int STATE_PRESSED = 0x8;
+    public static const int STATE_CHECKED = 0x10;
+    public static const int STATE_EXPANDED = 0x200;
+    public static const int STATE_COLLAPSED = 0x400;
+    public static const int STATE_HOTTRACKED = 0x80;
+    public static const int STATE_BUSY = 0x800;
+    public static const int STATE_READONLY = 0x40;
+    public static const int STATE_INVISIBLE = 0x8000;
+    public static const int STATE_OFFSCREEN = 0x10000;
+    public static const int STATE_SIZEABLE = 0x20000;
+    public static const int STATE_LINKED = 0x400000;
+
+    public static const int ROLE_CLIENT_AREA = 0xa;
+    public static const int ROLE_WINDOW = 0x9;
+    public static const int ROLE_MENUBAR = 0x2;
+    public static const int ROLE_MENU = 0xb;
+    public static const int ROLE_MENUITEM = 0xc;
+    public static const int ROLE_SEPARATOR = 0x15;
+    public static const int ROLE_TOOLTIP = 0xd;
+    public static const int ROLE_SCROLLBAR = 0x3;
+    public static const int ROLE_DIALOG = 0x12;
+    public static const int ROLE_LABEL = 0x29;
+    public static const int ROLE_PUSHBUTTON = 0x2b;
+    public static const int ROLE_CHECKBUTTON = 0x2c;
+    public static const int ROLE_RADIOBUTTON = 0x2d;
+    public static const int ROLE_COMBOBOX = 0x2e;
+    public static const int ROLE_TEXT = 0x2a;
+    public static const int ROLE_TOOLBAR = 0x16;
+    public static const int ROLE_LIST = 0x21;
+    public static const int ROLE_LISTITEM = 0x22;
+    public static const int ROLE_TABLE = 0x18;
+    public static const int ROLE_TABLECELL = 0x1d;
+    public static const int ROLE_TABLECOLUMNHEADER = 0x19;
+    /** @deprecated use ROLE_TABLECOLUMNHEADER */
+    public static const int ROLE_TABLECOLUMN = ROLE_TABLECOLUMNHEADER;
+    public static const int ROLE_TABLEROWHEADER = 0x1a;
+    public static const int ROLE_TREE = 0x23;
+    public static const int ROLE_TREEITEM = 0x24;
+    public static const int ROLE_TABFOLDER = 0x3c;
+    public static const int ROLE_TABITEM = 0x25;
+    public static const int ROLE_PROGRESSBAR = 0x30;
+    public static const int ROLE_SLIDER = 0x33;
+    public static const int ROLE_LINK = 0x1e;
+
+    public static const int CHILDID_SELF = -1;
+    public static const int CHILDID_NONE = -2;
+    public static const int CHILDID_MULTIPLE = -3;
+
+    public static const int TEXT_INSERT = 0;
+    public static const int TEXT_DELETE = 1;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/accessibility/Accessible.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,398 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.accessibility.Accessible;
+
+import java.lang.all;
+
+import org.eclipse.swt.accessibility.AccessibleListener;
+import org.eclipse.swt.accessibility.AccessibleTextListener;
+import org.eclipse.swt.accessibility.AccessibleControlListener;
+import org.eclipse.swt.accessibility.AccessibleControlListener;
+import org.eclipse.swt.accessibility.AccessibleFactory;
+import org.eclipse.swt.accessibility.AccessibleObject;
+import tango.core.Thread;
+import org.eclipse.swt.SWT;
+//import org.eclipse.swt.events.*;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Control;
+import tango.core.Array;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.DisposeEvent;
+
+/**
+ * Instances of this class provide a bridge between application
+ * code and assistive technology clients. Many platforms provide
+ * default accessible behavior for most widgets, and this class
+ * allows that default behavior to be overridden. Applications
+ * can get the default Accessible object for a control by sending
+ * it <code>getAccessible</code>, and then add an accessible listener
+ * to override simple items like the name and help string, or they
+ * can add an accessible control listener to override complex items.
+ * As a rule of thumb, an application would only want to use the
+ * accessible control listener to implement accessibility for a
+ * custom control.
+ *
+ * @see Control#getAccessible
+ * @see AccessibleListener
+ * @see AccessibleEvent
+ * @see AccessibleControlListener
+ * @see AccessibleControlEvent
+ * @see <a href="http://www.eclipse.org/swt/snippets/#accessibility">Accessibility snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 2.0
+ */
+public class Accessible {
+    AccessibleListener[] accessibleListeners;
+    AccessibleControlListener[] controlListeners;
+    AccessibleTextListener[] textListeners;
+    AccessibleObject accessibleObject;
+    Control control;
+
+    this (Control control) {
+        this.control = control;
+        AccessibleFactory.registerAccessible (this);
+        control.addDisposeListener (new class () DisposeListener {
+            public void widgetDisposed (DisposeEvent e) {
+                release ();
+            }
+        });
+    }
+
+    /**
+     * Adds the listener to the collection of listeners who will
+     * be notified when an accessible client asks for certain strings,
+     * such as name, description, help, or keyboard shortcut. The
+     * listener is notified by sending it one of the messages defined
+     * in the <code>AccessibleListener</code> interface.
+     *
+     * @param listener the listener that should be notified when the receiver
+     * is asked for a name, description, help, or keyboard shortcut string
+     *
+     * @exception IllegalArgumentException <ul>
+     *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+     * </ul>
+     * @exception SWTException <ul>
+     *    <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
+     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
+     * </ul>
+     *
+     * @see AccessibleListener
+     * @see #removeAccessibleListener
+     */
+    public void addAccessibleListener (AccessibleListener listener) {
+        checkWidget ();
+        if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+        accessibleListeners ~= listener;
+    }
+
+    /**
+     * Adds the listener to the collection of listeners who will
+     * be notified when an accessible client asks for custom control
+     * specific information. The listener is notified by sending it
+     * one of the messages defined in the <code>AccessibleControlListener</code>
+     * interface.
+     *
+     * @param listener the listener that should be notified when the receiver
+     * is asked for custom control specific information
+     *
+     * @exception IllegalArgumentException <ul>
+     *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+     * </ul>
+     * @exception SWTException <ul>
+     *    <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
+     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
+     * </ul>
+     *
+     * @see AccessibleControlListener
+     * @see #removeAccessibleControlListener
+     */
+    public void addAccessibleControlListener (AccessibleControlListener listener) {
+        checkWidget ();
+        if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+        controlListeners ~= listener;
+    }
+
+    /**
+     * Adds the listener to the collection of listeners who will
+     * be notified when an accessible client asks for custom text control
+     * specific information. The listener is notified by sending it
+     * one of the messages defined in the <code>AccessibleTextListener</code>
+     * interface.
+     *
+     * @param listener the listener that should be notified when the receiver
+     * is asked for custom text control specific information
+     *
+     * @exception IllegalArgumentException <ul>
+     *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+     * </ul>
+     * @exception SWTException <ul>
+     *    <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
+     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
+     * </ul>
+     *
+     * @see AccessibleTextListener
+     * @see #removeAccessibleTextListener
+     *
+     * @since 3.0
+     */
+    public void addAccessibleTextListener (AccessibleTextListener listener) {
+        checkWidget ();
+        if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+        textListeners ~= listener;
+    }
+
+    /**
+     * Returns the control for this Accessible object.
+     *
+     * @return the receiver's control
+     * @since 3.0
+     */
+    public Control getControl() {
+        return control;
+    }
+
+    /* checkWidget was copied from Widget, and rewritten to work in this package */
+    void checkWidget () {
+        if (!isValidThread ()) SWT.error (SWT.ERROR_THREAD_INVALID_ACCESS);
+        if (control.isDisposed ()) SWT.error (SWT.ERROR_WIDGET_DISPOSED);
+    }
+
+    AccessibleListener[] getAccessibleListeners () {
+        if (accessibleListeners.length is 0 ) return null;
+        return accessibleListeners.dup;
+    }
+
+    GtkWidget* getControlHandle () {
+        return control.handle;
+    }
+
+    AccessibleControlListener[] getControlListeners () {
+        if (controlListeners.length is 0) return null;
+        return controlListeners.dup;
+    }
+
+    AccessibleTextListener[] getTextListeners () {
+        if (textListeners.length is 0) return null;
+        return textListeners.dup;
+    }
+
+    /**
+     * Invokes platform specific functionality to allocate a new accessible object.
+     * <p>
+     * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+     * API for <code>Accessible</code>. It is marked public only so that it
+     * can be shared within the packages provided by SWT. It is not
+     * available on all platforms, and should never be called from
+     * application code.
+     * </p>
+     *
+     * @param control the control to get the accessible object for
+     * @return the platform specific accessible object
+     */
+    public static Accessible internal_new_Accessible (Control control) {
+        return new Accessible (control);
+    }
+
+    /* isValidThread was copied from Widget, and rewritten to work in this package */
+    bool isValidThread () {
+        return control.getDisplay ().getThread () is Thread.getThis ();
+    }
+
+    void release () {
+        AccessibleFactory.unregisterAccessible (/*Accessible.*/this);
+        if (accessibleObject !is null) {
+            accessibleObject.release ();
+            accessibleObject = null;
+        }
+        accessibleListeners = null;
+        controlListeners = null;
+        textListeners = null;
+    }
+    /**
+     * Removes the listener from the collection of listeners who will
+     * be notified when an accessible client asks for custom control
+     * specific information.
+     *
+     * @param listener the listener that should no longer be notified when the receiver
+     * is asked for custom control specific information
+     *
+     * @exception IllegalArgumentException <ul>
+     *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+     * </ul>
+     * @exception SWTException <ul>
+     *    <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
+     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
+     * </ul>
+     *
+     * @see AccessibleControlListener
+     * @see #addAccessibleControlListener
+     */
+    public void removeAccessibleControlListener (AccessibleControlListener listener) {
+        checkWidget ();
+        if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+        controlListeners.length = remove( controlListeners, listener, delegate bool(AccessibleControlListener a1, AccessibleControlListener a2 ){ return a1 is a2; });
+    }
+
+    /**
+     * Removes the listener from the collection of listeners who will
+     * be notified when an accessible client asks for certain strings,
+     * such as name, description, help, or keyboard shortcut.
+     *
+     * @param listener the listener that should no longer be notified when the receiver
+     * is asked for a name, description, help, or keyboard shortcut string
+     *
+     * @exception IllegalArgumentException <ul>
+     *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+     * </ul>
+     * @exception SWTException <ul>
+     *    <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
+     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
+     * </ul>
+     *
+     * @see AccessibleListener
+     * @see #addAccessibleListener
+     */
+    public void removeAccessibleListener (AccessibleListener listener) {
+        checkWidget ();
+        if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+        accessibleListeners.length = remove( accessibleListeners, listener, delegate bool( AccessibleListener a1, AccessibleListener a2 ){ return a1 is a2; });
+    }
+
+    /**
+     * Removes the listener from the collection of listeners who will
+     * be notified when an accessible client asks for custom text control
+     * specific information.
+     *
+     * @param listener the listener that should no longer be notified when the receiver
+     * is asked for custom text control specific information
+     *
+     * @exception IllegalArgumentException <ul>
+     *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+     * </ul>
+     * @exception SWTException <ul>
+     *    <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
+     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
+     * </ul>
+     *
+     * @see AccessibleTextListener
+     * @see #addAccessibleTextListener
+     *
+     * @since 3.0
+     */
+    public void removeAccessibleTextListener (AccessibleTextListener listener) {
+        checkWidget ();
+        if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+        textListeners.length = remove( textListeners, listener, delegate bool(AccessibleTextListener a1, AccessibleTextListener a2 ){ return a1 is a2; });
+    }
+
+    /**
+     * Sends a message to accessible clients that the child selection
+     * within a custom container control has changed.
+     *
+     * @exception SWTException <ul>
+     *    <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
+     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
+     * </ul>
+     *
+     * @since 3.0
+     */
+    public void selectionChanged () {
+        checkWidget ();
+        if (accessibleObject !is null) {
+            accessibleObject.selectionChanged ();
+        }
+    }
+
+    /**
+     * Sends a message to accessible clients indicating that the focus
+     * has changed within a custom control.
+     *
+     * @param childID an identifier specifying a child of the control
+     *
+     * @exception SWTException <ul>
+     *    <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
+     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
+     * </ul>
+     */
+    public void setFocus (int childID) {
+        checkWidget ();
+        if (accessibleObject !is null) {
+            accessibleObject.setFocus (childID);
+        }
+    }
+
+    /**
+     * Sends a message to accessible clients that the text
+     * caret has moved within a custom control.
+     *
+     * @param index the new caret index within the control
+     *
+     * @exception SWTException <ul>
+     *    <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
+     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
+     * </ul>
+     *
+     * @since 3.0
+     */
+    public void textCaretMoved (int index) {
+        checkWidget ();
+        if (accessibleObject !is null) {
+            accessibleObject.textCaretMoved (index);
+        }
+    }
+
+    /**
+     * Sends a message to accessible clients that the text
+     * within a custom control has changed.
+     *
+     * @param type the type of change, one of <code>ACC.NOTIFY_TEXT_INSERT</code>
+     * or <code>ACC.NOTIFY_TEXT_DELETE</code>
+     * @param startIndex the text index within the control where the insertion or deletion begins
+     * @param length the non-negative length in characters of the insertion or deletion
+     *
+     * @exception SWTException <ul>
+     *    <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
+     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
+     * </ul>
+     *
+     * @see ACC#TEXT_INSERT
+     * @see ACC#TEXT_DELETE
+     *
+     * @since 3.0
+     */
+    public void textChanged (int type, int startIndex, int length) {
+        checkWidget ();
+        if (accessibleObject !is null) {
+            accessibleObject.textChanged (type, startIndex, length);
+        }
+    }
+
+    /**
+     * Sends a message to accessible clients that the text
+     * selection has changed within a custom control.
+     *
+     * @exception SWTException <ul>
+     *    <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
+     *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
+     * </ul>
+     *
+     * @since 3.0
+     */
+    public void textSelectionChanged () {
+        checkWidget ();
+        if (accessibleObject !is null) {
+            accessibleObject.textSelectionChanged ();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/accessibility/AccessibleAdapter.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,135 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.accessibility.AccessibleAdapter;
+
+import java.lang.all;
+
+import org.eclipse.swt.accessibility.AccessibleListener;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+
+/**
+ * This adapter class provides default implementations for the
+ * methods described by the <code>AccessibleListener</code> interface.
+ * <p>
+ * Classes that wish to deal with <code>AccessibleEvent</code>s can
+ * extend this class and override only the methods that they are
+ * interested in.
+ * </p><p>
+ * Note: Accessibility clients use child identifiers to specify
+ * whether they want information about a control or one of its children.
+ * Child identifiers are increasing integers beginning with 0.
+ * The identifier CHILDID_SELF represents the control itself.
+ * </p>
+ *
+ * @see AccessibleListener
+ * @see AccessibleEvent
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 2.0
+ */
+public abstract class AccessibleAdapter : AccessibleListener {
+
+    /**
+     * Sent when an accessibility client requests the name
+     * of the control, or the name of a child of the control.
+     * The default behavior is to do nothing.
+     * <p>
+     * Return the name of the control or specified child in the
+     * <code>result</code> field of the event object. Returning
+     * an empty string tells the client that the control or child
+     * does not have a name, and returning null tells the client
+     * to use the platform name.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>childID [IN] - an identifier specifying the control or one of its children</li>
+     *    <li>result [OUT] - the requested name string, or null</li>
+     * </ul>
+     */
+    public void getName(AccessibleEvent e) {
+    }
+
+    /**
+     * Sent when an accessibility client requests the help string
+     * of the control, or the help string of a child of the control.
+     * The default behavior is to do nothing.
+     * <p>
+     * The information in this property should be similar to the help
+     * provided by toolTipText. It describes what the control or child
+     * does or how to use it, as opposed to getDescription, which
+     * describes appearance.
+     * </p><p>
+     * Return the help string of the control or specified child in
+     * the <code>result</code> field of the event object. Returning
+     * an empty string tells the client that the control or child
+     * does not have a help string, and returning null tells the
+     * client to use the platform help string.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>childID [IN] - an identifier specifying the control or one of its children</li>
+     *    <li>result [OUT] - the requested help string, or null</li>
+     * </ul>
+     */
+    public void getHelp(AccessibleEvent e) {
+    }
+
+    /**
+     * Sent when an accessibility client requests the keyboard shortcut
+     * of the control, or the keyboard shortcut of a child of the control.
+     * The default behavior is to do nothing.
+     * <p>
+     * A keyboard shortcut can either be a mnemonic, or an accelerator.
+     * As a general rule, if the control or child can receive keyboard focus,
+     * then you should expose its mnemonic, and if it cannot receive keyboard
+     * focus, then you should expose its accelerator.
+     * </p><p>
+     * Return the keyboard shortcut string of the control or specified child
+     * in the <code>result</code> field of the event object. Returning an
+     * empty string tells the client that the control or child does not
+     * have a keyboard shortcut string, and returning null tells the client
+     * to use the platform keyboard shortcut string.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>childID [IN] - an identifier specifying the control or one of its children</li>
+     *    <li>result [OUT] - the requested keyboard shortcut string (example: "ALT+N"), or null</li>
+     * </ul>
+     */
+    public void getKeyboardShortcut(AccessibleEvent e) {
+    }
+
+    /**
+     * Sent when an accessibility client requests a description
+     * of the control, or a description of a child of the control.
+     * The default behavior is to do nothing.
+     * <p>
+     * This is a textual description of the control or child's visual
+     * appearance, which is typically only necessary if it cannot be
+     * determined from other properties such as role.
+     * </p><p>
+     * Return the description of the control or specified child in
+     * the <code>result</code> field of the event object. Returning
+     * an empty string tells the client that the control or child
+     * does not have a description, and returning null tells the
+     * client to use the platform description.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>childID [IN] - an identifier specifying the control or one of its children</li>
+     *    <li>result [OUT] - the requested description string, or null</li>
+     * </ul>
+     */
+    public void getDescription(AccessibleEvent e) {
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/accessibility/AccessibleControlAdapter.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,258 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.accessibility.AccessibleControlAdapter;
+
+import java.lang.all;
+
+import org.eclipse.swt.accessibility.AccessibleControlListener;
+import org.eclipse.swt.accessibility.AccessibleControlEvent;
+
+/**
+ * This adapter class provides default implementations for the
+ * methods described by the <code>AccessibleControlListener</code> interface.
+ * <p>
+ * Classes that wish to deal with <code>AccessibleControlEvent</code>s can
+ * extend this class and override only the methods that they are
+ * interested in.
+ * </p><p>
+ * Note: Accessibility clients use child identifiers to specify
+ * whether they want information about a control or one of its children.
+ * Child identifiers are increasing integers beginning with 0.
+ * The identifier CHILDID_SELF represents the control itself.
+ * When returning a child identifier to a client, you may use CHILDID_NONE
+ * to indicate that no child or control has the required information.
+ * </p><p>
+ * Note: This adapter is typically used by implementors of
+ * a custom control to provide very detailed information about
+ * the control instance to accessibility clients.
+ * </p>
+ *
+ * @see AccessibleControlListener
+ * @see AccessibleControlEvent
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 2.0
+ */
+public abstract class AccessibleControlAdapter : AccessibleControlListener {
+
+    /**
+     * Sent when an accessibility client requests the identifier
+     * of the control child at the specified display coordinates.
+     * The default behavior is to do nothing.
+     * <p>
+     * Return the identifier of the child at display point (x, y)
+     * in the <code>childID</code> field of the event object.
+     * Return CHILDID_SELF if point (x, y) is in the control itself
+     * and not in any child. Return CHILDID_NONE if point (x, y)
+     * is not contained in either the control or any of its children.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>x, y [IN] - the specified point in display coordinates</li>
+     *    <li>childID [Typical OUT] - the ID of the child at point, or CHILDID_SELF, or CHILDID_NONE</li>
+     *    <li>accessible [Optional OUT] - the accessible object for the control or child may be returned instead of the childID</li>
+     * </ul>
+     */
+    public void getChildAtPoint(AccessibleControlEvent e) {
+    }
+
+    /**
+     * Sent when an accessibility client requests the location
+     * of the control, or the location of a child of the control.
+     * The default behavior is to do nothing.
+     * <p>
+     * Return a rectangle describing the location of the specified
+     * control or child in the <code>x, y, width, and height</code>
+     * fields of the event object.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>childID [IN] - an identifier specifying the control or one of its children</li>
+     *    <li>x, y, width, height [OUT] - the control or child location in display coordinates</li>
+     * </ul>
+     */
+    public void getLocation(AccessibleControlEvent e) {
+    }
+
+    /**
+     * Sent when an accessibility client requests the accessible object
+     * for a child of the control.
+     * The default behavior is to do nothing.
+     * <p>
+     * Return an <code>Accessible</code> for the specified control or
+     * child in the <code>accessible</code> field of the event object.
+     * Return null if the specified child does not have its own
+     * <code>Accessible</code>.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>childID [IN] - an identifier specifying a child of the control</li>
+     *    <li>accessible [OUT] - an Accessible for the specified childID, or null if one does not exist</li>
+     * </ul>
+     */
+    public void getChild(AccessibleControlEvent e) {
+    }
+
+    /**
+     * Sent when an accessibility client requests the number of
+     * children in the control.
+     * The default behavior is to do nothing.
+     * <p>
+     * Return the number of child items in the <code>detail</code>
+     * field of the event object.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>detail [OUT] - the number of child items in this control</li>
+     * </ul>
+     */
+    public void getChildCount(AccessibleControlEvent e) {
+    }
+
+    /**
+     * Sent when an accessibility client requests the default action
+     * of the control, or the default action of a child of the control.
+     * The default behavior is to do nothing.
+     * <p>
+     * This string is typically a verb describing what the user does to it.
+     * For example, a Push Button's default action is "Press", a Check Button's
+     * is "Check" or "UnCheck", and List items have the default action "Double Click".
+     * </p><p>
+     * Return a string describing the default action of the specified
+     * control or child in the <code>result</code> field of the event object.
+     * Returning null tells the client to use the platform default action string.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>childID [IN] - an identifier specifying the control or one of its children</li>
+     *    <li>result [OUT] - the requested default action string, or null</li>
+     * </ul>
+     */
+    public void getDefaultAction(AccessibleControlEvent e) {
+    }
+
+    /**
+     * Sent when an accessibility client requests the identity of
+     * the child or control that has keyboard focus.
+     * The default behavior is to do nothing.
+     * <p>
+     * Return the identifier of the child that has focus in the
+     * <code>childID</code> field of the event object.
+     * Return CHILDID_SELF if the control itself has keyboard focus.
+     * Return CHILDID_NONE if neither the control nor any of its children has focus.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>childID [Typical OUT] - the ID of the child with focus, or CHILDID_SELF, or CHILDID_NONE</li>
+     *    <li>accessible [Optional OUT] - the accessible object for a child may be returned instead of its childID</li>
+     * </ul>
+     */
+    public void getFocus(AccessibleControlEvent e) {
+    }
+
+    /**
+     * Sent when an accessibility client requests the role
+     * of the control, or the role of a child of the control.
+     * The default behavior is to do nothing.
+     * <p>
+     * Return a role constant (constant defined in ACC beginning with ROLE_)
+     * that describes the role of the specified control or child in the
+     * <code>detail</code> field of the event object.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>childID [IN] - an identifier specifying the control or one of its children</li>
+     *    <li>detail [OUT] - a role constant describing the role of the control or child</li>
+     * </ul>
+     */
+    public void getRole(AccessibleControlEvent e) {
+    }
+
+    /**
+     * Sent when an accessibility client requests the identity of
+     * the child or control that is currently selected.
+     * The default behavior is to do nothing.
+     * <p>
+     * Return the identifier of the selected child in the
+     * <code>childID</code> field of the event object.
+     * Return CHILDID_SELF if the control itself is selected.
+     * Return CHILDID_MULTIPLE if multiple children are selected, and return an array of childIDs in the <code>children</code> field.
+     * Return CHILDID_NONE if neither the control nor any of its children are selected.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>childID [Typical OUT] - the ID of the selected child, or CHILDID_SELF, or CHILDID_MULTIPLE, or CHILDID_NONE</li>
+     *    <li>accessible [Optional OUT] - the accessible object for the control or child may be returned instead of the childID</li>
+     * </ul>
+     */
+    public void getSelection(AccessibleControlEvent e) {
+    }
+
+    /**
+     * Sent when an accessibility client requests the state
+     * of the control, or the state of a child of the control.
+     * The default behavior is to do nothing.
+     * <p>
+     * Return a state mask (mask bit constants defined in ACC beginning with STATE_)
+     * that describes the current state of the specified control or child in the
+     * <code>detail</code> field of the event object.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>childID [IN] - an identifier specifying the control or one of its children</li>
+     *    <li>detail [OUT] - a state mask describing the current state of the control or child</li>
+     * </ul>
+     */
+    public void getState(AccessibleControlEvent e) {
+    }
+
+    /**
+     * Sent when an accessibility client requests the value
+     * of the control, or the value of a child of the control.
+     * The default behavior is to do nothing.
+     * <p>
+     * Many controls do not return a value. Examples of controls
+     * that do are: Combo returns the text string, Text returns
+     * its contents, ProgressBar returns a string representing a
+     * percentage, and Tree items return a string representing
+     * their level in the tree.
+     * </p><p>
+     * Return a string describing the value of the specified control
+     * or child in the <code>result</code> field of the event object.
+     * Returning null tells the client to use the platform value string.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>childID [IN] - an identifier specifying the control or one of its children</li>
+     *    <li>result [OUT] - the requested value string, or null</li>
+     * </ul>
+     */
+    public void getValue(AccessibleControlEvent e) {
+    }
+
+    /**
+     * Sent when an accessibility client requests the children of the control.
+     * The default behavior is to do nothing.
+     * <p>
+     * Return the children as an array of childIDs in the <code>children</code>
+     * field of the event object.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>children [Typical OUT] - an array of childIDs</li>
+     *    <li>accessible [Optional OUT] - an array of accessible objects for the children may be returned instead of the childIDs</li>
+     * </ul>
+     */
+    public void getChildren(AccessibleControlEvent e) {
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/accessibility/AccessibleControlEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.accessibility.AccessibleControlEvent;
+
+import java.lang.all;
+
+import org.eclipse.swt.accessibility.Accessible;
+
+import org.eclipse.swt.internal.SWTEventObject;
+import tango.text.convert.Format;
+
+/**
+ * Instances of this class are sent as a result of
+ * accessibility clients sending messages to controls
+ * asking for detailed information about the implementation
+ * of the control instance. Typically, only implementors
+ * of custom controls need to listen for this event.
+ * <p>
+ * Note: The meaning of each field depends on the
+ * message that was sent.
+ * </p>
+ *
+ * @see AccessibleControlListener
+ * @see AccessibleControlAdapter
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 2.0
+ */
+public class AccessibleControlEvent : SWTEventObject {
+    public int childID;         // IN/OUT
+    public Accessible accessible;   // OUT
+    public int x, y;                // IN/OUT
+    public int width, height;       // OUT
+    public int detail;          // IN/OUT
+    public String result;           // OUT
+    public Object children[];       // [OUT]
+
+    //static final long serialVersionUID = 3257281444169529141L;
+
+/**
+ * Constructs a new instance of this class.
+ *
+ * @param source the object that fired the event
+ */
+public this(Object source) {
+    super(source);
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+public override String toString () {
+    return Format( "AccessibleControlEvent {childID={} accessible={} x={} y={} width={} heigth={} detail={} result={}",
+        childID, accessible, x, y, width, height, detail, result);
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/accessibility/AccessibleControlListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,237 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.accessibility.AccessibleControlListener;
+
+import java.lang.all;
+
+import org.eclipse.swt.accessibility.AccessibleControlEvent;
+import org.eclipse.swt.internal.SWTEventListener;
+
+/**
+ * Classes that implement this interface provide methods
+ * that deal with the events that are generated when an
+ * accessibility client sends a message to a control.
+ * <p>
+ * After creating an instance of a class that implements
+ * this interface it can be added to a control using the
+ * <code>addAccessibleControlListener</code> method and removed
+ * using the <code>removeAccessibleControlListener</code> method.
+ * When a client requests information the appropriate method
+ * will be invoked.
+ * </p><p>
+ * Note: Accessibility clients use child identifiers to specify
+ * whether they want information about a control or one of its children.
+ * Child identifiers are increasing integers beginning with 0.
+ * The identifier CHILDID_SELF represents the control itself.
+ * </p><p>
+ * Note: This interface is typically used by implementors of
+ * a custom control to provide very detailed information about
+ * the control instance to accessibility clients.
+ * </p>
+ *
+ * @see AccessibleControlAdapter
+ * @see AccessibleControlEvent
+ *
+ * @since 2.0
+ */
+public interface AccessibleControlListener : SWTEventListener {
+
+    /**
+     * Sent when an accessibility client requests the identifier
+     * of the control child at the specified display coordinates.
+     * <p>
+     * Return the identifier of the child at display point (x, y)
+     * in the <code>childID</code> field of the event object.
+     * Return CHILDID_SELF if point (x, y) is in the control itself
+     * and not in any child. Return CHILDID_NONE if point (x, y)
+     * is not contained in either the control or any of its children.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>x, y [IN] - the specified point in display coordinates</li>
+     *    <li>childID [Typical OUT] - the ID of the child at point, or CHILDID_SELF, or CHILDID_NONE</li>
+     *    <li>accessible [Optional OUT] - the accessible object for the control or child may be returned instead of the childID</li>
+     * </ul>
+     */
+    public void getChildAtPoint(AccessibleControlEvent e);
+
+    /**
+     * Sent when an accessibility client requests the location
+     * of the control, or the location of a child of the control.
+     * <p>
+     * Return a rectangle describing the location of the specified
+     * control or child in the <code>x, y, width, and height</code>
+     * fields of the event object.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>childID [IN] - an identifier specifying the control or one of its children</li>
+     *    <li>x, y, width, height [OUT] - the control or child location in display coordinates</li>
+     * </ul>
+     */
+    public void getLocation(AccessibleControlEvent e);
+
+    /**
+     * Sent when an accessibility client requests the accessible object
+     * for a child of the control.
+     * <p>
+     * Return an <code>Accessible</code> for the specified control or
+     * child in the <code>accessible</code> field of the event object.
+     * Return null if the specified child does not have its own
+     * <code>Accessible</code>.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>childID [IN] - an identifier specifying a child of the control</li>
+     *    <li>accessible [OUT] - an Accessible for the specified childID, or null if one does not exist</li>
+     * </ul>
+     */
+    public void getChild(AccessibleControlEvent e);
+
+    /**
+     * Sent when an accessibility client requests the number of
+     * children in the control.
+     * <p>
+     * Return the number of child items in the <code>detail</code>
+     * field of the event object.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>detail [OUT] - the number of child items in this control</li>
+     * </ul>
+     */
+    public void getChildCount(AccessibleControlEvent e);
+
+    /**
+     * Sent when an accessibility client requests the default action
+     * of the control, or the default action of a child of the control.
+     * <p>
+     * This string is typically a verb describing what the user does to it.
+     * For example, a Push Button's default action is "Press", a Check Button's
+     * is "Check" or "UnCheck", and List items have the default action "Double Click".
+     * </p><p>
+     * Return a string describing the default action of the specified
+     * control or child in the <code>result</code> field of the event object.
+     * Returning null tells the client to use the platform default action string.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>childID [IN] - an identifier specifying the control or one of its children</li>
+     *    <li>result [OUT] - the requested default action string, or null</li>
+     * </ul>
+     */
+    public void getDefaultAction(AccessibleControlEvent e);
+
+    /**
+     * Sent when an accessibility client requests the identity of
+     * the child or control that has keyboard focus.
+     * <p>
+     * Return the identifier of the child that has focus in the
+     * <code>childID</code> field of the event object.
+     * Return CHILDID_SELF if the control itself has keyboard focus.
+     * Return CHILDID_NONE if neither the control nor any of its children has focus.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>childID [Typical OUT] - the ID of the child with focus, or CHILDID_SELF, or CHILDID_NONE</li>
+     *    <li>accessible [Optional OUT] - the accessible object for a child may be returned instead of its childID</li>
+     * </ul>
+     */
+    public void getFocus(AccessibleControlEvent e);
+
+    /**
+     * Sent when an accessibility client requests the role
+     * of the control, or the role of a child of the control.
+     * <p>
+     * Return a role constant (constant defined in ACC beginning with ROLE_)
+     * that describes the role of the specified control or child in the
+     * <code>detail</code> field of the event object.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>childID [IN] - an identifier specifying the control or one of its children</li>
+     *    <li>detail [OUT] - a role constant describing the role of the control or child</li>
+     * </ul>
+     */
+    public void getRole(AccessibleControlEvent e);
+
+    /**
+     * Sent when an accessibility client requests the identity of
+     * the child or control that is currently selected.
+     * <p>
+     * Return the identifier of the selected child in the
+     * <code>childID</code> field of the event object.
+     * Return CHILDID_SELF if the control itself is selected.
+     * Return CHILDID_MULTIPLE if multiple children are selected, and return an array of childIDs in the <code>children</code> field.
+     * Return CHILDID_NONE if neither the control nor any of its children are selected.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>childID [Typical OUT] - the ID of the selected child, or CHILDID_SELF, or CHILDID_MULTIPLE, or CHILDID_NONE</li>
+     *    <li>accessible [Optional OUT] - the accessible object for the control or child may be returned instead of the childID</li>
+     * </ul>
+     */
+    public void getSelection(AccessibleControlEvent e);
+
+    /**
+     * Sent when an accessibility client requests the state
+     * of the control, or the state of a child of the control.
+     * <p>
+     * Return a state mask (mask bit constants defined in ACC beginning with STATE_)
+     * that describes the current state of the specified control or child in the
+     * <code>detail</code> field of the event object.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>childID [IN] - an identifier specifying the control or one of its children</li>
+     *    <li>detail [OUT] - a state mask describing the current state of the control or child</li>
+     * </ul>
+     */
+    public void getState(AccessibleControlEvent e);
+
+    /**
+     * Sent when an accessibility client requests the value
+     * of the control, or the value of a child of the control.
+     * <p>
+     * Many controls do not return a value. Examples of controls
+     * that do are: Combo returns the text string, Text returns
+     * its contents, ProgressBar returns a string representing a
+     * percentage, and Tree items return a string representing
+     * their level in the tree.
+     * </p><p>
+     * Return a string describing the value of the specified control
+     * or child in the <code>result</code> field of the event object.
+     * Returning null tells the client to use the platform value string.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>childID [IN] - an identifier specifying the control or one of its children</li>
+     *    <li>result [OUT] - the requested value string, or null</li>
+     * </ul>
+     */
+    public void getValue(AccessibleControlEvent e);
+
+    /**
+     * Sent when an accessibility client requests the children of the control.
+     * <p>
+     * Return the children as an array of childIDs in the <code>children</code>
+     * field of the event object.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>children [Typical OUT] - an array of childIDs</li>
+     *    <li>children [Optional OUT] - an array of accessible objects for the children may be returned instead of the childIDs</li>
+     * </ul>
+     */
+    public void getChildren(AccessibleControlEvent e);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/accessibility/AccessibleEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.accessibility.AccessibleEvent;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.internal.SWTEventObject;
+import tango.text.convert.Format;
+
+/**
+ * Instances of this class are sent as a result of
+ * accessibility clients sending messages to controls
+ * asking for information about the control instance.
+ * <p>
+ * Note: The meaning of the result field depends
+ * on the message that was sent.
+ * </p>
+ *
+ * @see AccessibleListener
+ * @see AccessibleAdapter
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 2.0
+ */
+public class AccessibleEvent : SWTEventObject {
+    /**
+     * The value of this field is set by an accessibility client
+     * before the accessible listener method is called.
+     * ChildID can be CHILDID_SELF, representing the control itself,
+     * or a 0-based integer representing a specific child of the control.
+     */
+    public int childID;
+
+    /**
+     * The value of this field must be set in the accessible listener
+     * method before returning.
+     * What to set it to depends on the listener method called, and
+     * the childID specified by the client.
+     */
+    public String result;
+
+    //static final long serialVersionUID = 3257567304224026934L;
+
+/**
+ * Constructs a new instance of this class.
+ *
+ * @param source the object that fired the event
+ */
+public this(Object source) {
+    super(source);
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+public String toString () {
+    return Format( "AccessibleEvent {childID={} result={}}", childID, result );
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/accessibility/AccessibleFactory.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,313 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.accessibility.AccessibleFactory;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.internal.accessibility.gtk.ATK;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.accessibility.Accessible;
+import org.eclipse.swt.accessibility.ACC;
+import org.eclipse.swt.accessibility.AccessibleObject;
+import org.eclipse.swt.accessibility.AccessibleControlEvent;
+import org.eclipse.swt.accessibility.AccessibleControlListener;
+
+import org.eclipse.swt.SWT;
+
+class AccessibleFactory {
+    AtkObjectFactory * handle;
+    uint objectParentType;
+    char* widgetTypeName;
+
+    //Callback atkObjectFactoryCB_create_accessible;
+    //Callback gTypeInfo_base_init_factory;
+    Accessible[GtkWidget*] accessibles;
+
+    static long[String] Types;
+    static AccessibleFactory[long] Factories;
+
+    static uint DefaultParentType; //$NON-NLS-1$
+    static const String FACTORY_PARENTTYPENAME = "AtkObjectFactory";
+    static const String SWT_TYPE_PREFIX = "SWT";
+    static const String CHILD_TYPENAME = "Child";
+    static const String FACTORY_TYPENAME = "SWTFactory";
+    static const int[] actionRoles = [
+        ACC.ROLE_CHECKBUTTON, ACC.ROLE_COMBOBOX, ACC.ROLE_LINK,
+        ACC.ROLE_MENUITEM, ACC.ROLE_PUSHBUTTON, ACC.ROLE_RADIOBUTTON,
+    ];
+    static const int[] hypertextRoles = [ACC.ROLE_LINK];
+    static const int[] selectionRoles = [
+        ACC.ROLE_LIST, ACC.ROLE_TABFOLDER, ACC.ROLE_TABLE, ACC.ROLE_TREE,
+    ];
+    static const int[] textRoles = [
+        ACC.ROLE_COMBOBOX, ACC.ROLE_LINK, ACC.ROLE_LABEL, ACC.ROLE_TEXT,
+    ];
+
+    /* AT callbacks*/
+    /* interface definitions */
+    private static GTypeInfo* ObjectIfaceDefinition;
+    private static GInterfaceInfo* ActionIfaceDefinition;
+    private static GInterfaceInfo* ComponentIfaceDefinition;
+    private static GInterfaceInfo* HypertextIfaceDefinition;
+    private static GInterfaceInfo* SelectionIfaceDefinition;
+    private static GInterfaceInfo* TextIfaceDefinition;
+
+    private static synchronized void static_this(){
+        AccessibleObject.static_this();
+        /* Action interface */
+        if( ActionIfaceDefinition is null ){
+            DefaultParentType = OS.g_type_from_name ("GtkAccessible"); //$NON-NLS-1$
+            ActionIfaceDefinition = cast(GInterfaceInfo*)OS.g_malloc (GInterfaceInfo.sizeof);
+            ActionIfaceDefinition.interface_init = &AccessibleFactory.initActionIfaceCB;
+        }
+        /* Component interface */
+        if( ComponentIfaceDefinition is null ){
+            ComponentIfaceDefinition = cast(GInterfaceInfo*)OS.g_malloc (GInterfaceInfo.sizeof);
+            ComponentIfaceDefinition.interface_init = &AccessibleFactory.initComponentIfaceCB;
+        }
+        /* Hypertext interface */
+        if( HypertextIfaceDefinition is null ){
+            HypertextIfaceDefinition = cast(GInterfaceInfo*)OS.g_malloc (GInterfaceInfo.sizeof);
+            HypertextIfaceDefinition.interface_init = &AccessibleFactory.initHypertextIfaceCB;
+        }
+        /* Selection interface */
+        if( SelectionIfaceDefinition is null ){
+            SelectionIfaceDefinition = cast(GInterfaceInfo*)OS.g_malloc (GInterfaceInfo.sizeof);
+            SelectionIfaceDefinition.interface_init = &AccessibleFactory.initSelectionIfaceCB;
+        }
+        /* Text interface */
+        if( TextIfaceDefinition is null ){
+            TextIfaceDefinition =cast(GInterfaceInfo*) OS.g_malloc (GInterfaceInfo.sizeof);
+            TextIfaceDefinition.interface_init = &AccessibleFactory.initTextIfaceCB;
+        }
+    }
+
+    private this (int /*long*/ widgetType) {
+        widgetTypeName = OS.g_type_name (widgetType);
+        String factoryName = FACTORY_TYPENAME ~ fromStringz( widgetTypeName ) ~ \0;
+        if (OS.g_type_from_name (factoryName.ptr) is 0) {
+            /* register the factory */
+            auto registry = ATK.atk_get_default_registry ();
+            auto previousFactory = ATK.atk_registry_get_factory (registry, widgetType);
+            objectParentType = ATK.atk_object_factory_get_accessible_type (previousFactory);
+            if (objectParentType is 0) objectParentType = DefaultParentType;
+            auto factoryParentType = OS.g_type_from_name (FACTORY_PARENTTYPENAME.ptr);
+            auto typeInfo = cast(GTypeInfo*) OS.g_malloc (GTypeInfo.sizeof);
+            typeInfo.base_init = &gTypeInfo_base_init_factory;
+            typeInfo.class_size = AtkObjectFactoryClass.sizeof;
+            typeInfo.instance_size = AtkObjectFactory.sizeof;
+            auto swtFactoryType = OS.g_type_register_static (factoryParentType, factoryName.ptr, typeInfo, 0);
+            ATK.atk_registry_set_factory_type (registry, widgetType, swtFactoryType);
+            handle = ATK.atk_registry_get_factory (registry, widgetType);
+        }
+    }
+
+    void addAccessible (Accessible accessible) {
+        auto controlHandle = accessible.getControlHandle ();
+        accessibles[controlHandle] = accessible;
+        ATK.atk_object_factory_create_accessible (handle, cast(GObject*)controlHandle);
+    }
+
+    private static extern(C) AtkObject* atkObjectFactory_create_accessible (GObject* widget) {
+        auto widgetType = OS.G_OBJECT_TYPE ( cast(GTypeInstance*)widget);
+        if( auto factory = widgetType in Factories ){
+            with( *factory ){
+                Accessible accessible = accessibles[ cast(GtkWidget*) widget ];
+                if (accessible is null) {
+                    /*
+                    * we don't care about this control, so create it with the parent's
+                    * type so that its accessibility callbacks will not pass though here
+                    */
+                    auto result = cast(AtkObject*) OS.g_object_new (objectParentType, null);
+                    ATK.atk_object_initialize (result, cast(void*)widget);
+                    return result;
+                }
+                /* if an atk object has already been created for this widget then just return it */
+                if (accessible.accessibleObject !is null) {
+                    return accessible.accessibleObject.handle;
+                }
+                String buffer = fromStringz( widgetTypeName ).dup;
+                auto type = getType (buffer, accessible, objectParentType, ACC.CHILDID_SELF);
+                AccessibleObject object = new AccessibleObject (type, cast(GtkWidget*)widget, accessible, objectParentType, false);
+                accessible.accessibleObject = object;
+                return object.handle;
+            }
+        }
+        else{
+            getDwtLogger().info( __FILE__, __LINE__,  "AccessibleFactory.atkObjectFactoryCB_create_accessible cannot find factory instance" );
+        }
+    }
+
+    static int /*long*/ getChildType (Accessible accessible, int childIndex) {
+        return getType (CHILD_TYPENAME, accessible, DefaultParentType, childIndex);
+    }
+
+    static int /*long*/ getDefaultParentType () {
+        return DefaultParentType;
+    }
+
+    static int /*long*/ getType (String widgetTypeName, Accessible accessible, int /*long*/ parentType, int childId) {
+        AccessibleControlEvent event = new AccessibleControlEvent (accessible);
+        event.childID = childId;
+        AccessibleControlListener[] listeners = accessible.getControlListeners ();
+        for (int i = 0; i < listeners.length; i++) {
+            listeners [i].getRole (event);
+        }
+        bool action = false, hypertext = false, selection = false, text = false;
+        if (event.detail !is 0) {    /* a role was specified */
+            for (int i = 0; i < actionRoles.length; i++) {
+                if (event.detail is actionRoles [i]) {
+                    action = true;
+                    break;
+                }
+            }
+            for (int i = 0; i < hypertextRoles.length; i++) {
+                if (event.detail is hypertextRoles [i]) {
+                    hypertext = true;
+                    break;
+                }
+            }
+            for (int i = 0; i < selectionRoles.length; i++) {
+                if (event.detail is selectionRoles [i]) {
+                    selection = true;
+                    break;
+                }
+            }
+            for (int i = 0; i < textRoles.length; i++) {
+                if (event.detail is textRoles [i]) {
+                    text = true;
+                    break;
+                }
+            }
+        } else {
+            action = hypertext = selection = text = true;
+        }
+        String swtTypeName = SWT_TYPE_PREFIX.dup;
+        swtTypeName ~= widgetTypeName;
+        if (action) swtTypeName ~= "Action"; //$NON-NLS-1$
+        if (hypertext) swtTypeName ~= "Hypertext"; //$NON-NLS-1$
+        if (selection) swtTypeName ~= "Selection"; //$NON-NLS-1$
+        if (text) swtTypeName ~= "Text"; //$NON-NLS-1$
+
+        int /*long*/ type = 0;
+        if (swtTypeName in Types ) {
+            type = Types[swtTypeName];
+        } else {
+            /* define the type */
+            GTypeQuery* query = new GTypeQuery ();
+            OS.g_type_query (parentType, query);
+
+            GTypeInfo* typeInfo = new GTypeInfo ();
+            typeInfo.base_init = &gTypeInfo_base_init_type;
+            typeInfo.class_size = query.class_size;
+            typeInfo.instance_size = query.instance_size;
+            ObjectIfaceDefinition = typeInfo;
+
+            type = OS.g_type_register_static (parentType, toStringz( swtTypeName ), ObjectIfaceDefinition, 0);
+            OS.g_type_add_interface_static (type, AccessibleObject.ATK_COMPONENT_TYPE, ComponentIfaceDefinition);
+            if (action) OS.g_type_add_interface_static (type, AccessibleObject.ATK_ACTION_TYPE, ActionIfaceDefinition);
+            if (hypertext) OS.g_type_add_interface_static (type, AccessibleObject.ATK_HYPERTEXT_TYPE, HypertextIfaceDefinition);
+            if (selection) OS.g_type_add_interface_static (type, AccessibleObject.ATK_SELECTION_TYPE, SelectionIfaceDefinition);
+            if (text) OS.g_type_add_interface_static (type, AccessibleObject.ATK_TEXT_TYPE, TextIfaceDefinition);
+            Types[swtTypeName] = type;
+        }
+        return type;
+    }
+
+    private static extern(C) void gTypeInfo_base_init_factory (void* klass) {
+        auto atkObjectFactoryClass = ATK.ATK_OBJECT_FACTORY_CLASS (klass);
+        atkObjectFactoryClass.create_accessible = &atkObjectFactory_create_accessible;
+    }
+
+    private static extern(C) void gTypeInfo_base_init_type (void* klass) {
+        auto objectClass = cast(AtkObjectClass*)klass;
+        objectClass.get_name = &AccessibleObject.atkObject_get_name;
+        objectClass.get_description = &AccessibleObject.atkObject_get_description;
+        objectClass.get_n_children = &AccessibleObject.atkObject_get_n_children;
+        objectClass.get_role = &AccessibleObject.atkObject_get_role;
+        objectClass.get_parent = &AccessibleObject.atkObject_get_parent;
+        objectClass.ref_state_set = &AccessibleObject.atkObject_ref_state_set;
+        objectClass.get_index_in_parent = &AccessibleObject.atkObject_get_index_in_parent;
+        objectClass.ref_child = &AccessibleObject.atkObject_ref_child;
+
+        GObjectClass* gObjectClass = OS.G_OBJECT_CLASS ( cast(GTypeClass*)klass);
+        gObjectClass.finalize = &AccessibleObject.gObjectClass_finalize;
+    }
+
+    private static extern(C) void initActionIfaceCB ( void* g_iface, void* iface_data ) {
+        auto iface = cast(AtkActionIface*)g_iface;
+        iface.get_keybinding =  &AccessibleObject.atkAction_get_keybinding;
+        iface.get_name =  &AccessibleObject.atkAction_get_name;
+    }
+
+    private static extern(C) void initComponentIfaceCB ( void* g_iface, void* iface_data ) {
+        auto iface = cast(AtkComponentIface*)g_iface;
+        iface.get_extents = &AccessibleObject.atkComponent_get_extents;
+        iface.get_position = &AccessibleObject.atkComponent_get_position;
+        iface.get_size = &AccessibleObject.atkComponent_get_size;
+        iface.ref_accessible_at_point = &AccessibleObject.atkComponent_ref_accessible_at_point;
+    }
+
+    private static extern(C) void initHypertextIfaceCB ( void* g_iface, void* iface_data ) {
+        auto iface = cast(AtkHypertextIface*)g_iface;
+        iface.get_link = &AccessibleObject.atkHypertext_get_link;
+        iface.get_link_index = &AccessibleObject.atkHypertext_get_link_index;
+        iface.get_n_links = &AccessibleObject.atkHypertext_get_n_links;
+    }
+
+    private static extern(C) void initSelectionIfaceCB ( void* g_iface, void* iface_data ) {
+        auto iface = cast(AtkSelectionIface*)g_iface;
+        iface.is_child_selected = &AccessibleObject.atkSelection_is_child_selected;
+        iface.ref_selection = &AccessibleObject.atkSelection_ref_selection;
+    }
+
+    private static extern(C) void initTextIfaceCB ( void* g_iface, void* iface_data ) {
+        auto iface = cast(AtkTextIface*)g_iface;
+        iface.get_caret_offset = &AccessibleObject.atkText_get_caret_offset;
+        iface.get_character_at_offset = &AccessibleObject.atkText_get_character_at_offset;
+        iface.get_character_count = &AccessibleObject.atkText_get_character_count;
+        iface.get_n_selections = &AccessibleObject.atkText_get_n_selections;
+        iface.get_selection = &AccessibleObject.atkText_get_selection;
+        iface.get_text = &AccessibleObject.atkText_get_text;
+        iface.get_text_after_offset = &AccessibleObject.atkText_get_text_after_offset;
+        iface.get_text_at_offset = &AccessibleObject.atkText_get_text_at_offset;
+        iface.get_text_before_offset = &AccessibleObject.atkText_get_text_before_offset;
+    }
+
+    static void registerAccessible (Accessible accessible) {
+        static_this();
+        /* If DefaultParentType is 0 then OS accessibility is not active */
+        if (DefaultParentType is 0) return;
+        auto controlHandle = accessible.getControlHandle ();
+        auto widgetType = OS.G_OBJECT_TYPE ( cast(GTypeInstance*)controlHandle);
+        AccessibleFactory factory = Factories[widgetType];
+        if (factory is null) {
+            factory = new AccessibleFactory (widgetType);
+            Factories[widgetType] = factory;
+        }
+        factory.addAccessible (accessible);
+    }
+
+    void removeAccessible (Accessible accessible) {
+        accessibles.remove (accessible.getControlHandle ());
+    }
+
+    static void unregisterAccessible (Accessible accessible) {
+        auto controlHandle = accessible.getControlHandle ();
+        auto widgetType = OS.G_OBJECT_TYPE (cast(GTypeInstance*)controlHandle);
+        if ( auto factory = widgetType in Factories ) {
+            factory.removeAccessible (accessible);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/accessibility/AccessibleListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,131 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.accessibility.AccessibleListener;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.internal.SWTEventListener;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+
+/**
+ * Classes that implement this interface provide methods
+ * that deal with the events that are generated when an
+ * accessibility client sends a message to a control.
+ * <p>
+ * After creating an instance of a class that implements
+ * this interface it can be added to a control using the
+ * <code>addAccessibleListener</code> method and removed
+ * using the <code>removeAccessibleListener</code> method.
+ * When a client requests information, the appropriate method
+ * will be invoked.
+ * </p><p>
+ * Note: Accessibility clients use child identifiers to specify
+ * whether they want information about a control or one of its children.
+ * Child identifiers are increasing integers beginning with 0.
+ * The identifier CHILDID_SELF represents the control itself.
+ * </p>
+ *
+ * @see AccessibleAdapter
+ * @see AccessibleEvent
+ *
+ * @since 2.0
+ */
+public interface AccessibleListener : SWTEventListener {
+
+    /**
+     * Sent when an accessibility client requests the name
+     * of the control, or the name of a child of the control.
+     * <p>
+     * Return the name of the control or specified child in the
+     * <code>result</code> field of the event object. Returning
+     * an empty string tells the client that the control or child
+     * does not have a name, and returning null tells the client
+     * to use the platform name.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>childID [IN] - an identifier specifying the control or one of its children</li>
+     *    <li>result [OUT] - the requested name string, or null</li>
+     * </ul>
+     */
+    public void getName(AccessibleEvent e);
+
+    /**
+     * Sent when an accessibility client requests the help string
+     * of the control, or the help string of a child of the control.
+     * <p>
+     * The information in this property should be similar to the help
+     * provided by toolTipText. It describes what the control or child
+     * does or how to use it, as opposed to getDescription, which
+     * describes appearance.
+     * </p><p>
+     * Return the help string of the control or specified child in
+     * the <code>result</code> field of the event object. Returning
+     * an empty string tells the client that the control or child
+     * does not have a help string, and returning null tells the
+     * client to use the platform help string.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>childID [IN] - an identifier specifying the control or one of its children</li>
+     *    <li>result [OUT] - the requested help string, or null</li>
+     * </ul>
+     */
+    public void getHelp(AccessibleEvent e);
+
+    /**
+     * Sent when an accessibility client requests the keyboard shortcut
+     * of the control, or the keyboard shortcut of a child of the control.
+     * <p>
+     * A keyboard shortcut can either be a mnemonic, or an accelerator.
+     * As a general rule, if the control or child can receive keyboard focus,
+     * then you should expose its mnemonic, and if it cannot receive keyboard
+     * focus, then you should expose its accelerator.
+     * </p><p>
+     * Return the keyboard shortcut string of the control or specified child
+     * in the <code>result</code> field of the event object. Returning an
+     * empty string tells the client that the control or child does not
+     * have a keyboard shortcut string, and returning null tells the client
+     * to use the platform keyboard shortcut string.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>childID [IN] - an identifier specifying the control or one of its children</li>
+     *    <li>result [OUT] - the requested keyboard shortcut string (example: "ALT+N"), or null</li>
+     * </ul>
+     */
+    public void getKeyboardShortcut(AccessibleEvent e);
+
+    /**
+     * Sent when an accessibility client requests a description
+     * of the control, or a description of a child of the control.
+     * <p>
+     * This is a textual description of the control or child's visual
+     * appearance, which is typically only necessary if it cannot be
+     * determined from other properties such as role.
+     * </p><p>
+     * Return the description of the control or specified child in
+     * the <code>result</code> field of the event object. Returning
+     * an empty string tells the client that the control or child
+     * does not have a description, and returning null tells the
+     * client to use the platform description.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>childID [IN] - an identifier specifying the control or one of its children</li>
+     *    <li>result [OUT] - the requested description string, or null</li>
+     * </ul>
+     */
+    public void getDescription(AccessibleEvent e);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/accessibility/AccessibleObject.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,1383 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.accessibility.AccessibleObject;
+
+import org.eclipse.swt.internal.accessibility.gtk.ATK;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.accessibility.Accessible;
+import org.eclipse.swt.accessibility.AccessibleListener;
+import org.eclipse.swt.accessibility.AccessibleControlListener;
+import org.eclipse.swt.accessibility.AccessibleTextListener;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.accessibility.AccessibleControlEvent;
+import org.eclipse.swt.accessibility.AccessibleTextEvent;
+import org.eclipse.swt.accessibility.ACC;
+import org.eclipse.swt.accessibility.AccessibleFactory;
+import org.eclipse.swt.widgets.Display;
+import java.lang.all;
+import tango.text.Util;
+
+class AccessibleObject {
+    AtkObject* handle;
+    int /*long*/ parentType;
+    int index = -1, id = ACC.CHILDID_SELF;
+    Accessible accessible;
+    AccessibleObject parent;
+    AccessibleObject[AtkObject*] children;
+    /*
+    * a lightweight object does not correspond to a concrete gtk widget, but
+    * to a logical child of a widget (eg.- a CTabItem, which is simply drawn)
+    */
+    bool isLightweight = false;
+
+    static String actionNamePtr;
+    static String descriptionPtr;
+    static String keybindingPtr;
+    static String namePtr;
+    static AccessibleObject[AtkObject*] AccessibleObjects;
+    static /*const*/ uint ATK_ACTION_TYPE;
+    static /*const*/ uint ATK_COMPONENT_TYPE;
+    static /*const*/ uint ATK_HYPERTEXT_TYPE;
+    static /*const*/ uint ATK_SELECTION_TYPE;
+    static /*const*/ uint ATK_TEXT_TYPE;
+    static /*const*/ bool DEBUG;
+    static bool static_this_completed = false;
+
+    package static void static_this() {
+        if( static_this_completed ) return;
+        DEBUG = Display.DEBUG;
+        ATK_ACTION_TYPE = ATK.g_type_from_name ("AtkAction");
+        ATK_COMPONENT_TYPE = ATK.g_type_from_name ("AtkComponent");
+        ATK_HYPERTEXT_TYPE = ATK.g_type_from_name ("AtkHypertext");
+        ATK_SELECTION_TYPE = ATK.g_type_from_name ("AtkSelection");
+        ATK_TEXT_TYPE = ATK.g_type_from_name ("AtkText");
+        static_this_completed = true;
+    }
+
+    this (int /*long*/ type, GtkWidget* widget, Accessible accessible, int /*long*/ parentType, bool isLightweight) {
+        handle = cast(AtkObject*)ATK.g_object_new (type, null);
+        this.parentType = parentType;
+        ATK.atk_object_initialize (handle, widget);
+        this.accessible = accessible;
+        this.isLightweight = isLightweight;
+        AccessibleObjects[handle] = this;
+        if (DEBUG) getDwtLogger().info( __FILE__, __LINE__, "new AccessibleObject: {}", handle);
+    }
+
+    void addChild (AccessibleObject child) {
+        children[child.handle] = child;
+        child.setParent (this);
+    }
+
+    package static extern(C) char* atkAction_get_keybinding (void* obj, int index) {
+        auto atkObject = cast(AtkObject*)obj;
+        if (DEBUG) getDwtLogger().info (__FILE__, __LINE__, "-->atkAction_get_keybinding");
+        AccessibleObject object = getAccessibleObject (atkObject);
+        if (object is null) return null;
+        char* parentResult;
+        if (ATK.g_type_is_a (object.parentType, ATK_ACTION_TYPE)) {
+            auto superType = cast(AtkActionIface*)ATK.g_type_interface_peek_parent (ATK.ATK_ACTION_GET_IFACE (object.handle));
+            AtkActionIface* actionIface = superType;
+            if (actionIface.get_keybinding !is null) {
+                parentResult = actionIface.get_keybinding( object.handle, index );
+            }
+        }
+        AccessibleListener[] listeners = object.getAccessibleListeners ();
+        if (listeners.length is 0) return parentResult;
+
+        AccessibleEvent event = new AccessibleEvent (object);
+        event.childID = object.id;
+        if (parentResult !is null) {
+            String res = fromStringz( parentResult );
+            event.result = res.dup;
+        }
+        for (int i = 0; i < listeners.length; i++) {
+            listeners [i].getKeyboardShortcut (event);
+        }
+        if (event.result is null) return parentResult;
+        if (keybindingPtr !is null ) OS.g_free (keybindingPtr.ptr);
+        String name = event.result.dup ~ \0;
+        char* p = cast(char*) OS.g_malloc (name.length);
+        keybindingPtr =  p ? p[ 0 .. name.length ] : null;
+        return keybindingPtr.ptr;
+    }
+
+    package static extern(C) char* atkAction_get_name (void* obj, int index) {
+        auto atkObject = cast(AtkObject*)obj;
+        if (DEBUG) getDwtLogger().info (__FILE__, __LINE__, "-->atkAction_get_name");
+        AccessibleObject object = getAccessibleObject (atkObject);
+        if (object is null) return null;
+        char* parentResult;
+        if (ATK.g_type_is_a (object.parentType, ATK_ACTION_TYPE)) {
+            auto actionIface = cast(AtkActionIface*)ATK.g_type_interface_peek_parent (ATK.ATK_ACTION_GET_IFACE (object.handle));
+            if (actionIface.get_name !is null) {
+                parentResult = actionIface.get_name( object.handle, index);
+            }
+        }
+        AccessibleControlListener[] listeners = object.getControlListeners ();
+        if (listeners.length is 0) return parentResult;
+
+        AccessibleControlEvent event = new AccessibleControlEvent (object);
+        event.childID = object.id;
+        if (parentResult !is null) {
+            String res = fromStringz( parentResult );
+            event.result = res.dup;
+        }
+        for (int i = 0; i < listeners.length; i++) {
+            listeners [i].getDefaultAction (event);
+        }
+        if (event.result is null) return parentResult;
+        if (actionNamePtr !is null) OS.g_free (actionNamePtr.ptr);
+
+        String name = event.result.dup ~ \0;
+        auto p = cast(char*)OS.g_malloc (name.length);
+        actionNamePtr =  p ? p[ 0 .. name.length ] : null;
+        return actionNamePtr.ptr;
+    }
+
+    package static extern(C) void atkComponent_get_extents (void* obj, int* x, int* y, int* width, int* height, int coord_type) {
+        auto atkObject = cast(AtkObject*)obj;
+        if (DEBUG) getDwtLogger().info (__FILE__, __LINE__, "-->atkComponent_get_extents");
+        AccessibleObject object = getAccessibleObject (atkObject);
+        if (object is null) return 0;
+        *x = 0;
+        *y = 0;
+        *width = 0;
+        *height = 0;
+        if (ATK.g_type_is_a (object.parentType, ATK_COMPONENT_TYPE)) {
+            auto componentIface = cast(AtkComponentIface*) ATK.g_type_interface_peek_parent (ATK.ATK_COMPONENT_GET_IFACE (object.handle));
+            if (componentIface.get_extents !is null) {
+                componentIface.get_extents( object.handle, x, y, width, height, coord_type);
+            }
+        }
+        AccessibleControlListener[] listeners = object.getControlListeners ();
+        if (listeners.length is 0) return 0;
+
+        int parentX = *x, parentY = *y;
+        int parentWidth = *width, parentHeight = *height;
+        AccessibleControlEvent event = new AccessibleControlEvent (object);
+        event.childID = object.id;
+        event.x = parentX; event.y = parentY;
+        event.width = parentWidth; event.height = parentHeight;
+        if (coord_type is ATK.ATK_XY_WINDOW) {
+            /* translate control -> display, for filling in event to be dispatched */
+            auto gtkAccessible = ATK.GTK_ACCESSIBLE (object.handle);
+            auto topLevel = ATK.gtk_widget_get_toplevel (gtkAccessible.widget);
+            auto window = OS.GTK_WIDGET_WINDOW (topLevel);
+            int topWindowX, topWindowY;
+            OS.gdk_window_get_origin (window, &topWindowX, &topWindowY);
+            event.x += topWindowX;
+            event.y += topWindowY;
+        }
+        for (int i = 0; i < listeners.length; i++) {
+            listeners [i].getLocation (event);
+        }
+        if (coord_type is ATK.ATK_XY_WINDOW) {
+            /* translate display -> control, for answering to the OS */
+            auto gtkAccessible = ATK.GTK_ACCESSIBLE (object.handle);
+            auto topLevel = ATK.gtk_widget_get_toplevel (gtkAccessible.widget);
+            auto window = OS.GTK_WIDGET_WINDOW (topLevel);
+            int topWindowX, topWindowY;
+            OS.gdk_window_get_origin (window, &topWindowX, &topWindowY);
+            event.x -= topWindowX;
+            event.y -= topWindowY;
+        }
+        *x = event.x;
+        *y = event.y;
+        *width = event.width;
+        *height = event.height;
+        //return 0;
+    }
+
+    package static extern(C) void atkComponent_get_position (void* obj, int* x, int* y, int coord_type) {
+        auto atkObject = cast(AtkObject*)obj;
+        if (DEBUG) getDwtLogger().info (__FILE__, __LINE__, "-->atkComponent_get_position, object: {} x:{} y:{} coord:{}", atkObject, x, y, coord_type);
+        AccessibleObject object = getAccessibleObject (atkObject);
+        if (object is null) return 0;
+        *x=0;
+        *y=0;
+        if (ATK.g_type_is_a (object.parentType, ATK_COMPONENT_TYPE)) {
+            auto componentIface = cast(AtkComponentIface*)ATK.g_type_interface_peek_parent (ATK.ATK_COMPONENT_GET_IFACE (object.handle));
+            if (componentIface.get_extents !is null) {
+                componentIface.get_position( object.handle, x, y, coord_type);
+            }
+        }
+        AccessibleControlListener[] listeners = object.getControlListeners ();
+        if (listeners.length is 0) return 0;
+
+        int parentX, parentY;
+        parentX = *x;
+        parentY = *y;
+        AccessibleControlEvent event = new AccessibleControlEvent (object);
+        event.childID = object.id;
+        event.x = parentX; event.y = parentY;
+        if (coord_type is ATK.ATK_XY_WINDOW) {
+            /* translate control -> display, for filling in event to be dispatched */
+            auto gtkAccessible = ATK.GTK_ACCESSIBLE (object.handle);
+            auto topLevel = ATK.gtk_widget_get_toplevel (gtkAccessible.widget);
+            auto window = OS.GTK_WIDGET_WINDOW (topLevel);
+            int topWindowX, topWindowY;
+            OS.gdk_window_get_origin (window, &topWindowX, &topWindowY);
+            event.x += topWindowX;
+            event.y += topWindowY;
+        }
+        for (int i = 0; i < listeners.length; i++) {
+            listeners [i].getLocation (event);
+        }
+        if (coord_type is ATK.ATK_XY_WINDOW) {
+            /* translate display -> control, for answering to the OS */
+            auto gtkAccessible = ATK.GTK_ACCESSIBLE (object.handle);
+            auto topLevel = ATK.gtk_widget_get_toplevel (gtkAccessible.widget);
+            auto window = OS.GTK_WIDGET_WINDOW (topLevel);
+            int topWindowX, topWindowY;
+            OS.gdk_window_get_origin (window, &topWindowX, &topWindowY);
+            event.x -= topWindowX;
+            event.y -= topWindowY;
+        }
+        *x=event.x;
+        *y=event.y;
+        //return 0;
+    }
+
+    //PORTING_FIXME: what about the coord_type? componentIface.get_size( object.handle, width, height, coord_type);
+    //package static extern(C) void atkComponent_get_size (void* obj, int* width, int* height, int coord_type) {
+    package static extern(C) void atkComponent_get_size (void* obj, int* width, int* height) {
+        auto atkObject = cast(AtkObject*)obj;
+        if (DEBUG) getDwtLogger().info (__FILE__, __LINE__, "-->atkComponent_get_size");
+        AccessibleObject object = getAccessibleObject (atkObject);
+        if (object is null) return 0;
+        *width=0;
+        *height=0;
+        if (ATK.g_type_is_a (object.parentType, ATK_COMPONENT_TYPE)) {
+            auto componentIface = cast(AtkComponentIface*)ATK.g_type_interface_peek_parent (ATK.ATK_COMPONENT_GET_IFACE (object.handle));
+            if (componentIface.get_extents !is null) {
+                //PORTING_FIXME: what about the coord_type? componentIface.get_size( object.handle, width, height, coord_type);
+                componentIface.get_size( object.handle, width, height);
+            }
+        }
+        AccessibleControlListener[] listeners = object.getControlListeners ();
+        if (listeners.length is 0) return 0;
+
+        int parentWidth, parentHeight;
+        parentWidth= *width;
+        parentHeight= *height;
+        AccessibleControlEvent event = new AccessibleControlEvent (object);
+        event.childID = object.id;
+        event.width = parentWidth; event.height = parentHeight;
+        for (int i = 0; i < listeners.length; i++) {
+            listeners [i].getLocation (event);
+        }
+        *width=event.width;
+        *height=event.height;
+        //return 0;
+    }
+
+    package static extern(C) AtkObject* atkComponent_ref_accessible_at_point (void* obj, int x, int y, int coord_type) {
+        auto atkObject = cast(AtkObject*)obj;
+        if (DEBUG) getDwtLogger().info (__FILE__, __LINE__, "-->atkComponent_ref_accessible_at_point");
+        AccessibleObject object = getAccessibleObject (atkObject);
+        if (object is null) return null;
+        AtkObject* parentResult;
+        if (ATK.g_type_is_a (object.parentType, ATK_COMPONENT_TYPE)) {
+            auto componentIface = cast(AtkComponentIface*)ATK.g_type_interface_peek_parent (ATK.ATK_COMPONENT_GET_IFACE (object.handle));
+            if (componentIface.ref_accessible_at_point !is null) {
+                parentResult = componentIface.ref_accessible_at_point( object.handle, x, y, coord_type);
+            }
+        }
+        AccessibleControlListener[] listeners = object.getControlListeners ();
+        if (listeners.length is 0) return parentResult;
+
+        AccessibleControlEvent event = new AccessibleControlEvent (object);
+        event.childID = object.id;
+        event.x = x; event.y = y;
+        if (coord_type is ATK.ATK_XY_WINDOW) {
+            /* translate control -> display, for filling in the event to be dispatched */
+            auto gtkAccessible = ATK.GTK_ACCESSIBLE (object.handle);
+            auto topLevel = ATK.gtk_widget_get_toplevel (gtkAccessible.widget);
+            auto window = OS.GTK_WIDGET_WINDOW (topLevel);
+            int topWindowX, topWindowY;
+            OS.gdk_window_get_origin (window, &topWindowX, &topWindowY);
+            event.x += topWindowX;
+            event.y += topWindowY;
+        }
+        for (int i = 0; i < listeners.length; i++) {
+            listeners [i].getChildAtPoint (event);
+        }
+        if (event.childID is object.id) event.childID = ACC.CHILDID_SELF;
+        AccessibleObject accObj = object.getChildByID (event.childID);
+        if (accObj !is null) {
+            if (parentResult !is null) OS.g_object_unref (parentResult);
+            OS.g_object_ref (accObj.handle);
+            return accObj.handle;
+        }
+        return parentResult;
+    }
+
+    package static extern(C) AtkHyperlink* atkHypertext_get_link (void* obj, int link_index) {
+        auto atkObject = cast(AtkObject*)obj;
+        if (DEBUG) getDwtLogger().info (__FILE__, __LINE__, "-->atkHypertext_get_link");
+        return null;
+    }
+
+    package static extern(C) int atkHypertext_get_n_links (void* obj) {
+        auto atkObject = cast(AtkObject*)obj;
+        if (DEBUG) getDwtLogger().info (__FILE__, __LINE__, "-->atkHypertext_get_n_links");
+        return 0;   /* read hyperlink's name */
+    }
+
+    package static extern(C) int atkHypertext_get_link_index (void* obj, int char_index) {
+        auto atkObject = cast(AtkObject*)obj;
+        if (DEBUG) getDwtLogger().info (__FILE__, __LINE__, "-->atkHypertext_get_link_index");
+        return 0;
+    }
+
+    package static extern(C) char* atkObject_get_description (AtkObject* atkObject) {
+        if (DEBUG) getDwtLogger().info (__FILE__, __LINE__, "-->atkObject_get_description");
+        AccessibleObject object = getAccessibleObject (atkObject);
+        if (object is null) return null;
+        char* parentResult;
+        auto objectClass = cast(AtkObjectClass*)ATK.g_type_class_peek (object.parentType);
+        if (objectClass.get_description !is null) {
+            parentResult = objectClass.get_description(object.handle);
+        }
+        AccessibleListener[] listeners = object.getAccessibleListeners ();
+        if (listeners.length is 0) return parentResult;
+
+        AccessibleEvent event = new AccessibleEvent (object);
+        event.childID = object.id;
+        if (parentResult !is null) {
+            event.result = fromStringz( parentResult ).dup;
+        }
+        for (int i = 0; i < listeners.length; i++) {
+            listeners [i].getDescription (event);
+        }
+        if (event.result is null) return parentResult;
+        if (descriptionPtr !is null) OS.g_free (descriptionPtr.ptr);
+
+        String name = event.result.dup ~ \0;
+        char* p = cast(char*)OS.g_malloc (name.length);
+        descriptionPtr =  p ? p[ 0 .. name.length ] : null;
+        return descriptionPtr.ptr;  }
+
+    package static extern(C) char* atkObject_get_name (AtkObject* atkObject) {
+        if (DEBUG) getDwtLogger().info (__FILE__, __LINE__, "-->atkObject_get_name: {}", atkObject);
+        AccessibleObject object = getAccessibleObject (atkObject);
+        if (object is null) return null;
+        char* parentResult;
+        auto objectClass = cast(AtkObjectClass*)ATK.g_type_class_peek (object.parentType);
+        if (objectClass.get_name !is null) {
+            parentResult = objectClass.get_name( object.handle);
+        }
+        AccessibleListener[] listeners = object.getAccessibleListeners ();
+        if (listeners.length is 0) return parentResult;
+
+        AccessibleEvent event = new AccessibleEvent (object);
+        event.childID = object.id;
+        if (parentResult !is null) {
+            event.result = fromStringz( parentResult ).dup;
+        }
+        for (int i = 0; i < listeners.length; i++) {
+            listeners [i].getName (event);
+        }
+        if (event.result is null) return parentResult;
+        if (namePtr !is null) OS.g_free (namePtr.ptr);
+        String name = event.result.dup ~ \0;
+        char* p = cast(char*)OS.g_malloc (name.length);
+        namePtr =  p ? p[ 0 .. name.length ] : null;
+        return namePtr.ptr;
+    }
+
+    package static extern(C) int atkObject_get_n_children (AtkObject* atkObject) {
+        if (DEBUG) getDwtLogger().info (__FILE__, __LINE__, "-->atkObject_get_n_children: {}", atkObject);
+        AccessibleObject object = getAccessibleObject (atkObject);
+        if (object is null) return 0;
+        int /*long*/ parentResult = 0;
+        auto objectClass = cast(AtkObjectClass*)ATK.g_type_class_peek (object.parentType);
+        if (objectClass.get_n_children !is null) {
+            parentResult = objectClass.get_n_children( object.handle);
+        }
+        AccessibleControlListener[] listeners = object.getControlListeners ();
+        if (listeners.length is 0) return parentResult;
+
+        AccessibleControlEvent event = new AccessibleControlEvent (object);
+        event.childID = object.id;
+        event.detail = cast(int)/*64*/parentResult;
+        for (int i = 0; i < listeners.length; i++) {
+            listeners [i].getChildCount (event);
+        }
+        return event.detail;
+    }
+
+    package static extern(C) int atkObject_get_index_in_parent (AtkObject* atkObject) {
+        if (DEBUG) getDwtLogger().info (__FILE__, __LINE__, "-->atkObjectCB_get_index_in_parent.  ");
+        AccessibleObject object = getAccessibleObject (atkObject);
+        if (object is null) return 0;
+        if (object.index !is -1) return object.index;
+        auto objectClass = cast(AtkObjectClass*)ATK.g_type_class_peek (object.parentType);
+        if (objectClass.get_index_in_parent is null) return 0;
+        return objectClass.get_index_in_parent(object. handle);
+    }
+
+    package static extern(C) AtkObject* atkObject_get_parent (AtkObject* atkObject) {
+        if (DEBUG) getDwtLogger().info (__FILE__, __LINE__, "-->atkObject_get_parent: {}", atkObject);
+        AccessibleObject object = getAccessibleObject (atkObject);
+        if (object is null) return null;
+        if (object.parent !is null) return object.parent.handle;
+        auto objectClass = cast(AtkObjectClass*)ATK.g_type_class_peek (object.parentType);
+        if (objectClass.get_parent is null) return null;
+        return objectClass.get_parent( object.handle);
+    }
+
+    package static extern(C) int atkObject_get_role (AtkObject* atkObject) {
+        if (DEBUG) getDwtLogger().info (__FILE__, __LINE__, "-->atkObject_get_role: {}", atkObject);
+        AccessibleObject object = getAccessibleObject (atkObject);
+        if (object is null) return 0;
+        if (object.getAccessibleListeners ().length !is 0) {
+            AccessibleControlListener[] listeners = object.getControlListeners ();
+            AccessibleControlEvent event = new AccessibleControlEvent (object);
+            event.childID = object.id;
+            event.detail = -1;
+            for (int i = 0; i < listeners.length; i++) {
+                listeners [i].getRole (event);
+            }
+            if (event.detail !is -1) {
+                switch (event.detail) {
+                    /* Convert from win32 role values to atk role values */
+                    case ACC.ROLE_CHECKBUTTON: return ATK.ATK_ROLE_CHECK_BOX;
+                    case ACC.ROLE_CLIENT_AREA: return ATK.ATK_ROLE_DRAWING_AREA;
+                    case ACC.ROLE_COMBOBOX: return ATK.ATK_ROLE_COMBO_BOX;
+                    case ACC.ROLE_DIALOG: return ATK.ATK_ROLE_DIALOG;
+                    case ACC.ROLE_LABEL: return ATK.ATK_ROLE_LABEL;
+                    case ACC.ROLE_LINK: return ATK.ATK_ROLE_TEXT;
+                    case ACC.ROLE_LIST: return ATK.ATK_ROLE_LIST;
+                    case ACC.ROLE_LISTITEM: return ATK.ATK_ROLE_LIST_ITEM;
+                    case ACC.ROLE_MENU: return ATK.ATK_ROLE_MENU;
+                    case ACC.ROLE_MENUBAR: return ATK.ATK_ROLE_MENU_BAR;
+                    case ACC.ROLE_MENUITEM: return ATK.ATK_ROLE_MENU_ITEM;
+                    case ACC.ROLE_PROGRESSBAR: return ATK.ATK_ROLE_PROGRESS_BAR;
+                    case ACC.ROLE_PUSHBUTTON: return ATK.ATK_ROLE_PUSH_BUTTON;
+                    case ACC.ROLE_SCROLLBAR: return ATK.ATK_ROLE_SCROLL_BAR;
+                    case ACC.ROLE_SEPARATOR: return ATK.ATK_ROLE_SEPARATOR;
+                    case ACC.ROLE_SLIDER: return ATK.ATK_ROLE_SLIDER;
+                    case ACC.ROLE_TABLE: return ATK.ATK_ROLE_LIST;
+                    case ACC.ROLE_TABLECELL: return ATK.ATK_ROLE_LIST_ITEM;
+                    case ACC.ROLE_TABLECOLUMNHEADER: return ATK.ATK_ROLE_TABLE_COLUMN_HEADER;
+                    case ACC.ROLE_TABLEROWHEADER: return ATK.ATK_ROLE_TABLE_ROW_HEADER;
+                    case ACC.ROLE_TABFOLDER: return ATK.ATK_ROLE_PAGE_TAB_LIST;
+                    case ACC.ROLE_TABITEM: return ATK.ATK_ROLE_PAGE_TAB;
+                    case ACC.ROLE_TEXT: return ATK.ATK_ROLE_TEXT;
+                    case ACC.ROLE_TOOLBAR: return ATK.ATK_ROLE_TOOL_BAR;
+                    case ACC.ROLE_TOOLTIP: return ATK.ATK_ROLE_TOOL_TIP;
+                    case ACC.ROLE_TREE: return ATK.ATK_ROLE_TREE;
+                    case ACC.ROLE_TREEITEM: return ATK.ATK_ROLE_LIST_ITEM;
+                    case ACC.ROLE_RADIOBUTTON: return ATK.ATK_ROLE_RADIO_BUTTON;
+                    case ACC.ROLE_WINDOW: return ATK.ATK_ROLE_WINDOW;
+                    default:
+                }
+            }
+        }
+        auto objectClass = cast(AtkObjectClass*)ATK.g_type_class_peek (object.parentType);
+        if (objectClass.get_role is null) return 0;
+        return objectClass.get_role( object.handle);
+    }
+
+    package static extern(C) AtkObject* atkObject_ref_child (AtkObject* atkObject, int /*long*/ index) {
+        if (DEBUG) getDwtLogger().info (__FILE__, __LINE__, "-->atkObject_ref_child: {} of: {}", index, atkObject);
+        AccessibleObject object = getAccessibleObject (atkObject);
+        if (object is null) return null;
+        object.updateChildren ();
+        AccessibleObject accObject = object.getChildByIndex (cast(int)/*64*/index);
+        if (accObject !is null) {
+            OS.g_object_ref (accObject.handle);
+            return accObject.handle;
+        }
+        auto objectClass = cast(AtkObjectClass*)ATK.g_type_class_peek (object.parentType);
+        if (objectClass.ref_child is null) return null;
+        return objectClass.ref_child( object.handle, index);
+    }
+
+    package static extern(C) AtkStateSet * atkObject_ref_state_set (AtkObject* atkObject) {
+        if (DEBUG) getDwtLogger().info (__FILE__, __LINE__, "-->atkObject_ref_state_set");
+        AccessibleObject object = getAccessibleObject (atkObject);
+        if (object is null) return null;
+        AtkStateSet* parentResult;
+        auto objectClass = cast(AtkObjectClass*)ATK.g_type_class_peek (object.parentType);
+        if (objectClass.ref_state_set !is null) {
+            parentResult = objectClass.ref_state_set( object.handle);
+        }
+        AccessibleControlListener[] listeners = object.getControlListeners ();
+        if (listeners.length is 0) return parentResult;
+
+        auto set = parentResult;
+        AccessibleControlEvent event = new AccessibleControlEvent (object);
+        event.childID = object.id;
+        event.detail = -1;
+        for (int i = 0; i < listeners.length; i++) {
+            listeners [i].getState (event);
+        }
+        if (event.detail !is -1) {
+            /*  Convert from win32 state values to atk state values */
+            int state = event.detail;
+            if ((state & ACC.STATE_BUSY) !is 0) ATK.atk_state_set_add_state (set, ATK.ATK_STATE_BUSY);
+            if ((state & ACC.STATE_CHECKED) !is 0) ATK.atk_state_set_add_state (set, ATK.ATK_STATE_CHECKED);
+            if ((state & ACC.STATE_EXPANDED) !is 0) ATK.atk_state_set_add_state (set, ATK.ATK_STATE_EXPANDED);
+            if ((state & ACC.STATE_FOCUSABLE) !is 0) ATK.atk_state_set_add_state (set, ATK.ATK_STATE_FOCUSABLE);
+            if ((state & ACC.STATE_FOCUSED) !is 0) ATK.atk_state_set_add_state (set, ATK.ATK_STATE_FOCUSED);
+            if ((state & ACC.STATE_HOTTRACKED) !is 0) ATK.atk_state_set_add_state (set, ATK.ATK_STATE_ARMED);
+            if ((state & ACC.STATE_INVISIBLE) is 0) ATK.atk_state_set_add_state (set, ATK.ATK_STATE_VISIBLE);
+            if ((state & ACC.STATE_MULTISELECTABLE) !is 0) ATK.atk_state_set_add_state (set, ATK.ATK_STATE_MULTISELECTABLE);
+            if ((state & ACC.STATE_OFFSCREEN) is 0) ATK.atk_state_set_add_state (set, ATK.ATK_STATE_SHOWING);
+            if ((state & ACC.STATE_PRESSED) !is 0) ATK.atk_state_set_add_state (set, ATK.ATK_STATE_PRESSED);
+            if ((state & ACC.STATE_READONLY) is 0) ATK.atk_state_set_add_state (set, ATK.ATK_STATE_EDITABLE);
+            if ((state & ACC.STATE_SELECTABLE) !is 0) ATK.atk_state_set_add_state (set, ATK.ATK_STATE_SELECTABLE);
+            if ((state & ACC.STATE_SELECTED) !is 0) ATK.atk_state_set_add_state (set, ATK.ATK_STATE_SELECTED);
+            if ((state & ACC.STATE_SIZEABLE) !is 0) ATK.atk_state_set_add_state (set, ATK.ATK_STATE_RESIZABLE);
+            /* Note: STATE_COLLAPSED, STATE_LINKED and STATE_NORMAL have no ATK equivalents */
+        }
+        return set;
+    }
+
+    package static extern(C) int atkSelection_is_child_selected (void* obj, int index) {
+        auto atkObject = cast(AtkObject*)obj;
+        if (DEBUG) getDwtLogger().info (__FILE__, __LINE__, "-->atkSelection_is_child_selected");
+        AccessibleObject object = getAccessibleObject (atkObject);
+        if (object is null) return 0;
+        int /*long*/ parentResult = 0;
+        if (ATK.g_type_is_a (object.parentType, ATK_SELECTION_TYPE)) {
+            auto selectionIface = cast(AtkSelectionIface*)ATK.g_type_interface_peek_parent (ATK.ATK_SELECTION_GET_IFACE (object.handle));
+            if (selectionIface.is_child_selected !is null) {
+                parentResult = selectionIface.is_child_selected( object.handle, index);
+            }
+        }
+        AccessibleControlListener[] listeners = object.getControlListeners ();
+        if (listeners.length is 0) return parentResult;
+
+        AccessibleControlEvent event = new AccessibleControlEvent (object);
+        event.childID = object.id;
+        for (int i = 0; i < listeners.length; i++) {
+            listeners [i].getSelection (event);
+        }
+        AccessibleObject accessibleObject = object.getChildByID (event.childID);
+        if (accessibleObject !is null) {
+            return accessibleObject.index is index ? 1 : 0;
+        }
+        return parentResult;
+    }
+
+    package static extern(C) AtkObject* atkSelection_ref_selection (void* obj, int index) {
+        auto atkObject = cast(AtkObject*)obj;
+        if (DEBUG) getDwtLogger().info (__FILE__, __LINE__, "-->atkSelection_ref_selection");
+        AccessibleObject object = getAccessibleObject (atkObject);
+        if (object is null) return null;
+        AtkObject* parentResult;
+        if (ATK.g_type_is_a (object.parentType, ATK_SELECTION_TYPE)) {
+            auto selectionIface = cast(AtkSelectionIface*)ATK.g_type_interface_peek_parent (ATK.ATK_SELECTION_GET_IFACE (object.handle));
+            if (selectionIface.ref_selection !is null) {
+                parentResult = selectionIface.ref_selection( object.handle, index);
+            }
+        }
+        AccessibleControlListener[] listeners = object.getControlListeners ();
+        if (listeners.length is 0) return parentResult;
+
+        AccessibleControlEvent event = new AccessibleControlEvent (object);
+        event.childID = object.id;
+        for (int i = 0; i < listeners.length; i++) {
+            listeners [i].getSelection (event);
+        }
+        AccessibleObject accObj = object.getChildByID (event.childID);
+        if (accObj !is null) {
+            if (parentResult !is null) OS.g_object_unref (parentResult);
+            OS.g_object_ref (accObj.handle);
+            return accObj.handle;
+        }
+        return parentResult;
+    }
+
+    package static extern(C) int atkText_get_caret_offset (void* obj) {
+        auto atkObject = cast(AtkObject*)obj;
+        if (DEBUG) getDwtLogger().info (__FILE__, __LINE__, "-->atkText_get_caret_offset");
+        AccessibleObject object = getAccessibleObject (atkObject);
+        if (object is null) return 0;
+        int /*long*/ parentResult = 0;
+        if (ATK.g_type_is_a (object.parentType, ATK_TEXT_TYPE)) {
+            auto textIface = cast(AtkTextIface*)ATK.g_type_interface_peek_parent (ATK.ATK_TEXT_GET_IFACE (object.handle));
+            if (textIface.get_caret_offset !is null) {
+                parentResult = textIface.get_caret_offset( object.handle);
+            }
+        }
+        AccessibleTextListener[] listeners = object.getTextListeners ();
+        if (listeners.length is 0) return parentResult;
+
+        AccessibleTextEvent event = new AccessibleTextEvent (object);
+        event.childID = object.id;
+        event.offset = cast(int)/*64*/parentResult;
+        for (int i = 0; i < listeners.length; i++) {
+            listeners [i].getCaretOffset (event);
+        }
+        return event.offset;
+    }
+
+    package static extern(C) uint atkText_get_character_at_offset (void* obj, int offset) {
+        auto atkObject = cast(AtkObject*)obj;
+        if (DEBUG) getDwtLogger().info (__FILE__, __LINE__, "-->atkText_get_character_at_offset");
+        AccessibleObject object = getAccessibleObject (atkObject);
+        if (object is null) return 0;
+        String text = object.getText ();
+        if (text !is null) return text[cast(int)/*64*/offset ]; // TODO
+        if (ATK.g_type_is_a (object.parentType, ATK_TEXT_TYPE)) {
+            auto textIface = cast(AtkTextIface*)ATK.g_type_class_peek (object.parentType);
+            if (textIface.get_character_at_offset !is null) {
+                return textIface.get_character_at_offset( object.handle, offset);
+            }
+        }
+        return 0;
+    }
+
+    package static extern(C) int atkText_get_character_count (void* obj) {
+        auto atkObject = cast(AtkObject*)obj;
+        if (DEBUG) getDwtLogger().info (__FILE__, __LINE__, "-->atkText_get_character_count");
+        AccessibleObject object = getAccessibleObject (atkObject);
+        if (object is null) return 0;
+        String text = object.getText ();
+        if (text !is null) return text.length;
+        if (ATK.g_type_is_a (object.parentType, ATK_TEXT_TYPE)) {
+            auto textIface = cast(AtkTextIface*)ATK.g_type_class_peek (object.parentType);
+            if (textIface.get_character_count !is null) {
+                return textIface.get_character_count( object.handle);
+            }
+        }
+        return 0;
+    }
+
+    package static extern(C) int atkText_get_n_selections (void* obj) {
+        auto atkObject = cast(AtkObject*)obj;
+        if (DEBUG) getDwtLogger().info( __FILE__, __LINE__, "-->atkText_get_n_selections");
+        AccessibleObject object = getAccessibleObject (atkObject);
+        if (object is null) return 0;
+        int /*long*/ parentResult = 0;
+        if (ATK.g_type_is_a (object.parentType, ATK_TEXT_TYPE)) {
+            auto textIface = cast(AtkTextIface*)ATK.g_type_interface_peek_parent (ATK.ATK_TEXT_GET_IFACE (object.handle));
+            if (textIface.get_n_selections !is null) {
+                parentResult = textIface.get_n_selections( object.handle);
+            }
+        }
+        AccessibleTextListener[] listeners = object.getTextListeners ();
+        if (listeners.length is 0) return parentResult;
+
+        AccessibleTextEvent event = new AccessibleTextEvent (object);
+        event.childID = object.id;
+        for (int i = 0; i < listeners.length; i++) {
+            listeners [i].getSelectionRange (event);
+        }
+        return event.length is 0 ? parentResult : 1;
+    }
+
+    package static extern(C) char* atkText_get_selection (void* obj, int selection_num, int* start_offset, int* end_offset) {
+        auto atkObject = cast(AtkObject*)obj;
+        if (DEBUG) getDwtLogger().info (__FILE__, __LINE__, "-->atkText_get_selection");
+        AccessibleObject object = getAccessibleObject (atkObject);
+        if (object is null) return null;
+        *start_offset=0;
+        *end_offset=0;
+        if (ATK.g_type_is_a (object.parentType, ATK_TEXT_TYPE)) {
+            auto textIface = cast(AtkTextIface*)ATK.g_type_interface_peek_parent (ATK.ATK_TEXT_GET_IFACE (object.handle));
+            if (textIface.get_selection !is null) {
+                textIface.get_selection( object.handle, selection_num, start_offset, end_offset );
+            }
+        }
+        AccessibleTextListener[] listeners = object.getTextListeners ();
+        if (listeners.length is 0) return null;
+
+        AccessibleTextEvent event = new AccessibleTextEvent (object);
+        event.childID = object.id;
+        int parentStart;
+        int parentEnd;
+        parentStart= *start_offset;
+        parentEnd= *end_offset;
+        event.offset = parentStart;
+        event.length = parentEnd - parentStart;
+        for (int i = 0; i < listeners.length; i++) {
+            listeners [i].getSelectionRange (event);
+        }
+        *start_offset = event.offset;
+        *end_offset = event.offset + event.length;
+        return null;
+    }
+
+    package static extern(C) char* atkText_get_text (void* obj, int start_offset, int end_offset) {
+        auto atkObject = cast(AtkObject*)obj;
+        if (DEBUG) getDwtLogger().info (__FILE__, __LINE__, "-->atkText_get_text: {},{}", start_offset, end_offset);
+        AccessibleObject object = getAccessibleObject (atkObject);
+        if (object is null) return null;
+        String text = object.getText ();
+        if (text.length > 0) {
+            if (end_offset is -1) {
+                end_offset = text.length ;
+            } else {
+                end_offset = Math.min (end_offset, text.length );
+            }
+            start_offset = Math.min (start_offset, end_offset);
+            text = text[ start_offset .. end_offset ];
+            auto result = cast(char*)OS.g_malloc (text.length+1);
+            result[ 0 .. text.length ] = text;
+            result[ text.length ] = '\0';
+            return result;
+        }
+        return null;
+    }
+
+    package static extern(C) char* atkText_get_text_after_offset (void* obj, int offset_value, int boundary_type, int* start_offset, int* end_offset) {
+        auto atkObject = cast(AtkObject*)obj;
+        if (DEBUG) getDwtLogger().info (__FILE__, __LINE__, "-->atkText_get_text_after_offset");
+        AccessibleObject object = getAccessibleObject (atkObject);
+        if (object is null) return null;
+        int offset = cast(int)/*64*/offset_value;
+        String text = object.getText ();
+        if (text.length > 0) {
+            int length = text.length ;
+            offset = Math.min (offset, length - 1);
+            int startBounds = offset;
+            int endBounds = offset;
+            switch (cast(int)/*64*/boundary_type) {
+                case ATK.ATK_TEXT_BOUNDARY_CHAR: {
+                    if (length > offset) endBounds++;
+                    break;
+                }
+                case ATK.ATK_TEXT_BOUNDARY_WORD_START: {
+                    int wordStart1 = nextIndexOfChar (text, " !?.\n", offset - 1);
+                    if (wordStart1 is -1) {
+                        startBounds = endBounds = length;
+                        break;
+                    }
+                    wordStart1 = nextIndexOfNotChar (text, " !?.\n", wordStart1);
+                    if (wordStart1 is length) {
+                        startBounds = endBounds = length;
+                        break;
+                    }
+                    startBounds = wordStart1;
+                    int wordStart2 = nextIndexOfChar (text, " !?.\n", wordStart1);
+                    if (wordStart2 is -1) {
+                        endBounds = length;
+                        break;
+                    }
+                    endBounds = nextIndexOfNotChar (text, " !?.\n", wordStart2);
+                    break;
+                }
+                case ATK.ATK_TEXT_BOUNDARY_WORD_END: {
+                    int previousWordEnd = previousIndexOfNotChar (text, " \n", offset);
+                    if (previousWordEnd is -1 || previousWordEnd !is offset - 1) {
+                        offset = nextIndexOfNotChar (text, " \n", offset);
+                    }
+                    if (offset is -1) {
+                        startBounds = endBounds = length;
+                        break;
+                    }
+                    int wordEnd1 = nextIndexOfChar (text, " !?.\n", cast(int)/*64*/offset);
+                    if (wordEnd1 is -1) {
+                        startBounds = endBounds = length;
+                        break;
+                    }
+                    wordEnd1 = nextIndexOfNotChar (text, "!?.", wordEnd1);
+                    if (wordEnd1 is length) {
+                        startBounds = endBounds = length;
+                        break;
+                    }
+                    startBounds = wordEnd1;
+                    int wordEnd2 = nextIndexOfNotChar (text, " \n", wordEnd1);
+                    if (wordEnd2 is length) {
+                        startBounds = endBounds = length;
+                        break;
+                    }
+                    wordEnd2 = nextIndexOfChar (text, " !?.\n", wordEnd2);
+                    if (wordEnd2 is -1) {
+                        endBounds = length;
+                        break;
+                    }
+                    endBounds = nextIndexOfNotChar (text, "!?.", wordEnd2);
+                    break;
+                }
+                case ATK.ATK_TEXT_BOUNDARY_SENTENCE_START: {
+                    int previousSentenceEnd = previousIndexOfChar (text, "!?.", offset);
+                    int previousText = previousIndexOfNotChar (text, " !?.\n", offset);
+                    int sentenceStart1 = 0;
+                    if (previousSentenceEnd >= previousText) {
+                        sentenceStart1 = nextIndexOfNotChar (text, " !?.\n", offset);
+                    } else {
+                        sentenceStart1 = nextIndexOfChar (text, "!?.", offset);
+                        if (sentenceStart1 is -1) {
+                            startBounds = endBounds = length;
+                            break;
+                        }
+                        sentenceStart1 = nextIndexOfNotChar (text, " !?.\n", sentenceStart1);
+                    }
+                    if (sentenceStart1 is length) {
+                        startBounds = endBounds = length;
+                        break;
+                    }
+                    startBounds = sentenceStart1;
+                    int sentenceStart2 = nextIndexOfChar (text, "!?.", sentenceStart1);
+                    if (sentenceStart2 is -1) {
+                        endBounds = length;
+                        break;
+                    }
+                    endBounds = nextIndexOfNotChar (text, " !?.\n", sentenceStart2);
+                    break;
+                }
+                case ATK.ATK_TEXT_BOUNDARY_SENTENCE_END: {
+                    int sentenceEnd1 = nextIndexOfChar (text, "!?.", offset);
+                    if (sentenceEnd1 is -1) {
+                        startBounds = endBounds = length;
+                        break;
+                    }
+                    sentenceEnd1 = nextIndexOfNotChar (text, "!?.", sentenceEnd1);
+                    if (sentenceEnd1 is length) {
+                        startBounds = endBounds = length;
+                        break;
+                    }
+                    startBounds = sentenceEnd1;
+                    int sentenceEnd2 = nextIndexOfNotChar (text, " \n", sentenceEnd1);
+                    if (sentenceEnd2 is length) {
+                        startBounds = endBounds = length;
+                        break;
+                    }
+                    sentenceEnd2 = nextIndexOfChar (text, "!?.", sentenceEnd2);
+                    if (sentenceEnd2 is -1) {
+                        endBounds = length;
+                        break;
+                    }
+                    endBounds = nextIndexOfNotChar (text, "!?.", sentenceEnd2);
+                    break;
+                }
+                case ATK.ATK_TEXT_BOUNDARY_LINE_START: {
+                    int lineStart1 = locate( text, '\n' );
+                    if( lineStart1 is text.length ) lineStart1 = -1;
+                    if (lineStart1 is -1) {
+                        startBounds = endBounds = length;
+                        break;
+                    }
+                    lineStart1 = nextIndexOfNotChar (text, "\n", lineStart1);
+                    if (lineStart1 is length) {
+                        startBounds = endBounds = length;
+                        break;
+                    }
+                    startBounds = lineStart1;
+                    int lineStart2 = locate( text, '\n' );
+                    if( lineStart2 is text.length ) lineStart2 = -1;
+                    if (lineStart2 is -1) {
+                        endBounds = length;
+                        break;
+                    }
+                    lineStart2 = nextIndexOfNotChar (text, "\n", lineStart2);
+                    endBounds = lineStart2;
+                    break;
+                }
+                case ATK.ATK_TEXT_BOUNDARY_LINE_END: {
+                    int lineEnd1 = nextIndexOfChar (text, "\n", offset);
+                    if (lineEnd1 is -1) {
+                        startBounds = endBounds = length;
+                        break;
+                    }
+                    startBounds = lineEnd1;
+                    if (startBounds is length) {
+                        endBounds = length;
+                        break;
+                    }
+                    int lineEnd2 = nextIndexOfChar (text, "\n", lineEnd1 + 1);
+                    if (lineEnd2 is -1) {
+                        endBounds = length;
+                        break;
+                    }
+                    endBounds = lineEnd2;
+                    break;
+                }
+                default:
+            }
+            *start_offset=startBounds;
+            *end_offset=endBounds;
+            text = text[startBounds .. endBounds ];
+            auto result = cast(char*)OS.g_malloc (text.length+1);
+            result[ 0 .. text.length ] = text;
+            result[ text.length ] = '\0';
+            return result;
+        }
+        return null;
+    }
+
+    package static extern(C) char* atkText_get_text_at_offset (void* obj, int offset_value, int boundary_type, int* start_offset, int* end_offset) {
+        auto atkObject = cast(AtkObject*)obj;
+        if (DEBUG) getDwtLogger().info (__FILE__, __LINE__, "-->atkText_get_text_at_offset: {} start: {} end: {}", offset_value, start_offset, end_offset);
+        AccessibleObject object = getAccessibleObject (atkObject);
+        if (object is null) return null;
+        int offset = offset_value;
+        String text = object.getText ();
+        if (text.length > 0) {
+            int length = text.length;
+            offset = Math.min (offset, length - 1);
+            int startBounds = offset;
+            int endBounds = offset;
+            switch (boundary_type) {
+                case ATK.ATK_TEXT_BOUNDARY_CHAR: {
+                    if (length > offset) endBounds++;
+                    break;
+                }
+                case ATK.ATK_TEXT_BOUNDARY_WORD_START: {
+                    int wordStart1 = previousIndexOfNotChar (text, " !?.\n", offset);
+                    if (wordStart1 is -1) {
+                        startBounds = endBounds = 0;
+                        break;
+                    }
+                    wordStart1 = previousIndexOfChar (text, " !?.\n", wordStart1) + 1;
+                    if (wordStart1 is -1) {
+                        startBounds = 0;
+                        break;
+                    }
+                    startBounds = wordStart1;
+                    int wordStart2 = nextIndexOfChar (text, " !?.\n", wordStart1);
+                    endBounds = nextIndexOfNotChar (text, " !?.\n", wordStart2);
+                    break;
+                }
+                case ATK.ATK_TEXT_BOUNDARY_WORD_END: {
+                    int wordEnd1 = previousIndexOfNotChar (text, "!?.", offset + 1);
+                    wordEnd1 = previousIndexOfChar (text, " !?.\n", wordEnd1);
+                    wordEnd1 = previousIndexOfNotChar (text, " \n", wordEnd1 + 1);
+                    if (wordEnd1 is -1) {
+                        startBounds = endBounds = 0;
+                        break;
+                    }
+                    startBounds = wordEnd1 + 1;
+                    int wordEnd2 = nextIndexOfNotChar (text, " \n", startBounds);
+                    if (wordEnd2 is length) {
+                        endBounds = startBounds;
+                        break;
+                    }
+                    wordEnd2 = nextIndexOfChar (text, " !?.\n", wordEnd2);
+                    if (wordEnd2 is -1) {
+                        endBounds = startBounds;
+                        break;
+                    }
+                    endBounds = nextIndexOfNotChar (text, "!?.", wordEnd2);
+                    break;
+                }
+                case ATK.ATK_TEXT_BOUNDARY_SENTENCE_START: {
+                    int sentenceStart1 = previousIndexOfNotChar (text, " !?.\n", offset + 1);
+                    if (sentenceStart1 is -1) {
+                        startBounds = endBounds = 0;
+                        break;
+                    }
+                    sentenceStart1 = previousIndexOfChar (text, "!?.", sentenceStart1) + 1;
+                    startBounds = nextIndexOfNotChar (text, " \n", sentenceStart1);
+                    int sentenceStart2 = nextIndexOfChar (text, "!?.", startBounds);
+                    endBounds = nextIndexOfNotChar (text, " !?.\n", sentenceStart2);
+                    break;
+                }
+                case ATK.ATK_TEXT_BOUNDARY_SENTENCE_END: {
+                    int sentenceEnd1 = previousIndexOfNotChar (text, "!?.", offset + 1);
+                    sentenceEnd1 = previousIndexOfChar (text, "!?.", sentenceEnd1);
+                    sentenceEnd1 = previousIndexOfNotChar (text, " \n", sentenceEnd1 + 1);
+                    if (sentenceEnd1 is -1) {
+                        startBounds = endBounds = 0;
+                        break;
+                    }
+                    startBounds = sentenceEnd1 + 1;
+                    int sentenceEnd2 = nextIndexOfNotChar (text, " \n", startBounds);
+                    if (sentenceEnd2 is length) {
+                        endBounds = startBounds;
+                        break;
+                    }
+                    sentenceEnd2 = nextIndexOfChar (text, "!?.", sentenceEnd2);
+                    if (sentenceEnd2 is -1) {
+                        endBounds = startBounds;
+                        break;
+                    }
+                    endBounds = nextIndexOfNotChar (text, "!?.", sentenceEnd2);
+                    break;
+                }
+                case ATK.ATK_TEXT_BOUNDARY_LINE_START: {
+                    startBounds = previousIndexOfChar (text, "\n", offset) + 1;
+                    int lineEnd2 = nextIndexOfChar (text, "\n", startBounds);
+                    if (lineEnd2 < length) lineEnd2++;
+                    endBounds = lineEnd2;
+                    break;
+                }
+                case ATK.ATK_TEXT_BOUNDARY_LINE_END: {
+                    int lineEnd1 = previousIndexOfChar (text, "\n", offset);
+                    if (lineEnd1 is -1) {
+                        startBounds = endBounds = 0;
+                        break;
+                    }
+                    startBounds = lineEnd1;
+                    endBounds = nextIndexOfChar (text, "\n", lineEnd1 + 1);
+                }
+                default:
+            }
+            *start_offset=startBounds;
+            *end_offset=endBounds;
+            text = text[startBounds .. endBounds];
+            auto result = cast(char*) OS.g_malloc (text.length+1);
+            result[ 0 .. text.length ] = text;
+            result[ text.length ] = '\0';
+            return result;
+        }
+        return null;
+    }
+
+    package static extern(C) char* atkText_get_text_before_offset (void* obj, int offset_value, int boundary_type, int* start_offset, int* end_offset) {
+        auto atkObject = cast(AtkObject*)obj;
+        if (DEBUG) getDwtLogger().info (__FILE__, __LINE__, "-->atkText_get_text_before_offset");
+        AccessibleObject object = getAccessibleObject (atkObject);
+        if (object is null) return null;
+        int offset = offset_value;
+        String text = object.getText ();
+        if (text.length > 0) {
+            int length = text.length;
+            offset = Math.min (offset, length - 1);
+            int startBounds = offset;
+            int endBounds = offset;
+            switch (boundary_type) {
+                case ATK.ATK_TEXT_BOUNDARY_CHAR: {
+                    if (length >= offset && offset > 0) startBounds--;
+                    break;
+                }
+                case ATK.ATK_TEXT_BOUNDARY_WORD_START: {
+                    int wordStart1 = previousIndexOfChar (text, " !?.\n", offset - 1);
+                    if (wordStart1 is -1) {
+                        startBounds = endBounds = 0;
+                        break;
+                    }
+                    int wordStart2 = previousIndexOfNotChar (text, " !?.\n", wordStart1);
+                    if (wordStart2 is -1) {
+                        startBounds = endBounds = 0;
+                        break;
+                    }
+                    endBounds = wordStart1 + 1;
+                    startBounds = previousIndexOfChar (text, " !?.\n", wordStart2) + 1;
+                    break;
+                }
+                case ATK.ATK_TEXT_BOUNDARY_WORD_END: {
+                    int wordEnd1 =previousIndexOfChar (text, " !?.\n", offset);
+                    if (wordEnd1 is -1) {
+                        startBounds = endBounds = 0;
+                        break;
+                    }
+                    wordEnd1 = previousIndexOfNotChar (text, " \n", wordEnd1 + 1);
+                    if (wordEnd1 is -1) {
+                        startBounds = endBounds = 0;
+                        break;
+                    }
+                    endBounds = wordEnd1 + 1;
+                    int wordEnd2 = previousIndexOfNotChar (text, " !?.\n", endBounds);
+                    wordEnd2 = previousIndexOfChar (text, " !?.\n", wordEnd2);
+                    if (wordEnd2 is -1) {
+                        startBounds = 0;
+                        break;
+                    }
+                    startBounds = previousIndexOfNotChar (text, " \n", wordEnd2 + 1) + 1;
+                    break;
+                }
+                case ATK.ATK_TEXT_BOUNDARY_SENTENCE_START: {
+                    int sentenceStart1 = previousIndexOfChar (text, "!?.", offset);
+                    if (sentenceStart1 is -1) {
+                        startBounds = endBounds = 0;
+                        break;
+                    }
+                    int sentenceStart2 = previousIndexOfNotChar (text, "!?.", sentenceStart1);
+                    if (sentenceStart2 is -1) {
+                        startBounds = endBounds = 0;
+                        break;
+                    }
+                    endBounds = sentenceStart1 + 1;
+                    startBounds = previousIndexOfChar (text, "!?.", sentenceStart2) + 1;
+                    break;
+                }
+                case ATK.ATK_TEXT_BOUNDARY_SENTENCE_END: {
+                    int sentenceEnd1 = previousIndexOfChar (text, "!?.", offset);
+                    if (sentenceEnd1 is -1) {
+                        startBounds = endBounds = 0;
+                        break;
+                    }
+                    sentenceEnd1 = previousIndexOfNotChar (text, " \n", sentenceEnd1 + 1);
+                    if (sentenceEnd1 is -1) {
+                        startBounds = endBounds = 0;
+                        break;
+                    }
+                    endBounds = sentenceEnd1 + 1;
+                    int sentenceEnd2 = previousIndexOfNotChar (text, "!?.", endBounds);
+                    sentenceEnd2 = previousIndexOfChar (text, "!?.", sentenceEnd2);
+                    if (sentenceEnd2 is -1) {
+                        startBounds = 0;
+                        break;
+                    }
+                    startBounds = previousIndexOfNotChar (text, " \n", sentenceEnd2 + 1) + 1;
+                    break;
+                }
+                case ATK.ATK_TEXT_BOUNDARY_LINE_START: {
+                    int lineStart1 = previousIndexOfChar (text, "\n", offset);
+                    if (lineStart1 is -1) {
+                        startBounds = endBounds = 0;
+                        break;
+                    }
+                    endBounds = lineStart1 + 1;
+                    startBounds = previousIndexOfChar (text, "\n", lineStart1) + 1;
+                    break;
+                }
+                case ATK.ATK_TEXT_BOUNDARY_LINE_END: {
+                    int lineEnd1 = previousIndexOfChar (text, "\n", offset);
+                    if (lineEnd1 is -1) {
+                        startBounds = endBounds = 0;
+                        break;
+                    }
+                    endBounds = lineEnd1;
+                    startBounds = previousIndexOfChar (text, "\n", lineEnd1);
+                    if (startBounds is -1) startBounds = 0;
+                    break;
+                }
+                default:
+            }
+            *start_offset=startBounds;
+            *end_offset=endBounds;
+            text = text[startBounds .. endBounds];
+            auto result = cast(char*)OS.g_malloc (text.length+1);
+            result[ 0 .. text.length ] = text;
+            result[ text.length ] = '\0';
+            return result;
+        }
+        return null;
+    }
+
+    AccessibleListener[] getAccessibleListeners () {
+        if (accessible is null) return new AccessibleListener [0];
+        AccessibleListener[] result = accessible.getAccessibleListeners ();
+        return result !is null ? result : new AccessibleListener [0];
+    }
+
+    static AccessibleObject getAccessibleObject (AtkObject* atkObject) {
+        return AccessibleObjects[atkObject];
+    }
+
+    AccessibleObject getChildByHandle (AtkObject* handle) {
+        return children[handle];
+    }
+
+    AccessibleObject getChildByID (int childId) {
+        if (childId is ACC.CHILDID_SELF) return this;
+        foreach( object; children ){
+            if (object.id is childId) return object;
+        }
+        return null;
+    }
+
+    AccessibleObject getChildByIndex (int childIndex) {
+        foreach( object; children ){
+            if (object.index is childIndex) return object;
+        }
+        return null;
+    }
+
+    AccessibleControlListener[] getControlListeners () {
+        if (accessible is null) return new AccessibleControlListener [0];
+        AccessibleControlListener[] result = accessible.getControlListeners ();
+        return result !is null ? result : new AccessibleControlListener [0];
+    }
+
+    String getText () {
+        char* parentResult;
+        String parentText = ""; //$NON-NLS-1$
+        if (ATK.g_type_is_a (parentType, ATK_TEXT_TYPE)) {
+            auto textIface = cast(AtkTextIface*)ATK.g_type_interface_peek_parent (ATK.ATK_TEXT_GET_IFACE (handle));
+            int /*long*/ characterCount = 0;
+            if (textIface.get_character_count !is null) {
+                characterCount = textIface.get_character_count( handle);
+            }
+            if (characterCount > 0 && textIface.get_text !is null) {
+                parentResult = textIface.get_text( handle, 0, characterCount);
+                if (parentResult !is null) {
+                    parentText = fromStringz( parentResult ).dup;
+                }
+            }
+        }
+        AccessibleControlListener[] controlListeners = getControlListeners ();
+        if (controlListeners.length is 0) return parentText;
+        AccessibleControlEvent event = new AccessibleControlEvent (this);
+        event.childID = id;
+        event.result = parentText;
+        for (int i = 0; i < controlListeners.length; i++) {
+            controlListeners [i].getValue (event);
+        }
+        return event.result;
+    }
+
+    AccessibleTextListener[] getTextListeners () {
+        if (accessible is null) return new AccessibleTextListener [0];
+        AccessibleTextListener[] result = accessible.getTextListeners ();
+        return result !is null ? result : new AccessibleTextListener [0];
+    }
+
+    package static extern(C) void gObjectClass_finalize (GObject* atkObject) {
+        auto superType = ATK.g_type_class_peek_parent (ATK.G_OBJECT_GET_CLASS (cast(GTypeInstance*)atkObject));
+        auto objectClassStruct = cast(GObjectClass*)ATK.G_OBJECT_CLASS (cast(GTypeClass*)superType);
+        objectClassStruct.finalize(atkObject);
+        AccessibleObject object = getAccessibleObject (cast(AtkObject*)atkObject);
+        if (object !is null) {
+            AccessibleObjects.remove (cast(AtkObject*)atkObject);
+            object.release ();
+        }
+    }
+
+    static int nextIndexOfChar (String string, String searchChars, int startIndex) {
+        int result = string.length;
+        for (int i = 0; i < searchChars.length; i++) {
+            char current = searchChars[i];
+            int index = locate( string, current, startIndex );
+            if (index !is string.length ) result = Math.min (result, index);
+        }
+        return result;
+    }
+
+    static int nextIndexOfNotChar (String string, String searchChars, int startIndex) {
+        int length = string.length;
+        int index = startIndex;
+        while (index < length) {
+            char current = string[index];
+            if ( !contains( searchChars, current)) break;
+            index++;
+        }
+        return index;
+    }
+
+    static int previousIndexOfChar (String string, String searchChars, int startIndex) {
+        int result = -1;
+        if (startIndex < 0) return result;
+        string = string[0 .. startIndex];
+        for (int i = 0; i < searchChars.length ; i++) {
+            char current = searchChars[i];
+            int index = locatePrior( string, current);
+            if (index !is string.length ) result = Math.max (result, index);
+        }
+        return result;
+    }
+
+    static int previousIndexOfNotChar (String string, String searchChars, int startIndex) {
+        if (startIndex < 0) return -1;
+        int index = startIndex - 1;
+        while (index >= 0) {
+            char current = string[index];
+            if ( !contains(searchChars, current)) break;
+            index--;
+        }
+        return index;
+    }
+
+    void release () {
+        if (DEBUG) getDwtLogger().info( __FILE__, __LINE__, "AccessibleObject.release: {}", handle);
+        accessible = null;
+        foreach( child; children ){
+            if (child.isLightweight) OS.g_object_unref (child.handle);
+        }
+        if (parent !is null) parent.removeChild (this, false);
+    }
+
+    void removeChild (AccessibleObject child, bool unref) {
+        children.remove (child.handle);
+        if (unref && child.isLightweight) OS.g_object_unref (child.handle);
+    }
+
+    void selectionChanged () {
+        OS.g_signal_emit_by_name0 (handle, ATK.selection_changed.ptr);
+    }
+
+    void setFocus (int childID) {
+        updateChildren ();
+        AccessibleObject accObject = getChildByID (childID);
+        if (accObject !is null) {
+            ATK.atk_focus_tracker_notify (accObject.handle);
+        }
+    }
+
+    void setParent (AccessibleObject parent) {
+        this.parent = parent;
+    }
+
+    void textCaretMoved(int index) {
+        OS.g_signal_emit_by_name1 (handle, ATK.text_caret_moved.ptr, index);
+    }
+
+    void textChanged(int type, int startIndex, int length) {
+        if (type is ACC.TEXT_DELETE) {
+            OS.g_signal_emit_by_name2 (handle, ATK.text_changed_delete.ptr, startIndex, length);
+        } else {
+            OS.g_signal_emit_by_name2 (handle, ATK.text_changed_insert.ptr, startIndex, length);
+        }
+    }
+
+    void textSelectionChanged() {
+        OS.g_signal_emit_by_name0 (handle, ATK.text_selection_changed.ptr);
+    }
+
+    void updateChildren () {
+        if (isLightweight) return;
+        AccessibleControlListener[] listeners = getControlListeners ();
+        if (listeners.length is 0) return;
+
+        AccessibleControlEvent event = new AccessibleControlEvent (this);
+        for (int i = 0; i < listeners.length; i++) {
+            listeners [i].getChildren (event);
+        }
+        if (event.children !is null && event.children.length > 0) {
+            AtkObject*[] idsToKeep = new AtkObject*[]( children.length );
+            idsToKeep.length = 0;
+            if ( null !is (cast(Integer)event.children[0] )) {
+                /*  an array of child id's (Integers) was answered */
+                auto parentType = AccessibleFactory.getDefaultParentType ();
+                for (int i = 0; i < event.children.length; i++) {
+                    AccessibleObject object = getChildByIndex (i);
+                    if (object is null) {
+                        auto childType = AccessibleFactory.getChildType (accessible, i);
+                        object = new AccessibleObject (childType, null, accessible, parentType, true);
+                        AccessibleObjects[object.handle] = object;
+                        addChild (object);
+                        object.index = i;
+                    }
+                    if( auto intChild = cast(Integer)event.children[i] ){
+                        object.id = intChild.intValue ();
+                    }
+                    else {
+                        /* a non-ID value was given so don't set the ID */
+                    }
+                    idsToKeep ~= object.handle;
+                }
+            } else {
+                /* an array of Accessible children was answered */
+                int childIndex = 0;
+                for (int i = 0; i < event.children.length; i++) {
+                    AccessibleObject object = null;
+                    if( auto accChild = cast(Accessible)event.children[i] ){
+                        object = accChild.accessibleObject;
+                    } else {
+                        /* a non-Accessible value was given so nothing to do here */
+                    }
+                    if (object !is null) {
+                        object.index = childIndex++;
+                        idsToKeep ~= object.handle;
+                    }
+                }
+            }
+            /* remove old children that were not provided as children anymore */
+            foreach( id; children.keys ){
+                if ( !tango.core.Array.contains( idsToKeep, id )) {
+                    AccessibleObject object = cast(AccessibleObject) children[id];
+                    removeChild (object, true);
+                }
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/accessibility/AccessibleTextAdapter.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.accessibility.AccessibleTextAdapter;
+
+import java.lang.all;
+
+import org.eclipse.swt.accessibility.AccessibleTextEvent;
+import org.eclipse.swt.accessibility.AccessibleTextListener;
+
+/**
+ * This adapter class provides default implementations for the
+ * methods described by the <code>AccessibleTextListener</code> interface.
+ * <p>
+ * Classes that wish to deal with <code>AccessibleTextEvent</code>s can
+ * extend this class and override only the methods that they are
+ * interested in.
+ * </p><p>
+ * Note: Accessibility clients use child identifiers to specify
+ * whether they want information about a control or one of its children.
+ * Child identifiers are increasing integers beginning with 0.
+ * The identifier CHILDID_SELF represents the control itself.
+ * When returning a child identifier to a client, you may use CHILDID_NONE
+ * to indicate that no child or control has the required information.
+ * </p><p>
+ * Note: This adapter is typically used by implementors of
+ * a custom control to provide very detailed information about
+ * the control instance to accessibility clients.
+ * </p>
+ *
+ * @see AccessibleTextListener
+ * @see AccessibleTextEvent
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.0
+ */
+public abstract class AccessibleTextAdapter : AccessibleTextListener {
+
+    /**
+     * Sent when an accessibility client requests the current character offset
+     * of the text caret.
+     * The default behavior is to do nothing.
+     * <p>
+     * Return the caret offset in the <code>offset</code>
+     * field of the event object.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>childID [IN] - an identifier specifying a child of the control</li>
+     *    <li>offset [OUT] - the current offset of the text caret</li>
+     * </ul>
+     */
+    public void getCaretOffset (AccessibleTextEvent e) {
+    }
+
+    /**
+     * Sent when an accessibility client requests the range of the current
+     * text selection.
+     * The default behavior is to do nothing.
+     * <p>
+     * Return the selection start offset and non-negative length in the
+     * <code>offset</code> and <code>length</code> fields of the event object.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>childID [IN] - an identifier specifying a child of the control</li>
+     *    <li>offset [OUT] - the offset of the current text selection</li>
+     *    <li>length [OUT] - the length of the current text selection</li>
+     * </ul>
+     */
+    public void getSelectionRange (AccessibleTextEvent e) {
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/accessibility/AccessibleTextEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.accessibility.AccessibleTextEvent;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.internal.SWTEventObject;
+import tango.text.convert.Format;
+
+/**
+ * Instances of this class are sent as a result of
+ * accessibility clients sending messages to controls
+ * asking for detailed information about the implementation
+ * of the control instance. Typically, only implementors
+ * of custom controls need to listen for this event.
+ * <p>
+ * Note: The meaning of each field depends on the
+ * message that was sent.
+ * </p>
+ *
+ * @see AccessibleTextListener
+ * @see AccessibleTextAdapter
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.0
+ */
+public class AccessibleTextEvent : SWTEventObject {
+    public int childID;             // IN
+    public int offset, length;      // OUT
+
+    //static final long serialVersionUID = 3977019530868308275L;
+
+/**
+ * Constructs a new instance of this class.
+ *
+ * @param source the object that fired the event
+ */
+public this (Object source) {
+    super (source);
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+public override String toString () {
+    return Format( "AccessibleTextEvent {{childID={} offset={} length={}}",
+        childID,
+        offset,
+        length);
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/accessibility/AccessibleTextListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.accessibility.AccessibleTextListener;
+
+import java.lang.all;
+
+import org.eclipse.swt.accessibility.AccessibleTextEvent;
+
+import org.eclipse.swt.internal.SWTEventListener;
+
+/**
+ * Classes that implement this interface provide methods
+ * that deal with the events that are generated when an
+ * accessibility client sends a message to a control.
+ * <p>
+ * After creating an instance of a class that implements
+ * this interface it can be added to a control using the
+ * <code>addAccessibleTextListener</code> method and removed
+ * using the <code>removeAccessibleTextListener</code> method.
+ * When a client requests information the appropriate method
+ * will be invoked.
+ * </p><p>
+ * Note: Accessibility clients use child identifiers to specify
+ * whether they want information about a control or one of its children.
+ * Child identifiers are increasing integers beginning with 0.
+ * The identifier CHILDID_SELF represents the control itself.
+ * </p><p>
+ * Note: This interface is typically used by implementors of
+ * a custom control to provide very detailed information about
+ * the control instance to accessibility clients.
+ * </p>
+ *
+ * @see AccessibleTextAdapter
+ * @see AccessibleTextEvent
+ *
+ * @since 3.0
+ */
+public interface AccessibleTextListener : SWTEventListener {
+
+    /**
+     * Sent when an accessibility client requests the current character offset
+     * of the text caret.
+     * <p>
+     * Return the caret offset in the <code>offset</code>
+     * field of the event object.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>childID [IN] - an identifier specifying a child of the control</li>
+     *    <li>offset [OUT] - the current offset of the text caret</li>
+     * </ul>
+     */
+    public void getCaretOffset (AccessibleTextEvent e);
+
+    /**
+     * Sent when an accessibility client requests the range of the current
+     * text selection.
+     * <p>
+     * Return the selection start offset and non-negative length in the
+     * <code>offset</code> and <code>length</code> fields of the event object.
+     * </p>
+     *
+     * @param e an event object containing the following fields:<ul>
+     *    <li>childID [IN] - an identifier specifying a child of the control</li>
+     *    <li>offset [OUT] - the offset of the current text selection</li>
+     *    <li>length [OUT] - the length of the current text selection</li>
+     * </ul>
+     */
+    public void getSelectionRange (AccessibleTextEvent e);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/accessibility/all.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,19 @@
+module org.eclipse.swt.accessibility.all;
+
+import java.lang.all;
+
+public import org.eclipse.swt.accessibility.ACC;
+public import org.eclipse.swt.accessibility.Accessible;
+public import org.eclipse.swt.accessibility.AccessibleAdapter;
+public import org.eclipse.swt.accessibility.AccessibleControlAdapter;
+public import org.eclipse.swt.accessibility.AccessibleControlEvent;
+public import org.eclipse.swt.accessibility.AccessibleControlListener;
+public import org.eclipse.swt.accessibility.AccessibleEvent;
+public import org.eclipse.swt.accessibility.AccessibleFactory;
+public import org.eclipse.swt.accessibility.AccessibleListener;
+public import org.eclipse.swt.accessibility.AccessibleObject;
+public import org.eclipse.swt.accessibility.AccessibleTextAdapter;
+public import org.eclipse.swt.accessibility.AccessibleTextEvent;
+public import org.eclipse.swt.accessibility.AccessibleTextListener;
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/all.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,21 @@
+module org.eclipse.swt.all;
+
+import java.lang.all;
+
+public import org.eclipse.swt.SWT;
+public import org.eclipse.swt.SWTError;
+public import org.eclipse.swt.SWTException;
+
+public import org.eclipse.swt.accessibility.all;
+//public import org.eclipse.swt.browser.all; // not yet usable
+public import org.eclipse.swt.custom.all;
+public import org.eclipse.swt.dnd.all;
+public import org.eclipse.swt.events.all;
+public import org.eclipse.swt.graphics.all;
+public import org.eclipse.swt.layout.all;
+//public import org.eclipse.swt.opengl.all; // dependent on existing bindings
+public import org.eclipse.swt.printing.all;
+public import org.eclipse.swt.program.all;
+public import org.eclipse.swt.widgets.all;
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/AppFileLocProvider.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,255 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.AppFileLocProvider;
+
+import tango.sys.Environment;
+import tango.text.Util;
+
+import java.lang.all;
+import org.eclipse.swt.browser.Mozilla;
+import org.eclipse.swt.browser.SimpleEnumerator;
+
+import org.eclipse.swt.internal.Compatibility;
+
+import XPCOM = org.eclipse.swt.internal.mozilla.XPCOM;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsISimpleEnumerator;
+import org.eclipse.swt.internal.mozilla.nsEmbedString;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsIDirectoryService;
+import org.eclipse.swt.internal.mozilla.nsIFile;
+import org.eclipse.swt.internal.mozilla.nsILocalFile;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+class AppFileLocProvider : nsIDirectoryServiceProvider2 { 
+    int refCount = 0;
+    String mozillaPath, profilePath;
+    String[] pluginDirs;
+    bool isXULRunner;
+    
+    static       String SEPARATOR_OS;
+    static final String CHROME_DIR = "chrome"; //$NON-NLS-1$
+    static final String COMPONENTS_DIR = "components"; //$NON-NLS-1$
+    static final String HISTORY_FILE = "history.dat"; //$NON-NLS-1$
+    static final String LOCALSTORE_FILE = "localstore.rdf"; //$NON-NLS-1$
+    static final String MIMETYPES_FILE = "mimeTypes.rdf"; //$NON-NLS-1$
+    static final String PLUGINS_DIR = "plugins"; //$NON-NLS-1$
+    static       String USER_PLUGINS_DIR;
+    static final String PREFERENCES_FILE = "prefs.js"; //$NON-NLS-1$
+
+static this () {
+    SEPARATOR_OS = System.getProperty ("file.separator");
+    USER_PLUGINS_DIR = ".mozilla" ~ SEPARATOR_OS ~ "plugins";
+}
+
+this (String path) {
+    mozillaPath = path ~ SEPARATOR_OS;
+}
+
+extern(System)
+nsrefcnt AddRef () {
+    refCount++;
+    return refCount;
+}
+
+extern(System)
+nsresult QueryInterface (nsID* riid, void** ppvObject) {
+    if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
+
+    if (*riid == nsISupports.IID) {
+        *ppvObject = cast(void*)cast(nsISupports)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsIDirectoryServiceProvider.IID) {
+        *ppvObject = cast(void*)cast(nsIDirectoryServiceProvider)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsIDirectoryServiceProvider2.IID) {
+        *ppvObject = cast(void*)cast(nsIDirectoryServiceProvider2)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    
+    *ppvObject = null;
+    return XPCOM.NS_ERROR_NO_INTERFACE;
+}
+
+extern(System)
+nsrefcnt Release () {
+    refCount--;
+    if (refCount is 0) return 0;
+    return refCount;
+}
+
+void setProfilePath (String path) {
+    profilePath = path;
+    if (!Compatibility.fileExists (path, "")) { //$NON-NLS-1$
+        nsILocalFile file;
+        scope auto nsEmbedString pathString = new nsEmbedString (toWCharArray(path));
+        int rc = XPCOM.NS_NewLocalFile (cast(nsAString*)pathString, 1, &file);
+        if (rc !is XPCOM.NS_OK) Mozilla.error (rc);
+        if (file is null) Mozilla.error (XPCOM.NS_ERROR_NULL_POINTER);
+
+        rc = file.Create (nsILocalFile.DIRECTORY_TYPE, 0700);
+        if (rc !is XPCOM.NS_OK) Mozilla.error (rc);
+        file.Release ();
+    }
+}
+
+/* nsIDirectoryServiceProvider2 */
+extern(System)
+nsresult GetFiles (char* prop, nsISimpleEnumerator* _retval) {
+    String propertyName = fromStringz(prop);
+    String[] propertyValues = null;
+
+    if (propertyName == XPCOM.NS_APP_PLUGINS_DIR_LIST) {
+        if (pluginDirs is null) {
+            int index = 0;
+            /* set the first value(s) to the MOZ_PLUGIN_PATH environment variable value if it's defined */
+            String value = Environment.get (XPCOM.MOZILLA_PLUGIN_PATH);
+            if (value !is null) {
+                if (value.length > 0) {
+                    String separator = System.getProperty ("file.separator"); // $NON-NLS-1$
+                    foreach (segment; delimiters(value, separator))
+                        pluginDirs ~= segment;
+                }
+            }
+            if (pluginDirs is null) {
+                pluginDirs = new String[2];
+            }
+
+            /* set the next value to the GRE path + "plugins" */
+            pluginDirs ~= mozillaPath ~ PLUGINS_DIR;
+
+            /* set the next value to the home directory + "/.mozilla/plugins" */
+            pluginDirs ~= System.getProperty("user.home") ~ SEPARATOR_OS ~ USER_PLUGINS_DIR;
+        }
+        propertyValues = pluginDirs;
+    }
+
+    *_retval = null;
+    //XPCOM.memmove(_retval, new int /*long*/[] {0}, C.PTR_SIZEOF);
+    if (propertyValues !is null) {
+        nsILocalFile localFile;
+        nsIFile file;
+        nsISupports[] files = new nsISupports [propertyValues.length];
+        int index = 0;
+        for (int i = 0; i < propertyValues.length; i++) {
+            scope auto pathString = new nsEmbedString (toWCharArray(propertyValues[i]));
+            int rc = XPCOM.NS_NewLocalFile (cast(nsAString*)pathString, 1, &localFile);
+            if (rc !is XPCOM.NS_ERROR_FILE_UNRECOGNIZED_PATH) {
+                /* value appears to be a valid pathname */
+                if (rc !is XPCOM.NS_OK) Mozilla.error (rc);
+                if (localFile is null) Mozilla.error (XPCOM.NS_ERROR_NULL_POINTER);
+
+                rc = localFile.QueryInterface (&nsIFile.IID, cast(void**)&file); 
+                if (rc !is XPCOM.NS_OK) Mozilla.error (rc);
+                if (file is null) Mozilla.error (XPCOM.NS_ERROR_NO_INTERFACE);
+                localFile.Release ();
+
+                files[index++] = cast(nsISupports)file;
+            }
+        }
+
+        if (index < propertyValues.length) {
+            /* there were some invalid values so remove the trailing empty array slots */
+            files = files[0..index];
+        }
+
+        auto enumerator = new SimpleEnumerator (files);
+        enumerator.AddRef ();
+        *_retval = cast(nsISimpleEnumerator)enumerator;
+        return XPCOM.NS_OK;
+    }
+
+    return XPCOM.NS_ERROR_FAILURE;
+}   
+    
+/* nsIDirectoryServiceProvider implementation */
+extern(System)
+nsresult GetFile(char* prop, PRBool* persistent, nsIFile* _retval) {
+    String propertyName = tango.stdc.stringz.fromStringz( prop );
+    String propertyValue = null;
+
+    if (propertyName == (XPCOM.NS_APP_HISTORY_50_FILE)) {
+        propertyValue = profilePath ~ HISTORY_FILE;
+    } else if (propertyName == (XPCOM.NS_APP_USER_MIMETYPES_50_FILE)) {
+        propertyValue = profilePath ~ MIMETYPES_FILE;
+    } else if (propertyName == (XPCOM.NS_APP_PREFS_50_FILE)) {
+        propertyValue = profilePath ~ PREFERENCES_FILE;
+    } else if (propertyName == (XPCOM.NS_APP_PREFS_50_DIR)) {
+        propertyValue = profilePath;
+    } else if (propertyName == (XPCOM.NS_APP_USER_CHROME_DIR)) {
+        propertyValue = profilePath ~ CHROME_DIR;
+    } else if (propertyName == (XPCOM.NS_APP_USER_PROFILE_50_DIR)) {
+        propertyValue = profilePath;
+    } else if (propertyName == (XPCOM.NS_APP_LOCALSTORE_50_FILE)) {
+        propertyValue = profilePath ~ LOCALSTORE_FILE;
+    } else if (propertyName == (XPCOM.NS_APP_CACHE_PARENT_DIR)) {
+        propertyValue = profilePath;
+    } else if (propertyName == (XPCOM.NS_OS_HOME_DIR)) {
+        propertyValue = System.getProperty("user.home");    //$NON-NLS-1$
+    } else if (propertyName == (XPCOM.NS_OS_TEMP_DIR)) {
+        propertyValue = System.getProperty("java.io.tmpdir");   //$NON-NLS-1$
+    } else if (propertyName == (XPCOM.NS_GRE_DIR)) {
+        propertyValue = mozillaPath;
+    } else if (propertyName == (XPCOM.NS_GRE_COMPONENT_DIR)) {
+        propertyValue = mozillaPath ~ COMPONENTS_DIR;
+    } else if (propertyName == (XPCOM.NS_XPCOM_INIT_CURRENT_PROCESS_DIR)) {
+        propertyValue = mozillaPath;
+    } else if (propertyName == (XPCOM.NS_OS_CURRENT_PROCESS_DIR)) {
+        propertyValue = mozillaPath;
+    } else if (propertyName == (XPCOM.NS_XPCOM_COMPONENT_DIR)) {
+        propertyValue = mozillaPath ~ COMPONENTS_DIR;
+    } else if (propertyName == (XPCOM.NS_XPCOM_CURRENT_PROCESS_DIR)) {
+        propertyValue = mozillaPath;
+    } else if (propertyName == (XPCOM.NS_APP_PREF_DEFAULTS_50_DIR)) {
+        /*
+        * Answering a value for this property causes problems in Mozilla versions
+        * < 1.7.  Unfortunately this property is queried early enough in the
+        * Browser creation process that the Mozilla version being used is not
+        * yet determined.  However it is known if XULRunner is being used or not.
+        * 
+        * For now answer a value for this property iff XULRunner is the GRE.
+        * If the range of Mozilla versions supported by the Browser is changed
+        * in the future to be >= 1.7 then this value can always be answered.  
+        */
+        if (isXULRunner) propertyValue = profilePath;
+    }
+
+    *persistent = true; /* PRBool */
+    *_retval = null;
+    if (propertyValue !is null && propertyValue.length > 0) {
+        nsILocalFile localFile;
+        scope auto pathString = new nsEmbedString (propertyValue.toWCharArray());
+        int rc = XPCOM.NS_NewLocalFile (cast(nsAString*)pathString, 1, &localFile);
+        if (rc !is XPCOM.NS_OK) Mozilla.error (rc);
+        if (localFile is null) Mozilla.error (XPCOM.NS_ERROR_NULL_POINTER);
+        
+        nsIFile file;
+        rc = localFile.QueryInterface (&nsIFile.IID, cast(void**)&file); 
+        if (rc !is XPCOM.NS_OK) Mozilla.error (rc);
+        if (file is null) Mozilla.error (XPCOM.NS_ERROR_NO_INTERFACE);
+
+        *_retval = file;
+        localFile.Release ();
+        return XPCOM.NS_OK;
+    }
+
+    return XPCOM.NS_ERROR_FAILURE;
+}       
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/Browser.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,780 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.Browser;
+
+import java.lang.all;
+
+import tango.core.Thread;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Widget;
+
+import org.eclipse.swt.browser.Mozilla;
+import org.eclipse.swt.browser.WebBrowser;
+import org.eclipse.swt.browser.CloseWindowListener;
+import org.eclipse.swt.browser.LocationListener;
+import org.eclipse.swt.browser.OpenWindowListener;
+import org.eclipse.swt.browser.ProgressListener;
+import org.eclipse.swt.browser.StatusTextListener;
+import org.eclipse.swt.browser.TitleListener;
+import org.eclipse.swt.browser.VisibilityWindowListener;
+/**
+ * Instances of this class implement the browser user interface
+ * metaphor.  It allows the user to visualize and navigate through
+ * HTML documents.
+ * <p>
+ * Note that although this class is a subclass of <code>Composite</code>,
+ * it does not make sense to set a layout on it.
+ * </p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>MOZILLA</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>CloseWindowListener, LocationListener, OpenWindowListener, ProgressListener, StatusTextListener, TitleListener, VisibilityWindowListener</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ * 
+ * @since 3.0
+ */
+
+public class Browser : Composite {
+    WebBrowser webBrowser;
+    int userStyle;
+
+    static final String PACKAGE_PREFIX = "org.eclipse.swt.browser."; //$NON-NLS-1$
+    static final String NO_INPUT_METHOD = "org.eclipse.swt.internal.gtk.noInputMethod"; //$NON-NLS-1$
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together 
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a widget which will be the parent of the new instance (cannot be null)
+ * @param style the style of widget to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES if a handle could not be obtained for browser creation</li>
+ * </ul>
+ * 
+ * @see Widget#getStyle
+ * 
+ * @since 3.0
+ */
+public this (Composite parent, int style) {
+    super (checkParent (parent), checkStyle (style));
+    userStyle = style;
+
+    String platform = SWT.getPlatform ();
+    Display display = parent.getDisplay ();
+    if ("gtk" == platform) display.setData (NO_INPUT_METHOD, null); //$NON-NLS-1$
+    /*
+    String className = null;
+    if ((style & SWT.MOZILLA) !is 0) {
+        className = "org.eclipse.swt.browser.Mozilla"; //$NON-NLS-1$
+    } else {
+        dispose();
+        SWT.error(SWT.ERROR_NO_HANDLES);
+    }
+    */
+    webBrowser = new Mozilla;
+    if (webBrowser is null) {
+        dispose ();
+        SWT.error (SWT.ERROR_NO_HANDLES);
+    }
+
+    webBrowser.setBrowser (this);
+    webBrowser.create (parent, style);
+}
+
+static Composite checkParent (Composite parent) {
+    String platform = SWT.getPlatform ();
+    if (!("gtk" == platform)) return parent; //$NON-NLS-1$
+
+    /*
+    * Note.  Mozilla provides all IM support needed for text input in web pages.
+    * If SWT creates another input method context for the widget it will cause
+    * indeterminate results to happen (hangs and crashes). The fix is to prevent 
+    * SWT from creating an input method context for the  Browser widget.
+    */
+    if (parent !is null && !parent.isDisposed ()) {
+        Display display = parent.getDisplay ();
+        if (display !is null) {
+            if (display.getThread () is Thread.getThis ()) {
+                display.setData (NO_INPUT_METHOD, stringcast("true")); //$NON-NLS-1$
+            }
+        }
+    }
+    return parent;
+}
+
+static int checkStyle(int style) {
+    String platform = SWT.getPlatform ();
+    if ((style & SWT.MOZILLA) !is 0) {
+        if ("carbon" == platform) return style | SWT.EMBEDDED; //$NON-NLS-1$
+        if ("motif" == platform) return style | SWT.EMBEDDED; //$NON-NLS-1$
+        return style;
+    }
+
+    if ("win32" == platform) { //$NON-NLS-1$
+        /*
+        * For IE on win32 the border is supplied by the embedded browser, so remove
+        * the style so that the parent Composite will not draw a second border.
+        */
+        return style & ~SWT.BORDER;
+    } else if ("motif" == platform) { //$NON-NLS-1$
+        return style | SWT.EMBEDDED;
+    }
+    return style;
+}
+
+/**
+ * Clears all session cookies from all current Browser instances.
+ * 
+ * @since 3.2
+ */
+public static void clearSessions () {
+    WebBrowser.clearSessions ();
+}
+
+/**  
+ * Adds the listener to the collection of listeners who will be
+ * notified when the window hosting the receiver should be closed.
+ * <p>
+ * This notification occurs when a javascript command such as
+ * <code>window.close</code> gets executed by a <code>Browser</code>.
+ * </p>
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * 
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void addCloseWindowListener (CloseWindowListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    webBrowser.addCloseWindowListener (listener);
+}
+
+/**  
+ * Adds the listener to the collection of listeners who will be
+ * notified when the current location has changed or is about to change.
+ * <p>
+ * This notification typically occurs when the application navigates
+ * to a new location with {@link #setUrl(String)} or when the user
+ * activates a hyperlink.
+ * </p>
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * 
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void addLocationListener (LocationListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    webBrowser.addLocationListener (listener);
+}
+
+/**  
+ * Adds the listener to the collection of listeners who will be
+ * notified when a new window needs to be created.
+ * <p>
+ * This notification occurs when a javascript command such as
+ * <code>window.open</code> gets executed by a <code>Browser</code>.
+ * </p>
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * 
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void addOpenWindowListener (OpenWindowListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    webBrowser.addOpenWindowListener (listener);
+}
+
+/**  
+ * Adds the listener to the collection of listeners who will be
+ * notified when a progress is made during the loading of the current 
+ * URL or when the loading of the current URL has been completed.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * 
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void addProgressListener (ProgressListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    webBrowser.addProgressListener (listener);
+}
+
+/**  
+ * Adds the listener to the collection of listeners who will be
+ * notified when the status text is changed.
+ * <p>
+ * The status text is typically displayed in the status bar of
+ * a browser application.
+ * </p>
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * 
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void addStatusTextListener (StatusTextListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    webBrowser.addStatusTextListener (listener);
+}
+
+/**  
+ * Adds the listener to the collection of listeners who will be
+ * notified when the title of the current document is available
+ * or has changed.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * 
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void addTitleListener (TitleListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    webBrowser.addTitleListener (listener);
+}
+
+/**  
+ * Adds the listener to the collection of listeners who will be
+ * notified when a window hosting the receiver needs to be displayed
+ * or hidden.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * 
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void addVisibilityWindowListener (VisibilityWindowListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    webBrowser.addVisibilityWindowListener (listener);
+}
+
+/**
+ * Navigate to the previous session history item.
+ *
+ * @return <code>true</code> if the operation was successful and <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ *
+ * @see #forward
+ * 
+ * @since 3.0
+ */
+public bool back () {
+    checkWidget();
+    return webBrowser.back ();
+}
+
+protected void checkSubclass () {
+    String name = this.classinfo.name;
+    name = name.substring(0, name.lastIndexOf('.'));
+    int index = name.lastIndexOf('.');
+    if (!name.substring (0, index + 1).equals (PACKAGE_PREFIX)) {
+        getDwtLogger().info( __FILE__, __LINE__, "name: {} == {}", name.substring(0, index + 1), PACKAGE_PREFIX);
+        SWT.error (SWT.ERROR_INVALID_SUBCLASS);
+    }
+}
+
+/**
+ * Execute the specified script.
+ *
+ * <p>
+ * Execute a script containing javascript commands in the context of the current document. 
+ * 
+ * @param script the script with javascript commands
+ *  
+ * @return <code>true</code> if the operation was successful and <code>false</code> otherwise
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the script is null</li>
+ * </ul>
+ * 
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public bool execute (String script) {
+    checkWidget();
+    if (script is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    return webBrowser.execute (script);
+}
+
+/**
+ * Navigate to the next session history item.
+ *
+ * @return <code>true</code> if the operation was successful and <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ * 
+ * @see #back
+ * 
+ * @since 3.0
+ */
+public bool forward () {
+    checkWidget();
+    return webBrowser.forward ();
+}
+
+public int getStyle () {
+    /*
+    * If SWT.BORDER was specified at creation time then getStyle() should answer
+    * it even though it is removed for IE on win32 in checkStyle().
+    */
+    return super.getStyle () | (userStyle & SWT.BORDER);
+}
+
+/**
+ * Returns a string with HTML that represents the content of the current page.
+ *
+ * @return HTML representing the current page or an empty <code>String</code>
+ * if this is empty
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ *
+ * @since 3.4
+ */
+public String getText () {
+    checkWidget();
+    return webBrowser.getText ();
+}
+
+/**
+ * Returns the current URL.
+ *
+ * @return the current URL or an empty <code>String</code> if there is no current URL
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ *
+ * @see #setUrl
+ * 
+ * @since 3.0
+ */
+public String getUrl () {
+    checkWidget();
+    return webBrowser.getUrl ();
+}
+
+/**
+ * Returns the JavaXPCOM <code>nsIWebBrowser</code> for the receiver, or <code>null</code>
+ * if it is not available.  In order for an <code>nsIWebBrowser</code> to be returned all
+ * of the following must be true: <ul>
+ *    <li>the receiver's style must be <code>SWT.MOZILLA</code></li>
+ *    <li>the classes from JavaXPCOM &gt;= 1.8.1.2 must be resolvable at runtime</li>
+ *    <li>the version of the underlying XULRunner must be &gt;= 1.8.1.2</li>
+ * </ul> 
+ *
+ * @return the receiver's JavaXPCOM <code>nsIWebBrowser</code> or <code>null</code>
+ * 
+ * @since 3.3
+ */
+public Object getWebBrowser () {
+    checkWidget();
+    return webBrowser.getWebBrowser ();
+}
+
+/**
+ * Returns <code>true</code> if the receiver can navigate to the 
+ * previous session history item, and <code>false</code> otherwise.
+ *
+ * @return the receiver's back command enabled state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * 
+ * @see #back
+ */
+public bool isBackEnabled () {
+    checkWidget();
+    return webBrowser.isBackEnabled ();
+}
+
+public bool isFocusControl () {
+    checkWidget();
+    if (webBrowser.isFocusControl ()) return true;
+    return super.isFocusControl ();
+}
+
+/**
+ * Returns <code>true</code> if the receiver can navigate to the 
+ * next session history item, and <code>false</code> otherwise.
+ *
+ * @return the receiver's forward command enabled state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * 
+ * @see #forward
+ */
+public bool isForwardEnabled () {
+    checkWidget();
+    return webBrowser.isForwardEnabled ();
+}
+
+/**
+ * Refresh the current page.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void refresh () {
+    checkWidget();
+    webBrowser.refresh ();
+}
+
+/**  
+ * Removes the listener from the collection of listeners who will
+ * be notified when the window hosting the receiver should be closed.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * 
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ * 
+ * @since 3.0
+ */
+public void removeCloseWindowListener (CloseWindowListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    webBrowser.removeCloseWindowListener (listener);
+}
+
+/**  
+ * Removes the listener from the collection of listeners who will
+ * be notified when the current location is changed or about to be changed.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * 
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ * 
+ * @since 3.0
+ */
+public void removeLocationListener (LocationListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    webBrowser.removeLocationListener (listener);
+}
+
+/**  
+ * Removes the listener from the collection of listeners who will
+ * be notified when a new window needs to be created.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * 
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ * 
+ * @since 3.0
+ */
+public void removeOpenWindowListener (OpenWindowListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    webBrowser.removeOpenWindowListener (listener);
+}
+
+/**  
+ * Removes the listener from the collection of listeners who will
+ * be notified when a progress is made during the loading of the current 
+ * URL or when the loading of the current URL has been completed.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * 
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ * 
+ * @since 3.0
+ */
+public void removeProgressListener (ProgressListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    webBrowser.removeProgressListener (listener);
+}
+
+/**  
+ * Removes the listener from the collection of listeners who will
+ * be notified when the status text is changed.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * 
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ * 
+ * @since 3.0
+ */
+public void removeStatusTextListener (StatusTextListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    webBrowser.removeStatusTextListener (listener);
+}
+
+/**  
+ * Removes the listener from the collection of listeners who will
+ * be notified when the title of the current document is available
+ * or has changed.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * 
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ * 
+ * @since 3.0
+ */
+public void removeTitleListener (TitleListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    webBrowser.removeTitleListener (listener);
+}
+
+/**  
+ * Removes the listener from the collection of listeners who will
+ * be notified when a window hosting the receiver needs to be displayed
+ * or hidden.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * 
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ * 
+ * @since 3.0
+ */
+public void removeVisibilityWindowListener (VisibilityWindowListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    webBrowser.removeVisibilityWindowListener (listener);
+}
+
+/**
+ * Renders HTML.
+ * 
+ * <p>
+ * The html parameter is Unicode encoded since it is a java <code>String</code>.
+ * As a result, the HTML meta tag charset should not be set. The charset is implied
+ * by the <code>String</code> itself.
+ * 
+ * @param html the HTML content to be rendered
+ *
+ * @return true if the operation was successful and false otherwise.
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the html is null</li>
+ * </ul>
+ * 
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ *  
+ * @see #setUrl
+ * 
+ * @since 3.0
+ */
+public bool setText (String html) {
+    checkWidget();
+    if (html is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    return webBrowser.setText (html);
+}
+
+/**
+ * Loads a URL.
+ * 
+ * @param url the URL to be loaded
+ *
+ * @return true if the operation was successful and false otherwise.
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the url is null</li>
+ * </ul>
+ * 
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ *  
+ * @see #getUrl
+ * 
+ * @since 3.0
+ */
+public bool setUrl (String url) {
+    checkWidget();
+    if (url is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    return webBrowser.setUrl (url);
+}
+
+/**
+ * Stop any loading and rendering activity.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void stop () {
+    checkWidget();
+    webBrowser.stop ();
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/CloseWindowListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.CloseWindowListener;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.SWTEventListener;
+import org.eclipse.swt.browser.WindowEvent;
+
+/**
+ * This listener interface may be implemented in order to receive
+ * a {@link WindowEvent} notification when a {@link Browser} is 
+ * about to be closed and when its host window should be closed
+ * by the application.
+ * 
+ * @see Browser#addCloseWindowListener(CloseWindowListener)
+ * @see Browser#removeCloseWindowListener(CloseWindowListener)
+ * @see OpenWindowListener
+ * @see VisibilityWindowListener
+ * 
+ * @since 3.0
+ */
+public interface CloseWindowListener : SWTEventListener {
+
+/**
+ * This method is called when the window hosting a {@link Browser} should be closed.
+ * Application would typically close the {@link org.eclipse.swt.widgets.Shell} that
+ * hosts the <code>Browser</code>. The <code>Browser</code> is disposed after this
+ * notification.
+ *
+ * <p>The following fields in the <code>WindowEvent</code> apply:
+ * <ul>
+ * <li>(in) widget the <code>Browser</code> that is going to be disposed
+ * </ul></p>
+ *
+ * @param event the <code>WindowEvent</code> that specifies the <code>Browser</code>
+ * that is going to be disposed
+ * 
+ * @see org.eclipse.swt.widgets.Shell#close()
+ * 
+ * @since 3.0
+ */ 
+public void close(WindowEvent event);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/Download.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,338 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.Download;
+
+import Util = tango.text.Util;
+import tango.text.convert.Format;
+import java.lang.all;
+
+import org.eclipse.swt.SWT;
+
+import org.eclipse.swt.browser.Mozilla;
+
+import XPCOM = org.eclipse.swt.internal.mozilla.XPCOM;
+
+import org.eclipse.swt.internal.mozilla.prtime;
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsIDownload;
+import org.eclipse.swt.internal.mozilla.nsIHelperAppLauncher;
+import org.eclipse.swt.internal.mozilla.nsILocalFile;
+import org.eclipse.swt.internal.mozilla.nsIProgressDialog;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsIURI;
+import org.eclipse.swt.internal.mozilla.nsIWebProgressListener;
+import org.eclipse.swt.internal.mozilla.nsIMIMEInfo;
+import org.eclipse.swt.internal.mozilla.nsIObserver;
+import org.eclipse.swt.internal.mozilla.nsIDOMWindow;
+import org.eclipse.swt.internal.mozilla.nsIWebProgress;
+import org.eclipse.swt.internal.mozilla.nsIRequest;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+import org.eclipse.swt.internal.mozilla.nsEmbedString;
+
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+
+class Download : nsIProgressDialog {
+    nsIHelperAppLauncher helperAppLauncher;
+    int refCount = 0;
+
+    Shell shell;
+    Label status;
+    Button cancel;
+    
+this () {
+}
+
+extern(System)
+nsrefcnt AddRef () {
+    refCount++;
+    return refCount;
+}
+
+extern(System)
+nsresult QueryInterface (nsID* riid, void** ppvObject) {
+    if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
+ 
+    if (*riid == nsISupports.IID) {
+        *ppvObject = cast(void*)cast(nsISupports)this;
+        AddRef();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsIDownload.IID) {
+        *ppvObject = cast(void*)cast(nsIDownload)this;
+        AddRef();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsIProgressDialog.IID) {
+        *ppvObject = cast(void*)cast(nsIProgressDialog)this;
+        AddRef();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsIWebProgressListener.IID) {
+        *ppvObject = cast(void*)cast(nsIWebProgressListener)this;
+        AddRef();
+        return XPCOM.NS_OK;
+    }
+    *ppvObject = null;
+    return XPCOM.NS_ERROR_NO_INTERFACE;
+}
+
+extern(System)
+nsrefcnt Release () {
+    refCount--;
+    if (refCount is 0) return 0; // nonsensical condition: will fix later -JJR
+    return refCount;
+}
+
+/* nsIDownload */
+
+/* Note. The argument startTime is defined as a PRInt64. This translates into two java ints. */
+/* EXCEPTION: not for D */
+
+extern(System)
+nsresult Init (nsIURI aSource, nsIURI aTarget, nsAString* aDisplayName, nsIMIMEInfo aMIMEInfo, PRTime startTime, PRBool aPersist) {
+    //nsIURI source = new nsIURI (aSource);
+    scope auto aSpec = new nsEmbedCString;
+    int rc = aSource.GetHost (cast(nsACString*)aSpec);
+    if (rc !is XPCOM.NS_OK) Mozilla.error (rc);
+    //int length = XPCOM.nsEmbedCString_Length (aSpec);
+    //int /*long*/ buffer = XPCOM.nsEmbedCString_get (aSpec);
+    //byte[] dest = new byte[length];
+    //XPCOM.memmove (dest, buffer, length);
+    //XPCOM.nsEmbedCString_delete (aSpec);
+    String url = aSpec.toString;
+
+    /*
+    * As of mozilla 1.7 the second argument of the nsIDownload interface's 
+    * Init function changed from nsILocalFile to nsIURI.  Detect which of
+    * these interfaces the second argument implements and act accordingly.  
+    */
+    String filename = null;
+    nsISupports supports = cast(nsISupports)aTarget;
+    nsIURI target;
+    rc = supports.QueryInterface (&nsIURI.IID, cast(void**)&target);
+    if (rc is 0) {  /* >= 1.7 */
+        //result[0] = 0;
+        //int /*long*/ aPath = XPCOM.nsEmbedCString_new ();
+        scope auto aPath = new nsEmbedCString;
+        rc = target.GetPath (cast(nsACString*)aPath);
+        if (rc !is XPCOM.NS_OK) Mozilla.error (rc,__FILE__,__LINE__);
+        //length = XPCOM.nsEmbedCString_Length (aPath);
+        //buffer = XPCOM.nsEmbedCString_get (aPath);
+        //dest = new byte[length];
+        //XPCOM.memmove (dest, buffer, length);
+        //XPCOM.nsEmbedCString_delete (aPath);
+        filename = aPath.toString;
+        int separator = filename.lastIndexOf (System.getProperty ("file.separator"));   //$NON-NLS-1$
+        filename = filename.substring (separator + 1);
+        target.Release ();
+    } else {    /* < 1.7 */
+        nsILocalFile target2 = cast(nsILocalFile) aTarget;
+        scope auto aNativeTarget = new nsEmbedCString;
+        rc = target2.GetNativeLeafName (cast(nsACString*)aNativeTarget);
+        if (rc !is XPCOM.NS_OK) Mozilla.error (rc,__FILE__,__LINE__);
+        //length = XPCOM.nsEmbedCString_Length (aNativeTarget);
+        //buffer = XPCOM.nsEmbedCString_get (aNativeTarget);
+        //dest = new byte[length];
+        //XPCOM.memmove (dest, buffer, length);
+        //XPCOM.nsEmbedCString_delete (aNativeTarget);
+        filename = aNativeTarget.toString;
+    }
+
+    Listener listener = new class() Listener  {
+        public void handleEvent (Event event) {
+            if (event.widget is cancel) {
+                shell.close ();
+            }
+            if (helperAppLauncher !is null) {
+                helperAppLauncher.Cancel ();
+                helperAppLauncher.Release ();
+            }
+            shell = null;
+            helperAppLauncher = null;
+        }
+    };
+    shell = new Shell (SWT.DIALOG_TRIM);
+    //String msg = Compatibility.getMessage ("SWT_Download_File", new Object[] {filename}); //$NON-NLS-1$
+    shell.setText ("Download: " ~ filename);
+    GridLayout gridLayout = new GridLayout ();
+    gridLayout.marginHeight = 15;
+    gridLayout.marginWidth = 15;
+    gridLayout.verticalSpacing = 20;
+    shell.setLayout(gridLayout);
+    //msg = Compatibility.getMessage ("SWT_Download_Location", new Object[] {filename, url}); //$NON-NLS-1$
+    auto lbl = new Label (shell, SWT.SIMPLE);
+    lbl.setText ("Saving " ~ filename ~ " from " ~ url);
+    status = new Label (shell, SWT.SIMPLE);
+    //msg = Compatibility.getMessage ("SWT_Download_Started"); //$NON-NLS-1$
+    status.setText ("Downloading...");
+    GridData data = new GridData ();
+    data.grabExcessHorizontalSpace = true;
+    data.grabExcessVerticalSpace = true;
+    status.setLayoutData (data);
+
+    cancel = new Button (shell, SWT.PUSH);
+    cancel.setText ("Cancel"); //$NON-NLS-1$
+    data = new GridData ();
+    data.horizontalAlignment = GridData.CENTER;
+    cancel.setLayoutData (data);
+    cancel.addListener (SWT.Selection, listener);
+    shell.addListener (SWT.Close, listener);
+    shell.pack ();
+    shell.open ();
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult GetSource (nsIURI* aSource) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult GetTarget (nsIURI* aTarget) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult GetPersist (PRBool* aPersist) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult GetPercentComplete (PRInt32* aPercentComplete) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult GetDisplayName (PRUnichar** aDisplayName) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult SetDisplayName (PRUnichar* aDisplayName) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult GetStartTime (PRInt64* aStartTime) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult GetMIMEInfo (nsIMIMEInfo* aMIMEInfo) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult GetListener (nsIWebProgressListener* aListener) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult SetListener (nsIWebProgressListener aListener) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult GetObserver (nsIObserver* aObserver) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult SetObserver (nsIObserver aObserver) {
+    if (aObserver !is null) {
+        // nsISupports supports = new nsISupports (aObserver);
+        nsIHelperAppLauncher result;
+        int rc = aObserver.QueryInterface (&nsIHelperAppLauncher.IID, cast(void**)&result);
+        if (rc !is XPCOM.NS_OK) Mozilla.error (rc);
+        if (result is null) Mozilla.error (XPCOM.NS_ERROR_NO_INTERFACE);
+        helperAppLauncher = result;
+    }
+    return XPCOM.NS_OK;
+}
+
+/* nsIProgressDialog */
+
+extern(System)
+nsresult Open (nsIDOMWindow aParent) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult GetCancelDownloadOnClose (PRBool* aCancelDownloadOnClose) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult SetCancelDownloadOnClose (PRBool aCancelDownloadOnClose) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult GetDialog (nsIDOMWindow* aDialog) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult SetDialog (nsIDOMWindow aDialog) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* nsIWebProgressListener */
+
+extern(System)
+nsresult OnStateChange (nsIWebProgress aWebProgress, nsIRequest aRequest, PRUint32 aStateFlags, nsresult aStatus) {
+    if ((aStateFlags & nsIWebProgressListener.STATE_STOP) !is 0) {
+        if (helperAppLauncher !is null) helperAppLauncher.Release ();
+        helperAppLauncher = null;
+        if (shell !is null && !shell.isDisposed ()) shell.dispose ();
+        shell = null;
+    }
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult OnProgressChange (nsIWebProgress aWebProgress, nsIRequest aRequest, PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress) {
+    int currentKBytes = aCurTotalProgress / 1024;
+    int totalKBytes = aMaxTotalProgress / 1024;
+    if (shell !is null && !shell.isDisposed ()) {
+        //Object[] arguments = {new Integer (currentKBytes), new Integer (totalKBytes)};
+        //String statusMsg = Compatibility.getMessage ("SWT_Download_Status", arguments); //$NON-NLS-1$
+        status.setText (Format("Download: {0} KB of {1} KB", currentKBytes, totalKBytes));
+        shell.layout (true);
+        shell.getDisplay ().update ();
+    }
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult OnLocationChange (nsIWebProgress aWebProgress, nsIRequest aRequest, nsIURI aLocation) {
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult OnStatusChange (nsIWebProgress aWebProgress, nsIRequest aRequest, nsresult aStatus, PRUnichar* aMessage) {
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult OnSecurityChange (nsIWebProgress aWebProgress, nsIRequest aRequest, PRUint32 state) {
+    return XPCOM.NS_OK;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/DownloadFactory.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+module org.eclipse.swt.browser.DownloadFactory;
+
+import java.lang.all;
+
+//import org.eclipse.swt.internal.C;
+import XPCOM = org.eclipse.swt.internal.mozilla.XPCOM;
+import org.eclipse.swt.internal.mozilla.Common;
+//import org.eclipse.swt.internal.mozilla.XPCOMObject;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsIFactory;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.browser.Download;
+
+class DownloadFactory : nsIFactory {
+    int refCount = 0;
+
+this () {}
+
+extern(System)
+nsrefcnt AddRef () {
+    refCount++;
+    return refCount;
+}
+
+extern(System)
+nsresult QueryInterface (nsID* riid, void** ppvObject) {
+    if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
+    
+    if (*riid == nsISupports.IID) {
+        *ppvObject = cast(void*)cast(nsISupports)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsIFactory.IID) {
+        *ppvObject = cast(void*)cast(nsIFactory)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    
+    *ppvObject = null;
+    return XPCOM.NS_ERROR_NO_INTERFACE;
+}
+
+extern(System)
+nsrefcnt Release () {
+    refCount--;
+    //if (refCount is 0) disposeCOMInterfaces ();
+    return refCount;
+}
+    
+/* nsIFactory */
+
+extern(System)
+nsresult CreateInstance (nsISupports aOuter, nsID* iid, void** result) {
+    if (result is null) 
+        return XPCOM.NS_ERROR_INVALID_ARG;
+    auto download = new Download();
+    nsresult rv = download.QueryInterface( iid, result );
+    if (XPCOM.NS_FAILED(rv)) {
+        *result = null;
+        delete download;
+    }
+    return rv;
+}
+
+extern(System)
+nsresult LockFactory (int lock) {
+    return XPCOM.NS_OK;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/DownloadFactory_1_8.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.DownloadFactory_1_8;
+
+import java.lang.all;
+
+//import org.eclipse.swt.internal.C;
+import XPCOM = org.eclipse.swt.internal.mozilla.XPCOM;
+import org.eclipse.swt.internal.mozilla.Common;
+//import org.eclipse.swt.internal.mozilla.XPCOMObject;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsIFactory;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.browser.Download_1_8;
+
+class DownloadFactory_1_8 : nsIFactory {
+    //XPCOMObject supports;
+    //XPCOMObject factory;
+    int refCount = 0;
+
+this () {
+    //createCOMInterfaces ();
+}
+
+extern(System)
+nsrefcnt AddRef () {
+    refCount++;
+    return refCount;
+}
+
+extern(System)
+nsresult QueryInterface (nsIID* riid, void** ppvObject) {
+    if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
+    //nsID guid = new nsID ();
+    //XPCOM.memmove (guid, riid, nsID.sizeof);
+    
+    if (*riid == nsISupports.IID) {
+        *ppvObject = cast(void*)cast(nsISupports)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsIFactory.IID) {
+        *ppvObject = cast(void*)cast(nsIFactory)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    
+    *ppvObject = null;
+    return XPCOM.NS_ERROR_NO_INTERFACE;
+}
+
+extern(System)
+nsrefcnt Release () {
+    refCount--;
+    //if (refCount is 0) disposeCOMInterfaces ();
+    return refCount;
+}
+
+/* nsIFactory */
+
+extern(System)
+nsresult CreateInstance (nsISupports aOuter, nsIID* iid, void** result) {
+    if (result is null) 
+        return XPCOM.NS_ERROR_INVALID_ARG;
+    auto download = new Download_1_8;
+    nsresult rv = download.QueryInterface( iid, result );
+    if (XPCOM.NS_FAILED(rv)) {
+        *result = null;
+        delete download;
+    }
+    return rv;
+}
+
+extern(System)
+nsresult LockFactory (PRBool lock) {
+    return XPCOM.NS_OK;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/Download_1_8.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,333 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.Download_1_8;
+
+import java.lang.all;
+import tango.text.convert.Format;
+
+import org.eclipse.swt.SWT;
+
+import XPCOM = org.eclipse.swt.internal.mozilla.XPCOM;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.prtime;
+import org.eclipse.swt.internal.mozilla.nsICancelable;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsIDownload_1_8;
+import org.eclipse.swt.internal.mozilla.nsIProgressDialog_1_8;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsIURI;
+import org.eclipse.swt.internal.mozilla.nsIWebProgressListener;
+import org.eclipse.swt.internal.mozilla.nsIMIMEInfo;
+import org.eclipse.swt.internal.mozilla.nsIObserver;
+import org.eclipse.swt.internal.mozilla.nsIDOMWindow;
+import org.eclipse.swt.internal.mozilla.nsIWebProgress;
+import org.eclipse.swt.internal.mozilla.nsIRequest;
+import org.eclipse.swt.internal.mozilla.nsILocalFile;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+import org.eclipse.swt.internal.mozilla.nsEmbedString;
+
+import org.eclipse.swt.browser.Mozilla;
+
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+
+class Download_1_8 : nsIProgressDialog_1_8 {
+    nsICancelable cancelable;
+    int refCount = 0;
+
+    Shell shell;
+    Label status;
+    Button cancel;
+
+    //static final bool is32 = C.PTR_SIZEOF is 4; //determine if 32 or 64 bit platform?
+
+this () {
+}
+
+extern(System)
+nsrefcnt AddRef () {
+    refCount++;
+    return refCount;
+}
+
+extern(System)
+nsresult QueryInterface ( nsID* riid, void** ppvObject) {
+    if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
+   
+    if (*riid == nsISupports.IID) {
+        *ppvObject = cast(void*)cast(nsISupports)this;
+        AddRef();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsIDownload_1_8.IID) {
+        *ppvObject = cast(void*)cast(nsIDownload_1_8)this;
+        AddRef();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsIProgressDialog_1_8.IID) {
+        *ppvObject = cast(void*)cast(nsIProgressDialog_1_8)this;
+        AddRef();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsIWebProgressListener.IID) {
+        *ppvObject = cast(void*)cast(nsIWebProgressListener)this;
+        AddRef();
+        return XPCOM.NS_OK;
+    }
+    *ppvObject = null;
+    return XPCOM.NS_ERROR_NO_INTERFACE;
+}
+
+extern(System)
+nsrefcnt Release () {
+    refCount--;
+    if (refCount is 0) return 0;
+    return refCount;
+}
+
+/* nsIDownload */
+
+/* Note. The argument startTime is defined as a PRInt64. This translates into two java ints. */
+extern(System)
+nsresult Init_32 (nsIURI aSource, nsIURI aTarget, nsAString* aDisplayName, nsIMIMEInfo aMIMEInfo, PRInt32 startTime1, PRInt32 startTime2, nsILocalFile aTempFile, nsICancelable aCancelable) {
+    long startTime = (startTime2 << 32) + startTime1;
+    return Init (aSource, aTarget, aDisplayName, aMIMEInfo, startTime, aTempFile, aCancelable);
+}
+
+// FIXME: I've hardcoded the string values in place of Compatibility.getMessage calls in 
+// the Init method; this will need fixing in future releases. -JJR
+extern(System)
+nsresult Init (nsIURI aSource, nsIURI aTarget, nsAString* aDisplayName, nsIMIMEInfo aMIMEInfo, PRTime startTime, nsILocalFile aTempFile, nsICancelable aCancelable) {
+    cancelable = aCancelable;
+    // nsIURI source = new nsIURI (aSource);
+    scope auto aSpec = new nsEmbedCString;
+    int rc = aSource.GetHost (cast(nsACString*)aSpec);
+    if (rc !is XPCOM.NS_OK) Mozilla.error(rc,__FILE__,__LINE__);
+    //int length = XPCOM.nsEmbedCString_Length (aSpec);
+    //int /*long*/ buffer = XPCOM.nsEmbedCString_get (aSpec);
+    //byte[] dest = new byte[length];
+    //XPCOM.memmove (dest, buffer, length);
+    //XPCOM.nsEmbedCString_delete (aSpec);
+    String url = aSpec.toString;
+
+    //nsIURI target = new nsIURI (aTarget);
+    scope auto aPath = new nsEmbedCString;
+    rc = aTarget.GetPath (cast(nsACString*)aPath);
+    if (rc !is XPCOM.NS_OK) Mozilla.error (rc);
+    //length = XPCOM.nsEmbedCString_Length (aPath);
+    //buffer = XPCOM.nsEmbedCString_get (aPath);
+    //dest = new byte[length];
+    //XPCOM.memmove (dest, buffer, length);
+    //XPCOM.nsEmbedCString_delete (aPath);
+    String filename = aPath.toString;
+    //int separator = locatePrior(filename, System.getProperty ("file.separator"));
+    int separator = filename.lastIndexOf (System.getProperty ("file.separator"));   //$NON-NLS-1$
+    // NOTE: Not sure if this is correct; watch out for bugs here. -JJR
+    filename = filename.substring (separator + 1);
+
+    Listener listener = new class() Listener {
+        public void handleEvent (Event event) {
+            if (event.widget is cancel) {
+                shell.close ();
+            }
+            if (cancelable !is null) {
+                int rc = cancelable.Cancel (XPCOM.NS_BINDING_ABORTED);
+                if (rc !is XPCOM.NS_OK) Mozilla.error (rc,__FILE__,__LINE__);
+            }
+            shell = null;
+            cancelable = null;
+        }
+    };
+    shell = new Shell (SWT.DIALOG_TRIM);
+// FIXME: A working Compatibility.getMessage has not been ported yet
+// Strings hardcoded for now.
+    //String msg = Compatibility.getMessage ("SWT_Download_File", new Object[] {filename}); //$NON-NLS-1$
+    shell.setText ("Download: " ~ filename);
+    GridLayout gridLayout = new GridLayout ();
+    gridLayout.marginHeight = 15;
+    gridLayout.marginWidth = 15;
+    gridLayout.verticalSpacing = 20;
+    shell.setLayout (gridLayout);
+    //msg = Compatibility.getMessage ("SWT_Download_Location", new Object[] {filename, url}); //$NON-NLS-1$
+    auto lbl = new Label (shell, SWT.SIMPLE);
+    lbl.setText ("Saving " ~ filename ~ " from " ~ url );
+    status = new Label (shell, SWT.SIMPLE);
+    //msg = Compatibility.getMessage ("SWT_Download_Started"); //$NON-NLS-1$
+    status.setText ("Downloading...");
+    GridData data = new GridData ();
+    data.grabExcessHorizontalSpace = true;
+    data.grabExcessVerticalSpace = true;
+    status.setLayoutData (data);
+    
+    cancel = new Button (shell, SWT.PUSH);
+    cancel.setText( "Cancel" ); 
+    //cancel.setText (SWT.getMessage ("SWT_Cancel")); //$NON-NLS-1$
+    data = new GridData ();
+    data.horizontalAlignment = GridData.CENTER;
+    cancel.setLayoutData (data);
+    cancel.addListener (SWT.Selection, listener);
+    shell.addListener (SWT.Close, listener);
+    shell.pack ();
+    shell.open ();
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult GetAmountTransferred (PRUint64* arg0) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult GetCancelable (nsICancelable* arg0) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult GetDisplayName (PRUnichar** aDisplayName) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult GetMIMEInfo (nsIMIMEInfo* aMIMEInfo) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult GetPercentComplete (PRInt32* aPercentComplete) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult GetSize (PRUint64* arg0) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult GetSource (nsIURI* aSource) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult GetStartTime (PRInt64* aStartTime) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult GetTarget (nsIURI* aTarget) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult GetTargetFile (nsILocalFile* arg0) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* nsIProgressDialog */
+
+extern(System)
+nsresult GetCancelDownloadOnClose (PRBool* aCancelDownloadOnClose) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult GetDialog (nsIDOMWindow* aDialog) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult GetObserver (nsIObserver* aObserver) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult Open (nsIDOMWindow aParent) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult SetCancelDownloadOnClose (PRBool aCancelDownloadOnClose) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult SetDialog (nsIDOMWindow aDialog) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult SetObserver (nsIObserver aObserver) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* nsIWebProgressListener */
+
+extern(System)
+nsresult OnLocationChange (nsIWebProgress aWebProgress, nsIRequest aRequest, nsIURI aLocation) {
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult OnProgressChange (nsIWebProgress aWebProgress, nsIRequest aRequest, PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress) {
+    return OnProgressChange64 (aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress);
+}
+/++
+/* Note. The last 4 args in the original interface are defined as PRInt64. These each translate into two java ints. */
+nsresult OnProgressChange64_32 (int /*long*/ aWebProgress, int /*long*/ aRequest, int /*long*/ aCurSelfProgress1, int /*long*/ aCurSelfProgress2, int /*long*/ aMaxSelfProgress1, int /*long*/ aMaxSelfProgress2, int /*long*/ aCurTotalProgress1, int /*long*/ aCurTotalProgress2, int /*long*/ aMaxTotalProgress1, int /*long*/ aMaxTotalProgress2) {
+    long aCurSelfProgress = (aCurSelfProgress2 << 32) + aCurSelfProgress1;
+    long aMaxSelfProgress = (aMaxSelfProgress2 << 32) + aMaxSelfProgress1;
+    long aCurTotalProgress = (aCurTotalProgress2 << 32) + aCurTotalProgress1;
+    long aMaxTotalProgress = (aMaxTotalProgress2 << 32) + aMaxTotalProgress1;
+    return OnProgressChange64 (aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress);
+}
+++/
+extern(System)
+nsresult OnProgressChange64 (nsIWebProgress aWebProgress, nsIRequest aRequest, PRInt64 aCurSelfProgress, PRInt64 aMaxSelfProgress, PRInt64 aCurTotalProgress, PRInt64 aMaxTotalProgress) {
+    long currentKBytes = aCurTotalProgress / 1024;
+    long totalKBytes = aMaxTotalProgress / 1024;
+    if (shell !is null && !shell.isDisposed ()) {
+        //Object[] arguments = {new Long (currentKBytes), new Long (totalKBytes)};
+        //String statusMsg = Compatibility.getMessage ("SWT_Download_Status", arguments); //$NON-NLS-1$
+        String statusMsg = Format("Download:  {0} KB of {1} KB", currentKBytes, totalKBytes); 
+        status.setText (statusMsg);
+        shell.layout (true);
+        shell.getDisplay ().update ();
+    }
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult OnSecurityChange (nsIWebProgress aWebProgress, nsIRequest aRequest, PRUint32 state) {
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult OnStateChange (nsIWebProgress aWebProgress, nsIRequest aRequest, PRUint32 aStateFlags, nsresult aStatus) {
+    if ((aStateFlags & nsIWebProgressListener.STATE_STOP) !is 0) {
+        cancelable = null;
+        if (shell !is null && !shell.isDisposed ()) shell.dispose ();
+        shell = null;
+    }
+    return XPCOM.NS_OK;
+}   
+
+extern(System)
+nsresult OnStatusChange (nsIWebProgress aWebProgress, nsIRequest aRequest, nsresult aStatus, PRUnichar* aMessage) {
+    return XPCOM.NS_OK;
+}       
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/FilePicker.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,273 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.FilePicker;
+
+import java.lang.all;
+
+import org.eclipse.swt.SWT;
+
+import XPCOM = org.eclipse.swt.internal.mozilla.XPCOM;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsEmbedString;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsIFilePicker;
+import org.eclipse.swt.internal.mozilla.nsIFilePicker_1_8;
+import org.eclipse.swt.internal.mozilla.nsILocalFile;
+import org.eclipse.swt.internal.mozilla.nsIFileURL;
+import org.eclipse.swt.internal.mozilla.nsIDOMWindow;
+import org.eclipse.swt.internal.mozilla.nsISimpleEnumerator;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+import org.eclipse.swt.browser.Mozilla;
+
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Shell;
+
+class FilePicker : nsIFilePicker {
+
+    int refCount = 0;
+    short mode;
+    nsIDOMWindow parentHandle;
+    String[] files, masks;
+    String defaultFilename, directory, title;
+
+    static String SEPARATOR(){
+        return System.getProperty ("file.separator"); //$NON-NLS-1$
+    }
+
+this () {
+}
+
+extern(System)
+nsrefcnt AddRef () {
+    refCount++;
+    return refCount;
+}
+
+extern(System)
+nsresult QueryInterface (nsID* riid, void** ppvObject) {
+    if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
+    
+    if (*riid == nsISupports.IID) {
+        *ppvObject = cast(void*)cast(nsISupports) this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsIFilePicker.IID) {
+        *ppvObject = cast(void*)cast(nsIFilePicker) this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }   
+    if (*riid == nsIFilePicker_1_8.IID) {
+        *ppvObject = cast(void*)cast(nsIFilePicker_1_8) this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    *ppvObject = null; 
+    return XPCOM.NS_ERROR_NO_INTERFACE;
+}
+    
+extern(System)
+nsrefcnt Release () {
+    refCount--;
+    if (refCount is 0) return 0;
+    return refCount;
+}
+
+/*
+ * As of Mozilla 1.8 some of nsIFilePicker's string arguments changed type.  This method
+ * answers a java string based on the type of string that is appropriate for the Mozilla
+ * version being used.
+ */
+extern(D)
+String parseAString (nsAString* string) {
+    return null;
+}
+
+/* nsIFilePicker */
+
+extern(System)
+nsresult Init (nsIDOMWindow parent, nsAString* title, PRInt16 mode) {
+    parentHandle = parent;
+    this.mode = mode;
+    this.title = parseAString (title);
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult Show (PRInt16* _retval) {
+    if (mode is nsIFilePicker.modeGetFolder) {
+        /* picking a directory */
+        int result = showDirectoryPicker ();
+        *_retval = cast(int)cast(PRInt16)result; /* PRInt16 */
+        return XPCOM.NS_OK;
+    }
+
+    /* picking a file */
+    int style = mode is nsIFilePicker.modeSave ? SWT.SAVE : SWT.OPEN;
+    if (mode is nsIFilePicker.modeOpenMultiple) style |= SWT.MULTI;
+    Display display = Display.getCurrent ();
+    Shell parent = null; // TODO compute parent
+    if (parent is null) {
+        parent = new Shell (display);
+    }
+    FileDialog dialog = new FileDialog (parent, style);
+    if (title !is null) dialog.setText (title);
+    if (directory !is null) dialog.setFilterPath (directory);
+    if (masks !is null) dialog.setFilterExtensions (masks);
+    if (defaultFilename !is null) dialog.setFileName (defaultFilename);
+    String filename = dialog.open ();
+    files = dialog.getFileNames ();
+    directory = dialog.getFilterPath ();
+    title = defaultFilename = null;
+    masks = null;
+    int result = filename is null ? nsIFilePicker.returnCancel : nsIFilePicker.returnOK; 
+    *_retval = cast(int)cast(short)result;; /* PRInt16 */
+    return XPCOM.NS_OK;
+}
+
+int showDirectoryPicker () {
+    Display display = Display.getCurrent ();
+    Shell parent = null; // TODO compute parent
+    if (parent is null) {
+        parent = new Shell (display);
+    }
+    DirectoryDialog dialog = new DirectoryDialog (parent, SWT.NONE);
+    if (title !is null) dialog.setText (title);
+    if (directory !is null) dialog.setFilterPath (directory);
+    directory = dialog.open ();
+    title = defaultFilename = null;
+    files = masks = null;
+    return directory is null ? nsIFilePicker.returnCancel : nsIFilePicker.returnOK;
+}
+
+extern(System)
+nsresult GetFiles (nsISimpleEnumerator* aFiles) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult GetFileURL ( nsIFileURL* aFileURL ) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult GetFile (nsILocalFile* aFile) {
+    String filename = "";   //$NON-NLS-1$
+    if (directory !is null) filename ~= directory ~ SEPARATOR;
+    if (files !is null && files.length > 0) filename ~= files[0];
+    scope auto path = new nsEmbedString (toWCharArray(filename));
+    int rc = XPCOM.NS_NewLocalFile (cast(nsAString*)path, 1, aFile);
+    if (rc !is XPCOM.NS_OK) Mozilla.error (rc);
+    if (aFile is null) Mozilla.error (XPCOM.NS_ERROR_NULL_POINTER);
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult SetDisplayDirectory (nsILocalFile aDisplayDirectory) {
+    if (aDisplayDirectory is null) return XPCOM.NS_OK;
+    scope auto pathname = new nsEmbedCString();
+    aDisplayDirectory.GetNativePath (cast(nsACString*)pathname);
+    // wchar[] chars = MozillaDelegate.mbcsToWcs (null, bytes);
+    directory = pathname.toString;
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult GetDisplayDirectory (nsILocalFile* aDisplayDirectory) {
+    String directoryName = directory !is null ? directory : ""; //$NON-NLS-1$
+    scope auto path = new nsEmbedString (toWCharArray(directoryName));
+    int rc = XPCOM.NS_NewLocalFile (cast(nsAString*)path, 1, aDisplayDirectory);
+    if (rc !is XPCOM.NS_OK) Mozilla.error (rc);
+    if (aDisplayDirectory is null) Mozilla.error (XPCOM.NS_ERROR_NULL_POINTER);
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult SetFilterIndex (PRInt32 aFilterIndex) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult GetFilterIndex (PRInt32* aFilterIndex) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult SetDefaultExtension (nsAString* aDefaultExtension) {
+    /* note that the type of argument 1 changed as of Mozilla 1.8 */
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult GetDefaultExtension (nsAString* aDefaultExtension) {
+    /* note that the type of argument 1 changed as of Mozilla 1.8 */
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult SetDefaultString (nsAString* aDefaultString) {
+    defaultFilename = parseAString (aDefaultString);
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult GetDefaultString (nsAString* aDefaultString) {
+    /* note that the type of argument 1 changed as of Mozilla 1.8 */
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult AppendFilter (nsAString* title, nsAString* filter) {
+    /* note that the type of arguments 1 and 2 changed as of Mozilla 1.8 */
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult AppendFilters (PRInt32 filterMask) {
+    String[] addFilters = null;
+    switch (filterMask) {
+        case nsIFilePicker.filterAll:
+        case nsIFilePicker.filterApps:
+            masks = null;           /* this is equivalent to no filter */
+            break;
+        case nsIFilePicker.filterHTML:
+            addFilters[0] = "*.htm;*.html"; //$NON-NLS-1$
+            break;
+        case nsIFilePicker.filterImages:
+            addFilters[0] = "*.gif;*.jpeg;*.jpg;*.png"; //$NON-NLS-1$
+            break;
+        case nsIFilePicker.filterText:
+            addFilters[0] = "*.txt";    //$NON-NLS-1$
+            break;
+        case nsIFilePicker.filterXML:
+            addFilters[0] = "*.xml";    //$NON-NLS-1$
+            break;
+        case nsIFilePicker.filterXUL:
+            addFilters[0] = "*.xul";    //$NON-NLS-1$
+            break;
+    }
+    if (masks is null) {
+        masks = addFilters;
+    } else {
+        if (addFilters !is null) {
+            masks ~= addFilters;
+        }
+    }
+    return XPCOM.NS_OK;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/FilePickerFactory.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.FilePickerFactory;
+
+import java.lang.all;
+
+//import org.eclipse.swt.internal.C;
+import XPCOM = org.eclipse.swt.internal.mozilla.XPCOM;
+//import org.eclipse.swt.internal.mozilla.XPCOMObject;
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsIFactory;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.browser.FilePicker;
+
+class FilePickerFactory : nsIFactory {
+    //XPCOMObject supports;
+    //XPCOMObject factory;
+    int refCount = 0;
+
+this () { }
+
+extern(System)
+nsrefcnt AddRef () {
+    refCount++;
+    return refCount;
+}
+
+extern(System)
+nsresult QueryInterface (nsID* riid, void** ppvObject) {
+    if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
+    //nsID guid = new nsID ();
+    //XPCOM.memmove (guid, riid, nsID.sizeof);
+    
+    if (*riid == nsISupports.IID) {
+        *ppvObject = cast(void*)cast(nsISupports)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsIFactory.IID) {
+        *ppvObject = cast(void*)cast(nsIFactory)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    
+    *ppvObject = null;
+    return XPCOM.NS_ERROR_NO_INTERFACE;
+}
+
+extern(System)
+nsrefcnt Release () {
+    refCount--;
+    //if (refCount is 0) disposeCOMInterfaces ();
+    return refCount;
+}
+    
+/* nsIFactory */
+
+extern(System)
+nsresult CreateInstance (nsISupports aOuter, nsID* iid, void** result) { 
+     if (result is null) 
+        return XPCOM.NS_ERROR_INVALID_ARG;
+    auto picker = new FilePicker;
+    nsresult rv = picker.QueryInterface( iid, result );
+    if (XPCOM.NS_FAILED(rv)) {
+        *result = null;
+        delete picker;
+    }
+    return rv;
+}
+
+extern(System)
+nsresult LockFactory (PRBool lock) {
+    return XPCOM.NS_OK;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/FilePickerFactory_1_8.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.FilePickerFactory_1_8;
+
+import java.lang.all;
+
+import XPCOM = org.eclipse.swt.internal.mozilla.XPCOM;
+import org.eclipse.swt.browser.FilePickerFactory;
+import org.eclipse.swt.browser.FilePicker_1_8;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+
+class FilePickerFactory_1_8 : FilePickerFactory {
+
+extern(System)
+nsresult CreateInstance (nsISupports aOuter, nsID* iid, void** result) { 
+     if (result is null) 
+        return XPCOM.NS_ERROR_INVALID_ARG;
+    auto picker = new FilePicker_1_8;
+    nsresult rv = picker.QueryInterface( iid, result );
+    if (XPCOM.NS_FAILED(rv)) {
+        *result = null;
+        delete picker;
+    }
+    return rv;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/FilePicker_1_8.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.FilePicker_1_8;
+
+import java.lang.all;
+
+import org.eclipse.swt.browser.FilePicker;
+import XPCOM = org.eclipse.swt.internal.mozilla.XPCOM;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+class FilePicker_1_8 : FilePicker {
+
+extern(D)
+String parseAString (nsAString* string) {
+    if (string is null) return null;
+    return nsAString.toString(string);
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/HelperAppLauncherDialog.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,206 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.HelperAppLauncherDialog;
+
+import java.lang.all;
+
+import Utf = tango.text.convert.Utf;
+
+import org.eclipse.swt.SWT;
+
+import XPCOM = org.eclipse.swt.internal.mozilla.XPCOM;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsEmbedString;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsIHelperAppLauncher;
+import org.eclipse.swt.internal.mozilla.nsIHelperAppLauncherDialog;
+import org.eclipse.swt.internal.mozilla.nsIHelperAppLauncher_1_8;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsILocalFile;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+import org.eclipse.swt.browser.Mozilla;
+
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * This class implements the HelperAppLauncherDialog interface for mozilla
+ * versions 1.4 - 1.8.x.  For mozilla versions >= 1.9 this interface is
+ * implemented by class HelperAppLauncherDialog_1_9.  HelperAppLauncherDialogFactory
+ * determines at runtime which of these classes to instantiate. 
+ */
+
+class HelperAppLauncherDialog : nsIHelperAppLauncherDialog {
+    int refCount = 0;
+
+this() {
+}
+
+extern(System)
+nsrefcnt AddRef () {
+    refCount++;
+    return refCount;
+}
+
+extern(System)
+nsresult QueryInterface (nsID* riid, void** ppvObject) {
+    if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
+    
+    if (*riid == nsISupports.IID) {
+        *ppvObject = cast(void*)cast(nsISupports)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsIHelperAppLauncherDialog.IID) {
+        *ppvObject = cast(void*)cast(nsIHelperAppLauncherDialog)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    
+    *ppvObject = null;
+    return XPCOM.NS_ERROR_NO_INTERFACE;
+}
+
+extern(System)
+nsrefcnt Release () {
+    refCount--;
+    /*
+    * Note.  This instance lives as long as the download it is binded to.
+    * Its reference count is expected to go down to 0 when the download
+    * has completed or when it has been cancelled. E.g. when the user
+    * cancels the File Dialog, cancels or closes the Download Dialog
+    * and when the Download Dialog goes away after the download is completed.
+    */
+    if (refCount is 0) return 0;
+    return refCount;
+}
+
+/* nsIHelperAppLauncherDialog */
+
+extern(System)
+nsresult Show(nsIHelperAppLauncher aLauncher, nsISupports aContext, PRUint32 aReason) {
+     /*
+     * The interface for nsIHelperAppLauncher changed as of mozilla 1.8.  Query the received
+     * nsIHelperAppLauncher for the new interface, and if it is not found then fall back to
+     * the old interface. 
+     */
+
+    nsISupports supports = cast(nsISupports)aLauncher;
+    nsIHelperAppLauncher_1_8 helperAppLauncher;
+    nsresult rc = supports.QueryInterface (&nsIHelperAppLauncher_1_8.IID, cast(void**)&helperAppLauncher);
+    if (rc is 0) {
+        rc = helperAppLauncher.SaveToDisk (null, 0);
+        helperAppLauncher.Release ();
+        return rc;
+    }
+
+    /* < 1.8 */
+    return aLauncher.SaveToDisk (null, 0);
+    // no Release for this? -JJR
+}
+
+extern(System)
+nsresult PromptForSaveToFile (nsIHelperAppLauncher aLauncher, nsISupports aWindowContext, PRUnichar* aDefaultFile, PRUnichar* aSuggestedFileExtension, nsILocalFile* _retval) {
+    bool hasLauncher = false;
+
+    /*
+    * The interface for nsIHelperAppLauncherDialog changed as of mozilla 1.5 when an
+    * extra argument was added to the PromptForSaveToFile method (this resulted in all
+    * subsequent arguments shifting right).  The workaround is to provide an XPCOMObject 
+    * that fits the newer API, and to use the first argument's type to infer whether
+    * the old or new nsIHelperAppLauncherDialog interface is being used (and by extension
+    * the ordering of the arguments).  In mozilla >= 1.5 the first argument is an
+    * nsIHelperAppLauncher. 
+    */
+    /*
+     * The interface for nsIHelperAppLauncher changed as of mozilla 1.8, so the first
+     * argument must be queried for both the old and new nsIHelperAppLauncher interfaces. 
+     */
+    bool using_1_8 = false;
+    nsISupports support = cast(nsISupports)aLauncher; 
+    
+    if (aLauncher is null)
+        assert(0);
+
+    nsIHelperAppLauncher_1_8 helperAppLauncher1;
+    int rc = support.QueryInterface (&nsIHelperAppLauncher_1_8.IID, cast(void**)&helperAppLauncher1);
+    if (rc is XPCOM.NS_OK) {
+        using_1_8 = true;
+        hasLauncher = true;
+        helperAppLauncher1.Release ();
+    } else {
+        nsIHelperAppLauncher helperAppLauncher;
+        rc = support.QueryInterface (&nsIHelperAppLauncher.IID, cast(void**)&helperAppLauncher);
+        if (rc is XPCOM.NS_OK) {
+            hasLauncher = true;
+            helperAppLauncher.Release;
+        }
+    }
+
+/+
+    // In D port, no suppport for version >1.4 yet
+    if (hasLauncher) {  /* >= 1.5 */
+        aDefaultFile = arg2;
+        aSuggestedFileExtension = arg3;
+        _retval = arg4;
+    } else {            /* 1.4 */  
+    // This call conversion probablywon't work for non-Java
+    // and shouldn't get called; fix it later. -JJR
+        aDefaultFile = arg1;
+        aSuggestedFileExtension = arg2;
+        _retval = arg3;
+    }
++/
+    //int span = XPCOM.strlen_PRUnichar (aDefaultFile);
+    // XPCOM.memmove (dest, aDefaultFile, length * 2);
+    String defaultFile = Utf.toString(fromString16z(aDefaultFile));
+
+    //span = XPCOM.strlen_PRUnichar (aSuggestedFileExtension);
+    //dest = new char[length];
+    //XPCOM.memmove (dest, aSuggestedFileExtension, length * 2);
+    String suggestedFileExtension =  Utf.toString(fromString16z(aSuggestedFileExtension));
+
+    Shell shell = new Shell ();
+    FileDialog fileDialog = new FileDialog (shell, SWT.SAVE);
+    fileDialog.setFileName (defaultFile);
+    String[] tmp;
+    tmp ~= suggestedFileExtension; 
+    fileDialog.setFilterExtensions (tmp);
+    String name = fileDialog.open ();
+    shell.close ();
+    if (name is null) {
+        if (hasLauncher) {
+            if (using_1_8) {
+                rc = (cast(nsIHelperAppLauncher_1_8)aLauncher).Cancel (XPCOM.NS_BINDING_ABORTED);
+            } else {
+                rc = aLauncher.Cancel ();
+            }
+            if (rc !is XPCOM.NS_OK) Mozilla.error (rc,__FILE__,__LINE__); 
+            return XPCOM.NS_OK;
+        }
+        return XPCOM.NS_ERROR_FAILURE;
+    }
+    scope auto path = new nsEmbedString (name.toWCharArray());
+    nsILocalFile localFile;
+    rc = XPCOM.NS_NewLocalFile (cast(nsAString*)path, 1, &localFile);
+    //path.dispose ();
+    if (rc !is XPCOM.NS_OK) Mozilla.error (rc,__FILE__,__LINE__);
+    if (localFile is null) Mozilla.error (XPCOM.NS_ERROR_NULL_POINTER,__FILE__,__LINE__);
+    /* Our own nsIDownload has been registered during the Browser initialization. It will be invoked by Mozilla. */
+    *_retval = localFile; 
+    //XPCOM.memmove (_retval, result, C.PTR_SIZEOF);  
+    return XPCOM.NS_OK;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/HelperAppLauncherDialogFactory.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.HelperAppLauncherDialogFactory;
+
+import java.lang.all;
+
+import XPCOM = org.eclipse.swt.internal.mozilla.XPCOM;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsIFactory;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.browser.HelperAppLauncherDialog;
+import org.eclipse.swt.browser.HelperAppLauncherDialog_1_9;
+
+class HelperAppLauncherDialogFactory : nsIFactory {
+    int refCount = 0;
+    bool isPre_1_9 = true;
+
+
+this () {
+}
+
+extern(System)
+nsrefcnt AddRef () {
+    refCount++;
+    return refCount;
+}
+
+extern(System)
+nsresult QueryInterface (nsID* riid, void** ppvObject) {
+    if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
+    
+    if (*riid == nsISupports.IID) {
+        *ppvObject = cast(void*)cast(nsISupports)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsIFactory.IID) {
+        *ppvObject = cast(void*)cast(nsIFactory)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    
+    *ppvObject = null;
+    return XPCOM.NS_ERROR_NO_INTERFACE;
+}
+
+extern(System)
+nsrefcnt Release () {
+    refCount--;
+    if (refCount is 0) return 0;
+    return refCount;
+}
+
+/* nsIFactory */
+
+extern(System)
+nsresult CreateInstance (nsISupports aOuter, nsID* iid, void** result) { 
+    if (isPre_1_9) {
+        if (result is null) 
+            return XPCOM.NS_ERROR_INVALID_ARG;
+        auto helperAppLauncherDialog = new HelperAppLauncherDialog;
+        nsresult rv = helperAppLauncherDialog.QueryInterface( iid, result );
+        if (XPCOM.NS_FAILED(rv)) {
+            *result = null;
+            delete helperAppLauncherDialog;
+        } else {
+            if (result is null) 
+                return XPCOM.NS_ERROR_INVALID_ARG;
+            auto helperAppLauncherDialog19 = new HelperAppLauncherDialog_1_9;
+            rv = helperAppLauncherDialog19.QueryInterface( iid, result );
+            if (XPCOM.NS_FAILED(rv)) {
+                *result = null;
+                delete helperAppLauncherDialog19;
+            }
+            return rv;
+        }
+    }
+}
+
+extern(System)
+nsresult LockFactory (PRBool lock) {
+    return XPCOM.NS_OK;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/HelperAppLauncherDialog_1_9.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Ported to the D Programming Language:
+ *     John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.HelperAppLauncherDialog_1_9;
+
+import tango.text.convert.Utf;
+import java.lang.all;
+
+import org.eclipse.swt.SWT;
+
+import org.eclipse.swt.internal.mozilla.Common;
+
+import XPCOM = org.eclipse.swt.internal.mozilla.XPCOM;
+
+import org.eclipse.swt.internal.mozilla.nsEmbedString;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsIHelperAppLauncherDialog_1_9;
+import org.eclipse.swt.internal.mozilla.nsIHelperAppLauncher_1_9;
+import org.eclipse.swt.internal.mozilla.nsILocalFile;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+import org.eclipse.swt.internal.mozilla.nsEmbedString;
+
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Shell;
+
+import org.eclipse.swt.browser.Mozilla;
+
+class HelperAppLauncherDialog_1_9 : nsIHelperAppLauncherDialog_1_9 {
+
+    int refCount = 0;
+
+this () {
+}
+
+extern(System)
+nsrefcnt AddRef () {
+    refCount++;
+    return refCount;
+}
+
+extern(System)
+nsresult QueryInterface (nsID* riid, void** ppvObject) {
+    if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
+
+    if (*riid is nsISupports.IID) {
+        *ppvObject = cast(void*)cast(nsIHelperAppLauncherDialog_1_9)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    if (*riid is nsIHelperAppLauncherDialog_1_9.IID) {
+        *ppvObject = cast(void*)cast(nsIHelperAppLauncherDialog_1_9)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+
+    *ppvObject = null;
+    return XPCOM.NS_ERROR_NO_INTERFACE;
+}
+
+extern(System)          
+nsresult Release () {
+    refCount--;
+    /*
+    * Note.  This instance lives as long as the download it is bound to.
+    * Its reference count is expected to go down to 0 when the download
+    * has completed or when it has been cancelled. E.g. when the user
+    * cancels the File Dialog, cancels or closes the Download Dialog
+    * and when the Download Dialog goes away after the download is completed.
+    */
+    if (refCount is 0) return 0;
+    return refCount;
+}
+
+/* nsIHelperAppLauncherDialog */
+extern(System)
+nsresult Show (nsIHelperAppLauncher_1_9 aLauncher, nsISupports aContext, PRUint32 aReason) {
+    return aLauncher.SaveToDisk (null, 0);
+}
+
+extern(System)
+nsresult PromptForSaveToFile (nsIHelperAppLauncher_1_9 aLauncher, nsISupports aWindowContext, PRUnichar* aDefaultFileName, PRUnichar* aSuggestedFileExtension, PRBool aForcePrompt, nsILocalFile* _retval) {
+    //int length = XPCOM.strlen_PRUnichar (aDefaultFileName);
+    //char[] dest = new char[length];
+    //XPCOM.memmove (dest, aDefaultFileName, length * 2);
+    String defaultFile = Utf.toString(fromString16z(aDefaultFileName));
+
+    //length = XPCOM.strlen_PRUnichar (aSuggestedFileExtension);
+    //dest = new char[length];
+    //XPCOM.memmove (dest, aSuggestedFileExtension, length * 2);
+    String suggestedFileExtension = Utf.toString(fromString16z(aSuggestedFileExtension));
+
+    Shell shell = new Shell ();
+    FileDialog fileDialog = new FileDialog (shell, SWT.SAVE);
+    fileDialog.setFileName (defaultFile);
+    String[] tmp;
+    tmp ~= suggestedFileExtension; 
+    fileDialog.setFilterExtensions (tmp);
+    String name = fileDialog.open ();
+    shell.close ();
+    if (name is null) {
+        //nsIHelperAppLauncher_1_9 launcher = new nsIHelperAppLauncher_1_9 (aLauncher);
+        int rc = aLauncher.Cancel (XPCOM.NS_BINDING_ABORTED);
+        if (rc !is XPCOM.NS_OK) Mozilla.error (rc,__FILE__,__LINE__);
+        return XPCOM.NS_ERROR_FAILURE;
+    }
+    scope auto path = new nsEmbedString (name.toString16());
+    
+    nsILocalFile localFile;
+    int rc = XPCOM.NS_NewLocalFile (cast(nsAString*)path, 1, &localFile);
+    //path.dispose ();
+    if (rc !is XPCOM.NS_OK) Mozilla.error (rc,__FILE__,__LINE__);
+    if (localFile is null) Mozilla.error (XPCOM.NS_ERROR_NULL_POINTER,__FILE__,__LINE__);
+    /* Our own nsIDownload has been registered during the Browser initialization. It will be invoked by Mozilla. */
+    *_retval = localFile; 
+    //XPCOM.memmove (_retval, result, C.PTR_SIZEOF);  
+    return XPCOM.NS_OK;
+}
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/InputStream.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.InputStream;
+
+import java.lang.all;
+
+import XPCOM = org.eclipse.swt.internal.mozilla.XPCOM;
+
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsIInputStream;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.Common;
+
+class InputStream : nsIInputStream {
+    //XPCOMObject inputStream;
+    int refCount = 0;
+
+    byte[] buffer;
+    int index = 0;
+    
+this (byte[] buffer) {
+    this.buffer = buffer;
+    index = 0;
+}
+
+extern(System)
+nsrefcnt AddRef () {
+    refCount++;
+    return refCount;
+}
+
+extern(System)
+nsresult QueryInterface (nsID* riid, void** ppvObject) {
+    if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
+    //nsID guid = new nsID ();
+    //XPCOM.memmove (guid, riid, nsID.sizeof);
+    
+    if (*riid == nsISupports.IID) {
+        *ppvObject = cast(void*)cast(nsISupports)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsIInputStream.IID) {
+        *ppvObject = cast(void*)cast(nsIInputStream)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }   
+    *ppvObject = null;
+    return XPCOM.NS_ERROR_NO_INTERFACE;
+}
+
+extern(System)
+nsrefcnt Release () {
+    refCount--;
+    //if (refCount is 0) disposeCOMInterfaces ();
+    return refCount;
+}
+
+/* nsIInputStream implementation */
+
+extern(System)
+nsresult Close () {
+    buffer = null;
+    index = 0;
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult Available (PRUint32* _retval) {
+    PRUint32 available = buffer is null ? 0 : buffer.length - index;
+    *_retval = available;
+    //XPCOM.memmove (_retval, new int[] {available}, 4);
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult Read(byte* aBuf, PRUint32 aCount, PRUint32* _retval) {
+    int max = Math.min (aCount, buffer is null ? 0 : buffer.length - index);
+    if (aBuf is null)
+        assert(0);
+    if (max > 0) {
+        //byte[] src = new byte[max];
+        //System.arraycopy (buffer, index, src, 0, max);
+        //XPCOM.memmove (aBuf, src, max);
+        aBuf[0..max] = buffer[index..$];
+        index += max;
+    }
+    *_retval = max;
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult ReadSegments (nsWriteSegmentFun aWriter, void* aClosure, PRUint32 aCount, PRUint32* _retval) {
+    int max = Math.min (aCount, buffer is null ? 0 : buffer.length - index);
+    PRUint32 cnt = max;
+    while (cnt > 0) {
+        PRUint32 aWriteCount;
+        nsresult rc = aWriter (cast(nsIInputStream)this, aClosure, buffer.ptr, index, cnt, &aWriteCount);
+        if (rc !is XPCOM.NS_OK) break;
+        index += aWriteCount;
+        cnt -= aWriteCount;
+    }
+    //XPCOM.memmove (_retval, new int[] {max - cnt}, 4);
+    *_retval = (max - cnt);
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult IsNonBlocking (PRBool* _retval) {
+    /* blocking */
+    *_retval = 0;
+    return XPCOM.NS_OK;
+}       
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/LocationAdapter.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.LocationAdapter;
+
+import java.lang.all;
+
+import org.eclipse.swt.browser.LocationListener;
+import org.eclipse.swt.browser.LocationEvent;
+
+/**
+ * This adapter class provides default implementations for the
+ * methods described by the {@link LocationListener} interface.
+ * <p>
+ * Classes that wish to deal with {@link LocationEvent}'s can
+ * extend this class and override only the methods which they are
+ * interested in.
+ * </p>
+ * 
+ * @since 3.0
+ */
+public abstract class LocationAdapter : LocationListener {
+
+public void changing(LocationEvent event) {
+}
+
+public void changed(LocationEvent event) {
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/LocationEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.LocationEvent;
+
+import tango.text.convert.Format;
+
+import org.eclipse.swt.events.TypedEvent;
+import org.eclipse.swt.widgets.Widget;
+import java.lang.all;
+
+/**
+ * A <code>LocationEvent</code> is sent by a {@link Browser} to
+ * {@link LocationListener}'s when the <code>Browser</code>
+ * navigates to a different URL. This notification typically 
+ * occurs when the application navigates to a new location with 
+ * {@link Browser#setUrl(String)} or when the user activates a
+ * hyperlink.
+ * 
+ * @since 3.0
+ */
+public class LocationEvent : TypedEvent {
+    /** current location */
+    public String location;
+    
+    /**
+     * A flag indicating whether the location opens in the top frame
+     * or not.
+     */
+    public bool top;
+    
+    /**
+     * A flag indicating whether the location loading should be allowed.
+     * Setting this field to <code>false</code> will cancel the operation.
+     */
+    public bool doit;
+
+    static final long serialVersionUID = 3906644198244299574L;
+    
+this(Widget w) {
+    super(w);
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+public override String toString() {
+    return Format( "{} {location = {}, top = {}, doit = {}}", 
+        super.toString[1 .. $-2], location, top, doit );  
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/LocationListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.LocationListener;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.SWTEventListener;
+import org.eclipse.swt.browser.LocationEvent;
+
+/**
+ * This listener interface may be implemented in order to receive
+ * a {@link LocationEvent} notification when a {@link Browser}
+ * navigates to a different URL.
+ * 
+ * @see Browser#addLocationListener(LocationListener)
+ * @see Browser#removeLocationListener(LocationListener)
+ * 
+ * @since 3.0
+ */
+public interface LocationListener : SWTEventListener {
+
+/**
+ * This method is called when the current location is about to be changed.
+ * <p>
+ *
+ * <p>The following fields in the <code>LocationEvent</code> apply:
+ * <ul>
+ * <li>(in) location the location to be loaded
+ * <li>(in) widget the <code>Browser</code> whose location is changing
+ * <li>(in/out) doit can be set to <code>false</code> to prevent the location
+ * from being loaded 
+ * </ul>
+ * 
+ * @param event the <code>LocationEvent</code> that specifies the location
+ * to be loaded by a <code>Browser</code>
+ * 
+ * @since 3.0
+ */ 
+public void changing(LocationEvent event);
+
+/**
+ * This method is called when the current location is changed.
+ * <p>
+ *
+ * <p>The following fields in the <code>LocationEvent</code> apply:
+ * <ul>
+ * <li>(in) location the current location
+ * <li>(in) top <code>true</code> if the location opens in the top frame or
+ * <code>false</code> otherwise
+ * <li>(in) widget the <code>Browser</code> whose location has changed
+ * </ul>
+ * 
+ * @param event the <code>LocationEvent</code> that specifies  the new
+ * location of a <code>Browser</code>
+ * 
+ * @since 3.0
+ */ 
+public void changed(LocationEvent event);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/Mozilla.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,3131 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.Mozilla;
+
+import java.lang.all;
+
+import tango.text.locale.Core;
+import tango.text.convert.Format;
+import tango.io.Console;
+import tango.sys.Environment;
+import tango.stdc.string;
+
+import org.eclipse.swt.internal.c.gtk;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.browser.WebBrowser;
+import org.eclipse.swt.browser.MozillaDelegate;
+import org.eclipse.swt.browser.AppFileLocProvider;
+import org.eclipse.swt.browser.WindowCreator2;
+import org.eclipse.swt.browser.PromptService2Factory;
+import org.eclipse.swt.browser.HelperAppLauncherDialogFactory;
+import org.eclipse.swt.browser.DownloadFactory;
+import org.eclipse.swt.browser.DownloadFactory_1_8;
+import org.eclipse.swt.browser.FilePickerFactory;
+import org.eclipse.swt.browser.FilePickerFactory_1_8;
+import org.eclipse.swt.browser.InputStream;
+import org.eclipse.swt.browser.StatusTextEvent;
+import org.eclipse.swt.browser.ProgressEvent;
+import org.eclipse.swt.browser.LocationEvent;
+import org.eclipse.swt.browser.WindowEvent;
+import org.eclipse.swt.browser.TitleEvent;
+
+import org.eclipse.swt.internal.Compatibility;
+import org.eclipse.swt.internal.LONG;
+import org.eclipse.swt.internal.Library;
+
+import XPCOM = org.eclipse.swt.internal.mozilla.XPCOM;
+import XPCOMInit = org.eclipse.swt.internal.mozilla.XPCOMInit;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsEmbedString;
+import org.eclipse.swt.internal.mozilla.nsIAppShell;
+import org.eclipse.swt.internal.mozilla.nsIBaseWindow;
+import org.eclipse.swt.internal.mozilla.nsICategoryManager;
+import org.eclipse.swt.internal.mozilla.nsIComponentManager;
+import org.eclipse.swt.internal.mozilla.nsIComponentRegistrar;
+import org.eclipse.swt.internal.mozilla.nsIContextMenuListener;
+import org.eclipse.swt.internal.mozilla.nsICookie;
+import org.eclipse.swt.internal.mozilla.nsICookieManager;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsIDOMNode;
+import org.eclipse.swt.internal.mozilla.nsIDOMEvent;
+import org.eclipse.swt.internal.mozilla.nsIDOMEventListener;
+import org.eclipse.swt.internal.mozilla.nsIDOMEventTarget;
+import org.eclipse.swt.internal.mozilla.nsIDOMKeyEvent;
+import org.eclipse.swt.internal.mozilla.nsIDOMMouseEvent;
+import org.eclipse.swt.internal.mozilla.nsIDOMSerializer;
+import org.eclipse.swt.internal.mozilla.nsIDOMSerializer_1_7;
+import org.eclipse.swt.internal.mozilla.nsIDOMWindow;
+import org.eclipse.swt.internal.mozilla.nsIDOMWindowCollection;
+import org.eclipse.swt.internal.mozilla.nsIDOMDocument;
+import org.eclipse.swt.internal.mozilla.nsIDirectoryService;
+import org.eclipse.swt.internal.mozilla.nsIDocShell;
+import org.eclipse.swt.internal.mozilla.nsIEmbeddingSiteWindow;
+import org.eclipse.swt.internal.mozilla.nsIFile;
+import org.eclipse.swt.internal.mozilla.nsIFactory;
+import org.eclipse.swt.internal.mozilla.nsIIOService;
+import org.eclipse.swt.internal.mozilla.nsIInterfaceRequestor;
+import org.eclipse.swt.internal.mozilla.nsIJSContextStack;
+import org.eclipse.swt.internal.mozilla.nsILocalFile;
+import org.eclipse.swt.internal.mozilla.nsIObserverService;
+import org.eclipse.swt.internal.mozilla.nsIPrefBranch;
+import org.eclipse.swt.internal.mozilla.nsIPrefLocalizedString;
+import org.eclipse.swt.internal.mozilla.nsIPrefService;
+import org.eclipse.swt.internal.mozilla.nsIProperties;
+import org.eclipse.swt.internal.mozilla.nsIRequest;
+import org.eclipse.swt.internal.mozilla.nsIServiceManager;
+import org.eclipse.swt.internal.mozilla.nsISimpleEnumerator;
+import org.eclipse.swt.internal.mozilla.nsIStreamListener;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsITooltipListener;
+import org.eclipse.swt.internal.mozilla.nsIURI;
+import org.eclipse.swt.internal.mozilla.nsIURIContentListener;
+import org.eclipse.swt.internal.mozilla.nsIWeakReference;
+import org.eclipse.swt.internal.mozilla.nsIWebBrowser;
+import org.eclipse.swt.internal.mozilla.nsIWebBrowserChrome;
+import org.eclipse.swt.internal.mozilla.nsIWebBrowserChromeFocus;
+import org.eclipse.swt.internal.mozilla.nsIWebBrowserFocus;
+import org.eclipse.swt.internal.mozilla.nsIWebNavigation;
+import org.eclipse.swt.internal.mozilla.nsIWebNavigationInfo;
+import org.eclipse.swt.internal.mozilla.nsIWebProgress;
+import org.eclipse.swt.internal.mozilla.nsIWebProgressListener;
+import org.eclipse.swt.internal.mozilla.nsIWindowWatcher;
+import org.eclipse.swt.internal.mozilla.nsIWindowCreator;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Control;
+
+class Mozilla : WebBrowser, 
+                nsIWeakReference, 
+                nsIWebProgressListener, 
+                nsIWebBrowserChrome,
+                nsIWebBrowserChromeFocus, 
+                nsIEmbeddingSiteWindow, 
+                nsIInterfaceRequestor, 
+                nsISupportsWeakReference, 
+                nsIContextMenuListener, 
+                nsIURIContentListener,
+                nsITooltipListener, 
+                nsIDOMEventListener {
+                    
+    GtkWidget* embedHandle;
+    nsIWebBrowser webBrowser;
+    Object webBrowserObject;
+    MozillaDelegate mozDelegate;
+
+    int chromeFlags = nsIWebBrowserChrome.CHROME_DEFAULT;
+    int refCount, lastKeyCode, lastCharCode;
+    nsIRequest request;
+    Point location, size;
+    bool visible, isChild, ignoreDispose, awaitingNavigate;
+    Shell tip = null;
+    Listener listener;
+    nsIDOMWindow[] unhookedDOMWindows;
+
+    static nsIAppShell AppShell;
+    static AppFileLocProvider LocationProvider;
+    static WindowCreator2 WindowCreator;
+    static int BrowserCount;
+    static bool Initialized, IsPre_1_8, PerformedVersionCheck, XPCOMWasGlued, XPCOMInitWasGlued;
+
+    /* XULRunner detect constants */
+    static const String GRERANGE_LOWER = "1.8.1.2"; //$NON-NLS-1$
+    static const String GRERANGE_LOWER_FALLBACK = "1.8"; //$NON-NLS-1$
+    static const bool LowerRangeInclusive = true;
+    static const String GRERANGE_UPPER = "1.9.*"; //$NON-NLS-1$
+    static const bool UpperRangeInclusive = true;
+
+    static const int MAX_PORT = 65535;
+    static String SEPARATOR_OS(){
+        return System.getProperty ("file.separator"); //$NON-NLS-1$
+    }
+    static const String ABOUT_BLANK = "about:blank"; //$NON-NLS-1$
+    static const String DISPOSE_LISTENER_HOOKED = "org.eclipse.swt.browser.Mozilla.disposeListenerHooked"; //$NON-NLS-1$
+    static const String PREFIX_JAVASCRIPT = "javascript:"; //$NON-NLS-1$
+    static const String PREFERENCE_CHARSET = "intl.charset.default"; //$NON-NLS-1$
+    static const String PREFERENCE_DISABLEOPENDURINGLOAD = "dom.disable_open_during_load"; //$NON-NLS-1$
+    static const String PREFERENCE_DISABLEWINDOWSTATUSCHANGE = "dom.disable_window_status_change"; //$NON-NLS-1$
+    static const String PREFERENCE_LANGUAGES = "intl.accept_languages"; //$NON-NLS-1$
+    static const String PREFERENCE_PROXYHOST_FTP = "network.proxy.ftp"; //$NON-NLS-1$
+    static const String PREFERENCE_PROXYPORT_FTP = "network.proxy.ftp_port"; //$NON-NLS-1$
+    static const String PREFERENCE_PROXYHOST_HTTP = "network.proxy.http"; //$NON-NLS-1$
+    static const String PREFERENCE_PROXYPORT_HTTP = "network.proxy.http_port"; //$NON-NLS-1$
+    static const String PREFERENCE_PROXYHOST_SSL = "network.proxy.ssl"; //$NON-NLS-1$
+    static const String PREFERENCE_PROXYPORT_SSL = "network.proxy.ssl_port"; //$NON-NLS-1$
+    static const String PREFERENCE_PROXYTYPE = "network.proxy.type"; //$NON-NLS-1$
+    static const String PROFILE_AFTER_CHANGE = "profile-after-change"; //$NON-NLS-1$
+    static const String PROFILE_BEFORE_CHANGE = "profile-before-change"; //$NON-NLS-1$
+    static       String PROFILE_DIR; //= SEPARATOR_OS ~ "eclipse" ~ SEPARATOR_OS; //$NON-NLS-1$
+    static const String PROFILE_DO_CHANGE = "profile-do-change"; //$NON-NLS-1$
+    static const String PROPERTY_PROXYPORT = "network.proxy_port"; //$NON-NLS-1$
+    static const String PROPERTY_PROXYHOST = "network.proxy_host"; //$NON-NLS-1$
+    static const String SEPARATOR_LOCALE = "-"; //$NON-NLS-1$
+    static const String SHUTDOWN_PERSIST = "shutdown-persist"; //$NON-NLS-1$
+    static const String STARTUP = "startup"; //$NON-NLS-1$
+    static const String TOKENIZER_LOCALE = ","; //$NON-NLS-1$
+    static const String URI_FROMMEMORY = "file:///"; //$NON-NLS-1$
+    static const String XULRUNNER_PATH = "org.eclipse.swt.browser.XULRunnerPath"; //$NON-NLS-1$
+
+    // TEMPORARY CODE
+    static const String GRE_INITIALIZED = "org.eclipse.swt.browser.XULRunnerInitialized"; //$NON-NLS-1$
+
+    this () {
+        PROFILE_DIR = SEPARATOR_OS ~ "eclipse" ~ SEPARATOR_OS;
+        MozillaClearSessions = new class() Runnable {
+            public void run () {
+                if (!Initialized) return;
+                nsIServiceManager serviceManager;
+                int rc = XPCOM.NS_GetServiceManager (&serviceManager);
+                if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+                if (serviceManager is null) error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+
+                nsICookieManager manager;
+                rc = serviceManager.GetServiceByContractID (XPCOM.NS_COOKIEMANAGER_CONTRACTID.ptr, &nsICookieManager.IID, cast(void**)&manager);
+                if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+                if (manager is null) error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+                serviceManager.Release ();
+
+                nsISimpleEnumerator enumerator;
+                rc = manager.GetEnumerator (&enumerator);
+                if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+                manager.Release ();
+
+                PRBool moreElements;
+                rc = enumerator.HasMoreElements (&moreElements);
+                if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+                while (moreElements !is 0) {
+                    nsICookie cookie;
+                    rc = enumerator.GetNext (cast(nsISupports*)&cookie);
+                    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+                    PRUint64 expires;
+                    rc = cookie.GetExpires (&expires);
+                    if (expires is 0) {
+                        /* indicates a session cookie */
+                        scope auto domain = new nsEmbedCString;
+                        scope auto name = new nsEmbedCString;
+                        scope auto path = new nsEmbedCString;
+                        cookie.GetHost (cast(nsACString*)domain);
+                        cookie.GetName (cast(nsACString*)name);
+                        cookie.GetPath (cast(nsACString*)path);
+                        rc = manager.Remove (cast(nsACString*)domain, cast(nsACString*)name, cast(nsACString*)path, 0);
+                        if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+                    }
+                    cookie.Release ();
+                    rc = enumerator.HasMoreElements (&moreElements);
+                    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+                }
+                enumerator.Release ();
+            }
+        };
+    }
+
+extern(D)
+public void create (Composite parent, int style) {
+    mozDelegate = new MozillaDelegate (super.browser);
+    Display display = parent.getDisplay ();
+
+    if (!Initialized) {
+        bool initLoaded = false;
+        bool IsXULRunner = false;
+
+        String greInitialized = System.getProperty (GRE_INITIALIZED); 
+        if ("true" == greInitialized) { //$NON-NLS-1$
+            /* 
+             * Another browser has already initialized xulrunner in this process,
+             * so just bind to it instead of trying to initialize a new one.
+             */
+            Initialized = true;
+        }
+        String mozillaPath = System.getProperty (XULRUNNER_PATH);
+        if (mozillaPath is null) {
+            // we don't need to load an initial library in D, so set to "true"
+            initLoaded = true;
+        } else {
+            mozillaPath ~= SEPARATOR_OS ~ mozDelegate.getLibraryName ();
+            IsXULRunner = true;
+        }
+         
+        if (initLoaded) {
+            /* attempt to discover a XULRunner to use as the GRE */
+            XPCOMInit.GREVersionRange range;
+
+            range.lower = GRERANGE_LOWER.ptr;
+            range.lowerInclusive = LowerRangeInclusive;
+
+            range.upper = GRERANGE_UPPER.ptr;
+            range.upperInclusive = UpperRangeInclusive;
+
+            char[] greBuffer = new char[XPCOMInit.PATH_MAX];
+
+            int rc = XPCOMInit.GRE_GetGREPathWithProperties (&range, 1, null, 0, greBuffer.ptr, greBuffer.length);
+
+            /*
+             * A XULRunner was not found that supports wrapping of XPCOM handles as JavaXPCOM objects.
+             * Drop the lower version bound and try to detect an earlier XULRunner installation.
+             */
+
+            if (rc !is XPCOM.NS_OK) {
+                range.lower = GRERANGE_LOWER_FALLBACK.ptr;
+                rc = XPCOMInit.GRE_GetGREPathWithProperties (&range, 1, null, 0, greBuffer.ptr, greBuffer.length);
+            }
+
+            if (rc is XPCOM.NS_OK) {
+                /* indicates that a XULRunner was found */
+                mozillaPath = greBuffer;
+                IsXULRunner = mozillaPath.length > 0;
+
+                /*
+                 * Test whether the detected XULRunner can be used as the GRE before loading swt's
+                 * XULRunner library.  If it cannot be used then fall back to attempting to use
+                 * the GRE pointed to by MOZILLA_FIVE_HOME.
+                 * 
+                 * One case where this will fail is attempting to use a 64-bit xulrunner while swt
+                 * is running in 32-bit mode, or vice versa.
+                 */
+
+                if (IsXULRunner) {
+                    rc = XPCOMInit.XPCOMGlueStartup (mozillaPath.ptr);
+                    if (rc !is XPCOM.NS_OK) {
+                        mozillaPath = mozillaPath.substring (0, mozillaPath.lastIndexOf (SEPARATOR_OS));
+                        if (Device.DEBUG) Cerr ("cannot use detected XULRunner: ") (mozillaPath).newline; //$NON-NLS-1$
+                        
+                        /* attempt to XPCOMGlueStartup the GRE pointed at by MOZILLA_FIVE_HOME */
+                        auto ptr = Environment.get(XPCOM.MOZILLA_FIVE_HOME);
+
+                        if (ptr is null) {
+                            IsXULRunner = false;
+                        } else {
+                            mozillaPath = ptr;
+                            /*
+                             * Attempting to XPCOMGlueStartup a mozilla-based GRE !is xulrunner can
+                             * crash, so don't attempt unless the GRE appears to be xulrunner.
+                             */
+                            if (mozillaPath.indexOf("xulrunner") is -1) { //$NON-NLS-1$
+                                IsXULRunner = false;    
+
+                            } else {
+                                mozillaPath ~= SEPARATOR_OS ~ mozDelegate.getLibraryName ();
+                                rc = XPCOMInit.XPCOMGlueStartup (toStringz(mozillaPath));
+                                if (rc !is XPCOM.NS_OK) {
+                                    IsXULRunner = false;
+                                    mozillaPath = mozillaPath.substring (0, mozillaPath.lastIndexOf (SEPARATOR_OS));
+                                    if (Device.DEBUG) Cerr ("failed to start as XULRunner: " )(mozillaPath).newline; //$NON-NLS-1$
+                                }
+                            }
+                        } 
+                    }
+                    if (IsXULRunner) {
+                        XPCOMInitWasGlued = true;
+                    }
+                }
+            }
+        }
+
+        if (IsXULRunner) {
+            if (Device.DEBUG) Cerr ("XULRunner path: ") (mozillaPath).newline; //$NON-NLS-1$
+
+            XPCOMWasGlued = true;
+
+            /*
+             * Remove the trailing xpcom lib name from mozillaPath because the
+             * Mozilla.initialize and NS_InitXPCOM2 invocations require a directory name only.
+             */
+            mozillaPath = mozillaPath.substring (0, mozillaPath.lastIndexOf (SEPARATOR_OS));
+        } else {
+            if ((style & SWT.MOZILLA) !is 0) {
+                browser.dispose ();
+                String errorString = (mozillaPath !is null && mozillaPath.length > 0) ?
+                    " [Failed to use detected XULRunner: " ~ mozillaPath ~ "]" :
+                    " [Could not detect registered XULRunner to use]";  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+                SWT.error (SWT.ERROR_NO_HANDLES, null, errorString);
+            }
+
+            /* attempt to use the GRE pointed at by MOZILLA_FIVE_HOME */
+            auto mozFiveHome = Environment.get(XPCOM.MOZILLA_FIVE_HOME);
+            if (mozFiveHome !is null) {
+                mozillaPath = mozFiveHome;
+            } else {
+                browser.dispose ();
+                SWT.error (SWT.ERROR_NO_HANDLES, null, " [Unknown Mozilla path (MOZILLA_FIVE_HOME not set)]"); //$NON-NLS-1$
+            }
+            if (Device.DEBUG) Cerr ("Mozilla path: ") (mozillaPath).newline; //$NON-NLS-1$
+
+            /*
+            * Note.  Embedding a Mozilla GTK1.2 causes a crash.  The workaround
+            * is to check the version of GTK used by Mozilla by looking for
+            * the libwidget_gtk.so library used by Mozilla GTK1.2. Mozilla GTK2
+            * uses the libwidget_gtk2.so library.   
+            */
+            if (Compatibility.fileExists (mozillaPath, "components/libwidget_gtk.so")) { //$NON-NLS-1$
+                browser.dispose ();
+                SWT.error (SWT.ERROR_NO_HANDLES, null, " [Mozilla GTK2 required (GTK1.2 detected)]"); //$NON-NLS-1$                         
+            }
+        }
+
+        if (!Initialized) {
+            nsILocalFile localFile;
+            scope auto pathString = new nsEmbedString (mozillaPath.toWCharArray());
+            nsresult rc = XPCOM.NS_NewLocalFile (cast(nsAString*)pathString, 1, &localFile);
+            if (rc !is XPCOM.NS_OK) {
+                browser.dispose ();
+                error (rc, __FILE__, __LINE__);
+            }
+            if (localFile is null) {
+                browser.dispose ();
+                error (XPCOM.NS_ERROR_NULL_POINTER);
+            }
+
+            LocationProvider = new AppFileLocProvider (mozillaPath);
+            LocationProvider.AddRef ();
+
+            nsIDirectoryServiceProvider directoryServiceProvider;
+            rc = LocationProvider.QueryInterface( &nsIDirectoryServiceProvider.IID, cast(void**)&directoryServiceProvider);
+            if (rc !is XPCOM.NS_OK) {
+                browser.dispose();
+                error(rc);
+            }
+            rc = XPCOM.NS_InitXPCOM2 (null, cast(nsIFile)localFile, directoryServiceProvider);
+            localFile.Release ();
+            LocationProvider.Release();
+            if (rc !is XPCOM.NS_OK) {
+                browser.dispose ();
+                SWT.error (SWT.ERROR_NO_HANDLES, null, Format(" [MOZILLA_FIVE_HOME may not point at an embeddable GRE] [NS_InitEmbedding {0} error {1} ] ", mozillaPath, rc ) ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+            }
+            System.setProperty (GRE_INITIALIZED, "true"); //$NON-NLS-1$
+            if (IsXULRunner) {
+                System.setProperty (XULRUNNER_PATH, mozillaPath);
+            }
+        }
+
+        nsIComponentManager componentManager;
+        int rc = XPCOM.NS_GetComponentManager (&componentManager);
+        if (rc !is XPCOM.NS_OK) {
+            browser.dispose ();
+            error (rc, __FILE__, __LINE__);
+        }
+        if (componentManager is null) {
+            browser.dispose ();
+            error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+        }
+        
+        if (mozDelegate.needsSpinup ()) {
+            /* nsIAppShell is discontinued as of xulrunner 1.9, so do not fail if it is not found */
+            rc = componentManager.CreateInstance (&XPCOM.NS_APPSHELL_CID, null, &nsIAppShell.IID, cast(void**)&AppShell);
+            if (rc !is XPCOM.NS_ERROR_NO_INTERFACE) {
+                if (rc !is XPCOM.NS_OK) {
+                    browser.dispose ();
+                    error (rc, __FILE__, __LINE__);
+                }
+                if (AppShell is null) {
+                    browser.dispose ();
+                    error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+                }
+    
+                rc = AppShell.Create (null, null);
+                if (rc !is XPCOM.NS_OK) {
+                    browser.dispose ();
+                    error (rc, __FILE__, __LINE__);
+                }
+                rc = AppShell.Spinup ();
+                if (rc !is XPCOM.NS_OK) {
+                    browser.dispose ();
+                    error (rc, __FILE__, __LINE__);
+                }
+            }
+        }
+
+        WindowCreator = new WindowCreator2;
+        WindowCreator.AddRef ();
+        
+        nsIServiceManager serviceManager;
+        rc = XPCOM.NS_GetServiceManager (&serviceManager);
+        if (rc !is XPCOM.NS_OK) {
+            browser.dispose ();
+            error (rc, __FILE__, __LINE__);
+        }
+        if (serviceManager is null) {
+            browser.dispose ();
+            error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+        }
+        
+        nsIWindowWatcher windowWatcher;
+        rc = serviceManager.GetServiceByContractID (XPCOM.NS_WINDOWWATCHER_CONTRACTID.ptr, &nsIWindowWatcher.IID, cast(void**)&windowWatcher);
+        if (rc !is XPCOM.NS_OK) {
+            browser.dispose ();
+            error (rc, __FILE__, __LINE__);
+        }
+        if (windowWatcher is null) {
+            browser.dispose ();
+            error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);       
+        }
+
+        rc = windowWatcher.SetWindowCreator (cast(nsIWindowCreator)WindowCreator);
+        if (rc !is XPCOM.NS_OK) {
+            browser.dispose ();
+            error (rc, __FILE__, __LINE__);
+        }
+        windowWatcher.Release ();
+
+        if (LocationProvider !is null) {
+            nsIDirectoryService directoryService;
+            rc = serviceManager.GetServiceByContractID (XPCOM.NS_DIRECTORYSERVICE_CONTRACTID.ptr, &nsIDirectoryService.IID, cast(void**)&directoryService);
+            if (rc !is XPCOM.NS_OK) {
+                browser.dispose ();
+                error (rc, __FILE__, __LINE__);
+            }
+            if (directoryService is null) {
+                browser.dispose ();
+                error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+            }
+
+            nsIProperties properties;
+            rc = directoryService.QueryInterface (&nsIProperties.IID, cast(void**)&properties);
+            if (rc !is XPCOM.NS_OK) {
+                browser.dispose ();
+                error (rc, __FILE__, __LINE__);
+            }
+            if (properties is null) {
+                browser.dispose ();
+                error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+            }
+            directoryService.Release ();
+
+            nsIFile profileDir;
+            rc = properties.Get (XPCOM.NS_APP_APPLICATION_REGISTRY_DIR.ptr, &nsIFile.IID, cast(void**)&profileDir);
+            if (rc !is XPCOM.NS_OK) {
+                browser.dispose ();
+                error (rc, __FILE__, __LINE__);
+            }
+            if (profileDir is null) {
+                browser.dispose ();
+                error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+            }
+            properties.Release ();
+
+            scope auto path = new nsEmbedCString;
+            rc = profileDir.GetNativePath (cast(nsACString*)path);
+            if (rc !is XPCOM.NS_OK) {
+                browser.dispose ();
+                error (rc, __FILE__, __LINE__);
+            }
+
+            String profilePath = path.toString() ~ PROFILE_DIR;
+            LocationProvider.setProfilePath (profilePath);
+            LocationProvider.isXULRunner = IsXULRunner;
+
+            profileDir.Release ();
+
+            /* notify observers of a new profile directory being used */
+            nsIObserverService observerService;
+            rc = serviceManager.GetServiceByContractID (XPCOM.NS_OBSERVER_CONTRACTID.ptr, &nsIObserverService.IID, cast(void**)&observerService);
+            if (rc !is XPCOM.NS_OK) {
+                browser.dispose ();
+                error (rc, __FILE__, __LINE__);
+            }
+            if (observerService is null) {
+                browser.dispose ();
+                error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+            }
+
+            wchar* chars = STARTUP.toWCharArray().toString16z();
+            rc = observerService.NotifyObservers (null, PROFILE_DO_CHANGE.ptr, chars);
+            if (rc !is XPCOM.NS_OK) {
+                browser.dispose ();
+                error (rc, __FILE__, __LINE__);
+            }
+
+            rc = observerService.NotifyObservers (null, PROFILE_AFTER_CHANGE.ptr, chars);
+            if (rc !is XPCOM.NS_OK) {
+                browser.dispose ();
+                error (rc, __FILE__, __LINE__);
+            }
+            observerService.Release ();
+        }
+
+        /*
+         * As a result of using a common profile the user cannot change their locale
+         * and charset.  The fix for this is to set mozilla's locale and charset
+         * preference values according to the user's current locale and charset.
+         */
+
+        nsIPrefService prefService;
+        rc = serviceManager.GetServiceByContractID (XPCOM.NS_PREFSERVICE_CONTRACTID.ptr, &nsIPrefService.IID, cast(void**)&prefService);
+        serviceManager.Release ();
+        if (rc !is XPCOM.NS_OK) {
+            browser.dispose ();
+            error (rc, __FILE__, __LINE__);
+        }
+        if (serviceManager is null) {
+            browser.dispose ();
+            error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+        }
+
+        char[1] buffer = new char[1];
+        nsIPrefBranch prefBranch;
+        rc = prefService.GetBranch (buffer.ptr, &prefBranch);    /* empty buffer denotes root preference level */
+        prefService.Release ();
+        if (rc !is XPCOM.NS_OK) {
+            browser.dispose ();
+            error (rc, __FILE__, __LINE__);
+        }
+        if (prefBranch is null) {
+            browser.dispose ();
+            error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+        }
+
+        /* get Mozilla's current locale preference value */
+        String prefLocales = null;
+        nsIPrefLocalizedString localizedString = null;
+        //buffer = MozillaDelegate.wcsToMbcs (null, PREFERENCE_LANGUAGES, true);
+        rc = prefBranch.GetComplexValue (PREFERENCE_LANGUAGES.ptr, &nsIPrefLocalizedString.IID, cast(void**)&localizedString);
+        /* 
+         * Feature of Debian.  For some reason attempting to query for the current locale
+         * preference fails on Debian.  The workaround for this is to assume a value of
+         * "en-us,en" since this is typically the default value when mozilla is used without
+         * a profile.
+         */
+        if (rc !is XPCOM.NS_OK) {
+            prefLocales = "en-us,en" ~ TOKENIZER_LOCALE;    //$NON-NLS-1$
+        } else {
+            if (localizedString is null) {
+                browser.dispose ();
+                error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+            }
+            PRUnichar* tmpChars;
+            rc = localizedString.ToString (&tmpChars);
+            if (rc !is XPCOM.NS_OK) {
+                browser.dispose ();
+                error (rc, __FILE__, __LINE__);
+            }
+            if (tmpChars is null) {
+                browser.dispose ();
+                error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+            }
+            int span = XPCOM.strlen_PRUnichar (tmpChars);
+            prefLocales = Utf.toString(tmpChars[0 .. span]) ~ TOKENIZER_LOCALE;
+        }
+
+        /*
+         * construct the new locale preference value by prepending the
+         * user's current locale and language to the original value 
+         */
+
+        String language = Culture.current.twoLetterLanguageName ();
+        String country = Region.current.twoLetterRegionName ();
+        String stringBuffer = language.dup;
+
+        stringBuffer ~= SEPARATOR_LOCALE;
+        stringBuffer ~= country.toLowerCase ();
+        stringBuffer ~= TOKENIZER_LOCALE;
+        stringBuffer ~= language;
+        stringBuffer ~= TOKENIZER_LOCALE;
+        String newLocales = stringBuffer.dup;
+
+        int start, end = -1;
+        do {
+            start = end + 1;
+            end = prefLocales.indexOf (TOKENIZER_LOCALE, start);
+            String token;
+            if (end is -1) {
+                token = prefLocales.substring (start);
+            } else {
+                token = prefLocales.substring (start, end);
+            }
+            if (token.length () > 0) {
+                token = (token ~ TOKENIZER_LOCALE).trim ();
+                /* ensure that duplicate locale values are not added */
+                if (newLocales.indexOf (token) is -1) {
+                    stringBuffer ~= token;
+                }
+            }
+        } while (end !is -1);
+        newLocales[] = stringBuffer[];
+        if (!newLocales.equals (prefLocales)) {
+            /* write the new locale value */
+            newLocales = newLocales.substring (0, newLocales.length () - TOKENIZER_LOCALE.length ()); /* remove trailing tokenizer */
+            if (localizedString is null) {
+                rc = componentManager.CreateInstanceByContractID (XPCOM.NS_PREFLOCALIZEDSTRING_CONTRACTID.ptr, null, &nsIPrefLocalizedString.IID, cast(void**)&localizedString);
+                if (rc !is XPCOM.NS_OK) {
+                    browser.dispose ();
+                    error (rc, __FILE__, __LINE__);
+                }
+                if (localizedString is null) {
+                    browser.dispose ();
+                    error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+                }
+            }
+            localizedString.SetDataWithLength (newLocales.length, newLocales.toWCharArray().toString16z());
+            rc = prefBranch.SetComplexValue (PREFERENCE_LANGUAGES.ptr, &nsIPrefLocalizedString.IID, cast(nsISupports)localizedString);
+        }
+        if (localizedString !is null) {
+            localizedString.Release ();
+            localizedString = null;
+        }
+
+        /* get Mozilla's current charset preference value */
+        String prefCharset = null;
+        rc = prefBranch.GetComplexValue (PREFERENCE_CHARSET.ptr, &nsIPrefLocalizedString.IID, cast(void**)&localizedString);
+        /* 
+         * Feature of Debian.  For some reason attempting to query for the current charset
+         * preference fails on Debian.  The workaround for this is to assume a value of
+         * "ISO-8859-1" since this is typically the default value when mozilla is used
+         * without a profile.
+         */
+        if (rc !is XPCOM.NS_OK) {
+            prefCharset = "ISO-8859-1"; //$NON_NLS-1$
+        } else {
+            if (localizedString is null) {
+                browser.dispose ();
+                error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+            }
+            PRUnichar* tmpChar;
+            rc = localizedString.ToString (&tmpChar);
+            if (rc !is XPCOM.NS_OK) {
+                browser.dispose ();
+                error (rc, __FILE__, __LINE__);
+            }
+            if (tmpChar is null) {
+                browser.dispose ();
+                error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+            }
+            int span = XPCOM.strlen_PRUnichar (tmpChar);
+            prefCharset = Utf.toString(tmpChar[0 .. span]);
+        }
+
+        String newCharset = System.getProperty ("file.encoding");   // $NON-NLS-1$
+        if (!newCharset.equals (prefCharset)) {
+            /* write the new charset value */
+            if (localizedString is null) {
+                rc = componentManager.CreateInstanceByContractID (XPCOM.NS_PREFLOCALIZEDSTRING_CONTRACTID.ptr, null, &nsIPrefLocalizedString.IID, cast(void**)&localizedString);
+                if (rc !is XPCOM.NS_OK) {
+                    browser.dispose ();
+                    error (rc, __FILE__, __LINE__);
+                }
+                if (localizedString is null) {
+                    browser.dispose ();
+                    error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+                }
+            }
+            localizedString.SetDataWithLength (newCharset.length, newCharset.toWCharArray().toString16z());
+            rc = prefBranch.SetComplexValue (PREFERENCE_CHARSET.ptr, &nsIPrefLocalizedString.IID, cast(nsISupports)localizedString);
+        }
+        if (localizedString !is null) localizedString.Release ();
+
+        /*
+        * Check for proxy values set as documented java properties and update mozilla's
+        * preferences with these values if needed.
+        */
+
+        // NOTE: in org.eclipse.swt, these properties don't exist so both keys will return null
+        // (which appears to be ok in this situaion)
+        String proxyHost = System.getProperty (PROPERTY_PROXYHOST);
+        String proxyPortString = System.getProperty (PROPERTY_PROXYPORT);
+
+        int port = -1;
+        if (proxyPortString !is null) {
+            try {
+                int value = Integer.valueOf (proxyPortString).intValue ();
+                if (0 <= value && value <= MAX_PORT) port = value;
+            } catch (NumberFormatException e) {
+                /* do nothing, java property has non-integer value */
+            }
+        }
+
+        if (proxyHost !is null) {
+            rc = componentManager.CreateInstanceByContractID (XPCOM.NS_PREFLOCALIZEDSTRING_CONTRACTID.ptr, null, &nsIPrefLocalizedString.IID, cast(void**)&localizedString);
+            if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+            if (localizedString is null) error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+
+            rc = localizedString.SetDataWithLength (proxyHost.length, proxyHost.toWCharArray().toString16z());
+            if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+            rc = prefBranch.SetComplexValue (PREFERENCE_PROXYHOST_FTP.ptr, &nsIPrefLocalizedString.IID, cast(nsISupports)localizedString);
+            if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+            rc = prefBranch.SetComplexValue (PREFERENCE_PROXYHOST_HTTP.ptr, &nsIPrefLocalizedString.IID, cast(nsISupports)localizedString);
+            if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+            rc = prefBranch.SetComplexValue (PREFERENCE_PROXYHOST_SSL.ptr, &nsIPrefLocalizedString.IID, cast(nsISupports)localizedString);
+            if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+            localizedString.Release ();
+        }
+
+        if (port !is -1) {
+            rc = prefBranch.SetIntPref (PREFERENCE_PROXYPORT_FTP.ptr, port);
+            if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+            rc = prefBranch.SetIntPref (PREFERENCE_PROXYPORT_HTTP.ptr, port);
+            if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+            rc = prefBranch.SetIntPref (PREFERENCE_PROXYPORT_SSL.ptr, port);
+            if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+        }
+
+        if (proxyHost !is null || port !is -1) {
+            rc = prefBranch.SetIntPref (PREFERENCE_PROXYTYPE.ptr, 1);
+            if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+        }
+
+        /*
+        * Ensure that windows that are shown during page loads are not blocked.  Firefox may
+        * try to block these by default since such windows are often unwelcome, but this
+        * assumption should not be made in the Browser's context.  Since the Browser client
+        * is responsible for creating the new Browser and Shell in an OpenWindowListener,
+        * they should decide whether the new window is unwelcome or not and act accordingly. 
+        */
+        rc = prefBranch.SetBoolPref (PREFERENCE_DISABLEOPENDURINGLOAD.ptr, 0);
+        if (rc !is XPCOM.NS_OK) {
+            browser.dispose ();
+            error (rc, __FILE__, __LINE__);
+        }
+
+        /* Ensure that the status text can be set through means like javascript */ 
+        rc = prefBranch.SetBoolPref (PREFERENCE_DISABLEWINDOWSTATUSCHANGE.ptr, 0);
+        if (rc !is XPCOM.NS_OK) {
+            browser.dispose ();
+            error (rc, __FILE__, __LINE__);
+        }
+
+        prefBranch.Release ();
+
+        PromptService2Factory factory = new PromptService2Factory ();
+        factory.AddRef ();
+
+        nsIComponentRegistrar componentRegistrar;
+        rc = componentManager.QueryInterface (&nsIComponentRegistrar.IID, cast(void**)&componentRegistrar);
+        if (rc !is XPCOM.NS_OK) {
+            browser.dispose ();
+            error (rc, __FILE__, __LINE__);
+        }
+        if (componentRegistrar is null) {
+            browser.dispose ();
+            error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+        }
+        
+        String aClassName = "Prompt Service"; 
+
+        rc = componentRegistrar.RegisterFactory (&XPCOM.NS_PROMPTSERVICE_CID, aClassName.ptr, XPCOM.NS_PROMPTSERVICE_CONTRACTID.ptr, cast(nsIFactory)factory);
+
+        if (rc !is XPCOM.NS_OK) {
+            browser.dispose ();
+            error (rc, __FILE__, __LINE__);
+        }
+        factory.Release ();
+
+        /*
+        * This Download factory will be used if the GRE version is < 1.8.
+        * If the GRE version is 1.8.x then the Download factory that is registered later for
+        *   contract "Transfer" will be used.
+        * If the GRE version is >= 1.9 then no Download factory is registered because this
+        *   functionality is provided by the GRE.
+        */
+        DownloadFactory downloadFactory = new DownloadFactory ();
+        downloadFactory.AddRef ();
+        aClassName = "Download";
+        rc = componentRegistrar.RegisterFactory (&XPCOM.NS_DOWNLOAD_CID, aClassName.ptr, XPCOM.NS_DOWNLOAD_CONTRACTID.ptr, cast(nsIFactory)downloadFactory);
+        if (rc !is XPCOM.NS_OK) {
+            browser.dispose ();
+            error (rc, __FILE__, __LINE__);
+        }
+        downloadFactory.Release ();
+
+        FilePickerFactory pickerFactory = IsXULRunner ? new FilePickerFactory_1_8 () : new FilePickerFactory ();
+        pickerFactory.AddRef ();
+        aClassName = "FilePicker";
+        rc = componentRegistrar.RegisterFactory (&XPCOM.NS_FILEPICKER_CID, aClassName.ptr, XPCOM.NS_FILEPICKER_CONTRACTID.ptr, cast(nsIFactory)pickerFactory);
+        if (rc !is XPCOM.NS_OK) {
+            browser.dispose ();
+            error (rc, __FILE__, __LINE__);
+        }
+        pickerFactory.Release ();
+
+        componentRegistrar.Release ();
+        componentManager.Release ();
+
+        Initialized = true;
+    }
+
+    if (display.getData (DISPOSE_LISTENER_HOOKED) is null) {
+        display.setData (DISPOSE_LISTENER_HOOKED, stringcast(DISPOSE_LISTENER_HOOKED));
+        display.addListener (SWT.Dispose, dgListener( &handleDisposeEvent, display )  );
+    }
+
+    BrowserCount++;
+    nsIComponentManager componentManager;
+    int rc = XPCOM.NS_GetComponentManager (&componentManager);
+    if (rc !is XPCOM.NS_OK) {
+        browser.dispose ();
+        error (rc, __FILE__, __LINE__);
+    }
+    if (componentManager is null) {
+        browser.dispose ();
+        error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+    }
+    
+    nsID NS_IWEBBROWSER_CID = { 0xF1EAC761, 0x87E9, 0x11d3, [0xAF, 0x80, 0x00, 0xA0, 0x24, 0xFF, 0xC0, 0x8C] }; //$NON-NLS-1$
+    rc = componentManager.CreateInstance (&NS_IWEBBROWSER_CID, null, &nsIWebBrowser.IID, cast(void**)&webBrowser);
+    if (rc !is XPCOM.NS_OK) {
+        browser.dispose ();
+        error (rc, __FILE__, __LINE__);
+    }
+    if (webBrowser is null) {
+        browser.dispose ();
+        error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);   
+    }
+    
+    this.AddRef ();
+
+    rc = webBrowser.SetContainerWindow ( cast(nsIWebBrowserChrome)this );
+    if (rc !is XPCOM.NS_OK) {
+        browser.dispose ();
+        error (rc, __FILE__, __LINE__);
+    }
+            
+    nsIBaseWindow baseWindow;
+    rc = webBrowser.QueryInterface (&nsIBaseWindow.IID, cast(void**)&baseWindow);
+    if (rc !is XPCOM.NS_OK) {
+        browser.dispose ();
+        error (rc, __FILE__, __LINE__);
+    }
+    if (baseWindow is null) {
+        browser.dispose ();
+        error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+    }
+    
+    Rectangle rect = browser.getClientArea ();
+    if (rect.isEmpty ()) {
+        rect.width = 1;
+        rect.height = 1;
+    }
+
+    embedHandle = mozDelegate.getHandle ();
+
+    rc = baseWindow.InitWindow (cast(void*)embedHandle, null, 0, 0, rect.width, rect.height);
+    if (rc !is XPCOM.NS_OK) {
+        browser.dispose ();
+        error (XPCOM.NS_ERROR_FAILURE);
+    }
+    rc = baseWindow.Create ();
+    if (rc !is XPCOM.NS_OK) {
+        browser.dispose ();
+        error (XPCOM.NS_ERROR_FAILURE);
+    }
+    rc = baseWindow.SetVisibility (1);
+    if (rc !is XPCOM.NS_OK) {
+        browser.dispose ();
+        error (XPCOM.NS_ERROR_FAILURE);
+    }
+    baseWindow.Release ();
+
+    if (!PerformedVersionCheck) {
+        PerformedVersionCheck = true;
+        
+        nsIComponentRegistrar componentRegistrar;
+        rc = componentManager.QueryInterface (&nsIComponentRegistrar.IID, cast(void**)&componentRegistrar);
+        if (rc !is XPCOM.NS_OK) {
+            browser.dispose ();
+            error (rc, __FILE__,__LINE__);
+        }
+        if (componentRegistrar is null) {
+            browser.dispose ();
+            error (XPCOM.NS_NOINTERFACE,__FILE__,__LINE__);
+        }
+
+        HelperAppLauncherDialogFactory dialogFactory = new HelperAppLauncherDialogFactory ();
+        dialogFactory.AddRef ();
+        String aClassName = "Helper App Launcher Dialog"; //$NON-NLS-1$
+        rc = componentRegistrar.RegisterFactory (&XPCOM.NS_HELPERAPPLAUNCHERDIALOG_CID, aClassName.ptr, XPCOM.NS_HELPERAPPLAUNCHERDIALOG_CONTRACTID.ptr, cast(nsIFactory)dialogFactory);
+        if (rc !is XPCOM.NS_OK) {
+            browser.dispose ();
+            error (rc,__FILE__,__LINE__);
+        }
+        dialogFactory.Release ();
+
+        /*
+        * Check for the availability of the pre-1.8 implementation of nsIDocShell
+        * to determine if the GRE's version is < 1.8.
+        */
+        nsIInterfaceRequestor interfaceRequestor;
+        rc = webBrowser.QueryInterface (&nsIInterfaceRequestor.IID, cast(void**)&interfaceRequestor);
+        if (rc !is XPCOM.NS_OK) {
+            browser.dispose ();
+            error (XPCOM.NS_ERROR_FAILURE);
+        }
+        if (interfaceRequestor is null) {
+            browser.dispose ();
+            error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+        }
+
+        nsIDocShell docShell;
+        rc = interfaceRequestor.GetInterface (&nsIDocShell.IID, cast(void**)&docShell);
+        if (rc is XPCOM.NS_OK && docShell !is null) {
+            IsPre_1_8 = true;
+            docShell.Release ();
+        }
+
+        /*
+        * A Download factory for contract "Transfer" must be registered iff the GRE's version is 1.8.x.
+        *   Check for the availability of the 1.8 implementation of nsIDocShell to determine if the
+        *   GRE's version is 1.8.x.
+        * If the GRE version is < 1.8 then the previously-registered Download factory for contract
+        *   "Download" will be used.
+        * If the GRE version is >= 1.9 then no Download factory is registered because this
+        *   functionality is provided by the GRE.
+        */
+        if (!IsPre_1_8) {
+            nsIDocShell_1_8 docShell_1_8;
+            rc = interfaceRequestor.GetInterface (&nsIDocShell_1_8.IID, cast(void**)&docShell_1_8);
+            if (rc is XPCOM.NS_OK && docShell_1_8 !is null) { /* 1.8 */
+                docShell_1_8.Release ();
+ 
+                DownloadFactory_1_8 downloadFactory_1_8 = new DownloadFactory_1_8 ();
+                downloadFactory_1_8.AddRef ();
+                
+                aClassName = "Transfer"; //$NON-NLS-1$
+                rc = componentRegistrar.RegisterFactory (&XPCOM.NS_DOWNLOAD_CID, aClassName.ptr, XPCOM.NS_TRANSFER_CONTRACTID.ptr, cast(nsIFactory)downloadFactory_1_8);
+                if (rc !is XPCOM.NS_OK) {
+                    browser.dispose ();
+                    error (rc, __FILE__, __LINE__);
+                }
+                downloadFactory_1_8.Release ();
+                } else { /* >= 1.9 */
+                /*
+                 * Bug in XULRunner 1.9.  Mozilla no longer clears its background before initial content has
+                 * been set.  As a result embedders appear broken if they do not immediately navigate to a url.
+                 * The workaround for this is to navigate to about:blank immediately so that the background is
+                 * cleared, but do not fire any corresponding events or allow Browser API calls to reveal this.
+                 * Once the client does a proper navigate with either setUrl() or setText() then resume as
+                 * normal.  The Mozilla bug for this is https://bugzilla.mozilla.org/show_bug.cgi?id=415789.
+                 */
+                awaitingNavigate = true;
+                nsIWebNavigation webNavigation;
+                rc = webBrowser.QueryInterface (&nsIWebNavigation.IID, cast(void**)&webNavigation);
+                if (rc !is XPCOM.NS_OK) {
+                    browser.dispose ();
+                    error (rc, __FILE__, __LINE__);
+                }
+                if (webNavigation is null) {
+                    browser.dispose ();
+                    error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+                }
+                rc = webNavigation.LoadURI (ABOUT_BLANK.toWCharArray().toString16z(), nsIWebNavigation.LOAD_FLAGS_NONE, null, null, null);
+                webNavigation.Release ();
+                dialogFactory.isPre_1_9 = false;
+            }
+        }
+        interfaceRequestor.Release ();
+        componentRegistrar.Release ();
+    }
+    componentManager.Release ();
+
+    rc = webBrowser.AddWebBrowserListener (cast(nsIWeakReference)this, &nsIWebProgressListener.IID);
+    if (rc !is XPCOM.NS_OK) {
+        browser.dispose ();
+        error (rc, __FILE__, __LINE__);
+    }
+
+    // TODO: Find appropriate place to "Release" uriContentListener -JJR
+    nsIURIContentListener uriContentListener;
+    this.QueryInterface(&nsIURIContentListener.IID, cast(void**)&uriContentListener);
+    if (rc !is XPCOM.NS_OK) {
+        browser.dispose();
+        error(rc);
+    }
+    if (uriContentListener is null) {
+        browser.dispose();
+        error(XPCOM.NS_ERROR_NO_INTERFACE);
+    }
+
+    rc = webBrowser.SetParentURIContentListener (uriContentListener);
+    if (rc !is XPCOM.NS_OK) {
+        browser.dispose ();
+        error (rc, __FILE__, __LINE__);
+    }
+
+    mozDelegate.init ();
+        
+    int[] folderEvents = [
+        SWT.Dispose,
+        SWT.Resize,  
+        SWT.FocusIn,
+        SWT.Activate,
+        SWT.Deactivate,
+        SWT.Show,
+        SWT.KeyDown     // needed to make browser traversable
+    ];
+    
+    for (int i = 0; i < folderEvents.length; i++) {
+        browser.addListener (folderEvents[i], dgListener( &handleFolderEvent ));
+    }
+}
+
+/*******************************************************************************
+
+    Event Handlers for the Mozilla Class:
+    
+    These represent replacements for SWT's anonymous classes as used within
+    the Mozilla class.  Since D 1.0x anonymous classes do not work equivalently 
+    to Java's, we replace the anonymous classes with D delegates and templates
+    (ie dgListener which wrap the delegate in a class).  This circumvents some
+    nasty, evasive bugs.
+    
+    extern(D) becomes a necessary override on these methods because this class 
+    implements a XPCOM/COM interface resulting in all class methods defaulting
+    to extern(System). -JJR
+
+ ******************************************************************************/
+
+extern(D)
+private void handleDisposeEvent (Event event, Display display) {
+    if (BrowserCount > 0) return; /* another display is still active */
+
+    nsIServiceManager serviceManager;
+
+    int rc = XPCOM.NS_GetServiceManager (&serviceManager);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (serviceManager is null) error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+
+    nsIObserverService observerService;
+    rc = serviceManager.GetServiceByContractID (XPCOM.NS_OBSERVER_CONTRACTID.ptr, &nsIObserverService.IID, cast(void**)&observerService);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (observerService is null) error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+
+    rc = observerService.NotifyObservers (null, PROFILE_BEFORE_CHANGE.ptr, SHUTDOWN_PERSIST.toWCharArray().toString16z());
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    observerService.Release ();
+
+    if (LocationProvider !is null) {
+        String prefsLocation = LocationProvider.profilePath ~ AppFileLocProvider.PREFERENCES_FILE;
+        scope auto pathString = new nsEmbedString (prefsLocation.toWCharArray());
+        nsILocalFile localFile;
+        rc = XPCOM.NS_NewLocalFile (cast(nsAString*)pathString, 1, &localFile);
+        if (rc !is XPCOM.NS_OK) Mozilla.error (rc, __FILE__, __LINE__);
+        if (localFile is null) Mozilla.error (XPCOM.NS_ERROR_NULL_POINTER);
+
+        nsIFile prefFile;
+        rc = localFile.QueryInterface (&nsIFile.IID, cast(void**)&prefFile); 
+        if (rc !is XPCOM.NS_OK) Mozilla.error (rc, __FILE__, __LINE__);
+        if (prefFile is null) Mozilla.error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+        localFile.Release ();
+
+        nsIPrefService prefService;
+        rc = serviceManager.GetServiceByContractID (XPCOM.NS_PREFSERVICE_CONTRACTID.ptr, &nsIPrefService.IID, cast(void**)&prefService);
+        if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+        if (prefService is null) error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+
+        rc = prefService.SavePrefFile(prefFile);
+        prefService.Release ();
+        prefFile.Release ();
+    }
+    serviceManager.Release ();
+
+    if (XPCOMWasGlued) {
+        /*
+         * XULRunner 1.9 can crash on Windows if XPCOMGlueShutdown is invoked here,
+         * presumably because one or more of its unloaded symbols are referenced when
+         * this callback returns.  The workaround is to delay invoking XPCOMGlueShutdown
+         * so that its symbols are still available once this callback returns.
+         */
+         display.asyncExec (new class() Runnable {
+             public void run () {
+                 XPCOMInit.XPCOMGlueShutdown ();
+             }
+         });
+         XPCOMWasGlued = XPCOMInitWasGlued = false;
+    } 
+
+    Initialized = false;
+}
+  
+        
+extern(D)
+private void handleFolderEvent (Event event) {
+            Control control = cast(Control)browser;
+            switch (event.type) {
+                case SWT.Dispose: {
+                    /* make this handler run after other dispose listeners */
+                    if (ignoreDispose) {
+                        ignoreDispose = false;
+                        break;
+                    }
+                    ignoreDispose = true;
+                    browser.notifyListeners (event.type, event);
+                    event.type = SWT.NONE;
+                    onDispose (event.display);
+                    break;
+                }
+                case SWT.Resize: onResize (); break;
+                case SWT.FocusIn: Activate (); break;
+                case SWT.Activate: Activate (); break;
+                case SWT.Deactivate: {
+                    Display display = event.display;
+                    if (control is display.getFocusControl ()) Deactivate ();
+                    break;
+                }
+                case SWT.Show: {
+                    /*
+                    * Feature in GTK Mozilla.  Mozilla does not show up when
+                    * its container (a GTK fixed handle) is made visible
+                    * after having been hidden.  The workaround is to reset
+                    * its size after the container has been made visible. 
+                    */
+                    Display display = event.display;
+                    display.asyncExec(new class () Runnable {
+                        public void run() {
+                            if (browser.isDisposed ()) return;
+                            onResize ();
+                        }
+                    });
+                    break;
+                }
+                default: break;
+            }
+        }
+
+/*******************************************************************************
+
+*******************************************************************************/
+    
+extern(D)
+public bool back () {
+    if (awaitingNavigate) return false;
+
+    //int /*long*/[] result = new int /*long*/[1];
+    nsIWebNavigation webNavigation;
+    int rc = webBrowser.QueryInterface (&nsIWebNavigation.IID, cast(void**)&webNavigation);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (webNavigation is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+    
+    //nsIWebNavigation webNavigation = new nsIWebNavigation (result[0]);          
+    rc = webNavigation.GoBack ();   
+    webNavigation.Release ();
+    return rc is XPCOM.NS_OK;
+}
+
+extern(D)
+public bool execute (String script) {
+    if (awaitingNavigate) return false;
+
+    String url = PREFIX_JAVASCRIPT ~ script ~ ";void(0);";  //$NON-NLS-1$
+    //int /*long*/[] result = new int /*long*/[1];
+    nsIWebNavigation webNavigation;
+    int rc = webBrowser.QueryInterface (&nsIWebNavigation.IID, cast(void**)&webNavigation);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (webNavigation is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+
+    //nsIWebNavigation webNavigation = new nsIWebNavigation (result[0]);
+    //char[] arg = url.toCharArray (); 
+    //char[] c = new char[arg.length+1];
+    //System.arraycopy (arg, 0, c, 0, arg.length);
+    rc = webNavigation.LoadURI (url.toWCharArray().toString16z(), nsIWebNavigation.LOAD_FLAGS_NONE, null, null, null);
+    webNavigation.Release ();
+    return rc is XPCOM.NS_OK;
+}
+
+extern(D)
+static Browser findBrowser (void* handle) {
+    return MozillaDelegate.findBrowser (cast(GtkWidget*)handle);
+}
+
+extern(D)
+public bool forward () {
+    if (awaitingNavigate) return false;
+
+    //int /*long*/[] result = new int /*long*/[1];
+    nsIWebNavigation webNavigation;
+    int rc = webBrowser.QueryInterface (&nsIWebNavigation.IID, cast(void**)&webNavigation);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (webNavigation is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+    
+    //nsIWebNavigation webNavigation = new nsIWebNavigation (result[0]);
+    rc = webNavigation.GoForward ();
+    webNavigation.Release ();
+
+    return rc is XPCOM.NS_OK;
+}
+
+extern(D)
+public String getText () {
+    if (awaitingNavigate) return ""; //$NON-NLS-1$
+
+    //int /*long*/[] result = new int /*long*/[1];
+    nsIDOMWindow window;
+    int rc = webBrowser.GetContentDOMWindow (&window);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (window is null) error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+
+    //nsIDOMWindow window = new nsIDOMWindow (result[0]);
+    //result[0] = 0;
+    nsIDOMDocument document;
+    rc = window.GetDocument (&document);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (document is null) error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+    window.Release ();
+
+    //int /*long*/ document = result[0];
+    //result[0] = 0;
+    nsIComponentManager componentManager;
+    rc = XPCOM.NS_GetComponentManager (&componentManager);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (componentManager is null) error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+
+    //nsIComponentManager componentManager = new nsIComponentManager (result[0]);
+    //result[0] = 0;
+    //byte[] contractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_DOMSERIALIZER_CONTRACTID, true);
+    String chars = null;
+    nsIDOMSerializer_1_7 serializer_1_7;
+    rc = componentManager.CreateInstanceByContractID (XPCOM.NS_DOMSERIALIZER_CONTRACTID.ptr, null, &nsIDOMSerializer_1_7.IID, cast(void**)&serializer_1_7);
+    if (rc is XPCOM.NS_OK) {    /* mozilla >= 1.7 */
+        if (serializer_1_7 is null) error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+
+        //nsIDOMSerializer_1_7 serializer = new nsIDOMSerializer_1_7 (result[0]);
+        //result[0] = 0;
+        scope auto string = new nsEmbedString;
+        rc = serializer_1_7.SerializeToString (cast(nsIDOMNode)document, cast(nsAString*) string);
+        serializer_1_7.Release ();
+
+        //int length = XPCOM.nsEmbedString_Length (string);
+        //int /*long*/ buffer = XPCOM.nsEmbedString_get (string);
+        //chars = new char[length];
+        //XPCOM.memmove (chars, buffer, length * 2);
+        //XPCOM.nsEmbedString_delete (string);
+        chars = string.toString();
+    } else {    /* mozilla < 1.7 */
+        nsIDOMSerializer serializer;
+        rc = componentManager.CreateInstanceByContractID (XPCOM.NS_DOMSERIALIZER_CONTRACTID.ptr, null, &nsIDOMSerializer.IID, cast(void**)&serializer);
+        if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+        if (serializer is null) error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+        // TODO: Lookup SerializeToString contract. Find out if the string must provide it's own memory to the method. -JJR
+        PRUnichar* string;
+        //nsIDOMSerializer serializer = new nsIDOMSerializer (result[0]);
+        //result[0] = 0;
+        rc = serializer.SerializeToString (cast(nsIDOMNode)document, &string );
+        serializer.Release ();
+
+        //int length = XPCOM.strlen_PRUnichar (string);
+        //chars = new char[length];
+        //XPCOM.memmove (chars, result[0], length * 2);
+        chars = Utf.toString(fromString16z(string));
+    }
+
+    componentManager.Release ();
+    document.Release ();
+    return chars.dup;
+}
+
+extern(D)
+public String getUrl () {
+    if (awaitingNavigate) return ""; //$NON-NLS-1$
+
+    //int /*long*/[] result = new int /*long*/[1];
+    nsIWebNavigation webNavigation;
+    int rc = webBrowser.QueryInterface (&nsIWebNavigation.IID, cast(void**)&webNavigation);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (webNavigation is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+
+    //nsIWebNavigation webNavigation = new nsIWebNavigation (result[0]);
+    nsIURI aCurrentURI;
+    rc = webNavigation.GetCurrentURI (&aCurrentURI);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    webNavigation.Release ();
+
+    String location = null;
+    if (aCurrentURI !is null) {
+        //nsIURI uri = new nsIURI (aCurrentURI[0]);
+        scope auto aSpec = new nsEmbedCString;
+        rc = aCurrentURI.GetSpec (cast(nsACString*)aSpec);
+        if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+        //int length = XPCOM.nsEmbedCString_Length (aSpec);
+        //int /*long*/ buffer = XPCOM.nsEmbedCString_get (aSpec);
+        location = aSpec.toString;
+        //XPCOM.memmove (dest, buffer, length);
+        //XPCOM.nsEmbedCString_delete (aSpec);
+        aCurrentURI.Release ();
+    }
+    if (location is null) return ""; //$NON-NLS-1$
+
+    /*
+     * If the URI indicates that the page is being rendered from memory
+     * (via setText()) then set it to about:blank to be consistent with IE.
+     */
+    if (location.equals (URI_FROMMEMORY)) location = ABOUT_BLANK;
+    return location;
+}
+
+extern(D)
+public Object getWebBrowser () {
+    if ((browser.getStyle () & SWT.MOZILLA) is 0) return null;
+    if (webBrowserObject !is null) return webBrowserObject;
+    implMissing(__FILE__,__LINE__);
+/+
+    try {
+        // TODO: this references the JavaXPCOM browser... not sure what needs to be done here,
+        // but I don't think this method is necessary.
+        Class clazz = Class.forName ("org.mozilla.xpcom.Mozilla"); //$NON-NLS-1$
+        Method method = clazz.getMethod ("getInstance", new Class[0]); //$NON-NLS-1$
+        Object mozilla = method.invoke (null, new Object[0]);
+        method = clazz.getMethod ("wrapXPCOMObject", new Class[] {Long.TYPE, String.class}); //$NON-NLS-1$
+        webBrowserObject = webBrowser.getAddress ()), nsIWebBrowser.NS_IWEBBROWSER_IID_STR});
+        /*
+         * The following AddRef() is needed to offset the automatic Release() that
+         * will be performed by JavaXPCOM when webBrowserObject is finalized.
+         */
+        webBrowser.AddRef ();
+        return webBrowserObject;
+   } catch (ClassNotFoundException e) {
+   } catch (NoSuchMethodException e) {
+   } catch (IllegalArgumentException e) {
+   } catch (IllegalAccessException e) {
+   } catch (InvocationTargetException e) {
+   }
++/
+   return null;
+}
+
+extern(D)
+public bool isBackEnabled () {
+    if (awaitingNavigate) return false;
+
+    //int /*long*/[] result = new int /*long*/[1];
+    nsIWebNavigation webNavigation;
+    int rc = webBrowser.QueryInterface (&nsIWebNavigation.IID, cast(void**)&webNavigation);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (webNavigation is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+    
+    //nsIWebNavigation webNavigation = new nsIWebNavigation (result[0]);
+    PRBool aCanGoBack; /* PRBool */
+    rc = webNavigation.GetCanGoBack (&aCanGoBack);   
+    webNavigation.Release ();
+    return aCanGoBack !is 0;
+}
+
+extern(D)
+public bool isForwardEnabled () {
+    if (awaitingNavigate) return false;
+
+    //int /*long*/[] result = new int /*long*/[1];
+    nsIWebNavigation webNavigation;
+    int rc = webBrowser.QueryInterface (&nsIWebNavigation.IID, cast(void**)&webNavigation);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (webNavigation is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+    
+    //nsIWebNavigation webNavigation = new nsIWebNavigation (result[0]);
+    PRBool aCanGoForward; /* PRBool */
+    rc = webNavigation.GetCanGoForward (&aCanGoForward);
+    webNavigation.Release ();
+    return aCanGoForward !is 0;
+}
+
+extern(D)
+static void error (int code ) {
+    error ( code, "NOT GIVEN", 0 );
+}
+
+extern(D)
+static String error (int code, char[] file, int line) {
+    getDwtLogger().info( __FILE__, __LINE__,  "File: {}  Line: {}", file, line);
+    throw new SWTError ("XPCOM error " ~ Integer.toString(code)); //$NON-NLS-1$
+}
+
+extern(D)
+void onDispose (Display display) {
+    int rc = webBrowser.RemoveWebBrowserListener (cast(nsIWeakReference)this, &nsIWebProgressListener.IID);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+
+    rc = webBrowser.SetParentURIContentListener (null);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    
+    unhookDOMListeners ();
+    if (listener !is null) {
+        int[] folderEvents = [
+            SWT.Dispose,
+            SWT.Resize,  
+            SWT.FocusIn,
+            SWT.Activate,
+            SWT.Deactivate,
+            SWT.Show,
+            SWT.KeyDown,
+        ];
+        for (int i = 0; i < folderEvents.length; i++) {
+            browser.removeListener (folderEvents[i], listener);
+        }
+        listener = null;
+    }
+
+    //int /*long*/[] result = new int /*long*/[1];
+    nsIBaseWindow baseWindow;
+    rc = webBrowser.QueryInterface (&nsIBaseWindow.IID, cast(void**)&baseWindow);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (baseWindow is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+
+    //nsIBaseWindow baseWindow = new nsIBaseWindow (result[0]);
+    rc = baseWindow.Destroy ();
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    baseWindow.Release ();
+
+    Release ();
+    webBrowser.Release ();
+    webBrowser = null;
+    webBrowserObject = null;
+
+    if (tip !is null && !tip.isDisposed ()) tip.dispose ();
+    tip = null;
+    location = size = null;
+
+    //Enumeration elements = unhookedDOMWindows.elements ();
+    foreach (win ; unhookedDOMWindows) {
+        //LONG ptrObject = (LONG)elements.nextElement ();
+        win.Release ();
+    }
+    unhookedDOMWindows = null;
+
+    mozDelegate.onDispose (embedHandle);
+    mozDelegate = null;
+
+    embedHandle = null;
+    BrowserCount--;
+}
+
+extern(D)
+void Activate () {
+    //int /*long*/[] result = new int /*long*/[1];
+    nsIWebBrowserFocus webBrowserFocus;
+    int rc = webBrowser.QueryInterface (&nsIWebBrowserFocus.IID, cast(void**)&webBrowserFocus);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (webBrowserFocus is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+    
+    //nsIWebBrowserFocus webBrowserFocus = new nsIWebBrowserFocus (result[0]);
+    rc = webBrowserFocus.Activate ();
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    webBrowserFocus.Release ();
+}
+
+extern(D)
+void Deactivate () {
+    //int /*long*/[] result = new int /*long*/[1];
+    nsIWebBrowserFocus webBrowserFocus;
+    int rc = webBrowser.QueryInterface (&nsIWebBrowserFocus.IID, cast(void**)&webBrowserFocus);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (webBrowserFocus is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+    
+    //nsIWebBrowserFocus webBrowserFocus = new nsIWebBrowserFocus (result[0]);
+    rc = webBrowserFocus.Deactivate ();
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    webBrowserFocus.Release ();
+}
+
+extern(D)
+void onResize () {
+    Rectangle rect = browser.getClientArea ();
+    int width = Math.max (1, rect.width);
+    int height = Math.max (1, rect.height);
+
+    //int /*long*/[] result = new int /*long*/[1];
+    nsIBaseWindow baseWindow;
+    int rc = webBrowser.QueryInterface (&nsIBaseWindow.IID, cast(void**)&baseWindow);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (baseWindow is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+
+    mozDelegate.setSize (embedHandle, width, height);
+    //nsIBaseWindow baseWindow = new nsIBaseWindow (result[0]);
+    rc = baseWindow.SetPositionAndSize (0, 0, width, height, 1);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    baseWindow.Release ();
+}
+
+extern(D)
+public void refresh () {
+    if (awaitingNavigate) return;
+
+    //int /*long*/[] result = new int /*long*/[1];
+    nsIWebNavigation webNavigation;
+    int rc = webBrowser.QueryInterface (&nsIWebNavigation.IID, cast(void**)&webNavigation);
+    if (rc !is XPCOM.NS_OK) error(rc);
+    if (webNavigation is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+    
+    //nsIWebNavigation webNavigation = new nsIWebNavigation (result[0]);          
+    rc = webNavigation.Reload (nsIWebNavigation.LOAD_FLAGS_NONE);
+    webNavigation.Release ();
+    if (rc is XPCOM.NS_OK) return;
+    /*
+    * Feature in Mozilla.  Reload returns an error code NS_ERROR_INVALID_POINTER
+    * when it is called immediately after a request to load a new document using
+    * LoadURI.  The workaround is to ignore this error code.
+    *
+    * Feature in Mozilla.  Attempting to reload a file that no longer exists
+    * returns an error code of NS_ERROR_FILE_NOT_FOUND.  This is equivalent to
+    * attempting to load a non-existent local url, which is not a Browser error,
+    * so this error code should be ignored. 
+    */
+    if (rc !is XPCOM.NS_ERROR_INVALID_POINTER && rc !is XPCOM.NS_ERROR_FILE_NOT_FOUND) error (rc, __FILE__, __LINE__);
+}
+
+extern(D)
+public bool setText (String html) {
+    /*
+    *  Feature in Mozilla.  The focus memory of Mozilla must be 
+    *  properly managed through the nsIWebBrowserFocus interface.
+    *  In particular, nsIWebBrowserFocus.deactivate must be called
+    *  when the focus moves from the browser (or one of its children
+    *  managed by Mozilla to another widget.  We currently do not
+    *  get notified when a widget takes focus away from the Browser.
+    *  As a result, deactivate is not properly called. This causes
+    *  Mozilla to retake focus the next time a document is loaded.
+    *  This breaks the case where the HTML loaded in the Browser 
+    *  varies while the user enters characters in a text widget. The text
+    *  widget loses focus every time new content is loaded.
+    *  The current workaround is to call deactivate everytime if 
+    *  the browser currently does not have focus. A better workaround
+    *  would be to have a way to call deactivate when the Browser
+    *  or one of its children loses focus.
+    */
+    if (browser !is browser.getDisplay().getFocusControl ()) {
+        Deactivate ();
+    }
+    /* convert the String containing HTML to an array of bytes with UTF-8 data */
+    /+
+    byte[] data = null;
+    try {
+        data = html.getBytes ("UTF-8"); //$NON-NLS-1$
+    } catch (UnsupportedEncodingException e) {
+        return false;
+    }
+    +/
+    awaitingNavigate = false;
+
+    //byte[] contentTypeBuffer = MozillaDelegate.wcsToMbcs (null, "text/html", true); // $NON-NLS-1$
+    scope auto aContentType = new nsEmbedCString ("text/html");
+    //byte[] contentCharsetBuffer = MozillaDelegate.wcsToMbcs (null, "UTF-8", true);  //$NON-NLS-1$
+    scope auto aContentCharset = new nsEmbedCString ("UTF-8");
+
+    //int /*long*/[] result = new int /*long*/[1];
+    nsIServiceManager serviceManager;
+    int rc = XPCOM.NS_GetServiceManager (&serviceManager);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (serviceManager is null) error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+
+    //nsIServiceManager serviceManager = new nsIServiceManager (result[0]);
+    //result[0] = 0;
+    nsIIOService ioService;
+    rc = serviceManager.GetService (&XPCOM.NS_IOSERVICE_CID, &nsIIOService.IID, cast(void**)&ioService);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (ioService is null) error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+    serviceManager.Release ();
+
+    //nsIIOService ioService = new nsIIOService (result[0]);
+    //result[0] = 0;
+    /*
+    * Note.  Mozilla ignores LINK tags used to load CSS stylesheets
+    * when the URI protocol for the nsInputStreamChannel
+    * is about:blank.  The fix is to specify the file protocol.
+    */
+    //byte[] aString = MozillaDelegate.wcsToMbcs (null, URI_FROMMEMORY, false);
+    scope auto aSpec = new nsEmbedCString(URI_FROMMEMORY);
+    nsIURI uri;
+    rc = ioService.NewURI (cast(nsACString*)aSpec, null, null, &uri);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (uri is null) error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+    //XPCOM.nsEmbedCString_delete (aSpec);
+    ioService.Release ();
+
+    //nsIURI uri = new nsIURI (result[0]);
+    //result[0] = 0;
+    nsIInterfaceRequestor interfaceRequestor;
+    rc = webBrowser.QueryInterface (&nsIInterfaceRequestor.IID, cast(void**)&interfaceRequestor);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (interfaceRequestor is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+    //nsIInterfaceRequestor interfaceRequestor = new nsIInterfaceRequestor (result[0]);
+    //result[0] = 0;
+
+    /*
+    * Feature in Mozilla. LoadStream invokes the nsIInputStream argument
+    * through a different thread.  The callback mechanism must attach 
+    * a non java thread to the JVM otherwise the nsIInputStream Read and
+    * Close methods never get called.
+    */
+    
+    // Using fully qualified name for disambiguation with java.io.InputStream -JJR
+    auto inputStream = new org.eclipse.swt.browser.InputStream.InputStream (cast(byte[])html);
+    inputStream.AddRef ();
+
+    nsIDocShell_1_9 docShell_1_9;
+    rc = interfaceRequestor.GetInterface (&nsIDocShell_1_9.IID, cast(void**)&docShell_1_9);
+    if (rc is XPCOM.NS_OK) {
+        if (docShell_1_9 is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+        //nsIDocShell_1_9 docShell = new nsIDocShell_1_9 (result[0]);
+        rc = docShell_1_9.LoadStream (inputStream, uri, cast(nsACString*)aContentType,  cast(nsACString*)aContentCharset, null);
+        docShell_1_9.Release ();
+    } else {
+        //result[0] = 0;
+        nsIDocShell_1_8 docShell_1_8;
+        rc = interfaceRequestor.GetInterface (&nsIDocShell_1_8.IID, cast(void**)&docShell_1_8);
+        if (rc is XPCOM.NS_OK) {    
+            if (docShell_1_8 is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+            //nsIDocShell_1_8 docShell = new nsIDocShell_1_8 (result[0]);
+            rc = docShell_1_8.LoadStream (inputStream, uri, cast(nsACString*)aContentType,  cast(nsACString*)aContentCharset, null);
+            docShell_1_8.Release ();
+        } else {
+            //result[0] = 0;
+            nsIDocShell docShell;
+            rc = interfaceRequestor.GetInterface (&nsIDocShell.IID, cast(void**)&docShell);
+            if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+            if (docShell is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+            //nsIDocShell docShell = new nsIDocShell (result[0]);
+            rc = docShell.LoadStream (inputStream, uri, cast(nsACString*) aContentType,  cast(nsACString*)aContentCharset, null);
+            docShell.Release ();
+        }
+    }
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    //result[0] = 0;
+
+    inputStream.Release ();
+    interfaceRequestor.Release ();
+    uri.Release ();
+    //XPCOM.nsEmbedCString_delete (aContentCharset);
+    //XPCOM.nsEmbedCString_delete (aContentType);
+    return true;
+}
+
+extern(D)
+public bool setUrl (String url) {
+    awaitingNavigate = false;
+
+    nsIWebNavigation webNavigation;
+    int rc = webBrowser.QueryInterface (&nsIWebNavigation.IID, cast(void**)&webNavigation);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (webNavigation is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+
+    rc = webNavigation.LoadURI (url.toWCharArray().toString16z(), nsIWebNavigation.LOAD_FLAGS_NONE, null, null, null);
+    webNavigation.Release ();
+    return rc is XPCOM.NS_OK;
+}
+
+extern(D)
+public void stop () {
+    if (awaitingNavigate) return;
+
+    nsIWebNavigation webNavigation;
+    //int /*long*/[] result = new int /*long*/[1];
+    int rc = webBrowser.QueryInterface (&nsIWebNavigation.IID, cast(void**)&webNavigation);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (webNavigation is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+    
+    //nsIWebNavigation webNavigation = new nsIWebNavigation (result[0]);      
+    rc = webNavigation.Stop (nsIWebNavigation.STOP_ALL);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    webNavigation.Release ();
+}
+
+extern(D)
+void hookDOMListeners (nsIDOMEventTarget target, bool isTop) {
+    scope auto string = new nsEmbedString (XPCOM.DOMEVENT_FOCUS.toWCharArray());
+    target.AddEventListener (cast(nsAString*)string, cast(nsIDOMEventListener)this, 0);
+    //string.dispose ();
+    string = new nsEmbedString (XPCOM.DOMEVENT_UNLOAD.toWCharArray());
+    target.AddEventListener (cast(nsAString*)string, cast(nsIDOMEventListener)this, 0);
+    //string.dispose ();
+    string = new nsEmbedString (XPCOM.DOMEVENT_MOUSEDOWN.toWCharArray());
+    target.AddEventListener (cast(nsAString*)string,cast(nsIDOMEventListener)this, 0);
+    //string.dispose ();
+    string = new nsEmbedString (XPCOM.DOMEVENT_MOUSEUP.toWCharArray());
+    target.AddEventListener (cast(nsAString*)string, cast(nsIDOMEventListener)this, 0);
+    //string.dispose ();
+    string = new nsEmbedString (XPCOM.DOMEVENT_MOUSEMOVE.toWCharArray());
+    target.AddEventListener (cast(nsAString*)string, cast(nsIDOMEventListener)this, 0);
+    //string.dispose ();
+    string = new nsEmbedString (XPCOM.DOMEVENT_MOUSEWHEEL.toWCharArray());
+    target.AddEventListener (cast(nsAString*)string, cast(nsIDOMEventListener)this, 0);
+    //string.dispose ();
+    string = new nsEmbedString (XPCOM.DOMEVENT_MOUSEDRAG.toWCharArray());
+    target.AddEventListener (cast(nsAString*)string, cast(nsIDOMEventListener)this, 0);
+    //string.dispose ();
+
+    /*
+    * Only hook mouseover and mouseout if the target is a top-level frame, so that mouse moves
+    * between frames will not generate events.
+    */
+    if (isTop && mozDelegate.hookEnterExit ()) {
+        string = new nsEmbedString (XPCOM.DOMEVENT_MOUSEOVER.toWCharArray());
+        target.AddEventListener (cast(nsAString*)string, cast(nsIDOMEventListener)this, 0);
+        //string.dispose ();
+        string = new nsEmbedString (XPCOM.DOMEVENT_MOUSEOUT.toWCharArray());
+        target.AddEventListener (cast(nsAString*)string, cast(nsIDOMEventListener)this, 0);
+        //string.dispose ();
+    }
+
+    string = new nsEmbedString (XPCOM.DOMEVENT_KEYDOWN.toWCharArray());
+    target.AddEventListener (cast(nsAString*)string, cast(nsIDOMEventListener)this, 0);
+    //string.dispose ();
+    string = new nsEmbedString (XPCOM.DOMEVENT_KEYPRESS.toWCharArray());
+    target.AddEventListener (cast(nsAString*)string, cast(nsIDOMEventListener)this, 0);
+    //string.dispose ();
+    string = new nsEmbedString (XPCOM.DOMEVENT_KEYUP.toWCharArray());
+    target.AddEventListener (cast(nsAString*)string, cast(nsIDOMEventListener)this, 0);
+    //string.dispose ();
+}
+
+extern(D)
+void unhookDOMListeners () {
+    //int /*long*/[] result = new int /*long*/[1];
+    nsIDOMWindow window;
+    int rc = webBrowser.GetContentDOMWindow (&window);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (window is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+
+    //nsIDOMWindow window = new nsIDOMWindow (result[0]);
+    //result[0] = 0;
+    nsIDOMEventTarget target;
+    rc = window.QueryInterface (&nsIDOMEventTarget.IID, cast(void**)&target);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (target is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+
+    //nsIDOMEventTarget target = new nsIDOMEventTarget (result[0]);
+    //result[0] = 0;
+    unhookDOMListeners (target);
+    target.Release ();
+
+    /* Listeners must be unhooked in pages contained in frames */
+    nsIDOMWindowCollection frames;
+    rc = window.GetFrames (&frames);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (frames is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+    //nsIDOMWindowCollection frames = new nsIDOMWindowCollection (result[0]);
+    //result[0] = 0;
+    PRUint32 count;
+    rc = frames.GetLength (&count); /* PRUint32 */
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    //int count = frameCount[0];
+
+    if (count > 0) {
+        nsIDOMWindow frame;
+        for (int i = 0; i < count; i++) {
+            rc = frames.Item (i, &frame);
+            if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+            if (frame is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+
+            //nsIDOMWindow frame = new nsIDOMWindow (result[0]);
+            //result[0] = 0;
+            rc = frame.QueryInterface (&nsIDOMEventTarget.IID, cast(void**)&target);
+            if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+            if (target is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+
+            //target = new nsIDOMEventTarget (result[0]);
+            //result[0] = 0;
+            unhookDOMListeners (target);
+            target.Release ();
+            frame.Release ();
+        }
+    }
+    frames.Release ();
+    window.Release ();
+}
+
+extern(D)
+void unhookDOMListeners (nsIDOMEventTarget target) {
+    scope auto string = new nsEmbedString (XPCOM.DOMEVENT_FOCUS.toWCharArray());
+    target.RemoveEventListener (cast(nsAString*)string, cast(nsIDOMEventListener)this, 0);
+    //string.dispose ();
+    string = new nsEmbedString (XPCOM.DOMEVENT_UNLOAD.toWCharArray());
+    target.RemoveEventListener (cast(nsAString*)string, cast(nsIDOMEventListener)this, 0);
+    //string.dispose ();
+    string = new nsEmbedString (XPCOM.DOMEVENT_MOUSEDOWN.toWCharArray());
+    target.RemoveEventListener (cast(nsAString*)string, cast(nsIDOMEventListener)this, 0);
+    //string.dispose ();
+    string = new nsEmbedString (XPCOM.DOMEVENT_MOUSEUP.toWCharArray());
+    target.RemoveEventListener (cast(nsAString*)string, cast(nsIDOMEventListener)this, 0);
+    //string.dispose ();
+    string = new nsEmbedString (XPCOM.DOMEVENT_MOUSEMOVE.toWCharArray());
+    target.RemoveEventListener (cast(nsAString*)string, cast(nsIDOMEventListener)this, 0);
+    //string.dispose ();
+    string = new nsEmbedString (XPCOM.DOMEVENT_MOUSEWHEEL.toWCharArray());
+    target.RemoveEventListener (cast(nsAString*)string, cast(nsIDOMEventListener)this, 0);
+    //string.dispose ();
+    string = new nsEmbedString (XPCOM.DOMEVENT_MOUSEDRAG.toWCharArray());
+    target.RemoveEventListener (cast(nsAString*)string, cast(nsIDOMEventListener)this, 0);
+    //string.dispose ();
+    string = new nsEmbedString (XPCOM.DOMEVENT_MOUSEOVER.toWCharArray());
+    target.RemoveEventListener (cast(nsAString*)string, cast(nsIDOMEventListener)this, 0);
+    //string.dispose ();
+    string = new nsEmbedString (XPCOM.DOMEVENT_MOUSEOUT.toWCharArray());
+    target.RemoveEventListener (cast(nsAString*)string, cast(nsIDOMEventListener)this, 0);
+    //string.dispose ();
+    string = new nsEmbedString (XPCOM.DOMEVENT_KEYDOWN.toWCharArray());
+    target.RemoveEventListener (cast(nsAString*)string, cast(nsIDOMEventListener)this, 0);
+    //string.dispose ();
+    string = new nsEmbedString (XPCOM.DOMEVENT_KEYPRESS.toWCharArray());
+    target.RemoveEventListener (cast(nsAString*)string, cast(nsIDOMEventListener)this, 0);
+    //string.dispose ();
+    string = new nsEmbedString (XPCOM.DOMEVENT_KEYUP.toWCharArray());
+    target.RemoveEventListener (cast(nsAString*)string, cast(nsIDOMEventListener)this, 0);
+    //string.dispose ();
+}
+
+/* nsISupports */
+
+extern(System)
+nsresult QueryInterface (nsID* riid, void** ppvObject) {
+    if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
+
+    if (*riid == nsISupports.IID) {
+        *ppvObject = cast(void*)cast(nsISupports)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsIWeakReference.IID) {
+        *ppvObject = cast(void*)cast(nsIWeakReference)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsIWebProgressListener.IID) {
+        *ppvObject = cast(void*)cast(nsIWebProgressListener)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsIWebBrowserChrome.IID) {
+        *ppvObject = cast(void*)cast(nsIWebBrowserChrome)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsIWebBrowserChromeFocus.IID) {
+        *ppvObject = cast(void*)cast(nsIWebBrowserChromeFocus)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsIEmbeddingSiteWindow.IID) {
+        *ppvObject = cast(void*)cast(nsIEmbeddingSiteWindow)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsIInterfaceRequestor.IID) {
+        *ppvObject = cast(void*)cast(nsIInterfaceRequestor)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsISupportsWeakReference.IID) {
+        *ppvObject = cast(void*)cast(nsISupportsWeakReference)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsIContextMenuListener.IID) {
+        *ppvObject = cast(void*)cast(nsIContextMenuListener)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsIURIContentListener.IID) {
+        *ppvObject = cast(void*)cast(nsIURIContentListener)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsITooltipListener.IID) {
+        *ppvObject = cast(void*)cast(nsITooltipListener)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    *ppvObject = null;
+    return XPCOM.NS_ERROR_NO_INTERFACE;
+}
+
+extern(System)
+nsrefcnt AddRef () {
+    refCount++;
+    return refCount;
+}
+
+extern(System)
+nsrefcnt Release () {
+    refCount--;
+    if (refCount is 0) return 0;
+    return refCount;
+}
+
+/* nsIWeakReference */  
+
+extern(System)
+nsresult QueryReferent (nsID* riid, void** ppvObject) {
+    return QueryInterface (riid, ppvObject);
+}
+
+/* nsIInterfaceRequestor */
+
+extern(System)
+nsresult GetInterface ( nsID* riid, void** ppvObject) {
+    if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
+    //nsID guid = new nsID ();
+    //XPCOM.memmove (guid, riid, nsID.sizeof);
+    if (*riid == nsIDOMWindow.IID) {
+        nsIDOMWindow aContentDOMWindow;
+        //int /*long*/[] aContentDOMWindow = new int /*long*/[1];
+        int rc = webBrowser.GetContentDOMWindow (&aContentDOMWindow);
+        if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+        if (aContentDOMWindow is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+        *ppvObject = cast(void*)aContentDOMWindow;
+        //XPCOM.memmove (ppvObject, aContentDOMWindow, C.PTR_SIZEOF);
+        return rc;
+    }
+    return QueryInterface (riid, ppvObject);
+}
+
+extern(System)
+nsresult GetWeakReference (nsIWeakReference* ppvObject) {
+    *ppvObject = cast(nsIWeakReference)this;
+    //XPCOM.memmove (ppvObject, new int /*long*/[] {weakReference.getAddress ()}, C.PTR_SIZEOF);
+    AddRef ();
+    return XPCOM.NS_OK;
+}
+
+/* nsIWebProgressListener */
+
+extern(System)
+nsresult OnStateChange (nsIWebProgress aWebProgress, nsIRequest aRequest, PRUint32 aStateFlags, nsresult aStatus) {
+    if ((aStateFlags & nsIWebProgressListener.STATE_IS_DOCUMENT) is 0) return XPCOM.NS_OK;
+    if ((aStateFlags & nsIWebProgressListener.STATE_START) !is 0) {
+        if (request is null) request = aRequest;
+
+        if (!awaitingNavigate) {
+            /*
+             * Add the page's nsIDOMWindow to the collection of windows that will
+             * have DOM listeners added to them later on in the page loading
+             * process.  These listeners cannot be added yet because the
+             * nsIDOMWindow is not ready to take them at this stage.
+             */
+            //int /*long*/[] result = new int /*long*/[1];
+            nsIDOMWindow window;
+            //nsIWebProgress progress = new nsIWebProgress (aWebProgress);
+            int rc = aWebProgress.GetDOMWindow (&window);
+            if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+            if (window is null) error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+            unhookedDOMWindows ~= window;
+        }
+    } else if ((aStateFlags & nsIWebProgressListener.STATE_REDIRECTING) !is 0) {
+        if (request is aRequest) request = null;
+    } else if ((aStateFlags & nsIWebProgressListener.STATE_STOP) !is 0) {
+        /*
+        * If this page's nsIDOMWindow handle is still in unhookedDOMWindows then
+        * add its DOM listeners now.  It's possible for this to happen since
+        * there is no guarantee that a STATE_TRANSFERRING state change will be
+        * received for every window in a page, which is when these listeners
+        * are typically added.
+        */
+        //int /*long*/[] result = new int /*long*/[1];
+        //nsIWebProgress progress = new nsIWebProgress (aWebProgress);
+        nsIDOMWindow domWindow;
+        int rc = aWebProgress.GetDOMWindow (&domWindow);
+        if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+        if (domWindow is null) error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+        //nsIDOMWindow domWindow = new nsIDOMWindow (result[0]);
+
+        //LONG ptrObject = new LONG (result[0]);
+        //result[0] = 0;
+        int index = unhookedDOMWindows.arrayIndexOf (domWindow);
+        if (index !is -1) {
+            nsIDOMWindow contentWindow;
+            rc = webBrowser.GetContentDOMWindow (&contentWindow);
+            if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+            if (contentWindow is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+            bool isTop = contentWindow is domWindow;
+            contentWindow.Release ();
+            //result[0] = 0;
+            nsIDOMEventTarget target;
+            rc = domWindow.QueryInterface (&nsIDOMEventTarget.IID, cast(void**)&target);
+            if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+            if (target is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+
+            //nsIDOMEventTarget target = new nsIDOMEventTarget (result[0]);
+            //result[0] = 0;
+            hookDOMListeners (target, isTop);
+            target.Release ();
+
+            /*
+            * Remove and unreference the nsIDOMWindow from the collection of windows
+            * that are waiting to have DOM listeners hooked on them. 
+            */
+            unhookedDOMWindows = unhookedDOMWindows.arrayIndexRemove (index);
+            domWindow.Release ();
+        }
+        domWindow.Release ();
+
+        /*
+        * Feature in Mozilla.  When a request is redirected (STATE_REDIRECTING),
+        * it never reaches the state STATE_STOP and it is replaced with a new request.
+        * The new request is received when it is in the state STATE_STOP.
+        * To handle this case,  the variable request is set to 0 when the corresponding
+        * request is redirected. The following request received with the state STATE_STOP
+        * - the new request resulting from the redirection - is used to send
+        * the ProgressListener.completed event.
+        */
+        if (request is aRequest || request is null) {
+            request = null;
+            if (!awaitingNavigate) {
+                StatusTextEvent event = new StatusTextEvent (browser);
+                event.display = browser.getDisplay ();
+                event.widget = browser;
+                event.text = ""; //$NON-NLS-1$
+                for (int i = 0; i < statusTextListeners.length; i++) {
+                    statusTextListeners[i].changed (event);
+                }
+                ProgressEvent event2 = new ProgressEvent (browser);
+                event2.display = browser.getDisplay ();
+                event2.widget = browser;
+                for (int i = 0; i < progressListeners.length; i++) {
+                    progressListeners[i].completed (event2);
+                }
+            }
+        }
+    } else if ((aStateFlags & nsIWebProgressListener.STATE_TRANSFERRING) !is 0) {
+        /*
+        * Hook DOM listeners to the page's nsIDOMWindow here because this is
+        * the earliest opportunity to do so.    
+        */
+        //int /*long*/[] result = new int /*long*/[1];
+       // nsIWebProgress progress = new nsIWebProgress (aWebProgress);
+        nsIDOMWindow domWindow;
+        int rc = aWebProgress.GetDOMWindow (&domWindow);
+        if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+        if (domWindow is null) error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+        //nsIDOMWindow domWindow = new nsIDOMWindow (result[0]);
+
+        //LONG ptrObject = new LONG (result[0]);
+        //result[0] = 0;
+        int index = unhookedDOMWindows.arrayIndexOf ( domWindow);
+        if (index !is -1) {
+            nsIDOMWindow contentWindow;
+            rc = webBrowser.GetContentDOMWindow (&contentWindow);
+            if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+            if (contentWindow is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+            bool isTop = contentWindow is domWindow;
+            contentWindow.Release ();
+            //result[0] = 0;
+            nsIDOMEventTarget target;
+            rc = domWindow.QueryInterface (&nsIDOMEventTarget.IID, cast(void**)&target);
+            if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+            if (target is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+
+            //nsIDOMEventTarget target = new nsIDOMEventTarget (result[0]);
+            //result[0] = 0;
+            hookDOMListeners (target, isTop);
+            target.Release ();
+
+            /*
+            * Remove and unreference the nsIDOMWindow from the collection of windows
+            * that are waiting to have DOM listeners hooked on them. 
+            */
+            unhookedDOMWindows = unhookedDOMWindows.arrayIndexRemove(index);
+            domWindow.Release ();
+        }
+        domWindow.Release ();
+    }
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult OnProgressChange (nsIWebProgress aWebProgress, nsIRequest aRequest, PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress) {
+    if (awaitingNavigate || super.progressListeners.length is 0) return XPCOM.NS_OK;
+    ProgressEvent event = new ProgressEvent (browser);
+    event.display = browser.getDisplay ();
+    event.widget = browser;
+    event.current = aCurTotalProgress;
+    event.total = aMaxTotalProgress;
+    for (int i = 0; i < super.progressListeners.length; i++) {
+        super.progressListeners[i].changed (event);
+    }
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult OnLocationChange (nsIWebProgress aWebProgress, nsIRequest aRequest, nsIURI aLocation) {
+    /*
+    * Feature in Mozilla.  When a page is loaded via setText before a previous
+    * setText page load has completed, the expected OnStateChange STATE_STOP for the
+    * original setText never arrives because it gets replaced by the OnStateChange
+    * STATE_STOP for the new request.  This results in the request field never being
+    * cleared because the original request's OnStateChange STATE_STOP is still expected
+    * (but never arrives).  To handle this case, the request field is updated to the new
+    * overriding request since its OnStateChange STATE_STOP will be received next.
+    */
+    if (request !is null && request !is aRequest) request = aRequest;
+
+    if (awaitingNavigate || locationListeners.length is 0) return XPCOM.NS_OK;
+
+    //nsIWebProgress webProgress = new nsIWebProgress (aWebProgress);
+    
+    nsIDOMWindow domWindow;
+    //int /*long*/[] aDOMWindow = new int /*long*/[1];
+    int rc = aWebProgress.GetDOMWindow (&domWindow);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (domWindow is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+    
+    //nsIDOMWindow domWindow = new nsIDOMWindow (aDOMWindow[0]);
+    //int /*long*/[] aTop = new int /*long*/[1];
+    nsIDOMWindow topWindow;
+    rc = domWindow.GetTop (&topWindow);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (topWindow is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+    domWindow.Release ();
+    
+    //nsIDOMWindow topWindow = new nsIDOMWindow (aTop[0]);
+    topWindow.Release ();
+    
+    //nsIURI location = new nsIURI (aLocation);
+    scope auto aSpec = new nsEmbedCString;
+    aLocation.GetSpec (cast(nsACString*)aSpec);
+    //int length = XPCOM.nsEmbedCString_Length (aSpec);
+    //int /*long*/ buffer = XPCOM.nsEmbedCString_get (aSpec);
+    //byte[] dest = new byte[length];
+    //XPCOM.memmove (dest, buffer, length);
+    //XPCOM.nsEmbedCString_delete (aSpec);
+    String url = aSpec.toString;
+
+    /*
+     * As of Mozilla 1.8, the first time that a page is displayed, regardless of
+     * whether it's via Browser.setURL() or Browser.setText(), the GRE navigates
+     * to about:blank and fires the corresponding navigation events.  Do not send
+     * this event on to the user since it is not expected.
+     */
+    if (!IsPre_1_8 && aRequest is null && url.startsWith (ABOUT_BLANK)) return XPCOM.NS_OK;
+
+    LocationEvent event = new LocationEvent (browser);
+    event.display = browser.getDisplay ();
+    event.widget = browser;
+    event.location = url;
+    /*
+     * If the URI indicates that the page is being rendered from memory
+     * (via setText()) then set it to about:blank to be consistent with IE.
+     */
+    if (event.location.equals (URI_FROMMEMORY)) event.location = ABOUT_BLANK;
+    event.top = topWindow is domWindow;
+    for (int i = 0; i < locationListeners.length; i++) {
+        locationListeners[i].changed (event);
+    }
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult OnStatusChange (nsIWebProgress aWebProgress, nsIRequest aRequest, nsresult aStatus, PRUnichar* aMessage) {
+    if (awaitingNavigate || statusTextListeners.length is 0) return XPCOM.NS_OK;
+    StatusTextEvent event = new StatusTextEvent (browser);
+    event.display = browser.getDisplay ();
+    event.widget = browser;
+    //int length = XPCOM.strlen_PRUnichar (aMessage);
+    //char[] dest = new char[length];
+    //XPCOM.memmove (dest, aMessage, length * 2);
+    event.text = Utf.toString(fromString16z(aMessage));
+    for (int i = 0; i < statusTextListeners.length; i++) {
+        statusTextListeners[i].changed (event);
+    }
+    return XPCOM.NS_OK;
+}       
+
+extern(System)
+nsresult OnSecurityChange (nsIWebProgress aWebProgress, nsIRequest aRequest, PRUint32 state) {
+    return XPCOM.NS_OK;
+}
+
+/* nsIWebBrowserChrome */
+
+extern(System)
+nsresult SetStatus (PRUint32 statusType, PRUnichar* status) {
+    if (awaitingNavigate || statusTextListeners.length is 0) return XPCOM.NS_OK;
+    StatusTextEvent event = new StatusTextEvent (browser);
+    event.display = browser.getDisplay ();
+    event.widget = browser;
+    //int length = XPCOM.strlen_PRUnichar (status);
+    //char[] dest = new char[length];
+    //XPCOM.memmove (dest, status, length * 2);
+    //String string = new String (dest);
+    event.text = Utf.toString(fromString16z(status));
+    for (int i = 0; i < statusTextListeners.length; i++) {
+        statusTextListeners[i].changed (event);
+    }
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult GetWebBrowser (nsIWebBrowser* aWebBrowser) {
+    //int /*long*/[] ret = new int /*long*/[1];   
+    if (webBrowser !is null) {
+        webBrowser.AddRef ();
+        *aWebBrowser = webBrowser;  
+    }
+    //XPCOM.memmove (aWebBrowser, ret, C.PTR_SIZEOF);
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult SetWebBrowser (nsIWebBrowser aWebBrowser) {
+    if (webBrowser !is null) webBrowser.Release ();
+    webBrowser = aWebBrowser !is null ? cast(nsIWebBrowser)cast(void*)aWebBrowser : null;                
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult GetChromeFlags (PRUint32* aChromeFlags) {
+    //int[] ret = new int[1];
+    *aChromeFlags = chromeFlags;
+    //XPCOM.memmove (aChromeFlags, ret, 4); /* PRUint32 */
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult SetChromeFlags (PRUint32 aChromeFlags) {
+    chromeFlags = aChromeFlags;
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult DestroyBrowserWindow () {
+    WindowEvent newEvent = new WindowEvent (browser);
+    newEvent.display = browser.getDisplay ();
+    newEvent.widget = browser;
+    for (int i = 0; i < closeWindowListeners.length; i++) {
+        closeWindowListeners[i].close (newEvent);
+    }
+    /*
+    * Note on Mozilla.  The DestroyBrowserWindow notification cannot be cancelled.
+    * The browser widget cannot be used after this notification has been received.
+    * The application is advised to close the window hosting the browser widget.
+    * The browser widget must be disposed in all cases.
+    */
+    browser.dispose ();
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult SizeBrowserTo (PRInt32 aCX, PRInt32 aCY) {
+    size = new Point (aCX, aCY);
+    bool isChrome = (chromeFlags & nsIWebBrowserChrome.CHROME_OPENAS_CHROME) !is 0;
+    if (isChrome) {
+        Shell shell = browser.getShell ();
+        shell.setSize (shell.computeSize (size.x, size.y));
+    }
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult ShowAsModal () {
+    //int /*long*/[] result = new int /*long*/[1];
+    nsIServiceManager serviceManager;
+    int rc = XPCOM.NS_GetServiceManager (&serviceManager);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (serviceManager is null) error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+
+    //nsIServiceManager serviceManager = new nsIServiceManager (result[0]);
+    //result[0] = 0;
+    //byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_CONTEXTSTACK_CONTRACTID, true);
+    nsIJSContextStack stack;
+    rc = serviceManager.GetServiceByContractID (XPCOM.NS_CONTEXTSTACK_CONTRACTID.ptr, &nsIJSContextStack.IID, cast(void**)&stack);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (stack is null) error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+    serviceManager.Release ();
+
+    //nsIJSContextStack stack = new nsIJSContextStack (result[0]);
+    //result[0] = 0;
+    rc = stack.Push (null);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+
+    Shell shell = browser.getShell ();
+    Display display = browser.getDisplay ();
+    while (!shell.isDisposed ()) {
+        if (!display.readAndDispatch ()) display.sleep ();
+    }
+    JSContext* result;
+    rc = stack.Pop (&result);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    stack.Release ();
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult IsWindowModal (PRBool* retval) {
+    *retval = (chromeFlags & nsIWebBrowserChrome.CHROME_MODAL) !is 0 ? 1 : 0;
+    //XPCOM.memmove (retval, new int[] {result}, 4); /* PRBool */
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult ExitModalEventLoop (nsresult aStatus) {
+    return XPCOM.NS_OK;
+}
+
+/* nsIEmbeddingSiteWindow */ 
+
+extern(System)
+nsresult SetDimensions (PRUint32 flags, PRInt32 x, PRInt32 y, PRInt32 cx, PRInt32 cy) {
+    if ((flags & nsIEmbeddingSiteWindow.DIM_FLAGS_POSITION) !is 0) {
+        location = new Point (x, y);
+        browser.getShell ().setLocation (x, y);
+    }
+    if ((flags & nsIEmbeddingSiteWindow.DIM_FLAGS_SIZE_INNER) !is 0) {
+        browser.setSize (cx, cy);
+    }
+    if ((flags & nsIEmbeddingSiteWindow.DIM_FLAGS_SIZE_OUTER) !is 0) {
+        browser.getShell ().setSize (cx, cy);
+    }
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult GetDimensions (PRUint32 flags, PRInt32* x, PRInt32* y, PRInt32* cx, PRInt32* cy) {
+    if ((flags & nsIEmbeddingSiteWindow.DIM_FLAGS_POSITION) !is 0) {
+        Point location = browser.getShell ().getLocation ();
+        if (x !is null) *x = location.x; /* PRInt32 */
+        if (y !is null) *y = location.y; /* PRInt32 */
+    }
+    if ((flags & nsIEmbeddingSiteWindow.DIM_FLAGS_SIZE_INNER) !is 0) {
+        Point size = browser.getSize ();
+        if (cx !is null) *cx = size.x; /* PRInt32 */
+        if (cy !is null) *cy = size.y; /* PRInt32 */
+    }
+    if ((flags & nsIEmbeddingSiteWindow.DIM_FLAGS_SIZE_OUTER) !is 0) {
+        Point size = browser.getShell().getSize ();
+        if (cx !is null) *cx = size.x; /* PRInt32 */
+        if (cy !is null) *cy = size.y; /* PRInt32 */
+    }
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult SetFocus () {
+    //int /*long*/[] result = new int /*long*/[1];
+    nsIBaseWindow baseWindow;
+    int rc = webBrowser.QueryInterface (&nsIBaseWindow.IID, cast(void**)&baseWindow);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (baseWindow is null) error (XPCOM.NS_ERROR_NO_INTERFACE, __FILE__, __LINE__);
+    
+    //nsIBaseWindow baseWindow = new nsIBaseWindow (result[0]);
+    rc = baseWindow.SetFocus ();
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    baseWindow.Release ();
+
+    /*
+    * Note. Mozilla notifies here that one of the children took
+    * focus. This could or should be used to fire an SWT.FOCUS_IN
+    * event on Browser focus listeners.
+    */
+    return XPCOM.NS_OK;         
+}   
+
+extern(System)
+nsresult GetVisibility (PRBool* aVisibility) {
+    bool visible = browser.isVisible () && !browser.getShell ().getMinimized ();
+    *aVisibility = visible ? 1 : 0;
+    //XPCOM.memmove (aVisibility, new int[] {visible ? 1 : 0}, 4); /* PRBool */
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult SetVisibility (PRBool aVisibility) {
+    if (isChild) {
+        WindowEvent event = new WindowEvent (browser);
+        event.display = browser.getDisplay ();
+        event.widget = browser;
+        if (aVisibility !is 0) {
+            /*
+            * Bug in Mozilla.  When the JavaScript window.open is executed, Mozilla
+            * fires multiple SetVisibility 1 notifications.  The workaround is
+            * to ignore subsequent notifications. 
+            */
+            if (!visible) {
+                visible = true;
+                event.location = location;
+                event.size = size;
+                event.addressBar = (chromeFlags & nsIWebBrowserChrome.CHROME_LOCATIONBAR) !is 0;
+                event.menuBar = (chromeFlags & nsIWebBrowserChrome.CHROME_MENUBAR) !is 0;
+                event.statusBar = (chromeFlags & nsIWebBrowserChrome.CHROME_STATUSBAR) !is 0;
+                event.toolBar = (chromeFlags & nsIWebBrowserChrome.CHROME_TOOLBAR) !is 0;
+                for (int i = 0; i < visibilityWindowListeners.length; i++) {
+                    visibilityWindowListeners[i].show (event);
+                }
+                location = null;
+                size = null;
+            }
+        } else {
+            visible = false;
+            for (int i = 0; i < visibilityWindowListeners.length; i++) {
+                visibilityWindowListeners[i].hide (event);
+            }
+        }
+    } else {
+        visible = aVisibility !is 0;
+    }
+    return XPCOM.NS_OK;         
+}
+
+extern(System)
+nsresult GetTitle (PRUnichar** aTitle) {
+    return XPCOM.NS_OK;         
+}
+ 
+extern(System)
+nsresult SetTitle (PRUnichar* aTitle) {
+    if (awaitingNavigate || titleListeners.length is 0) return XPCOM.NS_OK;
+    TitleEvent event = new TitleEvent (browser);
+    event.display = browser.getDisplay ();
+    event.widget = browser;
+    /*
+    * To be consistent with other platforms the title event should
+    * contain the page's url if the page does not contain a <title>
+    * tag. 
+    */
+    int length = XPCOM.strlen_PRUnichar (aTitle);
+    if (length > 0) {
+        //char[] dest = new char[length];
+        //XPCOM.memmove (dest, aTitle, length * 2);
+        event.title = Utf.toString(fromString16z(aTitle));
+    } else {
+        event.title = getUrl ();
+    }
+    for (int i = 0; i < titleListeners.length; i++) {
+        titleListeners[i].changed (event);
+    }
+    return XPCOM.NS_OK;         
+}
+
+extern(System)
+nsresult GetSiteWindow (void** aSiteWindow) {
+    /*
+    * Note.  The handle is expected to be an HWND on Windows and
+    * a GtkWidget* on GTK.  This callback is invoked on Windows
+    * when the javascript window.print is invoked and the print
+    * dialog comes up. If no handle is returned, the print dialog
+    * does not come up on this platform.  
+    */
+    *aSiteWindow = cast(void*) embedHandle;
+    return XPCOM.NS_OK;         
+}  
+ 
+/* nsIWebBrowserChromeFocus */
+
+extern(System)
+nsresult FocusNextElement () {
+    /*
+    * Bug in Mozilla embedding API.  Mozilla takes back the focus after sending
+    * this event.  This prevents tabbing out of Mozilla. This behaviour can be reproduced
+    * with the Mozilla application TestGtkEmbed.  The workaround is to
+    * send the traversal notification after this callback returns.
+    */
+    browser.getDisplay ().asyncExec (new class() Runnable {
+        public void run () {
+            if (browser.isDisposed ()) return;
+            browser.traverse (SWT.TRAVERSE_TAB_NEXT);
+        }
+    });
+    return XPCOM.NS_OK;  
+}
+
+extern(System)
+nsresult FocusPrevElement () {
+    /*
+    * Bug in Mozilla embedding API.  Mozilla takes back the focus after sending
+    * this event.  This prevents tabbing out of Mozilla. This behaviour can be reproduced
+    * with the Mozilla application TestGtkEmbed.  The workaround is to
+    * send the traversal notification after this callback returns.
+    */
+    browser.getDisplay ().asyncExec (new class() Runnable {
+        public void run () {
+            if (browser.isDisposed ()) return;
+            browser.traverse (SWT.TRAVERSE_TAB_PREVIOUS);
+        }
+    });
+    return XPCOM.NS_OK;         
+}
+
+/* nsIContextMenuListener */
+
+extern(System)
+nsresult OnShowContextMenu (PRUint32 aContextFlags, nsIDOMEvent aEvent, nsIDOMNode aNode) {
+    if (awaitingNavigate) return XPCOM.NS_OK;
+
+    //nsIDOMEvent domEvent = new nsIDOMEvent (aEvent);
+    //int /*long*/[] result = new int /*long*/[1];
+    nsIDOMMouseEvent domMouseEvent;
+    int rc = aEvent.QueryInterface (&nsIDOMMouseEvent.IID, cast(void**)&domMouseEvent);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (domMouseEvent is null) error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+
+    //nsIDOMMouseEvent domMouseEvent = new nsIDOMMouseEvent (result[0]);
+    PRInt32 aScreenX, aScreenY;
+    rc = domMouseEvent.GetScreenX (&aScreenX);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    rc = domMouseEvent.GetScreenY (&aScreenY);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    domMouseEvent.Release ();
+    
+    auto event = new Event;
+    event.x = aScreenX;
+    event.y = aScreenY;
+    browser.notifyListeners (SWT.MenuDetect, event);
+    if (!event.doit) return XPCOM.NS_OK;
+    Menu menu = browser.getMenu ();
+    if (menu !is null && !menu.isDisposed ()) {
+        if (aScreenX !is event.x || aScreenY !is event.y) {
+            menu.setLocation (event.x, event.y);
+        }
+        menu.setVisible (true);
+    }
+    return XPCOM.NS_OK;         
+}
+
+/* nsIURIContentListener */
+
+extern(System)
+nsresult OnStartURIOpen (nsIURI aURI, PRBool* retval) {
+    if (awaitingNavigate || locationListeners.length is 0) {
+        *retval = 0;
+        //XPCOM.memmove (retval, new int[] {0}, 4); /* PRBool */
+        return XPCOM.NS_OK;
+    }
+    //nsIURI location = new nsIURI (aURI);
+    scope auto aSpec = new nsEmbedCString;
+    aURI.GetSpec (cast(nsACString*)aSpec);
+    //int length = XPCOM.nsEmbedCString_Length (aSpec);
+    //int /*long*/ buffer = XPCOM.nsEmbedCString_get (aSpec);
+    //buffer = XPCOM.nsEmbedCString_get (aSpec);
+    //byte[] dest = new byte[length];
+    //XPCOM.memmove (dest, buffer, length);
+    //XPCOM.nsEmbedCString_delete (aSpec);
+    String value = aSpec.toString;
+    bool doit = true;
+    if (request is null) {
+        /* 
+         * listeners should not be notified of internal transitions like "javascipt:..."
+         * because this is an implementation side-effect, not a true navigate
+         */
+        if (!value.startsWith (PREFIX_JAVASCRIPT)) {
+            LocationEvent event = new LocationEvent (browser);
+            event.display = browser.getDisplay();
+            event.widget = browser;
+            event.location = value;
+            /*
+             * If the URI indicates that the page is being rendered from memory
+             * (via setText()) then set it to about:blank to be consistent with IE.
+             */
+            if (event.location.equals (URI_FROMMEMORY)) event.location = ABOUT_BLANK;
+            event.doit = doit;
+            for (int i = 0; i < locationListeners.length; i++) {
+                locationListeners[i].changing (event);
+            }
+            doit = event.doit && !browser.isDisposed();
+        }
+    }
+    *retval = doit ? 0 : 1;
+    //XPCOM.memmove (retval, new int[] {doit ? 0 : 1}, 4); /* PRBool */
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult DoContent (char* aContentType, PRBool aIsContentPreferred, nsIRequest aRequest, nsIStreamListener* aContentHandler, PRBool* retval) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult IsPreferred (char* aContentType, char** aDesiredContentType, PRBool* retval) {
+    bool preferred = false;
+    auto size = strlen (aContentType);
+    if (size > 0) {
+        //byte[] typeBytes = new byte[size + 1];
+        //XPCOM.memmove (typeBytes, aContentType, size);
+        String contentType = fromStringz(aContentType);
+
+        /* do not attempt to handle known problematic content types */
+        if (!contentType.equals (XPCOM.CONTENT_MAYBETEXT) && !contentType.equals (XPCOM.CONTENT_MULTIPART)) {
+            /* determine whether browser can handle the content type */
+            // int /*long*/[] result = new int /*long*/[1];
+            nsIServiceManager serviceManager;
+            int rc = XPCOM.NS_GetServiceManager (&serviceManager);
+            if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+            if (serviceManager is null) error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+            //nsIServiceManager serviceManager = new nsIServiceManager (result[0]);
+            //result[0] = 0;
+
+            /* First try to use the nsIWebNavigationInfo if it's available (>= mozilla 1.8) */
+            //byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_WEBNAVIGATIONINFO_CONTRACTID, true);
+            nsIWebNavigationInfo info;
+            rc = serviceManager.GetServiceByContractID (XPCOM.NS_WEBNAVIGATIONINFO_CONTRACTID.ptr, &nsIWebNavigationInfo.IID, cast(void**)&info);
+            if (rc is XPCOM.NS_OK) {
+                //byte[] bytes = MozillaDelegate.wcsToMbcs (null, contentType, true);
+                scope auto typePtr = new nsEmbedCString(contentType);
+                //nsIWebNavigationInfo info = new nsIWebNavigationInfo (result[0]);
+                //result[0] = 0;
+                PRUint32 isSupportedResult; /* PRUint32 */
+                rc = info.IsTypeSupported (cast(nsACString*)typePtr, null, &isSupportedResult);
+                if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+                info.Release ();
+                //XPCOM.nsEmbedCString_delete (typePtr);
+                preferred = isSupportedResult !is 0;
+            } else {
+                /* nsIWebNavigationInfo is not available, so do the type lookup */
+                //result[0] = 0;
+                nsICategoryManager categoryManager;
+                rc = serviceManager.GetService (&XPCOM.NS_CATEGORYMANAGER_CID, &nsICategoryManager.IID, cast(void**)&categoryManager);
+                if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+                if (categoryManager is null) error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+
+                //nsICategoryManager categoryManager = new nsICategoryManager (result[0]);
+                //result[0] = 0;
+                char* categoryBytes = "Gecko-Content-Viewers"; //$NON-NLS-1$
+                char* result;
+                rc = categoryManager.GetCategoryEntry (categoryBytes, aContentType, &result);
+                categoryManager.Release ();
+                /* if no viewer for the content type is registered then rc is XPCOM.NS_ERROR_NOT_AVAILABLE */
+                preferred = rc is XPCOM.NS_OK;
+            }
+            serviceManager.Release ();
+        }
+    }
+
+    *retval = preferred ? 1 : 0; /* PRBool */
+    if (preferred) {
+        *aDesiredContentType = null;
+    }
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult CanHandleContent (char* aContentType, PRBool aIsContentPreferred, char** aDesiredContentType, PRBool* retval) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult GetLoadCookie (nsISupports* aLoadCookie) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult SetLoadCookie (nsISupports aLoadCookie) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult GetParentContentListener (nsIURIContentListener* aParentContentListener) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult SetParentContentListener (nsIURIContentListener aParentContentListener) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* nsITooltipListener */
+
+extern(System)
+nsresult OnShowTooltip (PRInt32 aXCoords, PRInt32 aYCoords, PRUnichar* aTipText) {
+    if (awaitingNavigate) return XPCOM.NS_OK;
+
+    //int length = XPCOM.strlen_PRUnichar (aTipText);
+    //char[] dest = new char[length];
+    //XPCOM.memmove (dest, aTipText, length * 2);
+    String text = Utf.toString(fromString16z(aTipText));
+    if (tip !is null && !tip.isDisposed ()) tip.dispose ();
+    Display display = browser.getDisplay ();
+    Shell parent = browser.getShell ();
+    tip = new Shell (parent, SWT.ON_TOP);
+    tip.setLayout (new FillLayout());
+    Label label = new Label (tip, SWT.CENTER);
+    label.setForeground (display.getSystemColor (SWT.COLOR_INFO_FOREGROUND));
+    label.setBackground (display.getSystemColor (SWT.COLOR_INFO_BACKGROUND));
+    label.setText (text);
+    /*
+    * Bug in Mozilla embedded API.  Tooltip coordinates are wrong for 
+    * elements inside an inline frame (IFrame tag).  The workaround is 
+    * to position the tooltip based on the mouse cursor location.
+    */
+    Point point = display.getCursorLocation ();
+    /* Assuming cursor is 21x21 because this is the size of
+     * the arrow cursor on Windows
+     */ 
+    point.y += 21;
+    tip.setLocation (point);
+    tip.pack ();
+    tip.setVisible (true);
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult OnHideTooltip () {
+    if (tip !is null && !tip.isDisposed ()) tip.dispose ();
+    tip = null;
+    return XPCOM.NS_OK;
+}
+
+/* nsIDOMEventListener */
+
+extern(System)
+nsresult HandleEvent (nsIDOMEvent event) {
+    //nsIDOMEvent domEvent = new nsIDOMEvent (event);
+
+    scope auto type = new nsEmbedString;
+    int rc = event.GetType (cast(nsAString*)type);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    //int length = XPCOM.nsEmbedString_Length (type);
+    //int /*long*/ buffer = XPCOM.nsEmbedString_get (type);
+    //char[] chars = new char[length];
+    //XPCOM.memmove (chars, buffer, length * 2);
+    String typeString = type.toString;
+    //XPCOM.nsEmbedString_delete (type);
+
+    if (XPCOM.DOMEVENT_UNLOAD.equals (typeString)) {
+        //int /*long*/[] result = new int /*long*/[1];
+        nsIDOMEventTarget target;
+        rc = event.GetCurrentTarget (&target);
+        if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+        if (target is null) error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+
+        //nsIDOMEventTarget target = new nsIDOMEventTarget (result[0]);
+        unhookDOMListeners (target);
+        target.Release ();
+        return XPCOM.NS_OK;
+    }
+
+    if (XPCOM.DOMEVENT_FOCUS.equals (typeString)) {
+        mozDelegate.handleFocus ();
+        return XPCOM.NS_OK;
+    }
+
+    if (XPCOM.DOMEVENT_KEYDOWN.equals (typeString)) {
+        //int /*long*/[] result = new int /*long*/[1];
+        nsIDOMKeyEvent domKeyEvent;
+        rc = event.QueryInterface (&nsIDOMKeyEvent.IID, cast(void**)&domKeyEvent);
+        if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+        if (domKeyEvent is null) error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+        //nsIDOMKeyEvent domKeyEvent = new nsIDOMKeyEvent (result[0]);
+        //result[0] = 0;
+
+        PRUint32 aKeyCode; /* PRUint32 */
+        rc = domKeyEvent.GetKeyCode (&aKeyCode);
+        if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+        int keyCode = super.translateKey (aKeyCode);
+
+        /*
+        * if keyCode is lastKeyCode then either a repeating key like Shift
+        * is being held or a key for which key events are not sent has been
+        * pressed.  In both of these cases a KeyDown should not be sent.
+        */
+        if (keyCode !is lastKeyCode) {
+            lastKeyCode = keyCode;
+            switch (keyCode) {
+                case SWT.SHIFT:
+                case SWT.CONTROL:
+                case SWT.ALT:
+                case SWT.CAPS_LOCK:
+                case SWT.NUM_LOCK:
+                case SWT.SCROLL_LOCK:
+                case SWT.COMMAND: {
+                    /* keypress events will not be received for these keys, so send KeyDowns for them now */
+                    PRBool aAltKey, aCtrlKey, aShiftKey, aMetaKey; /* PRBool */
+                    rc = domKeyEvent.GetAltKey (&aAltKey);
+                    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+                    rc = domKeyEvent.GetCtrlKey (&aCtrlKey);
+                    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+                    rc = domKeyEvent.GetShiftKey (&aShiftKey);
+                    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+                    rc = domKeyEvent.GetMetaKey (&aMetaKey);
+                    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+
+                    Event keyEvent = new Event ();
+                    keyEvent.widget = browser;
+                    keyEvent.type = SWT.KeyDown;
+                    keyEvent.keyCode = keyCode;
+                    keyEvent.stateMask = (aAltKey !is 0 ? SWT.ALT : 0) | (aCtrlKey !is 0 ? SWT.CTRL : 0) | (aShiftKey !is 0 ? SWT.SHIFT : 0) | (aMetaKey !is 0 ? SWT.COMMAND : 0);
+                    keyEvent.stateMask &= ~keyCode;     /* remove current keydown if it's a state key */
+                    browser.notifyListeners (keyEvent.type, keyEvent);
+                    if (!keyEvent.doit) {
+                        event.PreventDefault ();
+                    }
+                    break;
+                }
+                default: {
+                    /* 
+                    * If the keydown has Meta (but not Meta+Ctrl) as a modifier then send a KeyDown event for it here
+                    * because a corresponding keypress event will not be received for it from the DOM.  If the keydown
+                    * does not have Meta as a modifier, or has Meta+Ctrl as a modifier, then then do nothing here
+                    * because its KeyDown event will be sent from the keypress listener.
+                    */
+                    PRBool aMetaKey; /* PRBool */
+                    rc = domKeyEvent.GetMetaKey (&aMetaKey);
+                    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+                    if (aMetaKey !is 0) {
+                        PRBool aCtrlKey; /* PRBool */
+                        rc = domKeyEvent.GetCtrlKey (&aCtrlKey);
+                        if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+                        if (aCtrlKey is 0) {
+                            PRBool aAltKey, aShiftKey; /* PRBool */
+                            rc = domKeyEvent.GetAltKey (&aAltKey);
+                            if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+                            rc = domKeyEvent.GetShiftKey (&aShiftKey);
+                            if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+
+                            Event keyEvent = new Event ();
+                            keyEvent.widget = browser;
+                            keyEvent.type = SWT.KeyDown;
+                            keyEvent.keyCode = lastKeyCode;
+                            keyEvent.stateMask = (aAltKey !is 0 ? SWT.ALT : 0) | (aCtrlKey !is 0? SWT.CTRL : 0) | (aShiftKey !is 0? SWT.SHIFT : 0) | (aMetaKey !is 0? SWT.COMMAND : 0);
+                            browser.notifyListeners (keyEvent.type, keyEvent);
+                            if (!keyEvent.doit) {
+                                event.PreventDefault ();
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        domKeyEvent.Release ();
+        return XPCOM.NS_OK;
+    }
+
+    if (XPCOM.DOMEVENT_KEYPRESS.equals (typeString)) {
+        /*
+        * if keydown could not determine a keycode for this key then it's a
+        * key for which key events are not sent (eg.- the Windows key)
+        */
+        if (lastKeyCode is 0) return XPCOM.NS_OK;
+
+        /*
+        * On linux only, unexpected keypress events are received for some
+        * modifier keys.  The workaround is to ignore these events since
+        * KeyDown events are sent for these keys in the keydown listener.  
+        */
+        switch (lastKeyCode) {
+            case SWT.CAPS_LOCK:
+            case SWT.NUM_LOCK:
+            case SWT.SCROLL_LOCK: return XPCOM.NS_OK;
+            default: break;
+        }
+
+        //int /*long*/[] result = new int /*long*/[1];
+        nsIDOMKeyEvent domKeyEvent;
+        rc = event.QueryInterface (&nsIDOMKeyEvent.IID, cast(void**)&domKeyEvent);
+        if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+        if (domKeyEvent is null) error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+        //nsIDOMKeyEvent domKeyEvent = new nsIDOMKeyEvent (result[0]);
+        //result[0] = 0;
+
+        PRBool aAltKey, aCtrlKey, aShiftKey, aMetaKey; /* PRBool */
+        rc = domKeyEvent.GetAltKey (&aAltKey);
+        if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+        rc = domKeyEvent.GetCtrlKey (&aCtrlKey);
+        if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+        rc = domKeyEvent.GetShiftKey (&aShiftKey);
+        if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+        rc = domKeyEvent.GetMetaKey (&aMetaKey);
+        if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+        domKeyEvent.Release ();
+
+        PRUint32 aCharCode; /* PRUint32 */
+        rc = domKeyEvent.GetCharCode (&aCharCode);
+        if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+        lastCharCode = aCharCode;
+        if (lastCharCode is 0) {
+            switch (lastKeyCode) {
+                case SWT.TAB: lastCharCode = SWT.TAB; break;
+                case SWT.CR: lastCharCode = SWT.CR; break;
+                case SWT.BS: lastCharCode = SWT.BS; break;
+                case SWT.ESC: lastCharCode = SWT.ESC; break;
+                case SWT.DEL: lastCharCode = SWT.DEL; break;
+                default: break;
+            }
+        }
+        if (aCtrlKey !is 0 && (0 <= lastCharCode && lastCharCode <= 0x7F)) {
+            if ('a'  <= lastCharCode && lastCharCode <= 'z') lastCharCode -= 'a' - 'A';
+            if (64 <= lastCharCode && lastCharCode <= 95) lastCharCode -= 64;
+        }
+
+        Event keyEvent = new Event ();
+        keyEvent.widget = browser;
+        keyEvent.type = SWT.KeyDown;
+        keyEvent.keyCode = lastKeyCode;
+        keyEvent.character = cast(wchar)lastCharCode;
+        keyEvent.stateMask = (aAltKey !is 0 ? SWT.ALT : 0) | (aCtrlKey !is 0 ? SWT.CTRL : 0) | (aShiftKey !is 0 ? SWT.SHIFT : 0) | (aMetaKey !is 0 ? SWT.COMMAND : 0);
+        browser.notifyListeners (keyEvent.type, keyEvent);
+        if (!keyEvent.doit) {
+            event.PreventDefault ();
+        }
+        return XPCOM.NS_OK;
+    }
+
+    if (XPCOM.DOMEVENT_KEYUP.equals (typeString)) {
+        //int /*long*/[] result = new int /*long*/[1];
+        nsIDOMKeyEvent domKeyEvent;
+        rc = event.QueryInterface (&nsIDOMKeyEvent.IID, cast(void**)&domKeyEvent);
+        if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+        if (domKeyEvent is null) error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+        //nsIDOMKeyEvent domKeyEvent = new nsIDOMKeyEvent (result[0]);
+        //result[0] = 0;
+
+        PRUint32 aKeyCode; /* PRUint32 */
+        rc = domKeyEvent.GetKeyCode (&aKeyCode);
+        if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+        int keyCode = super.translateKey (aKeyCode);
+        if (keyCode is 0) {
+            /* indicates a key for which key events are not sent */
+            domKeyEvent.Release ();
+            return XPCOM.NS_OK;
+        }
+        if (keyCode !is lastKeyCode) {
+            /* keyup does not correspond to the last keydown */
+            lastKeyCode = keyCode;
+            lastCharCode = 0;
+        }
+
+        PRBool aAltKey, aCtrlKey, aShiftKey, aMetaKey; /* PRBool */
+        rc = domKeyEvent.GetAltKey (&aAltKey);
+        if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+        rc = domKeyEvent.GetCtrlKey (&aCtrlKey);
+        if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+        rc = domKeyEvent.GetShiftKey (&aShiftKey);
+        if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+        rc = domKeyEvent.GetMetaKey (&aMetaKey);
+        if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+        domKeyEvent.Release ();
+
+        Event keyEvent = new Event ();
+        keyEvent.widget = browser;
+        keyEvent.type = SWT.KeyUp;
+        keyEvent.keyCode = lastKeyCode;
+        keyEvent.character = cast(wchar)lastCharCode;
+        keyEvent.stateMask = (aAltKey !is 0 ? SWT.ALT : 0) | (aCtrlKey !is 0 ? SWT.CTRL : 0) | (aShiftKey !is 0 ? SWT.SHIFT : 0) | (aMetaKey !is 0 ? SWT.COMMAND : 0);
+        switch (lastKeyCode) {
+            case SWT.SHIFT:
+            case SWT.CONTROL:
+            case SWT.ALT:
+            case SWT.COMMAND: {
+                keyEvent.stateMask |= lastKeyCode;
+            }
+            default: break;
+        }
+        browser.notifyListeners (keyEvent.type, keyEvent);
+        if (!keyEvent.doit) {
+            event.PreventDefault ();
+        }
+        lastKeyCode = lastCharCode = 0;
+        return XPCOM.NS_OK;
+    }
+
+    /* mouse event */
+
+    //int /*long*/[] result = new int /*long*/[1];
+    nsIDOMMouseEvent domMouseEvent;
+    rc = event.QueryInterface (&nsIDOMMouseEvent.IID, cast(void**)&domMouseEvent);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    if (domMouseEvent is null) error (XPCOM.NS_NOINTERFACE, __FILE__, __LINE__);
+    //nsIDOMMouseEvent domMouseEvent = new nsIDOMMouseEvent (result[0]);
+    //result[0] = 0;
+
+    /*
+     * MouseOver and MouseOut events are fired any time the mouse enters or exits
+     * any element within the Browser.  To ensure that SWT events are only
+     * fired for mouse movements into or out of the Browser, do not fire an
+     * event if the element being exited (on MouseOver) or entered (on MouseExit)
+     * is within the Browser.
+     */
+    if (XPCOM.DOMEVENT_MOUSEOVER.equals (typeString) || XPCOM.DOMEVENT_MOUSEOUT.equals (typeString)) {
+        nsIDOMEventTarget eventTarget;
+        rc = domMouseEvent.GetRelatedTarget (&eventTarget);
+        if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+        if (eventTarget !is null) {
+            domMouseEvent.Release ();
+            return XPCOM.NS_OK;
+        }
+    }
+
+    PRInt32 aClientX, aClientY, aDetail; /* PRInt32 */
+    rc = domMouseEvent.GetClientX (&aClientX);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    rc = domMouseEvent.GetClientY (&aClientY);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    rc = domMouseEvent.GetDetail (&aDetail);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    PRUint16 aButton; /* PRUint16 */
+    rc = domMouseEvent.GetButton (&aButton);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    PRBool aAltKey, aCtrlKey, aShiftKey, aMetaKey; /* PRBool */
+    rc = domMouseEvent.GetAltKey (&aAltKey);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    rc = domMouseEvent.GetCtrlKey (&aCtrlKey);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    rc = domMouseEvent.GetShiftKey (&aShiftKey);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    rc = domMouseEvent.GetMetaKey (&aMetaKey);
+    if (rc !is XPCOM.NS_OK) error (rc, __FILE__, __LINE__);
+    domMouseEvent.Release ();
+
+    Event mouseEvent = new Event ();
+    mouseEvent.widget = browser;
+    mouseEvent.x = aClientX; mouseEvent.y = aClientY;
+    mouseEvent.stateMask = (aAltKey !is 0 ? SWT.ALT : 0) | (aCtrlKey !is 0 ? SWT.CTRL : 0) | (aShiftKey !is 0 ? SWT.SHIFT : 0) | (aMetaKey !is 0 ? SWT.COMMAND : 0);
+
+    if (XPCOM.DOMEVENT_MOUSEDOWN.equals (typeString)) {
+        mozDelegate.handleMouseDown ();
+        mouseEvent.type = SWT.MouseDown;
+        mouseEvent.button = aButton + 1;
+        mouseEvent.count = aDetail;
+    } else if (XPCOM.DOMEVENT_MOUSEUP.equals (typeString)) {
+        /*
+         * Bug on OSX.  For some reason multiple mouseup events come from the DOM
+         * when button 3 is released on OSX.  The first of these events has a count
+         * detail and the others do not.  The workaround is to not fire received
+         * button 3 mouseup events that do not have a count since mouse events
+         * without a click count are not valid.
+         */
+        int button = aButton + 1;
+        int count = aDetail;
+        if (count is 0 && button is 3) return XPCOM.NS_OK;
+        mouseEvent.type = SWT.MouseUp;
+        mouseEvent.button = button;
+        mouseEvent.count = count;
+    } else if (XPCOM.DOMEVENT_MOUSEMOVE.equals (typeString)) {
+        mouseEvent.type = SWT.MouseMove;
+    } else if (XPCOM.DOMEVENT_MOUSEWHEEL.equals (typeString)) {
+        mouseEvent.type = SWT.MouseWheel;
+        mouseEvent.count = -aDetail;
+    } else if (XPCOM.DOMEVENT_MOUSEOVER.equals (typeString)) {
+        mouseEvent.type = SWT.MouseEnter;
+    } else if (XPCOM.DOMEVENT_MOUSEOUT.equals (typeString)) {
+        mouseEvent.type = SWT.MouseExit;
+    } else if (XPCOM.DOMEVENT_MOUSEDRAG.equals (typeString)) {
+        mouseEvent.type = SWT.DragDetect;
+        mouseEvent.button = aButton + 1;
+        switch (mouseEvent.button) {
+            case 1: mouseEvent.stateMask |= SWT.BUTTON1; break;
+            case 2: mouseEvent.stateMask |= SWT.BUTTON2; break;
+            case 3: mouseEvent.stateMask |= SWT.BUTTON3; break;
+            case 4: mouseEvent.stateMask |= SWT.BUTTON4; break;
+            case 5: mouseEvent.stateMask |= SWT.BUTTON5; break;
+            default: break;
+        }
+    }
+
+    browser.notifyListeners (mouseEvent.type, mouseEvent);
+    if (aDetail is 2 && XPCOM.DOMEVENT_MOUSEDOWN.equals (typeString)) {
+        mouseEvent = new Event ();
+        mouseEvent.widget = browser;
+        mouseEvent.x = aClientX; mouseEvent.y = aClientY;
+        mouseEvent.stateMask = (aAltKey !is 0 ? SWT.ALT : 0) | (aCtrlKey !is 0 ? SWT.CTRL : 0) | (aShiftKey !is 0 ? SWT.SHIFT : 0) | (aMetaKey !is 0 ? SWT.COMMAND : 0);
+        mouseEvent.type = SWT.MouseDoubleClick;
+        mouseEvent.button = aButton + 1;
+        mouseEvent.count = aDetail;
+        browser.notifyListeners (mouseEvent.type, mouseEvent);  
+    }
+    return XPCOM.NS_OK;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/MozillaDelegate.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,216 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.MozillaDelegate;
+
+import java.lang.all;
+
+import tango.io.Console;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.Converter;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Widget;
+
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.browser.Mozilla;
+
+import org.eclipse.swt.internal.c.glib_object;
+
+class MozillaDelegate {
+    Browser browser;
+    gpointer mozillaHandle;
+    GtkWidget* embedHandle;
+    bool hasFocus;
+    Listener listener;
+    //static Callback eventCallback;
+    // static int /*long*/ eventProc;
+    static const gpointer STOP_PROPOGATE = cast(gpointer)1;
+    static bool IsLinux;
+
+static this () {
+    String osName = System.getProperty ("os.name").toLowerCase(); //$NON-NLS-1$
+    IsLinux = osName.startsWith("linux"); //$NON-NLS-1$
+}
+
+this (Browser browser) {
+    //super ();
+    if (!IsLinux) {
+        browser.dispose ();
+        SWT.error (SWT.ERROR_NO_HANDLES, null, " [Unsupported platform]"); //$NON-NLS-1$
+    }
+    this.browser = browser;
+}
+
+static extern(System) int eventProc (GtkWidget* handle, GdkEvent* gdkEvent, gpointer pointer) {
+    GtkWidget* parent = OS.gtk_widget_get_parent (handle);
+    parent = OS.gtk_widget_get_parent (parent);
+    if (parent is null) return 0;
+    Widget widget = Display.getCurrent ().findWidget (parent);
+    if (widget !is null && (cast(Browser)widget) !is null) {
+        return (cast(Mozilla)(cast(Browser)widget).webBrowser).mozDelegate.gtk_event (handle, gdkEvent, pointer);
+    }
+    return 0;
+}
+
+static Browser findBrowser (GtkWidget* handle) {
+    /*
+    * Note.  On GTK, Mozilla is embedded into a GtkHBox handle
+    * and not directly into the parent Composite handle.
+    */
+    GtkWidget* parent = OS.gtk_widget_get_parent (handle);
+    Display display = Display.getCurrent ();
+    return cast(Browser)display.findWidget (parent); 
+}
+/*
+static char[] mbcsToWcs (String codePage, byte [] buffer) {
+    return Converter.mbcsToWcs (codePage, buffer);
+}
+
+static byte[] wcsToMbcs (String codePage, String string, bool terminate) {
+    return Converter.wcsToMbcs (codePage, string, terminate);
+}
+*/
+GtkWidget* getHandle () {
+    /*
+    * Bug in Mozilla Linux GTK.  Embedding Mozilla into a GtkFixed
+    * handle causes problems with some Mozilla plug-ins.  For some
+    * reason, the Flash plug-in causes the child of the GtkFixed
+    * handle to be resized to 1 when the Flash document is loaded.
+    * That could be due to gtk_container_resize_children being called
+    * by Mozilla - or one of its plug-ins - on the GtkFixed handle,
+    * causing the child of the GtkFixed handle to be resized to 1.
+    * The workaround is to embed Mozilla into a GtkHBox handle.
+    */
+    embedHandle = OS.gtk_hbox_new (false, 0);
+    OS.gtk_container_add (browser.handle, embedHandle);
+    OS.gtk_widget_show (embedHandle);
+    return embedHandle;
+}
+
+String getLibraryName () {
+    return "libxpcom.so"; //$NON-NLS-1$
+}
+
+/*
+String getSWTInitLibraryName () {
+    return "swt-xpcominit"; //$NON-NLS-1$
+}
+*/
+
+int gtk_event (GtkWidget* handle, GdkEvent* event, gpointer pointer) {
+    if (event.type is OS.GDK_BUTTON_PRESS) {
+        if (!hasFocus) browser.setFocus ();
+    }
+
+    /* 
+    * Stop the propagation of events that are not consumed by Mozilla, before
+    * they reach the parent embedder.  These event have already been received.
+    */
+    if (pointer is STOP_PROPOGATE) return 1;
+    return 0;
+}
+
+void handleFocus () {
+    if (hasFocus) return;
+    hasFocus = true;
+    listener = new class() Listener {
+        public void handleEvent (Event event) {
+            if (event.widget is browser) return;
+            (cast(Mozilla)(browser.webBrowser)).Deactivate ();
+            hasFocus = false;
+            browser.getDisplay ().removeFilter (SWT.FocusIn, this);
+            browser.getShell ().removeListener (SWT.Deactivate, this);
+            listener = null;
+        }
+    };
+    browser.getDisplay ().addFilter (SWT.FocusIn, listener);
+    browser.getShell ().addListener (SWT.Deactivate, listener);
+}
+
+void handleMouseDown () {
+    int shellStyle = browser.getShell ().getStyle (); 
+    if ((shellStyle & SWT.ON_TOP) !is 0 && (((shellStyle & SWT.NO_FOCUS) is 0) || ((browser.getStyle () & SWT.NO_FOCUS) is 0))) {
+        browser.getDisplay ().asyncExec (new class() Runnable {
+            public void run () {
+                if (browser is null || browser.isDisposed ()) return;
+                (cast(Mozilla)(browser.webBrowser)).Activate ();
+            }
+        });
+    }
+}
+
+bool hookEnterExit () {
+    return false;
+}
+
+void init () { /*
+    if (eventCallback is null) {
+        eventCallback = new Callback (getClass (), "eventProc", 3); //$NON-NLS-1$
+        eventProc = eventCallback.getAddress ();
+        if (eventProc is null) {
+            browser.dispose ();
+            Mozilla.error (SWT.ERROR_NO_MORE_CALLBACKS);
+        }
+    } */
+
+    /*
+    * Feature in Mozilla.  GtkEvents such as key down, key pressed may be consumed
+    * by Mozilla and never be received by the parent embedder.  The workaround
+    * is to find the top Mozilla gtk widget that receives all the Mozilla GtkEvents,
+    * i.e. the first child of the parent embedder. Then hook event callbacks and
+    * forward the event to the parent embedder before Mozilla received and consumed
+    * them.
+    */
+    GList* list = OS.gtk_container_get_children (embedHandle);
+    if (list !is null) {
+        mozillaHandle = OS.g_list_data (list);
+        OS.g_list_free (list);
+        
+        if (mozillaHandle !is null) {          
+            /* Note. Callback to get events before Mozilla receives and consumes them. */
+            OS.g_signal_connect (mozillaHandle, OS.event.toStringz(), cast(GCallback)&eventProc, null);
+            
+            /* 
+            * Note.  Callback to get the events not consumed by Mozilla - and to block 
+            * them so that they don't get propagated to the parent handle twice.  
+            * This hook is set after Mozilla and is therefore called after Mozilla's 
+            * handler because GTK dispatches events in their order of registration.
+            */
+            OS.g_signal_connect (mozillaHandle, OS.key_press_event.toStringz(), cast(GCallback)&eventProc, STOP_PROPOGATE);
+            OS.g_signal_connect (mozillaHandle, OS.key_release_event.toStringz(), cast(GCallback)&eventProc, STOP_PROPOGATE);
+            OS.g_signal_connect (mozillaHandle, OS.button_press_event.toStringz(), cast(GCallback)&eventProc, STOP_PROPOGATE);
+        }
+    }
+}
+
+bool needsSpinup () {
+    return true;
+}
+
+void onDispose (GtkWidget* embedHandle) {
+    if (listener !is null) {
+        browser.getDisplay ().removeFilter (SWT.FocusIn, listener);
+        browser.getShell ().removeListener (SWT.Deactivate, listener);
+        listener = null;
+    }
+    browser = null;
+}
+
+void setSize (GtkWidget* embedHandle, int width, int height) {
+    OS.gtk_widget_set_size_request (embedHandle, width, height);
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/OpenWindowListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.OpenWindowListener;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.SWTEventListener;
+import org.eclipse.swt.browser.WindowEvent;
+
+/** 
+ * This listener interface may be implemented in order to receive
+ * a {@link WindowEvent} notification when a new {@link Browser}
+ * needs to be provided by the application.
+ * 
+ * @see Browser#addOpenWindowListener(OpenWindowListener)
+ * @see Browser#removeOpenWindowListener(OpenWindowListener)
+ * @see CloseWindowListener
+ * @see VisibilityWindowListener
+ * 
+ * @since 3.0
+ */
+public interface OpenWindowListener : SWTEventListener {
+
+/**
+ * This method is called when a new window needs to be created.
+ * <p>
+ * A particular <code>Browser</code> can be passed to the event.browser
+ * field to host the content of a new window.
+ * <p>
+ * A standalone system browser is used to host the new window
+ * if the event.required field value is false and if the event.browser 
+ * field is left <code>null</code>. The event.required field
+ * is true on platforms that don't support a standalone system browser for
+ * new window requests. 
+ * <p>
+ * The navigation is cancelled if the event.required field is set to
+ * true and the event.browser field is left <code>null</code>.
+ * <p>
+ * <p>The following fields in the <code>WindowEvent</code> apply:
+ * <ul>
+ * <li>(in/out) required true if the platform requires the user to provide a
+ * <code>Browser</code> to handle the new window or false otherwise.
+ * <li>(out) browser the new <code>Browser</code> that will host the 
+ * content of the new window.
+ * <li>(in) widget the <code>Browser</code> that is requesting to open a 
+ * new window
+ * </ul>
+ * 
+ * @param event the <code>WindowEvent</code> that needs to be passed a new
+ * <code>Browser</code> to handle the new window request
+ * 
+ * @since 3.0
+ */ 
+public void open(WindowEvent event);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/ProgressAdapter.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.ProgressAdapter;
+
+import java.lang.all;
+
+import org.eclipse.swt.browser.ProgressEvent;
+import org.eclipse.swt.browser.ProgressListener;
+
+/**
+ * This adapter class provides default implementations for the
+ * methods described by the {@link ProgressListener} interface.
+ * <p>
+ * Classes that wish to deal with {@link ProgressEvent}'s can
+ * extend this class and override only the methods which they are
+ * interested in.
+ * </p>
+ * 
+ * @since 3.0
+ */
+public abstract class ProgressAdapter : ProgressListener {
+ 
+public void changed(ProgressEvent event) {
+}
+
+public void completed(ProgressEvent event) {
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/ProgressEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.ProgressEvent;
+
+import tango.text.convert.Format;
+
+import java.lang.all;
+
+import org.eclipse.swt.events.TypedEvent;
+import org.eclipse.swt.widgets.Widget;
+
+/**
+ * A <code>ProgressEvent</code> is sent by a {@link Browser} to
+ * {@link ProgressListener}'s when a progress is made during the
+ * loading of the current URL or when the loading of the current
+ * URL has been completed.
+ * 
+ * @since 3.0
+ */
+public class ProgressEvent : TypedEvent {
+    /** current value */
+    public int current;
+    /** total value */
+    public int total;
+    
+    static final long serialVersionUID = 3977018427045393972L;
+
+this(Widget w) {
+    super(w);
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+public override String toString() {
+    return Format( "{} {current = {}, total = {}}", 
+        super.toString[1 .. $-2], current, total );  
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/ProgressListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.ProgressListener;
+
+import java.lang.all;
+
+import org.eclipse.swt.browser.ProgressEvent;
+import org.eclipse.swt.internal.SWTEventListener;
+
+/**
+ * This listener interface may be implemented in order to receive
+ * a {@link ProgressEvent} notification when a {@link Browser}
+ * makes a progress in loading the current URL or when the
+ * current URL has been loaded.
+ * 
+ * @see Browser#addProgressListener(ProgressListener)
+ * @see Browser#removeProgressListener(ProgressListener)
+ * @see Browser#getUrl()
+ * 
+ * @since 3.0
+ */
+public interface ProgressListener : SWTEventListener {
+    
+/**
+ * This method is called when a progress is made during the loading of the 
+ * current location.
+ * <p>
+ *
+ * <p>The following fields in the <code>ProgressEvent</code> apply:
+ * <ul>
+ * <li>(in) current the progress for the location currently being loaded
+ * <li>(in) total the maximum progress for the location currently being loaded
+ * <li>(in) widget the <code>Browser</code> whose current URL is being loaded
+ * </ul>
+ * 
+ * @param event the <code>ProgressEvent</code> related to the loading of the
+ * current location of a <code>Browser</code>
+ * 
+ * @since 3.0
+ */   
+public void changed(ProgressEvent event);
+    
+/**
+ * This method is called when the current location has been completely loaded.
+ * <p>
+ *
+ * <p>The following fields in the <code>ProgressEvent</code> apply:
+ * <ul>
+ * <li>(in) widget the <code>Browser</code> whose current URL has been loaded
+ * </ul>
+ * 
+ * @param event the <code>ProgressEvent</code> related to the <code>Browser</code>
+ * that has loaded its current URL.
+ * 
+ * @since 3.0
+ */
+public void completed(ProgressEvent event);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/PromptDialog.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,314 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.PromptDialog;
+
+import java.lang.all;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Dialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Monitor;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Widget;
+
+class PromptDialog : Dialog {
+    
+    this(Shell parent, int style) {
+        super(parent, style);
+    }
+    
+    this(Shell parent) {
+        this(parent, 0);
+    }
+    
+    void alertCheck(String title, String text, String check, ref int checkValue) {
+        Shell parent = getParent();
+        /* final */ Shell shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
+        if (title !is null) shell.setText(title);
+        GridLayout gridLayout = new GridLayout();
+        shell.setLayout(gridLayout);
+        Label label = new Label(shell, SWT.WRAP);
+        label.setText(text);
+        GridData data = new GridData();
+        org.eclipse.swt.widgets.Monitor.Monitor monitor = parent.getMonitor();
+        int maxWidth = monitor.getBounds().width * 2 / 3;
+        int width = label.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
+        data.widthHint = Math.min(width, maxWidth);
+        data.horizontalAlignment = GridData.FILL;
+        data.grabExcessHorizontalSpace = true;
+        label.setLayoutData (data);
+
+        final Button checkButton = check !is null ? new Button(shell, SWT.CHECK) : null;
+        if (checkButton !is null) {
+            checkButton.setText(check);
+            checkButton.setSelection(checkValue !is 0);
+            data = new GridData ();
+            data.horizontalAlignment = GridData.BEGINNING;
+            checkButton.setLayoutData (data);
+        }
+        Button okButton = new Button(shell, SWT.PUSH);
+        okButton.setText("OK");  // TODO: Need to do this through Resource Bundle
+        //okButton.setText(SWT.getMessage("SWT_OK")); //$NON-NLS-1$
+        data = new GridData ();
+        data.horizontalAlignment = GridData.CENTER;
+        okButton.setLayoutData (data);
+        okButton.addListener(SWT.Selection, new class() Listener {
+            public void handleEvent(Event event) {
+                if (checkButton !is null) checkValue = checkButton.getSelection() ? 1 : 0;
+                shell.close();
+            }
+        });
+
+        shell.pack();
+        shell.open();
+        Display display = parent.getDisplay();
+        while (!shell.isDisposed()) {
+            if (!display.readAndDispatch()) display.sleep();
+        }
+    }
+
+    void confirmEx(String title, String text, String check, String button0, String button1, String button2, int defaultIndex, ref int checkValue, ref int result) {
+        Shell parent = getParent();
+        /* final */ Shell shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
+        shell.setText(title);
+        GridLayout gridLayout = new GridLayout();
+        shell.setLayout(gridLayout);
+        Label label = new Label(shell, SWT.WRAP);
+        label.setText(text);
+        GridData data = new GridData();
+        org.eclipse.swt.widgets.Monitor.Monitor monitor = parent.getMonitor();
+        int maxWidth = monitor.getBounds().width * 2 / 3;
+        int width = label.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
+        data.widthHint = Math.min(width, maxWidth);
+        data.horizontalAlignment = GridData.FILL;
+        data.grabExcessHorizontalSpace = true;
+        label.setLayoutData (data);
+
+        final Button[] buttons = new Button[4];
+        Listener listener = new class() Listener {
+            public void handleEvent(Event event) {
+                if (buttons[0] !is null) checkValue = buttons[0].getSelection() ? 1 : 0;
+                Widget widget = event.widget;
+                for (int i = 1; i < buttons.length; i++) {
+                    if (widget is buttons[i]) {
+                        result = i - 1;
+                        break;
+                    }
+                }
+                shell.close();
+            }   
+        };
+        if (check !is null) {
+            buttons[0] = new Button(shell, SWT.CHECK);
+            buttons[0].setText(check);
+            buttons[0].setSelection(checkValue !is 0);
+            data = new GridData ();
+            data.horizontalAlignment = GridData.BEGINNING;
+            buttons[0].setLayoutData (data);
+        }
+        Composite composite = new Composite(shell, SWT.NONE);
+        data = new GridData();
+        data.horizontalAlignment = GridData.CENTER;
+        composite.setLayoutData (data);
+        GridLayout layout = new GridLayout();
+        layout.makeColumnsEqualWidth = true;
+        composite.setLayout(layout);
+        int buttonCount = 0;
+        if (button0 !is null) {
+            buttons[1] = new Button(composite, SWT.PUSH);
+            buttons[1].setText(button0);
+            buttons[1].addListener(SWT.Selection, listener);
+            buttons[1].setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+            buttonCount++;
+        }
+        if (button1 !is null) {
+            buttons[2] = new Button(composite, SWT.PUSH);
+            buttons[2].setText(button1);
+            buttons[2].addListener(SWT.Selection, listener);
+            buttons[2].setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+            buttonCount++;
+        }
+        if (button2 !is null) {
+            buttons[3] = new Button(composite, SWT.PUSH);
+            buttons[3].setText(button2);
+            buttons[3].addListener(SWT.Selection, listener);
+            buttons[3].setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+            buttonCount++;
+        }
+        layout.numColumns = buttonCount;
+        Button defaultButton = buttons [defaultIndex + 1];
+        if (defaultButton !is null) shell.setDefaultButton (defaultButton);
+
+        shell.pack();
+        shell.open();
+        Display display = parent.getDisplay();
+        while (!shell.isDisposed()) {
+            if (!display.readAndDispatch()) display.sleep();
+        }
+    }
+    
+    void prompt(String title, String text, String check, /* final */ref String value, /* final */ ref int checkValue, /* final */ref int result) {
+        Shell parent = getParent();
+        /* final */ Shell shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
+        if (title !is null) shell.setText(title);
+        GridLayout gridLayout = new GridLayout();
+        shell.setLayout(gridLayout);
+        Label label = new Label(shell, SWT.WRAP);
+        label.setText(text);
+        GridData data = new GridData();
+        org.eclipse.swt.widgets.Monitor.Monitor monitor = parent.getMonitor();
+        int maxWidth = monitor.getBounds().width * 2 / 3;
+        int width = label.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
+        data.widthHint = Math.min(width, maxWidth);
+        data.horizontalAlignment = GridData.FILL;
+        data.grabExcessHorizontalSpace = true;
+        label.setLayoutData (data);
+                
+        final Text valueText = new Text(shell, SWT.BORDER);
+        if (value !is null) valueText.setText(value);
+        data = new GridData();
+        width = valueText.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
+        if (width > maxWidth) data.widthHint = maxWidth;
+        data.horizontalAlignment = GridData.FILL;
+        data.grabExcessHorizontalSpace = true;
+        valueText.setLayoutData(data);
+
+        final Button[] buttons = new Button[3];
+        Listener listener = new class() Listener {
+            public void handleEvent(Event event) {
+                if (buttons[0] !is null) checkValue = buttons[0].getSelection() ? 1 : 0;
+                value = valueText.getText();
+                result = event.widget is buttons[1] ? 1 : 0;
+                shell.close();
+            }   
+        };
+        if (check !is null) {
+            buttons[0] = new Button(shell, SWT.CHECK);
+            buttons[0].setText(check);
+            buttons[0].setSelection(checkValue !is 0);
+            data = new GridData ();
+            data.horizontalAlignment = GridData.BEGINNING;
+            buttons[0].setLayoutData (data);
+        }
+        Composite composite = new Composite(shell, SWT.NONE);
+        data = new GridData();
+        data.horizontalAlignment = GridData.CENTER;
+        composite.setLayoutData (data);
+        composite.setLayout(new GridLayout(2, true));
+        buttons[1] = new Button(composite, SWT.PUSH);
+        //buttons[1].setText(SWT.getMessage("SWT_OK")); //$NON-NLS-1$
+        buttons[1].setText("OK");
+        buttons[1].setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+        buttons[1].addListener(SWT.Selection, listener);
+        buttons[2] = new Button(composite, SWT.PUSH);
+        //buttons[2].setText(SWT.getMessage("SWT_Cancel")); //$NON-NLS-1$
+        buttons[2].setText("Cancel");
+        buttons[2].setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+        buttons[2].addListener(SWT.Selection, listener);
+
+        shell.pack();
+        shell.open();
+        Display display = parent.getDisplay();
+        while (!shell.isDisposed()) {
+            if (!display.readAndDispatch()) display.sleep();
+        }   
+    }
+
+    void promptUsernameAndPassword(String title, String text, String check, ref String user, ref String pass, ref int checkValue, ref int result) {
+        Shell parent = getParent();
+        /* final */ Shell shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
+        shell.setText(title);
+        GridLayout gridLayout = new GridLayout();
+        shell.setLayout(gridLayout);
+        Label label = new Label(shell, SWT.WRAP);
+        label.setText(text);
+        GridData data = new GridData();
+        org.eclipse.swt.widgets.Monitor.Monitor monitor = parent.getMonitor();
+        int maxWidth = monitor.getBounds().width * 2 / 3;
+        int width = label.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
+        data.widthHint = Math.min(width, maxWidth);
+        data.horizontalAlignment = GridData.FILL;
+        data.grabExcessHorizontalSpace = true;
+        label.setLayoutData (data);
+        
+        Label userLabel = new Label(shell, SWT.NONE);
+        //userLabel.setText(SWT.getMessage("SWT_Username")); //$NON-NLS-1$
+        userLabel.setText("Username:");
+        final Text userText = new Text(shell, SWT.BORDER);
+        if (user !is null) userText.setText(user);
+        data = new GridData();
+        data.horizontalAlignment = GridData.FILL;
+        data.grabExcessHorizontalSpace = true;
+        userText.setLayoutData(data);
+        
+        Label passwordLabel = new Label(shell, SWT.NONE);
+        //passwordLabel.setText(SWT.getMessage("SWT_Password")); //$NON-NLS-1$
+        passwordLabel.setText("Password:");
+        final Text passwordText = new Text(shell, SWT.PASSWORD | SWT.BORDER);
+        if (pass !is null) passwordText.setText(pass);
+        data = new GridData();
+        data.horizontalAlignment = GridData.FILL;
+        data.grabExcessHorizontalSpace = true;
+        passwordText.setLayoutData(data);
+
+        final Button[] buttons = new Button[3];
+        Listener listener = new class() Listener {
+            public void handleEvent(Event event) {
+                if (buttons[0] !is null) checkValue = buttons[0].getSelection() ? 1 : 0;
+                user = userText.getText();
+                pass = passwordText.getText();
+                result = event.widget is buttons[1] ? 1 : 0;
+                shell.close();
+            }   
+        };
+        if (check !is null) {
+            buttons[0] = new Button(shell, SWT.CHECK);
+            buttons[0].setText(check);
+            buttons[0].setSelection(checkValue !is 0);
+            data = new GridData ();
+            data.horizontalAlignment = GridData.BEGINNING;
+            buttons[0].setLayoutData (data);
+        }
+        Composite composite = new Composite(shell, SWT.NONE);
+        data = new GridData();
+        data.horizontalAlignment = GridData.CENTER;
+        composite.setLayoutData (data);
+        composite.setLayout(new GridLayout(2, true));
+        buttons[1] = new Button(composite, SWT.PUSH);
+        //buttons[1].setText(SWT.getMessage("SWT_OK")); //$NON-NLS-1$
+        buttons[1].setText("OK");
+        buttons[1].setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+        buttons[1].addListener(SWT.Selection, listener);
+        buttons[2] = new Button(composite, SWT.PUSH);
+        //buttons[2].setText(SWT.getMessage("SWT_Cancel")); //$NON-NLS-1$
+        buttons[2].setText("Cancel");
+        buttons[2].setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+        buttons[2].addListener(SWT.Selection, listener);
+
+        shell.setDefaultButton(buttons[1]);
+        shell.pack();
+        shell.open();
+        Display display = parent.getDisplay();
+        while (!shell.isDisposed()) {
+            if (!display.readAndDispatch()) display.sleep();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/PromptService2.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,643 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.PromptService2;
+
+import tango.stdc.stdlib;
+import tango.text.convert.Format;
+
+import java.lang.all;
+
+import org.eclipse.swt.SWT;
+
+import org.eclipse.swt.internal.Compatibility;
+
+import XPCOM = org.eclipse.swt.internal.mozilla.XPCOM;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsEmbedString;
+import org.eclipse.swt.internal.mozilla.nsIAuthInformation;
+import org.eclipse.swt.internal.mozilla.nsIChannel;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsIDOMWindow;
+import org.eclipse.swt.internal.mozilla.nsIEmbeddingSiteWindow;
+import org.eclipse.swt.internal.mozilla.nsIMemory;
+import org.eclipse.swt.internal.mozilla.nsIPromptService;
+import org.eclipse.swt.internal.mozilla.nsIPromptService2;
+import org.eclipse.swt.internal.mozilla.nsIServiceManager;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsIURI;
+import org.eclipse.swt.internal.mozilla.nsIWebBrowserChrome;
+import org.eclipse.swt.internal.mozilla.nsIWindowWatcher;
+import org.eclipse.swt.internal.mozilla.nsIAuthPromptCallback;
+import org.eclipse.swt.internal.mozilla.nsICancelable;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Shell;
+
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.browser.Mozilla;
+import org.eclipse.swt.browser.PromptDialog;
+
+class PromptService2 : nsIPromptService2 {
+    int refCount = 0;
+
+this () {
+}
+
+extern(System)
+nsrefcnt AddRef () {
+    refCount++;
+    return refCount;
+}
+
+extern(System)
+nsresult QueryInterface (nsID* riid, void** ppvObject) {
+    if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
+ 
+    if (*riid == nsISupports.IID) {
+        *ppvObject = cast(void*)cast(nsISupports)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsIPromptService.IID) {
+        *ppvObject = cast(void*)cast(nsIPromptService)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsIPromptService2.IID) {
+        *ppvObject = cast(void*)cast(nsIPromptService2)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+
+    *ppvObject = null;
+    return XPCOM.NS_ERROR_NO_INTERFACE;
+}
+
+extern(System)
+nsrefcnt Release () {
+    refCount--;
+    //if (refCount is 0) disposeCOMInterfaces ();
+    return refCount;
+}
+
+extern(D)
+Browser getBrowser (nsIDOMWindow aDOMWindow) {
+    if (aDOMWindow is null) return null;
+
+    //int /*long*/[] result = new int /*long*/[1];
+    nsIServiceManager serviceManager;
+    auto rc = XPCOM.NS_GetServiceManager (&serviceManager);
+    if (rc !is XPCOM.NS_OK) Mozilla.error (rc);
+    if (serviceManager is null) Mozilla.error (XPCOM.NS_NOINTERFACE);
+    
+    //nsIServiceManager serviceManager = new nsIServiceManager (result[0]);
+    //result[0] = 0;
+    //byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_WINDOWWATCHER_CONTRACTID, true);
+    nsIWindowWatcher windowWatcher;
+    rc = serviceManager.GetServiceByContractID (XPCOM.NS_WINDOWWATCHER_CONTRACTID.ptr, &nsIWindowWatcher.IID, cast(void**)&windowWatcher);
+    if (rc !is XPCOM.NS_OK) Mozilla.error(rc);
+    if (windowWatcher is null) Mozilla.error (XPCOM.NS_NOINTERFACE);       
+    serviceManager.Release ();
+    
+    //nsIWindowWatcher windowWatcher = new nsIWindowWatcher (result[0]);
+    //result[0] = 0;
+    /* the chrome will only be answered for the top-level nsIDOMWindow */
+    //nsIDOMWindow window = new nsIDOMWindow (aDOMWindow);
+    nsIDOMWindow top;
+    rc = aDOMWindow.GetTop (&top);
+    if (rc !is XPCOM.NS_OK) Mozilla.error (rc);
+    if (top is null) Mozilla.error (XPCOM.NS_NOINTERFACE);
+    //aDOMWindow = result[0];
+    //result[0] = 0;
+    nsIWebBrowserChrome webBrowserChrome;
+    rc = windowWatcher.GetChromeForWindow (top, &webBrowserChrome);
+    if (rc !is XPCOM.NS_OK) Mozilla.error (rc);
+    if (webBrowserChrome is null) Mozilla.error (XPCOM.NS_NOINTERFACE);       
+    windowWatcher.Release ();   
+    
+    //nsIWebBrowserChrome webBrowserChrome = new nsIWebBrowserChrome (result[0]);
+    //result[0] = 0;
+    nsIEmbeddingSiteWindow embeddingSiteWindow;
+    rc = webBrowserChrome.QueryInterface (&nsIEmbeddingSiteWindow.IID, cast(void**)&embeddingSiteWindow);
+    if (rc !is XPCOM.NS_OK) Mozilla.error (rc);
+    if (embeddingSiteWindow is null) Mozilla.error (XPCOM.NS_NOINTERFACE);       
+    webBrowserChrome.Release ();
+    
+    //nsIEmbeddingSiteWindow embeddingSiteWindow = new nsIEmbeddingSiteWindow (result[0]);
+    //result[0] = 0;
+    
+    void* result;
+    rc = embeddingSiteWindow.GetSiteWindow (&result);
+    if (rc !is XPCOM.NS_OK) Mozilla.error (rc);
+    if (result is null) Mozilla.error (XPCOM.NS_NOINTERFACE);       
+    embeddingSiteWindow.Release ();
+    
+    return Mozilla.findBrowser (result); 
+}
+
+String getLabel (int buttonFlag, int index, PRUnichar* buttonTitle) {
+    String label = null;
+    int flag = (buttonFlag & (0xff * index)) / index;
+    switch (flag) {
+        // TODO: implement with SWT.getMessage - JJR
+        case nsIPromptService.BUTTON_TITLE_CANCEL : label = "Cancel"; break; //$NON-NLS-1$
+        case nsIPromptService.BUTTON_TITLE_NO : label = "No"; break; //$NON-NLS-1$
+        case nsIPromptService.BUTTON_TITLE_OK : label = "OK"; break; //$NON-NLS-1$
+        case nsIPromptService.BUTTON_TITLE_SAVE : label = "Save"; break; //$NON-NLS-1$
+        case nsIPromptService.BUTTON_TITLE_YES : label = "Yes"; break; //$NON-NLS-1$
+        case nsIPromptService.BUTTON_TITLE_IS_STRING : {
+            auto span = XPCOM.strlen_PRUnichar (buttonTitle);
+            //char[] dest = new char[length];
+            //XPCOM.memmove (dest, buttonTitle, length * 2);
+            label = Utf.toString (buttonTitle[0 .. span]);
+        }
+    }
+    return label;
+}
+
+/* nsIPromptService */
+
+extern(System)
+nsresult Alert (nsIDOMWindow aParent, PRUnichar* aDialogTitle, PRUnichar* aText) {
+    Browser browser = getBrowser (aParent);
+    
+    int span = XPCOM.strlen_PRUnichar (aDialogTitle);
+    //char[] dest = new char[length];
+    //XPCOM.memmove (dest, aDialogTitle, length * 2);
+    String titleLabel = Utf.toString (aDialogTitle[0 .. span]);
+
+    span = XPCOM.strlen_PRUnichar (aText);
+    //dest = new char[length];
+    //XPCOM.memmove (dest, aText, length * 2);
+    String textLabel = Utf.toString (aText[0 .. span]);
+
+    Shell shell = browser is null ? new Shell () : browser.getShell (); 
+    MessageBox messageBox = new MessageBox (shell, SWT.OK | SWT.ICON_WARNING);
+    messageBox.setText (titleLabel);
+    messageBox.setMessage (textLabel);
+    messageBox.open ();
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult AlertCheck (nsIDOMWindow aParent, PRUnichar* aDialogTitle, PRUnichar* aText, PRUnichar* aCheckMsg, PRBool* aCheckState) {
+    Browser browser = getBrowser (aParent);
+    
+    int span = XPCOM.strlen_PRUnichar (aDialogTitle);
+    //char[] dest = new char[length];
+    //XPCOM.memmove (dest, aDialogTitle, length * 2);
+    String titleLabel = Utf.toString (aDialogTitle[0 .. span]);
+
+    span = XPCOM.strlen_PRUnichar (aText);
+    //dest = new char[length];
+    //XPCOM.memmove (dest, aText, length * 2);
+    String textLabel = Utf.toString (aText[0 .. span]);
+
+    span = XPCOM.strlen_PRUnichar (aCheckMsg);
+    //dest = new char[length];
+    //XPCOM.memmove (dest, aCheckMsg, length * 2);
+    String checkLabel = Utf.toString (aCheckMsg[0..span]);
+
+    Shell shell = browser is null ? new Shell () : browser.getShell ();
+    PromptDialog dialog = new PromptDialog (shell);
+    int check;
+    if (aCheckState !is null) check = *aCheckState; /* PRBool */
+    dialog.alertCheck (titleLabel, textLabel, checkLabel, /*ref*/ check);
+    if (aCheckState !is null) *aCheckState = check; /* PRBool */
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult AsyncPromptAuth(nsIDOMWindow aParent, nsIChannel aChannel, nsIAuthPromptCallback aCallback, nsISupports aContext, PRUint32 level, nsIAuthInformation authInfo, PRUnichar* checkboxLabel, PRBool* checkValue, nsICancelable* _retval) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult Confirm (nsIDOMWindow aParent, PRUnichar* aDialogTitle, PRUnichar* aText, PRBool* _retval) {
+    Browser browser = getBrowser (aParent);
+    
+    int span = XPCOM.strlen_PRUnichar (aDialogTitle);
+    //char[] dest = new char[length];
+    //XPCOM.memmove (dest, aDialogTitle, length * 2);
+    String titleLabel = Utf.toString (aDialogTitle[0 .. span]);
+
+    span = XPCOM.strlen_PRUnichar (aText);
+    //dest = new char[length];
+    //XPCOM.memmove (dest, aText, length * 2);
+    String textLabel = Utf.toString (aText[0 .. span]);
+
+    Shell shell = browser is null ? new Shell () : browser.getShell ();
+    MessageBox messageBox = new MessageBox (shell, SWT.OK | SWT.CANCEL | SWT.ICON_QUESTION);
+    messageBox.setText (titleLabel);
+    messageBox.setMessage (textLabel);
+    int id = messageBox.open ();
+    int result = id is SWT.OK ? 1 : 0;
+    *_retval = result;
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult ConfirmCheck (nsIDOMWindow aParent, PRUnichar* aDialogTitle, PRUnichar* aText, PRUnichar* aCheckMsg, PRBool* aCheckState, PRBool* _retval) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult ConfirmEx (nsIDOMWindow aParent, PRUnichar* aDialogTitle, PRUnichar* aText, PRUint32 aButtonFlags, PRUnichar* aButton0Title, PRUnichar* aButton1Title, PRUnichar* aButton2Title, PRUnichar* aCheckMsg, PRBool* aCheckState, PRInt32* _retval) {
+    Browser browser = getBrowser (aParent);
+    
+    int span = XPCOM.strlen_PRUnichar (aDialogTitle);
+    //char[] dest = new char[length];
+    //XPCOM.memmove (dest, aDialogTitle, length * 2);
+    String titleLabel = Utf.toString (aDialogTitle[0 .. span]);
+
+    span = XPCOM.strlen_PRUnichar (aText);
+    //dest = new char[length];
+    //XPCOM.memmove (dest, aText, length * 2);
+    String textLabel = Utf.toString (aText[0 .. span]);
+    
+    String checkLabel = null;
+    if (aCheckMsg !is null) {
+        span = XPCOM.strlen_PRUnichar (aCheckMsg);
+        //dest = new char[length];
+        //XPCOM.memmove (dest, aCheckMsg, length * 2);
+        checkLabel = Utf.toString (aCheckMsg[0 .. span]);
+    }
+    
+    String button0Label = getLabel (aButtonFlags, nsIPromptService.BUTTON_POS_0, aButton0Title);
+    String button1Label = getLabel (aButtonFlags, nsIPromptService.BUTTON_POS_1, aButton1Title);
+    String button2Label = getLabel (aButtonFlags, nsIPromptService.BUTTON_POS_2, aButton2Title);
+    
+    int defaultIndex = 0;
+    if ((aButtonFlags & nsIPromptService.BUTTON_POS_1_DEFAULT) !is 0) {
+        defaultIndex = 1;
+    } else if ((aButtonFlags & nsIPromptService.BUTTON_POS_2_DEFAULT) !is 0) {
+        defaultIndex = 2;
+    }
+    
+    Shell shell = browser is null ? new Shell () : browser.getShell ();
+    PromptDialog dialog = new PromptDialog (shell);
+    int check, result;
+    if (aCheckState !is null) check = *aCheckState;
+    dialog.confirmEx (titleLabel, textLabel, checkLabel, button0Label, button1Label, button2Label, defaultIndex, /*ref*/check, /*ref*/result);
+    if (aCheckState !is null) *aCheckState = check;
+    *_retval = result;
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult Prompt (nsIDOMWindow aParent, PRUnichar* aDialogTitle, PRUnichar* aText, PRUnichar** aValue, PRUnichar* aCheckMsg, PRBool* aCheckState, PRBool* _retval) {
+    Browser browser = getBrowser (aParent);
+    String titleLabel = null;
+    String textLabel = null, checkLabel = null;
+    String valueLabel;
+    //char[] dest;
+    int span;
+    if (aDialogTitle !is null) {
+        span = XPCOM.strlen_PRUnichar (aDialogTitle);
+        //dest = new char[length];
+        //XPCOM.memmove (dest, aDialogTitle, length * 2);
+        titleLabel = Utf.toString (aDialogTitle[0 .. span]);
+    }
+    
+    span = XPCOM.strlen_PRUnichar (aText);
+    //dest = new char[length];
+    //XPCOM.memmove (dest, aText, length * 2);
+    textLabel = Utf.toString (aText[0 .. span]);
+    
+    //int /*long*/[] valueAddr = new int /*long*/[1];
+    //XPCOM.memmove (valueAddr, aValue, C.PTR_SIZEOF);
+    auto valueAddr = aValue;
+    if (valueAddr[0] !is null) {
+        span = XPCOM.strlen_PRUnichar (valueAddr[0]);
+        //dest = new char[length];
+        //XPCOM.memmove (dest, valueAddr[0], length * 2);
+        valueLabel = Utf.toString ((valueAddr[0])[0 .. span]);
+    }
+    
+    if (aCheckMsg !is null) {
+        span = XPCOM.strlen_PRUnichar (aCheckMsg);
+        if (span > 0) {
+            //dest = new char[length];
+            //XPCOM.memmove (dest, aCheckMsg, length * 2);
+            checkLabel = Utf.toString (aCheckMsg[0 .. span]);
+        }
+    }
+
+    Shell shell = browser is null ? new Shell () : browser.getShell ();
+    PromptDialog dialog = new PromptDialog (shell);
+    int check, result;
+    if (aCheckState !is null) check = *aCheckState;
+    dialog.prompt (titleLabel, textLabel, checkLabel, /*ref*/valueLabel,/*ref*/ check,/*ref*/ result);
+    *_retval = result;
+    if (result is 1) {
+        /* 
+        * User selected OK. User name and password are returned as PRUnichar values. Any default
+        * value that we override must be freed using the nsIMemory service.
+        */
+        int size;
+        void* ptr;
+        wchar[] buffer;
+        nsIServiceManager serviceManager;
+        if (valueLabel !is null) {
+            //cnt = valueLabel.length;
+            //buffer = new wchar[cnt + 1];
+            //valueLabel.getChars (0, cnt, buffer, 0);
+            buffer = toWCharArray(valueLabel);
+            size = buffer.length * 2;
+            ptr = tango.stdc.stdlib.malloc (size);
+            (cast(wchar*)ptr)[0 .. buffer.length] = buffer[0 .. $];
+            //XPCOM.memmove (ptr, buffer, size);
+            //XPCOM.memmove (aValue, new int /*long*/[] {ptr}, C.PTR_SIZEOF);
+            *aValue = cast(PRUnichar*)ptr;
+
+            if (valueAddr[0] !is null) {
+                int rc = XPCOM.NS_GetServiceManager (&serviceManager);
+                if (rc !is XPCOM.NS_OK) SWT.error (rc);
+                if (serviceManager is null) SWT.error (XPCOM.NS_NOINTERFACE);
+            
+                //nsIServiceManager serviceManager = new nsIServiceManager (result2[0]);
+                //result2[0] = 0;
+                nsIMemory memory;
+                //byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_MEMORY_CONTRACTID, true);
+                rc = serviceManager.GetServiceByContractID (XPCOM.NS_MEMORY_CONTRACTID.ptr, &nsIMemory.IID, cast(void**)&memory);
+                if (rc !is XPCOM.NS_OK) SWT.error (rc);
+                if (memory is null) SWT.error (XPCOM.NS_NOINTERFACE);      
+                serviceManager.Release ();
+                
+                //nsIMemory memory = new nsIMemory (result2[0]);
+                //result2[0] = 0;
+                memory.Free (valueAddr[0]);
+                memory.Release ();
+            }
+        }
+    }
+    if (aCheckState !is null) *aCheckState = check;
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult PromptAuth(nsIDOMWindow aParent, nsIChannel aChannel, PRUint32 level, nsIAuthInformation authInfo, PRUnichar* checkboxLabel, PRBool* checkboxValue, PRBool* _retval) {
+    Browser browser = getBrowser (aParent);
+    String checkLabel = null;
+    //int[] checkValue = new int[1];
+    //String[] userLabel = new String[1], passLabel = new String[1];
+    int checkValue;
+    String userLabel, passLabel;
+    //String title = SWT.getMessage ("SWT_Authentication_Required"); //$NON-NLS-1$
+    String title = "Authentication Required";
+
+    if (checkboxLabel !is null && checkboxValue !is null) {
+        //int span = XPCOM.strlen_PRUnichar (checkboxLabel);
+        //char[] dest = new char[length];
+        //XPCOM.memmove (dest, checkboxLabel, length * 2);
+        checkLabel = Utf.toString (fromString16z(checkboxLabel));
+        checkValue = *checkboxValue; /* PRBool */
+    }
+
+    /* get initial username and password values */
+
+    //nsIAuthInformation auth = new nsIAuthInformation (authInfo);
+
+    scope auto ptr1 = new nsEmbedString;
+    int rc = authInfo.GetUsername (cast(nsAString*)ptr1);
+    if (rc !is XPCOM.NS_OK) SWT.error (rc);
+    //int length = XPCOM.nsEmbedString_Length (ptr);
+    //int /*long*/ buffer = XPCOM.nsEmbedString_get (ptr);
+    //char[] chars = new char[length];
+    //XPCOM.memmove (chars, buffer, length * 2);
+    userLabel = ptr1.toString;
+    //XPCOM.nsEmbedString_delete (ptr);
+
+    scope auto ptr2 = new nsEmbedString;
+    rc = authInfo.GetPassword (cast(nsAString*)ptr2);
+    if (rc !is XPCOM.NS_OK) SWT.error (rc);
+    //length = XPCOM.nsEmbedString_Length (ptr);
+    //buffer = XPCOM.nsEmbedString_get (ptr);
+    //chars = new char[length];
+    //XPCOM.memmove (chars, buffer, length * 2);
+    passLabel = ptr2.toString;
+    //XPCOM.nsEmbedString_delete (ptr);
+
+    /* compute the message text */
+
+    scope auto ptr3 = new nsEmbedString;
+    rc = authInfo.GetRealm (cast(nsAString*)ptr3);
+    if (rc !is XPCOM.NS_OK) SWT.error (rc);
+    //length = XPCOM.nsEmbedString_Length (ptr);
+    //buffer = XPCOM.nsEmbedString_get (ptr);
+    //chars = new char[length];
+    //XPCOM.memmove (chars, buffer, length * 2);
+    String realm = ptr3.toString;
+    //XPCOM.nsEmbedString_delete (ptr);
+
+    //nsIChannel channel = new nsIChannel (aChannel);
+    nsIURI uri;
+    rc = aChannel.GetURI (&uri);
+    if (rc !is XPCOM.NS_OK) SWT.error (rc);
+    if (uri is null) Mozilla.error (XPCOM.NS_NOINTERFACE);
+
+    //nsIURI nsURI = new nsIURI (uri[0]);
+    scope auto aSpec = new nsEmbedCString;
+    rc = uri.GetHost (cast(nsACString*)aSpec);
+    if (rc !is XPCOM.NS_OK) SWT.error (rc);
+    //length = XPCOM.nsEmbedCString_Length (aSpec);
+    //buffer = XPCOM.nsEmbedCString_get (aSpec);
+    //byte[] bytes = new byte[length];
+    //XPCOM.memmove (bytes, buffer, length);
+    //XPCOM.nsEmbedCString_delete (aSpec);
+    String host = aSpec.toString;
+    uri.Release ();
+
+    String message;
+    if (realm.length () > 0 && host.length () > 0) {
+        //message = Compatibility.getMessage ("SWT_Enter_Username_and_Password", new String[] {realm, host}); //$NON-NLS-1$
+        message = Format("Enter user name and password for {0} at {1}",realm, host);
+    } else {
+        message = ""; //$NON-NLS-1$
+    }
+
+    /* open the prompter */
+    Shell shell = browser is null ? new Shell () : browser.getShell ();
+    PromptDialog dialog = new PromptDialog (shell);
+    int result;
+    dialog.promptUsernameAndPassword (title, message, checkLabel, userLabel, passLabel, checkValue, result);
+
+    //XPCOM.memmove (_retval, result, 4); /* PRBool */
+    *_retval = result;
+    if (result is 1) {   /* User selected OK */
+        scope auto string1 = new nsEmbedString (toWCharArray(userLabel));
+        rc = authInfo.SetUsername(cast(nsAString*)string1);
+        if (rc !is XPCOM.NS_OK) SWT.error (rc);
+        //string.dispose ();
+        
+        scope auto string2 = new nsEmbedString (toWCharArray(passLabel));
+        rc = authInfo.SetPassword(cast(nsAString*)string2);
+        if (rc !is XPCOM.NS_OK) SWT.error (rc);
+        //string.dispose ();
+    }
+
+    if (checkboxValue !is null) *checkboxValue = checkValue; /* PRBool */
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult PromptUsernameAndPassword (nsIDOMWindow aParent, PRUnichar* aDialogTitle, PRUnichar* aText, PRUnichar** aUsername, PRUnichar** aPassword, PRUnichar* aCheckMsg, PRBool* aCheckState, PRBool* _retval) {
+    Browser browser = getBrowser (aParent);
+    String titleLabel, textLabel, checkLabel = null;
+    String userLabel, passLabel;
+    char[] dest;
+    int span;
+    if (aDialogTitle !is null) {
+        //span = XPCOM.strlen_PRUnichar (aDialogTitle);
+        //dest = new char[length];
+        //XPCOM.memmove (dest, aDialogTitle, length * 2);
+        titleLabel = Utf.toString (fromString16z(aDialogTitle));
+    } else {
+        //titleLabel = SWT.getMessage ("SWT_Authentication_Required");    //$NON-NLS-1$
+        titleLabel = "Authentication Required";
+    }
+    
+    //span = XPCOM.strlen_PRUnichar (aText);
+    //dest = new char[length];
+    //XPCOM.memmove (dest, aText, length * 2);
+    textLabel = Utf.toString (fromString16z(aText));
+    
+    //int /*long*/[] userAddr = new int /*long*/[1];
+    //XPCOM.memmove (userAddr, aUsername, C.PTR_SIZEOF);
+    auto userAddr = *aUsername;
+    if (*aUsername !is null) {
+            //span = XPCOM.strlen_PRUnichar (userAddr[0]);
+            //dest = new char[length];
+            //XPCOM.memmove (dest, userAddr[0], length * 2);
+            userLabel = Utf.toString(fromString16z(*aUsername));       
+    }
+    
+    //int /*long*/[] passAddr = new int /*long*/[1];
+    //XPCOM.memmove (passAddr, aPassword, C.PTR_SIZEOF);
+    auto passAddr = *aPassword;
+    if (*aPassword !is null) {
+            //span = XPCOM.strlen_PRUnichar (passAddr[0]);
+            //dest = new char[length];
+            //XPCOM.memmove (dest, passAddr[0], length * 2);
+            passLabel = Utf.toString(fromString16z(*aPassword));       
+    }
+    
+    if (aCheckMsg !is null) {
+        //span = XPCOM.strlen_PRUnichar (aCheckMsg);
+        //if (span > 0) {
+            //dest = new char[length];
+            //XPCOM.memmove (dest, aCheckMsg, length * 2);
+        checkLabel = Utf.toString (fromString16z(aCheckMsg));
+        //}
+    }
+
+    Shell shell = browser is null ? new Shell () : browser.getShell ();
+    PromptDialog dialog = new PromptDialog (shell);
+    int check, result;
+    if (aCheckState !is null) check = *aCheckState;   /* PRBool */
+    dialog.promptUsernameAndPassword (titleLabel, textLabel, checkLabel, /*ref*/ userLabel, /*ref*/ passLabel, check, result);
+
+    *_retval = result; /* PRBool */
+    if (result is 1) {
+        /* 
+        * User selected OK. User name and password are returned as PRUnichar values. Any default
+        * value that we override must be freed using the nsIMemory service.
+        */
+        int cnt, size;
+        void* ptr;
+        wchar[] buffer;
+        int /*long*/[] result2 = new int /*long*/[1];
+        if (userLabel !is null) {
+            //cnt = userLabel[0].length ();
+            //buffer = new char[cnt + 1];
+            //buffer = toWCharArray(userLabel);
+            //userLabel[0].getChars (0, cnt, buffer, 0);
+            //size = buffer.length * 2;
+            //ptr = tango.stdc.stdlib.malloc (size);
+            //(cast(wchar*)ptr)[0 .. buffer.length] = buffer[0 .. $];
+            //XPCOM.memmove (ptr, buffer, size);
+            *aUsername = toString16z(toWCharArray(userLabel));
+            //XPCOM.memmove (aUsername, new int /*long*/[] {ptr}, C.PTR_SIZEOF);
+            nsIServiceManager serviceManager;
+            
+            if (userAddr !is null) {
+                int rc = XPCOM.NS_GetServiceManager (&serviceManager);
+                if (rc !is XPCOM.NS_OK) SWT.error (rc);
+                if (serviceManager is null) SWT.error (XPCOM.NS_NOINTERFACE);
+            
+                //nsIServiceManager serviceManager = new nsIServiceManager (result2[0]);
+                //result2[0] = 0;
+                //byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_MEMORY_CONTRACTID, true);
+                nsIMemory memory;
+                rc = serviceManager.GetServiceByContractID (XPCOM.NS_MEMORY_CONTRACTID.ptr, &nsIMemory.IID, cast(void**)&memory);
+                if (rc !is XPCOM.NS_OK) SWT.error (rc);
+                if (memory is null) SWT.error (XPCOM.NS_NOINTERFACE);       
+                serviceManager.Release ();
+                
+                //nsIMemory memory = new nsIMemory (result2[0]);
+                //result2[0] = 0;
+                memory.Free (userAddr);
+                memory.Release ();
+            }
+        }
+        if (passLabel !is null) {
+            //cnt = passLabel[0].length ();
+            //buffer = new char[cnt + 1];
+            //buffer = toWCharArray( passLabel );
+            //passLabel[0].getChars (0, cnt, buffer, 0);
+            //size = buffer.length * 2;
+            //ptr = tango.stdc.stdlib.malloc (size);
+            //(cast(wchar*)ptr)[0 .. buffer.length] = buffer[0 .. $];
+            //XPCOM.memmove (ptr, buffer, size);
+            *aPassword = toString16z(toWCharArray(passLabel));
+            //XPCOM.memmove (aPassword, new int /*long*/[] {ptr}, C.PTR_SIZEOF);
+            
+            nsIServiceManager serviceManager;
+            if (passAddr !is null) {
+                int rc = XPCOM.NS_GetServiceManager (&serviceManager);
+                if (rc !is XPCOM.NS_OK) SWT.error (rc);
+                if (serviceManager is null) SWT.error (XPCOM.NS_NOINTERFACE);
+
+                //nsIServiceManager serviceManager = new nsIServiceManager (result2[0]);
+                //result2[0] = 0;
+                //byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_MEMORY_CONTRACTID, true);
+                nsIMemory memory;
+                rc = serviceManager.GetServiceByContractID (XPCOM.NS_MEMORY_CONTRACTID.ptr, &nsIMemory.IID, cast(void**)&memory);
+                if (rc !is XPCOM.NS_OK) SWT.error (rc);
+                if (memory is null) SWT.error (XPCOM.NS_NOINTERFACE);      
+                serviceManager.Release ();
+
+                //nsIMemory memory = new nsIMemory (result2[0]);
+                //result2[0] = 0;
+                memory.Free (passAddr);
+                memory.Release ();
+            }
+        }
+    }
+    if (aCheckState !is null) *aCheckState = check; /* PRBool */
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult PromptPassword (nsIDOMWindow aParent, PRUnichar* aDialogTitle, PRUnichar* aText, PRUnichar** aPassword, PRUnichar* aCheckMsg, PRBool* aCheckState, PRBool* _retval) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+extern(System)
+nsresult Select (nsIDOMWindow aParent, PRUnichar* aDialogTitle, PRUnichar* aText, PRUint32 aCount, PRUnichar** aSelectList, PRInt32* aOutSelection, PRBool* _retval) {
+    return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/PromptService2Factory.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.PromptService2Factory;
+
+//import java.lang.all;
+import org.eclipse.swt.internal.mozilla.Common;
+//import org.eclipse.swt.internal.C;
+import XPCOM = org.eclipse.swt.internal.mozilla.XPCOM;
+//import org.eclipse.swt.internal.mozilla.XPCOMObject;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsIFactory;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.browser.PromptService2;
+
+class PromptService2Factory : nsIFactory {
+ //   XPCOMObject supports;
+ //   XPCOMObject factory;
+    int refCount = 0;
+
+this () {
+//    createCOMInterfaces ();
+}
+
+extern(System)
+nsrefcnt AddRef () {
+    refCount++;
+    return refCount;
+}
+
+extern(System)
+nsresult QueryInterface (nsID* riid, void** ppvObject) {
+    if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
+    //nsID guid = new nsID ();
+    //XPCOM.memmove (guid, riid, nsID.sizeof);
+    
+    if (*riid == nsISupports.IID) {
+        *ppvObject = cast(void*)cast(nsISupports)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsIFactory.IID) {
+        *ppvObject = cast(void*)cast(nsIFactory)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    
+    *ppvObject = null;
+    return XPCOM.NS_ERROR_NO_INTERFACE;
+}
+
+extern(System)
+nsrefcnt Release () {
+    refCount--;
+    //if (refCount is null) disposeCOMInterfaces ();
+    return refCount;
+}
+    
+/* nsIFactory */
+
+extern(System)
+nsresult CreateInstance (nsISupports aOuter, nsIID* iid, void** result) {
+    if (result is null) 
+        return XPCOM.NS_ERROR_INVALID_ARG;
+    auto promptService = new PromptService2;
+    nsresult rv = promptService.QueryInterface( iid, result );
+    if (XPCOM.NS_FAILED(rv)) {
+        *result = null;
+        delete promptService;
+    }
+    return rv;
+}
+
+extern(System)
+nsresult LockFactory (PRBool lock) {
+    return XPCOM.NS_OK;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/SimpleEnumerator.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.SimpleEnumerator;
+
+//import java.lang.all;
+
+//import org.eclipse.swt.internal.C;
+import XPCOM = org.eclipse.swt.internal.mozilla.XPCOM;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISimpleEnumerator;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+class SimpleEnumerator : nsISimpleEnumerator{
+    int refCount = 0;
+    nsISupports[] values;
+    int index = 0;
+
+this (nsISupports[] values) {
+    this.values = values;
+    for (int i = 0; i < values.length; i++) {
+        values[i].AddRef ();
+    }
+}
+
+extern(System)
+nsrefcnt AddRef () {
+    refCount++;
+    return refCount;
+}
+
+extern(System)
+nsresult QueryInterface (nsID* riid, void** ppvObject) {
+    if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
+    //nsID guid = new nsID ();
+    //XPCOM.memmove (guid, riid, nsID.sizeof);
+
+    if (*riid == nsISupports.IID) {
+        *ppvObject = cast(void*)cast(nsISupports)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsISimpleEnumerator.IID) {
+        *ppvObject = cast(void*)cast(nsISimpleEnumerator)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+
+    *ppvObject = null;
+    return XPCOM.NS_ERROR_NO_INTERFACE;
+}
+
+extern(System)
+nsresult Release () {
+    refCount--;
+    //if (refCount is 0) disposeCOMInterfaces ();
+    return refCount;
+}
+
+extern(System)
+nsresult HasMoreElements (PRBool* _retval) {
+    bool more = values !is null && index < values.length;
+    *_retval = more ? 1 : 0; /*PRBool */
+    return XPCOM.NS_OK;
+}
+
+extern(System)
+nsresult GetNext (nsISupports* _retval) {
+    if (values is null || index is values.length) return XPCOM.NS_ERROR_UNEXPECTED;
+    nsISupports value = values[index++];
+    value.AddRef ();
+    *_retval = value;
+    return XPCOM.NS_OK;
+}       
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/StatusTextEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.StatusTextEvent;
+
+import tango.text.convert.Format;
+
+import java.lang.all;
+
+import org.eclipse.swt.events.TypedEvent;
+import org.eclipse.swt.widgets.Widget;
+
+/**
+ * A <code>StatusTextEvent</code> is sent by a {@link Browser} to
+ * {@link StatusTextListener}'s when the status text is changed.
+ * The status text is typically displayed in the status bar of
+ * a browser application.
+ * 
+ * @since 3.0
+ */
+public class StatusTextEvent : TypedEvent {
+    /** status text */
+    public String text;
+    
+    static final long serialVersionUID = 3258407348371600439L;
+
+this(Widget w) {
+    super(w);
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+public override String toString() {
+    return Format( "{} {text = {}}", 
+        super.toString[1 .. $-2], text );  
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/StatusTextListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.StatusTextListener;
+
+import org.eclipse.swt.browser.StatusTextEvent;
+//import java.lang.all;
+
+import org.eclipse.swt.internal.SWTEventListener;
+
+/**
+ * This listener interface may be implemented in order to receive
+ * a {@link StatusTextEvent} notification when the status text for
+ * a {@link Browser} is changed.
+ * 
+ * @see Browser#addStatusTextListener(StatusTextListener)
+ * @see Browser#removeStatusTextListener(StatusTextListener)
+ * 
+ * @since 3.0
+ */
+public interface StatusTextListener : SWTEventListener {
+
+/**
+ * This method is called when the status text is changed. The
+ * status text is typically displayed in the status bar of a browser 
+ * application. 
+ * <p>
+ *
+ * <p>The following fields in the <code>StatusTextEvent</code> apply:
+ * <ul>
+ * <li>(in) text the modified status text
+ * <li>(in) widget the <code>Browser</code> whose status text is changed
+ * </ul>
+ * 
+ * @param event the <code>StatusTextEvent</code> that contains the updated
+ * status description of a <code>Browser</code>
+ * 
+ * @since 3.0
+ */
+public void changed(StatusTextEvent event);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/TitleEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.TitleEvent;
+
+import tango.text.convert.Format;
+
+import java.lang.all;
+
+import org.eclipse.swt.events.TypedEvent;
+import org.eclipse.swt.widgets.Widget;
+
+/**
+ * A <code>TitleEvent</code> is sent by a {@link Browser} to
+ * {@link TitleListener}'s when the title of the current document
+ * is available or when it is modified.
+ * 
+ * @since 3.0
+ */
+public class TitleEvent : TypedEvent {
+    /** the title of the current document */
+    public String title;
+    
+    static final long serialVersionUID = 4121132532906340919L;
+
+this(Widget w) {
+    super(w);
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+public override String toString() {
+    return Format( "{} {title = {}}", 
+        super.toString[1 .. $-2], title );  
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/TitleListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.TitleListener;
+
+import org.eclipse.swt.browser.TitleEvent;
+//import java.lang.all;
+
+import org.eclipse.swt.internal.SWTEventListener;
+
+/**
+ * This listener interface may be implemented in order to receive
+ * a {@link TitleEvent} notification when the title of the document
+ * displayed in a {@link Browser} is known or has been changed.
+ * 
+ * @see Browser#addTitleListener(TitleListener)
+ * @see Browser#removeTitleListener(TitleListener)
+ * 
+ * @since 3.0
+ */
+public interface TitleListener : SWTEventListener {
+
+/**
+ * This method is called when the title of the current document
+ * is available or has changed.
+ * <p>
+ *
+ * <p>The following fields in the <code>TitleEvent</code> apply:
+ * <ul>
+ * <li>(in) title the title of the current document
+ * <li>(in) widget the <code>Browser</code> whose current document's
+ * title is known or modified
+ * </ul>
+ * 
+ * @param event the <code>TitleEvent</code> that contains the title
+ * of the document currently displayed in a <code>Browser</code>
+ * 
+ * @since 3.0
+ */
+public void changed(TitleEvent event);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/VisibilityWindowAdapter.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.VisibilityWindowAdapter;
+
+import java.lang.all;
+
+import org.eclipse.swt.browser.WindowEvent;
+import org.eclipse.swt.browser.VisibilityWindowListener;
+
+/**
+ * This adapter class provides default implementations for the
+ * methods described by the {@link VisibilityWindowListener} interface.
+ * <p>
+ * Classes that wish to deal with {@link WindowEvent}'s can
+ * extend this class and override only the methods which they are
+ * interested in.
+ * </p>
+ * 
+ * @since 3.0
+ */
+public abstract class VisibilityWindowAdapter : VisibilityWindowListener {
+
+public void hide(WindowEvent event) {
+}
+ 
+public void show(WindowEvent event) {
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/VisibilityWindowListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.VisibilityWindowListener;
+
+import org.eclipse.swt.browser.WindowEvent;
+//import java.lang.all;
+
+import org.eclipse.swt.internal.SWTEventListener;
+
+/** 
+ * This listener interface may be implemented in order to receive
+ * a {@link WindowEvent} notification when a window hosting a
+ * {@link Browser} needs to be displayed or hidden.
+ * 
+ * @see Browser#addVisibilityWindowListener(VisibilityWindowListener)
+ * @see Browser#removeVisibilityWindowListener(VisibilityWindowListener)
+ * @see OpenWindowListener
+ * @see CloseWindowListener
+ * 
+ * @since 3.0
+ */
+public interface VisibilityWindowListener : SWTEventListener {
+    
+/**
+ * This method is called when the window hosting a <code>Browser</code> 
+ * is requested to be hidden. Application would typically hide the
+ * {@link org.eclipse.swt.widgets.Shell} that hosts the <code>Browser</code>.
+ * <p>
+ *
+ * <p>The following fields in the <code>WindowEvent</code> apply:
+ * <ul>
+ * <li>(in) widget the <code>Browser</code> that needs to be hidden
+ * </ul>
+ *
+ * @param event the <code>WindowEvent</code> that specifies the
+ * <code>Browser</code> that needs to be hidden
+ * 
+ * @see org.eclipse.swt.widgets.Shell#setVisible(bool)
+ * 
+ * @since 3.0
+ */ 
+public void hide(WindowEvent event);
+
+/**
+ * This method is called when the window hosting a <code>Browser</code>
+ * is requested to be displayed. Application would typically set the 
+ * location and the size of the {@link org.eclipse.swt.widgets.Shell} 
+ * that hosts the <code>Browser</code>, if a particular location and size
+ * are specified. The application would then open that <code>Shell</code>.
+ * <p>
+ *
+ * <p>The following fields in the <code>WindowEvent</code> apply:
+ * <ul>
+ * <li>(in) widget the <code>Browser</code> to display
+ * <li>(in) location the requested location for the <code>Shell</code> 
+ * hosting the browser. It is <code>null</code> if no location is set. 
+ * <li>(in) size the requested size for the <code>Browser</code>.
+ * The client area of the <code>Shell</code> hosting the
+ * <code>Browser</code> should be large enough to accommodate that size.
+ * It is <code>null</code> if no size is set.
+ * <li>(in) addressBar <code>true</code> if the <code>Shell</code> 
+ * hosting the <code>Browser</code> should display an address bar or
+ * <code>false</code> otherwise
+ * <li>(in) menuBar <code>true</code> if the <code>Shell</code> 
+ * hosting the <code>Browser</code> should display a menu bar or
+ * <code>false</code> otherwise
+ * <li>(in) statusBar <code>true</code> if the <code>Shell</code> 
+ * hosting the <code>Browser</code> should display a status bar or
+ * <code>false</code> otherwise
+ * <li>(in) toolBar <code>true</code> if the <code>Shell</code> 
+ * hosting the <code>Browser</code> should display a tool bar or
+ * <code>false</code> otherwise
+ * </ul>
+ *
+ * @param event the <code>WindowEvent</code> that specifies the
+ * <code>Browser</code> that needs to be displayed
+ * 
+ * @see org.eclipse.swt.widgets.Control#setLocation(org.eclipse.swt.graphics.Point)
+ * @see org.eclipse.swt.widgets.Control#setSize(org.eclipse.swt.graphics.Point)
+ * @see org.eclipse.swt.widgets.Shell#open()
+ * 
+ * @since 3.0
+ */ 
+public void show(WindowEvent event);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/WebBrowser.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,414 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.WebBrowser;
+
+import java.lang.all;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.browser.CloseWindowListener;
+import org.eclipse.swt.browser.LocationListener;
+import org.eclipse.swt.browser.OpenWindowListener;
+import org.eclipse.swt.browser.ProgressListener;
+import org.eclipse.swt.browser.StatusTextListener;
+import org.eclipse.swt.browser.TitleListener;
+import org.eclipse.swt.browser.VisibilityWindowListener;
+
+abstract class WebBrowser {
+    Browser browser;
+    CloseWindowListener[] closeWindowListeners;
+    LocationListener[] locationListeners;
+    OpenWindowListener[] openWindowListeners;
+    ProgressListener[] progressListeners;
+    StatusTextListener[] statusTextListeners;
+    TitleListener[] titleListeners;
+    VisibilityWindowListener[] visibilityWindowListeners;
+
+    static Runnable MozillaClearSessions;
+    static Runnable NativeClearSessions;
+
+    /* Key Mappings */
+    static final int [][] KeyTable = [
+        /* Keyboard and Mouse Masks */
+        [18,    SWT.ALT],
+        [16,    SWT.SHIFT],
+        [17,    SWT.CONTROL],
+        [224,   SWT.COMMAND],
+
+        /* Literal Keys */
+        [65,    'a'],
+        [66,    'b'],
+        [67,    'c'],
+        [68,    'd'],
+        [69,    'e'],
+        [70,    'f'],
+        [71,    'g'],
+        [72,    'h'],
+        [73,    'i'],
+        [74,    'j'],
+        [75,    'k'],
+        [76,    'l'],
+        [77,    'm'],
+        [78,    'n'],
+        [79,    'o'],
+        [80,    'p'],
+        [81,    'q'],
+        [82,    'r'],
+        [83,    's'],
+        [84,    't'],
+        [85,    'u'],
+        [86,    'v'],
+        [87,    'w'],
+        [88,    'x'],
+        [89,    'y'],
+        [90,    'z'],
+        [48,    '0'],
+        [49,    '1'],
+        [50,    '2'],
+        [51,    '3'],
+        [52,    '4'],
+        [53,    '5'],
+        [54,    '6'],
+        [55,    '7'],
+        [56,    '8'],
+        [57,    '9'],
+        [32,    ' '],
+        [59,    ';'],
+        [61,    '='],
+        [188,   ','],
+        [190,   '.'],
+        [191,   '/'],
+        [219,   '['],
+        [221,   ']'],
+        [222,   '\''],
+        [192,   '`'],
+        [220,   '\\'],
+        [108,   '|'],
+
+        /* Non-Numeric Keypad Keys */
+        [37,    SWT.ARROW_LEFT],
+        [39,    SWT.ARROW_RIGHT],
+        [38,    SWT.ARROW_UP],
+        [40,    SWT.ARROW_DOWN],
+        [45,    SWT.INSERT],
+        [36,    SWT.HOME],
+        [35,    SWT.END],
+        [46,    SWT.DEL],
+        [33,    SWT.PAGE_UP],
+        [34,    SWT.PAGE_DOWN],
+
+        /* Virtual and Ascii Keys */
+        [8,     SWT.BS],
+        [13,    SWT.CR],
+        [9,     SWT.TAB],
+        [27,    SWT.ESC],
+        [12,    SWT.DEL],
+
+        /* Functions Keys */
+        [112,   SWT.F1],
+        [113,   SWT.F2],
+        [114,   SWT.F3],
+        [115,   SWT.F4],
+        [116,   SWT.F5],
+        [117,   SWT.F6],
+        [118,   SWT.F7],
+        [119,   SWT.F8],
+        [120,   SWT.F9],
+        [121,   SWT.F10],
+        [122,   SWT.F11],
+        [123,   SWT.F12],
+        [124,   SWT.F13],
+        [125,   SWT.F14],
+        [126,   SWT.F15],
+        [127,   0],
+        [128,   0],
+        [129,   0],
+        [130,   0],
+        [131,   0],
+        [132,   0],
+        [133,   0],
+        [134,   0],
+        [135,   0],
+
+        /* Numeric Keypad Keys */
+        [96,    SWT.KEYPAD_0],
+        [97,    SWT.KEYPAD_1],
+        [98,    SWT.KEYPAD_2],
+        [99,    SWT.KEYPAD_3],
+        [100,   SWT.KEYPAD_4],
+        [101,   SWT.KEYPAD_5],
+        [102,   SWT.KEYPAD_6],
+        [103,   SWT.KEYPAD_7],
+        [104,   SWT.KEYPAD_8],
+        [105,   SWT.KEYPAD_9],
+        [14,    SWT.KEYPAD_CR],
+        [107,   SWT.KEYPAD_ADD],
+        [109,   SWT.KEYPAD_SUBTRACT],
+        [106,   SWT.KEYPAD_MULTIPLY],
+        [111,   SWT.KEYPAD_DIVIDE],
+        [110,   SWT.KEYPAD_DECIMAL],
+
+        /* Other keys */
+        [20,    SWT.CAPS_LOCK],
+        [144,   SWT.NUM_LOCK],
+        [145,   SWT.SCROLL_LOCK],
+        [44,    SWT.PRINT_SCREEN],
+        [6,     SWT.HELP],
+        [19,    SWT.PAUSE],
+        [3,     SWT.BREAK],
+
+        /* Safari-specific */
+        [186,   ';'],
+        [187,   '='],
+        [189,   '-'],
+    ];
+
+public void addCloseWindowListener (CloseWindowListener listener) {
+    //CloseWindowListener[] newCloseWindowListeners = new CloseWindowListener[closeWindowListeners.length + 1];
+    //System.arraycopy(closeWindowListeners, 0, newCloseWindowListeners, 0, closeWindowListeners.length);
+    //closeWindowListeners = newCloseWindowListeners;
+    closeWindowListeners ~= listener;
+}
+
+public void addLocationListener (LocationListener listener) {
+    //LocationListener[] newLocationListeners = new LocationListener[locationListeners.length + 1];
+    //System.arraycopy(locationListeners, 0, newLocationListeners, 0, locationListeners.length);
+    //locationListeners = newLocationListeners;
+    locationListeners ~= listener;
+}
+
+public void addOpenWindowListener (OpenWindowListener listener) {
+    //OpenWindowListener[] newOpenWindowListeners = new OpenWindowListener[openWindowListeners.length + 1];
+    //System.arraycopy(openWindowListeners, 0, newOpenWindowListeners, 0, openWindowListeners.length);
+    //openWindowListeners = newOpenWindowListeners;
+    openWindowListeners ~= listener;
+}
+
+public void addProgressListener (ProgressListener listener) {
+    //ProgressListener[] newProgressListeners = new ProgressListener[progressListeners.length + 1];
+    //System.arraycopy(progressListeners, 0, newProgressListeners, 0, progressListeners.length);
+    //progressListeners = newProgressListeners;
+    progressListeners ~= listener;
+}
+
+public void addStatusTextListener (StatusTextListener listener) {
+    //StatusTextListener[] newStatusTextListeners = new StatusTextListener[statusTextListeners.length + 1];
+    //System.arraycopy(statusTextListeners, 0, newStatusTextListeners, 0, statusTextListeners.length);
+    //statusTextListeners = newStatusTextListeners;
+    statusTextListeners ~= listener;
+}
+
+public void addTitleListener (TitleListener listener) {
+    //TitleListener[] newTitleListeners = new TitleListener[titleListeners.length + 1];
+    //System.arraycopy(titleListeners, 0, newTitleListeners, 0, titleListeners.length);
+    //titleListeners = newTitleListeners;
+    titleListeners ~= listener;
+}
+
+public void addVisibilityWindowListener (VisibilityWindowListener listener) {
+    //VisibilityWindowListener[] newVisibilityWindowListeners = new VisibilityWindowListener[visibilityWindowListeners.length + 1];
+    //System.arraycopy(visibilityWindowListeners, 0, newVisibilityWindowListeners, 0, visibilityWindowListeners.length);
+    //visibilityWindowListeners = newVisibilityWindowListeners;
+    visibilityWindowListeners ~= listener;
+}
+
+public abstract bool back ();
+
+public static void clearSessions () {
+    if (NativeClearSessions !is null) NativeClearSessions.run ();
+    if (MozillaClearSessions !is null) MozillaClearSessions.run ();
+}
+
+public abstract void create (Composite parent, int style);
+
+public abstract bool execute (String script);
+
+public abstract bool forward ();
+
+public abstract String getText ();
+
+public abstract String getUrl ();
+
+public Object getWebBrowser () {
+    return null;
+}
+
+public abstract bool isBackEnabled ();
+
+public bool isFocusControl () {
+    return false;
+}
+
+public abstract bool isForwardEnabled ();
+
+public abstract void refresh ();
+
+public void removeCloseWindowListener (CloseWindowListener listener) {
+    if (closeWindowListeners.length is 0) return;
+    int index = -1;
+    for (int i = 0; i < closeWindowListeners.length; i++) {
+        if (listener is closeWindowListeners[i]){
+            index = i;
+            break;
+        }
+    }
+    if (index is -1) return;
+    if (closeWindowListeners.length is 1) {
+        closeWindowListeners = new CloseWindowListener[0];
+        return;
+    }
+    //CloseWindowListener[] newCloseWindowListeners = new CloseWindowListener[closeWindowListeners.length - 1];
+    //System.arraycopy (closeWindowListeners, 0, newCloseWindowListeners, 0, index);
+    //System.arraycopy (closeWindowListeners, index + 1, newCloseWindowListeners, index, closeWindowListeners.length - index - 1);
+    closeWindowListeners = closeWindowListeners[0..index] ~ closeWindowListeners[index+1..$];
+}
+
+public void removeLocationListener (LocationListener listener) {
+    if (locationListeners.length is 0) return;
+    int index = -1;
+    for (int i = 0; i < locationListeners.length; i++) {
+        if (listener is locationListeners[i]){
+            index = i;
+            break;
+        }
+    }
+    if (index is -1) return;
+    if (locationListeners.length is 1) {
+        locationListeners = new LocationListener[0];
+        return;
+    }
+    //LocationListener[] newLocationListeners = new LocationListener[locationListeners.length - 1];
+    //System.arraycopy (locationListeners, 0, newLocationListeners, 0, index);
+    //System.arraycopy (locationListeners, index + 1, newLocationListeners, index, locationListeners.length - index - 1);
+    locationListeners = locationListeners[0..index] ~ locationListeners[index+1..$];
+}
+
+public void removeOpenWindowListener (OpenWindowListener listener) {
+    if (openWindowListeners.length is 0) return;
+    int index = -1;
+    for (int i = 0; i < openWindowListeners.length; i++) {
+        if (listener is openWindowListeners[i]){
+            index = i;
+            break;
+        }
+    }
+    if (index is -1) return;
+    if (openWindowListeners.length is 1) {
+        openWindowListeners = new OpenWindowListener[0];
+        return;
+    }
+    //OpenWindowListener[] newOpenWindowListeners = new OpenWindowListener[openWindowListeners.length - 1];
+    //System.arraycopy (openWindowListeners, 0, newOpenWindowListeners, 0, index);
+    //System.arraycopy (openWindowListeners, index + 1, newOpenWindowListeners, index, openWindowListeners.length - index - 1);
+    openWindowListeners = openWindowListeners[0..index] ~ openWindowListeners[index+1..$];
+}
+
+public void removeProgressListener (ProgressListener listener) {
+    if (progressListeners.length is 0) return;
+    int index = -1;
+    for (int i = 0; i < progressListeners.length; i++) {
+        if (listener is progressListeners[i]){
+            index = i;
+            break;
+        }
+    }
+    if (index is -1) return;
+    if (progressListeners.length is 1) {
+        progressListeners = new ProgressListener[0];
+        return;
+    }
+    //ProgressListener[] newProgressListeners = new ProgressListener[progressListeners.length - 1];
+    //System.arraycopy (progressListeners, 0, newProgressListeners, 0, index);
+    //System.arraycopy (progressListeners, index + 1, newProgressListeners, index, progressListeners.length - index - 1);
+    progressListeners = progressListeners[0..index] ~ progressListeners[index+1..$];
+}
+
+public void removeStatusTextListener (StatusTextListener listener) {
+    if (statusTextListeners.length is 0) return;
+    int index = -1;
+    for (int i = 0; i < statusTextListeners.length; i++) {
+        if (listener is statusTextListeners[i]){
+            index = i;
+            break;
+        }
+    }
+    if (index is -1) return;
+    if (statusTextListeners.length is 1) {
+        statusTextListeners = new StatusTextListener[0];
+        return;
+    }
+    //StatusTextListener[] newStatusTextListeners = new StatusTextListener[statusTextListeners.length - 1];
+    //System.arraycopy (statusTextListeners, 0, newStatusTextListeners, 0, index);
+    //System.arraycopy (statusTextListeners, index + 1, newStatusTextListeners, index, statusTextListeners.length - index - 1);
+    statusTextListeners = statusTextListeners[0..index] ~ statusTextListeners[index+1..$];
+}
+
+public void removeTitleListener (TitleListener listener) {
+    if (titleListeners.length is 0) return;
+    int index = -1;
+    for (int i = 0; i < titleListeners.length; i++) {
+        if (listener is titleListeners[i]){
+            index = i;
+            break;
+        }
+    }
+    if (index is -1) return;
+    if (titleListeners.length is 1) {
+        titleListeners = new TitleListener[0];
+        return;
+    }
+    TitleListener[] newTitleListeners = new TitleListener[titleListeners.length - 1];
+    //System.arraycopy (titleListeners, 0, newTitleListeners, 0, index);
+    //System.arraycopy (titleListeners, index + 1, newTitleListeners, index, titleListeners.length - index - 1);
+    titleListeners = titleListeners[0..index] ~ titleListeners[index+1..$];
+}
+
+public void removeVisibilityWindowListener (VisibilityWindowListener listener) {
+    if (visibilityWindowListeners.length is 0) return;
+    int index = -1;
+    for (int i = 0; i < visibilityWindowListeners.length; i++) {
+        if (listener is visibilityWindowListeners[i]){
+            index = i;
+            break;
+        }
+    }
+    if (index is -1) return;
+    if (visibilityWindowListeners.length is 1) {
+        visibilityWindowListeners = new VisibilityWindowListener[0];
+        return;
+    }
+    //VisibilityWindowListener[] newVisibilityWindowListeners = new VisibilityWindowListener[visibilityWindowListeners.length - 1];
+    //System.arraycopy (visibilityWindowListeners, 0, newVisibilityWindowListeners, 0, index);
+    //System.arraycopy (visibilityWindowListeners, index + 1, newVisibilityWindowListeners, index, visibilityWindowListeners.length - index - 1);
+    visibilityWindowListeners = visibilityWindowListeners[0..index] ~ visibilityWindowListeners[index+1..$];
+}
+
+public void setBrowser (Browser browser) {
+    this.browser = browser;
+}
+
+public abstract bool setText (String html);
+
+public abstract bool setUrl (String url);
+
+public abstract void stop ();
+
+int translateKey (int key) {
+    for (int i = 0; i < KeyTable.length; i++) {
+        if (KeyTable[i][0] is key) return KeyTable[i][1];
+    }
+    return 0;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/WindowCreator2.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,221 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.WindowCreator2;
+
+import java.lang.all;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+
+import org.eclipse.swt.internal.Platform;
+import org.eclipse.swt.internal.mozilla.Common;
+
+import XPCOM = org.eclipse.swt.internal.mozilla.XPCOM;
+
+import org.eclipse.swt.internal.mozilla.nsIBaseWindow;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsIURI;
+import org.eclipse.swt.internal.mozilla.nsIWebBrowser;
+import org.eclipse.swt.internal.mozilla.nsIWebBrowserChrome;
+import org.eclipse.swt.internal.mozilla.nsIWindowCreator;
+import org.eclipse.swt.internal.mozilla.nsIWindowCreator2;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+import org.eclipse.swt.internal.mozilla.nsEmbedString;
+
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Shell;
+
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.browser.Mozilla;
+import org.eclipse.swt.browser.VisibilityWindowListener;
+import org.eclipse.swt.browser.CloseWindowListener;
+import org.eclipse.swt.browser.WindowEvent;
+
+class WindowCreator2 : nsIWindowCreator2 {
+    int refCount = 0;
+
+this () {}
+
+extern(System)
+nsrefcnt AddRef () {
+    refCount++;
+    return refCount;
+}
+
+extern(System)
+nsresult QueryInterface (nsID* riid, void** ppvObject) {
+    if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
+    //nsID guid = new nsID ();
+    //XPCOM.memmove (guid, riid, nsID.sizeof);
+    
+    if (*riid == nsISupports.IID) {
+        *ppvObject = cast(void*)cast(nsISupports)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsIWindowCreator.IID) {
+        *ppvObject = cast(void*)cast(nsIWindowCreator)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+    if (*riid == nsIWindowCreator2.IID) {
+        *ppvObject = cast(void*)cast(nsIWindowCreator2)this;
+        AddRef ();
+        return XPCOM.NS_OK;
+    }
+
+    *ppvObject = null;
+    return XPCOM.NS_ERROR_NO_INTERFACE;
+}
+
+extern(System)
+nsresult Release () {
+    refCount--;
+    //if (refCount is 0) disposeCOMInterfaces ();
+    return refCount;
+}
+
+/* nsIWindowCreator */
+
+extern(System)
+nsresult CreateChromeWindow (nsIWebBrowserChrome parent, PRUint32 chromeFlags, nsIWebBrowserChrome* _retval) {
+    return CreateChromeWindow2 (parent, chromeFlags, 0, null, null, _retval);
+}
+
+/* nsIWindowCreator2 */
+
+extern(System)
+nsresult CreateChromeWindow2 (nsIWebBrowserChrome parent, PRUint32 chromeFlags, PRUint32 contextFlags, nsIURI uri, PRBool* cancel, nsIWebBrowserChrome* _retval) {
+    if (parent is null && (chromeFlags & nsIWebBrowserChrome.CHROME_OPENAS_CHROME) is 0) {
+        return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+    }
+    Browser src = null; 
+    if (parent !is null) {
+        //nsIWebBrowserChrome browserChromeParent = new nsIWebBrowserChrome (parent);
+        nsIWebBrowser webBrowser;
+        int rc = parent.GetWebBrowser (&webBrowser);
+        if (rc !is XPCOM.NS_OK) Mozilla.error (rc);
+        if (webBrowser is null) Mozilla.error (XPCOM.NS_ERROR_NO_INTERFACE);
+
+        //nsIWebBrowser webBrowser = new nsIWebBrowser (aWebBrowser[0]);
+        nsIBaseWindow baseWindow;
+        rc = webBrowser.QueryInterface (&nsIBaseWindow.IID, cast(void**)&baseWindow);
+        if (rc !is XPCOM.NS_OK) Mozilla.error (rc);
+        if (baseWindow is null) Mozilla.error (XPCOM.NS_ERROR_NO_INTERFACE);
+        webBrowser.Release ();
+
+        //nsIBaseWindow baseWindow = new nsIBaseWindow (result[0]);
+        //result[0] = 0;
+        nativeWindow aParentNativeWindow;  // nativeWindow is "void*" (represents GtkWidget*)
+        rc = baseWindow.GetParentNativeWindow (&aParentNativeWindow);
+        if (rc !is XPCOM.NS_OK) Mozilla.error (rc);
+        if (aParentNativeWindow is null) Mozilla.error (XPCOM.NS_ERROR_NO_INTERFACE);
+        baseWindow.Release ();
+
+        src = Mozilla.findBrowser (aParentNativeWindow);
+    }
+    Browser browser;
+    bool doit = true;
+    if ((chromeFlags & nsIWebBrowserChrome.CHROME_OPENAS_CHROME) !is 0) {
+        /*
+        * Mozilla will request a new Browser in a modal window in order to emulate a native
+        * dialog that is not available to it (eg.- a print dialog on Linux).  For this
+        * reason modal requests are handled here so that the user is not exposed to them.
+        */
+        int style = SWT.DIALOG_TRIM;
+        if ((chromeFlags & nsIWebBrowserChrome.CHROME_MODAL) !is 0) style |= SWT.APPLICATION_MODAL; 
+        Shell shell = src is null ?
+            new Shell (style) :
+            new Shell (src.getShell(), style);
+        shell.setLayout (new FillLayout ());
+        browser = new Browser (shell, src is null ? SWT.MOZILLA : src.getStyle () & SWT.MOZILLA);
+        browser.addVisibilityWindowListener (new class(shell) VisibilityWindowListener {
+            Shell sh;
+            this (Shell shell) { this.sh = shell; }
+            public void hide (WindowEvent event) {
+            }
+            public void show (WindowEvent event) {
+                if (event.location !is null) sh.setLocation (event.location);
+                if (event.size !is null) {
+                    Point size = event.size;
+                    sh.setSize (sh.computeSize (size.x, size.y));
+                }
+                shell.open ();
+            }
+        });
+        browser.addCloseWindowListener (new class(shell) CloseWindowListener {
+            Shell sh;
+            this (Shell shell) { this.sh = shell; }
+            public void close (WindowEvent event) {
+                sh.close ();
+            }
+        });
+        if (uri !is null) {
+            //nsIURI location = new nsIURI (uri);
+            scope auto aSpec = new nsEmbedCString;
+            if (uri.GetSpec (cast(nsACString*)aSpec) is XPCOM.NS_OK) {
+                int span = aSpec.toString().length;
+                if (span > 0) {
+                    //int /*long*/ buffer = XPCOM.nsEmbedCString_get (aSpec);
+                    // byte[] dest = new byte[length];
+                    //XPCOM.memmove (dest, buffer, length);
+                    browser.setUrl (aSpec.toString);
+                }
+            }
+            //XPCOM.nsEmbedCString_delete (aSpec);
+        }
+    } else {
+        WindowEvent event = new WindowEvent (src);
+        event.display = src.getDisplay ();
+        event.widget = src;
+        event.required = true;
+        for (int i = 0; i < src.webBrowser.openWindowListeners.length; i++) {
+            src.webBrowser.openWindowListeners[i].open (event);
+        }
+        browser = event.browser;
+
+        /* Ensure that the Browser provided by the client is valid for use */ 
+        doit = browser !is null && !browser.isDisposed ();
+        if (doit) {
+            String platform = Platform.PLATFORM;
+            bool isMozillaNativePlatform = platform == "gtk" || platform == "motif"; //$NON-NLS-1$ //$NON-NLS-2$
+            doit = isMozillaNativePlatform || (browser.getStyle () & SWT.MOZILLA) !is 0;
+        }
+    }
+    if (doit) {
+        // STRANGE but TRUE:  browser.webBrowser is always instantiated as Mozilla (on this platform),
+        // so it can be cast back to the subclass Mozilla safely.  Looks very dangerous, though... 
+        // considering the next few lines of code that cast the Mozilla class to the interface, 
+        // nsIWebBrowserChrome.
+        // This is an ugly D conversion hack because interfaces are implemented differently than 
+        // in the Java SWT version.  Watch this code section carefully for errors/bugs. -JJR
+        Mozilla mozilla = cast(Mozilla)browser.webBrowser;
+        mozilla.isChild = true;
+        // And since Mozilla class implements the nsIWebBrowserChrome interface....
+        nsIWebBrowserChrome chrome;
+        nsresult rc = mozilla.QueryInterface( &nsIWebBrowserChrome.IID, cast(void**)&chrome);
+        if (rc !is XPCOM.NS_OK) Mozilla.error (rc);
+        //nsIWebBrowserChrome webBrowserChrome = new nsIWebBrowserChrome (chromePtr);
+        chrome.SetChromeFlags (chromeFlags);
+        //chrome.AddRef ();
+        //XPCOM.memmove (_retval, new int /*long*/[] {chromePtr}, C.PTR_SIZEOF);
+        *_retval = chrome;
+    } else {
+        if (cancel !is null) {
+            *cancel = 1;   /* PRBool */
+        }
+    }
+    return doit ? XPCOM.NS_OK : XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/WindowEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,212 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.browser.WindowEvent;
+
+import tango.text.convert.Format;
+
+import java.lang.all;
+
+import org.eclipse.swt.events.TypedEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swt.browser.Browser;
+
+/**
+ * A <code>WindowEvent</code> is sent by a {@link Browser} when
+ * a new window needs to be created or when an existing window needs to be
+ * closed. This notification occurs when a javascript command such as
+ * <code>window.open</code> or <code>window.close</code> gets executed by
+ * a <code>Browser</code>.
+ *
+ * <p>
+ * The following example shows how <code>WindowEvent</code>'s are typically
+ * handled.
+ * 
+ * <code><pre>
+ *  public static void main(String[] args) {
+ *      Display display = new Display();
+ *      Shell shell = new Shell(display);
+ *      shell.setText("Main Window");
+ *      shell.setLayout(new FillLayout());
+ *      Browser browser = new Browser(shell, SWT.NONE);
+ *      initialize(display, browser);
+ *      shell.open();
+ *      browser.setUrl("http://www.eclipse.org");
+ *      while (!shell.isDisposed()) {
+ *          if (!display.readAndDispatch())
+ *              display.sleep();
+ *      }
+ *      display.dispose();
+ *  }
+ *
+ *  static void initialize(final Display display, Browser browser) {
+ *      browser.addOpenWindowListener(new OpenWindowListener() {
+ *          public void open(WindowEvent event) {
+ *              // Certain platforms can provide a default full browser.
+ *              // simply return in that case if the application prefers
+ *              // the default full browser to the embedded one set below.
+ *              if (!event.required) return;
+ *
+ *              // Embed the new window
+ *              Shell shell = new Shell(display);
+ *              shell.setText("New Window");
+ *              shell.setLayout(new FillLayout());
+ *              Browser browser = new Browser(shell, SWT.NONE);
+ *              initialize(display, browser);
+ *              event.browser = browser;
+ *          }
+ *      });
+ *      browser.addVisibilityWindowListener(new VisibilityWindowListener() {
+ *          public void hide(WindowEvent event) {
+ *              Browser browser = (Browser)event.widget;
+ *              Shell shell = browser.getShell();
+ *              shell.setVisible(false);
+ *          }
+ *          public void show(WindowEvent event) {
+ *              Browser browser = (Browser)event.widget;
+ *              Shell shell = browser.getShell();
+ *              if (event.location !is null) shell.setLocation(event.location);
+ *              if (event.size !is null) {
+ *                  Point size = event.size;
+ *                  shell.setSize(shell.computeSize(size.x, size.y));
+ *              }
+ *              if (event.addressBar || event.menuBar || event.statusBar || event.toolBar) {
+ *                  // Create widgets for the address bar, menu bar, status bar and/or tool bar
+ *                  // leave enough space in the Shell to accommodate a Browser of the size
+ *                  // given by event.size
+ *              }
+ *              shell.open();
+ *          }
+ *      });
+ *      browser.addCloseWindowListener(new CloseWindowListener() {
+ *          public void close(WindowEvent event) {
+ *              Browser browser = (Browser)event.widget;
+ *              Shell shell = browser.getShell();
+ *              shell.close();
+ *          }
+ *      });
+ *  }
+ * </pre></code>
+ * 
+ * The following notifications are emitted when the user selects a hyperlink that targets a new window
+ * or as the result of a javascript that executes window.open. 
+ * 
+ * <p>Main Browser
+ * <ul>
+ *    <li>User selects a link that opens in a new window or javascript requests a new window</li>
+ *    <li>OpenWindowListener.open() notified</li>
+ *    <ul>
+ *          <li>Application creates a new Shell and a second Browser inside that Shell</li>
+ *          <li>Application registers WindowListener's on that second Browser, such as VisibilityWindowListener</li>
+ *          <li>Application returns the second Browser as the host for the new window content</li>
+ *    </ul>
+ * </ul>
+ * 
+ * <p>Second Browser
+ * <ul>
+ *    <li>VisibilityWindowListener.show() notified</li>
+ *    <ul>
+ *          <li>Application sets navigation tool bar, status bar, menu bar and Shell size
+ *          <li>Application makes the Shell hosting the second Browser visible
+ *          <li>User now sees the new window
+ *    </ul> 
+ * </ul>
+ * 
+ * @see CloseWindowListener
+ * @see OpenWindowListener
+ * @see VisibilityWindowListener
+ * 
+ * @since 3.0
+ */
+public class WindowEvent : TypedEvent {
+
+    /** 
+     * Specifies whether the platform requires the user to provide a
+     * <code>Browser</code> to handle the new window.
+     * 
+     * @since 3.1
+     */
+    public bool required;
+    
+    
+    /** 
+     * <code>Browser</code> provided by the application.
+     */
+    public Browser browser;
+
+    /** 
+     * Requested location for the <code>Shell</code> hosting the <code>Browser</code>.
+     * It is <code>null</code> if no location has been requested.
+     */
+    public Point location;
+
+    /** 
+     * Requested <code>Browser</code> size. The client area of the <code>Shell</code> 
+     * hosting the <code>Browser</code> should be large enough to accommodate that size. 
+     * It is <code>null</code> if no size has been requested.
+     */
+    public Point size;
+    
+    /**
+     * Specifies whether the <code>Shell</code> hosting the <code>Browser</code> should
+     * display an address bar.
+     * 
+     * @since 3.1
+     */
+    public bool addressBar;
+
+    /**
+     * Specifies whether the <code>Shell</code> hosting the <code>Browser</code> should
+     * display a menu bar.
+     * 
+     * @since 3.1
+     */
+    public bool menuBar;
+    
+    /**
+     * Specifies whether the <code>Shell</code> hosting the <code>Browser</code> should
+     * display a status bar.
+     * 
+     * @since 3.1
+     */
+    public bool statusBar;
+    
+    /**
+     * Specifies whether the <code>Shell</code> hosting the <code>Browser</code> should
+     * display a tool bar.
+     * 
+     * @since 3.1
+     */
+    public bool toolBar;
+    
+    static final long serialVersionUID = 3617851997387174969L;
+    
+this(Widget w) {
+    super(w);
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+
+public String toString() {
+    return Format( "{} {required = {}, browser = {}, location = {}, size = {}, addressbar = {}, menubar = {}, statusbar = {}, toolbar = {}}", 
+        super.toString[1 .. $-2], 
+        required, browser, 
+        location, size, addressBar, 
+        menuBar, statusBar, toolBar ); 
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/browser/all.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,42 @@
+module org.eclipse.swt.browser.all;
+
+import java.lang.all;
+
+public import org.eclipse.swt.browser.AppFileLocProvider;
+public import org.eclipse.swt.browser.Browser;
+public import org.eclipse.swt.browser.CloseWindowListener;
+public import org.eclipse.swt.browser.Download;
+public import org.eclipse.swt.browser.DownloadFactory;
+public import org.eclipse.swt.browser.DownloadFactory_1_8;
+public import org.eclipse.swt.browser.Download_1_8;
+public import org.eclipse.swt.browser.FilePicker;
+public import org.eclipse.swt.browser.FilePickerFactory;
+public import org.eclipse.swt.browser.FilePickerFactory_1_8;
+public import org.eclipse.swt.browser.FilePicker_1_8;
+public import org.eclipse.swt.browser.HelperAppLauncherDialog;
+public import org.eclipse.swt.browser.HelperAppLauncherDialogFactory;
+public import org.eclipse.swt.browser.InputStream;
+public import org.eclipse.swt.browser.LocationAdapter;
+public import org.eclipse.swt.browser.LocationEvent;
+public import org.eclipse.swt.browser.LocationListener;
+public import org.eclipse.swt.browser.Mozilla;
+public import org.eclipse.swt.browser.MozillaDelegate;
+public import org.eclipse.swt.browser.OpenWindowListener;
+public import org.eclipse.swt.browser.ProgressAdapter;
+public import org.eclipse.swt.browser.ProgressEvent;
+public import org.eclipse.swt.browser.ProgressListener;
+public import org.eclipse.swt.browser.PromptDialog;
+public import org.eclipse.swt.browser.PromptService2;
+public import org.eclipse.swt.browser.PromptService2Factory;
+public import org.eclipse.swt.browser.SimpleEnumerator;
+public import org.eclipse.swt.browser.StatusTextEvent;
+public import org.eclipse.swt.browser.StatusTextListener;
+public import org.eclipse.swt.browser.TitleEvent;
+public import org.eclipse.swt.browser.TitleListener;
+public import org.eclipse.swt.browser.VisibilityWindowAdapter;
+public import org.eclipse.swt.browser.VisibilityWindowListener;
+public import org.eclipse.swt.browser.WebBrowser;
+public import org.eclipse.swt.browser.WindowCreator2;
+public import org.eclipse.swt.browser.WindowEvent;
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/AnimatedProgress.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,246 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.AnimatedProgress;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * A control for showing progress feedback for a long running operation.
+ *
+ * @deprecated As of Eclipse 2.1, use ProgressBar with the style SWT.INDETERMINATE
+ *
+ * <dl>
+ * <dt><b>Styles:</b><dd>VERTICAL, HORIZONTAL, BORDER
+ * </dl>
+ *
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class AnimatedProgress : Canvas {
+
+    alias Canvas.computeSize computeSize;
+
+    static const int SLEEP = 70;
+    static const int DEFAULT_WIDTH = 160;
+    static const int DEFAULT_HEIGHT = 18;
+    bool active = false;
+    bool showStripes = false;
+    int value;
+    int orientation = SWT.HORIZONTAL;
+    bool showBorder = false;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a widget which will be the parent of the new instance (cannot be null)
+ * @param style the style of widget to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ *
+ * @see SWT#VERTICAL
+ * @see SWT#HORIZONTAL
+ * @see SWT#BORDER
+ * @see #getStyle()
+ */
+public this(Composite parent, int style) {
+    super(parent, checkStyle(style));
+
+    if ((style & SWT.VERTICAL) !is 0) {
+        orientation = SWT.VERTICAL;
+    }
+    showBorder = (style & SWT.BORDER) !is 0;
+
+    addControlListener(new class() ControlAdapter {
+        public void controlResized(ControlEvent e) {
+            redraw();
+        }
+    });
+    addPaintListener(new class() PaintListener {
+        public void paintControl(PaintEvent e) {
+            paint(e);
+        }
+    });
+    addDisposeListener(new class() DisposeListener {
+        public void widgetDisposed(DisposeEvent e){
+            stop();
+        }
+    });
+}
+private static int checkStyle (int style) {
+    int mask = SWT.NONE;
+    return style & mask;
+}
+/**
+ * Stop the animation if it is not already stopped and
+ * reset the presentation to a blank appearance.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public synchronized void clear(){
+    checkWidget();
+    if (active) stop();
+    showStripes = false;
+    redraw();
+}
+public override Point computeSize(int wHint, int hHint, bool changed) {
+    checkWidget();
+    Point size = null;
+    if (orientation is SWT.HORIZONTAL) {
+        size = new Point(DEFAULT_WIDTH, DEFAULT_HEIGHT);
+    } else {
+        size = new Point(DEFAULT_HEIGHT, DEFAULT_WIDTH);
+    }
+    if (wHint !is SWT.DEFAULT) size.x = wHint;
+    if (hHint !is SWT.DEFAULT) size.y = hHint;
+
+    return size;
+}
+private void drawBevelRect(GC gc, int x, int y, int w, int h, Color topleft, Color bottomright) {
+    gc.setForeground(topleft);
+    gc.drawLine(x, y, x+w-1, y);
+    gc.drawLine(x, y, x, y+h-1);
+
+    gc.setForeground(bottomright);
+    gc.drawLine(x+w, y, x+w, y+h);
+    gc.drawLine(x, y+h, x+w, y+h);
+}
+void paint(PaintEvent event) {
+    GC gc = event.gc;
+    Display disp= getDisplay();
+
+    Rectangle rect= getClientArea();
+    gc.fillRectangle(rect);
+    if (showBorder) {
+        drawBevelRect(gc, rect.x, rect.y, rect.width-1, rect.height-1,
+            disp.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW),
+            disp.getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW));
+    }
+
+    paintStripes(gc);
+}
+void paintStripes(GC gc) {
+
+    if (!showStripes) return;
+
+    Rectangle rect= getClientArea();
+    // Subtracted border painted by paint.
+    rect = new Rectangle(rect.x+2, rect.y+2, rect.width-4, rect.height-4);
+
+    gc.setLineWidth(2);
+    gc.setClipping(rect);
+    Color color = getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION);
+    gc.setBackground(color);
+    gc.fillRectangle(rect);
+    gc.setForeground(this.getBackground());
+    int step = 12;
+    int foregroundValue = value is 0 ? step - 2 : value - 2;
+    if (orientation is SWT.HORIZONTAL) {
+        int y = rect.y - 1;
+        int w = rect.width;
+        int h = rect.height + 2;
+        for (int i= 0; i < w; i+= step) {
+            int x = i + foregroundValue;
+            gc.drawLine(x, y, x, h);
+        }
+    } else {
+        int x = rect.x - 1;
+        int w = rect.width + 2;
+        int h = rect.height;
+
+        for (int i= 0; i < h; i+= step) {
+            int y = i + foregroundValue;
+            gc.drawLine(x, y, w, y);
+        }
+    }
+
+    if (active) {
+        value = (value + 2) % step;
+    }
+}
+/**
+* Start the animation.
+*
+* @exception SWTException <ul>
+*    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+*    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+* </ul>
+*/
+public synchronized void start() {
+    checkWidget();
+    if (active) return;
+
+    active = true;
+    showStripes = true;
+
+    Display display = getDisplay();
+    Runnable [] timer = new Runnable [1];
+
+    timer [0] = new class( display, timer ) Runnable {
+        Display disp;
+        Runnable [] runs;
+        this( Display disp, Runnable[] runs ){
+            this.disp = disp;
+            this.runs = runs;
+        }
+        public void run () {
+            if (!active) return;
+            GC gc = new GC(this.outer);
+            paintStripes(gc);
+            gc.dispose();
+            disp.timerExec (SLEEP, runs [0]);
+        }
+    };
+    display.timerExec (SLEEP, timer [0]);
+}
+/**
+* Stop the animation.   Freeze the presentation at its current appearance.
+*/
+public synchronized void stop() {
+    //checkWidget();
+    active = false;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/BidiSegmentEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.BidiSegmentEvent;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.events.TypedEvent;
+import org.eclipse.swt.custom.StyledTextEvent;
+
+/**
+ * This event is sent to BidiSegmentListeners when a line is to
+ * be measured or rendered in a bidi locale.  The segments field is
+ * used to specify text ranges in the line that should be treated as
+ * separate segments for bidi reordering.  Each segment will be reordered
+ * and rendered separately.
+ * <p>
+ * The elements in the segments field specify the start offset of
+ * a segment relative to the start of the line. They must follow
+ * the following rules:
+ * <ul>
+ * <li>first element must be 0
+ * <li>elements must be in ascending order and must not have duplicates
+ * <li>elements must not exceed the line length
+ * </ul>
+ * In addition, the last element may be set to the end of the line
+ * but this is not required.
+ *
+ * The segments field may be left null if the entire line should
+ * be reordered as is.
+ * </p>
+ * A BidiSegmentListener may be used when adjacent segments of
+ * right-to-left text should not be reordered relative to each other.
+ * For example, within a Java editor, you may wish multiple
+ * right-to-left string literals to be reordered differently than the
+ * bidi algorithm specifies.
+ *
+ * Example:
+ * <pre>
+ *  stored line = "R1R2R3" + "R4R5R6"
+ *      R1 to R6 are right-to-left characters. The quotation marks
+ *      are part of the line text. The line is 13 characters long.
+ *
+ *  segments = null:
+ *      entire line will be reordered and thus the two R2L segments
+ *      swapped (as per the bidi algorithm).
+ *      visual line (rendered on screen) = "R6R5R4" + "R3R2R1"
+ *
+ *  segments = [0, 5, 8]
+ *      "R1R2R3" will be reordered, followed by [blank]+[blank] and
+ *      "R4R5R6".
+ *      visual line = "R3R2R1" + "R6R5R4"
+ * </pre>
+ *
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class BidiSegmentEvent : TypedEvent {
+
+    /**
+     * line start offset
+     */
+    public int lineOffset;
+
+    /**
+     * line text
+     */
+    public String lineText;
+
+    /**
+     * bidi segments, see above
+     */
+    public int[] segments;
+
+this(StyledTextEvent e) {
+    super(cast(Object)e);
+    lineOffset = e.detail;
+    lineText = e.text;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/BidiSegmentListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.BidiSegmentListener;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.SWTEventListener;
+import org.eclipse.swt.custom.BidiSegmentEvent;
+
+/**
+ * This listener interface may be implemented in order to receive
+ * BidiSegmentEvents.
+ * @see BidiSegmentEvent
+ */
+public interface BidiSegmentListener : SWTEventListener {
+
+/**
+ * This method is called when a line needs to be reordered for
+ * measuring or rendering in a bidi locale.
+ * <p>
+ * The following event fields are used:<ul>
+ * <li>event.lineOffset line start offset (input)</li>
+ * <li>event.lineText line text (input)</li>
+ * <li>event.segments text segments that should be reordered
+ *  separately. (output)</li>
+ * </ul>
+ *
+ * @param event the given event
+ *  separately. (output)
+ * @see BidiSegmentEvent
+ */
+public void lineGetSegments(BidiSegmentEvent event);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/Bullet.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,162 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.Bullet;
+
+import java.lang.all;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.custom.ST;
+
+/**
+ * Instances of this class represent bullets in the <code>StyledText</code>.
+ * <p>
+ * The hashCode() method in this class uses the values of the public
+ * fields to compute the hash value. When storing instances of the
+ * class in hashed collections, do not modify these fields after the
+ * object has been inserted.
+ * </p>
+ * <p>
+ * Application code does <em>not</em> need to explicitly release the
+ * resources managed by each instance when those instances are no longer
+ * required, and thus no <code>dispose()</code> method is provided.
+ * </p>
+ *
+ * @see StyledText#setLineBullet(int, int, Bullet)
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.2
+ */
+public class Bullet {
+    /**
+    * The bullet type.  Possible values are:
+    * <ul>
+    * <li><code>ST.BULLET_DOT</code></li>
+    * <li><code>ST.BULLET_NUMBER</code></li>
+    * <li><code>ST.BULLET_LETTER_LOWER</code></li>
+    * <li><code>ST.BULLET_LETTER_UPPER</code></li>
+    * <li><code>ST.BULLET_TEXT</code></li>
+    * <li><code>ST.BULLET_CUSTOM</code></li>
+    * </ul>
+    */
+    public int type;
+
+    /**
+    * The bullet style.
+    */
+    public StyleRange style;
+
+    /**
+    * The bullet text.
+    */
+    public String text;
+
+    int[] linesIndices;
+    int count;
+
+/**
+ * Create a new bullet with the specified style, and type <code>ST.BULLET_DOT</code>. 
+ * The style must have a glyph metrics set.
+ *
+ * @param style the style
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when the style or the glyph metrics are null</li>
+ * </ul>
+ */
+public this(StyleRange style) {
+    this(ST.BULLET_DOT, style);
+}
+/**
+ * Create a new bullet the specified style and type.
+ * The style must have a glyph metrics set.
+ *
+ * @param type the bullet type
+ * @param style the style
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when the style or the glyph metrics are null</li>
+ * </ul>
+ */
+public this(int type, StyleRange style) {
+    if (style is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (style.metrics is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    this.type = type;
+    this.style = style;
+}
+void addIndices (int startLine, int lineCount) {
+    if (linesIndices is null) {
+        linesIndices = new int[lineCount];
+        count = lineCount;
+        for (int i = 0; i < lineCount; i++) linesIndices[i] = startLine + i;
+    } else {
+        int modifyStart = 0;
+        while (modifyStart < count) {
+            if (startLine <= linesIndices[modifyStart]) break;
+            modifyStart++;
+        }
+        int modifyEnd = modifyStart;
+        while (modifyEnd < count) {
+            if (startLine + lineCount <= linesIndices[modifyEnd]) break;
+            modifyEnd++;
+        }
+        int newSize = modifyStart + lineCount + count - modifyEnd;
+        if (newSize > linesIndices.length) {
+            int[] newLinesIndices = new int[newSize];
+            System.arraycopy(linesIndices, 0, newLinesIndices, 0, count);
+            linesIndices = newLinesIndices;
+        }
+        System.arraycopy(linesIndices, modifyEnd, linesIndices, modifyStart + lineCount, count - modifyEnd);
+        for (int i = 0; i < lineCount; i++) linesIndices[modifyStart + i] = startLine + i;
+        count = newSize;
+    }
+}
+int indexOf (int lineIndex) {
+    for (int i = 0; i < count; i++) {
+        if (linesIndices[i] is lineIndex) return i;
+    }
+    return -1;
+}
+public override hash_t toHash() {
+    return style.toHash() ^ type;
+}
+int[] removeIndices (int startLine, int replaceLineCount, int newLineCount, bool update) {
+    if (count is 0) return null;
+    if (startLine > linesIndices[count - 1]) return null;
+    int endLine = startLine + replaceLineCount;
+    int delta = newLineCount - replaceLineCount;
+    for (int i = 0; i < count; i++) {
+        int index = linesIndices[i];
+        if (startLine <= index) {
+            int j = i;
+            while (j < count) {
+                if (linesIndices[j] >= endLine) break;
+                j++;
+            }
+            if (update) {
+                for (int k = j; k < count; k++) linesIndices[k] += delta;
+            }
+            int[] redrawLines = new int[count - j];
+            System.arraycopy(linesIndices, j, redrawLines, 0, count - j);
+            System.arraycopy(linesIndices, j, linesIndices, i, count - j);
+            count -= (j - i);
+            return redrawLines;
+        }
+    }
+    for (int i = 0; i < count; i++) linesIndices[i] += delta;
+    return null;
+}
+int size() {
+    return count;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/BusyIndicator.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.BusyIndicator;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import java.lang.all;
+
+/**
+ * Support for showing a Busy Cursor during a long running process.
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#busyindicator">BusyIndicator snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class BusyIndicator {
+
+    static int nextBusyId = 1;
+    static const String BUSYID_NAME = "SWT BusyIndicator"; //$NON-NLS-1$
+    static const String BUSY_CURSOR = "SWT BusyIndicator Cursor"; //$NON-NLS-1$
+
+/**
+ * Runs the given <code>Runnable</code> while providing
+ * busy feedback using this busy indicator.
+ *
+ * @param display the display on which the busy feedback should be
+ *        displayed.  If the display is null, the Display for the current
+ *        thread will be used.  If there is no Display for the current thread,
+ *        the runnable code will be executed and no busy feedback will be displayed.
+ * @param runnable the runnable for which busy feedback is to be shown.
+ *        Must not be null.
+ *
+* @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the runnable is null</li>
+ * </ul>
+ */
+
+public static void showWhile(Display display, Runnable runnable) {
+    if (runnable is null)
+        SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (display is null) {
+        display = Display.getCurrent();
+        if (display is null) {
+            runnable.run();
+            return;
+        }
+    }
+
+    Integer busyId = new Integer(nextBusyId);
+    nextBusyId++;
+    Cursor cursor = display.getSystemCursor(SWT.CURSOR_WAIT);
+    Shell[] shells = display.getShells();
+    for (int i = 0; i < shells.length; i++) {
+        Integer id = cast(Integer)shells[i].getData(BUSYID_NAME);
+        if (id is null) {
+            shells[i].setCursor(cursor);
+            shells[i].setData(BUSYID_NAME, busyId);
+        }
+    }
+
+    try {
+        runnable.run();
+    } finally {
+        shells = display.getShells();
+        for (int i = 0; i < shells.length; i++) {
+            Integer id = cast(Integer)shells[i].getData(BUSYID_NAME);
+            if ( id !is null && id == busyId) {
+                shells[i].setCursor(null);
+                shells[i].setData(BUSYID_NAME, null);
+            }
+        }
+    }
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/CBanner.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,561 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.CBanner;
+
+import java.lang.all;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Layout;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.custom.CBannerLayout;
+
+
+
+/**
+ * Instances of this class implement a Composite that lays out its
+ * children and allows programmatic control of the layout. It draws
+ * a separator between the left and right children which can be dragged
+ * to resize the right control.
+ * CBanner is used in the workbench to layout the toolbar area and
+ * perspective switching toolbar.
+ * <p>
+ * Note that although this class is a subclass of <code>Composite</code>,
+ * it does not make sense to set a layout on it.
+ * </p><p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>NONE</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(None)</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.0
+ */
+
+public class CBanner : Composite {
+
+    Control left;
+    Control right;
+    Control bottom;
+
+    bool simple = true;
+
+    int[] curve;
+    int curveStart = 0;
+    Rectangle curveRect;
+    int curve_width = 5;
+    int curve_indent = -2;
+
+    int rightWidth = SWT.DEFAULT;
+    int rightMinWidth = 0;
+    int rightMinHeight = 0;
+    Cursor resizeCursor;
+    bool dragging = false;
+    int rightDragDisplacement = 0;
+
+    static const int OFFSCREEN = -200;
+    static const int BORDER_BOTTOM = 2;
+    static const int BORDER_TOP = 3;
+    static const int BORDER_STRIPE = 1;
+    static const int CURVE_TAIL = 200;
+    static const int BEZIER_RIGHT = 30;
+    static const int BEZIER_LEFT = 30;
+    static const int MIN_LEFT = 10;
+    static int BORDER1 = SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW;
+
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a widget which will be the parent of the new instance (cannot be null)
+ * @param style the style of widget to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ *
+ */
+public this(Composite parent, int style) {
+    curveRect = new Rectangle(0, 0, 0, 0);
+    super(parent, checkStyle(style));
+    super.setLayout(new CBannerLayout());
+    resizeCursor = new Cursor(getDisplay(), SWT.CURSOR_SIZEWE);
+
+    Listener listener = new class() Listener {
+        public void handleEvent(Event e) {
+            switch (e.type) {
+                case SWT.Dispose:
+                    onDispose(); break;
+                case SWT.MouseDown:
+                    onMouseDown (e.x, e.y); break;
+                case SWT.MouseExit:
+                    onMouseExit(); break;
+                case SWT.MouseMove:
+                    onMouseMove(e.x, e.y); break;
+                case SWT.MouseUp:
+                    onMouseUp(); break;
+                case SWT.Paint:
+                    onPaint(e.gc); break;
+                case SWT.Resize:
+                    onResize(); break;
+                default:
+            }
+        }
+    };
+    int[] events = [SWT.Dispose, SWT.MouseDown, SWT.MouseExit, SWT.MouseMove, SWT.MouseUp, SWT.Paint, SWT.Resize];
+    for (int i = 0; i < events.length; i++) {
+        addListener(events[i], listener);
+    }
+}
+static int[] bezier(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, int count) {
+    // The parametric equations for a Bezier curve for x[t] and y[t] where  0 <= t <=1 are:
+    // x[t] = x0+3(x1-x0)t+3(x0+x2-2x1)t^2+(x3-x0+3x1-3x2)t^3
+    // y[t] = y0+3(y1-y0)t+3(y0+y2-2y1)t^2+(y3-y0+3y1-3y2)t^3
+    double a0 = x0;
+    double a1 = 3*(x1 - x0);
+    double a2 = 3*(x0 + x2 - 2*x1);
+    double a3 = x3 - x0 + 3*x1 - 3*x2;
+    double b0 = y0;
+    double b1 = 3*(y1 - y0);
+    double b2 = 3*(y0 + y2 - 2*y1);
+    double b3 = y3 - y0 + 3*y1 - 3*y2;
+
+    int[] polygon = new int[2*count + 2];
+    for (int i = 0; i <= count; i++) {
+        double t = cast(double)i / cast(double)count;
+        polygon[2*i] = cast(int)(a0 + a1*t + a2*t*t + a3*t*t*t);
+        polygon[2*i + 1] = cast(int)(b0 + b1*t + b2*t*t + b3*t*t*t);
+    }
+    return polygon;
+}
+static int checkStyle (int style) {
+    return SWT.NONE;
+}
+/**
+* Returns the Control that appears on the bottom side of the banner.
+*
+* @return the control that appears on the bottom side of the banner or null
+*
+* @exception SWTException <ul>
+*    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+*    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+* </ul>
+*
+* @since 3.0
+*/
+public Control getBottom() {
+    checkWidget();
+    return bottom;
+}
+public override Rectangle getClientArea() {
+    return new Rectangle(0, 0, 0, 0);
+}
+
+/**
+* Returns the Control that appears on the left side of the banner.
+*
+* @return the control that appears on the left side of the banner or null
+*
+* @exception SWTException <ul>
+*    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+*    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+* </ul>
+*
+* @since 3.0
+*/
+public Control getLeft() {
+    checkWidget();
+    return left;
+}
+
+/**
+* Returns the Control that appears on the right side of the banner.
+*
+* @return the control that appears on the right side of the banner or null
+*
+* @exception SWTException <ul>
+*    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+*    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+* </ul>
+*
+* @since 3.0
+*/
+public Control getRight() {
+    checkWidget();
+    return right;
+}
+/**
+ * Returns the minimum size of the control that appears on the right of the banner.
+ *
+ * @return the minimum size of the control that appears on the right of the banner
+ *
+ * @since 3.1
+ */
+public Point getRightMinimumSize() {
+    checkWidget();
+    return new Point(rightMinWidth, rightMinHeight);
+}
+/**
+ * Returns the width of the control that appears on the right of the banner.
+ *
+ * @return the width of the control that appears on the right of the banner
+ *
+ * @since 3.0
+ */
+public int getRightWidth() {
+    checkWidget();
+    if (right is null) return 0;
+    if (rightWidth is SWT.DEFAULT) {
+        Point size = right.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
+        return size.x;
+    }
+    return rightWidth;
+}
+/**
+ * Returns <code>true</code> if the CBanner is rendered
+ * with a simple, traditional shape.
+ *
+ * @return <code>true</code> if the CBanner is rendered with a simple shape
+ *
+ * @since 3.0
+ */
+public bool getSimple() {
+    checkWidget();
+    return simple;
+}
+void onDispose() {
+    if (resizeCursor !is null) resizeCursor.dispose();
+    resizeCursor = null;
+    left = null;
+    right = null;
+    bottom = null;
+}
+void onMouseDown (int x, int y) {
+    if (curveRect.contains(x, y)) {
+        dragging = true;
+        rightDragDisplacement = curveStart - x + curve_width - curve_indent;
+    }
+}
+void onMouseExit() {
+    if (!dragging) setCursor(null);
+}
+void onMouseMove(int x, int y) {
+    if (dragging) {
+        Point size = getSize();
+        if (!(0 < x && x < size.x)) return;
+        rightWidth = Math.max(0, size.x - x - rightDragDisplacement);
+        if (rightMinWidth is SWT.DEFAULT) {
+            Point minSize = right.computeSize(rightMinWidth, rightMinHeight);
+            rightWidth = Math.max(minSize.x, rightWidth);
+        } else {
+            rightWidth = Math.max(rightMinWidth, rightWidth);
+        }
+        layout(false);
+        return;
+    }
+    if (curveRect.contains(x, y)) {
+        setCursor(resizeCursor);
+    } else {
+        setCursor(null);
+    }
+}
+void onMouseUp () {
+    dragging = false;
+}
+void onPaint(GC gc) {
+//   Useful for debugging paint problems
+//  {
+//  Point size = getSize();
+//  gc.setBackground(getDisplay().getSystemColor(SWT.COLOR_GREEN));
+//  gc.fillRectangle(-10, -10, size.x+20, size.y+20);
+//  }
+    if (left is null && right is null) return;
+    Point size = getSize();
+    Color border1 = getDisplay().getSystemColor(BORDER1);
+    if (bottom !is null) {
+        int y = bottom.getBounds().y - BORDER_STRIPE - 1;
+        gc.setForeground(border1);
+        gc.drawLine(0, y, size.x, y);
+    }
+    if (left is null || right is null) return;
+    int[] line1 = new int[curve.length+6];
+    int index = 0;
+    int x = curveStart;
+    line1[index++] = x + 1;
+    line1[index++] = size.y - BORDER_STRIPE;
+    for (int i = 0; i < curve.length/2; i++) {
+        line1[index++]=x+curve[2*i];
+        line1[index++]=curve[2*i+1];
+    }
+    line1[index++] = x + curve_width;
+    line1[index++] = 0;
+    line1[index++] = size.x;
+    line1[index++] = 0;
+
+    Color background = getBackground();
+
+    if (getDisplay().getDepth() >= 15) {
+        // Anti- aliasing
+        int[] line2 = new int[line1.length];
+        index = 0;
+        for (int i = 0; i < line1.length/2; i++) {
+            line2[index] = line1[index++]  - 1;
+            line2[index] = line1[index++];
+        }
+        int[] line3 = new int[line1.length];
+        index = 0;
+        for (int i = 0; i < line1.length/2; i++) {
+            line3[index] = line1[index++] + 1;
+            line3[index] = line1[index++];
+        }
+        RGB from = border1.getRGB();
+        RGB to = background.getRGB();
+        int red = from.red + 3*(to.red - from.red)/4;
+        int green = from.green + 3*(to.green - from.green)/4;
+        int blue = from.blue + 3*(to.blue - from.blue)/4;
+        Color color = new Color(getDisplay(), red, green, blue);
+        gc.setForeground(color);
+        gc.drawPolyline(line2);
+        gc.drawPolyline(line3);
+        color.dispose();
+
+        // draw tail fading to background
+        int x1 = Math.max(0, curveStart - CURVE_TAIL);
+        gc.setForeground(background);
+        gc.setBackground(border1);
+        gc.fillGradientRectangle(x1, size.y - BORDER_STRIPE, curveStart-x1+1, 1, false);
+    } else {
+        // draw solid tail
+        int x1 = Math.max(0, curveStart - CURVE_TAIL);
+        gc.setForeground(border1);
+        gc.drawLine(x1, size.y - BORDER_STRIPE, curveStart+1, size.y - BORDER_STRIPE);
+    }
+
+    // draw border
+    gc.setForeground(border1);
+    gc.drawPolyline(line1);
+}
+
+void onResize() {
+    updateCurve(getSize().y);
+}
+/**
+* Set the control that appears on the bottom side of the banner.
+* The bottom control is optional.  Setting the bottom control to null will remove it from
+* the banner - however, the creator of the control must dispose of the control.
+*
+* @param control the control to be displayed on the bottom or null
+*
+* @exception SWTException <ul>
+*    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+*    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+*    <li>ERROR_INVALID_ARGUMENT - if the bottom control was not created as a child of the receiver</li>
+* </ul>
+*
+* @since 3.0
+*/
+public void setBottom(Control control) {
+    checkWidget();
+    if (control !is null && control.getParent() !is this) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (bottom !is null && !bottom.isDisposed()) {
+        Point size = bottom.getSize();
+        bottom.setLocation(OFFSCREEN - size.x, OFFSCREEN - size.y);
+    }
+    bottom = control;
+    layout(false);
+}
+/**
+ * Sets the layout which is associated with the receiver to be
+ * the argument which may be null.
+ * <p>
+ * Note: No Layout can be set on this Control because it already
+ * manages the size and position of its children.
+ * </p>
+ *
+ * @param layout the receiver's new layout or null
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public override void setLayout (Layout layout) {
+    checkWidget();
+    return;
+}
+
+/**
+* Set the control that appears on the left side of the banner.
+* The left control is optional.  Setting the left control to null will remove it from
+* the banner - however, the creator of the control must dispose of the control.
+*
+* @param control the control to be displayed on the left or null
+*
+* @exception SWTException <ul>
+*    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+*    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+*    <li>ERROR_INVALID_ARGUMENT - if the left control was not created as a child of the receiver</li>
+* </ul>
+*
+* @since 3.0
+*/
+public void setLeft(Control control) {
+    checkWidget();
+    if (control !is null && control.getParent() !is this) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (left !is null && !left.isDisposed()) {
+        Point size = left.getSize();
+        left.setLocation(OFFSCREEN - size.x, OFFSCREEN - size.y);
+    }
+    left = control;
+    layout(false);
+}
+/**
+* Set the control that appears on the right side of the banner.
+* The right control is optional.  Setting the right control to null will remove it from
+* the banner - however, the creator of the control must dispose of the control.
+*
+* @param control the control to be displayed on the right or null
+*
+* @exception SWTException <ul>
+*    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+*    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+*    <li>ERROR_INVALID_ARGUMENT - if the right control was not created as a child of the receiver</li>
+* </ul>
+*
+* @since 3.0
+*/
+public void setRight(Control control) {
+    checkWidget();
+    if (control !is null && control.getParent() !is this) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (right !is null && !right.isDisposed()) {
+        Point size = right.getSize();
+        right.setLocation(OFFSCREEN - size.x, OFFSCREEN - size.y);
+    }
+    right = control;
+    layout(false);
+}
+/**
+ * Set the minimum height of the control that appears on the right side of the banner.
+ *
+ * @param size the minimum size of the control on the right
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the size is null or the values of size are less than SWT.DEFAULT</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void setRightMinimumSize(Point size) {
+    checkWidget();
+    if (size is null || size.x < SWT.DEFAULT || size.y < SWT.DEFAULT) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    rightMinWidth = size.x;
+    rightMinHeight = size.y;
+    layout(false);
+}
+/**
+ * Set the width of the control that appears on the right side of the banner.
+ *
+ * @param width the width of the control on the right
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if width is less than SWT.DEFAULT</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setRightWidth(int width) {
+    checkWidget();
+    if (width < SWT.DEFAULT) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    rightWidth = width;
+    layout(false);
+}
+/**
+ * Sets the shape that the CBanner will use to render itself.
+ *
+ * @param simple <code>true</code> if the CBanner should render itself in a simple, traditional style
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setSimple(bool simple) {
+    checkWidget();
+    if (this.simple !is simple) {
+        this.simple = simple;
+        if (simple) {
+            curve_width = 5;
+            curve_indent = -2;
+        } else {
+            curve_width = 50;
+            curve_indent = 5;
+        }
+        updateCurve(getSize().y);
+        layout(false);
+        redraw();
+    }
+}
+void updateCurve(int height) {
+    int h = height - BORDER_STRIPE;
+    if (simple) {
+        curve = [0,h, 1,h, 2,h-1, 3,h-2,
+                                   3,2, 4,1, 5,0];
+    } else {
+        curve = bezier(0, h+1, BEZIER_LEFT, h+1,
+                             curve_width-BEZIER_RIGHT, 0, curve_width, 0,
+                             curve_width);
+    }
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/CBannerLayout.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,200 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.CBannerLayout;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Layout;
+import org.eclipse.swt.widgets.Scrollable;
+import org.eclipse.swt.custom.CBanner;
+import org.eclipse.swt.custom.CLayoutData;
+
+
+/**
+ * This class provides the layout for CBanner
+ *
+ * @see CBanner
+ */
+class CBannerLayout : Layout {
+
+protected override Point computeSize(Composite composite, int wHint, int hHint, bool flushCache) {
+    CBanner banner = cast(CBanner)composite;
+    Control left = banner.left;
+    Control right = banner.right;
+    Control bottom = banner.bottom;
+    bool showCurve = left !is null && right !is null;
+    int height = hHint;
+    int width = wHint;
+
+    // Calculate component sizes
+    Point bottomSize = new Point(0, 0);
+    if (bottom !is null) {
+        int trim = computeTrim(bottom);
+        int w = wHint is SWT.DEFAULT ? SWT.DEFAULT : Math.max(0, width - trim);
+        bottomSize = computeChildSize(bottom, w, SWT.DEFAULT, flushCache);
+    }
+    Point rightSize = new Point(0, 0);
+    if (right !is null) {
+        int trim = computeTrim(right);
+        int w = SWT.DEFAULT;
+        if (banner.rightWidth !is SWT.DEFAULT) {
+            w = banner.rightWidth - trim;
+            if (left !is null) {
+                w = Math.min(w, width - banner.curve_width + 2* banner.curve_indent - CBanner.MIN_LEFT - trim);
+            }
+            w = Math.max(0, w);
+        }
+        rightSize = computeChildSize(right, w, SWT.DEFAULT, flushCache);
+        if (wHint !is SWT.DEFAULT) {
+            width -= rightSize.x + banner.curve_width - 2* banner.curve_indent;
+        }
+    }
+    Point leftSize = new Point(0, 0);
+    if (left !is null) {
+        int trim = computeTrim(left);
+        int w = wHint is SWT.DEFAULT ? SWT.DEFAULT : Math.max(0, width - trim);
+        leftSize = computeChildSize(left, w, SWT.DEFAULT, flushCache);
+    }
+
+    // Add up sizes
+    width = leftSize.x + rightSize.x;
+    height = bottomSize.y;
+    if (bottom !is null && (left !is null || right !is null)) {
+        height += CBanner.BORDER_STRIPE + 2;
+    }
+    if (left !is null) {
+        if (right is null) {
+            height += leftSize.y;
+        } else {
+            height += Math.max(leftSize.y, banner.rightMinHeight is SWT.DEFAULT ? rightSize.y : banner.rightMinHeight);
+        }
+    } else {
+        height += rightSize.y;
+    }
+    if (showCurve) {
+        width += banner.curve_width - 2*banner.curve_indent;
+        height +=  CBanner.BORDER_TOP + CBanner.BORDER_BOTTOM + 2*CBanner.BORDER_STRIPE;
+    }
+
+    if (wHint !is SWT.DEFAULT) width = wHint;
+    if (hHint !is SWT.DEFAULT) height = hHint;
+
+    return new Point(width, height);
+}
+Point computeChildSize(Control control, int wHint, int hHint, bool flushCache) {
+    Object data = control.getLayoutData();
+    if (data is null || !( null !is cast(CLayoutData)data)) {
+        data = new CLayoutData();
+        control.setLayoutData(data);
+    }
+    return (cast(CLayoutData)data).computeSize(control, wHint, hHint, flushCache);
+}
+int computeTrim(Control c) {
+    if ( auto s = cast(Scrollable)c) {
+        Rectangle rect = s.computeTrim (0, 0, 0, 0);
+        return rect.width;
+    }
+    return c.getBorderWidth () * 2;
+}
+protected override bool flushCache(Control control) {
+    Object data = control.getLayoutData();
+    if ( auto ld = cast(CLayoutData)data ) ld.flushCache();
+    return true;
+}
+protected override void layout(Composite composite, bool flushCache) {
+    CBanner banner = cast(CBanner)composite;
+    Control left = banner.left;
+    Control right = banner.right;
+    Control bottom = banner.bottom;
+
+    Point size = banner.getSize();
+    bool showCurve = left !is null && right !is null;
+    int width = size.x - 2*banner.getBorderWidth();
+    int height = size.y - 2*banner.getBorderWidth();
+
+    Point bottomSize = new Point(0, 0);
+    if (bottom !is null) {
+        int trim = computeTrim(bottom);
+        int w = Math.max(0, width - trim);
+        bottomSize = computeChildSize(bottom, w, SWT.DEFAULT, flushCache);
+        height -= bottomSize.y + CBanner.BORDER_STRIPE + 2;
+    }
+    if (showCurve) height -=  CBanner.BORDER_TOP + CBanner.BORDER_BOTTOM + 2*CBanner.BORDER_STRIPE;
+    height = Math.max(0, height);
+    Point rightSize = new Point(0,0);
+    if (right !is null) {
+        int trim = computeTrim(right);
+        int w = SWT.DEFAULT;
+        if (banner.rightWidth !is SWT.DEFAULT) {
+            w = banner.rightWidth - trim;
+            if (left !is null) {
+                w = Math.min(w, width - banner.curve_width + 2* banner.curve_indent - CBanner.MIN_LEFT - trim);
+            }
+            w = Math.max(0, w);
+        }
+        rightSize = computeChildSize(right, w, SWT.DEFAULT, flushCache);
+        width = width - (rightSize.x - banner.curve_indent + banner.curve_width - banner.curve_indent);
+    }
+    Point leftSize = new Point(0, 0);
+    if (left !is null) {
+        int trim = computeTrim(left);
+        int w = Math.max(0, width - trim);
+        leftSize = computeChildSize(left, w, SWT.DEFAULT, flushCache);
+    }
+
+    int x = 0;
+    int y = 0;
+    int oldStart = banner.curveStart;
+    Rectangle leftRect = null;
+    Rectangle rightRect = null;
+    Rectangle bottomRect = null;
+    if (bottom !is null) {
+        bottomRect = new Rectangle(x, y+size.y-bottomSize.y, bottomSize.x, bottomSize.y);
+    }
+    if (showCurve) y += CBanner.BORDER_TOP + CBanner.BORDER_STRIPE;
+    if(left !is null) {
+        leftRect = new Rectangle(x, y, leftSize.x, leftSize.y);
+        banner.curveStart = x + leftSize.x - banner.curve_indent;
+        x += leftSize.x - banner.curve_indent + banner.curve_width - banner.curve_indent;
+    }
+    if (right !is null) {
+        if (left !is null) {
+            rightSize.y = Math.max(leftSize.y, banner.rightMinHeight is SWT.DEFAULT ? rightSize.y : banner.rightMinHeight);
+        }
+        rightRect = new Rectangle(x, y, rightSize.x, rightSize.y);
+    }
+    if (banner.curveStart < oldStart) {
+        banner.redraw(banner.curveStart - CBanner.CURVE_TAIL, 0, oldStart + banner.curve_width - banner.curveStart + CBanner.CURVE_TAIL + 5, size.y, false);
+    }
+    if (banner.curveStart > oldStart) {
+        banner.redraw(oldStart - CBanner.CURVE_TAIL, 0, banner.curveStart + banner.curve_width - oldStart + CBanner.CURVE_TAIL + 5, size.y, false);
+    }
+    /*
+     * The paint events must be flushed in order to make the curve draw smoothly
+     * while the user drags the divider.
+     * On Windows, it is necessary to flush the paints before the children are
+     * resized because otherwise the children (particularly toolbars) will flash.
+     */
+    banner.update();
+    banner.curveRect = new Rectangle(banner.curveStart, 0, banner.curve_width, size.y);
+    if (bottomRect !is null) bottom.setBounds(bottomRect);
+    if (rightRect !is null) right.setBounds(rightRect);
+    if (leftRect !is null) left.setBounds(leftRect);
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/CCombo.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,1805 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.CCombo;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.accessibility.ACC;
+import org.eclipse.swt.accessibility.AccessibleAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlEvent;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.accessibility.AccessibleTextAdapter;
+import org.eclipse.swt.accessibility.AccessibleTextEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.VerifyListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Layout;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.widgets.Widget;
+
+static import tango.text.convert.Utf;
+static import tango.text.Unicode;
+static import tango.text.convert.Format;
+import java.lang.all;
+
+/**
+ * The CCombo class represents a selectable user interface object
+ * that combines a text field and a list and issues notification
+ * when an item is selected from the list.
+ * <p>
+ * CCombo was written to work around certain limitations in the native
+ * combo box. Specifically, on win32, the height of a CCombo can be set;
+ * attempts to set the height of a Combo are ignored. CCombo can be used
+ * anywhere that having the increased flexibility is more important than
+ * getting native L&F, but the decision should not be taken lightly.
+ * There is no is no strict requirement that CCombo look or behave
+ * the same as the native combo box.
+ * </p>
+ * <p>
+ * Note that although this class is a subclass of <code>Composite</code>,
+ * it does not make sense to add children to it, or set a layout on it.
+ * </p>
+ * <dl>
+ * <dt><b>Styles:</b>
+ * <dd>BORDER, READ_ONLY, FLAT</dd>
+ * <dt><b>Events:</b>
+ * <dd>DefaultSelection, Modify, Selection, Verify</dd>
+ * </dl>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#ccombo">CCombo snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: CustomControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public final class CCombo : Composite {
+
+    alias Composite.computeSize computeSize;
+
+    Text text;
+    List list;
+    int visibleItemCount = 5;
+    Shell popup;
+    Button arrow;
+    bool hasFocus;
+    Listener listener, filter;
+    Color foreground, background;
+    Font font;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a widget which will be the parent of the new instance (cannot be null)
+ * @param style the style of widget to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ *
+ * @see SWT#BORDER
+ * @see SWT#READ_ONLY
+ * @see SWT#FLAT
+ * @see Widget#getStyle()
+ */
+public this (Composite parent, int style) {
+    super (parent, style = checkStyle (style));
+
+    int textStyle = SWT.SINGLE;
+    if ((style & SWT.READ_ONLY) !is 0) textStyle |= SWT.READ_ONLY;
+    if ((style & SWT.FLAT) !is 0) textStyle |= SWT.FLAT;
+    text = new Text (this, textStyle);
+    int arrowStyle = SWT.ARROW | SWT.DOWN;
+    if ((style & SWT.FLAT) !is 0) arrowStyle |= SWT.FLAT;
+    arrow = new Button (this, arrowStyle);
+
+    listener = new class() Listener {
+        public void handleEvent (Event event) {
+            if (popup is event.widget) {
+                popupEvent (event);
+                return;
+            }
+            if (text is event.widget) {
+                textEvent (event);
+                return;
+            }
+            if (list is event.widget) {
+                listEvent (event);
+                return;
+            }
+            if (arrow is event.widget) {
+                arrowEvent (event);
+                return;
+            }
+            if (this.outer is event.widget) {
+                comboEvent (event);
+                return;
+            }
+            if (getShell () is event.widget) {
+                getDisplay().asyncExec(new class() Runnable {
+                    public void run() {
+                        if (isDisposed()) return;
+                        handleFocus (SWT.FocusOut);
+                    }
+                });
+            }
+        }
+    };
+    filter = new class() Listener {
+        public void handleEvent(Event event) {
+            Shell shell = (cast(Control)event.widget).getShell ();
+            if (shell is this.outer.getShell ()) {
+                handleFocus (SWT.FocusOut);
+            }
+        }
+    };
+
+    int [] comboEvents = [SWT.Dispose, SWT.FocusIn, SWT.Move, SWT.Resize];
+    for (int i=0; i<comboEvents.length; i++) this.addListener (comboEvents [i], listener);
+
+    int [] textEvents = [SWT.DefaultSelection, SWT.KeyDown, SWT.KeyUp, SWT.MenuDetect, SWT.Modify, SWT.MouseDown, SWT.MouseUp, SWT.MouseDoubleClick, SWT.MouseWheel, SWT.Traverse, SWT.FocusIn, SWT.Verify];
+    for (int i=0; i<textEvents.length; i++) text.addListener (textEvents [i], listener);
+
+    int [] arrowEvents = [SWT.MouseDown, SWT.MouseUp, SWT.Selection, SWT.FocusIn];
+    for (int i=0; i<arrowEvents.length; i++) arrow.addListener (arrowEvents [i], listener);
+
+    createPopup(null, -1);
+    initAccessible();
+}
+static int checkStyle (int style) {
+    int mask = SWT.BORDER | SWT.READ_ONLY | SWT.FLAT | SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
+    return SWT.NO_FOCUS | (style & mask);
+}
+/**
+ * Adds the argument to the end of the receiver's list.
+ *
+ * @param string the new item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #add(String,int)
+ */
+public void add (String string) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (string is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    list.add (string);
+}
+/**
+ * Adds the argument to the receiver's list at the given
+ * zero-relative index.
+ * <p>
+ * Note: To add an item at the end of the list, use the
+ * result of calling <code>getItemCount()</code> as the
+ * index or use <code>add(String)</code>.
+ * </p>
+ *
+ * @param string the new item
+ * @param index the index for the item
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #add(String)
+ */
+public void add (String string, int index) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (string is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    list.add (string, index);
+}
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the receiver's text is modified, by sending
+ * it one of the messages defined in the <code>ModifyListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ModifyListener
+ * @see #removeModifyListener
+ */
+public void addModifyListener (ModifyListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Modify, typedListener);
+}
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the user changes the receiver's selection, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * <code>widgetSelected</code> is called when the combo's list selection changes.
+ * <code>widgetDefaultSelected</code> is typically called when ENTER is pressed the combo's text area.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the user changes the receiver's selection
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener(SelectionListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Selection,typedListener);
+    addListener (SWT.DefaultSelection,typedListener);
+}
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the receiver's text is verified, by sending
+ * it one of the messages defined in the <code>VerifyListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see VerifyListener
+ * @see #removeVerifyListener
+ *
+ * @since 3.3
+ */
+public void addVerifyListener (VerifyListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Verify,typedListener);
+}
+void arrowEvent (Event event) {
+    switch (event.type) {
+        case SWT.FocusIn: {
+            handleFocus (SWT.FocusIn);
+            break;
+        }
+        case SWT.MouseDown: {
+            Event mouseEvent = new Event ();
+            mouseEvent.button = event.button;
+            mouseEvent.count = event.count;
+            mouseEvent.stateMask = event.stateMask;
+            mouseEvent.time = event.time;
+            mouseEvent.x = event.x; mouseEvent.y = event.y;
+            notifyListeners (SWT.MouseDown, mouseEvent);
+            event.doit = mouseEvent.doit;
+            break;
+        }
+        case SWT.MouseUp: {
+            Event mouseEvent = new Event ();
+            mouseEvent.button = event.button;
+            mouseEvent.count = event.count;
+            mouseEvent.stateMask = event.stateMask;
+            mouseEvent.time = event.time;
+            mouseEvent.x = event.x; mouseEvent.y = event.y;
+            notifyListeners (SWT.MouseUp, mouseEvent);
+            event.doit = mouseEvent.doit;
+            break;
+        }
+        case SWT.Selection: {
+            text.setFocus();
+            dropDown (!isDropped ());
+            break;
+        }
+        default:
+    }
+}
+/**
+ * Sets the selection in the receiver's text field to an empty
+ * selection starting just before the first character. If the
+ * text field is editable, this has the effect of placing the
+ * i-beam at the start of the text.
+ * <p>
+ * Note: To clear the selected items in the receiver's list,
+ * use <code>deselectAll()</code>.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #deselectAll
+ */
+public void clearSelection () {
+    checkWidget ();
+    text.clearSelection ();
+    list.deselectAll ();
+}
+void comboEvent (Event event) {
+    switch (event.type) {
+        case SWT.Dispose:
+            if (popup !is null && !popup.isDisposed ()) {
+                list.removeListener (SWT.Dispose, listener);
+                popup.dispose ();
+            }
+            Shell shell = getShell ();
+            shell.removeListener (SWT.Deactivate, listener);
+            Display display = getDisplay ();
+            display.removeFilter (SWT.FocusIn, filter);
+            popup = null;
+            text = null;
+            list = null;
+            arrow = null;
+            break;
+        case SWT.FocusIn:
+            Control focusControl = getDisplay ().getFocusControl ();
+            if (focusControl is arrow || focusControl is list) return;
+            if (isDropped()) {
+                list.setFocus();
+            } else {
+                text.setFocus();
+            }
+            break;
+        case SWT.Move:
+            dropDown (false);
+            break;
+        case SWT.Resize:
+            internalLayout (false);
+            break;
+        default:
+    }
+}
+
+public override Point computeSize (int wHint, int hHint, bool changed) {
+    checkWidget ();
+    int width = 0, height = 0;
+    String[] items = list.getItems ();
+    GC gc = new GC (text);
+    int spacer = gc.stringExtent (" ").x; //$NON-NLS-1$
+    int textWidth = gc.stringExtent (text.getText ()).x;
+    for (int i = 0; i < items.length; i++) {
+        textWidth = Math.max (gc.stringExtent (items[i]).x, textWidth);
+    }
+    gc.dispose ();
+    Point textSize = text.computeSize (SWT.DEFAULT, SWT.DEFAULT, changed);
+    Point arrowSize = arrow.computeSize (SWT.DEFAULT, SWT.DEFAULT, changed);
+    Point listSize = list.computeSize (SWT.DEFAULT, SWT.DEFAULT, changed);
+    int borderWidth = getBorderWidth ();
+
+    height = Math.max (textSize.y, arrowSize.y);
+    width = Math.max (textWidth + 2*spacer + arrowSize.x + 2*borderWidth, listSize.x);
+    if (wHint !is SWT.DEFAULT) width = wHint;
+    if (hHint !is SWT.DEFAULT) height = hHint;
+    return new Point (width + 2*borderWidth, height + 2*borderWidth);
+}
+/**
+ * Copies the selected text.
+ * <p>
+ * The current selection is copied to the clipboard.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.3
+ */
+public void copy () {
+    checkWidget ();
+    text.copy ();
+}
+void createPopup(String[] items, int selectionIndex) {
+    // create shell and list
+    popup = new Shell (getShell (), SWT.NO_TRIM | SWT.ON_TOP);
+    int style = getStyle ();
+    int listStyle = SWT.SINGLE | SWT.V_SCROLL;
+    if ((style & SWT.FLAT) !is 0) listStyle |= SWT.FLAT;
+    if ((style & SWT.RIGHT_TO_LEFT) !is 0) listStyle |= SWT.RIGHT_TO_LEFT;
+    if ((style & SWT.LEFT_TO_RIGHT) !is 0) listStyle |= SWT.LEFT_TO_RIGHT;
+    list = new List (popup, listStyle);
+    if (font !is null) list.setFont (font);
+    if (foreground !is null) list.setForeground (foreground);
+    if (background !is null) list.setBackground (background);
+
+    int [] popupEvents = [SWT.Close, SWT.Paint, SWT.Deactivate];
+    for (int i=0; i<popupEvents.length; i++) popup.addListener (popupEvents [i], listener);
+    int [] listEvents = [SWT.MouseUp, SWT.Selection, SWT.Traverse, SWT.KeyDown, SWT.KeyUp, SWT.FocusIn, SWT.Dispose];
+    for (int i=0; i<listEvents.length; i++) list.addListener (listEvents [i], listener);
+
+    if (items !is null) list.setItems (items);
+    if (selectionIndex !is -1) list.setSelection (selectionIndex);
+}
+/**
+ * Cuts the selected text.
+ * <p>
+ * The current selection is first copied to the
+ * clipboard and then deleted from the widget.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.3
+ */
+public void cut () {
+    checkWidget ();
+    text.cut ();
+}
+/**
+ * Deselects the item at the given zero-relative index in the receiver's
+ * list.  If the item at the index was already deselected, it remains
+ * deselected. Indices that are out of range are ignored.
+ *
+ * @param index the index of the item to deselect
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void deselect (int index) {
+    checkWidget ();
+    if (0 <= index && index < list.getItemCount () &&
+            index is list.getSelectionIndex() &&
+            text.getText().equals(list.getItem(index))) {
+        text.setText("");  //$NON-NLS-1$
+        list.deselect (index);
+    }
+}
+/**
+ * Deselects all selected items in the receiver's list.
+ * <p>
+ * Note: To clear the selection in the receiver's text field,
+ * use <code>clearSelection()</code>.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #clearSelection
+ */
+public void deselectAll () {
+    checkWidget ();
+    text.setText("");  //$NON-NLS-1$
+    list.deselectAll ();
+}
+void dropDown (bool drop) {
+    if (drop is isDropped ()) return;
+    if (!drop) {
+        popup.setVisible (false);
+        if (!isDisposed () && isFocusControl()) {
+            text.setFocus();
+        }
+        return;
+    }
+    if (!isVisible()) return;
+    if (getShell() !is popup.getParent ()) {
+        String[] items = list.getItems ();
+        int selectionIndex = list.getSelectionIndex ();
+        list.removeListener (SWT.Dispose, listener);
+        popup.dispose();
+        popup = null;
+        list = null;
+        createPopup (items, selectionIndex);
+    }
+
+    Point size = getSize ();
+    int itemCount = list.getItemCount ();
+    itemCount = (itemCount is 0) ? visibleItemCount : Math.min(visibleItemCount, itemCount);
+    int itemHeight = list.getItemHeight () * itemCount;
+    Point listSize = list.computeSize (SWT.DEFAULT, itemHeight, false);
+    list.setBounds (1, 1, Math.max (size.x - 2, listSize.x), listSize.y);
+
+    int index = list.getSelectionIndex ();
+    if (index !is -1) list.setTopIndex (index);
+    Display display = getDisplay ();
+    Rectangle listRect = list.getBounds ();
+    Rectangle parentRect = display.map (getParent (), null, getBounds ());
+    Point comboSize = getSize ();
+    Rectangle displayRect = getMonitor ().getClientArea ();
+    int width = Math.max (comboSize.x, listRect.width + 2);
+    int height = listRect.height + 2;
+    int x = parentRect.x;
+    int y = parentRect.y + comboSize.y;
+    if (y + height > displayRect.y + displayRect.height) y = parentRect.y - height;
+    if (x + width > displayRect.x + displayRect.width) x = displayRect.x + displayRect.width - listRect.width;
+    popup.setBounds (x, y, width, height);
+    popup.setVisible (true);
+    if (isFocusControl()) list.setFocus ();
+}
+/*
+ * Return the lowercase of the first non-'&' character following
+ * an '&' character in the given string. If there are no '&'
+ * characters in the given string, return '\0'.
+ */
+dchar _findMnemonic (String string) {
+    if (string is null) return '\0';
+    int index = 0;
+    int length = string.length;
+    do {
+        while (index < length && string[index] !is '&') index++;
+        if (++index >= length) return '\0';
+        if (string[index] !is '&') {
+            dchar[1] d; uint ate;
+            auto d2 = tango.text.convert.Utf.toString32( string[ index .. Math.min( index +4, string.length )], d, &ate );
+            auto d3 = tango.text.Unicode.toLower( d2, d2 );
+            return d3[0];
+        }
+        index++;
+    } while (index < length);
+    return '\0';
+}
+/*
+ * Return the Label immediately preceding the receiver in the z-order,
+ * or null if none.
+ */
+Label getAssociatedLabel () {
+    Control[] siblings = getParent ().getChildren ();
+    for (int i = 0; i < siblings.length; i++) {
+        if (siblings [i] is this) {
+            if (i > 0 && ( null !is cast(Label)siblings [i-1] )) {
+                return cast(Label) siblings [i-1];
+            }
+        }
+    }
+    return null;
+}
+public override Control [] getChildren () {
+    checkWidget();
+    return new Control [0];
+}
+/**
+ * Gets the editable state.
+ *
+ * @return whether or not the receiver is editable
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public bool getEditable () {
+    checkWidget ();
+    return text.getEditable();
+}
+/**
+ * Returns the item at the given, zero-relative index in the
+ * receiver's list. Throws an exception if the index is out
+ * of range.
+ *
+ * @param index the index of the item to return
+ * @return the item at the given index
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getItem (int index) {
+    checkWidget();
+    return list.getItem (index);
+}
+/**
+ * Returns the number of items contained in the receiver's list.
+ *
+ * @return the number of items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemCount () {
+    checkWidget ();
+    return list.getItemCount ();
+}
+/**
+ * Returns the height of the area which would be used to
+ * display <em>one</em> of the items in the receiver's list.
+ *
+ * @return the height of one item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemHeight () {
+    checkWidget ();
+    return list.getItemHeight ();
+}
+/**
+ * Returns an array of <code>String</code>s which are the items
+ * in the receiver's list.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the items in the receiver's list
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String [] getItems () {
+    checkWidget ();
+    return list.getItems ();
+}
+/**
+ * Returns <code>true</code> if the receiver's list is visible,
+ * and <code>false</code> otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, this method
+ * may still indicate that it is considered visible even though
+ * it may not actually be showing.
+ * </p>
+ *
+ * @return the receiver's list's visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.4
+ */
+public bool getListVisible () {
+    checkWidget ();
+    return isDropped();
+}
+public override Menu getMenu() {
+    return text.getMenu();
+}
+/**
+ * Returns a <code>Point</code> whose x coordinate is the start
+ * of the selection in the receiver's text field, and whose y
+ * coordinate is the end of the selection. The returned values
+ * are zero-relative. An "empty" selection as indicated by
+ * the the x and y coordinates having the same value.
+ *
+ * @return a point representing the selection start and end
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Point getSelection () {
+    checkWidget ();
+    return text.getSelection ();
+}
+/**
+ * Returns the zero-relative index of the item which is currently
+ * selected in the receiver's list, or -1 if no item is selected.
+ *
+ * @return the index of the selected item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSelectionIndex () {
+    checkWidget ();
+    return list.getSelectionIndex ();
+}
+public override int getStyle () {
+    int style = super.getStyle ();
+    style &= ~SWT.READ_ONLY;
+    if (!text.getEditable()) style |= SWT.READ_ONLY;
+    return style;
+}
+/**
+ * Returns a string containing a copy of the contents of the
+ * receiver's text field.
+ *
+ * @return the receiver's text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getText () {
+    checkWidget ();
+    return text.getText ();
+}
+/**
+ * Returns the height of the receivers's text field.
+ *
+ * @return the text height
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getTextHeight () {
+    checkWidget ();
+    return text.getLineHeight ();
+}
+/**
+ * Returns the maximum number of characters that the receiver's
+ * text field is capable of holding. If this has not been changed
+ * by <code>setTextLimit()</code>, it will be the constant
+ * <code>Combo.LIMIT</code>.
+ *
+ * @return the text limit
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getTextLimit () {
+    checkWidget ();
+    return text.getTextLimit ();
+}
+/**
+ * Gets the number of items that are visible in the drop
+ * down portion of the receiver's list.
+ *
+ * @return the number of items that are visible
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public int getVisibleItemCount () {
+    checkWidget ();
+    return visibleItemCount;
+}
+void handleFocus (int type) {
+    if (isDisposed ()) return;
+    switch (type) {
+        case SWT.FocusIn: {
+            if (hasFocus) return;
+            if (getEditable ()) text.selectAll ();
+            hasFocus = true;
+            Shell shell = getShell ();
+            shell.removeListener (SWT.Deactivate, listener);
+            shell.addListener (SWT.Deactivate, listener);
+            Display display = getDisplay ();
+            display.removeFilter (SWT.FocusIn, filter);
+            display.addFilter (SWT.FocusIn, filter);
+            Event e = new Event ();
+            notifyListeners (SWT.FocusIn, e);
+            break;
+        }
+        case SWT.FocusOut: {
+            if (!hasFocus) return;
+            Control focusControl = getDisplay ().getFocusControl ();
+            if (focusControl is arrow || focusControl is list || focusControl is text) return;
+            hasFocus = false;
+            Shell shell = getShell ();
+            shell.removeListener(SWT.Deactivate, listener);
+            Display display = getDisplay ();
+            display.removeFilter (SWT.FocusIn, filter);
+            Event e = new Event ();
+            notifyListeners (SWT.FocusOut, e);
+            break;
+        }
+        default:
+    }
+}
+/**
+ * Searches the receiver's list starting at the first item
+ * (index 0) until an item is found that is equal to the
+ * argument, and returns the index of that item. If no item
+ * is found, returns -1.
+ *
+ * @param string the search item
+ * @return the index of the item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int indexOf (String string) {
+    checkWidget ();
+    // SWT extension: allow null for zero length string
+    //if (string is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    return list.indexOf (string);
+}
+/**
+ * Searches the receiver's list starting at the given,
+ * zero-relative index until an item is found that is equal
+ * to the argument, and returns the index of that item. If
+ * no item is found or the starting index is out of range,
+ * returns -1.
+ *
+ * @param string the search item
+ * @param start the zero-relative index at which to begin the search
+ * @return the index of the item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int indexOf (String string, int start) {
+    checkWidget ();
+    // SWT extension: allow null for zero length string
+    //if (string is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    return list.indexOf (string, start);
+}
+
+void initAccessible() {
+    AccessibleAdapter accessibleAdapter = new class() AccessibleAdapter {
+        public void getName (AccessibleEvent e) {
+            String name = null;
+            Label label = getAssociatedLabel ();
+            if (label !is null) {
+                name = stripMnemonic (label.getText());
+            }
+            e.result = name;
+        }
+        public void getKeyboardShortcut(AccessibleEvent e) {
+            String shortcut = null;
+            Label label = getAssociatedLabel ();
+            if (label !is null) {
+                String text = label.getText ();
+                if (text !is null) {
+                    dchar mnemonic = _findMnemonic (text);
+                    if (mnemonic !is '\0') {
+                        shortcut = tango.text.convert.Format.Format( "Alt+{}", mnemonic ); //$NON-NLS-1$
+                    }
+                }
+            }
+            e.result = shortcut;
+        }
+        public void getHelp (AccessibleEvent e) {
+            e.result = getToolTipText ();
+        }
+    };
+    getAccessible ().addAccessibleListener (accessibleAdapter);
+    text.getAccessible ().addAccessibleListener (accessibleAdapter);
+    list.getAccessible ().addAccessibleListener (accessibleAdapter);
+
+    arrow.getAccessible ().addAccessibleListener (new class() AccessibleAdapter {
+        public void getName (AccessibleEvent e) {
+            e.result = isDropped () ? SWT.getMessage ("SWT_Close") : SWT.getMessage ("SWT_Open"); //$NON-NLS-1$ //$NON-NLS-2$
+        }
+        public void getKeyboardShortcut (AccessibleEvent e) {
+            e.result = "Alt+Down Arrow"; //$NON-NLS-1$
+        }
+        public void getHelp (AccessibleEvent e) {
+            e.result = getToolTipText ();
+        }
+    });
+
+    getAccessible().addAccessibleTextListener (new class() AccessibleTextAdapter {
+        public void getCaretOffset (AccessibleTextEvent e) {
+            e.offset = text.getCaretPosition ();
+        }
+        public void getSelectionRange(AccessibleTextEvent e) {
+            Point sel = text.getSelection();
+            e.offset = sel.x;
+            e.length = sel.y - sel.x;
+        }
+    });
+
+    getAccessible().addAccessibleControlListener (new class() AccessibleControlAdapter {
+        public void getChildAtPoint (AccessibleControlEvent e) {
+            Point testPoint = toControl (e.x, e.y);
+            if (getBounds ().contains (testPoint)) {
+                e.childID = ACC.CHILDID_SELF;
+            }
+        }
+
+        public void getLocation (AccessibleControlEvent e) {
+            Rectangle location = getBounds ();
+            Point pt = getParent().toDisplay (location.x, location.y);
+            e.x = pt.x;
+            e.y = pt.y;
+            e.width = location.width;
+            e.height = location.height;
+        }
+
+        public void getChildCount (AccessibleControlEvent e) {
+            e.detail = 0;
+        }
+
+        public void getRole (AccessibleControlEvent e) {
+            e.detail = ACC.ROLE_COMBOBOX;
+        }
+
+        public void getState (AccessibleControlEvent e) {
+            e.detail = ACC.STATE_NORMAL;
+        }
+
+        public void getValue (AccessibleControlEvent e) {
+            e.result = getText ();
+        }
+    });
+
+    text.getAccessible ().addAccessibleControlListener (new class() AccessibleControlAdapter {
+        public void getRole (AccessibleControlEvent e) {
+            e.detail = text.getEditable () ? ACC.ROLE_TEXT : ACC.ROLE_LABEL;
+        }
+    });
+
+    arrow.getAccessible ().addAccessibleControlListener (new class() AccessibleControlAdapter {
+        public void getDefaultAction (AccessibleControlEvent e) {
+            e.result = isDropped () ? SWT.getMessage ("SWT_Close") : SWT.getMessage ("SWT_Open"); //$NON-NLS-1$ //$NON-NLS-2$
+        }
+    });
+}
+bool isDropped () {
+    return popup.getVisible ();
+}
+public override bool isFocusControl () {
+    checkWidget();
+    if (text.isFocusControl () || arrow.isFocusControl () || list.isFocusControl () || popup.isFocusControl ()) {
+        return true;
+    }
+    return super.isFocusControl ();
+}
+void internalLayout (bool changed) {
+    if (isDropped ()) dropDown (false);
+    Rectangle rect = getClientArea ();
+    int width = rect.width;
+    int height = rect.height;
+    Point arrowSize = arrow.computeSize (SWT.DEFAULT, height, changed);
+    text.setBounds (0, 0, width - arrowSize.x, height);
+    arrow.setBounds (width - arrowSize.x, 0, arrowSize.x, arrowSize.y);
+}
+void listEvent (Event event) {
+    switch (event.type) {
+        case SWT.Dispose:
+            if (getShell () !is popup.getParent ()) {
+                String[] items = list.getItems ();
+                int selectionIndex = list.getSelectionIndex ();
+                popup = null;
+                list = null;
+                createPopup (items, selectionIndex);
+            }
+            break;
+        case SWT.FocusIn: {
+            handleFocus (SWT.FocusIn);
+            break;
+        }
+        case SWT.MouseUp: {
+            if (event.button !is 1) return;
+            dropDown (false);
+            break;
+        }
+        case SWT.Selection: {
+            int index = list.getSelectionIndex ();
+            if (index is -1) return;
+            text.setText (list.getItem (index));
+            text.selectAll ();
+            list.setSelection (index);
+            Event e = new Event ();
+            e.time = event.time;
+            e.stateMask = event.stateMask;
+            e.doit = event.doit;
+            notifyListeners (SWT.Selection, e);
+            event.doit = e.doit;
+            break;
+        }
+        case SWT.Traverse: {
+            switch (event.detail) {
+                case SWT.TRAVERSE_RETURN:
+                case SWT.TRAVERSE_ESCAPE:
+                case SWT.TRAVERSE_ARROW_PREVIOUS:
+                case SWT.TRAVERSE_ARROW_NEXT:
+                    event.doit = false;
+                    break;
+                case SWT.TRAVERSE_TAB_NEXT:
+                case SWT.TRAVERSE_TAB_PREVIOUS:
+                    event.doit = text.traverse(event.detail);
+                    event.detail = SWT.TRAVERSE_NONE;
+                    if (event.doit) dropDown(false);
+                    return;
+                default:
+            }
+            Event e = new Event ();
+            e.time = event.time;
+            e.detail = event.detail;
+            e.doit = event.doit;
+            e.character = event.character;
+            e.keyCode = event.keyCode;
+            notifyListeners (SWT.Traverse, e);
+            event.doit = e.doit;
+            event.detail = e.detail;
+            break;
+        }
+        case SWT.KeyUp: {
+            Event e = new Event ();
+            e.time = event.time;
+            e.character = event.character;
+            e.keyCode = event.keyCode;
+            e.stateMask = event.stateMask;
+            notifyListeners (SWT.KeyUp, e);
+            break;
+        }
+        case SWT.KeyDown: {
+            if (event.character is SWT.ESC) {
+                // Escape key cancels popup list
+                dropDown (false);
+            }
+            if ((event.stateMask & SWT.ALT) !is 0 && (event.keyCode is SWT.ARROW_UP || event.keyCode is SWT.ARROW_DOWN)) {
+                dropDown (false);
+            }
+            if (event.character is SWT.CR) {
+                // Enter causes default selection
+                dropDown (false);
+                Event e = new Event ();
+                e.time = event.time;
+                e.stateMask = event.stateMask;
+                notifyListeners (SWT.DefaultSelection, e);
+            }
+            // At this point the widget may have been disposed.
+            // If so, do not continue.
+            if (isDisposed ()) break;
+            Event e = new Event();
+            e.time = event.time;
+            e.character = event.character;
+            e.keyCode = event.keyCode;
+            e.stateMask = event.stateMask;
+            notifyListeners(SWT.KeyDown, e);
+            break;
+
+        }
+        default:
+    }
+}
+/**
+ * Pastes text from clipboard.
+ * <p>
+ * The selected text is deleted from the widget
+ * and new text inserted from the clipboard.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.3
+ */
+public void paste () {
+    checkWidget ();
+    text.paste ();
+}
+void popupEvent(Event event) {
+    switch (event.type) {
+        case SWT.Paint:
+            // draw black rectangle around list
+            Rectangle listRect = list.getBounds();
+            Color black = getDisplay().getSystemColor(SWT.COLOR_BLACK);
+            event.gc.setForeground(black);
+            event.gc.drawRectangle(0, 0, listRect.width + 1, listRect.height + 1);
+            break;
+        case SWT.Close:
+            event.doit = false;
+            dropDown (false);
+            break;
+        case SWT.Deactivate:
+            /*
+             * Bug in GTK. When the arrow button is pressed the popup control receives a
+             * deactivate event and then the arrow button receives a selection event. If
+             * we hide the popup in the deactivate event, the selection event will show
+             * it again. To prevent the popup from showing again, we will let the selection
+             * event of the arrow button hide the popup.
+             * In Windows, hiding the popup during the deactivate causes the deactivate
+             * to be called twice and the selection event to be disappear.
+             */
+            if (!"carbon".equals(SWT.getPlatform())) {
+                Point point = arrow.toControl(getDisplay().getCursorLocation());
+                Point size = arrow.getSize();
+                Rectangle rect = new Rectangle(0, 0, size.x, size.y);
+                if (!rect.contains(point)) dropDown (false);
+            } else {
+                dropDown(false);
+            }
+            break;
+        default:
+    }
+}
+public override void redraw () {
+    super.redraw();
+    text.redraw();
+    arrow.redraw();
+    if (popup.isVisible()) list.redraw();
+}
+public override void redraw (int x, int y, int width, int height, bool all) {
+    super.redraw(x, y, width, height, true);
+}
+
+/**
+ * Removes the item from the receiver's list at the given
+ * zero-relative index.
+ *
+ * @param index the index for the item
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void remove (int index) {
+    checkWidget();
+    list.remove (index);
+}
+/**
+ * Removes the items from the receiver's list which are
+ * between the given zero-relative start and end
+ * indices (inclusive).
+ *
+ * @param start the start of the range
+ * @param end the end of the range
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if either the start or end are not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void remove (int start, int end) {
+    checkWidget();
+    list.remove (start, end);
+}
+/**
+ * Searches the receiver's list starting at the first item
+ * until an item is found that is equal to the argument,
+ * and removes that item from the list.
+ *
+ * @param string the item to remove
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the string is not found in the list</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void remove (String string) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (string is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    list.remove (string);
+}
+/**
+ * Removes all of the items from the receiver's list and clear the
+ * contents of receiver's text field.
+ * <p>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void removeAll () {
+    checkWidget();
+    text.setText (""); //$NON-NLS-1$
+    list.removeAll ();
+}
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the receiver's text is modified.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ModifyListener
+ * @see #addModifyListener
+ */
+public void removeModifyListener (ModifyListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    removeListener(SWT.Modify, listener);
+}
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the user changes the receiver's selection.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener (SelectionListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    removeListener(SWT.Selection, listener);
+    removeListener(SWT.DefaultSelection,listener);
+}
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is verified.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see VerifyListener
+ * @see #addVerifyListener
+ *
+ * @since 3.3
+ */
+public void removeVerifyListener (VerifyListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    removeListener(SWT.Verify, listener);
+}
+/**
+ * Selects the item at the given zero-relative index in the receiver's
+ * list.  If the item at the index was already selected, it remains
+ * selected. Indices that are out of range are ignored.
+ *
+ * @param index the index of the item to select
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void select (int index) {
+    checkWidget();
+    if (index is -1) {
+        list.deselectAll ();
+        text.setText (""); //$NON-NLS-1$
+        return;
+    }
+    if (0 <= index && index < list.getItemCount()) {
+        if (index !is getSelectionIndex()) {
+            text.setText (list.getItem (index));
+            text.selectAll ();
+            list.select (index);
+            list.showSelection ();
+        }
+    }
+}
+public override void setBackground (Color color) {
+    super.setBackground(color);
+    background = color;
+    if (text !is null) text.setBackground(color);
+    if (list !is null) list.setBackground(color);
+    if (arrow !is null) arrow.setBackground(color);
+}
+/**
+ * Sets the editable state.
+ *
+ * @param editable the new editable state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setEditable (bool editable) {
+    checkWidget ();
+    text.setEditable(editable);
+}
+public override void setEnabled (bool enabled) {
+    super.setEnabled(enabled);
+    if (popup !is null) popup.setVisible (false);
+    if (text !is null) text.setEnabled(enabled);
+    if (arrow !is null) arrow.setEnabled(enabled);
+}
+public override bool setFocus () {
+    checkWidget();
+    if (!isEnabled () || !isVisible ()) return false;
+    if (isFocusControl ()) return true;
+    return text.setFocus ();
+}
+public override void setFont (Font font) {
+    super.setFont (font);
+    this.font = font;
+    text.setFont (font);
+    list.setFont (font);
+    internalLayout (true);
+}
+public override void setForeground (Color color) {
+    super.setForeground(color);
+    foreground = color;
+    if (text !is null) text.setForeground(color);
+    if (list !is null) list.setForeground(color);
+    if (arrow !is null) arrow.setForeground(color);
+}
+/**
+ * Sets the text of the item in the receiver's list at the given
+ * zero-relative index to the string argument. This is equivalent
+ * to <code>remove</code>'ing the old item at the index, and then
+ * <code>add</code>'ing the new item at that index.
+ *
+ * @param index the index for the item
+ * @param string the new text for the item
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setItem (int index, String string) {
+    checkWidget();
+    list.setItem (index, string);
+}
+/**
+ * Sets the receiver's list to be the given array of items.
+ *
+ * @param items the array of items
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if an item in the items array is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setItems (String [] items) {
+    checkWidget ();
+    list.setItems (items);
+    if (!text.getEditable ()) text.setText (""); //$NON-NLS-1$
+}
+/**
+ * Sets the layout which is associated with the receiver to be
+ * the argument which may be null.
+ * <p>
+ * Note: No Layout can be set on this Control because it already
+ * manages the size and position of its children.
+ * </p>
+ *
+ * @param layout the receiver's new layout or null
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public override void setLayout (Layout layout) {
+    checkWidget ();
+    return;
+}
+/**
+ * Marks the receiver's list as visible if the argument is <code>true</code>,
+ * and marks it invisible otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, marking
+ * it visible may not actually cause it to be displayed.
+ * </p>
+ *
+ * @param visible the new visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.4
+ */
+public void setListVisible (bool visible) {
+    checkWidget ();
+    dropDown(visible);
+}
+public override void setMenu(Menu menu) {
+    text.setMenu(menu);
+}
+/**
+ * Sets the selection in the receiver's text field to the
+ * range specified by the argument whose x coordinate is the
+ * start of the selection and whose y coordinate is the end
+ * of the selection.
+ *
+ * @param selection a point representing the new selection start and end
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (Point selection) {
+    checkWidget();
+    if (selection is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    text.setSelection (selection.x, selection.y);
+}
+
+/**
+ * Sets the contents of the receiver's text field to the
+ * given string.
+ * <p>
+ * Note: The text field in a <code>Combo</code> is typically
+ * only capable of displaying a single line of text. Thus,
+ * setting the text to a string containing line breaks or
+ * other special characters will probably cause it to
+ * display incorrectly.
+ * </p>
+ *
+ * @param string the new text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setText (String string) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (string is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    int index = list.indexOf (string);
+    if (index is -1) {
+        list.deselectAll ();
+        text.setText (string);
+        return;
+    }
+    text.setText (string);
+    text.selectAll ();
+    list.setSelection (index);
+    list.showSelection ();
+}
+/**
+ * Sets the maximum number of characters that the receiver's
+ * text field is capable of holding to be the argument.
+ *
+ * @param limit new text limit
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_CANNOT_BE_ZERO - if the limit is zero</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setTextLimit (int limit) {
+    checkWidget();
+    text.setTextLimit (limit);
+}
+
+public override void setToolTipText (String string) {
+    checkWidget();
+    super.setToolTipText(string);
+    arrow.setToolTipText (string);
+    text.setToolTipText (string);
+}
+
+public override void setVisible (bool visible) {
+    super.setVisible(visible);
+    /*
+     * At this point the widget may have been disposed in a FocusOut event.
+     * If so then do not continue.
+     */
+    if (isDisposed ()) return;
+    // TEMPORARY CODE
+    if (popup is null || popup.isDisposed ()) return;
+    if (!visible) popup.setVisible (false);
+}
+/**
+ * Sets the number of items that are visible in the drop
+ * down portion of the receiver's list.
+ *
+ * @param count the new number of items to be visible
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setVisibleItemCount (int count) {
+    checkWidget ();
+    if (count < 0) return;
+    visibleItemCount = count;
+}
+String stripMnemonic (String string) {
+    int index = 0;
+    int length_ = string.length;
+    do {
+        while ((index < length_) && (string[index] !is '&')) index++;
+        if (++index >= length_) return string;
+        if (string[index] !is '&') {
+            return string[0 .. index-1] ~ string[index .. length_];
+        }
+        index++;
+    } while (index < length_);
+    return string;
+}
+void textEvent (Event event) {
+    switch (event.type) {
+        case SWT.FocusIn: {
+            handleFocus (SWT.FocusIn);
+            break;
+        }
+        case SWT.DefaultSelection: {
+            dropDown (false);
+            Event e = new Event ();
+            e.time = event.time;
+            e.stateMask = event.stateMask;
+            notifyListeners (SWT.DefaultSelection, e);
+            break;
+        }
+        case SWT.KeyDown: {
+            Event keyEvent = new Event ();
+            keyEvent.time = event.time;
+            keyEvent.character = event.character;
+            keyEvent.keyCode = event.keyCode;
+            keyEvent.stateMask = event.stateMask;
+            notifyListeners (SWT.KeyDown, keyEvent);
+            if (isDisposed ()) break;
+            event.doit = keyEvent.doit;
+            if (!event.doit) break;
+            if (event.keyCode is SWT.ARROW_UP || event.keyCode is SWT.ARROW_DOWN) {
+                event.doit = false;
+                if ((event.stateMask & SWT.ALT) !is 0) {
+                    bool dropped = isDropped ();
+                    text.selectAll ();
+                    if (!dropped) setFocus ();
+                    dropDown (!dropped);
+                    break;
+                }
+
+                int oldIndex = getSelectionIndex ();
+                if (event.keyCode is SWT.ARROW_UP) {
+                    select (Math.max (oldIndex - 1, 0));
+                } else {
+                    select (Math.min (oldIndex + 1, getItemCount () - 1));
+                }
+                if (oldIndex !is getSelectionIndex ()) {
+                    Event e = new Event();
+                    e.time = event.time;
+                    e.stateMask = event.stateMask;
+                    notifyListeners (SWT.Selection, e);
+                }
+                if (isDisposed ()) break;
+            }
+
+            // Further work : Need to add support for incremental search in
+            // pop up list as characters typed in text widget
+            break;
+        }
+        case SWT.KeyUp: {
+            Event e = new Event ();
+            e.time = event.time;
+            e.character = event.character;
+            e.keyCode = event.keyCode;
+            e.stateMask = event.stateMask;
+            notifyListeners (SWT.KeyUp, e);
+            event.doit = e.doit;
+            break;
+        }
+        case SWT.MenuDetect: {
+            Event e = new Event ();
+            e.time = event.time;
+            notifyListeners (SWT.MenuDetect, e);
+            break;
+        }
+        case SWT.Modify: {
+            list.deselectAll ();
+            Event e = new Event ();
+            e.time = event.time;
+            notifyListeners (SWT.Modify, e);
+            break;
+        }
+        case SWT.MouseDown: {
+            Event mouseEvent = new Event ();
+            mouseEvent.button = event.button;
+            mouseEvent.count = event.count;
+            mouseEvent.stateMask = event.stateMask;
+            mouseEvent.time = event.time;
+            mouseEvent.x = event.x; mouseEvent.y = event.y;
+            notifyListeners (SWT.MouseDown, mouseEvent);
+            if (isDisposed ()) break;
+            event.doit = mouseEvent.doit;
+            if (!event.doit) break;
+            if (event.button !is 1) return;
+            if (text.getEditable ()) return;
+            bool dropped = isDropped ();
+            text.selectAll ();
+            if (!dropped) setFocus ();
+            dropDown (!dropped);
+            break;
+        }
+        case SWT.MouseUp: {
+            Event mouseEvent = new Event ();
+            mouseEvent.button = event.button;
+            mouseEvent.count = event.count;
+            mouseEvent.stateMask = event.stateMask;
+            mouseEvent.time = event.time;
+            mouseEvent.x = event.x; mouseEvent.y = event.y;
+            notifyListeners (SWT.MouseUp, mouseEvent);
+            if (isDisposed ()) break;
+            event.doit = mouseEvent.doit;
+            if (!event.doit) break;
+            if (event.button !is 1) return;
+            if (text.getEditable ()) return;
+            text.selectAll ();
+            break;
+        }
+        case SWT.MouseDoubleClick: {
+            Event mouseEvent = new Event ();
+            mouseEvent.button = event.button;
+            mouseEvent.count = event.count;
+            mouseEvent.stateMask = event.stateMask;
+            mouseEvent.time = event.time;
+            mouseEvent.x = event.x; mouseEvent.y = event.y;
+            notifyListeners (SWT.MouseDoubleClick, mouseEvent);
+            break;
+        }
+        case SWT.MouseWheel: {
+            Event keyEvent = new Event ();
+            keyEvent.time = event.time;
+            keyEvent.keyCode = event.count > 0 ? SWT.ARROW_UP : SWT.ARROW_DOWN;
+            keyEvent.stateMask = event.stateMask;
+            notifyListeners (SWT.KeyDown, keyEvent);
+            if (isDisposed ()) break;
+            event.doit = keyEvent.doit;
+            if (!event.doit) break;
+            if (event.count !is 0) {
+                event.doit = false;
+                int oldIndex = getSelectionIndex ();
+                if (event.count > 0) {
+                    select (Math.max (oldIndex - 1, 0));
+                } else {
+                    select (Math.min (oldIndex + 1, getItemCount () - 1));
+                }
+                if (oldIndex !is getSelectionIndex ()) {
+                    Event e = new Event();
+                    e.time = event.time;
+                    e.stateMask = event.stateMask;
+                    notifyListeners (SWT.Selection, e);
+                }
+                if (isDisposed ()) break;
+            }
+            break;
+        }
+        case SWT.Traverse: {
+            switch (event.detail) {
+                case SWT.TRAVERSE_ARROW_PREVIOUS:
+                case SWT.TRAVERSE_ARROW_NEXT:
+                    // The enter causes default selection and
+                    // the arrow keys are used to manipulate the list contents so
+                    // do not use them for traversal.
+                    event.doit = false;
+                    break;
+                case SWT.TRAVERSE_TAB_PREVIOUS:
+                    event.doit = traverse(SWT.TRAVERSE_TAB_PREVIOUS);
+                    event.detail = SWT.TRAVERSE_NONE;
+                    return;
+                default:
+            }
+            Event e = new Event ();
+            e.time = event.time;
+            e.detail = event.detail;
+            e.doit = event.doit;
+            e.character = event.character;
+            e.keyCode = event.keyCode;
+            notifyListeners (SWT.Traverse, e);
+            event.doit = e.doit;
+            event.detail = e.detail;
+            break;
+        }
+        case SWT.Verify: {
+            Event e = new Event ();
+            e.text = event.text;
+            e.start = event.start;
+            e.end = event.end;
+            e.character = event.character;
+            e.keyCode = event.keyCode;
+            e.stateMask = event.stateMask;
+            notifyListeners (SWT.Verify, e);
+            event.doit = e.doit;
+            break;
+        }
+        default:
+    }
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/CLabel.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,849 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.CLabel;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.accessibility.ACC;
+import org.eclipse.swt.accessibility.Accessible;
+import org.eclipse.swt.accessibility.AccessibleAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlEvent;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.TraverseEvent;
+import org.eclipse.swt.events.TraverseListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.TextLayout;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import java.lang.all;
+
+static import tango.text.Unicode;
+static import tango.text.convert.Utf;
+
+/**
+ * A Label which supports aligned text and/or an image and different border styles.
+ * <p>
+ * If there is not enough space a CLabel uses the following strategy to fit the
+ * information into the available space:
+ * <pre>
+ *      ignores the indent in left align mode
+ *      ignores the image and the gap
+ *      shortens the text by replacing the center portion of the label with an ellipsis
+ *      shortens the text by removing the center portion of the label
+ * </pre>
+ * <p>
+ * <dl>
+ * <dt><b>Styles:</b>
+ * <dd>LEFT, RIGHT, CENTER, SHADOW_IN, SHADOW_OUT, SHADOW_NONE</dd>
+ * <dt><b>Events:</b>
+ * <dd></dd>
+ * </dl>
+ *
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: CustomControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class CLabel : Canvas {
+
+    alias Canvas.computeSize computeSize;
+
+    /** Gap between icon and text */
+    private static const int GAP = 5;
+    /** Left and right margins */
+    private static const int INDENT = 3;
+    /** a string inserted in the middle of text that has been shortened */
+    private static const String ELLIPSIS = "..."; //$NON-NLS-1$ // could use the ellipsis glyph on some platforms "\u2026"
+    /** the alignment. Either CENTER, RIGHT, LEFT. Default is LEFT*/
+    private int align_ = SWT.LEFT;
+    private int hIndent = INDENT;
+    private int vIndent = INDENT;
+    /** the current text */
+    private String text;
+    /** the current icon */
+    private Image image;
+    // The tooltip is used for two purposes - the application can set
+    // a tooltip or the tooltip can be used to display the full text when the
+    // the text has been truncated due to the label being too short.
+    // The appToolTip stores the tooltip set by the application.  Control.tooltiptext
+    // contains whatever tooltip is currently being displayed.
+    private String appToolTipText;
+
+    private Image backgroundImage;
+    private Color[] gradientColors;
+    private int[] gradientPercents;
+    private bool gradientVertical;
+    private Color background;
+
+    private static int DRAW_FLAGS = SWT.DRAW_MNEMONIC | SWT.DRAW_TAB | SWT.DRAW_TRANSPARENT | SWT.DRAW_DELIMITER;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a widget which will be the parent of the new instance (cannot be null)
+ * @param style the style of widget to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ *
+ * @see SWT#LEFT
+ * @see SWT#RIGHT
+ * @see SWT#CENTER
+ * @see SWT#SHADOW_IN
+ * @see SWT#SHADOW_OUT
+ * @see SWT#SHADOW_NONE
+ * @see #getStyle()
+ */
+public this(Composite parent, int style) {
+    super(parent, checkStyle(style));
+    if ((style & (SWT.CENTER | SWT.RIGHT)) is 0) style |= SWT.LEFT;
+    if ((style & SWT.CENTER) !is 0) align_ = SWT.CENTER;
+    if ((style & SWT.RIGHT) !is 0)  align_ = SWT.RIGHT;
+    if ((style & SWT.LEFT) !is 0)   align_ = SWT.LEFT;
+
+    addPaintListener(new class() PaintListener{
+        public void paintControl(PaintEvent event) {
+            onPaint(event);
+        }
+    });
+
+    addDisposeListener(new class() DisposeListener{
+        public void widgetDisposed(DisposeEvent event) {
+            onDispose(event);
+        }
+    });
+
+    addTraverseListener(new class() TraverseListener {
+        public void keyTraversed(TraverseEvent event) {
+            if (event.detail is SWT.TRAVERSE_MNEMONIC) {
+                onMnemonic(event);
+            }
+        }
+    });
+
+    initAccessible();
+
+}
+/**
+ * Check the style bits to ensure that no invalid styles are applied.
+ */
+private static int checkStyle (int style) {
+    if ((style & SWT.BORDER) !is 0) style |= SWT.SHADOW_IN;
+    int mask = SWT.SHADOW_IN | SWT.SHADOW_OUT | SWT.SHADOW_NONE | SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
+    style = style & mask;
+    return style |= SWT.NO_FOCUS | SWT.DOUBLE_BUFFERED;
+}
+
+//protected void checkSubclass () {
+//  String name = getClass().getName ();
+//  String validName = CLabel.class.getName();
+//  if (!validName.equals(name)) {
+//      SWT.error (SWT.ERROR_INVALID_SUBCLASS);
+//  }
+//}
+
+public override Point computeSize(int wHint, int hHint, bool changed) {
+    checkWidget();
+    Point e = getTotalSize(image, text);
+    if (wHint is SWT.DEFAULT){
+        e.x += 2*hIndent;
+    } else {
+        e.x = wHint;
+    }
+    if (hHint is SWT.DEFAULT) {
+        e.y += 2*vIndent;
+    } else {
+        e.y = hHint;
+    }
+    return e;
+}
+/**
+ * Draw a rectangle in the given colors.
+ */
+private void drawBevelRect(GC gc, int x, int y, int w, int h, Color topleft, Color bottomright) {
+    gc.setForeground(bottomright);
+    gc.drawLine(x+w, y,   x+w, y+h);
+    gc.drawLine(x,   y+h, x+w, y+h);
+
+    gc.setForeground(topleft);
+    gc.drawLine(x, y, x+w-1, y);
+    gc.drawLine(x, y, x,     y+h-1);
+}
+/*
+ * Return the lowercase of the first non-'&' character following
+ * an '&' character in the given string. If there are no '&'
+ * characters in the given string, return '\0'.
+ */
+dchar _findMnemonic (String string) {
+    if (string is null) return '\0';
+    int index = 0;
+    int length = string.length;
+    do {
+        while (index < length && string[index] !is '&') index++;
+        if (++index >= length) return '\0';
+        if (string[index] !is '&') {
+            dchar[1] tmp; uint ate;
+            dchar[] tmp2 = tango.text.convert.Utf.toString32( string[index .. Math.min( index + 4, string.length ) ], tmp, &ate );
+            assert( tmp2.length == 1 );
+            return tango.text.Unicode.toLower( tmp2 )[0];
+        }
+        index++;
+    } while (index < length);
+    return '\0';
+}
+/**
+ * Returns the alignment.
+ * The alignment style (LEFT, CENTER or RIGHT) is returned.
+ *
+ * @return SWT.LEFT, SWT.RIGHT or SWT.CENTER
+ */
+public int getAlignment() {
+    //checkWidget();
+    return align_;
+}
+/**
+ * Return the CLabel's image or <code>null</code>.
+ *
+ * @return the image of the label or null
+ */
+public Image getImage() {
+    //checkWidget();
+    return image;
+}
+/**
+ * Compute the minimum size.
+ */
+private Point getTotalSize(Image image, String text) {
+    Point size = new Point(0, 0);
+
+    if (image !is null) {
+        Rectangle r = image.getBounds();
+        size.x += r.width;
+        size.y += r.height;
+    }
+
+    GC gc = new GC(this);
+    if (text !is null && text.length > 0) {
+        Point e = gc.textExtent(text, DRAW_FLAGS);
+        size.x += e.x;
+        size.y = Math.max(size.y, e.y);
+        if (image !is null) size.x += GAP;
+    } else {
+        size.y = Math.max(size.y, gc.getFontMetrics().getHeight());
+    }
+    gc.dispose();
+
+    return size;
+}
+public override int getStyle () {
+    int style = super.getStyle();
+    switch (align_) {
+        case SWT.RIGHT: style |= SWT.RIGHT; break;
+        case SWT.CENTER: style |= SWT.CENTER; break;
+        case SWT.LEFT: style |= SWT.LEFT; break;
+        default:
+    }
+    return style;
+}
+
+/**
+ * Return the Label's text.
+ *
+ * @return the text of the label or null
+ */
+public String getText() {
+    //checkWidget();
+    return text;
+}
+public override String getToolTipText () {
+    checkWidget();
+    return appToolTipText;
+}
+private void initAccessible() {
+    Accessible accessible = getAccessible();
+    accessible.addAccessibleListener(new class() AccessibleAdapter {
+        public void getName(AccessibleEvent e) {
+            e.result = getText();
+        }
+
+        public void getHelp(AccessibleEvent e) {
+            e.result = getToolTipText();
+        }
+
+        public void getKeyboardShortcut(AccessibleEvent e) {
+            dchar mnemonic = _findMnemonic(this.outer.text);
+            if (mnemonic !is '\0') {
+                dchar[1] d;
+                d[0] = mnemonic;
+                e.result = "Alt+" ~ tango.text.convert.Utf.toString(d); //$NON-NLS-1$
+            }
+        }
+    });
+
+    accessible.addAccessibleControlListener(new class() AccessibleControlAdapter {
+        public void getChildAtPoint(AccessibleControlEvent e) {
+            e.childID = ACC.CHILDID_SELF;
+        }
+
+        public void getLocation(AccessibleControlEvent e) {
+            Rectangle rect = getDisplay().map(getParent(), null, getBounds());
+            e.x = rect.x;
+            e.y = rect.y;
+            e.width = rect.width;
+            e.height = rect.height;
+        }
+
+        public void getChildCount(AccessibleControlEvent e) {
+            e.detail = 0;
+        }
+
+        public void getRole(AccessibleControlEvent e) {
+            e.detail = ACC.ROLE_LABEL;
+        }
+
+        public void getState(AccessibleControlEvent e) {
+            e.detail = ACC.STATE_READONLY;
+        }
+    });
+}
+void onDispose(DisposeEvent event) {
+    gradientColors = null;
+    gradientPercents = null;
+    backgroundImage = null;
+    text = null;
+    image = null;
+    appToolTipText = null;
+}
+void onMnemonic(TraverseEvent event) {
+    dchar mnemonic = _findMnemonic(text);
+    if (mnemonic is '\0') return;
+    dchar[1] d; uint ate;
+    auto r = tango.text.convert.Utf.toString32( [event.character][], d, &ate );
+    if (tango.text.Unicode.toLower(r)[0] !is mnemonic) return;
+    Composite control = this.getParent();
+    while (control !is null) {
+        Control [] children = control.getChildren();
+        int index = 0;
+        while (index < children.length) {
+            if (children [index] is this) break;
+            index++;
+        }
+        index++;
+        if (index < children.length) {
+            if (children [index].setFocus ()) {
+                event.doit = true;
+                event.detail = SWT.TRAVERSE_NONE;
+            }
+        }
+        control = control.getParent();
+    }
+}
+
+void onPaint(PaintEvent event) {
+    Rectangle rect = getClientArea();
+    if (rect.width is 0 || rect.height is 0) return;
+
+    bool shortenText_ = false;
+    String t = text;
+    Image img = image;
+    int availableWidth = Math.max(0, rect.width - 2*hIndent);
+    Point extent = getTotalSize(img, t);
+    if (extent.x > availableWidth) {
+        img = null;
+        extent = getTotalSize(img, t);
+        if (extent.x > availableWidth) {
+            shortenText_ = true;
+        }
+    }
+
+    GC gc = event.gc;
+    String[] lines = text is null ? null : splitString(text);
+
+    // shorten the text
+    if (shortenText_) {
+        extent.x = 0;
+        for(int i = 0; i < lines.length; i++) {
+            Point e = gc.textExtent(lines[i], DRAW_FLAGS);
+            if (e.x > availableWidth) {
+                lines[i] = shortenText(gc, lines[i], availableWidth);
+                extent.x = Math.max(extent.x, getTotalSize(null, lines[i]).x);
+            } else {
+                extent.x = Math.max(extent.x, e.x);
+            }
+        }
+        if (appToolTipText is null) {
+            super.setToolTipText(text);
+        }
+    } else {
+        super.setToolTipText(appToolTipText);
+    }
+
+    // determine horizontal position
+    int x = rect.x + hIndent;
+    if (align_ is SWT.CENTER) {
+        x = (rect.width - extent.x)/2;
+    }
+    if (align_ is SWT.RIGHT) {
+        x = rect.width - hIndent - extent.x;
+    }
+
+    // draw a background image behind the text
+    try {
+        if (backgroundImage !is null) {
+            // draw a background image behind the text
+            Rectangle imageRect = backgroundImage.getBounds();
+            // tile image to fill space
+            gc.setBackground(getBackground());
+            gc.fillRectangle(rect);
+            int xPos = 0;
+            while (xPos < rect.width) {
+                int yPos = 0;
+                while (yPos < rect.height) {
+                    gc.drawImage(backgroundImage, xPos, yPos);
+                    yPos += imageRect.height;
+                }
+                xPos += imageRect.width;
+            }
+        } else if (gradientColors !is null) {
+            // draw a gradient behind the text
+            final Color oldBackground = gc.getBackground();
+            if (gradientColors.length is 1) {
+                if (gradientColors[0] !is null) gc.setBackground(gradientColors[0]);
+                gc.fillRectangle(0, 0, rect.width, rect.height);
+            } else {
+                final Color oldForeground = gc.getForeground();
+                Color lastColor = gradientColors[0];
+                if (lastColor is null) lastColor = oldBackground;
+                int pos = 0;
+                for (int i = 0; i < gradientPercents.length; ++i) {
+                    gc.setForeground(lastColor);
+                    lastColor = gradientColors[i + 1];
+                    if (lastColor is null) lastColor = oldBackground;
+                    gc.setBackground(lastColor);
+                    if (gradientVertical) {
+                        final int gradientHeight = (gradientPercents[i] * rect.height / 100) - pos;
+                        gc.fillGradientRectangle(0, pos, rect.width, gradientHeight, true);
+                        pos += gradientHeight;
+                    } else {
+                        final int gradientWidth = (gradientPercents[i] * rect.width / 100) - pos;
+                        gc.fillGradientRectangle(pos, 0, gradientWidth, rect.height, false);
+                        pos += gradientWidth;
+                    }
+                }
+                if (gradientVertical && pos < rect.height) {
+                    gc.setBackground(getBackground());
+                    gc.fillRectangle(0, pos, rect.width, rect.height - pos);
+                }
+                if (!gradientVertical && pos < rect.width) {
+                    gc.setBackground(getBackground());
+                    gc.fillRectangle(pos, 0, rect.width - pos, rect.height);
+                }
+                gc.setForeground(oldForeground);
+            }
+            gc.setBackground(oldBackground);
+        } else {
+            if (background !is null || (getStyle() & SWT.DOUBLE_BUFFERED) is 0) {
+                gc.setBackground(getBackground());
+                gc.fillRectangle(rect);
+            }
+        }
+    } catch (SWTException e) {
+        if ((getStyle() & SWT.DOUBLE_BUFFERED) is 0) {
+            gc.setBackground(getBackground());
+            gc.fillRectangle(rect);
+        }
+    }
+
+    // draw border
+    int style = getStyle();
+    if ((style & SWT.SHADOW_IN) !is 0 || (style & SWT.SHADOW_OUT) !is 0) {
+        paintBorder(gc, rect);
+    }
+
+    // draw the image
+    if (img !is null) {
+        Rectangle imageRect = img.getBounds();
+        gc.drawImage(img, 0, 0, imageRect.width, imageRect.height,
+                        x, (rect.height-imageRect.height)/2, imageRect.width, imageRect.height);
+        x +=  imageRect.width + GAP;
+        extent.x -= imageRect.width + GAP;
+    }
+    // draw the text
+    if (lines !is null) {
+        int lineHeight = gc.getFontMetrics().getHeight();
+        int textHeight = lines.length * lineHeight;
+        int lineY = Math.max(vIndent, rect.y + (rect.height - textHeight) / 2);
+        gc.setForeground(getForeground());
+        for (int i = 0; i < lines.length; i++) {
+            int lineX = x;
+            if (lines.length > 1) {
+                if (align_ is SWT.CENTER) {
+                    int lineWidth = gc.textExtent(lines[i], DRAW_FLAGS).x;
+                    lineX = x + Math.max(0, (extent.x - lineWidth) / 2);
+                }
+                if (align_ is SWT.RIGHT) {
+                    int lineWidth = gc.textExtent(lines[i], DRAW_FLAGS).x;
+                    lineX = Math.max(x, rect.x + rect.width - hIndent - lineWidth);
+                }
+            }
+            gc.drawText(lines[i], lineX, lineY, DRAW_FLAGS);
+            lineY += lineHeight;
+        }
+    }
+}
+/**
+ * Paint the Label's border.
+ */
+private void paintBorder(GC gc, Rectangle r) {
+    Display disp= getDisplay();
+
+    Color c1 = null;
+    Color c2 = null;
+
+    int style = getStyle();
+    if ((style & SWT.SHADOW_IN) !is 0) {
+        c1 = disp.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW);
+        c2 = disp.getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW);
+    }
+    if ((style & SWT.SHADOW_OUT) !is 0) {
+        c1 = disp.getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW);
+        c2 = disp.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW);
+    }
+
+    if (c1 !is null && c2 !is null) {
+        gc.setLineWidth(1);
+        drawBevelRect(gc, r.x, r.y, r.width-1, r.height-1, c1, c2);
+    }
+}
+/**
+ * Set the alignment of the CLabel.
+ * Use the values LEFT, CENTER and RIGHT to align image and text within the available space.
+ *
+ * @param align the alignment style of LEFT, RIGHT or CENTER
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the value of align is not one of SWT.LEFT, SWT.RIGHT or SWT.CENTER</li>
+ * </ul>
+ */
+public void setAlignment(int align_) {
+    checkWidget();
+    if (align_ !is SWT.LEFT && align_ !is SWT.RIGHT && align_ !is SWT.CENTER) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (this.align_ !is align_) {
+        this.align_ = align_;
+        redraw();
+    }
+}
+
+public override void setBackground (Color color) {
+    super.setBackground (color);
+    // Are these settings the same as before?
+    if (backgroundImage is null &&
+        gradientColors is null &&
+        gradientPercents is null) {
+        if (color is null) {
+            if (background is null) return;
+        } else {
+            if (color ==/*eq*/ background) return;
+        }
+    }
+    background = color;
+    backgroundImage = null;
+    gradientColors = null;
+    gradientPercents = null;
+    redraw ();
+}
+
+/**
+ * Specify a gradient of colours to be drawn in the background of the CLabel.
+ * <p>For example, to draw a gradient that varies from dark blue to blue and then to
+ * white and stays white for the right half of the label, use the following call
+ * to setBackground:</p>
+ * <pre>
+ *  clabel.setBackground(new Color[]{display.getSystemColor(SWT.COLOR_DARK_BLUE),
+ *                                 display.getSystemColor(SWT.COLOR_BLUE),
+ *                                 display.getSystemColor(SWT.COLOR_WHITE),
+ *                                 display.getSystemColor(SWT.COLOR_WHITE)},
+ *                     new int[] {25, 50, 100});
+ * </pre>
+ *
+ * @param colors an array of Color that specifies the colors to appear in the gradient
+ *               in order of appearance from left to right;  The value <code>null</code>
+ *               clears the background gradient; the value <code>null</code> can be used
+ *               inside the array of Color to specify the background color.
+ * @param percents an array of integers between 0 and 100 specifying the percent of the width
+ *                 of the widget at which the color should change; the size of the percents
+ *                 array must be one less than the size of the colors array.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the values of colors and percents are not consistent</li>
+ * </ul>
+ */
+public void setBackground(Color[] colors, int[] percents) {
+    setBackground(colors, percents, false);
+}
+/**
+ * Specify a gradient of colours to be drawn in the background of the CLabel.
+ * <p>For example, to draw a gradient that varies from dark blue to white in the vertical,
+ * direction use the following call
+ * to setBackground:</p>
+ * <pre>
+ *  clabel.setBackground(new Color[]{display.getSystemColor(SWT.COLOR_DARK_BLUE),
+ *                                 display.getSystemColor(SWT.COLOR_WHITE)},
+ *                       new int[] {100}, true);
+ * </pre>
+ *
+ * @param colors an array of Color that specifies the colors to appear in the gradient
+ *               in order of appearance from left/top to right/bottom;  The value <code>null</code>
+ *               clears the background gradient; the value <code>null</code> can be used
+ *               inside the array of Color to specify the background color.
+ * @param percents an array of integers between 0 and 100 specifying the percent of the width/height
+ *                 of the widget at which the color should change; the size of the percents
+ *                 array must be one less than the size of the colors array.
+ * @param vertical indicate the direction of the gradient.  True is vertical and false is horizontal.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the values of colors and percents are not consistent</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setBackground(Color[] colors, int[] percents, bool vertical) {
+    checkWidget();
+    if (colors !is null) {
+        if (percents is null || percents.length !is colors.length - 1) {
+            SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+        }
+        if (getDisplay().getDepth() < 15) {
+            // Don't use gradients on low color displays
+            colors = [colors[colors.length - 1]];
+            percents = null;
+        }
+        for (int i = 0; i < percents.length; i++) {
+            if (percents[i] < 0 || percents[i] > 100) {
+                SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+            }
+            if (i > 0 && percents[i] < percents[i-1]) {
+                SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+            }
+        }
+    }
+
+    // Are these settings the same as before?
+    final Color background = getBackground();
+    if (backgroundImage is null) {
+        if ((gradientColors !is null) && (colors !is null) &&
+            (gradientColors.length is colors.length)) {
+            bool same = false;
+            for (int i = 0; i < gradientColors.length; i++) {
+                same = (gradientColors[i] is colors[i]) ||
+                    ((gradientColors[i] is null) && (colors[i] is background)) ||
+                    ((gradientColors[i] is background) && (colors[i] is null));
+                if (!same) break;
+            }
+            if (same) {
+                for (int i = 0; i < gradientPercents.length; i++) {
+                    same = gradientPercents[i] is percents[i];
+                    if (!same) break;
+                }
+            }
+            if (same && this.gradientVertical is vertical) return;
+        }
+    } else {
+        backgroundImage = null;
+    }
+    // Store the new settings
+    if (colors is null) {
+        gradientColors = null;
+        gradientPercents = null;
+        gradientVertical = false;
+    } else {
+        gradientColors = new Color[colors.length];
+        for (int i = 0; i < colors.length; ++i)
+            gradientColors[i] = (colors[i] !is null) ? colors[i] : background;
+        gradientPercents = new int[percents.length];
+        for (int i = 0; i < percents.length; ++i)
+            gradientPercents[i] = percents[i];
+        gradientVertical = vertical;
+    }
+    // Refresh with the new settings
+    redraw();
+}
+/**
+ * Set the image to be drawn in the background of the label.
+ *
+ * @param image the image to be drawn in the background
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setBackground(Image image) {
+    checkWidget();
+    if (image is backgroundImage) return;
+    if (image !is null) {
+        gradientColors = null;
+        gradientPercents = null;
+    }
+    backgroundImage = image;
+    redraw();
+
+}
+public override void setFont(Font font) {
+    super.setFont(font);
+    redraw();
+}
+/**
+ * Set the label's Image.
+ * The value <code>null</code> clears it.
+ *
+ * @param image the image to be displayed in the label or null
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setImage(Image image) {
+    checkWidget();
+    if (image !is this.image) {
+        this.image = image;
+        redraw();
+    }
+}
+/**
+ * Set the label's text.
+ * The value <code>null</code> clears it.
+ *
+ * @param text the text to be displayed in the label or null
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setText(String text) {
+    checkWidget();
+    if (text is null) text = ""; //$NON-NLS-1$
+    if ( text !=/*eq*/ this.text) {
+        this.text = text;
+        redraw();
+    }
+}
+public override void setToolTipText (String string) {
+    super.setToolTipText (string);
+    appToolTipText = super.getToolTipText();
+}
+/**
+ * Shorten the given text <code>t</code> so that its length doesn't exceed
+ * the given width. The default implementation replaces characters in the
+ * center of the original string with an ellipsis ("...").
+ * Override if you need a different strategy.
+ *
+ * @param gc the gc to use for text measurement
+ * @param t the text to shorten
+ * @param width the width to shorten the text to, in pixels
+ * @return the shortened text
+ */
+protected String shortenText(GC gc, String t, int width) {
+    if (t is null) return null;
+    int w = gc.textExtent(ELLIPSIS, DRAW_FLAGS).x;
+    if (width<=w) return t;
+    int l = t.length;
+    int max = l/2;
+    int min = 0;
+    int mid = (max+min)/2 - 1;
+    if (mid <= 0) return t;
+    TextLayout layout = new TextLayout (getDisplay());
+    layout.setText(t);
+    mid = validateOffset(layout, mid);
+    while (min < mid && mid < max) {
+        String s1 = t[0 .. mid].dup;
+        String s2 = t.substring(validateOffset(layout, l-mid), l);
+        int l1 = gc.textExtent(s1, DRAW_FLAGS).x;
+        int l2 = gc.textExtent(s2, DRAW_FLAGS).x;
+        if (l1+w+l2 > width) {
+            max = mid;
+            mid = validateOffset(layout, (max+min)/2);
+        } else if (l1+w+l2 < width) {
+            min = mid;
+            mid = validateOffset(layout, (max+min)/2);
+        } else {
+            min = max;
+        }
+    }
+    String result = mid is 0 ? t : t.substring(0, mid) ~ ELLIPSIS ~ t.substring(validateOffset(layout, l-mid), l);
+    layout.dispose();
+    return result;
+}
+int validateOffset(TextLayout layout, int offset) {
+    int nextOffset = layout.getNextOffset(offset, SWT.MOVEMENT_CLUSTER);
+    if (nextOffset !is offset) return layout.getPreviousOffset(nextOffset, SWT.MOVEMENT_CLUSTER);
+    return offset;
+}
+private String[] splitString(String text) {
+    String[] lines = new String[1];
+    int start = 0, pos;
+    do {
+        pos = tango.text.Util.locate( text, '\n', start);
+        if (pos is text.length ) {
+            lines[lines.length - 1] = text[start .. $ ];
+        } else {
+            bool crlf = (pos > 0) && (text[ pos - 1 ] is '\r');
+            lines[lines.length - 1] = text[ start .. pos - (crlf ? 1 : 0)];
+            start = pos + 1;
+            String[] newLines = new String[lines.length+1];
+            System.arraycopy(lines, 0, newLines, 0, lines.length);
+            lines = newLines;
+        }
+    } while (pos !is text.length);
+    return lines;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/CLayoutData.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.CLayoutData;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Control;
+
+class CLayoutData {
+
+    int defaultWidth = -1, defaultHeight = -1;
+    int currentWhint, currentHhint, currentWidth = -1, currentHeight = -1;
+
+Point computeSize (Control control, int wHint, int hHint, bool flushCache_) {
+    if (flushCache_) flushCache();
+    if (wHint is SWT.DEFAULT && hHint is SWT.DEFAULT) {
+        if (defaultWidth is -1 || defaultHeight is -1) {
+            Point size = control.computeSize (wHint, hHint, flushCache_);
+            defaultWidth = size.x;
+            defaultHeight = size.y;
+        }
+        return new Point(defaultWidth, defaultHeight);
+    }
+    if (currentWidth is -1 || currentHeight is -1 || wHint !is currentWhint || hHint !is currentHhint) {
+        Point size = control.computeSize (wHint, hHint, flushCache_);
+        currentWhint = wHint;
+        currentHhint = hHint;
+        currentWidth = size.x;
+        currentHeight = size.y;
+    }
+    return new Point(currentWidth, currentHeight);
+}
+void flushCache () {
+    defaultWidth = defaultHeight = -1;
+    currentWidth = currentHeight = -1;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/CTabFolder.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,4081 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.CTabFolder;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.accessibility.ACC;
+import org.eclipse.swt.accessibility.Accessible;
+import org.eclipse.swt.accessibility.AccessibleAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlEvent;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.Region;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Layout;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.custom.CTabItem;
+import org.eclipse.swt.custom.CTabFolder2Listener;
+import org.eclipse.swt.custom.CTabFolderListener;
+import org.eclipse.swt.custom.CTabFolderLayout;
+import org.eclipse.swt.custom.CTabFolderEvent;
+
+import java.lang.all;
+import tango.util.Convert;
+static import tango.text.convert.Utf;
+
+/**
+ *
+ * Instances of this class implement the notebook user interface
+ * metaphor.  It allows the user to select a notebook page from
+ * set of pages.
+ * <p>
+ * The item children that may be added to instances of this class
+ * must be of type <code>CTabItem</code>.
+ * <code>Control</code> children are created and then set into a
+ * tab item using <code>CTabItem#setControl</code>.
+ * </p><p>
+ * Note that although this class is a subclass of <code>Composite</code>,
+ * it does not make sense to set a layout on it.
+ * </p><p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>CLOSE, TOP, BOTTOM, FLAT, BORDER, SINGLE, MULTI</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection</dd>
+ * <dd>"CTabFolder2"</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles TOP and BOTTOM
+ * may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#ctabfolder">CTabFolder, CTabItem snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: CustomControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public class CTabFolder : Composite {
+
+    /**
+     * marginWidth specifies the number of pixels of horizontal margin
+     * that will be placed along the left and right edges of the form.
+     *
+     * The default value is 0.
+     */
+    public int marginWidth = 0;
+    /**
+     * marginHeight specifies the number of pixels of vertical margin
+     * that will be placed along the top and bottom edges of the form.
+     *
+     * The default value is 0.
+     */
+    public int marginHeight = 0;
+
+    /**
+     * A multiple of the tab height that specifies the minimum width to which a tab
+     * will be compressed before scrolling arrows are used to navigate the tabs.
+     *
+     * NOTE This field is badly named and can not be fixed for backwards compatibility.
+     * It should not be capitalized.
+     *
+     * @deprecated This field is no longer used.  See setMinimumCharacters(int)
+     */
+    public int MIN_TAB_WIDTH = 4;
+
+    /**
+     * Color of innermost line of drop shadow border.
+     *
+     * NOTE This field is badly named and can not be fixed for backwards compatibility.
+     * It should be capitalized.
+     *
+     * @deprecated drop shadow border is no longer drawn in 3.0
+     */
+    public static RGB borderInsideRGB;
+    /**
+     * Color of middle line of drop shadow border.
+     *
+     * NOTE This field is badly named and can not be fixed for backwards compatibility.
+     * It should be capitalized.
+     *
+     * @deprecated drop shadow border is no longer drawn in 3.0
+     */
+    public static RGB borderMiddleRGB;
+    /**
+     * Color of outermost line of drop shadow border.
+     *
+     * NOTE This field is badly named and can not be fixed for backwards compatibility.
+     * It should be capitalized.
+     *
+     * @deprecated drop shadow border is no longer drawn in 3.0
+     */
+    public static RGB borderOutsideRGB;
+
+    /* sizing, positioning */
+    int xClient, yClient;
+    bool onBottom = false;
+    bool single = false;
+    bool simple = true;
+    int fixedTabHeight = SWT.DEFAULT;
+    int tabHeight;
+    int minChars = 20;
+
+    /* item management */
+    CTabItem items[];
+    int firstIndex = -1; // index of the left most visible tab.
+    int selectedIndex = -1;
+    int[] priority;
+    bool mru = false;
+    Listener listener;
+
+    /* External Listener management */
+    CTabFolder2Listener[] folderListeners;
+    // support for deprecated listener mechanism
+    CTabFolderListener[] tabListeners;
+
+    /* Selected item appearance */
+    Image selectionBgImage;
+    Color[] selectionGradientColors;
+    int[] selectionGradientPercents;
+    bool selectionGradientVertical;
+    Color selectionForeground;
+    Color selectionBackground;  //selection fade end
+    Color selectionFadeStart;
+
+    Color selectionHighlightGradientBegin = null;  //null is no highlight
+    //Although we are given new colours all the time to show different states (active, etc),
+    //some of which may have a highlight and some not, we'd like to retain the highlight colours
+    //as a cache so that we can reuse them if we're again told to show the highlight.
+    //We are relying on the fact that only one tab state usually gets a highlight, so only
+    //a single cache is required. If that happens to not be true, cache simply becomes less effective,
+    //but we don't leak colours.
+    Color[] selectionHighlightGradientColorsCache = null;  //null is a legal value, check on access
+
+    /* Unselected item appearance */
+    Image bgImage;
+    Color[] gradientColors;
+    int[] gradientPercents;
+    bool gradientVertical;
+    bool showUnselectedImage = true;
+
+    static Color borderColor;
+
+    // close, min/max and chevron buttons
+    bool showClose = false;
+    bool showUnselectedClose = true;
+
+    Rectangle chevronRect;
+    int chevronImageState = NORMAL;
+    bool showChevron = false;
+    Menu showMenu;
+
+    bool showMin = false;
+    Rectangle minRect;
+    bool minimized = false;
+    int minImageState = NORMAL;
+
+    bool showMax = false;
+    Rectangle maxRect;
+    bool maximized = false;
+    int maxImageState = NORMAL;
+
+    Control topRight;
+    Rectangle topRightRect;
+    int topRightAlignment = SWT.RIGHT;
+
+    // borders and shapes
+    int borderLeft = 0;
+    int borderRight = 0;
+    int borderTop = 0;
+    int borderBottom = 0;
+
+    int highlight_margin = 0;
+    int highlight_header = 0;
+
+    int[] curve;
+    int[] topCurveHighlightStart;
+    int[] topCurveHighlightEnd;
+    int curveWidth = 0;
+    int curveIndent = 0;
+
+    // when disposing CTabFolder, don't try to layout the items or
+    // change the selection as each child is destroyed.
+    bool inDispose = false;
+
+    // keep track of size changes in order to redraw only affected area
+    // on Resize
+    Point oldSize;
+    Font oldFont;
+
+    // internal constants
+    static const int DEFAULT_WIDTH = 64;
+    static const int DEFAULT_HEIGHT = 64;
+    static const int BUTTON_SIZE = 18;
+
+    static const int[] TOP_LEFT_CORNER = [0,6, 1,5, 1,4, 4,1, 5,1, 6,0];
+
+    //TOP_LEFT_CORNER_HILITE is laid out in reverse (ie. top to bottom)
+    //so can fade in same direction as right swoop curve
+    static const int[] TOP_LEFT_CORNER_HILITE = [5,2, 4,2, 3,3, 2,4, 2,5, 1,6];
+
+    static const int[] TOP_RIGHT_CORNER = [-6,0, -5,1, -4,1, -1,4, -1,5, 0,6];
+    static const int[] BOTTOM_LEFT_CORNER = [0,-6, 1,-5, 1,-4, 4,-1, 5,-1, 6,0];
+    static const int[] BOTTOM_RIGHT_CORNER = [-6,0, -5,-1, -4,-1, -1,-4, -1,-5, 0,-6];
+
+    static const int[] SIMPLE_TOP_LEFT_CORNER = [0,2, 1,1, 2,0];
+    static const int[] SIMPLE_TOP_RIGHT_CORNER = [-2,0, -1,1, 0,2];
+    static const int[] SIMPLE_BOTTOM_LEFT_CORNER = [0,-2, 1,-1, 2,0];
+    static const int[] SIMPLE_BOTTOM_RIGHT_CORNER = [-2,0, -1,-1, 0,-2];
+    static const int[] SIMPLE_UNSELECTED_INNER_CORNER = [0,0];
+
+    static const int[] TOP_LEFT_CORNER_BORDERLESS = [0,6, 1,5, 1,4, 4,1, 5,1, 6,0];
+    static const int[] TOP_RIGHT_CORNER_BORDERLESS = [-7,0, -6,1, -5,1, -2,4, -2,5, -1,6];
+    static const int[] BOTTOM_LEFT_CORNER_BORDERLESS = [0,-6, 1,-6, 1,-5, 2,-4, 4,-2, 5,-1, 6,-1, 6,0];
+    static const int[] BOTTOM_RIGHT_CORNER_BORDERLESS = [-7,0, -7,-1, -6,-1, -5,-2, -3,-4, -2,-5, -2,-6, -1,-6];
+
+    static const int[] SIMPLE_TOP_LEFT_CORNER_BORDERLESS = [0,2, 1,1, 2,0];
+    static const int[] SIMPLE_TOP_RIGHT_CORNER_BORDERLESS= [-3,0, -2,1, -1,2];
+    static const int[] SIMPLE_BOTTOM_LEFT_CORNER_BORDERLESS = [0,-3, 1,-2, 2,-1, 3,0];
+    static const int[] SIMPLE_BOTTOM_RIGHT_CORNER_BORDERLESS = [-4,0, -3,-1, -2,-2, -1,-3];
+
+    static const int SELECTION_FOREGROUND = SWT.COLOR_LIST_FOREGROUND;
+    static const int SELECTION_BACKGROUND = SWT.COLOR_LIST_BACKGROUND;
+    static const int BORDER1_COLOR = SWT.COLOR_WIDGET_NORMAL_SHADOW;
+    static const int FOREGROUND = SWT.COLOR_WIDGET_FOREGROUND;
+    static const int BACKGROUND = SWT.COLOR_WIDGET_BACKGROUND;
+    static const int BUTTON_BORDER = SWT.COLOR_WIDGET_DARK_SHADOW;
+    static const int BUTTON_FILL = SWT.COLOR_LIST_BACKGROUND;
+
+    static const int NONE = 0;
+    static const int NORMAL = 1;
+    static const int HOT = 2;
+    static const int SELECTED = 3;
+    static const RGB CLOSE_FILL;
+
+    static const int CHEVRON_CHILD_ID = 0;
+    static const int MINIMIZE_CHILD_ID = 1;
+    static const int MAXIMIZE_CHILD_ID = 2;
+    static const int EXTRA_CHILD_ID_COUNT = 3;
+
+static this(){
+    borderInsideRGB  = new RGB (132, 130, 132);
+    borderMiddleRGB  = new RGB (143, 141, 138);
+    borderOutsideRGB = new RGB (171, 168, 165);
+    CLOSE_FILL = new RGB(252, 160, 160);
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a widget which will be the parent of the new instance (cannot be null)
+ * @param style the style of widget to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ *
+ * @see SWT#TOP
+ * @see SWT#BOTTOM
+ * @see SWT#FLAT
+ * @see SWT#BORDER
+ * @see SWT#SINGLE
+ * @see SWT#MULTI
+ * @see #getStyle()
+ */
+public this(Composite parent, int style) {
+    chevronRect = new Rectangle(0, 0, 0, 0);
+    minRect = new Rectangle(0, 0, 0, 0);
+    maxRect = new Rectangle(0, 0, 0, 0);
+    topRightRect = new Rectangle(0, 0, 0, 0);
+    super(parent, checkStyle (parent, style));
+    super.setLayout(new CTabFolderLayout());
+    int style2 = super.getStyle();
+    oldFont = getFont();
+    onBottom = (style2 & SWT.BOTTOM) !is 0;
+    showClose = (style2 & SWT.CLOSE) !is 0;
+//  showMin = (style2 & SWT.MIN) !is 0; - conflicts with SWT.TOP
+//  showMax = (style2 & SWT.MAX) !is 0; - conflicts with SWT.BOTTOM
+    single = (style2 & SWT.SINGLE) !is 0;
+    borderLeft = borderRight = (style & SWT.BORDER) !is 0 ? 1 : 0;
+    borderTop = onBottom ? borderLeft : 0;
+    borderBottom = onBottom ? 0 : borderLeft;
+    highlight_header = (style & SWT.FLAT) !is 0 ? 1 : 3;
+    highlight_margin = (style & SWT.FLAT) !is 0 ? 0 : 2;
+    //set up default colors
+    Display display = getDisplay();
+    selectionForeground = display.getSystemColor(SELECTION_FOREGROUND);
+    selectionBackground = display.getSystemColor(SELECTION_BACKGROUND);
+    borderColor = display.getSystemColor(BORDER1_COLOR);
+    updateTabHeight(false);
+
+    initAccessible();
+
+    // Add all listeners
+    listener = new class() Listener {
+        public void handleEvent(Event event) {
+            switch (event.type) {
+                case SWT.Dispose:          onDispose(event); break;
+                case SWT.DragDetect:       onDragDetect(event); break;
+                case SWT.FocusIn:          onFocus(event);  break;
+                case SWT.FocusOut:         onFocus(event);  break;
+                case SWT.KeyDown:          onKeyDown(event); break;
+                case SWT.MouseDoubleClick: onMouseDoubleClick(event); break;
+                case SWT.MouseDown:        onMouse(event);  break;
+                case SWT.MouseEnter:       onMouse(event);  break;
+                case SWT.MouseExit:        onMouse(event);  break;
+                case SWT.MouseMove:        onMouse(event); break;
+                case SWT.MouseUp:          onMouse(event); break;
+                case SWT.Paint:            onPaint(event);  break;
+                case SWT.Resize:           onResize();  break;
+                case SWT.Traverse:         onTraverse(event); break;
+                default:
+            }
+        }
+    };
+
+    int[] folderEvents = [
+        SWT.Dispose,
+        SWT.DragDetect,
+        SWT.FocusIn,
+        SWT.FocusOut,
+        SWT.KeyDown,
+        SWT.MouseDoubleClick,
+        SWT.MouseDown,
+        SWT.MouseEnter,
+        SWT.MouseExit,
+        SWT.MouseMove,
+        SWT.MouseUp,
+        SWT.Paint,
+        SWT.Resize,
+        SWT.Traverse,
+    ];
+    for (int i = 0; i < folderEvents.length; i++) {
+        addListener(folderEvents[i], listener);
+    }
+}
+static int checkStyle (Composite parent, int style) {
+    int mask = SWT.CLOSE | SWT.TOP | SWT.BOTTOM | SWT.FLAT | SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT | SWT.SINGLE | SWT.MULTI;
+    style = style & mask;
+    // TOP and BOTTOM are mutually exclusive.
+    // TOP is the default
+    if ((style & SWT.TOP) !is 0) style = style & ~SWT.BOTTOM;
+    // SINGLE and MULTI are mutually exclusive.
+    // MULTI is the default
+    if ((style & SWT.MULTI) !is 0) style = style & ~SWT.SINGLE;
+    // reduce the flash by not redrawing the entire area on a Resize event
+    style |= SWT.NO_REDRAW_RESIZE;
+    //TEMPORARY CODE
+    /*
+     * The default background on carbon and some GTK themes is not a solid color
+     * but a texture.  To show the correct default background, we must allow
+     * the operating system to draw it and therefore, we can not use the
+     * NO_BACKGROUND style.  The NO_BACKGROUND style is not required on platforms
+     * that use double buffering which is true in both of these cases.
+     */
+    String platform = SWT.getPlatform();
+    if ("carbon"==platform || "gtk"==platform) return style; //$NON-NLS-1$ //$NON-NLS-2$
+
+    //TEMPORARY CODE
+    /*
+     * In Right To Left orientation on Windows, all GC calls that use a brush are drawing
+     * offset by one pixel.  This results in some parts of the CTabFolder not drawing correctly.
+     * To alleviate some of the appearance problems, allow the OS to draw the background.
+     * This does not draw correctly but the result is less obviously wrong.
+     */
+    if ((style & SWT.RIGHT_TO_LEFT) !is 0) return style;
+    if ((parent.getStyle() & SWT.MIRRORED) !is 0 && (style & SWT.LEFT_TO_RIGHT) is 0) return style;
+
+    return style | SWT.NO_BACKGROUND;
+}
+static void fillRegion(GC gc, Region region) {
+    // NOTE: region passed in to this function will be modified
+    Region clipping = new Region();
+    gc.getClipping(clipping);
+    region.intersect(clipping);
+    gc.setClipping(region);
+    gc.fillRectangle(region.getBounds());
+    gc.setClipping(clipping);
+    clipping.dispose();
+}
+/**
+ *
+ * Adds the listener to the collection of listeners who will
+ * be notified when a tab item is closed, minimized, maximized,
+ * restored, or to show the list of items that are not
+ * currently visible.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ *
+ * @see CTabFolder2Listener
+ * @see #removeCTabFolder2Listener(CTabFolder2Listener)
+ *
+ * @since 3.0
+ */
+public void addCTabFolder2Listener(CTabFolder2Listener listener) {
+    checkWidget();
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    // add to array
+    CTabFolder2Listener[] newListeners = new CTabFolder2Listener[folderListeners.length + 1];
+    SimpleType!(CTabFolder2Listener).arraycopy(folderListeners, 0, newListeners, 0, folderListeners.length);
+    folderListeners = newListeners;
+    folderListeners[folderListeners.length - 1] = listener;
+}
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when a tab item is closed.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ *
+ * @see CTabFolderListener
+ * @see #removeCTabFolderListener(CTabFolderListener)
+ *
+ * @deprecated use addCTabFolder2Listener(CTabFolder2Listener)
+ */
+public void addCTabFolderListener(CTabFolderListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    // add to array
+    CTabFolderListener[] newTabListeners = new CTabFolderListener[tabListeners.length + 1];
+    SimpleType!(CTabFolderListener).arraycopy(tabListeners, 0, newTabListeners, 0, tabListeners.length);
+    tabListeners = newTabListeners;
+    tabListeners[tabListeners.length - 1] = listener;
+    // display close button to be backwards compatible
+    if (!showClose) {
+        showClose = true;
+        updateItems();
+        redraw();
+    }
+}
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the user changes the receiver's selection, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * <code>widgetSelected</code> is called when the user changes the selected tab.
+ * <code>widgetDefaultSelected</code> is not called.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the user changes the receiver's selection
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener(SelectionListener listener) {
+    checkWidget();
+    if (listener is null) {
+        SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    }
+    TypedListener typedListener = new TypedListener(listener);
+    addListener(SWT.Selection, typedListener);
+    addListener(SWT.DefaultSelection, typedListener);
+}
+void antialias (int[] shape, RGB lineRGB, RGB innerRGB, RGB outerRGB, GC gc){
+    // Don't perform anti-aliasing on Mac and WPF because the platform
+    // already does it.  The simple style also does not require anti-aliasing.
+    if (simple || "carbon".equals(SWT.getPlatform()) || "wpf".equals(SWT.getPlatform())) return; //$NON-NLS-1$
+    // Don't perform anti-aliasing on low resolution displays
+    if (getDisplay().getDepth() < 15) return;
+    if (outerRGB !is null) {
+        int index = 0;
+        bool left = true;
+        int oldY = onBottom ? 0 : getSize().y;
+        int[] outer = new int[shape.length];
+        for (int i = 0; i < shape.length/2; i++) {
+            if (left && (index + 3 < shape.length)) {
+                left = onBottom ? oldY <= shape[index+3] : oldY >= shape[index+3];
+                oldY = shape[index+1];
+            }
+            outer[index] = shape[index] + (left ? -1 : +1);
+            index++;
+            outer[index] = shape[index];
+            index++;
+        }
+        RGB from = lineRGB;
+        RGB to = outerRGB;
+        int red = from.red + 2*(to.red - from.red)/3;
+        int green = from.green + 2*(to.green - from.green)/3;
+        int blue = from.blue + 2*(to.blue - from.blue)/3;
+        Color color = new Color(getDisplay(), red, green, blue);
+        gc.setForeground(color);
+        gc.drawPolyline(outer);
+        color.dispose();
+    }
+    if (innerRGB !is null) {
+        int[] inner = new int[shape.length];
+        int index = 0;
+        bool left = true;
+        int oldY = onBottom ? 0 : getSize().y;
+        for (int i = 0; i < shape.length/2; i++) {
+            if (left && (index + 3 < shape.length)) {
+                left = onBottom ? oldY <= shape[index+3] : oldY >= shape[index+3];
+                oldY = shape[index+1];
+            }
+            inner[index] = shape[index] + (left ? +1 : -1);
+            index++;
+            inner[index] = shape[index];
+            index++;
+        }
+        RGB from = lineRGB;
+        RGB to = innerRGB;
+        int red = from.red + 2*(to.red - from.red)/3;
+        int green = from.green + 2*(to.green - from.green)/3;
+        int blue = from.blue + 2*(to.blue - from.blue)/3;
+        Color color = new Color(getDisplay(), red, green, blue);
+        gc.setForeground(color);
+        gc.drawPolyline(inner);
+        color.dispose();
+    }
+}
+public override Rectangle computeTrim (int x, int y, int width, int height) {
+    checkWidget();
+    int trimX = x - marginWidth - highlight_margin - borderLeft;
+    int trimWidth = width + borderLeft + borderRight + 2*marginWidth + 2*highlight_margin;
+    if (minimized) {
+        int trimY = onBottom ? y - borderTop : y - highlight_header - tabHeight - borderTop;
+        int trimHeight = borderTop + borderBottom + tabHeight + highlight_header;
+        return new Rectangle (trimX, trimY, trimWidth, trimHeight);
+    } else {
+        int trimY = onBottom ? y - marginHeight - highlight_margin - borderTop: y - marginHeight - highlight_header - tabHeight - borderTop;
+        int trimHeight = height + borderTop + borderBottom + 2*marginHeight + tabHeight + highlight_header + highlight_margin;
+        return new Rectangle (trimX, trimY, trimWidth, trimHeight);
+    }
+}
+void createItem (CTabItem item, int index) {
+    if (0 > index || index > getItemCount ())SWT.error (SWT.ERROR_INVALID_RANGE);
+    item.parent = this;
+    CTabItem[] newItems = new CTabItem [items.length + 1];
+    System.arraycopy(items, 0, newItems, 0, index);
+    newItems[index] = item;
+    System.arraycopy(items, index, newItems, index + 1, items.length - index);
+    items = newItems;
+    if (selectedIndex >= index) selectedIndex ++;
+    int[] newPriority = new int[priority.length + 1];
+    int next = 0,  priorityIndex = priority.length;
+    for (int i = 0; i < priority.length; i++) {
+        if (!mru && priority[i] is index) {
+            priorityIndex = next++;
+        }
+        newPriority[next++] = priority[i] >= index ? priority[i] + 1 : priority[i];
+    }
+    newPriority[priorityIndex] = index;
+    priority = newPriority;
+
+    if (items.length is 1) {
+        if (!updateTabHeight(false)) updateItems();
+        redraw();
+    } else {
+        updateItems();
+        redrawTabs();
+    }
+}
+void destroyItem (CTabItem item) {
+    if (inDispose) return;
+    int index = indexOf(item);
+    if (index is -1) return;
+
+    if (items.length is 1) {
+        items = new CTabItem[0];
+        priority = new int[0];
+        firstIndex = -1;
+        selectedIndex = -1;
+
+        Control control = item.getControl();
+        if (control !is null && !control.isDisposed()) {
+            control.setVisible(false);
+        }
+        setToolTipText(null);
+        setButtonBounds();
+        redraw();
+        return;
+    }
+
+    CTabItem[] newItems = new CTabItem [items.length - 1];
+    System.arraycopy(items, 0, newItems, 0, index);
+    System.arraycopy(items, index + 1, newItems, index, items.length - index - 1);
+    items = newItems;
+
+    int[] newPriority = new int[priority.length - 1];
+    int next = 0;
+    for (int i = 0; i < priority.length; i++) {
+        if (priority [i] is index) continue;
+        newPriority[next++] = priority[i] > index ? priority[i] - 1 : priority [i];
+    }
+    priority = newPriority;
+
+    // move the selection if this item is selected
+    if (selectedIndex is index) {
+        Control control = item.getControl();
+        selectedIndex = -1;
+        int nextSelection = mru ? priority[0] : Math.max(0, index - 1);
+        setSelection(nextSelection, true);
+        if (control !is null && !control.isDisposed()) {
+            control.setVisible(false);
+        }
+    } else if (selectedIndex > index) {
+        selectedIndex --;
+    }
+
+    updateItems();
+    redrawTabs();
+}
+void drawBackground(GC gc, int[] shape, bool selected) {
+    Color defaultBackground = selected ? selectionBackground : getBackground();
+    Image image = selected ? selectionBgImage : bgImage;
+    Color[] colors = selected ? selectionGradientColors : gradientColors;
+    int[] percents = selected ? selectionGradientPercents : gradientPercents;
+    bool vertical = selected ? selectionGradientVertical : gradientVertical;
+    Point size = getSize();
+    int width = size.x;
+    int height = tabHeight + highlight_header;
+    int x = 0;
+    if (borderLeft > 0) {
+        x += 1; width -= 2;
+    }
+    int y = onBottom ? size.y - borderBottom - height : borderTop;
+    drawBackground(gc, shape, x, y, width, height, defaultBackground, image, colors, percents, vertical);
+}
+void drawBackground(GC gc, int[] shape, int x, int y, int width, int height, Color defaultBackground, Image image, Color[] colors, int[] percents, bool vertical) {
+    Region clipping = new Region();
+    gc.getClipping(clipping);
+    Region region = new Region();
+    region.add(shape);
+    region.intersect(clipping);
+    gc.setClipping(region);
+
+    if (image !is null) {
+        // draw the background image in shape
+        gc.setBackground(defaultBackground);
+        gc.fillRectangle(x, y, width, height);
+        Rectangle imageRect = image.getBounds();
+        gc.drawImage(image, imageRect.x, imageRect.y, imageRect.width, imageRect.height, x, y, width, height);
+    } else if (colors !is null) {
+        // draw gradient
+        if (colors.length is 1) {
+            Color background = colors[0] !is null ? colors[0] : defaultBackground;
+            gc.setBackground(background);
+            gc.fillRectangle(x, y, width, height);
+        } else {
+            if (vertical) {
+                if (onBottom) {
+                    int pos = 0;
+                    if (percents[percents.length - 1] < 100) {
+                        pos = percents[percents.length - 1] * height / 100;
+                        gc.setBackground(defaultBackground);
+                        gc.fillRectangle(x, y, width, pos);
+                    }
+                    Color lastColor = colors[colors.length-1];
+                    if (lastColor is null) lastColor = defaultBackground;
+                    for (int i = percents.length-1; i >= 0; i--) {
+                        gc.setForeground(lastColor);
+                        lastColor = colors[i];
+                        if (lastColor is null) lastColor = defaultBackground;
+                        gc.setBackground(lastColor);
+                        int gradientHeight = percents[i] * height / 100;
+                        gc.fillGradientRectangle(x, y+pos, width, gradientHeight, true);
+                        pos += gradientHeight;
+                    }
+                } else {
+                    Color lastColor = colors[0];
+                    if (lastColor is null) lastColor = defaultBackground;
+                    int pos = 0;
+                    for (int i = 0; i < percents.length; i++) {
+                        gc.setForeground(lastColor);
+                        lastColor = colors[i + 1];
+                        if (lastColor is null) lastColor = defaultBackground;
+                        gc.setBackground(lastColor);
+                        int gradientHeight = percents[i] * height / 100;
+                        gc.fillGradientRectangle(x, y+pos, width, gradientHeight, true);
+                        pos += gradientHeight;
+                    }
+                    if (pos < height) {
+                        gc.setBackground(defaultBackground);
+                        gc.fillRectangle(x, pos, width, height-pos+1);
+                    }
+                }
+            } else { //horizontal gradient
+                y = 0;
+                height = getSize().y;
+                Color lastColor = colors[0];
+                if (lastColor is null) lastColor = defaultBackground;
+                int pos = 0;
+                for (int i = 0; i < percents.length; ++i) {
+                    gc.setForeground(lastColor);
+                    lastColor = colors[i + 1];
+                    if (lastColor is null) lastColor = defaultBackground;
+                    gc.setBackground(lastColor);
+                    int gradientWidth = (percents[i] * width / 100) - pos;
+                    gc.fillGradientRectangle(x+pos, y, gradientWidth, height, false);
+                    pos += gradientWidth;
+                }
+                if (pos < width) {
+                    gc.setBackground(defaultBackground);
+                    gc.fillRectangle(x+pos, y, width-pos, height);
+                }
+            }
+        }
+    } else {
+        // draw a solid background using default background in shape
+        if ((getStyle() & SWT.NO_BACKGROUND) !is 0 || defaultBackground!=getBackground()) {
+            gc.setBackground(defaultBackground);
+            gc.fillRectangle(x, y, width, height);
+        }
+    }
+    gc.setClipping(clipping);
+    clipping.dispose();
+    region.dispose();
+}
+void drawBody(Event event) {
+    GC gc = event.gc;
+    Point size = getSize();
+
+    // fill in body
+    if (!minimized){
+        int width = size.x  - borderLeft - borderRight - 2*highlight_margin;
+        int height = size.y - borderTop - borderBottom - tabHeight - highlight_header - highlight_margin;
+        // Draw highlight margin
+        if (highlight_margin > 0) {
+            int[] shape = null;
+            if (onBottom) {
+                int x1 = borderLeft;
+                int y1 = borderTop;
+                int x2 = size.x - borderRight;
+                int y2 = size.y - borderBottom - tabHeight - highlight_header;
+                shape = [x1,y1, x2,y1, x2,y2, x2-highlight_margin,y2,
+                                   x2-highlight_margin, y1+highlight_margin, x1+highlight_margin,y1+highlight_margin,
+                                   x1+highlight_margin,y2, x1,y2];
+            } else {
+                int x1 = borderLeft;
+                int y1 = borderTop + tabHeight + highlight_header;
+                int x2 = size.x - borderRight;
+                int y2 = size.y - borderBottom;
+                shape = [x1,y1, x1+highlight_margin,y1, x1+highlight_margin,y2-highlight_margin,
+                                   x2-highlight_margin,y2-highlight_margin, x2-highlight_margin,y1,
+                                   x2,y1, x2,y2, x1,y2];
+            }
+            // If horizontal gradient, show gradient across the whole area
+            if (selectedIndex !is -1 && selectionGradientColors !is null && selectionGradientColors.length > 1 && !selectionGradientVertical) {
+                drawBackground(gc, shape, true);
+            } else if (selectedIndex is -1 && gradientColors !is null && gradientColors.length > 1 && !gradientVertical) {
+                drawBackground(gc, shape, false);
+            } else {
+                gc.setBackground(selectedIndex is -1 ? getBackground() : selectionBackground);
+                gc.fillPolygon(shape);
+            }
+        }
+        //Draw client area
+        if ((getStyle() & SWT.NO_BACKGROUND) !is 0) {
+            gc.setBackground(getBackground());
+            gc.fillRectangle(xClient - marginWidth, yClient - marginHeight, width, height);
+        }
+    } else {
+        if ((getStyle() & SWT.NO_BACKGROUND) !is 0) {
+            int height = borderTop + tabHeight + highlight_header + borderBottom;
+            if (size.y > height) {
+                gc.setBackground(getParent().getBackground());
+                gc.fillRectangle(0, height, size.x, size.y - height);
+            }
+        }
+    }
+
+    //draw 1 pixel border around outside
+    if (borderLeft > 0) {
+        gc.setForeground(borderColor);
+        int x1 = borderLeft - 1;
+        int x2 = size.x - borderRight;
+        int y1 = onBottom ? borderTop - 1 : borderTop + tabHeight;
+        int y2 = onBottom ? size.y - tabHeight - borderBottom - 1 : size.y - borderBottom;
+        gc.drawLine(x1, y1, x1, y2); // left
+        gc.drawLine(x2, y1, x2, y2); // right
+        if (onBottom) {
+            gc.drawLine(x1, y1, x2, y1); // top
+        } else {
+            gc.drawLine(x1, y2, x2, y2); // bottom
+        }
+    }
+}
+
+void drawChevron(GC gc) {
+    if (chevronRect.width is 0 || chevronRect.height is 0) return;
+    // draw chevron (10x7)
+    Display display = getDisplay();
+    Point dpi = display.getDPI();
+    int fontHeight = 72 * 10 / dpi.y;
+    FontData fd = getFont().getFontData()[0];
+    fd.setHeight(fontHeight);
+    Font f = new Font(display, fd);
+    int fHeight = f.getFontData()[0].getHeight() * dpi.y / 72;
+    int indent = Math.max(2, (chevronRect.height - fHeight - 4) /2);
+    int x = chevronRect.x + 2;
+    int y = chevronRect.y + indent;
+    int count;
+    if (single) {
+        count = selectedIndex is -1 ? items.length : items.length - 1;
+    } else {
+        int showCount = 0;
+        while (showCount < priority.length && items[priority[showCount]].showing) {
+            showCount++;
+        }
+        count = items.length - showCount;
+    }
+    String chevronString = count > 99 ? "99+" : to!(String)(count); //$NON-NLS-1$
+    switch (chevronImageState) {
+        case NORMAL: {
+            Color chevronBorder = single ? getSelectionForeground() : getForeground();
+            gc.setForeground(chevronBorder);
+            gc.setFont(f);
+            gc.drawLine(x,y,     x+2,y+2);
+            gc.drawLine(x+2,y+2, x,y+4);
+            gc.drawLine(x+1,y,   x+3,y+2);
+            gc.drawLine(x+3,y+2, x+1,y+4);
+            gc.drawLine(x+4,y,   x+6,y+2);
+            gc.drawLine(x+6,y+2, x+5,y+4);
+            gc.drawLine(x+5,y,   x+7,y+2);
+            gc.drawLine(x+7,y+2, x+4,y+4);
+            gc.drawString(chevronString, x+7, y+3, true);
+            break;
+        }
+        case HOT: {
+            gc.setForeground(display.getSystemColor(BUTTON_BORDER));
+            gc.setBackground(display.getSystemColor(BUTTON_FILL));
+            gc.setFont(f);
+            gc.fillRoundRectangle(chevronRect.x, chevronRect.y, chevronRect.width, chevronRect.height, 6, 6);
+            gc.drawRoundRectangle(chevronRect.x, chevronRect.y, chevronRect.width - 1, chevronRect.height - 1, 6, 6);
+            gc.drawLine(x,y,     x+2,y+2);
+            gc.drawLine(x+2,y+2, x,y+4);
+            gc.drawLine(x+1,y,   x+3,y+2);
+            gc.drawLine(x+3,y+2, x+1,y+4);
+            gc.drawLine(x+4,y,   x+6,y+2);
+            gc.drawLine(x+6,y+2, x+5,y+4);
+            gc.drawLine(x+5,y,   x+7,y+2);
+            gc.drawLine(x+7,y+2, x+4,y+4);
+            gc.drawString(chevronString, x+7, y+3, true);
+            break;
+        }
+        case SELECTED: {
+            gc.setForeground(display.getSystemColor(BUTTON_BORDER));
+            gc.setBackground(display.getSystemColor(BUTTON_FILL));
+            gc.setFont(f);
+            gc.fillRoundRectangle(chevronRect.x, chevronRect.y, chevronRect.width, chevronRect.height, 6, 6);
+            gc.drawRoundRectangle(chevronRect.x, chevronRect.y, chevronRect.width - 1, chevronRect.height - 1, 6, 6);
+            gc.drawLine(x+1,y+1, x+3,y+3);
+            gc.drawLine(x+3,y+3, x+1,y+5);
+            gc.drawLine(x+2,y+1, x+4,y+3);
+            gc.drawLine(x+4,y+3, x+2,y+5);
+            gc.drawLine(x+5,y+1, x+7,y+3);
+            gc.drawLine(x+7,y+3, x+6,y+5);
+            gc.drawLine(x+6,y+1, x+8,y+3);
+            gc.drawLine(x+8,y+3, x+5,y+5);
+            gc.drawString(chevronString, x+8, y+4, true);
+            break;
+        }
+        default:
+    }
+    f.dispose();
+}
+void drawMaximize(GC gc) {
+    if (maxRect.width is 0 || maxRect.height is 0) return;
+    Display display = getDisplay();
+    // 5x4 or 7x9
+    int x = maxRect.x + (CTabFolder.BUTTON_SIZE - 10)/2;
+    int y = maxRect.y + 3;
+
+    gc.setForeground(display.getSystemColor(BUTTON_BORDER));
+    gc.setBackground(display.getSystemColor(BUTTON_FILL));
+
+    switch (maxImageState) {
+        case NORMAL: {
+            if (!maximized) {
+                gc.fillRectangle(x, y, 9, 9);
+                gc.drawRectangle(x, y, 9, 9);
+                gc.drawLine(x+1, y+2, x+8, y+2);
+            } else {
+                gc.fillRectangle(x, y+3, 5, 4);
+                gc.fillRectangle(x+2, y, 5, 4);
+                gc.drawRectangle(x, y+3, 5, 4);
+                gc.drawRectangle(x+2, y, 5, 4);
+                gc.drawLine(x+3, y+1, x+6, y+1);
+                gc.drawLine(x+1, y+4, x+4, y+4);
+            }
+            break;
+        }
+        case HOT: {
+            gc.fillRoundRectangle(maxRect.x, maxRect.y, maxRect.width, maxRect.height, 6, 6);
+            gc.drawRoundRectangle(maxRect.x, maxRect.y, maxRect.width - 1, maxRect.height - 1, 6, 6);
+            if (!maximized) {
+                gc.fillRectangle(x, y, 9, 9);
+                gc.drawRectangle(x, y, 9, 9);
+                gc.drawLine(x+1, y+2, x+8, y+2);
+            } else {
+                gc.fillRectangle(x, y+3, 5, 4);
+                gc.fillRectangle(x+2, y, 5, 4);
+                gc.drawRectangle(x, y+3, 5, 4);
+                gc.drawRectangle(x+2, y, 5, 4);
+                gc.drawLine(x+3, y+1, x+6, y+1);
+                gc.drawLine(x+1, y+4, x+4, y+4);
+            }
+            break;
+        }
+        case SELECTED: {
+            gc.fillRoundRectangle(maxRect.x, maxRect.y, maxRect.width, maxRect.height, 6, 6);
+            gc.drawRoundRectangle(maxRect.x, maxRect.y, maxRect.width - 1, maxRect.height - 1, 6, 6);
+            if (!maximized) {
+                gc.fillRectangle(x+1, y+1, 9, 9);
+                gc.drawRectangle(x+1, y+1, 9, 9);
+                gc.drawLine(x+2, y+3, x+9, y+3);
+            } else {
+                gc.fillRectangle(x+1, y+4, 5, 4);
+                gc.fillRectangle(x+3, y+1, 5, 4);
+                gc.drawRectangle(x+1, y+4, 5, 4);
+                gc.drawRectangle(x+3, y+1, 5, 4);
+                gc.drawLine(x+4, y+2, x+7, y+2);
+                gc.drawLine(x+2, y+5, x+5, y+5);
+            }
+            break;
+        }
+        default:
+    }
+}
+void drawMinimize(GC gc) {
+    if (minRect.width is 0 || minRect.height is 0) return;
+    Display display = getDisplay();
+    // 5x4 or 9x3
+    int x = minRect.x + (BUTTON_SIZE - 10)/2;
+    int y = minRect.y + 3;
+
+    gc.setForeground(display.getSystemColor(BUTTON_BORDER));
+    gc.setBackground(display.getSystemColor(BUTTON_FILL));
+
+    switch (minImageState) {
+        case NORMAL: {
+            if (!minimized) {
+                gc.fillRectangle(x, y, 9, 3);
+                gc.drawRectangle(x, y, 9, 3);
+            } else {
+                gc.fillRectangle(x, y+3, 5, 4);
+                gc.fillRectangle(x+2, y, 5, 4);
+                gc.drawRectangle(x, y+3, 5, 4);
+                gc.drawRectangle(x+2, y, 5, 4);
+                gc.drawLine(x+3, y+1, x+6, y+1);
+                gc.drawLine(x+1, y+4, x+4, y+4);
+            }
+            break;
+        }
+        case HOT: {
+            gc.fillRoundRectangle(minRect.x, minRect.y, minRect.width, minRect.height, 6, 6);
+            gc.drawRoundRectangle(minRect.x, minRect.y, minRect.width - 1, minRect.height - 1, 6, 6);
+            if (!minimized) {
+                gc.fillRectangle(x, y, 9, 3);
+                gc.drawRectangle(x, y, 9, 3);
+            } else {
+                gc.fillRectangle(x, y+3, 5, 4);
+                gc.fillRectangle(x+2, y, 5, 4);
+                gc.drawRectangle(x, y+3, 5, 4);
+                gc.drawRectangle(x+2, y, 5, 4);
+                gc.drawLine(x+3, y+1, x+6, y+1);
+                gc.drawLine(x+1, y+4, x+4, y+4);
+            }
+            break;
+        }
+        case SELECTED: {
+            gc.fillRoundRectangle(minRect.x, minRect.y, minRect.width, minRect.height, 6, 6);
+            gc.drawRoundRectangle(minRect.x, minRect.y, minRect.width - 1, minRect.height - 1, 6, 6);
+            if (!minimized) {
+                gc.fillRectangle(x+1, y+1, 9, 3);
+                gc.drawRectangle(x+1, y+1, 9, 3);
+            } else {
+                gc.fillRectangle(x+1, y+4, 5, 4);
+                gc.fillRectangle(x+3, y+1, 5, 4);
+                gc.drawRectangle(x+1, y+4, 5, 4);
+                gc.drawRectangle(x+3, y+1, 5, 4);
+                gc.drawLine(x+4, y+2, x+7, y+2);
+                gc.drawLine(x+2, y+5, x+5, y+5);
+            }
+            break;
+        }
+        default:
+    }
+}
+void drawTabArea(Event event) {
+    GC gc = event.gc;
+    Point size = getSize();
+    int[] shape = null;
+
+    if (tabHeight is 0) {
+        int style = getStyle();
+        if ((style & SWT.FLAT) !is 0 && (style & SWT.BORDER) is 0) return;
+        int x1 = borderLeft - 1;
+        int x2 = size.x - borderRight;
+        int y1 = onBottom ? size.y - borderBottom - highlight_header - 1 : borderTop + highlight_header;
+        int y2 = onBottom ? size.y - borderBottom : borderTop;
+        if (borderLeft > 0 && onBottom) y2 -= 1;
+
+        shape = [x1, y1, x1,y2, x2,y2, x2,y1];
+
+        // If horizontal gradient, show gradient across the whole area
+        if (selectedIndex !is -1 && selectionGradientColors !is null && selectionGradientColors.length > 1 && !selectionGradientVertical) {
+            drawBackground(gc, shape, true);
+        } else if (selectedIndex is -1 && gradientColors !is null && gradientColors.length > 1 && !gradientVertical) {
+            drawBackground(gc, shape, false);
+        } else {
+            gc.setBackground(selectedIndex is -1 ? getBackground() : selectionBackground);
+            gc.fillPolygon(shape);
+        }
+
+        //draw 1 pixel border
+        if (borderLeft > 0) {
+            gc.setForeground(borderColor);
+            gc.drawPolyline(shape);
+        }
+        return;
+    }
+
+    int x = Math.max(0, borderLeft - 1);
+    int y = onBottom ? size.y - borderBottom - tabHeight : borderTop;
+    int width = size.x - borderLeft - borderRight + 1;
+    int height = tabHeight - 1;
+
+    // Draw Tab Header
+    if (onBottom) {
+        int[] left, right;
+        if ((getStyle() & SWT.BORDER) !is 0) {
+            left = simple ? SIMPLE_BOTTOM_LEFT_CORNER : BOTTOM_LEFT_CORNER;
+            right = simple ? SIMPLE_BOTTOM_RIGHT_CORNER : BOTTOM_RIGHT_CORNER;
+        } else {
+            left = simple ? SIMPLE_BOTTOM_LEFT_CORNER_BORDERLESS : BOTTOM_LEFT_CORNER_BORDERLESS;
+            right = simple ? SIMPLE_BOTTOM_RIGHT_CORNER_BORDERLESS : BOTTOM_RIGHT_CORNER_BORDERLESS;
+        }
+        shape = new int[left.length + right.length + 4];
+        int index = 0;
+        shape[index++] = x;
+        shape[index++] = y-highlight_header;
+        for (int i = 0; i < left.length/2; i++) {
+            shape[index++] = x+left[2*i];
+            shape[index++] = y+height+left[2*i+1];
+            if (borderLeft is 0) shape[index-1] += 1;
+        }
+        for (int i = 0; i < right.length/2; i++) {
+            shape[index++] = x+width+right[2*i];
+            shape[index++] = y+height+right[2*i+1];
+            if (borderLeft is 0) shape[index-1] += 1;
+        }
+        shape[index++] = x+width;
+        shape[index++] = y-highlight_header;
+    } else {
+        int[] left, right;
+        if ((getStyle() & SWT.BORDER) !is 0) {
+            left = simple ? SIMPLE_TOP_LEFT_CORNER : TOP_LEFT_CORNER;
+            right = simple ? SIMPLE_TOP_RIGHT_CORNER : TOP_RIGHT_CORNER;
+        } else {
+            left = simple ? SIMPLE_TOP_LEFT_CORNER_BORDERLESS : TOP_LEFT_CORNER_BORDERLESS;
+            right = simple ? SIMPLE_TOP_RIGHT_CORNER_BORDERLESS : TOP_RIGHT_CORNER_BORDERLESS;
+        }
+        shape = new int[left.length + right.length + 4];
+        int index = 0;
+        shape[index++] = x;
+        shape[index++] = y+height+highlight_header + 1;
+        for (int i = 0; i < left.length/2; i++) {
+            shape[index++] = x+left[2*i];
+            shape[index++] = y+left[2*i+1];
+        }
+        for (int i = 0; i < right.length/2; i++) {
+            shape[index++] = x+width+right[2*i];
+            shape[index++] = y+right[2*i+1];
+        }
+        shape[index++] = x+width;
+        shape[index++] = y+height+highlight_header + 1;
+    }
+    // Fill in background
+    bool bkSelected = single && selectedIndex !is -1;
+    drawBackground(gc, shape, bkSelected);
+    // Fill in parent background for non-rectangular shape
+    Region r = new Region();
+    r.add(new Rectangle(x, y, width + 1, height + 1));
+    r.subtract(shape);
+    gc.setBackground(getParent().getBackground());
+    fillRegion(gc, r);
+    r.dispose();
+
+    // Draw the unselected tabs.
+    if (!single) {
+        for (int i=0; i < items.length; i++) {
+            if (i !is selectedIndex && event.getBounds().intersects(items[i].getBounds())) {
+                items[i].onPaint(gc, false);
+            }
+        }
+    }
+
+    // Draw selected tab
+    if (selectedIndex !is -1) {
+        CTabItem item = items[selectedIndex];
+        item.onPaint(gc, true);
+    } else {
+        // if no selected tab - draw line across bottom of all tabs
+        int x1 = borderLeft;
+        int y1 = (onBottom) ? size.y - borderBottom - tabHeight - 1 : borderTop + tabHeight;
+        int x2 = size.x - borderRight;
+        gc.setForeground(borderColor);
+        gc.drawLine(x1, y1, x2, y1);
+    }
+
+    // Draw Buttons
+    drawChevron(gc);
+    drawMinimize(gc);
+    drawMaximize(gc);
+
+    // Draw border line
+    if (borderLeft > 0) {
+        RGB outside = getParent().getBackground().getRGB();
+        antialias(shape, borderColor.getRGB(), null, outside, gc);
+        gc.setForeground(borderColor);
+        gc.drawPolyline(shape);
+    }
+}
+/**
+ * Returns <code>true</code> if the receiver's border is visible.
+ *
+ * @return the receiver's border visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public bool getBorderVisible() {
+    checkWidget();
+    return borderLeft is 1;
+}
+public override Rectangle getClientArea() {
+    checkWidget();
+    if (minimized) return new Rectangle(xClient, yClient, 0, 0);
+    Point size = getSize();
+    int width = size.x  - borderLeft - borderRight - 2*marginWidth - 2*highlight_margin;
+    int height = size.y - borderTop - borderBottom - 2*marginHeight - highlight_margin - highlight_header;
+    height -= tabHeight;
+    return new Rectangle(xClient, yClient, width, height);
+}
+/**
+ * Return the tab that is located at the specified index.
+ *
+ * @param index the index of the tab item
+ * @return the item at the specified index
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is out of range</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ */
+public CTabItem getItem (int index) {
+    //checkWidget();
+    if (index  < 0 || index >= items.length)
+        SWT.error(SWT.ERROR_INVALID_RANGE);
+    return items [index];
+}
+/**
+ * Gets the item at a point in the widget.
+ *
+ * @param pt the point in coordinates relative to the CTabFolder
+ * @return the item at a point or null
+ *
+ * @exception SWTException <ul>
+ *      <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *      <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ *  </ul>
+ */
+public CTabItem getItem (Point pt) {
+    //checkWidget();
+    if (items.length is 0) return null;
+    Point size = getSize();
+    if (size.x <= borderLeft + borderRight) return null;
+    if (showChevron && chevronRect.contains(pt)) return null;
+    for (int i = 0; i < priority.length; i++) {
+        CTabItem item = items[priority[i]];
+        Rectangle rect = item.getBounds();
+        if (rect.contains(pt)) return item;
+    }
+    return null;
+}
+/**
+ * Return the number of tabs in the folder.
+ *
+ * @return the number of tabs in the folder
+ *
+ * @exception SWTException <ul>
+ *      <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *      <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ *  </ul>
+ */
+public int getItemCount(){
+    //checkWidget();
+    return items.length;
+}
+/**
+ * Return the tab items.
+ *
+ * @return the tab items
+ *
+ * @exception SWTException <ul>
+ *      <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *      <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ *  </ul>
+ */
+public CTabItem [] getItems() {
+    //checkWidget();
+    CTabItem[] tabItems = new CTabItem [items.length];
+    System.arraycopy(items, 0, tabItems, 0, items.length);
+    return tabItems;
+}
+/*
+ * Return the lowercase of the first non-'&' character following
+ * an '&' character in the given string. If there are no '&'
+ * characters in the given string, return '\0'.
+ */
+dchar _findMnemonic (String string) {
+    if (string is null) return '\0';
+    int index = 0;
+    int length_ = string.length;
+    do {
+        while (index < length_ && string[index] !is '&') index++;
+        if (++index >= length_) return '\0';
+        if (string[index] !is '&') return CharacterFirstToLower(string[index..$]);
+        index++;
+    } while (index < length_);
+    return '\0';
+}
+String stripMnemonic (String string) {
+    int index = 0;
+    int length_ = string.length;
+    do {
+        while ((index < length_) && (string[index] !is '&')) index++;
+        if (++index >= length_) return string;
+        if (string[index] !is '&') {
+            return string.substring(0, index-1) ~ string.substring(index, length_);
+        }
+        index++;
+    } while (index < length_);
+    return string;
+}
+/**
+ * Returns <code>true</code> if the receiver is minimized.
+ *
+ * @return the receiver's minimized state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public bool getMinimized() {
+    checkWidget();
+    return minimized;
+}
+/**
+ * Returns <code>true</code> if the minimize button
+ * is visible.
+ *
+ * @return the visibility of the minimized button
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public bool getMinimizeVisible() {
+    checkWidget();
+    return showMin;
+}
+/**
+ * Returns the number of characters that will
+ * appear in a fully compressed tab.
+ *
+ * @return number of characters that will appear in a fully compressed tab
+ *
+ * @since 3.0
+ */
+public int getMinimumCharacters() {
+    checkWidget();
+    return minChars;
+}
+/**
+ * Returns <code>true</code> if the receiver is maximized.
+ * <p>
+ *
+ * @return the receiver's maximized state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public bool getMaximized() {
+    checkWidget();
+    return maximized;
+}
+/**
+ * Returns <code>true</code> if the maximize button
+ * is visible.
+ *
+ * @return the visibility of the maximized button
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public bool getMaximizeVisible() {
+    checkWidget();
+    return showMax;
+}
+/**
+ * Returns <code>true</code> if the receiver displays most
+ * recently used tabs and <code>false</code> otherwise.
+ * <p>
+ * When there is not enough horizontal space to show all the tabs,
+ * by default, tabs are shown sequentially from left to right in
+ * order of their index.  When the MRU visibility is turned on,
+ * the tabs that are visible will be the tabs most recently selected.
+ * Tabs will still maintain their left to right order based on index
+ * but only the most recently selected tabs are visible.
+ * <p>
+ * For example, consider a CTabFolder that contains "Tab 1", "Tab 2",
+ * "Tab 3" and "Tab 4" (in order by index).  The user selects
+ * "Tab 1" and then "Tab 3".  If the CTabFolder is now
+ * compressed so that only two tabs are visible, by default,
+ * "Tab 2" and "Tab 3" will be shown ("Tab 3" since it is currently
+ * selected and "Tab 2" because it is the previous item in index order).
+ * If MRU visibility is enabled, the two visible tabs will be "Tab 1"
+ * and "Tab 3" (in that order from left to right).</p>
+ *
+ * @return the receiver's header's visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public bool getMRUVisible() {
+    checkWidget();
+    return mru;
+}
+int getRightItemEdge (){
+    int x = getSize().x - borderRight - 3;
+    if (showMin) x -= BUTTON_SIZE;
+    if (showMax) x -= BUTTON_SIZE;
+    if (showChevron) x -= 3*BUTTON_SIZE/2;
+    if (topRight !is null && topRightAlignment !is SWT.FILL) {
+        Point rightSize = topRight.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+        x -= rightSize.x + 3;
+    }
+    return Math.max(0, x);
+}
+/**
+ * Return the selected tab item, or null if there is no selection.
+ *
+ * @return the selected tab item, or null if none has been selected
+ *
+ * @exception SWTException <ul>
+ *      <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *      <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ *  </ul>
+ */
+public CTabItem getSelection() {
+    //checkWidget();
+    if (selectedIndex is -1) return null;
+    return items[selectedIndex];
+}
+/**
+ * Returns the receiver's selection background color.
+ *
+ * @return the selection background color of the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public Color getSelectionBackground() {
+    checkWidget();
+    return selectionBackground;
+}
+/**
+ * Returns the receiver's selection foreground color.
+ *
+ * @return the selection foreground color of the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public Color getSelectionForeground() {
+    checkWidget();
+    return selectionForeground;
+}
+/**
+ * Return the index of the selected tab item, or -1 if there
+ * is no selection.
+ *
+ * @return the index of the selected tab item or -1
+ *
+ * @exception SWTException <ul>
+ *      <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *      <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ *  </ul>
+ */
+public int getSelectionIndex() {
+    //checkWidget();
+    return selectedIndex;
+}
+/**
+ * Returns <code>true</code> if the CTabFolder is rendered
+ * with a simple, traditional shape.
+ *
+ * @return <code>true</code> if the CTabFolder is rendered with a simple shape
+ *
+ * @since 3.0
+ */
+public bool getSimple() {
+    checkWidget();
+    return simple;
+}
+/**
+ * Returns <code>true</code> if the CTabFolder only displays the selected tab
+ * and <code>false</code> if the CTabFolder displays multiple tabs.
+ *
+ * @return <code>true</code> if the CTabFolder only displays the selected tab and <code>false</code> if the CTabFolder displays multiple tabs
+ *
+ * @since 3.0
+ */
+public bool getSingle() {
+    checkWidget();
+    return single;
+}
+
+public override int getStyle() {
+    int style = super.getStyle();
+    style &= ~(SWT.TOP | SWT.BOTTOM);
+    style |= onBottom ? SWT.BOTTOM : SWT.TOP;
+    style &= ~(SWT.SINGLE | SWT.MULTI);
+    style |= single ? SWT.SINGLE : SWT.MULTI;
+    if (borderLeft !is 0) style |= SWT.BORDER;
+    style &= ~SWT.CLOSE;
+    if (showClose) style |= SWT.CLOSE;
+    return style;
+}
+/**
+ * Returns the height of the tab
+ *
+ * @return the height of the tab
+ *
+ * @exception SWTException <ul>
+ *      <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *      <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ *  </ul>
+ */
+public int getTabHeight(){
+    checkWidget();
+    if (fixedTabHeight !is SWT.DEFAULT) return fixedTabHeight;
+    return tabHeight - 1; // -1 for line drawn across top of tab
+}
+/**
+ * Returns the position of the tab.  Possible values are SWT.TOP or SWT.BOTTOM.
+ *
+ * @return the position of the tab
+ *
+ * @exception SWTException <ul>
+ *      <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *      <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ *  </ul>
+ */
+public int getTabPosition(){
+    checkWidget();
+    return onBottom ? SWT.BOTTOM : SWT.TOP;
+}
+/**
+ * Returns the control in the top right corner of the tab folder.
+ * Typically this is a close button or a composite with a menu and close button.
+ *
+ * @return the control in the top right corner of the tab folder or null
+ *
+ * @exception  SWTException <ul>
+ *      <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *      <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ *  </ul>
+ *
+ * @since 2.1
+ */
+public Control getTopRight() {
+    checkWidget();
+    return topRight;
+}
+/**
+ * Returns <code>true</code> if the close button appears
+ * when the user hovers over an unselected tabs.
+ *
+ * @return <code>true</code> if the close button appears on unselected tabs
+ *
+ * @since 3.0
+ */
+public bool getUnselectedCloseVisible() {
+    checkWidget();
+    return showUnselectedClose;
+}
+/**
+ * Returns <code>true</code> if an image appears
+ * in unselected tabs.
+ *
+ * @return <code>true</code> if an image appears in unselected tabs
+ *
+ * @since 3.0
+ */
+public bool getUnselectedImageVisible() {
+    checkWidget();
+    return showUnselectedImage;
+}
+/**
+ * Return the index of the specified tab or -1 if the tab is not
+ * in the receiver.
+ *
+ * @param item the tab item for which the index is required
+ *
+ * @return the index of the specified tab item or -1
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ */
+public int indexOf(CTabItem item) {
+    checkWidget();
+    if (item is null) {
+        SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    }
+    for (int i = 0; i < items.length; i++) {
+        if (items[i] is item) return i;
+    }
+    return -1;
+}
+void initAccessible() {
+    Accessible accessible = getAccessible();
+    accessible.addAccessibleListener(new class() AccessibleAdapter {
+        public void getName(AccessibleEvent e) {
+            String name = null;
+            int childID = e.childID;
+            if (childID >= 0 && childID < items.length) {
+                name = stripMnemonic(items[childID].getText());
+            } else if (childID is items.length + CHEVRON_CHILD_ID) {
+                name = SWT.getMessage("SWT_ShowList"); //$NON-NLS-1$
+            } else if (childID is items.length + MINIMIZE_CHILD_ID) {
+                name = minimized ? SWT.getMessage("SWT_Restore") : SWT.getMessage("SWT_Minimize"); //$NON-NLS-1$ //$NON-NLS-2$
+            } else if (childID is items.length + MAXIMIZE_CHILD_ID) {
+                name = maximized ? SWT.getMessage("SWT_Restore") : SWT.getMessage("SWT_Maximize"); //$NON-NLS-1$ //$NON-NLS-2$
+            }
+            e.result = name;
+        }
+
+        public void getHelp(AccessibleEvent e) {
+            String help = null;
+            int childID = e.childID;
+            if (childID is ACC.CHILDID_SELF) {
+                help = getToolTipText();
+            } else if (childID >= 0 && childID < items.length) {
+                help = items[childID].getToolTipText();
+            }
+            e.result = help;
+        }
+
+        public void getKeyboardShortcut(AccessibleEvent e) {
+            String shortcut = null;
+            int childID = e.childID;
+            if (childID >= 0 && childID < items.length) {
+                String text = items[childID].getText();
+                if (text !is null) {
+                    dchar mnemonic = _findMnemonic(text);
+                    if (mnemonic !is '\0') {
+                        shortcut = "Alt+"~tango.text.convert.Utf.toString([mnemonic]); //$NON-NLS-1$
+                    }
+                }
+            }
+            e.result = shortcut;
+        }
+    });
+
+    accessible.addAccessibleControlListener(new class() AccessibleControlAdapter {
+        public void getChildAtPoint(AccessibleControlEvent e) {
+            Point testPoint = toControl(e.x, e.y);
+            int childID = ACC.CHILDID_NONE;
+            for (int i = 0; i < items.length; i++) {
+                if (items[i].getBounds().contains(testPoint)) {
+                    childID = i;
+                    break;
+                }
+            }
+            if (childID is ACC.CHILDID_NONE) {
+                if (showChevron && chevronRect.contains(testPoint)) {
+                    childID = items.length + CHEVRON_CHILD_ID;
+                } else if (showMin && minRect.contains(testPoint)) {
+                    childID = items.length + MINIMIZE_CHILD_ID;
+                } else if (showMax && maxRect.contains(testPoint)) {
+                    childID = items.length + MAXIMIZE_CHILD_ID;
+                } else {
+                    Rectangle location = getBounds();
+                    location.height = location.height - getClientArea().height;
+                    if (location.contains(testPoint)) {
+                        childID = ACC.CHILDID_SELF;
+                    }
+                }
+            }
+            e.childID = childID;
+        }
+
+        public void getLocation(AccessibleControlEvent e) {
+            Rectangle location = null;
+            Point pt = null;
+            int childID = e.childID;
+            if (childID is ACC.CHILDID_SELF) {
+                location = getBounds();
+                pt = getParent().toDisplay(location.x, location.y);
+            } else {
+                if (childID >= 0 && childID < items.length && items[childID].isShowing()) {
+                    location = items[childID].getBounds();
+                } else if (showChevron && childID is items.length + CHEVRON_CHILD_ID) {
+                    location = chevronRect;
+                } else if (showMin && childID is items.length + MINIMIZE_CHILD_ID) {
+                    location = minRect;
+                } else if (showMax && childID is items.length + MAXIMIZE_CHILD_ID) {
+                    location = maxRect;
+                }
+                if (location !is null) {
+                    pt = toDisplay(location.x, location.y);
+                }
+            }
+            if (location !is null && pt !is null) {
+                e.x = pt.x;
+                e.y = pt.y;
+                e.width = location.width;
+                e.height = location.height;
+            }
+        }
+
+        public void getChildCount(AccessibleControlEvent e) {
+            e.detail = items.length + EXTRA_CHILD_ID_COUNT;
+        }
+
+        public void getDefaultAction(AccessibleControlEvent e) {
+            String action = null;
+            int childID = e.childID;
+            if (childID >= 0 && childID < items.length) {
+                action = SWT.getMessage ("SWT_Switch"); //$NON-NLS-1$
+            }
+            if (childID >= items.length && childID < items.length + EXTRA_CHILD_ID_COUNT) {
+                action = SWT.getMessage ("SWT_Press"); //$NON-NLS-1$
+            }
+            e.result = action;
+        }
+
+        public void getFocus(AccessibleControlEvent e) {
+            int childID = ACC.CHILDID_NONE;
+            if (isFocusControl()) {
+                if (selectedIndex is -1) {
+                    childID = ACC.CHILDID_SELF;
+                } else {
+                    childID = selectedIndex;
+                }
+            }
+            e.childID = childID;
+        }
+
+        public void getRole(AccessibleControlEvent e) {
+            int role = 0;
+            int childID = e.childID;
+            if (childID is ACC.CHILDID_SELF) {
+                role = ACC.ROLE_TABFOLDER;
+            } else if (childID >= 0 && childID < items.length) {
+                role = ACC.ROLE_TABITEM;
+            } else if (childID >= items.length && childID < items.length + EXTRA_CHILD_ID_COUNT) {
+                role = ACC.ROLE_PUSHBUTTON;
+            }
+            e.detail = role;
+        }
+
+        public void getSelection(AccessibleControlEvent e) {
+            e.childID = (selectedIndex is -1) ? ACC.CHILDID_NONE : selectedIndex;
+        }
+
+        public void getState(AccessibleControlEvent e) {
+            int state = 0;
+            int childID = e.childID;
+            if (childID is ACC.CHILDID_SELF) {
+                state = ACC.STATE_NORMAL;
+            } else if (childID >= 0 && childID < items.length) {
+                state = ACC.STATE_SELECTABLE;
+                if (isFocusControl()) {
+                    state |= ACC.STATE_FOCUSABLE;
+                }
+                if (selectedIndex is childID) {
+                    state |= ACC.STATE_SELECTED;
+                    if (isFocusControl()) {
+                        state |= ACC.STATE_FOCUSED;
+                    }
+                }
+            } else if (childID is items.length + CHEVRON_CHILD_ID) {
+                state = showChevron ? ACC.STATE_NORMAL : ACC.STATE_INVISIBLE;
+            } else if (childID is items.length + MINIMIZE_CHILD_ID) {
+                state = showMin ? ACC.STATE_NORMAL : ACC.STATE_INVISIBLE;
+            } else if (childID is items.length + MAXIMIZE_CHILD_ID) {
+                state = showMax ? ACC.STATE_NORMAL : ACC.STATE_INVISIBLE;
+            }
+            e.detail = state;
+        }
+
+        public void getChildren(AccessibleControlEvent e) {
+            int childIdCount = items.length + EXTRA_CHILD_ID_COUNT;
+            Object[] children = new Object[childIdCount];
+            for (int i = 0; i < childIdCount; i++) {
+                children[i] = new Integer(i);
+            }
+            e.children = children;
+        }
+    });
+
+    addListener(SWT.Selection, new class(accessible) Listener {
+        Accessible acc;
+        this( Accessible a ){
+            this.acc = a;
+        }
+        public void handleEvent(Event event) {
+            if (isFocusControl()) {
+                if (selectedIndex is -1) {
+                    acc.setFocus(ACC.CHILDID_SELF);
+                } else {
+                    acc.setFocus(selectedIndex);
+                }
+            }
+        }
+    });
+
+    addListener(SWT.FocusIn, new class(accessible) Listener {
+        Accessible acc;
+        this( Accessible a ){ this.acc = a; }
+        public void handleEvent(Event event) {
+            if (selectedIndex is -1) {
+                acc.setFocus(ACC.CHILDID_SELF);
+            } else {
+                acc.setFocus(selectedIndex);
+            }
+        }
+    });
+}
+
+void onKeyDown (Event event) {
+    switch (event.keyCode) {
+        case SWT.ARROW_LEFT:
+        case SWT.ARROW_RIGHT:
+            int count = items.length;
+            if (count is 0) return;
+            if (selectedIndex  is -1) return;
+            int leadKey = (getStyle() & SWT.RIGHT_TO_LEFT) !is 0 ? SWT.ARROW_RIGHT : SWT.ARROW_LEFT;
+            int offset =  event.keyCode is leadKey ? -1 : 1;
+            int index;
+            if (!mru) {
+                index = selectedIndex + offset;
+            } else {
+                int[] visible = new int[items.length];
+                int idx = 0;
+                int current = -1;
+                for (int i = 0; i < items.length; i++) {
+                    if (items[i].showing) {
+                        if (i is selectedIndex) current = idx;
+                        visible [idx++] = i;
+                    }
+                }
+                if (current + offset >= 0 && current + offset < idx){
+                    index = visible [current + offset];
+                } else {
+                    if (showChevron) {
+                        CTabFolderEvent e = new CTabFolderEvent(this);
+                        e.widget = this;
+                        e.time = event.time;
+                        e.x = chevronRect.x;
+                        e.y = chevronRect.y;
+                        e.width = chevronRect.width;
+                        e.height = chevronRect.height;
+                        e.doit = true;
+                        for (int i = 0; i < folderListeners.length; i++) {
+                            folderListeners[i].showList(e);
+                        }
+                        if (e.doit && !isDisposed()) {
+                            showList(chevronRect);
+                        }
+                    }
+                    return;
+                }
+            }
+            if (index < 0 || index >= count) return;
+            setSelection (index, true);
+            forceFocus();
+        default:
+    }
+}
+void onDispose(Event event) {
+    removeListener(SWT.Dispose, listener);
+    notifyListeners(SWT.Dispose, event);
+    event.type = SWT.None;
+    /*
+     * Usually when an item is disposed, destroyItem will change the size of the items array,
+     * reset the bounds of all the tabs and manage the widget associated with the tab.
+     * Since the whole folder is being disposed, this is not necessary.  For speed
+     * the inDispose flag is used to skip over this part of the item dispose.
+     */
+    inDispose = true;
+
+    if (showMenu !is null && !showMenu.isDisposed()) {
+        showMenu.dispose();
+        showMenu = null;
+    }
+    int length = items.length;
+    for (int i = 0; i < length; i++) {
+        if (items[i] !is null) {
+            items[i].dispose();
+        }
+    }
+
+    selectionGradientColors = null;
+    selectionGradientPercents = null;
+    selectionBgImage = null;
+
+    selectionBackground = null;
+    selectionForeground = null;
+    disposeSelectionHighlightGradientColors();
+}
+void onDragDetect(Event event) {
+    bool consume = false;
+    if (chevronRect.contains(event.x, event.y) ||
+        minRect.contains(event.x, event.y) ||
+        maxRect.contains(event.x, event.y)){
+        consume = true;
+    } else {
+        for (int i = 0; i < items.length; i++) {
+            if (items[i].closeRect.contains(event.x, event.y)) {
+                    consume = true;
+                    break;
+            }
+        }
+    }
+    if (consume) {
+        event.type = SWT.None;
+    }
+}
+void onFocus(Event event) {
+    checkWidget();
+    if (selectedIndex >= 0) {
+        redraw();
+    } else {
+        setSelection(0, true);
+    }
+}
+bool onMnemonic (Event event) {
+    auto key = event.character;
+    for (int i = 0; i < items.length; i++) {
+        if (items[i] !is null) {
+            auto mnemonic = _findMnemonic (items[i].getText ());
+            if (mnemonic !is '\0') {
+                if ( CharacterToLower(key) is mnemonic) {
+                    setSelection(i, true);
+                    return true;
+                }
+            }
+        }
+    }
+    return false;
+}
+void onMouseDoubleClick(Event event) {
+    if (event.button !is 1 ||
+        (event.stateMask & SWT.BUTTON2) !is 0 ||
+        (event.stateMask & SWT.BUTTON3) !is 0) return;
+    Event e = new Event();
+    e.item = getItem(new Point(event.x, event.y));
+    if (e.item !is null) {
+        notifyListeners(SWT.DefaultSelection, e);
+    }
+}
+void onMouse(Event event) {
+    int x = event.x, y = event.y;
+    switch (event.type) {
+        case SWT.MouseEnter: {
+            setToolTipText(null);
+            break;
+        }
+        case SWT.MouseExit: {
+            if (minImageState !is NORMAL) {
+                minImageState = NORMAL;
+                redraw(minRect.x, minRect.y, minRect.width, minRect.height, false);
+            }
+            if (maxImageState !is NORMAL) {
+                maxImageState = NORMAL;
+                redraw(maxRect.x, maxRect.y, maxRect.width, maxRect.height, false);
+            }
+            if (chevronImageState !is NORMAL) {
+                chevronImageState = NORMAL;
+                redraw(chevronRect.x, chevronRect.y, chevronRect.width, chevronRect.height, false);
+            }
+            for (int i=0; i<items.length; i++) {
+                CTabItem item = items[i];
+                if (i !is selectedIndex && item.closeImageState !is NONE) {
+                    item.closeImageState = NONE;
+                    redraw(item.closeRect.x, item.closeRect.y, item.closeRect.width, item.closeRect.height, false);
+                }
+                if (i is selectedIndex && item.closeImageState !is NORMAL) {
+                    item.closeImageState = NORMAL;
+                    redraw(item.closeRect.x, item.closeRect.y, item.closeRect.width, item.closeRect.height, false);
+                }
+            }
+            break;
+        }
+        case SWT.MouseDown: {
+            if (minRect.contains(x, y)) {
+                if (event.button !is 1) return;
+                minImageState = SELECTED;
+                redraw(minRect.x, minRect.y, minRect.width, minRect.height, false);
+                update();
+                return;
+            }
+            if (maxRect.contains(x, y)) {
+                if (event.button !is 1) return;
+                maxImageState = SELECTED;
+                redraw(maxRect.x, maxRect.y, maxRect.width, maxRect.height, false);
+                update();
+                return;
+            }
+            if (chevronRect.contains(x, y)) {
+                if (event.button !is 1) return;
+                if (chevronImageState !is HOT) {
+                    chevronImageState = HOT;
+                } else {
+                    chevronImageState = SELECTED;
+                }
+                redraw(chevronRect.x, chevronRect.y, chevronRect.width, chevronRect.height, false);
+                update();
+                return;
+            }
+            CTabItem item = null;
+            if (single) {
+                if (selectedIndex !is -1) {
+                    Rectangle bounds = items[selectedIndex].getBounds();
+                    if (bounds.contains(x, y)){
+                        item = items[selectedIndex];
+                    }
+                }
+            } else {
+                for (int i=0; i<items.length; i++) {
+                    Rectangle bounds = items[i].getBounds();
+                    if (bounds.contains(x, y)){
+                        item = items[i];
+                    }
+                }
+            }
+            if (item !is null) {
+                if (item.closeRect.contains(x,y)){
+                    if (event.button !is 1) return;
+                    item.closeImageState = SELECTED;
+                    redraw(item.closeRect.x, item.closeRect.y, item.closeRect.width, item.closeRect.height, false);
+                    update();
+                    return;
+                }
+                int index = indexOf(item);
+                if (item.showing){
+                    setSelection(index, true);
+                }
+                return;
+            }
+            break;
+        }
+        case SWT.MouseMove: {
+            _setToolTipText(event.x, event.y);
+            bool close = false, minimize = false, maximize = false, chevron = false;
+            if (minRect.contains(x, y)) {
+                minimize = true;
+                if (minImageState !is SELECTED && minImageState !is HOT) {
+                    minImageState = HOT;
+                    redraw(minRect.x, minRect.y, minRect.width, minRect.height, false);
+                }
+            }
+            if (maxRect.contains(x, y)) {
+                maximize = true;
+                if (maxImageState !is SELECTED && maxImageState !is HOT) {
+                    maxImageState = HOT;
+                    redraw(maxRect.x, maxRect.y, maxRect.width, maxRect.height, false);
+                }
+            }
+            if (chevronRect.contains(x, y)) {
+                chevron = true;
+                if (chevronImageState !is SELECTED && chevronImageState !is HOT) {
+                    chevronImageState = HOT;
+                    redraw(chevronRect.x, chevronRect.y, chevronRect.width, chevronRect.height, false);
+                }
+            }
+            if (minImageState !is NORMAL && !minimize) {
+                minImageState = NORMAL;
+                redraw(minRect.x, minRect.y, minRect.width, minRect.height, false);
+            }
+            if (maxImageState !is NORMAL && !maximize) {
+                maxImageState = NORMAL;
+                redraw(maxRect.x, maxRect.y, maxRect.width, maxRect.height, false);
+            }
+            if (chevronImageState !is NORMAL && !chevron) {
+                chevronImageState = NORMAL;
+                redraw(chevronRect.x, chevronRect.y, chevronRect.width, chevronRect.height, false);
+            }
+            for (int i=0; i<items.length; i++) {
+                CTabItem item = items[i];
+                close = false;
+                if (item.getBounds().contains(x, y)) {
+                    close = true;
+                    if (item.closeRect.contains(x, y)) {
+                        if (item.closeImageState !is SELECTED && item.closeImageState !is HOT) {
+                            item.closeImageState = HOT;
+                            redraw(item.closeRect.x, item.closeRect.y, item.closeRect.width, item.closeRect.height, false);
+                        }
+                    } else {
+                        if (item.closeImageState !is NORMAL) {
+                            item.closeImageState = NORMAL;
+                            redraw(item.closeRect.x, item.closeRect.y, item.closeRect.width, item.closeRect.height, false);
+                        }
+                    }
+                }
+                if (i !is selectedIndex && item.closeImageState !is NONE && !close) {
+                    item.closeImageState = NONE;
+                    redraw(item.closeRect.x, item.closeRect.y, item.closeRect.width, item.closeRect.height, false);
+                }
+                if (i is selectedIndex && item.closeImageState !is NORMAL && !close) {
+                    item.closeImageState = NORMAL;
+                    redraw(item.closeRect.x, item.closeRect.y, item.closeRect.width, item.closeRect.height, false);
+                }
+            }
+            break;
+        }
+        case SWT.MouseUp: {
+            if (event.button !is 1) return;
+            if (chevronRect.contains(x, y)) {
+                bool selected = chevronImageState is SELECTED;
+                if (!selected) return;
+                CTabFolderEvent e = new CTabFolderEvent(this);
+                e.widget = this;
+                e.time = event.time;
+                e.x = chevronRect.x;
+                e.y = chevronRect.y;
+                e.width = chevronRect.width;
+                e.height = chevronRect.height;
+                e.doit = true;
+                for (int i = 0; i < folderListeners.length; i++) {
+                    folderListeners[i].showList(e);
+                }
+                if (e.doit && !isDisposed()) {
+                    showList(chevronRect);
+                }
+                return;
+            }
+            if (minRect.contains(x, y)) {
+                bool selected = minImageState is SELECTED;
+                minImageState = HOT;
+                redraw(minRect.x, minRect.y, minRect.width, minRect.height, false);
+                if (!selected) return;
+                CTabFolderEvent e = new CTabFolderEvent(this);
+                e.widget = this;
+                e.time = event.time;
+                for (int i = 0; i < folderListeners.length; i++) {
+                    if (minimized) {
+                        folderListeners[i].restore(e);
+                    } else {
+                        folderListeners[i].minimize(e);
+                    }
+                }
+                return;
+            }
+            if (maxRect.contains(x, y)) {
+                bool selected = maxImageState is SELECTED;
+                maxImageState = HOT;
+                redraw(maxRect.x, maxRect.y, maxRect.width, maxRect.height, false);
+                if (!selected) return;
+                CTabFolderEvent e = new CTabFolderEvent(this);
+                e.widget = this;
+                e.time = event.time;
+                for (int i = 0; i < folderListeners.length; i++) {
+                    if (maximized) {
+                        folderListeners[i].restore(e);
+                    } else {
+                        folderListeners[i].maximize(e);
+                    }
+                }
+                return;
+            }
+            CTabItem item = null;
+            if (single) {
+                if (selectedIndex !is -1) {
+                    Rectangle bounds = items[selectedIndex].getBounds();
+                    if (bounds.contains(x, y)){
+                        item = items[selectedIndex];
+                    }
+                }
+            } else {
+                for (int i=0; i<items.length; i++) {
+                    Rectangle bounds = items[i].getBounds();
+                    if (bounds.contains(x, y)){
+                        item = items[i];
+                    }
+                }
+            }
+            if (item !is null) {
+                if (item.closeRect.contains(x,y)) {
+                    bool selected = item.closeImageState is SELECTED;
+                    item.closeImageState = HOT;
+                    redraw(item.closeRect.x, item.closeRect.y, item.closeRect.width, item.closeRect.height, false);
+                    if (!selected) return;
+                    CTabFolderEvent e = new CTabFolderEvent(this);
+                    e.widget = this;
+                    e.time = event.time;
+                    e.item = item;
+                    e.doit = true;
+                    for (int j = 0; j < folderListeners.length; j++) {
+                        CTabFolder2Listener listener = folderListeners[j];
+                        listener.close(e);
+                    }
+                    for (int j = 0; j < tabListeners.length; j++) {
+                        CTabFolderListener listener = tabListeners[j];
+                        listener.itemClosed(e);
+                    }
+                    if (e.doit) item.dispose();
+                    if (!isDisposed() && item.isDisposed()) {
+                        Display display = getDisplay();
+                        Point pt = display.getCursorLocation();
+                        pt = display.map(null, this, pt.x, pt.y);
+                        CTabItem nextItem = getItem(pt);
+                        if (nextItem !is null) {
+                            if (nextItem.closeRect.contains(pt)) {
+                                if (nextItem.closeImageState !is SELECTED && nextItem.closeImageState !is HOT) {
+                                    nextItem.closeImageState = HOT;
+                                    redraw(nextItem.closeRect.x, nextItem.closeRect.y, nextItem.closeRect.width, nextItem.closeRect.height, false);
+                                }
+                            } else {
+                                if (nextItem.closeImageState !is NORMAL) {
+                                    nextItem.closeImageState = NORMAL;
+                                    redraw(nextItem.closeRect.x, nextItem.closeRect.y, nextItem.closeRect.width, nextItem.closeRect.height, false);
+                                }
+                            }
+                        }
+                    }
+                    return;
+                }
+            }
+        default:
+        }
+    }
+}
+bool onPageTraversal(Event event) {
+    int count = items.length;
+    if (count is 0) return false;
+    int index = selectedIndex;
+    if (index  is -1) {
+        index = 0;
+    } else {
+        int offset = (event.detail is SWT.TRAVERSE_PAGE_NEXT) ? 1 : -1;
+        if (!mru) {
+            index = (selectedIndex + offset + count) % count;
+        } else {
+            int[] visible = new int[items.length];
+            int idx = 0;
+            int current = -1;
+            for (int i = 0; i < items.length; i++) {
+                if (items[i].showing) {
+                    if (i is selectedIndex) current = idx;
+                    visible [idx++] = i;
+                }
+            }
+            if (current + offset >= 0 && current + offset < idx){
+                index = visible [current + offset];
+            } else {
+                if (showChevron) {
+                    CTabFolderEvent e = new CTabFolderEvent(this);
+                    e.widget = this;
+                    e.time = event.time;
+                    e.x = chevronRect.x;
+                    e.y = chevronRect.y;
+                    e.width = chevronRect.width;
+                    e.height = chevronRect.height;
+                    e.doit = true;
+                    for (int i = 0; i < folderListeners.length; i++) {
+                        folderListeners[i].showList(e);
+                    }
+                    if (e.doit && !isDisposed()) {
+                        showList(chevronRect);
+                    }
+                }
+                return true;
+            }
+        }
+    }
+    setSelection (index, true);
+    return true;
+}
+void onPaint(Event event) {
+    if (inDispose) return;
+    Font font = getFont();
+    if (oldFont is null || oldFont!=font) {
+        // handle case where  default font changes
+        oldFont = font;
+        if (!updateTabHeight(false)) {
+            updateItems();
+            redraw();
+            return;
+        }
+    }
+
+    GC gc = event.gc;
+    Font gcFont = gc.getFont();
+    Color gcBackground = gc.getBackground();
+    Color gcForeground = gc.getForeground();
+
+// Useful for debugging paint problems
+//{
+//Point size = getSize();
+//gc.setBackground(getDisplay().getSystemColor(SWT.COLOR_GREEN));
+//gc.fillRectangle(-10, -10, size.x + 20, size.y+20);
+//}
+
+    drawBody(event);
+
+    gc.setFont(gcFont);
+    gc.setForeground(gcForeground);
+    gc.setBackground(gcBackground);
+
+    drawTabArea(event);
+
+    gc.setFont(gcFont);
+    gc.setForeground(gcForeground);
+    gc.setBackground(gcBackground);
+}
+
+void onResize() {
+    if (updateItems()) redrawTabs();
+
+    Point size = getSize();
+    if (oldSize is null) {
+        redraw();
+    } else {
+        if (onBottom && size.y !is oldSize.y) {
+            redraw();
+        } else {
+            int x1 = Math.min(size.x, oldSize.x);
+            if (size.x !is oldSize.x) x1 -= borderRight + highlight_margin + 2;
+            if (!simple) x1 -= 5; // rounded top right corner
+            int y1 = Math.min(size.y, oldSize.y);
+            if (size.y !is oldSize.y) y1 -= borderBottom + highlight_margin;
+            int x2 = Math.max(size.x, oldSize.x);
+            int y2 = Math.max(size.y, oldSize.y);
+            redraw(0, y1, x2, y2 - y1, false);
+            redraw(x1, 0, x2 - x1, y2, false);
+        }
+    }
+    oldSize = size;
+}
+void onTraverse (Event event) {
+    switch (event.detail) {
+        case SWT.TRAVERSE_ESCAPE:
+        case SWT.TRAVERSE_RETURN:
+        case SWT.TRAVERSE_TAB_NEXT:
+        case SWT.TRAVERSE_TAB_PREVIOUS:
+            Control focusControl = getDisplay().getFocusControl();
+            if (focusControl is this) event.doit = true;
+            break;
+        case SWT.TRAVERSE_MNEMONIC:
+            event.doit = onMnemonic(event);
+            if (event.doit) event.detail = SWT.TRAVERSE_NONE;
+            break;
+        case SWT.TRAVERSE_PAGE_NEXT:
+        case SWT.TRAVERSE_PAGE_PREVIOUS:
+            event.doit = onPageTraversal(event);
+            event.detail = SWT.TRAVERSE_NONE;
+            break;
+        default:
+    }
+}
+void redrawTabs() {
+    Point size = getSize();
+    if (onBottom) {
+        redraw(0, size.y - borderBottom - tabHeight - highlight_header - 1, size.x, borderBottom + tabHeight + highlight_header + 1, false);
+    } else {
+        redraw(0, 0, size.x, borderTop + tabHeight + highlight_header + 1, false);
+    }
+}
+/**
+ * Removes the listener.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ *
+ * @see #addCTabFolder2Listener(CTabFolder2Listener)
+ *
+ * @since 3.0
+ */
+public void removeCTabFolder2Listener(CTabFolder2Listener listener) {
+    checkWidget();
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    if (folderListeners.length is 0) return;
+    int index = -1;
+    for (int i = 0; i < folderListeners.length; i++) {
+        if (listener is folderListeners[i]){
+            index = i;
+            break;
+        }
+    }
+    if (index is -1) return;
+    if (folderListeners.length is 1) {
+        folderListeners = new CTabFolder2Listener[0];
+        return;
+    }
+    CTabFolder2Listener[] newTabListeners = new CTabFolder2Listener[folderListeners.length - 1];
+    SimpleType!(CTabFolder2Listener).arraycopy(folderListeners, 0, newTabListeners, 0, index);
+    SimpleType!(CTabFolder2Listener).arraycopy(folderListeners, index + 1, newTabListeners, index, folderListeners.length - index - 1);
+    folderListeners = newTabListeners;
+}
+/**
+ * Removes the listener.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ *
+ * @deprecated see removeCTabFolderCloseListener(CTabFolderListener)
+ */
+public void removeCTabFolderListener(CTabFolderListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    if (tabListeners.length is 0) return;
+    int index = -1;
+    for (int i = 0; i < tabListeners.length; i++) {
+        if (listener is tabListeners[i]){
+            index = i;
+            break;
+        }
+    }
+    if (index is -1) return;
+    if (tabListeners.length is 1) {
+        tabListeners = new CTabFolderListener[0];
+        return;
+    }
+    CTabFolderListener[] newTabListeners = new CTabFolderListener[tabListeners.length - 1];
+    SimpleType!(CTabFolderListener).arraycopy(tabListeners, 0, newTabListeners, 0, index);
+    SimpleType!(CTabFolderListener).arraycopy(tabListeners, index + 1, newTabListeners, index, tabListeners.length - index - 1);
+    tabListeners = newTabListeners;
+}
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the user changes the receiver's selection.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener(SelectionListener listener) {
+    checkWidget();
+    if (listener is null) {
+        SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    }
+    removeListener(SWT.Selection, listener);
+    removeListener(SWT.DefaultSelection, listener);
+}
+public override void setBackground (Color color) {
+    super.setBackground(color);
+    redraw();
+}
+/**
+ * Specify a gradient of colours to be drawn in the background of the unselected tabs.
+ * For example to draw a gradient that varies from dark blue to blue and then to
+ * white, use the following call to setBackground:
+ * <pre>
+ *  cfolder.setBackground(new Color[]{display.getSystemColor(SWT.COLOR_DARK_BLUE),
+ *                                 display.getSystemColor(SWT.COLOR_BLUE),
+ *                                 display.getSystemColor(SWT.COLOR_WHITE),
+ *                                 display.getSystemColor(SWT.COLOR_WHITE)},
+ *                     new int[] {25, 50, 100});
+ * </pre>
+ *
+ * @param colors an array of Color that specifies the colors to appear in the gradient
+ *               in order of appearance left to right.  The value <code>null</code> clears the
+ *               background gradient. The value <code>null</code> can be used inside the array of
+ *               Color to specify the background color.
+ * @param percents an array of integers between 0 and 100 specifying the percent of the width
+ *                 of the widget at which the color should change.  The size of the percents array must be one
+ *                 less than the size of the colors array.
+ *
+ * @exception SWTException <ul>
+ *      <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *      <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ *  </ul>
+ *
+ * @since 3.0
+ */
+void setBackground(Color[] colors, int[] percents) {
+    setBackground(colors, percents, false);
+}
+/**
+ * Specify a gradient of colours to be drawn in the background of the unselected tab.
+ * For example to draw a vertical gradient that varies from dark blue to blue and then to
+ * white, use the following call to setBackground:
+ * <pre>
+ *  cfolder.setBackground(new Color[]{display.getSystemColor(SWT.COLOR_DARK_BLUE),
+ *                                 display.getSystemColor(SWT.COLOR_BLUE),
+ *                                 display.getSystemColor(SWT.COLOR_WHITE),
+ *                                 display.getSystemColor(SWT.COLOR_WHITE)},
+ *                        new int[] {25, 50, 100}, true);
+ * </pre>
+ *
+ * @param colors an array of Color that specifies the colors to appear in the gradient
+ *               in order of appearance left to right.  The value <code>null</code> clears the
+ *               background gradient. The value <code>null</code> can be used inside the array of
+ *               Color to specify the background color.
+ * @param percents an array of integers between 0 and 100 specifying the percent of the width
+ *                 of the widget at which the color should change.  The size of the percents array must be one
+ *                 less than the size of the colors array.
+ *
+ * @param vertical indicate the direction of the gradient.  True is vertical and false is horizontal.
+ *
+ * @exception SWTException <ul>
+ *      <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *      <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ *  </ul>
+ *
+ * @since 3.0
+ */
+void setBackground(Color[] colors, int[] percents, bool vertical) {
+    checkWidget();
+    if (colors !is null) {
+        if (percents is null || percents.length !is colors.length - 1) {
+            SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+        }
+        for (int i = 0; i < percents.length; i++) {
+            if (percents[i] < 0 || percents[i] > 100) {
+                SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+            }
+            if (i > 0 && percents[i] < percents[i-1]) {
+                SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+            }
+        }
+        if (getDisplay().getDepth() < 15) {
+            // Don't use gradients on low color displays
+            colors = [colors[colors.length - 1]];
+            percents = null;
+        }
+    }
+
+    // Are these settings the same as before?
+    if (bgImage is null) {
+        if ((gradientColors !is null) && (colors !is null) &&
+            (gradientColors.length is colors.length)) {
+            bool same = false;
+            for (int i = 0; i < gradientColors.length; i++) {
+                if (gradientColors[i] is null) {
+                    same = colors[i] is null;
+                } else {
+                    same = cast(bool)(gradientColors[i]==colors[i]);
+                }
+                if (!same) break;
+            }
+            if (same) {
+                for (int i = 0; i < gradientPercents.length; i++) {
+                    same = gradientPercents[i] is percents[i];
+                    if (!same) break;
+                }
+            }
+            if (same && this.gradientVertical is vertical) return;
+        }
+    } else {
+        bgImage = null;
+    }
+    // Store the new settings
+    if (colors is null) {
+        gradientColors = null;
+        gradientPercents = null;
+        gradientVertical = false;
+        setBackground(cast(Color)null);
+    } else {
+        gradientColors = new Color[colors.length];
+        for (int i = 0; i < colors.length; ++i) {
+            gradientColors[i] = colors[i];
+        }
+        gradientPercents = new int[percents.length];
+        for (int i = 0; i < percents.length; ++i) {
+            gradientPercents[i] = percents[i];
+        }
+        gradientVertical = vertical;
+        setBackground(gradientColors[gradientColors.length-1]);
+    }
+
+    // Refresh with the new settings
+    redraw();
+}
+
+/**
+ * Set the image to be drawn in the background of the unselected tab.  Image
+ * is stretched or compressed to cover entire unselected tab area.
+ *
+ * @param image the image to be drawn in the background
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+void setBackground(Image image) {
+    checkWidget();
+    if (image is bgImage) return;
+    if (image !is null) {
+        gradientColors = null;
+        gradientPercents = null;
+    }
+    bgImage = image;
+    redraw();
+}
+/**
+ * Toggle the visibility of the border
+ *
+ * @param show true if the border should be displayed
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setBorderVisible(bool show) {
+    checkWidget();
+    if ((borderLeft is 1) is show) return;
+    borderLeft = borderRight = show ? 1 : 0;
+    borderTop = onBottom ? borderLeft : 0;
+    borderBottom = onBottom ? 0 : borderLeft;
+    Rectangle rectBefore = getClientArea();
+    updateItems();
+    Rectangle rectAfter = getClientArea();
+    if (rectBefore!=rectAfter) {
+        notifyListeners(SWT.Resize, new Event());
+    }
+    redraw();
+}
+void setButtonBounds() {
+    Point size = getSize();
+    int oldX, oldY, oldWidth, oldHeight;
+    // max button
+    oldX = maxRect.x;
+    oldY = maxRect.y;
+    oldWidth = maxRect.width;
+    oldHeight = maxRect.height;
+    maxRect.x = maxRect.y = maxRect.width = maxRect.height = 0;
+    if (showMax) {
+        maxRect.x = size.x - borderRight - BUTTON_SIZE - 3;
+        if (borderRight > 0) maxRect.x += 1;
+        maxRect.y = onBottom ? size.y - borderBottom - tabHeight + (tabHeight - BUTTON_SIZE)/2: borderTop + (tabHeight - BUTTON_SIZE)/2;
+        maxRect.width = BUTTON_SIZE;
+        maxRect.height = BUTTON_SIZE;
+    }
+    if (oldX !is maxRect.x || oldWidth !is maxRect.width ||
+        oldY !is maxRect.y || oldHeight !is maxRect.height) {
+        int left = Math.min(oldX, maxRect.x);
+        int right = Math.max(oldX + oldWidth, maxRect.x + maxRect.width);
+        int top = onBottom ? size.y - borderBottom - tabHeight: borderTop + 1;
+        redraw(left, top, right - left, tabHeight, false);
+    }
+
+    // min button
+    oldX = minRect.x;
+    oldY = minRect.y;
+    oldWidth = minRect.width;
+    oldHeight = minRect.height;
+    minRect.x = minRect.y = minRect.width = minRect.height = 0;
+    if (showMin) {
+        minRect.x = size.x - borderRight - maxRect.width - BUTTON_SIZE - 3;
+        if (borderRight > 0) minRect.x += 1;
+        minRect.y = onBottom ? size.y - borderBottom - tabHeight + (tabHeight - BUTTON_SIZE)/2: borderTop + (tabHeight - BUTTON_SIZE)/2;
+        minRect.width = BUTTON_SIZE;
+        minRect.height = BUTTON_SIZE;
+    }
+    if (oldX !is minRect.x || oldWidth !is minRect.width ||
+        oldY !is minRect.y || oldHeight !is minRect.height) {
+        int left = Math.min(oldX, minRect.x);
+        int right = Math.max(oldX + oldWidth, minRect.x + minRect.width);
+        int top = onBottom ? size.y - borderBottom - tabHeight: borderTop + 1;
+        redraw(left, top, right - left, tabHeight, false);
+    }
+
+    // top right control
+    oldX = topRightRect.x;
+    oldY = topRightRect.y;
+    oldWidth = topRightRect.width;
+    oldHeight = topRightRect.height;
+    topRightRect.x = topRightRect.y = topRightRect.width = topRightRect.height = 0;
+    if (topRight !is null) {
+        switch (topRightAlignment) {
+            case SWT.FILL: {
+                int rightEdge = size.x - borderRight - 3 - maxRect.width - minRect.width;
+                if (!simple && borderRight > 0 && !showMax && !showMin) rightEdge -= 2;
+                if (single) {
+                    if (items.length is 0 || selectedIndex is -1) {
+                        topRightRect.x = borderLeft + 3;
+                        topRightRect.width = rightEdge - topRightRect.x;
+                    } else {
+                        // fill size is 0 if item compressed
+                        CTabItem item = items[selectedIndex];
+                        if (item.x + item.width + 7 + 3*BUTTON_SIZE/2 >= rightEdge) break;
+                        topRightRect.x = item.x + item.width + 7 + 3*BUTTON_SIZE/2;
+                        topRightRect.width = rightEdge - topRightRect.x;
+                    }
+                } else {
+                    // fill size is 0 if chevron showing
+                    if (showChevron) break;
+                    if (items.length is 0) {
+                        topRightRect.x = borderLeft + 3;
+                    } else {
+                        CTabItem item = items[items.length - 1];
+                        topRightRect.x = item.x + item.width;
+                        if (!simple && items.length - 1 is selectedIndex) topRightRect.x += curveWidth - curveIndent;
+                    }
+                    topRightRect.width = Math.max(0, rightEdge - topRightRect.x);
+                }
+                topRightRect.y = onBottom ? size.y - borderBottom - tabHeight: borderTop + 1;
+                topRightRect.height = tabHeight - 1;
+                break;
+            }
+            case SWT.RIGHT: {
+                Point topRightSize = topRight.computeSize(SWT.DEFAULT, tabHeight, false);
+                int rightEdge = size.x - borderRight - 3 - maxRect.width - minRect.width;
+                if (!simple && borderRight > 0 && !showMax && !showMin) rightEdge -= 2;
+                topRightRect.x = rightEdge - topRightSize.x;
+                topRightRect.width = topRightSize.x;
+                topRightRect.y = onBottom ? size.y - borderBottom - tabHeight: borderTop + 1;
+                topRightRect.height = tabHeight - 1;
+            }
+            default:
+        }
+        topRight.setBounds(topRightRect);
+    }
+    if (oldX !is topRightRect.x || oldWidth !is topRightRect.width ||
+        oldY !is topRightRect.y || oldHeight !is topRightRect.height) {
+        int left = Math.min(oldX, topRightRect.x);
+        int right = Math.max(oldX + oldWidth, topRightRect.x + topRightRect.width);
+        int top = onBottom ? size.y - borderBottom - tabHeight : borderTop + 1;
+        redraw(left, top, right - left, tabHeight, false);
+    }
+
+    // chevron button
+    oldX = chevronRect.x;
+    oldY = chevronRect.y;
+    oldWidth = chevronRect.width;
+    oldHeight = chevronRect.height;
+    chevronRect.x = chevronRect.y = chevronRect.height = chevronRect.width = 0;
+    if (single) {
+        if (selectedIndex is -1 || items.length > 1) {
+            chevronRect.width = 3*BUTTON_SIZE/2;
+            chevronRect.height = BUTTON_SIZE;
+            chevronRect.y = onBottom ? size.y - borderBottom - tabHeight + (tabHeight - chevronRect.height)/2 : borderTop + (tabHeight - chevronRect.height)/2;
+            if (selectedIndex is -1) {
+                chevronRect.x = size.x - borderRight - 3 - minRect.width - maxRect.width - topRightRect.width - chevronRect.width;
+            } else {
+                CTabItem item = items[selectedIndex];
+                int w = size.x - borderRight - 3 - minRect.width - maxRect.width - chevronRect.width;
+                if (topRightRect.width > 0) w -= topRightRect.width + 3;
+                chevronRect.x = Math.min(item.x + item.width + 3, w);
+            }
+            if (borderRight > 0) chevronRect.x += 1;
+        }
+    } else {
+        if (showChevron) {
+            chevronRect.width = 3*BUTTON_SIZE/2;
+            chevronRect.height = BUTTON_SIZE;
+            int i = 0, lastIndex = -1;
+            while (i < priority.length && items[priority[i]].showing) {
+                lastIndex = Math.max(lastIndex, priority[i++]);
+            }
+            if (lastIndex is -1) lastIndex = firstIndex;
+            CTabItem lastItem = items[lastIndex];
+            int w = lastItem.x + lastItem.width + 3;
+            if (!simple && lastIndex is selectedIndex) w += curveWidth - 2*curveIndent;
+            chevronRect.x = Math.min(w, getRightItemEdge());
+            chevronRect.y = onBottom ? size.y - borderBottom - tabHeight + (tabHeight - chevronRect.height)/2 : borderTop + (tabHeight - chevronRect.height)/2;
+        }
+    }
+    if (oldX !is chevronRect.x || oldWidth !is chevronRect.width ||
+        oldY !is chevronRect.y || oldHeight !is chevronRect.height) {
+        int left = Math.min(oldX, chevronRect.x);
+        int right = Math.max(oldX + oldWidth, chevronRect.x + chevronRect.width);
+        int top = onBottom ? size.y - borderBottom - tabHeight: borderTop + 1;
+        redraw(left, top, right - left, tabHeight, false);
+    }
+}
+public override void setFont(Font font) {
+    checkWidget();
+    if (font !is null && font==getFont()) return;
+    super.setFont(font);
+    oldFont = getFont();
+    if (!updateTabHeight(false)) {
+        updateItems();
+        redraw();
+    }
+}
+public override void setForeground (Color color) {
+    super.setForeground(color);
+    redraw();
+}
+/**
+ * Display an insert marker before or after the specified tab item.
+ *
+ * A value of null will clear the mark.
+ *
+ * @param item the item with which the mark is associated or null
+ *
+ * @param after true if the mark should be displayed after the specified item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setInsertMark(CTabItem item, bool after) {
+    checkWidget();
+}
+/**
+ * Display an insert marker before or after the specified tab item.
+ *
+ * A value of -1 will clear the mark.
+ *
+ * @param index the index of the item with which the mark is associated or null
+ *
+ * @param after true if the mark should be displayed after the specified item
+ *
+ * @exception IllegalArgumentException<ul>
+ * </ul>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setInsertMark(int index, bool after) {
+    checkWidget();
+    if (index < -1 || index >= getItemCount()) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+}
+bool setItemLocation() {
+    bool changed = false;
+    if (items.length is 0) return false;
+    Point size = getSize();
+    int y = onBottom ? Math.max(borderBottom, size.y - borderBottom - tabHeight) : borderTop;
+    if (single) {
+        int defaultX = getDisplay().getBounds().width + 10; // off screen
+        for (int i = 0; i < items.length; i++) {
+            CTabItem item = items[i];
+            if (i is selectedIndex) {
+                firstIndex = selectedIndex;
+                int oldX = item.x, oldY = item.y;
+                item.x = borderLeft;
+                item.y = y;
+                item.showing = true;
+                if (showClose || item.showClose) {
+                    item.closeRect.x = borderLeft + CTabItem.LEFT_MARGIN;
+                    item.closeRect.y = onBottom ? size.y - borderBottom - tabHeight + (tabHeight - BUTTON_SIZE)/2: borderTop + (tabHeight - BUTTON_SIZE)/2;
+                }
+                if (item.x !is oldX || item.y !is oldY) changed = true;
+            } else {
+                item.x = defaultX;
+                item.showing = false;
+            }
+        }
+    } else {
+        int rightItemEdge = getRightItemEdge();
+        int maxWidth = rightItemEdge - borderLeft;
+        int width = 0;
+        for (int i = 0; i < priority.length; i++) {
+            CTabItem item = items[priority[i]];
+            width += item.width;
+            item.showing = i is 0 ? true : item.width > 0 && width <= maxWidth;
+            if (!simple && priority[i] is selectedIndex) width += curveWidth - 2*curveIndent;
+        }
+        int x = 0;
+        int defaultX = getDisplay().getBounds().width + 10; // off screen
+        firstIndex = items.length - 1;
+        for (int i = 0; i < items.length; i++) {
+            CTabItem item = items[i];
+            if (!item.showing) {
+                if (item.x !is defaultX) changed = true;
+                item.x = defaultX;
+            } else {
+                firstIndex = Math.min(firstIndex, i);
+                if (item.x !is x || item.y !is y) changed = true;
+                item.x = x;
+                item.y = y;
+                if (i is selectedIndex) {
+                    int edge = Math.min(item.x + item.width, rightItemEdge);
+                    item.closeRect.x = edge - CTabItem.RIGHT_MARGIN - BUTTON_SIZE;
+                } else {
+                    item.closeRect.x = item.x + item.width - CTabItem.RIGHT_MARGIN - BUTTON_SIZE;
+                }
+                item.closeRect.y = onBottom ? size.y - borderBottom - tabHeight + (tabHeight - BUTTON_SIZE)/2: borderTop + (tabHeight - BUTTON_SIZE)/2;
+                x = x + item.width;
+                if (!simple && i is selectedIndex) x += curveWidth - 2*curveIndent;
+            }
+        }
+    }
+    return changed;
+}
+bool setItemSize() {
+    bool changed = false;
+    if (isDisposed()) return changed;
+    Point size = getSize();
+    if (size.x <= 0 || size.y <= 0) return changed;
+    xClient = borderLeft + marginWidth + highlight_margin;
+    if (onBottom) {
+        yClient = borderTop + highlight_margin + marginHeight;
+    } else {
+        yClient = borderTop + tabHeight + highlight_header + marginHeight;
+    }
+    showChevron = false;
+    if (single) {
+        showChevron = true;
+        if (selectedIndex !is -1) {
+            CTabItem tab = items[selectedIndex];
+            GC gc = new GC(this);
+            int width = tab.preferredWidth(gc, true, false);
+            gc.dispose();
+            width = Math.min(width, getRightItemEdge() - borderLeft);
+            if (tab.height !is tabHeight || tab.width !is width) {
+                changed = true;
+                tab.shortenedText = null;
+                tab.shortenedTextWidth = 0;
+                tab.height = tabHeight;
+                tab.width = width;
+                tab.closeRect.width = tab.closeRect.height = 0;
+                if (showClose || tab.showClose) {
+                    tab.closeRect.width = BUTTON_SIZE;
+                    tab.closeRect.height = BUTTON_SIZE;
+                }
+            }
+        }
+        return changed;
+    }
+
+    if (items.length is 0) return changed;
+
+    int[] widths;
+    GC gc = new GC(this);
+    int tabAreaWidth = size.x - borderLeft - borderRight - 3;
+    if (showMin) tabAreaWidth -= BUTTON_SIZE;
+    if (showMax) tabAreaWidth -= BUTTON_SIZE;
+    if (topRightAlignment is SWT.RIGHT && topRight !is null) {
+        Point rightSize = topRight.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
+        tabAreaWidth -= rightSize.x + 3;
+    }
+    if (!simple) tabAreaWidth -= curveWidth - 2*curveIndent;
+    tabAreaWidth = Math.max(0, tabAreaWidth);
+
+    // First, try the minimum tab size at full compression.
+    int minWidth = 0;
+    int[] minWidths = new int[items.length];
+    for (int i = 0; i < priority.length; i++) {
+        int index = priority[i];
+        minWidths[index] = items[index].preferredWidth(gc, index is selectedIndex, true);
+        minWidth += minWidths[index];
+        if (minWidth > tabAreaWidth) break;
+    }
+    if (minWidth > tabAreaWidth) {
+        // full compression required and a chevron
+        showChevron = items.length > 1;
+        if (showChevron) tabAreaWidth -= 3*BUTTON_SIZE/2;
+        widths = minWidths;
+        int index = selectedIndex !is -1 ? selectedIndex : 0;
+        if (tabAreaWidth < widths[index]) {
+            widths[index] = Math.max(0, tabAreaWidth);
+        }
+    } else {
+        int maxWidth = 0;
+        int[] maxWidths = new int[items.length];
+        for (int i = 0; i < items.length; i++) {
+            maxWidths[i] = items[i].preferredWidth(gc, i is selectedIndex, false);
+            maxWidth += maxWidths[i];
+        }
+        if (maxWidth <= tabAreaWidth) {
+            // no compression required
+            widths = maxWidths;
+        } else {
+            // determine compression for each item
+            int extra = (tabAreaWidth - minWidth) / items.length;
+            while (true) {
+                int large = 0, totalWidth = 0;
+                for (int i = 0 ; i < items.length; i++) {
+                    if (maxWidths[i] > minWidths[i] + extra) {
+                        totalWidth += minWidths[i] + extra;
+                        large++;
+                    } else {
+                        totalWidth += maxWidths[i];
+                    }
+                }
+                if (totalWidth >= tabAreaWidth) {
+                    extra--;
+                    break;
+                }
+                if (large is 0 || tabAreaWidth - totalWidth < large) break;
+                extra++;
+            }
+            widths = new int[items.length];
+            for (int i = 0; i < items.length; i++) {
+                widths[i] = Math.min(maxWidths[i], minWidths[i] + extra);
+            }
+        }
+    }
+    gc.dispose();
+
+    for (int i = 0; i < items.length; i++) {
+        CTabItem tab = items[i];
+        int width = widths[i];
+        if (tab.height !is tabHeight || tab.width !is width) {
+            changed = true;
+            tab.shortenedText = null;
+            tab.shortenedTextWidth = 0;
+            tab.height = tabHeight;
+            tab.width = width;
+            tab.closeRect.width = tab.closeRect.height = 0;
+            if (showClose || tab.showClose) {
+                if (i is selectedIndex || showUnselectedClose) {
+                    tab.closeRect.width = BUTTON_SIZE;
+                    tab.closeRect.height = BUTTON_SIZE;
+                }
+            }
+        }
+    }
+    return changed;
+}
+/**
+ * Marks the receiver's maximize button as visible if the argument is <code>true</code>,
+ * and marks it invisible otherwise.
+ *
+ * @param visible the new visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setMaximizeVisible(bool visible) {
+    checkWidget();
+    if (showMax is visible) return;
+    // display maximize button
+    showMax = visible;
+    updateItems();
+    redraw();
+}
+/**
+ * Sets the layout which is associated with the receiver to be
+ * the argument which may be null.
+ * <p>
+ * Note: No Layout can be set on this Control because it already
+ * manages the size and position of its children.
+ * </p>
+ *
+ * @param layout the receiver's new layout or null
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public override void setLayout (Layout layout) {
+    checkWidget();
+    return;
+}
+/**
+ * Sets the maximized state of the receiver.
+ *
+ * @param maximize the new maximized state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setMaximized(bool maximize) {
+    checkWidget ();
+    if (this.maximized is maximize) return;
+    if (maximize && this.minimized) setMinimized(false);
+    this.maximized = maximize;
+    redraw(maxRect.x, maxRect.y, maxRect.width, maxRect.height, false);
+}
+/**
+ * Marks the receiver's minimize button as visible if the argument is <code>true</code>,
+ * and marks it invisible otherwise.
+ *
+ * @param visible the new visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setMinimizeVisible(bool visible) {
+    checkWidget();
+    if (showMin is visible) return;
+    // display minimize button
+    showMin = visible;
+    updateItems();
+    redraw();
+}
+/**
+ * Sets the minimized state of the receiver.
+ *
+ * @param minimize the new minimized state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setMinimized(bool minimize) {
+    checkWidget ();
+    if (this.minimized is minimize) return;
+    if (minimize && this.maximized) setMaximized(false);
+    this.minimized = minimize;
+    redraw(minRect.x, minRect.y, minRect.width, minRect.height, false);
+}
+
+/**
+ * Sets the minimum number of characters that will
+ * be displayed in a fully compressed tab.
+ *
+ * @param count the minimum number of characters that will be displayed in a fully compressed tab
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_INVALID_RANGE - if the count is less than zero</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setMinimumCharacters(int count) {
+    checkWidget ();
+    if (count < 0) SWT.error(SWT.ERROR_INVALID_RANGE);
+    if (minChars is count) return;
+    minChars = count;
+    if (updateItems()) redrawTabs();
+}
+
+/**
+ * When there is not enough horizontal space to show all the tabs,
+ * by default, tabs are shown sequentially from left to right in
+ * order of their index.  When the MRU visibility is turned on,
+ * the tabs that are visible will be the tabs most recently selected.
+ * Tabs will still maintain their left to right order based on index
+ * but only the most recently selected tabs are visible.
+ * <p>
+ * For example, consider a CTabFolder that contains "Tab 1", "Tab 2",
+ * "Tab 3" and "Tab 4" (in order by index).  The user selects
+ * "Tab 1" and then "Tab 3".  If the CTabFolder is now
+ * compressed so that only two tabs are visible, by default,
+ * "Tab 2" and "Tab 3" will be shown ("Tab 3" since it is currently
+ * selected and "Tab 2" because it is the previous item in index order).
+ * If MRU visibility is enabled, the two visible tabs will be "Tab 1"
+ * and "Tab 3" (in that order from left to right).</p>
+ *
+ * @param show the new visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void setMRUVisible(bool show) {
+    checkWidget();
+    if (mru is show) return;
+    mru = show;
+    if (!mru) {
+        int idx = firstIndex;
+        int next = 0;
+        for (int i = firstIndex; i < items.length; i++) {
+            priority[next++] = i;
+        }
+        for (int i = 0; i < idx; i++) {
+            priority[next++] = i;
+        }
+        if (updateItems()) redrawTabs();
+    }
+}
+/**
+ * Set the selection to the tab at the specified item.
+ *
+ * @param item the tab item to be selected
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ * </ul>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ * </ul>
+ */
+public void setSelection(CTabItem item) {
+    checkWidget();
+    if (item is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    int index = indexOf(item);
+    setSelection(index);
+}
+/**
+ * Set the selection to the tab at the specified index.
+ *
+ * @param index the index of the tab item to be selected
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection(int index) {
+    checkWidget();
+    if (index < 0 || index >= items.length) return;
+    CTabItem selection = items[index];
+    if (selectedIndex is index) {
+        showItem(selection);
+        return;
+    }
+
+    int oldIndex = selectedIndex;
+    selectedIndex = index;
+    if (oldIndex !is -1) {
+        items[oldIndex].closeImageState = NONE;
+    }
+    selection.closeImageState = NORMAL;
+    selection.showing = false;
+
+    Control newControl = selection.control;
+    Control oldControl = null;
+    if (oldIndex !is -1) {
+        oldControl = items[oldIndex].control;
+    }
+
+    if (newControl !is oldControl) {
+        if (newControl !is null && !newControl.isDisposed()) {
+            newControl.setBounds(getClientArea());
+            newControl.setVisible(true);
+        }
+        if (oldControl !is null && !oldControl.isDisposed()) {
+            oldControl.setVisible(false);
+        }
+    }
+    showItem(selection);
+    redraw();
+}
+void setSelection(int index, bool notify) {
+    int oldSelectedIndex = selectedIndex;
+    setSelection(index);
+    if (notify && selectedIndex !is oldSelectedIndex && selectedIndex !is -1) {
+        Event event = new Event();
+        event.item = getItem(selectedIndex);
+        notifyListeners(SWT.Selection, event);
+    }
+}
+/**
+ * Sets the receiver's selection background color to the color specified
+ * by the argument, or to the default system color for the control
+ * if the argument is null.
+ *
+ * @param color the new color (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setSelectionBackground (Color color) {
+    checkWidget();
+    setSelectionHighlightGradientColor(null);
+    if (selectionBackground is color) return;
+    if (color is null) color = getDisplay().getSystemColor(SELECTION_BACKGROUND);
+    selectionBackground = color;
+    if (selectedIndex > -1) redraw();
+}
+/**
+ * Specify a gradient of colours to be draw in the background of the selected tab.
+ * For example to draw a gradient that varies from dark blue to blue and then to
+ * white, use the following call to setBackground:
+ * <pre>
+ *  cfolder.setBackground(new Color[]{display.getSystemColor(SWT.COLOR_DARK_BLUE),
+ *                                 display.getSystemColor(SWT.COLOR_BLUE),
+ *                                 display.getSystemColor(SWT.COLOR_WHITE),
+ *                                 display.getSystemColor(SWT.COLOR_WHITE)},
+ *                     new int[] {25, 50, 100});
+ * </pre>
+ *
+ * @param colors an array of Color that specifies the colors to appear in the gradient
+ *               in order of appearance left to right.  The value <code>null</code> clears the
+ *               background gradient. The value <code>null</code> can be used inside the array of
+ *               Color to specify the background color.
+ * @param percents an array of integers between 0 and 100 specifying the percent of the width
+ *                 of the widget at which the color should change.  The size of the percents array must be one
+ *                 less than the size of the colors array.
+ *
+ * @exception SWTException <ul>
+ *      <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *      <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ *  </ul>
+ */
+public void setSelectionBackground(Color[] colors, int[] percents) {
+    setSelectionBackground(colors, percents, false);
+}
+/**
+ * Specify a gradient of colours to be draw in the background of the selected tab.
+ * For example to draw a vertical gradient that varies from dark blue to blue and then to
+ * white, use the following call to setBackground:
+ * <pre>
+ *  cfolder.setBackground(new Color[]{display.getSystemColor(SWT.COLOR_DARK_BLUE),
+ *                                 display.getSystemColor(SWT.COLOR_BLUE),
+ *                                 display.getSystemColor(SWT.COLOR_WHITE),
+ *                                 display.getSystemColor(SWT.COLOR_WHITE)},
+ *                        new int[] {25, 50, 100}, true);
+ * </pre>
+ *
+ * @param colors an array of Color that specifies the colors to appear in the gradient
+ *               in order of appearance left to right.  The value <code>null</code> clears the
+ *               background gradient. The value <code>null</code> can be used inside the array of
+ *               Color to specify the background color.
+ * @param percents an array of integers between 0 and 100 specifying the percent of the width
+ *                 of the widget at which the color should change.  The size of the percents array must be one
+ *                 less than the size of the colors array.
+ *
+ * @param vertical indicate the direction of the gradient.  True is vertical and false is horizontal.
+ *
+ * @exception SWTException <ul>
+ *      <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *      <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ *  </ul>
+ *
+ * @since 3.0
+ */
+public void setSelectionBackground(Color[] colors, int[] percents, bool vertical) {
+    checkWidget();
+    int colorsLength;
+    Color highlightBeginColor = null;  //null is no highlight
+
+    if (colors !is null) {
+        //The colors array can optionally have an extra entry which describes the highlight top color
+        //Thus its either one or two larger than the percents array
+        if (percents is null ||
+                ! ((percents.length is colors.length - 1) || (percents.length is colors.length - 2))){
+            SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+        }
+        for (int i = 0; i < percents.length; i++) {
+            if (percents[i] < 0 || percents[i] > 100) {
+                SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+            }
+            if (i > 0 && percents[i] < percents[i-1]) {
+                SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+            }
+        }
+        //If the colors is exactly two more than percents then last is highlight
+        //Keep track of *real* colorsLength (minus the highlight)
+        if(percents.length is colors.length - 2) {
+            highlightBeginColor = colors[colors.length - 1];
+            colorsLength = colors.length - 1;
+        } else {
+            colorsLength = colors.length;
+        }
+        if (getDisplay().getDepth() < 15) {
+            // Don't use gradients on low color displays
+            colors = [colors[colorsLength - 1]];
+            colorsLength = colors.length;
+            percents = null;
+        }
+    } else {
+        colorsLength = 0;
+    }
+
+    // Are these settings the same as before?
+    if (selectionBgImage is null) {
+        if ((selectionGradientColors !is null) && (colors !is null) &&
+            (selectionGradientColors.length is colorsLength)) {
+            bool same = false;
+            for (int i = 0; i < selectionGradientColors.length; i++) {
+                if (selectionGradientColors[i] is null) {
+                    same = colors[i] is null;
+                } else {
+                    same = cast(bool)(selectionGradientColors[i]==colors[i]);
+                }
+                if (!same) break;
+            }
+            if (same) {
+                for (int i = 0; i < selectionGradientPercents.length; i++) {
+                    same = selectionGradientPercents[i] is percents[i];
+                    if (!same) break;
+                }
+            }
+            if (same && this.selectionGradientVertical is vertical) return;
+        }
+    } else {
+        selectionBgImage = null;
+    }
+    // Store the new settings
+    if (colors is null) {
+        selectionGradientColors = null;
+        selectionGradientPercents = null;
+        selectionGradientVertical = false;
+        setSelectionBackground(cast(Color)null);
+        setSelectionHighlightGradientColor(null);
+    } else {
+        selectionGradientColors = new Color[colorsLength];
+        for (int i = 0; i < colorsLength; ++i) {
+            selectionGradientColors[i] = colors[i];
+        }
+        selectionGradientPercents = new int[percents.length];
+        for (int i = 0; i < percents.length; ++i) {
+            selectionGradientPercents[i] = percents[i];
+        }
+        selectionGradientVertical = vertical;
+        setSelectionBackground(selectionGradientColors[selectionGradientColors.length-1]);
+        setSelectionHighlightGradientColor(highlightBeginColor);
+    }
+
+    // Refresh with the new settings
+    if (selectedIndex > -1) redraw();
+}
+
+/*
+ * Set the color for the highlight start for selected tabs.
+ * Update the cache of highlight gradient colors if required.
+ */
+
+void setSelectionHighlightGradientColor(Color start) {
+    //Set to null to match all the early return cases.
+    //For early returns, don't realloc the cache, we may get a cache hit next time we're given the highlight
+    selectionHighlightGradientBegin = null;
+
+    if(start is null)
+        return;
+
+    //don't bother on low colour
+    if (getDisplay().getDepth() < 15)
+        return;
+
+    //don't bother if we don't have a background gradient
+    if(selectionGradientColors.length < 2)
+        return;
+
+    //OK we know its a valid gradient now
+    selectionHighlightGradientBegin = start;
+
+    if(! isSelectionHighlightColorsCacheHit(start))
+        createSelectionHighlightGradientColors(start);  //if no cache hit then compute new ones
+}
+
+/*
+ * Return true if given start color, the cache of highlight colors we have
+ * would match the highlight colors we'd compute.
+ */
+bool isSelectionHighlightColorsCacheHit(Color start) {
+
+    if(selectionHighlightGradientColorsCache is null)
+        return false;
+
+    //this case should never happen but check to be safe before accessing array indexes
+    if(selectionHighlightGradientColorsCache.length < 2)
+        return false;
+
+    Color highlightBegin = selectionHighlightGradientColorsCache[0];
+    Color highlightEnd = selectionHighlightGradientColorsCache[selectionHighlightGradientColorsCache.length - 1];
+
+    if( highlightBegin!=start)
+        return false;
+
+    //Compare number of colours we have vs. we'd compute
+    if(selectionHighlightGradientColorsCache.length !is tabHeight)
+        return false;
+
+    //Compare existing highlight end to what it would be (selectionBackground)
+    if( highlightEnd!=selectionBackground)
+        return false;
+
+    return true;
+}
+
+/**
+ * Set the image to be drawn in the background of the selected tab.  Image
+ * is stretched or compressed to cover entire selection tab area.
+ *
+ * @param image the image to be drawn in the background
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelectionBackground(Image image) {
+    checkWidget();
+    setSelectionHighlightGradientColor(null);
+    if (image is selectionBgImage) return;
+    if (image !is null) {
+        selectionGradientColors = null;
+        selectionGradientPercents = null;
+        disposeSelectionHighlightGradientColors();
+    }
+    selectionBgImage = image;
+    if (selectedIndex > -1) redraw();
+}
+/**
+ * Set the foreground color of the selected tab.
+ *
+ * @param color the color of the text displayed in the selected tab
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelectionForeground (Color color) {
+    checkWidget();
+    if (selectionForeground is color) return;
+    if (color is null) color = getDisplay().getSystemColor(SELECTION_FOREGROUND);
+    selectionForeground = color;
+    if (selectedIndex > -1) redraw();
+}
+
+/*
+ * Allocate colors for the highlight line.
+ * Colours will be a gradual blend ranging from to.
+ * Blend length will be tab height.
+ * Recompute this if tab height changes.
+ * Could remain null if there'd be no gradient (start=end or low colour display)
+ */
+void createSelectionHighlightGradientColors(Color start) {
+    disposeSelectionHighlightGradientColors(); //dispose if existing
+
+    if(start is null)  //shouldn't happen but just to be safe
+        return;
+
+    //alloc colours for entire height to ensure it matches wherever we stop drawing
+    int fadeGradientSize = tabHeight;
+
+    RGB from = start.getRGB();
+    RGB to = selectionBackground.getRGB();
+
+    selectionHighlightGradientColorsCache = new Color[fadeGradientSize];
+    int denom = fadeGradientSize - 1;
+
+    for (int i = 0; i < fadeGradientSize; i++) {
+        int propFrom = denom - i;
+        int propTo = i;
+        int red = (to.red * propTo + from.red * propFrom) / denom;
+        int green = (to.green * propTo  + from.green * propFrom) / denom;
+        int blue = (to.blue * propTo  + from.blue * propFrom) / denom;
+        selectionHighlightGradientColorsCache[i] = new Color(getDisplay(), red, green, blue);
+    }
+}
+
+void disposeSelectionHighlightGradientColors() {
+    if(selectionHighlightGradientColorsCache is null)
+        return;
+    for (int i = 0; i < selectionHighlightGradientColorsCache.length; i++) {
+        selectionHighlightGradientColorsCache[i].dispose();
+    }
+    selectionHighlightGradientColorsCache = null;
+}
+
+/*
+ * Return the gradient start color for selected tabs, which is the start of the tab fade
+ * (end is selectionBackground).
+ */
+Color getSelectionBackgroundGradientBegin() {
+    if (selectionGradientColors is null)
+        return getSelectionBackground();
+    if (selectionGradientColors.length is 0)
+        return getSelectionBackground();
+    return selectionGradientColors[0];
+}
+
+/**
+ * Sets the shape that the CTabFolder will use to render itself.
+ *
+ * @param simple <code>true</code> if the CTabFolder should render itself in a simple, traditional style
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setSimple(bool simple) {
+    checkWidget();
+    if (this.simple !is simple) {
+        this.simple = simple;
+        Rectangle rectBefore = getClientArea();
+        updateItems();
+        Rectangle rectAfter = getClientArea();
+        if (rectBefore!=rectAfter) {
+            notifyListeners(SWT.Resize, new Event());
+        }
+        redraw();
+    }
+}
+/**
+ * Sets the number of tabs that the CTabFolder should display
+ *
+ * @param single <code>true</code> if only the selected tab should be displayed otherwise, multiple tabs will be shown.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setSingle(bool single) {
+    checkWidget();
+    if (this.single !is single) {
+        this.single = single;
+        if (!single) {
+            for (int i = 0; i < items.length; i++) {
+                if (i !is selectedIndex && items[i].closeImageState is NORMAL) {
+                    items[i].closeImageState = NONE;
+                }
+            }
+        }
+        Rectangle rectBefore = getClientArea();
+        updateItems();
+        Rectangle rectAfter = getClientArea();
+        if (rectBefore!=rectAfter) {
+            notifyListeners(SWT.Resize, new Event());
+        }
+        redraw();
+    }
+}
+/**
+ * Specify a fixed height for the tab items.  If no height is specified,
+ * the default height is the height of the text or the image, whichever
+ * is greater. Specifying a height of -1 will revert to the default height.
+ *
+ * @param height the pixel value of the height or -1
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if called with a height of less than 0</li>
+ * </ul>
+ */
+public void setTabHeight(int height) {
+    checkWidget();
+    if (height < -1) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    fixedTabHeight = height;
+    updateTabHeight(false);
+}
+/**
+ * Specify whether the tabs should appear along the top of the folder
+ * or along the bottom of the folder.
+ *
+ * @param position <code>SWT.TOP</code> for tabs along the top or <code>SWT.BOTTOM</code> for tabs along the bottom
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the position value is not either SWT.TOP or SWT.BOTTOM</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setTabPosition(int position) {
+    checkWidget();
+    if (position !is SWT.TOP && position !is SWT.BOTTOM) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (onBottom !is (position is SWT.BOTTOM)) {
+        onBottom = position is SWT.BOTTOM;
+        borderTop = onBottom ? borderLeft : 0;
+        borderBottom = onBottom ? 0 : borderRight;
+        updateTabHeight(true);
+        Rectangle rectBefore = getClientArea();
+        updateItems();
+        Rectangle rectAfter = getClientArea();
+        if (rectBefore!=rectAfter) {
+            notifyListeners(SWT.Resize, new Event());
+        }
+        redraw();
+    }
+}
+/**
+ * Set the control that appears in the top right corner of the tab folder.
+ * Typically this is a close button or a composite with a Menu and close button.
+ * The topRight control is optional.  Setting the top right control to null will
+ * remove it from the tab folder.
+ *
+ * @param control the control to be displayed in the top right corner or null
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the control is not a child of this CTabFolder</li>
+ * </ul>
+ *
+ * @since 2.1
+ */
+public void setTopRight(Control control) {
+    setTopRight(control, SWT.RIGHT);
+}
+/**
+ * Set the control that appears in the top right corner of the tab folder.
+ * Typically this is a close button or a composite with a Menu and close button.
+ * The topRight control is optional.  Setting the top right control to null
+ * will remove it from the tab folder.
+ * <p>
+ * The alignment parameter sets the layout of the control in the tab area.
+ * <code>SWT.RIGHT</code> will cause the control to be positioned on the far
+ * right of the folder and it will have its default size.  <code>SWT.FILL</code>
+ * will size the control to fill all the available space to the right of the
+ * last tab.  If there is no available space, the control will not be visible.
+ * </p>
+ *
+ * @param control the control to be displayed in the top right corner or null
+ * @param alignment <code>SWT.RIGHT</code> or <code>SWT.FILL</code>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the control is not a child of this CTabFolder</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setTopRight(Control control, int alignment) {
+    checkWidget();
+    if (alignment !is SWT.RIGHT && alignment !is SWT.FILL) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (control !is null && control.getParent() !is this) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    topRight = control;
+    topRightAlignment = alignment;
+    if (updateItems()) redraw();
+}
+/**
+ * Specify whether the close button appears
+ * when the user hovers over an unselected tabs.
+ *
+ * @param visible <code>true</code> makes the close button appear
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setUnselectedCloseVisible(bool visible) {
+    checkWidget();
+    if (showUnselectedClose is visible) return;
+    // display close button when mouse hovers
+    showUnselectedClose = visible;
+    updateItems();
+    redraw();
+}
+/**
+ * Specify whether the image appears on unselected tabs.
+ *
+ * @param visible <code>true</code> makes the image appear
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setUnselectedImageVisible(bool visible) {
+    checkWidget();
+    if (showUnselectedImage is visible) return;
+    // display image on unselected items
+    showUnselectedImage = visible;
+    updateItems();
+    redraw();
+}
+/**
+ * Shows the item.  If the item is already showing in the receiver,
+ * this method simply returns.  Otherwise, the items are scrolled until
+ * the item is visible.
+ *
+ * @param item the item to be shown
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see CTabFolder#showSelection()
+ *
+ * @since 2.0
+ */
+public void showItem (CTabItem item) {
+    checkWidget();
+    if (item is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    if (item.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    int index = indexOf(item);
+    if (index is -1) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    int idx = -1;
+    for (int i = 0; i < priority.length; i++) {
+        if (priority[i] is index) {
+            idx = i;
+            break;
+        }
+    }
+    if (mru) {
+        // move to front of mru order
+        int[] newPriority = new int[priority.length];
+        System.arraycopy(priority, 0, newPriority, 1, idx);
+        System.arraycopy(priority, idx+1, newPriority, idx+1, priority.length - idx - 1);
+        newPriority[0] = index;
+        priority = newPriority;
+    }
+    if (item.isShowing()) return;
+    updateItems(index);
+    redrawTabs();
+}
+void showList (Rectangle rect) {
+    if (items.length is 0 || !showChevron) return;
+    if (showMenu is null || showMenu.isDisposed()) {
+        showMenu = new Menu(this);
+    } else {
+        MenuItem[] items = showMenu.getItems();
+        for (int i = 0; i < items.length; i++) {
+            items[i].dispose();
+        }
+    }
+    static const String id = "CTabFolder_showList_Index"; //$NON-NLS-1$
+    for (int i = 0; i < items.length; i++) {
+        CTabItem tab = items[i];
+        if (tab.showing) continue;
+        MenuItem item = new MenuItem(showMenu, SWT.NONE);
+        item.setText(tab.getText());
+        item.setImage(tab.getImage());
+        item.setData(id, tab);
+        item.addSelectionListener(new class() SelectionAdapter {
+            public void widgetSelected(SelectionEvent e) {
+                MenuItem menuItem = cast(MenuItem)e.widget;
+                int index = indexOf(cast(CTabItem)menuItem.getData(id));
+                this.outer.setSelection(index, true);
+            }
+        });
+    }
+    int x = rect.x;
+    int y = rect.y + rect.height;
+    Point location = getDisplay().map(this, null, x, y);
+    showMenu.setLocation(location.x, location.y);
+    showMenu.setVisible(true);
+}
+/**
+ * Shows the selection.  If the selection is already showing in the receiver,
+ * this method simply returns.  Otherwise, the items are scrolled until
+ * the selection is visible.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see CTabFolder#showItem(CTabItem)
+ *
+ * @since 2.0
+ */
+public void showSelection () {
+    checkWidget ();
+    if (selectedIndex !is -1) {
+        showItem(getSelection());
+    }
+}
+
+void _setToolTipText (int x, int y) {
+    String oldTip = getToolTipText();
+    String newTip = _getToolTip(x, y);
+    if (newTip is null || newTip!=oldTip) {
+        setToolTipText(newTip);
+    }
+}
+
+bool updateItems() {
+    return updateItems(selectedIndex);
+}
+
+bool updateItems(int showIndex) {
+    if (!single && !mru && showIndex !is -1) {
+        // make sure selected item will be showing
+        int firstIndex = showIndex;
+        if (priority[0] < showIndex) {
+            int maxWidth = getRightItemEdge() - borderLeft;
+            if (!simple) maxWidth -= curveWidth - 2*curveIndent;
+            int width = 0;
+            int[] widths = new int[items.length];
+            GC gc = new GC(this);
+            for (int i = priority[0]; i <= showIndex; i++) {
+                widths[i] = items[i].preferredWidth(gc, i is selectedIndex, true);
+                width += widths[i];
+                if (width > maxWidth) break;
+            }
+            if (width > maxWidth) {
+                width = 0;
+                for (int i = showIndex; i >= 0; i--) {
+                    if (widths[i] is 0) widths[i] = items[i].preferredWidth(gc, i is selectedIndex, true);
+                    width += widths[i];
+                    if (width > maxWidth) break;
+                    firstIndex = i;
+                }
+            } else {
+                firstIndex = priority[0];
+                for (int i = showIndex + 1; i < items.length; i++) {
+                    widths[i] = items[i].preferredWidth(gc, i is selectedIndex, true);
+                    width += widths[i];
+                    if (width >= maxWidth) break;
+                }
+                if (width < maxWidth) {
+                    for (int i = priority[0] - 1; i >= 0; i--) {
+                        if (widths[i] is 0) widths[i] = items[i].preferredWidth(gc, i is selectedIndex, true);
+                        width += widths[i];
+                        if (width > maxWidth) break;
+                        firstIndex = i;
+                    }
+                }
+            }
+            gc.dispose();
+        }
+        if (firstIndex !is priority[0]) {
+            int index = 0;
+            for (int i = firstIndex; i < items.length; i++) {
+                priority[index++] = i;
+            }
+            for (int i = 0; i < firstIndex; i++) {
+                priority[index++] = i;
+            }
+        }
+    }
+
+    bool oldShowChevron = showChevron;
+    bool changed = setItemSize();
+    changed |= setItemLocation();
+    setButtonBounds();
+    changed |= showChevron !is oldShowChevron;
+    if (changed && getToolTipText() !is null) {
+        Point pt = getDisplay().getCursorLocation();
+        pt = toControl(pt);
+        _setToolTipText(pt.x, pt.y);
+    }
+    return changed;
+}
+bool updateTabHeight(bool force){
+    int style = getStyle();
+    if (fixedTabHeight is 0 && (style & SWT.FLAT) !is 0 && (style & SWT.BORDER) is 0) highlight_header = 0;
+    int oldHeight = tabHeight;
+    if (fixedTabHeight !is SWT.DEFAULT) {
+        tabHeight = fixedTabHeight is 0 ? 0 : fixedTabHeight + 1; // +1 for line drawn across top of tab
+    } else {
+        int tempHeight = 0;
+        GC gc = new GC(this);
+        if (items.length is 0) {
+            tempHeight = gc.textExtent("Default", CTabItem.FLAGS).y + CTabItem.TOP_MARGIN + CTabItem.BOTTOM_MARGIN; //$NON-NLS-1$
+        } else {
+            for (int i=0; i < items.length; i++) {
+                tempHeight = Math.max(tempHeight, items[i].preferredHeight(gc));
+            }
+        }
+        gc.dispose();
+        tabHeight =  tempHeight;
+    }
+    if (!force && tabHeight is oldHeight) return false;
+
+    oldSize = null;
+    if (onBottom) {
+        int d = tabHeight - 12;
+        curve = [0,13+d, 0,12+d, 2,12+d, 3,11+d, 5,11+d, 6,10+d, 7,10+d, 9,8+d, 10,8+d,
+                          11,7+d, 11+d,7,
+                          12+d,6, 13+d,6, 15+d,4, 16+d,4, 17+d,3, 19+d,3, 20+d,2, 22+d,2, 23+d,1];
+        curveWidth = 26+d;
+        curveIndent = curveWidth/3;
+    } else {
+        int d = tabHeight - 12;
+        curve = [0,0, 0,1, 2,1, 3,2, 5,2, 6,3, 7,3, 9,5, 10,5,
+                          11,6, 11+d,6+d,
+                          12+d,7+d, 13+d,7+d, 15+d,9+d, 16+d,9+d, 17+d,10+d, 19+d,10+d, 20+d,11+d, 22+d,11+d, 23+d,12+d];
+        curveWidth = 26+d;
+        curveIndent = curveWidth/3;
+
+        //this could be static but since values depend on curve, better to keep in one place
+        topCurveHighlightStart = [
+                0, 2,  1, 2,  2, 2,
+                3, 3,  4, 3,  5, 3,
+                6, 4,  7, 4,
+                8, 5,
+                9, 6, 10, 6];
+
+        //also, by adding in 'd' here we save some math cost when drawing the curve
+        topCurveHighlightEnd = [
+                10+d, 6+d,
+                11+d, 7+d,
+                12+d, 8+d,  13+d, 8+d,
+                14+d, 9+d,
+                15+d, 10+d,  16+d, 10+d,
+                17+d, 11+d,  18+d, 11+d,  19+d, 11+d,
+                20+d, 12+d,  21+d, 12+d,  22+d,  12+d ];
+    }
+    notifyListeners(SWT.Resize, new Event());
+    return true;
+}
+String _getToolTip(int x, int y) {
+    if (showMin && minRect.contains(x, y)) return minimized ? SWT.getMessage("SWT_Restore") : SWT.getMessage("SWT_Minimize"); //$NON-NLS-1$ //$NON-NLS-2$
+    if (showMax && maxRect.contains(x, y)) return maximized ? SWT.getMessage("SWT_Restore") : SWT.getMessage("SWT_Maximize"); //$NON-NLS-1$ //$NON-NLS-2$
+    if (showChevron && chevronRect.contains(x, y)) return SWT.getMessage("SWT_ShowList"); //$NON-NLS-1$
+    CTabItem item = getItem(new Point (x, y));
+    if (item is null) return null;
+    if (!item.showing) return null;
+    if ((showClose || item.showClose) && item.closeRect.contains(x, y)) {
+        return SWT.getMessage("SWT_Close"); //$NON-NLS-1$
+    }
+    return item.getToolTipText();
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/CTabFolder2Adapter.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.CTabFolder2Adapter;
+
+import java.lang.all;
+import org.eclipse.swt.custom.CTabFolder2Listener;
+import org.eclipse.swt.custom.CTabFolderEvent;
+
+/**
+ * This adapter class provides default implementations for the
+ * methods described by the <code>CTabFolder2Listener</code> interface.
+ * <p>
+ * Classes that wish to deal with <code>CTabFolderEvent</code>s can
+ * extend this class and override only the methods which they are
+ * interested in.
+ * </p>
+ *
+ * @see CTabFolder2Listener
+ * @see CTabFolderEvent
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.0
+ */
+public class CTabFolder2Adapter : CTabFolder2Listener {
+
+/**
+ * Sent when the user clicks on the close button of an item in the CTabFolder.  The item being closed is specified
+ * in the event.item field. Setting the event.doit field to false will stop  the CTabItem from closing.
+ * When the CTabItem is closed, it is disposed.  The contents of the CTabItem (see CTabItem#setControl) will be
+ * made not visible when the CTabItem is closed.
+ * <p>
+ * The default behaviour is to close the CTabItem.
+ * </p>
+ *
+ * @param event an event indicating the item being closed
+ */
+public void close(CTabFolderEvent event){}
+
+/**
+ * Sent when the user clicks on the minimize button of a CTabFolder.
+ * <p>
+ * The default behaviour is to do nothing.
+ * </p>
+ *
+ * @param event an event containing information about the minimize
+ */
+public void minimize(CTabFolderEvent event){}
+
+/**
+ * Sent when the user clicks on the maximize button of a CTabFolder.
+ * <p>
+ * The default behaviour is to do nothing.
+ * </p>
+ *
+ * @param event an event containing information about the maximize
+ */
+public void maximize(CTabFolderEvent event){}
+
+/**
+ * Sent when the user clicks on the restore button of a CTabFolder.
+ * <p>
+ * The default behaviour is to do nothing.
+ * </p>
+ *
+ * @param event an event containing information about the restore
+ */
+public void restore(CTabFolderEvent event){}
+
+/**
+ * Sent when the user clicks on the chevron button of a CTabFolder.
+ * <p>
+ * The default behaviour is to show a list of items that are not currently
+ * visible and to change the selection based on the item selected from the list.
+ * </p>
+ *
+ * @param event an event containing information about the show list
+ */
+public void showList(CTabFolderEvent event){}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/CTabFolder2Listener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,197 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.CTabFolder2Listener;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.SWTEventListener;
+import org.eclipse.swt.custom.CTabFolderEvent;
+
+import tango.core.Traits;
+import tango.core.Tuple;
+
+/**
+ * Classes which implement this interface provide methods
+ * that deal with the events that are generated by the CTabFolder
+ * control.
+ * <p>
+ * After creating an instance of a class that :
+ * this interface it can be added to a CTabFolder using the
+ * <code>addCTabFolder2Listener</code> method and removed using
+ * the <code>removeCTabFolder2Listener</code> method. When
+ * events occurs in a CTabFolder the appropriate method
+ * will be invoked.
+ * </p>
+ *
+ * @see CTabFolder2Adapter
+ * @see CTabFolderEvent
+ *
+ * @since 3.0
+ */
+public interface CTabFolder2Listener : SWTEventListener {
+    public enum {
+        MINIMIZE,
+        MAXIMIZE,
+        SHOWLIST,
+        RESTORE,
+        CLOSE
+    }
+
+/**
+ * Sent when the user clicks on the close button of an item in the CTabFolder.
+ * The item being closed is specified in the event.item field.
+ * Setting the event.doit field to false will stop the CTabItem from closing.
+ * When the CTabItem is closed, it is disposed.  The contents of the
+ * CTabItem (see CTabItem.setControl) will be made not visible when
+ * the CTabItem is closed.
+ *
+ * @param event an event indicating the item being closed
+ */
+public void close(CTabFolderEvent event);
+
+/**
+ * Sent when the user clicks on the minimize button of a CTabFolder.
+ * The state of the CTabFolder does not change automatically - it
+ * is up to the application to change the state of the CTabFolder
+ * in response to this event using CTabFolder.setMinimized(true).
+ *
+ * @param event an event containing information about the minimize
+ *
+ * @see CTabFolder#getMinimized()
+ * @see CTabFolder#setMinimized(bool)
+ * @see CTabFolder#setMinimizeVisible(bool)
+ */
+public void minimize(CTabFolderEvent event);
+
+/**
+ * Sent when the user clicks on the maximize button of a CTabFolder.
+ * The state of the CTabFolder does not change automatically - it
+ * is up to the application to change the state of the CTabFolder
+ * in response to this event using CTabFolder.setMaximized(true).
+ *
+ * @param event an event containing information about the maximize
+ *
+ * @see CTabFolder#getMaximized()
+ * @see CTabFolder#setMaximized(bool)
+ * @see CTabFolder#setMaximizeVisible(bool)
+ */
+public void maximize(CTabFolderEvent event);
+
+/**
+ * Sent when the user clicks on the restore button of a CTabFolder.
+ * This event is sent either to restore the CTabFolder from the
+ * minimized state or from the maximized state.  To determine
+ * which restore is requested, use CTabFolder.getMinimized() or
+ * CTabFolder.getMaximized() to determine the current state.
+ * The state of the CTabFolder does not change automatically - it
+ * is up to the application to change the state of the CTabFolder
+ * in response to this event using CTabFolder.setMaximized(false)
+ * or CTabFolder.setMinimized(false).
+ *
+ * @param event an event containing information about the restore
+ *
+ * @see CTabFolder#getMinimized()
+ * @see CTabFolder#getMaximized()
+ * @see CTabFolder#setMinimized(bool)
+ * @see CTabFolder#setMinimizeVisible(bool)
+ * @see CTabFolder#setMaximized(bool)
+ * @see CTabFolder#setMaximizeVisible(bool)
+ */
+public void restore(CTabFolderEvent event);
+
+/**
+ * Sent when the user clicks on the chevron button of the CTabFolder.
+ * A chevron appears in the CTabFolder when there are more tabs
+ * than can be displayed at the current widget size.  To select a
+ * tab that is not currently visible, the user clicks on the
+ * chevron and selects a tab item from a list.  By default, the
+ * CTabFolder provides a list of all the items that are not currently
+ * visible, however, the application can provide its own list by setting
+ * the event.doit field to <code>false</code> and displaying a selection list.
+ *
+ * @param event an event containing information about the show list
+ *
+ * @see CTabFolder#setSelection(CTabItem)
+ */
+public void showList(CTabFolderEvent event);
+}
+
+
+
+/// Helper class for the dgListener template function
+private class _DgCTabFolder2ListenerT(Dg,T...) : CTabFolder2Listener {
+
+    alias ParameterTupleOf!(Dg) DgArgs;
+    static assert( is(DgArgs == Tuple!(CTabFolderEvent,T)),
+                "Delegate args not correct: "~DgArgs.stringof~" vs. (Event,"~T.stringof~")" );
+
+    Dg dg;
+    T  t;
+    int type;
+
+    private this( int type, Dg dg, T t ){
+        this.type = type;
+        this.dg = dg;
+        static if( T.length > 0 ){
+            this.t = t;
+        }
+    }
+
+    void itemClosed( CTabFolderEvent e ){
+        dg(e,t);
+    }
+    public void close(CTabFolderEvent e){
+        if( type is CTabFolder2Listener.CLOSE ){
+            dg(e,t);
+        }
+    }
+    public void minimize(CTabFolderEvent e){
+        if( type is CTabFolder2Listener.MINIMIZE ){
+            dg(e,t);
+        }
+    }
+    public void maximize(CTabFolderEvent e){
+        if( type is CTabFolder2Listener.MAXIMIZE ){
+            dg(e,t);
+        }
+    }
+    public void restore(CTabFolderEvent e){
+        if( type is CTabFolder2Listener.RESTORE ){
+            dg(e,t);
+        }
+    }
+    public void showList(CTabFolderEvent e){
+        if( type is CTabFolder2Listener.SHOWLIST ){
+            dg(e,t);
+        }
+    }
+}
+
+/++
+ + dgListener creates a class implementing the Listener interface and delegating the call to
+ + handleEvent to the users delegate. This template function will store also additional parameters.
+ +
+ + Examle of usage:
+ + ---
+ + void handleTextEvent ( Event e, int inset ) {
+ +     // ...
+ + }
+ + text.addListener (SWT.FocusOut, dgListener( &handleTextEvent, inset ));
+ + ---
+ +/
+CTabFolder2Listener dgCTabFolder2Listener( Dg, T... )( int type, Dg dg, T args ){
+    return new _DgCTabFolder2ListenerT!( Dg, T )( type, dg, args );
+}
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/CTabFolderAdapter.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.CTabFolderAdapter;
+
+import java.lang.all;
+import org.eclipse.swt.custom.CTabFolderEvent;
+import org.eclipse.swt.custom.CTabFolderListener;
+
+
+/**
+ * This adapter class provides a default implementation for the
+ * method described by the <code>CTabFolderListener</code> interface.
+ * 
+ * @see CTabFolderListener
+ * @see CTabFolderEvent
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class CTabFolderAdapter : CTabFolderListener {
+    public void itemClosed(CTabFolderEvent event){}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/CTabFolderEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.CTabFolderEvent;
+
+import java.lang.all;
+
+
+
+import org.eclipse.swt.events.TypedEvent;
+import org.eclipse.swt.widgets.Widget;
+
+import tango.util.Convert;
+
+/**
+ * This event is sent when an event is generated in the CTabFolder.
+ *
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> 
+ */
+public class CTabFolderEvent : TypedEvent {
+    /**
+     * The tab item for the operation.
+     */
+    public Widget item;
+
+    /**
+     * A flag indicating whether the operation should be allowed.
+     * Setting this field to <code>false</code> will cancel the operation.
+     * Applies to the close and showList events.
+     */
+    public bool doit;
+
+    /**
+     * The widget-relative, x coordinate of the chevron button
+     * at the time of the event.  Applies to the showList event.
+     *
+     * @since 3.0
+     */
+    public int x;
+    /**
+     * The widget-relative, y coordinate of the chevron button
+     * at the time of the event.  Applies to the showList event.
+     *
+     * @since 3.0
+     */
+    public int y;
+    /**
+     * The width of the chevron button at the time of the event.
+     * Applies to the showList event.
+     *
+     * @since 3.0
+     */
+    public int width;
+    /**
+     * The height of the chevron button at the time of the event.
+     * Applies to the showList event.
+     *
+     * @since 3.0
+     */
+    public int height;
+
+    static final long serialVersionUID = 3760566386225066807L;
+
+/**
+ * Constructs a new instance of this class.
+ *
+ * @param w the widget that fired the event
+ */
+this(Widget w) {
+    super(w);
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+public override String toString() {
+    String string = super.toString ();
+    return string[0.. $ - 1] // remove trailing '}'
+        ~ " item=" ~ to!(String)(item)
+        ~ " doit=" ~ to!(String)(doit)
+        ~ " x=" ~ to!(String)(x)
+        ~ " y=" ~ to!(String)(y)
+        ~ " width=" ~ to!(String)(width)
+        ~ " height=" ~ to!(String)(height)
+        ~ "}";
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/CTabFolderLayout.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.CTabFolderLayout;
+
+import java.lang.all;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Layout;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.CTabItem;
+
+/**
+ * This class provides the layout for CTabFolder
+ *
+ * @see CTabFolder
+ */
+class CTabFolderLayout : Layout {
+protected override Point computeSize(Composite composite, int wHint, int hHint, bool flushCache) {
+    CTabFolder folder = cast(CTabFolder)composite;
+    CTabItem[] items = folder.items;
+    // preferred width of tab area to show all tabs
+    int tabW = 0;
+    GC gc = new GC(folder);
+    for (int i = 0; i < items.length; i++) {
+        if (folder.single) {
+            tabW = Math.max(tabW, items[i].preferredWidth(gc, true, false));
+        } else {
+            tabW += items[i].preferredWidth(gc, i is folder.selectedIndex, false);
+        }
+    }
+    gc.dispose();
+    tabW += 3;
+    if (folder.showMax) tabW += CTabFolder.BUTTON_SIZE;
+    if (folder.showMin) tabW += CTabFolder.BUTTON_SIZE;
+    if (folder.single) tabW += 3*CTabFolder.BUTTON_SIZE/2; //chevron
+    if (folder.topRight !is null) {
+        Point pt = folder.topRight.computeSize(SWT.DEFAULT, folder.tabHeight, flushCache);
+        tabW += 3 + pt.x;
+    }
+    if (!folder.single && !folder.simple) tabW += folder.curveWidth - 2*folder.curveIndent;
+
+    int controlW = 0;
+    int controlH = 0;
+    // preferred size of controls in tab items
+    for (int i = 0; i < items.length; i++) {
+        Control control = items[i].getControl();
+        if (control !is null && !control.isDisposed()){
+            Point size = control.computeSize (wHint, hHint, flushCache);
+            controlW = Math.max (controlW, size.x);
+            controlH = Math.max (controlH, size.y);
+        }
+    }
+
+    int minWidth = Math.max(tabW, controlW);
+    int minHeight = (folder.minimized) ? 0 : controlH;
+    if (minWidth is 0) minWidth = CTabFolder.DEFAULT_WIDTH;
+    if (minHeight is 0) minHeight = CTabFolder.DEFAULT_HEIGHT;
+
+    if (wHint !is SWT.DEFAULT) minWidth  = wHint;
+    if (hHint !is SWT.DEFAULT) minHeight = hHint;
+
+    return new Point (minWidth, minHeight);
+}
+protected override bool flushCache(Control control) {
+    return true;
+}
+protected override void layout(Composite composite, bool flushCache) {
+    CTabFolder folder = cast(CTabFolder)composite;
+    // resize content
+    if (folder.selectedIndex !is -1) {
+        Control control = folder.items[folder.selectedIndex].getControl();
+        if (control !is null && !control.isDisposed()) {
+            control.setBounds(folder.getClientArea());
+        }
+    }
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/CTabFolderListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.CTabFolderListener;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.SWTEventListener;
+import org.eclipse.swt.custom.CTabFolderEvent;
+
+import tango.core.Traits;
+import tango.core.Tuple;
+
+/**
+ * Classes which implement this interface provide a method
+ * that deals with events generated in the CTabFolder.
+ * <p>
+ * After creating an instance of a class that :
+ * this interface it can be added to a CTabFolder using the
+ * <code>addCTabFolderListener</code> method and removed using
+ * the <code>removeCTabFolderListener</code> method. When a
+ * tab item is closed, the itemClosed method will be invoked.
+ * </p>
+ *
+ * @see CTabFolderEvent
+ */
+public interface CTabFolderListener : SWTEventListener {
+
+/**
+ * Sent when the user clicks on the close button of an item in the CTabFolder.  The item being closed is specified
+ * in the event.item field. Setting the event.doit field to false will stop the CTabItem from closing.
+ * When the CTabItem is closed, it is disposed.  The contents of the CTabItem (see CTabItem.setControl) will be
+ * made not visible when the CTabItem is closed.
+ *
+ * @param event an event indicating the item being closed
+ *
+ * @see CTabItem#setControl
+ */
+public void itemClosed(CTabFolderEvent event);
+}
+
+
+
+/// Helper class for the dgListener template function
+private class _DgCTabFolderListenerT(Dg,T...) : CTabFolderListener {
+
+    alias ParameterTupleOf!(Dg) DgArgs;
+    static assert( is(DgArgs == Tuple!(CTabFolderEvent,T)),
+                "Delegate args not correct" );
+
+    Dg dg;
+    T  t;
+
+    private this( Dg dg, T t ){
+        this.dg = dg;
+        static if( T.length > 0 ){
+            this.t = t;
+        }
+    }
+
+    void itemClosed( CTabFolderEvent e ){
+        dg(e,t);
+    }
+}
+
+/++
+ + dgListener creates a class implementing the Listener interface and delegating the call to
+ + handleEvent to the users delegate. This template function will store also additional parameters.
+ +
+ + Examle of usage:
+ + ---
+ + void handleTextEvent (Event e, int inset ) {
+ +     // ...
+ + }
+ + text.addListener (SWT.FocusOut, dgListener( &handleTextEvent, inset ));
+ + ---
+ +/
+CTabFolderListener dgCTabFolderListener( Dg, T... )( Dg dg, T args ){
+    return new _DgCTabFolderListenerT!( Dg, T )( dg, args );
+}
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/CTabItem.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,1073 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.CTabItem;
+
+import java.lang.all;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.TextLayout;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swt.custom.CTabFolder;
+
+/**
+ * Instances of this class represent a selectable user interface object
+ * that represent a page in a notebook widget.
+ *
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>SWT.CLOSE</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#ctabfolder">CTabFolder, CTabItem snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class CTabItem : Item {
+    CTabFolder parent;
+    int x,y,width,height = 0;
+    Control control; // the tab page
+
+    String toolTipText;
+    String shortenedText;
+    int shortenedTextWidth;
+
+    // Appearance
+    Font font;
+    Image disabledImage;
+
+    Rectangle closeRect;
+    int closeImageState = CTabFolder.NONE;
+    bool showClose = false;
+    bool showing = false;
+
+    // internal constants
+    static final int TOP_MARGIN = 2;
+    static final int BOTTOM_MARGIN = 2;
+    static final int LEFT_MARGIN = 4;
+    static final int RIGHT_MARGIN = 4;
+    static final int INTERNAL_SPACING = 4;
+    static final int FLAGS = SWT.DRAW_TRANSPARENT | SWT.DRAW_MNEMONIC;
+    static final String ELLIPSIS = "..."; //$NON-NLS-1$ // could use the ellipsis glyph on some platforms "\u2026"
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>CTabFolder</code>) and a style value
+ * describing its behavior and appearance. The item is added
+ * to the end of the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a CTabFolder which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#getStyle()
+ */
+public this (CTabFolder parent, int style) {
+    this(parent, style, parent.getItemCount());
+}
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>CTabFolder</code>), a style value
+ * describing its behavior and appearance, and the index
+ * at which to place it in the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a CTabFolder which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ * @param index the zero-relative index to store the receiver in its parent
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the parent (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#getStyle()
+ */
+public this (CTabFolder parent, int style, int index) {
+    closeRect = new Rectangle(0, 0, 0, 0);
+    super (parent, style);
+    showClose = (style & SWT.CLOSE) !is 0;
+    parent.createItem (this, index);
+}
+
+/*
+ * Return whether to use ellipses or just truncate labels
+ */
+bool useEllipses() {
+    return parent.simple;
+}
+
+String shortenText(GC gc, String text, int width) {
+    return useEllipses()
+        ? shortenText(gc, text, width, ELLIPSIS)
+        : shortenText(gc, text, width, ""); //$NON-NLS-1$
+}
+
+String shortenText(GC gc, String text, int width, String ellipses) {
+    if (gc.textExtent(text, FLAGS).x <= width) return text;
+    int ellipseWidth = gc.textExtent(ellipses, FLAGS).x;
+    int length = text.length;
+    TextLayout layout = new TextLayout(getDisplay());
+    layout.setText(text);
+    int end = layout.getPreviousOffset(length, SWT.MOVEMENT_CLUSTER);
+    while (end > 0) {
+        text = text[ 0 .. end ];
+        int l = gc.textExtent(text, FLAGS).x;
+        if (l + ellipseWidth <= width) {
+            break;
+        }
+        end = layout.getPreviousOffset(end, SWT.MOVEMENT_CLUSTER);
+    }
+    layout.dispose();
+    return end is 0 ? text.substring(0, 1) : text ~ ellipses;
+}
+
+public override void dispose() {
+    if (isDisposed ()) return;
+    //if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS);
+    parent.destroyItem(this);
+    super.dispose();
+    parent = null;
+    control = null;
+    toolTipText = null;
+    shortenedText = null;
+    font = null;
+}
+void drawClose(GC gc) {
+    if (closeRect.width is 0 || closeRect.height is 0) return;
+    Display display = getDisplay();
+
+    // draw X 9x9
+    int indent = Math.max(1, (CTabFolder.BUTTON_SIZE-9)/2);
+    int x = closeRect.x + indent;
+    int y = closeRect.y + indent;
+    y += parent.onBottom ? -1 : 1;
+
+    Color closeBorder = display.getSystemColor(CTabFolder.BUTTON_BORDER);
+    switch (closeImageState) {
+        case CTabFolder.NORMAL: {
+            int[] shape = [x,y, x+2,y, x+4,y+2, x+5,y+2, x+7,y, x+9,y,
+                                     x+9,y+2, x+7,y+4, x+7,y+5, x+9,y+7, x+9,y+9,
+                                     x+7,y+9, x+5,y+7, x+4,y+7, x+2,y+9, x,y+9,
+                                     x,y+7, x+2,y+5, x+2,y+4, x,y+2];
+            gc.setBackground(display.getSystemColor(CTabFolder.BUTTON_FILL));
+            gc.fillPolygon(shape);
+            gc.setForeground(closeBorder);
+            gc.drawPolygon(shape);
+            break;
+        }
+        case CTabFolder.HOT: {
+            int[] shape = [x,y, x+2,y, x+4,y+2, x+5,y+2, x+7,y, x+9,y,
+                                     x+9,y+2, x+7,y+4, x+7,y+5, x+9,y+7, x+9,y+9,
+                                     x+7,y+9, x+5,y+7, x+4,y+7, x+2,y+9, x,y+9,
+                                     x,y+7, x+2,y+5, x+2,y+4, x,y+2];
+            Color fill = new Color(display, CTabFolder.CLOSE_FILL);
+            gc.setBackground(fill);
+            gc.fillPolygon(shape);
+            fill.dispose();
+            gc.setForeground(closeBorder);
+            gc.drawPolygon(shape);
+            break;
+        }
+        case CTabFolder.SELECTED: {
+            int[] shape = [x+1,y+1, x+3,y+1, x+5,y+3, x+6,y+3, x+8,y+1, x+10,y+1,
+                                     x+10,y+3, x+8,y+5, x+8,y+6, x+10,y+8, x+10,y+10,
+                                     x+8,y+10, x+6,y+8, x+5,y+8, x+3,y+10, x+1,y+10,
+                                     x+1,y+8, x+3,y+6, x+3,y+5, x+1,y+3];
+            Color fill = new Color(display, CTabFolder.CLOSE_FILL);
+            gc.setBackground(fill);
+            gc.fillPolygon(shape);
+            fill.dispose();
+            gc.setForeground(closeBorder);
+            gc.drawPolygon(shape);
+            break;
+        }
+        case CTabFolder.NONE: {
+            int[] shape = [x,y, x+10,y, x+10,y+10, x,y+10];
+            if (parent.gradientColors !is null && !parent.gradientVertical) {
+                parent.drawBackground(gc, shape, false);
+            } else {
+                Color defaultBackground = parent.getBackground();
+                Image image = parent.bgImage;
+                Color[] colors = parent.gradientColors;
+                int[] percents = parent.gradientPercents;
+                bool vertical = parent.gradientVertical;
+                parent.drawBackground(gc, shape, x, y, 10, 10, defaultBackground, image, colors, percents, vertical);
+            }
+            break;
+        }
+        default:
+    }
+}
+void drawSelected(GC gc ) {
+    Point size = parent.getSize();
+    int rightEdge = Math.min (x + width, parent.getRightItemEdge());
+
+    //   Draw selection border across all tabs
+    int xx = parent.borderLeft;
+    int yy = parent.onBottom ? size.y - parent.borderBottom - parent.tabHeight - parent.highlight_header : parent.borderTop + parent.tabHeight + 1;
+    int ww = size.x - parent.borderLeft - parent.borderRight;
+    int hh = parent.highlight_header - 1;
+    int[] shape = [xx,yy, xx+ww,yy, xx+ww,yy+hh, xx,yy+hh];
+    if (parent.selectionGradientColors !is null && !parent.selectionGradientVertical) {
+        parent.drawBackground(gc, shape, true);
+    } else {
+        gc.setBackground(parent.selectionBackground);
+        gc.fillRectangle(xx, yy, ww, hh);
+    }
+
+    if (parent.single) {
+        if (!showing) return;
+    } else {
+        // if selected tab scrolled out of view or partially out of view
+        // just draw bottom line
+        if (!showing){
+            int x1 = Math.max(0, parent.borderLeft - 1);
+            int y1 = (parent.onBottom) ? y - 1 : y + height;
+            int x2 = size.x - parent.borderRight;
+            gc.setForeground(CTabFolder.borderColor);
+            gc.drawLine(x1, y1, x2, y1);
+            return;
+        }
+
+        // draw selected tab background and outline
+        shape = null;
+        if (this.parent.onBottom) {
+            int[] left = parent.simple ? CTabFolder.SIMPLE_BOTTOM_LEFT_CORNER : CTabFolder.BOTTOM_LEFT_CORNER;
+            int[] right = parent.simple ? CTabFolder.SIMPLE_BOTTOM_RIGHT_CORNER : parent.curve;
+            if (parent.borderLeft is 0 && parent.indexOf(this) is parent.firstIndex) {
+                left = [x, y+height];
+            }
+            shape = new int[left.length+right.length+8];
+            int index = 0;
+            shape[index++] = x; // first point repeated here because below we reuse shape to draw outline
+            shape[index++] = y - 1;
+            shape[index++] = x;
+            shape[index++] = y - 1;
+            for (int i = 0; i < left.length/2; i++) {
+                shape[index++] = x + left[2*i];
+                shape[index++] = y + height + left[2*i+1] - 1;
+            }
+            for (int i = 0; i < right.length/2; i++) {
+                shape[index++] = parent.simple ? rightEdge - 1 + right[2*i] : rightEdge - parent.curveIndent + right[2*i];
+                shape[index++] = parent.simple ? y + height + right[2*i+1] - 1 : y + right[2*i+1] - 2;
+            }
+            shape[index++] = parent.simple ? rightEdge - 1 : rightEdge + parent.curveWidth - parent.curveIndent;
+            shape[index++] = y - 1;
+            shape[index++] = parent.simple ? rightEdge - 1 : rightEdge + parent.curveWidth - parent.curveIndent;
+            shape[index++] = y - 1;
+        } else {
+            int[] left = parent.simple ? CTabFolder.SIMPLE_TOP_LEFT_CORNER : CTabFolder.TOP_LEFT_CORNER;
+            int[] right = parent.simple ? CTabFolder.SIMPLE_TOP_RIGHT_CORNER : parent.curve;
+            if (parent.borderLeft is 0 && parent.indexOf(this) is parent.firstIndex) {
+                left = [x, y];
+            }
+            shape = new int[left.length+right.length+8];
+            int index = 0;
+            shape[index++] = x; // first point repeated here because below we reuse shape to draw outline
+            shape[index++] = y + height + 1;
+            shape[index++] = x;
+            shape[index++] = y + height + 1;
+            for (int i = 0; i < left.length/2; i++) {
+                shape[index++] = x + left[2*i];
+                shape[index++] = y + left[2*i+1];
+            }
+            for (int i = 0; i < right.length/2; i++) {
+                shape[index++] = parent.simple ? rightEdge - 1 + right[2*i] : rightEdge - parent.curveIndent + right[2*i];
+                shape[index++] = y + right[2*i+1];
+            }
+            shape[index++] = parent.simple ? rightEdge - 1 : rightEdge + parent.curveWidth - parent.curveIndent;
+            shape[index++] = y + height + 1;
+            shape[index++] = parent.simple ? rightEdge - 1 : rightEdge + parent.curveWidth - parent.curveIndent;
+            shape[index++] = y + height + 1;
+        }
+
+        Rectangle clipping = gc.getClipping();
+        Rectangle bounds = getBounds();
+        bounds.height += 1;
+        if (parent.onBottom) bounds.y -= 1;
+        bool tabInPaint = clipping.intersects(bounds);
+
+        if (tabInPaint) {
+            // fill in tab background
+            if (parent.selectionGradientColors !is null && !parent.selectionGradientVertical) {
+                parent.drawBackground(gc, shape, true);
+            } else {
+                Color defaultBackground = parent.selectionBackground;
+                Image image = parent.selectionBgImage;
+                Color[] colors = parent.selectionGradientColors;
+                int[] percents = parent.selectionGradientPercents;
+                bool vertical = parent.selectionGradientVertical;
+                xx = x;
+                yy = parent.onBottom ? y -1 : y + 1;
+                ww = width;
+                hh = height;
+                if (!parent.single && !parent.simple) ww += parent.curveWidth - parent.curveIndent;
+                parent.drawBackground(gc, shape, xx, yy, ww, hh, defaultBackground, image, colors, percents, vertical);
+            }
+        }
+
+        //Highlight MUST be drawn before the outline so that outline can cover it in the right spots (start of swoop)
+        //otherwise the curve looks jagged
+        drawHighlight(gc, rightEdge);
+
+        // draw outline
+        shape[0] = Math.max(0, parent.borderLeft - 1);
+        if (parent.borderLeft is 0 && parent.indexOf(this) is parent.firstIndex) {
+            shape[1] = parent.onBottom ? y + height - 1 : y;
+            shape[5] = shape[3] = shape[1];
+        }
+        shape[shape.length - 2] = size.x - parent.borderRight + 1;
+        for (int i = 0; i < shape.length/2; i++) {
+            if (shape[2*i + 1] is y + height + 1) shape[2*i + 1] -= 1;
+        }
+        RGB inside = parent.selectionBackground.getRGB();
+        if (parent.selectionBgImage !is null ||
+            (parent.selectionGradientColors !is null && parent.selectionGradientColors.length > 1)) {
+            inside = null;
+        }
+        RGB outside = parent.getBackground().getRGB();
+        if (parent.bgImage !is null ||
+            (parent.gradientColors !is null && parent.gradientColors.length > 1)) {
+            outside = null;
+        }
+        parent.antialias(shape, CTabFolder.borderColor.getRGB(), inside, outside, gc);
+        gc.setForeground(CTabFolder.borderColor);
+        gc.drawPolyline(shape);
+
+        if (!tabInPaint) return;
+    }
+
+    // draw Image
+    int xDraw = x + LEFT_MARGIN;
+    if (parent.single && (parent.showClose || showClose)) xDraw += CTabFolder.BUTTON_SIZE;
+    Image image = getImage();
+    if (image !is null) {
+        Rectangle imageBounds = image.getBounds();
+        // only draw image if it won't overlap with close button
+        int maxImageWidth = rightEdge - xDraw - RIGHT_MARGIN;
+        if (!parent.single && closeRect.width > 0) maxImageWidth -= closeRect.width + INTERNAL_SPACING;
+        if (imageBounds.width < maxImageWidth) {
+            int imageX = xDraw;
+            int imageY = y + (height - imageBounds.height) / 2;
+            imageY += parent.onBottom ? -1 : 1;
+            gc.drawImage(image, imageX, imageY);
+            xDraw += imageBounds.width + INTERNAL_SPACING;
+        }
+    }
+
+    // draw Text
+    int textWidth = rightEdge - xDraw - RIGHT_MARGIN;
+    if (!parent.single && closeRect.width > 0) textWidth -= closeRect.width + INTERNAL_SPACING;
+    if (textWidth > 0) {
+        Font gcFont = gc.getFont();
+        gc.setFont(font is null ? parent.getFont() : font);
+
+        if (shortenedText is null || shortenedTextWidth !is textWidth) {
+            shortenedText = shortenText(gc, getText(), textWidth);
+            shortenedTextWidth = textWidth;
+        }
+        Point extent = gc.textExtent(shortenedText, FLAGS);
+        int textY = y + (height - extent.y) / 2;
+        textY += parent.onBottom ? -1 : 1;
+
+        gc.setForeground(parent.selectionForeground);
+        gc.drawText(shortenedText, xDraw, textY, FLAGS);
+        gc.setFont(gcFont);
+
+        // draw a Focus rectangle
+        if (parent.isFocusControl()) {
+            Display display = getDisplay();
+            if (parent.simple || parent.single) {
+                gc.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
+                gc.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
+                gc.drawFocus(xDraw-1, textY-1, extent.x+2, extent.y+2);
+            } else {
+                gc.setForeground(display.getSystemColor(CTabFolder.BUTTON_BORDER));
+                gc.drawLine(xDraw, textY+extent.y+1, xDraw+extent.x+1, textY+extent.y+1);
+            }
+        }
+    }
+    if (parent.showClose || showClose) drawClose(gc);
+}
+
+/*
+ * Draw a highlight effect along the left, top, and right edges of the tab.
+ * Only for curved tabs, on top.
+ * Do not draw if insufficient colors.
+ */
+void drawHighlight(GC gc, int rightEdge) {
+    //only draw for curvy tabs and only draw for top tabs
+    if(parent.simple || this.parent.onBottom)
+        return;
+
+    if(parent.selectionHighlightGradientBegin is null)
+        return;
+
+    Color[] gradients = parent.selectionHighlightGradientColorsCache;
+    if(gradients is null)
+        return;
+    int gradientsSize = gradients.length;
+    if(gradientsSize is 0)
+        return;     //shouldn't happen but just to be tidy
+
+    gc.setForeground(gradients[0]);
+
+    //draw top horizontal line
+    gc.drawLine(
+            CTabFolder.TOP_LEFT_CORNER_HILITE[0] + x + 1, //rely on fact that first pair is top/right of curve
+            1 + y,
+            rightEdge - parent.curveIndent,
+            1 + y);
+
+    int[] leftHighlightCurve = CTabFolder.TOP_LEFT_CORNER_HILITE;
+
+    int d = parent.tabHeight - parent.topCurveHighlightEnd.length /2;
+
+    int lastX = 0;
+    int lastY = 0;
+    int lastColorIndex = 0;
+
+    //draw upper left curve highlight
+    for (int i = 0; i < leftHighlightCurve.length /2; i++) {
+        int rawX = leftHighlightCurve[i * 2];
+        int rawY = leftHighlightCurve[i * 2 + 1];
+        lastX = rawX + x;
+        lastY = rawY + y;
+        lastColorIndex = rawY - 1;
+        gc.setForeground(gradients[lastColorIndex]);
+        gc.drawPoint(lastX, lastY);
+    }
+    //draw left vertical line highlight
+    for(int i = lastColorIndex; i < gradientsSize; i++) {
+        gc.setForeground(gradients[i]);
+        gc.drawPoint(lastX, 1 + lastY++);
+    }
+
+    int rightEdgeOffset = rightEdge - parent.curveIndent;
+
+    //draw right swoop highlight up to diagonal portion
+    for (int i = 0; i < parent.topCurveHighlightStart.length /2; i++) {
+        int rawX = parent.topCurveHighlightStart[i * 2];
+        int rawY = parent.topCurveHighlightStart[i * 2 + 1];
+        lastX = rawX + rightEdgeOffset;
+        lastY = rawY + y;
+        lastColorIndex = rawY - 1;
+        if(lastColorIndex >= gradientsSize)
+            break;  //can happen if tabs are unusually short and cut off the curve
+        gc.setForeground(gradients[lastColorIndex]);
+        gc.drawPoint(lastX, lastY);
+    }
+    //draw right diagonal line highlight
+    for(int i = lastColorIndex; i < lastColorIndex + d; i++) {
+        if(i >= gradientsSize)
+            break;  //can happen if tabs are unusually short and cut off the curve
+        gc.setForeground(gradients[i]);
+        gc.drawPoint(1 + lastX++, 1 + lastY++);
+    }
+
+    //draw right swoop highlight from diagonal portion to end
+    for (int i = 0; i < parent.topCurveHighlightEnd.length /2; i++) {
+        int rawX = parent.topCurveHighlightEnd[i * 2]; //d is already encoded in this value
+        int rawY = parent.topCurveHighlightEnd[i * 2 + 1]; //d already encoded
+        lastX = rawX + rightEdgeOffset;
+        lastY = rawY + y;
+        lastColorIndex = rawY - 1;
+        if(lastColorIndex >= gradientsSize)
+            break;  //can happen if tabs are unusually short and cut off the curve
+        gc.setForeground(gradients[lastColorIndex]);
+        gc.drawPoint(lastX, lastY);
+    }
+}
+
+/*
+ * Draw the unselected border for the receiver on the right.
+ *
+ * @param gc
+ */
+void drawRightUnselectedBorder(GC gc) {
+
+    int[] shape = null;
+    int startX = x + width - 1;
+
+    if (this.parent.onBottom) {
+        int[] right = parent.simple
+            ? CTabFolder.SIMPLE_UNSELECTED_INNER_CORNER
+            : CTabFolder.BOTTOM_RIGHT_CORNER;
+
+        shape = new int[right.length + 2];
+        int index = 0;
+
+        for (int i = 0; i < right.length / 2; i++) {
+            shape[index++] = startX + right[2 * i];
+            shape[index++] = y + height + right[2 * i + 1] - 1;
+        }
+        shape[index++] = startX;
+        shape[index++] = y - 1;
+    } else {
+        int[] right = parent.simple
+            ? CTabFolder.SIMPLE_UNSELECTED_INNER_CORNER
+            : CTabFolder.TOP_RIGHT_CORNER;
+
+        shape = new int[right.length + 2];
+        int index = 0;
+
+        for (int i = 0; i < right.length / 2; i++) {
+            shape[index++] = startX + right[2 * i];
+            shape[index++] = y + right[2 * i + 1];
+        }
+
+        shape[index++] = startX;
+        shape[index++] = y + height;
+
+    }
+
+    drawBorder(gc, shape);
+
+}
+
+/*
+ * Draw the border of the tab
+ *
+ * @param gc
+ * @param shape
+ */
+void drawBorder(GC gc, int[] shape) {
+
+    gc.setForeground(CTabFolder.borderColor);
+    gc.drawPolyline(shape);
+}
+
+/*
+ * Draw the unselected border for the receiver on the left.
+ *
+ * @param gc
+ */
+void drawLeftUnselectedBorder(GC gc) {
+
+    int[] shape = null;
+    if (this.parent.onBottom) {
+        int[] left = parent.simple
+            ? CTabFolder.SIMPLE_UNSELECTED_INNER_CORNER
+            : CTabFolder.BOTTOM_LEFT_CORNER;
+
+        shape = new int[left.length + 2];
+        int index = 0;
+        shape[index++] = x;
+        shape[index++] = y - 1;
+        for (int i = 0; i < left.length / 2; i++) {
+            shape[index++] = x + left[2 * i];
+            shape[index++] = y + height + left[2 * i + 1] - 1;
+        }
+    } else {
+        int[] left = parent.simple
+            ? CTabFolder.SIMPLE_UNSELECTED_INNER_CORNER
+            : CTabFolder.TOP_LEFT_CORNER;
+
+        shape = new int[left.length + 2];
+        int index = 0;
+        shape[index++] = x;
+        shape[index++] = y + height;
+        for (int i = 0; i < left.length / 2; i++) {
+            shape[index++] = x + left[2 * i];
+            shape[index++] = y + left[2 * i + 1];
+        }
+
+    }
+
+    drawBorder(gc, shape);
+}
+
+void drawUnselected(GC gc) {
+    // Do not draw partial items
+    if (!showing) return;
+
+    Rectangle clipping = gc.getClipping();
+    Rectangle bounds = getBounds();
+    if (!clipping.intersects(bounds)) return;
+
+    // draw border
+    int index = parent.indexOf(this);
+
+    if (index > 0 && index < parent.selectedIndex)
+        drawLeftUnselectedBorder(gc);
+    // If it is the last one then draw a line
+    if (index > parent.selectedIndex)
+        drawRightUnselectedBorder(gc);
+
+    // draw Image
+    int xDraw = x + LEFT_MARGIN;
+    Image image = getImage();
+    if (image !is null && parent.showUnselectedImage) {
+        Rectangle imageBounds = image.getBounds();
+        // only draw image if it won't overlap with close button
+        int maxImageWidth = x + width - xDraw - RIGHT_MARGIN;
+        if (parent.showUnselectedClose && (parent.showClose || showClose)) {
+            maxImageWidth -= closeRect.width + INTERNAL_SPACING;
+        }
+        if (imageBounds.width < maxImageWidth) {
+            int imageX = xDraw;
+            int imageHeight = imageBounds.height;
+            int imageY = y + (height - imageHeight) / 2;
+            imageY += parent.onBottom ? -1 : 1;
+            int imageWidth = imageBounds.width * imageHeight / imageBounds.height;
+            gc.drawImage(image,
+                         imageBounds.x, imageBounds.y, imageBounds.width, imageBounds.height,
+                         imageX, imageY, imageWidth, imageHeight);
+            xDraw += imageWidth + INTERNAL_SPACING;
+        }
+    }
+    // draw Text
+    int textWidth = x + width - xDraw - RIGHT_MARGIN;
+    if (parent.showUnselectedClose && (parent.showClose || showClose)) {
+        textWidth -= closeRect.width + INTERNAL_SPACING;
+    }
+    if (textWidth > 0) {
+        Font gcFont = gc.getFont();
+        gc.setFont(font is null ? parent.getFont() : font);
+        if (shortenedText is null || shortenedTextWidth !is textWidth) {
+            shortenedText = shortenText(gc, getText(), textWidth);
+            shortenedTextWidth = textWidth;
+        }
+        Point extent = gc.textExtent(shortenedText, FLAGS);
+        int textY = y + (height - extent.y) / 2;
+        textY += parent.onBottom ? -1 : 1;
+        gc.setForeground(parent.getForeground());
+        gc.drawText(shortenedText, xDraw, textY, FLAGS);
+        gc.setFont(gcFont);
+    }
+    // draw close
+    if (parent.showUnselectedClose && (parent.showClose || showClose)) drawClose(gc);
+}
+/**
+ * Returns a rectangle describing the receiver's size and location
+ * relative to its parent.
+ *
+ * @return the receiver's bounding column rectangle
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Rectangle getBounds () {
+    //checkWidget();
+    int w = width;
+    if (!parent.simple && !parent.single && parent.indexOf(this) is parent.selectedIndex) w += parent.curveWidth - parent.curveIndent;
+    return new Rectangle(x, y, w, height);
+}
+/**
+* Gets the control that is displayed in the content area of the tab item.
+*
+* @return the control
+*
+* @exception SWTException <ul>
+*    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+*    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+* </ul>
+*/
+public Control getControl () {
+    checkWidget();
+    return control;
+}
+/**
+ * Get the image displayed in the tab if the tab is disabled.
+ *
+ * @return the disabled image or null
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @deprecated the disabled image is not used
+ */
+public Image getDisabledImage(){
+    checkWidget();
+    return disabledImage;
+}
+/**
+ * Returns the font that the receiver will use to paint textual information.
+ *
+ * @return the receiver's font
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ *  @since 3.0
+ */
+public Font getFont() {
+    checkWidget();
+    if (font !is null) return font;
+    return parent.getFont();
+}
+/**
+ * Returns the receiver's parent, which must be a <code>CTabFolder</code>.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public CTabFolder getParent () {
+    //checkWidget();
+    return parent;
+}
+/**
+ * Returns <code>true</code> to indicate that the receiver's close button should be shown.
+ * Otherwise return <code>false</code>. The initial value is defined by the style (SWT.CLOSE)
+ * that was used to create the receiver.
+ *
+ * @return <code>true</code> if the close button should be shown
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.4
+ */
+public bool getShowClose() {
+    checkWidget();
+    return showClose;
+}
+/**
+ * Returns the receiver's tool tip text, or null if it has
+ * not been set.
+ *
+ * @return the receiver's tool tip text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getToolTipText () {
+    checkWidget();
+    if (toolTipText is null && shortenedText !is null) {
+        String text = getText();
+        if (shortenedText!=text) return text;
+    }
+    return toolTipText;
+}
+/**
+* Returns <code>true</code> if the item will be rendered in the visible area of the CTabFolder. Returns false otherwise.
+*
+*  @return <code>true</code> if the item will be rendered in the visible area of the CTabFolder. Returns false otherwise.
+*
+*  @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+* @since 3.0
+*/
+public bool isShowing () {
+    checkWidget();
+    return showing;
+}
+void onPaint(GC gc, bool isSelected) {
+    if (width is 0 || height is 0) return;
+    if (isSelected) {
+        drawSelected(gc);
+    } else {
+        drawUnselected(gc);
+    }
+}
+int preferredHeight(GC gc) {
+    Image image = getImage();
+    int h = (image is null) ? 0 : image.getBounds().height;
+    String text = getText();
+    if (font is null) {
+        h = Math.max(h, gc.textExtent(text, FLAGS).y);
+    } else {
+        Font gcFont = gc.getFont();
+        gc.setFont(font);
+        h = Math.max(h, gc.textExtent(text, FLAGS).y);
+        gc.setFont(gcFont);
+    }
+    return h + TOP_MARGIN + BOTTOM_MARGIN;
+}
+int preferredWidth(GC gc, bool isSelected, bool minimum) {
+    // NOTE: preferred width does not include the "dead space" caused
+    // by the curve.
+    if (isDisposed()) return 0;
+    int w = 0;
+    Image image = getImage();
+    if (image !is null && (isSelected || parent.showUnselectedImage)) {
+        w += image.getBounds().width;
+    }
+    String text = null;
+    if (minimum) {
+        int minChars = parent.minChars;
+        text = minChars is 0 ? null : getText();
+        if (text !is null && text.length > minChars) {
+            if (useEllipses()) {
+                int end = minChars < ELLIPSIS.length + 1 ? minChars : minChars - ELLIPSIS.length;
+                text = text[ 0 .. end ];
+                if (minChars > ELLIPSIS.length + 1) text ~= ELLIPSIS;
+            } else {
+                int end = minChars;
+                text = text[ 0 .. end ];
+            }
+        }
+    } else {
+        text = getText();
+    }
+    if (text !is null) {
+        if (w > 0) w += INTERNAL_SPACING;
+        if (font is null) {
+            w += gc.textExtent(text, FLAGS).x;
+        } else {
+            Font gcFont = gc.getFont();
+            gc.setFont(font);
+            w += gc.textExtent(text, FLAGS).x;
+            gc.setFont(gcFont);
+        }
+    }
+    if (parent.showClose || showClose) {
+        if (isSelected || parent.showUnselectedClose) {
+            if (w > 0) w += INTERNAL_SPACING;
+            w += CTabFolder.BUTTON_SIZE;
+        }
+    }
+    return w + LEFT_MARGIN + RIGHT_MARGIN;
+}
+/**
+ * Sets the control that is used to fill the client area of
+ * the tab folder when the user selects the tab item.
+ *
+ * @param control the new control (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the control has been disposed</li>
+ *    <li>ERROR_INVALID_PARENT - if the control is not in the same widget tree</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setControl (Control control) {
+    checkWidget();
+    if (control !is null) {
+        if (control.isDisposed()) SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+        if (control.getParent() !is parent) SWT.error (SWT.ERROR_INVALID_PARENT);
+    }
+    if (this.control !is null && !this.control.isDisposed()) {
+        this.control.setVisible(false);
+    }
+    this.control = control;
+    if (this.control !is null) {
+        int index = parent.indexOf (this);
+        if (index is parent.getSelectionIndex ()){
+            this.control.setBounds(parent.getClientArea ());
+            this.control.setVisible(true);
+        } else {
+            this.control.setVisible(false);
+        }
+    }
+}
+/**
+ * Sets the image that is displayed if the tab item is disabled.
+ * Null will clear the image.
+ *
+ * @param image the image to be displayed when the item is disabled or null
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @deprecated This image is not used
+ */
+public void setDisabledImage (Image image) {
+    checkWidget();
+    if (image !is null && image.isDisposed ()) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    this.disabledImage = image;
+}
+/**
+ * Sets the font that the receiver will use to paint textual information
+ * for this item to the font specified by the argument, or to the default font
+ * for that kind of control if the argument is null.
+ *
+ * @param font the new font (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setFont (Font font){
+    checkWidget();
+    if (font !is null && font.isDisposed ()) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (font is null && this.font is null) return;
+    if (font !is null && font==this.font) return;
+    this.font = font;
+    if (!parent.updateTabHeight(false)) {
+        parent.updateItems();
+        parent.redrawTabs();
+    }
+}
+public override void setImage (Image image) {
+    checkWidget();
+    if (image !is null && image.isDisposed ()) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    Image oldImage = getImage();
+    if (image is null && oldImage is null) return;
+    if (image !is null && image==oldImage) return;
+    super.setImage(image);
+    if (!parent.updateTabHeight(false)) {
+        // If image is the same size as before,
+        // redraw only the image
+        if (oldImage !is null && image !is null) {
+            Rectangle oldBounds = oldImage.getBounds();
+            Rectangle bounds = image.getBounds();
+            if (bounds.width is oldBounds.width && bounds.height is oldBounds.height) {
+                if (showing) {
+                    bool selected = parent.indexOf(this) is parent.selectedIndex;
+                    if (selected || parent.showUnselectedImage) {
+                        int imageX = x + LEFT_MARGIN, maxImageWidth;
+                        if (selected) {
+                            if (parent.single && (parent.showClose || showClose)) imageX += CTabFolder.BUTTON_SIZE;
+                            int rightEdge = Math.min (x + width, parent.getRightItemEdge());
+                            maxImageWidth = rightEdge - imageX - RIGHT_MARGIN;
+                            if (!parent.single && closeRect.width > 0) maxImageWidth -= closeRect.width + INTERNAL_SPACING;
+                        } else {
+                            maxImageWidth = x + width - imageX - RIGHT_MARGIN;
+                            if (parent.showUnselectedClose && (parent.showClose || showClose)) {
+                                maxImageWidth -= closeRect.width + INTERNAL_SPACING;
+                            }
+                        }
+                        if (bounds.width < maxImageWidth) {
+                            int imageY = y + (height - bounds.height) / 2 + (parent.onBottom ? -1 : 1);
+                            parent.redraw(imageX, imageY, bounds.width, bounds.height, false);
+                        }
+                    }
+                }
+                return;
+            }
+        }
+        parent.updateItems();
+        parent.redrawTabs();
+    }
+}
+/**
+ * Sets to <code>true</code> to indicate that the receiver's close button should be shown.
+ * If the parent (CTabFolder) was created with SWT.CLOSE style, changing this value has
+ * no effect.
+ *
+ * @param close the new state of the close button
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.4
+ */
+public void setShowClose(bool close) {
+    checkWidget();
+    if (showClose is close) return;
+    showClose = close;
+    parent.updateItems();
+    parent.redrawTabs();
+}
+public override void setText (String string) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (string is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    if (string.equals (getText())) return;
+    super.setText(string);
+    shortenedText = null;
+    shortenedTextWidth = 0;
+    if (!parent.updateTabHeight(false)) {
+        parent.updateItems();
+        parent.redrawTabs();
+    }
+}
+/**
+ * Sets the receiver's tool tip text to the argument, which
+ * may be null indicating that no tool tip text should be shown.
+ *
+ * @param string the new tool tip text (or null)
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setToolTipText (String string) {
+    checkWidget();
+    toolTipText = string;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/ControlEditor.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,262 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.ControlEditor;
+
+import java.lang.all;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.ScrollBar;
+
+/**
+*
+* A ControlEditor is a manager for a Control that appears above a composite and tracks with the
+* moving and resizing of that composite.  It can be used to display one control above
+* another control.  This could be used when editing a control that does not have editing
+* capabilities by using a text editor or for launching a dialog by placing a button
+* above a control.
+*
+* <p> Here is an example of using a ControlEditor:
+*
+* <code><pre>
+* Canvas canvas = new Canvas(shell, SWT.BORDER);
+* canvas.setBounds(10, 10, 300, 300);
+* Color color = new Color(null, 255, 0, 0);
+* canvas.setBackground(color);
+* ControlEditor editor = new ControlEditor (canvas);
+* // The editor will be a button in the bottom right corner of the canvas.
+* // When selected, it will launch a Color dialog that will change the background
+* // of the canvas.
+* Button button = new Button(canvas, SWT.PUSH);
+* button.setText("Select Color...");
+* button.addSelectionListener (new SelectionAdapter() {
+*   public void widgetSelected(SelectionEvent e) {
+*       ColorDialog dialog = new ColorDialog(shell);
+*       dialog.open();
+*       RGB rgb = dialog.getRGB();
+*       if (rgb !is null) {
+*           if (color !is null) color.dispose();
+*           color = new Color(null, rgb);
+*           canvas.setBackground(color);
+*       }
+*
+*   }
+* });
+*
+* editor.horizontalAlignment = SWT.RIGHT;
+* editor.verticalAlignment = SWT.BOTTOM;
+* editor.grabHorizontal = false;
+* editor.grabVertical = false;
+* Point size = button.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+* editor.minimumWidth = size.x;
+* editor.minimumHeight = size.y;
+* editor.setEditor (button);
+* </pre></code>
+*
+* @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+*/
+public class ControlEditor {
+
+    /**
+    * Specifies how the editor should be aligned relative to the control.  Allowed values
+    * are SWT.LEFT, SWT.RIGHT and SWT.CENTER.  The default value is SWT.CENTER.
+    */
+    public int horizontalAlignment = SWT.CENTER;
+
+    /**
+    * Specifies whether the editor should be sized to use the entire width of the control.
+    * True means resize the editor to the same width as the cell.  False means do not adjust
+    * the width of the editor.  The default value is false.
+    */
+    public bool grabHorizontal = false;
+
+    /**
+    * Specifies the minimum width the editor can have.  This is used in association with
+    * a true value of grabHorizontal.  If the cell becomes smaller than the minimumWidth, the
+    * editor will not made smaller than the minimum width value.  The default value is 0.
+    */
+    public int minimumWidth = 0;
+
+    /**
+    * Specifies how the editor should be aligned relative to the control.  Allowed values
+    * are SWT.TOP, SWT.BOTTOM and SWT.CENTER.  The default value is SWT.CENTER.
+    */
+    public int verticalAlignment = SWT.CENTER;
+
+    /**
+    * Specifies whether the editor should be sized to use the entire height of the control.
+    * True means resize the editor to the same height as the underlying control.  False means do not adjust
+    * the height of the editor. The default value is false.
+    */
+    public bool grabVertical = false;
+
+    /**
+    * Specifies the minimum height the editor can have.  This is used in association with
+    * a true value of grabVertical.  If the control becomes smaller than the minimumHeight, the
+    * editor will not made smaller than the minimum height value.  The default value is 0.
+    */
+    public int minimumHeight = 0;
+
+    Composite parent;
+    Control editor;
+    private bool hadFocus;
+    private Listener controlListener;
+    private Listener scrollbarListener;
+
+    private final static int [] EVENTS = [SWT.KeyDown, SWT.KeyUp, SWT.MouseDown, SWT.MouseUp, SWT.Resize];
+/**
+* Creates a ControlEditor for the specified Composite.
+*
+* @param parent the Composite above which this editor will be displayed
+*
+*/
+public this (Composite parent) {
+    this.parent = parent;
+
+    controlListener = new class() Listener {
+        public void handleEvent(Event e) {
+            layout ();
+        }
+    };
+    for (int i=0; i<EVENTS.length; i++) {
+        parent.addListener (EVENTS [i], controlListener);
+    }
+
+    scrollbarListener = new class() Listener {
+        public void handleEvent(Event e) {
+            scroll (e);
+        }
+    };
+    ScrollBar hBar = parent.getHorizontalBar ();
+    if (hBar !is null) hBar.addListener (SWT.Selection, scrollbarListener);
+    ScrollBar vBar = parent.getVerticalBar ();
+    if (vBar !is null) vBar.addListener (SWT.Selection, scrollbarListener);
+}
+Rectangle computeBounds () {
+    Rectangle clientArea = parent.getClientArea();
+    Rectangle editorRect = new Rectangle(clientArea.x, clientArea.y, minimumWidth, minimumHeight);
+
+    if (grabHorizontal)
+        editorRect.width = Math.max(clientArea.width, minimumWidth);
+
+    if (grabVertical)
+        editorRect.height = Math.max(clientArea.height, minimumHeight);
+
+    switch (horizontalAlignment) {
+        case SWT.RIGHT:
+            editorRect.x += clientArea.width - editorRect.width;
+            break;
+        case SWT.LEFT:
+            // do nothing - clientArea.x is the right answer
+            break;
+        default:
+            // default is CENTER
+            editorRect.x += (clientArea.width - editorRect.width)/2;
+    }
+
+    switch (verticalAlignment) {
+        case SWT.BOTTOM:
+            editorRect.y += clientArea.height - editorRect.height;
+            break;
+        case SWT.TOP:
+            // do nothing - clientArea.y is the right answer
+            break;
+        default :
+            // default is CENTER
+            editorRect.y += (clientArea.height - editorRect.height)/2;
+    }
+
+
+    return editorRect;
+
+}
+/**
+ * Removes all associations between the Editor and the underlying composite.  The
+ * composite and the editor Control are <b>not</b> disposed.
+ */
+public void dispose () {
+    if (parent !is null && !parent.isDisposed()) {
+        for (int i=0; i<EVENTS.length; i++) {
+            parent.removeListener (EVENTS [i], controlListener);
+        }
+        ScrollBar hBar = parent.getHorizontalBar ();
+        if (hBar !is null) hBar.removeListener (SWT.Selection, scrollbarListener);
+        ScrollBar vBar = parent.getVerticalBar ();
+        if (vBar !is null) vBar.removeListener (SWT.Selection, scrollbarListener);
+    }
+
+    parent = null;
+    editor = null;
+    hadFocus = false;
+    controlListener = null;
+    scrollbarListener = null;
+}
+/**
+* Returns the Control that is displayed above the composite being edited.
+*
+* @return the Control that is displayed above the composite being edited
+*/
+public Control getEditor () {
+    return editor;
+}
+/**
+ * Lays out the control within the underlying composite.  This
+ * method should be called after changing one or more fields to
+ * force the Editor to resize.
+ *
+ * @since 2.1
+ */
+public void layout () {
+    if (editor is null || editor.isDisposed()) return;
+    if (editor.getVisible ()) {
+        hadFocus = editor.isFocusControl();
+    } // this doesn't work because
+      // resizing the column takes the focus away
+      // before we get here
+    editor.setBounds (computeBounds ());
+    if (hadFocus) {
+        if (editor is null || editor.isDisposed()) return;
+        editor.setFocus ();
+    }
+}
+void scroll (Event e) {
+    if (editor is null || editor.isDisposed()) return;
+    layout();
+}
+/**
+* Specify the Control that is to be displayed.
+*
+* <p>Note: The Control provided as the editor <b>must</b> be created with its parent
+* being the Composite specified in the ControlEditor constructor.
+*
+* @param editor the Control that is displayed above the composite being edited
+*/
+public void setEditor (Control editor) {
+
+    if (editor is null) {
+        // this is the case where the caller is setting the editor to be blank
+        // set all the values accordingly
+        this.editor = null;
+        return;
+    }
+
+    this.editor = editor;
+    layout();
+    if (this.editor is null || this.editor.isDisposed()) return;
+    editor.setVisible(true);
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/DefaultContent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,921 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.DefaultContent;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.internal.Compatibility;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.custom.StyledTextContent;
+import org.eclipse.swt.custom.TextChangeListener;
+import org.eclipse.swt.custom.StyledTextEvent;
+import org.eclipse.swt.custom.StyledTextListener;
+import org.eclipse.swt.custom.StyledText;
+import java.lang.all;
+
+static import tango.io.model.IFile;
+
+
+class DefaultContent : StyledTextContent {
+    private final static String LineDelimiter = tango.io.model.IFile.FileConst.NewlineString;
+
+    StyledTextListener[] textListeners; // stores text listeners for event sending
+    char[] textStore; // stores the actual text
+    int gapStart = -1;  // the character position start of the gap
+    int gapEnd = -1;    // the character position after the end of the gap
+    int gapLine = -1;   // the line on which the gap exists, the gap will always be associated with one line
+    int highWatermark = 300;
+    int lowWatermark = 50;
+
+    int[][] lines; // array of character positions and lengths representing the lines of text
+    int lineCount_ = 0;  // the number of lines of text
+    int expandExp = 1;  // the expansion exponent, used to increase the lines array exponentially
+    int replaceExpandExp = 1;   // the expansion exponent, used to increase the lines array exponentially
+
+/**
+ * Creates a new DefaultContent and initializes it.  A <code>StyledTextContent</> will always have
+ * at least one empty line.
+ */
+this() {
+    lines = new int[][]( 50, 2 );
+    setText("");
+}
+/**
+ * Adds a line to the end of the line indexes array.  Increases the size of the array if necessary.
+ * <code>lineCount</code> is updated to reflect the new entry.
+ * <p>
+ *
+ * @param start the start of the line
+ * @param length the length of the line
+ */
+void addLineIndex(int start, int length) {
+    int size = lines.length;
+    if (lineCount_ is size) {
+        // expand the lines by powers of 2
+        int[][] newLines = new int[][]( size+Compatibility.pow2(expandExp), 2 );
+        System.arraycopy(lines, 0, newLines, 0, size);
+        lines = newLines;
+        expandExp++;
+    }
+    int[] range = [start, length];
+    lines[lineCount_] = range;
+    lineCount_++;
+}
+/**
+ * Adds a line index to the end of <code>linesArray</code>.  Increases the
+ * size of the array if necessary and returns a new array.
+ * <p>
+ *
+ * @param start the start of the line
+ * @param length the length of the line
+ * @param linesArray the array to which to add the line index
+ * @param count the position at which to add the line
+ * @return a new array of line indexes
+ */
+int[][] addLineIndex(int start, int length, int[][] linesArray, int count) {
+    int size = linesArray.length;
+    int[][] newLines = linesArray;
+    if (count is size) {
+        newLines = new int[][]( size+Compatibility.pow2(replaceExpandExp), 2 );
+        replaceExpandExp++;
+        System.arraycopy(linesArray, 0, newLines, 0, size);
+    }
+    int[] range = [start, length];
+    newLines[count] = range;
+    return newLines;
+}
+/**
+ * Adds a <code>TextChangeListener</code> listening for
+ * <code>TextChangingEvent</code> and <code>TextChangedEvent</code>. A
+ * <code>TextChangingEvent</code> is sent before changes to the text occur.
+ * A <code>TextChangedEvent</code> is sent after changes to the text
+ * occurred.
+ * <p>
+ *
+ * @param listener the listener
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when listener is null</li>
+ * </ul>
+ */
+public void addTextChangeListener(TextChangeListener listener) {
+    if (listener is null) error(SWT.ERROR_NULL_ARGUMENT);
+    StyledTextListener typedListener = new StyledTextListener(listener);
+    textListeners ~= typedListener;
+}
+/**
+ * Adjusts the gap to accommodate a text change that is occurring.
+ * <p>
+ *
+ * @param position the position at which a change is occurring
+ * @param sizeHint the size of the change
+ * @param line the line where the gap will go
+ */
+void adjustGap(int position, int sizeHint, int line) {
+    if (position is gapStart) {
+        // text is being inserted at the gap position
+        int size = (gapEnd - gapStart) - sizeHint;
+        if (lowWatermark <= size && size <= highWatermark)
+            return;
+    } else if ((position + sizeHint is gapStart) && (sizeHint < 0)) {
+        // text is being deleted at the gap position
+        int size = (gapEnd - gapStart) - sizeHint;
+        if (lowWatermark <= size && size <= highWatermark)
+            return;
+    }
+    moveAndResizeGap(position, sizeHint, line);
+}
+/**
+ * Calculates the indexes of each line in the text store.  Assumes no gap exists.
+ * Optimized to do less checking.
+ */
+void indexLines(){
+    int start = 0;
+    lineCount_ = 0;
+    int textLength = textStore.length;
+    int i;
+    for (i = start; i < textLength; i++) {
+        char ch = textStore[i];
+        if (ch is SWT.CR) {
+            // see if the next character is a LF
+            if (i + 1 < textLength) {
+                ch = textStore[i+1];
+                if (ch is SWT.LF) {
+                    i++;
+                }
+            }
+            addLineIndex(start, i - start + 1);
+            start = i + 1;
+        } else if (ch is SWT.LF) {
+            addLineIndex(start, i - start + 1);
+            start = i + 1;
+        }
+    }
+    addLineIndex(start, i - start);
+}
+/**
+ * Returns whether or not the given character is a line delimiter.  Both CR and LF
+ * are valid line delimiters.
+ * <p>
+ *
+ * @param ch the character to test
+ * @return true if ch is a delimiter, false otherwise
+ */
+bool isDelimiter(char ch) {
+    if (ch is SWT.CR) return true;
+    if (ch is SWT.LF) return true;
+    return false;
+}
+/**
+ * Determine whether or not the replace operation is valid.  DefaultContent will not allow
+ * the /r/n line delimiter to be split or partially deleted.
+ * <p>
+ *
+ * @param start start offset of text to replace
+ * @param replaceLength start offset of text to replace
+ * @param newText start offset of text to replace
+ * @return a bool specifying whether or not the replace operation is valid
+ */
+protected bool isValidReplace(int start, int replaceLength, String newText){
+    if (replaceLength is 0) {
+        // inserting text, see if the \r\n line delimiter is being split
+        if (start is 0) return true;
+        if (start is getCharCount()) return true;
+        char before = getTextRange(start - 1, 1)[0];
+        if (before is '\r') {
+            char after = getTextRange(start, 1)[0];
+            if (after is '\n') return false;
+        }
+    } else {
+        // deleting text, see if part of a \r\n line delimiter is being deleted
+        char startChar = getTextRange(start, 1)[0];
+        if (startChar is '\n') {
+            // see if char before delete position is \r
+            if (start !is 0) {
+                char before = getTextRange(start - 1, 1)[0];
+                if (before is '\r') return false;
+            }
+        }
+        char endChar = getTextRange(start + replaceLength - 1, 1)[0];
+        if (endChar is '\r') {
+            // see if char after delete position is \n
+            if (start + replaceLength !is getCharCount()) {
+                char after = getTextRange(start + replaceLength, 1)[0];
+                if (after is '\n') return false;
+            }
+        }
+    }
+    return true;
+}
+/**
+ * Calculates the indexes of each line of text in the given range.
+ * <p>
+ *
+ * @param offset the logical start offset of the text lineate
+ * @param length the length of the text to lineate, includes gap
+ * @param numLines the number of lines to initially allocate for the line index array,
+ *  passed in for efficiency (the exact number of lines may be known)
+ * @return a line indexes array where each line is identified by a start offset and
+ *  a length
+ */
+int[][] indexLines(int offset, int length, int numLines){
+    int[][] indexedLines = new int[][]( numLines, 2 );
+    int start = 0;
+    int lineCount_ = 0;
+    int i;
+    replaceExpandExp = 1;
+    for (i = start; i < length; i++) {
+        int location = i + offset;
+        if ((location >= gapStart) && (location < gapEnd)) {
+            // ignore the gap
+        } else {
+            char ch = textStore[location];
+            if (ch is SWT.CR) {
+                // see if the next character is a LF
+                if (location+1 < textStore.length) {
+                    ch = textStore[location+1];
+                    if (ch is SWT.LF) {
+                        i++;
+                    }
+                }
+                indexedLines = addLineIndex(start, i - start + 1, indexedLines, lineCount_);
+                lineCount_++;
+                start = i + 1;
+            } else if (ch is SWT.LF) {
+                indexedLines = addLineIndex(start, i - start + 1, indexedLines, lineCount_);
+                lineCount_++;
+                start = i + 1;
+            }
+        }
+    }
+    int[][] newLines = new int[][]( lineCount_+1, 2 );
+    System.arraycopy(indexedLines, 0, newLines, 0, lineCount_);
+    int[] range = [start, i - start];
+    newLines[lineCount_] = range;
+    return newLines;
+}
+/**
+ * Inserts text.
+ * <p>
+ *
+ * @param position the position at which to insert the text
+ * @param text the text to insert
+ */
+void insert(int position, String text) {
+    if (text.length is 0) return;
+
+    int startLine = getLineAtOffset(position);
+    int change = text.length;
+    bool endInsert = position is getCharCount();
+    adjustGap(position, change, startLine);
+
+    // during an insert the gap will be adjusted to start at
+    // position and it will be associated with startline, the
+    // inserted text will be placed in the gap
+    int startLineOffset = getOffsetAtLine(startLine);
+    // at this point, startLineLength will include the start line
+    // and all of the newly inserted text
+    int startLineLength = getPhysicalLine(startLine).length;
+
+    if (change > 0) {
+        // shrink gap
+        gapStart += (change);
+        for (int i = 0; i < text.length; i++) {
+            textStore[position + i]= text[i];
+        }
+    }
+
+    // figure out the number of new lines that have been inserted
+    int [][] newLines = indexLines(startLineOffset, startLineLength, 10);
+    // only insert an empty line if it is the last line in the text
+    int numNewLines = newLines.length - 1;
+    if (newLines[numNewLines][1] is 0) {
+        // last inserted line is a new line
+        if (endInsert) {
+            // insert happening at end of the text, leave numNewLines as
+            // is since the last new line will not be concatenated with another
+            // line
+            numNewLines += 1;
+        } else {
+            numNewLines -= 1;
+        }
+    }
+
+    // make room for the new lines
+    expandLinesBy(numNewLines);
+    // shift down the lines after the replace line
+    for (int i = lineCount_ - 1; i > startLine; i--) {
+        lines[i + numNewLines]=lines[i];
+    }
+    // insert the new lines
+    for (int i = 0; i < numNewLines; i++) {
+        newLines[i][0] += startLineOffset;
+        lines[startLine + i]=newLines[i];
+    }
+    // update the last inserted line
+    if (numNewLines < newLines.length) {
+        newLines[numNewLines][0] += startLineOffset;
+        lines[startLine + numNewLines] = newLines[numNewLines];
+    }
+
+    lineCount_ += numNewLines;
+    gapLine = getLineAtPhysicalOffset(gapStart);
+}
+/**
+ * Moves the gap and adjusts its size in anticipation of a text change.
+ * The gap is resized to actual size + the specified size and moved to the given
+ * position.
+ * <p>
+ *
+ * @param position the position at which a change is occurring
+ * @param size the size of the change
+ * @param newGapLine the line where the gap should be put
+ */
+void moveAndResizeGap(int position, int size, int newGapLine) {
+    char[] content = null;
+    int oldSize = gapEnd - gapStart;
+    int newSize;
+    if (size > 0) {
+        newSize = highWatermark + size;
+    } else {
+        newSize = lowWatermark - size;
+    }
+    // remove the old gap from the lines information
+    if (gapExists()) {
+        // adjust the line length
+        lines[gapLine][1] = lines[gapLine][1] - oldSize;
+        // adjust the offsets of the lines after the gapLine
+        for (int i = gapLine + 1; i < lineCount_; i++) {
+            lines[i][0] = lines[i][0] - oldSize;
+        }
+    }
+
+    if (newSize < 0) {
+        if (oldSize > 0) {
+            // removing the gap
+            content = new char[textStore.length - oldSize];
+            System.arraycopy(textStore, 0, content, 0, gapStart);
+            System.arraycopy(textStore, gapEnd, content, gapStart, content.length - gapStart);
+            textStore = content;
+        }
+        gapStart = gapEnd = position;
+        return;
+    }
+    content = new char[textStore.length + (newSize - oldSize)];
+    int newGapStart = position;
+    int newGapEnd = newGapStart + newSize;
+    if (oldSize is 0) {
+        System.arraycopy(textStore, 0, content, 0, newGapStart);
+        System.arraycopy(textStore, newGapStart, content, newGapEnd, content.length - newGapEnd);
+    } else if (newGapStart < gapStart) {
+        int delta = gapStart - newGapStart;
+        System.arraycopy(textStore, 0, content, 0, newGapStart);
+        System.arraycopy(textStore, newGapStart, content, newGapEnd, delta);
+        System.arraycopy(textStore, gapEnd, content, newGapEnd + delta, textStore.length - gapEnd);
+    } else {
+        int delta = newGapStart - gapStart;
+        System.arraycopy(textStore, 0, content, 0, gapStart);
+        System.arraycopy(textStore, gapEnd, content, gapStart, delta);
+        System.arraycopy(textStore, gapEnd + delta, content, newGapEnd, content.length - newGapEnd);
+    }
+    textStore = content;
+    gapStart = newGapStart;
+    gapEnd = newGapEnd;
+
+    // add the new gap to the lines information
+    if (gapExists()) {
+        gapLine = newGapLine;
+        // adjust the line length
+        int gapLength = gapEnd - gapStart;
+        lines[gapLine][1] = lines[gapLine][1] + (gapLength);
+        // adjust the offsets of the lines after the gapLine
+        for (int i = gapLine + 1; i < lineCount_; i++) {
+            lines[i][0] = lines[i][0] + gapLength;
+        }
+    }
+}
+/**
+ * Returns the number of lines that are in the specified text.
+ * <p>
+ *
+ * @param startOffset the start of the text to lineate
+ * @param length the length of the text to lineate
+ * @return number of lines
+ */
+int lineCount(int startOffset, int length){
+    if (length is 0) {
+        return 0;
+    }
+    int lineCount_ = 0;
+    int count = 0;
+    int i = startOffset;
+    if (i >= gapStart) {
+        i += gapEnd - gapStart;
+    }
+    while (count < length) {
+        if ((i >= gapStart) && (i < gapEnd)) {
+            // ignore the gap
+        } else {
+            char ch = textStore[i];
+            if (ch is SWT.CR) {
+                // see if the next character is a LF
+                if (i + 1 < textStore.length) {
+                    ch = textStore[i+1];
+                    if (ch is SWT.LF) {
+                        i++;
+                        count++;
+                    }
+                }
+                lineCount_++;
+            } else if (ch is SWT.LF) {
+                lineCount_++;
+            }
+            count++;
+        }
+        i++;
+    }
+    return lineCount_;
+}
+/**
+ * Returns the number of lines that are in the specified text.
+ * <p>
+ *
+ * @param text the text to lineate
+ * @return number of lines in the text
+ */
+int lineCount(String text){
+    int lineCount_ = 0;
+    int length = text.length;
+    for (int i = 0; i < length; i++) {
+        char ch = text[i];
+        if (ch is SWT.CR) {
+            if (i + 1 < length && text[i + 1] is SWT.LF) {
+                i++;
+            }
+            lineCount_++;
+        } else if (ch is SWT.LF) {
+            lineCount_++;
+        }
+    }
+    return lineCount_;
+}
+/**
+ * @return the logical length of the text store
+ */
+public int getCharCount() {
+    int length = gapEnd - gapStart;
+    return (textStore.length - length);
+}
+/**
+ * Returns the line at <code>index</code> without delimiters.
+ * <p>
+ *
+ * @param index the index of the line to return
+ * @return the logical line text (i.e., without the gap)
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_INVALID_ARGUMENT when index is out of range</li>
+ * </ul>
+ */
+public String getLine(int index) {
+    if ((index >= lineCount_) || (index < 0)) error(SWT.ERROR_INVALID_ARGUMENT);
+    int start = lines[index][0];
+    int length_ = lines[index][1];
+    int end = start + length_ - 1;
+    if (!gapExists() || (end < gapStart) || (start >= gapEnd)) {
+        // line is before or after the gap
+        while ((length_ - 1 >= 0) && isDelimiter(textStore[start+length_-1])) {
+            length_--;
+        }
+        return textStore[ start .. start + length_].dup;
+    } else {
+        // gap is in the specified range, strip out the gap
+        StringBuffer buf = new StringBuffer();
+        int gapLength = gapEnd - gapStart;
+        buf.append(textStore[ start .. gapStart ] );
+        buf.append(textStore[ gapEnd .. gapEnd + length_ - gapLength - (gapStart - start) ]);
+        length_ = buf.length;
+        while ((length_ - 1 >=0) && isDelimiter(buf.slice[length_ - 1])) {
+            length_--;
+        }
+        return buf.toString()[ 0 .. length_ ].dup;
+    }
+}
+/**
+ * Returns the line delimiter that should be used by the StyledText
+ * widget when inserting new lines.  This delimiter may be different than the
+ * delimiter that is used by the <code>StyledTextContent</code> interface.
+ * <p>
+ *
+ * @return the platform line delimiter as specified in the line.separator
+ *  system property.
+ */
+public String getLineDelimiter() {
+    return LineDelimiter;
+}
+/**
+ * Returns the line at the given index with delimiters.
+ * <p>
+ * @param index the index of the line to return
+ * @return the logical line text (i.e., without the gap) with delimiters
+ */
+String getFullLine(int index) {
+    int start = lines[index][0];
+    int length_ = lines[index][1];
+    int end = start + length_ - 1;
+    if (!gapExists() || (end < gapStart) || (start >= gapEnd)) {
+        // line is before or after the gap
+        return textStore[ start .. start + length_ ].dup;
+    } else {
+        // gap is in the specified range, strip out the gap
+        StringBuffer buffer = new StringBuffer();
+        int gapLength = gapEnd - gapStart;
+        buffer.append(textStore[ start .. gapStart ]);
+        buffer.append(textStore[ gapEnd .. gapEnd + length_ - gapLength - (gapStart - start) ]);
+        return buffer.toString().dup;
+    }
+}
+/**
+ * Returns the physical line at the given index (i.e., with delimiters and the gap).
+ * <p>
+ *
+ * @param index the line index
+ * @return the physical line
+ */
+String getPhysicalLine(int index) {
+    int start = lines[index][0];
+    int length_ = lines[index][1];
+    return getPhysicalText(start, length_);
+}
+/**
+ * @return the number of lines in the text store
+ */
+public int getLineCount(){
+    return lineCount_;
+}
+/**
+ * Returns the line at the given offset.
+ * <p>
+ *
+ * @param charPosition logical character offset (i.e., does not include gap)
+ * @return the line index
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT when charPosition is out of range</li>
+ * </ul>
+ */
+public int getLineAtOffset(int charPosition){
+    if ((charPosition > getCharCount()) || (charPosition < 0)) error(SWT.ERROR_INVALID_ARGUMENT);
+    int position;
+    if (charPosition < gapStart) {
+        // position is before the gap
+        position = charPosition;
+    } else {
+        // position includes the gap
+        position = charPosition + (gapEnd - gapStart);
+    }
+
+    // if last line and the line is not empty you can ask for
+    // a position that doesn't exist (the one to the right of the
+    // last character) - for inserting
+    if (lineCount_ > 0) {
+        int lastLine = lineCount_ - 1;
+        if (position is lines[lastLine][0] + lines[lastLine][1])
+            return lastLine;
+    }
+
+    int high = lineCount_;
+    int low = -1;
+    int index = lineCount_;
+    while (high - low > 1) {
+        index = (high + low) / 2;
+        int lineStart = lines[index][0];
+        int lineEnd = lineStart + lines[index][1] - 1;
+        if (position <= lineStart) {
+            high = index;
+        } else if (position <= lineEnd) {
+            high = index;
+            break;
+        } else {
+            low = index;
+        }
+    }
+    return high;
+}
+/**
+ * Returns the line index at the given physical offset.
+ * <p>
+ *
+ * @param position physical character offset (i.e., includes gap)
+ * @return the line index
+ */
+int getLineAtPhysicalOffset(int position){
+    int high = lineCount_;
+    int low = -1;
+    int index = lineCount_;
+    while (high - low > 1) {
+        index = (high + low) / 2;
+        int lineStart = lines[index][0];
+        int lineEnd = lineStart + lines[index][1] - 1;
+        if (position <= lineStart) {
+            high = index;
+        } else if (position <= lineEnd) {
+            high = index;
+            break;
+        } else {
+            low = index;
+        }
+    }
+    return high;
+}
+/**
+ * Returns the logical offset of the given line.
+ * <p>
+ *
+ * @param lineIndex index of line
+ * @return the logical starting offset of the line.  When there are not any lines,
+ *  getOffsetAtLine(0) is a valid call that should answer 0.
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_INVALID_ARGUMENT when lineIndex is out of range</li>
+ * </ul>
+ */
+public int getOffsetAtLine(int lineIndex) {
+    if (lineIndex is 0) return 0;
+    if ((lineIndex >= lineCount_) || (lineIndex < 0)) error(SWT.ERROR_INVALID_ARGUMENT);
+    int start = lines[lineIndex][0];
+    if (start > gapEnd) {
+        return start - (gapEnd - gapStart);
+    } else {
+        return start;
+    }
+}
+/**
+ * Increases the line indexes array to accommodate more lines.
+ * <p>
+ *
+ * @param numLines the number to increase the array by
+ */
+void expandLinesBy(int numLines) {
+    int size = lines.length;
+    if (size - lineCount_ >= numLines) {
+        return;
+    }
+    int[][] newLines = new int[][]( size+Math.max(10, numLines), 2 );
+    System.arraycopy(lines, 0, newLines, 0, size);
+    lines = newLines;
+}
+/**
+ * Reports an SWT error.
+ * <p>
+ *
+ * @param code the error code
+ */
+void error (int code) {
+    SWT.error(code);
+}
+/**
+ * Returns whether or not a gap exists in the text store.
+ * <p>
+ *
+ * @return true if gap exists, false otherwise
+ */
+bool gapExists() {
+    return gapStart !is gapEnd;
+}
+/**
+ * Returns a string representing the continuous content of
+ * the text store.
+ * <p>
+ *
+ * @param start the physical start offset of the text to return
+ * @param length the physical length of the text to return
+ * @return the text
+ */
+String getPhysicalText(int start, int length_) {
+    return textStore[ start .. start + length_ ].dup;
+}
+/**
+ * Returns a string representing the logical content of
+ * the text store (i.e., gap stripped out).
+ * <p>
+ *
+ * @param start the logical start offset of the text to return
+ * @param length the logical length of the text to return
+ * @return the text
+ */
+public String getTextRange(int start, int length_) {
+    if (textStore is null)
+        return "";
+    if (length_ is 0)
+        return "";
+    int end= start + length_;
+    if (!gapExists() || (end < gapStart))
+        return textStore[ start .. start + length_].dup;
+    if (gapStart < start) {
+        int gapLength= gapEnd - gapStart;
+        return textStore[ start + gapLength .. start + gapLength + length_ ].dup;
+    }
+    StringBuffer buf = new StringBuffer();
+    buf.append(textStore[ start .. start + gapStart - start ] );
+    buf.append(textStore[ gapEnd .. gapEnd + end - gapStart ] );
+    return buf.toString().dup;
+}
+/**
+ * Removes the specified <code>TextChangeListener</code>.
+ * <p>
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when listener is null</li>
+ * </ul>
+ */
+public void removeTextChangeListener(TextChangeListener listener){
+    if (listener is null) error(SWT.ERROR_NULL_ARGUMENT);
+    for (int i = 0; i < textListeners.length; i++) {
+        TypedListener typedListener = cast(TypedListener) textListeners[i];
+        if (typedListener.getEventListener () is listener) {
+            textListeners = textListeners[ 0 .. i ] ~ textListeners[ i+1 .. $ ];
+            break;
+        }
+    }
+}
+/**
+ * Replaces the text with <code>newText</code> starting at position <code>start</code>
+ * for a length of <code>replaceLength</code>.  Notifies the appropriate listeners.
+ * <p>
+ *
+ * When sending the TextChangingEvent, <code>newLineCount</code> is the number of
+ * lines that are going to be inserted and <code>replaceLineCount</code> is
+ * the number of lines that are going to be deleted, based on the change
+ * that occurs visually.  For example:
+ * <ul>
+ * <li>(replaceText,newText) is> (replaceLineCount,newLineCount)
+ * <li>("","\n") is> (0,1)
+ * <li>("\n\n","a") is> (2,0)
+ * </ul>
+ * </p>
+ *
+ * @param start start offset of text to replace
+ * @param replaceLength start offset of text to replace
+ * @param newText start offset of text to replace
+ *
+ * @exception SWTException <ul>
+ *   <li>ERROR_INVALID_ARGUMENT when the text change results in a multi byte
+ *      line delimiter being split or partially deleted.  Splitting a line
+ *      delimiter by inserting text between the CR and LF characters of the
+ *      \r\n delimiter or deleting part of this line delimiter is not supported</li>
+ * </ul>
+ */
+public void replaceTextRange(int start, int replaceLength, String newText){
+    // check for invalid replace operations
+    if (!isValidReplace(start, replaceLength, newText)) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+
+    // inform listeners
+    StyledTextEvent event = new StyledTextEvent(this);
+    event.type = StyledText.TextChanging;
+    event.start = start;
+    event.replaceLineCount = lineCount(start, replaceLength);
+    event.text = newText;
+    event.newLineCount = lineCount(newText);
+    event.replaceCharCount = replaceLength;
+    event.newCharCount = newText.length;
+    sendTextEvent(event);
+
+    // first delete the text to be replaced
+    delete_(start, replaceLength, event.replaceLineCount + 1);
+    // then insert the new text
+    insert(start, newText);
+    // inform listeners
+    event = new StyledTextEvent(this);
+    event.type = StyledText.TextChanged;
+    sendTextEvent(event);
+}
+/**
+ * Sends the text listeners the TextChanged event.
+ */
+void sendTextEvent(StyledTextEvent event) {
+    for (int i = 0; i < textListeners.length; i++) {
+        (cast(StyledTextListener)textListeners[i]).handleEvent(event);
+    }
+}
+/**
+ * Sets the content to text and removes the gap since there are no sensible predictions
+ * about where the next change will occur.
+ * <p>
+ *
+ * @param text the text
+ */
+public void setText (String text){
+    textStore = text.dup;
+    gapStart = -1;
+    gapEnd = -1;
+    expandExp = 1;
+    indexLines();
+    StyledTextEvent event = new StyledTextEvent(this);
+    event.type = StyledText.TextSet;
+    event.text = "";
+    sendTextEvent(event);
+}
+/**
+ * Deletes text.
+ * <p>
+ * @param position the position at which the text to delete starts
+ * @param length the length of the text to delete
+ * @param numLines the number of lines that are being deleted
+ */
+void delete_(int position, int length_, int numLines) {
+    if (length_ is 0) return;
+
+    int startLine = getLineAtOffset(position);
+    int startLineOffset = getOffsetAtLine(startLine);
+    int endLine = getLineAtOffset(position + length_);
+
+    String endText = "";
+    bool splittingDelimiter = false;
+    if (position + length_ < getCharCount()) {
+        endText = getTextRange(position + length_ - 1, 2);
+        if ((endText[0] is SWT.CR) && (endText[1] is SWT.LF)) {
+            splittingDelimiter = true;
+        }
+    }
+
+    adjustGap(position + length_, -length_, startLine);
+    int [][] oldLines = indexLines(position, length_ + (gapEnd - gapStart), numLines);
+
+    // enlarge the gap - the gap can be enlarged either to the
+    // right or left
+    if (position + length_ is gapStart) {
+        gapStart -= length_;
+    } else {
+        gapEnd += length_;
+    }
+
+    // figure out the length of the new concatenated line, do so by
+    // finding the first line delimiter after position
+    int j = position;
+    bool eol = false;
+    while (j < textStore.length && !eol) {
+        if (j < gapStart || j >= gapEnd) {
+            char ch = textStore[j];
+            if (isDelimiter(ch)) {
+                if (j + 1 < textStore.length) {
+                    if (ch is SWT.CR && (textStore[j+1] is SWT.LF)) {
+                        j++;
+                    }
+                }
+                eol = true;
+            }
+        }
+        j++;
+    }
+    // update the line where the deletion started
+    lines[startLine][1] = (position - startLineOffset) + (j - position);
+    // figure out the number of lines that have been deleted
+    int numOldLines = oldLines.length - 1;
+    if (splittingDelimiter) numOldLines -= 1;
+    // shift up the lines after the last deleted line, no need to update
+    // the offset or length of the lines
+    for (int i = endLine + 1; i < lineCount_; i++) {
+        lines[i - numOldLines] = lines[i];
+    }
+    lineCount_ -= numOldLines;
+    gapLine = getLineAtPhysicalOffset(gapStart);
+}
+
+/++
+ + SWT extension
+ +/
+int utf8AdjustOffset( int offset ){
+    if (textStore is null)
+        return offset;
+    if (offset is 0)
+        return offset;
+    if( offset >= textStore.length ){
+        return offset;
+    }
+    if (!gapExists() || (offset < gapStart)){
+        while( textStore[offset] & 0xC0 is 0x80 ){
+            offset--;
+        }
+        return offset;
+    }
+    int gapLength= gapEnd - gapStart;
+    if( offset+gapLength >= textStore.length ){
+        return offset;
+    }
+    while( textStore[offset+gapLength] & 0xC0 is 0x80 ){
+        offset--;
+    }
+    return offset;
+}
+
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/ExtendedModifyEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.ExtendedModifyEvent;
+
+import java.lang.all;
+
+import org.eclipse.swt.events.TypedEvent;
+import org.eclipse.swt.custom.StyledTextEvent;
+
+/**
+ * This event is sent after a text change occurs.
+ *
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public final class ExtendedModifyEvent : TypedEvent {
+    /** start offset of the new text */
+    public int start;
+    /** length of the new text */
+    public int length;
+    /** replaced text or empty string if no text was replaced */
+    public String replacedText;
+
+    static final long serialVersionUID = 3258696507027830832L;
+
+/**
+ * Constructs a new instance of this class based on the
+ * information in the given event.
+ *
+ * @param e the event containing the information
+ */
+public this(StyledTextEvent e) {
+    super(cast(Object)e);
+    start = e.start;
+    length = e.end - e.start;
+    replacedText = e.text;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/ExtendedModifyListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.ExtendedModifyListener;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.SWTEventListener;
+import org.eclipse.swt.custom.ExtendedModifyEvent;
+
+/**
+ * Classes which implement this interface provide a method
+ * that deals with the event that is generated when text
+ * is modified.
+ *
+ * @see ExtendedModifyEvent
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public interface ExtendedModifyListener : SWTEventListener {
+
+/**
+ * This method is called after a text change occurs.
+ * <p>
+ * The following event fields are used:<ul>
+ * <li>event.start the start offset of the new text (input)</li>
+ * <li>event.length the length of the new text (input)</li>
+ * <li>event.replacedText the replaced text (input)</li>
+ * </ul>
+ *
+ * @param event the given event
+ * @see ExtendedModifyEvent
+ */
+public void modifyText(ExtendedModifyEvent event);
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/LineBackgroundEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.LineBackgroundEvent;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.events.TypedEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.custom.StyledTextEvent;
+
+/**
+ * This event is sent when a line is about to be drawn.
+ *
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class LineBackgroundEvent : TypedEvent {
+
+    /**
+     * line start offset
+     */
+    public int lineOffset;
+
+    /**
+     * line text
+     */
+    public String lineText;
+
+    /**
+     * line background color
+     */
+    public Color lineBackground;
+
+    static final long serialVersionUID = 3978711687853324342L;
+
+/**
+ * Constructs a new instance of this class based on the
+ * information in the given event.
+ *
+ * @param e the event containing the information
+ */
+public this(StyledTextEvent e) {
+    super(cast(Object)e);
+    lineOffset = e.detail;
+    lineText = e.text;
+    lineBackground = e.lineBackground;
+}
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/LineBackgroundListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.LineBackgroundListener;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.SWTEventListener;
+import org.eclipse.swt.custom.LineBackgroundEvent;
+
+/**
+ * Classes which implement this interface provide a method
+ * that can provide the background color for a line that
+ * is to be drawn.
+ *
+ * @see LineBackgroundEvent
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public interface LineBackgroundListener : SWTEventListener {
+
+/**
+ * This method is called when a line is about to be drawn in order to get its
+ * background color.
+ * <p>
+ * The following event fields are used:<ul>
+ * <li>event.lineOffset line start offset (input)</li>
+ * <li>event.lineText line text (input)</li>
+ * <li>event.lineBackground line background color (output)</li>
+ * </ul>
+ *
+ * @param event the given event
+ * @see LineBackgroundEvent
+ */
+public void lineGetBackground(LineBackgroundEvent event);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/LineStyleEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.LineStyleEvent;
+
+import java.lang.all;
+
+import org.eclipse.swt.events.TypedEvent;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.custom.Bullet;
+import org.eclipse.swt.custom.StyledTextEvent;
+
+/**
+ * This event is sent when a line is about to be drawn.
+ *
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class LineStyleEvent : TypedEvent {
+
+    /**
+     * line start offset (input)
+     */
+    public int lineOffset;
+
+    /**
+     * line text (input)
+     */
+    public String lineText;
+
+    /**
+     * line ranges (output)
+     *
+     * @since 3.2
+     */
+    public int[] ranges;
+
+    /**
+     * line styles (output)
+     *
+     * Note: Because a StyleRange includes the start and length, the
+     * same instance cannot occur multiple times in the array of styles.
+     * If the same style attributes, such as font and color, occur in
+     * multiple StyleRanges, <code>ranges</code> can be used to share
+     * styles and reduce memory usage.
+     */
+    public StyleRange[] styles;
+
+    /**
+     * line alignment (input, output)
+     *
+     * @since 3.2
+     */
+    public int alignment;
+
+    /**
+     * line indent (input, output)
+     *
+     * @since 3.2
+     */
+    public int indent;
+
+    /**
+     * line justification (input, output)
+     *
+     * @since 3.2
+     */
+    public bool justify;
+
+    /**
+     * line bullet (output)
+     * @since 3.2
+     */
+    public Bullet bullet;
+
+    /**
+     * line bullet index (output)
+     * @since 3.2
+     */
+    public int bulletIndex;
+
+    static final long serialVersionUID = 3906081274027192884L;
+
+/**
+ * Constructs a new instance of this class based on the
+ * information in the given event.
+ *
+ * @param e the event containing the information
+ */
+public this(StyledTextEvent e) {
+    super(cast(Object)e);
+    styles = e.styles;
+    ranges = e.ranges;
+    lineOffset = e.detail;
+    lineText = e.text;
+    alignment = e.alignment;
+    justify = e.justify;
+    indent = e.indent;
+    bullet = e.bullet;
+    bulletIndex = e.bulletIndex;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/LineStyleListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.LineStyleListener;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.SWTEventListener;
+import org.eclipse.swt.custom.LineStyleEvent;
+
+/**
+ * Classes which implement this interface provide a method
+ * that can provide the style information for a line that
+ * is to be drawn.
+ *
+ * @see LineStyleEvent
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public interface LineStyleListener : SWTEventListener {
+
+/**
+ * This method is called when a line is about to be drawn in order to get the
+ * line's style information.
+ * <p>
+ * The following event fields are used:<ul>
+ * <li>event.lineOffset line start offset (input)</li>
+ * <li>event.lineText line text (input)</li>
+ * <li>event.styles array of StyleRanges, need to be in order (output)</li>
+ * </ul>
+ *
+ * @param event the given event
+ * @see LineStyleEvent
+ */
+public void lineGetStyle(LineStyleEvent event);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/MovementEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.MovementEvent;
+
+import java.lang.all;
+
+import org.eclipse.swt.events.TypedEvent;
+import org.eclipse.swt.custom.StyledTextEvent;
+
+/**
+ * This event is sent when a new offset is required based on the current
+ * offset and a movement type.
+ *
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.3
+ */
+public class MovementEvent : TypedEvent {
+
+    /**
+     * line start offset (input)
+     */
+    public int lineOffset;
+
+    /**
+     * line text (input)
+     */
+    public String lineText;
+
+    /**
+     * the current offset (input)
+     */
+    public int offset;
+
+    /**
+     * the new offset  (input, output)
+     */
+    public int newOffset;
+
+    /**
+     * the movement type (input)
+     *
+     * @see org.eclipse.swt.SWT#MOVEMENT_WORD
+     * @see org.eclipse.swt.SWT#MOVEMENT_WORD_END
+     * @see org.eclipse.swt.SWT#MOVEMENT_WORD_START
+     * @see org.eclipse.swt.SWT#MOVEMENT_CHAR
+     * @see org.eclipse.swt.SWT#MOVEMENT_CLUSTER
+     */
+    public int movement;
+
+    static final long serialVersionUID = 3978765487853324342L;
+
+/**
+ * Constructs a new instance of this class based on the
+ * information in the given event.
+ *
+ * @param e the event containing the information
+ */
+public this(StyledTextEvent e) {
+    super(cast(Object)e);
+    lineOffset = e.detail;
+    lineText = e.text;
+    movement = e.count;
+    offset = e.start;
+    newOffset = e.end;
+}
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/MovementListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.MovementListener;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.SWTEventListener;
+import org.eclipse.swt.custom.MovementEvent;
+
+/**
+ * This listener is invoked when a new offset is required based on the current
+ * offset and a movement type.
+ *
+ * @see org.eclipse.swt.SWT#MOVEMENT_WORD
+ * @see org.eclipse.swt.SWT#MOVEMENT_WORD_END
+ * @see org.eclipse.swt.SWT#MOVEMENT_WORD_START
+ * @see org.eclipse.swt.SWT#MOVEMENT_CHAR
+ * @see org.eclipse.swt.SWT#MOVEMENT_CLUSTER
+ *
+ * @since 3.3
+ */
+public interface MovementListener : SWTEventListener {
+/**
+ * This method is called when a new offset is required based on the current
+ * offset and a movement type.
+ *
+ * <p>
+ * The following event fields are used:<ul>
+ * <li>event.lineOffset line start offset (input)</li>
+ * <li>event.lineText line text (input)</li>
+ * <li>event.movement the movement type (input)</li>
+ * <li>event.offset the current offset (input)</li>
+ * <li>event.newOffset the new offset (input, output)</li>
+ * </ul>
+ *
+ * @param event the event
+ *
+ * @see MovementEvent
+ * @see StyledText#addWordMovementListener(MovementListener)
+ */
+public void getNextOffset (MovementEvent event);
+/**
+ * This method is called when a new offset is required based on the current
+ * offset and a movement type.
+ *
+ * <p>
+ * The following event fields are used:<ul>
+ * <li>event.lineOffset line start offset (input)</li>
+ * <li>event.lineText line text (input)</li>
+ * <li>event.movement the movement type (input)</li>
+ * <li>event.offset the current offset (input)</li>
+ * <li>event.newOffset the new offset (input, output)</li>
+ * </ul>
+ *
+ * @param event the event
+ *
+ * @see MovementEvent
+ * @see StyledText#addWordMovementListener(MovementListener)
+ */
+public void getPreviousOffset (MovementEvent event);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/PaintObjectEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.PaintObjectEvent;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.events.TypedEvent;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.custom.Bullet;
+import org.eclipse.swt.custom.StyledTextEvent;
+
+/**
+ * This event is sent when an object needs to be drawn.
+ *
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.2
+ */
+public class PaintObjectEvent : TypedEvent {
+
+    /**
+     * the GC
+     */
+    public GC gc;
+
+    /**
+     * the x location
+     */
+    public int x;
+
+    /**
+     * the y location
+     */
+    public int y;
+
+    /**
+     * the line ascent
+     */
+    public int ascent;
+
+    /**
+     * the line descent
+     */
+    public int descent;
+
+    /**
+     * the StyleRange
+     */
+    public StyleRange style;
+
+    /**
+     * the Bullet
+     */
+    public Bullet bullet;
+
+    /**
+     * the bullet index
+     */
+    public int bulletIndex;
+
+    static final long serialVersionUID = 3906081274027192855L;
+
+/**
+ * Constructs a new instance of this class based on the
+ * information in the given event.
+ *
+ * @param e the event containing the information
+ */
+public this(StyledTextEvent e) {
+    super(cast(Object)e);
+    gc = e.gc;
+    x = e.x;
+    y = e.y;
+    ascent = e.ascent;
+    descent = e.descent;
+    style = e.style;
+    bullet = e.bullet;
+    bulletIndex = e.bulletIndex;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/PaintObjectListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.PaintObjectListener;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.internal.SWTEventListener;
+import org.eclipse.swt.custom.PaintObjectEvent;
+
+/**
+ * This listener is invoked when an object needs to be drawn.
+ *
+ * @since 3.2
+ */
+public interface PaintObjectListener : SWTEventListener {
+/**
+ * This method is called when an object needs to be drawn.
+ *
+ * <p>
+ * The following event fields are used:<ul>
+ * <li>event.x the x location (input)</li>
+ * <li>event.y the y location (input)</li>
+ * <li>event.ascent the line ascent (input)</li>
+ * <li>event.descent the line descent (input)</li>
+ * <li>event.gc the gc (input)</li>
+ * <li>event.style the style (input)</li>
+ * </ul>
+ *
+ * @param event the event
+ *
+ * @see PaintObjectEvent
+ * @see StyledText#addPaintObjectListener(PaintObjectListener)
+ */
+public void paintObject(PaintObjectEvent event);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/PopupList.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,290 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.PopupList;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+* A PopupList is a list of selectable items that appears in its own shell positioned above
+* its parent shell.  It is used for selecting items when editing a Table cell (similar to the
+* list that appears when you open a Combo box).
+*
+* The list will be positioned so that it does not run off the screen and the largest number of items
+* are visible.  It may appear above the current cursor location or below it depending how close you
+* are to the edge of the screen.
+*
+* @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+*/
+public class PopupList {
+    Shell  shell;
+    List   list;
+    int    minimumWidth;
+/**
+* Creates a PopupList above the specified shell.
+*
+* @param parent a Shell control which will be the parent of the new instance (cannot be null)
+*/
+public this(Shell parent) {
+    this (parent, 0);
+}
+/**
+* Creates a PopupList above the specified shell.
+*
+* @param parent a widget which will be the parent of the new instance (cannot be null)
+* @param style the style of widget to construct
+*
+* @since 3.0
+*/
+public this(Shell parent, int style) {
+    shell = new Shell(parent, checkStyle(style));
+
+    list = new List(shell, SWT.SINGLE | SWT.V_SCROLL);
+
+    // close dialog if user selects outside of the shell
+    shell.addListener(SWT.Deactivate, new class() Listener {
+        public void handleEvent(Event e){
+            shell.setVisible (false);
+        }
+    });
+
+    // resize shell when list resizes
+    shell.addControlListener(new class() ControlListener {
+        public void controlMoved(ControlEvent e){}
+        public void controlResized(ControlEvent e){
+            Rectangle shellSize = shell.getClientArea();
+            list.setSize(shellSize.width, shellSize.height);
+        }
+    });
+
+    // return list selection on Mouse Up or Carriage Return
+    list.addMouseListener(new class() MouseListener {
+        public void mouseDoubleClick(MouseEvent e){}
+        public void mouseDown(MouseEvent e){}
+        public void mouseUp(MouseEvent e){
+            shell.setVisible (false);
+        }
+    });
+    list.addKeyListener(new class() KeyListener {
+        public void keyReleased(KeyEvent e){}
+        public void keyPressed(KeyEvent e){
+            if (e.character is '\r'){
+                shell.setVisible (false);
+            }
+        }
+    });
+
+}
+private static int checkStyle (int style) {
+    int mask = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
+    return style & mask;
+}
+/**
+* Gets the widget font.
+* <p>
+* @return the widget font
+*
+* @exception SWTException <ul>
+*    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+*    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+*   </ul>
+*/
+public Font getFont () {
+    return list.getFont();
+}
+/**
+* Gets the items.
+* <p>
+* This operation will fail if the items cannot
+* be queried from the OS.
+*
+* @return the items in the widget
+*
+* @exception SWTException <ul>
+*    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+*    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+*   </ul>
+*/
+public String[] getItems () {
+    return list.getItems();
+}
+/**
+* Gets the minimum width of the list.
+*
+* @return the minimum width of the list
+*/
+public int getMinimumWidth () {
+    return minimumWidth;
+}
+/**
+* Launches the Popup List, waits for an item to be selected and then closes the PopupList.
+*
+* @param rect the initial size and location of the PopupList; the dialog will be
+*        positioned so that it does not run off the screen and the largest number of items are visible
+*
+* @return the text of the selected item or null if no item is selected
+*/
+public String open (Rectangle rect) {
+
+    Point listSize = list.computeSize (rect.width, SWT.DEFAULT, false);
+    Rectangle screenSize = shell.getDisplay().getBounds();
+
+    // Position the dialog so that it does not run off the screen and the largest number of items are visible
+    int spaceBelow = screenSize.height - (rect.y + rect.height) - 30;
+    int spaceAbove = rect.y - 30;
+
+    int y = 0;
+    if (spaceAbove > spaceBelow && listSize.y > spaceBelow) {
+        // place popup list above table cell
+        if (listSize.y > spaceAbove){
+            listSize.y = spaceAbove;
+        } else {
+            listSize.y += 2;
+        }
+        y = rect.y - listSize.y;
+
+    } else {
+        // place popup list below table cell
+        if (listSize.y > spaceBelow){
+            listSize.y = spaceBelow;
+        } else {
+            listSize.y += 2;
+        }
+        y = rect.y + rect.height;
+    }
+
+    // Make dialog as wide as the cell
+    listSize.x = rect.width;
+    // dialog width should not be less than minimumWidth
+    if (listSize.x < minimumWidth)
+        listSize.x = minimumWidth;
+
+    // Align right side of dialog with right side of cell
+    int x = rect.x + rect.width - listSize.x;
+
+    shell.setBounds(x, y, listSize.x, listSize.y);
+
+    shell.open();
+    list.setFocus();
+
+    Display display = shell.getDisplay();
+    while (!shell.isDisposed () && shell.isVisible ()) {
+        if (!display.readAndDispatch()) display.sleep();
+    }
+
+    String result = null;
+    if (!shell.isDisposed ()) {
+        String [] strings = list.getSelection ();
+        shell.dispose();
+        if (strings.length !is 0) result = strings [0];
+    }
+    return result;
+}
+/**
+* Selects an item with text that starts with specified String.
+* <p>
+* If the item is not currently selected, it is selected.
+* If the item at an index is selected, it remains selected.
+* If the string is not matched, it is ignored.
+*
+* @param string the text of the item
+*
+* @exception SWTException <ul>
+*    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+*    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+*   </ul>
+*/
+public void select(String string) {
+    String[] items = list.getItems();
+
+    // find the first entry in the list that starts with the
+    // specified string
+    if (string !is null){
+        for (int i = 0; i < items.length; i++) {
+            if ( tango.text.Util.locatePattern( items[i], string) is 0 ){
+                int index = list.indexOf(items[i]);
+                list.select(index);
+                break;
+            }
+        }
+    }
+}
+/**
+* Sets the widget font.
+* <p>
+* When new font is null, the font reverts
+* to the default system font for the widget.
+*
+* @param font the new font (or null)
+*
+* @exception SWTException <ul>
+*    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+*    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+*   </ul>
+*/
+public void setFont (Font font) {
+    list.setFont(font);
+}
+/**
+* Sets all items.
+* <p>
+* The previous selection is cleared.
+* The previous items are deleted.
+* The new items are added.
+* The top index is set to 0.
+*
+* @param strings the array of items
+*
+* This operation will fail when an item is null
+* or could not be added in the OS.
+*
+* @exception IllegalArgumentException <ul>
+*    <li>ERROR_INVALID_ARGUMENT - if an item in the items array is null</li>
+* </ul>
+* @exception SWTException <ul>
+*    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+*    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+*   </ul>
+*/
+public void setItems (String[] strings) {
+    list.setItems(strings);
+}
+/**
+* Sets the minimum width of the list.
+*
+* @param width the minimum width of the list
+*/
+public void setMinimumWidth (int width) {
+    if (width < 0)
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+
+    minimumWidth = width;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/ST.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,135 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.ST;
+
+import java.lang.all;
+
+
+/**
+ * This class provides access to the public constants provided by <code>StyledText</code>.
+ *
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class ST {
+
+    /*
+     *  Navigation Key Actions. Key bindings for the actions are set
+     *  by the StyledText widget.
+     */
+    public static const int LINE_UP = 16777217;             // binding = SWT.ARROW_UP
+    public static const int LINE_DOWN = 16777218;       // binding = SWT.ARROW_DOWN
+    public static const int LINE_START = 16777223;      // binding = SWT.HOME
+    public static const int LINE_END = 16777224;        // binding = SWT.END
+    public static const int COLUMN_PREVIOUS = 16777219;     // binding = SWT.ARROW_LEFT
+    public static const int COLUMN_NEXT = 16777220;         // binding = SWT.ARROW_RIGHT
+    public static const int PAGE_UP = 16777221;             // binding = SWT.PAGE_UP
+    public static const int PAGE_DOWN = 16777222;       // binding = SWT.PAGE_DOWN
+    public static const int WORD_PREVIOUS = 17039363;   // binding = SWT.MOD1 + SWT.ARROW_LEFT
+    public static const int WORD_NEXT = 17039364;       // binding = SWT.MOD1 + SWT.ARROW_RIGHT
+    public static const int TEXT_START = 17039367;      // binding = SWT.MOD1 + SWT.HOME
+    public static const int TEXT_END = 17039368;        // binding = SWT.MOD1 + SWT.END
+    public static const int WINDOW_START = 17039365;    // binding = SWT.MOD1 + SWT.PAGE_UP
+    public static const int WINDOW_END = 17039366;      // binding = SWT.MOD1 + SWT.PAGE_DOWN
+
+    /*
+     * Selection Key Actions
+     */
+    public static const int SELECT_ALL = 262209;                // binding = SWT.MOD1 + 'A'
+    public static const int SELECT_LINE_UP = 16908289;          // binding = SWT.MOD2 + SWT.ARROW_UP
+    public static const int SELECT_LINE_DOWN = 16908290;        // binding = SWT.MOD2 + SWT.ARROW_DOWN
+    public static const int SELECT_LINE_START = 16908295;       // binding = SWT.MOD2 + SWT.HOME
+    public static const int SELECT_LINE_END = 16908296;             // binding = SWT.MOD2 + SWT.END
+    public static const int SELECT_COLUMN_PREVIOUS = 16908291;  // binding = SWT.MOD2 + SWT.ARROW_LEFT
+    public static const int SELECT_COLUMN_NEXT = 16908292;      // binding = SWT.MOD2 + SWT.ARROW_RIGHT
+    public static const int SELECT_PAGE_UP = 16908293;          // binding = SWT.MOD2 + SWT.PAGE_UP
+    public static const int SELECT_PAGE_DOWN = 16908294;        // binding = SWT.MOD2 + SWT.PAGE_DOWN
+    public static const int SELECT_WORD_PREVIOUS = 17170435;        // binding = SWT.MOD1 + SWT.MOD2 + SWT.ARROW_LEFT
+    public static const int SELECT_WORD_NEXT = 17170436;        // binding = SWT.MOD1 + SWT.MOD2 + SWT.ARROW_RIGHT
+    public static const int SELECT_TEXT_START = 17170439;       // binding = SWT.MOD1 + SWT.MOD2 + SWT.HOME
+    public static const int SELECT_TEXT_END = 17170440;             // binding = SWT.MOD1 + SWT.MOD2 + SWT.END
+    public static const int SELECT_WINDOW_START = 17170437;         // binding = SWT.MOD1 + SWT.MOD2 + SWT.PAGE_UP
+    public static const int SELECT_WINDOW_END = 17170438;       // binding = SWT.MOD1 + SWT.MOD2 + SWT.PAGE_DOWN
+
+    /*
+     *  Modification Key Actions
+     */
+    public static const int CUT = 131199;           // binding = SWT.MOD2 + SWT.DEL
+    public static const int COPY = 17039369;        // binding = SWT.MOD1 + SWT.INSERT;
+    public static const int PASTE = 16908297;       // binding = SWT.MOD2 + SWT.INSERT ;
+    public static const int DELETE_PREVIOUS = '\b';     // binding = SWT.BS;
+    public static const int DELETE_NEXT = 0x7F;         // binding = SWT.DEL;
+    public static const int DELETE_WORD_PREVIOUS = 262152;  // binding = SWT.BS | SWT.MOD1;
+    public static const int DELETE_WORD_NEXT = 262271;  // binding = SWT.DEL | SWT.MOD1;
+
+    /*
+     * Miscellaneous Key Actions
+     */
+    public static const int TOGGLE_OVERWRITE = 16777225; // binding = SWT.INSERT;
+
+    /**
+     *  Bullet style dot.
+     *
+     *  @see Bullet
+     *
+     *  @since 3.2
+     */
+    public static const int BULLET_DOT = 1 << 0;
+
+    /**
+     *  Bullet style number.
+     *
+     *  @see Bullet
+     *
+     *  @since 3.2
+     */
+    public static const int BULLET_NUMBER = 1 << 1;
+
+    /**
+     *  Bullet style lower case letter.
+     *
+     *  @see Bullet
+     *
+     *  @since 3.2
+     */
+    public static const int BULLET_LETTER_LOWER = 1 << 2;
+
+    /**
+     *  Bullet style upper case letter.
+     *
+     *  @see Bullet
+     *
+     *  @since 3.2
+     */
+    public static const int BULLET_LETTER_UPPER = 1 << 3;
+
+    /**
+     *  Bullet style text.
+     *
+     *  @see Bullet
+     *
+     *  @since 3.2
+     */
+    public static const int BULLET_TEXT = 1 << 4;
+
+    /**
+     *  Bullet style custom draw.
+     *
+     *  @see StyledText#addPaintObjectListener(PaintObjectListener)
+     *  @see StyledText#removePaintObjectListener(PaintObjectListener)
+     *  @see Bullet
+     *
+     *  @since 3.2
+     */
+    public static const int BULLET_CUSTOM = 1 << 5;
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/SashForm.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,448 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.SashForm;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Layout;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Sash;
+import org.eclipse.swt.custom.SashFormLayout;
+import org.eclipse.swt.custom.SashFormData;
+import java.lang.all;
+
+/**
+ * The SashForm is a composite control that lays out its children in a
+ * row or column arrangement (as specified by the orientation) and places
+ * a Sash between each child. One child may be maximized to occupy the
+ * entire size of the SashForm.  The relative sizes of the children may
+ * be specified using weights.
+ * <p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>HORIZONTAL, VERTICAL, SMOOTH</dd>
+ * </dl>
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#sashform">SashForm snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: CustomControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class SashForm : Composite {
+
+    /**
+    * The width of all sashes in the form.
+    */
+    public int SASH_WIDTH = 3;
+
+    int sashStyle;
+    Sash[] sashes;
+    // Remember background and foreground
+    // colors to determine whether to set
+    // sashes to the default color (null) or
+    // a specific color
+    Color background = null;
+    Color foreground = null;
+    Control[] controls;
+    Control maxControl = null;
+    Listener sashListener;
+    static const int DRAG_MINIMUM = 20;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a widget which will be the parent of the new instance (cannot be null)
+ * @param style the style of widget to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ *
+ * @see SWT#HORIZONTAL
+ * @see SWT#VERTICAL
+ * @see #getStyle()
+ */
+public this(Composite parent, int style) {
+    super(parent, checkStyle(style));
+    super.setLayout(new SashFormLayout());
+    sashStyle = ((style & SWT.VERTICAL) !is 0) ? SWT.HORIZONTAL : SWT.VERTICAL;
+    if ((style & SWT.BORDER) !is 0) sashStyle |= SWT.BORDER;
+    if ((style & SWT.SMOOTH) !is 0) sashStyle |= SWT.SMOOTH;
+    sashListener = new class() Listener {
+        public void handleEvent(Event e) {
+            onDragSash(e);
+        }
+    };
+}
+static int checkStyle (int style) {
+    int mask = SWT.BORDER | SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
+    return style & mask;
+}
+/**
+ * Returns SWT.HORIZONTAL if the controls in the SashForm are laid out side by side
+ * or SWT.VERTICAL   if the controls in the SashForm are laid out top to bottom.
+ *
+ * @return SWT.HORIZONTAL or SWT.VERTICAL
+ */
+public int getOrientation() {
+    //checkWidget();
+    return (sashStyle & SWT.VERTICAL) !is 0 ? SWT.HORIZONTAL : SWT.VERTICAL;
+}
+/**
+ * Returns the width of the sashes when the controls in the SashForm are 
+ * laid out.
+ * 
+ * @return the width of the sashes
+ * 
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * 
+ * @since 3.4
+ */
+public int getSashWidth() {
+    checkWidget();
+    return SASH_WIDTH;
+}
+public override int getStyle() {
+    int style = super.getStyle();
+    style |= getOrientation() is SWT.VERTICAL ? SWT.VERTICAL : SWT.HORIZONTAL;
+    if ((sashStyle & SWT.SMOOTH) !is 0) style |= SWT.SMOOTH;
+    return style;
+}
+/**
+ * Answer the control that currently is maximized in the SashForm.
+ * This value may be null.
+ *
+ * @return the control that currently is maximized or null
+ */
+public Control getMaximizedControl(){
+    //checkWidget();
+    return this.maxControl;
+}
+/**
+ * Answer the relative weight of each child in the SashForm.  The weight represents the
+ * percent of the total width (if SashForm has Horizontal orientation) or
+ * total height (if SashForm has Vertical orientation) each control occupies.
+ * The weights are returned in order of the creation of the widgets (weight[0]
+ * corresponds to the weight of the first child created).
+ *
+ * @return the relative weight of each child
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+
+public int[] getWeights() {
+    checkWidget();
+    Control[] cArray = getControls(false);
+    int[] ratios = new int[cArray.length];
+    for (int i = 0; i < cArray.length; i++) {
+        Object data = cArray[i].getLayoutData();
+        if ( auto sfd = cast(SashFormData)data ) {
+            ratios[i] = cast(int)(sfd.weight * 1000 >> 16);
+        } else {
+            ratios[i] = 200;
+        }
+    }
+    return ratios;
+}
+Control[] getControls(bool onlyVisible) {
+    Control[] children = getChildren();
+    Control[] result = new Control[0];
+    for (int i = 0; i < children.length; i++) {
+        if ( null !is cast(Sash)children[i]) continue;
+        if (onlyVisible && !children[i].getVisible()) continue;
+
+        Control[] newResult = new Control[result.length + 1];
+        System.arraycopy(result, 0, newResult, 0, result.length);
+        newResult[result.length] = children[i];
+        result = newResult;
+    }
+    return result;
+}
+void onDragSash(Event event) {
+    Sash sash = cast(Sash)event.widget;
+    int sashIndex = -1;
+    for (int i= 0; i < sashes.length; i++) {
+        if (sashes[i] is sash) {
+            sashIndex = i;
+            break;
+        }
+    }
+    if (sashIndex is -1) return;
+
+    Control c1 = controls[sashIndex];
+    Control c2 = controls[sashIndex + 1];
+    Rectangle b1 = c1.getBounds();
+    Rectangle b2 = c2.getBounds();
+
+    Rectangle sashBounds = sash.getBounds();
+    Rectangle area = getClientArea();
+    bool correction = false;
+    if (getOrientation() is SWT.HORIZONTAL) {
+        correction = b1.width < DRAG_MINIMUM || b2.width < DRAG_MINIMUM;
+        int totalWidth = b2.x + b2.width - b1.x;
+        int shift = event.x - sashBounds.x;
+        b1.width += shift;
+        b2.x += shift;
+        b2.width -= shift;
+        if (b1.width < DRAG_MINIMUM) {
+            b1.width = DRAG_MINIMUM;
+            b2.x = b1.x + b1.width + sashBounds.width;
+            b2.width = totalWidth - b2.x;
+            event.x = b1.x + b1.width;
+            event.doit = false;
+        }
+        if (b2.width < DRAG_MINIMUM) {
+            b1.width = totalWidth - DRAG_MINIMUM - sashBounds.width;
+            b2.x = b1.x + b1.width + sashBounds.width;
+            b2.width = DRAG_MINIMUM;
+            event.x = b1.x + b1.width;
+            event.doit = false;
+        }
+        Object data1 = c1.getLayoutData();
+        if (data1 is null || !( null !is cast(SashFormData)data1 )) {
+            data1 = new SashFormData();
+            c1.setLayoutData(data1);
+        }
+        Object data2 = c2.getLayoutData();
+        if (data2 is null || !( null !is cast(SashFormData)data2 )) {
+            data2 = new SashFormData();
+            c2.setLayoutData(data2);
+        }
+        (cast(SashFormData)data1).weight = ((cast(long)b1.width << 16) + area.width - 1) / area.width;
+        (cast(SashFormData)data2).weight = ((cast(long)b2.width << 16) + area.width - 1) / area.width;
+    } else {
+        correction = b1.height < DRAG_MINIMUM || b2.height < DRAG_MINIMUM;
+        int totalHeight = b2.y + b2.height - b1.y;
+        int shift = event.y - sashBounds.y;
+        b1.height += shift;
+        b2.y += shift;
+        b2.height -= shift;
+        if (b1.height < DRAG_MINIMUM) {
+            b1.height = DRAG_MINIMUM;
+            b2.y = b1.y + b1.height + sashBounds.height;
+            b2.height = totalHeight - b2.y;
+            event.y = b1.y + b1.height;
+            event.doit = false;
+        }
+        if (b2.height < DRAG_MINIMUM) {
+            b1.height = totalHeight - DRAG_MINIMUM - sashBounds.height;
+            b2.y = b1.y + b1.height + sashBounds.height;
+            b2.height = DRAG_MINIMUM;
+            event.y = b1.y + b1.height;
+            event.doit = false;
+        }
+        Object data1 = c1.getLayoutData();
+        if (data1 is null || !( null !is cast(SashFormData)data1 )) {
+            data1 = new SashFormData();
+            c1.setLayoutData(data1);
+        }
+        Object data2 = c2.getLayoutData();
+        if (data2 is null || !(null !is cast(SashFormData)data2 )) {
+            data2 = new SashFormData();
+            c2.setLayoutData(data2);
+        }
+        (cast(SashFormData)data1).weight = ((cast(long)b1.height << 16) + area.height - 1) / area.height;
+        (cast(SashFormData)data2).weight = ((cast(long)b2.height << 16) + area.height - 1) / area.height;
+    }
+    if (correction || (event.doit && event.detail !is SWT.DRAG)) {
+        c1.setBounds(b1);
+        sash.setBounds(event.x, event.y, event.width, event.height);
+        c2.setBounds(b2);
+    }
+}
+/**
+ * If orientation is SWT.HORIZONTAL, lay the controls in the SashForm
+ * out side by side.  If orientation is SWT.VERTICAL, lay the
+ * controls in the SashForm out top to bottom.
+ *
+ * @param orientation SWT.HORIZONTAL or SWT.VERTICAL
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the value of orientation is not SWT.HORIZONTAL or SWT.VERTICAL
+ * </ul>
+ */
+public void setOrientation(int orientation) {
+    checkWidget();
+    if (getOrientation() is orientation) return;
+    if (orientation !is SWT.HORIZONTAL && orientation !is SWT.VERTICAL) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    sashStyle &= ~(SWT.HORIZONTAL | SWT.VERTICAL);
+    sashStyle |= orientation is SWT.VERTICAL ? SWT.HORIZONTAL : SWT.VERTICAL;
+    for (int i = 0; i < sashes.length; i++) {
+        sashes[i].dispose();
+        sashes[i] = new Sash(this, sashStyle);
+        sashes[i].setBackground(background);
+        sashes[i].setForeground(foreground);
+        sashes[i].addListener(SWT.Selection, sashListener);
+    }
+    layout(false);
+}
+public override void setBackground (Color color) {
+    super.setBackground(color);
+    background = color;
+    for (int i = 0; i < sashes.length; i++) {
+        sashes[i].setBackground(background);
+    }
+}
+public override void setForeground (Color color) {
+    super.setForeground(color);
+    foreground = color;
+    for (int i = 0; i < sashes.length; i++) {
+        sashes[i].setForeground(foreground);
+    }
+}
+/**
+ * Sets the layout which is associated with the receiver to be
+ * the argument which may be null.
+ * <p>
+ * Note: No Layout can be set on this Control because it already
+ * manages the size and position of its children.
+ * </p>
+ *
+ * @param layout the receiver's new layout or null
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public override void setLayout (Layout layout) {
+    checkWidget();
+    return;
+}
+/**
+ * Specify the control that should take up the entire client area of the SashForm.
+ * If one control has been maximized, and this method is called with a different control,
+ * the previous control will be minimized and the new control will be maximized.
+ * If the value of control is null, the SashForm will minimize all controls and return to
+ * the default layout where all controls are laid out separated by sashes.
+ *
+ * @param control the control to be maximized or null
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMaximizedControl(Control control){
+    checkWidget();
+    if (control is null) {
+        if (maxControl !is null) {
+            this.maxControl = null;
+            layout(false);
+            for (int i= 0; i < sashes.length; i++){
+                sashes[i].setVisible(true);
+            }
+        }
+        return;
+    }
+
+    for (int i= 0; i < sashes.length; i++){
+        sashes[i].setVisible(false);
+    }
+    maxControl = control;
+    layout(false);
+}
+
+/**
+ * Specify the width of the sashes when the controls in the SashForm are 
+ * laid out.
+ * 
+ * @param width the width of the sashes
+ * 
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * 
+ * @since 3.4
+ */
+public void setSashWidth(int width) {
+    checkWidget();
+    if (SASH_WIDTH is width) return;
+    SASH_WIDTH = width;
+    layout(false);
+}
+/**
+ * Specify the relative weight of each child in the SashForm.  This will determine
+ * what percent of the total width (if SashForm has Horizontal orientation) or
+ * total height (if SashForm has Vertical orientation) each control will occupy.
+ * The weights must be positive values and there must be an entry for each
+ * non-sash child of the SashForm.
+ *
+ * @param weights the relative weight of each child
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the weights value is null or of incorrect length (must match the number of children)</li>
+ * </ul>
+ */
+public void setWeights(int[] weights) {
+    checkWidget();
+    Control[] cArray = getControls(false);
+    if (weights is null || weights.length !is cArray.length) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+
+    int total = 0;
+    for (int i = 0; i < weights.length; i++) {
+        if (weights[i] < 0) {
+            SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+        }
+        total += weights[i];
+    }
+    if (total is 0) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    for (int i = 0; i < cArray.length; i++) {
+        Object data = cArray[i].getLayoutData();
+        if (data is null || !( null !is cast(SashFormData)data )) {
+            data = new SashFormData();
+            cArray[i].setLayoutData(data);
+        }
+        (cast(SashFormData)data).weight = ((cast(long)weights[i] << 16) + total - 1) / total;
+    }
+
+    layout(false);
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/SashFormData.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.SashFormData;
+
+import java.lang.all;
+
+static import tango.text.Util;
+import tango.util.Convert;
+
+class SashFormData {
+
+    long weight;
+
+String getName () {
+    String string = this.classinfo.name;
+    int index = tango.text.Util.locatePrior( string ,'.' );
+    if (index is string.length ) return string;
+    return string[ index + 1 .. $ ];
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+public override String toString () {
+    return getName()~" {weight="~to!(String)(weight)~"}"; //$NON-NLS-2$
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/SashFormLayout.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,205 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.SashFormLayout;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Layout;
+import org.eclipse.swt.widgets.Sash;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.custom.SashFormData;
+import java.lang.all;
+
+/**
+ * This class provides the layout for SashForm
+ *
+ * @see SashForm
+ */
+class SashFormLayout : Layout {
+protected override Point computeSize(Composite composite, int wHint, int hHint, bool flushCache) {
+    SashForm sashForm = cast(SashForm)composite;
+    Control[] cArray = sashForm.getControls(true);
+    int width = 0;
+    int height = 0;
+    if (cArray.length is 0) {
+        if (wHint !is SWT.DEFAULT) width = wHint;
+        if (hHint !is SWT.DEFAULT) height = hHint;
+        return new Point(width, height);
+    }
+    // determine control sizes
+    bool vertical = sashForm.getOrientation() is SWT.VERTICAL;
+    int maxIndex = 0;
+    int maxValue = 0;
+    for (int i = 0; i < cArray.length; i++) {
+        if (vertical) {
+            Point size = cArray[i].computeSize(wHint, SWT.DEFAULT, flushCache);
+            if (size.y > maxValue) {
+                maxIndex = i;
+                maxValue = size.y;
+            }
+            width = Math.max(width, size.x);
+        } else {
+            Point size = cArray[i].computeSize(SWT.DEFAULT, hHint, flushCache);
+            if (size.x > maxValue) {
+                maxIndex = i;
+                maxValue = size.x;
+            }
+            height = Math.max(height, size.y);
+        }
+    }
+    // get the ratios
+    long[] ratios = new long[cArray.length];
+    long total = 0;
+    for (int i = 0; i < cArray.length; i++) {
+        Object data = cArray[i].getLayoutData();
+        if ( auto sfd = cast(SashFormData)data) {
+            ratios[i] = sfd.weight;
+        } else {
+            data = new SashFormData();
+            cArray[i].setLayoutData(data);
+            (cast(SashFormData)data).weight = ratios[i] = ((200 << 16) + 999) / 1000;
+
+        }
+        total += ratios[i];
+    }
+    if (ratios[maxIndex] > 0) {
+        int sashwidth = sashForm.sashes.length > 0 ? sashForm.SASH_WIDTH + sashForm.sashes [0].getBorderWidth() * 2 : sashForm.SASH_WIDTH;
+        if (vertical) {
+            height += cast(int)(total * maxValue / ratios[maxIndex]) + (cArray.length - 1) * sashwidth;
+        } else {
+            width += cast(int)(total * maxValue / ratios[maxIndex]) + (cArray.length - 1) * sashwidth;
+        }
+    }
+    width += sashForm.getBorderWidth()*2;
+    height += sashForm.getBorderWidth()*2;
+    if (wHint !is SWT.DEFAULT) width = wHint;
+    if (hHint !is SWT.DEFAULT) height = hHint;
+    return new Point(width, height);
+}
+
+protected override bool flushCache(Control control) {
+    return true;
+}
+
+protected override void layout(Composite composite, bool flushCache) {
+    SashForm sashForm = cast(SashForm)composite;
+    Rectangle area = sashForm.getClientArea();
+    if (area.width <= 1 || area.height <= 1) return;
+
+    Control[] newControls = sashForm.getControls(true);
+    if (sashForm.controls.length is 0 && newControls.length is 0) return;
+    sashForm.controls = newControls;
+
+    Control[] controls = sashForm.controls;
+
+    if (sashForm.maxControl !is null && !sashForm.maxControl.isDisposed()) {
+        for (int i= 0; i < controls.length; i++){
+            if (controls[i] !is sashForm.maxControl) {
+                controls[i].setBounds(-200, -200, 0, 0);
+            } else {
+                controls[i].setBounds(area);
+            }
+        }
+        return;
+    }
+
+    // keep just the right number of sashes
+    if (sashForm.sashes.length < controls.length - 1) {
+        Sash[] newSashes = new Sash[controls.length - 1];
+        System.arraycopy(sashForm.sashes, 0, newSashes, 0, sashForm.sashes.length);
+        for (int i = sashForm.sashes.length; i < newSashes.length; i++) {
+            newSashes[i] = new Sash(sashForm, sashForm.sashStyle);
+            newSashes[i].setBackground(sashForm.background);
+            newSashes[i].setForeground(sashForm.foreground);
+            newSashes[i].addListener(SWT.Selection, sashForm.sashListener);
+        }
+        sashForm.sashes = newSashes;
+    }
+    if (sashForm.sashes.length > controls.length - 1) {
+        if (controls.length is 0) {
+            for (int i = 0; i < sashForm.sashes.length; i++) {
+                sashForm.sashes[i].dispose();
+            }
+            sashForm.sashes = new Sash[0];
+        } else {
+            Sash[] newSashes = new Sash[controls.length - 1];
+            System.arraycopy(sashForm.sashes, 0, newSashes, 0, newSashes.length);
+            for (int i = controls.length - 1; i < sashForm.sashes.length; i++) {
+                sashForm.sashes[i].dispose();
+            }
+            sashForm.sashes = newSashes;
+        }
+    }
+    if (controls.length is 0) return;
+    Sash[] sashes = sashForm.sashes;
+    // get the ratios
+    long[] ratios = new long[controls.length];
+    long total = 0;
+    for (int i = 0; i < controls.length; i++) {
+        Object data = controls[i].getLayoutData();
+        if ( auto sfd = cast(SashFormData)data ) {
+            ratios[i] = sfd.weight;
+        } else {
+            data = new SashFormData();
+            controls[i].setLayoutData(data);
+            (cast(SashFormData)data).weight = ratios[i] = ((200 << 16) + 999) / 1000;
+
+        }
+        total += ratios[i];
+    }
+
+    int sashwidth = sashes.length > 0 ? sashForm.SASH_WIDTH + sashes [0].getBorderWidth() * 2 : sashForm.SASH_WIDTH;
+    if (sashForm.getOrientation() is SWT.HORIZONTAL) {
+        int width = cast(int)(ratios[0] * (area.width - sashes.length * sashwidth) / total);
+        int x = area.x;
+        controls[0].setBounds(x, area.y, width, area.height);
+        x += width;
+        for (int i = 1; i < controls.length - 1; i++) {
+            sashes[i - 1].setBounds(x, area.y, sashwidth, area.height);
+            x += sashwidth;
+            width = cast(int)(ratios[i] * (area.width - sashes.length * sashwidth) / total);
+            controls[i].setBounds(x, area.y, width, area.height);
+            x += width;
+        }
+        if (controls.length > 1) {
+            sashes[sashes.length - 1].setBounds(x, area.y, sashwidth, area.height);
+            x += sashwidth;
+            width = area.width - x;
+            controls[controls.length - 1].setBounds(x, area.y, width, area.height);
+        }
+    } else {
+        int height = cast(int)(ratios[0] * (area.height - sashes.length * sashwidth) / total);
+        int y = area.y;
+        controls[0].setBounds(area.x, y, area.width, height);
+        y += height;
+        for (int i = 1; i < controls.length - 1; i++) {
+            sashes[i - 1].setBounds(area.x, y, area.width, sashwidth);
+            y += sashwidth;
+            height = cast(int)(ratios[i] * (area.height - sashes.length * sashwidth) / total);
+            controls[i].setBounds(area.x, y, area.width, height);
+            y += height;
+        }
+        if (controls.length > 1) {
+            sashes[sashes.length - 1].setBounds(area.x, y, area.width, sashwidth);
+            y += sashwidth;
+            height = area.height - y;
+            controls[controls.length - 1].setBounds(area.x, y, area.width, height);
+        }
+
+    }
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/ScrolledComposite.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,709 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.ScrolledComposite;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Layout;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.ScrollBar;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.custom.ScrolledCompositeLayout;
+
+/**
+ * A ScrolledComposite provides scrollbars and will scroll its content when the user
+ * uses the scrollbars.
+ *
+ *
+ * <p>There are two ways to use the ScrolledComposite:
+ *
+ * <p>
+ * 1) Set the size of the control that is being scrolled and the ScrolledComposite
+ * will show scrollbars when the contained control can not be fully seen.
+ *
+ * 2) The second way imitates the way a browser would work.  Set the minimum size of
+ * the control and the ScrolledComposite will show scroll bars if the visible area is
+ * less than the minimum size of the control and it will expand the size of the control
+ * if the visible area is greater than the minimum size.  This requires invoking
+ * both setMinWidth(), setMinHeight() and setExpandHorizontal(), setExpandVertical().
+ *
+ * <code><pre>
+ * public static void main (String [] args) {
+ *      Display display = new Display ();
+ *      Color red = display.getSystemColor(SWT.COLOR_RED);
+ *      Color blue = display.getSystemColor(SWT.COLOR_BLUE);
+ *      Shell shell = new Shell (display);
+ *      shell.setLayout(new FillLayout());
+ *
+ *      // set the size of the scrolled content - method 1
+ *      final ScrolledComposite sc1 = new ScrolledComposite(shell, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+ *      final Composite c1 = new Composite(sc1, SWT.NONE);
+ *      sc1.setContent(c1);
+ *      c1.setBackground(red);
+ *      GridLayout layout = new GridLayout();
+ *      layout.numColumns = 4;
+ *      c1.setLayout(layout);
+ *      Button b1 = new Button (c1, SWT.PUSH);
+ *      b1.setText("first button");
+ *      c1.setSize(c1.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+ *
+ *      // set the minimum width and height of the scrolled content - method 2
+ *      final ScrolledComposite sc2 = new ScrolledComposite(shell, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+ *      sc2.setExpandHorizontal(true);
+ *      sc2.setExpandVertical(true);
+ *      final Composite c2 = new Composite(sc2, SWT.NONE);
+ *      sc2.setContent(c2);
+ *      c2.setBackground(blue);
+ *      layout = new GridLayout();
+ *      layout.numColumns = 4;
+ *      c2.setLayout(layout);
+ *      Button b2 = new Button (c2, SWT.PUSH);
+ *      b2.setText("first button");
+ *      sc2.setMinSize(c2.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+ *
+ *      Button add = new Button (shell, SWT.PUSH);
+ *      add.setText("add children");
+ *      final int[] index = new int[]{0};
+ *      add.addListener(SWT.Selection, new Listener() {
+ *          public void handleEvent(Event e) {
+ *              index[0]++;
+ *              Button button = new Button(c1, SWT.PUSH);
+ *              button.setText("button "+index[0]);
+ *              // reset size of content so children can be seen - method 1
+ *              c1.setSize(c1.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+ *              c1.layout();
+ *
+ *              button = new Button(c2, SWT.PUSH);
+ *              button.setText("button "+index[0]);
+ *              // reset the minimum width and height so children can be seen - method 2
+ *              sc2.setMinSize(c2.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+ *              c2.layout();
+ *          }
+ *      });
+ *
+ *      shell.open ();
+ *      while (!shell.isDisposed ()) {
+ *          if (!display.readAndDispatch ()) display.sleep ();
+ *      }
+ *      display.dispose ();
+ * }
+ * </pre></code>
+ *
+ * <dl>
+ * <dt><b>Styles:</b><dd>H_SCROLL, V_SCROLL
+ * </dl>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#scrolledcomposite">ScrolledComposite snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class ScrolledComposite : Composite {
+
+    Control content;
+    Listener contentListener;
+    Listener filter;
+
+    int minHeight = 0;
+    int minWidth = 0;
+    bool expandHorizontal = false;
+    bool expandVertical = false;
+    bool alwaysShowScroll = false;
+    bool showFocusedControl = false;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a widget which will be the parent of the new instance (cannot be null)
+ * @param style the style of widget to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ *
+ * @see SWT#H_SCROLL
+ * @see SWT#V_SCROLL
+ * @see #getStyle()
+ */
+public this(Composite parent, int style) {
+    super(parent, checkStyle(style));
+    super.setLayout(new ScrolledCompositeLayout());
+    ScrollBar hBar = getHorizontalBar ();
+    if (hBar !is null) {
+        hBar.setVisible(false);
+        hBar.addListener (SWT.Selection, new class() Listener  {
+            public void handleEvent (Event e) {
+                hScroll();
+            }
+        });
+    }
+
+    ScrollBar vBar = getVerticalBar ();
+    if (vBar !is null) {
+        vBar.setVisible(false);
+        vBar.addListener (SWT.Selection, new class() Listener {
+            public void handleEvent (Event e) {
+                vScroll();
+            }
+        });
+    }
+
+    contentListener = new class() Listener {
+        public void handleEvent(Event e) {
+            if (e.type !is SWT.Resize) return;
+            layout(false);
+        }
+    };
+
+    filter = new class() Listener {
+        public void handleEvent(Event event) {
+            if (auto control = cast(Control)event.widget ) {
+                if (contains(control)) showControl(control);
+            }
+        }
+    };
+
+    addDisposeListener(new class() DisposeListener {
+        public void widgetDisposed(DisposeEvent e) {
+            getDisplay().removeFilter(SWT.FocusIn, filter);
+        }
+    });
+}
+
+static int checkStyle (int style) {
+    int mask = SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
+    return style & mask;
+}
+
+bool contains(Control control) {
+    if (control is null || control.isDisposed()) return false;
+
+    Composite parent = control.getParent();
+    while (parent !is null && !( null !is cast(Shell)parent )) {
+        if (this is parent) return true;
+        parent = parent.getParent();
+    }
+    return false;
+}
+
+/**
+ * Returns the Always Show Scrollbars flag.  True if the scrollbars are
+ * always shown even if they are not required.  False if the scrollbars are only
+ * visible when some part of the composite needs to be scrolled to be seen.
+ * The H_SCROLL and V_SCROLL style bits are also required to enable scrollbars in the
+ * horizontal and vertical directions.
+ *
+ * @return the Always Show Scrollbars flag value
+ */
+public bool getAlwaysShowScrollBars() {
+    //checkWidget();
+    return alwaysShowScroll;
+}
+
+/**
+ * Returns <code>true</code> if the content control
+ * will be expanded to fill available horizontal space.
+ *
+ * @return the receiver's horizontal expansion state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public bool getExpandHorizontal() {
+    checkWidget();
+    return expandHorizontal;
+}
+
+/**
+ * Returns <code>true</code> if the content control
+ * will be expanded to fill available vertical space.
+ *
+ * @return the receiver's vertical expansion state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public bool getExpandVertical() {
+    checkWidget();
+    return expandVertical;
+}
+
+/**
+ * Returns the minimum width of the content control.
+ *
+ * @return the minimum width
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public int getMinWidth() {
+    checkWidget();
+    return minWidth;
+}
+
+/**
+ * Returns the minimum height of the content control.
+ *
+ * @return the minimum height
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public int getMinHeight() {
+    checkWidget();
+    return minHeight;
+}
+
+/**
+ * Get the content that is being scrolled.
+ *
+ * @return the control displayed in the content area
+ */
+public Control getContent() {
+    //checkWidget();
+    return content;
+}
+
+/**
+ * Returns <code>true</code> if the receiver automatically scrolls to a focused child control
+ * to make it visible. Otherwise, returns <code>false</code>.
+ *
+ * @return a bool indicating whether focused child controls are automatically scrolled into the viewport
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.4
+ */
+public bool getShowFocusedControl() {
+    checkWidget();
+    return showFocusedControl;
+}
+
+void hScroll() {
+    if (content is null) return;
+    Point location = content.getLocation ();
+    ScrollBar hBar = getHorizontalBar ();
+    int hSelection = hBar.getSelection ();
+    content.setLocation (-hSelection, location.y);
+}
+bool needHScroll(Rectangle contentRect, bool vVisible) {
+    ScrollBar hBar = getHorizontalBar();
+    if (hBar is null) return false;
+
+    Rectangle hostRect = getBounds();
+    int border = getBorderWidth();
+    hostRect.width -= 2*border;
+    ScrollBar vBar = getVerticalBar();
+    if (vVisible && vBar !is null) hostRect.width -= vBar.getSize().x;
+
+    if (!expandHorizontal && contentRect.width > hostRect.width) return true;
+    if (expandHorizontal && minWidth > hostRect.width) return true;
+    return false;
+}
+
+bool needVScroll(Rectangle contentRect, bool hVisible) {
+    ScrollBar vBar = getVerticalBar();
+    if (vBar is null) return false;
+
+    Rectangle hostRect = getBounds();
+    int border = getBorderWidth();
+    hostRect.height -= 2*border;
+    ScrollBar hBar = getHorizontalBar();
+    if (hVisible && hBar !is null) hostRect.height -= hBar.getSize().y;
+
+    if (!expandVertical && contentRect.height > hostRect.height) return true;
+    if (expandVertical && minHeight > hostRect.height) return true;
+    return false;
+}
+
+/**
+ * Return the point in the content that currently appears in the top left
+ * corner of the scrolled composite.
+ *
+ * @return the point in the content that currently appears in the top left
+ * corner of the scrolled composite.  If no content has been set, this returns
+ * (0, 0).
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ */
+public Point getOrigin() {
+    checkWidget();
+    if (content is null) return new Point(0, 0);
+    Point location = content.getLocation();
+    return new Point(-location.x, -location.y);
+}
+/**
+ * Scrolls the content so that the specified point in the content is in the top
+ * left corner.  If no content has been set, nothing will occur.
+ *
+ * Negative values will be ignored.  Values greater than the maximum scroll
+ * distance will result in scrolling to the end of the scrollbar.
+ *
+ * @param origin the point on the content to appear in the top left corner
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_INVALID_ARGUMENT - value of origin is outside of content
+ * </ul>
+ * @since 2.0
+ */
+public void setOrigin(Point origin) {
+    setOrigin(origin.x, origin.y);
+}
+/**
+ * Scrolls the content so that the specified point in the content is in the top
+ * left corner.  If no content has been set, nothing will occur.
+ *
+ * Negative values will be ignored.  Values greater than the maximum scroll
+ * distance will result in scrolling to the end of the scrollbar.
+ *
+ * @param x the x coordinate of the content to appear in the top left corner
+ *
+ * @param y the y coordinate of the content to appear in the top left corner
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ */
+public void setOrigin(int x, int y) {
+    checkWidget();
+    if (content is null) return;
+    ScrollBar hBar = getHorizontalBar ();
+    if (hBar !is null) {
+        hBar.setSelection(x);
+        x = -hBar.getSelection ();
+    } else {
+        x = 0;
+    }
+    ScrollBar vBar = getVerticalBar ();
+    if (vBar !is null) {
+        vBar.setSelection(y);
+        y = -vBar.getSelection ();
+    } else {
+        y = 0;
+    }
+    content.setLocation(x, y);
+}
+/**
+ * Set the Always Show Scrollbars flag.  True if the scrollbars are
+ * always shown even if they are not required.  False if the scrollbars are only
+ * visible when some part of the composite needs to be scrolled to be seen.
+ * The H_SCROLL and V_SCROLL style bits are also required to enable scrollbars in the
+ * horizontal and vertical directions.
+ *
+ * @param show true to show the scrollbars even when not required, false to show scrollbars only when required
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setAlwaysShowScrollBars(bool show) {
+    checkWidget();
+    if (show is alwaysShowScroll) return;
+    alwaysShowScroll = show;
+    ScrollBar hBar = getHorizontalBar ();
+    if (hBar !is null && alwaysShowScroll) hBar.setVisible(true);
+    ScrollBar vBar = getVerticalBar ();
+    if (vBar !is null && alwaysShowScroll) vBar.setVisible(true);
+    layout(false);
+}
+
+/**
+ * Set the content that will be scrolled.
+ *
+ * @param content the control to be displayed in the content area
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setContent(Control content) {
+    checkWidget();
+    if (this.content !is null && !this.content.isDisposed()) {
+        this.content.removeListener(SWT.Resize, contentListener);
+        this.content.setBounds(new Rectangle(-200, -200, 0, 0));
+    }
+
+    this.content = content;
+    ScrollBar vBar = getVerticalBar ();
+    ScrollBar hBar = getHorizontalBar ();
+    if (this.content !is null) {
+        if (vBar !is null) {
+            vBar.setMaximum (0);
+            vBar.setThumb (0);
+            vBar.setSelection(0);
+        }
+        if (hBar !is null) {
+            hBar.setMaximum (0);
+            hBar.setThumb (0);
+            hBar.setSelection(0);
+        }
+        content.setLocation(0, 0);
+        layout(false);
+        this.content.addListener(SWT.Resize, contentListener);
+    } else {
+        if (hBar !is null) hBar.setVisible(alwaysShowScroll);
+        if (vBar !is null) vBar.setVisible(alwaysShowScroll);
+    }
+}
+/**
+ * Configure the ScrolledComposite to resize the content object to be as wide as the
+ * ScrolledComposite when the width of the ScrolledComposite is greater than the
+ * minimum width specified in setMinWidth.  If the ScrolledComposite is less than the
+ * minimum width, the content will not be resized and instead the horizontal scroll bar will be
+ * used to view the entire width.
+ * If expand is false, this behaviour is turned off.  By default, this behaviour is turned off.
+ *
+ * @param expand true to expand the content control to fill available horizontal space
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setExpandHorizontal(bool expand) {
+    checkWidget();
+    if (expand is expandHorizontal) return;
+    expandHorizontal = expand;
+    layout(false);
+}
+/**
+ * Configure the ScrolledComposite to resize the content object to be as tall as the
+ * ScrolledComposite when the height of the ScrolledComposite is greater than the
+ * minimum height specified in setMinHeight.  If the ScrolledComposite is less than the
+ * minimum height, the content will not be resized and instead the vertical scroll bar will be
+ * used to view the entire height.
+ * If expand is false, this behaviour is turned off.  By default, this behaviour is turned off.
+ *
+ * @param expand true to expand the content control to fill available vertical space
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setExpandVertical(bool expand) {
+    checkWidget();
+    if (expand is expandVertical) return;
+    expandVertical = expand;
+    layout(false);
+}
+/**
+ * Sets the layout which is associated with the receiver to be
+ * the argument which may be null.
+ * <p>
+ * Note: No Layout can be set on this Control because it already
+ * manages the size and position of its children.
+ * </p>
+ *
+ * @param layout the receiver's new layout or null
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public override void setLayout (Layout layout) {
+    checkWidget();
+    return;
+}
+/**
+ * Specify the minimum height at which the ScrolledComposite will begin scrolling the
+ * content with the vertical scroll bar.  This value is only relevant if
+ * setExpandVertical(true) has been set.
+ *
+ * @param height the minimum height or 0 for default height
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMinHeight(int height) {
+    setMinSize(minWidth, height);
+}
+/**
+ * Specify the minimum width and height at which the ScrolledComposite will begin scrolling the
+ * content with the horizontal scroll bar.  This value is only relevant if
+ * setExpandHorizontal(true) and setExpandVertical(true) have been set.
+ *
+ * @param size the minimum size or null for the default size
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMinSize(Point size) {
+    if (size is null) {
+        setMinSize(0, 0);
+    } else {
+        setMinSize(size.x, size.y);
+    }
+}
+/**
+ * Specify the minimum width and height at which the ScrolledComposite will begin scrolling the
+ * content with the horizontal scroll bar.  This value is only relevant if
+ * setExpandHorizontal(true) and setExpandVertical(true) have been set.
+ *
+ * @param width the minimum width or 0 for default width
+ * @param height the minimum height or 0 for default height
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMinSize(int width, int height) {
+    checkWidget();
+    if (width is minWidth && height is minHeight) return;
+    minWidth = Math.max(0, width);
+    minHeight = Math.max(0, height);
+    layout(false);
+}
+/**
+ * Specify the minimum width at which the ScrolledComposite will begin scrolling the
+ * content with the horizontal scroll bar.  This value is only relevant if
+ * setExpandHorizontal(true) has been set.
+ *
+ * @param width the minimum width or 0 for default width
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMinWidth(int width) {
+    setMinSize(width, minHeight);
+}
+
+/**
+ * Configure the receiver to automatically scroll to a focused child control
+ * to make it visible.
+ *
+ * If show is <code>false</code>, show a focused control is off.
+ * By default, show a focused control is off.
+ *
+ * @param show <code>true</code> to show a focused control.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.4
+ */
+public void setShowFocusedControl(bool show) {
+    checkWidget();
+    if (showFocusedControl is show) return;
+    Display display = getDisplay();
+    display.removeFilter(SWT.FocusIn, filter);
+    showFocusedControl = show;
+    if (!showFocusedControl) return;
+    display.addFilter(SWT.FocusIn, filter);
+    Control control = display.getFocusControl();
+    if (contains(control)) showControl(control);
+}
+
+/**
+ * Scrolls the content of the receiver so that the control is visible.
+ *
+ * @param control the control to be shown
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the control is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the control has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.4
+ */
+public void showControl(Control control) {
+    checkWidget ();
+    if (control is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (control.isDisposed ()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    if (!contains(control)) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+
+    Rectangle itemRect = getDisplay().map(control.getParent(), this, control.getBounds());
+    Rectangle area = getClientArea();
+    Point origin = getOrigin();
+    if (itemRect.x < 0) origin.x = Math.max(0, origin.x + itemRect.x);
+    if (itemRect.y < 0) origin.y = Math.max(0, origin.y + itemRect.y);
+    if (area.width < itemRect.x + itemRect.width) origin.x = Math.max(0, origin.x + itemRect.x + itemRect.width - area.width);
+    if (area.height < itemRect.y + itemRect.height) origin.y = Math.max(0, origin.y + itemRect.y + itemRect.height - area.height);
+    setOrigin(origin);
+}
+
+void vScroll() {
+    if (content is null) return;
+    Point location = content.getLocation ();
+    ScrollBar vBar = getVerticalBar ();
+    int vSelection = vBar.getSelection ();
+    content.setLocation (location.x, -vSelection);
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/ScrolledCompositeLayout.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,123 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.ScrolledCompositeLayout;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Layout;
+import org.eclipse.swt.widgets.ScrollBar;
+import org.eclipse.swt.custom.ScrolledComposite;
+
+
+/**
+ * This class provides the layout for ScrolledComposite
+ *
+ * @see ScrolledComposite
+ */
+class ScrolledCompositeLayout : Layout {
+
+    bool inLayout = false;
+    static final int DEFAULT_WIDTH  = 64;
+    static final int DEFAULT_HEIGHT = 64;
+
+protected override Point computeSize(Composite composite, int wHint, int hHint, bool flushCache) {
+    ScrolledComposite sc = cast(ScrolledComposite)composite;
+    Point size = new Point(DEFAULT_WIDTH, DEFAULT_HEIGHT);
+    if (sc.content !is null) {
+        Point preferredSize = sc.content.computeSize(wHint, hHint, flushCache);
+        Point currentSize = sc.content.getSize();
+        size.x = sc.getExpandHorizontal() ? preferredSize.x : currentSize.x;
+        size.y = sc.getExpandVertical() ? preferredSize.y : currentSize.y;
+    }
+    size.x = Math.max(size.x, sc.minWidth);
+    size.y = Math.max(size.y, sc.minHeight);
+    if (wHint !is SWT.DEFAULT) size.x = wHint;
+    if (hHint !is SWT.DEFAULT) size.y = hHint;
+    return size;
+}
+
+protected override bool flushCache(Control control) {
+    return true;
+}
+
+protected override void layout(Composite composite, bool flushCache) {
+    if (inLayout) return;
+    ScrolledComposite sc = cast(ScrolledComposite)composite;
+    if (sc.content is null) return;
+    ScrollBar hBar = sc.getHorizontalBar();
+    ScrollBar vBar = sc.getVerticalBar();
+    if (hBar !is null) {
+        if (hBar.getSize().y >= sc.getSize().y) {
+            return;
+        }
+    }
+    if (vBar !is null) {
+        if (vBar.getSize().x >= sc.getSize().x) {
+            return;
+        }
+    }
+    inLayout = true;
+    Rectangle contentRect = sc.content.getBounds();
+    if (!sc.alwaysShowScroll) {
+        bool hVisible = sc.needHScroll(contentRect, false);
+        bool vVisible = sc.needVScroll(contentRect, hVisible);
+        if (!hVisible && vVisible) hVisible = sc.needHScroll(contentRect, vVisible);
+        if (hBar !is null) hBar.setVisible(hVisible);
+        if (vBar !is null) vBar.setVisible(vVisible);
+    }
+    Rectangle hostRect = sc.getClientArea();
+    if (sc.expandHorizontal) {
+        contentRect.width = Math.max(sc.minWidth, hostRect.width);
+    }
+    if (sc.expandVertical) {
+        contentRect.height = Math.max(sc.minHeight, hostRect.height);
+    }
+
+    if (hBar !is null) {
+        hBar.setMaximum (contentRect.width);
+        hBar.setThumb (Math.min (contentRect.width, hostRect.width));
+        int hPage = contentRect.width - hostRect.width;
+        int hSelection = hBar.getSelection ();
+        if (hSelection >= hPage) {
+            if (hPage <= 0) {
+                hSelection = 0;
+                hBar.setSelection(0);
+            }
+            contentRect.x = -hSelection;
+        }
+    }
+
+    if (vBar !is null) {
+        vBar.setMaximum (contentRect.height);
+        vBar.setThumb (Math.min (contentRect.height, hostRect.height));
+        int vPage = contentRect.height - hostRect.height;
+        int vSelection = vBar.getSelection ();
+        if (vSelection >= vPage) {
+            if (vPage <= 0) {
+                vSelection = 0;
+                vBar.setSelection(0);
+            }
+            contentRect.y = -vSelection;
+        }
+    }
+
+    sc.content.setBounds (contentRect);
+    inLayout = false;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/StackLayout.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,159 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.StackLayout;
+
+import java.lang.all;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Layout;
+
+import tango.util.Convert;
+static import tango.text.Util;
+
+/**
+ * This Layout stacks all the controls one on top of the other and resizes all controls
+ * to have the same size and location.
+ * The control specified in topControl is visible and all other controls are not visible.
+ * Users must set the topControl value to flip between the visible items and then call
+ * layout() on the composite which has the StackLayout.
+ *
+ * <p> Here is an example which places ten buttons in a stack layout and
+ * flips between them:
+ *
+ * <pre><code>
+ *  public static void main(String[] args) {
+ *      Display display = new Display();
+ *      Shell shell = new Shell(display);
+ *      shell.setLayout(new GridLayout());
+ *
+ *      final Composite parent = new Composite(shell, SWT.NONE);
+ *      parent.setLayoutData(new GridData(GridData.FILL_BOTH));
+ *      final StackLayout layout = new StackLayout();
+ *      parent.setLayout(layout);
+ *      final Button[] bArray = new Button[10];
+ *      for (int i = 0; i &lt; 10; i++) {
+ *          bArray[i] = new Button(parent, SWT.PUSH);
+ *          bArray[i].setText("Button "+i);
+ *      }
+ *      layout.topControl = bArray[0];
+ *
+ *      Button b = new Button(shell, SWT.PUSH);
+ *      b.setText("Show Next Button");
+ *      final int[] index = new int[1];
+ *      b.addListener(SWT.Selection, new Listener(){
+ *          public void handleEvent(Event e) {
+ *              index[0] = (index[0] + 1) % 10;
+ *              layout.topControl = bArray[index[0]];
+ *              parent.layout();
+ *          }
+ *      });
+ *
+ *      shell.open();
+ *      while (shell !is null && !shell.isDisposed()) {
+ *          if (!display.readAndDispatch())
+ *              display.sleep();
+ *      }
+ *  }
+ * </code></pre>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#stacklayout">StackLayout snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: LayoutExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public class StackLayout : Layout {
+
+    /**
+     * marginWidth specifies the number of pixels of horizontal margin
+     * that will be placed along the left and right edges of the layout.
+     *
+     * The default value is 0.
+     */
+    public int marginWidth = 0;
+    /**
+     * marginHeight specifies the number of pixels of vertical margin
+     * that will be placed along the top and bottom edges of the layout.
+     *
+     * The default value is 0.
+     */
+    public int marginHeight = 0;
+
+    /**
+     * topControl the Control that is displayed at the top of the stack.
+     * All other controls that are children of the parent composite will not be visible.
+     */
+    public Control topControl;
+
+protected override Point computeSize(Composite composite, int wHint, int hHint, bool flushCache) {
+    Control children[] = composite.getChildren();
+    int maxWidth = 0;
+    int maxHeight = 0;
+    for (int i = 0; i < children.length; i++) {
+        Point size = children[i].computeSize(wHint, hHint, flushCache);
+        maxWidth = Math.max(size.x, maxWidth);
+        maxHeight = Math.max(size.y, maxHeight);
+    }
+    int width = maxWidth + 2 * marginWidth;
+    int height = maxHeight + 2 * marginHeight;
+    if (wHint !is SWT.DEFAULT) width = wHint;
+    if (hHint !is SWT.DEFAULT) height = hHint;
+    return new Point(width, height);
+}
+
+protected override bool flushCache(Control control) {
+    return true;
+}
+
+protected override void layout(Composite composite, bool flushCache) {
+    Control children[] = composite.getChildren();
+    Rectangle rect = composite.getClientArea();
+    rect.x += marginWidth;
+    rect.y += marginHeight;
+    rect.width -= 2 * marginWidth;
+    rect.height -= 2 * marginHeight;
+    for (int i = 0; i < children.length; i++) {
+        children[i].setBounds(rect);
+        children[i].setVisible(children[i] is topControl);
+
+    }
+}
+
+String getName () {
+    String string = this.classinfo.name;
+    int index = tango.text.Util.locatePrior( string ,'.');
+    if (index is string.length ) return string;
+    return string[ index + 1 .. $ ];
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the layout
+ */
+public override String toString () {
+    String string = getName ()~" {";
+    if (marginWidth !is 0) string ~= "marginWidth="~to!(String)(marginWidth)~" ";
+    if (marginHeight !is 0) string ~= "marginHeight="~to!(String)(marginHeight)~" ";
+    if (topControl !is null) string ~= "topControl="~to!(String)(topControl)~" ";
+    string = tango.text.Util.trim(string);
+    string ~= "}";
+    return string;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/StyleRange.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,228 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.StyleRange;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.TextStyle;
+import org.eclipse.swt.internal.CloneableCompatibility;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.custom.TextChangedEvent;
+import org.eclipse.swt.custom.TextChangingEvent;
+
+
+/**
+ * <code>StyleRange</code> defines a set of styles for a specified
+ * range of text.
+ * <p>
+ * The hashCode() method in this class uses the values of the public
+ * fields to compute the hash value. When storing instances of the
+ * class in hashed collections, do not modify these fields after the
+ * object has been inserted.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class StyleRange : TextStyle, CloneableCompatibility {
+
+    /**
+     * the start offset of the range, zero-based from the document start
+     */
+    public int start;
+
+    /**
+     * the length of the range
+     */
+    public int length;
+
+    /**
+     * the font style of the range. It may be a combination of
+     * SWT.NORMAL, SWT.ITALIC or SWT.BOLD
+     *
+     * Note: the font style is not used if the <code>font</code> attribute
+     * is set
+     */
+    public int fontStyle = SWT.NORMAL;
+
+/**
+ * Create a new style range with no styles
+ *
+ * @since 3.2
+ */
+public this() {
+}
+/++
+ + SWT extension for clone implementation
+ +/
+protected this( StyleRange other ){
+    super( other );
+    start = other.start;
+    length = other.length;
+    fontStyle = other.fontStyle;
+}
+
+/**
+ * Create a new style range from an existing text style.
+ *
+ * @param style the text style to copy
+ *
+ * @since 3.4
+ */
+public this(TextStyle style) {
+    super(style);
+}
+
+/**
+ * Create a new style range.
+ *
+ * @param start start offset of the style
+ * @param length length of the style
+ * @param foreground foreground color of the style, null if none
+ * @param background background color of the style, null if none
+ */
+public this(int start, int length, Color foreground, Color background) {
+    super(null, foreground, background);
+    this.start = start;
+    this.length = length;
+}
+
+/**
+ * Create a new style range.
+ *
+ * @param start start offset of the style
+ * @param length length of the style
+ * @param foreground foreground color of the style, null if none
+ * @param background background color of the style, null if none
+ * @param fontStyle font style of the style, may be SWT.NORMAL, SWT.ITALIC or SWT.BOLD
+ */
+public this(int start, int length, Color foreground, Color background, int fontStyle) {
+    this(start, length, foreground, background);
+    this.fontStyle = fontStyle;
+}
+
+/**
+ * Compares the argument to the receiver, and returns true
+ * if they represent the <em>same</em> object using a class
+ * specific comparison.
+ *
+ * @param object the object to compare with this object
+ * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
+ *
+ * @see #hashCode()
+ */
+public override int opEquals(Object object) {
+    if (object is this) return true;
+    if (auto style = cast(StyleRange) object ) {
+        if (start !is style.start) return false;
+        if (length !is style.length) return false;
+        return similarTo(style);
+    }
+    return false;
+}
+
+/**
+ * Returns an integer hash code for the receiver. Any two
+ * objects that return <code>true</code> when passed to
+ * <code>equals</code> must return the same value for this
+ * method.
+ *
+ * @return the receiver's hash
+ *
+ * @see #equals(Object)
+ */
+public override hash_t toHash() {
+    return super.toHash() ^ fontStyle;
+}
+bool isVariableHeight() {
+    return font !is null || metrics !is null || rise !is 0;
+}
+/**
+ * Returns whether or not the receiver is unstyled (i.e., does not have any
+ * style attributes specified).
+ *
+ * @return true if the receiver is unstyled, false otherwise.
+ */
+public bool isUnstyled() {
+    if (font !is null) return false;
+    if (rise !is 0) return false;
+    if (metrics !is null) return false;
+    if (foreground !is null) return false;
+    if (background !is null) return false;
+    if (fontStyle !is SWT.NORMAL) return false;
+    if (underline) return false;
+    if (strikeout) return false;
+    if (borderStyle !is SWT.NONE) return false;
+    return true;
+}
+
+/**
+ * Compares the specified object to this StyleRange and answer if the two
+ * are similar. The object must be an instance of StyleRange and have the
+ * same field values for except for start and length.
+ *
+ * @param style the object to compare with this object
+ * @return true if the objects are similar, false otherwise
+ */
+public bool similarTo(StyleRange style) {
+    if (!super.opEquals(style)) return false;
+    if (fontStyle !is style.fontStyle) return false;
+    return true;
+}
+
+/**
+ * Returns a new StyleRange with the same values as this StyleRange.
+ *
+ * @return a shallow copy of this StyleRange
+ */
+public /+override+/ Object clone() {
+    return new StyleRange( this );
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the StyleRange
+ */
+public override String toString() {
+    StringBuffer buffer = new StringBuffer();
+    buffer.append("StyleRange {");
+    buffer.append(start);
+    buffer.append(", ");
+    buffer.append(length);
+    buffer.append(", fontStyle=");
+    switch (fontStyle) {
+        case SWT.BOLD:
+            buffer.append("bold");
+            break;
+        case SWT.ITALIC:
+            buffer.append("italic");
+            break;
+        case SWT.BOLD | SWT.ITALIC:
+            buffer.append("bold-italic");
+            break;
+        default:
+            buffer.append("normal");
+    }
+    String str = super.toString();
+    int index = tango.text.Util.locate( str, '{');
+    if( index is str.length ) index = -1;
+    str = str[ index + 1 .. $ ];
+    if (str.length > 1) buffer.append(", ");
+    buffer.append(str);
+    return buffer.toString();
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/StyledText.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,8453 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.StyledText;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.accessibility.ACC;
+import org.eclipse.swt.accessibility.Accessible;
+import org.eclipse.swt.accessibility.AccessibleAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlEvent;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.accessibility.AccessibleTextAdapter;
+import org.eclipse.swt.accessibility.AccessibleTextEvent;
+import org.eclipse.swt.dnd.Clipboard;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.RTFTransfer;
+import org.eclipse.swt.dnd.TextTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.VerifyListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.FontMetrics;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.GlyphMetrics;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.Resource;
+import org.eclipse.swt.graphics.TextLayout;
+import org.eclipse.swt.internal.BidiUtil;
+import org.eclipse.swt.internal.Compatibility;
+import org.eclipse.swt.printing.Printer;
+import org.eclipse.swt.printing.PrinterData;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Caret;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.IME;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.ScrollBar;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.custom.StyledTextContent;
+import org.eclipse.swt.custom.TextChangeListener;
+import org.eclipse.swt.custom.StyledTextRenderer;
+import org.eclipse.swt.custom.StyledTextPrintOptions;
+import org.eclipse.swt.custom.ExtendedModifyListener;
+import org.eclipse.swt.custom.BidiSegmentListener;
+import org.eclipse.swt.custom.LineBackgroundListener;
+import org.eclipse.swt.custom.LineStyleListener;
+import org.eclipse.swt.custom.PaintObjectListener;
+import org.eclipse.swt.custom.VerifyKeyListener;
+import org.eclipse.swt.custom.MovementListener;
+import org.eclipse.swt.custom.Bullet;
+import org.eclipse.swt.custom.StyledTextEvent;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.custom.TextChangedEvent;
+import org.eclipse.swt.custom.TextChangingEvent;
+import org.eclipse.swt.custom.DefaultContent;
+import org.eclipse.swt.custom.StyledTextDropTargetEffect;
+import org.eclipse.swt.custom.StyledTextListener;
+import org.eclipse.swt.custom.ST;
+
+static import tango.text.Util;
+static import tango.io.model.IFile;
+static import tango.text.convert.Utf;
+import tango.util.Convert;
+import java.lang.all;
+
+
+/**
+ * A StyledText is an editable user interface object that displays lines
+ * of text.  The following style attributes can be defined for the text:
+ * <ul>
+ * <li>foreground color
+ * <li>background color
+ * <li>font style (bold, italic, bold-italic, regular)
+ * <li>underline
+ * <li>strikeout
+ * </ul>
+ * <p>
+ * In addition to text style attributes, the background color of a line may
+ * be specified.
+ * </p><p>
+ * There are two ways to use this widget when specifying text style information.
+ * You may use the API that is defined for StyledText or you may define your own
+ * LineStyleListener.  If you define your own listener, you will be responsible
+ * for maintaining the text style information for the widget.  IMPORTANT: You may
+ * not define your own listener and use the StyledText API.  The following
+ * StyledText API is not supported if you have defined a LineStyleListener:
+ * <ul>
+ * <li>getStyleRangeAtOffset(int)
+ * <li>getStyleRanges()
+ * <li>replaceStyleRanges(int,int,StyleRange[])
+ * <li>setStyleRange(StyleRange)
+ * <li>setStyleRanges(StyleRange[])
+ * </ul>
+ * </p><p>
+ * There are two ways to use this widget when specifying line background colors.
+ * You may use the API that is defined for StyledText or you may define your own
+ * LineBackgroundListener.  If you define your own listener, you will be responsible
+ * for maintaining the line background color information for the widget.
+ * IMPORTANT: You may not define your own listener and use the StyledText API.
+ * The following StyledText API is not supported if you have defined a
+ * LineBackgroundListener:
+ * <ul>
+ * <li>getLineBackground(int)
+ * <li>setLineBackground(int,int,Color)
+ * </ul>
+ * </p><p>
+ * The content implementation for this widget may also be user-defined.  To do so,
+ * you must implement the StyledTextContent interface and use the StyledText API
+ * setContent(StyledTextContent) to initialize the widget.
+ * </p><p>
+ * <dl>
+ * <dt><b>Styles:</b><dd>FULL_SELECTION, MULTI, READ_ONLY, SINGLE, WRAP
+ * <dt><b>Events:</b><dd>ExtendedModify, LineGetBackground, LineGetSegments, LineGetStyle, Modify, Selection, Verify, VerifyKey
+ * </dl>
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#styledtext">StyledText snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Examples: CustomControlExample, TextEditor</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class StyledText : Canvas {
+    alias Canvas.computeSize computeSize;
+
+    static const char TAB = '\t';
+    static const String PlatformLineDelimiter = tango.io.model.IFile.FileConst.NewlineString;
+    static const int BIDI_CARET_WIDTH = 3;
+    static const int DEFAULT_WIDTH  = 64;
+    static const int DEFAULT_HEIGHT = 64;
+    static const int V_SCROLL_RATE = 50;
+    static const int H_SCROLL_RATE = 10;
+
+    static const int ExtendedModify = 3000;
+    static const int LineGetBackground = 3001;
+    static const int LineGetStyle = 3002;
+    static const int TextChanging = 3003;
+    static const int TextSet = 3004;
+    static const int VerifyKey = 3005;
+    static const int TextChanged = 3006;
+    static const int LineGetSegments = 3007;
+    static const int PaintObject = 3008;
+    static const int WordNext = 3009;
+    static const int WordPrevious = 3010;
+
+    static const int PREVIOUS_OFFSET_TRAILING = 0;
+    static const int OFFSET_LEADING = 1;
+
+    Color selectionBackground;  // selection background color
+    Color selectionForeground;  // selection foreground color
+    StyledTextContent content;          // native content (default or user specified)
+    StyledTextRenderer renderer;
+    Listener listener;
+    TextChangeListener textChangeListener;  // listener for TextChanging, TextChanged and TextSet events from StyledTextContent
+    int verticalScrollOffset = 0;       // pixel based
+    int horizontalScrollOffset = 0;     // pixel based
+    int topIndex = 0;                   // top visible line
+    int topIndexY;
+    int clientAreaHeight = 0;           // the client area height. Needed to calculate content width for new visible lines during Resize callback
+    int clientAreaWidth = 0;            // the client area width. Needed during Resize callback to determine if line wrap needs to be recalculated
+    int tabLength = 4;                  // number of characters in a tab
+    int leftMargin;
+    int topMargin;
+    int rightMargin;
+    int bottomMargin;
+    int columnX;                        // keep track of the horizontal caret position when changing lines/pages. Fixes bug 5935
+    int caretOffset = 0;
+    int caretAlignment;
+    Point selection;                    // x and y are start and end caret offsets of selection
+    Point clipboardSelection;           // x and y are start and end caret offsets of previous selection
+    int selectionAnchor;                // position of selection anchor. 0 based offset from beginning of text
+    Point doubleClickSelection;         // selection after last mouse double click
+    bool editable = true;
+    bool wordWrap = false;
+    bool doubleClickEnabled = true;  // see getDoubleClickEnabled
+    bool overwrite = false;          // insert/overwrite edit mode
+    int textLimit = -1;                 // limits the number of characters the user can type in the widget. Unlimited by default.
+    int[int] keyActionMap;
+    Color background = null;            // workaround for bug 4791
+    Color foreground = null;            //
+    Clipboard clipboard;
+    int clickCount;
+    int autoScrollDirection = SWT.NULL; // the direction of autoscrolling (up, down, right, left)
+    int autoScrollDistance = 0;
+    int lastTextChangeStart;            // cache data of the
+    int lastTextChangeNewLineCount;     // last text changing
+    int lastTextChangeNewCharCount;     // event for use in the
+    int lastTextChangeReplaceLineCount; // text changed handler
+    int lastTextChangeReplaceCharCount;
+    int lastLineBottom;                 // the bottom pixel of the last line been replaced
+    bool isMirrored_;
+    bool bidiColoring = false;       // apply the BIDI algorithm on text segments of the same color
+    Image leftCaretBitmap = null;
+    Image rightCaretBitmap = null;
+    int caretDirection = SWT.NULL;
+    int caretWidth = 0;
+    Caret defaultCaret = null;
+    bool updateCaretDirection = true;
+    bool fixedLineHeight;
+    bool dragDetect_ = true;
+    IME ime;
+
+    int alignment;
+    bool justify;
+    int indent;
+    int lineSpacing;
+
+    const static bool IS_CARBON, IS_GTK, IS_MOTIF;
+    static this(){
+        String platform = SWT.getPlatform();
+        IS_CARBON = ("carbon" == platform);
+        IS_GTK    = ("gtk"    == platform);
+        IS_MOTIF  = ("motif"  == platform);
+    }
+
+    /**
+     * The Printing class : printing of a range of text.
+     * An instance of <code>Printing</code> is returned in the
+     * StyledText#print(Printer) API. The run() method may be
+     * invoked from any thread.
+     */
+    static class Printing : Runnable {
+        const static int LEFT = 0;                      // left aligned header/footer segment
+        const static int CENTER = 1;                    // centered header/footer segment
+        const static int RIGHT = 2;                     // right aligned header/footer segment
+
+        Printer printer;
+        StyledTextRenderer printerRenderer;
+        StyledTextPrintOptions printOptions;
+        Rectangle clientArea;
+        FontData fontData;
+        Font printerFont;
+        Resource[Resource] resources;
+        int tabLength;
+        GC gc;                                          // printer GC
+        int pageWidth;                                  // width of a printer page in pixels
+        int startPage;                                  // first page to print
+        int endPage;                                    // last page to print
+        int startLine;                                  // first (wrapped) line to print
+        int endLine;                                    // last (wrapped) line to print
+        bool singleLine;                             // widget single line mode
+        Point selection = null;                 // selected text
+        bool mirrored;                       // indicates the printing gc should be mirrored
+        int lineSpacing;
+        int printMargin;
+
+    /**
+     * Creates an instance of <code>Printing</code>.
+     * Copies the widget content and rendering data that needs
+     * to be requested from listeners.
+     * </p>
+     * @param parent StyledText widget to print.
+     * @param printer printer device to print on.
+     * @param printOptions print options
+     */
+    this(StyledText styledText, Printer printer, StyledTextPrintOptions printOptions) {
+        this.printer = printer;
+        this.printOptions = printOptions;
+        this.mirrored = (styledText.getStyle() & SWT.MIRRORED) !is 0;
+        singleLine = styledText.isSingleLine();
+        startPage = 1;
+        endPage = int.max;
+        PrinterData data = printer.getPrinterData();
+        if (data.scope_ is PrinterData.PAGE_RANGE) {
+            startPage = data.startPage;
+            endPage = data.endPage;
+            if (endPage < startPage) {
+                int temp = endPage;
+                endPage = startPage;
+                startPage = temp;
+            }
+        } else if (data.scope_ is PrinterData.SELECTION) {
+            selection = styledText.getSelectionRange();
+        }
+        printerRenderer = new StyledTextRenderer(printer, null);
+        printerRenderer.setContent(copyContent(styledText.getContent()));
+        cacheLineData(styledText);
+    }
+    /**
+     * Caches all line data that needs to be requested from a listener.
+     * </p>
+     * @param printerContent <code>StyledTextContent</code> to request
+     *  line data for.
+     */
+    void cacheLineData(StyledText styledText) {
+        StyledTextRenderer renderer = styledText.renderer;
+        renderer.copyInto(printerRenderer);
+        fontData = styledText.getFont().getFontData()[0];
+        tabLength = styledText.tabLength;
+        int lineCount = printerRenderer.lineCount;
+        if (styledText.isListening(LineGetBackground) || (styledText.isBidi() && styledText.isListening(LineGetSegments)) || styledText.isListening(LineGetStyle)) {
+            StyledTextContent content = printerRenderer.content;
+            for (int i = 0; i < lineCount; i++) {
+                String line = content.getLine(i);
+                int lineOffset = content.getOffsetAtLine(i);
+                StyledTextEvent event = styledText.getLineBackgroundData(lineOffset, line);
+                if (event !is null && event.lineBackground !is null) {
+                    printerRenderer.setLineBackground(i, 1, event.lineBackground);
+                }
+                if (styledText.isBidi()) {
+                    int[] segments = styledText.getBidiSegments(lineOffset, line);
+                    printerRenderer.setLineSegments(i, 1, segments);
+                }
+                event = styledText.getLineStyleData(lineOffset, line);
+                if (event !is null) {
+                    printerRenderer.setLineIndent(i, 1, event.indent);
+                    printerRenderer.setLineAlignment(i, 1, event.alignment);
+                    printerRenderer.setLineJustify(i, 1, event.justify);
+                    printerRenderer.setLineBullet(i, 1, event.bullet);
+                    StyleRange[] styles = event.styles;
+                    if (styles !is null && styles.length > 0) {
+                        printerRenderer.setStyleRanges(event.ranges, styles);
+                    }
+                }
+            }
+        }
+        Point screenDPI = styledText.getDisplay().getDPI();
+        Point printerDPI = printer.getDPI();
+        resources = null;
+        for (int i = 0; i < lineCount; i++) {
+            Color color = printerRenderer.getLineBackground(i, null);
+            if (color !is null) {
+                if (printOptions.printLineBackground) {
+                    Color printerColor;
+                    if ( auto p = color in resources ) {
+                        printerColor = cast(Color)*p;
+                    }
+                    else {
+                        printerColor = new Color (printer, color.getRGB());
+                        resources[color]=printerColor;
+                    }
+                    printerRenderer.setLineBackground(i, 1, printerColor);
+                } else {
+                    printerRenderer.setLineBackground(i, 1, null);
+                }
+            }
+            int indent = printerRenderer.getLineIndent(i, 0);
+            if (indent !is 0) {
+                printerRenderer.setLineIndent(i, 1, indent * printerDPI.x / screenDPI.x);
+            }
+        }
+        StyleRange[] styles = printerRenderer.styles;
+        for (int i = 0; i < printerRenderer.styleCount; i++) {
+            StyleRange style = styles[i];
+            Font font = style.font;
+            if (style.font !is null) {
+                Font printerFont;
+                if ( auto p = font in resources ) {
+                    printerFont = cast(Font)*p;
+                }
+                else {
+                    printerFont = new Font (printer, font.getFontData());
+                    resources[font]= printerFont;
+                }
+                style.font = printerFont;
+            }
+            Color color = style.foreground;
+            if (color !is null) {
+                if (printOptions.printTextForeground) {
+                    Color printerColor;
+                    if ( auto p = color in resources ) {
+                        printerColor = cast(Color)*p;
+                    }
+                    else {
+                        printerColor = new Color (printer, color.getRGB());
+                        resources[color]=printerColor;
+                    }
+                    style.foreground = printerColor;
+                } else {
+                    style.foreground = null;
+                }
+            }
+            color = style.background;
+            if (color !is null) {
+                if (printOptions.printTextBackground) {
+                    Color printerColor;
+                    if ( auto p = color in resources ) {
+                        printerColor = cast(Color)*p;
+                    }
+                    else {
+                        printerColor = new Color (printer, color.getRGB());
+                        resources[color]=printerColor;
+                    }
+                    style.background = printerColor;
+                } else {
+                    style.background = null;
+                }
+            }
+            if (!printOptions.printTextFontStyle) {
+                style.fontStyle = SWT.NORMAL;
+            }
+            style.rise = style.rise * printerDPI.y / screenDPI.y;
+            GlyphMetrics metrics = style.metrics;
+            if (metrics !is null) {
+                metrics.ascent = metrics.ascent * printerDPI.y / screenDPI.y;
+                metrics.descent = metrics.descent * printerDPI.y / screenDPI.y;
+                metrics.width = metrics.width * printerDPI.x / screenDPI.x;
+            }
+        }
+        lineSpacing = styledText.lineSpacing * printerDPI.y / screenDPI.y;
+        if (printOptions.printLineNumbers) {
+            printMargin = 3 * printerDPI.x / screenDPI.x;
+        }
+    }
+    /**
+     * Copies the text of the specified <code>StyledTextContent</code>.
+     * </p>
+     * @param original the <code>StyledTextContent</code> to copy.
+     */
+    StyledTextContent copyContent(StyledTextContent original) {
+        StyledTextContent printerContent = new DefaultContent();
+        int insertOffset = 0;
+        for (int i = 0; i < original.getLineCount(); i++) {
+            int insertEndOffset;
+            if (i < original.getLineCount() - 1) {
+                insertEndOffset = original.getOffsetAtLine(i + 1);
+            } else {
+                insertEndOffset = original.getCharCount();
+            }
+            printerContent.replaceTextRange(insertOffset, 0, original.getTextRange(insertOffset, insertEndOffset - insertOffset));
+            insertOffset = insertEndOffset;
+        }
+        return printerContent;
+    }
+    /**
+     * Disposes of the resources and the <code>PrintRenderer</code>.
+     */
+    void dispose() {
+        if (gc !is null) {
+            gc.dispose();
+            gc = null;
+        }
+        foreach( resource; resources.values ){
+            resource.dispose();
+        }
+        resources = null;
+        if (printerFont !is null) {
+            printerFont.dispose();
+            printerFont = null;
+        }
+        if (printerRenderer !is null) {
+            printerRenderer.dispose();
+            printerRenderer = null;
+        }
+    }
+    void init_() {
+        Rectangle trim = printer.computeTrim(0, 0, 0, 0);
+        Point dpi = printer.getDPI();
+
+        printerFont = new Font( cast(Device)printer, fontData.getName(), fontData.getHeight(), SWT.NORMAL);
+        clientArea = printer.getClientArea();
+        pageWidth = clientArea.width;
+        // one inch margin around text
+        clientArea.x = dpi.x + trim.x;
+        clientArea.y = dpi.y + trim.y;
+        clientArea.width -= (clientArea.x + trim.width);
+        clientArea.height -= (clientArea.y + trim.height);
+
+        int style = mirrored ? SWT.RIGHT_TO_LEFT : SWT.LEFT_TO_RIGHT;
+        gc = new GC(printer, style);
+        gc.setFont(printerFont);
+        printerRenderer.setFont(printerFont, tabLength);
+        int lineHeight = printerRenderer.getLineHeight();
+        if (printOptions.header !is null) {
+            clientArea.y += lineHeight * 2;
+            clientArea.height -= lineHeight * 2;
+        }
+        if (printOptions.footer !is null) {
+            clientArea.height -= lineHeight * 2;
+        }
+
+        // TODO not wrapped
+        StyledTextContent content = printerRenderer.content;
+        startLine = 0;
+        endLine = singleLine ? 0 : content.getLineCount() - 1;
+        PrinterData data = printer.getPrinterData();
+        if (data.scope_ is PrinterData.PAGE_RANGE) {
+            int pageSize = clientArea.height / lineHeight;//WRONG
+            startLine = (startPage - 1) * pageSize;
+        } else if (data.scope_ is PrinterData.SELECTION) {
+            startLine = content.getLineAtOffset(selection.x);
+            if (selection.y > 0) {
+                endLine = content.getLineAtOffset(selection.x + selection.y - 1);
+            } else {
+                endLine = startLine - 1;
+            }
+        }
+    }
+    /**
+     * Prints the lines in the specified page range.
+     */
+    void print() {
+        Color background = gc.getBackground();
+        Color foreground = gc.getForeground();
+        int paintY = clientArea.y;
+        int paintX = clientArea.x;
+        int width = clientArea.width;
+        int page = startPage;
+        int pageBottom = clientArea.y + clientArea.height;
+        int orientation =  gc.getStyle() & (SWT.RIGHT_TO_LEFT | SWT.LEFT_TO_RIGHT);
+        TextLayout printLayout = null;
+        if (printOptions.printLineNumbers || printOptions.header !is null || printOptions.footer !is null) {
+            printLayout = new TextLayout(printer);
+            printLayout.setFont(printerFont);
+        }
+        if (printOptions.printLineNumbers) {
+            int numberingWidth = 0;
+            int count = endLine - startLine + 1;
+            String[] lineLabels = printOptions.lineLabels;
+            if (lineLabels !is null) {
+                for (int i = startLine; i < Math.min(count, lineLabels.length); i++) {
+                    if (lineLabels[i] !is null) {
+                        printLayout.setText(lineLabels[i]);
+                        int lineWidth = printLayout.getBounds().width;
+                        numberingWidth = Math.max(numberingWidth, lineWidth);
+                    }
+                }
+            } else {
+                StringBuffer buffer = new StringBuffer("0");
+                while ((count /= 10) > 0) buffer.append("0");
+                printLayout.setText(buffer.toString());
+                numberingWidth = printLayout.getBounds().width;
+            }
+            numberingWidth += printMargin;
+            if (numberingWidth > width) numberingWidth = width;
+            paintX += numberingWidth;
+            width -= numberingWidth;
+        }
+        for (int i = startLine; i <= endLine && page <= endPage; i++) {
+            if (paintY is clientArea.y) {
+                printer.startPage();
+                printDecoration(page, true, printLayout);
+            }
+            TextLayout layout = printerRenderer.getTextLayout(i, orientation, width, lineSpacing);
+            Color lineBackground = printerRenderer.getLineBackground(i, background);
+            int paragraphBottom = paintY + layout.getBounds().height;
+            if (paragraphBottom <= pageBottom) {
+                //normal case, the whole paragraph fits in the current page
+                printLine(paintX, paintY, gc, foreground, lineBackground, layout, printLayout, i);
+                paintY = paragraphBottom;
+            } else {
+                int lineCount = layout.getLineCount();
+                while (paragraphBottom > pageBottom && lineCount > 0) {
+                    lineCount--;
+                    paragraphBottom -= layout.getLineBounds(lineCount).height + layout.getSpacing();
+                }
+                if (lineCount is 0) {
+                    //the whole paragraph goes to the next page
+                    printDecoration(page, false, printLayout);
+                    printer.endPage();
+                    page++;
+                    if (page <= endPage) {
+                        printer.startPage();
+                        printDecoration(page, true, printLayout);
+                        paintY = clientArea.y;
+                        printLine(paintX, paintY, gc, foreground, lineBackground, layout, printLayout, i);
+                        paintY += layout.getBounds().height;
+                    }
+                } else {
+                    //draw paragraph top in the current page and paragraph bottom in the next
+                    int height = paragraphBottom - paintY;
+                    gc.setClipping(clientArea.x, paintY, clientArea.width, height);
+                    printLine(paintX, paintY, gc, foreground, lineBackground, layout, printLayout, i);
+                    gc.setClipping(cast(Rectangle)null);
+                    printDecoration(page, false, printLayout);
+                    printer.endPage();
+                    page++;
+                    if (page <= endPage) {
+                        printer.startPage();
+                        printDecoration(page, true, printLayout);
+                        paintY = clientArea.y - height;
+                        int layoutHeight = layout.getBounds().height;
+                        gc.setClipping(clientArea.x, clientArea.y, clientArea.width, layoutHeight - height);
+                        printLine(paintX, paintY, gc, foreground, lineBackground, layout, printLayout, i);
+                        gc.setClipping(cast(Rectangle)null);
+                        paintY += layoutHeight;
+                    }
+                }
+            }
+            printerRenderer.disposeTextLayout(layout);
+        }
+        if (page <= endPage && paintY > clientArea.y) {
+            // close partial page
+            printDecoration(page, false, printLayout);
+            printer.endPage();
+        }
+        if (printLayout !is null) printLayout.dispose();
+    }
+    /**
+     * Print header or footer decorations.
+     *
+     * @param page page number to print, if specified in the StyledTextPrintOptions header or footer.
+     * @param header true = print the header, false = print the footer
+     */
+    void printDecoration(int page, bool header, TextLayout layout) {
+        String text = header ? printOptions.header : printOptions.footer;
+        if (text is null) return;
+        int lastSegmentIndex = 0;
+        for (int i = 0; i < 3; i++) {
+            int segmentIndex = text.indexOf( StyledTextPrintOptions.SEPARATOR, lastSegmentIndex);
+            String segment;
+            if (segmentIndex is -1 ) {
+                segment = text.substring(lastSegmentIndex);
+                printDecorationSegment(segment, i, page, header, layout);
+                break;
+            } else {
+                segment = text.substring(lastSegmentIndex, segmentIndex);
+                printDecorationSegment(segment, i, page, header, layout);
+                lastSegmentIndex = segmentIndex + StyledTextPrintOptions.SEPARATOR.length;
+            }
+        }
+    }
+    /**
+     * Print one segment of a header or footer decoration.
+     * Headers and footers have three different segments.
+     * One each for left aligned, centered, and right aligned text.
+     *
+     * @param segment decoration segment to print
+     * @param alignment alignment of the segment. 0=left, 1=center, 2=right
+     * @param page page number to print, if specified in the decoration segment.
+     * @param header true = print the header, false = print the footer
+     */
+    void printDecorationSegment(String segment, int alignment, int page, bool header, TextLayout layout) {
+        int pageIndex = segment.indexOf(StyledTextPrintOptions.PAGE_TAG);
+        if (pageIndex !is -1 ) {
+            int pageTagLength = StyledTextPrintOptions.PAGE_TAG.length;
+            StringBuffer buffer = new StringBuffer(segment.substring (0, pageIndex));
+            buffer.append (page);
+            buffer.append (segment.substring(pageIndex + pageTagLength));
+            segment = buffer.toString().dup;
+        }
+        if (segment.length > 0) {
+            layout.setText(segment);
+            int segmentWidth = layout.getBounds().width;
+            int segmentHeight = printerRenderer.getLineHeight();
+            int drawX = 0, drawY;
+            if (alignment is LEFT) {
+                drawX = clientArea.x;
+            } else if (alignment is CENTER) {
+                drawX = (pageWidth - segmentWidth) / 2;
+            } else if (alignment is RIGHT) {
+                drawX = clientArea.x + clientArea.width - segmentWidth;
+            }
+            if (header) {
+                drawY = clientArea.y - segmentHeight * 2;
+            } else {
+                drawY = clientArea.y + clientArea.height + segmentHeight;
+            }
+            layout.draw(gc, drawX, drawY);
+        }
+    }
+    void printLine(int x, int y, GC gc, Color foreground, Color background, TextLayout layout, TextLayout printLayout, int index) {
+        if (background !is null) {
+            Rectangle rect = layout.getBounds();
+            gc.setBackground(background);
+            gc.fillRectangle(x, y, rect.width, rect.height);
+
+//          int lineCount = layout.getLineCount();
+//          for (int i = 0; i < lineCount; i++) {
+//              Rectangle rect = layout.getLineBounds(i);
+//              rect.x += paintX;
+//              rect.y += paintY + layout.getSpacing();
+//              rect.width = width;//layout bounds
+//              gc.fillRectangle(rect);
+//          }
+        }
+        if (printOptions.printLineNumbers) {
+            FontMetrics metrics = layout.getLineMetrics(0);
+            printLayout.setAscent(metrics.getAscent() + metrics.getLeading());
+            printLayout.setDescent(metrics.getDescent());
+            String[] lineLabels = printOptions.lineLabels;
+            if (lineLabels !is null) {
+                if (0 <= index && index < lineLabels.length && lineLabels[index] !is null) {
+                    printLayout.setText(lineLabels[index]);
+                } else {
+                    printLayout.setText("");
+                }
+            } else {
+                printLayout.setText(to!(String)(index));
+            }
+            int paintX = x - printMargin - printLayout.getBounds().width;
+            printLayout.draw(gc, paintX, y);
+            printLayout.setAscent(-1);
+            printLayout.setDescent(-1);
+        }
+        gc.setForeground(foreground);
+        layout.draw(gc, x, y);
+    }
+    /**
+     * Starts a print job and prints the pages specified in the constructor.
+     */
+    public void run() {
+        String jobName = printOptions.jobName;
+        if (jobName is null) {
+            jobName = "Printing";
+        }
+        if (printer.startJob(jobName)) {
+            init_();
+            print();
+            dispose();
+            printer.endJob();
+        }
+    }
+    }
+    /**
+     * The <code>RTFWriter</code> class is used to write widget content as
+     * rich text. The implementation complies with the RTF specification
+     * version 1.5.
+     * <p>
+     * toString() is guaranteed to return a valid RTF string only after
+     * close() has been called.
+     * </p><p>
+     * Whole and partial lines and line breaks can be written. Lines will be
+     * formatted using the styles queried from the LineStyleListener, if
+     * set, or those set directly in the widget. All styles are applied to
+     * the RTF stream like they are rendered by the widget. In addition, the
+     * widget font name and size is used for the whole text.
+     * </p>
+     */
+    class RTFWriter : TextWriter {
+
+        alias TextWriter.write write;
+
+        static const int DEFAULT_FOREGROUND = 0;
+        static const int DEFAULT_BACKGROUND = 1;
+        Color[] colorTable;
+        Font[] fontTable;
+        bool WriteUnicode;
+
+    /**
+     * Creates a RTF writer that writes content starting at offset "start"
+     * in the document.  <code>start</code> and <code>length</code>can be set to specify partial
+     * lines.
+     *
+     * @param start start offset of content to write, 0 based from
+     *  beginning of document
+     * @param length length of content to write
+     */
+    public this(int start, int length) {
+        super(start, length);
+        colorTable ~= getForeground();
+        colorTable ~= getBackground();
+        fontTable ~= getFont();
+        setUnicode();
+    }
+    /**
+     * Closes the RTF writer. Once closed no more content can be written.
+     * <b>NOTE:</b>  <code>toString()</code> does not return a valid RTF string until
+     * <code>close()</code> has been called.
+     */
+    public override void close() {
+        if (!isClosed()) {
+            writeHeader();
+            write("\n}}\0");
+            super.close();
+        }
+    }
+    /**
+     * Returns the index of the specified color in the RTF color table.
+     *
+     * @param color the color
+     * @param defaultIndex return value if color is null
+     * @return the index of the specified color in the RTF color table
+     *  or "defaultIndex" if "color" is null.
+     */
+    int getColorIndex(Color color, int defaultIndex) {
+        if (color is null) return defaultIndex;
+        int index = -1;
+        foreach( i, col; colorTable ){
+            if( col == color ){
+                index = i;
+                break;
+            }
+        }
+        if (index is -1) {
+            index = colorTable.length;
+            colorTable ~= color;
+        }
+        return index;
+    }
+    /**
+     * Returns the index of the specified color in the RTF color table.
+     *
+     * @param color the color
+     * @param defaultIndex return value if color is null
+     * @return the index of the specified color in the RTF color table
+     *  or "defaultIndex" if "color" is null.
+     */
+    int getFontIndex(Font font) {
+        int index = -1;
+        foreach( i, f; colorTable ){
+            if( f == font ){
+                index = i;
+                break;
+            }
+        }
+        if (index is -1) {
+            index = fontTable.length;
+            fontTable ~= font;
+        }
+        return index;
+    }
+    /**
+     * Determines if Unicode RTF should be written.
+     * Don't write Unicode RTF on Windows 95/98/ME or NT.
+     */
+    void setUnicode() {
+//         const String Win95 = "windows 95";
+//         const String Win98 = "windows 98";
+//         const String WinME = "windows me";
+//         const String WinNT = "windows nt";
+//         String osName = System.getProperty("os.name").toLowerCase();
+//         String osVersion = System.getProperty("os.version");
+//         int majorVersion = 0;
+//
+//         if (osName.startsWith(WinNT) && osVersion !is null) {
+//             int majorIndex = osVersion.indexOf('.');
+//             if (majorIndex !is -1) {
+//                 osVersion = osVersion.substring(0, majorIndex);
+//                 try {
+//                     majorVersion = Integer.parseInt(osVersion);
+//                 } catch (NumberFormatException exception) {
+//                     // ignore exception. version number remains unknown.
+//                     // will write without Unicode
+//                 }
+//             }
+//         }
+//         WriteUnicode =  !osName.startsWith(Win95) &&
+//                         !osName.startsWith(Win98) &&
+//                         !osName.startsWith(WinME) &&
+//                         (!osName.startsWith(WinNT) || majorVersion > 4);
+        WriteUnicode = true; // we are on linux-gtk
+    }
+    /**
+     * Appends the specified segment of "string" to the RTF data.
+     * Copy from <code>start</code> up to, but excluding, <code>end</code>.
+     *
+     * @param string string to copy a segment from. Must not contain
+     *  line breaks. Line breaks should be written using writeLineDelimiter()
+     * @param start start offset of segment. 0 based.
+     * @param end end offset of segment
+     */
+    void write(String string, int start, int end) {
+        start = 0;
+        end = string.length;
+        int incr = 1;
+        for (int index = start; index < end; index+=incr) {
+            dchar ch = firstCodePoint( string[index .. $], incr );
+            if (ch > 0xFF && WriteUnicode) {
+                // write the sub string from the last escaped character
+                // to the current one. Fixes bug 21698.
+                if (index > start) {
+                    write( string[start .. index ] );
+                }
+                write("\\u");
+                write( to!(String)( cast(short)ch ));
+                write(' ');                     // control word delimiter
+                start = index + incr;
+            } else if (ch is '}' || ch is '{' || ch is '\\') {
+                // write the sub string from the last escaped character
+                // to the current one. Fixes bug 21698.
+                if (index > start) {
+                    write(string[start .. index]);
+                }
+                write('\\');
+                write(cast(char)ch); // ok because one of {}\
+                start = index + 1;
+            }
+        }
+        // write from the last escaped character to the end.
+        // Fixes bug 21698.
+        if (start < end) {
+            write(string[ start .. end]);
+        }
+    }
+    /**
+     * Writes the RTF header including font table and color table.
+     */
+    void writeHeader() {
+        StringBuffer header = new StringBuffer();
+        FontData fontData = getFont().getFontData()[0];
+        header.append("{\\rtf1\\ansi");
+        // specify code page, necessary for copy to work in bidi
+        // systems that don't support Unicode RTF.
+        // PORTING_TODO: String cpg = System.getProperty("file.encoding").toLowerCase();
+        String cpg = "UTF16";
+        /+
+        if (cpg.startsWith("cp") || cpg.startsWith("ms")) {
+            cpg = cpg.substring(2, cpg.length());
+            header.append("\\ansicpg");
+            header.append(cpg);
+        }
+        +/
+        header.append("\\uc0\\deff0{\\fonttbl{\\f0\\fnil ");
+        header.append(fontData.getName());
+        header.append(";");
+        for (int i = 1; i < fontTable.length; i++) {
+            header.append("\\f");
+            header.append(i);
+            header.append(" ");
+            FontData fd = (cast(Font)fontTable[i]).getFontData()[0];
+            header.append(fd.getName());
+            header.append(";");
+        }
+        header.append("}}\n{\\colortbl");
+        for (int i = 0; i < colorTable.length; i++) {
+            Color color = cast(Color) colorTable[i];
+            header.append("\\red");
+            header.append(color.getRed());
+            header.append("\\green");
+            header.append(color.getGreen());
+            header.append("\\blue");
+            header.append(color.getBlue());
+            header.append(";");
+        }
+        // some RTF readers ignore the deff0 font tag. Explicitly
+        // set the font for the whole document to work around this.
+        header.append("}\n{\\f0\\fs");
+        // font size is specified in half points
+        header.append(fontData.getHeight() * 2);
+        header.append(" ");
+        write(header.toString(), 0);
+    }
+    /**
+     * Appends the specified line text to the RTF data.  Lines will be formatted
+     * using the styles queried from the LineStyleListener, if set, or those set
+     * directly in the widget.
+     *
+     * @param line line text to write as RTF. Must not contain line breaks
+     *  Line breaks should be written using writeLineDelimiter()
+     * @param lineOffset offset of the line. 0 based from the start of the
+     *  widget document. Any text occurring before the start offset or after the
+     *  end offset specified during object creation is ignored.
+     * @exception SWTException <ul>
+     *   <li>ERROR_IO when the writer is closed.</li>
+     * </ul>
+     */
+    public override void writeLine(String line, int lineOffset) {
+        if (isClosed()) {
+            SWT.error(SWT.ERROR_IO);
+        }
+        int lineIndex = content.getLineAtOffset(lineOffset);
+        int lineAlignment, lineIndent;
+        bool lineJustify;
+        int[] ranges;
+        StyleRange[] styles;
+        StyledTextEvent event = getLineStyleData(lineOffset, line);
+        if (event !is null) {
+            lineAlignment = event.alignment;
+            lineIndent = event.indent;
+            lineJustify = event.justify;
+            ranges = event.ranges;
+            styles = event.styles;
+        } else {
+            lineAlignment = renderer.getLineAlignment(lineIndex, alignment);
+            lineIndent =  renderer.getLineIndent(lineIndex, indent);
+            lineJustify = renderer.getLineJustify(lineIndex, justify);
+            ranges = renderer.getRanges(lineOffset, line.length);
+            styles = renderer.getStyleRanges(lineOffset, line.length, false);
+        }
+        if (styles is null) styles = new StyleRange[0];
+        Color lineBackground = renderer.getLineBackground(lineIndex, null);
+        event = getLineBackgroundData(lineOffset, line);
+        if (event !is null && event.lineBackground !is null) lineBackground = event.lineBackground;
+        writeStyledLine(line, lineOffset, ranges, styles, lineBackground, lineIndent, lineAlignment, lineJustify);
+    }
+    /**
+     * Appends the specified line delimiter to the RTF data.
+     *
+     * @param lineDelimiter line delimiter to write as RTF.
+     * @exception SWTException <ul>
+     *   <li>ERROR_IO when the writer is closed.</li>
+     * </ul>
+     */
+    public override void writeLineDelimiter(String lineDelimiter) {
+        if (isClosed()) {
+            SWT.error(SWT.ERROR_IO);
+        }
+        write(lineDelimiter, 0, lineDelimiter.length);
+        write("\\par ");
+    }
+    /**
+     * Appends the specified line text to the RTF data.
+     * <p>
+     * Use the colors and font styles specified in "styles" and "lineBackground".
+     * Formatting is written to reflect the text rendering by the text widget.
+     * Style background colors take precedence over the line background color.
+     * Background colors are written using the \highlight tag (vs. the \cb tag).
+     * </p>
+     *
+     * @param line line text to write as RTF. Must not contain line breaks
+     *  Line breaks should be written using writeLineDelimiter()
+     * @param lineOffset offset of the line. 0 based from the start of the
+     *  widget document. Any text occurring before the start offset or after the
+     *  end offset specified during object creation is ignored.
+     * @param styles styles to use for formatting. Must not be null.
+     * @param lineBackground line background color to use for formatting.
+     *  May be null.
+     */
+    void writeStyledLine(String line, int lineOffset, int ranges[], StyleRange[] styles, Color lineBackground, int indent, int alignment, bool justify) {
+        int lineLength = line.length;
+        int startOffset = getStart();
+        int writeOffset = startOffset - lineOffset;
+        if (writeOffset >= lineLength) return;
+        int lineIndex = Math.max(0, writeOffset);
+
+        write("\\fi");
+        write(indent);
+        switch (alignment) {
+            case SWT.LEFT: write("\\ql"); break;
+            case SWT.CENTER: write("\\qc"); break;
+            case SWT.RIGHT: write("\\qr"); break;
+            default:
+        }
+        if (justify) write("\\qj");
+        write(" ");
+
+        if (lineBackground !is null) {
+            write("{\\highlight");
+            write(getColorIndex(lineBackground, DEFAULT_BACKGROUND));
+            write(" ");
+        }
+        int endOffset = startOffset + super.getCharCount();
+        int lineEndOffset = Math.min(lineLength, endOffset - lineOffset);
+        for (int i = 0; i < styles.length; i++) {
+            StyleRange style = styles[i];
+            int start, end;
+            if (ranges !is null) {
+                start = ranges[i << 1] - lineOffset;
+                end = start + ranges[(i << 1) + 1];
+            } else {
+                start = style.start - lineOffset;
+                end = start + style.length;
+            }
+            // skip over partial first line
+            if (end < writeOffset) {
+                continue;
+            }
+            // style starts beyond line end or RTF write end
+            if (start >= lineEndOffset) {
+                break;
+            }
+            // write any unstyled text
+            if (lineIndex < start) {
+                // copy to start of style
+                // style starting beyond end of write range or end of line
+                // is guarded against above.
+                write(line, lineIndex, start);
+                lineIndex = start;
+            }
+            // write styled text
+            write("{\\cf");
+            write(getColorIndex(style.foreground, DEFAULT_FOREGROUND));
+            int colorIndex = getColorIndex(style.background, DEFAULT_BACKGROUND);
+            if (colorIndex !is DEFAULT_BACKGROUND) {
+                write("\\highlight");
+                write(colorIndex);
+            }
+            Font font = style.font;
+            if (font !is null) {
+                int fontIndex = getFontIndex(font);
+                write("\\f");
+                write(fontIndex);
+                FontData fontData = font.getFontData()[0];
+                write("\\fs");
+                write(fontData.getHeight() * 2);
+            } else {
+                if ((style.fontStyle & SWT.BOLD) !is 0) {
+                    write("\\b");
+                }
+                if ((style.fontStyle & SWT.ITALIC) !is 0) {
+                    write("\\i");
+                }
+            }
+            if (style.underline) {
+                write("\\ul");
+            }
+            if (style.strikeout) {
+                write("\\strike");
+            }
+            write(" ");
+            // copy to end of style or end of write range or end of line
+            int copyEnd = Math.min(end, lineEndOffset);
+            // guard against invalid styles and let style processing continue
+            copyEnd = Math.max(copyEnd, lineIndex);
+            write(line, lineIndex, copyEnd);
+            if (font is null) {
+                if ((style.fontStyle & SWT.BOLD) !is 0) {
+                    write("\\b0");
+                }
+                if ((style.fontStyle & SWT.ITALIC) !is 0) {
+                    write("\\i0");
+                }
+            }
+            if (style.underline) {
+                write("\\ul0");
+            }
+            if (style.strikeout) {
+                write("\\strike0");
+            }
+            write("}");
+            lineIndex = copyEnd;
+        }
+        // write unstyled text at the end of the line
+        if (lineIndex < lineEndOffset) {
+            write(line, lineIndex, lineEndOffset);
+        }
+        if (lineBackground !is null) write("}");
+    }
+    }
+    /**
+     * The <code>TextWriter</code> class is used to write widget content to
+     * a string.  Whole and partial lines and line breaks can be written. To write
+     * partial lines, specify the start and length of the desired segment
+     * during object creation.
+     * <p>
+     * </b>NOTE:</b> <code>toString()</code> is guaranteed to return a valid string only after close()
+     * has been called.
+     * </p>
+     */
+    class TextWriter {
+        private StringBuffer buffer;
+        private int startOffset;    // offset of first character that will be written
+        private int endOffset;      // offset of last character that will be written.
+                                    // 0 based from the beginning of the widget text.
+        private bool isClosed_ = false;
+
+    /**
+     * Creates a writer that writes content starting at offset "start"
+     * in the document.  <code>start</code> and <code>length</code> can be set to specify partial lines.
+     *
+     * @param start start offset of content to write, 0 based from beginning of document
+     * @param length length of content to write
+     */
+    public this(int start, int length) {
+        buffer = new StringBuffer(length);
+        startOffset = start;
+        endOffset = start + length;
+    }
+    /**
+     * Closes the writer. Once closed no more content can be written.
+     * <b>NOTE:</b>  <code>toString()</code> is not guaranteed to return a valid string unless
+     * the writer is closed.
+     */
+    public void close() {
+        if (!isClosed_) {
+            isClosed_ = true;
+        }
+    }
+    /**
+     * Returns the number of characters to write.
+     * @return the integer number of characters to write
+     */
+    public int getCharCount() {
+        return endOffset - startOffset;
+    }
+    /**
+     * Returns the offset where writing starts. 0 based from the start of
+     * the widget text. Used to write partial lines.
+     * @return the integer offset where writing starts
+     */
+    public int getStart() {
+        return startOffset;
+    }
+    /**
+     * Returns whether the writer is closed.
+     * @return a bool specifying whether or not the writer is closed
+     */
+    public bool isClosed() {
+        return isClosed_;
+    }
+    /**
+     * Returns the string.  <code>close()</code> must be called before <code>toString()</code>
+     * is guaranteed to return a valid string.
+     *
+     * @return the string
+     */
+    public override String toString() {
+        return buffer.toString();
+    }
+    /**
+     * Appends the given string to the data.
+     */
+    void write(String string) {
+        buffer.append(string);
+    }
+    /**
+     * Inserts the given string to the data at the specified offset.
+     * <p>
+     * Do nothing if "offset" is < 0 or > getCharCount()
+     * </p>
+     *
+     * @param string text to insert
+     * @param offset offset in the existing data to insert "string" at.
+     */
+    void write(String string, int offset) {
+        if (offset < 0 || offset > buffer.length()) {
+            return;
+        }
+        buffer.insert( offset, string );
+    }
+    /**
+     * Appends the given int to the data.
+     */
+    void write(int i) {
+        buffer.append(i);
+    }
+    /**
+     * Appends the given character to the data.
+     */
+    void write(char i) {
+        buffer.append(i);
+    }
+    /**
+     * Appends the specified line text to the data.
+     *
+     * @param line line text to write. Must not contain line breaks
+     *  Line breaks should be written using writeLineDelimiter()
+     * @param lineOffset offset of the line. 0 based from the start of the
+     *  widget document. Any text occurring before the start offset or after the
+     *  end offset specified during object creation is ignored.
+     * @exception SWTException <ul>
+     *   <li>ERROR_IO when the writer is closed.</li>
+     * </ul>
+     */
+    public void writeLine(String line, int lineOffset) {
+        if (isClosed_) {
+            SWT.error(SWT.ERROR_IO);
+        }
+        int writeOffset = startOffset - lineOffset;
+        int lineLength = line.length;
+        int lineIndex;
+        if (writeOffset >= lineLength) {
+            return;                         // whole line is outside write range
+        } else if (writeOffset > 0) {
+            lineIndex = writeOffset;        // line starts before write start
+        } else {
+            lineIndex = 0;
+        }
+        int copyEnd = Math.min(lineLength, endOffset - lineOffset);
+        if (lineIndex < copyEnd) {
+            write(line.substring(lineIndex, copyEnd));
+        }
+    }
+    /**
+     * Appends the specified line delimiter to the data.
+     *
+     * @param lineDelimiter line delimiter to write
+     * @exception SWTException <ul>
+     *   <li>ERROR_IO when the writer is closed.</li>
+     * </ul>
+     */
+    public void writeLineDelimiter(String lineDelimiter) {
+        if (isClosed_) {
+            SWT.error(SWT.ERROR_IO);
+        }
+        write(lineDelimiter);
+    }
+    }
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a widget which will be the parent of the new instance (cannot be null)
+ * @param style the style of widget to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ *
+ * @see SWT#FULL_SELECTION
+ * @see SWT#MULTI
+ * @see SWT#READ_ONLY
+ * @see SWT#SINGLE
+ * @see SWT#WRAP
+ * @see #getStyle
+ */
+public this(Composite parent, int style) {
+    selection = new Point(0, 0);
+    super(parent, checkStyle(style));
+    // set the fg in the OS to ensure that these are the same as StyledText, necessary
+    // for ensuring that the bg/fg the IME box uses is the same as what StyledText uses
+    super.setForeground(getForeground());
+    super.setDragDetect(false);
+    Display display = getDisplay();
+    isMirrored_ = (super.getStyle() & SWT.MIRRORED) !is 0;
+    fixedLineHeight = true;
+    if ((style & SWT.READ_ONLY) !is 0) {
+        setEditable(false);
+    }
+    leftMargin = rightMargin = isBidiCaret() ? BIDI_CARET_WIDTH - 1: 0;
+    if ((style & SWT.SINGLE) !is 0 && (style & SWT.BORDER) !is 0) {
+        leftMargin = topMargin = rightMargin = bottomMargin = 2;
+    }
+    alignment = style & (SWT.LEFT | SWT.RIGHT | SWT.CENTER);
+    if (alignment is 0) alignment = SWT.LEFT;
+    clipboard = new Clipboard(display);
+    installDefaultContent();
+    renderer = new StyledTextRenderer(getDisplay(), this);
+    renderer.setContent(content);
+    renderer.setFont(getFont(), tabLength);
+    ime = new IME(this, SWT.NONE);
+    defaultCaret = new Caret(this, SWT.NONE);
+    if ((style & SWT.WRAP) !is 0) {
+        setWordWrap(true);
+    }
+    if (isBidiCaret()) {
+        createCaretBitmaps();
+        Runnable runnable = new class() Runnable {
+            public void run() {
+                int direction = BidiUtil.getKeyboardLanguage() is BidiUtil.KEYBOARD_BIDI ? SWT.RIGHT : SWT.LEFT;
+                if (direction is caretDirection) return;
+                if (getCaret() !is defaultCaret) return;
+                Point newCaretPos = getPointAtOffset(caretOffset);
+                setCaretLocation(newCaretPos, direction);
+            }
+        };
+        BidiUtil.addLanguageListener(this, runnable);
+    }
+    setCaret(defaultCaret);
+    calculateScrollBars();
+    createKeyBindings();
+    setCursor(display.getSystemCursor(SWT.CURSOR_IBEAM));
+    installListeners();
+    initializeAccessible();
+    setData("DEFAULT_DROP_TARGET_EFFECT", new StyledTextDropTargetEffect(this));
+}
+/**
+ * Adds an extended modify listener. An ExtendedModify event is sent by the
+ * widget when the widget text has changed.
+ *
+ * @param extendedModifyListener the listener
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when listener is null</li>
+ * </ul>
+ */
+public void addExtendedModifyListener(ExtendedModifyListener extendedModifyListener) {
+    checkWidget();
+    if (extendedModifyListener is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    StyledTextListener typedListener = new StyledTextListener(extendedModifyListener);
+    addListener(ExtendedModify, typedListener);
+}
+/**
+ * Adds a bidirectional segment listener.
+ * <p>
+ * A BidiSegmentEvent is sent
+ * whenever a line of text is measured or rendered. The user can
+ * specify text ranges in the line that should be treated as if they
+ * had a different direction than the surrounding text.
+ * This may be used when adjacent segments of right-to-left text should
+ * not be reordered relative to each other.
+ * E.g., Multiple Java string literals in a right-to-left language
+ * should generally remain in logical order to each other, that is, the
+ * way they are stored.
+ * </p>
+ *
+ * @param listener the listener
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when listener is null</li>
+ * </ul>
+ * @see BidiSegmentEvent
+ * @since 2.0
+ */
+public void addBidiSegmentListener(BidiSegmentListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    addListener(LineGetSegments, new StyledTextListener(listener));
+}
+/**
+ * Adds a line background listener. A LineGetBackground event is sent by the
+ * widget to determine the background color for a line.
+ *
+ * @param listener the listener
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when listener is null</li>
+ * </ul>
+ */
+public void addLineBackgroundListener(LineBackgroundListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (!isListening(LineGetBackground)) {
+        renderer.clearLineBackground(0, content.getLineCount());
+    }
+    addListener(LineGetBackground, new StyledTextListener(listener));
+}
+/**
+ * Adds a line style listener. A LineGetStyle event is sent by the widget to
+ * determine the styles for a line.
+ *
+ * @param listener the listener
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when listener is null</li>
+ * </ul>
+ */
+public void addLineStyleListener(LineStyleListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (!isListening(LineGetStyle)) {
+        setStyleRanges(0, 0, null, null, true);
+        renderer.clearLineStyle(0, content.getLineCount());
+    }
+    addListener(LineGetStyle, new StyledTextListener(listener));
+}
+/**
+ * Adds a modify listener. A Modify event is sent by the widget when the widget text
+ * has changed.
+ *
+ * @param modifyListener the listener
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when listener is null</li>
+ * </ul>
+ */
+public void addModifyListener(ModifyListener modifyListener) {
+    checkWidget();
+    if (modifyListener is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    addListener(SWT.Modify, new TypedListener(modifyListener));
+}
+/**
+ * Adds a paint object listener. A paint object event is sent by the widget when an object
+ * needs to be drawn.
+ *
+ * @param listener the listener
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when listener is null</li>
+ * </ul>
+ *
+ * @since 3.2
+ *
+ * @see PaintObjectListener
+ * @see PaintObjectEvent
+ */
+public void addPaintObjectListener(PaintObjectListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    addListener(PaintObject, new StyledTextListener(listener));
+}
+/**
+ * Adds a selection listener. A Selection event is sent by the widget when the
+ * user changes the selection.
+ * <p>
+ * When <code>widgetSelected</code> is called, the event x and y fields contain
+ * the start and end caret indices of the selection.
+ * <code>widgetDefaultSelected</code> is not called for StyledTexts.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the user changes the receiver's selection
+
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener(SelectionListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    addListener(SWT.Selection, new TypedListener(listener));
+}
+/**
+ * Adds a verify key listener. A VerifyKey event is sent by the widget when a key
+ * is pressed. The widget ignores the key press if the listener sets the doit field
+ * of the event to false.
+ *
+ * @param listener the listener
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when listener is null</li>
+ * </ul>
+ */
+public void addVerifyKeyListener(VerifyKeyListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    addListener(VerifyKey, new StyledTextListener(listener));
+}
+/**
+ * Adds a verify listener. A Verify event is sent by the widget when the widget text
+ * is about to change. The listener can set the event text and the doit field to
+ * change the text that is set in the widget or to force the widget to ignore the
+ * text change.
+ *
+ * @param verifyListener the listener
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when listener is null</li>
+ * </ul>
+ */
+public void addVerifyListener(VerifyListener verifyListener) {
+    checkWidget();
+    if (verifyListener is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    addListener(SWT.Verify, new TypedListener(verifyListener));
+}
+/**
+ * Adds a word movement listener. A movement event is sent when the boundary
+ * of a word is needed. For example, this occurs during word next and word
+ * previous actions.
+ *
+ * @param movementListener the listener
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when listener is null</li>
+ * </ul>
+ *
+ * @see MovementEvent
+ * @see MovementListener
+ * @see #removeWordMovementListener
+ *
+ * @since 3.3
+ */
+public void addWordMovementListener(MovementListener movementListener) {
+    checkWidget();
+    if (listener is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    addListener(WordNext, new StyledTextListener(movementListener));
+    addListener(WordPrevious, new StyledTextListener(movementListener));
+}
+/**
+ * Appends a string to the text at the end of the widget.
+ *
+ * @param string the string to be appended
+ * @see #replaceTextRange(int,int,String)
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void append(String string) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+//     if (string is null) {
+//         SWT.error(SWT.ERROR_NULL_ARGUMENT);
+//     }
+    int lastChar = Math.max(getCharCount(), 0);
+    replaceTextRange(lastChar, 0, string);
+}
+/**
+ * Calculates the scroll bars
+ */
+void calculateScrollBars() {
+    ScrollBar horizontalBar = getHorizontalBar();
+    ScrollBar verticalBar = getVerticalBar();
+    setScrollBars(true);
+    if (verticalBar !is null) {
+        verticalBar.setIncrement(getVerticalIncrement());
+    }
+    if (horizontalBar !is null) {
+        horizontalBar.setIncrement(getHorizontalIncrement());
+    }
+}
+/**
+ * Calculates the top index based on the current vertical scroll offset.
+ * The top index is the index of the topmost fully visible line or the
+ * topmost partially visible line if no line is fully visible.
+ * The top index starts at 0.
+ */
+void calculateTopIndex(int delta) {
+    int oldTopIndex = topIndex;
+    int oldTopIndexY = topIndexY;
+    if (isFixedLineHeight()) {
+        int verticalIncrement = getVerticalIncrement();
+        if (verticalIncrement is 0) {
+            return;
+        }
+        topIndex = Compatibility.ceil(getVerticalScrollOffset(), verticalIncrement);
+        // Set top index to partially visible top line if no line is fully
+        // visible but at least some of the widget client area is visible.
+        // Fixes bug 15088.
+        if (topIndex > 0) {
+            if (clientAreaHeight > 0) {
+                int bottomPixel = getVerticalScrollOffset() + clientAreaHeight;
+                int fullLineTopPixel = topIndex * verticalIncrement;
+                int fullLineVisibleHeight = bottomPixel - fullLineTopPixel;
+                // set top index to partially visible line if no line fully fits in
+                // client area or if space is available but not used (the latter should
+                // never happen because we use claimBottomFreeSpace)
+                if (fullLineVisibleHeight < verticalIncrement) {
+                    topIndex--;
+                }
+            } else if (topIndex >= content.getLineCount()) {
+                topIndex = content.getLineCount() - 1;
+            }
+        }
+    } else {
+        if (delta >= 0) {
+            delta -= topIndexY;
+            int lineIndex = topIndex;
+            int lineCount = content.getLineCount();
+            while (lineIndex < lineCount) {
+                if (delta <= 0) break;
+                delta -= renderer.getLineHeight(lineIndex++);
+            }
+            if (lineIndex < lineCount && -delta + renderer.getLineHeight(lineIndex) <= clientAreaHeight - topMargin - bottomMargin) {
+                topIndex = lineIndex;
+                topIndexY = -delta;
+            } else {
+                topIndex = lineIndex - 1;
+                topIndexY = -renderer.getLineHeight(topIndex) - delta;
+            }
+        } else {
+            delta -= topIndexY;
+            int lineIndex = topIndex;
+            while (lineIndex > 0) {
+                int lineHeight = renderer.getLineHeight(lineIndex - 1);
+                if (delta + lineHeight > 0) break;
+                delta += lineHeight;
+                lineIndex--;
+            }
+            if (lineIndex is 0 || -delta + renderer.getLineHeight(lineIndex) <= clientAreaHeight - topMargin - bottomMargin) {
+                topIndex = lineIndex;
+                topIndexY = - delta;
+            } else {
+                topIndex = lineIndex - 1;
+                topIndexY = - renderer.getLineHeight(topIndex) - delta;
+            }
+        }
+    }
+    if (topIndex !is oldTopIndex || oldTopIndexY !is topIndexY) {
+        renderer.calculateClientArea();
+        setScrollBars(false);
+    }
+}
+/**
+ * Hides the scroll bars if widget is created in single line mode.
+ */
+static int checkStyle(int style) {
+    if ((style & SWT.SINGLE) !is 0) {
+        style &= ~(SWT.H_SCROLL | SWT.V_SCROLL | SWT.WRAP | SWT.MULTI);
+    } else {
+        style |= SWT.MULTI;
+        if ((style & SWT.WRAP) !is 0) {
+            style &= ~SWT.H_SCROLL;
+        }
+    }
+    style |= SWT.NO_REDRAW_RESIZE | SWT.DOUBLE_BUFFERED | SWT.NO_BACKGROUND;
+    return style;
+}
+/**
+ * Scrolls down the text to use new space made available by a resize or by
+ * deleted lines.
+ */
+void claimBottomFreeSpace() {
+    int clientAreaHeight = this.clientAreaHeight - topMargin - bottomMargin;
+    if (isFixedLineHeight()) {
+        int lineHeight = renderer.getLineHeight();
+        int newVerticalOffset = Math.max(0, content.getLineCount() * lineHeight - clientAreaHeight);
+        if (newVerticalOffset < getVerticalScrollOffset()) {
+            scrollVertical(newVerticalOffset - getVerticalScrollOffset(), true);
+        }
+    } else {
+        int bottomIndex = getPartialBottomIndex();
+        int height = getLinePixel(bottomIndex + 1);
+        if (clientAreaHeight > height) {
+            scrollVertical(-getAvailableHeightAbove(clientAreaHeight - height), true);
+        }
+    }
+}
+/**
+ * Scrolls text to the right to use new space made available by a resize.
+ */
+void claimRightFreeSpace() {
+    int newHorizontalOffset = Math.max(0, renderer.getWidth() - (clientAreaWidth - leftMargin - rightMargin));
+    if (newHorizontalOffset < horizontalScrollOffset) {
+        // item is no longer drawn past the right border of the client area
+        // align the right end of the item with the right border of the
+        // client area (window is scrolled right).
+        scrollHorizontal(newHorizontalOffset - horizontalScrollOffset, true);
+    }
+}
+/**
+ * Removes the widget selection.
+ *
+ * @param sendEvent a Selection event is sent when set to true and when the selection is actually reset.
+ */
+void clearSelection(bool sendEvent) {
+    int selectionStart = selection.x;
+    int selectionEnd = selection.y;
+    resetSelection();
+    // redraw old selection, if any
+    if (selectionEnd - selectionStart > 0) {
+        int length = content.getCharCount();
+        // called internally to remove selection after text is removed
+        // therefore make sure redraw range is valid.
+        int redrawStart = Math.min(selectionStart, length);
+        int redrawEnd = Math.min(selectionEnd, length);
+        if (redrawEnd - redrawStart > 0) {
+            internalRedrawRange(redrawStart, redrawEnd - redrawStart);
+        }
+        if (sendEvent) {
+            sendSelectionEvent();
+        }
+    }
+}
+public override Point computeSize (int wHint, int hHint, bool changed) {
+    checkWidget();
+    int lineCount = (getStyle() & SWT.SINGLE) !is 0 ? 1 : content.getLineCount();
+    int width = 0;
+    int height = 0;
+    if (wHint is SWT.DEFAULT || hHint is SWT.DEFAULT) {
+        Display display = getDisplay();
+        int maxHeight = display.getClientArea().height;
+        for (int lineIndex = 0; lineIndex < lineCount; lineIndex++) {
+            TextLayout layout = renderer.getTextLayout(lineIndex);
+            int wrapWidth = layout.getWidth();
+            if (wordWrap) layout.setWidth(wHint is 0 ? 1 : wHint);
+            Rectangle rect = layout.getBounds();
+            height += rect.height;
+            width = Math.max(width, rect.width);
+            layout.setWidth(wrapWidth);
+            renderer.disposeTextLayout(layout);
+            if (isFixedLineHeight() && height > maxHeight) break;
+        }
+        if (isFixedLineHeight()) {
+            height = lineCount * renderer.getLineHeight();
+        }
+    }
+    // Use default values if no text is defined.
+    if (width is 0) width = DEFAULT_WIDTH;
+    if (height is 0) height = DEFAULT_HEIGHT;
+    if (wHint !is SWT.DEFAULT) width = wHint;
+    if (hHint !is SWT.DEFAULT) height = hHint;
+    int wTrim = leftMargin + rightMargin + getCaretWidth();
+    int hTrim = topMargin + bottomMargin;
+    Rectangle rect = computeTrim(0, 0, width + wTrim, height + hTrim);
+    return new Point (rect.width, rect.height);
+}
+/**
+ * Copies the selected text to the <code>DND.CLIPBOARD</code> clipboard.
+ * <p>
+ * The text will be put on the clipboard in plain text format and RTF format.
+ * The <code>DND.CLIPBOARD</code> clipboard is used for data that is
+ * transferred by keyboard accelerator (such as Ctrl+C/Ctrl+V) or
+ * by menu action.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void copy() {
+    checkWidget();
+    copy(DND.CLIPBOARD);
+}
+/**
+ * Copies the selected text to the specified clipboard.  The text will be put in the
+ * clipboard in plain text format and RTF format.
+ * <p>
+ * The clipboardType is  one of the clipboard constants defined in class
+ * <code>DND</code>.  The <code>DND.CLIPBOARD</code>  clipboard is
+ * used for data that is transferred by keyboard accelerator (such as Ctrl+C/Ctrl+V)
+ * or by menu action.  The <code>DND.SELECTION_CLIPBOARD</code>
+ * clipboard is used for data that is transferred by selecting text and pasting
+ * with the middle mouse button.
+ * </p>
+ *
+ * @param clipboardType indicates the type of clipboard
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void copy(int clipboardType) {
+    checkWidget();
+    if (clipboardType !is DND.CLIPBOARD && clipboardType !is DND.SELECTION_CLIPBOARD) return;
+    int length = selection.y - selection.x;
+    if (length > 0) {
+        try {
+            setClipboardContent(selection.x, length, clipboardType);
+        } catch (SWTError error) {
+            // Copy to clipboard failed. This happens when another application
+            // is accessing the clipboard while we copy. Ignore the error.
+            // Fixes 1GDQAVN
+            // Rethrow all other errors. Fixes bug 17578.
+            if (error.code !is DND.ERROR_CANNOT_SET_CLIPBOARD) {
+                throw error;
+            }
+        }
+    }
+}
+/**
+ * Returns the alignment of the widget.
+ *
+ * @return the alignment
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getLineAlignment(int)
+ *
+ * @since 3.2
+ */
+public int getAlignment() {
+    checkWidget();
+    return alignment;
+}
+int getAvailableHeightAbove(int height) {
+    int maxHeight = verticalScrollOffset;
+    if (maxHeight is -1) {
+        int lineIndex = topIndex - 1;
+        maxHeight = -topIndexY;
+        if (topIndexY > 0) {
+            maxHeight += renderer.getLineHeight(lineIndex--);
+        }
+        while (height > maxHeight && lineIndex >= 0) {
+            maxHeight += renderer.getLineHeight(lineIndex--);
+        }
+    }
+    return Math.min(height, maxHeight);
+}
+int getAvailableHeightBellow(int height) {
+    int partialBottomIndex = getPartialBottomIndex();
+    int topY = getLinePixel(partialBottomIndex);
+    int lineHeight = renderer.getLineHeight(partialBottomIndex);
+    int availableHeight = 0;
+    int clientAreaHeight = this.clientAreaHeight - topMargin - bottomMargin;
+    if (topY + lineHeight > clientAreaHeight) {
+        availableHeight = lineHeight - (clientAreaHeight - topY);
+    }
+    int lineIndex = partialBottomIndex + 1;
+    int lineCount = content.getLineCount();
+    while (height > availableHeight && lineIndex < lineCount) {
+        availableHeight += renderer.getLineHeight(lineIndex++);
+    }
+    return Math.min(height, availableHeight);
+}
+/**
+ * Returns a string that uses only the line delimiter specified by the
+ * StyledTextContent implementation.
+ * <p>
+ * Returns only the first line if the widget has the SWT.SINGLE style.
+ * </p>
+ *
+ * @param text the text that may have line delimiters that don't
+ *  match the model line delimiter. Possible line delimiters
+ *  are CR ('\r'), LF ('\n'), CR/LF ("\r\n")
+ * @return the converted text that only uses the line delimiter
+ *  specified by the model. Returns only the first line if the widget
+ *  has the SWT.SINGLE style.
+ */
+String getModelDelimitedText(String text) {
+    int length = text.length;
+    if (length is 0) {
+        return text;
+    }
+    int crIndex = 0;
+    int lfIndex = 0;
+    int i = 0;
+    StringBuffer convertedText = new StringBuffer(length);
+    String delimiter = getLineDelimiter();
+    while (i < length) {
+        if (crIndex !is -1) {
+            crIndex = text.indexOf (SWT.CR, i);
+        }
+        if (lfIndex !is -1) {
+            lfIndex = text.indexOf (SWT.LF, i);
+        }
+        if (lfIndex is -1 && crIndex is -1) {   // no more line breaks?
+            break;
+        } else if ((crIndex < lfIndex && crIndex !is -1) || lfIndex is -1) {
+            convertedText.append(text.substring(i, crIndex));
+            if (lfIndex is crIndex + 1) {       // CR/LF combination?
+                i = lfIndex + 1;
+            } else {
+                i = crIndex + 1;
+            }
+        } else {                                    // LF occurs before CR!
+            convertedText.append(text.substring(i, lfIndex));
+            i = lfIndex + 1;
+        }
+        if (isSingleLine()) {
+            break;
+        }
+        convertedText.append(delimiter);
+    }
+    // copy remaining text if any and if not in single line mode or no
+    // text copied thus far (because there only is one line)
+    if (i < length && (!isSingleLine() || convertedText.length() is 0)) {
+        convertedText.append(text.substring(i));
+    }
+    return convertedText.toString();
+}
+bool checkDragDetect(Event event) {
+    if (!isListening(SWT.DragDetect)) return false;
+    if (IS_MOTIF) {
+        if (event.button !is 2) return false;
+    } else {
+        if (event.button !is 1) return false;
+    }
+    if (selection.x is selection.y) return false;
+    int offset = getOffsetAtPoint(event.x, event.y, null, true);
+    if (selection.x <= offset && offset < selection.y) {
+        return dragDetect(event);
+    }
+    return false;
+}
+/**
+ * Creates default key bindings.
+ */
+void createKeyBindings() {
+    int nextKey = isMirrored() ? SWT.ARROW_LEFT : SWT.ARROW_RIGHT;
+    int previousKey = isMirrored() ? SWT.ARROW_RIGHT : SWT.ARROW_LEFT;
+
+    // Navigation
+    setKeyBinding(SWT.ARROW_UP, ST.LINE_UP);
+    setKeyBinding(SWT.ARROW_DOWN, ST.LINE_DOWN);
+    if (IS_CARBON) {
+        setKeyBinding(previousKey | SWT.MOD1, ST.LINE_START);
+        setKeyBinding(nextKey | SWT.MOD1, ST.LINE_END);
+        setKeyBinding(SWT.HOME, ST.TEXT_START);
+        setKeyBinding(SWT.END, ST.TEXT_END);
+        setKeyBinding(SWT.ARROW_UP | SWT.MOD1, ST.TEXT_START);
+        setKeyBinding(SWT.ARROW_DOWN | SWT.MOD1, ST.TEXT_END);
+        setKeyBinding(nextKey | SWT.MOD3, ST.WORD_NEXT);
+        setKeyBinding(previousKey | SWT.MOD3, ST.WORD_PREVIOUS);
+    } else {
+        setKeyBinding(SWT.HOME, ST.LINE_START);
+        setKeyBinding(SWT.END, ST.LINE_END);
+        setKeyBinding(SWT.HOME | SWT.MOD1, ST.TEXT_START);
+        setKeyBinding(SWT.END | SWT.MOD1, ST.TEXT_END);
+        setKeyBinding(nextKey | SWT.MOD1, ST.WORD_NEXT);
+        setKeyBinding(previousKey | SWT.MOD1, ST.WORD_PREVIOUS);
+    }
+    setKeyBinding(SWT.PAGE_UP, ST.PAGE_UP);
+    setKeyBinding(SWT.PAGE_DOWN, ST.PAGE_DOWN);
+    setKeyBinding(SWT.PAGE_UP | SWT.MOD1, ST.WINDOW_START);
+    setKeyBinding(SWT.PAGE_DOWN | SWT.MOD1, ST.WINDOW_END);
+    setKeyBinding(nextKey, ST.COLUMN_NEXT);
+    setKeyBinding(previousKey, ST.COLUMN_PREVIOUS);
+
+    // Selection
+    setKeyBinding(SWT.ARROW_UP | SWT.MOD2, ST.SELECT_LINE_UP);
+    setKeyBinding(SWT.ARROW_DOWN | SWT.MOD2, ST.SELECT_LINE_DOWN);
+    if (IS_CARBON) {
+        setKeyBinding(previousKey | SWT.MOD1 | SWT.MOD2, ST.SELECT_LINE_START);
+        setKeyBinding(nextKey | SWT.MOD1 | SWT.MOD2, ST.SELECT_LINE_END);
+        setKeyBinding(SWT.HOME | SWT.MOD2, ST.SELECT_TEXT_START);
+        setKeyBinding(SWT.END | SWT.MOD2, ST.SELECT_TEXT_END);
+        setKeyBinding(SWT.ARROW_UP | SWT.MOD1 | SWT.MOD2, ST.SELECT_TEXT_START);
+        setKeyBinding(SWT.ARROW_DOWN | SWT.MOD1 | SWT.MOD2, ST.SELECT_TEXT_END);
+        setKeyBinding(nextKey | SWT.MOD2 | SWT.MOD3, ST.SELECT_WORD_NEXT);
+        setKeyBinding(previousKey | SWT.MOD2 | SWT.MOD3, ST.SELECT_WORD_PREVIOUS);
+    } else  {
+        setKeyBinding(SWT.HOME | SWT.MOD2, ST.SELECT_LINE_START);
+        setKeyBinding(SWT.END | SWT.MOD2, ST.SELECT_LINE_END);
+        setKeyBinding(SWT.HOME | SWT.MOD1 | SWT.MOD2, ST.SELECT_TEXT_START);
+        setKeyBinding(SWT.END | SWT.MOD1 | SWT.MOD2, ST.SELECT_TEXT_END);
+        setKeyBinding(nextKey | SWT.MOD1 | SWT.MOD2, ST.SELECT_WORD_NEXT);
+        setKeyBinding(previousKey | SWT.MOD1 | SWT.MOD2, ST.SELECT_WORD_PREVIOUS);
+    }
+    setKeyBinding(SWT.PAGE_UP | SWT.MOD2, ST.SELECT_PAGE_UP);
+    setKeyBinding(SWT.PAGE_DOWN | SWT.MOD2, ST.SELECT_PAGE_DOWN);
+    setKeyBinding(SWT.PAGE_UP | SWT.MOD1 | SWT.MOD2, ST.SELECT_WINDOW_START);
+    setKeyBinding(SWT.PAGE_DOWN | SWT.MOD1 | SWT.MOD2, ST.SELECT_WINDOW_END);
+    setKeyBinding(nextKey | SWT.MOD2, ST.SELECT_COLUMN_NEXT);
+    setKeyBinding(previousKey | SWT.MOD2, ST.SELECT_COLUMN_PREVIOUS);
+
+    // Modification
+    // Cut, Copy, Paste
+    setKeyBinding('X' | SWT.MOD1, ST.CUT);
+    setKeyBinding('C' | SWT.MOD1, ST.COPY);
+    setKeyBinding('V' | SWT.MOD1, ST.PASTE);
+    if (IS_CARBON) {
+        setKeyBinding(SWT.DEL | SWT.MOD2, ST.DELETE_NEXT);
+        setKeyBinding(SWT.BS | SWT.MOD3, ST.DELETE_WORD_PREVIOUS);
+        setKeyBinding(SWT.DEL | SWT.MOD3, ST.DELETE_WORD_NEXT);
+    } else {
+        // Cut, Copy, Paste Wordstar style
+        setKeyBinding(SWT.DEL | SWT.MOD2, ST.CUT);
+        setKeyBinding(SWT.INSERT | SWT.MOD1, ST.COPY);
+        setKeyBinding(SWT.INSERT | SWT.MOD2, ST.PASTE);
+    }
+    setKeyBinding(SWT.BS | SWT.MOD2, ST.DELETE_PREVIOUS);
+    setKeyBinding(SWT.BS, ST.DELETE_PREVIOUS);
+    setKeyBinding(SWT.DEL, ST.DELETE_NEXT);
+    setKeyBinding(SWT.BS | SWT.MOD1, ST.DELETE_WORD_PREVIOUS);
+    setKeyBinding(SWT.DEL | SWT.MOD1, ST.DELETE_WORD_NEXT);
+
+    // Miscellaneous
+    setKeyBinding(SWT.INSERT, ST.TOGGLE_OVERWRITE);
+}
+/**
+ * Create the bitmaps to use for the caret in bidi mode.  This
+ * method only needs to be called upon widget creation and when the
+ * font changes (the caret bitmap height needs to match font height).
+ */
+void createCaretBitmaps() {
+    int caretWidth = BIDI_CARET_WIDTH;
+    Display display = getDisplay();
+    if (leftCaretBitmap !is null) {
+        if (defaultCaret !is null && leftCaretBitmap==/*eq*/defaultCaret.getImage()) {
+            defaultCaret.setImage(null);
+        }
+        leftCaretBitmap.dispose();
+    }
+    int lineHeight = renderer.getLineHeight();
+    leftCaretBitmap = new Image(display, caretWidth, lineHeight);
+    GC gc = new GC (leftCaretBitmap);
+    gc.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
+    gc.fillRectangle(0, 0, caretWidth, lineHeight);
+    gc.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
+    gc.drawLine(0,0,0,lineHeight);
+    gc.drawLine(0,0,caretWidth-1,0);
+    gc.drawLine(0,1,1,1);
+    gc.dispose();
+
+    if (rightCaretBitmap !is null) {
+        if (defaultCaret !is null && rightCaretBitmap==/*eq*/defaultCaret.getImage()) {
+            defaultCaret.setImage(null);
+        }
+        rightCaretBitmap.dispose();
+    }
+    rightCaretBitmap = new Image(display, caretWidth, lineHeight);
+    gc = new GC (rightCaretBitmap);
+    gc.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
+    gc.fillRectangle(0, 0, caretWidth, lineHeight);
+    gc.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
+    gc.drawLine(caretWidth-1,0,caretWidth-1,lineHeight);
+    gc.drawLine(0,0,caretWidth-1,0);
+    gc.drawLine(caretWidth-1,1,1,1);
+    gc.dispose();
+}
+/**
+ * Moves the selected text to the clipboard.  The text will be put in the
+ * clipboard in plain text format and RTF format.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void cut(){
+    checkWidget();
+    int length = selection.y - selection.x;
+    if (length > 0) {
+        try {
+            setClipboardContent(selection.x, length, DND.CLIPBOARD);
+        } catch (SWTError error) {
+            // Copy to clipboard failed. This happens when another application
+            // is accessing the clipboard while we copy. Ignore the error.
+            // Fixes 1GDQAVN
+            // Rethrow all other errors. Fixes bug 17578.
+            if (error.code !is DND.ERROR_CANNOT_SET_CLIPBOARD) {
+                throw error;
+            }
+            // Abort cut operation if copy to clipboard fails.
+            // Fixes bug 21030.
+            return;
+        }
+        doDelete();
+    }
+}
+/**
+ * A mouse move event has occurred.  See if we should start autoscrolling.  If
+ * the move position is outside of the client area, initiate autoscrolling.
+ * Otherwise, we've moved back into the widget so end autoscrolling.
+ */
+void doAutoScroll(Event event) {
+    if (event.y > clientAreaHeight) {
+        doAutoScroll(SWT.DOWN, event.y - clientAreaHeight);
+    } else if (event.y < 0) {
+        doAutoScroll(SWT.UP, -event.y);
+    } else if (event.x < leftMargin && !wordWrap) {
+        doAutoScroll(ST.COLUMN_PREVIOUS, leftMargin - event.x);
+    } else if (event.x > clientAreaWidth - leftMargin - rightMargin && !wordWrap) {
+        doAutoScroll(ST.COLUMN_NEXT, event.x - (clientAreaWidth - leftMargin - rightMargin));
+    } else {
+        endAutoScroll();
+    }
+}
+/**
+ * Initiates autoscrolling.
+ *
+ * @param direction SWT.UP, SWT.DOWN, SWT.COLUMN_NEXT, SWT.COLUMN_PREVIOUS
+ */
+void doAutoScroll(int direction, int distance) {
+    autoScrollDistance = distance;
+    // If we're already autoscrolling in the given direction do nothing
+    if (autoScrollDirection is direction) {
+        return;
+    }
+
+    Runnable timer = null;
+    final Display disp = getDisplay();
+    // Set a timer that will simulate the user pressing and holding
+    // down a cursor key (i.e., arrowUp, arrowDown).
+    if (direction is SWT.UP) {
+        timer = new class(disp) Runnable {
+            Display display;
+            this( Display d ){ this.display = d; }
+            public void run() {
+                if (autoScrollDirection is SWT.UP) {
+                    doSelectionPageUp(autoScrollDistance);
+                    display.timerExec(V_SCROLL_RATE, this);
+                }
+            }
+        };
+        autoScrollDirection = direction;
+        display.timerExec(V_SCROLL_RATE, timer);
+    } else if (direction is SWT.DOWN) {
+        timer = new class(disp) Runnable {
+            Display display;
+            this( Display d ){ this.display = d; }
+            public void run() {
+                if (autoScrollDirection is SWT.DOWN) {
+                    doSelectionPageDown(autoScrollDistance);
+                    display.timerExec(V_SCROLL_RATE, this);
+                }
+            }
+        };
+        autoScrollDirection = direction;
+        display.timerExec(V_SCROLL_RATE, timer);
+    } else if (direction is ST.COLUMN_NEXT) {
+        timer = new class(disp) Runnable {
+            Display display;
+            this( Display d ){ this.display = d; }
+            public void run() {
+                if (autoScrollDirection is ST.COLUMN_NEXT) {
+                    doVisualNext();
+                    setMouseWordSelectionAnchor();
+                    doMouseSelection();
+                    display.timerExec(H_SCROLL_RATE, this);
+                }
+            }
+        };
+        autoScrollDirection = direction;
+        display.timerExec(H_SCROLL_RATE, timer);
+    } else if (direction is ST.COLUMN_PREVIOUS) {
+        timer = new class(disp) Runnable {
+            Display display;
+            this( Display d ){ this.display = d; }
+            public void run() {
+                if (autoScrollDirection is ST.COLUMN_PREVIOUS) {
+                    doVisualPrevious();
+                    setMouseWordSelectionAnchor();
+                    doMouseSelection();
+                    display.timerExec(H_SCROLL_RATE, this);
+                }
+            }
+        };
+        autoScrollDirection = direction;
+        display.timerExec(H_SCROLL_RATE, timer);
+    }
+}
+/**
+ * Deletes the previous character. Delete the selected text if any.
+ * Move the caret in front of the deleted text.
+ */
+void doBackspace() {
+    Event event = new Event();
+    event.text = "";
+    if (selection.x !is selection.y) {
+        event.start = selection.x;
+        event.end = selection.y;
+        sendKeyEvent(event);
+    } else if (caretOffset > 0) {
+        int lineIndex = content.getLineAtOffset(caretOffset);
+        int lineOffset = content.getOffsetAtLine(lineIndex);
+        if (caretOffset is lineOffset) {
+            // SWT: on line start, delete line break
+            lineOffset = content.getOffsetAtLine(lineIndex - 1);
+            event.start = lineOffset + content.getLine(lineIndex - 1).length;
+            event.end = caretOffset;
+        } else {
+            TextLayout layout = renderer.getTextLayout(lineIndex);
+            int start = layout.getPreviousOffset(caretOffset - lineOffset, SWT.MOVEMENT_CLUSTER);
+            renderer.disposeTextLayout(layout);
+            event.start = start + lineOffset;
+            event.end = caretOffset;
+        }
+        sendKeyEvent(event);
+    }
+}
+/**
+ * Replaces the selection with the character or insert the character at the
+ * current caret position if no selection exists.
+ * <p>
+ * If a carriage return was typed replace it with the line break character
+ * used by the widget on this platform.
+ * </p>
+ *
+ * @param key the character typed by the user
+ */
+void doContent(dchar key) {
+    Event event = new Event();
+    event.start = selection.x;
+    event.end = selection.y;
+    // replace a CR line break with the widget line break
+    // CR does not make sense on Windows since most (all?) applications
+    // don't recognize CR as a line break.
+    if (key is SWT.CR || key is SWT.LF) {
+        if (!isSingleLine()) {
+            event.text = getLineDelimiter();
+        }
+    } else if (selection.x is selection.y && overwrite && key !is TAB) {
+        // no selection and overwrite mode is on and the typed key is not a
+        // tab character (tabs are always inserted without overwriting)?
+        int lineIndex = content.getLineAtOffset(event.end);
+        int lineOffset = content.getOffsetAtLine(lineIndex);
+        String line = content.getLine(lineIndex);
+        // replace character at caret offset if the caret is not at the
+        // end of the line
+        if (event.end < lineOffset + line.length) {
+            event.end+=dcharToString( key ).length;
+        }
+        event.text = dcharToString( key );
+    } else {
+        event.text = dcharToString( key );
+    }
+    if (event.text !is null) {
+        if (textLimit > 0 && content.getCharCount() - (event.end - event.start) >= textLimit) {
+            return;
+        }
+        sendKeyEvent(event);
+    }
+}
+/**
+ * Moves the caret after the last character of the widget content.
+ */
+void doContentEnd() {
+    // place caret at end of first line if receiver is in single
+    // line mode. fixes 4820.
+    if (isSingleLine()) {
+        doLineEnd();
+    } else {
+        int length = content.getCharCount();
+        if (caretOffset < length) {
+            caretOffset = length;
+            showCaret();
+        }
+    }
+}
+/**
+ * Moves the caret in front of the first character of the widget content.
+ */
+void doContentStart() {
+    if (caretOffset > 0) {
+        caretOffset = 0;
+        showCaret();
+    }
+}
+/**
+ * Moves the caret to the start of the selection if a selection exists.
+ * Otherwise, if no selection exists move the cursor according to the
+ * cursor selection rules.
+ *
+ * @see #doSelectionCursorPrevious
+ */
+void doCursorPrevious() {
+    if (selection.y - selection.x > 0) {
+        caretOffset = selection.x;
+        caretAlignment = OFFSET_LEADING;
+        showCaret();
+    } else {
+        doSelectionCursorPrevious();
+    }
+}
+/**
+ * Moves the caret to the end of the selection if a selection exists.
+ * Otherwise, if no selection exists move the cursor according to the
+ * cursor selection rules.
+ *
+ * @see #doSelectionCursorNext
+ */
+void doCursorNext() {
+    if (selection.y - selection.x > 0) {
+        caretOffset = selection.y;
+        caretAlignment = PREVIOUS_OFFSET_TRAILING;
+        showCaret();
+    } else {
+        doSelectionCursorNext();
+    }
+}
+/**
+ * Deletes the next character. Delete the selected text if any.
+ */
+void doDelete() {
+    Event event = new Event();
+    event.text = "";
+    if (selection.x !is selection.y) {
+        event.start = selection.x;
+        event.end = selection.y;
+        sendKeyEvent(event);
+    } else if (caretOffset < content.getCharCount()) {
+        int line = content.getLineAtOffset(caretOffset);
+        int lineOffset = content.getOffsetAtLine(line);
+        int lineLength = content.getLine(line).length;
+        if (caretOffset is lineOffset + lineLength) {
+            event.start = caretOffset;
+            event.end = content.getOffsetAtLine(line + 1);
+        } else {
+            event.start = caretOffset;
+            event.end = getClusterNext(caretOffset, line);
+        }
+        sendKeyEvent(event);
+    }
+}
+/**
+ * Deletes the next word.
+ */
+void doDeleteWordNext() {
+    if (selection.x !is selection.y) {
+        // if a selection exists, treat the as if
+        // only the delete key was pressed
+        doDelete();
+    } else {
+        Event event = new Event();
+        event.text = "";
+        event.start = caretOffset;
+        event.end = getWordNext(caretOffset, SWT.MOVEMENT_WORD);
+        sendKeyEvent(event);
+    }
+}
+/**
+ * Deletes the previous word.
+ */
+void doDeleteWordPrevious() {
+    if (selection.x !is selection.y) {
+        // if a selection exists, treat as if
+        // only the backspace key was pressed
+        doBackspace();
+    } else {
+        Event event = new Event();
+        event.text = "";
+        event.start = getWordPrevious(caretOffset, SWT.MOVEMENT_WORD);
+        event.end = caretOffset;
+        sendKeyEvent(event);
+    }
+}
+/**
+ * Moves the caret one line down and to the same character offset relative
+ * to the beginning of the line. Move the caret to the end of the new line
+ * if the new line is shorter than the character offset.
+ */
+void doLineDown(bool select) {
+    int caretLine = getCaretLine();
+    int lineCount = content.getLineCount();
+    int y = 0;
+    bool lastLine = false;
+    if (wordWrap) {
+        int lineOffset = content.getOffsetAtLine(caretLine);
+        int offsetInLine = caretOffset - lineOffset;
+        TextLayout layout = renderer.getTextLayout(caretLine);
+        int lineIndex = getVisualLineIndex(layout, offsetInLine);
+        int layoutLineCount = layout.getLineCount();
+        if (lineIndex is layoutLineCount - 1) {
+            lastLine = caretLine is lineCount - 1;
+            caretLine++;
+        } else {
+            y = layout.getLineBounds(lineIndex + 1).y;
+        }
+        renderer.disposeTextLayout(layout);
+    } else {
+        lastLine = caretLine is lineCount - 1;
+        caretLine++;
+    }
+    if (lastLine) {
+        if (select) caretOffset = content.getCharCount();
+    } else {
+        caretOffset = getOffsetAtPoint(columnX, y, caretLine);
+    }
+    int oldColumnX = columnX;
+    int oldHScrollOffset = horizontalScrollOffset;
+    if (select) {
+        setMouseWordSelectionAnchor();
+        // select first and then scroll to reduce flash when key
+        // repeat scrolls lots of lines
+        doSelection(ST.COLUMN_NEXT);
+    }
+    showCaret();
+    int hScrollChange = oldHScrollOffset - horizontalScrollOffset;
+    columnX = oldColumnX + hScrollChange;
+}
+/**
+ * Moves the caret to the end of the line.
+ */
+void doLineEnd() {
+    int caretLine = getCaretLine();
+    int lineOffset = content.getOffsetAtLine(caretLine);
+    int lineEndOffset;
+    if (wordWrap) {
+        TextLayout layout = renderer.getTextLayout(caretLine);
+        int offsetInLine = caretOffset - lineOffset;
+        int lineIndex = getVisualLineIndex(layout, offsetInLine);
+        int[] offsets = layout.getLineOffsets();
+        lineEndOffset = lineOffset + offsets[lineIndex + 1];
+        renderer.disposeTextLayout(layout);
+    } else {
+        int lineLength = content.getLine(caretLine).length;
+        lineEndOffset = lineOffset + lineLength;
+    }
+    if (caretOffset < lineEndOffset) {
+        caretOffset = lineEndOffset;
+        caretAlignment = PREVIOUS_OFFSET_TRAILING;
+        showCaret();
+    }
+}
+/**
+ * Moves the caret to the beginning of the line.
+ */
+void doLineStart() {
+    int caretLine = getCaretLine();
+    int lineOffset = content.getOffsetAtLine(caretLine);
+    if (wordWrap) {
+        TextLayout layout = renderer.getTextLayout(caretLine);
+        int offsetInLine = caretOffset - lineOffset;
+        int lineIndex = getVisualLineIndex(layout, offsetInLine);
+        int[] offsets = layout.getLineOffsets();
+        lineOffset += offsets[lineIndex];
+        renderer.disposeTextLayout(layout);
+    }
+    if (caretOffset > lineOffset) {
+        caretOffset = lineOffset;
+        caretAlignment = OFFSET_LEADING;
+        showCaret();
+    }
+}
+/**
+ * Moves the caret one line up and to the same character offset relative
+ * to the beginning of the line. Move the caret to the end of the new line
+ * if the new line is shorter than the character offset.
+ */
+void doLineUp(bool select) {
+    int caretLine = getCaretLine(), y = 0;
+    bool firstLine = false;
+    if (wordWrap) {
+        int lineOffset = content.getOffsetAtLine(caretLine);
+        int offsetInLine = caretOffset - lineOffset;
+        TextLayout layout = renderer.getTextLayout(caretLine);
+        int lineIndex = getVisualLineIndex(layout, offsetInLine);
+        if (lineIndex is 0) {
+            firstLine = caretLine is 0;
+            if (!firstLine) {
+                caretLine--;
+                y = renderer.getLineHeight(caretLine) - 1;
+            }
+        } else {
+            y = layout.getLineBounds(lineIndex - 1).y;
+        }
+        renderer.disposeTextLayout(layout);
+    } else {
+        firstLine = caretLine is 0;
+        caretLine--;
+    }
+    if (firstLine) {
+        if (select) caretOffset = 0;
+    } else {
+        caretOffset = getOffsetAtPoint(columnX, y, caretLine);
+    }
+    int oldColumnX = columnX;
+    int oldHScrollOffset = horizontalScrollOffset;
+    if (select) setMouseWordSelectionAnchor();
+    showCaret();
+    if (select) doSelection(ST.COLUMN_PREVIOUS);
+    int hScrollChange = oldHScrollOffset - horizontalScrollOffset;
+    columnX = oldColumnX + hScrollChange;
+}
+/**
+ * Moves the caret to the specified location.
+ *
+ * @param x x location of the new caret position
+ * @param y y location of the new caret position
+ * @param select the location change is a selection operation.
+ *  include the line delimiter in the selection
+ */
+void doMouseLocationChange(int x, int y, bool select) {
+    int line = getLineIndex(y);
+
+    updateCaretDirection = true;
+    // allow caret to be placed below first line only if receiver is
+    // not in single line mode. fixes 4820.
+    if (line < 0 || (isSingleLine() && line > 0)) {
+        return;
+    }
+    int oldCaretAlignment = caretAlignment;
+    int newCaretOffset = getOffsetAtPoint(x, y);
+
+    if (doubleClickEnabled && clickCount > 1) {
+        newCaretOffset = doMouseWordSelect(x, newCaretOffset, line);
+    }
+
+    int newCaretLine = content.getLineAtOffset(newCaretOffset);
+
+    // Is the mouse within the left client area border or on
+    // a different line? If not the autoscroll selection
+    // could be incorrectly reset. Fixes 1GKM3XS
+    if (0 <= y && y < clientAreaHeight &&
+        (0 <= x && x < clientAreaWidth || wordWrap ||
+        newCaretLine !is content.getLineAtOffset(caretOffset))) {
+        if (newCaretOffset !is caretOffset || caretAlignment !is oldCaretAlignment) {
+            caretOffset = newCaretOffset;
+            if (select) doMouseSelection();
+            showCaret();
+        }
+    }
+    if (!select) {
+        caretOffset = newCaretOffset;
+        clearSelection(true);
+    }
+}
+/**
+ * Updates the selection based on the caret position
+ */
+void doMouseSelection() {
+    if (caretOffset <= selection.x ||
+        (caretOffset > selection.x &&
+         caretOffset < selection.y && selectionAnchor is selection.x)) {
+        doSelection(ST.COLUMN_PREVIOUS);
+    } else {
+        doSelection(ST.COLUMN_NEXT);
+    }
+}
+/**
+ * Returns the offset of the word at the specified offset.
+ * If the current selection extends from high index to low index
+ * (i.e., right to left, or caret is at left border of selection on
+ * non-bidi platforms) the start offset of the word preceding the
+ * selection is returned. If the current selection extends from
+ * low index to high index the end offset of the word following
+ * the selection is returned.
+ *
+ * @param x mouse x location
+ * @param newCaretOffset caret offset of the mouse cursor location
+ * @param line line index of the mouse cursor location
+ */
+int doMouseWordSelect(int x, int newCaretOffset, int line) {
+    // flip selection anchor based on word selection direction from
+    // base double click. Always do this here (and don't rely on doAutoScroll)
+    // because auto scroll only does not cover all possible mouse selections
+    // (e.g., mouse x < 0 && mouse y > caret line y)
+    if (newCaretOffset < selectionAnchor && selectionAnchor is selection.x) {
+        selectionAnchor = doubleClickSelection.y;
+    } else if (newCaretOffset > selectionAnchor && selectionAnchor is selection.y) {
+        selectionAnchor = doubleClickSelection.x;
+    }
+    if (0 <= x && x < clientAreaWidth) {
+        bool wordSelect = (clickCount & 1) is 0;
+        if (caretOffset is selection.x) {
+            if (wordSelect) {
+                newCaretOffset = getWordPrevious(newCaretOffset, SWT.MOVEMENT_WORD_START);
+            } else {
+                newCaretOffset = content.getOffsetAtLine(line);
+            }
+        } else {
+            if (wordSelect) {
+                newCaretOffset = getWordNext(newCaretOffset, SWT.MOVEMENT_WORD_END);
+            } else {
+                int lineEnd = content.getCharCount();
+                if (line + 1 < content.getLineCount()) {
+                    lineEnd = content.getOffsetAtLine(line + 1);
+                }
+                newCaretOffset = lineEnd;
+            }
+        }
+    }
+    return newCaretOffset;
+}
+/**
+ * Scrolls one page down so that the last line (truncated or whole)
+ * of the current page becomes the fully visible top line.
+ * <p>
+ * The caret is scrolled the same number of lines so that its location
+ * relative to the top line remains the same. The exception is the end
+ * of the text where a full page scroll is not possible. In this case
+ * the caret is moved after the last character.
+ * </p>
+ *
+ * @param select whether or not to select the page
+ */
+void doPageDown(bool select, int height) {
+    if (isSingleLine()) return;
+    int oldColumnX = columnX;
+    int oldHScrollOffset = horizontalScrollOffset;
+    if (isFixedLineHeight()) {
+        int lineCount = content.getLineCount();
+        int caretLine = getCaretLine();
+        if (caretLine < lineCount - 1) {
+            int lineHeight = renderer.getLineHeight();
+            int lines = (height is -1 ? clientAreaHeight : height) / lineHeight;
+            int scrollLines = Math.min(lineCount - caretLine - 1, lines);
+            // ensure that scrollLines never gets negative and at least one
+            // line is scrolled. fixes bug 5602.
+            scrollLines = Math.max(1, scrollLines);
+            caretOffset = getOffsetAtPoint(columnX, getLinePixel(caretLine + scrollLines));
+            if (select) {
+                doSelection(ST.COLUMN_NEXT);
+            }
+            // scroll one page down or to the bottom
+            int verticalMaximum = lineCount * getVerticalIncrement();
+            int pageSize = clientAreaHeight;
+            int verticalScrollOffset = getVerticalScrollOffset();
+            int scrollOffset = verticalScrollOffset + scrollLines * getVerticalIncrement();
+            if (scrollOffset + pageSize > verticalMaximum) {
+                scrollOffset = verticalMaximum - pageSize;
+            }
+            if (scrollOffset > verticalScrollOffset) {
+                scrollVertical(scrollOffset - verticalScrollOffset, true);
+            }
+        }
+    } else {
+        int lineCount = content.getLineCount();
+        int caretLine = getCaretLine();
+        int lineIndex, lineHeight;
+        if (height is -1) {
+            lineIndex = getPartialBottomIndex();
+            int topY = getLinePixel(lineIndex);
+            lineHeight = renderer.getLineHeight(lineIndex);
+            height = topY;
+            if (topY + lineHeight <= clientAreaHeight) {
+                height += lineHeight;
+            } else {
+                if (wordWrap) {
+                    TextLayout layout = renderer.getTextLayout(lineIndex);
+                    int y = clientAreaHeight - topY;
+                    for (int i = 0; i < layout.getLineCount(); i++) {
+                        Rectangle bounds = layout.getLineBounds(i);
+                        if (bounds.contains(bounds.x, y)) {
+                            height += bounds.y;
+                            break;
+                        }
+                    }
+                    renderer.disposeTextLayout(layout);
+                }
+            }
+        } else {
+            lineIndex = getLineIndex(height);
+            int topLineY = getLinePixel(lineIndex);
+            if (wordWrap) {
+                TextLayout layout = renderer.getTextLayout(lineIndex);
+                int y = height - topLineY;
+                for (int i = 0; i < layout.getLineCount(); i++) {
+                    Rectangle bounds = layout.getLineBounds(i);
+                    if (bounds.contains(bounds.x, y)) {
+                        height = topLineY + bounds.y + bounds.height;
+                        break;
+                    }
+                }
+                renderer.disposeTextLayout(layout);
+            } else {
+                height = topLineY + renderer.getLineHeight(lineIndex);
+            }
+        }
+        int caretHeight = height;
+        if (wordWrap) {
+            TextLayout layout = renderer.getTextLayout(caretLine);
+            int offsetInLine = caretOffset - content.getOffsetAtLine(caretLine);
+            lineIndex = getVisualLineIndex(layout, offsetInLine);
+            caretHeight += layout.getLineBounds(lineIndex).y;
+            renderer.disposeTextLayout(layout);
+        }
+        lineIndex = caretLine;
+        lineHeight = renderer.getLineHeight(lineIndex);
+        while (caretHeight - lineHeight >= 0 && lineIndex < lineCount - 1) {
+            caretHeight -= lineHeight;
+            lineHeight = renderer.getLineHeight(++lineIndex);
+        }
+        caretOffset = getOffsetAtPoint(columnX, caretHeight, lineIndex);
+        if (select) doSelection(ST.COLUMN_NEXT);
+        height = getAvailableHeightBellow(height);
+        scrollVertical(height, true);
+        if (height is 0) setCaretLocation();
+    }
+    showCaret();
+    int hScrollChange = oldHScrollOffset - horizontalScrollOffset;
+    columnX = oldColumnX + hScrollChange;
+}
+/**
+ * Moves the cursor to the end of the last fully visible line.
+ */
+void doPageEnd() {
+    // go to end of line if in single line mode. fixes 5673
+    if (isSingleLine()) {
+        doLineEnd();
+    } else {
+        int bottomOffset;
+        if (wordWrap) {
+            int lineIndex = getPartialBottomIndex();
+            TextLayout layout = renderer.getTextLayout(lineIndex);
+            int y = (clientAreaHeight - bottomMargin) - getLinePixel(lineIndex);
+            int index = layout.getLineCount() - 1;
+            while (index >= 0) {
+                Rectangle bounds = layout.getLineBounds(index);
+                if (y >= bounds.y + bounds.height) break;
+                index--;
+            }
+            if (index is -1 && lineIndex > 0) {
+                bottomOffset = content.getOffsetAtLine(lineIndex - 1) + content.getLine(lineIndex - 1).length;
+            } else {
+                bottomOffset = content.getOffsetAtLine(lineIndex) + Math.max(0, layout.getLineOffsets()[index + 1] - 1);
+            }
+            renderer.disposeTextLayout(layout);
+        } else {
+            int lineIndex = getBottomIndex();
+            bottomOffset = content.getOffsetAtLine(lineIndex) + content.getLine(lineIndex).length;
+        }
+        if (caretOffset < bottomOffset) {
+            caretOffset = bottomOffset;
+            caretAlignment = OFFSET_LEADING;
+            showCaret();
+        }
+    }
+}
+/**
+ * Moves the cursor to the beginning of the first fully visible line.
+ */
+void doPageStart() {
+    int topOffset;
+    if (wordWrap) {
+        int y, lineIndex;
+        if (topIndexY > 0) {
+            lineIndex = topIndex - 1;
+            y = renderer.getLineHeight(lineIndex) - topIndexY;
+        } else {
+            lineIndex = topIndex;
+            y = -topIndexY;
+        }
+        TextLayout layout = renderer.getTextLayout(lineIndex);
+        int index = 0;
+        int lineCount = layout.getLineCount();
+        while (index < lineCount) {
+            Rectangle bounds = layout.getLineBounds(index);
+            if (y <= bounds.y) break;
+            index++;
+        }
+        if (index is lineCount) {
+            topOffset = content.getOffsetAtLine(lineIndex + 1);
+        } else {
+            topOffset = content.getOffsetAtLine(lineIndex) + layout.getLineOffsets()[index];
+        }
+        renderer.disposeTextLayout(layout);
+    } else {
+        topOffset = content.getOffsetAtLine(topIndex);
+    }
+    if (caretOffset > topOffset) {
+        caretOffset = topOffset;
+        caretAlignment = OFFSET_LEADING;
+        showCaret();
+    }
+}
+/**
+ * Scrolls one page up so that the first line (truncated or whole)
+ * of the current page becomes the fully visible last line.
+ * The caret is scrolled the same number of lines so that its location
+ * relative to the top line remains the same. The exception is the beginning
+ * of the text where a full page scroll is not possible. In this case the
+ * caret is moved in front of the first character.
+ */
+void doPageUp(bool select, int height) {
+    if (isSingleLine()) return;
+    int oldHScrollOffset = horizontalScrollOffset;
+    int oldColumnX = columnX;
+    if (isFixedLineHeight()) {
+        int caretLine = getCaretLine();
+        if (caretLine > 0) {
+            int lineHeight = renderer.getLineHeight();
+            int lines = (height is -1 ? clientAreaHeight : height) / lineHeight;
+            int scrollLines = Math.max(1, Math.min(caretLine, lines));
+            caretLine -= scrollLines;
+            caretOffset = getOffsetAtPoint(columnX, getLinePixel(caretLine));
+            if (select) {
+                doSelection(ST.COLUMN_PREVIOUS);
+            }
+            int verticalScrollOffset = getVerticalScrollOffset();
+            int scrollOffset = Math.max(0, verticalScrollOffset - scrollLines * getVerticalIncrement());
+            if (scrollOffset < verticalScrollOffset) {
+                scrollVertical(scrollOffset - verticalScrollOffset, true);
+            }
+        }
+    } else {
+        int caretLine = getCaretLine();
+        int lineHeight, lineIndex;
+        if (height is -1) {
+            if (topIndexY is 0) {
+                height = clientAreaHeight;
+            } else {
+                int y;
+                if (topIndex > 0) {
+                    lineIndex = topIndex - 1;
+                    lineHeight = renderer.getLineHeight(lineIndex);
+                    height = clientAreaHeight - topIndexY;
+                    y = lineHeight - topIndexY;
+                } else {
+                    lineIndex = topIndex;
+                    lineHeight = renderer.getLineHeight(lineIndex);
+                    height = clientAreaHeight - (lineHeight + topIndexY);
+                    y = -topIndexY;
+                }
+                if (wordWrap) {
+                    TextLayout layout = renderer.getTextLayout(lineIndex);
+                    for (int i = 0; i < layout.getLineCount(); i++) {
+                        Rectangle bounds = layout.getLineBounds(i);
+                        if (bounds.contains(bounds.x, y)) {
+                            height += lineHeight - (bounds.y + bounds.height);
+                            break;
+                        }
+                    }
+                    renderer.disposeTextLayout(layout);
+                }
+            }
+        } else {
+            lineIndex = getLineIndex(clientAreaHeight - height);
+            int topLineY = getLinePixel(lineIndex);
+            if (wordWrap) {
+                TextLayout layout = renderer.getTextLayout(lineIndex);
+                int y = topLineY;
+                for (int i = 0; i < layout.getLineCount(); i++) {
+                    Rectangle bounds = layout.getLineBounds(i);
+                    if (bounds.contains(bounds.x, y)) {
+                        height = clientAreaHeight - (topLineY + bounds.y);
+                        break;
+                    }
+                }
+                renderer.disposeTextLayout(layout);
+            } else {
+                height = clientAreaHeight - topLineY;
+            }
+        }
+        int caretHeight = height;
+        if (wordWrap) {
+            TextLayout layout = renderer.getTextLayout(caretLine);
+            int offsetInLine = caretOffset - content.getOffsetAtLine(caretLine);
+            lineIndex = getVisualLineIndex(layout, offsetInLine);
+            caretHeight += layout.getBounds().height - layout.getLineBounds(lineIndex).y;
+            renderer.disposeTextLayout(layout);
+        }
+        lineIndex = caretLine;
+        lineHeight = renderer.getLineHeight(lineIndex);
+        while (caretHeight - lineHeight >= 0 && lineIndex > 0) {
+            caretHeight -= lineHeight;
+            lineHeight = renderer.getLineHeight(--lineIndex);
+        }
+        lineHeight = renderer.getLineHeight(lineIndex);
+        caretOffset = getOffsetAtPoint(columnX, lineHeight - caretHeight, lineIndex);
+        if (select) doSelection(ST.COLUMN_PREVIOUS);
+        height = getAvailableHeightAbove(height);
+        scrollVertical(-height, true);
+        if (height is 0) setCaretLocation();
+    }
+    showCaret();
+    int hScrollChange = oldHScrollOffset - horizontalScrollOffset;
+    columnX = oldColumnX + hScrollChange;
+}
+/**
+ * Updates the selection to extend to the current caret position.
+ */
+void doSelection(int direction) {
+    int redrawStart = -1;
+    int redrawEnd = -1;
+    if (selectionAnchor is -1) {
+        selectionAnchor = selection.x;
+    }
+    if (direction is ST.COLUMN_PREVIOUS) {
+        if (caretOffset < selection.x) {
+            // grow selection
+            redrawEnd = selection.x;
+            redrawStart = selection.x = caretOffset;
+            // check if selection has reversed direction
+            if (selection.y !is selectionAnchor) {
+                redrawEnd = selection.y;
+                selection.y = selectionAnchor;
+            }
+        // test whether selection actually changed. Fixes 1G71EO1
+        } else if (selectionAnchor is selection.x && caretOffset < selection.y) {
+            // caret moved towards selection anchor (left side of selection).
+            // shrink selection
+            redrawEnd = selection.y;
+            redrawStart = selection.y = caretOffset;
+        }
+    } else {
+        if (caretOffset > selection.y) {
+            // grow selection
+            redrawStart = selection.y;
+            redrawEnd = selection.y = caretOffset;
+            // check if selection has reversed direction
+            if (selection.x !is selectionAnchor) {
+                redrawStart = selection.x;
+                selection.x = selectionAnchor;
+            }
+        // test whether selection actually changed. Fixes 1G71EO1
+        } else if (selectionAnchor is selection.y && caretOffset > selection.x) {
+            // caret moved towards selection anchor (right side of selection).
+            // shrink selection
+            redrawStart = selection.x;
+            redrawEnd = selection.x = caretOffset;
+        }
+    }
+    if (redrawStart !is -1 && redrawEnd !is -1) {
+        internalRedrawRange(redrawStart, redrawEnd - redrawStart);
+        sendSelectionEvent();
+    }
+}
+/**
+ * Moves the caret to the next character or to the beginning of the
+ * next line if the cursor is at the end of a line.
+ */
+void doSelectionCursorNext() {
+    int caretLine = getCaretLine();
+    int lineOffset = content.getOffsetAtLine(caretLine);
+    int offsetInLine = caretOffset - lineOffset;
+    if (offsetInLine < content.getLine(caretLine).length) {
+        TextLayout layout = renderer.getTextLayout(caretLine);
+        offsetInLine = layout.getNextOffset(offsetInLine, SWT.MOVEMENT_CLUSTER);
+        int lineStart = layout.getLineOffsets()[layout.getLineIndex(offsetInLine)];
+        renderer.disposeTextLayout(layout);
+        caretOffset = offsetInLine + lineOffset;
+        caretAlignment = offsetInLine is lineStart ? OFFSET_LEADING : PREVIOUS_OFFSET_TRAILING;
+        showCaret();
+    } else if (caretLine < content.getLineCount() - 1 && !isSingleLine()) {
+        caretLine++;
+        caretOffset = content.getOffsetAtLine(caretLine);
+        caretAlignment = PREVIOUS_OFFSET_TRAILING;
+        showCaret();
+    }
+}
+/**
+ * Moves the caret to the previous character or to the end of the previous
+ * line if the cursor is at the beginning of a line.
+ */
+void doSelectionCursorPrevious() {
+    int caretLine = getCaretLine();
+    int lineOffset = content.getOffsetAtLine(caretLine);
+    int offsetInLine = caretOffset - lineOffset;
+    caretAlignment = OFFSET_LEADING;
+
+    if (offsetInLine > 0) {
+        caretOffset = getClusterPrevious(caretOffset, caretLine);
+        showCaret();
+    } else if (caretLine > 0) {
+        caretLine--;
+        lineOffset = content.getOffsetAtLine(caretLine);
+        caretOffset = lineOffset + content.getLine(caretLine).length;
+        showCaret();
+    }
+}
+/**
+ * Moves the caret one line down and to the same character offset relative
+ * to the beginning of the line. Moves the caret to the end of the new line
+ * if the new line is shorter than the character offset.
+ * Moves the caret to the end of the text if the caret already is on the
+ * last line.
+ * Adjusts the selection according to the caret change. This can either add
+ * to or subtract from the old selection, depending on the previous selection
+ * direction.
+ */
+void doSelectionLineDown() {
+    int oldColumnX = columnX = getPointAtOffset(caretOffset).x;
+    doLineDown(true);
+    columnX = oldColumnX;
+}
+/**
+ * Moves the caret one line up and to the same character offset relative
+ * to the beginning of the line. Moves the caret to the end of the new line
+ * if the new line is shorter than the character offset.
+ * Moves the caret to the beginning of the document if it is already on the
+ * first line.
+ * Adjusts the selection according to the caret change. This can either add
+ * to or subtract from the old selection, depending on the previous selection
+ * direction.
+ */
+void doSelectionLineUp() {
+    int oldColumnX = columnX = getPointAtOffset(caretOffset).x;
+    doLineUp(true);
+    columnX = oldColumnX;
+}
+/**
+ * Scrolls one page down so that the last line (truncated or whole)
+ * of the current page becomes the fully visible top line.
+ * <p>
+ * The caret is scrolled the same number of lines so that its location
+ * relative to the top line remains the same. The exception is the end
+ * of the text where a full page scroll is not possible. In this case
+ * the caret is moved after the last character.
+ * <p></p>
+ * Adjusts the selection according to the caret change. This can either add
+ * to or subtract from the old selection, depending on the previous selection
+ * direction.
+ * </p>
+ */
+void doSelectionPageDown(int pixels) {
+    int oldColumnX = columnX = getPointAtOffset(caretOffset).x;
+    doPageDown(true, pixels);
+    columnX = oldColumnX;
+}
+/**
+ * Scrolls one page up so that the first line (truncated or whole)
+ * of the current page becomes the fully visible last line.
+ * <p>
+ * The caret is scrolled the same number of lines so that its location
+ * relative to the top line remains the same. The exception is the beginning
+ * of the text where a full page scroll is not possible. In this case the
+ * caret is moved in front of the first character.
+ * </p><p>
+ * Adjusts the selection according to the caret change. This can either add
+ * to or subtract from the old selection, depending on the previous selection
+ * direction.
+ * </p>
+ */
+void doSelectionPageUp(int pixels) {
+    int oldColumnX = columnX = getPointAtOffset(caretOffset).x;
+    doPageUp(true, pixels);
+    columnX = oldColumnX;
+}
+/**
+ * Moves the caret to the end of the next word .
+ */
+void doSelectionWordNext() {
+    int newCaretOffset = getWordNext(caretOffset, SWT.MOVEMENT_WORD);
+    // Force symmetrical movement for word next and previous. Fixes 14536
+    caretAlignment = OFFSET_LEADING;
+    // don't change caret position if in single line mode and the cursor
+    // would be on a different line. fixes 5673
+    if (!isSingleLine() ||
+        content.getLineAtOffset(caretOffset) is content.getLineAtOffset(newCaretOffset)) {
+        caretOffset = newCaretOffset;
+        showCaret();
+    }
+}
+/**
+ * Moves the caret to the start of the previous word.
+ */
+void doSelectionWordPrevious() {
+    caretAlignment = OFFSET_LEADING;
+    caretOffset = getWordPrevious(caretOffset, SWT.MOVEMENT_WORD);
+    int caretLine = content.getLineAtOffset(caretOffset);
+    // word previous always comes from bottom line. when
+    // wrapping lines, stay on bottom line when on line boundary
+    if (wordWrap && caretLine < content.getLineCount() - 1 &&
+        caretOffset is content.getOffsetAtLine(caretLine + 1)) {
+        caretLine++;
+    }
+    showCaret();
+}
+/**
+ * Moves the caret one character to the left.  Do not go to the previous line.
+ * When in a bidi locale and at a R2L character the caret is moved to the
+ * beginning of the R2L segment (visually right) and then one character to the
+ * left (visually left because it's now in a L2R segment).
+ */
+void doVisualPrevious() {
+    caretOffset = getClusterPrevious(caretOffset, getCaretLine());
+    showCaret();
+}
+/**
+ * Moves the caret one character to the right.  Do not go to the next line.
+ * When in a bidi locale and at a R2L character the caret is moved to the
+ * end of the R2L segment (visually left) and then one character to the
+ * right (visually right because it's now in a L2R segment).
+ */
+void doVisualNext() {
+    caretOffset = getClusterNext(caretOffset, getCaretLine());
+    showCaret();
+}
+/**
+ * Moves the caret to the end of the next word.
+ * If a selection exists, move the caret to the end of the selection
+ * and remove the selection.
+ */
+void doWordNext() {
+    if (selection.y - selection.x > 0) {
+        caretOffset = selection.y;
+        showCaret();
+    } else {
+        doSelectionWordNext();
+    }
+}
+/**
+ * Moves the caret to the start of the previous word.
+ * If a selection exists, move the caret to the start of the selection
+ * and remove the selection.
+ */
+void doWordPrevious() {
+    if (selection.y - selection.x > 0) {
+        caretOffset = selection.x;
+        showCaret();
+    } else {
+        doSelectionWordPrevious();
+    }
+}
+/**
+ * Ends the autoscroll process.
+ */
+void endAutoScroll() {
+    autoScrollDirection = SWT.NULL;
+}
+public override Color getBackground() {
+    checkWidget();
+    if (background is null) {
+        return getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND);
+    }
+    return background;
+}
+/**
+ * Returns the baseline, in pixels.
+ *
+ * Note: this API should not be used if a StyleRange attribute causes lines to
+ * have different heights (i.e. different fonts, rise, etc).
+ *
+ * @return baseline the baseline
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @since 3.0
+ *
+ * @see #getBaseline(int)
+ */
+public int getBaseline() {
+    checkWidget();
+    return renderer.getBaseline();
+}
+/**
+ * Returns the baseline at the given offset, in pixels.
+ *
+ * @param offset the offset
+ *
+ * @return baseline the baseline
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_INVALID_RANGE when the offset is outside the valid range (< 0 or > getCharCount())</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public int getBaseline(int offset) {
+    checkWidget();
+    if (!(0 <= offset && offset <= content.getCharCount())) {
+        SWT.error(SWT.ERROR_INVALID_RANGE);
+    }
+    if (isFixedLineHeight()) {
+        return renderer.getBaseline();
+    }
+    int lineIndex = content.getLineAtOffset(offset);
+    int lineOffset = content.getOffsetAtLine(lineIndex);
+    TextLayout layout = renderer.getTextLayout(lineIndex);
+    int lineInParagraph = layout.getLineIndex(Math.min(offset - lineOffset, layout.getText().length));
+    FontMetrics metrics = layout.getLineMetrics(lineInParagraph);
+    renderer.disposeTextLayout(layout);
+    return metrics.getAscent() + metrics.getLeading();
+}
+/**
+ * Gets the BIDI coloring mode.  When true the BIDI text display
+ * algorithm is applied to segments of text that are the same
+ * color.
+ *
+ * @return the current coloring mode
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @deprecated use BidiSegmentListener instead.
+ */
+public bool getBidiColoring() {
+    checkWidget();
+    return bidiColoring;
+}
+/**
+ * Returns the index of the last fully visible line.
+ *
+ * @return index of the last fully visible line.
+ */
+int getBottomIndex() {
+    int bottomIndex;
+    if (isFixedLineHeight()) {
+        int lineCount = 1;
+        int lineHeight = renderer.getLineHeight();
+        if (lineHeight !is 0) {
+            // calculate the number of lines that are fully visible
+            int partialTopLineHeight = topIndex * lineHeight - getVerticalScrollOffset();
+            lineCount = (clientAreaHeight - partialTopLineHeight) / lineHeight;
+        }
+        bottomIndex = Math.min(content.getLineCount() - 1, topIndex + Math.max(0, lineCount - 1));
+    } else {
+        int clientAreaHeight = this.clientAreaHeight - bottomMargin;
+        bottomIndex = getLineIndex(clientAreaHeight);
+        if (bottomIndex > 0) {
+            int linePixel = getLinePixel(bottomIndex);
+            int lineHeight = renderer.getLineHeight(bottomIndex);
+            if (linePixel + lineHeight > clientAreaHeight) {
+                if (getLinePixel(bottomIndex - 1) >= topMargin) {
+                    bottomIndex--;
+                }
+            }
+        }
+    }
+    return bottomIndex;
+}
+Rectangle getBoundsAtOffset(int offset) {
+    int lineIndex = content.getLineAtOffset(offset);
+    int lineOffset = content.getOffsetAtLine(lineIndex);
+    String line = content.getLine(lineIndex);
+    Rectangle bounds;
+    if (line.length !is 0) {
+        int offsetInLine = offset - lineOffset;
+        TextLayout layout = renderer.getTextLayout(lineIndex);
+        bounds = layout.getBounds(offsetInLine, offsetInLine);
+        renderer.disposeTextLayout(layout);
+    } else {
+        bounds = new Rectangle (0, 0, 0, renderer.getLineHeight());
+    }
+    if (offset is caretOffset) {
+        int lineEnd = lineOffset + line.length;
+        if (offset is lineEnd && caretAlignment is PREVIOUS_OFFSET_TRAILING) {
+            bounds.width += getCaretWidth();
+        }
+    }
+    bounds.x += leftMargin - horizontalScrollOffset;
+    bounds.y += getLinePixel(lineIndex);
+    return bounds;
+}
+/**
+ * Returns the caret position relative to the start of the text.
+ *
+ * @return the caret position relative to the start of the text.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getCaretOffset() {
+    checkWidget();
+    return caretOffset;
+}
+/**
+ * Returns the caret width.
+ *
+ * @return the caret width, 0 if caret is null.
+ */
+int getCaretWidth() {
+    Caret caret = getCaret();
+    if (caret is null) return 0;
+    return caret.getSize().x;
+}
+Object getClipboardContent(int clipboardType) {
+    TextTransfer plainTextTransfer = TextTransfer.getInstance();
+    return clipboard.getContents(plainTextTransfer, clipboardType);
+}
+int getClusterNext(int offset, int lineIndex) {
+    int lineOffset = content.getOffsetAtLine(lineIndex);
+    TextLayout layout = renderer.getTextLayout(lineIndex);
+    offset -= lineOffset;
+    offset = layout.getNextOffset(offset, SWT.MOVEMENT_CLUSTER);
+    offset += lineOffset;
+    renderer.disposeTextLayout(layout);
+    return offset;
+}
+int getClusterPrevious(int offset, int lineIndex) {
+    int lineOffset = content.getOffsetAtLine(lineIndex);
+    TextLayout layout = renderer.getTextLayout(lineIndex);
+    offset -= lineOffset;
+    offset = layout.getPreviousOffset(offset, SWT.MOVEMENT_CLUSTER);
+    offset += lineOffset;
+    renderer.disposeTextLayout(layout);
+    return offset;
+}
+/**
+ * Returns the content implementation that is used for text storage.
+ *
+ * @return content the user defined content implementation that is used for
+ * text storage or the default content implementation if no user defined
+ * content implementation has been set.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public StyledTextContent getContent() {
+    checkWidget();
+    return content;
+}
+public override bool getDragDetect () {
+    checkWidget ();
+    return dragDetect_;
+}
+/**
+ * Returns whether the widget implements double click mouse behavior.
+ *
+ * @return true if double clicking a word selects the word, false if double clicks
+ * have the same effect as regular mouse clicks
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool getDoubleClickEnabled() {
+    checkWidget();
+    return doubleClickEnabled;
+}
+/**
+ * Returns whether the widget content can be edited.
+ *
+ * @return true if content can be edited, false otherwise
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool getEditable() {
+    checkWidget();
+    return editable;
+}
+public override Color getForeground() {
+    checkWidget();
+    if (foreground is null) {
+        return getDisplay().getSystemColor(SWT.COLOR_LIST_FOREGROUND);
+    }
+    return foreground;
+}
+/**
+ * Returns the horizontal scroll increment.
+ *
+ * @return horizontal scroll increment.
+ */
+int getHorizontalIncrement() {
+    return renderer.averageCharWidth;
+}
+/**
+ * Returns the horizontal scroll offset relative to the start of the line.
+ *
+ * @return horizontal scroll offset relative to the start of the line,
+ * measured in character increments starting at 0, if > 0 the content is scrolled
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getHorizontalIndex() {
+    checkWidget();
+    return horizontalScrollOffset / getHorizontalIncrement();
+}
+/**
+ * Returns the horizontal scroll offset relative to the start of the line.
+ *
+ * @return the horizontal scroll offset relative to the start of the line,
+ * measured in pixel starting at 0, if > 0 the content is scrolled.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getHorizontalPixel() {
+    checkWidget();
+    return horizontalScrollOffset;
+}
+/**
+ * Returns the line indentation of the widget.
+ *
+ * @return the line indentation
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getLineIndent(int)
+ *
+ * @since 3.2
+ */
+public int getIndent() {
+    checkWidget();
+    return indent;
+}
+/**
+ * Returns whether the widget justifies lines.
+ *
+ * @return whether lines are justified
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getLineJustify(int)
+ *
+ * @since 3.2
+ */
+public bool getJustify() {
+    checkWidget();
+    return justify;
+}
+/**
+ * Returns the action assigned to the key.
+ * Returns SWT.NULL if there is no action associated with the key.
+ *
+ * @param key a key code defined in SWT.java or a character.
+ *  Optionally ORd with a state mask.  Preferred state masks are one or more of
+ *  SWT.MOD1, SWT.MOD2, SWT.MOD3, since these masks account for modifier platform
+ *  differences.  However, there may be cases where using the specific state masks
+ *  (i.e., SWT.CTRL, SWT.SHIFT, SWT.ALT, SWT.COMMAND) makes sense.
+ * @return one of the predefined actions defined in ST.java or SWT.NULL
+ *  if there is no action associated with the key.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getKeyBinding(int key) {
+    checkWidget();
+    if( auto p = key in keyActionMap ){
+        return *p;
+    }
+    return SWT.NULL;
+}
+/**
+ * Gets the number of characters.
+ *
+ * @return number of characters in the widget
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getCharCount() {
+    checkWidget();
+    return content.getCharCount();
+}
+/**
+ * Returns the line at the given line index without delimiters.
+ * Index 0 is the first line of the content. When there are not
+ * any lines, getLine(0) is a valid call that answers an empty string.
+ * <p>
+ *
+ * @param lineIndex index of the line to return.
+ * @return the line text without delimiters
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_INVALID_RANGE when the line index is outside the valid range (< 0 or >= getLineCount())</li>
+ * </ul>
+ * @since 3.4
+ */
+public String getLine(int lineIndex) {
+    checkWidget();
+    if (lineIndex < 0 ||
+        (lineIndex > 0 && lineIndex >= content.getLineCount())) {
+        SWT.error(SWT.ERROR_INVALID_RANGE);
+    }
+    return content.getLine(lineIndex);
+}
+/**
+ * Returns the alignment of the line at the given index.
+ *
+ * @param index the index of the line
+ *
+ * @return the line alignment
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT when the index is invalid</li>
+ * </ul>
+ *
+ * @see #getAlignment()
+ *
+ * @since 3.2
+ */
+public int getLineAlignment(int index) {
+    checkWidget();
+    if (index < 0 || index > content.getLineCount()) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    return renderer.getLineAlignment(index, alignment);
+}
+/**
+ * Returns the line at the specified offset in the text
+ * where 0 &lt; offset &lt; getCharCount() so that getLineAtOffset(getCharCount())
+ * returns the line of the insert location.
+ *
+ * @param offset offset relative to the start of the content.
+ *  0 <= offset <= getCharCount()
+ * @return line at the specified offset in the text
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_INVALID_RANGE when the offset is outside the valid range (< 0 or > getCharCount())</li>
+ * </ul>
+ */
+public int getLineAtOffset(int offset) {
+    checkWidget();
+    if (offset < 0 || offset > getCharCount()) {
+        SWT.error(SWT.ERROR_INVALID_RANGE);
+    }
+    return content.getLineAtOffset(offset);
+}
+/**
+ * Returns the background color of the line at the given index.
+ * Returns null if a LineBackgroundListener has been set or if no background
+ * color has been specified for the line. Should not be called if a
+ * LineBackgroundListener has been set since the listener maintains the
+ * line background colors.
+ *
+ * @param index the index of the line
+ * @return the background color of the line at the given index.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT when the index is invalid</li>
+ * </ul>
+ */
+public Color getLineBackground(int index) {
+    checkWidget();
+    if (index < 0 || index > content.getLineCount()) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    return isListening(LineGetBackground) ? null : renderer.getLineBackground(index, null);
+}
+/**
+ * Returns the bullet of the line at the given index.
+ *
+ * @param index the index of the line
+ *
+ * @return the line bullet
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT when the index is invalid</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public Bullet getLineBullet(int index) {
+    checkWidget();
+    if (index < 0 || index > content.getLineCount()) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    return isListening(LineGetStyle) ? null : renderer.getLineBullet(index, null);
+}
+/**
+ * Returns the line background data for the given line or null if
+ * there is none.
+ *
+ * @param lineOffset offset of the line start relative to the start
+ *  of the content.
+ * @param line line to get line background data for
+ * @return line background data for the given line.
+ */
+StyledTextEvent getLineBackgroundData(int lineOffset, String line) {
+    return sendLineEvent(LineGetBackground, lineOffset, line);
+}
+/**
+ * Gets the number of text lines.
+ *
+ * @return the number of lines in the widget
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getLineCount() {
+    checkWidget();
+    return content.getLineCount();
+}
+/**
+ * Returns the number of lines that can be completely displayed in the
+ * widget client area.
+ *
+ * @return number of lines that can be completely displayed in the widget
+ *  client area.
+ */
+int getLineCountWhole() {
+    if (isFixedLineHeight()) {
+        int lineHeight = renderer.getLineHeight();
+        return lineHeight !is 0 ? clientAreaHeight / lineHeight : 1;
+    }
+    return getBottomIndex() - topIndex + 1;
+}
+/**
+ * Returns the line delimiter used for entering new lines by key down
+ * or paste operation.
+ *
+ * @return line delimiter used for entering new lines by key down
+ * or paste operation.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getLineDelimiter() {
+    checkWidget();
+    return content.getLineDelimiter();
+}
+/**
+ * Returns the line height.
+ * <p>
+ * Note: this API should not be used if a StyleRange attribute causes lines to
+ * have different heights (i.e. different fonts, rise, etc).
+ * </p>
+ *
+ * @return line height in pixel.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @see #getLineHeight(int)
+ */
+public int getLineHeight() {
+    checkWidget();
+    return renderer.getLineHeight();
+}
+/**
+ * Returns the line height at the given offset.
+ *
+ * @param offset the offset
+ *
+ * @return line height in pixels
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_INVALID_RANGE when the offset is outside the valid range (< 0 or > getCharCount())</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public int getLineHeight(int offset) {
+    checkWidget();
+    if (!(0 <= offset && offset <= content.getCharCount())) {
+        SWT.error(SWT.ERROR_INVALID_RANGE);
+    }
+    if (isFixedLineHeight()) {
+        return renderer.getLineHeight();
+    }
+    int lineIndex = content.getLineAtOffset(offset);
+    int lineOffset = content.getOffsetAtLine(lineIndex);
+    TextLayout layout = renderer.getTextLayout(lineIndex);
+    int lineInParagraph = layout.getLineIndex(Math.min(offset - lineOffset, layout.getText().length));
+    int height = layout.getLineBounds(lineInParagraph).height;
+    renderer.disposeTextLayout(layout);
+    return height;
+}
+/**
+ * Returns the indentation of the line at the given index.
+ *
+ * @param index the index of the line
+ *
+ * @return the line indentation
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT when the index is invalid</li>
+ * </ul>
+ *
+ * @see #getIndent()
+ *
+ * @since 3.2
+ */
+public int getLineIndent(int index) {
+    checkWidget();
+    if (index < 0 || index > content.getLineCount()) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    return isListening(LineGetStyle) ? 0 : renderer.getLineIndent(index, indent);
+}
+/**
+ * Returns whether the line at the given index is justified.
+ *
+ * @param index the index of the line
+ *
+ * @return whether the line is justified
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT when the index is invalid</li>
+ * </ul>
+ *
+ * @see #getJustify()
+ *
+ * @since 3.2
+ */
+public bool getLineJustify(int index) {
+    checkWidget();
+    if (index < 0 || index > content.getLineCount()) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    return isListening(LineGetStyle) ? false : renderer.getLineJustify(index, justify);
+}
+/**
+ * Returns the line spacing of the widget.
+ *
+ * @return the line spacing
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public int getLineSpacing() {
+    checkWidget();
+    return lineSpacing;
+}
+/**
+ * Returns the line style data for the given line or null if there is
+ * none.
+ * <p>
+ * If there is a LineStyleListener but it does not set any styles,
+ * the StyledTextEvent.styles field will be initialized to an empty
+ * array.
+ * </p>
+ *
+ * @param lineOffset offset of the line start relative to the start of
+ *  the content.
+ * @param line line to get line styles for
+ * @return line style data for the given line. Styles may start before
+ *  line start and end after line end
+ */
+StyledTextEvent getLineStyleData(int lineOffset, String line) {
+    return sendLineEvent(LineGetStyle, lineOffset, line);
+}
+/**
+ * Returns the top pixel, relative to the client area, of a given line.
+ * Clamps out of ranges index.
+ *
+ * @param lineIndex the line index, the max value is lineCount. If
+ * lineIndex is lineCount it returns the bottom pixel of the last line.
+ * It means this function can be used to retrieve the bottom pixel of any line.
+ *
+ * @return the top pixel of a given line index
+ *
+ * @since 3.2
+ */
+public int getLinePixel(int lineIndex) {
+    checkWidget();
+    int lineCount = content.getLineCount();
+    lineIndex = Math.max(0, Math.min(lineCount, lineIndex));
+    if (isFixedLineHeight()) {
+        int lineHeight = renderer.getLineHeight();
+        return lineIndex * lineHeight - getVerticalScrollOffset() + topMargin;
+    }
+    if (lineIndex is topIndex) return topIndexY + topMargin;
+    int height = topIndexY;
+    if (lineIndex > topIndex) {
+        for (int i = topIndex; i < lineIndex; i++) {
+            height += renderer.getLineHeight(i);
+        }
+    } else {
+        for (int i = topIndex - 1; i >= lineIndex; i--) {
+            height -= renderer.getLineHeight(i);
+        }
+    }
+    return height + topMargin;
+}
+/**
+ * Returns the line index for a y, relative to the client area.
+ * The line index returned is always in the range 0..lineCount - 1.
+ *
+ * @param y the y-coordinate pixel
+ *
+ * @return the line index for a given y-coordinate pixel
+ *
+ * @since 3.2
+ */
+public int getLineIndex(int y) {
+    checkWidget();
+    y -= topMargin;
+    if (isFixedLineHeight()) {
+        int lineHeight = renderer.getLineHeight();
+        int lineIndex = (y + getVerticalScrollOffset()) / lineHeight;
+        int lineCount = content.getLineCount();
+        lineIndex = Math.max(0, Math.min(lineCount - 1, lineIndex));
+        return lineIndex;
+    }
+    if (y is topIndexY) return topIndex;
+    int line = topIndex;
+    if (y < topIndexY) {
+        while (y < topIndexY && line > 0) {
+            y += renderer.getLineHeight(--line);
+        }
+    } else {
+        int lineCount = content.getLineCount();
+        int lineHeight = renderer.getLineHeight(line);
+        while (y - lineHeight >= topIndexY && line < lineCount - 1) {
+            y -= lineHeight;
+            lineHeight = renderer.getLineHeight(++line);
+        }
+    }
+    return line;
+}
+/**
+ * Returns the x, y location of the upper left corner of the character
+ * bounding box at the specified offset in the text. The point is
+ * relative to the upper left corner of the widget client area.
+ *
+ * @param offset offset relative to the start of the content.
+ *  0 <= offset <= getCharCount()
+ * @return x, y location of the upper left corner of the character
+ *  bounding box at the specified offset in the text.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_INVALID_RANGE when the offset is outside the valid range (< 0 or > getCharCount())</li>
+ * </ul>
+ */
+public Point getLocationAtOffset(int offset) {
+    checkWidget();
+    if (offset < 0 || offset > getCharCount()) {
+        SWT.error(SWT.ERROR_INVALID_RANGE);
+    }
+    return getPointAtOffset(offset);
+}
+/**
+ * Returns the character offset of the first character of the given line.
+ *
+ * @param lineIndex index of the line, 0 based relative to the first
+ *  line in the content. 0 <= lineIndex < getLineCount(), except
+ *  lineIndex may always be 0
+ * @return offset offset of the first character of the line, relative to
+ *  the beginning of the document. The first character of the document is
+ *  at offset 0.
+ *  When there are not any lines, getOffsetAtLine(0) is a valid call that
+ *  answers 0.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_INVALID_RANGE when the line index is outside the valid range (< 0 or >= getLineCount())</li>
+ * </ul>
+ * @since 2.0
+ */
+public int getOffsetAtLine(int lineIndex) {
+    checkWidget();
+    if (lineIndex < 0 ||
+        (lineIndex > 0 && lineIndex >= content.getLineCount())) {
+        SWT.error(SWT.ERROR_INVALID_RANGE);
+    }
+    return content.getOffsetAtLine(lineIndex);
+}
+/**
+ * Returns the offset of the character at the given location relative
+ * to the first character in the document.
+ * <p>
+ * The return value reflects the character offset that the caret will
+ * be placed at if a mouse click occurred at the specified location.
+ * If the x coordinate of the location is beyond the center of a character
+ * the returned offset will be behind the character.
+ * </p>
+ *
+ * @param point the origin of character bounding box relative to
+ *  the origin of the widget client area.
+ * @return offset of the character at the given location relative
+ *  to the first character in the document.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_NULL_ARGUMENT when point is null</li>
+ *   <li>ERROR_INVALID_ARGUMENT when there is no character at the specified location</li>
+ * </ul>
+ */
+public int getOffsetAtLocation(Point point) {
+    checkWidget();
+    if (point is null) {
+        SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    }
+    int[] trailing = new int[1];
+    int offset = getOffsetAtPoint(point.x, point.y, trailing, true);
+    if (offset is -1) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    return offset + trailing[0];
+}
+int getOffsetAtPoint(int x, int y) {
+    int lineIndex = getLineIndex(y);
+    y -= getLinePixel(lineIndex);
+    return getOffsetAtPoint(x, y, lineIndex);
+}
+/**
+ * Returns the offset at the specified x location in the specified line.
+ *
+ * @param x x location of the mouse location
+ * @param line  line the mouse location is in
+ * @return the offset at the specified x location in the specified line,
+ *  relative to the beginning of the document
+ */
+int getOffsetAtPoint(int x, int y, int lineIndex) {
+    TextLayout layout = renderer.getTextLayout(lineIndex);
+    x += horizontalScrollOffset - leftMargin;
+    int[1] trailing;
+    int offsetInLine = layout.getOffset(x, y, trailing);
+    caretAlignment = OFFSET_LEADING;
+    if (trailing[0] !is 0) {
+        int lineInParagraph = layout.getLineIndex(offsetInLine + trailing[0]);
+        int lineStart = layout.getLineOffsets()[lineInParagraph];
+        if (offsetInLine + trailing[0] is lineStart) {
+            offsetInLine += trailing[0];
+            caretAlignment = PREVIOUS_OFFSET_TRAILING;
+        } else {
+            String line = content.getLine(lineIndex);
+            int level;
+            int offset = offsetInLine;
+            while (offset > 0 && tango.text.Unicode.isDigit(line[offset])) offset--;
+            if (offset is 0 && tango.text.Unicode.isDigit(line[offset])) {
+                level = isMirrored() ? 1 : 0;
+            } else {
+                level = layout.getLevel(offset) & 0x1;
+            }
+            offsetInLine += trailing[0];
+            int trailingLevel = layout.getLevel(offsetInLine) & 0x1;
+            if ((level ^ trailingLevel) !is 0) {
+                caretAlignment = PREVIOUS_OFFSET_TRAILING;
+            } else {
+                caretAlignment = OFFSET_LEADING;
+            }
+        }
+    }
+    renderer.disposeTextLayout(layout);
+    return offsetInLine + content.getOffsetAtLine(lineIndex);
+}
+int getOffsetAtPoint(int x, int y, int[] trailing, bool inTextOnly) {
+    if (inTextOnly && y + getVerticalScrollOffset() < 0 || x + horizontalScrollOffset < 0) {
+        return -1;
+    }
+    int bottomIndex = getPartialBottomIndex();
+    int height = getLinePixel(bottomIndex + 1);
+    if (inTextOnly && y > height) {
+        return -1;
+    }
+    int lineIndex = getLineIndex(y);
+    int lineOffset = content.getOffsetAtLine(lineIndex);
+    TextLayout layout = renderer.getTextLayout(lineIndex);
+    x += horizontalScrollOffset - leftMargin ;
+    y -= getLinePixel(lineIndex);
+    int offset = layout.getOffset(x, y, trailing);
+    Rectangle rect = layout.getLineBounds(layout.getLineIndex(offset));
+    renderer.disposeTextLayout(layout);
+    if (inTextOnly && !(rect.x  <= x && x <=  rect.x + rect.width)) {
+        return -1;
+    }
+    return offset + lineOffset;
+}
+/**
+ * Returns the orientation of the receiver.
+ *
+ * @return the orientation style
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.1.2
+ */
+public int getOrientation () {
+    checkWidget();
+    return isMirrored() ? SWT.RIGHT_TO_LEFT : SWT.LEFT_TO_RIGHT;
+}
+/**
+ * Returns the index of the last partially visible line.
+ *
+ * @return index of the last partially visible line.
+ */
+int getPartialBottomIndex() {
+    if (isFixedLineHeight()) {
+        int lineHeight = renderer.getLineHeight();
+        int partialLineCount = Compatibility.ceil(clientAreaHeight, lineHeight);
+        return Math.max(0, Math.min(content.getLineCount(), topIndex + partialLineCount) - 1);
+    }
+    return getLineIndex(clientAreaHeight - bottomMargin);
+}
+/**
+ * Returns the index of the first partially visible line.
+ *
+ * @return index of the first partially visible line.
+ */
+int getPartialTopIndex() {
+    if (isFixedLineHeight()) {
+        int lineHeight = renderer.getLineHeight();
+        return getVerticalScrollOffset() / lineHeight;
+    }
+    return topIndexY <= 0 ? topIndex : topIndex - 1;
+}
+/**
+ * Returns the content in the specified range using the platform line
+ * delimiter to separate lines.
+ *
+ * @param writer the TextWriter to write line text into
+ * @return the content in the specified range using the platform line
+ *  delimiter to separate lines as written by the specified TextWriter.
+ */
+String getPlatformDelimitedText(TextWriter writer) {
+    int end = writer.getStart() + writer.getCharCount();
+    int startLine = content.getLineAtOffset(writer.getStart());
+    int endLine = content.getLineAtOffset(end);
+    String endLineText = content.getLine(endLine);
+    int endLineOffset = content.getOffsetAtLine(endLine);
+
+    for (int i = startLine; i <= endLine; i++) {
+        writer.writeLine(content.getLine(i), content.getOffsetAtLine(i));
+        if (i < endLine) {
+            writer.writeLineDelimiter(PlatformLineDelimiter);
+        }
+    }
+    if (end > endLineOffset + endLineText.length) {
+        writer.writeLineDelimiter(PlatformLineDelimiter);
+    }
+    writer.close();
+    return writer.toString();
+}
+/**
+ * Returns all the ranges of text that have an associated StyleRange.
+ * Returns an empty array if a LineStyleListener has been set.
+ * Should not be called if a LineStyleListener has been set since the
+ * listener maintains the styles.
+ * <p>
+ * The ranges array contains start and length pairs.  Each pair refers to
+ * the corresponding style in the styles array.  For example, the pair
+ * that starts at ranges[n] with length ranges[n+1] uses the style
+ * at styles[n/2] returned by <code>getStyleRanges(int, int, bool)</code>.
+ * </p>
+ *
+ * @return the ranges or an empty array if a LineStyleListener has been set.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ *
+ * @see #getStyleRanges(bool)
+ */
+public int[] getRanges() {
+    checkWidget();
+    if (!isListening(LineGetStyle)) {
+        int[] ranges = renderer.getRanges(0, content.getCharCount());
+        if (ranges !is null) return ranges;
+    }
+    return new int[0];
+}
+/**
+ * Returns the ranges of text that have an associated StyleRange.
+ * Returns an empty array if a LineStyleListener has been set.
+ * Should not be called if a LineStyleListener has been set since the
+ * listener maintains the styles.
+ * <p>
+ * The ranges array contains start and length pairs.  Each pair refers to
+ * the corresponding style in the styles array.  For example, the pair
+ * that starts at ranges[n] with length ranges[n+1] uses the style
+ * at styles[n/2] returned by <code>getStyleRanges(int, int, bool)</code>.
+ * </p>
+ *
+ * @param start the start offset of the style ranges to return
+ * @param length the number of style ranges to return
+ *
+ * @return the ranges or an empty array if a LineStyleListener has been set.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_INVALID_RANGE if start or length are outside the widget content</li>
+ * </ul>
+ *
+ * @since 3.2
+ *
+ * @see #getStyleRanges(int, int, bool)
+ */
+public int[] getRanges(int start, int length) {
+    checkWidget();
+    int contentLength = getCharCount();
+    int end = start + length;
+    if (start > end || start < 0 || end > contentLength) {
+        SWT.error(SWT.ERROR_INVALID_RANGE);
+    }
+    if (!isListening(LineGetStyle)) {
+        int[] ranges = renderer.getRanges(start, length);
+        if (ranges !is null) return ranges;
+    }
+    return new int[0];
+}
+/**
+ * Returns the selection.
+ * <p>
+ * Text selections are specified in terms of caret positions.  In a text
+ * widget that contains N characters, there are N+1 caret positions,
+ * ranging from 0..N
+ * </p>
+ *
+ * @return start and end of the selection, x is the offset of the first
+ *  selected character, y is the offset after the last selected character.
+ *  The selection values returned are visual (i.e., x will always always be
+ *  <= y).  To determine if a selection is right-to-left (RtoL) vs. left-to-right
+ *  (LtoR), compare the caretOffset to the start and end of the selection
+ *  (e.g., caretOffset is start of selection implies that the selection is RtoL).
+ * @see #getSelectionRange
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Point getSelection() {
+    checkWidget();
+    return new Point(selection.x, selection.y);
+}
+/**
+ * Returns the selection.
+ *
+ * @return start and length of the selection, x is the offset of the
+ *  first selected character, relative to the first character of the
+ *  widget content. y is the length of the selection.
+ *  The selection values returned are visual (i.e., length will always always be
+ *  positive).  To determine if a selection is right-to-left (RtoL) vs. left-to-right
+ *  (LtoR), compare the caretOffset to the start and end of the selection
+ *  (e.g., caretOffset is start of selection implies that the selection is RtoL).
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Point getSelectionRange() {
+    checkWidget();
+    return new Point(selection.x, selection.y - selection.x);
+}
+/**
+ * Returns the receiver's selection background color.
+ *
+ * @return the selection background color
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @since 2.1
+ */
+public Color getSelectionBackground() {
+    checkWidget();
+    if (selectionBackground is null) {
+        return getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION);
+    }
+    return selectionBackground;
+}
+/**
+ * Gets the number of selected characters.
+ *
+ * @return the number of selected characters.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSelectionCount() {
+    checkWidget();
+    return getSelectionRange().y;
+}
+/**
+ * Returns the receiver's selection foreground color.
+ *
+ * @return the selection foreground color
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @since 2.1
+ */
+public Color getSelectionForeground() {
+    checkWidget();
+    if (selectionForeground is null) {
+        return getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT);
+    }
+    return selectionForeground;
+}
+/**
+ * Returns the selected text.
+ *
+ * @return selected text, or an empty String if there is no selection.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getSelectionText() {
+    checkWidget();
+    return content.getTextRange(selection.x, selection.y - selection.x);
+}
+public override int getStyle() {
+    int style = super.getStyle();
+    style &= ~(SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT | SWT.MIRRORED);
+    if (isMirrored()) {
+        style |= SWT.RIGHT_TO_LEFT | SWT.MIRRORED;
+    } else {
+        style |= SWT.LEFT_TO_RIGHT;
+    }
+    return style;
+}
+
+/**
+ * Returns the text segments that should be treated as if they
+ * had a different direction than the surrounding text.
+ *
+ * @param lineOffset offset of the first character in the line.
+ *  0 based from the beginning of the document.
+ * @param line text of the line to specify bidi segments for
+ * @return text segments that should be treated as if they had a
+ *  different direction than the surrounding text. Only the start
+ *  index of a segment is specified, relative to the start of the
+ *  line. Always starts with 0 and ends with the line length.
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the segment indices returned
+ *      by the listener do not start with 0, are not in ascending order,
+ *      exceed the line length or have duplicates</li>
+ * </ul>
+ */
+int [] getBidiSegments(int lineOffset, String line) {
+    if (!isBidi()) return null;
+    if (!isListening(LineGetSegments)) {
+        return getBidiSegmentsCompatibility(line, lineOffset);
+    }
+    StyledTextEvent event = sendLineEvent(LineGetSegments, lineOffset, line);
+    int lineLength = line.length;
+    int[] segments;
+    if (event is null || event.segments is null || event.segments.length is 0) {
+        segments = [0, lineLength];
+    } else {
+        int segmentCount = event.segments.length;
+
+        // test segment index consistency
+        if (event.segments[0] !is 0) {
+            SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+        }
+        for (int i = 1; i < segmentCount; i++) {
+            if (event.segments[i] <= event.segments[i - 1] || event.segments[i] > lineLength) {
+                SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+            }
+        }
+        // ensure that last segment index is line end offset
+        if (event.segments[segmentCount - 1] !is lineLength) {
+            segments = new int[segmentCount + 1];
+            System.arraycopy(event.segments, 0, segments, 0, segmentCount);
+            segments[segmentCount] = lineLength;
+        } else {
+            segments = event.segments;
+        }
+    }
+    return segments;
+}
+/**
+ * @see #getBidiSegments
+ * Supports deprecated setBidiColoring API. Remove when API is removed.
+ */
+int [] getBidiSegmentsCompatibility(String line, int lineOffset) {
+    int lineLength = line.length;
+    if (!bidiColoring) {
+        return [0, lineLength];
+    }
+    StyleRange [] styles = null;
+    StyledTextEvent event = getLineStyleData(lineOffset, line);
+    if (event !is null) {
+        styles = event.styles;
+    } else {
+        styles = renderer.getStyleRanges(lineOffset, lineLength, true);
+    }
+    if (styles is null || styles.length is 0) {
+        return [0, lineLength];
+    }
+    int k=0, count = 1;
+    while (k < styles.length && styles[k].start is 0 && styles[k].length is lineLength) {
+        k++;
+    }
+    int[] offsets = new int[(styles.length - k) * 2 + 2];
+    for (int i = k; i < styles.length; i++) {
+        StyleRange style = styles[i];
+        int styleLineStart = Math.max(style.start - lineOffset, 0);
+        int styleLineEnd = Math.max(style.start + style.length - lineOffset, styleLineStart);
+        styleLineEnd = Math.min (styleLineEnd, line.length );
+        if (i > 0 && count > 1 &&
+            ((styleLineStart >= offsets[count-2] && styleLineStart <= offsets[count-1]) ||
+             (styleLineEnd >= offsets[count-2] && styleLineEnd <= offsets[count-1])) &&
+             style.similarTo(styles[i-1])) {
+            offsets[count-2] = Math.min(offsets[count-2], styleLineStart);
+            offsets[count-1] = Math.max(offsets[count-1], styleLineEnd);
+        } else {
+            if (styleLineStart > offsets[count - 1]) {
+                offsets[count] = styleLineStart;
+                count++;
+            }
+            offsets[count] = styleLineEnd;
+            count++;
+        }
+    }
+    // add offset for last non-colored segment in line, if any
+    if (lineLength > offsets[count-1]) {
+        offsets [count] = lineLength;
+        count++;
+    }
+    if (count is offsets.length) {
+        return offsets;
+    }
+    int [] result = new int [count];
+    System.arraycopy (offsets, 0, result, 0, count);
+    return result;
+}
+/**
+ * Returns the style range at the given offset.
+ * <p>
+ * Returns null if a LineStyleListener has been set or if a style is not set
+ * for the offset.
+ * Should not be called if a LineStyleListener has been set since the
+ * listener maintains the styles.
+ * </p>
+ *
+ * @param offset the offset to return the style for.
+ *  0 <= offset < getCharCount() must be true.
+ * @return a StyleRange with start is offset and length is 1, indicating
+ *  the style at the given offset. null if a LineStyleListener has been set
+ *  or if a style is not set for the given offset.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_INVALID_ARGUMENT when the offset is invalid</li>
+ * </ul>
+ */
+public StyleRange getStyleRangeAtOffset(int offset) {
+    checkWidget();
+    if (offset < 0 || offset >= getCharCount()) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (!isListening(LineGetStyle)) {
+        StyleRange[] ranges = renderer.getStyleRanges(offset, 1, true);
+        if (ranges !is null) return ranges[0];
+    }
+    return null;
+}
+/**
+ * Returns the styles.
+ * <p>
+ * Returns an empty array if a LineStyleListener has been set.
+ * Should not be called if a LineStyleListener has been set since the
+ * listener maintains the styles.
+ * <p></p>
+ * Note: Because a StyleRange includes the start and length, the
+ * same instance cannot occur multiple times in the array of styles.
+ * If the same style attributes, such as font and color, occur in
+ * multiple StyleRanges, <code>getStyleRanges(bool)</code>
+ * can be used to get the styles without the ranges.
+ * </p>
+ *
+ * @return the styles or an empty array if a LineStyleListener has been set.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getStyleRanges(bool)
+ */
+public StyleRange[] getStyleRanges() {
+    checkWidget();
+    return getStyleRanges(0, content.getCharCount(), true);
+}
+/**
+ * Returns the styles.
+ * <p>
+ * Returns an empty array if a LineStyleListener has been set.
+ * Should not be called if a LineStyleListener has been set since the
+ * listener maintains the styles.
+ * </p><p>
+ * Note: When <code>includeRanges</code> is true, the start and length
+ * fields of each StyleRange will be valid, however the StyleRange
+ * objects may need to be cloned. When <code>includeRanges</code> is
+ * false, <code>getRanges(int, int)</code> can be used to get the
+ * associated ranges.
+ * </p>
+ *
+ * @param includeRanges whether the start and length field of the StyleRanges should be set.
+ *
+ * @return the styles or an empty array if a LineStyleListener has been set.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ *
+ * @see #getRanges(int, int)
+ * @see #setStyleRanges(int[], StyleRange[])
+ */
+public StyleRange[] getStyleRanges(bool includeRanges) {
+    checkWidget();
+    return getStyleRanges(0, content.getCharCount(), includeRanges);
+}
+/**
+ * Returns the styles for the given text range.
+ * <p>
+ * Returns an empty array if a LineStyleListener has been set.
+ * Should not be called if a LineStyleListener has been set since the
+ * listener maintains the styles.
+ * </p><p>
+ * Note: Because the StyleRange includes the start and length, the
+ * same instance cannot occur multiple times in the array of styles.
+ * If the same style attributes, such as font and color, occur in
+ * multiple StyleRanges, <code>getStyleRanges(int, int, bool)</code>
+ * can be used to get the styles without the ranges.
+ * </p>
+ * @param start the start offset of the style ranges to return
+ * @param length the number of style ranges to return
+ *
+ * @return the styles or an empty array if a LineStyleListener has
+ *  been set.  The returned styles will reflect the given range.  The first
+ *  returned <code>StyleRange</code> will have a starting offset >= start
+ *  and the last returned <code>StyleRange</code> will have an ending
+ *  offset <= start + length - 1
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_INVALID_RANGE when start and/or end are outside the widget content</li>
+ * </ul>
+ *
+ * @see #getStyleRanges(int, int, bool)
+ *
+ * @since 3.0
+ */
+public StyleRange[] getStyleRanges(int start, int length) {
+    checkWidget();
+    return getStyleRanges(start, length, true);
+}
+/**
+ * Returns the styles for the given text range.
+ * <p>
+ * Returns an empty array if a LineStyleListener has been set.
+ * Should not be called if a LineStyleListener has been set since the
+ * listener maintains the styles.
+ * </p><p>
+ * Note: When <code>includeRanges</code> is true, the start and length
+ * fields of each StyleRange will be valid, however the StyleRange
+ * objects may need to be cloned. When <code>includeRanges</code> is
+ * false, <code>getRanges(int, int)</code> can be used to get the
+ * associated ranges.
+ * </p>
+ *
+ * @param start the start offset of the style ranges to return
+ * @param length the number of style ranges to return
+ * @param includeRanges whether the start and length field of the StyleRanges should be set.
+ *
+ * @return the styles or an empty array if a LineStyleListener has
+ *  been set.  The returned styles will reflect the given range.  The first
+ *  returned <code>StyleRange</code> will have a starting offset >= start
+ *  and the last returned <code>StyleRange</code> will have an ending
+ *  offset <= start + length - 1
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_INVALID_RANGE when start and/or end are outside the widget content</li>
+ * </ul>
+ *
+ * @since 3.2
+ *
+ * @see #getRanges(int, int)
+ * @see #setStyleRanges(int[], StyleRange[])
+ */
+public StyleRange[] getStyleRanges(int start, int length, bool includeRanges) {
+    checkWidget();
+    int contentLength = getCharCount();
+    int end = start + length;
+    if (start > end || start < 0 || end > contentLength) {
+        SWT.error(SWT.ERROR_INVALID_RANGE);
+    }
+    if (!isListening(LineGetStyle)) {
+        StyleRange[] ranges = renderer.getStyleRanges(start, length, includeRanges);
+        if (ranges !is null) return ranges;
+    }
+    return new StyleRange[0];
+}
+/**
+ * Returns the tab width measured in characters.
+ *
+ * @return tab width measured in characters
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getTabs() {
+    checkWidget();
+    return tabLength;
+}
+/**
+ * Returns a copy of the widget content.
+ *
+ * @return copy of the widget content
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getText() {
+    checkWidget();
+    return content.getTextRange(0, getCharCount());
+}
+/**
+ * Returns the widget content between the two offsets.
+ *
+ * @param start offset of the first character in the returned String
+ * @param end offset of the last character in the returned String
+ * @return widget content starting at start and ending at end
+ * @see #getTextRange(int,int)
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_INVALID_RANGE when start and/or end are outside the widget content</li>
+ * </ul>
+ */
+public String getText(int start, int end) {
+    checkWidget();
+    int contentLength = getCharCount();
+    if (start < 0 || start >= contentLength || end < 0 || end >= contentLength || start > end) {
+        SWT.error(SWT.ERROR_INVALID_RANGE);
+    }
+    return content.getTextRange(start, end - start + 1);
+}
+/**
+ * Returns the smallest bounding rectangle that includes the characters between two offsets.
+ *
+ * @param start offset of the first character included in the bounding box
+ * @param end offset of the last character included in the bounding box
+ * @return bounding box of the text between start and end
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_INVALID_RANGE when start and/or end are outside the widget content</li>
+ * </ul>
+ * @since 3.1
+ */
+public Rectangle getTextBounds(int start, int end) {
+    checkWidget();
+    int contentLength = getCharCount();
+    if (start < 0 || start >= contentLength || end < 0 || end >= contentLength || start > end) {
+        SWT.error(SWT.ERROR_INVALID_RANGE);
+    }
+    int lineStart = content.getLineAtOffset(start);
+    int lineEnd = content.getLineAtOffset(end);
+    Rectangle rect;
+    int y = getLinePixel(lineStart);
+    int height = 0;
+    int left = 0x7fffffff, right = 0;
+    for (int i = lineStart; i <= lineEnd; i++) {
+        int lineOffset = content.getOffsetAtLine(i);
+        TextLayout layout = renderer.getTextLayout(i);
+        int length = layout.getText().length;
+        if (length > 0) {
+            if (i is lineStart) {
+                if (i is lineEnd) {
+                    rect = layout.getBounds(start - lineOffset, end - lineOffset);
+                } else {
+                    rect = layout.getBounds(start - lineOffset, length);
+                }
+                y += rect.y;
+            } else if (i is lineEnd) {
+                rect = layout.getBounds(0, end - lineOffset);
+            } else {
+                rect = layout.getBounds();
+            }
+            left = Math.min(left, rect.x);
+            right = Math.max(right, rect.x + rect.width);
+            height += rect.height;
+        } else {
+            height += renderer.getLineHeight();
+        }
+        renderer.disposeTextLayout(layout);
+    }
+    rect = new Rectangle (left, y, right-left, height);
+    rect.x += leftMargin - horizontalScrollOffset;
+    return rect;
+}
+/**
+ * Returns the widget content starting at start for length characters.
+ *
+ * @param start offset of the first character in the returned String
+ * @param length number of characters to return
+ * @return widget content starting at start and extending length characters.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_INVALID_RANGE when start and/or length are outside the widget content</li>
+ * </ul>
+ */
+public String getTextRange(int start, int length) {
+    checkWidget();
+    int contentLength = getCharCount();
+    int end = start + length;
+    if (start > end || start < 0 || end > contentLength) {
+        SWT.error(SWT.ERROR_INVALID_RANGE);
+    }
+    return content.getTextRange(start, length);
+}
+/**
+ * Returns the maximum number of characters that the receiver is capable of holding.
+ *
+ * @return the text limit
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getTextLimit() {
+    checkWidget();
+    return textLimit;
+}
+/**
+ * Gets the top index.
+ * <p>
+ * The top index is the index of the fully visible line that is currently
+ * at the top of the widget or the topmost partially visible line if no line is fully visible.
+ * The top index changes when the widget is scrolled. Indexing is zero based.
+ * </p>
+ *
+ * @return the index of the top line
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getTopIndex() {
+    checkWidget();
+    return topIndex;
+}
+/**
+ * Gets the top pixel.
+ * <p>
+ * The top pixel is the pixel position of the line that is
+ * currently at the top of the widget. The text widget can be scrolled by pixels
+ * by dragging the scroll thumb so that a partial line may be displayed at the top
+ * the widget.  The top pixel changes when the widget is scrolled.  The top pixel
+ * does not include the widget trimming.
+ * </p>
+ *
+ * @return pixel position of the top line
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getTopPixel() {
+    checkWidget();
+    return getVerticalScrollOffset();
+}
+/**
+ * Returns the vertical scroll increment.
+ *
+ * @return vertical scroll increment.
+ */
+int getVerticalIncrement() {
+    return renderer.getLineHeight();
+}
+int getVerticalScrollOffset() {
+    if (verticalScrollOffset is -1) {
+        renderer.calculate(0, topIndex);
+        int height = 0;
+        for (int i = 0; i < topIndex; i++) {
+            height += renderer.getLineHeight(i);
+        }
+        height -= topIndexY;
+        verticalScrollOffset = height;
+    }
+    return verticalScrollOffset;
+}
+int getVisualLineIndex(TextLayout layout, int offsetInLine) {
+    int lineIndex = layout.getLineIndex(offsetInLine);
+    int[] offsets = layout.getLineOffsets();
+    if (lineIndex !is 0 && offsetInLine is offsets[lineIndex]) {
+        int lineY = layout.getLineBounds(lineIndex).y;
+        int caretY = getCaret().getLocation().y - topMargin - getLinePixel(getCaretLine());
+        if (lineY > caretY) lineIndex--;
+    }
+    return lineIndex;
+}
+int getCaretDirection() {
+    if (!isBidiCaret()) return SWT.DEFAULT;
+    if (ime.getCompositionOffset() !is -1) return SWT.DEFAULT;
+    if (!updateCaretDirection && caretDirection !is SWT.NULL) return caretDirection;
+    updateCaretDirection = false;
+    int caretLine = getCaretLine();
+    int lineOffset = content.getOffsetAtLine(caretLine);
+    String line = content.getLine(caretLine);
+    int offset = caretOffset - lineOffset;
+    int lineLength = line.length;
+    if (lineLength is 0) return isMirrored() ? SWT.RIGHT : SWT.LEFT;
+    if (caretAlignment is PREVIOUS_OFFSET_TRAILING && offset > 0) offset--;
+    if (offset is lineLength && offset > 0) offset--;
+    while (offset > 0 && tango.text.Unicode.isDigit(line[offset])) offset--;
+    if (offset is 0 && tango.text.Unicode.isDigit(line[offset])) {
+        return isMirrored() ? SWT.RIGHT : SWT.LEFT;
+    }
+    TextLayout layout = renderer.getTextLayout(caretLine);
+    int level = layout.getLevel(offset);
+    renderer.disposeTextLayout(layout);
+    return ((level & 1) !is 0) ? SWT.RIGHT : SWT.LEFT;
+}
+/*
+ * Returns the index of the line the caret is on.
+ */
+int getCaretLine() {
+    return content.getLineAtOffset(caretOffset);
+}
+int getWrapWidth () {
+    if (wordWrap && !isSingleLine()) {
+        int width = clientAreaWidth - leftMargin - rightMargin - getCaretWidth();
+        return width > 0 ? width : 1;
+    }
+    return -1;
+}
+int getWordNext (int offset, int movement) {
+    int newOffset, lineOffset;
+    String lineText;
+    if (offset >= getCharCount()) {
+        newOffset = offset;
+        int lineIndex = content.getLineCount() - 1;
+        lineOffset = content.getOffsetAtLine(lineIndex);
+        lineText = content.getLine(lineIndex);
+    } else {
+        int lineIndex = content.getLineAtOffset(offset);
+        lineOffset = content.getOffsetAtLine(lineIndex);
+        lineText = content.getLine(lineIndex);
+        int lineLength = lineText.length;
+        if (offset is lineOffset + lineLength) {
+            newOffset = content.getOffsetAtLine(lineIndex + 1);
+        } else {
+            TextLayout layout = renderer.getTextLayout(lineIndex);
+            newOffset = lineOffset + layout.getNextOffset(offset - lineOffset, movement);
+            renderer.disposeTextLayout(layout);
+        }
+    }
+    return sendWordBoundaryEvent(WordNext, movement, offset, newOffset, lineText, lineOffset);
+}
+int getWordPrevious(int offset, int movement) {
+    int newOffset, lineOffset;
+    String lineText;
+    if (offset <= 0) {
+        newOffset = 0;
+        int lineIndex = content.getLineAtOffset(newOffset);
+        lineOffset = content.getOffsetAtLine(lineIndex);
+        lineText = content.getLine(lineIndex);
+    } else {
+        int lineIndex = content.getLineAtOffset(offset);
+        lineOffset = content.getOffsetAtLine(lineIndex);
+        lineText = content.getLine(lineIndex);
+        if (offset is lineOffset) {
+            String nextLineText = content.getLine(lineIndex - 1);
+            int nextLineOffset = content.getOffsetAtLine(lineIndex - 1);
+            newOffset = nextLineOffset + nextLineText.length;
+        } else {
+            TextLayout layout = renderer.getTextLayout(lineIndex);
+            newOffset = lineOffset + layout.getPreviousOffset(offset - lineOffset, movement);
+            renderer.disposeTextLayout(layout);
+        }
+    }
+    return sendWordBoundaryEvent(WordPrevious, movement, offset, newOffset, lineText, lineOffset);
+}
+/**
+ * Returns whether the widget wraps lines.
+ *
+ * @return true if widget wraps lines, false otherwise
+ * @since 2.0
+ */
+public bool getWordWrap() {
+    checkWidget();
+    return wordWrap;
+}
+/**
+ * Returns the location of the given offset.
+ * <p>
+ * <b>NOTE:</b> Does not return correct values for true italic fonts (vs. slanted fonts).
+ * </p>
+ *
+ * @return location of the character at the given offset in the line.
+ */
+Point getPointAtOffset(int offset) {
+    int lineIndex = content.getLineAtOffset(offset);
+    String line = content.getLine(lineIndex);
+    int lineOffset = content.getOffsetAtLine(lineIndex);
+    int offsetInLine = offset - lineOffset;
+    int lineLength = line.length;
+    if (lineIndex < content.getLineCount() - 1) {
+        int endLineOffset = content.getOffsetAtLine(lineIndex + 1) - 1;
+        if (lineLength < offsetInLine && offsetInLine <= endLineOffset) {
+            offsetInLine = lineLength;
+        }
+    }
+    Point point;
+    TextLayout layout = renderer.getTextLayout(lineIndex);
+    if (lineLength !is 0  && offsetInLine <= lineLength) {
+        if (offsetInLine is lineLength) {
+            // SWT: Instead of go back one byte, go back one codepoint
+            int offsetInLine_m1 = layout.getPreviousOffset(offsetInLine, SWT.MOVEMENT_CLUSTER);
+            point = layout.getLocation(offsetInLine_m1, true);
+        } else {
+            switch (caretAlignment) {
+                case OFFSET_LEADING:
+                    point = layout.getLocation(offsetInLine, false);
+                    break;
+                case PREVIOUS_OFFSET_TRAILING:
+                default:
+                    if (offsetInLine is 0) {
+                        point = layout.getLocation(offsetInLine, false);
+                    } else {
+                        // SWT: Instead of go back one byte, go back one codepoint
+                        int offsetInLine_m1 = layout.getPreviousOffset(offsetInLine, SWT.MOVEMENT_CLUSTER);
+                        point = layout.getLocation(offsetInLine_m1, true);
+                    }
+                    break;
+            }
+        }
+    } else {
+        point = new Point(layout.getIndent(), 0);
+    }
+    renderer.disposeTextLayout(layout);
+    point.x += leftMargin - horizontalScrollOffset;
+    point.y += getLinePixel(lineIndex);
+    return point;
+}
+/**
+ * Inserts a string.  The old selection is replaced with the new text.
+ *
+ * @param string the string
+ * @see #replaceTextRange(int,int,String)
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void insert(String string) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+//     if (string is null) {
+//         SWT.error(SWT.ERROR_NULL_ARGUMENT);
+//     }
+    Point sel = getSelectionRange();
+    replaceTextRange(sel.x, sel.y, string);
+}
+/**
+ * Creates content change listeners and set the default content model.
+ */
+void installDefaultContent() {
+    textChangeListener = new class() TextChangeListener {
+        public void textChanging(TextChangingEvent event) {
+            handleTextChanging(event);
+        }
+        public void textChanged(TextChangedEvent event) {
+            handleTextChanged(event);
+        }
+        public void textSet(TextChangedEvent event) {
+            handleTextSet(event);
+        }
+    };
+    content = new DefaultContent();
+    content.addTextChangeListener(textChangeListener);
+}
+/**
+ * Adds event listeners
+ */
+void installListeners() {
+    ScrollBar verticalBar = getVerticalBar();
+    ScrollBar horizontalBar = getHorizontalBar();
+
+    listener = new class() Listener {
+        public void handleEvent(Event event) {
+            switch (event.type) {
+                case SWT.Dispose: handleDispose(event); break;
+                case SWT.KeyDown: handleKeyDown(event); break;
+                case SWT.KeyUp: handleKeyUp(event); break;
+                case SWT.MouseDown: handleMouseDown(event); break;
+                case SWT.MouseUp: handleMouseUp(event); break;
+                case SWT.MouseMove: handleMouseMove(event); break;
+                case SWT.Paint: handlePaint(event); break;
+                case SWT.Resize: handleResize(event); break;
+                case SWT.Traverse: handleTraverse(event); break;
+                default:
+            }
+        }
+    };
+    addListener(SWT.Dispose, listener);
+    addListener(SWT.KeyDown, listener);
+    addListener(SWT.KeyUp, listener);
+    addListener(SWT.MouseDown, listener);
+    addListener(SWT.MouseUp, listener);
+    addListener(SWT.MouseMove, listener);
+    addListener(SWT.Paint, listener);
+    addListener(SWT.Resize, listener);
+    addListener(SWT.Traverse, listener);
+    ime.addListener(SWT.ImeComposition, new class() Listener {
+        public void handleEvent(Event event) {
+            switch (event.detail) {
+                case SWT.COMPOSITION_SELECTION: handleCompositionSelection(event); break;
+                case SWT.COMPOSITION_CHANGED: handleCompositionChanged(event); break;
+                case SWT.COMPOSITION_OFFSET: handleCompositionOffset(event); break;
+                default:
+            }
+        }
+    });
+    if (verticalBar !is null) {
+        verticalBar.addListener(SWT.Selection, new class() Listener {
+            public void handleEvent(Event event) {
+                handleVerticalScroll(event);
+            }
+        });
+    }
+    if (horizontalBar !is null) {
+        horizontalBar.addListener(SWT.Selection, new class() Listener {
+            public void handleEvent(Event event) {
+                handleHorizontalScroll(event);
+            }
+        });
+    }
+}
+void internalRedrawRange(int start, int length) {
+    if (length <= 0) return;
+    int end = start + length;
+    int startLine = content.getLineAtOffset(start);
+    int endLine = content.getLineAtOffset(end);
+    int partialBottomIndex = getPartialBottomIndex();
+    int partialTopIndex = getPartialTopIndex();
+    if (startLine > partialBottomIndex || endLine < partialTopIndex) {
+        return;
+    }
+    if (partialTopIndex > startLine) {
+        startLine = partialTopIndex;
+        start = 0;
+    } else {
+        start -= content.getOffsetAtLine(startLine);
+    }
+    if (partialBottomIndex < endLine) {
+        endLine = partialBottomIndex + 1;
+        end = 0;
+    } else {
+        end -= content.getOffsetAtLine(endLine);
+    }
+
+    TextLayout layout = renderer.getTextLayout(startLine);
+    int lineX = leftMargin - horizontalScrollOffset, startLineY = getLinePixel(startLine);
+    int[] offsets = layout.getLineOffsets();
+    int startIndex = layout.getLineIndex(Math.min(start, layout.getText().length));
+
+    /* Redraw end of line before start line if wrapped and start offset is first char */
+    if (wordWrap && startIndex > 0 && offsets[startIndex] is start) {
+        Rectangle rect = layout.getLineBounds(startIndex - 1);
+        rect.x = rect.width;
+        rect.width = clientAreaWidth - rightMargin - rect.x;
+        rect.x += lineX;
+        rect.y += startLineY;
+        super.redraw(rect.x, rect.y, rect.width, rect.height, false);
+    }
+
+    if (startLine is endLine) {
+        int endIndex = layout.getLineIndex(Math.min(end, layout.getText().length));
+        if (startIndex is endIndex) {
+            /* Redraw rect between start and end offset if start and end offsets are in same wrapped line */
+            Rectangle rect = layout.getBounds(start, end - 1);
+            rect.x += lineX;
+            rect.y += startLineY;
+            super.redraw(rect.x, rect.y, rect.width, rect.height, false);
+            renderer.disposeTextLayout(layout);
+            return;
+        }
+    }
+
+    /* Redraw start line from the start offset to the end of client area */
+    Rectangle startRect = layout.getBounds(start, offsets[startIndex + 1] - 1);
+    if (startRect.height is 0) {
+        Rectangle bounds = layout.getLineBounds(startIndex);
+        startRect.x = bounds.width;
+        startRect.y = bounds.y;
+        startRect.height = bounds.height;
+    }
+    startRect.x += lineX;
+    startRect.y += startLineY;
+    startRect.width = clientAreaWidth - rightMargin - startRect.x;
+    super.redraw(startRect.x, startRect.y, startRect.width, startRect.height, false);
+
+    /* Redraw end line from the beginning of the line to the end offset */
+    if (startLine !is endLine) {
+        renderer.disposeTextLayout(layout);
+        layout = renderer.getTextLayout(endLine);
+        offsets = layout.getLineOffsets();
+    }
+    int endIndex = layout.getLineIndex(Math.min(end, layout.getText().length));
+    Rectangle endRect = layout.getBounds(offsets[endIndex], end - 1);
+    if (endRect.height is 0) {
+        Rectangle bounds = layout.getLineBounds(endIndex);
+        endRect.y = bounds.y;
+        endRect.height = bounds.height;
+    }
+    endRect.x += lineX;
+    endRect.y += getLinePixel(endLine);
+    super.redraw(endRect.x, endRect.y, endRect.width, endRect.height, false);
+    renderer.disposeTextLayout(layout);
+
+    /* Redraw all lines in between start and end line */
+    int y = startRect.y + startRect.height;
+    if (endRect.y > y) {
+        super.redraw(leftMargin, y, clientAreaWidth - rightMargin - leftMargin, endRect.y - y, false);
+    }
+}
+void handleCompositionOffset (Event event) {
+    int[] trailing = new int [1];
+    event.index = getOffsetAtPoint(event.x, event.y, trailing, true);
+    event.count = trailing[0];
+}
+void handleCompositionSelection (Event event) {
+    event.start = selection.x;
+    event.end = selection.y;
+    event.text = getSelectionText();
+}
+void handleCompositionChanged(Event event) {
+    String text = event.text;
+    int start = event.start;
+    int end = event.end;
+    int length = text.length;
+    if (length is ime.getCommitCount()) {
+        content.replaceTextRange(start, end - start, "");
+        caretOffset = ime.getCompositionOffset();
+        caretWidth = 0;
+        caretDirection = SWT.NULL;
+    } else {
+        content.replaceTextRange(start, end - start, text);
+        caretOffset = ime.getCaretOffset();
+        if (ime.getWideCaret()) {
+            start = ime.getCompositionOffset();
+            int lineIndex = getCaretLine();
+            int lineOffset = content.getOffsetAtLine(lineIndex);
+            TextLayout layout = renderer.getTextLayout(lineIndex);
+            caretWidth = layout.getBounds(start - lineOffset, start + length - 1 - lineOffset).width;
+            renderer.disposeTextLayout(layout);
+        }
+    }
+    showCaret();
+}
+/**
+ * Frees resources.
+ */
+void handleDispose(Event event) {
+    removeListener(SWT.Dispose, listener);
+    notifyListeners(SWT.Dispose, event);
+    event.type = SWT.None;
+
+    clipboard.dispose();
+    if (renderer !is null) {
+        renderer.dispose();
+        renderer = null;
+    }
+    if (content !is null) {
+        content.removeTextChangeListener(textChangeListener);
+        content = null;
+    }
+    if (defaultCaret !is null) {
+        defaultCaret.dispose();
+        defaultCaret = null;
+    }
+    if (leftCaretBitmap !is null) {
+        leftCaretBitmap.dispose();
+        leftCaretBitmap = null;
+    }
+    if (rightCaretBitmap !is null) {
+        rightCaretBitmap.dispose();
+        rightCaretBitmap = null;
+    }
+    if (isBidiCaret()) {
+        BidiUtil.removeLanguageListener(this);
+    }
+    selectionBackground = null;
+    selectionForeground = null;
+    textChangeListener = null;
+    selection = null;
+    doubleClickSelection = null;
+    keyActionMap = null;
+    background = null;
+    foreground = null;
+    clipboard = null;
+}
+/**
+ * Scrolls the widget horizontally.
+ */
+void handleHorizontalScroll(Event event) {
+    int scrollPixel = getHorizontalBar().getSelection() - horizontalScrollOffset;
+    scrollHorizontal(scrollPixel, false);
+}
+/**
+ * If an action has been registered for the key stroke execute the action.
+ * Otherwise, if a character has been entered treat it as new content.
+ *
+ * @param event keyboard event
+ */
+void handleKey(Event event) {
+    int action;
+    caretAlignment = PREVIOUS_OFFSET_TRAILING;
+    if (event.keyCode !is 0) {
+        // special key pressed (e.g., F1)
+        action = getKeyBinding(event.keyCode | event.stateMask);
+    } else {
+        // character key pressed
+        action = getKeyBinding(event.character | event.stateMask);
+        if (action is SWT.NULL) {
+            // see if we have a control character
+            if ((event.stateMask & SWT.CTRL) !is 0 && (event.character >= 0) && event.character <= 31) {
+                // get the character from the CTRL+char sequence, the control
+                // key subtracts 64 from the value of the key that it modifies
+                int c = event.character + 64;
+                action = getKeyBinding(c | event.stateMask);
+            }
+        }
+    }
+    if (action is SWT.NULL) {
+        bool ignore = false;
+
+        if (IS_CARBON) {
+            // Ignore accelerator key combinations (we do not want to
+            // insert a character in the text in this instance). Do not
+            // ignore COMMAND+ALT combinations since that key sequence
+            // produces characters on the mac.
+            ignore = (event.stateMask ^ SWT.COMMAND) is 0 ||
+                    (event.stateMask ^ (SWT.COMMAND | SWT.SHIFT)) is 0;
+        } else if (IS_MOTIF) {
+            // Ignore accelerator key combinations (we do not want to
+            // insert a character in the text in this instance). Do not
+            // ignore ALT combinations since this key sequence
+            // produces characters on motif.
+            ignore = (event.stateMask ^ SWT.CTRL) is 0 ||
+                    (event.stateMask ^ (SWT.CTRL | SWT.SHIFT)) is 0;
+        } else {
+            // Ignore accelerator key combinations (we do not want to
+            // insert a character in the text in this instance). Don't
+            // ignore CTRL+ALT combinations since that is the Alt Gr
+            // key on some keyboards.  See bug 20953.
+            ignore = (event.stateMask ^ SWT.ALT) is 0 ||
+                    (event.stateMask ^ SWT.CTRL) is 0 ||
+                    (event.stateMask ^ (SWT.ALT | SWT.SHIFT)) is 0 ||
+                    (event.stateMask ^ (SWT.CTRL | SWT.SHIFT)) is 0;
+        }
+        // -ignore anything below SPACE except for line delimiter keys and tab.
+        // -ignore DEL
+        if (!ignore && event.character > 31 && event.character !is SWT.DEL ||
+            event.character is SWT.CR || event.character is SWT.LF ||
+            event.character is TAB) {
+            doContent(event.character);
+            update();
+        }
+    } else {
+        invokeAction(action);
+    }
+}
+/**
+ * If a VerifyKey listener exists, verify that the key that was entered
+ * should be processed.
+ *
+ * @param event keyboard event
+ */
+void handleKeyDown(Event event) {
+    if (clipboardSelection is null) {
+        clipboardSelection = new Point(selection.x, selection.y);
+    }
+
+    Event verifyEvent = new Event();
+    verifyEvent.character = event.character;
+    verifyEvent.keyCode = event.keyCode;
+    verifyEvent.stateMask = event.stateMask;
+    verifyEvent.doit = true;
+    notifyListeners(VerifyKey, verifyEvent);
+    if (verifyEvent.doit) {
+        handleKey(event);
+    }
+}
+/**
+ * Update the Selection Clipboard.
+ *
+ * @param event keyboard event
+ */
+void handleKeyUp(Event event) {
+    if (clipboardSelection !is null) {
+        if (clipboardSelection.x !is selection.x || clipboardSelection.y !is selection.y) {
+            try {
+                if (selection.y - selection.x > 0) {
+                    setClipboardContent(selection.x, selection.y - selection.x, DND.SELECTION_CLIPBOARD);
+                }
+            } catch (SWTError error) {
+                // Copy to clipboard failed. This happens when another application
+                // is accessing the clipboard while we copy. Ignore the error.
+                // Fixes 1GDQAVN
+                // Rethrow all other errors. Fixes bug 17578.
+                if (error.code !is DND.ERROR_CANNOT_SET_CLIPBOARD) {
+                    throw error;
+                }
+            }
+        }
+    }
+    clipboardSelection = null;
+}
+/**
+ * Updates the caret location and selection if mouse button 1 has been
+ * pressed.
+ */
+void handleMouseDown(Event event) {
+    //force focus (object support)
+    forceFocus();
+
+    //drag detect
+    if (dragDetect_ && checkDragDetect(event)) return;
+
+    //paste clipboard selection
+    if (event.button is 2) {
+        auto o = cast(ArrayWrapperString)getClipboardContent(DND.SELECTION_CLIPBOARD);
+        String text = o.array;
+        if (text !is null && text.length > 0) {
+            // position cursor
+            doMouseLocationChange(event.x, event.y, false);
+            // insert text
+            Event e = new Event();
+            e.start = selection.x;
+            e.end = selection.y;
+            e.text = getModelDelimitedText(text);
+            sendKeyEvent(e);
+        }
+    }
+
+    //set selection
+    if ((event.button !is 1) || (IS_CARBON && (event.stateMask & SWT.MOD4) !is 0)) {
+        return;
+    }
+    clickCount = event.count;
+    if (clickCount is 1) {
+        bool select = (event.stateMask & SWT.MOD2) !is 0;
+        doMouseLocationChange(event.x, event.y, select);
+    } else {
+        if (doubleClickEnabled) {
+            clearSelection(false);
+            int offset = getOffsetAtPoint(event.x, event.y);
+            int lineIndex = content.getLineAtOffset(offset);
+            int lineOffset = content.getOffsetAtLine(lineIndex);
+            int lineEnd = content.getCharCount();
+            if (lineIndex + 1 < content.getLineCount()) {
+                lineEnd = content.getOffsetAtLine(lineIndex + 1);
+            }
+            int start, end;
+            if ((clickCount & 1) is 0) {
+                start = Math.max(0, getWordPrevious(offset, SWT.MOVEMENT_WORD_START));
+                end = Math.min(content.getCharCount(), getWordNext(start, SWT.MOVEMENT_WORD_END));
+            } else {
+                start = lineOffset;
+                end = lineEnd;
+            }
+            caretOffset = start;
+            resetSelection();
+            caretOffset = end;
+            showCaret();
+            doMouseSelection();
+            doubleClickSelection = new Point(selection.x, selection.y);
+        }
+    }
+}
+/**
+ * Updates the caret location and selection if mouse button 1 is pressed
+ * during the mouse move.
+ */
+void handleMouseMove(Event event) {
+    if (clickCount is 0) return;
+    doMouseLocationChange(event.x, event.y, true);
+    update();
+    doAutoScroll(event);
+}
+/**
+ * Autoscrolling ends when the mouse button is released.
+ */
+void handleMouseUp(Event event) {
+    clickCount = 0;
+    endAutoScroll();
+    if (event.button is 1) {
+        try {
+            if (selection.y - selection.x > 0) {
+                setClipboardContent(selection.x, selection.y - selection.x, DND.SELECTION_CLIPBOARD);
+            }
+        } catch (SWTError error) {
+            // Copy to clipboard failed. This happens when another application
+            // is accessing the clipboard while we copy. Ignore the error.
+            // Fixes 1GDQAVN
+            // Rethrow all other errors. Fixes bug 17578.
+            if (error.code !is DND.ERROR_CANNOT_SET_CLIPBOARD) {
+                throw error;
+            }
+        }
+    }
+}
+/**
+ * Renders the invalidated area specified in the paint event.
+ *
+ * @param event paint event
+ */
+void handlePaint(Event event) {
+    if (event.width is 0 || event.height is 0) return;
+    if (clientAreaWidth is 0 || clientAreaHeight is 0) return;
+
+    int startLine = getLineIndex(event.y);
+    int y = getLinePixel(startLine);
+    int endY = event.y + event.height;
+    GC gc = event.gc;
+    Color background = getBackground();
+    Color foreground = getForeground();
+    if (endY > 0) {
+        int lineCount = isSingleLine() ? 1 : content.getLineCount();
+        int x = leftMargin - horizontalScrollOffset;
+        for (int i = startLine; y < endY && i < lineCount; i++) {
+            y += renderer.drawLine(i, x, y, gc, background, foreground);
+        }
+        if (y < endY) {
+            gc.setBackground(background);
+            drawBackground(gc, 0, y, clientAreaWidth, endY - y);
+        }
+    }
+    // fill the margin background
+    gc.setBackground(background);
+    if (topMargin > 0) {
+        drawBackground(gc, 0, 0, clientAreaWidth, topMargin);
+    }
+    if (bottomMargin > 0) {
+        drawBackground(gc, 0, clientAreaHeight - bottomMargin, clientAreaWidth, bottomMargin);
+    }
+    if (leftMargin > 0) {
+        drawBackground(gc, 0, 0, leftMargin, clientAreaHeight);
+    }
+    if (rightMargin > 0) {
+        drawBackground(gc, clientAreaWidth - rightMargin, 0, rightMargin, clientAreaHeight);
+    }
+}
+/**
+ * Recalculates the scroll bars. Rewraps all lines when in word
+ * wrap mode.
+ *
+ * @param event resize event
+ */
+void handleResize(Event event) {
+    int oldHeight = clientAreaHeight;
+    int oldWidth = clientAreaWidth;
+    Rectangle clientArea = getClientArea();
+    clientAreaHeight = clientArea.height;
+    clientAreaWidth = clientArea.width;
+    /* Redraw the old or new right/bottom margin if needed */
+    if (oldWidth !is clientAreaWidth) {
+        if (rightMargin > 0) {
+            int x = (oldWidth < clientAreaWidth ? oldWidth : clientAreaWidth) - rightMargin;
+            super.redraw(x, 0, rightMargin, oldHeight, false);
+        }
+    }
+    if (oldHeight !is clientAreaHeight) {
+        if (bottomMargin > 0) {
+            int y = (oldHeight < clientAreaHeight ? oldHeight : clientAreaHeight) - bottomMargin;
+            super.redraw(0, y, oldWidth, bottomMargin, false);
+        }
+    }
+    if (wordWrap) {
+        if (oldWidth !is clientAreaWidth) {
+            renderer.reset(0, content.getLineCount());
+            verticalScrollOffset = -1;
+            renderer.calculateIdle();
+            super.redraw();
+        }
+        if (oldHeight !is clientAreaHeight) {
+            if (oldHeight is 0) topIndexY = 0;
+            setScrollBars(true);
+        }
+        setCaretLocation();
+    } else  {
+        renderer.calculateClientArea();
+        setScrollBars(true);
+        claimRightFreeSpace();
+        // StyledText allows any value for horizontalScrollOffset when clientArea is zero
+        // in setHorizontalPixel() and setHorisontalOffset(). Fixes bug 168429.
+        if (clientAreaWidth !is 0) {
+            ScrollBar horizontalBar = getHorizontalBar();
+            if (horizontalBar !is null && horizontalBar.getVisible()) {
+                if (horizontalScrollOffset !is horizontalBar.getSelection()) {
+                    horizontalBar.setSelection(horizontalScrollOffset);
+                    horizontalScrollOffset = horizontalBar.getSelection();
+                }
+            }
+        }
+    }
+    claimBottomFreeSpace();
+    //TODO FIX TOP INDEX DURING RESIZE
+//  if (oldHeight !is clientAreaHeight || wordWrap) {
+//      calculateTopIndex(0);
+//  }
+}
+/**
+ * Updates the caret position and selection and the scroll bars to reflect
+ * the content change.
+ */
+void handleTextChanged(TextChangedEvent event) {
+    int offset = ime.getCompositionOffset();
+    if (offset !is -1 && lastTextChangeStart < offset) {
+        ime.setCompositionOffset(offset + lastTextChangeNewCharCount - lastTextChangeReplaceCharCount);
+    }
+    int firstLine = content.getLineAtOffset(lastTextChangeStart);
+    resetCache(firstLine, 0);
+    if (!isFixedLineHeight() && topIndex > firstLine) {
+        topIndex = firstLine;
+        topIndexY = 0;
+        super.redraw();
+    } else {
+        int lastLine = firstLine + lastTextChangeNewLineCount;
+        int firstLineTop = getLinePixel(firstLine);
+        int newLastLineBottom = getLinePixel(lastLine + 1);
+        if (lastLineBottom !is newLastLineBottom) {
+            super.redraw();
+        } else {
+            super.redraw(0, firstLineTop, clientAreaWidth, newLastLineBottom - firstLineTop, false);
+            redrawLinesBullet(renderer.redrawLines);
+        }
+    }
+    renderer.redrawLines = null;
+    // update selection/caret location after styles have been changed.
+    // otherwise any text measuring could be incorrect
+    //
+    // also, this needs to be done after all scrolling. Otherwise,
+    // selection redraw would be flushed during scroll which is wrong.
+    // in some cases new text would be drawn in scroll source area even
+    // though the intent is to scroll it.
+    updateSelection(lastTextChangeStart, lastTextChangeReplaceCharCount, lastTextChangeNewCharCount);
+    if (lastTextChangeReplaceLineCount > 0 || wordWrap) {
+        claimBottomFreeSpace();
+    }
+    if (lastTextChangeReplaceCharCount > 0) {
+        claimRightFreeSpace();
+    }
+}
+/**
+ * Updates the screen to reflect a pending content change.
+ *
+ * @param event .start the start offset of the change
+ * @param event .newText text that is going to be inserted or empty String
+ *  if no text will be inserted
+ * @param event .replaceCharCount length of text that is going to be replaced
+ * @param event .newCharCount length of text that is going to be inserted
+ * @param event .replaceLineCount number of lines that are going to be replaced
+ * @param event .newLineCount number of new lines that are going to be inserted
+ */
+void handleTextChanging(TextChangingEvent event) {
+    if (event.replaceCharCount < 0) {
+        event.start += event.replaceCharCount;
+        event.replaceCharCount *= -1;
+    }
+    lastTextChangeStart = event.start;
+    lastTextChangeNewLineCount = event.newLineCount;
+    lastTextChangeNewCharCount = event.newCharCount;
+    lastTextChangeReplaceLineCount = event.replaceLineCount;
+    lastTextChangeReplaceCharCount = event.replaceCharCount;
+    int lineIndex = content.getLineAtOffset(event.start);
+    int srcY = getLinePixel(lineIndex + event.replaceLineCount + 1);
+    int destY = getLinePixel(lineIndex + 1) + event.newLineCount * renderer.getLineHeight();
+    lastLineBottom = destY;
+    if (srcY < 0 && destY < 0) {
+        lastLineBottom += srcY - destY;
+        verticalScrollOffset += destY - srcY;
+        calculateTopIndex(destY - srcY);
+        setScrollBars(true);
+    } else {
+        scrollText(srcY, destY);
+    }
+
+    renderer.textChanging(event);
+
+    // Update the caret offset if it is greater than the length of the content.
+    // This is necessary since style range API may be called between the
+    // handleTextChanging and handleTextChanged events and this API sets the
+    // caretOffset.
+    int newEndOfText = content.getCharCount() - event.replaceCharCount + event.newCharCount;
+    if (caretOffset > newEndOfText) caretOffset = newEndOfText;
+}
+/**
+ * Called when the widget content is set programmatically, overwriting
+ * the old content. Resets the caret position, selection and scroll offsets.
+ * Recalculates the content width and scroll bars. Redraws the widget.
+ *
+ * @param event text change event.
+ */
+void handleTextSet(TextChangedEvent event) {
+    reset();
+}
+/**
+ * Called when a traversal key is pressed.
+ * Allow tab next traversal to occur when the widget is in single
+ * line mode or in multi line and non-editable mode .
+ * When in editable multi line mode we want to prevent the tab
+ * traversal and receive the tab key event instead.
+ *
+ * @param event the event
+ */
+void handleTraverse(Event event) {
+    switch (event.detail) {
+        case SWT.TRAVERSE_ESCAPE:
+        case SWT.TRAVERSE_PAGE_NEXT:
+        case SWT.TRAVERSE_PAGE_PREVIOUS:
+            event.doit = true;
+            break;
+        case SWT.TRAVERSE_RETURN:
+        case SWT.TRAVERSE_TAB_NEXT:
+        case SWT.TRAVERSE_TAB_PREVIOUS:
+            if ((getStyle() & SWT.SINGLE) !is 0) {
+                event.doit = true;
+            } else {
+                if (!editable || (event.stateMask & SWT.MODIFIER_MASK) !is 0) {
+                    event.doit = true;
+                }
+            }
+            break;
+        default:
+    }
+}
+/**
+ * Scrolls the widget vertically.
+ */
+void handleVerticalScroll(Event event) {
+    int scrollPixel = getVerticalBar().getSelection() - getVerticalScrollOffset();
+    scrollVertical(scrollPixel, false);
+}
+/**
+ * Add accessibility support for the widget.
+ */
+void initializeAccessible() {
+    final Accessible accessible = getAccessible();
+    accessible.addAccessibleListener(new class() AccessibleAdapter {
+        public void getName (AccessibleEvent e) {
+            String name = null;
+            Label label = getAssociatedLabel ();
+            if (label !is null) {
+                name = stripMnemonic (label.getText());
+            }
+            e.result = name;
+        }
+        public void getHelp(AccessibleEvent e) {
+            e.result = getToolTipText();
+        }
+        public void getKeyboardShortcut(AccessibleEvent e) {
+            String shortcut = null;
+            Label label = getAssociatedLabel ();
+            if (label !is null) {
+                String text = label.getText ();
+                if (text !is null) {
+                    dchar mnemonic = _findMnemonic (text);
+                    if (mnemonic !is '\0') {
+                        shortcut = "Alt+"~tango.text.convert.Utf.toString( [mnemonic] ); //$NON-NLS-1$
+                    }
+                }
+            }
+            e.result = shortcut;
+        }
+    });
+    accessible.addAccessibleTextListener(new class() AccessibleTextAdapter {
+        public void getCaretOffset(AccessibleTextEvent e) {
+            e.offset = this.outer.getCaretOffset();
+        }
+        public void getSelectionRange(AccessibleTextEvent e) {
+            Point selection = this.outer.getSelectionRange();
+            e.offset = selection.x;
+            e.length = selection.y;
+        }
+    });
+    accessible.addAccessibleControlListener(new class() AccessibleControlAdapter {
+        public void getRole(AccessibleControlEvent e) {
+            e.detail = ACC.ROLE_TEXT;
+        }
+        public void getState(AccessibleControlEvent e) {
+            int state = 0;
+            if (isEnabled()) state |= ACC.STATE_FOCUSABLE;
+            if (isFocusControl()) state |= ACC.STATE_FOCUSED;
+            if (!isVisible()) state |= ACC.STATE_INVISIBLE;
+            if (!getEditable()) state |= ACC.STATE_READONLY;
+            e.detail = state;
+        }
+        public void getValue(AccessibleControlEvent e) {
+            e.result = this.outer.getText();
+        }
+    });
+    addListener(SWT.FocusIn, new class(accessible) Listener {
+        Accessible acc;
+        this( Accessible acc ){ this.acc = acc; }
+        public void handleEvent(Event event) {
+            acc.setFocus(ACC.CHILDID_SELF);
+        }
+    });
+}
+/*
+ * Return the Label immediately preceding the receiver in the z-order,
+ * or null if none.
+ */
+Label getAssociatedLabel () {
+    Control[] siblings = getParent ().getChildren ();
+    for (int i = 0; i < siblings.length; i++) {
+        if (siblings [i] is this) {
+            if (i > 0 && ( null !is cast(Label)siblings [i-1])) {
+                return cast(Label) siblings [i-1];
+            }
+        }
+    }
+    return null;
+}
+String stripMnemonic (String string) {
+    int index = 0;
+    int length_ = string.length;
+    do {
+        while ((index < length_) && (string[index] !is '&')) index++;
+        if (++index >= length_) return string;
+        if (string[index] !is '&') {
+            return string.substring(0, index-1) ~ string.substring(index, length_);
+        }
+        index++;
+    } while (index < length_);
+    return string;
+}
+/*
+ * Return the lowercase of the first non-'&' character following
+ * an '&' character in the given string. If there are no '&'
+ * characters in the given string, return '\0'.
+ */
+dchar _findMnemonic (String string) {
+    if (string is null) return '\0';
+    int index = 0;
+    int length_ = string.length;
+    do {
+        while (index < length_ && string[index] !is '&') index++;
+        if (++index >= length_) return '\0';
+        if (string[index] !is '&') return CharacterFirstToLower(string[index .. $ ] );
+        index++;
+    } while (index < length_);
+    return '\0';
+}
+/**
+ * Executes the action.
+ *
+ * @param action one of the actions defined in ST.java
+ */
+public void invokeAction(int action) {
+    checkWidget();
+    updateCaretDirection = true;
+    switch (action) {
+        // Navigation
+        case ST.LINE_UP:
+            doLineUp(false);
+            clearSelection(true);
+            break;
+        case ST.LINE_DOWN:
+            doLineDown(false);
+            clearSelection(true);
+            break;
+        case ST.LINE_START:
+            doLineStart();
+            clearSelection(true);
+            break;
+        case ST.LINE_END:
+            doLineEnd();
+            clearSelection(true);
+            break;
+        case ST.COLUMN_PREVIOUS:
+            doCursorPrevious();
+            clearSelection(true);
+            break;
+        case ST.COLUMN_NEXT:
+            doCursorNext();
+            clearSelection(true);
+            break;
+        case ST.PAGE_UP:
+            doPageUp(false, -1);
+            clearSelection(true);
+            break;
+        case ST.PAGE_DOWN:
+            doPageDown(false, -1);
+            clearSelection(true);
+            break;
+        case ST.WORD_PREVIOUS:
+            doWordPrevious();
+            clearSelection(true);
+            break;
+        case ST.WORD_NEXT:
+            doWordNext();
+            clearSelection(true);
+            break;
+        case ST.TEXT_START:
+            doContentStart();
+            clearSelection(true);
+            break;
+        case ST.TEXT_END:
+            doContentEnd();
+            clearSelection(true);
+            break;
+        case ST.WINDOW_START:
+            doPageStart();
+            clearSelection(true);
+            break;
+        case ST.WINDOW_END:
+            doPageEnd();
+            clearSelection(true);
+            break;
+        // Selection
+        case ST.SELECT_LINE_UP:
+            doSelectionLineUp();
+            break;
+        case ST.SELECT_ALL:
+            selectAll();
+            break;
+        case ST.SELECT_LINE_DOWN:
+            doSelectionLineDown();
+            break;
+        case ST.SELECT_LINE_START:
+            doLineStart();
+            doSelection(ST.COLUMN_PREVIOUS);
+            break;
+        case ST.SELECT_LINE_END:
+            doLineEnd();
+            doSelection(ST.COLUMN_NEXT);
+            break;
+        case ST.SELECT_COLUMN_PREVIOUS:
+            doSelectionCursorPrevious();
+            doSelection(ST.COLUMN_PREVIOUS);
+            break;
+        case ST.SELECT_COLUMN_NEXT:
+            doSelectionCursorNext();
+            doSelection(ST.COLUMN_NEXT);
+            break;
+        case ST.SELECT_PAGE_UP:
+            doSelectionPageUp(-1);
+            break;
+        case ST.SELECT_PAGE_DOWN:
+            doSelectionPageDown(-1);
+            break;
+        case ST.SELECT_WORD_PREVIOUS:
+            doSelectionWordPrevious();
+            doSelection(ST.COLUMN_PREVIOUS);
+            break;
+        case ST.SELECT_WORD_NEXT:
+            doSelectionWordNext();
+            doSelection(ST.COLUMN_NEXT);
+            break;
+        case ST.SELECT_TEXT_START:
+            doContentStart();
+            doSelection(ST.COLUMN_PREVIOUS);
+            break;
+        case ST.SELECT_TEXT_END:
+            doContentEnd();
+            doSelection(ST.COLUMN_NEXT);
+            break;
+        case ST.SELECT_WINDOW_START:
+            doPageStart();
+            doSelection(ST.COLUMN_PREVIOUS);
+            break;
+        case ST.SELECT_WINDOW_END:
+            doPageEnd();
+            doSelection(ST.COLUMN_NEXT);
+            break;
+        // Modification
+        case ST.CUT:
+            cut();
+            break;
+        case ST.COPY:
+            copy();
+            break;
+        case ST.PASTE:
+            paste();
+            break;
+        case ST.DELETE_PREVIOUS:
+            doBackspace();
+            break;
+        case ST.DELETE_NEXT:
+            doDelete();
+            break;
+        case ST.DELETE_WORD_PREVIOUS:
+            doDeleteWordPrevious();
+            break;
+        case ST.DELETE_WORD_NEXT:
+            doDeleteWordNext();
+            break;
+        // Miscellaneous
+        case ST.TOGGLE_OVERWRITE:
+            overwrite = !overwrite;     // toggle insert/overwrite mode
+            break;
+        default:
+    }
+}
+/**
+ * Temporary until SWT provides this
+ */
+bool isBidi() {
+    return IS_GTK || IS_CARBON || BidiUtil.isBidiPlatform() || isMirrored_;
+}
+bool isBidiCaret() {
+    return BidiUtil.isBidiPlatform();
+}
+bool isFixedLineHeight() {
+    return fixedLineHeight;
+}
+/**
+ * Returns whether the given offset is inside a multi byte line delimiter.
+ * Example:
+ * "Line1\r\n" isLineDelimiter(5) is false but isLineDelimiter(6) is true
+ *
+ * @return true if the given offset is inside a multi byte line delimiter.
+ * false if the given offset is before or after a line delimiter.
+ */
+bool isLineDelimiter(int offset) {
+    int line = content.getLineAtOffset(offset);
+    int lineOffset = content.getOffsetAtLine(line);
+    int offsetInLine = offset - lineOffset;
+    // offsetInLine will be greater than line length if the line
+    // delimiter is longer than one character and the offset is set
+    // in between parts of the line delimiter.
+    return offsetInLine > content.getLine(line).length;
+}
+/**
+ * Returns whether the widget is mirrored (right oriented/right to left
+ * writing order).
+ *
+ * @return isMirrored true=the widget is right oriented, false=the widget
+ *  is left oriented
+ */
+bool isMirrored() {
+    return isMirrored_;
+}
+/**
+ * Returns whether the widget can have only one line.
+ *
+ * @return true if widget can have only one line, false if widget can have
+ *  multiple lines
+ */
+bool isSingleLine() {
+    return (getStyle() & SWT.SINGLE) !is 0;
+}
+/**
+ * Sends the specified verify event, replace/insert text as defined by
+ * the event and send a modify event.
+ *
+ * @param event the text change event.
+ *  <ul>
+ *  <li>event.start - the replace start offset</li>
+ *  <li>event.end - the replace end offset</li>
+ *  <li>event.text - the new text</li>
+ *  </ul>
+ * @param updateCaret whether or not he caret should be set behind
+ *  the new text
+ */
+void modifyContent(Event event, bool updateCaret) {
+    event.doit = true;
+    notifyListeners(SWT.Verify, event);
+    if (event.doit) {
+        StyledTextEvent styledTextEvent = null;
+        int replacedLength = event.end - event.start;
+        if (isListening(ExtendedModify)) {
+            styledTextEvent = new StyledTextEvent(content);
+            styledTextEvent.start = event.start;
+            styledTextEvent.end = event.start + event.text.length;
+            styledTextEvent.text = content.getTextRange(event.start, replacedLength);
+        }
+        if (updateCaret) {
+            //Fix advancing flag for delete/backspace key on direction boundary
+            if (event.text.length is 0) {
+                int lineIndex = content.getLineAtOffset(event.start);
+                int lineOffset = content.getOffsetAtLine(lineIndex);
+                TextLayout layout = renderer.getTextLayout(lineIndex);
+                int levelStart = layout.getLevel(event.start - lineOffset);
+                int lineIndexEnd = content.getLineAtOffset(event.end);
+                if (lineIndex !is lineIndexEnd) {
+                    renderer.disposeTextLayout(layout);
+                    lineOffset = content.getOffsetAtLine(lineIndexEnd);
+                    layout = renderer.getTextLayout(lineIndexEnd);
+                }
+                int levelEnd = layout.getLevel(event.end - lineOffset);
+                renderer.disposeTextLayout(layout);
+                if (levelStart !is levelEnd) {
+                    caretAlignment = PREVIOUS_OFFSET_TRAILING;
+                } else {
+                    caretAlignment = OFFSET_LEADING;
+                }
+            }
+        }
+        content.replaceTextRange(event.start, replacedLength, event.text);
+        // set the caret position prior to sending the modify event.
+        // fixes 1GBB8NJ
+        if (updateCaret) {
+            // always update the caret location. fixes 1G8FODP
+            setSelection(event.start + event.text.length, 0, true);
+            showCaret();
+        }
+        sendModifyEvent(event);
+        if (isListening(ExtendedModify)) {
+            notifyListeners(ExtendedModify, styledTextEvent);
+        }
+    }
+}
+void paintObject(GC gc, int x, int y, int ascent, int descent, StyleRange style, Bullet bullet, int bulletIndex) {
+    if (isListening(PaintObject)) {
+        StyledTextEvent event = new StyledTextEvent (content) ;
+        event.gc = gc;
+        event.x = x;
+        event.y = y;
+        event.ascent = ascent;
+        event.descent = descent;
+        event.style = style;
+        event.bullet = bullet;
+        event.bulletIndex = bulletIndex;
+        notifyListeners(PaintObject, event);
+    }
+}
+/**
+ * Replaces the selection with the text on the <code>DND.CLIPBOARD</code>
+ * clipboard  or, if there is no selection,  inserts the text at the current
+ * caret offset.   If the widget has the SWT.SINGLE style and the
+ * clipboard text contains more than one line, only the first line without
+ * line delimiters is  inserted in the widget.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void paste(){
+    checkWidget();
+    String text = null;
+    if( auto o = cast(ArrayWrapperString) getClipboardContent(DND.CLIPBOARD)){
+        text = o.array;
+    }
+    if (text !is null && text.length > 0) {
+        Event event = new Event();
+        event.start = selection.x;
+        event.end = selection.y;
+        event.text = getModelDelimitedText(text);
+        sendKeyEvent(event);
+    }
+}
+/**
+ * Prints the widget's text to the default printer.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void print() {
+    checkWidget();
+    Printer printer = new Printer();
+    StyledTextPrintOptions options = new StyledTextPrintOptions();
+    options.printTextForeground = true;
+    options.printTextBackground = true;
+    options.printTextFontStyle = true;
+    options.printLineBackground = true;
+    (new Printing(this, printer, options)).run();
+    printer.dispose();
+}
+/**
+ * Returns a runnable that will print the widget's text
+ * to the specified printer.
+ * <p>
+ * The runnable may be run in a non-UI thread.
+ * </p>
+ *
+ * @param printer the printer to print to
+ *
+ * @return a <code>Runnable</code> for printing the receiver's text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when printer is null</li>
+ * </ul>
+ */
+public Runnable print(Printer printer) {
+    checkWidget();
+    if (printer is null) {
+        SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    }
+    StyledTextPrintOptions options = new StyledTextPrintOptions();
+    options.printTextForeground = true;
+    options.printTextBackground = true;
+    options.printTextFontStyle = true;
+    options.printLineBackground = true;
+    return print(printer, options);
+}
+/**
+ * Returns a runnable that will print the widget's text
+ * to the specified printer.
+ * <p>
+ * The runnable may be run in a non-UI thread.
+ * </p>
+ *
+ * @param printer the printer to print to
+ * @param options print options to use during printing
+ *
+ * @return a <code>Runnable</code> for printing the receiver's text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when printer or options is null</li>
+ * </ul>
+ * @since 2.1
+ */
+public Runnable print(Printer printer, StyledTextPrintOptions options) {
+    checkWidget();
+    if (printer is null || options is null) {
+        SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    }
+    return new Printing(this, printer, options);
+}
+/**
+ * Causes the entire bounds of the receiver to be marked
+ * as needing to be redrawn. The next time a paint request
+ * is processed, the control will be completely painted.
+ * <p>
+ * Recalculates the content width for all lines in the bounds.
+ * When a <code>LineStyleListener</code> is used a redraw call
+ * is the only notification to the widget that styles have changed
+ * and that the content width may have changed.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Control#update()
+ */
+public override void redraw() {
+    super.redraw();
+    int itemCount = getPartialBottomIndex() - topIndex + 1;
+    renderer.reset(topIndex, itemCount);
+    renderer.calculate(topIndex, itemCount);
+    setScrollBars(false);
+}
+/**
+ * Causes the rectangular area of the receiver specified by
+ * the arguments to be marked as needing to be redrawn.
+ * The next time a paint request is processed, that area of
+ * the receiver will be painted. If the <code>all</code> flag
+ * is <code>true</code>, any children of the receiver which
+ * intersect with the specified area will also paint their
+ * intersecting areas. If the <code>all</code> flag is
+ * <code>false</code>, the children will not be painted.
+ * <p>
+ * Marks the content width of all lines in the specified rectangle
+ * as unknown. Recalculates the content width of all visible lines.
+ * When a <code>LineStyleListener</code> is used a redraw call
+ * is the only notification to the widget that styles have changed
+ * and that the content width may have changed.
+ * </p>
+ *
+ * @param x the x coordinate of the area to draw
+ * @param y the y coordinate of the area to draw
+ * @param width the width of the area to draw
+ * @param height the height of the area to draw
+ * @param all <code>true</code> if children should redraw, and <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Control#update()
+ */
+public override void redraw(int x, int y, int width, int height, bool all) {
+    super.redraw(x, y, width, height, all);
+    if (height > 0) {
+        int firstLine = getLineIndex(y);
+        int lastLine = getLineIndex(y + height);
+        resetCache(firstLine, lastLine - firstLine + 1);
+    }
+}
+void redrawLines(int startLine, int lineCount) {
+    // do nothing if redraw range is completely invisible
+    int partialBottomIndex = getPartialBottomIndex();
+    if (startLine > partialBottomIndex || startLine + lineCount - 1 < topIndex) {
+        return;
+    }
+    // only redraw visible lines
+    if (startLine < topIndex) {
+        lineCount -= topIndex - startLine;
+        startLine = topIndex;
+    }
+    if (startLine + lineCount - 1 > partialBottomIndex) {
+        lineCount = partialBottomIndex - startLine + 1;
+    }
+    startLine -= topIndex;
+    int redrawTop = getLinePixel(startLine);
+    int redrawBottom = getLinePixel(startLine + lineCount);
+    int redrawWidth = clientAreaWidth - leftMargin - rightMargin;
+    super.redraw(leftMargin, redrawTop, redrawWidth, redrawBottom - redrawTop, true);
+}
+void redrawLinesBullet (int[] redrawLines) {
+    if (redrawLines is null) return;
+    int topIndex = getPartialTopIndex();
+    int bottomIndex = getPartialBottomIndex();
+    for (int i = 0; i < redrawLines.length; i++) {
+        int lineIndex = redrawLines[i];
+        if (!(topIndex <= lineIndex && lineIndex <= bottomIndex)) continue;
+        int width = -1;
+        Bullet bullet = renderer.getLineBullet(lineIndex, null);
+        if (bullet !is null) {
+            StyleRange style = bullet.style;
+            GlyphMetrics metrics = style.metrics;
+            width = metrics.width;
+        }
+        if (width is -1) width = getClientArea().width;
+        int height = renderer.getLineHeight(lineIndex);
+        int y = getLinePixel(lineIndex);
+        super.redraw(0, y, width, height, false);
+    }
+}
+/**
+ * Redraws the specified text range.
+ *
+ * @param start offset of the first character to redraw
+ * @param length number of characters to redraw
+ * @param clearBackground true if the background should be cleared as
+ *  part of the redraw operation.  If true, the entire redraw range will
+ *  be cleared before anything is redrawn.  If the redraw range includes
+ *  the last character of a line (i.e., the entire line is redrawn) the
+ *  line is cleared all the way to the right border of the widget.
+ *  The redraw operation will be faster and smoother if clearBackground
+ *  is set to false.  Whether or not the flag can be set to false depends
+ *  on the type of change that has taken place.  If font styles or
+ *  background colors for the redraw range have changed, clearBackground
+ *  should be set to true.  If only foreground colors have changed for
+ *  the redraw range, clearBackground can be set to false.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_INVALID_RANGE when start and/or end are outside the widget content</li>
+ * </ul>
+ */
+public void redrawRange(int start, int length, bool clearBackground) {
+    checkWidget();
+    int end = start + length;
+    int contentLength = content.getCharCount();
+    if (start > end || start < 0 || end > contentLength) {
+        SWT.error(SWT.ERROR_INVALID_RANGE);
+    }
+    int firstLine = content.getLineAtOffset(start);
+    int lastLine = content.getLineAtOffset(end);
+    resetCache(firstLine, lastLine - firstLine + 1);
+    internalRedrawRange(start, length);
+}
+/**
+ * Removes the specified bidirectional segment listener.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when listener is null</li>
+ * </ul>
+ *
+ * @since 2.0
+ */
+public void removeBidiSegmentListener(BidiSegmentListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    removeListener(LineGetSegments, listener);
+}
+/**
+ * Removes the specified extended modify listener.
+ *
+ * @param extendedModifyListener the listener which should no longer be notified
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when listener is null</li>
+ * </ul>
+ */
+public void removeExtendedModifyListener(ExtendedModifyListener extendedModifyListener) {
+    checkWidget();
+    if (extendedModifyListener is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    removeListener(ExtendedModify, extendedModifyListener);
+}
+/**
+ * Removes the specified line background listener.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when listener is null</li>
+ * </ul>
+ */
+public void removeLineBackgroundListener(LineBackgroundListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    removeListener(LineGetBackground, listener);
+}
+/**
+ * Removes the specified line style listener.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when listener is null</li>
+ * </ul>
+ */
+public void removeLineStyleListener(LineStyleListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    removeListener(LineGetStyle, listener);
+}
+/**
+ * Removes the specified modify listener.
+ *
+ * @param modifyListener the listener which should no longer be notified
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when listener is null</li>
+ * </ul>
+ */
+public void removeModifyListener(ModifyListener modifyListener) {
+    checkWidget();
+    if (modifyListener is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    removeListener(SWT.Modify, modifyListener);
+}
+/**
+ * Removes the specified listener.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when listener is null</li>
+ * </ul>
+ * @since 3.2
+ */
+public void removePaintObjectListener(PaintObjectListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    removeListener(PaintObject, listener);
+}
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the user changes the receiver's selection.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener(SelectionListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    removeListener(SWT.Selection, listener);
+}
+/**
+ * Removes the specified verify listener.
+ *
+ * @param verifyListener the listener which should no longer be notified
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when listener is null</li>
+ * </ul>
+ */
+public void removeVerifyListener(VerifyListener verifyListener) {
+    checkWidget();
+    if (verifyListener is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    removeListener(SWT.Verify, verifyListener);
+}
+/**
+ * Removes the specified key verify listener.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when listener is null</li>
+ * </ul>
+ */
+public void removeVerifyKeyListener(VerifyKeyListener listener) {
+    if (listener is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    removeListener(VerifyKey, listener);
+}
+/**
+ * Removes the specified word movement listener.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when listener is null</li>
+ * </ul>
+ *
+ * @see MovementEvent
+ * @see MovementListener
+ * @see #addWordMovementListener
+ *
+ * @since 3.3
+ */
+
+public void removeWordMovementListener(MovementListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    removeListener(WordNext, listener);
+    removeListener(WordPrevious, listener);
+}
+/**
+ * Replaces the styles in the given range with new styles.  This method
+ * effectively deletes the styles in the given range and then adds the
+ * the new styles.
+ * <p>
+ * Note: Because a StyleRange includes the start and length, the
+ * same instance cannot occur multiple times in the array of styles.
+ * If the same style attributes, such as font and color, occur in
+ * multiple StyleRanges, <code>setStyleRanges(int, int, int[], StyleRange[])</code>
+ * can be used to share styles and reduce memory usage.
+ * </p><p>
+ * Should not be called if a LineStyleListener has been set since the
+ * listener maintains the styles.
+ * </p>
+ *
+ * @param start offset of first character where styles will be deleted
+ * @param length length of the range to delete styles in
+ * @param ranges StyleRange objects containing the new style information.
+ * The ranges should not overlap and should be within the specified start
+ * and length. The style rendering is undefined if the ranges do overlap
+ * or are ill-defined. Must not be null.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_INVALID_RANGE when either start or end is outside the valid range (0 <= offset <= getCharCount())</li>
+ * </ul>
+ *
+ * @since 2.0
+ *
+ * @see #setStyleRanges(int, int, int[], StyleRange[])
+ */
+public void replaceStyleRanges(int start, int length, StyleRange[] ranges) {
+    checkWidget();
+    if (isListening(LineGetStyle)) return;
+    // SWT extension: allow null for zero length string
+    //if (ranges is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    setStyleRanges(start, length, null, ranges, false);
+}
+/**
+ * Replaces the given text range with new text.
+ * If the widget has the SWT.SINGLE style and "text" contains more than
+ * one line, only the first line is rendered but the text is stored
+ * unchanged. A subsequent call to getText will return the same text
+ * that was set. Note that only a single line of text should be set when
+ * the SWT.SINGLE style is used.
+ * <p>
+ * <b>NOTE:</b> During the replace operation the current selection is
+ * changed as follows:
+ * <ul>
+ * <li>selection before replaced text: selection unchanged
+ * <li>selection after replaced text: adjust the selection so that same text
+ * remains selected
+ * <li>selection intersects replaced text: selection is cleared and caret
+ * is placed after inserted text
+ * </ul>
+ * </p>
+ *
+ * @param start offset of first character to replace
+ * @param length number of characters to replace. Use 0 to insert text
+ * @param text new text. May be empty to delete text.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_INVALID_RANGE when either start or end is outside the valid range (0 <= offset <= getCharCount())</li>
+ *   <li>ERROR_INVALID_ARGUMENT when either start or end is inside a multi byte line delimiter.
+ *      Splitting a line delimiter for example by inserting text in between the CR and LF and deleting part of a line delimiter is not supported</li>
+ * </ul>
+ */
+public void replaceTextRange(int start, int length, String text) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+//     if (text is null) {
+//         SWT.error(SWT.ERROR_NULL_ARGUMENT);
+//     }
+    int contentLength = getCharCount();
+    int end = start + length;
+    if (start > end || start < 0 || end > contentLength) {
+        SWT.error(SWT.ERROR_INVALID_RANGE);
+    }
+    Event event = new Event();
+    event.start = start;
+    event.end = end;
+    event.text = text;
+    modifyContent(event, false);
+}
+/**
+ * Resets the caret position, selection and scroll offsets. Recalculate
+ * the content width and scroll bars. Redraw the widget.
+ */
+void reset() {
+    ScrollBar verticalBar = getVerticalBar();
+    ScrollBar horizontalBar = getHorizontalBar();
+    caretOffset = 0;
+    topIndex = 0;
+    topIndexY = 0;
+    verticalScrollOffset = 0;
+    horizontalScrollOffset = 0;
+    resetSelection();
+    renderer.setContent(content);
+    if (verticalBar !is null) {
+        verticalBar.setSelection(0);
+    }
+    if (horizontalBar !is null) {
+        horizontalBar.setSelection(0);
+    }
+    resetCache(0, 0);
+    setCaretLocation();
+    super.redraw();
+}
+void resetCache(int firstLine, int count) {
+    int maxLineIndex = renderer.maxWidthLineIndex;
+    renderer.reset(firstLine, count);
+    renderer.calculateClientArea();
+    if (0 <= maxLineIndex && maxLineIndex < content.getLineCount()) {
+        renderer.calculate(maxLineIndex, 1);
+    }
+    setScrollBars(true);
+    if (!isFixedLineHeight()) {
+        if (topIndex > firstLine) {
+            verticalScrollOffset = -1;
+        }
+        renderer.calculateIdle();
+    }
+}
+/**
+ * Resets the selection.
+ */
+void resetSelection() {
+    selection.x = selection.y = caretOffset;
+    selectionAnchor = -1;
+}
+
+public override void scroll(int destX, int destY, int x, int y, int width, int height, bool all) {
+    super.scroll(destX, destY, x, y, width, height, false);
+    if (all) {
+        int deltaX = destX - x, deltaY = destY - y;
+        Control[] children = getChildren();
+        for (int i=0; i<children.length; i++) {
+            Control child = children[i];
+            Rectangle rect = child.getBounds();
+            child.setLocation(rect.x + deltaX, rect.y + deltaY);
+        }
+    }
+}
+
+/**
+ * Scrolls the widget horizontally.
+ *
+ * @param pixels number of pixels to scroll, > 0 = scroll left,
+ *  < 0 scroll right
+ * @param adjustScrollBar
+ *  true= the scroll thumb will be moved to reflect the new scroll offset.
+ *  false = the scroll thumb will not be moved
+ * @return
+ *  true=the widget was scrolled
+ *  false=the widget was not scrolled, the given offset is not valid.
+ */
+bool scrollHorizontal(int pixels, bool adjustScrollBar) {
+    if (pixels is 0) {
+        return false;
+    }
+    ScrollBar horizontalBar = getHorizontalBar();
+    if (horizontalBar !is null && adjustScrollBar) {
+        horizontalBar.setSelection(horizontalScrollOffset + pixels);
+    }
+    int scrollHeight = clientAreaHeight - topMargin - bottomMargin;
+    if (pixels > 0) {
+        int sourceX = leftMargin + pixels;
+        int scrollWidth = clientAreaWidth - sourceX - rightMargin;
+        if (scrollWidth > 0) {
+            scroll(leftMargin, topMargin, sourceX, topMargin, scrollWidth, scrollHeight, true);
+        }
+        if (sourceX > scrollWidth) {
+            super.redraw(leftMargin + scrollWidth, topMargin, pixels - scrollWidth, scrollHeight, true);
+        }
+    } else {
+        int destinationX = leftMargin - pixels;
+        int scrollWidth = clientAreaWidth - destinationX - rightMargin;
+        if (scrollWidth > 0) {
+            scroll(destinationX, topMargin, leftMargin, topMargin, scrollWidth, scrollHeight, true);
+        }
+        if (destinationX > scrollWidth) {
+            super.redraw(leftMargin + scrollWidth, topMargin, -pixels - scrollWidth, scrollHeight, true);
+        }
+    }
+    horizontalScrollOffset += pixels;
+    setCaretLocation();
+    return true;
+}
+/**
+ * Scrolls the widget vertically.
+ *
+ * @param pixel the new vertical scroll offset
+ * @param adjustScrollBar
+ *  true= the scroll thumb will be moved to reflect the new scroll offset.
+ *  false = the scroll thumb will not be moved
+ * @return
+ *  true=the widget was scrolled
+ *  false=the widget was not scrolled
+ */
+bool scrollVertical(int pixels, bool adjustScrollBar) {
+    if (pixels is 0) {
+        return false;
+    }
+    if (verticalScrollOffset !is -1) {
+        ScrollBar verticalBar = getVerticalBar();
+        if (verticalBar !is null && adjustScrollBar) {
+            verticalBar.setSelection(verticalScrollOffset + pixels);
+        }
+        int scrollWidth = clientAreaWidth - leftMargin - rightMargin;
+        if (pixels > 0) {
+            int sourceY = topMargin + pixels;
+            int scrollHeight = clientAreaHeight - sourceY - bottomMargin;
+            if (scrollHeight > 0) {
+                scroll(leftMargin, topMargin, leftMargin, sourceY, scrollWidth, scrollHeight, true);
+            }
+            if (sourceY > scrollHeight) {
+                int redrawY = Math.max(0, topMargin + scrollHeight);
+                int redrawHeight = Math.min(clientAreaHeight, pixels - scrollHeight);
+                super.redraw(leftMargin, redrawY, scrollWidth, redrawHeight, true);
+            }
+        } else {
+            int destinationY = topMargin - pixels;
+            int scrollHeight = clientAreaHeight - destinationY - bottomMargin;
+            if (scrollHeight > 0) {
+                scroll(leftMargin, destinationY, leftMargin, topMargin, scrollWidth, scrollHeight, true);
+            }
+            if (destinationY > scrollHeight) {
+                int redrawY = Math.max(0, topMargin + scrollHeight);
+                int redrawHeight = Math.min(clientAreaHeight, -pixels - scrollHeight);
+                super.redraw(leftMargin, redrawY, scrollWidth, redrawHeight, true);
+            }
+        }
+        verticalScrollOffset += pixels;
+        calculateTopIndex(pixels);
+    } else {
+        calculateTopIndex(pixels);
+        super.redraw();
+    }
+    setCaretLocation();
+    return true;
+}
+void scrollText(int srcY, int destY) {
+    if (srcY is destY) return;
+    int deltaY = destY - srcY;
+    int scrollWidth = clientAreaWidth - leftMargin - rightMargin, scrollHeight;
+    if (deltaY > 0) {
+        scrollHeight = clientAreaHeight - srcY - bottomMargin;
+    } else {
+        scrollHeight = clientAreaHeight - destY - bottomMargin;
+    }
+    scroll(leftMargin, destY, leftMargin, srcY, scrollWidth, scrollHeight, true);
+    if ((0 < srcY + scrollHeight) && (topMargin > srcY)) {
+        super.redraw(leftMargin, deltaY, scrollWidth, topMargin, false);
+    }
+    if ((0 < destY + scrollHeight) && (topMargin > destY)) {
+        super.redraw(leftMargin, 0, scrollWidth, topMargin, false);
+    }
+    if ((clientAreaHeight - bottomMargin < srcY + scrollHeight) && (clientAreaHeight > srcY)) {
+        super.redraw(leftMargin, clientAreaHeight - bottomMargin + deltaY, scrollWidth, bottomMargin, false);
+    }
+    if ((clientAreaHeight - bottomMargin < destY + scrollHeight) && (clientAreaHeight > destY)) {
+        super.redraw(leftMargin, clientAreaHeight - bottomMargin, scrollWidth, bottomMargin, false);
+    }
+}
+/**
+ * Selects all the text.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void selectAll() {
+    checkWidget();
+    setSelection(0, Math.max(getCharCount(),0));
+}
+/**
+ * Replaces/inserts text as defined by the event.
+ *
+ * @param event the text change event.
+ *  <ul>
+ *  <li>event.start - the replace start offset</li>
+ *  <li>event.end - the replace end offset</li>
+ *  <li>event.text - the new text</li>
+ *  </ul>
+ */
+void sendKeyEvent(Event event) {
+    if (editable) {
+        modifyContent(event, true);
+    }
+}
+/**
+ * Returns a StyledTextEvent that can be used to request data such
+ * as styles and background color for a line.
+ * <p>
+ * The specified line may be a visual (wrapped) line if in word
+ * wrap mode. The returned object will always be for a logical
+ * (unwrapped) line.
+ * </p>
+ *
+ * @param lineOffset offset of the line. This may be the offset of
+ *  a visual line if the widget is in word wrap mode.
+ * @param line line text. This may be the text of a visual line if
+ *  the widget is in word wrap mode.
+ * @return StyledTextEvent that can be used to request line data
+ *  for the given line.
+ */
+StyledTextEvent sendLineEvent(int eventType, int lineOffset, String line) {
+    StyledTextEvent event = null;
+    if (isListening(eventType)) {
+        event = new StyledTextEvent(content);
+        event.detail = lineOffset;
+        event.text = line;
+        event.alignment = alignment;
+        event.indent = indent;
+        event.justify = justify;
+        notifyListeners(eventType, event);
+    }
+    return event;
+}
+void sendModifyEvent(Event event) {
+    Accessible accessible = getAccessible();
+    if (event.text.length is 0) {
+        accessible.textChanged(ACC.TEXT_DELETE, event.start, event.end - event.start);
+    } else {
+        if (event.start is event.end) {
+            accessible.textChanged(ACC.TEXT_INSERT, event.start, event.text.length);
+        } else {
+            accessible.textChanged(ACC.TEXT_DELETE, event.start, event.end - event.start);
+            accessible.textChanged(ACC.TEXT_INSERT, event.start, event.text.length);
+        }
+    }
+    notifyListeners(SWT.Modify, event);
+}
+/**
+ * Sends the specified selection event.
+ */
+void sendSelectionEvent() {
+    getAccessible().textSelectionChanged();
+    Event event = new Event();
+    event.x = selection.x;
+    event.y = selection.y;
+    notifyListeners(SWT.Selection, event);
+}
+int sendWordBoundaryEvent(int eventType, int movement, int offset, int newOffset, String lineText, int lineOffset) {
+    if (isListening(eventType)) {
+        StyledTextEvent event = new StyledTextEvent(content);
+        event.detail = lineOffset;
+        event.text = lineText;
+        event.count = movement;
+        event.start = offset;
+        event.end = newOffset;
+        notifyListeners(eventType, event);
+        offset = event.end;
+        if (offset !is newOffset) {
+            int length = getCharCount();
+            if (offset < 0) {
+                offset = 0;
+            } else if (offset > length) {
+                offset = length;
+            } else {
+                if (isLineDelimiter(offset)) {
+                    SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+                }
+            }
+        }
+        return offset;
+    }
+    return newOffset;
+}
+/**
+ * Sets the alignment of the widget. The argument should be one of <code>SWT.LEFT</code>,
+ * <code>SWT.CENTER</code> or <code>SWT.RIGHT</code>. The alignment applies for all lines.
+ * </p><p>
+ * Note that if <code>SWT.MULTI</code> is set, then <code>SWT.WRAP</code> must also be set
+ * in order to stabilize the right edge before setting alignment.
+ * </p>
+ *
+ * @param alignment the new alignment
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setLineAlignment(int, int, int)
+ *
+ * @since 3.2
+ */
+public void setAlignment(int alignment) {
+    checkWidget();
+    alignment &= (SWT.LEFT | SWT.RIGHT | SWT.CENTER);
+    if (alignment is 0 || this.alignment is alignment) return;
+    this.alignment = alignment;
+    resetCache(0, content.getLineCount());
+    setCaretLocation();
+    super.redraw();
+}
+/**
+ * @see Control#setBackground(Color)
+ */
+public override void setBackground(Color color) {
+    checkWidget();
+    background = color;
+    super.setBackground(color);
+    super.redraw();
+}
+/**
+ * Sets the receiver's caret.  Set the caret's height and location.
+ *
+ * </p>
+ * @param caret the new caret for the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public override void setCaret(Caret caret) {
+    checkWidget ();
+    super.setCaret(caret);
+    caretDirection = SWT.NULL;
+    if (caret !is null) {
+        setCaretLocation();
+    }
+}
+/**
+ * Sets the BIDI coloring mode.  When true the BIDI text display
+ * algorithm is applied to segments of text that are the same
+ * color.
+ *
+ * @param mode the new coloring mode
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @deprecated use BidiSegmentListener instead.
+ */
+public void setBidiColoring(bool mode) {
+    checkWidget();
+    bidiColoring = mode;
+}
+/**
+ * Moves the Caret to the current caret offset.
+ */
+void setCaretLocation() {
+    Point newCaretPos = getPointAtOffset(caretOffset);
+    setCaretLocation(newCaretPos, getCaretDirection());
+}
+void setCaretLocation(Point location, int direction) {
+    Caret caret = getCaret();
+    if (caret !is null) {
+        bool isDefaultCaret = caret is defaultCaret;
+        int lineHeight = renderer.getLineHeight();
+        int caretHeight = lineHeight;
+        if (!isFixedLineHeight() && isDefaultCaret) {
+            caretHeight = getBoundsAtOffset(caretOffset).height;
+            if (caretHeight !is lineHeight) {
+                direction = SWT.DEFAULT;
+            }
+        }
+        int imageDirection = direction;
+        if (isMirrored()) {
+            if (imageDirection is SWT.LEFT) {
+                imageDirection = SWT.RIGHT;
+            } else if (imageDirection is SWT.RIGHT) {
+                imageDirection = SWT.LEFT;
+            }
+        }
+        if (isDefaultCaret && imageDirection is SWT.RIGHT) {
+            location.x -= (caret.getSize().x - 1);
+        }
+        if (isDefaultCaret) {
+            caret.setBounds(location.x, location.y, caretWidth, caretHeight);
+        } else {
+            caret.setLocation(location);
+        }
+        getAccessible().textCaretMoved(getCaretOffset());
+        if (direction !is caretDirection) {
+            caretDirection = direction;
+            if (isDefaultCaret) {
+                if (imageDirection is SWT.DEFAULT) {
+                    defaultCaret.setImage(null);
+                } else if (imageDirection is SWT.LEFT) {
+                    defaultCaret.setImage(leftCaretBitmap);
+                } else if (imageDirection is SWT.RIGHT) {
+                    defaultCaret.setImage(rightCaretBitmap);
+                }
+            }
+            if (caretDirection is SWT.LEFT) {
+                BidiUtil.setKeyboardLanguage(BidiUtil.KEYBOARD_NON_BIDI);
+            } else if (caretDirection is SWT.RIGHT) {
+                BidiUtil.setKeyboardLanguage(BidiUtil.KEYBOARD_BIDI);
+            }
+        }
+    }
+    columnX = location.x;
+}
+/**
+ * Sets the caret offset.
+ *
+ * @param offset caret offset, relative to the first character in the text.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_INVALID_ARGUMENT when either the start or the end of the selection range is inside a
+ * multi byte line delimiter (and thus neither clearly in front of or after the line delimiter)
+ * </ul>
+ */
+public void setCaretOffset(int offset) {
+    checkWidget();
+    int length = getCharCount();
+    if (length > 0 && offset !is caretOffset) {
+        if (offset < 0) {
+            caretOffset = 0;
+        } else if (offset > length) {
+            caretOffset = length;
+        } else {
+            if (isLineDelimiter(offset)) {
+                // offset is inside a multi byte line delimiter. This is an
+                // illegal operation and an exception is thrown. Fixes 1GDKK3R
+                SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+            }
+            caretOffset = offset;
+        }
+        caretAlignment = PREVIOUS_OFFSET_TRAILING;
+        // clear the selection if the caret is moved.
+        // don't notify listeners about the selection change.
+        clearSelection(false);
+    }
+    setCaretLocation();
+}
+/**
+ * Copies the specified text range to the clipboard.  The text will be placed
+ * in the clipboard in plain text format and RTF format.
+ *
+ * @param start start index of the text
+ * @param length length of text to place in clipboard
+ *
+ * @exception SWTError, see Clipboard.setContents
+ * @see org.eclipse.swt.dnd.Clipboard#setContents
+ */
+void setClipboardContent(int start, int length, int clipboardType) {
+    if (clipboardType is DND.SELECTION_CLIPBOARD && !(IS_MOTIF || IS_GTK)) return;
+    TextTransfer plainTextTransfer = TextTransfer.getInstance();
+    TextWriter plainTextWriter = new TextWriter(start, length);
+    String plainText = getPlatformDelimitedText(plainTextWriter);
+    Object[] data;
+    Transfer[] types;
+    if (clipboardType is DND.SELECTION_CLIPBOARD) {
+        data = [ cast(Object) new ArrayWrapperString(plainText) ];
+        types = [plainTextTransfer];
+    } else {
+        RTFTransfer rtfTransfer = RTFTransfer.getInstance();
+        RTFWriter rtfWriter = new RTFWriter(start, length);
+        String rtfText = getPlatformDelimitedText(rtfWriter);
+        data = [ cast(Object) new ArrayWrapperString(rtfText), new ArrayWrapperString(plainText) ];
+        types = [ cast(Transfer)rtfTransfer, plainTextTransfer];
+    }
+    clipboard.setContents(data, types, clipboardType);
+}
+/**
+ * Sets the content implementation to use for text storage.
+ *
+ * @param newContent StyledTextContent implementation to use for text storage.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when listener is null</li>
+ * </ul>
+ */
+public void setContent(StyledTextContent newContent) {
+    checkWidget();
+    if (newContent is null) {
+        SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    }
+    if (content !is null) {
+        content.removeTextChangeListener(textChangeListener);
+    }
+    content = newContent;
+    content.addTextChangeListener(textChangeListener);
+    reset();
+}
+/**
+ * Sets the receiver's cursor to the cursor specified by the
+ * argument.  Overridden to handle the null case since the
+ * StyledText widget uses an ibeam as its default cursor.
+ *
+ * @see Control#setCursor(Cursor)
+ */
+public override void setCursor (Cursor cursor) {
+    if (cursor is null) {
+        Display display = getDisplay();
+        super.setCursor(display.getSystemCursor(SWT.CURSOR_IBEAM));
+    } else {
+        super.setCursor(cursor);
+    }
+}
+/**
+ * Sets whether the widget : double click mouse behavior.
+ * </p>
+ *
+ * @param enable if true double clicking a word selects the word, if false
+ *  double clicks have the same effect as regular mouse clicks.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setDoubleClickEnabled(bool enable) {
+    checkWidget();
+    doubleClickEnabled = enable;
+}
+public override void setDragDetect (bool dragDetect_) {
+    checkWidget ();
+    this.dragDetect_ = dragDetect_;
+}
+/**
+ * Sets whether the widget content can be edited.
+ * </p>
+ *
+ * @param editable if true content can be edited, if false content can not be
+ *  edited
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setEditable(bool editable) {
+    checkWidget();
+    this.editable = editable;
+}
+/**
+ * Sets a new font to render text with.
+ * <p>
+ * <b>NOTE:</b> Italic fonts are not supported unless they have no overhang
+ * and the same baseline as regular fonts.
+ * </p>
+ *
+ * @param font new font
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public override void setFont(Font font) {
+    checkWidget();
+    int oldLineHeight = renderer.getLineHeight();
+    super.setFont(font);
+    renderer.setFont(getFont(), tabLength);
+    // keep the same top line visible. fixes 5815
+    if (isFixedLineHeight()) {
+        int lineHeight = renderer.getLineHeight();
+        if (lineHeight !is oldLineHeight) {
+            int vscroll = (getVerticalScrollOffset() * lineHeight / oldLineHeight) - getVerticalScrollOffset();
+            scrollVertical(vscroll, true);
+        }
+    }
+    resetCache(0, content.getLineCount());
+    claimBottomFreeSpace();
+    calculateScrollBars();
+    if (isBidiCaret()) createCaretBitmaps();
+    caretDirection = SWT.NULL;
+    setCaretLocation();
+    super.redraw();
+}
+public override void setForeground(Color color) {
+    checkWidget();
+    foreground = color;
+    super.setForeground(getForeground());
+    super.redraw();
+}
+/**
+ * Sets the horizontal scroll offset relative to the start of the line.
+ * Do nothing if there is no text set.
+ * <p>
+ * <b>NOTE:</b> The horizontal index is reset to 0 when new text is set in the
+ * widget.
+ * </p>
+ *
+ * @param offset horizontal scroll offset relative to the start
+ *  of the line, measured in character increments starting at 0, if
+ *  equal to 0 the content is not scrolled, if > 0 = the content is scrolled.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setHorizontalIndex(int offset) {
+    checkWidget();
+    if (getCharCount() is 0) {
+        return;
+    }
+    if (offset < 0) {
+        offset = 0;
+    }
+    offset *= getHorizontalIncrement();
+    // allow any value if client area width is unknown or 0.
+    // offset will be checked in resize handler.
+    // don't use isVisible since width is known even if widget
+    // is temporarily invisible
+    if (clientAreaWidth > 0) {
+        int width = renderer.getWidth();
+        // prevent scrolling if the content fits in the client area.
+        // align end of longest line with right border of client area
+        // if offset is out of range.
+        if (offset > width - clientAreaWidth) {
+            offset = Math.max(0, width - clientAreaWidth);
+        }
+    }
+    scrollHorizontal(offset - horizontalScrollOffset, true);
+}
+/**
+ * Sets the horizontal pixel offset relative to the start of the line.
+ * Do nothing if there is no text set.
+ * <p>
+ * <b>NOTE:</b> The horizontal pixel offset is reset to 0 when new text
+ * is set in the widget.
+ * </p>
+ *
+ * @param pixel horizontal pixel offset relative to the start
+ *  of the line.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @since 2.0
+ */
+public void setHorizontalPixel(int pixel) {
+    checkWidget();
+    if (getCharCount() is 0) {
+        return;
+    }
+    if (pixel < 0) {
+        pixel = 0;
+    }
+    // allow any value if client area width is unknown or 0.
+    // offset will be checked in resize handler.
+    // don't use isVisible since width is known even if widget
+    // is temporarily invisible
+    if (clientAreaWidth > 0) {
+        int width = renderer.getWidth();
+        // prevent scrolling if the content fits in the client area.
+        // align end of longest line with right border of client area
+        // if offset is out of range.
+        if (pixel > width - clientAreaWidth) {
+            pixel = Math.max(0, width - clientAreaWidth);
+        }
+    }
+    scrollHorizontal(pixel - horizontalScrollOffset, true);
+}
+/**
+ * Sets the line indentation of the widget.
+ * <p>
+ * It is the amount of blank space, in pixels, at the beginning of each line.
+ * When a line wraps in several lines only the first one is indented.
+ * </p>
+ *
+ * @param indent the new indent
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setLineIndent(int, int, int)
+ *
+ * @since 3.2
+ */
+public void setIndent(int indent) {
+    checkWidget();
+    if (this.indent is indent || indent < 0) return;
+    this.indent = indent;
+    resetCache(0, content.getLineCount());
+    setCaretLocation();
+    super.redraw();
+}
+/**
+ * Sets whether the widget should justify lines.
+ *
+ * @param justify whether lines should be justified
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setLineJustify(int, int, bool)
+ *
+ * @since 3.2
+ */
+public void setJustify(bool justify) {
+    checkWidget();
+    if (this.justify is justify) return;
+    this.justify = justify;
+    resetCache(0, content.getLineCount());
+    setCaretLocation();
+    super.redraw();
+}
+/**
+ * Maps a key to an action.
+ * <p>
+ * One action can be associated with N keys. However, each key can only
+ * have one action (key:action is N:1 relation).
+ * </p>
+ *
+ * @param key a key code defined in SWT.java or a character.
+ *  Optionally ORd with a state mask.  Preferred state masks are one or more of
+ *  SWT.MOD1, SWT.MOD2, SWT.MOD3, since these masks account for modifier platform
+ *  differences.  However, there may be cases where using the specific state masks
+ *  (i.e., SWT.CTRL, SWT.SHIFT, SWT.ALT, SWT.COMMAND) makes sense.
+ * @param action one of the predefined actions defined in ST.java.
+ *  Use SWT.NULL to remove a key binding.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setKeyBinding(int key, int action) {
+    checkWidget();
+    int modifierValue = key & SWT.MODIFIER_MASK;
+    char keyChar = cast(char)(key & SWT.KEY_MASK);
+    if (Compatibility.isLetter(keyChar)) {
+        // make the keybinding case insensitive by adding it
+        // in its upper and lower case form
+        char ch = CharacterToUpper(keyChar);
+        int newKey = ch | modifierValue;
+        if (action is SWT.NULL) {
+            keyActionMap.remove(newKey);
+        } else {
+            keyActionMap[newKey] = action;
+        }
+        ch = CharacterToLower(keyChar);
+        newKey = ch | modifierValue;
+        if (action is SWT.NULL) {
+            keyActionMap.remove(newKey);
+        } else {
+            keyActionMap[newKey] = action;
+        }
+    } else {
+        if (action is SWT.NULL) {
+            keyActionMap.remove(key);
+        } else {
+            keyActionMap[key]=action;
+        }
+    }
+}
+/**
+ * Sets the alignment of the specified lines. The argument should be one of <code>SWT.LEFT</code>,
+ * <code>SWT.CENTER</code> or <code>SWT.RIGHT</code>.
+ * <p><p>
+ * Note that if <code>SWT.MULTI</code> is set, then <code>SWT.WRAP</code> must also be set
+ * in order to stabilize the right edge before setting alignment.
+ * </p>
+ * Should not be called if a LineStyleListener has been set since the listener
+ * maintains the line attributes.
+ * </p><p>
+ * All line attributes are maintained relative to the line text, not the
+ * line index that is specified in this method call.
+ * During text changes, when entire lines are inserted or removed, the line
+ * attributes that are associated with the lines after the change
+ * will "move" with their respective text. An entire line is defined as
+ * extending from the first character on a line to the last and including the
+ * line delimiter.
+ * </p><p>
+ * When two lines are joined by deleting a line delimiter, the top line
+ * attributes take precedence and the attributes of the bottom line are deleted.
+ * For all other text changes line attributes will remain unchanged.
+ *
+ * @param startLine first line the alignment is applied to, 0 based
+ * @param lineCount number of lines the alignment applies to.
+ * @param alignment line alignment
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_INVALID_ARGUMENT when the specified line range is invalid</li>
+ * </ul>
+ * @see #setAlignment(int)
+ * @since 3.2
+ */
+public void setLineAlignment(int startLine, int lineCount, int alignment) {
+    checkWidget();
+    if (isListening(LineGetStyle)) return;
+    if (startLine < 0 || startLine + lineCount > content.getLineCount()) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+
+    renderer.setLineAlignment(startLine, lineCount, alignment);
+    resetCache(startLine, lineCount);
+    redrawLines(startLine, lineCount);
+    int caretLine = getCaretLine();
+    if (startLine <= caretLine && caretLine < startLine + lineCount) {
+        setCaretLocation();
+    }
+}
+/**
+ * Sets the background color of the specified lines.
+ * <p>
+ * The background color is drawn for the width of the widget. All
+ * line background colors are discarded when setText is called.
+ * The text background color if defined in a StyleRange overlays the
+ * line background color.
+ * </p><p>
+ * Should not be called if a LineBackgroundListener has been set since the
+ * listener maintains the line backgrounds.
+ * </p><p>
+ * All line attributes are maintained relative to the line text, not the
+ * line index that is specified in this method call.
+ * During text changes, when entire lines are inserted or removed, the line
+ * attributes that are associated with the lines after the change
+ * will "move" with their respective text. An entire line is defined as
+ * extending from the first character on a line to the last and including the
+ * line delimiter.
+ * </p><p>
+ * When two lines are joined by deleting a line delimiter, the top line
+ * attributes take precedence and the attributes of the bottom line are deleted.
+ * For all other text changes line attributes will remain unchanged.
+ * </p>
+ *
+ * @param startLine first line the color is applied to, 0 based
+ * @param lineCount number of lines the color applies to.
+ * @param background line background color
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_INVALID_ARGUMENT when the specified line range is invalid</li>
+ * </ul>
+ */
+public void setLineBackground(int startLine, int lineCount, Color background) {
+    checkWidget();
+    if (isListening(LineGetBackground)) return;
+    if (startLine < 0 || startLine + lineCount > content.getLineCount()) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (background !is null) {
+        renderer.setLineBackground(startLine, lineCount, background);
+    } else {
+        renderer.clearLineBackground(startLine, lineCount);
+    }
+    redrawLines(startLine, lineCount);
+}
+/**
+ * Sets the bullet of the specified lines.
+ * <p>
+ * Should not be called if a LineStyleListener has been set since the listener
+ * maintains the line attributes.
+ * </p><p>
+ * All line attributes are maintained relative to the line text, not the
+ * line index that is specified in this method call.
+ * During text changes, when entire lines are inserted or removed, the line
+ * attributes that are associated with the lines after the change
+ * will "move" with their respective text. An entire line is defined as
+ * extending from the first character on a line to the last and including the
+ * line delimiter.
+ * </p><p>
+ * When two lines are joined by deleting a line delimiter, the top line
+ * attributes take precedence and the attributes of the bottom line are deleted.
+ * For all other text changes line attributes will remain unchanged.
+ * </p>
+ *
+ * @param startLine first line the bullet is applied to, 0 based
+ * @param lineCount number of lines the bullet applies to.
+ * @param bullet line bullet
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_INVALID_ARGUMENT when the specified line range is invalid</li>
+ * </ul>
+ * @since 3.2
+ */
+public void setLineBullet(int startLine, int lineCount, Bullet bullet) {
+    checkWidget();
+    if (isListening(LineGetStyle)) return;
+    if (startLine < 0 || startLine + lineCount > content.getLineCount()) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+
+    renderer.setLineBullet(startLine, lineCount, bullet);
+    resetCache(startLine, lineCount);
+    redrawLines(startLine, lineCount);
+    int caretLine = getCaretLine();
+    if (startLine <= caretLine && caretLine < startLine + lineCount) {
+        setCaretLocation();
+    }
+}
+void setVariableLineHeight () {
+    if (!fixedLineHeight) return;
+    fixedLineHeight = false;
+    renderer.calculateIdle();
+}
+/**
+ * Sets the indent of the specified lines.
+ * <p>
+ * Should not be called if a LineStyleListener has been set since the listener
+ * maintains the line attributes.
+ * </p><p>
+ * All line attributes are maintained relative to the line text, not the
+ * line index that is specified in this method call.
+ * During text changes, when entire lines are inserted or removed, the line
+ * attributes that are associated with the lines after the change
+ * will "move" with their respective text. An entire line is defined as
+ * extending from the first character on a line to the last and including the
+ * line delimiter.
+ * </p><p>
+ * When two lines are joined by deleting a line delimiter, the top line
+ * attributes take precedence and the attributes of the bottom line are deleted.
+ * For all other text changes line attributes will remain unchanged.
+ * </p>
+ *
+ * @param startLine first line the indent is applied to, 0 based
+ * @param lineCount number of lines the indent applies to.
+ * @param indent line indent
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_INVALID_ARGUMENT when the specified line range is invalid</li>
+ * </ul>
+ * @see #setIndent(int)
+ * @since 3.2
+ */
+public void setLineIndent(int startLine, int lineCount, int indent) {
+    checkWidget();
+    if (isListening(LineGetStyle)) return;
+    if (startLine < 0 || startLine + lineCount > content.getLineCount()) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+
+    renderer.setLineIndent(startLine, lineCount, indent);
+    resetCache(startLine, lineCount);
+    redrawLines(startLine, lineCount);
+    int caretLine = getCaretLine();
+    if (startLine <= caretLine && caretLine < startLine + lineCount) {
+        setCaretLocation();
+    }
+}
+/**
+ * Sets the justify of the specified lines.
+ * <p>
+ * Should not be called if a LineStyleListener has been set since the listener
+ * maintains the line attributes.
+ * </p><p>
+ * All line attributes are maintained relative to the line text, not the
+ * line index that is specified in this method call.
+ * During text changes, when entire lines are inserted or removed, the line
+ * attributes that are associated with the lines after the change
+ * will "move" with their respective text. An entire line is defined as
+ * extending from the first character on a line to the last and including the
+ * line delimiter.
+ * </p><p>
+ * When two lines are joined by deleting a line delimiter, the top line
+ * attributes take precedence and the attributes of the bottom line are deleted.
+ * For all other text changes line attributes will remain unchanged.
+ * </p>
+ *
+ * @param startLine first line the justify is applied to, 0 based
+ * @param lineCount number of lines the justify applies to.
+ * @param justify true if lines should be justified
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_INVALID_ARGUMENT when the specified line range is invalid</li>
+ * </ul>
+ * @see #setJustify(bool)
+ * @since 3.2
+ */
+public void setLineJustify(int startLine, int lineCount, bool justify) {
+    checkWidget();
+    if (isListening(LineGetStyle)) return;
+    if (startLine < 0 || startLine + lineCount > content.getLineCount()) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+
+    renderer.setLineJustify(startLine, lineCount, justify);
+    resetCache(startLine, lineCount);
+    redrawLines(startLine, lineCount);
+    int caretLine = getCaretLine();
+    if (startLine <= caretLine && caretLine < startLine + lineCount) {
+        setCaretLocation();
+    }
+}
+/**
+ * Sets the line spacing of the widget. The line spacing applies for all lines.
+ *
+ * @param lineSpacing the line spacing
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @since 3.2
+ */
+public void setLineSpacing(int lineSpacing) {
+    checkWidget();
+    if (this.lineSpacing is lineSpacing || lineSpacing < 0) return;
+    this.lineSpacing = lineSpacing;
+    setVariableLineHeight();
+    resetCache(0, content.getLineCount());
+    setCaretLocation();
+    super.redraw();
+}
+void setMargins (int leftMargin, int topMargin, int rightMargin, int bottomMargin) {
+    checkWidget();
+    this.leftMargin = leftMargin;
+    this.topMargin = topMargin;
+    this.rightMargin = rightMargin;
+    this.bottomMargin = bottomMargin;
+    setCaretLocation();
+}
+/**
+ * Flips selection anchor based on word selection direction.
+ */
+void setMouseWordSelectionAnchor() {
+    if (clickCount > 1) {
+        if (caretOffset < doubleClickSelection.x) {
+            selectionAnchor = doubleClickSelection.y;
+        } else if (caretOffset > doubleClickSelection.y) {
+            selectionAnchor = doubleClickSelection.x;
+        }
+    }
+}
+/**
+ * Sets the orientation of the receiver, which must be one
+ * of the constants <code>SWT.LEFT_TO_RIGHT</code> or <code>SWT.RIGHT_TO_LEFT</code>.
+ *
+ * @param orientation new orientation style
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.1.2
+ */
+public void setOrientation(int orientation) {
+    if ((orientation & (SWT.RIGHT_TO_LEFT | SWT.LEFT_TO_RIGHT)) is 0) {
+        return;
+    }
+    if ((orientation & SWT.RIGHT_TO_LEFT) !is 0 && (orientation & SWT.LEFT_TO_RIGHT) !is 0) {
+        return;
+    }
+    if ((orientation & SWT.RIGHT_TO_LEFT) !is 0 && isMirrored()) {
+        return;
+    }
+    if ((orientation & SWT.LEFT_TO_RIGHT) !is 0 && !isMirrored()) {
+        return;
+    }
+    if (!BidiUtil.setOrientation(this, orientation)) {
+        return;
+    }
+    isMirrored_ = (orientation & SWT.RIGHT_TO_LEFT) !is 0;
+    caretDirection = SWT.NULL;
+    resetCache(0, content.getLineCount());
+    setCaretLocation();
+    keyActionMap = null;
+    createKeyBindings();
+    super.redraw();
+}
+/**
+ * Adjusts the maximum and the page size of the scroll bars to
+ * reflect content width/length changes.
+ *
+ * @param vertical indicates if the vertical scrollbar also needs to be set
+ */
+void setScrollBars(bool vertical) {
+    int inactive = 1;
+    if (vertical || !isFixedLineHeight()) {
+        ScrollBar verticalBar = getVerticalBar();
+        if (verticalBar !is null) {
+            int maximum = renderer.getHeight();
+            // only set the real values if the scroll bar can be used
+            // (ie. because the thumb size is less than the scroll maximum)
+            // avoids flashing on Motif, fixes 1G7RE1J and 1G5SE92
+            if (clientAreaHeight < maximum) {
+                verticalBar.setMaximum(maximum);
+                verticalBar.setThumb(clientAreaHeight);
+                verticalBar.setPageIncrement(clientAreaHeight);
+            } else if (verticalBar.getThumb() !is inactive || verticalBar.getMaximum() !is inactive) {
+                verticalBar.setValues(
+                    verticalBar.getSelection(),
+                    verticalBar.getMinimum(),
+                    inactive,
+                    inactive,
+                    verticalBar.getIncrement(),
+                    inactive);
+            }
+        }
+    }
+    ScrollBar horizontalBar = getHorizontalBar();
+    if (horizontalBar !is null && horizontalBar.getVisible()) {
+        int maximum = renderer.getWidth();
+        // only set the real values if the scroll bar can be used
+        // (ie. because the thumb size is less than the scroll maximum)
+        // avoids flashing on Motif, fixes 1G7RE1J and 1G5SE92
+        if (clientAreaWidth < maximum) {
+            horizontalBar.setMaximum(maximum);
+            horizontalBar.setThumb(clientAreaWidth - leftMargin - rightMargin);
+            horizontalBar.setPageIncrement(clientAreaWidth - leftMargin - rightMargin);
+        } else if (horizontalBar.getThumb() !is inactive || horizontalBar.getMaximum() !is inactive) {
+            horizontalBar.setValues(
+                horizontalBar.getSelection(),
+                horizontalBar.getMinimum(),
+                inactive,
+                inactive,
+                horizontalBar.getIncrement(),
+                inactive);
+        }
+    }
+}
+/**
+ * Sets the selection to the given position and scrolls it into view.  Equivalent to setSelection(start,start).
+ *
+ * @param start new caret position
+ * @see #setSelection(int,int)
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_INVALID_ARGUMENT when either the start or the end of the selection range is inside a
+ * multi byte line delimiter (and thus neither clearly in front of or after the line delimiter)
+ * </ul>
+ */
+public void setSelection(int start) {
+    // checkWidget test done in setSelectionRange
+    setSelection(start, start);
+}
+/**
+ * Sets the selection and scrolls it into view.
+ * <p>
+ * Indexing is zero based.  Text selections are specified in terms of
+ * caret positions.  In a text widget that contains N characters, there are
+ * N+1 caret positions, ranging from 0..N
+ * </p>
+ *
+ * @param point x=selection start offset, y=selection end offset
+ *  The caret will be placed at the selection start when x > y.
+ * @see #setSelection(int,int)
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_NULL_ARGUMENT when point is null</li>
+ *   <li>ERROR_INVALID_ARGUMENT when either the start or the end of the selection range is inside a
+ * multi byte line delimiter (and thus neither clearly in front of or after the line delimiter)
+ * </ul>
+ */
+public void setSelection(Point point) {
+    checkWidget();
+    if (point is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    setSelection(point.x, point.y);
+}
+/**
+ * Sets the receiver's selection background color to the color specified
+ * by the argument, or to the default system color for the control
+ * if the argument is null.
+ *
+ * @param color the new color (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @since 2.1
+ */
+public void setSelectionBackground (Color color) {
+    checkWidget ();
+    if (color !is null) {
+        if (color.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    selectionBackground = color;
+    super.redraw();
+}
+/**
+ * Sets the receiver's selection foreground color to the color specified
+ * by the argument, or to the default system color for the control
+ * if the argument is null.
+ * <p>
+ * Note that this is a <em>HINT</em>. Some platforms do not allow the application
+ * to change the selection foreground color.
+ * </p>
+ * @param color the new color (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @since 2.1
+ */
+public void setSelectionForeground (Color color) {
+    checkWidget ();
+    if (color !is null) {
+        if (color.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    selectionForeground = color;
+    super.redraw();
+}
+/**
+ * Sets the selection and scrolls it into view.
+ * <p>
+ * Indexing is zero based.  Text selections are specified in terms of
+ * caret positions.  In a text widget that contains N characters, there are
+ * N+1 caret positions, ranging from 0..N
+ * </p>
+ *
+ * @param start selection start offset. The caret will be placed at the
+ *  selection start when start > end.
+ * @param end selection end offset
+ * @see #setSelectionRange(int,int)
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_INVALID_ARGUMENT when either the start or the end of the selection range is inside a
+ * multi byte line delimiter (and thus neither clearly in front of or after the line delimiter)
+ * </ul>
+ */
+public void setSelection(int start, int end) {
+    setSelectionRange(start, end - start);
+    showSelection();
+}
+/**
+ * Sets the selection.
+ * <p>
+ * The new selection may not be visible. Call showSelection to scroll
+ * the selection into view.
+ * </p>
+ *
+ * @param start offset of the first selected character, start >= 0 must be true.
+ * @param length number of characters to select, 0 <= start + length
+ *  <= getCharCount() must be true.
+ *  A negative length places the caret at the selection start.
+ * @param sendEvent a Selection event is sent when set to true and when
+ *  the selection is reset.
+ */
+void setSelection(int start, int length, bool sendEvent) {
+    int end = start + length;
+    start = content.utf8AdjustOffset(start);
+    end = content.utf8AdjustOffset(end);
+    if (start > end) {
+        int temp = end;
+        end = start;
+        start = temp;
+    }
+    // is the selection range different or is the selection direction
+    // different?
+    if (selection.x !is start || selection.y !is end ||
+        (length > 0 && selectionAnchor !is selection.x) ||
+        (length < 0 && selectionAnchor !is selection.y)) {
+        clearSelection(sendEvent);
+        if (length < 0) {
+            selectionAnchor = selection.y = end;
+            caretOffset = selection.x = start;
+        } else {
+            selectionAnchor = selection.x = start;
+            caretOffset = selection.y = end;
+        }
+        caretAlignment = PREVIOUS_OFFSET_TRAILING;
+        internalRedrawRange(selection.x, selection.y - selection.x);
+    }
+}
+/**
+ * Sets the selection.
+ * <p>
+ * The new selection may not be visible. Call showSelection to scroll the selection
+ * into view. A negative length places the caret at the visual start of the selection.
+ * </p>
+ *
+ * @param start offset of the first selected character
+ * @param length number of characters to select
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_INVALID_ARGUMENT when either the start or the end of the selection range is inside a
+ * multi byte line delimiter (and thus neither clearly in front of or after the line delimiter)
+ * </ul>
+ */
+public void setSelectionRange(int start, int length) {
+    checkWidget();
+    int contentLength = getCharCount();
+    start = Math.max(0, Math.min (start, contentLength));
+    int end = start + length;
+    if (end < 0) {
+        length = -start;
+    } else {
+        if (end > contentLength) length = contentLength - start;
+    }
+    if (isLineDelimiter(start) || isLineDelimiter(start + length)) {
+        // the start offset or end offset of the selection range is inside a
+        // multi byte line delimiter. This is an illegal operation and an exception
+        // is thrown. Fixes 1GDKK3R
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    setSelection(start, length, false);
+    setCaretLocation();
+}
+/**
+ * Adds the specified style.
+ * <p>
+ * The new style overwrites existing styles for the specified range.
+ * Existing style ranges are adjusted if they partially overlap with
+ * the new style. To clear an individual style, call setStyleRange
+ * with a StyleRange that has null attributes.
+ * </p><p>
+ * Should not be called if a LineStyleListener has been set since the
+ * listener maintains the styles.
+ * </p>
+ *
+ * @param range StyleRange object containing the style information.
+ * Overwrites the old style in the given range. May be null to delete
+ * all styles.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_INVALID_RANGE when the style range is outside the valid range (> getCharCount())</li>
+ * </ul>
+ */
+public void setStyleRange(StyleRange range) {
+    checkWidget();
+    if (isListening(LineGetStyle)) return;
+    if (range !is null) {
+        if (range.isUnstyled()) {
+            setStyleRanges(range.start, range.length, null, null, false);
+        } else {
+            setStyleRanges(range.start, 0, null, [range], false);
+        }
+    } else {
+        setStyleRanges(0, 0, null, null, true);
+    }
+}
+/**
+ * Clears the styles in the range specified by <code>start</code> and
+ * <code>length</code> and adds the new styles.
+ * <p>
+ * The ranges array contains start and length pairs.  Each pair refers to
+ * the corresponding style in the styles array.  For example, the pair
+ * that starts at ranges[n] with length ranges[n+1] uses the style
+ * at styles[n/2].  The range fields within each StyleRange are ignored.
+ * If ranges or styles is null, the specified range is cleared.
+ * </p><p>
+ * Note: It is expected that the same instance of a StyleRange will occur
+ * multiple times within the styles array, reducing memory usage.
+ * </p><p>
+ * Should not be called if a LineStyleListener has been set since the
+ * listener maintains the styles.
+ * </p>
+ *
+ * @param start offset of first character where styles will be deleted
+ * @param length length of the range to delete styles in
+ * @param ranges the array of ranges.  The ranges must not overlap and must be in order.
+ * @param styles the array of StyleRanges.  The range fields within the StyleRange are unused.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when an element in the styles array is null</li>
+ *    <li>ERROR_INVALID_RANGE when the number of ranges and style do not match (ranges.length * 2 is styles.length)</li>
+ *    <li>ERROR_INVALID_RANGE when a range is outside the valid range (> getCharCount() or less than zero)</li>
+ *    <li>ERROR_INVALID_RANGE when a range overlaps</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setStyleRanges(int start, int length, int[] ranges, StyleRange[] styles) {
+    checkWidget();
+    if (isListening(LineGetStyle)) return;
+    if (ranges is null || styles is null) {
+        setStyleRanges(start, length, null, null, false);
+    } else {
+        setStyleRanges(start, length, ranges, styles, false);
+    }
+}
+/**
+ * Sets styles to be used for rendering the widget content.
+ * <p>
+ * All styles in the widget will be replaced with the given set of ranges and styles.
+ * The ranges array contains start and length pairs.  Each pair refers to
+ * the corresponding style in the styles array.  For example, the pair
+ * that starts at ranges[n] with length ranges[n+1] uses the style
+ * at styles[n/2].  The range fields within each StyleRange are ignored.
+ * If either argument is null, the styles are cleared.
+ * </p><p>
+ * Note: It is expected that the same instance of a StyleRange will occur
+ * multiple times within the styles array, reducing memory usage.
+ * </p><p>
+ * Should not be called if a LineStyleListener has been set since the
+ * listener maintains the styles.
+ * </p>
+ *
+ * @param ranges the array of ranges.  The ranges must not overlap and must be in order.
+ * @param styles the array of StyleRanges.  The range fields within the StyleRange are unused.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when an element in the styles array is null</li>
+ *    <li>ERROR_INVALID_RANGE when the number of ranges and style do not match (ranges.length * 2 is styles.length)</li>
+ *    <li>ERROR_INVALID_RANGE when a range is outside the valid range (> getCharCount() or less than zero)</li>
+ *    <li>ERROR_INVALID_RANGE when a range overlaps</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setStyleRanges(int[] ranges, StyleRange[] styles) {
+    checkWidget();
+    if (isListening(LineGetStyle)) return;
+    if (ranges is null || styles is null) {
+        setStyleRanges(0, 0, null, null, true);
+    } else {
+        setStyleRanges(0, 0, ranges, styles, true);
+    }
+}
+void setStyleRanges(int start, int length, int[] ranges, StyleRange[] styles, bool reset) {
+    int charCount = content.getCharCount();
+    int end = start + length;
+    if (start > end || start < 0) {
+        SWT.error(SWT.ERROR_INVALID_RANGE);
+    }
+    if (styles !is null) {
+        if (end > charCount) {
+            SWT.error(SWT.ERROR_INVALID_RANGE);
+        }
+        if (ranges !is null) {
+            if (ranges.length !is styles.length << 1) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+        }
+        int lastOffset = 0;
+        bool variableHeight = false;
+        for (int i = 0; i < styles.length; i ++) {
+            if (styles[i] is null) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+            int rangeStart, rangeLength;
+            if (ranges !is null) {
+                rangeStart = ranges[i << 1];
+                rangeLength = ranges[(i << 1) + 1];
+            } else {
+                rangeStart = styles[i].start;
+                rangeLength = styles[i].length;
+            }
+            if (rangeLength < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+            if (!(0 <= rangeStart && rangeStart + rangeLength <= charCount)) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+            if (lastOffset > rangeStart) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+            variableHeight |= styles[i].isVariableHeight();
+            lastOffset = rangeStart + rangeLength;
+        }
+        if (variableHeight) setVariableLineHeight();
+    }
+    int rangeStart = start, rangeEnd = end;
+    if (styles !is null && styles.length > 0) {
+        if (ranges !is null) {
+            rangeStart = ranges[0];
+            rangeEnd = ranges[ranges.length - 2] + ranges[ranges.length - 1];
+        } else {
+            rangeStart = styles[0].start;
+            rangeEnd = styles[styles.length - 1].start + styles[styles.length - 1].length;
+        }
+    }
+    int lastLineBottom = 0;
+    if (!isFixedLineHeight() && !reset) {
+        int lineEnd = content.getLineAtOffset(Math.max(end, rangeEnd));
+        int partialTopIndex = getPartialTopIndex();
+        int partialBottomIndex = getPartialBottomIndex();
+        if (partialTopIndex <= lineEnd && lineEnd <= partialBottomIndex) {
+            lastLineBottom = getLinePixel(lineEnd + 1);
+        }
+    }
+    if (reset) {
+        renderer.setStyleRanges(null, null);
+    } else {
+        renderer.updateRanges(start, length, length);
+    }
+    if (styles !is null && styles.length > 0) {
+        renderer.setStyleRanges(ranges, styles);
+    }
+    if (reset) {
+        resetCache(0, content.getLineCount());
+        super.redraw();
+    } else {
+        int lineStart = content.getLineAtOffset(Math.min(start, rangeStart));
+        int lineEnd = content.getLineAtOffset(Math.max(end, rangeEnd));
+        resetCache(lineStart, lineEnd - lineStart + 1);
+        int partialTopIndex = getPartialTopIndex();
+        int partialBottomIndex = getPartialBottomIndex();
+        if (!(lineStart > partialBottomIndex || lineEnd < partialTopIndex)) {
+            int y = 0;
+            int height = clientAreaHeight;
+            if (partialTopIndex <= lineStart && lineStart <= partialBottomIndex) {
+                int lineTop = Math.max(y, getLinePixel(lineStart));
+                y = lineTop;
+                height -= lineTop;
+            }
+            if (partialTopIndex <= lineEnd && lineEnd <= partialBottomIndex) {
+                int newLastLineBottom = getLinePixel(lineEnd + 1);
+                if (!isFixedLineHeight()) {
+                    scrollText(lastLineBottom, newLastLineBottom);
+                }
+                height = newLastLineBottom - y;
+            }
+            super.redraw(0, y, clientAreaWidth, height, false);
+        }
+    }
+    setCaretLocation();
+}
+/**
+ * Sets styles to be used for rendering the widget content. All styles
+ * in the widget will be replaced with the given set of styles.
+ * <p>
+ * Note: Because a StyleRange includes the start and length, the
+ * same instance cannot occur multiple times in the array of styles.
+ * If the same style attributes, such as font and color, occur in
+ * multiple StyleRanges, <code>setStyleRanges(int[], StyleRange[])</code>
+ * can be used to share styles and reduce memory usage.
+ * </p><p>
+ * Should not be called if a LineStyleListener has been set since the
+ * listener maintains the styles.
+ * </p>
+ *
+ * @param ranges StyleRange objects containing the style information.
+ * The ranges should not overlap. The style rendering is undefined if
+ * the ranges do overlap. Must not be null. The styles need to be in order.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE when the last of the style ranges is outside the valid range (> getCharCount())</li>
+ * </ul>
+ *
+ * @see #setStyleRanges(int[], StyleRange[])
+ */
+public void setStyleRanges(StyleRange[] ranges) {
+    checkWidget();
+    if (isListening(LineGetStyle)) return;
+    // SWT extension: allow null for zero length string
+    //if (ranges is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    setStyleRanges(0, 0, null, ranges, true);
+}
+/**
+ * Sets the tab width.
+ *
+ * @param tabs tab width measured in characters.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setTabs(int tabs) {
+    checkWidget();
+    tabLength = tabs;
+    renderer.setFont(null, tabs);
+    resetCache(0, content.getLineCount());
+    setCaretLocation();
+    super.redraw();
+}
+/**
+ * Sets the widget content.
+ * If the widget has the SWT.SINGLE style and "text" contains more than
+ * one line, only the first line is rendered but the text is stored
+ * unchanged. A subsequent call to getText will return the same text
+ * that was set.
+ * <p>
+ * <b>Note:</b> Only a single line of text should be set when the SWT.SINGLE
+ * style is used.
+ * </p>
+ *
+ * @param text new widget content. Replaces existing content. Line styles
+ *  that were set using StyledText API are discarded.  The
+ *  current selection is also discarded.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setText(String text) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+//     if (text is null) {
+//         SWT.error(SWT.ERROR_NULL_ARGUMENT);
+//     }
+    Event event = new Event();
+    event.start = 0;
+    event.end = getCharCount();
+    event.text = text;
+    event.doit = true;
+    notifyListeners(SWT.Verify, event);
+    if (event.doit) {
+        StyledTextEvent styledTextEvent = null;
+        if (isListening(ExtendedModify)) {
+            styledTextEvent = new StyledTextEvent(content);
+            styledTextEvent.start = event.start;
+            styledTextEvent.end = event.start + event.text.length;
+            styledTextEvent.text = content.getTextRange(event.start, event.end - event.start);
+        }
+        content.setText(event.text);
+        sendModifyEvent(event);
+        if (styledTextEvent !is null) {
+            notifyListeners(ExtendedModify, styledTextEvent);
+        }
+    }
+}
+/**
+ * Sets the text limit to the specified number of characters.
+ * <p>
+ * The text limit specifies the amount of text that
+ * the user can type into the widget.
+ * </p>
+ *
+ * @param limit the new text limit.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_CANNOT_BE_ZERO when limit is 0</li>
+ * </ul>
+ */
+public void setTextLimit(int limit) {
+    checkWidget();
+    if (limit is 0) {
+        SWT.error(SWT.ERROR_CANNOT_BE_ZERO);
+    }
+    textLimit = limit;
+}
+/**
+ * Sets the top index. Do nothing if there is no text set.
+ * <p>
+ * The top index is the index of the line that is currently at the top
+ * of the widget. The top index changes when the widget is scrolled.
+ * Indexing starts from zero.
+ * Note: The top index is reset to 0 when new text is set in the widget.
+ * </p>
+ *
+ * @param topIndex new top index. Must be between 0 and
+ *  getLineCount() - fully visible lines per page. If no lines are fully
+ *  visible the maximum value is getLineCount() - 1. An out of range
+ *  index will be adjusted accordingly.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setTopIndex(int topIndex) {
+    checkWidget();
+    if (getCharCount() is 0) {
+        return;
+    }
+    int lineCount = content.getLineCount(), pixel;
+    if (isFixedLineHeight()) {
+        int pageSize = Math.max(1, Math.min(lineCount, getLineCountWhole()));
+        if (topIndex < 0) {
+            topIndex = 0;
+        } else if (topIndex > lineCount - pageSize) {
+            topIndex = lineCount - pageSize;
+        }
+        pixel = getLinePixel(topIndex);
+    } else {
+        topIndex = Math.max(0, Math.min(lineCount - 1, topIndex));
+        pixel = getLinePixel(topIndex);
+        if (pixel > 0) {
+            pixel = getAvailableHeightBellow(pixel);
+        } else {
+            pixel = getAvailableHeightAbove(pixel);
+        }
+    }
+    scrollVertical(pixel, true);
+}
+/**
+ * Sets the top pixel offset. Do nothing if there is no text set.
+ * <p>
+ * The top pixel offset is the vertical pixel offset of the widget. The
+ * widget is scrolled so that the given pixel position is at the top.
+ * The top index is adjusted to the corresponding top line.
+ * Note: The top pixel is reset to 0 when new text is set in the widget.
+ * </p>
+ *
+ * @param pixel new top pixel offset. Must be between 0 and
+ *  (getLineCount() - visible lines per page) / getLineHeight()). An out
+ *  of range offset will be adjusted accordingly.
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @since 2.0
+ */
+public void setTopPixel(int pixel) {
+    checkWidget();
+    if (getCharCount() is 0) {
+        return;
+    }
+    if (pixel < 0) pixel = 0;
+    int lineCount = content.getLineCount();
+    int height = clientAreaHeight - topMargin - bottomMargin;
+    int verticalOffset = getVerticalScrollOffset();
+    if (isFixedLineHeight()) {
+        int maxTopPixel = Math.max(0, lineCount * getVerticalIncrement() - height);
+        if (pixel > maxTopPixel) pixel = maxTopPixel;
+        pixel -= verticalOffset;
+    } else {
+        pixel -= verticalOffset;
+        if (pixel > 0) {
+            pixel = getAvailableHeightBellow(pixel);
+        }
+    }
+    scrollVertical(pixel, true);
+}
+/**
+ * Sets whether the widget wraps lines.
+ * <p>
+ * This overrides the creation style bit SWT.WRAP.
+ * </p>
+ *
+ * @param wrap true=widget wraps lines, false=widget does not wrap lines
+ * @since 2.0
+ */
+public void setWordWrap(bool wrap) {
+    checkWidget();
+    if ((getStyle() & SWT.SINGLE) !is 0) return;
+    if (wordWrap is wrap) return;
+    wordWrap = wrap;
+    setVariableLineHeight();
+    resetCache(0, content.getLineCount());
+    horizontalScrollOffset = 0;
+    ScrollBar horizontalBar = getHorizontalBar();
+    if (horizontalBar !is null) {
+        horizontalBar.setVisible(!wordWrap);
+    }
+    setScrollBars(true);
+    setCaretLocation();
+    super.redraw();
+}
+// SWT: If necessary, scroll to show the location
+bool showLocation(Rectangle rect, bool scrollPage) {
+    int clientAreaWidth = this.clientAreaWidth - leftMargin - rightMargin;
+    int clientAreaHeight = this.clientAreaHeight - topMargin - bottomMargin;
+    bool scrolled = false;
+    if (rect.y <= topMargin) {
+        scrolled = scrollVertical(rect.y - topMargin, true);
+    } else if (rect.y + rect.height > clientAreaHeight) {
+        if (clientAreaHeight is 0) {
+            scrolled = scrollVertical(rect.y, true);
+        } else {
+            scrolled = scrollVertical(rect.y + rect.height - clientAreaHeight, true);
+        }
+    }
+    if (clientAreaWidth > 0) {
+        int minScroll = scrollPage ? clientAreaWidth / 4 : 0;
+        if (rect.x < leftMargin) {
+            int scrollWidth = Math.max(leftMargin - rect.x, minScroll);
+            int maxScroll = horizontalScrollOffset;
+            scrolled = scrollHorizontal(-Math.min(maxScroll, scrollWidth), true);
+        } else if (rect.x + rect.width > clientAreaWidth) {
+            int scrollWidth =  Math.max(rect.x + rect.width - clientAreaWidth, minScroll);
+            int maxScroll = renderer.getWidth() - horizontalScrollOffset - this.clientAreaWidth;
+            scrolled = scrollHorizontal(Math.min(maxScroll, scrollWidth), true);
+        }
+    }
+    return scrolled;
+}
+/**
+ * Sets the caret location and scrolls the caret offset into view.
+ */
+void showCaret() {
+    Rectangle bounds = getBoundsAtOffset(caretOffset);
+    if (!showLocation(bounds, true)) {
+        setCaretLocation();
+    }
+}
+/**
+ * Scrolls the selection into view.
+ * <p>
+ * The end of the selection will be scrolled into view.
+ * Note that if a right-to-left selection exists, the end of the selection is
+ * the visual beginning of the selection (i.e., where the caret is located).
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void showSelection() {
+    checkWidget();
+    // is selection from right-to-left?
+    bool rightToLeft = caretOffset is selection.x;
+    int startOffset, endOffset;
+    if (rightToLeft) {
+        startOffset = selection.y;
+        endOffset = selection.x;
+    } else {
+        startOffset = selection.x;
+        endOffset = selection.y;
+    }
+
+    Rectangle startBounds = getBoundsAtOffset(startOffset);
+    Rectangle endBounds = getBoundsAtOffset(endOffset);
+
+    // can the selection be fully displayed within the widget's visible width?
+    int w = clientAreaWidth - leftMargin - rightMargin;
+    bool selectionFits = rightToLeft ? startBounds.x - endBounds.x <= w : endBounds.x - startBounds.x <= w;
+    if (selectionFits) {
+        // show as much of the selection as possible by first showing
+        // the start of the selection
+        if (showLocation(startBounds, false)) {
+            // endX value could change if showing startX caused a scroll to occur
+            endBounds = getBoundsAtOffset(endOffset);
+        }
+        // the character at endOffset is not part of the selection
+        endBounds.width = 0;
+        showLocation(endBounds, false);
+    } else {
+        // just show the end of the selection since the selection start
+        // will not be visible
+        showLocation(endBounds, true);
+    }
+}
+/**
+ * Updates the selection and caret position depending on the text change.
+ * <p>
+ * If the selection intersects with the replaced text, the selection is
+ * reset and the caret moved to the end of the new text.
+ * If the selection is behind the replaced text it is moved so that the
+ * same text remains selected.  If the selection is before the replaced text
+ * it is left unchanged.
+ * </p>
+ *
+ * @param startOffset offset of the text change
+ * @param replacedLength length of text being replaced
+ * @param newLength length of new text
+ */
+void updateSelection(int startOffset, int replacedLength, int newLength) {
+    if (selection.y <= startOffset) {
+        // selection ends before text change
+        if (wordWrap) setCaretLocation();
+        return;
+    }
+    if (selection.x < startOffset) {
+        // clear selection fragment before text change
+        internalRedrawRange(selection.x, startOffset - selection.x);
+    }
+    if (selection.y > startOffset + replacedLength && selection.x < startOffset + replacedLength) {
+        // clear selection fragment after text change.
+        // do this only when the selection is actually affected by the
+        // change. Selection is only affected if it intersects the change (1GDY217).
+        int netNewLength = newLength - replacedLength;
+        int redrawStart = startOffset + newLength;
+        internalRedrawRange(redrawStart, selection.y + netNewLength - redrawStart);
+    }
+    if (selection.y > startOffset && selection.x < startOffset + replacedLength) {
+        // selection intersects replaced text. set caret behind text change
+        setSelection(startOffset + newLength, 0, true);
+    } else {
+        // move selection to keep same text selected
+        setSelection(selection.x + newLength - replacedLength, selection.y - selection.x, true);
+    }
+    setCaretLocation();
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/StyledTextContent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,217 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.StyledTextContent;
+
+import java.lang.all;
+
+import org.eclipse.swt.custom.TextChangeListener;
+/**
+ * Clients may implement the StyledTextContent interface to provide a
+ * custom store for the StyledText widget content. The StyledText widget
+ * interacts with its StyledTextContent in order to access and update
+ * the text that is being displayed and edited in the widget.
+ * A custom content implementation can be set in the widget using the
+ * StyledText.setContent API.
+ */
+public interface StyledTextContent {
+
+/**
+ * Called by StyledText to add itself as an Observer to content changes.
+ * See TextChangeListener for a description of the listener methods that
+ * are called when text changes occur.
+ * <p>
+ *
+ * @param listener the listener
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when listener is null</li>
+ * </ul>
+ */
+public void addTextChangeListener(TextChangeListener listener);
+
+/**
+ * Return the number of characters in the content.
+ * <p>
+ *
+ * @return the number of characters in the content.
+ */
+public int getCharCount();
+
+/**
+ * Return the line at the given line index without delimiters.
+ * <p>
+ *
+ * @param lineIndex index of the line to return. Does not include
+ *  delimiters of preceding lines. Index 0 is the first line of the
+ *  content.
+ * @return the line text without delimiters
+ */
+public String getLine(int lineIndex);
+
+/**
+ * Return the line index at the given character offset.
+ * <p>
+ *
+ * @param offset offset of the line to return. The first character of the
+ *  document is at offset 0.  An offset of getLength() is valid and should
+ *  answer the number of lines.
+ * @return the line index. The first line is at index 0.  If the character
+ *  at offset is a delimiter character, answer the line index of the line
+ *  that is delimited.
+ *  For example, if text = "\r\n\r\n", and delimiter = "\r\n", then:
+ * <ul>
+ * <li>getLineAtOffset(0) is 0
+ * <li>getLineAtOffset(1) is 0
+ * <li>getLineAtOffset(2) is 1
+ * <li>getLineAtOffset(3) is 1
+ * <li>getLineAtOffset(4) is 2
+ * </ul>
+ */
+public int getLineAtOffset(int offset);
+
+/**
+ * Return the number of lines.  Should answer 1 when no text is specified.
+ * The  StyledText widget relies on this behavior for drawing the cursor.
+ * <p>
+ *
+ * @return the number of lines.  For example:
+ * <ul>
+ * <li> text value is> getLineCount
+ * <li> null is> 1
+ * <li> "" is> 1
+ * <li> "a\n" is> 2
+ * <li> "\n\n" is> 3
+ * </ul>
+ */
+public int getLineCount();
+
+/**
+ * Return the line delimiter that should be used by the StyledText
+ * widget when inserting new lines. New lines entered using key strokes
+ * and paste operations use this line delimiter.
+ * Implementors may use System.getProperty("line.separator") to return
+ * the platform line delimiter.
+ * <p>
+ *
+ * @return the line delimiter that should be used by the StyledText widget
+ *  when inserting new lines.
+ */
+public String getLineDelimiter();
+
+/**
+ * Return the character offset of the first character of the given line.
+ * <p>
+ * <b>NOTE:</b> When there is no text (i.e., no lines), getOffsetAtLine(0)
+ * is a valid call that should return 0.
+ * </p>
+ *
+ * @param lineIndex index of the line. The first line is at index 0.
+ * @return offset offset of the first character of the line. The first
+ *  character of the document is at offset 0.  The return value should
+ *  include line delimiters.
+ *  For example, if text = "\r\ntest\r\n" and delimiter = "\r\n", then:
+ * <ul>
+ * <li>getOffsetAtLine(0) is 0
+ * <li>getOffsetAtLine(1) is 2
+ * <li>getOffsetAtLine(2) is 8
+ * </ul>
+ */
+public int getOffsetAtLine(int lineIndex);
+
+/**
+ * Returns a string representing the content at the given range.
+ * <p>
+ *
+ * @param start the start offset of the text to return. Offset 0 is the
+ *  first character of the document.
+ * @param length the length of the text to return
+ * @return the text at the given range
+ */
+public String getTextRange(int start, int length);
+
+/**
+ * Remove the specified text changed listener.
+ * <p>
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when listener is null</li>
+ * </ul>
+ */
+public void removeTextChangeListener(TextChangeListener listener);
+
+/**
+ * Replace the text with "newText" starting at position "start"
+ * for a length of "replaceLength".
+ * <p>
+ * Implementors have to notify the TextChangeListeners that were added
+ * using <code>addTextChangeListener</code> before and after the content
+ * is changed. A <code>TextChangingEvent</code> has to be sent to the
+ * textChanging method before the content is changed and a
+ * <code>TextChangedEvent</code> has to be sent to the textChanged method
+ * after the content has changed.
+ * The text change that occurs after the <code>TextChangingEvent</code>
+ * has been sent has to be consistent with the data provided in the
+ * <code>TextChangingEvent</code>.
+ * This data will be cached by the widget and will be used when the
+ * <code>TextChangedEvent</code> is received.
+ * <p>
+ * The <code>TextChangingEvent</code> should be set as follows:
+ * <ul>
+ * <li>event.start = start of the replaced text
+ * <li>event.newText = text that is going to be inserted or empty String
+ *  if no text will be inserted
+ * <li>event.replaceCharCount = length of text that is going to be replaced
+ * <li>event.newCharCount = length of text that is going to be inserted
+ * <li>event.replaceLineCount = number of lines that are going to be replaced
+ * <li>event.newLineCount = number of new lines that are going to be inserted
+ * </ul>
+ * <b>NOTE:</b> newLineCount is the number of inserted lines and replaceLineCount
+ * is the number of deleted lines based on the change that occurs visually.
+ * For example:
+ * <ul>
+ * <li>(replaceText, newText) is> (replaceLineCount, newLineCount)
+ * <li>("", "\n") is> (0, 1)
+ * <li>("\n\n", "a") is> (2, 0)
+ * <li>("a", "\n\n") is> (0, 2)
+ * <li>("\n", "") is> (1, 0)
+ * </ul>
+ * </p>
+ *
+ * @param start start offset of text to replace, none of the offsets include
+ *  delimiters of preceding lines, offset 0 is the first character of the
+ *  document
+ * @param replaceLength length of text to replace
+ * @param text text to replace
+ * @see TextChangeListener
+ */
+public void replaceTextRange(int start, int replaceLength, String text);
+
+/**
+ * Set text to "text".
+ * Implementors have to send a <code>TextChangedEvent</code> to the
+ * textSet method of the TextChangeListeners that were added using
+ * <code>addTextChangeListener</code>.
+ * <p>
+ *
+ * @param text the new text
+ * @see TextChangeListener
+ */
+public void setText(String text);
+
+/++
+ + SWT Extension
+ +/
+int utf8AdjustOffset( int offset );
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/StyledTextDropTargetEffect.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,257 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.StyledTextDropTargetEffect;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.DropTargetAdapter;
+import org.eclipse.swt.dnd.DropTargetEffect;
+import org.eclipse.swt.dnd.DropTargetEvent;
+import org.eclipse.swt.graphics.FontMetrics;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.custom.StyledTextContent;
+
+static import tango.core.Exception;
+import java.lang.all;
+
+/**
+ * This adapter class provides a default drag under effect (eg. select and scroll)
+ * when a drag occurs over a <code>StyledText</code>.
+ *
+ * <p>Classes that wish to provide their own drag under effect for a <code>StyledText</code>
+ * can extend this class, override the <code>StyledTextDropTargetEffect.dragOver</code>
+ * method and override any other applicable methods in <code>StyledTextDropTargetEffect</code> to
+ * display their own drag under effect.</p>
+ *
+ * Subclasses that override any methods of this class should call the corresponding
+ * <code>super</code> method to get the default drag under effect implementation.
+ *
+ * <p>The feedback value is either one of the FEEDBACK constants defined in
+ * class <code>DND</code> which is applicable to instances of this class,
+ * or it must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>DND</code> effect constants.
+ * </p>
+ * <p>
+ * <dl>
+ * <dt><b>Feedback:</b></dt>
+ * <dd>FEEDBACK_SELECT, FEEDBACK_SCROLL</dd>
+ * </dl>
+ * </p>
+ *
+ * @see DropTargetAdapter
+ * @see DropTargetEvent
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.3
+ */
+public class StyledTextDropTargetEffect : DropTargetEffect {
+    static final int CARET_WIDTH = 2;
+    static final int SCROLL_HYSTERESIS = 100; // milli seconds
+    static final int SCROLL_TOLERANCE = 20; // pixels
+
+    int currentOffset = -1;
+    long scrollBeginTime;
+    int scrollX = -1, scrollY = -1;
+    Listener paintListener;
+
+    /**
+     * Creates a new <code>StyledTextDropTargetEffect</code> to handle the drag under effect on the specified
+     * <code>StyledText</code>.
+     *
+     * @param styledText the <code>StyledText</code> over which the user positions the cursor to drop the data
+     */
+    public this(StyledText styledText) {
+        super(styledText);
+        paintListener = new class() Listener {
+            public void handleEvent (Event event) {
+                if (currentOffset !is -1) {
+                    StyledText text = cast(StyledText) getControl();
+                    Point position = text.getLocationAtOffset(currentOffset);
+                    int height = text.getLineHeight(currentOffset);
+                    event.gc.setBackground(event.display.getSystemColor (SWT.COLOR_BLACK));
+                    event.gc.fillRectangle(position.x, position.y, CARET_WIDTH, height);
+                }
+            }
+        };
+    }
+
+    /**
+     * This implementation of <code>dragEnter</code> provides a default drag under effect
+     * for the feedback specified in <code>event.feedback</code>.
+     *
+     * For additional information see <code>DropTargetAdapter.dragEnter</code>.
+     *
+     * Subclasses that override this method should call <code>super.dragEnter(event)</code>
+     * to get the default drag under effect implementation.
+     *
+     * @param event  the information associated with the drag start event
+     *
+     * @see DropTargetAdapter
+     * @see DropTargetEvent
+     */
+    public override void dragEnter(DropTargetEvent event) {
+        currentOffset = -1;
+        scrollBeginTime = 0;
+        scrollX = -1;
+        scrollY = -1;
+        getControl().removeListener(SWT.Paint, paintListener);
+        getControl().addListener (SWT.Paint, paintListener);
+    }
+
+    /**
+     * This implementation of <code>dragLeave</code> provides a default drag under effect
+     * for the feedback specified in <code>event.feedback</code>.
+     *
+     * For additional information see <code>DropTargetAdapter.dragLeave</code>.
+     *
+     * Subclasses that override this method should call <code>super.dragLeave(event)</code>
+     * to get the default drag under effect implementation.
+     *
+     * @param event  the information associated with the drag leave event
+     *
+     * @see DropTargetAdapter
+     * @see DropTargetEvent
+     */
+    public override void dragLeave(DropTargetEvent event) {
+        StyledText text = cast(StyledText) getControl();
+        if (currentOffset !is -1) {
+            refreshCaret(text, currentOffset, -1);
+        }
+        text.removeListener(SWT.Paint, paintListener);
+        scrollBeginTime = 0;
+        scrollX = -1;
+        scrollY = -1;
+    }
+
+    /**
+     * This implementation of <code>dragOver</code> provides a default drag under effect
+     * for the feedback specified in <code>event.feedback</code>.
+     *
+     * For additional information see <code>DropTargetAdapter.dragOver</code>.
+     *
+     * Subclasses that override this method should call <code>super.dragOver(event)</code>
+     * to get the default drag under effect implementation.
+     *
+     * @param event  the information associated with the drag over event
+     *
+     * @see DropTargetAdapter
+     * @see DropTargetEvent
+     * @see DND#FEEDBACK_SELECT
+     * @see DND#FEEDBACK_SCROLL
+     */
+    public override void dragOver(DropTargetEvent event) {
+        int effect = event.feedback;
+        StyledText text = cast(StyledText) getControl();
+
+        Point pt = text.getDisplay().map(null, text, event.x, event.y);
+        if ((effect & DND.FEEDBACK_SCROLL) is 0) {
+            scrollBeginTime = 0;
+            scrollX = scrollY = -1;
+        } else {
+            if (text.getCharCount() is 0) {
+                scrollBeginTime = 0;
+                scrollX = scrollY = -1;
+            } else {
+                if (scrollX !is -1 && scrollY !is -1 && scrollBeginTime !is 0 &&
+                    (pt.x >= scrollX && pt.x <= (scrollX + SCROLL_TOLERANCE) ||
+                     pt.y >= scrollY && pt.y <= (scrollY + SCROLL_TOLERANCE))) {
+                    if (System.currentTimeMillis() >= scrollBeginTime) {
+                        Rectangle area = text.getClientArea();
+                        GC gc = new GC(text);
+                        FontMetrics fm = gc.getFontMetrics();
+                        gc.dispose();
+                        int charWidth = fm.getAverageCharWidth();
+                        int scrollAmount = 10*charWidth;
+                        if (pt.x < area.x + 3*charWidth) {
+                            int leftPixel = text.getHorizontalPixel();
+                            text.setHorizontalPixel(leftPixel - scrollAmount);
+                        }
+                        if (pt.x > area.width - 3*charWidth) {
+                            int leftPixel = text.getHorizontalPixel();
+                            text.setHorizontalPixel(leftPixel + scrollAmount);
+                        }
+                        int lineHeight = text.getLineHeight();
+                        if (pt.y < area.y + lineHeight) {
+                            int topPixel = text.getTopPixel();
+                            text.setTopPixel(topPixel - lineHeight);
+                        }
+                        if (pt.y > area.height - lineHeight) {
+                            int topPixel = text.getTopPixel();
+                            text.setTopPixel(topPixel + lineHeight);
+                        }
+                        scrollBeginTime = 0;
+                        scrollX = scrollY = -1;
+                    }
+                } else {
+                    scrollBeginTime = System.currentTimeMillis() + SCROLL_HYSTERESIS;
+                    scrollX = pt.x;
+                    scrollY = pt.y;
+                }
+            }
+        }
+
+        if ((effect & DND.FEEDBACK_SELECT) !is 0) {
+            int[] trailing = new int [1];
+            int newOffset = text.getOffsetAtPoint(pt.x, pt.y, trailing, false);
+            newOffset += trailing [0];
+            if (newOffset !is currentOffset) {
+                refreshCaret(text, currentOffset, newOffset);
+                currentOffset = newOffset;
+            }
+        }
+    }
+
+    void refreshCaret(StyledText text, int oldOffset, int newOffset) {
+        if (oldOffset !is newOffset) {
+            if (oldOffset !is -1) {
+                Point oldPos = text.getLocationAtOffset(oldOffset);
+                int oldHeight = text.getLineHeight(oldOffset);
+                text.redraw (oldPos.x, oldPos.y, CARET_WIDTH, oldHeight, false);
+            }
+            if (newOffset !is -1) {
+                Point newPos = text.getLocationAtOffset(newOffset);
+                int newHeight = text.getLineHeight(newOffset);
+                text.redraw (newPos.x, newPos.y, CARET_WIDTH, newHeight, false);
+            }
+        }
+    }
+
+    /**
+     * This implementation of <code>dropAccept</code> provides a default drag under effect
+     * for the feedback specified in <code>event.feedback</code>.
+     *
+     * For additional information see <code>DropTargetAdapter.dropAccept</code>.
+     *
+     * Subclasses that override this method should call <code>super.dropAccept(event)</code>
+     * to get the default drag under effect implementation.
+     *
+     * @param event  the information associated with the drop accept event
+     *
+     * @see DropTargetAdapter
+     * @see DropTargetEvent
+     */
+    public override void dropAccept(DropTargetEvent event) {
+        if (currentOffset !is -1) {
+            StyledText text = cast(StyledText) getControl();
+            text.setSelection(currentOffset);
+            currentOffset = -1;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/StyledTextEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.StyledTextEvent;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.custom.Bullet;
+import org.eclipse.swt.custom.StyledTextContent;
+
+/**
+ *
+ */
+class StyledTextEvent : Event {
+    // used by LineStyleEvent
+    int[] ranges;
+    StyleRange[] styles;
+    int alignment;
+    int indent;
+    bool justify;
+    Bullet bullet;
+    int bulletIndex;
+    // used by LineBackgroundEvent
+    Color lineBackground;
+    // used by BidiSegmentEvent
+    int[] segments;
+    // used by TextChangedEvent
+    int replaceCharCount;
+    int newCharCount;
+    int replaceLineCount;
+    int newLineCount;
+    // used by PaintObjectEvent
+    int x;
+    int y;
+    int ascent;
+    int descent;
+    StyleRange style;
+
+this (StyledTextContent content) {
+    data = cast(Object)content;
+}
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/StyledTextListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,122 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.StyledTextListener;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.events.VerifyEvent;
+import org.eclipse.swt.internal.SWTEventListener;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.custom.ExtendedModifyEvent;
+import org.eclipse.swt.custom.ExtendedModifyListener;
+import org.eclipse.swt.custom.StyledTextEvent;
+import org.eclipse.swt.custom.LineBackgroundEvent;
+import org.eclipse.swt.custom.BidiSegmentEvent;
+import org.eclipse.swt.custom.LineStyleEvent;
+import org.eclipse.swt.custom.PaintObjectEvent;
+import org.eclipse.swt.custom.MovementEvent;
+import org.eclipse.swt.custom.TextChangedEvent;
+import org.eclipse.swt.custom.TextChangingEvent;
+import org.eclipse.swt.custom.LineBackgroundListener;
+import org.eclipse.swt.custom.BidiSegmentListener;
+import org.eclipse.swt.custom.LineStyleListener;
+import org.eclipse.swt.custom.PaintObjectListener;
+import org.eclipse.swt.custom.VerifyKeyListener;
+import org.eclipse.swt.custom.StyledTextContent;
+import org.eclipse.swt.custom.TextChangeListener;
+import org.eclipse.swt.custom.MovementListener;
+
+
+class StyledTextListener : TypedListener {
+/**
+ */
+this(SWTEventListener listener) {
+    super(listener);
+}
+/**
+ * Process StyledText events by invoking the event's handler.
+ *
+ * @param e the event to handle
+ */
+public override void handleEvent(Event e) {
+
+    switch (e.type) {
+        case StyledText.ExtendedModify:
+            ExtendedModifyEvent extendedModifyEvent = new ExtendedModifyEvent(cast(StyledTextEvent) e);
+            (cast(ExtendedModifyListener) eventListener).modifyText(extendedModifyEvent);
+            break;
+        case StyledText.LineGetBackground:
+            LineBackgroundEvent lineBgEvent = new LineBackgroundEvent(cast(StyledTextEvent) e);
+            (cast(LineBackgroundListener) eventListener).lineGetBackground(lineBgEvent);
+            (cast(StyledTextEvent) e).lineBackground = lineBgEvent.lineBackground;
+            break;
+        case StyledText.LineGetSegments:
+            BidiSegmentEvent segmentEvent = new BidiSegmentEvent(cast(StyledTextEvent) e);
+            (cast(BidiSegmentListener) eventListener).lineGetSegments(segmentEvent);
+            (cast(StyledTextEvent) e).segments = segmentEvent.segments;
+            break;
+        case StyledText.LineGetStyle:
+            LineStyleEvent lineStyleEvent = new LineStyleEvent(cast(StyledTextEvent) e);
+            (cast(LineStyleListener) eventListener).lineGetStyle(lineStyleEvent);
+            (cast(StyledTextEvent) e).ranges = lineStyleEvent.ranges;
+            (cast(StyledTextEvent) e).styles = lineStyleEvent.styles;
+            (cast(StyledTextEvent) e).alignment = lineStyleEvent.alignment;
+            (cast(StyledTextEvent) e).indent = lineStyleEvent.indent;
+            (cast(StyledTextEvent) e).justify = lineStyleEvent.justify;
+            (cast(StyledTextEvent) e).bullet = lineStyleEvent.bullet;
+            (cast(StyledTextEvent) e).bulletIndex = lineStyleEvent.bulletIndex;
+            break;
+        case StyledText.PaintObject:
+            PaintObjectEvent paintObjectEvent = new PaintObjectEvent(cast(StyledTextEvent) e);
+            (cast(PaintObjectListener) eventListener).paintObject(paintObjectEvent);
+            break;
+        case StyledText.VerifyKey:
+            VerifyEvent verifyEvent = new VerifyEvent(e);
+            (cast(VerifyKeyListener) eventListener).verifyKey(verifyEvent);
+            e.doit = verifyEvent.doit;
+            break;
+        case StyledText.TextChanged: {
+            TextChangedEvent textChangedEvent = new TextChangedEvent(cast(StyledTextContent) e.data);
+            (cast(TextChangeListener) eventListener).textChanged(textChangedEvent);
+            break;
+        }
+        case StyledText.TextChanging:
+            TextChangingEvent textChangingEvent = new TextChangingEvent(cast(StyledTextContent) e.data, cast(StyledTextEvent) e);
+            (cast(TextChangeListener) eventListener).textChanging(textChangingEvent);
+            break;
+        case StyledText.TextSet: {
+            TextChangedEvent textChangedEvent = new TextChangedEvent(cast(StyledTextContent) e.data);
+            (cast(TextChangeListener) eventListener).textSet(textChangedEvent);
+            break;
+        }
+        case StyledText.WordNext: {
+            MovementEvent wordBoundaryEvent = new MovementEvent(cast(StyledTextEvent) e);
+            (cast(MovementListener) eventListener).getNextOffset(wordBoundaryEvent);
+            (cast(StyledTextEvent) e).end = wordBoundaryEvent.newOffset;
+            break;
+        }
+        case StyledText.WordPrevious: {
+            MovementEvent wordBoundaryEvent = new MovementEvent(cast(StyledTextEvent) e);
+            (cast(MovementListener) eventListener).getPreviousOffset(wordBoundaryEvent);
+            (cast(StyledTextEvent) e).end = wordBoundaryEvent.newOffset;
+            break;
+        }
+        default:
+    }
+}
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/StyledTextPrintOptions.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.StyledTextPrintOptions;
+
+import java.lang.all;
+
+/**
+ * Use StyledTextPrintOptions to specify printing options for the
+ * StyledText.print(Printer, StyledTextPrintOptions) API.
+ * <p>
+ * The following example prints a right aligned page number in the footer,
+ * sets the job name to "Example" and prints line background colors but no other
+ * formatting:
+ * </p>
+ * <pre>
+ * StyledTextPrintOptions options = new StyledTextPrintOptions();
+ * options.footer = "\t\t&lt;page&gt;";
+ * options.jobName = "Example";
+ * options.printLineBackground = true;
+ *
+ * Runnable runnable = styledText.print(new Printer(), options);
+ * runnable.run();
+ * </pre>
+ *
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 2.1
+ */
+public class StyledTextPrintOptions {
+    /**
+     * Page number placeholder constant for use in <code>header</code>
+     * and <code>footer</code>. Value is <code>&lt;page&gt;</code>
+     */
+    public static final String PAGE_TAG = "<page>";
+    /**
+     * Separator constant for use in <code>header</code> and
+     * <code>footer</code>. Value is <code>\t</code>
+     */
+    public static final String SEPARATOR = "\t";
+    /**
+     * Formatted text to print in the header of each page.
+     * <p>"left '\t' center '\t' right"</p>
+     * <p>left, center, right = &lt;page&gt; | #CDATA</p>
+     * <p>Header and footer are defined as three separate regions for arbitrary
+     * text or the page number placeholder &lt;page&gt;
+     * (<code>StyledTextPrintOptions.PAGE_TAG</code>). The three regions are
+     * left aligned, centered and right aligned. They are separated by a tab
+     * character (<code>StyledTextPrintOptions.SEPARATOR</code>).
+     */
+    public String header = null;
+    /**
+     * Formatted text to print in the footer of each page.
+     * <p>"left '\t' center '\t' right"</p>
+     * <p>left, center, right = &lt;page&gt; | #CDATA</p>
+     * <p>Header and footer are defined as three separate regions for arbitrary
+     * text or the page number placeholder &lt;page&gt;
+     * (<code>StyledTextPrintOptions.PAGE_TAG</code>). The three regions are
+     * left aligned, centered and right aligned. They are separated by a tab
+     * character (<code>StyledTextPrintOptions.SEPARATOR</code>).
+     */
+    public String footer = null;
+    /**
+     * Name of the print job.
+     */
+    public String jobName = null;
+
+    /**
+     * Print the text foreground color. Default value is <code>false</code>.
+     */
+    public bool printTextForeground = false;
+    /**
+     * Print the text background color. Default value is <code>false</code>.
+     */
+    public bool printTextBackground = false;
+    /**
+     * Print the font styles. Default value is <code>false</code>.
+     */
+    public bool printTextFontStyle = false;
+    /**
+     * Print the line background color. Default value is <code>false</code>.
+     */
+    public bool printLineBackground = false;
+
+    /**
+     * Print line numbers. Default value is <code>false</code>.
+     *
+     * @since 3.3
+     */
+    public bool printLineNumbers = false;
+
+    /**
+     * Labels used for printing line numbers.
+     * 
+     * @since 3.4
+     */
+    public String[] lineLabels = null;
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/StyledTextRenderer.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,1550 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.StyledTextRenderer;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.FontMetrics;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.GlyphMetrics;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.TextLayout;
+import org.eclipse.swt.graphics.TextStyle;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.IME;
+import org.eclipse.swt.widgets.ScrollBar;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.custom.Bullet;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.custom.StyledTextContent;
+import org.eclipse.swt.custom.TextChangingEvent;
+import org.eclipse.swt.custom.ST;
+import org.eclipse.swt.custom.StyledTextEvent;
+
+import java.lang.all;
+
+static import tango.text.Util;
+static import tango.text.convert.Utf;
+import tango.util.Convert;
+
+/**
+ * A StyledTextRenderer renders the content of a StyledText widget.
+ * This class can be used to render to the display or to a printer.
+ */
+class StyledTextRenderer {
+    Device device;
+    StyledText styledText;
+    StyledTextContent content;
+
+    /* Font info */
+    Font regularFont, boldFont, italicFont, boldItalicFont;
+    int tabWidth;
+    int ascent, descent;
+    int averageCharWidth;
+
+    /* Line data */
+    int topIndex = -1;
+    TextLayout[] layouts;
+    int lineCount;
+    int[] lineWidth;
+    int[] lineHeight;
+    LineInfo[] lines;
+    int maxWidth;
+    int maxWidthLineIndex;
+    bool idleRunning;
+
+    /* Bullet */
+    Bullet[] bullets;
+    int[] bulletsIndices;
+    int[] redrawLines;
+
+    /* Style data */
+    int[] ranges;
+    int styleCount;
+    StyleRange[] styles;
+    StyleRange[] stylesSet;
+    int stylesSetCount = 0;
+    final static int BULLET_MARGIN = 8;
+
+    final static bool COMPACT_STYLES = true;
+    final static bool MERGE_STYLES = true;
+
+    final static int GROW = 32;
+    final static int IDLE_TIME = 50;
+    final static int CACHE_SIZE = 128;
+
+    final static int BACKGROUND = 1 << 0;
+    final static int ALIGNMENT = 1 << 1;
+    final static int INDENT = 1 << 2;
+    final static int JUSTIFY = 1 << 3;
+    final static int SEGMENTS = 1 << 5;
+
+    static class LineInfo {
+        int flags;
+        Color background;
+        int alignment;
+        int indent;
+        bool justify;
+        int[] segments;
+
+        public this() {
+        }
+        public this(LineInfo info) {
+            if (info !is null) {
+                flags = info.flags;
+                background = info.background;
+                alignment = info.alignment;
+                indent = info.indent;
+                justify = info.justify;
+                segments = info.segments;
+            }
+        }
+    }
+
+this(Device device, StyledText styledText) {
+    this.device = device;
+    this.styledText = styledText;
+}
+int addMerge(int[] mergeRanges, StyleRange[] mergeStyles, int mergeCount, int modifyStart, int modifyEnd) {
+    int rangeCount = styleCount << 1;
+    StyleRange endStyle = null;
+    int endStart = 0, endLength = 0;
+    if (modifyEnd < rangeCount) {
+        endStyle = styles[modifyEnd >> 1];
+        endStart = ranges[modifyEnd];
+        endLength = ranges[modifyEnd + 1];
+    }
+    int grow = mergeCount - (modifyEnd - modifyStart);
+    if (rangeCount + grow >= ranges.length) {
+        int[] tmpRanges = new int[ranges.length + grow + (GROW << 1)];
+        System.arraycopy(ranges, 0, tmpRanges, 0, modifyStart);
+        StyleRange[] tmpStyles = new StyleRange[styles.length + (grow >> 1) + GROW];
+        System.arraycopy(styles, 0, tmpStyles, 0, modifyStart >> 1);
+        if (rangeCount > modifyEnd) {
+            System.arraycopy(ranges, modifyEnd, tmpRanges, modifyStart + mergeCount, rangeCount - modifyEnd);
+            System.arraycopy(styles, modifyEnd >> 1, tmpStyles, (modifyStart + mergeCount) >> 1, styleCount - (modifyEnd >> 1));
+        }
+        ranges = tmpRanges;
+        styles = tmpStyles;
+    } else {
+        if (rangeCount > modifyEnd) {
+            System.arraycopy(ranges, modifyEnd, ranges, modifyStart + mergeCount, rangeCount - modifyEnd);
+            System.arraycopy(styles, modifyEnd >> 1, styles, (modifyStart + mergeCount) >> 1, styleCount - (modifyEnd >> 1));
+        }
+    }
+    if (MERGE_STYLES) {
+        int j = modifyStart;
+        for (int i = 0; i < mergeCount; i += 2) {
+            if (j > 0 && ranges[j - 2] + ranges[j - 1] is mergeRanges[i] && mergeStyles[i >> 1].similarTo(styles[(j - 2) >> 1])) {
+                ranges[j - 1] += mergeRanges[i + 1];
+            } else {
+                styles[j >> 1] = mergeStyles[i >> 1];
+                ranges[j++] = mergeRanges[i];
+                ranges[j++] = mergeRanges[i + 1];
+            }
+        }
+        if (endStyle !is null && ranges[j - 2] + ranges[j - 1] is endStart && endStyle.similarTo(styles[(j - 2) >> 1])) {
+            ranges[j - 1] += endLength;
+            modifyEnd += 2;
+            mergeCount += 2;
+        }
+        if (rangeCount > modifyEnd) {
+            System.arraycopy(ranges, modifyStart + mergeCount, ranges, j, rangeCount - modifyEnd);
+            System.arraycopy(styles, (modifyStart + mergeCount) >> 1, styles, j >> 1, styleCount - (modifyEnd >> 1));
+        }
+        grow = (j - modifyStart) - (modifyEnd - modifyStart);
+    } else {
+        System.arraycopy(mergeRanges, 0, ranges, modifyStart, mergeCount);
+        System.arraycopy(mergeStyles, 0, styles, modifyStart >> 1, mergeCount >> 1);
+    }
+    styleCount += grow >> 1;
+    return grow;
+}
+int addMerge(StyleRange[] mergeStyles, int mergeCount, int modifyStart, int modifyEnd) {
+    int grow = mergeCount - (modifyEnd - modifyStart);
+    StyleRange endStyle = null;
+    if (modifyEnd < styleCount) endStyle = styles[modifyEnd];
+    if (styleCount + grow >= styles.length) {
+        StyleRange[] tmpStyles = new StyleRange[styles.length + grow + GROW];
+        System.arraycopy(styles, 0, tmpStyles, 0, modifyStart);
+        if (styleCount > modifyEnd) {
+            System.arraycopy(styles, modifyEnd, tmpStyles, modifyStart + mergeCount, styleCount - modifyEnd);
+        }
+        styles = tmpStyles;
+    } else {
+        if (styleCount > modifyEnd) {
+            System.arraycopy(styles, modifyEnd, styles, modifyStart + mergeCount, styleCount - modifyEnd);
+        }
+    }
+    if (MERGE_STYLES) {
+        int j = modifyStart;
+        for (int i = 0; i < mergeCount; i++) {
+            StyleRange newStyle = mergeStyles[i], style;
+            if (j > 0 && (style = styles[j - 1]).start + style.length is newStyle.start && newStyle.similarTo(style)) {
+                style.length += newStyle.length;
+            } else {
+                styles[j++] = newStyle;
+            }
+        }
+        StyleRange style = styles[j - 1];
+        if (endStyle !is null && style.start + style.length is endStyle.start && endStyle.similarTo(style)) {
+            style.length += endStyle.length;
+            modifyEnd++;
+            mergeCount++;
+        }
+        if (styleCount > modifyEnd) {
+            System.arraycopy(styles, modifyStart + mergeCount, styles, j, styleCount - modifyEnd);
+        }
+        grow = (j - modifyStart) - (modifyEnd - modifyStart);
+    } else {
+        System.arraycopy(mergeStyles, 0, styles, modifyStart, mergeCount);
+    }
+    styleCount += grow;
+    return grow;
+}
+void calculate(int startLine, int lineCount) {
+    int endLine = startLine + lineCount;
+    if (startLine < 0 || endLine > lineWidth.length) {
+        return;
+    }
+    int hTrim = styledText.leftMargin + styledText.rightMargin + styledText.getCaretWidth();
+    for (int i = startLine; i < endLine; i++) {
+        if (lineWidth[i] is -1 || lineHeight[i] is -1) {
+            TextLayout layout = getTextLayout(i);
+            Rectangle rect = layout.getBounds();
+            lineWidth[i] = rect.width + hTrim;
+            lineHeight[i] = rect.height;
+            disposeTextLayout(layout);
+        }
+        if (lineWidth[i] > maxWidth) {
+            maxWidth = lineWidth[i];
+            maxWidthLineIndex = i;
+        }
+    }
+}
+void calculateClientArea () {
+    int index = styledText.getTopIndex();
+    int lineCount = content.getLineCount();
+    int height = styledText.getClientArea().height;
+    int y = 0;
+    while (height > y && lineCount > index) {
+        calculate(index, 1);
+        y += lineHeight[index++];
+    }
+}
+void calculateIdle () {
+    if (idleRunning) return;
+    Runnable runnable = new class() Runnable {
+        public void run() {
+            if (styledText is null) return;
+            int i;
+            long start = System.currentTimeMillis();
+            for (i = 0; i < lineCount; i++) {
+                if (lineHeight[i] is -1 || lineWidth[i] is -1) {
+                    calculate(i, 1);
+                    if (System.currentTimeMillis() - start > IDLE_TIME) break;
+                }
+            }
+            if (i < lineCount) {
+                Display display = styledText.getDisplay();
+                display.asyncExec(this);
+            } else {
+                idleRunning = false;
+                styledText.setScrollBars(true);
+                ScrollBar bar = styledText.getVerticalBar();
+                if (bar !is null) {
+                    bar.setSelection(styledText.getVerticalScrollOffset());
+                }
+            }
+        }
+    };
+    Display display = styledText.getDisplay();
+    display.asyncExec(runnable);
+    idleRunning = true;
+}
+void clearLineBackground(int startLine, int count) {
+    if (lines is null) return;
+    for (int i = startLine; i < startLine + count; i++) {
+        LineInfo info = lines[i];
+        if (info !is null) {
+            info.flags &= ~BACKGROUND;
+            info.background = null;
+            if (info.flags is 0) lines[i] = null;
+        }
+    }
+}
+void clearLineStyle(int startLine, int count) {
+    if (lines is null) return;
+    for (int i = startLine; i < startLine + count; i++) {
+        LineInfo info = lines[i];
+        if (info !is null) {
+            info.flags &= ~(ALIGNMENT | INDENT | JUSTIFY);
+            if (info.flags is 0) lines[i] = null;
+        }
+    }
+}
+void copyInto(StyledTextRenderer renderer) {
+    if (ranges !is null) {
+        int[] newRanges = renderer.ranges = new int[styleCount << 1];
+        System.arraycopy(ranges, 0, newRanges, 0, newRanges.length);
+    }
+    if (styles !is null) {
+        StyleRange[] newStyles = renderer.styles = new StyleRange[styleCount];
+        for (int i = 0; i < newStyles.length; i++) {
+            newStyles[i] = cast(StyleRange)styles[i].clone();
+        }
+        renderer.styleCount = styleCount;
+    }
+    if (lines !is null) {
+        LineInfo[] newLines = renderer.lines = new LineInfo[lineCount];
+        for (int i = 0; i < newLines.length; i++) {
+            newLines[i] = new LineInfo(lines[i]);
+        }
+        renderer.lineCount = lineCount;
+    }
+}
+void dispose() {
+    if (boldFont !is null) boldFont.dispose();
+    if (italicFont !is null) italicFont.dispose();
+    if (boldItalicFont !is null) boldItalicFont.dispose();
+    boldFont = italicFont = boldItalicFont = null;
+    reset();
+    content = null;
+    device = null;
+    styledText = null;
+}
+void disposeTextLayout (TextLayout layout) {
+    if (layouts !is null) {
+        for (int i = 0; i < layouts.length; i++) {
+            if (layouts[i] is layout) return;
+        }
+    }
+    layout.dispose();
+}
+void drawBullet(Bullet bullet, GC gc, int paintX, int paintY, int index, int lineAscent, int lineDescent) {
+    StyleRange style = bullet.style;
+    GlyphMetrics metrics = style.metrics;
+    Color color = style.foreground;
+    if (color !is null) gc.setForeground(color);
+    if ((bullet.type & ST.BULLET_DOT) !is 0 && StyledText.IS_MOTIF) {
+        int size = Math.max(4, (lineAscent + lineDescent) / 4);
+        if ((size & 1) is 0) size++;
+        if (color is null) {
+            Display display = styledText.getDisplay();
+            color = display.getSystemColor(SWT.COLOR_BLACK);
+        }
+        gc.setBackground(color);
+        int x = paintX + Math.max(0, metrics.width - size - BULLET_MARGIN);
+        gc.fillArc(x, paintY + size, size + 1, size + 1, 0, 360);
+        return;
+    }
+    Font font = style.font;
+    if (font !is null) gc.setFont(font);
+    String string = "";
+    int type = bullet.type & (ST.BULLET_DOT|ST.BULLET_NUMBER|ST.BULLET_LETTER_LOWER|ST.BULLET_LETTER_UPPER);
+    switch (type) {
+        case ST.BULLET_DOT: string = "\u2022"; break;
+        case ST.BULLET_NUMBER: string = to!(String)(index); break;
+        case ST.BULLET_LETTER_LOWER: string = [cast(char) (index % 26 + 97)]; break;
+        case ST.BULLET_LETTER_UPPER: string = [cast(char) (index % 26 + 65)]; break;
+        default:
+    }
+    if ((bullet.type & ST.BULLET_TEXT) !is 0) string ~= bullet.text;
+    Display display = styledText.getDisplay();
+    TextLayout layout = new TextLayout(display);
+    layout.setText(string);
+    layout.setAscent(lineAscent);
+    layout.setDescent(lineDescent);
+    style = cast(StyleRange)style.clone();
+    style.metrics = null;
+    if (style.font is null) style.font = getFont(style.fontStyle);
+    layout.setStyle(style, 0, string.length);
+    int x = paintX + Math.max(0, metrics.width - layout.getBounds().width - BULLET_MARGIN);
+    layout.draw(gc, x, paintY);
+    layout.dispose();
+}
+int drawLine(int lineIndex, int paintX, int paintY, GC gc, Color widgetBackground, Color widgetForeground) {
+    TextLayout layout = getTextLayout(lineIndex);
+    String line = content.getLine(lineIndex);
+    int lineOffset = content.getOffsetAtLine(lineIndex);
+    int lineLength = line.length;
+    Point selection = styledText.getSelection();
+    int selectionStart = selection.x - lineOffset;
+    int selectionEnd = selection.y - lineOffset;
+    Rectangle client = styledText.getClientArea();
+    Color lineBackground = getLineBackground(lineIndex, null);
+    StyledTextEvent event = styledText.getLineBackgroundData(lineOffset, line);
+    if (event !is null && event.lineBackground !is null) lineBackground = event.lineBackground;
+
+    int height = layout.getBounds().height;
+    if (lineBackground !is null) {
+        gc.setBackground(lineBackground);
+        gc.fillRectangle(client.x, paintY, client.width, height);
+    } else {
+        gc.setBackground(widgetBackground);
+        styledText.drawBackground(gc, client.x, paintY, client.width, height);
+    }
+    gc.setForeground(widgetForeground);
+    if (selectionStart is selectionEnd || (selectionEnd <= 0 && selectionStart > lineLength - 1)) {
+        layout.draw(gc, paintX, paintY);
+    } else {
+        int start = Math.max(0, selectionStart);
+        int end = Math.min(lineLength, selectionEnd);
+        Color selectionFg = styledText.getSelectionForeground();
+        Color selectionBg = styledText.getSelectionBackground();
+        int flags;
+        if ((styledText.getStyle() & SWT.FULL_SELECTION) !is 0) {
+            flags = SWT.FULL_SELECTION;
+        } else {
+            flags = SWT.DELIMITER_SELECTION;
+        }
+        if (selectionStart <= lineLength && lineLength < selectionEnd ) {
+            flags |= SWT.LAST_LINE_SELECTION;
+        }
+        layout.draw(gc, paintX, paintY, start, end - 1, selectionFg, selectionBg, flags);
+    }
+
+    // draw objects
+    Bullet bullet = null;
+    int bulletIndex = -1;
+    if (bullets !is null) {
+        if (bulletsIndices !is null) {
+            int index = lineIndex - topIndex;
+            if (0 <= index && index < CACHE_SIZE) {
+                bullet = bullets[index];
+                bulletIndex = bulletsIndices[index];
+            }
+        } else {
+            for (int i = 0; i < bullets.length; i++) {
+                bullet = bullets[i];
+                bulletIndex = bullet.indexOf(lineIndex);
+                if (bulletIndex !is -1) break;
+            }
+        }
+    }
+    if (bulletIndex !is -1 && bullet !is null) {
+        FontMetrics metrics = layout.getLineMetrics(0);
+        int lineAscent = metrics.getAscent() + metrics.getLeading();
+        if (bullet.type is ST.BULLET_CUSTOM) {
+            bullet.style.start = lineOffset;
+            styledText.paintObject(gc, paintX, paintY, lineAscent, metrics.getDescent(), bullet.style, bullet, bulletIndex);
+        } else {
+            drawBullet(bullet, gc, paintX, paintY, bulletIndex, lineAscent, metrics.getDescent());
+        }
+    }
+    TextStyle[] styles = layout.getStyles();
+    int[] ranges = null;
+    for (int i = 0; i < styles.length; i++) {
+        if (styles[i].metrics !is null) {
+            if (ranges is null) ranges = layout.getRanges();
+            int start = ranges[i << 1];
+            int length = ranges[(i << 1) + 1] - start;
+            Point point = layout.getLocation(start, false);
+            FontMetrics metrics = layout.getLineMetrics(layout.getLineIndex(start));
+            StyleRange style = cast(StyleRange)(cast(StyleRange)styles[i]).clone();
+            style.start = start + lineOffset;
+            style.length = length;
+            int lineAscent = metrics.getAscent() + metrics.getLeading();
+            styledText.paintObject(gc, point.x + paintX, point.y + paintY, lineAscent, metrics.getDescent(), style, null, 0);
+        }
+    }
+    disposeTextLayout(layout);
+    return height;
+}
+int getBaseline() {
+    return ascent;
+}
+Font getFont(int style) {
+    switch (style) {
+        case SWT.BOLD:
+            if (boldFont !is null) return boldFont;
+            return boldFont = new Font(device, getFontData(style));
+        case SWT.ITALIC:
+            if (italicFont !is null) return italicFont;
+            return italicFont = new Font(device, getFontData(style));
+        case SWT.BOLD | SWT.ITALIC:
+            if (boldItalicFont !is null) return boldItalicFont;
+            return boldItalicFont = new Font(device, getFontData(style));
+        default:
+            return regularFont;
+    }
+}
+FontData[] getFontData(int style) {
+    FontData[] fontDatas = regularFont.getFontData();
+    for (int i = 0; i < fontDatas.length; i++) {
+        fontDatas[i].setStyle(style);
+    }
+    return fontDatas;
+}
+int getHeight () {
+    int defaultLineHeight = getLineHeight();
+    if (styledText.isFixedLineHeight()) {
+        return lineCount * defaultLineHeight;
+    }
+    int totalHeight = 0;
+    int width = styledText.getWrapWidth();
+    for (int i = 0; i < lineCount; i++) {
+        int height = lineHeight[i];
+        if (height is -1) {
+            if (width > 0) {
+                int length = content.getLine(i).length;
+                height = ((length * averageCharWidth / width) + 1) * defaultLineHeight;
+            } else {
+                height = defaultLineHeight;
+            }
+        }
+        totalHeight += height;
+    }
+    return totalHeight + styledText.topMargin + styledText.bottomMargin;
+}
+int getLineAlignment(int index, int defaultAlignment) {
+    if (lines is null) return defaultAlignment;
+    LineInfo info = lines[index];
+    if (info !is null && (info.flags & ALIGNMENT) !is 0) {
+        return info.alignment;
+    }
+    return defaultAlignment;
+}
+Color getLineBackground(int index, Color defaultBackground) {
+    if (lines is null) return defaultBackground;
+    LineInfo info = lines[index];
+    if (info !is null && (info.flags & BACKGROUND) !is 0) {
+        return info.background;
+    }
+    return defaultBackground;
+}
+Bullet getLineBullet (int index, Bullet defaultBullet) {
+    if (bullets is null) return defaultBullet;
+    if (bulletsIndices !is null) return defaultBullet;
+    for (int i = 0; i < bullets.length; i++) {
+        Bullet bullet = bullets[i];
+        if (bullet.indexOf(index) !is -1) return bullet;
+    }
+    return defaultBullet;
+}
+int getLineHeight() {
+    return ascent + descent;
+}
+int getLineHeight(int lineIndex) {
+    if (lineHeight[lineIndex] is -1) {
+        calculate(lineIndex, 1);
+    }
+    return lineHeight[lineIndex];
+}
+int getLineIndent(int index, int defaultIndent) {
+    if (lines is null) return defaultIndent;
+    LineInfo info = lines[index];
+    if (info !is null && (info.flags & INDENT) !is 0) {
+        return info.indent;
+    }
+    return defaultIndent;
+}
+bool getLineJustify(int index, bool defaultJustify) {
+    if (lines is null) return defaultJustify;
+    LineInfo info = lines[index];
+    if (info !is null && (info.flags & JUSTIFY) !is 0) {
+        return info.justify;
+    }
+    return defaultJustify;
+}
+int[] getLineSegments(int index, int[] defaultSegments) {
+    if (lines is null) return defaultSegments;
+    LineInfo info = lines[index];
+    if (info !is null && (info.flags & SEGMENTS) !is 0) {
+        return info.segments;
+    }
+    return defaultSegments;
+}
+int getRangeIndex(int offset, int low, int high) {
+    if (styleCount is 0) return 0;
+    if (ranges !is null)  {
+        while (high - low > 2) {
+            int index = ((high + low) / 2) / 2 * 2;
+            int end = ranges[index] + ranges[index + 1];
+            if (end > offset) {
+                high = index;
+            } else {
+                low = index;
+            }
+        }
+    } else {
+        while (high - low > 1) {
+            int index = ((high + low) / 2);
+            int end = styles[index].start + styles[index].length;
+            if (end > offset) {
+                high = index;
+            } else {
+                low = index;
+            }
+        }
+    }
+    return high;
+}
+int[] getRanges(int start, int length) {
+    int[] newRanges;
+    int end = start + length - 1;
+    if (ranges !is null) {
+        int rangeCount = styleCount << 1;
+        int rangeStart = getRangeIndex(start, -1, rangeCount);
+        if (rangeStart >= rangeCount) return null;
+        if (ranges[rangeStart] > end) return null;
+        int rangeEnd = Math.min(rangeCount - 2, getRangeIndex(end, rangeStart - 1, rangeCount) + 1);
+        newRanges = new int[rangeEnd - rangeStart + 2];
+        System.arraycopy(ranges, rangeStart, newRanges, 0, newRanges.length);
+    } else {
+        int rangeStart = getRangeIndex(start, -1, styleCount);
+        if (rangeStart >= styleCount) return null;
+        if (styles[rangeStart].start > end) return null;
+        int rangeEnd = Math.min(styleCount - 1, getRangeIndex(end, rangeStart - 1, styleCount));
+        newRanges = new int[(rangeEnd - rangeStart + 1) << 1];
+        for (int i = rangeStart, j = 0; i <= rangeEnd; i++, j += 2) {
+            StyleRange style = styles[i];
+            newRanges[j] = style.start;
+            newRanges[j + 1] = style.length;
+        }
+    }
+    if (start > newRanges[0]) {
+        newRanges[1] = newRanges[0] + newRanges[1] - start;
+        newRanges[0] = start;
+    }
+    if (end < newRanges[newRanges.length - 2] + newRanges[newRanges.length - 1] - 1) {
+        newRanges[newRanges.length - 1] = end - newRanges[newRanges.length - 2] + 1;
+    }
+    return newRanges;
+}
+StyleRange[] getStyleRanges(int start, int length, bool includeRanges) {
+    StyleRange[] newStyles;
+    int end = start + length - 1;
+    if (ranges !is null) {
+        int rangeCount = styleCount << 1;
+        int rangeStart = getRangeIndex(start, -1, rangeCount);
+        if (rangeStart >= rangeCount) return null;
+        if (ranges[rangeStart] > end) return null;
+        int rangeEnd = Math.min(rangeCount - 2, getRangeIndex(end, rangeStart - 1, rangeCount) + 1);
+        newStyles = new StyleRange[((rangeEnd - rangeStart) >> 1) + 1];
+        if (includeRanges) {
+            for (int i = rangeStart, j = 0; i <= rangeEnd; i += 2, j++) {
+                newStyles[j] = cast(StyleRange)styles[i >> 1].clone();
+                newStyles[j].start = ranges[i];
+                newStyles[j].length = ranges[i + 1];
+            }
+        } else {
+            System.arraycopy(styles, rangeStart >> 1, newStyles, 0, newStyles.length);
+        }
+    } else {
+        int rangeStart = getRangeIndex(start, -1, styleCount);
+        if (rangeStart >= styleCount) return null;
+        if (styles[rangeStart].start > end) return null;
+        int rangeEnd = Math.min(styleCount - 1, getRangeIndex(end, rangeStart - 1, styleCount));
+        newStyles = new StyleRange[rangeEnd - rangeStart + 1];
+        System.arraycopy(styles, rangeStart, newStyles, 0, newStyles.length);
+    }
+    StyleRange style = newStyles[0];
+    if (start > style.start) {
+        if (!includeRanges || ranges is null) newStyles[0] = style = cast(StyleRange)style.clone();
+        style.length = style.start + style.length - start;
+        style.start = start;
+    }
+    style = newStyles[newStyles.length - 1];
+    if (end < style.start + style.length - 1) {
+        if (end < style.start) {
+            StyleRange[] tmp = new StyleRange[newStyles.length - 1];
+            System.arraycopy(newStyles, 0, tmp, 0, newStyles.length - 1);
+            newStyles = tmp;
+        } else {
+            if (!includeRanges || ranges is null) newStyles[newStyles.length - 1] = style = cast(StyleRange)style.clone();
+            style.length = end - style.start + 1;
+        }
+    }
+    return newStyles;
+}
+StyleRange getStyleRange(StyleRange style) {
+    if (style.start is 0 && style.length is 0 && style.fontStyle is SWT.NORMAL) return style;
+    StyleRange clone = cast(StyleRange)style.clone();
+    clone.start = clone.length = 0;
+    clone.fontStyle = SWT.NORMAL;
+    if (clone.font is null) clone.font = getFont(style.fontStyle);
+    return clone;
+}
+TextLayout getTextLayout(int lineIndex) {
+    return getTextLayout(lineIndex, styledText.getOrientation(), styledText.getWrapWidth(), styledText.lineSpacing);
+}
+TextLayout getTextLayout(int lineIndex, int orientation, int width, int lineSpacing) {
+    TextLayout layout = null;
+    if (styledText !is null) {
+        int topIndex = styledText.topIndex > 0 ? styledText.topIndex - 1 : 0;
+        if (layouts is null || topIndex !is this.topIndex) {
+            TextLayout[] newLayouts = new TextLayout[CACHE_SIZE];
+            if (layouts !is null) {
+                for (int i = 0; i < layouts.length; i++) {
+                    if (layouts[i] !is null) {
+                        int layoutIndex = (i + this.topIndex) - topIndex;
+                        if (0 <= layoutIndex && layoutIndex < newLayouts.length) {
+                            newLayouts[layoutIndex] = layouts[i];
+                        } else {
+                            layouts[i].dispose();
+                        }
+                    }
+                }
+            }
+            if (bullets !is null && bulletsIndices !is null && topIndex !is this.topIndex) {
+                int delta = topIndex - this.topIndex;
+                if (delta > 0) {
+                    if (delta < bullets.length) {
+                        System.arraycopy(bullets, delta, bullets, 0, bullets.length - delta);
+                        System.arraycopy(bulletsIndices, delta, bulletsIndices, 0, bulletsIndices.length - delta);
+                    }
+                    int startIndex = Math.max(0, bullets.length - delta);
+                    for (int i = startIndex; i < bullets.length; i++) bullets[i] = null;
+                } else {
+                    if (-delta < bullets.length) {
+                        System.arraycopy(bullets, 0, bullets, -delta, bullets.length + delta);
+                        System.arraycopy(bulletsIndices, 0, bulletsIndices, -delta, bulletsIndices.length + delta);
+                    }
+                    int endIndex = Math.min(bullets.length, -delta);
+                    for (int i = 0; i < endIndex; i++) bullets[i] = null;
+                }
+            }
+            this.topIndex = topIndex;
+            layouts = newLayouts;
+        }
+        if (layouts !is null) {
+            int layoutIndex = lineIndex - topIndex;
+            if (0 <= layoutIndex && layoutIndex < layouts.length) {
+                layout = layouts[layoutIndex];
+                if (layout !is null) {
+                    if (lineWidth[lineIndex] !is -1) return layout;
+                } else {
+                    layout = layouts[layoutIndex] = new TextLayout(device);
+                }
+            }
+        }
+    }
+    if (layout is null) layout = new TextLayout(device);
+    String line = content.getLine(lineIndex);
+    int lineOffset = content.getOffsetAtLine(lineIndex);
+    int[] segments = null;
+    int indent = 0;
+    int alignment = SWT.LEFT;
+    bool justify = false;
+    Bullet bullet = null;
+    int[] ranges = null;
+    StyleRange[] styles = null;
+    int rangeStart = 0, styleCount = 0;
+    StyledTextEvent event = null;
+    if (styledText !is null) {
+        event = styledText.getLineStyleData(lineOffset, line);
+        segments = styledText.getBidiSegments(lineOffset, line);
+        indent = styledText.indent;
+        alignment = styledText.alignment;
+        justify = styledText.justify;
+    }
+    if (event !is null) {
+        indent = event.indent;
+        alignment = event.alignment;
+        justify = event.justify;
+        bullet = event.bullet;
+        ranges = event.ranges;
+        styles = event.styles;
+        if (styles !is null) {
+            styleCount = styles.length;
+            if (styledText.isFixedLineHeight()) {
+                for (int i = 0; i < styleCount; i++) {
+                    if (styles[i].isVariableHeight()) {
+                        styledText.verticalScrollOffset = -1;
+                        styledText.setVariableLineHeight();
+                        styledText.redraw();
+                        break;
+                    }
+                }
+            }
+        }
+        if (bullets is null || bulletsIndices is null) {
+            bullets = new Bullet[CACHE_SIZE];
+            bulletsIndices = new int[CACHE_SIZE];
+        }
+        int index = lineIndex - topIndex;
+        if (0 <= index && index < CACHE_SIZE) {
+            bullets[index] = bullet;
+            bulletsIndices[index] = event.bulletIndex;
+        }
+    } else {
+        if (lines !is null) {
+            LineInfo info = lines[lineIndex];
+            if (info !is null) {
+                if ((info.flags & INDENT) !is 0) indent = info.indent;
+                if ((info.flags & ALIGNMENT) !is 0) alignment = info.alignment;
+                if ((info.flags & JUSTIFY) !is 0) justify = info.justify;
+                if ((info.flags & SEGMENTS) !is 0) segments = info.segments;
+            }
+        }
+        if (bulletsIndices !is null) {
+            bullets = null;
+            bulletsIndices = null;
+        }
+        if (bullets !is null) {
+            for (int i = 0; i < bullets.length; i++) {
+                if (bullets[i].indexOf(lineIndex) !is -1) {
+                    bullet = bullets[i];
+                    break;
+                }
+            }
+        }
+        ranges = this.ranges;
+        styles = this.styles;
+        styleCount = this.styleCount;
+        if (ranges !is null) {
+            rangeStart = getRangeIndex(lineOffset, -1, styleCount << 1);
+        } else {
+            rangeStart = getRangeIndex(lineOffset, -1, styleCount);
+        }
+    }
+    if (bullet !is null) {
+        StyleRange style = bullet.style;
+        GlyphMetrics metrics = style.metrics;
+        indent += metrics.width;
+    }
+    layout.setFont(regularFont);
+    layout.setAscent(ascent);
+    layout.setDescent(descent);
+    layout.setText(line);
+    layout.setOrientation(orientation);
+    layout.setSegments(segments);
+    layout.setWidth(width);
+    layout.setSpacing(lineSpacing);
+    layout.setTabs([tabWidth]);
+    layout.setIndent(indent);
+    layout.setAlignment(alignment);
+    layout.setJustify(justify);
+
+    int lastOffset = 0;
+    int length = line.length;
+    if (styles !is null) {
+        if (ranges !is null) {
+            int rangeCount = styleCount << 1;
+            for (int i = rangeStart; i < rangeCount; i += 2) {
+                int start, end;
+                if (lineOffset > ranges[i]) {
+                    start = 0;
+                    end = Math.min (length, ranges[i + 1] - lineOffset + ranges[i]);
+                } else {
+                    start = ranges[i] - lineOffset;
+                    end = Math.min(length, start + ranges[i + 1]);
+                }
+                if (start >= length) break;
+                if (lastOffset < start) {
+                    layout.setStyle(null, lastOffset, start - 1);
+                }
+                layout.setStyle(getStyleRange(styles[i >> 1]), start, end);
+                lastOffset = Math.max(lastOffset, end);
+            }
+        } else {
+            for (int i = rangeStart; i < styleCount; i++) {
+                int start, end;
+                if (lineOffset > styles[i].start) {
+                    start = 0;
+                    end = Math.min (length, styles[i].length - lineOffset + styles[i].start);
+                } else {
+                    start = styles[i].start - lineOffset;
+                    end = Math.min(length, start + styles[i].length);
+                }
+                if (start >= length) break;
+                if (lastOffset < start) {
+                    layout.setStyle(null, lastOffset, start - 1);
+                }
+                layout.setStyle(getStyleRange(styles[i]), start, end);
+                lastOffset = Math.max(lastOffset, end);
+            }
+        }
+    }
+    if (lastOffset < length) layout.setStyle(null, lastOffset, length);
+    if (styledText !is null && styledText.ime !is null) {
+        IME ime = styledText.ime;
+        int compositionOffset = ime.getCompositionOffset();
+        if (compositionOffset !is -1) {
+            int commitCount = ime.getCommitCount();
+            int compositionLength = ime.getText().length;
+            if (compositionLength !is commitCount) {
+                int compositionLine = content.getLineAtOffset(compositionOffset);
+                if (compositionLine is lineIndex) {
+                    int[] imeRanges = ime.getRanges();
+                    TextStyle[] imeStyles = ime.getStyles();
+                    if (imeRanges.length > 0) {
+                        for (int i = 0; i < imeStyles.length; i++) {
+                            int start = imeRanges[i*2] - lineOffset;
+                            int end = imeRanges[i*2+1] - lineOffset;
+                            TextStyle imeStyle = imeStyles[i], userStyle;
+                            for (int j = start; j <= end; j++) {
+                                userStyle = layout.getStyle(j);
+                                if (userStyle is null && j > 0) userStyle = layout.getStyle(j - 1);
+                                if (userStyle is null && j + 1 < length) userStyle = layout.getStyle(j + 1);
+                                if (userStyle is null) {
+                                    layout.setStyle(imeStyle, j, j);
+                                } else {
+                                    TextStyle newStyle = new TextStyle(imeStyle);
+                                    if (newStyle.font is null) newStyle.font = userStyle.font;
+                                    if (newStyle.foreground is null) newStyle.foreground = userStyle.foreground;
+                                    if (newStyle.background is null) newStyle.background = userStyle.background;
+                                    layout.setStyle(newStyle, j, j);
+                                }
+                            }
+                        }
+                    } else {
+                        int start = compositionOffset - lineOffset;
+                        int end = start + compositionLength - 1;
+                        TextStyle userStyle = layout.getStyle(start);
+                        if (userStyle is null) {
+                            if (start > 0) userStyle = layout.getStyle(start - 1);
+                            if (userStyle is null && end + 1 < length) userStyle = layout.getStyle(end + 1);
+                            if (userStyle !is null) {
+                                TextStyle newStyle = new TextStyle();
+                                newStyle.font = userStyle.font;
+                                newStyle.foreground = userStyle.foreground;
+                                newStyle.background = userStyle.background;
+                                layout.setStyle(newStyle, start, end);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    if (styledText !is null && styledText.isFixedLineHeight()) {
+        int index = -1;
+        int lineCount = layout.getLineCount();
+        int height = getLineHeight();
+        for (int i = 0; i < lineCount; i++) {
+            int lineHeight = layout.getLineBounds(i).height;
+            if (lineHeight > height) {
+                height = lineHeight;
+                index = i;
+            }
+        }
+        if (index !is -1) {
+            FontMetrics metrics = layout.getLineMetrics(index);
+            ascent = metrics.getAscent() + metrics.getLeading();
+            descent = metrics.getDescent();
+            if (layouts !is null) {
+                for (int i = 0; i < layouts.length; i++) {
+                    if (layouts[i] !is null && layouts[i] !is layout) {
+                        layouts[i].setAscent(ascent);
+                        layouts[i].setDescent(descent);
+                    }
+                }
+            }
+            if (styledText.verticalScrollOffset !is 0) {
+                int topIndex = styledText.topIndex;
+                int topIndexY = styledText.topIndexY;
+                int lineHeight = getLineHeight();
+                if (topIndexY >= 0) {
+                    styledText.verticalScrollOffset = (topIndex - 1) * lineHeight + lineHeight - topIndexY;
+                } else {
+                    styledText.verticalScrollOffset = topIndex * lineHeight - topIndexY;
+                }
+            }
+            styledText.calculateScrollBars();
+            if (styledText.isBidiCaret()) styledText.createCaretBitmaps();
+            styledText.caretDirection = SWT.NULL;
+            styledText.setCaretLocation();
+            styledText.redraw();
+        }
+    }
+    return layout;
+}
+int getWidth() {
+    return maxWidth;
+}
+void reset() {
+    if (layouts !is null) {
+        for (int i = 0; i < layouts.length; i++) {
+            TextLayout layout = layouts[i];
+            if (layout !is null) layout.dispose();
+        }
+        layouts = null;
+    }
+    topIndex = -1;
+    stylesSetCount = styleCount = lineCount = 0;
+    ranges = null;
+    styles = null;
+    stylesSet = null;
+    lines = null;
+    lineWidth = null;
+    lineHeight = null;
+    bullets = null;
+    bulletsIndices = null;
+    redrawLines = null;
+}
+void reset(int startLine, int lineCount) {
+    int endLine = startLine + lineCount;
+    if (startLine < 0 || endLine > lineWidth.length) return;
+    for (int i = startLine; i < endLine; i++) {
+        lineWidth[i] = -1;
+        lineHeight[i] = -1;
+    }
+    if (startLine <= maxWidthLineIndex && maxWidthLineIndex < endLine) {
+        maxWidth = 0;
+        maxWidthLineIndex = -1;
+        if (lineCount !is this.lineCount) {
+            for (int i = 0; i < this.lineCount; i++) {
+                if (lineWidth[i] > maxWidth) {
+                    maxWidth = lineWidth[i];
+                    maxWidthLineIndex = i;
+                }
+            }
+        }
+    }
+}
+void setContent(StyledTextContent content) {
+    reset();
+    this.content = content;
+    lineCount = content.getLineCount();
+    lineWidth = new int[lineCount];
+    lineHeight = new int[lineCount];
+    reset(0, lineCount);
+}
+void setFont(Font font, int tabs) {
+    TextLayout layout = new TextLayout(device);
+    layout.setFont(regularFont);
+    if (font !is null) {
+        if (boldFont !is null) boldFont.dispose();
+        if (italicFont !is null) italicFont.dispose();
+        if (boldItalicFont !is null) boldItalicFont.dispose();
+        boldFont = italicFont = boldItalicFont = null;
+        regularFont = font;
+        layout.setText("    ");
+        layout.setFont(font);
+        layout.setStyle(new TextStyle(getFont(SWT.NORMAL), null, null), 0, 0);
+        layout.setStyle(new TextStyle(getFont(SWT.BOLD), null, null), 1, 1);
+        layout.setStyle(new TextStyle(getFont(SWT.ITALIC), null, null), 2, 2);
+        layout.setStyle(new TextStyle(getFont(SWT.BOLD | SWT.ITALIC), null, null), 3, 3);
+        FontMetrics metrics = layout.getLineMetrics(0);
+        ascent = metrics.getAscent() + metrics.getLeading();
+        descent = metrics.getDescent();
+        boldFont.dispose();
+        italicFont.dispose();
+        boldItalicFont.dispose();
+        boldFont = italicFont = boldItalicFont = null;
+    }
+    layout.dispose();
+    layout = new TextLayout(device);
+    layout.setFont(regularFont);
+    StringBuffer tabBuffer = new StringBuffer(tabs);
+    for (int i = 0; i < tabs; i++) {
+        tabBuffer.append(' ');
+    }
+    layout.setText(tabBuffer.toString());
+    tabWidth = layout.getBounds().width;
+    layout.dispose();
+    if (styledText !is null) {
+        GC gc = new GC(styledText);
+        averageCharWidth = gc.getFontMetrics().getAverageCharWidth();
+        gc.dispose();
+    }
+}
+void setLineAlignment(int startLine, int count, int alignment) {
+    if (lines is null) lines = new LineInfo[lineCount];
+    for (int i = startLine; i < startLine + count; i++) {
+        if (lines[i] is null) {
+            lines[i] = new LineInfo();
+        }
+        lines[i].flags |= ALIGNMENT;
+        lines[i].alignment = alignment;
+    }
+}
+void setLineBackground(int startLine, int count, Color background) {
+    if (lines is null) lines = new LineInfo[lineCount];
+    for (int i = startLine; i < startLine + count; i++) {
+        if (lines[i] is null) {
+            lines[i] = new LineInfo();
+        }
+        lines[i].flags |= BACKGROUND;
+        lines[i].background = background;
+    }
+}
+void setLineBullet(int startLine, int count, Bullet bullet) {
+    if (bulletsIndices !is null) {
+        bulletsIndices = null;
+        bullets = null;
+    }
+    if (bullets is null) {
+        if (bullet is null) return;
+        bullets = new Bullet[1];
+        bullets[0] = bullet;
+    }
+    int index = 0;
+    while (index < bullets.length) {
+        if (bullet is bullets[index]) break;
+        index++;
+    }
+    if (bullet !is null) {
+        if (index is bullets.length) {
+            Bullet[] newBulletsList = new Bullet[bullets.length + 1];
+            System.arraycopy(bullets, 0, newBulletsList, 0, bullets.length);
+            newBulletsList[index] = bullet;
+            bullets = newBulletsList;
+        }
+        bullet.addIndices(startLine, count);
+    } else {
+        updateBullets(startLine, count, 0, false);
+        styledText.redrawLinesBullet(redrawLines);
+        redrawLines = null;
+    }
+}
+void setLineIndent(int startLine, int count, int indent) {
+    if (lines is null) lines = new LineInfo[lineCount];
+    for (int i = startLine; i < startLine + count; i++) {
+        if (lines[i] is null) {
+            lines[i] = new LineInfo();
+        }
+        lines[i].flags |= INDENT;
+        lines[i].indent = indent;
+    }
+}
+void setLineJustify(int startLine, int count, bool justify) {
+    if (lines is null) lines = new LineInfo[lineCount];
+    for (int i = startLine; i < startLine + count; i++) {
+        if (lines[i] is null) {
+            lines[i] = new LineInfo();
+        }
+        lines[i].flags |= JUSTIFY;
+        lines[i].justify = justify;
+    }
+}
+void setLineSegments(int startLine, int count, int[] segments) {
+    if (lines is null) lines = new LineInfo[lineCount];
+    for (int i = startLine; i < startLine + count; i++) {
+        if (lines[i] is null) {
+            lines[i] = new LineInfo();
+        }
+        lines[i].flags |= SEGMENTS;
+        lines[i].segments = segments;
+    }
+}
+void setStyleRanges (int[] newRanges, StyleRange[] newStyles) {
+    if (newStyles is null) {
+        stylesSetCount = styleCount = 0;
+        ranges = null;
+        styles = null;
+        stylesSet = null;
+        return;
+    }
+    if (newRanges is null && COMPACT_STYLES) {
+        newRanges = new int[newStyles.length << 1];
+        StyleRange[] tmpStyles = new StyleRange[newStyles.length];
+        if (stylesSet is null) stylesSet = new StyleRange[4];
+        for (int i = 0, j = 0; i < newStyles.length; i++) {
+            StyleRange newStyle = newStyles[i];
+            newRanges[j++] = newStyle.start;
+            newRanges[j++] = newStyle.length;
+            int index = 0;
+            while (index < stylesSetCount) {
+                if (stylesSet[index].similarTo(newStyle)) break;
+                index++;
+            }
+            if (index is stylesSetCount) {
+                if (stylesSetCount is stylesSet.length) {
+                    StyleRange[] tmpStylesSet = new StyleRange[stylesSetCount + 4];
+                    System.arraycopy(stylesSet, 0, tmpStylesSet, 0, stylesSetCount);
+                    stylesSet = tmpStylesSet;
+                }
+                stylesSet[stylesSetCount++] = newStyle;
+            }
+            tmpStyles[i] = stylesSet[index];
+        }
+        newStyles = tmpStyles;
+    }
+
+    if (styleCount is 0) {
+        if (newRanges !is null) {
+            ranges = new int[newRanges.length];
+            System.arraycopy(newRanges, 0, ranges, 0, ranges.length);
+        }
+        styles = new StyleRange[newStyles.length];
+        System.arraycopy(newStyles, 0, styles, 0, styles.length);
+        styleCount = newStyles.length;
+        return;
+    }
+    if (newRanges !is null && ranges is null) {
+        ranges = new int[styles.length << 1];
+        for (int i = 0, j = 0; i < styleCount; i++) {
+            ranges[j++] = styles[i].start;
+            ranges[j++] = styles[i].length;
+        }
+    }
+    if (newRanges is null && ranges !is null) {
+        newRanges = new int[newStyles.length << 1];
+        for (int i = 0, j = 0; i < newStyles.length; i++) {
+            newRanges[j++] = newStyles[i].start;
+            newRanges[j++] = newStyles[i].length;
+        }
+    }
+    if (ranges !is null) {
+        int rangeCount = styleCount << 1;
+        int start = newRanges[0];
+        int modifyStart = getRangeIndex(start, -1, rangeCount), modifyEnd;
+        bool insert = modifyStart is rangeCount;
+        if (!insert) {
+            int end = newRanges[newRanges.length - 2] + newRanges[newRanges.length - 1];
+            modifyEnd = getRangeIndex(end, modifyStart - 1, rangeCount);
+            insert = modifyStart is modifyEnd && ranges[modifyStart] >= end;
+        }
+        if (insert) {
+            addMerge(newRanges, newStyles, newRanges.length, modifyStart, modifyStart);
+            return;
+        }
+        modifyEnd = modifyStart;
+        int[] mergeRanges = new int[6];
+        StyleRange[] mergeStyles = new StyleRange[3];
+        for (int i = 0; i < newRanges.length; i += 2) {
+            int newStart = newRanges[i];
+            int newEnd = newStart + newRanges[i + 1];
+            if (newStart is newEnd) continue;
+            int modifyLast = 0, mergeCount = 0;
+            while (modifyEnd < rangeCount) {
+                if (newStart >= ranges[modifyStart] + ranges[modifyStart + 1]) modifyStart += 2;
+                if (ranges[modifyEnd] + ranges[modifyEnd + 1] > newEnd) break;
+                modifyEnd += 2;
+            }
+            if (ranges[modifyStart] < newStart && newStart < ranges[modifyStart] + ranges[modifyStart + 1]) {
+                mergeStyles[mergeCount >> 1] = styles[modifyStart >> 1];
+                mergeRanges[mergeCount] = ranges[modifyStart];
+                mergeRanges[mergeCount + 1] = newStart - ranges[modifyStart];
+                mergeCount += 2;
+            }
+            mergeStyles[mergeCount >> 1] = newStyles[i >> 1];
+            mergeRanges[mergeCount] = newStart;
+            mergeRanges[mergeCount + 1] = newRanges[i + 1];
+            mergeCount += 2;
+            if (modifyEnd < rangeCount && ranges[modifyEnd] < newEnd && newEnd < ranges[modifyEnd] + ranges[modifyEnd + 1]) {
+                mergeStyles[mergeCount >> 1] = styles[modifyEnd >> 1];
+                mergeRanges[mergeCount] = newEnd;
+                mergeRanges[mergeCount + 1] = ranges[modifyEnd] + ranges[modifyEnd + 1] - newEnd;
+                mergeCount += 2;
+                modifyLast = 2;
+            }
+            int grow = addMerge(mergeRanges, mergeStyles, mergeCount, modifyStart, modifyEnd + modifyLast);
+            rangeCount += grow;
+            modifyStart = modifyEnd += grow;
+        }
+    } else {
+        int start = newStyles[0].start;
+        int modifyStart = getRangeIndex(start, -1, styleCount), modifyEnd;
+        bool insert = modifyStart is styleCount;
+        if (!insert) {
+            int end = newStyles[newStyles.length - 1].start + newStyles[newStyles.length - 1].length;
+            modifyEnd = getRangeIndex(end, modifyStart - 1, styleCount);
+            insert = modifyStart is modifyEnd && styles[modifyStart].start >= end;
+        }
+        if (insert) {
+            addMerge(newStyles, newStyles.length, modifyStart, modifyStart);
+            return;
+        }
+        modifyEnd = modifyStart;
+        StyleRange[] mergeStyles = new StyleRange[3];
+        for (int i = 0; i < newStyles.length; i++) {
+            StyleRange newStyle = newStyles[i], style;
+            int newStart = newStyle.start;
+            int newEnd = newStart + newStyle.length;
+            if (newStart is newEnd) continue;
+            int modifyLast = 0, mergeCount = 0;
+            while (modifyEnd < styleCount) {
+                if (newStart >= styles[modifyStart].start + styles[modifyStart].length) modifyStart++;
+                if (styles[modifyEnd].start + styles[modifyEnd].length > newEnd) break;
+                modifyEnd++;
+            }
+            style = styles[modifyStart];
+            if (style.start < newStart && newStart < style.start + style.length) {
+                style = mergeStyles[mergeCount++] = cast(StyleRange)style.clone();
+                style.length = newStart - style.start;
+            }
+            mergeStyles[mergeCount++] = newStyle;
+            if (modifyEnd < styleCount) {
+                style = styles[modifyEnd];
+                if (style.start < newEnd && newEnd < style.start + style.length) {
+                    style = mergeStyles[mergeCount++] = cast(StyleRange)style.clone();
+                    style.length += style.start - newEnd;
+                    style.start = newEnd;
+                    modifyLast = 1;
+                }
+            }
+            int grow = addMerge(mergeStyles, mergeCount, modifyStart, modifyEnd + modifyLast);
+            modifyStart = modifyEnd += grow;
+        }
+    }
+}
+void textChanging(TextChangingEvent event) {
+    int start = event.start;
+    int newCharCount = event.newCharCount, replaceCharCount = event.replaceCharCount;
+    int newLineCount = event.newLineCount, replaceLineCount = event.replaceLineCount;
+
+    updateRanges(start, replaceCharCount, newCharCount);
+
+    int startLine = content.getLineAtOffset(start);
+    if (replaceCharCount is content.getCharCount()) lines = null;
+    if (replaceLineCount is lineCount) {
+        lineCount = newLineCount;
+        lineWidth = new int[lineCount];
+        lineHeight = new int[lineCount];
+        reset(0, lineCount);
+    } else {
+        int delta = newLineCount - replaceLineCount;
+        if (lineCount + delta > lineWidth.length) {
+            int[] newWidths = new int[lineCount + delta + GROW];
+            System.arraycopy(lineWidth, 0, newWidths, 0, lineCount);
+            lineWidth = newWidths;
+            int[] newHeights = new int[lineCount + delta + GROW];
+            System.arraycopy(lineHeight, 0, newHeights, 0, lineCount);
+            lineHeight = newHeights;
+        }
+        if (lines !is null) {
+            if (lineCount + delta > lines.length) {
+                LineInfo[] newLines = new LineInfo[lineCount + delta + GROW];
+                System.arraycopy(lines, 0, newLines, 0, lineCount);
+                lines = newLines;
+            }
+        }
+        int startIndex = startLine + replaceLineCount + 1;
+        int endIndex = startLine + newLineCount + 1;
+        System.arraycopy(lineWidth, startIndex, lineWidth, endIndex, lineCount - startIndex);
+        System.arraycopy(lineHeight, startIndex, lineHeight, endIndex, lineCount - startIndex);
+        for (int i = startLine; i < endIndex; i++) {
+            lineWidth[i] = lineHeight[i] = -1;
+        }
+        for (int i = lineCount + delta; i < lineCount; i++) {
+            lineWidth[i] = lineHeight[i] = -1;
+        }
+        if (layouts !is null) {
+            int layoutStartLine = startLine - topIndex;
+            int layoutEndLine = layoutStartLine + replaceLineCount + 1;
+            for (int i = layoutStartLine; i < layoutEndLine; i++) {
+                if (0 <= i && i < layouts.length) {
+                    if (layouts[i] !is null) layouts[i].dispose();
+                    layouts[i] = null;
+                    if (bullets !is null && bulletsIndices !is null) bullets[i] = null;
+                }
+            }
+            if (delta > 0) {
+                for (int i = layouts.length - 1; i >= layoutEndLine; i--) {
+                    if (0 <= i && i < layouts.length) {
+                        endIndex = i + delta;
+                        if (0 <= endIndex && endIndex < layouts.length) {
+                            layouts[endIndex] = layouts[i];
+                            layouts[i] = null;
+                            if (bullets !is null && bulletsIndices !is null) {
+                                bullets[endIndex] = bullets[i];
+                                bulletsIndices[endIndex] = bulletsIndices[i];
+                                bullets[i] = null;
+                            }
+                        } else {
+                            if (layouts[i] !is null) layouts[i].dispose();
+                            layouts[i] = null;
+                            if (bullets !is null && bulletsIndices !is null) bullets[i] = null;
+                        }
+                    }
+                }
+            } else if (delta < 0) {
+                for (int i = layoutEndLine; i < layouts.length; i++) {
+                    if (0 <= i && i < layouts.length) {
+                        endIndex = i + delta;
+                        if (0 <= endIndex && endIndex < layouts.length) {
+                            layouts[endIndex] = layouts[i];
+                            layouts[i] = null;
+                            if (bullets !is null && bulletsIndices !is null) {
+                                bullets[endIndex] = bullets[i];
+                                bulletsIndices[endIndex] = bulletsIndices[i];
+                                bullets[i] = null;
+                            }
+                        } else {
+                            if (layouts[i] !is null) layouts[i].dispose();
+                            layouts[i] = null;
+                            if (bullets !is null && bulletsIndices !is null) bullets[i] = null;
+                        }
+                    }
+                }
+            }
+        }
+        if (replaceLineCount !is 0 || newLineCount !is 0) {
+            int startLineOffset = content.getOffsetAtLine(startLine);
+            if (startLineOffset !is start) startLine++;
+            updateBullets(startLine, replaceLineCount, newLineCount, true);
+            if (lines !is null) {
+                startIndex = startLine + replaceLineCount;
+                endIndex = startLine + newLineCount;
+                System.arraycopy(lines, startIndex, lines, endIndex, lineCount - startIndex);
+                for (int i = startLine; i < endIndex; i++) {
+                    lines[i] = null;
+                }
+                for (int i = lineCount + delta; i < lineCount; i++) {
+                    lines[i] = null;
+                }
+            }
+        }
+        lineCount += delta;
+        if (maxWidthLineIndex !is -1 && startLine <= maxWidthLineIndex && maxWidthLineIndex <= startLine + replaceLineCount) {
+            maxWidth = 0;
+            maxWidthLineIndex = -1;
+            for (int i = 0; i < lineCount; i++) {
+                if (lineWidth[i] > maxWidth) {
+                    maxWidth = lineWidth[i];
+                    maxWidthLineIndex = i;
+                }
+            }
+        }
+    }
+}
+void updateBullets(int startLine, int replaceLineCount, int newLineCount, bool update) {
+    if (bullets is null) return;
+    if (bulletsIndices !is null) return;
+    for (int i = 0; i < bullets.length; i++) {
+        Bullet bullet = bullets[i];
+        int[] lines = bullet.removeIndices(startLine, replaceLineCount, newLineCount, update);
+        if (lines !is null) {
+            if (redrawLines is null) {
+                redrawLines = lines;
+            } else {
+                int[] newRedrawBullets = new int[redrawLines.length + lines.length];
+                System.arraycopy(redrawLines, 0, newRedrawBullets, 0, redrawLines.length);
+                System.arraycopy(lines, 0, newRedrawBullets, redrawLines.length, lines.length);
+                redrawLines = newRedrawBullets;
+            }
+        }
+    }
+    int removed = 0;
+    for (int i = 0; i < bullets.length; i++) {
+        if (bullets[i].size() is 0) removed++;
+    }
+    if (removed > 0) {
+        if (removed is bullets.length) {
+            bullets = null;
+        } else {
+            Bullet[] newBulletsList = new Bullet[bullets.length - removed];
+            for (int i = 0, j = 0; i < bullets.length; i++) {
+                Bullet bullet = bullets[i];
+                if (bullet.size() > 0) newBulletsList[j++] = bullet;
+            }
+            bullets = newBulletsList;
+        }
+    }
+}
+void updateRanges(int start, int replaceCharCount, int newCharCount) {
+    if (styleCount is 0 || (replaceCharCount is 0 && newCharCount is 0)) return;
+    if (ranges !is null) {
+        int rangeCount = styleCount << 1;
+        int modifyStart = getRangeIndex(start, -1, rangeCount);
+        if (modifyStart is rangeCount) return;
+        int end = start + replaceCharCount;
+        int modifyEnd = getRangeIndex(end, modifyStart - 1, rangeCount);
+        int offset = newCharCount - replaceCharCount;
+        if (modifyStart is modifyEnd && ranges[modifyStart] < start && end < ranges[modifyEnd] + ranges[modifyEnd + 1]) {
+            if (newCharCount is 0) {
+                ranges[modifyStart + 1] -= replaceCharCount;
+                modifyEnd += 2;
+            } else {
+                if (rangeCount + 2 > ranges.length) {
+                    int[] newRanges = new int[ranges.length + (GROW << 1)];
+                    System.arraycopy(ranges, 0, newRanges, 0, rangeCount);
+                    ranges = newRanges;
+                    StyleRange[] newStyles = new StyleRange[styles.length + GROW];
+                    System.arraycopy(styles, 0, newStyles, 0, styleCount);
+                    styles = newStyles;
+                }
+                System.arraycopy(ranges, modifyStart + 2, ranges, modifyStart + 4, rangeCount - (modifyStart + 2));
+                System.arraycopy(styles, (modifyStart + 2) >> 1, styles, (modifyStart + 4) >> 1, styleCount - ((modifyStart + 2) >> 1));
+                ranges[modifyStart + 3] = ranges[modifyStart] + ranges[modifyStart + 1] - end;
+                ranges[modifyStart + 2] = start + newCharCount;
+                ranges[modifyStart + 1] = start - ranges[modifyStart];
+                styles[(modifyStart >> 1) + 1] = styles[modifyStart >> 1];
+                rangeCount += 2;
+                styleCount++;
+                modifyEnd += 4;
+            }
+            if (offset !is 0) {
+                for (int i = modifyEnd; i < rangeCount; i += 2) {
+                    ranges[i] += offset;
+                }
+            }
+        } else {
+            if (ranges[modifyStart] < start && start < ranges[modifyStart] + ranges[modifyStart + 1]) {
+                ranges[modifyStart + 1] = start - ranges[modifyStart];
+                modifyStart += 2;
+            }
+            if (modifyEnd < rangeCount && ranges[modifyEnd] < end && end < ranges[modifyEnd] + ranges[modifyEnd + 1]) {
+                ranges[modifyEnd + 1] = ranges[modifyEnd] + ranges[modifyEnd + 1] - end;
+                ranges[modifyEnd] = end;
+            }
+            if (offset !is 0) {
+                for (int i = modifyEnd; i < rangeCount; i += 2) {
+                    ranges[i] += offset;
+                }
+            }
+            System.arraycopy(ranges, modifyEnd, ranges, modifyStart, rangeCount - modifyEnd);
+            System.arraycopy(styles, modifyEnd >> 1, styles, modifyStart >> 1, styleCount - (modifyEnd >> 1));
+            styleCount -= (modifyEnd - modifyStart) >> 1;
+        }
+    } else {
+        int modifyStart = getRangeIndex(start, -1, styleCount);
+        if (modifyStart is styleCount) return;
+        int end = start + replaceCharCount;
+        int modifyEnd = getRangeIndex(end, modifyStart - 1, styleCount);
+        int offset = newCharCount - replaceCharCount;
+        if (modifyStart is modifyEnd && styles[modifyStart].start < start && end < styles[modifyEnd].start + styles[modifyEnd].length) {
+            if (newCharCount is 0) {
+                styles[modifyStart].length -= replaceCharCount;
+                modifyEnd++;
+            } else {
+                if (styleCount + 1 > styles.length) {
+                    StyleRange[] newStyles = new StyleRange[styles.length + GROW];
+                    System.arraycopy(styles, 0, newStyles, 0, styleCount);
+                    styles = newStyles;
+                }
+                System.arraycopy(styles, modifyStart + 1, styles, modifyStart + 2, styleCount - (modifyStart + 1));
+                styles[modifyStart + 1] = cast(StyleRange)styles[modifyStart].clone();
+                styles[modifyStart + 1].length = styles[modifyStart].start + styles[modifyStart].length - end;
+                styles[modifyStart + 1].start = start + newCharCount;
+                styles[modifyStart].length = start - styles[modifyStart].start;
+                styleCount++;
+                modifyEnd += 2;
+            }
+            if (offset !is 0) {
+                for (int i = modifyEnd; i < styleCount; i++) {
+                    styles[i].start += offset;
+                }
+            }
+        } else {
+            if (styles[modifyStart].start < start && start < styles[modifyStart].start + styles[modifyStart].length) {
+                styles[modifyStart].length = start - styles[modifyStart].start;
+                modifyStart++;
+            }
+            if (modifyEnd < styleCount && styles[modifyEnd].start < end && end < styles[modifyEnd].start + styles[modifyEnd].length) {
+                styles[modifyEnd].length = styles[modifyEnd].start + styles[modifyEnd].length - end;
+                styles[modifyEnd].start = end;
+            }
+            if (offset !is 0) {
+                for (int i = modifyEnd; i < styleCount; i++) {
+                    styles[i].start += offset;
+                }
+            }
+            System.arraycopy(styles, modifyEnd, styles, modifyStart, styleCount - modifyEnd);
+            styleCount -= modifyEnd - modifyStart;
+        }
+    }
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/TableCursor.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,789 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.TableCursor;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.ScrollBar;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.widgets.Widget;
+
+/**
+ * A TableCursor provides a way for the user to navigate around a Table
+ * using the keyboard.  It also provides a mechanism for selecting an
+ * individual cell in a table.
+ *
+ * <p> Here is an example of using a TableCursor to navigate to a cell and then edit it.
+ *
+ * <code><pre>
+ *  public static void main(String[] args) {
+ *      Display display = new Display();
+ *      Shell shell = new Shell(display);
+ *      shell.setLayout(new GridLayout());
+ *
+ *      // create a a table with 3 columns and fill with data
+ *      final Table table = new Table(shell, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
+ *      table.setLayoutData(new GridData(GridData.FILL_BOTH));
+ *      TableColumn column1 = new TableColumn(table, SWT.NONE);
+ *      TableColumn column2 = new TableColumn(table, SWT.NONE);
+ *      TableColumn column3 = new TableColumn(table, SWT.NONE);
+ *      for (int i = 0; i &lt; 100; i++) {
+ *          TableItem item = new TableItem(table, SWT.NONE);
+ *          item.setText(new String[] { "cell "+i+" 0", "cell "+i+" 1", "cell "+i+" 2"});
+ *      }
+ *      column1.pack();
+ *      column2.pack();
+ *      column3.pack();
+ *
+ *      // create a TableCursor to navigate around the table
+ *      final TableCursor cursor = new TableCursor(table, SWT.NONE);
+ *      // create an editor to edit the cell when the user hits "ENTER"
+ *      // while over a cell in the table
+ *      final ControlEditor editor = new ControlEditor(cursor);
+ *      editor.grabHorizontal = true;
+ *      editor.grabVertical = true;
+ *
+ *      cursor.addSelectionListener(new SelectionAdapter() {
+ *          // when the TableEditor is over a cell, select the corresponding row in
+ *          // the table
+ *          public void widgetSelected(SelectionEvent e) {
+ *              table.setSelection(new TableItem[] {cursor.getRow()});
+ *          }
+ *          // when the user hits "ENTER" in the TableCursor, pop up a text editor so that
+ *          // they can change the text of the cell
+ *          public void widgetDefaultSelected(SelectionEvent e){
+ *              final Text text = new Text(cursor, SWT.NONE);
+ *              TableItem row = cursor.getRow();
+ *              int column = cursor.getColumn();
+ *              text.setText(row.getText(column));
+ *              text.addKeyListener(new KeyAdapter() {
+ *                  public void keyPressed(KeyEvent e) {
+ *                      // close the text editor and copy the data over
+ *                      // when the user hits "ENTER"
+ *                      if (e.character is SWT.CR) {
+ *                          TableItem row = cursor.getRow();
+ *                          int column = cursor.getColumn();
+ *                          row.setText(column, text.getText());
+ *                          text.dispose();
+ *                      }
+ *                      // close the text editor when the user hits "ESC"
+ *                      if (e.character is SWT.ESC) {
+ *                          text.dispose();
+ *                      }
+ *                  }
+ *              });
+ *              editor.setEditor(text);
+ *              text.setFocus();
+ *          }
+ *      });
+ *      // Hide the TableCursor when the user hits the "MOD1" or "MOD2" key.
+ *      // This allows the user to select multiple items in the table.
+ *      cursor.addKeyListener(new KeyAdapter() {
+ *          public void keyPressed(KeyEvent e) {
+ *              if (e.keyCode is SWT.MOD1 ||
+ *                  e.keyCode is SWT.MOD2 ||
+ *                  (e.stateMask & SWT.MOD1) !is 0 ||
+ *                  (e.stateMask & SWT.MOD2) !is 0) {
+ *                  cursor.setVisible(false);
+ *              }
+ *          }
+ *      });
+ *      // Show the TableCursor when the user releases the "MOD2" or "MOD1" key.
+ *      // This signals the end of the multiple selection task.
+ *      table.addKeyListener(new KeyAdapter() {
+ *          public void keyReleased(KeyEvent e) {
+ *              if (e.keyCode is SWT.MOD1 && (e.stateMask & SWT.MOD2) !is 0) return;
+ *              if (e.keyCode is SWT.MOD2 && (e.stateMask & SWT.MOD1) !is 0) return;
+ *              if (e.keyCode !is SWT.MOD1 && (e.stateMask & SWT.MOD1) !is 0) return;
+ *              if (e.keyCode !is SWT.MOD2 && (e.stateMask & SWT.MOD2) !is 0) return;
+ *
+ *              TableItem[] selection = table.getSelection();
+ *              TableItem row = (selection.length is 0) ? table.getItem(table.getTopIndex()) : selection[0];
+ *              table.showItem(row);
+ *              cursor.setSelection(row, 0);
+ *              cursor.setVisible(true);
+ *              cursor.setFocus();
+ *          }
+ *      });
+ *
+ *      shell.open();
+ *      while (!shell.isDisposed()) {
+ *          if (!display.readAndDispatch())
+ *              display.sleep();
+ *      }
+ *      display.dispose();
+ *  }
+ * </pre></code>
+ *
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>BORDER</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection, DefaultSelection</dd>
+ * </dl>
+ *
+ * @since 2.0
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#tablecursor">TableCursor snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> 
+ */
+public class TableCursor : Canvas {
+
+    alias Canvas.dispose dispose;
+
+    Table table;
+    TableItem row = null;
+    TableColumn column = null;
+    Listener tableListener, resizeListener, disposeItemListener, disposeColumnListener;
+
+    Color background = null;
+    Color foreground = null;
+
+    // By default, invert the list selection colors
+    static final int BACKGROUND = SWT.COLOR_LIST_SELECTION_TEXT;
+    static final int FOREGROUND = SWT.COLOR_LIST_SELECTION;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * table and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a Table control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#BORDER
+ * @see Widget#checkSubclass()
+ * @see Widget#getStyle()
+ */
+public this(Table parent, int style) {
+    super(parent, style);
+    table = parent;
+    setBackground(null);
+    setForeground(null);
+
+    Listener listener = new class() Listener {
+        public void handleEvent(Event event) {
+            switch (event.type) {
+                case SWT.Dispose :
+                    dispose(event);
+                    break;
+                case SWT.FocusIn :
+                case SWT.FocusOut :
+                    redraw();
+                    break;
+                case SWT.KeyDown :
+                    keyDown(event);
+                    break;
+                case SWT.Paint :
+                    paint(event);
+                    break;
+                case SWT.Traverse : {
+                    event.doit = true;
+                    switch (event.detail) {
+                        case SWT.TRAVERSE_ARROW_NEXT :
+                        case SWT.TRAVERSE_ARROW_PREVIOUS :
+                        case SWT.TRAVERSE_RETURN :
+                            event.doit = false;
+                            break;
+                        default:
+                    }
+                    break;
+                }
+                default:
+            }
+        }
+    };
+    int[] events = [SWT.Dispose, SWT.FocusIn, SWT.FocusOut, SWT.KeyDown, SWT.Paint, SWT.Traverse];
+    for (int i = 0; i < events.length; i++) {
+        addListener(events[i], listener);
+    }
+
+    tableListener = new class() Listener {
+        public void handleEvent(Event event) {
+            switch (event.type) {
+                case SWT.MouseDown :
+                    tableMouseDown(event);
+                    break;
+                case SWT.FocusIn :
+                    tableFocusIn(event);
+                    break;
+                default:
+            }
+        }
+    };
+    table.addListener(SWT.FocusIn, tableListener);
+    table.addListener(SWT.MouseDown, tableListener);
+
+    disposeItemListener = new class() Listener {
+        public void handleEvent(Event event) {
+            unhookRowColumnListeners();
+            row = null;
+            column = null;
+            _resize();
+        }
+    };
+    disposeColumnListener = new class() Listener {
+        public void handleEvent(Event event) {
+            unhookRowColumnListeners();
+            row = null;
+            column = null;
+            _resize();
+        }
+    };
+    resizeListener = new class() Listener {
+        public void handleEvent(Event event) {
+            _resize();
+        }
+    };
+    ScrollBar hBar = table.getHorizontalBar();
+    if (hBar !is null) {
+        hBar.addListener(SWT.Selection, resizeListener);
+    }
+    ScrollBar vBar = table.getVerticalBar();
+    if (vBar !is null) {
+        vBar.addListener(SWT.Selection, resizeListener);
+    }
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the user changes the receiver's selection, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * When <code>widgetSelected</code> is called, the item field of the event object is valid.
+ * If the receiver has <code>SWT.CHECK</code> style set and the check selection changes,
+ * the event object detail field contains the value <code>SWT.CHECK</code>.
+ * <code>widgetDefaultSelected</code> is typically called when an item is double-clicked.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the user changes the receiver's selection
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see SelectionEvent
+ * @see #removeSelectionListener(SelectionListener)
+ *
+ */
+public void addSelectionListener(SelectionListener listener) {
+    checkWidget();
+    if (listener is null)
+        SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener(listener);
+    addListener(SWT.Selection, typedListener);
+    addListener(SWT.DefaultSelection, typedListener);
+}
+
+void dispose(Event event) {
+    table.removeListener(SWT.FocusIn, tableListener);
+    table.removeListener(SWT.MouseDown, tableListener);
+    unhookRowColumnListeners();
+    ScrollBar hBar = table.getHorizontalBar();
+    if (hBar !is null) {
+        hBar.removeListener(SWT.Selection, resizeListener);
+    }
+    ScrollBar vBar = table.getVerticalBar();
+    if (vBar !is null) {
+        vBar.removeListener(SWT.Selection, resizeListener);
+    }
+}
+
+void keyDown(Event event) {
+    if (row is null) return;
+    switch (event.character) {
+        case SWT.CR :
+            notifyListeners(SWT.DefaultSelection, new Event());
+            return;
+        default:
+    }
+    int rowIndex = table.indexOf(row);
+    int columnIndex = column is null ? 0 : table.indexOf(column);
+    switch (event.keyCode) {
+        case SWT.ARROW_UP :
+            setRowColumn(Math.max(0, rowIndex - 1), columnIndex, true);
+            break;
+        case SWT.ARROW_DOWN :
+            setRowColumn(Math.min(rowIndex + 1, table.getItemCount() - 1), columnIndex, true);
+            break;
+        case SWT.ARROW_LEFT :
+        case SWT.ARROW_RIGHT :
+            {
+                int columnCount = table.getColumnCount();
+                if (columnCount is 0) break;
+                int[] order = table.getColumnOrder();
+                int index = 0;
+                while (index < order.length) {
+                    if (order[index] is columnIndex) break;
+                    index++;
+                }
+                if (index is order.length) index = 0;
+                int leadKey = (getStyle() & SWT.RIGHT_TO_LEFT) !is 0 ? SWT.ARROW_RIGHT : SWT.ARROW_LEFT;
+                if (event.keyCode is leadKey) {
+                   setRowColumn(rowIndex, order[Math.max(0, index - 1)], true);
+                } else {
+                   setRowColumn(rowIndex, order[Math.min(columnCount - 1, index + 1)], true);
+                }
+                break;
+            }
+        case SWT.HOME :
+            setRowColumn(0, columnIndex, true);
+            break;
+        case SWT.END :
+            {
+                int i = table.getItemCount() - 1;
+                setRowColumn(i, columnIndex, true);
+                break;
+            }
+        case SWT.PAGE_UP :
+            {
+                int index = table.getTopIndex();
+                if (index is rowIndex) {
+                    Rectangle rect = table.getClientArea();
+                    TableItem item = table.getItem(index);
+                    Rectangle itemRect = item.getBounds(0);
+                    rect.height -= itemRect.y;
+                    int height = table.getItemHeight();
+                    int page = Math.max(1, rect.height / height);
+                    index = Math.max(0, index - page + 1);
+                }
+                setRowColumn(index, columnIndex, true);
+                break;
+            }
+        case SWT.PAGE_DOWN :
+            {
+                int index = table.getTopIndex();
+                Rectangle rect = table.getClientArea();
+                TableItem item = table.getItem(index);
+                Rectangle itemRect = item.getBounds(0);
+                rect.height -= itemRect.y;
+                int height = table.getItemHeight();
+                int page = Math.max(1, rect.height / height);
+                int end = table.getItemCount() - 1;
+                index = Math.min(end, index + page - 1);
+                if (index is rowIndex) {
+                    index = Math.min(end, index + page - 1);
+                }
+                setRowColumn(index, columnIndex, true);
+                break;
+            }
+        default:
+    }
+}
+
+void paint(Event event) {
+    if (row is null) return;
+    int columnIndex = column is null ? 0 : table.indexOf(column);
+    GC gc = event.gc;
+    Display display = getDisplay();
+    gc.setBackground(getBackground());
+    gc.setForeground(getForeground());
+    gc.fillRectangle(event.x, event.y, event.width, event.height);
+    int x = 0;
+    Point size = getSize();
+    Image image = row.getImage(columnIndex);
+    if (image !is null) {
+        Rectangle imageSize = image.getBounds();
+        int imageY = (size.y - imageSize.height) / 2;
+        gc.drawImage(image, x, imageY);
+        x += imageSize.width;
+    }
+    String text = row.getText(columnIndex);
+    if (text.length > 0) {
+        Rectangle bounds = row.getBounds(columnIndex);
+        Point extent = gc.stringExtent(text);
+        // Temporary code - need a better way to determine table trim
+        String platform = SWT.getPlatform();
+        if ("win32"==platform) { //$NON-NLS-1$
+            if (table.getColumnCount() is 0 || columnIndex is 0) {
+                x += 2;
+            } else {
+                int alignmnent = column.getAlignment();
+                switch (alignmnent) {
+                    case SWT.LEFT:
+                        x += 6;
+                        break;
+                    case SWT.RIGHT:
+                        x = bounds.width - extent.x - 6;
+                        break;
+                    case SWT.CENTER:
+                        x += (bounds.width - x - extent.x) / 2;
+                        break;
+                    default:
+                }
+            }
+        }  else {
+            if (table.getColumnCount() is 0) {
+                x += 5;
+            } else {
+                int alignmnent = column.getAlignment();
+                switch (alignmnent) {
+                    case SWT.LEFT:
+                        x += 5;
+                        break;
+                    case SWT.RIGHT:
+                        x = bounds.width- extent.x - 2;
+                        break;
+                    case SWT.CENTER:
+                        x += (bounds.width - x - extent.x) / 2 + 2;
+                        break;
+                    default:
+                }
+            }
+        }
+        int textY = (size.y - extent.y) / 2;
+        gc.drawString(text, x, textY);
+    }
+    if (isFocusControl()) {
+        gc.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
+        gc.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
+        gc.drawFocus(0, 0, size.x, size.y);
+    }
+}
+
+void tableFocusIn(Event event) {
+    if (isDisposed()) return;
+    if (isVisible()) {
+        if (row is null && column is null) return;
+        setFocus();
+    }
+}
+
+void tableMouseDown(Event event) {
+    if (isDisposed() || !isVisible()) return;
+    Point pt = new Point(event.x, event.y);
+    int lineWidth = table.getLinesVisible() ? table.getGridLineWidth() : 0;
+    TableItem item = table.getItem(pt);
+    if ((table.getStyle() & SWT.FULL_SELECTION) !is 0) {
+        if (item is null) return;
+    } else {
+        int start = item !is null ? table.indexOf(item) : table.getTopIndex();
+        int end = table.getItemCount();
+        Rectangle clientRect = table.getClientArea();
+        for (int i = start; i < end; i++) {
+            TableItem nextItem = table.getItem(i);
+            Rectangle rect = nextItem.getBounds(0);
+            if (pt.y >= rect.y && pt.y < rect.y + rect.height + lineWidth) {
+                item = nextItem;
+                break;
+            }
+            if (rect.y > clientRect.y + clientRect.height)  return;
+        }
+        if (item is null) return;
+    }
+    TableColumn newColumn = null;
+    int columnCount = table.getColumnCount();
+    if (columnCount is 0) {
+        if ((table.getStyle() & SWT.FULL_SELECTION) is 0) {
+            Rectangle rect = item.getBounds(0);
+            rect.width += lineWidth;
+            rect.height += lineWidth;
+            if (!rect.contains(pt)) return;
+        }
+    } else {
+        for (int i = 0; i < columnCount; i++) {
+            Rectangle rect = item.getBounds(i);
+            rect.width += lineWidth;
+            rect.height += lineWidth;
+            if (rect.contains(pt)) {
+                newColumn = table.getColumn(i);
+                break;
+            }
+        }
+        if (newColumn is null) {
+            if ((table.getStyle() & SWT.FULL_SELECTION) is 0) return;
+            newColumn = table.getColumn(0);
+        }
+    }
+    setRowColumn(item, newColumn, true);
+    setFocus();
+    return;
+}
+void setRowColumn(int row, int column, bool notify) {
+    TableItem item = row is -1 ? null : table.getItem(row);
+    TableColumn col = column is -1 || table.getColumnCount() is 0 ? null : table.getColumn(column);
+    setRowColumn(item, col, notify);
+}
+void setRowColumn(TableItem row, TableColumn column, bool notify) {
+    if (this.row is row && this.column is column) {
+        return;
+    }
+    if (this.row !is null && this.row !is row) {
+        this.row.removeListener(SWT.Dispose, disposeItemListener);
+        this.row = null;
+    }
+    if (this.column !is null && this.column !is column) {
+        this.column.removeListener(SWT.Dispose, disposeColumnListener);
+        this.column.removeListener(SWT.Move, resizeListener);
+        this.column.removeListener(SWT.Resize, resizeListener);
+        this.column = null;
+    }
+    if (row !is null) {
+        if (this.row !is row) {
+            this.row = row;
+            row.addListener(SWT.Dispose, disposeItemListener);
+            table.showItem(row);
+        }
+        if (this.column !is column && column !is null) {
+            this.column = column;
+            column.addListener(SWT.Dispose, disposeColumnListener);
+            column.addListener(SWT.Move, resizeListener);
+            column.addListener(SWT.Resize, resizeListener);
+            table.showColumn(column);
+        }
+        int columnIndex = column is null ? 0 : table.indexOf(column);
+        setBounds(row.getBounds(columnIndex));
+        redraw();
+        if (notify) {
+            notifyListeners(SWT.Selection, new Event());
+        }
+    }
+}
+
+public override void setVisible(bool visible) {
+    checkWidget();
+    if (visible) _resize();
+    super.setVisible(visible);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the user changes the receiver's selection.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener(SelectionListener)
+ *
+ * @since 3.0
+ */
+public void removeSelectionListener(SelectionListener listener) {
+    checkWidget();
+    if (listener is null) {
+        SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    }
+    removeListener(SWT.Selection, listener);
+    removeListener(SWT.DefaultSelection, listener);
+}
+
+void _resize() {
+    if (row is null) {
+        setBounds(-200, -200, 0, 0);
+    } else {
+        int columnIndex = column is null ? 0 : table.indexOf(column);
+        setBounds(row.getBounds(columnIndex));
+    }
+}
+/**
+ * Returns the column over which the TableCursor is positioned.
+ *
+ * @return the column for the current position
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getColumn() {
+    checkWidget();
+    return column is null ? 0 : table.indexOf(column);
+}
+/**
+ * Returns the background color that the receiver will use to draw.
+ *
+ * @return the receiver's background color
+ */
+public Color getBackground() {
+    checkWidget();
+    if (background is null) {
+        return getDisplay().getSystemColor(BACKGROUND);
+    }
+    return background;
+}
+/**
+ * Returns the foreground color that the receiver will use to draw.
+ *
+ * @return the receiver's foreground color
+ */
+public Color getForeground() {
+    checkWidget();
+    if (foreground is null) {
+        return getDisplay().getSystemColor(FOREGROUND);
+    }
+    return foreground;
+}
+/**
+ * Returns the row over which the TableCursor is positioned.
+ *
+ * @return the item for the current position
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TableItem getRow() {
+    checkWidget();
+    return row;
+}
+/**
+ * Sets the receiver's background color to the color specified
+ * by the argument, or to the default system color for the control
+ * if the argument is null.
+ * <p>
+ * Note: This operation is a hint and may be overridden by the platform.
+ * For example, on Windows the background of a Button cannot be changed.
+ * </p>
+ * @param color the new color (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> 
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public override void setBackground (Color color) {
+    background = color;
+    super.setBackground(getBackground());
+    redraw();
+}
+/**
+ * Sets the receiver's foreground color to the color specified
+ * by the argument, or to the default system color for the control
+ * if the argument is null.
+ * <p>
+ * Note: This operation is a hint and may be overridden by the platform.
+ * </p>
+ * @param color the new color (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li> 
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public override void setForeground (Color color) {
+    foreground = color;
+    super.setForeground(getForeground());
+    redraw();
+}
+/**
+ * Positions the TableCursor over the cell at the given row and column in the parent table.
+ *
+ * @param row the index of the row for the cell to select
+ * @param column the index of column for the cell to select
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ */
+public void setSelection(int row, int column) {
+    checkWidget();
+    int columnCount = table.getColumnCount();
+    int maxColumnIndex =  columnCount is 0 ? 0 : columnCount - 1;
+    if (row < 0
+        || row >= table.getItemCount()
+        || column < 0
+        || column > maxColumnIndex)
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    setRowColumn(row, column, false);
+}
+/**
+ * Positions the TableCursor over the cell at the given row and column in the parent table.
+ *
+ * @param row the TableItem of the row for the cell to select
+ * @param column the index of column for the cell to select
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ */
+public void setSelection(TableItem row, int column) {
+    checkWidget();
+    int columnCount = table.getColumnCount();
+    int maxColumnIndex =  columnCount is 0 ? 0 : columnCount - 1;
+    if (row is null
+        || row.isDisposed()
+        || column < 0
+        || column > maxColumnIndex)
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    setRowColumn(table.indexOf(row), column, false);
+}
+void unhookRowColumnListeners() {
+    if (column !is null) {
+        column.removeListener(SWT.Dispose, disposeColumnListener);
+        column.removeListener(SWT.Move, resizeListener);
+        column.removeListener(SWT.Resize, resizeListener);
+        column = null;
+    }
+    if (row !is null) {
+        row.removeListener(SWT.Dispose, disposeItemListener);
+        row = null;
+    }
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/TableEditor.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,271 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.TableEditor;
+
+import java.lang.all;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.custom.ControlEditor;
+
+/**
+*
+* A TableEditor is a manager for a Control that appears above a cell in a Table and tracks with the
+* moving and resizing of that cell.  It can be used to display a text widget above a cell
+* in a Table so that the user can edit the contents of that cell.  It can also be used to display
+* a button that can launch a dialog for modifying the contents of the associated cell.
+*
+* <p> Here is an example of using a TableEditor:
+* <code><pre>
+*   final Table table = new Table(shell, SWT.FULL_SELECTION | SWT.HIDE_SELECTION);
+*   TableColumn column1 = new TableColumn(table, SWT.NONE);
+*   TableColumn column2 = new TableColumn(table, SWT.NONE);
+*   for (int i = 0; i &lt; 10; i++) {
+*       TableItem item = new TableItem(table, SWT.NONE);
+*       item.setText(new String[] {"item " + i, "edit this value"});
+*   }
+*   column1.pack();
+*   column2.pack();
+*
+*   final TableEditor editor = new TableEditor(table);
+*   //The editor must have the same size as the cell and must
+*   //not be any smaller than 50 pixels.
+*   editor.horizontalAlignment = SWT.LEFT;
+*   editor.grabHorizontal = true;
+*   editor.minimumWidth = 50;
+*   // editing the second column
+*   final int EDITABLECOLUMN = 1;
+*
+*   table.addSelectionListener(new SelectionAdapter() {
+*       public void widgetSelected(SelectionEvent e) {
+*           // Clean up any previous editor control
+*           Control oldEditor = editor.getEditor();
+*           if (oldEditor !is null) oldEditor.dispose();
+*
+*           // Identify the selected row
+*           TableItem item = (TableItem)e.item;
+*           if (item is null) return;
+*
+*           // The control that will be the editor must be a child of the Table
+*           Text newEditor = new Text(table, SWT.NONE);
+*           newEditor.setText(item.getText(EDITABLECOLUMN));
+*           newEditor.addModifyListener(new ModifyListener() {
+*               public void modifyText(ModifyEvent e) {
+*                   Text text = (Text)editor.getEditor();
+*                   editor.getItem().setText(EDITABLECOLUMN, text.getText());
+*               }
+*           });
+*           newEditor.selectAll();
+*           newEditor.setFocus();
+*           editor.setEditor(newEditor, item, EDITABLECOLUMN);
+*       }
+*   });
+* </pre></code>
+*
+* @see <a href="http://www.eclipse.org/swt/snippets/#tableeditor">TableEditor snippets</a>
+* @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+*/
+public class TableEditor : ControlEditor {
+    Table table;
+    TableItem item;
+    int column = -1;
+    ControlListener columnListener;
+    Runnable timer;
+    static final int TIMEOUT = 1500;
+/**
+* Creates a TableEditor for the specified Table.
+*
+* @param table the Table Control above which this editor will be displayed
+*
+*/
+public this (Table table) {
+    super(table);
+    this.table = table;
+
+    columnListener = new class() ControlListener {
+        public void controlMoved(ControlEvent e){
+            layout ();
+        }
+        public void controlResized(ControlEvent e){
+            layout ();
+        }
+    };
+    timer = new class() Runnable {
+        public void run() {
+            layout ();
+        }
+    };
+
+    // To be consistent with older versions of SWT, grabVertical defaults to true
+    grabVertical = true;
+}
+override Rectangle computeBounds () {
+    if (item is null || column is -1 || item.isDisposed()) return new Rectangle(0, 0, 0, 0);
+    Rectangle cell = item.getBounds(column);
+    Rectangle rect = item.getImageBounds(column);
+    cell.x = rect.x + rect.width;
+    cell.width -= rect.width;
+    Rectangle area = table.getClientArea();
+    if (cell.x < area.x + area.width) {
+        if (cell.x + cell.width > area.x + area.width) {
+            cell.width = area.x + area.width - cell.x;
+        }
+    }
+    Rectangle editorRect = new Rectangle(cell.x, cell.y, minimumWidth, minimumHeight);
+
+    if (grabHorizontal) {
+        editorRect.width = Math.max(cell.width, minimumWidth);
+    }
+
+    if (grabVertical) {
+        editorRect.height = Math.max(cell.height, minimumHeight);
+    }
+
+    if (horizontalAlignment is SWT.RIGHT) {
+        editorRect.x += cell.width - editorRect.width;
+    } else if (horizontalAlignment is SWT.LEFT) {
+        // do nothing - cell.x is the right answer
+    } else { // default is CENTER
+        editorRect.x += (cell.width - editorRect.width)/2;
+    }
+
+    if (verticalAlignment is SWT.BOTTOM) {
+        editorRect.y += cell.height - editorRect.height;
+    } else if (verticalAlignment is SWT.TOP) {
+        // do nothing - cell.y is the right answer
+    } else { // default is CENTER
+        editorRect.y += (cell.height - editorRect.height)/2;
+    }
+    return editorRect;
+}
+/**
+ * Removes all associations between the TableEditor and the cell in the table.  The
+ * Table and the editor Control are <b>not</b> disposed.
+ */
+public override void dispose () {
+    if (table !is null && !table.isDisposed()) {
+        if (this.column > -1 && this.column < table.getColumnCount()){
+            TableColumn tableColumn = table.getColumn(this.column);
+            tableColumn.removeControlListener(columnListener);
+        }
+    }
+    columnListener = null;
+    table = null;
+    item = null;
+    column = -1;
+    timer = null;
+    super.dispose();
+}
+/**
+* Returns the zero based index of the column of the cell being tracked by this editor.
+*
+* @return the zero based index of the column of the cell being tracked by this editor
+*/
+public int getColumn () {
+    return column;
+}
+/**
+* Returns the TableItem for the row of the cell being tracked by this editor.
+*
+* @return the TableItem for the row of the cell being tracked by this editor
+*/
+public TableItem getItem () {
+    return item;
+}
+void resize () {
+    layout();
+    /*
+     * On some platforms, the table scrolls when an item that
+     * is partially visible at the bottom of the table is
+     * selected.  Ensure that the correct row is edited by
+     * laying out one more time in a timerExec().
+     */
+    if (table !is null) {
+        Display display = table.getDisplay();
+        display.timerExec(-1, timer);
+        display.timerExec(TIMEOUT, timer);
+    }
+}
+/**
+* Sets the zero based index of the column of the cell being tracked by this editor.
+*
+* @param column the zero based index of the column of the cell being tracked by this editor
+*/
+public void setColumn(int column) {
+    int columnCount = table.getColumnCount();
+    // Separately handle the case where the table has no TableColumns.
+    // In this situation, there is a single default column.
+    if (columnCount is 0) {
+        this.column = (column is 0) ? 0 : -1;
+        resize();
+        return;
+    }
+    if (this.column > -1 && this.column < columnCount){
+        TableColumn tableColumn = table.getColumn(this.column);
+        tableColumn.removeControlListener(columnListener);
+        this.column = -1;
+    }
+
+    if (column < 0  || column >= table.getColumnCount()) return;
+
+    this.column = column;
+    TableColumn tableColumn = table.getColumn(this.column);
+    tableColumn.addControlListener(columnListener);
+    resize();
+}
+/**
+* Specifies the <code>TableItem</code> that is to be edited.
+*
+* @param item the item to be edited
+*/
+public void setItem (TableItem item) {
+    this.item = item;
+    resize();
+}
+public override void setEditor (Control editor) {
+    super.setEditor(editor);
+    resize();
+}
+/**
+* Specify the Control that is to be displayed and the cell in the table that it is to be positioned above.
+*
+* <p>Note: The Control provided as the editor <b>must</b> be created with its parent being the Table control
+* specified in the TableEditor constructor.
+*
+* @param editor the Control that is displayed above the cell being edited
+* @param item the TableItem for the row of the cell being tracked by this editor
+* @param column the zero based index of the column of the cell being tracked by this editor
+*/
+public void setEditor (Control editor, TableItem item, int column) {
+    setItem(item);
+    setColumn(column);
+    setEditor(editor);
+}
+public override void layout () {
+    if (table is null || table.isDisposed()) return;
+    if (item is null || item.isDisposed()) return;
+    int columnCount = table.getColumnCount();
+    if (columnCount is 0 && column !is 0) return;
+    if (columnCount > 0 && (column < 0 || column >= columnCount)) return;
+    super.layout();
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/TableTree.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,842 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.TableTree;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.TreeListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.PaletteData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.custom.TableTreeItem;
+import java.lang.all;
+
+/**
+ * A TableTree is a selectable user interface object
+ * that displays a hierarchy of items, and issues
+ * notification when an item is selected.
+ * A TableTree may be single or multi select.
+ * <p>
+ * The item children that may be added to instances of this class
+ * must be of type <code>TableTreeItem</code>.
+ * </p><p>
+ * Note that although this class is a subclass of <code>Composite</code>,
+ * it does not make sense to add <code>Control</code> children to it,
+ * or set a layout on it.
+ * </p><p>
+ * <dl>
+ *  <dt><b>Styles:</b> <dd> SINGLE, MULTI, CHECK, FULL_SELECTION
+ *  <dt><b>Events:</b> <dd> Selection, DefaultSelection, Collapse, Expand
+ * </dl>
+ * <p>
+ * Note: Only one of the styles SINGLE, and MULTI may be specified.
+ * </p>
+ *
+ * @deprecated As of 3.1 use Tree, TreeItem and TreeColumn
+ */
+public class TableTree : Composite {
+
+    alias Composite.computeSize computeSize;
+
+    Table table;
+    TableTreeItem[] items;
+    Image plusImage, minusImage, sizeImage;
+
+    /*
+    * TableTreeItems are not treated as children but rather as items.
+    * When the TableTree is disposed, all children are disposed because
+    * TableTree inherits this behaviour from Composite.  The items
+    * must be disposed separately.  Because TableTree is not part of
+    * the org.eclipse.swt.widgets module, the method releaseWidget can
+    * not be overridden (this is how items are disposed of in Table and Tree).
+    * Instead, the items are disposed of in response to the dispose event on the
+    * TableTree.  The "inDispose" flag is used to distinguish between disposing
+    * one TableTreeItem (e.g. when removing an entry from the TableTree) and
+    * disposing the entire TableTree.
+    */
+    bool inDispose = false;
+
+    static final TableTreeItem[] EMPTY_ITEMS;
+    static final String[] EMPTY_TEXTS;
+    static final Image[] EMPTY_IMAGES;
+    static final String ITEMID = "TableTreeItemID"; //$NON-NLS-1$
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a widget which will be the parent of the new instance (cannot be null)
+ * @param style the style of widget to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ *
+ * @see SWT#SINGLE
+ * @see SWT#MULTI
+ * @see SWT#CHECK
+ * @see SWT#FULL_SELECTION
+ * @see #getStyle
+ */
+public this(Composite parent, int style) {
+    super(parent, checkStyle (style));
+    items = EMPTY_ITEMS;
+    table = new Table(this, style);
+    Listener tableListener = new class() Listener {
+        public void handleEvent(Event e) {
+            switch (e.type) {
+            case SWT.MouseDown: onMouseDown(e); break;
+            case SWT.Selection: onSelection(e); break;
+            case SWT.DefaultSelection: onSelection(e); break;
+            case SWT.KeyDown: onKeyDown(e); break;
+            default:
+            }
+        }
+    };
+    int[] tableEvents = [SWT.MouseDown,
+                                   SWT.Selection,
+                                   SWT.DefaultSelection,
+                                   SWT.KeyDown];
+    for (int i = 0; i < tableEvents.length; i++) {
+        table.addListener(tableEvents[i], tableListener);
+    }
+
+    Listener listener = new class() Listener {
+        public void handleEvent(Event e) {
+            switch (e.type) {
+            case SWT.Dispose: onDispose(e); break;
+            case SWT.Resize:  onResize(e); break;
+            case SWT.FocusIn: onFocusIn(e); break;
+            default:
+            }
+        }
+    };
+    int[] events = [SWT.Dispose,
+                              SWT.Resize,
+                              SWT.FocusIn];
+    for (int i = 0; i < events.length; i++) {
+        addListener(events[i], listener);
+    }
+}
+
+int addItem(TableTreeItem item, int index) {
+    if (index < 0 || index > items.length) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    TableTreeItem[] newItems = new TableTreeItem[items.length + 1];
+    System.arraycopy(items, 0, newItems, 0, index);
+    newItems[index] = item;
+    System.arraycopy(items, index, newItems, index + 1, items.length - index);
+    items = newItems;
+
+    /* Return the index in the table where this table should be inserted */
+    if (index is items.length - 1 )
+        return table.getItemCount();
+    else
+        return table.indexOf(items[index+1].tableItem);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the user changes the receiver's selection, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * When <code>widgetSelected</code> is called, the item field of the event object is valid.
+ * If the receiver has <code>SWT.CHECK</code> style set and the check selection changes,
+ * the event object detail field contains the value <code>SWT.CHECK</code>.
+ * <code>widgetDefaultSelected</code> is typically called when an item is double-clicked.
+ * The item field of the event object is valid for default selection, but the detail field is not used.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the user changes the receiver's selection
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener(SelectionListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Selection,typedListener);
+    addListener (SWT.DefaultSelection,typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when an item in the receiver is expanded or collapsed
+ * by sending it one of the messages defined in the <code>TreeListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see TreeListener
+ * @see #removeTreeListener
+ */
+public void addTreeListener(TreeListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Expand, typedListener);
+    addListener (SWT.Collapse, typedListener);
+}
+private static int checkStyle (int style) {
+    int mask = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
+    style = style & mask;
+    return style;
+}
+public override Point computeSize (int wHint, int hHint, bool changed) {
+    checkWidget();
+    return table.computeSize (wHint, hHint, changed);
+}
+public override Rectangle computeTrim (int x, int y, int width, int height) {
+    checkWidget();
+    return table.computeTrim(x, y, width, height);
+}
+
+/**
+ * Deselects all items.
+ * <p>
+ * If an item is selected, it is deselected.
+ * If an item is not selected, it remains unselected.
+ *
+ * @exception SWTException <ul>
+ *  <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
+ *  <li>ERROR_WIDGET_DISPOSED when the widget has been disposed
+ * </ul>
+ */
+public void deselectAll () {
+    checkWidget();
+    table.deselectAll();
+}
+
+/* Expand upward from the specified leaf item. */
+void expandItem (TableTreeItem item) {
+    if (item is null) return;
+    expandItem(item.parentItem);
+    if (!item.getVisible()) item.setVisible(true);
+    if ( !item.expanded && item.items.length > 0) {
+        item.setExpanded(true);
+        Event event = new Event();
+        event.item = item;
+        notifyListeners(SWT.Expand, event);
+    }
+}
+public override Color getBackground () {
+    // This method must be overridden otherwise, in a TableTree in which the first
+    // item has no sub items, a grey (Widget background colour) square will appear in
+    // the first column of the first item.
+    // It is not possible in the constructor to set the background of the TableTree
+    // to be the same as the background of the Table because this interferes with
+    // the TableTree adapting to changes in the System color settings.
+    return table.getBackground();
+}
+public override Rectangle getClientArea () {
+    return table.getClientArea();
+}
+public override Color getForeground () {
+    return table.getForeground();
+}
+public override Font getFont () {
+    return table.getFont();
+}
+/**
+ * Gets the number of items.
+ * <p>
+ * @return the number of items in the widget
+ */
+public int getItemCount () {
+    //checkWidget();
+    return items.length;
+}
+
+/**
+ * Gets the height of one item.
+ * <p>
+ * This operation will fail if the height of
+ * one item could not be queried from the OS.
+ *
+ * @return the height of one item in the widget
+ *
+ * @exception SWTException <ul>
+ *  <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
+ *  <li>ERROR_WIDGET_DISPOSED when the widget has been disposed
+ * </ul>
+ */
+public int getItemHeight () {
+    checkWidget();
+    return table.getItemHeight();
+}
+
+/**
+ * Gets the items.
+ * <p>
+ * @return the items in the widget
+ */
+public TableTreeItem [] getItems () {
+    //checkWidget();
+    TableTreeItem[] newItems = new TableTreeItem[items.length];
+    System.arraycopy(items, 0, newItems, 0, items.length);
+    return newItems;
+}
+
+/**
+ * Gets the selected items.
+ * <p>
+ * This operation will fail if the selected
+ * items cannot be queried from the OS.
+ *
+ * @return the selected items in the widget
+ *
+ * @exception SWTException <ul>
+ *      <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *      <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ *  </ul>
+ */
+public TableTreeItem [] getSelection () {
+    checkWidget();
+    TableItem[] selection = table.getSelection();
+    TableTreeItem [] result = new TableTreeItem[selection.length];
+    for (int i = 0; i < selection.length; i++){
+        result[i] = cast(TableTreeItem) selection[i].getData(ITEMID);
+    }
+    return result;
+}
+
+/**
+ * Gets the number of selected items.
+ * <p>
+ * This operation will fail if the number of selected
+ * items cannot be queried from the OS.
+ *
+ * @return the number of selected items in the widget
+ *
+ * @exception SWTException <ul>
+ *      <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *      <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ *  </ul>
+ */
+public int getSelectionCount () {
+    checkWidget();
+    return table.getSelectionCount();
+}
+
+public override int getStyle () {
+    checkWidget();
+    return table.getStyle();
+}
+
+/**
+ * Returns the underlying Table control.
+ *
+ * @return the underlying Table control
+ */
+public Table getTable () {
+    //checkWidget();
+    return table;
+}
+
+void createImages () {
+
+    int itemHeight = sizeImage.getBounds().height;
+    // Calculate border around image.
+    // At least 9 pixels are needed to draw the image
+    // Leave at least a 6 pixel border.
+    int indent = Math.min(6, (itemHeight - 9) / 2);
+    indent = Math.max(0, indent);
+    int size = Math.max (10, itemHeight - 2 * indent);
+    size = ((size + 1) / 2) * 2; // size must be an even number
+    int midpoint = indent + size / 2;
+
+    Color foreground = getForeground();
+    Color plusMinus = getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW);
+    Color background = getBackground();
+
+    /* Plus image */
+    PaletteData palette = new PaletteData( [ foreground.getRGB(), background.getRGB(), plusMinus.getRGB()]);
+    ImageData imageData = new ImageData(itemHeight, itemHeight, 4, palette);
+    imageData.transparentPixel = 1;
+    plusImage = new Image(getDisplay(), imageData);
+    GC gc = new GC(plusImage);
+    gc.setBackground(background);
+    gc.fillRectangle(0, 0, itemHeight, itemHeight);
+    gc.setForeground(plusMinus);
+    gc.drawRectangle(indent, indent, size, size);
+    gc.setForeground(foreground);
+    gc.drawLine(midpoint, indent + 2, midpoint, indent + size - 2);
+    gc.drawLine(indent + 2, midpoint, indent + size - 2, midpoint);
+    gc.dispose();
+
+    /* Minus image */
+    palette = new PaletteData([foreground.getRGB(), background.getRGB(), plusMinus.getRGB()]);
+    imageData = new ImageData(itemHeight, itemHeight, 4, palette);
+    imageData.transparentPixel = 1;
+    minusImage = new Image(getDisplay(), imageData);
+    gc = new GC(minusImage);
+    gc.setBackground(background);
+    gc.fillRectangle(0, 0, itemHeight, itemHeight);
+    gc.setForeground(plusMinus);
+    gc.drawRectangle(indent, indent, size, size);
+    gc.setForeground(foreground);
+    gc.drawLine(indent + 2, midpoint, indent + size - 2, midpoint);
+    gc.dispose();
+}
+
+Image getPlusImage() {
+    if (plusImage is null) createImages();
+    return plusImage;
+}
+
+Image getMinusImage() {
+    if (minusImage is null) createImages();
+    return minusImage;
+}
+
+/**
+ * Gets the index of an item.
+ *
+ * <p>The widget is searched starting at 0 until an
+ * item is found that is equal to the search item.
+ * If no item is found, -1 is returned.  Indexing
+ * is zero based.  This index is relative to the parent only.
+ *
+ * @param item the search item
+ * @return the index of the item or -1
+ */
+public int indexOf (TableTreeItem item) {
+    //checkWidget();
+    for (int i = 0; i < items.length; i++) {
+        if (item is items[i]) return i;
+    }
+    return -1;
+}
+
+void onDispose(Event e) {
+    /*
+     * Usually when an item is disposed, destroyItem will change the size of the items array
+     * and dispose of the underlying table items.
+     * Since the whole table tree is being disposed, this is not necessary.  For speed
+     * the inDispose flag is used to skip over this part of the item dispose.
+     */
+    inDispose = true;
+    for (int i = 0; i < items.length; i++) {
+        items[i].dispose();
+    }
+    inDispose = false;
+    if (plusImage !is null) plusImage.dispose();
+    if (minusImage !is null) minusImage.dispose();
+    if (sizeImage !is null) sizeImage.dispose();
+    plusImage = minusImage = sizeImage = null;
+}
+
+void onResize(Event e) {
+    Point size = getSize();
+    table.setBounds(0, 0, size.x, size.y);
+}
+
+void onSelection(Event e) {
+    Event event = new Event();
+    TableItem tableItem = cast(TableItem)e.item;
+    TableTreeItem item = getItem(tableItem);
+    event.item = item;
+
+    if (e.type is SWT.Selection && e.detail is SWT.CHECK && item !is null) {
+        event.detail = SWT.CHECK;
+        item.checked = tableItem.getChecked();
+    }
+    notifyListeners(e.type, event);
+}
+/**
+ * Returns the item at the given, zero-relative index in the
+ * receiver. Throws an exception if the index is out of range.
+ *
+ * @param index the index of the item to return
+ * @return the item at the given index
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public TableTreeItem getItem (int index) {
+    checkWidget();
+    int count = items.length;
+    if (!(0 <= index && index < count)) SWT.error (SWT.ERROR_INVALID_RANGE);
+    return items [index];
+}
+
+/**
+ * Returns the item at the given point in the receiver
+ * or null if no such item exists. The point is in the
+ * coordinate system of the receiver.
+ *
+ * @param point the point used to locate the item
+ * @return the item at the given point
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TableTreeItem getItem(Point point) {
+    checkWidget();
+    TableItem item = table.getItem(point);
+    if (item is null) return null;
+    return getItem(item);
+
+}
+TableTreeItem getItem(TableItem tableItem) {
+    if (tableItem is null) return null;
+    for (int i = 0; i < items.length; i++) {
+            TableTreeItem item = items[i].getItem(tableItem);
+            if (item !is null) return item;
+    }
+    return null;
+}
+void onFocusIn (Event e) {
+    table.setFocus();
+}
+
+void onKeyDown (Event e) {
+    TableTreeItem[] selection = getSelection();
+    if (selection.length is 0) return;
+    TableTreeItem item = selection[0];
+    int type = 0;
+    if (e.keyCode is SWT.ARROW_RIGHT || e.keyCode is SWT.ARROW_LEFT) {
+        int trailKey = (getStyle() & SWT.MIRRORED) !is 0 ? SWT.ARROW_LEFT : SWT.ARROW_RIGHT;
+        if (e.keyCode is trailKey) {
+            if (item.getItemCount() is 0) return;
+            if (item.getExpanded()) {
+                TableTreeItem newSelection = item.getItems()[0];
+                table.setSelection([newSelection.tableItem]);
+                showItem(newSelection);
+                type = SWT.Selection;
+            } else {
+                item.setExpanded(true);
+                type = SWT.Expand;
+            }
+        } else {
+            if (item.getExpanded()) {
+                item.setExpanded(false);
+                type = SWT.Collapse;
+            } else {
+                TableTreeItem parent = item.getParentItem();
+                if (parent !is null) {
+                    int index = parent.indexOf(item);
+                    if (index !is 0) return;
+                    table.setSelection([parent.tableItem]);
+                    type = SWT.Selection;
+                }
+            }
+        }
+    }
+    if (e.character is '*') {
+        item.expandAll(true);
+    }
+    if (e.character is '-') {
+        if (item.getExpanded()) {
+            item.setExpanded(false);
+            type = SWT.Collapse;
+        }
+    }
+    if (e.character is '+') {
+        if (item.getItemCount() > 0 && !item.getExpanded()) {
+            item.setExpanded(true);
+            type = SWT.Expand;
+        }
+    }
+    if (type is 0) return;
+    Event event = new Event();
+    event.item = item;
+    notifyListeners(type, event);
+}
+void onMouseDown(Event event) {
+    /* If user clicked on the [+] or [-], expand or collapse the tree. */
+    TableItem[] items = table.getItems();
+    for (int i = 0; i < items.length; i++) {
+        Rectangle rect = items[i].getImageBounds(0);
+        if (rect.contains(event.x, event.y)) {
+            TableTreeItem item = cast(TableTreeItem) items[i].getData(ITEMID);
+            event = new Event();
+            event.item = item;
+            item.setExpanded(!item.getExpanded());
+            if (item.getExpanded()) {
+                notifyListeners(SWT.Expand, event);
+            } else {
+                notifyListeners(SWT.Collapse, event);
+            }
+            return;
+        }
+    }
+}
+
+/**
+ * Removes all items.
+ * <p>
+ * This operation will fail when an item
+ * could not be removed in the OS.
+ *
+ * @exception SWTException <ul>
+ *  <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
+ *  <li>ERROR_WIDGET_DISPOSED when the widget has been disposed
+ * </ul>
+ */
+public void removeAll () {
+    checkWidget();
+    setRedraw(false);
+    for (int i = items.length - 1; i >= 0; i--) {
+        items[i].dispose();
+    }
+    items = EMPTY_ITEMS;
+    setRedraw(true);
+}
+
+void removeItem(TableTreeItem item) {
+    int index = 0;
+    while (index < items.length && items[index] !is item) index++;
+    if (index is items.length) return;
+    TableTreeItem[] newItems = new TableTreeItem[items.length - 1];
+    System.arraycopy(items, 0, newItems, 0, index);
+    System.arraycopy(items, index + 1, newItems, index, items.length - index - 1);
+    items = newItems;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the user changes the receiver's selection.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener (SelectionListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    removeListener(SWT.Selection, listener);
+    removeListener(SWT.DefaultSelection, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when items in the receiver are expanded or collapsed.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see TreeListener
+ * @see #addTreeListener
+ */
+public void removeTreeListener (TreeListener listener) {
+    checkWidget();
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    removeListener(SWT.Expand, listener);
+    removeListener(SWT.Collapse, listener);
+}
+
+/**
+ * Selects all of the items in the receiver.
+ * <p>
+ * If the receiver is single-select, do nothing.
+ *
+ * @exception SWTException <ul>
+ *  <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
+ *  <li>ERROR_WIDGET_DISPOSED when the widget has been disposed
+ * </ul>
+ */
+public void selectAll () {
+    checkWidget();
+    table.selectAll();
+}
+public override void setBackground (Color color) {
+    super.setBackground(color);
+    table.setBackground(color);
+    if (sizeImage !is null) {
+        GC gc = new GC (sizeImage);
+        gc.setBackground(getBackground());
+        Rectangle size = sizeImage.getBounds();
+        gc.fillRectangle(size);
+        gc.dispose();
+    }
+}
+public override void setEnabled (bool enabled) {
+    super.setEnabled(enabled);
+    table.setEnabled(enabled);
+}
+public override void setFont (Font font) {
+    super.setFont(font);
+    table.setFont(font);
+}
+public override void setForeground (Color color) {
+    super.setForeground(color);
+    table.setForeground(color);
+}
+public override void setMenu (Menu menu) {
+    super.setMenu(menu);
+    table.setMenu(menu);
+}
+
+/**
+ * Sets the receiver's selection to be the given array of items.
+ * The current selection is cleared before the new items are selected.
+ * <p>
+ * Items that are not in the receiver are ignored.
+ * If the receiver is single-select and multiple items are specified,
+ * then all items are ignored.
+ *
+ * @param items the array of items
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if one of the item has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see TableTree#deselectAll()
+ */
+public void setSelection (TableTreeItem[] items) {
+    checkWidget ();
+    // SWT extension: allow null for zero length string
+    //if (items is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    int length = items.length;
+    if (length is 0 || ((table.getStyle() & SWT.SINGLE) !is 0 && length > 1)) {
+        deselectAll();
+        return;
+    }
+    TableItem[] tableItems = new TableItem[length];
+    for (int i = 0; i < length; i++) {
+        if (items[i] is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+        if (!items[i].getVisible()) expandItem (items[i]);
+        tableItems[i] = items[i].tableItem;
+    }
+    table.setSelection(tableItems);
+}
+public override void setToolTipText (String string) {
+    super.setToolTipText(string);
+    table.setToolTipText(string);
+}
+
+/**
+ * Shows the item.  If the item is already showing in the receiver,
+ * this method simply returns.  Otherwise, the items are scrolled
+ * and expanded until the item is visible.
+ *
+ * @param item the item to be shown
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see TableTree#showSelection()
+ */
+public void showItem (TableTreeItem item) {
+    checkWidget();
+    if (item is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    if (!item.getVisible()) expandItem (item);
+    TableItem tableItem = item.tableItem;
+    table.showItem(tableItem);
+}
+
+/**
+ * Shows the selection.
+ * <p>
+ * If there is no selection or the selection
+ * is already visible, this method does nothing.
+ * If the selection is scrolled out of view,
+ * the top index of the widget is changed such
+ * that selection becomes visible.
+ *
+ * @exception SWTException <ul>
+ *  <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
+ *  <li>ERROR_WIDGET_DISPOSED when the widget has been disposed
+ * </ul>
+ */
+public void showSelection () {
+    checkWidget();
+    table.showSelection();
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/TableTreeEditor.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,281 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.TableTreeEditor;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.TreeEvent;
+import org.eclipse.swt.events.TreeListener;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.custom.ControlEditor;
+import org.eclipse.swt.custom.TableTree;
+import org.eclipse.swt.custom.TableTreeItem;
+
+
+/**
+*
+* A TableTreeEditor is a manager for a Control that appears above a cell in a TableTree
+* and tracks with the moving and resizing of that cell.  It can be used to display a
+* text widget above a cell in a TableTree so that the user can edit the contents of
+* that cell.  It can also be used to display a button that can launch a dialog for
+* modifying the contents of the associated cell.
+*
+* <p> Here is an example of using a TableTreeEditor:
+* <code><pre>
+*   final TableTree tableTree = new TableTree(shell, SWT.FULL_SELECTION | SWT.HIDE_SELECTION);
+*   final Table table = tableTree.getTable();
+*   TableColumn column1 = new TableColumn(table, SWT.NONE);
+*   TableColumn column2 = new TableColumn(table, SWT.NONE);
+*   for (int i = 0; i &lt; 10; i++) {
+*       TableTreeItem item = new TableTreeItem(tableTree, SWT.NONE);
+*       item.setText(0, "item " + i);
+*       item.setText(1, "edit this value");
+*       for (int j = 0; j &lt; 3; j++) {
+*           TableTreeItem subitem = new TableTreeItem(item, SWT.NONE);
+*           subitem.setText(0, "subitem " + i + " " + j);
+*           subitem.setText(1, "edit this value");
+*       }
+*   }
+*   column1.setWidth(100);
+*   column2.pack();
+*
+*   final TableTreeEditor editor = new TableTreeEditor(tableTree);
+*   //The editor must have the same size as the cell and must
+*   //not be any smaller than 50 pixels.
+*   editor.horizontalAlignment = SWT.LEFT;
+*   editor.grabHorizontal = true;
+*   editor.minimumWidth = 50;
+*   // editing the second column
+*   final int EDITABLECOLUMN = 1;
+*
+*   tableTree.addSelectionListener(new SelectionAdapter() {
+*       public void widgetSelected(SelectionEvent e) {
+*           // Clean up any previous editor control
+*           Control oldEditor = editor.getEditor();
+*           if (oldEditor !is null) oldEditor.dispose();
+*
+*           // Identify the selected row
+*           TableTreeItem item = (TableTreeItem)e.item;
+*           if (item is null) return;
+*
+*           // The control that will be the editor must be a child of the Table
+*           Text newEditor = new Text(table, SWT.NONE);
+*           newEditor.setText(item.getText(EDITABLECOLUMN));
+*           newEditor.addModifyListener(new ModifyListener() {
+*               public void modifyText(ModifyEvent e) {
+*                   Text text = (Text)editor.getEditor();
+*                   editor.getItem().setText(EDITABLECOLUMN, text.getText());
+*               }
+*           });
+*           newEditor.selectAll();
+*           newEditor.setFocus();
+*           editor.setEditor(newEditor, item, EDITABLECOLUMN);
+*       }
+*   });
+* </pre></code>
+*
+* @deprecated As of 3.1 use TreeEditor with Tree, TreeItem and TreeColumn
+*/
+public class TableTreeEditor : ControlEditor {
+
+    alias ControlEditor.setEditor setEditor;
+
+    TableTree tableTree;
+    TableTreeItem item;
+    int column = -1;
+    ControlListener columnListener;
+    TreeListener treeListener;
+/**
+* Creates a TableTreeEditor for the specified TableTree.
+*
+* @param tableTree the TableTree Control above which this editor will be displayed
+*
+*/
+public this (TableTree tableTree) {
+    super(tableTree.getTable());
+    this.tableTree = tableTree;
+
+    treeListener = new class() TreeListener  {
+        Runnable runnable;
+        this() {
+            runnable = new class() Runnable {
+                public void run() {
+                    if (editor is null || editor.isDisposed()) return;
+                    if (this.outer.outer.tableTree.isDisposed()) return;
+                    layout();
+                    editor.setVisible(true);
+                }
+            };
+        }
+        public void treeCollapsed(TreeEvent e) {
+            if (editor is null || editor.isDisposed ()) return;
+            editor.setVisible(false);
+            e.display.asyncExec(runnable);
+        }
+        public void treeExpanded(TreeEvent e) {
+            if (editor is null || editor.isDisposed ()) return;
+            editor.setVisible(false);
+            e.display.asyncExec(runnable);
+        }
+    };
+    tableTree.addTreeListener(treeListener);
+
+    columnListener = new class() ControlListener {
+        public void controlMoved(ControlEvent e){
+            layout ();
+        }
+        public void controlResized(ControlEvent e){
+            layout ();
+        }
+    };
+
+    // To be consistent with older versions of SWT, grabVertical defaults to true
+    grabVertical = true;
+}
+
+override Rectangle computeBounds () {
+    if (item is null || column is -1 || item.isDisposed() || item.tableItem is null) return new Rectangle(0, 0, 0, 0);
+    Rectangle cell = item.getBounds(column);
+    Rectangle area = tableTree.getClientArea();
+    if (cell.x < area.x + area.width) {
+        if (cell.x + cell.width > area.x + area.width) {
+            cell.width = area.x + area.width - cell.x;
+        }
+    }
+    Rectangle editorRect = new Rectangle(cell.x, cell.y, minimumWidth, minimumHeight);
+
+    if (grabHorizontal) {
+        editorRect.width = Math.max(cell.width, minimumWidth);
+    }
+
+    if (grabVertical) {
+        editorRect.height = Math.max(cell.height, minimumHeight);
+    }
+
+    if (horizontalAlignment is SWT.RIGHT) {
+        editorRect.x += cell.width - editorRect.width;
+    } else if (horizontalAlignment is SWT.LEFT) {
+        // do nothing - cell.x is the right answer
+    } else { // default is CENTER
+        editorRect.x += (cell.width - editorRect.width)/2;
+    }
+
+    if (verticalAlignment is SWT.BOTTOM) {
+        editorRect.y += cell.height - editorRect.height;
+    } else if (verticalAlignment is SWT.TOP) {
+        // do nothing - cell.y is the right answer
+    } else { // default is CENTER
+        editorRect.y += (cell.height - editorRect.height)/2;
+    }
+    return editorRect;
+}
+/**
+ * Removes all associations between the TableTreeEditor and the cell in the table tree.  The
+ * TableTree and the editor Control are <b>not</b> disposed.
+ */
+public override void dispose () {
+    if (tableTree !is null && !tableTree.isDisposed()) {
+        Table table = tableTree.getTable();
+        if (table !is null && !table.isDisposed()) {
+            if (this.column > -1 && this.column < table.getColumnCount()){
+                TableColumn tableColumn = table.getColumn(this.column);
+                tableColumn.removeControlListener(columnListener);
+            }
+        }
+        if (treeListener !is null) tableTree.removeTreeListener(treeListener);
+    }
+    treeListener = null;
+    columnListener = null;
+    tableTree = null;
+    item = null;
+    column = -1;
+    super.dispose();
+}
+/**
+* Returns the zero based index of the column of the cell being tracked by this editor.
+*
+* @return the zero based index of the column of the cell being tracked by this editor
+*/
+public int getColumn () {
+    return column;
+}
+/**
+* Returns the TableTreeItem for the row of the cell being tracked by this editor.
+*
+* @return the TableTreeItem for the row of the cell being tracked by this editor
+*/
+public TableTreeItem getItem () {
+    return item;
+}
+public void setColumn(int column) {
+    Table table = tableTree.getTable();
+    int columnCount = table.getColumnCount();
+    // Separately handle the case where the table has no TableColumns.
+    // In this situation, there is a single default column.
+    if (columnCount is 0) {
+        this.column = (column is 0) ? 0 : -1;
+        layout();
+        return;
+    }
+    if (this.column > -1 && this.column < columnCount){
+        TableColumn tableColumn = table.getColumn(this.column);
+        tableColumn.removeControlListener(columnListener);
+        this.column = -1;
+    }
+
+    if (column < 0  || column >= table.getColumnCount()) return;
+
+    this.column = column;
+    TableColumn tableColumn = table.getColumn(this.column);
+    tableColumn.addControlListener(columnListener);
+    layout();
+}
+public void setItem (TableTreeItem item) {
+    this.item = item;
+    layout();
+}
+
+/**
+* Specify the Control that is to be displayed and the cell in the table that it is to be positioned above.
+*
+* <p>Note: The Control provided as the editor <b>must</b> be created with its parent being the Table control
+* specified in the TableEditor constructor.
+*
+* @param editor the Control that is displayed above the cell being edited
+* @param item the TableItem for the row of the cell being tracked by this editor
+* @param column the zero based index of the column of the cell being tracked by this editor
+*/
+alias ControlEditor.setEditor setEditor;
+public void setEditor (Control editor, TableTreeItem item, int column) {
+    setItem(item);
+    setColumn(column);
+    setEditor(editor);
+}
+public override void layout () {
+    if (tableTree is null || tableTree.isDisposed()) return;
+    if (item is null || item.isDisposed()) return;
+    Table table = tableTree.getTable();
+    int columnCount = table.getColumnCount();
+    if (columnCount is 0 && column !is 0) return;
+    if (columnCount > 0 && (column < 0 || column >= columnCount)) return;
+    super.layout();
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/TableTreeItem.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,894 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.TableTreeItem;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swt.custom.TableTree;
+import java.lang.all;
+
+
+/**
+ * A TableTreeItem is a selectable user interface object
+ * that represents an item in a hierarchy of items in a
+ * TableTree.
+ *
+ * @deprecated As of 3.1 use Tree, TreeItem and TreeColumn
+ */
+public class TableTreeItem : Item {
+    TableItem tableItem;
+    TableTree parent;
+    TableTreeItem parentItem;
+    TableTreeItem [] items;
+    String[] texts;
+    Image[] images;
+    Color background;
+    Color foreground;
+    Font font;
+    bool expanded;
+    bool checked;
+    bool grayed;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>TableTree</code>)
+ * and a style value describing its behavior and appearance.
+ * The item is added to the end of the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#getStyle()
+ */
+public this(TableTree parent, int style) {
+    this (parent, style, parent.getItemCount());
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>TableTree</code>,
+ * a style value describing its behavior and appearance, and the index
+ * at which to place it in the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ * @param index the index to store the receiver in its parent
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#getStyle()
+ */
+public this(TableTree parent, int style, int index) {
+    this (parent, null, style, index);
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>TableTreeItem</code>)
+ * and a style value describing its behavior and appearance.
+ * The item is added to the end of the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#getStyle()
+ */
+public this(TableTreeItem parent, int style) {
+    this (parent, style, parent.getItemCount());
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>TableTreeItem</code>),
+ * a style value describing its behavior and appearance, and the index
+ * at which to place it in the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ * @param index the index to store the receiver in its parent
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#getStyle()
+ */
+public this(TableTreeItem parent, int style, int index) {
+    this (parent.getParent(), parent, style, index);
+}
+
+this(TableTree parent, TableTreeItem parentItem, int style, int index) {
+
+    items = TableTree.EMPTY_ITEMS;
+    texts = TableTree.EMPTY_TEXTS;
+    images = TableTree.EMPTY_IMAGES;
+
+    super(parent, style);
+    this.parent = parent;
+    this.parentItem = parentItem;
+    if (parentItem is null) {
+
+        /* Root items are visible immediately */
+        int tableIndex = parent.addItem(this, index);
+        tableItem = new TableItem(parent.getTable(), style, tableIndex);
+        tableItem.setData(TableTree.ITEMID, this);
+        addCheck();
+        /*
+        * Feature in the Table.  The table uses the first image that
+        * is inserted into the table to size the table rows.  If the
+        * user is allowed to insert the first image, this will cause
+        * the +/- images to be scaled.  The fix is to insert a dummy
+        * image to force the size.
+        */
+        if (parent.sizeImage is null) {
+            int itemHeight = parent.getItemHeight();
+            parent.sizeImage = new Image(parent.getDisplay(), itemHeight, itemHeight);
+            GC gc = new GC (parent.sizeImage);
+            gc.setBackground(parent.getBackground());
+            gc.fillRectangle(0, 0, itemHeight, itemHeight);
+            gc.dispose();
+            tableItem.setImage(0, parent.sizeImage);
+        }
+    } else {
+        parentItem.addItem(this, index);
+    }
+}
+void addCheck() {
+    Table table = parent.getTable();
+    if ((table.getStyle() & SWT.CHECK) is 0) return;
+    tableItem.setChecked(checked);
+    tableItem.setGrayed(grayed);
+}
+void addItem(TableTreeItem item, int index) {
+    if (item is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (index < 0 || index > items.length) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+
+    /* Now that item has a sub-node it must indicate that it can be expanded */
+    if (items.length is 0 && index is 0) {
+        if (tableItem !is null) {
+            Image image = expanded ? parent.getMinusImage() : parent.getPlusImage();
+            tableItem.setImage(0, image);
+        }
+    }
+
+    /* Put the item in the items list */
+    TableTreeItem[] newItems = new TableTreeItem[items.length + 1];
+    System.arraycopy(items, 0, newItems, 0, index);
+    newItems[index] = item;
+    System.arraycopy(items, index, newItems, index + 1, items.length - index);
+    items = newItems;
+    if (expanded) item.setVisible(true);
+}
+
+/**
+ * Returns the receiver's background color.
+ *
+ * @return the background color
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ *
+ */
+public Color getBackground () {
+    checkWidget ();
+    return (background is null) ? parent.getBackground() : background;
+}
+
+/**
+ * Returns a rectangle describing the receiver's size and location
+ * relative to its parent.
+ *
+ * @return the receiver's bounding rectangle
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Rectangle getBounds (int index) {
+    checkWidget();
+    if (tableItem !is null) {
+        return tableItem.getBounds(index);
+    } else {
+        return new Rectangle(0, 0, 0, 0);
+    }
+}
+/**
+ * Returns <code>true</code> if the receiver is checked,
+ * and false otherwise.  When the parent does not have
+ * the <code>CHECK style, return false.
+ *
+ * @return the checked state of the checkbox
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool getChecked () {
+    checkWidget();
+    if (tableItem is null) return checked;
+    return tableItem.getChecked();
+}
+
+/**
+ * Returns <code>true</code> if the receiver is grayed,
+ * and false otherwise. When the parent does not have
+ * the <code>CHECK</code> style, return false.
+ *
+ * @return the grayed state of the checkbox
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.1
+ */
+public bool getGrayed () {
+    checkWidget();
+    if (tableItem is null) return grayed;
+    return tableItem.getGrayed();
+}
+
+/**
+ * Returns <code>true</code> if the receiver is expanded,
+ * and false otherwise.
+ * <p>
+ *
+ * @return the expanded state
+ */
+public bool getExpanded () {
+    //checkWidget();
+    return expanded;
+}
+
+/**
+ * Returns the font that the receiver will use to paint textual information for this item.
+ *
+ * @return the receiver's font
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public Font getFont () {
+    checkWidget ();
+    return (font is null) ? parent.getFont() : font;
+}
+/**
+ * Returns the foreground color that the receiver will use to draw.
+ *
+ * @return the receiver's foreground color
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ *
+ */
+public Color getForeground () {
+    checkWidget ();
+    return (foreground is null) ? parent.getForeground() : foreground;
+}
+/**
+ * Gets the first image.
+ * <p>
+ * The image in column 0 is reserved for the [+] and [-]
+ * images of the tree, therefore getImage(0) will return null.
+ *
+ * @return the image at index 0
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public override Image getImage () {
+    checkWidget();
+    return getImage(0);
+}
+
+/**
+ * Gets the image at the specified index.
+ * <p>
+ * Indexing is zero based. The image can be null.
+ * The image in column 0 is reserved for the [+] and [-]
+ * images of the tree, therefore getImage(0) will return null.
+ * Return null if the index is out of range.
+ *
+ * @param index the index of the image
+ * @return the image at the specified index or null
+ */
+public Image getImage (int index) {
+    //checkWidget();
+    if (0 < index && index < images.length) return images[index];
+    return null;
+}
+
+int getIndent() {
+    if (parentItem is null) return 0;
+    return parentItem.getIndent() + 1;
+}
+
+/**
+ * Returns the item at the given, zero-relative index in the
+ * receiver. Throws an exception if the index is out of range.
+ *
+ * @param index the index of the item to return
+ * @return the item at the given index
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public TableTreeItem getItem (int index) {
+    checkWidget();
+    int count = items.length;
+    if (!(0 <= index && index < count)) SWT.error (SWT.ERROR_INVALID_RANGE);
+    return items [index];
+}
+
+/**
+ * Returns the number of items contained in the receiver
+ * that are direct item children of the receiver.
+ *
+ * @return the number of items
+ */
+public int getItemCount () {
+    //checkWidget();
+    return items.length;
+}
+
+/**
+ * Returns an array of <code>TableTreeItem</code>s which are the
+ * direct item children of the receiver.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the receiver's items
+ */
+public TableTreeItem[] getItems () {
+    //checkWidget();
+    TableTreeItem[] newItems = new TableTreeItem[items.length];
+    System.arraycopy(items, 0, newItems, 0, items.length);
+    return newItems;
+}
+
+TableTreeItem getItem(TableItem tableItem) {
+    if (tableItem is null) return null;
+    if (this.tableItem is tableItem) return this;
+    for (int i = 0; i < items.length; i++) {
+        TableTreeItem item =  items[i].getItem(tableItem);
+            if (item !is null) return item;
+    }
+    return null;
+}
+
+/**
+ * Returns the receiver's parent, which must be a <code>TableTree</code>.
+ *
+ * @return the receiver's parent
+ */
+public TableTree getParent () {
+    //checkWidget();
+    return parent;
+}
+
+/**
+ * Returns the receiver's parent item, which must be a
+ * <code>TableTreeItem</code> or null when the receiver is a
+ * root.
+ *
+ * @return the receiver's parent item
+ */
+public TableTreeItem getParentItem () {
+    //checkWidget();
+    return parentItem;
+}
+public override String getText () {
+    checkWidget();
+    return getText(0);
+}
+
+/**
+ * Gets the item text at the specified index.
+ * <p>
+ * Indexing is zero based.
+ *
+ * This operation will fail when the index is out
+ * of range or an item could not be queried from
+ * the OS.
+ *
+ * @param index the index of the item
+ * @return the item text at the specified index, which can be null
+ */
+public String getText(int index) {
+    //checkWidget();
+    if (0 <= index && index < texts.length) return texts[index];
+    return null;
+}
+
+bool getVisible () {
+    return tableItem !is null;
+}
+
+/**
+ * Gets the index of the specified item.
+ *
+ * <p>The widget is searched starting at 0 until an
+ * item is found that is equal to the search item.
+ * If no item is found, -1 is returned.  Indexing
+ * is zero based.  This index is relative to the parent only.
+ *
+ * @param item the search item
+ * @return the index of the item or -1 if the item is not found
+ *
+ */
+public int indexOf (TableTreeItem item) {
+    //checkWidget();
+    for (int i = 0; i < items.length; i++) {
+        if (items[i] is item) return i;
+    }
+    return -1;
+}
+
+void expandAll(bool notify) {
+    if (items.length is 0) return;
+    if (!expanded) {
+        setExpanded(true);
+        if (notify) {
+            Event event = new Event();
+            event.item = this;
+            parent.notifyListeners(SWT.Expand, event);
+        }
+    }
+    for (int i = 0; i < items.length; i++) {
+        items[i].expandAll(notify);
+    }
+}
+int expandedIndexOf (TableTreeItem item) {
+    int index = 0;
+    for (int i = 0; i < items.length; i++) {
+        if (items[i] is item) return index;
+        if (items[i].expanded) index += items[i].visibleChildrenCount ();
+        index++;
+    }
+    return -1;
+}
+
+int visibleChildrenCount () {
+    int count = 0;
+    for (int i = 0; i < items.length; i++) {
+        if (items[i].getVisible ()) {
+            count += 1 + items[i].visibleChildrenCount ();
+        }
+    }
+    return count;
+}
+
+public override void dispose () {
+    if (isDisposed()) return;
+    for (int i = items.length - 1; i >= 0; i--) {
+        items[i].dispose();
+    }
+    super.dispose();
+    if (!parent.inDispose) {
+        if (parentItem !is null) {
+            parentItem.removeItem(this);
+        } else {
+            parent.removeItem(this);
+        }
+        if (tableItem !is null) tableItem.dispose();
+    }
+    items = null;
+    parentItem = null;
+    parent = null;
+    images = null;
+    texts = null;
+    tableItem = null;
+    foreground = null;
+    background = null;
+    font = null;
+}
+
+void removeItem(TableTreeItem item) {
+    int index = 0;
+    while (index < items.length && items[index] !is item) index++;
+    if (index is items.length) return;
+    TableTreeItem[] newItems = new TableTreeItem[items.length - 1];
+    System.arraycopy(items, 0, newItems, 0, index);
+    System.arraycopy(items, index + 1, newItems, index, items.length - index - 1);
+    items = newItems;
+    if (items.length is 0) {
+        if (tableItem !is null) tableItem.setImage(0, null);
+    }
+}
+
+/**
+ * Sets the receiver's background color to the color specified
+ * by the argument, or to the default system color for the item
+ * if the argument is null.
+ *
+ * @param color the new color (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ *
+ */
+public void setBackground (Color color) {
+    checkWidget ();
+    if (color !is null && color.isDisposed ()) {
+        SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (tableItem !is null) {
+        tableItem.setBackground(color);
+    }
+    background = color;
+}
+
+/**
+ * Sets the checked state of the checkbox for this item.  This state change
+ * only applies if the Table was created with the SWT.CHECK style.
+ *
+ * @param checked the new checked state of the checkbox
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setChecked (bool checked) {
+    checkWidget();
+    Table table = parent.getTable();
+    if ((table.getStyle() & SWT.CHECK) is 0) return;
+    if (tableItem !is null) {
+        tableItem.setChecked(checked);
+    }
+    this.checked = checked;
+}
+
+/**
+ * Sets the grayed state of the checkbox for this item.  This state change
+ * only applies if the Table was created with the SWT.CHECK style.
+ *
+ * @param grayed the new grayed state of the checkbox;
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.1
+ */
+public void setGrayed (bool grayed) {
+    checkWidget();
+    Table table = parent.getTable();
+    if ((table.getStyle() & SWT.CHECK) is 0) return;
+    if (tableItem !is null) {
+        tableItem.setGrayed(grayed);
+    }
+    this.grayed = grayed;
+}
+
+/**
+ * Sets the expanded state.
+ * <p>
+ * @param expanded the new expanded state.
+ *
+ * @exception SWTException <ul>
+ *      <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *      <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ *  </ul>
+ */
+public void setExpanded (bool expanded) {
+    checkWidget();
+    if (items.length is 0) return;
+    if (this.expanded is expanded) return;
+    this.expanded = expanded;
+    if (tableItem is null) return;
+    parent.setRedraw(false);
+    for (int i = 0; i < items.length; i++) {
+        items[i].setVisible(expanded);
+    }
+    Image image = expanded ? parent.getMinusImage() : parent.getPlusImage();
+    tableItem.setImage(0, image);
+    parent.setRedraw(true);
+}
+
+/**
+ * Sets the font that the receiver will use to paint textual information
+ * for this item to the font specified by the argument, or to the default font
+ * for that kind of control if the argument is null.
+ *
+ * @param font the new font (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setFont (Font font){
+    checkWidget ();
+    if (font !is null && font.isDisposed ()) {
+        SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (tableItem !is null) {
+        tableItem.setFont(font);
+    }
+    this.font = font;
+}
+/**
+ * Sets the receiver's foreground color to the color specified
+ * by the argument, or to the default system color for the item
+ * if the argument is null.
+ *
+ * @param color the new color (or null)
+ *
+ * @since 2.0
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ *
+ */
+public void setForeground (Color color) {
+    checkWidget ();
+    if (color !is null && color.isDisposed ()) {
+        SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (tableItem !is null) {
+        tableItem.setForeground(color);
+    }
+    foreground = color;
+}
+
+/**
+ * Sets the image at an index.
+ * <p>
+ * The image can be null.
+ * The image in column 0 is reserved for the [+] and [-]
+ * images of the tree, therefore do nothing if index is 0.
+ *
+ * @param image the new image or null
+ *
+ * @exception SWTException <ul>
+ *      <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *      <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ *  </ul>
+ */
+public void setImage (int index, Image image) {
+    checkWidget();
+    int columnCount = Math.max(parent.getTable().getColumnCount(), 1);
+    if (index <= 0 || index >= columnCount) return;
+    if (images.length < columnCount) {
+        Image[] newImages = new Image[columnCount];
+        System.arraycopy(images, 0, newImages, 0, images.length);
+        images = newImages;
+    }
+    images[index] = image;
+    if (tableItem !is null) tableItem.setImage(index, image);
+}
+
+/**
+ * Sets the first image.
+ * <p>
+ * The image can be null.
+ * The image in column 0 is reserved for the [+] and [-]
+ * images of the tree, therefore do nothing.
+ *
+ * @param image the new image or null
+ *
+ * @exception SWTException <ul>
+ *      <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *      <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ *  </ul>
+ */
+public override void setImage (Image image) {
+    setImage(0, image);
+}
+
+/**
+ * Sets the widget text.
+ * <p>
+ *
+ * The widget text for an item is the label of the
+ * item or the label of the text specified by a column
+ * number.
+ *
+ * @param index the column number
+ * @param text the new text
+ *
+ * @exception SWTException <ul>
+ *      <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
+ *      <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
+ *  </ul>
+ */
+public void setText(int index, String text) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (text is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    int columnCount = Math.max(parent.getTable().getColumnCount(), 1);
+    if (index < 0 || index >= columnCount) return;
+    if (texts.length < columnCount) {
+        String[] newTexts = new String[columnCount];
+        System.arraycopy(texts, 0, newTexts, 0, texts.length);
+        texts = newTexts;
+    }
+    texts[index] = text;
+    if (tableItem !is null) tableItem.setText(index, text);
+}
+public override void setText (String string) {
+    setText(0, string);
+}
+
+void setVisible (bool show) {
+    if (parentItem is null) return; // this is a root and can not be toggled between visible and hidden
+    if (getVisible() is show) return;
+
+    if (show) {
+        if (!parentItem.getVisible()) return; // parentItem must already be visible
+        // create underlying table item and set data in table item to stored data
+        Table table = parent.getTable();
+        int parentIndex = table.indexOf(parentItem.tableItem);
+        int index = parentItem.expandedIndexOf(this) + parentIndex + 1;
+        if (index < 0) return;
+        tableItem = new TableItem(table, getStyle(), index);
+        tableItem.setData(TableTree.ITEMID, this);
+        tableItem.setImageIndent(getIndent());
+        if (background !is null) tableItem.setBackground(background);
+        if (foreground !is null) tableItem.setForeground(foreground);
+        if (font !is null) tableItem.setFont(font);
+        addCheck();
+
+        // restore fields to item
+        // ignore any images in the first column
+        int columnCount = Math.max(table.getColumnCount(), 1);
+        for (int i = 0; i < columnCount; i++) {
+            if (i < texts.length && texts[i] !is null) setText(i, texts[i]);
+            if (i < images.length && images[i] !is null) setImage(i, images[i]);
+        }
+
+        // display the children and the appropriate [+]/[-] symbol as required
+        if (items.length !is 0) {
+            if (expanded) {
+                tableItem.setImage(0, parent.getMinusImage());
+                for (int i = 0, length = items.length; i < length; i++) {
+                    items[i].setVisible(true);
+                }
+            } else {
+                tableItem.setImage(0, parent.getPlusImage());
+            }
+        }
+
+    } else {
+
+        for (int i = 0, length = items.length; i < length; i++) {
+            items[i].setVisible(false);
+        }
+        // remove row from table
+        tableItem.dispose();
+        tableItem = null;
+    }
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/TextChangeListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.TextChangeListener;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.internal.SWTEventListener;
+import org.eclipse.swt.custom.TextChangingEvent;
+import org.eclipse.swt.custom.TextChangedEvent;
+
+/**
+ * The StyledText widget implements this listener to receive
+ * notifications when changes to the model occur.
+ * It is not intended to be implemented by clients or by
+ * implementors of StyledTextContent.
+ * Clients should listen to the ModifyEvent or ExtendedModifyEvent
+ * that is sent by the StyledText widget to receive text change
+ * notifications.
+ * Implementors of StyledTextContent should call the textChanging
+ * and textChanged methods when text changes occur as described
+ * below. If the entire text is replaced the textSet method
+ * should be called instead.
+ */
+public interface TextChangeListener : SWTEventListener {
+
+/**
+ * This method is called when the content is about to be changed.
+ * Callers also need to call the textChanged method after the
+ * content change has been applied. The widget only updates the
+ * screen properly when it receives both events.
+ *
+ * @param event the text changing event. All event fields need
+ *  to be set by the sender.
+ * @see TextChangingEvent
+ */
+public void textChanging(TextChangingEvent event);
+/**
+ * This method is called when the content has changed.
+ * Callers need to have called the textChanging method prior to
+ * applying the content change and calling this method. The widget
+ * only updates the screen properly when it receives both events.
+ *
+ * @param event the text changed event
+ */
+public void textChanged(TextChangedEvent event);
+/**
+ * This method is called instead of the textChanging/textChanged
+ * combination when the entire old content has been replaced
+ * (e.g., by a call to StyledTextContent.setText()).
+ *
+ * @param event the text changed event
+ */
+public void textSet(TextChangedEvent event);
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/TextChangedEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.TextChangedEvent;
+
+import java.lang.all;
+
+import org.eclipse.swt.events.TypedEvent;
+import org.eclipse.swt.custom.StyledTextContent;
+/**
+ * This event is sent by the StyledTextContent implementor when a change to
+ * the text occurs.
+ *
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class TextChangedEvent : TypedEvent {
+
+/**
+ * Create the TextChangedEvent to be used by the StyledTextContent implementor.
+ * <p>
+ *
+ * @param source the object that will be sending the TextChangedEvent,
+ *  cannot be null
+ */
+public this(StyledTextContent source) {
+    super(cast(Object)source);
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/TextChangingEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.TextChangingEvent;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.events.TypedEvent;
+import org.eclipse.swt.custom.StyledTextContent;
+import org.eclipse.swt.custom.StyledTextEvent;
+
+/**
+ * This event is sent by the StyledTextContent implementor when a change
+ * to the text is about to occur.
+ *
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class TextChangingEvent : TypedEvent {
+    /**
+     * Start offset of the text that is going to be replaced
+     */
+    public int start;
+    /**
+     * Text that is going to be inserted or empty string
+     * if no text will be inserted
+     */
+    public String newText;
+    /**
+     * Length of text that is going to be replaced
+     */
+    public int replaceCharCount;
+    /**
+     * Length of text that is going to be inserted
+     */
+    public int newCharCount;
+    /**
+     * Number of lines that are going to be replaced
+     */
+    public int replaceLineCount;
+    /**
+     * Number of new lines that are going to be inserted
+     */
+    public int newLineCount;
+
+    static final long serialVersionUID = 3257290210114352439L;
+
+/**
+ * Create the TextChangedEvent to be used by the StyledTextContent implementor.
+ * <p>
+ *
+ * @param source the object that will be sending the new TextChangingEvent,
+ *  cannot be null
+ */
+public this(StyledTextContent source) {
+    super( cast(Object)source);
+}
+this(StyledTextContent source, StyledTextEvent e) {
+    super( cast(Object)source);
+    start = e.start;
+    replaceCharCount = e.replaceCharCount;
+    newCharCount = e.newCharCount;
+    replaceLineCount = e.replaceLineCount;
+    newLineCount = e.newLineCount;
+    newText = e.text;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/TreeEditor.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,336 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.TreeEditor;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.TreeEvent;
+import org.eclipse.swt.events.TreeListener;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.swt.custom.ControlEditor;
+
+/**
+*
+* A TreeEditor is a manager for a Control that appears above a cell in a Tree and tracks with the
+* moving and resizing of that cell.  It can be used to display a text widget above a cell
+* in a Tree so that the user can edit the contents of that cell.  It can also be used to display
+* a button that can launch a dialog for modifying the contents of the associated cell.
+*
+* <p> Here is an example of using a TreeEditor:
+* <code><pre>
+*   final Tree tree = new Tree(shell, SWT.BORDER);
+*   for (int i = 0; i &lt; 3; i++) {
+*       TreeItem item = new TreeItem(tree, SWT.NONE);
+*       item.setText("item " + i);
+*       for (int j = 0; j &lt; 3; j++) {
+*           TreeItem subItem = new TreeItem(item, SWT.NONE);
+*           subItem.setText("item " + i + " " + j);
+*       }
+*   }
+*
+*   final TreeEditor editor = new TreeEditor(tree);
+*   //The editor must have the same size as the cell and must
+*   //not be any smaller than 50 pixels.
+*   editor.horizontalAlignment = SWT.LEFT;
+*   editor.grabHorizontal = true;
+*   editor.minimumWidth = 50;
+*
+*   tree.addSelectionListener(new SelectionAdapter() {
+*       public void widgetSelected(SelectionEvent e) {
+*           // Clean up any previous editor control
+*           Control oldEditor = editor.getEditor();
+*           if (oldEditor !is null) oldEditor.dispose();
+*
+*           // Identify the selected row
+*           TreeItem item = (TreeItem)e.item;
+*           if (item is null) return;
+*
+*           // The control that will be the editor must be a child of the Tree
+*           Text newEditor = new Text(tree, SWT.NONE);
+*           newEditor.setText(item.getText());
+*           newEditor.addModifyListener(new ModifyListener() {
+*               public void modifyText(ModifyEvent e) {
+*                   Text text = (Text)editor.getEditor();
+*                   editor.getItem().setText(text.getText());
+*               }
+*           });
+*           newEditor.selectAll();
+*           newEditor.setFocus();
+*           editor.setEditor(newEditor, item);
+*       }
+*   });
+* </pre></code>
+*
+* @see <a href="http://www.eclipse.org/swt/snippets/#treeeditor">TreeEditor snippets</a>
+* @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+*/
+
+public class TreeEditor : ControlEditor {
+    Tree tree;
+    TreeItem item;
+    int column = 0;
+    ControlListener columnListener;
+    TreeListener treeListener;
+    Runnable timer;
+    static const int TIMEOUT = 1500;
+
+/**
+* Creates a TreeEditor for the specified Tree.
+*
+* @param tree the Tree Control above which this editor will be displayed
+*
+*/
+public this (Tree tree) {
+    super(tree);
+    this.tree = tree;
+
+    columnListener = new class() ControlListener {
+        public void controlMoved(ControlEvent e){
+            layout();
+        }
+        public void controlResized(ControlEvent e){
+            layout();
+        }
+    };
+    timer = new class() Runnable {
+        public void run() {
+            layout ();
+        }
+    };
+    treeListener = new class() TreeListener {
+        Runnable runnable;
+        this(){
+            runnable = new class() Runnable {
+                public void run() {
+                    if (this.outer.outer.editor is null || this.outer.outer.editor.isDisposed()) return;
+                    if (this.outer.outer.tree.isDisposed()) return;
+                    layout();
+                    this.outer.outer.editor.setVisible(true);
+                }
+            };
+        }
+        public void treeCollapsed(TreeEvent e) {
+            if (this.outer.editor is null || this.outer.editor.isDisposed ()) return;
+            this.outer.editor.setVisible(false);
+            e.display.asyncExec(runnable);
+        }
+        public void treeExpanded(TreeEvent e) {
+            if (this.outer.editor is null || this.outer.editor.isDisposed ()) return;
+            this.outer.editor.setVisible(false);
+            e.display.asyncExec(runnable);
+        }
+    };
+    tree.addTreeListener(treeListener);
+
+    // To be consistent with older versions of SWT, grabVertical defaults to true
+    grabVertical = true;
+}
+
+override Rectangle computeBounds () {
+    if (item is null || column is -1 || item.isDisposed()) return new Rectangle(0, 0, 0, 0);
+    Rectangle cell = item.getBounds(column);
+    Rectangle rect = item.getImageBounds(column);
+    cell.x = rect.x + rect.width;
+    cell.width -= rect.width;
+    Rectangle area = tree.getClientArea();
+    if (cell.x < area.x + area.width) {
+        if (cell.x + cell.width > area.x + area.width) {
+            cell.width = area.x + area.width - cell.x;
+        }
+    }
+    Rectangle editorRect = new Rectangle(cell.x, cell.y, minimumWidth, minimumHeight);
+
+    if (grabHorizontal) {
+        if (tree.getColumnCount() is 0) {
+            // Bounds of tree item only include the text area - stretch out to include
+            // entire client area
+            cell.width = area.x + area.width - cell.x;
+        }
+        editorRect.width = Math.max(cell.width, minimumWidth);
+    }
+
+    if (grabVertical) {
+        editorRect.height = Math.max(cell.height, minimumHeight);
+    }
+
+    if (horizontalAlignment is SWT.RIGHT) {
+        editorRect.x += cell.width - editorRect.width;
+    } else if (horizontalAlignment is SWT.LEFT) {
+        // do nothing - cell.x is the right answer
+    } else { // default is CENTER
+        editorRect.x += (cell.width - editorRect.width)/2;
+    }
+    // don't let the editor overlap with the + / - of the tree
+    editorRect.x = Math.max(cell.x, editorRect.x);
+
+    if (verticalAlignment is SWT.BOTTOM) {
+        editorRect.y += cell.height - editorRect.height;
+    } else if (verticalAlignment is SWT.TOP) {
+        // do nothing - cell.y is the right answer
+    } else { // default is CENTER
+        editorRect.y += (cell.height - editorRect.height)/2;
+    }
+    return editorRect;
+}
+
+/**
+ * Removes all associations between the TreeEditor and the row in the tree.  The
+ * tree and the editor Control are <b>not</b> disposed.
+ */
+public override void dispose () {
+    if (tree !is null && !tree.isDisposed()) {
+        if (this.column > -1 && this.column < tree.getColumnCount()){
+            TreeColumn treeColumn = tree.getColumn(this.column);
+            treeColumn.removeControlListener(columnListener);
+        }
+        if (treeListener !is null) tree.removeTreeListener(treeListener);
+    }
+    columnListener = null;
+    treeListener = null;
+    tree = null;
+    item = null;
+    column = 0;
+    timer = null;
+    super.dispose();
+}
+
+/**
+* Returns the zero based index of the column of the cell being tracked by this editor.
+*
+* @return the zero based index of the column of the cell being tracked by this editor
+*
+* @since 3.1
+*/
+public int getColumn () {
+    return column;
+}
+
+/**
+* Returns the TreeItem for the row of the cell being tracked by this editor.
+*
+* @return the TreeItem for the row of the cell being tracked by this editor
+*/
+public TreeItem getItem () {
+    return item;
+}
+
+void resize () {
+    layout();
+    /*
+     * On some platforms, the table scrolls when an item that
+     * is partially visible at the bottom of the table is
+     * selected.  Ensure that the correct row is edited by
+     * laying out one more time in a timerExec().
+     */
+    if (tree !is null) {
+        Display display = tree.getDisplay();
+        display.timerExec(-1, timer);
+        display.timerExec(TIMEOUT, timer);
+    }
+}
+
+/**
+* Sets the zero based index of the column of the cell being tracked by this editor.
+*
+* @param column the zero based index of the column of the cell being tracked by this editor
+*
+* @since 3.1
+*/
+public void setColumn(int column) {
+    int columnCount = tree.getColumnCount();
+    // Separately handle the case where the tree has no TreeColumns.
+    // In this situation, there is a single default column.
+    if (columnCount is 0) {
+        this.column = (column is 0) ? 0 : -1;
+        resize();
+        return;
+    }
+    if (this.column > -1 && this.column < columnCount){
+        TreeColumn treeColumn = tree.getColumn(this.column);
+        treeColumn.removeControlListener(columnListener);
+        this.column = -1;
+    }
+
+    if (column < 0  || column >= tree.getColumnCount()) return;
+
+    this.column = column;
+    TreeColumn treeColumn = tree.getColumn(this.column);
+    treeColumn.addControlListener(columnListener);
+    resize();
+}
+
+/**
+* Specifies the <code>TreeItem</code> that is to be edited.
+*
+* @param item the item to be edited
+*/
+public void setItem (TreeItem item) {
+    this.item = item;
+    resize();
+}
+
+/**
+* Specify the Control that is to be displayed and the cell in the tree that it is to be positioned above.
+*
+* <p>Note: The Control provided as the editor <b>must</b> be created with its parent being the Tree control
+* specified in the TreeEditor constructor.
+*
+* @param editor the Control that is displayed above the cell being edited
+* @param item the TreeItem for the row of the cell being tracked by this editor
+* @param column the zero based index of the column of the cell being tracked by this editor
+*
+* @since 3.1
+*/
+public void setEditor (Control editor, TreeItem item, int column) {
+    setItem(item);
+    setColumn(column);
+    setEditor(editor);
+}
+public override void setEditor (Control editor) {
+    super.setEditor(editor);
+    resize();
+}
+
+/**
+* Specify the Control that is to be displayed and the cell in the tree that it is to be positioned above.
+*
+* <p>Note: The Control provided as the editor <b>must</b> be created with its parent being the Tree control
+* specified in the TreeEditor constructor.
+*
+* @param editor the Control that is displayed above the cell being edited
+* @param item the TreeItem for the row of the cell being tracked by this editor
+*/
+public void setEditor (Control editor, TreeItem item) {
+    setItem(item);
+    setEditor(editor);
+}
+
+public override void layout () {
+    if (tree is null || tree.isDisposed()) return;
+    if (item is null || item.isDisposed()) return;
+    int columnCount = tree.getColumnCount();
+    if (columnCount is 0 && column !is 0) return;
+    if (columnCount > 0 && (column < 0 || column >= columnCount)) return;
+    super.layout();
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/VerifyKeyListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.VerifyKeyListener;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.events.VerifyEvent;
+import org.eclipse.swt.internal.SWTEventListener;
+
+/**
+ * Classes which implement this interface provide a method
+ * that deals with the event that is generated when a
+ * key is pressed.
+ *
+ * @see VerifyEvent
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public interface VerifyKeyListener : SWTEventListener {
+/**
+ * The following event fields are used:<ul>
+ * <li>event.character is the character that was typed (input)</li>
+ * <li>event.keyCode is the key code that was typed (input)</li>
+ * <li>event.stateMask is the state of the keyboard (input)</li>
+ * <li>event.doit is processed or not (output)</li>
+ * </ul>
+ * @param event the verify event
+ * @see VerifyEvent
+ */
+public void verifyKey (VerifyEvent event);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/ViewForm.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,493 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.ViewForm;
+
+import java.lang.all;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Layout;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.custom.ViewFormLayout;
+
+/**
+ * Instances of this class implement a Composite that positions and sizes
+ * children and allows programmatic control of layout and border parameters.
+ * ViewForm is used in the workbench to lay out a view's label/menu/toolbar
+ * local bar.
+ * <p>
+ * Note that although this class is a subclass of <code>Composite</code>,
+ * it does not make sense to set a layout on it.
+ * </p><p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>BORDER, FLAT</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(None)</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public class ViewForm : Composite {
+
+    /**
+     * marginWidth specifies the number of pixels of horizontal margin
+     * that will be placed along the left and right edges of the form.
+     *
+     * The default value is 0.
+     */
+    public int marginWidth = 0;
+    /**
+     * marginHeight specifies the number of pixels of vertical margin
+     * that will be placed along the top and bottom edges of the form.
+     *
+     * The default value is 0.
+     */
+    public int marginHeight = 0;
+    /**
+     * horizontalSpacing specifies the number of pixels between the right
+     * edge of one cell and the left edge of its neighbouring cell to
+     * the right.
+     *
+     * The default value is 1.
+     */
+    public int horizontalSpacing = 1;
+    /**
+     * verticalSpacing specifies the number of pixels between the bottom
+     * edge of one cell and the top edge of its neighbouring cell underneath.
+     *
+     * The default value is 1.
+     */
+    public int verticalSpacing = 1;
+
+    /**
+     * Color of innermost line of drop shadow border.
+     *
+     * NOTE This field is badly named and can not be fixed for backwards compatibility.
+     * It should be capitalized.
+     *
+     * @deprecated
+     */
+    public static RGB borderInsideRGB;
+    /**
+     * Color of middle line of drop shadow border.
+     *
+     * NOTE This field is badly named and can not be fixed for backwards compatibility.
+     * It should be capitalized.
+     *
+     * @deprecated
+     */
+    public static RGB borderMiddleRGB;
+    /**
+     * Color of outermost line of drop shadow border.
+     *
+     * NOTE This field is badly named and can not be fixed for backwards compatibility.
+     * It should be capitalized.
+     *
+     * @deprecated
+     */
+    public static RGB borderOutsideRGB;
+
+    // SWT widgets
+    Control topLeft;
+    Control topCenter;
+    Control topRight;
+    Control content;
+
+    // Configuration and state info
+    bool separateTopCenter = false;
+    bool showBorder = false;
+
+    int separator = -1;
+    int borderTop = 0;
+    int borderBottom = 0;
+    int borderLeft = 0;
+    int borderRight = 0;
+    int highlight = 0;
+    Point oldSize;
+
+    Color selectionBackground;
+
+    static final int OFFSCREEN = -200;
+    static final int BORDER1_COLOR = SWT.COLOR_WIDGET_NORMAL_SHADOW;
+    static final int SELECTION_BACKGROUND = SWT.COLOR_LIST_BACKGROUND;
+
+
+    static this(){
+        borderInsideRGB  = new RGB (132, 130, 132);
+        borderMiddleRGB  = new RGB (143, 141, 138);
+        borderOutsideRGB = new RGB (171, 168, 165);
+    }
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a widget which will be the parent of the new instance (cannot be null)
+ * @param style the style of widget to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ *
+ * @see SWT#BORDER
+ * @see SWT#FLAT
+ * @see #getStyle()
+ */
+public this(Composite parent, int style) {
+    super(parent, checkStyle(style));
+    super.setLayout(new ViewFormLayout());
+
+    setBorderVisible((style & SWT.BORDER) !is 0);
+
+    Listener listener = new class() Listener {
+        public void handleEvent(Event e) {
+            switch (e.type) {
+                case SWT.Dispose: onDispose(); break;
+                case SWT.Paint: onPaint(e.gc); break;
+                case SWT.Resize: onResize(); break;
+                default:
+            }
+        }
+    };
+
+    int[] events = [SWT.Dispose, SWT.Paint, SWT.Resize];
+
+    for (int i = 0; i < events.length; i++) {
+        addListener(events[i], listener);
+    }
+}
+
+static int checkStyle (int style) {
+    int mask = SWT.FLAT | SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
+    return style & mask | SWT.NO_REDRAW_RESIZE;
+}
+
+//protected void checkSubclass () {
+//  String name = getClass().getName ();
+//  String validName = ViewForm.class.getName();
+//  if (!validName.equals(name)) {
+//      SWT.error (SWT.ERROR_INVALID_SUBCLASS);
+//  }
+//}
+
+public override Rectangle computeTrim (int x, int y, int width, int height) {
+    checkWidget ();
+    int trimX = x - borderLeft - highlight;
+    int trimY = y - borderTop - highlight;
+    int trimWidth = width + borderLeft + borderRight + 2*highlight;
+    int trimHeight = height + borderTop + borderBottom + 2*highlight;
+    return new Rectangle(trimX, trimY, trimWidth, trimHeight);
+}
+public override Rectangle getClientArea() {
+    checkWidget();
+    Rectangle clientArea = super.getClientArea();
+    clientArea.x += borderLeft;
+    clientArea.y += borderTop;
+    clientArea.width -= borderLeft + borderRight;
+    clientArea.height -= borderTop + borderBottom;
+    return clientArea;
+}
+/**
+* Returns the content area.
+*
+* @return the control in the content area of the pane or null
+*/
+public Control getContent() {
+    //checkWidget();
+    return content;
+}
+/**
+* Returns Control that appears in the top center of the pane.
+* Typically this is a toolbar.
+*
+* @return the control in the top center of the pane or null
+*/
+public Control getTopCenter() {
+    //checkWidget();
+    return topCenter;
+}
+/**
+* Returns the Control that appears in the top left corner of the pane.
+* Typically this is a label such as CLabel.
+*
+* @return the control in the top left corner of the pane or null
+*/
+public Control getTopLeft() {
+    //checkWidget();
+    return topLeft;
+}
+/**
+* Returns the control in the top right corner of the pane.
+* Typically this is a Close button or a composite with a Menu and Close button.
+*
+* @return the control in the top right corner of the pane or null
+*/
+public Control getTopRight() {
+    //checkWidget();
+    return topRight;
+}
+void onDispose() {
+    topLeft = null;
+    topCenter = null;
+    topRight = null;
+    content = null;
+    oldSize = null;
+    selectionBackground = null;
+}
+void onPaint(GC gc) {
+    Color gcForeground = gc.getForeground();
+    Point size = getSize();
+    Color border = getDisplay().getSystemColor(BORDER1_COLOR);
+    if (showBorder) {
+        gc.setForeground(border);
+        gc.drawRectangle(0, 0, size.x - 1, size.y - 1);
+        if (highlight > 0) {
+            int x1 = 1;
+            int y1 = 1;
+            int x2 = size.x - 1;
+            int y2 = size.y - 1;
+            int[] shape = [x1,y1, x2,y1, x2,y2, x1,y2, x1,y1+highlight,
+                               x1+highlight,y1+highlight, x1+highlight,y2-highlight,
+                               x2-highlight,y2-highlight, x2-highlight,y1+highlight, x1,y1+highlight];
+            Color highlightColor = getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION);
+            gc.setBackground(highlightColor);
+            gc.fillPolygon(shape);
+        }
+    }
+    if (separator > -1) {
+        gc.setForeground(border);
+        gc.drawLine(borderLeft + highlight, separator, size.x - borderLeft - borderRight - highlight, separator);
+    }
+    gc.setForeground(gcForeground);
+}
+void onResize() {
+    Point size = getSize();
+    if (oldSize is null || oldSize.x is 0 || oldSize.y is 0) {
+        redraw();
+    } else {
+        int width = 0;
+        if (oldSize.x < size.x) {
+            width = size.x - oldSize.x + borderRight + highlight;
+        } else if (oldSize.x > size.x) {
+            width = borderRight + highlight;
+        }
+        redraw(size.x - width, 0, width, size.y, false);
+
+        int height = 0;
+        if (oldSize.y < size.y) {
+            height = size.y - oldSize.y + borderBottom + highlight;
+        }
+        if (oldSize.y > size.y) {
+            height = borderBottom + highlight;
+        }
+        redraw(0, size.y - height, size.x, height, false);
+    }
+    oldSize = size;
+}
+/**
+* Sets the content.
+* Setting the content to null will remove it from
+* the pane - however, the creator of the content must dispose of the content.
+*
+* @param content the control to be displayed in the content area or null
+*
+* @exception SWTException <ul>
+*    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+*    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+*    <li>ERROR_INVALID_ARGUMENT - if the control is not a child of this ViewForm</li>
+* </ul>
+*/
+public void setContent(Control content) {
+    checkWidget();
+    if (content !is null && content.getParent() !is this) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (this.content !is null && !this.content.isDisposed()) {
+        this.content.setBounds(OFFSCREEN, OFFSCREEN, 0, 0);
+    }
+    this.content = content;
+    layout(false);
+}
+/**
+ * Sets the layout which is associated with the receiver to be
+ * the argument which may be null.
+ * <p>
+ * Note: No Layout can be set on this Control because it already
+ * manages the size and position of its children.
+ * </p>
+ *
+ * @param layout the receiver's new layout or null
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public override void setLayout (Layout layout) {
+    checkWidget();
+    return;
+}
+void setSelectionBackground (Color color) {
+    checkWidget();
+    if (selectionBackground is color) return;
+    if (color is null) color = getDisplay().getSystemColor(SELECTION_BACKGROUND);
+    selectionBackground = color;
+    redraw();
+}
+/**
+* Set the control that appears in the top center of the pane.
+* Typically this is a toolbar.
+* The topCenter is optional.  Setting the topCenter to null will remove it from
+* the pane - however, the creator of the topCenter must dispose of the topCenter.
+*
+* @param topCenter the control to be displayed in the top center or null
+*
+* @exception SWTException <ul>
+*    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+*    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+*    <li>ERROR_INVALID_ARGUMENT - if the control is not a child of this ViewForm</li>
+* </ul>
+*/
+public void setTopCenter(Control topCenter) {
+    checkWidget();
+    if (topCenter !is null && topCenter.getParent() !is this) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (this.topCenter !is null && !this.topCenter.isDisposed()) {
+        Point size = this.topCenter.getSize();
+        this.topCenter.setLocation(OFFSCREEN - size.x, OFFSCREEN - size.y);
+    }
+    this.topCenter = topCenter;
+    layout(false);
+}
+/**
+* Set the control that appears in the top left corner of the pane.
+* Typically this is a label such as CLabel.
+* The topLeft is optional.  Setting the top left control to null will remove it from
+* the pane - however, the creator of the control must dispose of the control.
+*
+* @param c the control to be displayed in the top left corner or null
+*
+* @exception SWTException <ul>
+*    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+*    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+*    <li>ERROR_INVALID_ARGUMENT - if the control is not a child of this ViewForm</li>
+* </ul>
+*/
+public void setTopLeft(Control c) {
+    checkWidget();
+    if (c !is null && c.getParent() !is this) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (this.topLeft !is null && !this.topLeft.isDisposed()) {
+        Point size = this.topLeft.getSize();
+        this.topLeft.setLocation(OFFSCREEN - size.x, OFFSCREEN - size.y);
+    }
+    this.topLeft = c;
+    layout(false);
+}
+/**
+* Set the control that appears in the top right corner of the pane.
+* Typically this is a Close button or a composite with a Menu and Close button.
+* The topRight is optional.  Setting the top right control to null will remove it from
+* the pane - however, the creator of the control must dispose of the control.
+*
+* @param c the control to be displayed in the top right corner or null
+*
+* @exception SWTException <ul>
+*    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+*    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+*    <li>ERROR_INVALID_ARGUMENT - if the control is not a child of this ViewForm</li>
+* </ul>
+*/
+public void setTopRight(Control c) {
+    checkWidget();
+    if (c !is null && c.getParent() !is this) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (this.topRight !is null && !this.topRight.isDisposed()) {
+        Point size = this.topRight.getSize();
+        this.topRight.setLocation(OFFSCREEN - size.x, OFFSCREEN - size.y);
+    }
+    this.topRight = c;
+    layout(false);
+}
+/**
+* Specify whether the border should be displayed or not.
+*
+* @param show true if the border should be displayed
+*
+* @exception SWTException <ul>
+*    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+*    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+* </ul>
+*/
+public void setBorderVisible(bool show) {
+    checkWidget();
+    if (showBorder is show) return;
+
+    showBorder = show;
+    if (showBorder) {
+        borderLeft = borderTop = borderRight = borderBottom = 1;
+        if ((getStyle() & SWT.FLAT)is 0) highlight = 2;
+    } else {
+        borderBottom = borderTop = borderLeft = borderRight = 0;
+        highlight = 0;
+    }
+    layout(false);
+    redraw();
+}
+/**
+* If true, the topCenter will always appear on a separate line by itself, otherwise the
+* topCenter will appear in the top row if there is room and will be moved to the second row if
+* required.
+*
+* @param show true if the topCenter will always appear on a separate line by itself
+*
+* @exception SWTException <ul>
+*    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+*    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+* </ul>
+*/
+public void setTopCenterSeparate(bool show) {
+    checkWidget();
+    separateTopCenter = show;
+    layout(false);
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/ViewFormLayout.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,212 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.custom.ViewFormLayout;
+
+import java.lang.all;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Layout;
+import org.eclipse.swt.widgets.Scrollable;
+import org.eclipse.swt.custom.ViewForm;
+import org.eclipse.swt.custom.CLayoutData;
+
+/**
+ * This class provides the layout for ViewForm
+ *
+ * @see ViewForm
+ */
+class ViewFormLayout : Layout {
+
+protected override Point computeSize(Composite composite, int wHint, int hHint, bool flushCache) {
+    ViewForm form = cast(ViewForm)composite;
+    Control left = form.topLeft;
+    Control center = form.topCenter;
+    Control right = form.topRight;
+    Control content = form.content;
+
+    Point leftSize = new Point(0, 0);
+    if (left !is null) {
+        leftSize = computeChildSize(left, SWT.DEFAULT, SWT.DEFAULT, flushCache);
+    }
+    Point centerSize = new Point(0, 0);
+    if (center !is null) {
+         centerSize = computeChildSize(center, SWT.DEFAULT, SWT.DEFAULT, flushCache);
+    }
+    Point rightSize = new Point(0, 0);
+    if (right !is null) {
+         rightSize = computeChildSize(right, SWT.DEFAULT, SWT.DEFAULT, flushCache);
+    }
+    Point size = new Point(0, 0);
+    // calculate width of title bar
+    if (form.separateTopCenter ||
+        (wHint !is SWT.DEFAULT &&  leftSize.x + centerSize.x + rightSize.x > wHint)) {
+        size.x = leftSize.x + rightSize.x;
+        if (leftSize.x > 0 && rightSize.x > 0) size.x += form.horizontalSpacing;
+        size.x = Math.max(centerSize.x, size.x);
+        size.y = Math.max(leftSize.y, rightSize.y);
+        if (center !is null){
+            size.y += centerSize.y;
+            if (left !is null ||right !is null)size.y += form.verticalSpacing;
+        }
+    } else {
+        size.x = leftSize.x + centerSize.x + rightSize.x;
+        int count = -1;
+        if (leftSize.x > 0) count++;
+        if (centerSize.x > 0) count++;
+        if (rightSize.x > 0) count++;
+        if (count > 0) size.x += count * form.horizontalSpacing;
+        size.y = Math.max(leftSize.y, Math.max(centerSize.y, rightSize.y));
+    }
+
+    if (content !is null) {
+        if (left !is null || right !is null || center !is null) size.y += 1; // allow space for a vertical separator
+        Point contentSize = new Point(0, 0);
+        contentSize = computeChildSize(content, SWT.DEFAULT, SWT.DEFAULT, flushCache);
+        size.x = Math.max (size.x, contentSize.x);
+        size.y += contentSize.y;
+        if (size.y > contentSize.y) size.y += form.verticalSpacing;
+    }
+
+    size.x += 2*form.marginWidth;
+    size.y += 2*form.marginHeight;
+
+    if (wHint !is SWT.DEFAULT) size.x  = wHint;
+    if (hHint !is SWT.DEFAULT) size.y = hHint;
+
+    return size;
+}
+
+Point computeChildSize(Control control, int wHint, int hHint, bool flushCache) {
+    Object data = control.getLayoutData();
+    if (data is null || !( null !is cast(CLayoutData)data )) {
+        data = new CLayoutData();
+        control.setLayoutData(data);
+    }
+    return (cast(CLayoutData)data).computeSize(control, wHint, hHint, flushCache);
+}
+
+int computeTrim(Control c) {
+    if ( auto sa = cast(Scrollable)c) {
+        Rectangle rect = sa.computeTrim (0, 0, 0, 0);
+        return rect.width;
+    }
+    return c.getBorderWidth () * 2;
+}
+
+protected override bool flushCache(Control control) {
+    Object data = control.getLayoutData();
+    if ( auto ld = cast(CLayoutData)data ) ld.flushCache();
+    return true;
+}
+
+protected override void layout(Composite composite, bool flushCache) {
+    ViewForm form = cast(ViewForm)composite;
+    Control left = form.topLeft;
+    Control center = form.topCenter;
+    Control right = form.topRight;
+    Control content = form.content;
+
+    Rectangle rect = composite.getClientArea();
+
+    Point leftSize = new Point(0, 0);
+    if (left !is null && !left.isDisposed()) {
+        leftSize = computeChildSize(left, SWT.DEFAULT, SWT.DEFAULT, flushCache);
+    }
+    Point centerSize = new Point(0, 0);
+    if (center !is null && !center.isDisposed()) {
+         centerSize = computeChildSize(center, SWT.DEFAULT, SWT.DEFAULT, flushCache);
+    }
+    Point rightSize = new Point(0, 0);
+    if (right !is null && !right.isDisposed()) {
+         rightSize = computeChildSize(right, SWT.DEFAULT, SWT.DEFAULT, flushCache);
+    }
+
+    int minTopWidth = leftSize.x + centerSize.x + rightSize.x + 2*form.marginWidth + 2*form.highlight;
+    int count = -1;
+    if (leftSize.x > 0) count++;
+    if (centerSize.x > 0) count++;
+    if (rightSize.x > 0) count++;
+    if (count > 0) minTopWidth += count * form.horizontalSpacing;
+
+    int x = rect.x + rect.width - form.marginWidth - form.highlight;
+    int y = rect.y + form.marginHeight + form.highlight;
+
+    bool top = false;
+    if (form.separateTopCenter || minTopWidth > rect.width) {
+        int topHeight = Math.max(rightSize.y, leftSize.y);
+        if (right !is null && !right.isDisposed()) {
+            top = true;
+            x -= rightSize.x;
+            right.setBounds(x, y, rightSize.x, topHeight);
+            x -= form.horizontalSpacing;
+        }
+        if (left !is null && !left.isDisposed()) {
+            top = true;
+            int trim = computeTrim(left);
+            int leftW = x - rect.x - form.marginWidth - form.highlight - trim;
+            leftSize = computeChildSize(left, leftW, SWT.DEFAULT, false);
+            left.setBounds(rect.x + form.marginWidth + form.highlight, y, leftSize.x, topHeight);
+        }
+        if (top) y += topHeight + form.verticalSpacing;
+        if (center !is null && !center.isDisposed()) {
+            top = true;
+            int trim = computeTrim(center);
+            int w = rect.width - 2*form.marginWidth - 2*form.highlight - trim;
+            centerSize = computeChildSize(center, w, SWT.DEFAULT, false);
+            center.setBounds(rect.x + rect.width - form.marginWidth - form.highlight - centerSize.x, y, centerSize.x, centerSize.y);
+            y += centerSize.y + form.verticalSpacing;
+        }
+    } else {
+        int topHeight = Math.max(rightSize.y, Math.max(centerSize.y, leftSize.y));
+        if (right !is null && !right.isDisposed()) {
+            top = true;
+            x -= rightSize.x;
+            right.setBounds(x, y, rightSize.x, topHeight);
+            x -= form.horizontalSpacing;
+        }
+        if (center !is null && !center.isDisposed()) {
+            top = true;
+            x -= centerSize.x;
+            center.setBounds(x, y, centerSize.x, topHeight);
+            x -= form.horizontalSpacing;
+        }
+        if (left !is null && !left.isDisposed()) {
+            top = true;
+            Rectangle trim = ( null !is cast(Composite)left ) ? (cast(Composite)left).computeTrim(0, 0, 0, 0) : new Rectangle(0, 0, 0, 0);
+            int w = x - rect.x - form.marginWidth - form.highlight - trim.width;
+            int h = topHeight - trim.height;
+            leftSize = computeChildSize(left, w, h, false);
+            left.setBounds(rect.x + form.marginWidth + form.highlight, y, leftSize.x, topHeight);
+        }
+        if (top)y += topHeight + form.verticalSpacing;
+    }
+    int oldSeperator = form.separator;
+    form.separator = -1;
+    if (content !is null && !content.isDisposed()) {
+        if (left !is null || right !is null || center !is null){
+            form.separator = y;
+            y++;
+        }
+         content.setBounds(rect.x + form.marginWidth + form.highlight, y, rect.width - 2 * form.marginWidth - 2*form.highlight, rect.y + rect.height - y - form.marginHeight - form.highlight);
+    }
+    if (oldSeperator !is -1 && form.separator !is -1) {
+        int t = Math.min(form.separator, oldSeperator);
+        int b = Math.max(form.separator, oldSeperator);
+        form.redraw(form.borderLeft, t, form.getSize().x - form.borderLeft - form.borderRight, b - t, false);
+    }
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/custom/all.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,64 @@
+module org.eclipse.swt.custom.all;
+
+import java.lang.all;
+
+public import org.eclipse.swt.custom.AnimatedProgress;
+public import org.eclipse.swt.custom.BidiSegmentEvent;
+public import org.eclipse.swt.custom.BidiSegmentListener;
+public import org.eclipse.swt.custom.Bullet;
+public import org.eclipse.swt.custom.BusyIndicator;
+public import org.eclipse.swt.custom.CBanner;
+public import org.eclipse.swt.custom.CBannerLayout;
+public import org.eclipse.swt.custom.CCombo;
+public import org.eclipse.swt.custom.CLabel;
+public import org.eclipse.swt.custom.CLayoutData;
+public import org.eclipse.swt.custom.CTabFolder2Adapter;
+public import org.eclipse.swt.custom.CTabFolder2Listener;
+public import org.eclipse.swt.custom.CTabFolder;
+public import org.eclipse.swt.custom.CTabFolderAdapter;
+public import org.eclipse.swt.custom.CTabFolderEvent;
+public import org.eclipse.swt.custom.CTabFolderLayout;
+public import org.eclipse.swt.custom.CTabFolderListener;
+public import org.eclipse.swt.custom.CTabItem;
+public import org.eclipse.swt.custom.ControlEditor;
+public import org.eclipse.swt.custom.DefaultContent;
+public import org.eclipse.swt.custom.ExtendedModifyEvent;
+public import org.eclipse.swt.custom.ExtendedModifyListener;
+public import org.eclipse.swt.custom.LineBackgroundEvent;
+public import org.eclipse.swt.custom.LineBackgroundListener;
+public import org.eclipse.swt.custom.LineStyleEvent;
+public import org.eclipse.swt.custom.LineStyleListener;
+public import org.eclipse.swt.custom.MovementEvent;
+public import org.eclipse.swt.custom.MovementListener;
+public import org.eclipse.swt.custom.PaintObjectEvent;
+public import org.eclipse.swt.custom.PaintObjectListener;
+public import org.eclipse.swt.custom.PopupList;
+public import org.eclipse.swt.custom.ST;
+public import org.eclipse.swt.custom.SashForm;
+public import org.eclipse.swt.custom.SashFormData;
+public import org.eclipse.swt.custom.SashFormLayout;
+public import org.eclipse.swt.custom.ScrolledComposite;
+public import org.eclipse.swt.custom.ScrolledCompositeLayout;
+public import org.eclipse.swt.custom.StackLayout;
+public import org.eclipse.swt.custom.StyleRange;
+public import org.eclipse.swt.custom.StyledText;
+public import org.eclipse.swt.custom.StyledTextContent;
+public import org.eclipse.swt.custom.StyledTextDropTargetEffect;
+public import org.eclipse.swt.custom.StyledTextEvent;
+public import org.eclipse.swt.custom.StyledTextListener;
+public import org.eclipse.swt.custom.StyledTextPrintOptions;
+public import org.eclipse.swt.custom.StyledTextRenderer;
+public import org.eclipse.swt.custom.TableCursor;
+public import org.eclipse.swt.custom.TableEditor;
+public import org.eclipse.swt.custom.TableTree;
+public import org.eclipse.swt.custom.TableTreeEditor;
+public import org.eclipse.swt.custom.TableTreeItem;
+public import org.eclipse.swt.custom.TextChangeListener;
+public import org.eclipse.swt.custom.TextChangedEvent;
+public import org.eclipse.swt.custom.TextChangingEvent;
+public import org.eclipse.swt.custom.TreeEditor;
+public import org.eclipse.swt.custom.VerifyKeyListener;
+public import org.eclipse.swt.custom.ViewForm;
+public import org.eclipse.swt.custom.ViewFormLayout;
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/ByteArrayTransfer.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,197 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.dnd.ByteArrayTransfer;
+
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.dnd.TransferData;
+import org.eclipse.swt.dnd.DND;
+import java.lang.all;
+
+/**
+ * The class <code>ByteArrayTransfer</code> provides a platform specific
+ * mechanism for converting a java <code>byte[]</code> to a platform
+ * specific representation of the byte array and vice versa.
+ *
+ * <p><code>ByteArrayTransfer</code> is never used directly but is sub-classed
+ * by transfer agents that convert between data in a java format such as a
+ * <code>String</code> and a platform specific byte array.
+ *
+ * <p>If the data you are converting <b>does not</b> map to a
+ * <code>byte[]</code>, you should sub-class <code>Transfer</code> directly
+ * and do your own mapping to a platform data type.</p>
+ *
+ * <p>The following snippet shows a subclass of ByteArrayTransfer that transfers
+ * data defined by the class <code>MyType</code>.</p>
+ *
+ * <pre><code>
+ * public class MyType {
+ *  public String fileName;
+ *  public long fileLength;
+ *  public long lastModified;
+ * }
+ * </code></pre>
+ *
+ * <pre><code>
+ * public class MyTypeTransfer extends ByteArrayTransfer {
+ *
+ *  private static final String MYTYPENAME = "my_type_name";
+ *  private static final int MYTYPEID = registerType(MYTYPENAME);
+ *  private static MyTypeTransfer _instance = new MyTypeTransfer();
+ *
+ * private MyTypeTransfer() {}
+ *
+ * public static MyTypeTransfer getInstance () {
+ *  return _instance;
+ * }
+ * public void javaToNative (Object object, TransferData transferData) {
+ *  if (object is null || !(object instanceof MyType[])) return;
+ *
+ *  if (isSupportedType(transferData)) {
+ *      MyType[] myTypes = (MyType[]) object;
+ *      try {
+ *          // write data to a byte array and then ask super to convert to pMedium
+ *          ByteArrayOutputStream out = new ByteArrayOutputStream();
+ *          DataOutputStream writeOut = new DataOutputStream(out);
+ *          for (int i = 0, length = myTypes.length; i &lt; length;  i++){
+ *              byte[] buffer = myTypes[i].fileName.getBytes();
+ *              writeOut.writeInt(buffer.length);
+ *              writeOut.write(buffer);
+ *              writeOut.writeLong(myTypes[i].fileLength);
+ *              writeOut.writeLong(myTypes[i].lastModified);
+ *          }
+ *          byte[] buffer = out.toByteArray();
+ *          writeOut.close();
+ *
+ *          super.javaToNative(buffer, transferData);
+ *
+ *      } catch (IOException e) {
+ *      }
+ *  }
+ * }
+ * public Object nativeToJava(TransferData transferData){
+ *
+ *  if (isSupportedType(transferData)) {
+ *
+ *      byte[] buffer = (byte[])super.nativeToJava(transferData);
+ *      if (buffer is null) return null;
+ *
+ *      MyType[] myData = new MyType[0];
+ *      try {
+ *          ByteArrayInputStream in = new ByteArrayInputStream(buffer);
+ *          DataInputStream readIn = new DataInputStream(in);
+ *          while(readIn.available() > 20) {
+ *              MyType datum = new MyType();
+ *              int size = readIn.readInt();
+ *              byte[] name = new byte[size];
+ *              readIn.read(name);
+ *              datum.fileName = new String(name);
+ *              datum.fileLength = readIn.readLong();
+ *              datum.lastModified = readIn.readLong();
+ *              MyType[] newMyData = new MyType[myData.length + 1];
+ *              System.arraycopy(myData, 0, newMyData, 0, myData.length);
+ *              newMyData[myData.length] = datum;
+ *              myData = newMyData;
+ *          }
+ *          readIn.close();
+ *      } catch (IOException ex) {
+ *          return null;
+ *      }
+ *      return myData;
+ *  }
+ *
+ *  return null;
+ * }
+ * protected String[] getTypeNames(){
+ *  return new String[]{MYTYPENAME};
+ * }
+ * protected int[] getTypeIds(){
+ *  return new int[] {MYTYPEID};
+ * }
+ * }
+ * </code></pre>
+ *
+ * @see Transfer
+ */
+public abstract class ByteArrayTransfer : Transfer {
+
+public override TransferData[] getSupportedTypes() {
+    int[] types = getTypeIds();
+    TransferData[] data = new TransferData[types.length];
+    for (int i = 0; i < types.length; i++) {
+        data[i] = new TransferData();
+        data[i].type = cast(void*)types[i];
+    }
+    return data;
+}
+
+public override bool isSupportedType(TransferData transferData){
+    if (transferData is null) return false;
+    int[] types = getTypeIds();
+    for (int i = 0; i < types.length; i++) {
+        if (transferData.type is cast(void*)types[i]) return true;
+    }
+    return false;
+}
+
+/**
+ * This implementation of <code>javaToNative</code> converts a java
+ * <code>byte[]</code> to a platform specific representation.
+ * 
+ * @param object a java <code>byte[]</code> containing the data to be converted
+ * @param transferData an empty <code>TransferData</code> object that will
+ *      be filled in on return with the platform specific format of the data
+ * 
+ * @see Transfer#nativeToJava
+ */
+protected override void javaToNative (Object object, TransferData transferData) {
+    transferData.result = 0;
+    if (!checkByteArray(object) || !isSupportedType(transferData)) {
+        DND.error(DND.ERROR_INVALID_DATA);
+    }
+    byte[] buffer = (cast(ArrayWrapperByte)object).array;
+    if (buffer.length is 0) return;
+    byte* pValue = cast(byte*)OS.g_malloc(buffer.length);
+    if (pValue is null) return;
+    pValue[ 0 .. buffer.length ] = buffer;
+    transferData.length = buffer.length;
+    transferData.format = 8;
+    transferData.pValue = cast(char*)pValue;
+    transferData.result = 1;
+}
+
+/**
+ * This implementation of <code>nativeToJava</code> converts a platform specific
+ * representation of a byte array to a java <code>byte[]</code>.
+ *
+ * @param transferData the platform specific representation of the data to be converted
+ * @return a java <code>byte[]</code> containing the converted data if the conversion was
+ *      successful; otherwise null
+ *
+ * @see Transfer#javaToNative
+ */
+protected override Object nativeToJava(TransferData transferData) {
+    if ( !isSupportedType(transferData) || transferData.pValue is null) return null;
+    int size = transferData.format * transferData.length / 8;
+    if (size is 0) return null;
+    byte* ptr = cast(byte*)transferData.pValue;
+    return new ArrayWrapperByte( ptr[ 0 .. size ].dup );
+}
+
+bool checkByteArray(Object object) {
+    if( object is null ) return false;
+    ArrayWrapperByte arr = cast(ArrayWrapperByte)object;
+    if( arr is null ) return false;
+    return arr.array.length > 0;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/Clipboard.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,632 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.dnd.Clipboard;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.internal.Converter;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.dnd.TransferData;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.ClipboardProxy;
+
+import java.lang.all;
+
+import tango.core.Thread;
+static import tango.stdc.string;
+
+/**
+ * The <code>Clipboard</code> provides a mechanism for transferring data from one
+ * application to another or within an application.
+ *
+ * <p>IMPORTANT: This class is <em>not</em> intended to be subclassed.</p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#clipboard">Clipboard snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ClipboardExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class Clipboard {
+
+    private Display display;
+
+    private static void* GTKCLIPBOARD;
+    private static void* GTKPRIMARYCLIPBOARD;
+    private static void* TARGET;
+    private static bool static_this_completed = false;
+    private static void static_this(){
+        if( !static_this_completed ){
+            GTKCLIPBOARD = OS.gtk_clipboard_get( cast(void*)OS.GDK_NONE);
+            auto primary = OS.gdk_atom_intern("PRIMARY".ptr, false);
+            GTKPRIMARYCLIPBOARD = OS.gtk_clipboard_get(primary);
+            TARGET = OS.gdk_atom_intern("TARGETS".ptr, false);
+            static_this_completed = true;
+        }
+    }
+
+/**
+ * Constructs a new instance of this class.  Creating an instance of a Clipboard
+ * may cause system resources to be allocated depending on the platform.  It is therefore
+ * mandatory that the Clipboard instance be disposed when no longer required.
+ *
+ * @param display the display on which to allocate the clipboard
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see Clipboard#dispose
+ * @see Clipboard#checkSubclass
+ */
+public this(Display display) {
+    checkSubclass ();
+    static_this();
+    if (display is null) {
+        display = Display.getCurrent();
+        if (display is null) {
+            display = Display.getDefault();
+        }
+    }
+    if (display.getThread() !is Thread.getThis()) {
+        DND.error(SWT.ERROR_THREAD_INVALID_ACCESS);
+    }
+    this.display = display;
+}
+
+/**
+ * Checks that this class can be subclassed.
+ * <p>
+ * The SWT class library is intended to be subclassed
+ * only at specific, controlled points. This method enforces this
+ * rule unless it is overridden.
+ * </p><p>
+ * <em>IMPORTANT:</em> By providing an implementation of this
+ * method that allows a subclass of a class which does not
+ * normally allow subclassing to be created, the implementer
+ * agrees to be fully responsible for the fact that any such
+ * subclass will likely fail between SWT releases and will be
+ * strongly platform specific. No support is provided for
+ * user-written classes which are implemented in this fashion.
+ * </p><p>
+ * The ability to subclass outside of the allowed SWT classes
+ * is intended purely to enable those not on the SWT development
+ * team to implement patches in order to get around specific
+ * limitations in advance of when those limitations can be
+ * addressed by the team. Subclassing should not be attempted
+ * without an intimate and detailed understanding of the hierarchy.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ */
+protected void checkSubclass () {
+    String name = this.classinfo.name;
+    String validName = Clipboard.classinfo.name;
+    if ( validName !=/*eq*/ name ) {
+        DND.error (SWT.ERROR_INVALID_SUBCLASS);
+    }
+}
+/**
+ * Throws an <code>SWTException</code> if the receiver can not
+ * be accessed by the caller. This may include both checks on
+ * the state of the receiver and more generally on the entire
+ * execution context. This method <em>should</em> be called by
+ * widget implementors to enforce the standard SWT invariants.
+ * <p>
+ * Currently, it is an error to invoke any method (other than
+ * <code>isDisposed()</code>) on a widget that has had its
+ * <code>dispose()</code> method called. It is also an error
+ * to call widget methods from any thread that is different
+ * from the thread that created the widget.
+ * </p><p>
+ * In future releases of SWT, there may be more or fewer error
+ * checks and exceptions may be thrown for different reasons.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+protected void checkWidget () {
+    Display display = this.display;
+    if (display is null) DND.error (SWT.ERROR_WIDGET_DISPOSED);
+    if (display.getThread() !is Thread.getThis ()) DND.error (SWT.ERROR_THREAD_INVALID_ACCESS);
+    if (display.isDisposed()) DND.error(SWT.ERROR_WIDGET_DISPOSED);
+}
+
+/**
+ * If this clipboard is currently the owner of the data on the system clipboard,
+ * clear the contents.  If this clipboard is not the owner, then nothing is done.
+ * Note that there are clipboard assistant applications that take ownership of
+ * data or make copies of data when it is placed on the clipboard.  In these
+ * cases, it may not be possible to clear the clipboard.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void clearContents() {
+    clearContents(DND.CLIPBOARD);
+}
+
+/**
+ * If this clipboard is currently the owner of the data on the specified
+ * clipboard, clear the contents.  If this clipboard is not the owner, then
+ * nothing is done.
+ *
+ * <p>Note that there are clipboard assistant applications that take ownership
+ * of data or make copies of data when it is placed on the clipboard.  In these
+ * cases, it may not be possible to clear the clipboard.</p>
+ *
+ * <p>The clipboards value is either one of the clipboard constants defined in
+ * class <code>DND</code>, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>DND</code> clipboard constants.</p>
+ *
+ * @param clipboards to be cleared
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see DND#CLIPBOARD
+ * @see DND#SELECTION_CLIPBOARD
+ *
+ * @since 3.1
+ */
+public void clearContents(int clipboards) {
+    checkWidget();
+    ClipboardProxy proxy = ClipboardProxy._getInstance(display);
+    proxy.clear(this, clipboards);
+}
+
+/**
+ * Disposes of the operating system resources associated with the clipboard.
+ * The data will still be available on the system clipboard after the dispose
+ * method is called.
+ *
+ * <p>NOTE: On some platforms the data will not be available once the application
+ * has exited or the display has been disposed.</p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ */
+public void dispose () {
+    if (isDisposed()) return;
+    if (display.getThread() !is Thread.getThis()) DND.error(SWT.ERROR_THREAD_INVALID_ACCESS);
+    display = null;
+}
+
+/**
+ * Retrieve the data of the specified type currently available on the system
+ * clipboard.  Refer to the specific subclass of <code>Transfer</code> to
+ * determine the type of object returned.
+ *
+ * <p>The following snippet shows text and RTF text being retrieved from the
+ * clipboard:</p>
+ *
+ *    <code><pre>
+ *    Clipboard clipboard = new Clipboard(display);
+ *    TextTransfer textTransfer = TextTransfer.getInstance();
+ *    String textData = (String)clipboard.getContents(textTransfer);
+ *    if (textData !is null) System.out.println("Text is "+textData);
+ *    RTFTransfer rtfTransfer = RTFTransfer.getInstance();
+ *    String rtfData = (String)clipboard.getContents(rtfTransfer);
+ *    if (rtfData !is null) System.out.println("RTF Text is "+rtfData);
+ *    clipboard.dispose();
+ *    </code></pre>
+ *
+ * @param transfer the transfer agent for the type of data being requested
+ * @return the data obtained from the clipboard or null if no data of this type is available
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if transfer is null</li>
+ * </ul>
+ *
+ * @see Transfer
+ */
+public Object getContents(Transfer transfer) {
+    return getContents(transfer, DND.CLIPBOARD);
+}
+
+/**
+ * Retrieve the data of the specified type currently available on the specified
+ * clipboard.  Refer to the specific subclass of <code>Transfer</code> to
+ * determine the type of object returned.
+ *
+ * <p>The following snippet shows text and RTF text being retrieved from the
+ * clipboard:</p>
+ *
+ *    <code><pre>
+ *    Clipboard clipboard = new Clipboard(display);
+ *    TextTransfer textTransfer = TextTransfer.getInstance();
+ *    String textData = (String)clipboard.getContents(textTransfer);
+ *    if (textData !is null) System.out.println("Text is "+textData);
+ *    RTFTransfer rtfTransfer = RTFTransfer.getInstance();
+ *    String rtfData = (String)clipboard.getContents(rtfTransfer, DND.CLIPBOARD);
+ *    if (rtfData !is null) System.out.println("RTF Text is "+rtfData);
+ *    clipboard.dispose();
+ *    </code></pre>
+ *
+ * <p>The clipboards value is either one of the clipboard constants defined in
+ * class <code>DND</code>, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>DND</code> clipboard constants.</p>
+ *
+ * @param transfer the transfer agent for the type of data being requested
+ * @param clipboards on which to look for data
+ *
+ * @return the data obtained from the clipboard or null if no data of this type is available
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if transfer is null</li>
+ * </ul>
+ *
+ * @see Transfer
+ * @see DND#CLIPBOARD
+ * @see DND#SELECTION_CLIPBOARD
+ *
+ * @since 3.1
+ */
+public Object getContents(Transfer transfer, int clipboards) {
+    checkWidget();
+    if (transfer is null) DND.error(SWT.ERROR_NULL_ARGUMENT);
+    GtkSelectionData* selection_data;
+    auto typeIds = transfer.getTypeIds();
+    for (int i = 0; i < typeIds.length; i++) {
+        if ((clipboards & DND.CLIPBOARD) !is 0) {
+            selection_data = gtk_clipboard_wait_for_contents(GTKCLIPBOARD, cast(void*)typeIds[i]);
+        }
+        if (selection_data !is null) break;
+        if ((clipboards & DND.SELECTION_CLIPBOARD) !is 0) {
+            selection_data = gtk_clipboard_wait_for_contents(GTKPRIMARYCLIPBOARD, cast(void*)typeIds[i]);
+        }
+    }
+    if (selection_data is null) return null;
+    GtkSelectionData* gtkSelectionData = selection_data;
+    TransferData tdata = new TransferData();
+    tdata.type = gtkSelectionData.type;
+    tdata.pValue = gtkSelectionData.data;
+    tdata.length = gtkSelectionData.length;
+    tdata.format = gtkSelectionData.format;
+    Object result = transfer.nativeToJava(tdata);
+    OS.gtk_selection_data_free(selection_data);
+    return result;
+}
+
+/**
+ * Returns <code>true</code> if the clipboard has been disposed,
+ * and <code>false</code> otherwise.
+ * <p>
+ * This method gets the dispose state for the clipboard.
+ * When a clipboard has been disposed, it is an error to
+ * invoke any other method using the clipboard.
+ * </p>
+ *
+ * @return <code>true</code> when the widget is disposed and <code>false</code> otherwise
+ *
+ * @since 3.0
+ */
+public bool isDisposed () {
+    return (display is null);
+}
+
+/**
+ * Place data of the specified type on the system clipboard.  More than one type
+ * of data can be placed on the system clipboard at the same time.  Setting the
+ * data clears any previous data from the system clipboard, regardless of type.
+ *
+ * <p>NOTE: On some platforms, the data is immediately copied to the system
+ * clipboard but on other platforms it is provided upon request.  As a result,
+ * if the application modifies the data object it has set on the clipboard, that
+ * modification may or may not be available when the data is subsequently
+ * requested.</p>
+ *
+ * <p>The following snippet shows text and RTF text being set on the copy/paste
+ * clipboard:
+ * </p>
+ *
+ * <code><pre>
+ *  Clipboard clipboard = new Clipboard(display);
+ *  String textData = "Hello World";
+ *  String rtfData = "{\\rtf1\\b\\i Hello World}";
+ *  TextTransfer textTransfer = TextTransfer.getInstance();
+ *  RTFTransfer rtfTransfer = RTFTransfer.getInstance();
+ *  Transfer[] transfers = new Transfer[]{textTransfer, rtfTransfer};
+ *  Object[] data = new Object[]{textData, rtfData};
+ *  clipboard.setContents(data, transfers);
+ *  clipboard.dispose();
+ * </code></pre>
+ *
+ * @param data the data to be set in the clipboard
+ * @param dataTypes the transfer agents that will convert the data to its
+ * platform specific format; each entry in the data array must have a
+ * corresponding dataType
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if data is null or datatypes is null
+ *          or the length of data is not the same as the length of dataTypes</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *  @exception SWTError <ul>
+ *    <li>ERROR_CANNOT_SET_CLIPBOARD - if the clipboard is locked or otherwise unavailable</li>
+ * </ul>
+ *
+ * <p>NOTE: ERROR_CANNOT_SET_CLIPBOARD should be an SWTException, since it is a
+ * recoverable error, but can not be changed due to backward compatibility.</p>
+ */
+public void setContents(Object[] data, Transfer[] dataTypes) {
+    setContents(data, dataTypes, DND.CLIPBOARD);
+}
+
+/**
+ * Place data of the specified type on the specified clipboard.  More than one
+ * type of data can be placed on the specified clipboard at the same time.
+ * Setting the data clears any previous data from the specified
+ * clipboard, regardless of type.
+ *
+ * <p>NOTE: On some platforms, the data is immediately copied to the specified
+ * clipboard but on other platforms it is provided upon request.  As a result,
+ * if the application modifies the data object it has set on the clipboard, that
+ * modification may or may not be available when the data is subsequently
+ * requested.</p>
+ *
+ * <p>The clipboards value is either one of the clipboard constants defined in
+ * class <code>DND</code>, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>DND</code> clipboard constants.</p>
+ *
+ * <p>The following snippet shows text and RTF text being set on the copy/paste
+ * clipboard:
+ * </p>
+ *
+ * <code><pre>
+ *  Clipboard clipboard = new Clipboard(display);
+ *  String textData = "Hello World";
+ *  String rtfData = "{\\rtf1\\b\\i Hello World}";
+ *  TextTransfer textTransfer = TextTransfer.getInstance();
+ *  RTFTransfer rtfTransfer = RTFTransfer.getInstance();
+ *  Transfer[] transfers = new Transfer[]{textTransfer, rtfTransfer};
+ *  Object[] data = new Object[]{textData, rtfData};
+ *  clipboard.setContents(data, transfers, DND.CLIPBOARD);
+ *  clipboard.dispose();
+ * </code></pre>
+ *
+ * @param data the data to be set in the clipboard
+ * @param dataTypes the transfer agents that will convert the data to its
+ * platform specific format; each entry in the data array must have a
+ * corresponding dataType
+ * @param clipboards on which to set the data
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if data is null or datatypes is null
+ *          or the length of data is not the same as the length of dataTypes</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *  @exception SWTError <ul>
+ *    <li>ERROR_CANNOT_SET_CLIPBOARD - if the clipboard is locked or otherwise unavailable</li>
+ * </ul>
+ *
+ * <p>NOTE: ERROR_CANNOT_SET_CLIPBOARD should be an SWTException, since it is a
+ * recoverable error, but can not be changed due to backward compatibility.</p>
+ *
+ * @see DND#CLIPBOARD
+ * @see DND#SELECTION_CLIPBOARD
+ *
+ * @since 3.1
+ */
+public void setContents(Object[] data, Transfer[] dataTypes, int clipboards) {
+    checkWidget();
+    if (data is null || dataTypes is null || data.length !is dataTypes.length || data.length is 0) {
+        DND.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    for (int i = 0; i < data.length; i++) {
+        if (data[i] is null || dataTypes[i] is null || !dataTypes[i].validate(data[i])) {
+            DND.error(SWT.ERROR_INVALID_ARGUMENT);
+        }
+    }
+    ClipboardProxy proxy = ClipboardProxy._getInstance(display);
+    if (!proxy.setData(this, data, dataTypes, clipboards)) {
+        DND.error(DND.ERROR_CANNOT_SET_CLIPBOARD);
+    }
+}
+
+/**
+ * Returns an array of the data types currently available on the system
+ * clipboard. Use with Transfer.isSupportedType.
+ *
+ * @return array of data types currently available on the system clipboard
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Transfer#isSupportedType
+ *
+ * @since 3.0
+ */
+public TransferData[] getAvailableTypes() {
+    return getAvailableTypes(DND.CLIPBOARD);
+}
+
+/**
+ * Returns an array of the data types currently available on the specified
+ * clipboard. Use with Transfer.isSupportedType.
+ *
+ * <p>The clipboards value is either one of the clipboard constants defined in
+ * class <code>DND</code>, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>DND</code> clipboard constants.</p>
+ *
+ * @param clipboards from which to get the data types
+ * @return array of data types currently available on the specified clipboard
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Transfer#isSupportedType
+ * @see DND#CLIPBOARD
+ * @see DND#SELECTION_CLIPBOARD
+ *
+ * @since 3.1
+ */
+public TransferData[] getAvailableTypes(int clipboards) {
+    checkWidget();
+    TransferData[] result = null;
+    if ((clipboards & DND.CLIPBOARD) !is 0) {
+        auto types = getAvailableClipboardTypes();
+        result = new TransferData[types.length];
+        for (int i = 0; i < types.length; i++) {
+            result[i] = new TransferData();
+            result[i].type = types[i];
+        }
+    }
+    if ((clipboards & DND.SELECTION_CLIPBOARD) !is 0) {
+        auto types = getAvailablePrimaryTypes();
+        int offset = 0;
+        if (result !is null) {
+            TransferData[] newResult = new TransferData[result.length + types.length];
+            System.arraycopy(result,0, newResult, 0, result.length);
+            offset = result.length;
+            result = newResult;
+        } else {
+            result = new TransferData[types.length];
+        }
+        for (int i = 0; i < types.length; i++) {
+            result[offset+i] = new TransferData();
+            result[offset+i].type = types[i];
+        }
+    }
+    return result is null ? new TransferData[0] : result;
+}
+
+/**
+ * Returns a platform specific list of the data types currently available on the
+ * system clipboard.
+ *
+ * <p>Note: <code>getAvailableTypeNames</code> is a utility for writing a Transfer
+ * sub-class.  It should NOT be used within an application because it provides
+ * platform specific information.</p>
+ *
+ * @return a platform specific list of the data types currently available on the
+ * system clipboard
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String[] getAvailableTypeNames() {
+    checkWidget();
+    auto types1 = getAvailableClipboardTypes();
+    auto types2 = getAvailablePrimaryTypes();
+    String[] result = new String[types1.length + types2.length];
+    int count = 0;
+    for (int i = 0; i < types1.length; i++) {
+        auto pName = OS.gdk_atom_name(types1[i]);
+        if (pName is null) {
+            continue;
+        }
+        String buffer = fromStringz( pName ).dup;
+        OS.g_free (pName);
+        result[count++] = "GTKCLIPBOARD "~buffer;
+    }
+    for (int i = 0; i < types2.length; i++) {
+        auto pName = OS.gdk_atom_name(types2[i]);
+        if (pName is null) {
+            continue;
+        }
+        String buffer = fromStringz( pName ).dup;
+        OS.g_free (pName);
+        result[count++] = "GTKPRIMARYCLIPBOARD "~buffer;
+    }
+    if (count < result.length){
+        String[] temp = new String[count];
+        System.arraycopy(result, 0, temp, 0, count);
+        result = temp;
+    }
+    return result;
+}
+
+private  void*[] getAvailablePrimaryTypes() {
+    void*[] types;
+    auto selection_data = gtk_clipboard_wait_for_contents(GTKPRIMARYCLIPBOARD, TARGET);
+    if (selection_data !is null) {
+        try {
+            GtkSelectionData* gtkSelectionData = selection_data;
+            if (gtkSelectionData.length !is 0) {
+                types = cast(void*[])new int[gtkSelectionData.length * 8 / gtkSelectionData.format];
+                tango.stdc.string.memmove( cast(void*)types.ptr, gtkSelectionData.data, gtkSelectionData.length );
+            }
+        } finally {
+            OS.gtk_selection_data_free(selection_data);
+        }
+    }
+    return types;
+}
+private void*[] getAvailableClipboardTypes () {
+    void*[] types;
+    auto selection_data  = gtk_clipboard_wait_for_contents(GTKCLIPBOARD, TARGET);
+    if (selection_data !is null) {
+        try {
+            GtkSelectionData* gtkSelectionData = selection_data;
+            if (gtkSelectionData.length !is 0) {
+                types = cast(void*[])new int[gtkSelectionData.length * 8 / gtkSelectionData.format];
+                tango.stdc.string.memmove( cast(void*)types, gtkSelectionData.data, gtkSelectionData.length);
+            }
+        } finally {
+            OS.gtk_selection_data_free(selection_data);
+        }
+    }
+    return types;
+}
+
+GtkSelectionData* gtk_clipboard_wait_for_contents(void* clipboard, void* target) {
+    String key = "org.eclipse.swt.internal.gtk.dispatchEvent";
+    Display display = this.display;
+    ArrayWrapperInt arr = new ArrayWrapperInt( [ OS.GDK_PROPERTY_NOTIFY, OS.GDK_SELECTION_CLEAR, OS.GDK_SELECTION_REQUEST, OS.GDK_SELECTION_NOTIFY ] );
+    display.setData(key, arr );
+    GtkSelectionData* selection_data = OS.gtk_clipboard_wait_for_contents(clipboard, target);
+    display.setData(key, null);
+    return selection_data;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/ClipboardProxy.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,201 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.dnd.ClipboardProxy;
+
+import java.lang.all;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.dnd.Clipboard;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.TransferData;
+
+static import tango.stdc.string;
+
+
+class ClipboardProxy {
+    /* Data is not flushed to the clipboard immediately.
+     * This class will remember the data and provide it when requested.
+     */
+    Object[] clipboardData;
+    Transfer[] clipboardDataTypes;
+    Object[] primaryClipboardData;
+    Transfer[] primaryClipboardDataTypes;
+
+    Display display;
+    Clipboard activeClipboard = null;
+    Clipboard activePrimaryClipboard = null;
+
+    static String ID = "CLIPBOARD PROXY OBJECT"; //$NON-NLS-1$
+
+static ClipboardProxy _getInstance(Display display) {
+    ClipboardProxy proxy = cast(ClipboardProxy) display.getData(ID);
+    if (proxy !is null) return proxy;
+    proxy = new ClipboardProxy(display);
+    display.setData(ID, proxy);
+    display.addListener(SWT.Dispose, new class( display ) Listener {
+        Display disp;
+        this( Display disp ){ this.disp = disp; }
+        public void handleEvent(Event event) {
+            ClipboardProxy clipbordProxy = cast(ClipboardProxy)disp.getData(ID);
+            if (clipbordProxy is null) return;
+            disp.setData(ID, null);
+            clipbordProxy.dispose();
+        }
+    });
+    return proxy;
+}
+
+this(Display display) {
+    this.display = display;
+}
+
+void clear (Clipboard owner, int clipboards) {
+    if ((clipboards & DND.CLIPBOARD) !is 0 && activeClipboard is owner) {
+        OS.gtk_clipboard_clear(Clipboard.GTKCLIPBOARD);
+    }
+    if ((clipboards & DND.SELECTION_CLIPBOARD) !is 0 && activePrimaryClipboard is owner) {
+        OS.gtk_clipboard_clear(Clipboard.GTKPRIMARYCLIPBOARD);
+    }
+}
+
+private static extern(C) void clearFuncFunc(GtkClipboard *clipboard, void* user_data_or_owner){
+    auto obj = cast(ClipboardProxy)user_data_or_owner;
+    obj.clearFunc( clipboard );
+}
+void clearFunc(GtkClipboard *clipboard ){
+    if (clipboard is Clipboard.GTKCLIPBOARD) {
+        activeClipboard = null;
+        clipboardData = null;
+        clipboardDataTypes = null;
+    }
+    if (clipboard is Clipboard.GTKPRIMARYCLIPBOARD) {
+        activePrimaryClipboard = null;
+        primaryClipboardData = null;
+        primaryClipboardDataTypes = null;
+    }
+}
+
+void dispose () {
+    if (display is null) return;
+    if (activeClipboard !is null) OS.gtk_clipboard_clear(Clipboard.GTKCLIPBOARD);
+    if (activePrimaryClipboard !is null) OS.gtk_clipboard_clear(Clipboard.GTKPRIMARYCLIPBOARD);
+    display = null;
+    clipboardData = null;
+    clipboardDataTypes = null;
+    primaryClipboardData = null;
+    primaryClipboardDataTypes = null;
+}
+
+private static extern(C) void getFuncFunc(
+    GtkClipboard *clipboard,
+    GtkSelectionData *selection_data,
+    uint info,
+    void* user_data_or_owner)
+{
+    auto obj = cast(ClipboardProxy)user_data_or_owner;
+    obj.getFunc( clipboard, selection_data, info );
+}
+/**
+ * This function provides the data to the clipboard on request.
+ * When this clipboard is disposed, the data will no longer be available.
+ */
+void getFunc(
+    GtkClipboard *clipboard,
+    GtkSelectionData *selectionData,
+    uint info)
+{
+    if (selectionData is null) return 0;
+    TransferData tdata = new TransferData();
+    tdata.type = selectionData.target;
+    Transfer[] types = (clipboard is Clipboard.GTKCLIPBOARD) ? clipboardDataTypes : primaryClipboardDataTypes;
+    int index = -1;
+    for (int i = 0; i < types.length; i++) {
+        if (types[i].isSupportedType(tdata)) {
+            index = i;
+            break;
+        }
+    }
+    if (index is -1) return 0;
+    Object[] data = (clipboard is Clipboard.GTKCLIPBOARD) ? clipboardData : primaryClipboardData;
+    types[index].javaToNative(data[index], tdata);
+    if (tdata.format < 8 || tdata.format % 8 !is 0) {
+        return 0;
+    }
+    OS.gtk_selection_data_set(selectionData, tdata.type, tdata.format, tdata.pValue, tdata.length);
+    OS.g_free(tdata.pValue);
+    return 1;
+}
+
+bool setData(Clipboard owner, Object[] data, Transfer[] dataTypes, int clipboards) { 
+    GtkTargetEntry*[] entries;
+    GtkTargetEntry* pTargetsList;
+    try {
+        for (int i = 0; i < dataTypes.length; i++) {
+            Transfer transfer = dataTypes[i];
+            int[] typeIds = transfer.getTypeIds();
+            String[] typeNames = transfer.getTypeNames();
+            for (int j = 0; j < typeIds.length; j++) {
+                GtkTargetEntry*  entry = new GtkTargetEntry();
+                entry.info = typeIds[j];
+                char* pName = cast(char*)OS.g_malloc(typeNames[j].length+1);
+                pName[ 0 .. typeNames[j].length ] = typeNames[j];
+                pName[ typeNames[j].length ] = '\0';
+                entry.target = pName;
+                GtkTargetEntry*[] tmp = new GtkTargetEntry*[entries.length + 1];
+                SimpleType!(GtkTargetEntry*).arraycopy(entries, 0, tmp, 0, entries.length);
+                tmp[entries.length] = entry;
+                entries = tmp;
+            }
+        }
+
+        pTargetsList = cast(GtkTargetEntry*)OS.g_malloc(GtkTargetEntry.sizeof * entries.length);
+        int offset = 0;
+        for (int i = 0; i < entries.length; i++) {
+            tango.stdc.string.memmove(pTargetsList + i, entries[i], GtkTargetEntry.sizeof);
+            offset += GtkTargetEntry.sizeof;
+        }
+        if ((clipboards & DND.CLIPBOARD) !is 0) {
+            if (activeClipboard !is null) OS.gtk_clipboard_clear(Clipboard.GTKCLIPBOARD);
+            clipboardData = data;
+            clipboardDataTypes = dataTypes;
+            if (!OS.gtk_clipboard_set_with_data(Clipboard.GTKCLIPBOARD, pTargetsList, entries.length, &getFuncFunc, &clearFuncFunc, cast(void*)this )) {
+                return false;
+            }
+            activeClipboard = owner;
+        }
+        if ((clipboards & DND.SELECTION_CLIPBOARD) !is 0) {
+            if (activePrimaryClipboard !is null) OS.gtk_clipboard_clear(Clipboard.GTKPRIMARYCLIPBOARD);
+            primaryClipboardData = data;
+            primaryClipboardDataTypes = dataTypes;
+            if (!OS.gtk_clipboard_set_with_data(Clipboard.GTKPRIMARYCLIPBOARD, pTargetsList, entries.length, &getFuncFunc, &clearFuncFunc, cast(void*)this )) {
+                return false;
+            }
+            activePrimaryClipboard = owner;
+        }
+        return true;
+    } finally {
+        for (int i = 0; i < entries.length; i++) {
+            GtkTargetEntry* entry = entries[i];
+            if( entry.target !is null) OS.g_free(entry.target);
+        }
+        if (pTargetsList !is null) OS.g_free(pTargetsList);
+    }
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/DND.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,294 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.dnd.DND;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.SWTException;
+
+import tango.util.Convert;
+
+/**
+ *
+ * Class DND contains all the constants used in defining a
+ * DragSource or a DropTarget.
+ *
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class DND {
+
+    /**
+     * The transfer mechanism for data that is being cut
+     * and then pasted or copied and then pasted (value is 1).
+     *
+     * @see Clipboard
+     *
+     * @since 3.1
+     */
+    public const static int CLIPBOARD = 1 << 0;
+
+    /**
+     * The transfer mechanism for clients that use the selection
+     * mechanism (value is 2).
+     *
+     * @see Clipboard
+     *
+     * @since 3.1
+     */
+    public const static int SELECTION_CLIPBOARD = 1 << 1;
+
+    /**
+     * Drag and Drop Operation: no drag/drop operation performed
+     * (value is 0).
+     */
+    public const static int DROP_NONE = 0;
+
+    /**
+     * Drag and Drop Operation: a copy of the data in the drag source is
+     * added to the drop target (value is 1 &lt;&lt; 0).
+     */
+    public const static int DROP_COPY = 1 << 0;
+
+    /**
+     * Drag and Drop Operation: a copy of the data is added to the drop target and
+     * the original data is removed from the drag source (value is 1 &lt;&lt; 1).
+     */
+    public const static int DROP_MOVE = 1 << 1;
+
+    /**
+     * Drag and Drop Operation: the drop target makes a link to the data in
+     * the drag source (value is 1 &lt;&lt; 2).
+     */
+    public const static int DROP_LINK = 1 << 2;
+
+    /**
+     * Drag and Drop Operation: the drop target moves the data and the drag source removes
+     * any references to the data and updates its display.  This is not available on all platforms
+     * and is only used when a non-SWT application is the drop target.  In this case, the SWT
+     * drag source is informed in the dragFinished event that the drop target has moved the data.
+     * (value is 1 &lt;&lt; 3).
+     *
+     * @see DragSourceListener#dragFinished
+     */
+    public const static int DROP_TARGET_MOVE = 1 << 3;
+
+    /**
+     * Drag and Drop Operation: During a dragEnter event or a dragOperationChanged, if no modifier keys
+     * are pressed, the operation is set to DROP_DEFAULT.  The application can choose what the default
+     * operation should be by setting a new value in the operation field.  If no value is choosen, the
+     * default operation for the platform will be selected (value is 1 &lt;&lt; 4).
+     *
+     * @see DropTargetListener#dragEnter
+     * @see DropTargetListener#dragOperationChanged
+     * @since 2.0
+     */
+    public const static int DROP_DEFAULT = 1 << 4;
+
+    /**
+     * DragSource Event: the drop has successfully completed or has been terminated (such as hitting
+     * the ESC key); perform cleanup such as removing data on a move operation (value is 2000).
+     */
+    public static const int DragEnd     = 2000;
+
+    /**
+     * DragSource Event: the data to be dropped is required from the drag source (value is 2001).
+     */
+    public static const int DragSetData = 2001;
+
+    /**
+     * DropTarget Event: the cursor has entered the drop target boundaries (value is 2002).
+     */
+    public static const int DragEnter   = 2002;
+
+    /**
+     * DropTarget Event: the cursor has left the drop target boundaries OR the drop
+     * operation has been cancelled (such as by hitting ECS) OR the drop is about to
+     * happen (user has released the mouse button over this target) (value is 2003).
+     */
+    public static const int DragLeave   = 2003;
+
+    /**
+     * DropTarget Event: the cursor is over the drop target (value is 2004).
+     */
+    public static const int DragOver    = 2004;
+
+    /**
+     * DropTarget Event: the operation being performed has changed usually due to the user
+     * changing the selected modifier keys while dragging (value is 2005).
+     */
+    public static const int DragOperationChanged = 2005;
+
+    /**
+     * DropTarget Event: the data has been dropped (value is 2006).
+     */
+    public static const int Drop = 2006;
+
+    /**
+     * DropTarget Event: the drop target is given a last chance to modify the drop (value is 2007).
+     */
+    public static const int DropAccept  = 2007;
+
+    /**
+     * DragSource Event: a drag is about to begin (value is 2008).
+     */
+    public static const int DragStart = 2008;
+
+    /**
+     * DropTarget drag under effect: No effect is shown (value is 0).
+     */
+    public static const int FEEDBACK_NONE = 0;
+
+    /**
+     * DropTarget drag under effect: The item under the cursor is selected; applies to tables
+     * and trees (value is 1).
+     */
+    public static const int FEEDBACK_SELECT = 1;
+
+    /**
+     * DropTarget drag under effect: An insertion mark is shown before the item under the cursor; applies to
+     * trees (value is 2).
+     */
+    public static const int FEEDBACK_INSERT_BEFORE = 2;
+
+    /**
+     * DropTarget drag under effect:An insertion mark is shown after the item under the cursor; applies to
+     * trees (value is 4).
+     */
+    public static const int FEEDBACK_INSERT_AFTER = 4;
+
+    /**
+     * DropTarget drag under effect: The widget is scrolled up or down to allow the user to drop on items that
+     * are not currently visible;  applies to tables and trees (value is 8).
+     */
+    public static const int FEEDBACK_SCROLL = 8;
+
+    /**
+     * DropTarget drag under effect: The item currently under the cursor is expanded to allow the user to
+     * select a drop target from a sub item; applies to trees (value is 16).
+     */
+    public static const int FEEDBACK_EXPAND = 16;
+
+    /**
+     * Error code: drag source can not be initialized (value is 2000).
+     */
+    public static const int ERROR_CANNOT_INIT_DRAG = 2000;
+
+    /**
+     * Error code: drop target cannot be initialized (value is 2001).
+     */
+    public static const int ERROR_CANNOT_INIT_DROP = 2001;
+
+    /**
+     * Error code: Data can not be set on system clipboard (value is 2002).
+     */
+    public static const int ERROR_CANNOT_SET_CLIPBOARD = 2002;
+
+    /**
+     * Error code: Data does not have correct format for type (value is 2003).
+     * @since 3.1
+     */
+    public static const int ERROR_INVALID_DATA = 2003;
+
+    /**
+     * DropTarget Key: The string constant for looking up the drop target 
+     * for a control using <code>getData(String)</code>. When a drop target 
+     * is created for a control, it is stored as a property in the control 
+     * using <code>setData(String, Object)</code>.
+     * 
+     * @since 3.4
+     */
+    public static final String DROP_TARGET_KEY = "DropTarget"; //$NON-NLS-1$
+    
+    /**
+     * DragSource Key: The string constant for looking up the drag source 
+     * for a control using <code>getData(String)</code>. When a drag source 
+     * is created for a control, it is stored as a property in the control 
+     * using <code>setData(String, Object)</code>.
+     * 
+     * @since 3.4
+     */
+    public static final String DRAG_SOURCE_KEY = "DragSource"; //$NON-NLS-1$
+
+    static const String INIT_DRAG_MESSAGE = "Cannot initialize Drag"; //$NON-NLS-1$
+    static const String INIT_DROP_MESSAGE = "Cannot initialize Drop"; //$NON-NLS-1$
+    static const String CANNOT_SET_CLIPBOARD_MESSAGE = "Cannot set data in clipboard"; //$NON-NLS-1$
+    static const String INVALID_DATA_MESSAGE = "Data does not have correct format for type"; //$NON-NLS-1$
+
+/**
+ * Throws an appropriate exception based on the passed in error code.
+ *
+ * @param code the DND error code
+ */
+public static void error (int code) {
+    error (code, 0);
+}
+
+/**
+ * Throws an appropriate exception based on the passed in error code.
+ * The <code>hresult</code> argument should be either 0, or the
+ * platform specific error code.
+ * <p>
+ * In DND, errors are reported by throwing one of three exceptions:
+ * <dl>
+ * <dd>java.lang.IllegalArgumentException</dd>
+ * <dt>thrown whenever one of the API methods is invoked with an illegal argument</dt>
+ * <dd>org.eclipse.swt.SWTException (extends java.lang.RuntimeException)</dd>
+ * <dt>thrown whenever a recoverable error happens internally in SWT</dt>
+ * <dd>org.eclipse.swt.SWTError (extends java.lang.Error)</dd>
+ * <dt>thrown whenever a <b>non-recoverable</b> error happens internally in SWT</dt>
+ * </dl>
+ * This method provides the logic which maps between error codes
+ * and one of the above exceptions.
+ * </p>
+ *
+ * @param code the DND error code.
+ * @param hresult the platform specific error code.
+ *
+ * @see SWTError
+ * @see SWTException
+ * @see IllegalArgumentException
+ */
+public static void error (int code, int hresult) {
+    switch (code) {
+        /* OS Failure/Limit (fatal, may occur only on some platforms) */
+        case DND.ERROR_CANNOT_INIT_DRAG:{
+            String msg = DND.INIT_DRAG_MESSAGE;
+            if (hresult !is 0) msg ~= " result = "~to!(String)(hresult); //$NON-NLS-1$
+            throw new SWTError (code, msg);
+        }
+        case DND.ERROR_CANNOT_INIT_DROP:{
+            String msg = DND.INIT_DROP_MESSAGE;
+            if (hresult !is 0) msg ~= " result = "~to!(String)(hresult); //$NON-NLS-1$
+            throw new SWTError (code, msg);
+        }
+        case DND.ERROR_CANNOT_SET_CLIPBOARD:{
+            String msg = DND.CANNOT_SET_CLIPBOARD_MESSAGE;
+            if (hresult !is 0) msg ~= " result = "~to!(String)(hresult); //$NON-NLS-1$
+            throw new SWTError (code, msg);
+        }
+        case DND.ERROR_INVALID_DATA:{
+            String msg = DND.INVALID_DATA_MESSAGE;
+            if (hresult !is 0) msg ~= " result = "~to!(String)(hresult); //$NON-NLS-1$
+            throw new SWTException (code, msg);
+        }
+        default:
+    }
+
+    /* Unknown/Undefined Error */
+    SWT.error(code);
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/DNDEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.dnd.DNDEvent;
+
+import java.lang.all;
+
+
+
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.dnd.TransferData;
+
+class DNDEvent : Event {
+    public TransferData dataType;
+    public TransferData[] dataTypes;
+    public int operations;
+    public int feedback;
+    public Image image;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/DNDListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,139 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.dnd.DNDListener;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.internal.SWTEventListener;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.DNDEvent;
+import org.eclipse.swt.dnd.DragSourceEvent;
+import org.eclipse.swt.dnd.DragSourceEffect;
+import org.eclipse.swt.dnd.DragSource;
+import org.eclipse.swt.dnd.DragSourceListener;
+import org.eclipse.swt.dnd.DropTargetEvent;
+import org.eclipse.swt.dnd.DropTargetListener;
+import org.eclipse.swt.dnd.DropTargetEffect;
+import org.eclipse.swt.dnd.DropTarget;
+
+
+class DNDListener : TypedListener {
+    Widget dndWidget;
+/**
+ * DNDListener constructor comment.
+ * @param listener org.eclipse.swt.internal.SWTEventListener
+ */
+this(SWTEventListener listener) {
+    super(listener);
+}
+public override void handleEvent (Event e) {
+    switch (e.type) {
+        case DND.DragStart: {
+            DragSourceEvent event = new DragSourceEvent(cast(DNDEvent)e);
+            DragSourceEffect sourceEffect = (cast(DragSource) dndWidget).getDragSourceEffect();
+            if (sourceEffect !is null) {
+                sourceEffect.dragStart (event);
+            }
+            (cast(DragSourceListener) eventListener).dragStart (event);
+            event.updateEvent(cast(DNDEvent)e);
+            break;
+        }
+        case DND.DragEnd: {
+            DragSourceEvent event = new DragSourceEvent(cast(DNDEvent)e);
+            DragSourceEffect sourceEffect = (cast(DragSource) dndWidget).getDragSourceEffect();
+            if (sourceEffect !is null) {
+                sourceEffect.dragFinished (event);
+            }
+            (cast(DragSourceListener) eventListener).dragFinished (event);
+            event.updateEvent(cast(DNDEvent)e);
+            break;
+        }
+        case DND.DragSetData: {
+            DragSourceEvent event = new DragSourceEvent(cast(DNDEvent)e);
+            DragSourceEffect sourceEffect = (cast(DragSource) dndWidget).getDragSourceEffect();
+            if (sourceEffect !is null) {
+                sourceEffect.dragSetData (event);
+            }
+            (cast(DragSourceListener) eventListener).dragSetData (event);
+            event.updateEvent(cast(DNDEvent)e);
+            break;
+        }
+        case DND.DragEnter: {
+            DropTargetEvent event = new DropTargetEvent(cast(DNDEvent)e);
+            (cast(DropTargetListener) eventListener).dragEnter (event);
+            DropTargetEffect dropEffect = (cast(DropTarget) dndWidget).getDropTargetEffect();
+            if (dropEffect !is null) {
+                dropEffect.dragEnter (event);
+            }
+            event.updateEvent(cast(DNDEvent)e);
+            break;
+        }
+        case DND.DragLeave: {
+            DropTargetEvent event = new DropTargetEvent(cast(DNDEvent)e);
+            (cast(DropTargetListener) eventListener).dragLeave (event);
+            DropTargetEffect dropEffect = (cast(DropTarget) dndWidget).getDropTargetEffect();
+            if (dropEffect !is null) {
+                dropEffect.dragLeave (event);
+            }
+            event.updateEvent(cast(DNDEvent)e);
+            break;
+        }
+        case DND.DragOver: {
+            DropTargetEvent event = new DropTargetEvent(cast(DNDEvent)e);
+            (cast(DropTargetListener) eventListener).dragOver (event);
+            DropTargetEffect dropEffect = (cast(DropTarget) dndWidget).getDropTargetEffect();
+            if (dropEffect !is null) {
+                dropEffect.dragOver (event);
+            }
+            event.updateEvent(cast(DNDEvent)e);
+            break;
+        }
+        case DND.Drop: {
+            DropTargetEvent event = new DropTargetEvent(cast(DNDEvent)e);
+            (cast(DropTargetListener) eventListener).drop (event);
+            DropTargetEffect dropEffect = (cast(DropTarget) dndWidget).getDropTargetEffect();
+            if (dropEffect !is null) {
+                dropEffect.drop (event);
+            }
+            event.updateEvent(cast(DNDEvent)e);
+            break;
+        }
+        case DND.DropAccept: {
+            DropTargetEvent event = new DropTargetEvent(cast(DNDEvent)e);
+            (cast(DropTargetListener) eventListener).dropAccept (event);
+            DropTargetEffect dropEffect = (cast(DropTarget) dndWidget).getDropTargetEffect();
+            if (dropEffect !is null) {
+                dropEffect.dropAccept (event);
+            }
+            event.updateEvent(cast(DNDEvent)e);
+            break;
+        }
+        case DND.DragOperationChanged: {
+            DropTargetEvent event = new DropTargetEvent(cast(DNDEvent)e);
+            (cast(DropTargetListener) eventListener).dragOperationChanged (event);
+            DropTargetEffect dropEffect = (cast(DropTarget) dndWidget).getDropTargetEffect();
+            if (dropEffect !is null) {
+                dropEffect.dragOperationChanged (event);
+            }
+            event.updateEvent(cast(DNDEvent)e);
+            break;
+        }
+        default:
+
+    }
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/DragSource.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,679 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.dnd.DragSource;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.dnd.DragSourceEffect;
+import org.eclipse.swt.dnd.DragSourceListener;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.TreeDragSourceEffect;
+import org.eclipse.swt.dnd.TableDragSourceEffect;
+import org.eclipse.swt.dnd.DNDListener;
+import org.eclipse.swt.dnd.DNDEvent;
+import org.eclipse.swt.dnd.TransferData;
+import java.lang.all;
+
+import tango.core.Thread;
+
+/**
+ *
+ * <code>DragSource</code> defines the source object for a drag and drop transfer.
+ *
+ * <p>IMPORTANT: This class is <em>not</em> intended to be subclassed.</p>
+ *
+ * <p>A drag source is the object which originates a drag and drop operation. For the specified widget,
+ * it defines the type of data that is available for dragging and the set of operations that can
+ * be performed on that data.  The operations can be any bit-wise combination of DND.MOVE, DND.COPY or
+ * DND.LINK.  The type of data that can be transferred is specified by subclasses of Transfer such as
+ * TextTransfer or FileTransfer.  The type of data transferred can be a predefined system type or it
+ * can be a type defined by the application.  For instructions on how to define your own transfer type,
+ * refer to <code>ByteArrayTransfer</code>.</p>
+ *
+ * <p>You may have several DragSources in an application but you can only have one DragSource
+ * per Control.  Data dragged from this DragSource can be dropped on a site within this application
+ * or it can be dropped on another application such as an external Text editor.</p>
+ *
+ * <p>The application supplies the content of the data being transferred by implementing the
+ * <code>DragSourceListener</code> and associating it with the DragSource via DragSource#addDragListener.</p>
+ *
+ * <p>When a successful move operation occurs, the application is required to take the appropriate
+ * action to remove the data from its display and remove any associated operating system resources or
+ * internal references.  Typically in a move operation, the drop target makes a copy of the data
+ * and the drag source deletes the original.  However, sometimes copying the data can take a long
+ * time (such as copying a large file).  Therefore, on some platforms, the drop target may actually
+ * move the data in the operating system rather than make a copy.  This is usually only done in
+ * file transfers.  In this case, the drag source is informed in the DragEnd event that a
+ * DROP_TARGET_MOVE was performed.  It is the responsibility of the drag source at this point to clean
+ * up its displayed information.  No action needs to be taken on the operating system resources.</p>
+ *
+ * <p> The following example shows a Label widget that allows text to be dragged from it.</p>
+ *
+ * <code><pre>
+ *  // Enable a label as a Drag Source
+ *  Label label = new Label(shell, SWT.NONE);
+ *  // This example will allow text to be dragged
+ *  Transfer[] types = new Transfer[] {TextTransfer.getInstance()};
+ *  // This example will allow the text to be copied or moved to the drop target
+ *  int operations = DND.DROP_MOVE | DND.DROP_COPY;
+ *
+ *  DragSource source = new DragSource(label, operations);
+ *  source.setTransfer(types);
+ *  source.addDragListener(new DragSourceListener() {
+ *      public void dragStart(DragSourceEvent e) {
+ *          // Only start the drag if there is actually text in the
+ *          // label - this text will be what is dropped on the target.
+ *          if (label.getText().length() is 0) {
+ *              event.doit = false;
+ *          }
+ *      };
+ *      public void dragSetData(DragSourceEvent event) {
+ *          // A drop has been performed, so provide the data of the
+ *          // requested type.
+ *          // (Checking the type of the requested data is only
+ *          // necessary if the drag source supports more than
+ *          // one data type but is shown here as an example).
+ *          if (TextTransfer.getInstance().isSupportedType(event.dataType)){
+ *              event.data = label.getText();
+ *          }
+ *      }
+ *      public void dragFinished(DragSourceEvent event) {
+ *          // A Move operation has been performed so remove the data
+ *          // from the source
+ *          if (event.detail is DND.DROP_MOVE)
+ *              label.setText("");
+ *      }
+ *  });
+ * </pre></code>
+ *
+ *
+ * <dl>
+ *  <dt><b>Styles</b></dt> <dd>DND.DROP_NONE, DND.DROP_COPY, DND.DROP_MOVE, DND.DROP_LINK</dd>
+ *  <dt><b>Events</b></dt> <dd>DND.DragStart, DND.DragSetData, DND.DragEnd</dd>
+ * </dl>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#dnd">Drag and Drop snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: DNDExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class DragSource : Widget {
+
+    // info for registering as a drag source
+    Control control;
+    Listener controlListener;
+    Transfer[] transferAgents;
+    DragSourceEffect dragEffect;
+
+    void* targetList;
+
+    //workaround - remember action performed for DragEnd
+    bool moveData = false;
+
+    static const String DEFAULT_DRAG_SOURCE_EFFECT = "DEFAULT_DRAG_SOURCE_EFFECT"; //$NON-NLS-1$
+
+//     static Callback DragGetData;
+//     static Callback DragEnd;
+//     static Callback DragDataDelete;
+//     static this() {
+//         DragGetData = new Callback(DragSource.class, "DragGetData", 5);  //$NON-NLS-1$
+//         if (DragGetData.getAddress() is 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS);
+//         DragEnd = new Callback(DragSource.class, "DragEnd", 2); //$NON-NLS-1$
+//         if (DragEnd.getAddress() is 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS);
+//         DragDataDelete = new Callback(DragSource.class, "DragDataDelete", 2); //$NON-NLS-1$
+//         if (DragDataDelete.getAddress() is 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS);
+//     }
+
+/**
+ * Creates a new <code>DragSource</code> to handle dragging from the specified <code>Control</code>.
+ * Creating an instance of a DragSource may cause system resources to be allocated depending on the platform.
+ * It is therefore mandatory that the DragSource instance be disposed when no longer required.
+ *
+ * @param control the <code>Control</code> that the user clicks on to initiate the drag
+ * @param style the bitwise OR'ing of allowed operations; this may be a combination of any of
+ *                  DND.DROP_NONE, DND.DROP_COPY, DND.DROP_MOVE, DND.DROP_LINK
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_CANNOT_INIT_DRAG - unable to initiate drag source; this will occur if more than one
+ *        drag source is created for a control or if the operating system will not allow the creation
+ *        of the drag source</li>
+ * </ul>
+ *
+ * <p>NOTE: ERROR_CANNOT_INIT_DRAG should be an SWTException, since it is a
+ * recoverable error, but can not be changed due to backward compatibility.</p>
+ *
+ * @see Widget#dispose
+ * @see DragSource#checkSubclass
+ * @see DND#DROP_NONE
+ * @see DND#DROP_COPY
+ * @see DND#DROP_MOVE
+ * @see DND#DROP_LINK
+ */
+public this(Control control, int style) {
+    super (control, checkStyle(style));
+    this.control = control;
+//     if (DragGetData is null || DragEnd is null || DragDataDelete is null) {
+//         DND.error(DND.ERROR_CANNOT_INIT_DRAG);
+//     }
+    if (control.getData(DND.DRAG_SOURCE_KEY) !is null) {
+        DND.error(DND.ERROR_CANNOT_INIT_DRAG);
+    }
+    control.setData(DND.DRAG_SOURCE_KEY, this);
+
+    OS.g_signal_connect(control.handle, OS.drag_data_get.ptr, cast(GCallback)&DragGetData, null);
+    OS.g_signal_connect(control.handle, OS.drag_end.ptr, cast(GCallback)&DragEnd, null);
+    OS.g_signal_connect(control.handle, OS.drag_data_delete.ptr, cast(GCallback)&DragDataDelete, null);
+
+    controlListener = new class() Listener {
+        public void handleEvent (Event event) {
+            if (event.type is SWT.Dispose) {
+                if (!this.outer.isDisposed()) {
+                    this.outer.dispose();
+                }
+            }
+            if (event.type is SWT.DragDetect) {
+                if (!this.outer.isDisposed()) {
+                    this.outer.drag(event);
+                }
+            }
+        }
+    };
+    control.addListener (SWT.Dispose, controlListener);
+    control.addListener (SWT.DragDetect, controlListener);
+
+    Object effect = control.getData(DEFAULT_DRAG_SOURCE_EFFECT);
+    if ( auto de = cast(DragSourceEffect)effect ) {
+        dragEffect = de;
+    } else if ( auto tree = cast(Tree)control) {
+        dragEffect = new TreeDragSourceEffect(tree);
+    } else if ( auto table = cast(Table)control ) {
+        dragEffect = new TableDragSourceEffect(table);
+    }
+
+    this.addListener(SWT.Dispose, new class() Listener {
+        public void handleEvent(Event e) {
+            onDispose();
+        }
+    });
+}
+
+static int checkStyle (int style) {
+    if (style is SWT.NONE) return DND.DROP_MOVE;
+    return style;
+}
+
+private static extern(C) void DragDataDelete(
+    GtkWidget      *widget,
+    GdkDragContext *drag_context,
+    void*           user_data )
+{
+    DragSource source = FindDragSource(widget);
+    if (source is null) return;
+    source.dragDataDelete(widget, drag_context);
+    return;
+}
+
+private static extern(C) void DragEnd (
+    GtkWidget      *widget,
+    GdkDragContext *drag_context,
+    void*           user_data)
+{
+    DragSource source = FindDragSource(widget);
+    if (source is null) return;
+    source.dragEnd(widget, drag_context);
+    return;
+}
+
+private static extern(C) void DragGetData(
+    GtkWidget        *widget,
+    GdkDragContext   *context,
+    GtkSelectionData *selection_data,
+    uint              info,
+    uint              time,
+    void*             user_data )
+{
+    DragSource source = FindDragSource(widget);
+    if (source is null) return;
+    source.dragGetData(widget, context, selection_data, cast(int)/*64*/info, cast(int)/*64*/time);
+    return;
+}
+
+static DragSource FindDragSource(GtkWidget* handle) {
+    Display display = Display.findDisplay(Thread.getThis());
+    if (display is null || display.isDisposed()) return null;
+    Widget widget = display.findWidget(handle);
+    if (widget is null) return null;
+    return cast(DragSource)widget.getData(DND.DRAG_SOURCE_KEY);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when a drag and drop operation is in progress, by sending
+ * it one of the messages defined in the <code>DragSourceListener</code>
+ * interface.
+ *
+ * <p><ul>
+ * <li><code>dragStart</code> is called when the user has begun the actions required to drag the widget.
+ * This event gives the application the chance to decide if a drag should be started.
+ * <li><code>dragSetData</code> is called when the data is required from the drag source.
+ * <li><code>dragFinished</code> is called when the drop has successfully completed (mouse up
+ * over a valid target) or has been terminated (such as hitting the ESC key). Perform cleanup
+ * such as removing data from the source side on a successful move operation.
+ * </ul></p>
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see DragSourceListener
+ * @see #getDragListeners
+ * @see #removeDragListener
+ * @see DragSourceEvent
+ */
+public void addDragListener(DragSourceListener listener) {
+    if (listener is null) DND.error (SWT.ERROR_NULL_ARGUMENT);
+    DNDListener typedListener = new DNDListener (listener);
+    typedListener.dndWidget = this;
+    addListener (DND.DragStart, typedListener);
+    addListener (DND.DragSetData, typedListener);
+    addListener (DND.DragEnd, typedListener);
+}
+
+protected override void checkSubclass () {
+    String name = this.classinfo.name;
+    String validName = DragSource.classinfo.name;
+    if ( validName !=/*eq*/ name ) {
+        DND.error (SWT.ERROR_INVALID_SUBCLASS);
+    }
+}
+
+void drag(Event dragEvent) {
+    moveData = false;
+    DNDEvent event = new DNDEvent();
+    event.widget = this;
+    event.x = dragEvent.x;
+    event.y = dragEvent.y;
+    event.time = dragEvent.time;
+    event.doit = true;
+    notifyListeners(DND.DragStart, event);
+    if (!event.doit || transferAgents is null || transferAgents.length is 0) return;
+    if (targetList is null) return;
+
+    int actions = opToOsOp(getStyle());
+    Image image = event.image;
+    auto context = OS.gtk_drag_begin(control.handle, targetList, actions, 1, null);
+    if (context !is null && image !is null) {
+        auto pixbuf = createPixbuf(image);
+        OS.gtk_drag_set_icon_pixbuf(context, pixbuf, 0, 0);
+        OS.g_object_unref(pixbuf);
+    }
+}
+
+void dragEnd(
+    GtkWidget      *widget,
+    GdkDragContext *context )
+{
+    /*
+     * Bug in GTK.  If a drag is initiated using gtk_drag_begin and the
+     * mouse is released immediately, the mouse and keyboard remain
+     * grabbed.  The fix is to release the grab on the mouse and keyboard
+     * whenever the drag is terminated.
+     *
+     * NOTE: We believe that it is never an error to ungrab when
+     * a drag is finished.
+     */
+    OS.gdk_pointer_ungrab(OS.GDK_CURRENT_TIME);
+    OS.gdk_keyboard_ungrab(OS.GDK_CURRENT_TIME);
+
+    int operation = DND.DROP_NONE;
+    if (context !is null) {
+        GdkDragContext* gdkDragContext = context;
+        if (gdkDragContext.dest_window !is null) { //NOTE: if dest_window is 0, drag was aborted
+            if (moveData) {
+                operation = DND.DROP_MOVE;
+            } else {
+                operation = osOpToOp(gdkDragContext.action);
+                if (operation is DND.DROP_MOVE) operation = DND.DROP_NONE;
+            }
+        }
+    }
+
+    DNDEvent event = new DNDEvent();
+    event.widget = this;
+    //event.time = ???
+    event.doit = operation !is 0;
+    event.detail = operation;
+    notifyListeners(DND.DragEnd, event);
+    moveData = false;
+}
+
+void dragGetData(
+    GtkWidget        *widget,
+    GdkDragContext   *context,
+    GtkSelectionData *gtkSelectionData,
+    uint              info,
+    uint              time )
+{
+    if (gtkSelectionData is null) return;
+    if (gtkSelectionData.target is null) return;
+
+    TransferData transferData = new TransferData();
+    transferData.type = gtkSelectionData.target;
+    transferData.pValue = gtkSelectionData.data;
+    transferData.length = gtkSelectionData.length;
+    transferData.format = gtkSelectionData.format;
+
+    DNDEvent event = new DNDEvent();
+    event.widget = this;
+    event.time = time;
+    event.dataType = transferData;
+    notifyListeners(DND.DragSetData, event);
+
+    Transfer transfer = null;
+    for (int i = 0; i < transferAgents.length; i++) {
+        Transfer transferAgent = transferAgents[i];
+        if (transferAgent !is null && transferAgent.isSupportedType(transferData)) {
+            transfer = transferAgent;
+            break;
+        }
+    }
+    if (transfer is null) return;
+    transfer.javaToNative(event.data, transferData);
+    if (transferData.result !is 1) return;
+    OS.gtk_selection_data_set(gtkSelectionData, transferData.type, transferData.format, transferData.pValue, transferData.length);
+    OS.g_free(transferData.pValue);
+    return;
+}
+
+void dragDataDelete(
+    GtkWidget      *widget,
+    GdkDragContext *drag_context)
+{
+    moveData = true;
+}
+
+/**
+ * Returns the Control which is registered for this DragSource.  This is the control that the
+ * user clicks in to initiate dragging.
+ *
+ * @return the Control which is registered for this DragSource
+ */
+public Control getControl () {
+    return control;
+}
+
+/**
+ * Returns an array of listeners who will be notified when a drag and drop
+ * operation is in progress, by sending it one of the messages defined in
+ * the <code>DragSourceListener</code> interface.
+ *
+ * @return the listeners who will be notified when a drag and drop
+ * operation is in progress
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see DragSourceListener
+ * @see #addDragListener
+ * @see #removeDragListener
+ * @see DragSourceEvent
+ *
+ * @since 3.4
+ */
+public DragSourceListener[] getDragListeners() {
+    Listener[] listeners = getListeners(DND.DragStart);
+    int length = listeners.length;
+    DragSourceListener[] dragListeners = new DragSourceListener[length];
+    int count = 0;
+    for (int i = 0; i < length; i++) {
+        Listener listener = listeners[i];
+        if ( auto l = cast(DNDListener)listener ) {
+            dragListeners[count] = cast(DragSourceListener) (l.getEventListener());
+            count++;
+        }
+    }
+    if (count is length) return dragListeners;
+    DragSourceListener[] result = new DragSourceListener[count];
+    SimpleType!(DragSourceListener).arraycopy(dragListeners, 0, result, 0, count);
+    return result;
+}
+
+/**
+ * Returns the drag effect that is registered for this DragSource.  This drag
+ * effect will be used during a drag and drop operation.
+ *
+ * @return the drag effect that is registered for this DragSource
+ *
+ * @since 3.3
+ */
+public DragSourceEffect getDragSourceEffect() {
+    return dragEffect;
+}
+
+/**
+ * Returns the list of data types that can be transferred by this DragSource.
+ *
+ * @return the list of data types that can be transferred by this DragSource
+ */
+public Transfer[] getTransfer(){
+    return transferAgents;
+}
+
+void onDispose() {
+    if (control is null) return;
+    if (targetList !is null) {
+        OS.gtk_target_list_unref(targetList);
+    }
+    targetList = null;
+    if (controlListener !is null) {
+        control.removeListener(SWT.Dispose, controlListener);
+        control.removeListener(SWT.DragDetect, controlListener);
+    }
+    controlListener = null;
+    control.setData(DND.DRAG_SOURCE_KEY, null);
+    control = null;
+    transferAgents = null;
+}
+
+int opToOsOp(int operation){
+    int osOperation = 0;
+
+    if ((operation & DND.DROP_COPY) is DND.DROP_COPY)
+        osOperation |= OS.GDK_ACTION_COPY;
+    if ((operation & DND.DROP_MOVE) is DND.DROP_MOVE)
+        osOperation |= OS.GDK_ACTION_MOVE;
+    if ((operation & DND.DROP_LINK) is DND.DROP_LINK)
+        osOperation |= OS.GDK_ACTION_LINK;
+
+    return osOperation;
+}
+
+int osOpToOp(int osOperation){
+    int operation = DND.DROP_NONE;
+
+    if ((osOperation & OS.GDK_ACTION_COPY) is OS.GDK_ACTION_COPY)
+        operation |= DND.DROP_COPY;
+    if ((osOperation & OS.GDK_ACTION_MOVE) is OS.GDK_ACTION_MOVE)
+        operation |= DND.DROP_MOVE;
+    if ((osOperation & OS.GDK_ACTION_LINK) is OS.GDK_ACTION_LINK)
+        operation |= DND.DROP_LINK;
+
+    return operation;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when a drag and drop operation is in progress.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see DragSourceListener
+ * @see #addDragListener
+ * @see #getDragListeners
+ */
+public void removeDragListener(DragSourceListener listener) {
+    if (listener is null) DND.error (SWT.ERROR_NULL_ARGUMENT);
+    removeListener (DND.DragStart, listener);
+    removeListener (DND.DragSetData, listener);
+    removeListener (DND.DragEnd, listener);
+}
+
+/**
+ * Specifies the drag effect for this DragSource.  This drag effect will be
+ * used during a drag and drop operation.
+ *
+ * @param effect the drag effect that is registered for this DragSource
+ *
+ * @since 3.3
+ */
+public void setDragSourceEffect(DragSourceEffect effect) {
+    dragEffect = effect;
+}
+
+/**
+ * Specifies the list of data types that can be transferred by this DragSource.
+ * The application must be able to provide data to match each of these types when
+ * a successful drop has occurred.
+ *
+ * @param transferAgents a list of Transfer objects which define the types of data that can be
+ * dragged from this source
+ */
+public void setTransfer(Transfer[] transferAgents){
+    if (targetList !is null) {
+        OS.gtk_target_list_unref(targetList);
+        targetList = null;
+    }
+    this.transferAgents = transferAgents;
+    if (transferAgents is null || transferAgents.length is 0) return;
+
+    GtkTargetEntry*[] targets;
+    for (int i = 0; i < transferAgents.length; i++) {
+        Transfer transfer = transferAgents[i];
+        if (transfer !is null) {
+            int[] typeIds = transfer.getTypeIds();
+            String[] typeNames = transfer.getTypeNames();
+            for (int j = 0; j < typeIds.length; j++) {
+                GtkTargetEntry* entry = new GtkTargetEntry();
+                String type = typeNames[j];
+                entry.target = cast(char*)OS.g_malloc(type.length+1);
+                entry.target[ 0 .. type.length ] = type[];
+                entry.target[ type.length ] = '\0';
+                entry.info = typeIds[j];
+                GtkTargetEntry*[] newTargets = new GtkTargetEntry*[targets.length + 1];
+                SimpleType!(GtkTargetEntry*).arraycopy(targets, 0, newTargets, 0, targets.length);
+                newTargets[targets.length] = entry;
+                targets = newTargets;
+            }
+        }
+    }
+
+    void* pTargets = OS.g_malloc(targets.length * GtkTargetEntry.sizeof);
+    for (int i = 0; i < targets.length; i++) {
+        tango.stdc.string.memmove(pTargets + i*GtkTargetEntry.sizeof, targets[i], GtkTargetEntry.sizeof);
+    }
+    targetList = OS.gtk_target_list_new(pTargets, targets.length);
+
+    for (int i = 0; i < targets.length; i++) {
+        OS.g_free(targets[i].target);
+    }
+}
+
+static GdkDrawable* createPixbuf(Image image) {
+    int w, h;
+    OS.gdk_drawable_get_size (image.pixmap, &w, &h);
+    auto colormap = OS.gdk_colormap_get_system ();
+    void* pixbuf;
+    bool hasMask = image.mask !is null && OS.gdk_drawable_get_depth (image.mask) is 1;
+    if (hasMask) {
+        pixbuf = OS.gdk_pixbuf_new (OS.GDK_COLORSPACE_RGB, true, 8, w, h);
+        if (pixbuf is null) SWT.error (SWT.ERROR_NO_HANDLES);
+        OS.gdk_pixbuf_get_from_drawable (pixbuf, image.pixmap, colormap, 0, 0, 0, 0, w , h);
+        auto maskPixbuf = OS.gdk_pixbuf_new(OS.GDK_COLORSPACE_RGB, false, 8, w , h );
+        if (maskPixbuf is null) SWT.error (SWT.ERROR_NO_HANDLES);
+        OS.gdk_pixbuf_get_from_drawable(maskPixbuf, image.mask, null, 0, 0, 0, 0, w , h );
+        int stride = OS.gdk_pixbuf_get_rowstride(pixbuf);
+        auto pixels = OS.gdk_pixbuf_get_pixels(pixbuf);
+        byte[] line = new byte[stride];
+        int maskStride = OS.gdk_pixbuf_get_rowstride(maskPixbuf);
+        auto maskPixels = OS.gdk_pixbuf_get_pixels(maskPixbuf);
+        byte[] maskLine = new byte[maskStride];
+        for (int y=0; y<h; y++) {
+            auto offset = pixels + (y * stride);
+            tango.stdc.string.memmove(line.ptr, offset, stride);
+            auto maskOffset = maskPixels + (y * maskStride);
+            tango.stdc.string.memmove(maskLine.ptr, maskOffset, maskStride);
+            for (int x=0; x<w; x++) {
+                if (maskLine[x * 3] is 0) {
+                    line[x * 4 + 3] = 0;
+                }
+            }
+            tango.stdc.string.memmove(offset, line.ptr, stride);
+        }
+        OS.g_object_unref(maskPixbuf);
+    } else {
+        ImageData data = image.getImageData ();
+        bool hasAlpha = data.getTransparencyType () is SWT.TRANSPARENCY_ALPHA;
+        pixbuf = OS.gdk_pixbuf_new (OS.GDK_COLORSPACE_RGB, hasAlpha, 8, w , h );
+        if (pixbuf is null) SWT.error (SWT.ERROR_NO_HANDLES);
+        OS.gdk_pixbuf_get_from_drawable (pixbuf, image.pixmap, colormap, 0, 0, 0, 0, w , h );
+        if (hasAlpha) {
+            byte [] alpha = data.alphaData;
+            int stride = OS.gdk_pixbuf_get_rowstride (pixbuf);
+            auto pixels = OS.gdk_pixbuf_get_pixels (pixbuf);
+            byte [] line = new byte [stride];
+            for (int y = 0; y < h ; y++) {
+                auto offset = pixels + (y * stride);
+                tango.stdc.string.memmove (line.ptr, offset, stride);
+                for (int x = 0; x < w ; x++) {
+                    line [x*4+3] = alpha [y*w +x];
+                }
+                tango.stdc.string.memmove (offset, line.ptr, stride);
+            }
+        }
+    }
+    return cast(GdkDrawable*)pixbuf;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/DragSourceAdapter.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.dnd.DragSourceAdapter;
+
+import java.lang.all;
+
+import org.eclipse.swt.dnd.DragSourceListener;
+import org.eclipse.swt.dnd.DragSourceEvent;
+
+/**
+ * This adapter class provides default implementations for the
+ * methods described by the <code>DragSourceListener</code> interface.
+ *
+ * <p>Classes that wish to deal with <code>DragSourceEvent</code>s can
+ * extend this class and override only the methods which they are
+ * interested in.</p>
+ *
+ * @see DragSourceListener
+ * @see DragSourceEvent
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class DragSourceAdapter : DragSourceListener {
+
+/**
+ * This implementation of <code>dragStart</code> permits the drag operation to start.
+ * For additional information see <code>DragSourceListener.dragStart</code>.
+ * 
+ * @param event the information associated with the drag start event
+ */
+public void dragStart(DragSourceEvent event){}
+
+/**
+ * This implementation of <code>dragFinished</code> does nothing.
+ * For additional information see <code>DragSourceListener.dragFinished</code>.
+ * 
+ * @param event the information associated with the drag finished event
+ */
+public void dragFinished(DragSourceEvent event){}
+
+/**
+ * This implementation of <code>dragSetData</code> does nothing.
+ * For additional information see <code>DragSourceListener.dragSetData</code>.
+ * 
+ * @param event the information associated with the drag set data event
+ */
+public void dragSetData(DragSourceEvent event){}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/DragSourceEffect.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.dnd.DragSourceEffect;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.dnd.DragSourceAdapter;
+
+/**
+ * This class provides default implementations to display a drag source
+ * effect during a drag and drop operation. The current implementation
+ * does not provide any visual feedback.
+ *
+ * <p>The drag source effect has the same API as the
+ * <code>DragSourceAdapter</code> so that it can provide custom visual
+ * feedback when a <code>DragSourceEvent</code> occurs.
+ * </p>
+ *
+ * <p>Classes that wish to provide their own drag source effect such as
+ * displaying a default source image during a drag can extend the <code>DragSourceEffect</code>
+ * class, override the <code>DragSourceAdapter.dragStart</code> method and set
+ * the field <code>DragSourceEvent.image</code> with their own image.
+ * The image should be disposed when <code>DragSourceAdapter.dragFinished</code> is called.
+ * </p>
+ *
+ * @see DragSourceAdapter
+ * @see DragSourceEvent
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.3
+ */
+public class DragSourceEffect : DragSourceAdapter {
+    Control control = null;
+
+    /**
+     * Creates a new <code>DragSourceEffect</code> to handle drag effect from the specified <code>Control</code>.
+     *
+     * @param control the <code>Control</code> that the user clicks on to initiate the drag
+     *
+     * @exception IllegalArgumentException <ul>
+     *    <li>ERROR_NULL_ARGUMENT - if the control is null</li>
+     * </ul>
+     */
+    public this(Control control) {
+        if (control is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+        this.control = control;
+    }
+
+    /**
+     * Returns the Control which is registered for this DragSourceEffect.  This is the control that the
+     * user clicks in to initiate dragging.
+     *
+     * @return the Control which is registered for this DragSourceEffect
+     */
+    public Control getControl() {
+        return control;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/DragSourceEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,114 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.dnd.DragSourceEvent;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.events.TypedEvent;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.dnd.TransferData;
+import org.eclipse.swt.dnd.DNDEvent;
+
+/**
+ * The DragSourceEvent contains the event information passed in the methods of the DragSourceListener.
+ *
+ * @see DragSourceListener
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class DragSourceEvent : TypedEvent {
+    /**
+     * The operation that was performed.
+     * @see DND#DROP_NONE
+     * @see DND#DROP_MOVE
+     * @see DND#DROP_COPY
+     * @see DND#DROP_LINK
+     * @see DND#DROP_TARGET_MOVE
+     */
+    public int detail;
+
+    /**
+     * In dragStart, the doit field determines if the drag and drop operation
+     * should proceed; in dragFinished, the doit field indicates whether
+     * the operation was performed successfully.
+     * <p></p>
+     * In dragStart:
+     * <p>Flag to determine if the drag and drop operation should proceed.
+     * The application can set this value to false to prevent the drag from starting.
+     * Set to true by default.</p>
+     *
+     * <p>In dragFinished:</p>
+     * <p>Flag to indicate if the operation was performed successfully.
+     * True if the operation was performed successfully.</p>
+     */
+    public bool doit;
+
+    /**
+     * In dragStart, the x coordinate (relative to the control) of the
+     * position the mouse went down to start the drag.
+     * @since 3.2
+     */
+    public int x;
+    /**
+     * In dragStart, the y coordinate (relative to the control) of the
+     * position the mouse went down to start the drag .
+     * @since 3.2
+     */
+    public int y;
+
+    /**
+     * The type of data requested.
+     * Data provided in the data field must be of the same type.
+     */
+    public TransferData dataType;
+
+    /**
+     * The drag source image to be displayed during the drag.
+     * <p>A value of null indicates that no drag image will be displayed.</p>
+     * <p>The default value is null.</p>
+     *
+     * @since 3.3
+     */
+    public Image image;
+
+    static const long serialVersionUID = 3257002142513770808L;
+
+/**
+ * Constructs a new instance of this class based on the
+ * information in the given untyped event.
+ *
+ * @param e the untyped event containing the information
+ */
+public this(DNDEvent e) {
+    super( cast(Event) e );
+    this.data = e.data;
+    this.detail = e.detail;
+    this.doit = e.doit;
+    this.dataType = e.dataType;
+    this.x = e.x;
+    this.y = e.y;
+    this.image = e.image;
+}
+void updateEvent(DNDEvent e) {
+    e.widget = this.widget;
+    e.time = this.time;
+    e.data = this.data;
+    e.detail = this.detail;
+    e.doit = this.doit;
+    e.dataType = this.dataType;
+    e.x = this.x;
+    e.y = this.y;
+    e.image = this.image;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/DragSourceListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.dnd.DragSourceListener;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.SWTEventListener;
+import org.eclipse.swt.dnd.DragSourceEvent;
+
+/**
+ * The <code>DragSourceListener</code> class provides event notification to the application for DragSource events.
+ *
+ * <p>When the user drops data on a <code>DropTarget</code>, the application which defines the <code>DragSource</code>
+ * must provide the dropped data by implementing <code>dragSetData</code>.  In the dragSetData, the application
+ * must support all the data types that were specified in the DragSource#setTransfer method.</p>
+ *
+ * <p>After the drop has completed successfully or has been aborted, the application which defines the
+ * <code>DragSource</code> is required to take the appropriate cleanup action.  In the case of a successful
+ * <b>move</b> operation, the application must remove the data that was transferred.</p>
+ *
+ */
+public interface DragSourceListener : SWTEventListener {
+
+/**
+ * The user has begun the actions required to drag the widget. This event gives the application
+ * the chance to decide if a drag should be started.
+ *
+ * <p>The following fields in the DragSourceEvent apply:
+ * <ul>
+ * <li>(in)widget
+ * <li>(in)time
+ * <li>(in,out)doit
+ * </ul></p>
+ *
+ * @param event the information associated with the drag start event
+ *
+ * @see DragSourceEvent
+ */
+public void dragStart(DragSourceEvent event);
+
+/**
+ * The data is required from the drag source.
+ *
+ * <p>The following fields in the DragSourceEvent apply:
+ * <ul>
+ * <li>(in)widget
+ * <li>(in)time
+ * <li>(in)dataType - the type of data requested.
+ * <li>(out)data    - the application inserts the actual data here (must match the dataType)
+ * </ul></p>
+ *
+ * @param event the information associated with the drag set data event
+ *
+ * @see DragSourceEvent
+ */
+public void dragSetData(DragSourceEvent event);
+
+/**
+ * The drop has successfully completed(mouse up over a valid target) or has been terminated (such as hitting
+ * the ESC key). Perform cleanup such as removing data from the source side on a successful move operation.
+ *
+ * <p>The following fields in the DragSourceEvent apply:
+ * <ul>
+ * <li>(in)widget
+ * <li>(in)time
+ * <li>(in)doit
+ * <li>(in)detail
+ * </ul></p>
+ *
+ * @param event the information associated with the drag finished event
+ *
+ * @see DragSourceEvent
+ */
+public void dragFinished(DragSourceEvent event);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/DropTarget.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,875 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.dnd.DropTarget;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.dnd.DropTargetEffect;
+import org.eclipse.swt.dnd.DNDEvent;
+import org.eclipse.swt.dnd.DNDListener;
+import org.eclipse.swt.dnd.TransferData;
+import org.eclipse.swt.dnd.DropTargetListener;
+import org.eclipse.swt.dnd.TableDropTargetEffect;
+import org.eclipse.swt.dnd.TreeDropTargetEffect;
+import java.lang.all;
+
+import tango.core.Thread;
+static import tango.stdc.string;
+
+/**
+ *
+ * Class <code>DropTarget</code> defines the target object for a drag and drop transfer.
+ *
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ *
+ * <p>This class identifies the <code>Control</code> over which the user must position the cursor
+ * in order to drop the data being transferred.  It also specifies what data types can be dropped on
+ * this control and what operations can be performed.  You may have several DropTragets in an
+ * application but there can only be a one to one mapping between a <code>Control</code> and a <code>DropTarget</code>.
+ * The DropTarget can receive data from within the same application or from other applications
+ * (such as text dragged from a text editor like Word).</p>
+ *
+ * <code><pre>
+ *  int operations = DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK;
+ *  Transfer[] types = new Transfer[] {TextTransfer.getInstance()};
+ *  DropTarget target = new DropTarget(label, operations);
+ *  target.setTransfer(types);
+ * </code></pre>
+ *
+ * <p>The application is notified of data being dragged over this control and of when a drop occurs by
+ * implementing the interface <code>DropTargetListener</code> which uses the class
+ * <code>DropTargetEvent</code>.  The application can modify the type of drag being performed
+ * on this Control at any stage of the drag by modifying the <code>event.detail</code> field or the
+ * <code>event.currentDataType</code> field.  When the data is dropped, it is the responsibility of
+ * the application to copy this data for its own purposes.
+ *
+ * <code><pre>
+ *  target.addDropListener (new DropTargetListener() {
+ *      public void dragEnter(DropTargetEvent event) {};
+ *      public void dragOver(DropTargetEvent event) {};
+ *      public void dragLeave(DropTargetEvent event) {};
+ *      public void dragOperationChanged(DropTargetEvent event) {};
+ *      public void dropAccept(DropTargetEvent event) {}
+ *      public void drop(DropTargetEvent event) {
+ *          // A drop has occurred, copy over the data
+ *          if (event.data is null) { // no data to copy, indicate failure in event.detail
+ *              event.detail = DND.DROP_NONE;
+ *              return;
+ *          }
+ *          label.setText ((String) event.data); // data copied to label text
+ *      }
+ *  });
+ * </pre></code>
+ *
+ * <dl>
+ *  <dt><b>Styles</b></dt> <dd>DND.DROP_NONE, DND.DROP_COPY, DND.DROP_MOVE, DND.DROP_LINK</dd>
+ *  <dt><b>Events</b></dt> <dd>DND.DragEnter, DND.DragLeave, DND.DragOver, DND.DragOperationChanged,
+ *                             DND.DropAccept, DND.Drop </dd>
+ * </dl>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#dnd">Drag and Drop snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: DNDExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class DropTarget : Widget {
+
+    Control control;
+    Listener controlListener;
+    Transfer[] transferAgents;
+    DropTargetEffect dropEffect;
+
+    // Track application selections
+    TransferData selectedDataType;
+    int selectedOperation;
+
+    // workaround - There is no event for "operation changed" so track operation based on key state
+    int keyOperation = -1;
+
+    // workaround - Simulate events when the mouse is not moving
+    long dragOverStart;
+    Runnable dragOverHeartbeat;
+    DNDEvent dragOverEvent;
+
+    int drag_motion_handler;
+    int drag_leave_handler;
+    int drag_data_received_handler;
+    int drag_drop_handler;
+
+    static const String DEFAULT_DROP_TARGET_EFFECT = "DEFAULT_DROP_TARGET_EFFECT"; //$NON-NLS-1$
+    static const int DRAGOVER_HYSTERESIS = 50;
+
+//     static Callback Drag_Motion;
+//     static Callback Drag_Leave;
+//     static Callback Drag_Data_Received;
+//     static Callback Drag_Drop;
+//
+//      static this(){
+//         Drag_Motion = new Callback(DropTarget.class, "Drag_Motion", 5); //$NON-NLS-1$
+//         if (Drag_Motion.getAddress() is 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS);
+//         Drag_Leave = new Callback(DropTarget.class, "Drag_Leave", 3); //$NON-NLS-1$
+//         if (Drag_Leave.getAddress() is 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS);
+//         Drag_Data_Received = new Callback(DropTarget.class, "Drag_Data_Received", 7); //$NON-NLS-1$
+//         if (Drag_Data_Received.getAddress() is 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS);
+//         Drag_Drop = new Callback(DropTarget.class, "Drag_Drop", 5); //$NON-NLS-1$
+//         if (Drag_Drop.getAddress() is 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS);
+//     }
+
+/**
+ * Creates a new <code>DropTarget</code> to allow data to be dropped on the specified
+ * <code>Control</code>.
+ * Creating an instance of a DropTarget may cause system resources to be allocated
+ * depending on the platform.  It is therefore mandatory that the DropTarget instance
+ * be disposed when no longer required.
+ *
+ * @param control the <code>Control</code> over which the user positions the cursor to drop the data
+ * @param style the bitwise OR'ing of allowed operations; this may be a combination of any of
+ *         DND.DROP_NONE, DND.DROP_COPY, DND.DROP_MOVE, DND.DROP_LINK
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_CANNOT_INIT_DROP - unable to initiate drop target; this will occur if more than one
+ *        drop target is created for a control or if the operating system will not allow the creation
+ *        of the drop target</li>
+ * </ul>
+ *
+ * <p>NOTE: ERROR_CANNOT_INIT_DROP should be an SWTException, since it is a
+ * recoverable error, but can not be changed due to backward compatibility.</p>
+ *
+ * @see Widget#dispose
+ * @see DropTarget#checkSubclass
+ * @see DND#DROP_NONE
+ * @see DND#DROP_COPY
+ * @see DND#DROP_MOVE
+ * @see DND#DROP_LINK
+ */
+public this(Control control, int style) {
+    super(control, checkStyle(style));
+    this.control = control;
+//     if (Drag_Motion is null || Drag_Leave is null || Drag_Data_Received is null || Drag_Drop is null) {
+//          DND.error(DND.ERROR_CANNOT_INIT_DROP);
+//     }
+    if (control.getData(DND.DROP_TARGET_KEY) !is null) {
+        DND.error(DND.ERROR_CANNOT_INIT_DROP);
+    }
+    control.setData(DND.DROP_TARGET_KEY, this);
+
+    drag_motion_handler = OS.g_signal_connect(control.handle, OS.drag_motion.ptr, cast(GCallback)&Drag_Motion, null);
+    drag_leave_handler = OS.g_signal_connect(control.handle, OS.drag_leave.ptr, cast(GCallback)&Drag_Leave, null);
+    drag_data_received_handler = OS.g_signal_connect(control.handle, OS.drag_data_received.ptr, cast(GCallback)&Drag_Data_Received, null);
+    drag_drop_handler = OS.g_signal_connect(control.handle, OS.drag_drop.ptr, cast(GCallback)&Drag_Drop, null);
+
+    // Dispose listeners
+    controlListener = new class() Listener{
+        public void handleEvent(Event event){
+            if (!this.outer.isDisposed()){
+                this.outer.dispose();
+            }
+        }
+    };
+    control.addListener(SWT.Dispose, controlListener);
+
+    this.addListener(SWT.Dispose, new class() Listener {
+        public void handleEvent(Event event){
+            onDispose();
+        }
+    });
+
+    Object effect = control.getData(DEFAULT_DROP_TARGET_EFFECT);
+    if ( auto de = cast(DropTargetEffect)effect ) {
+        dropEffect = de;
+    } else if ( auto table = cast(Table)control ) {
+        dropEffect = new TableDropTargetEffect(table);
+    } else if ( auto tree = cast(Tree) control ) {
+        dropEffect = new TreeDropTargetEffect(tree);
+    }
+
+    dragOverHeartbeat = new class() Runnable {
+        public void run() {
+            Control control = this.outer.control;
+            if (control is null || control.isDisposed() || dragOverStart is 0) return;
+            long time = System.currentTimeMillis();
+            int delay = DRAGOVER_HYSTERESIS;
+            if (time < dragOverStart) {
+                delay = cast(int)(dragOverStart - time);
+            } else {
+                dragOverEvent.time += DRAGOVER_HYSTERESIS;
+                int allowedOperations = dragOverEvent.operations;
+                TransferData[] allowedTypes = dragOverEvent.dataTypes;
+                //pass a copy of data types in to listeners in case application modifies it
+                TransferData[] dataTypes = new TransferData[allowedTypes.length];
+                System.arraycopy(allowedTypes, 0, dataTypes, 0, dataTypes.length);
+
+                DNDEvent event = new DNDEvent();
+                event.widget = dragOverEvent.widget;
+                event.x = dragOverEvent.x;
+                event.y = dragOverEvent.y;
+                event.time = dragOverEvent.time;
+                event.feedback = DND.FEEDBACK_SELECT;
+                event.dataTypes = dataTypes;
+                event.dataType = selectedDataType;
+                event.operations = dragOverEvent.operations;
+                event.detail  = selectedOperation;
+                if (dropEffect !is null) {
+                    event.item = dropEffect.getItem(dragOverEvent.x, dragOverEvent.y);
+                }
+                selectedDataType = null;
+                selectedOperation = DND.DROP_NONE;
+                notifyListeners(DND.DragOver, event);
+                if (event.dataType !is null) {
+                    for (int i = 0; i < allowedTypes.length; i++) {
+                        if (allowedTypes[i].type is event.dataType.type) {
+                            selectedDataType = event.dataType;
+                            break;
+                        }
+                    }
+                }
+                if (selectedDataType !is null && (event.detail & allowedOperations) !is 0) {
+                    selectedOperation = event.detail;
+                }
+            }
+            control = this.outer.control;
+            if (control is null || control.isDisposed()) return;
+            control.getDisplay().timerExec(delay, dragOverHeartbeat);
+        }
+    };
+}
+
+static int checkStyle (int style) {
+    if (style is SWT.NONE) return DND.DROP_MOVE;
+    return style;
+}
+
+private static extern(C) void Drag_Data_Received (
+    GtkWidget *widget,
+    GdkDragContext *context,
+    int x,
+    int y,
+    GtkSelectionData *data,
+    uint info,
+    uint time,
+    void* user_data)
+{
+    DropTarget target = FindDropTarget(widget);
+    if (target is null) return;
+    target.drag_data_received (widget, context, cast(int)/*64*/x, cast(int)/*64*/y, data, cast(int)/*64*/info, cast(int)/*64*/time);
+}
+
+private static extern(C) int Drag_Drop(
+    GtkWidget *widget,
+    GdkDragContext *context,
+    int x,
+    int y,
+    uint time,
+    void* user_data)
+{
+    DropTarget target = FindDropTarget(widget);
+    if (target is null) return 0;
+    return target.drag_drop (widget, context, cast(int)/*64*/x, cast(int)/*64*/y, cast(int)/*64*/time) ? 1 : 0;
+}
+
+private static extern(C) void Drag_Leave (
+    GtkWidget *widget,
+    GdkDragContext *context,
+    uint time,
+    void* user_data)
+{
+    DropTarget target = FindDropTarget(widget);
+    if (target is null) return;
+    target.drag_leave (widget, context, cast(int)/*64*/time);
+}
+
+private static extern(C) int Drag_Motion (
+    GtkWidget *widget,
+    GdkDragContext *context,
+    int x,
+    int y,
+    uint time,
+    void* user_data)
+{
+    DropTarget target = FindDropTarget(widget);
+    if (target is null) return 0;
+    return target.drag_motion (widget, context, cast(int)/*64*/x, cast(int)/*64*/y, cast(int)/*64*/time) ? 1 : 0;
+}
+
+static DropTarget FindDropTarget(GtkWidget* handle) {
+    Display display = Display.findDisplay(Thread.getThis());
+    if (display is null || display.isDisposed()) return null;
+    Widget widget = display.findWidget(handle);
+    if (widget is null) return null;
+    return cast(DropTarget)widget.getData(DND.DROP_TARGET_KEY);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when a drag and drop operation is in progress, by sending
+ * it one of the messages defined in the <code>DropTargetListener</code>
+ * interface.
+ *
+ * <p><ul>
+ * <li><code>dragEnter</code> is called when the cursor has entered the drop target boundaries
+ * <li><code>dragLeave</code> is called when the cursor has left the drop target boundaries and just before
+ * the drop occurs or is cancelled.
+ * <li><code>dragOperationChanged</code> is called when the operation being performed has changed
+ * (usually due to the user changing the selected modifier key(s) while dragging)
+ * <li><code>dragOver</code> is called when the cursor is moving over the drop target
+ * <li><code>dropAccept</code> is called just before the drop is performed.  The drop target is given
+ * the chance to change the nature of the drop or veto the drop by setting the <code>event.detail</code> field
+ * <li><code>drop</code> is called when the data is being dropped
+ * </ul></p>
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see DropTargetListener
+ * @see #getDropListeners
+ * @see #removeDropListener
+ * @see DropTargetEvent
+ */
+public void addDropListener(DropTargetListener listener) {
+    if (listener is null) DND.error (SWT.ERROR_NULL_ARGUMENT);
+    DNDListener typedListener = new DNDListener (listener);
+    typedListener.dndWidget = this;
+    addListener (DND.DragEnter, typedListener);
+    addListener (DND.DragLeave, typedListener);
+    addListener (DND.DragOver, typedListener);
+    addListener (DND.DragOperationChanged, typedListener);
+    addListener (DND.Drop, typedListener);
+    addListener (DND.DropAccept, typedListener);
+}
+
+protected override void checkSubclass () {
+    String name = this.classinfo.name;
+    String validName = DropTarget.classinfo.name;
+    if ( validName !=/*eq*/ name ) {
+        DND.error (SWT.ERROR_INVALID_SUBCLASS);
+    }
+}
+
+void drag_data_received (
+    GtkWidget *widget,
+    GdkDragContext *context,
+    int x,
+    int y,
+    GtkSelectionData *data,
+    uint info,
+    uint time )
+{
+    DNDEvent event = new DNDEvent();
+    if (data is null || !setEventData(context, x, y, time, event)) {
+        keyOperation = -1;
+        return;
+    }
+    keyOperation = -1;
+
+    int allowedOperations = event.operations;
+
+    // Get data in a Java format
+    Object object = null;
+    TransferData transferData = new TransferData();
+    if (data.data !is null) {
+        transferData.type = data.type;
+        transferData.length = data.length;
+        transferData.pValue = data.data;
+        transferData.format = data.format;
+        for (int i = 0; i < transferAgents.length; i++) {
+            Transfer transfer = transferAgents[i];
+            if (transfer !is null && transfer.isSupportedType(transferData)) {
+                object = transfer.nativeToJava(transferData);
+                break;
+            }
+        }
+    }
+    if (object is null) {
+        selectedOperation = DND.DROP_NONE;
+    }
+
+    event.detail = selectedOperation;
+    event.dataType = transferData;
+    event.data = object;
+    selectedOperation = DND.DROP_NONE;
+    notifyListeners(DND.Drop, event);
+    if ((allowedOperations & event.detail) is event.detail) {
+        selectedOperation = event.detail;
+    }
+    //stop native handler
+    OS.g_signal_stop_emission_by_name(widget, OS.drag_data_received.ptr);
+
+    //notify source of action taken
+    OS.gtk_drag_finish(context, selectedOperation !is DND.DROP_NONE, selectedOperation is DND.DROP_MOVE, time);
+    return;
+}
+
+bool drag_drop(
+    GtkWidget *widget,
+    GdkDragContext *context,
+    int x,
+    int y,
+    uint time)
+{
+    DNDEvent event = new DNDEvent();
+    if (!setEventData(context, x, y, time, event)) {
+        keyOperation = -1;
+        return false;
+    }
+    keyOperation = -1;
+
+    int allowedOperations = event.operations;
+    TransferData[] allowedDataTypes = new TransferData[event.dataTypes.length];
+    System.arraycopy(event.dataTypes, 0, allowedDataTypes, 0, allowedDataTypes.length);
+
+    event.dataType = selectedDataType;
+    event.detail = selectedOperation;
+    selectedDataType = null;
+    selectedOperation = DND.DROP_NONE;
+    notifyListeners(DND.DropAccept,event);
+    if (event.dataType !is null) {
+        for (int i = 0; i < allowedDataTypes.length; i++) {
+            if (allowedDataTypes[i].type is event.dataType.type) {
+                selectedDataType = allowedDataTypes[i];
+                break;
+            }
+        }
+    }
+    if (selectedDataType !is null && ((event.detail & allowedOperations) is event.detail)) {
+        selectedOperation = event.detail;
+    }
+    if (selectedOperation is DND.DROP_NONE) {
+        // this was not a successful drop
+        return false;
+    }
+    // ask drag source for dropped data
+    OS.gtk_drag_get_data(widget, context, selectedDataType.type, time);
+    return true;
+}
+
+void drag_leave(
+    GtkWidget *widget,
+    GdkDragContext *context,
+    uint time )
+{
+    updateDragOverHover(0, null);
+
+    if (keyOperation is -1) return;
+    keyOperation = -1;
+
+    DNDEvent event = new DNDEvent();
+    event.widget = this;
+    event.time = time;
+    event.detail = DND.DROP_NONE;
+    notifyListeners(DND.DragLeave, event);
+}
+
+bool drag_motion (
+    GtkWidget *widget,
+    GdkDragContext *context,
+    int x,
+    int y,
+    uint time)
+{
+    int oldKeyOperation = keyOperation;
+
+    if (oldKeyOperation is -1) { //drag enter
+        selectedDataType = null;
+        selectedOperation = DND.DROP_NONE;
+    }
+
+    DNDEvent event = new DNDEvent();
+    if (!setEventData(context, x, y, time, event)) {
+        keyOperation = -1;
+        OS.gdk_drag_status(context, 0, time);
+        return false;
+    }
+
+    int allowedOperations = event.operations;
+    TransferData[] allowedDataTypes = new TransferData[event.dataTypes.length];
+    System.arraycopy(event.dataTypes, 0, allowedDataTypes, 0, allowedDataTypes.length);
+
+    if (oldKeyOperation is -1) {
+        event.type = DND.DragEnter;
+    } else {
+        if (keyOperation is oldKeyOperation) {
+            event.type = DND.DragOver;
+            event.dataType = selectedDataType;
+            event.detail = selectedOperation;
+        } else {
+            event.type = DND.DragOperationChanged;
+            event.dataType = selectedDataType;
+        }
+    }
+    updateDragOverHover(DRAGOVER_HYSTERESIS, event);
+    selectedDataType = null;
+    selectedOperation = DND.DROP_NONE;
+    notifyListeners(event.type, event);
+    if (event.detail is DND.DROP_DEFAULT) {
+        event.detail = (allowedOperations & DND.DROP_MOVE) !is 0 ? DND.DROP_MOVE : DND.DROP_NONE;
+    }
+    if (event.dataType !is null) {
+        for (int i = 0; i < allowedDataTypes.length; i++) {
+            if (allowedDataTypes[i].type is event.dataType.type) {
+                selectedDataType = allowedDataTypes[i];
+                break;
+            }
+        }
+    }
+    if (selectedDataType !is null && (allowedOperations & event.detail) !is 0) {
+        selectedOperation = event.detail;
+    }
+
+    switch (selectedOperation) {
+        case DND.DROP_NONE:
+            OS.gdk_drag_status(context, 0, time);
+            break;
+        case DND.DROP_COPY:
+            OS.gdk_drag_status(context, OS.GDK_ACTION_COPY, time);
+            break;
+        case DND.DROP_MOVE:
+            OS.gdk_drag_status(context, OS.GDK_ACTION_MOVE, time);
+            break;
+        case DND.DROP_LINK:
+            OS.gdk_drag_status(context, OS.GDK_ACTION_LINK, time);
+            break;
+        default:
+    }
+
+    if (oldKeyOperation is -1) {
+        dragOverHeartbeat.run();
+    }
+    return true;
+}
+
+/**
+ * Returns the Control which is registered for this DropTarget.  This is the control over which the
+ * user positions the cursor to drop the data.
+ *
+ * @return the Control which is registered for this DropTarget
+ */
+public Control getControl () {
+    return control;
+}
+
+/**
+ * Returns an array of listeners who will be notified when a drag and drop
+ * operation is in progress, by sending it one of the messages defined in
+ * the <code>DropTargetListener</code> interface.
+ *
+ * @return the listeners who will be notified when a drag and drop 
+ * operation is in progress
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see DropTargetListener
+ * @see #addDropListener
+ * @see #removeDropListener
+ * @see DropTargetEvent
+ *
+ * @since 3.4
+ */
+public DropTargetListener[] getDropListeners() {
+    Listener[] listeners = getListeners(DND.DragEnter);
+    int length = listeners.length;
+    DropTargetListener[] dropListeners = new DropTargetListener[length];
+    int count = 0;
+    for (int i = 0; i < length; i++) {
+        Listener listener = listeners[i];
+        if ( auto l = cast(DNDListener)listener ) {
+            dropListeners[count] = cast(DropTargetListener) (l.getEventListener());
+            count++;
+        }
+    }
+    if (count is length) return dropListeners;
+    DropTargetListener[] result = new DropTargetListener[count];
+    SimpleType!(DropTargetListener).arraycopy(dropListeners, 0, result, 0, count);
+    return result;
+}
+
+/**
+ * Returns the drop effect for this DropTarget.  This drop effect will be
+ * used during a drag and drop to display the drag under effect on the
+ * target widget.
+ *
+ * @return the drop effect that is registered for this DropTarget
+ *
+ * @since 3.3
+ */
+public DropTargetEffect getDropTargetEffect() {
+    return dropEffect;
+}
+
+int getOperationFromKeyState() {
+    int state;
+    OS.gdk_window_get_pointer(null, null, null, &state);
+    bool ctrl = (state & OS.GDK_CONTROL_MASK) !is 0;
+    bool shift = (state & OS.GDK_SHIFT_MASK) !is 0;
+    if (ctrl && shift) return DND.DROP_LINK;
+    if (ctrl)return DND.DROP_COPY;
+    if (shift)return DND.DROP_MOVE;
+    return DND.DROP_DEFAULT;
+}
+
+/**
+ * Returns a list of the data types that can be transferred to this DropTarget.
+ *
+ * @return a list of the data types that can be transferred to this DropTarget
+ */
+public Transfer[] getTransfer() {
+    return transferAgents;
+}
+
+void onDispose(){
+    if (control is null) return;
+    OS.g_signal_handler_disconnect(control.handle, drag_motion_handler);
+    OS.g_signal_handler_disconnect(control.handle, drag_leave_handler);
+    OS.g_signal_handler_disconnect(control.handle, drag_data_received_handler);
+    OS.g_signal_handler_disconnect(control.handle, drag_drop_handler);
+    if (transferAgents.length !is 0)
+        OS.gtk_drag_dest_unset(control.handle);
+    transferAgents = null;
+    if (controlListener !is null)
+        control.removeListener(SWT.Dispose, controlListener);
+    control.setData(DND.DROP_TARGET_KEY, null);
+    control = null;
+    controlListener = null;
+}
+
+int opToOsOp(int operation){
+    int osOperation = 0;
+    if ((operation & DND.DROP_COPY) is DND.DROP_COPY)
+        osOperation |= OS.GDK_ACTION_COPY;
+    if ((operation & DND.DROP_MOVE) is DND.DROP_MOVE)
+        osOperation |= OS.GDK_ACTION_MOVE;
+    if ((operation & DND.DROP_LINK) is DND.DROP_LINK)
+        osOperation |= OS.GDK_ACTION_LINK;
+    return osOperation;
+}
+
+int osOpToOp(int osOperation){
+    int operation = DND.DROP_NONE;
+    if ((osOperation & OS.GDK_ACTION_COPY) is OS.GDK_ACTION_COPY)
+        operation |= DND.DROP_COPY;
+    if ((osOperation & OS.GDK_ACTION_MOVE) is OS.GDK_ACTION_MOVE)
+        operation |= DND.DROP_MOVE;
+    if ((osOperation & OS.GDK_ACTION_LINK) is OS.GDK_ACTION_LINK)
+        operation |= DND.DROP_LINK;
+    return operation;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when a drag and drop operation is in progress.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see DropTargetListener
+ * @see #addDropListener
+ * @see #getDropListeners
+ */
+public void removeDropListener(DropTargetListener listener) {
+    if (listener is null) DND.error (SWT.ERROR_NULL_ARGUMENT);
+    removeListener (DND.DragEnter, listener);
+    removeListener (DND.DragLeave, listener);
+    removeListener (DND.DragOver, listener);
+    removeListener (DND.DragOperationChanged, listener);
+    removeListener (DND.Drop, listener);
+    removeListener (DND.DropAccept, listener);
+}
+
+/**
+ * Specifies the data types that can be transferred to this DropTarget.  If data is
+ * being dragged that does not match one of these types, the drop target will be notified of
+ * the drag and drop operation but the currentDataType will be null and the operation
+ * will be DND.NONE.
+ *
+ * @param transferAgents a list of Transfer objects which define the types of data that can be
+ *                       dropped on this target
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if transferAgents is null</li>
+ * </ul>
+ */
+public void setTransfer(Transfer[] transferAgents){
+    if (transferAgents is null) DND.error(SWT.ERROR_NULL_ARGUMENT);
+
+    if (this.transferAgents.length !is 0) {
+        OS.gtk_drag_dest_unset(control.handle);
+    }
+    this.transferAgents = transferAgents;
+
+    GtkTargetEntry*[] targets;
+    for (int i = 0; i < transferAgents.length; i++) {
+        Transfer transfer = transferAgents[i];
+        if (transfer !is null) {
+            int[] typeIds = transfer.getTypeIds();
+            String[] typeNames = transfer.getTypeNames();
+            for (int j = 0; j < typeIds.length; j++) {
+                GtkTargetEntry* entry = new GtkTargetEntry();
+                entry.target = cast(char*)OS.g_malloc(typeNames[j].length +1);
+                entry.target[ 0 .. typeNames[j].length ] = typeNames[j];
+                entry.target[ typeNames[j].length ] = '\0';
+                entry.info = typeIds[j];
+                GtkTargetEntry*[] newTargets = new GtkTargetEntry*[targets.length + 1];
+                SimpleType!(GtkTargetEntry*).arraycopy(targets, 0, newTargets, 0, targets.length);
+                newTargets[targets.length] = entry;
+                targets = newTargets;
+            }
+        }
+    }
+
+    auto pTargets = OS.g_malloc(targets.length * GtkTargetEntry.sizeof);
+    for (int i = 0; i < targets.length; i++) {
+        tango.stdc.string.memmove(pTargets + i*GtkTargetEntry.sizeof, targets[i], GtkTargetEntry.sizeof);
+    }
+
+    int actions = opToOsOp(getStyle());
+    if ( auto c = cast(Combo)control ) {
+        if ((control.getStyle() & SWT.READ_ONLY) is 0) {
+            auto entryHandle = OS.gtk_bin_get_child (control.handle);
+            if (entryHandle !is null) {
+                OS.gtk_drag_dest_unset(entryHandle);
+            }
+        }
+    }
+    OS.gtk_drag_dest_set(control.handle, 0, pTargets, targets.length, actions);
+
+    for (int i = 0; i < targets.length; i++) {
+        OS.g_free(targets[i].target);
+    }
+}
+
+/**
+ * Specifies the drop effect for this DropTarget.  This drop effect will be
+ * used during a drag and drop to display the drag under effect on the
+ * target widget.
+ *
+ * @param effect the drop effect that is registered for this DropTarget
+ *
+ * @since 3.3
+ */
+public void setDropTargetEffect(DropTargetEffect effect) {
+    dropEffect = effect;
+}
+
+bool setEventData(GdkDragContext* dragContext, int x, int y, int time, DNDEvent event) {
+    if (dragContext is null) return false;
+    if (dragContext.targets is null) return false;
+
+    // get allowed operations
+    int style = getStyle();
+    int operations = osOpToOp(dragContext.actions) & style;
+    if (operations is DND.DROP_NONE) return false;
+
+    // get current operation
+    int operation = getOperationFromKeyState();
+    keyOperation = operation;
+    if (operation is DND.DROP_DEFAULT) {
+        if ((style & DND.DROP_DEFAULT) is 0) {
+            operation = (operations & DND.DROP_MOVE) !is 0 ? DND.DROP_MOVE : DND.DROP_NONE;
+        }
+    } else {
+        if ((operation & operations) is 0) operation = DND.DROP_NONE;
+    }
+
+    // Get allowed transfer types
+    int length = OS.g_list_length(dragContext.targets);
+    TransferData[] dataTypes = new TransferData[0];
+    for (int i = 0; i < length; i++) {
+        auto pData = OS.g_list_nth(dragContext.targets, i);
+        GtkTargetPair* gtkTargetPair = cast(GtkTargetPair*)pData;
+        TransferData data = new TransferData();
+        data.type = gtkTargetPair.target;
+        for (int j = 0; j < transferAgents.length; j++) {
+            Transfer transfer = transferAgents[j];
+            if (transfer !is null && transfer.isSupportedType(data)) {
+                TransferData[] newDataTypes = new TransferData[dataTypes.length + 1];
+                System.arraycopy(dataTypes, 0, newDataTypes, 0, dataTypes.length);
+                newDataTypes[dataTypes.length] = data;
+                dataTypes = newDataTypes;
+                break;
+            }
+        }
+    }
+    if (dataTypes.length is 0) return false;
+
+    auto window = OS.GTK_WIDGET_WINDOW(control.handle);
+    int origin_x, origin_y;
+    OS.gdk_window_get_origin(window, &origin_x, &origin_y);
+    Point coordinates = new Point(origin_x + x, origin_y + y);
+
+    event.widget = this;
+    event.x = coordinates.x;
+    event.y = coordinates.y;
+    event.time = time;
+    event.feedback = DND.FEEDBACK_SELECT;
+    event.dataTypes = dataTypes;
+    event.dataType = dataTypes[0];
+    event.operations = operations;
+    event.detail = operation;
+    if (dropEffect !is null) {
+        event.item = dropEffect.getItem(coordinates.x, coordinates.y);
+    }
+    return true;
+}
+
+void updateDragOverHover(long delay, DNDEvent event) {
+    if (delay is 0) {
+        dragOverStart = 0;
+        dragOverEvent = null;
+        return;
+    }
+    dragOverStart = System.currentTimeMillis() + delay;
+    if (dragOverEvent is null) dragOverEvent = new DNDEvent();
+    dragOverEvent.x = event.x;
+    dragOverEvent.y = event.y;
+    TransferData[] dataTypes = new TransferData[ event.dataTypes.length];
+    System.arraycopy( event.dataTypes, 0, dataTypes, 0, dataTypes.length);
+    dragOverEvent.dataTypes  = dataTypes;
+    dragOverEvent.operations = event.operations;
+    dragOverEvent.time = event.time;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/DropTargetAdapter.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.dnd.DropTargetAdapter;
+
+import java.lang.all;
+
+import org.eclipse.swt.dnd.DropTargetListener;
+import org.eclipse.swt.dnd.DropTargetEvent;
+
+/**
+ * This adapter class provides default implementations for the
+ * methods described by the <code>DropTargetListener</code> interface.
+ * <p>
+ * Classes that wish to deal with <code>DropTargetEvent</code>s can
+ * extend this class and override only the methods which they are
+ * interested in.
+ * </p>
+ *
+ * @see DropTargetListener
+ * @see DropTargetEvent
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class DropTargetAdapter : DropTargetListener {
+
+/**
+ * This implementation of <code>dragEnter</code> permits the default
+ * operation defined in <code>event.detail</code>to be performed on the current data type
+ * defined in <code>event.currentDataType</code>.
+ * For additional information see <code>DropTargetListener.dragEnter</code>.
+ * 
+ * @param event the information associated with the drag enter event
+ */
+public void dragEnter(DropTargetEvent event){}
+
+/**
+ * This implementation of <code>dragLeave</code> does nothing.
+ * For additional information see <code>DropTargetListener.dragOperationChanged</code>.
+ * 
+ * @param event the information associated with the drag leave event
+ */
+public void dragLeave(DropTargetEvent event){}
+
+/**
+ * This implementation of <code>dragOperationChanged</code> permits the default
+ * operation defined in <code>event.detail</code>to be performed on the current data type
+ * defined in <code>event.currentDataType</code>.
+ * For additional information see <code>DropTargetListener.dragOperationChanged</code>.
+ * 
+ * @param event the information associated with the drag operation changed event
+ */
+public void dragOperationChanged(DropTargetEvent event){}
+
+/**
+ * This implementation of <code>dragOver</code> permits the default
+ * operation defined in <code>event.detail</code>to be performed on the current data type
+ * defined in <code>event.currentDataType</code>.
+ * For additional information see <code>DropTargetListener.dragOver</code>.
+ * 
+ * @param event the information associated with the drag over event
+ */
+public void dragOver(DropTargetEvent event){}
+
+/**
+ * This implementation of <code>drop</code> does nothing.
+ * For additional information see <code>DropTargetListener.drop</code>.
+ * 
+ * @param event the information associated with the drop event
+ */
+public void drop(DropTargetEvent event){}
+
+/**
+ * This implementation of <code>dropAccept</code> permits the default
+ * operation defined in <code>event.detail</code>to be performed on the current data type
+ * defined in <code>event.currentDataType</code>.
+ * For additional information see <code>DropTargetListener.dropAccept</code>.
+ * 
+ * @param event the information associated with the drop accept event
+ */
+public void dropAccept(DropTargetEvent event){}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/DropTargetEffect.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,182 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.dnd.DropTargetEffect;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swt.dnd.DropTargetAdapter;
+
+
+/**
+ * This class provides a default drag under effect during a drag and drop.
+ * The current implementation does not provide any visual feedback.
+ *
+ * <p>The drop target effect has the same API as the
+ * <code>DropTargetAdapter</code> so that it can provide custom visual
+ * feedback when a <code>DropTargetEvent</code> occurs.
+ * </p>
+ *
+ * <p>Classes that wish to provide their own drag under effect
+ * can extend the <code>DropTargetEffect</code> and override any applicable methods
+ * in <code>DropTargetAdapter</code> to display their own drag under effect.</p>
+ *
+ * <p>The feedback value is either one of the FEEDBACK constants defined in
+ * class <code>DND</code> which is applicable to instances of this class,
+ * or it must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>DND</code> effect constants.
+ * </p>
+ * <p>
+ * <dl>
+ * <dt><b>Feedback:</b></dt>
+ * <dd>FEEDBACK_EXPAND, FEEDBACK_INSERT_AFTER, FEEDBACK_INSERT_BEFORE,
+ * FEEDBACK_NONE, FEEDBACK_SELECT, FEEDBACK_SCROLL</dd>
+ * </dl>
+ * </p>
+ *
+ * @see DropTargetAdapter
+ * @see DropTargetEvent
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.3
+ */
+public class DropTargetEffect : DropTargetAdapter {
+    Control control;
+
+    /**
+     * Creates a new <code>DropTargetEffect</code> to handle the drag under effect on the specified
+     * <code>Control</code>.
+     *
+     * @param control the <code>Control</code> over which the user positions the cursor to drop the data
+     *
+     * @exception IllegalArgumentException <ul>
+     *    <li>ERROR_NULL_ARGUMENT - if the control is null</li>
+     * </ul>
+     */
+    public this(Control control) {
+        if (control is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+        this.control = control;
+    }
+
+    /**
+     * Returns the Control which is registered for this DropTargetEffect.  This is the control over which the
+     * user positions the cursor to drop the data.
+     *
+     * @return the Control which is registered for this DropTargetEffect
+     */
+    public Control getControl() {
+        return control;
+    }
+
+    /**
+     * Returns the item at the given x-y coordinate in the receiver
+     * or null if no such item exists. The x-y coordinate is in the
+     * display relative coordinates.
+     *
+     * @param x the x coordinate used to locate the item
+     * @param y the y coordinate used to locate the item
+     * @return the item at the given x-y coordinate, or null if the coordinate is not in a selectable item
+     */
+    public Widget getItem(int x, int y) {
+        if ( auto table = cast(Table)control ) {
+            return getItem(table, x, y);
+        }
+        if ( auto tree = cast(Tree)control ) {
+            return getItem(tree, x, y);
+        }
+        return null;
+    }
+
+    Widget getItem(Table table, int x, int y) {
+        Point coordinates = new Point(x, y);
+        coordinates = table.toControl(coordinates);
+        TableItem item = table.getItem(coordinates);
+        if (item !is null) return item;
+        Rectangle area = table.getClientArea();
+        int tableBottom = area.y + area.height;
+        int itemCount = table.getItemCount();
+        for (int i=table.getTopIndex(); i<itemCount; i++) {
+            item = table.getItem(i);
+            Rectangle rect = item.getBounds();
+            rect.x = area.x;
+            rect.width = area.width;
+            if (rect.contains(coordinates)) return item;
+            if (rect.y > tableBottom) break;
+        }
+        return null;
+    }
+
+    Widget getItem(Tree tree, int x, int y) {
+        Point point = new Point(x, y);
+        point = tree.toControl(point);
+        TreeItem item = tree.getItem(point);
+        if (item is null) {
+            Rectangle area = tree.getClientArea();
+            if (area.contains(point)) {
+                int treeBottom = area.y + area.height;
+                item = tree.getTopItem();
+                while (item !is null) {
+                    Rectangle rect = item.getBounds();
+                    int itemBottom = rect.y + rect.height;
+                    if (rect.y <= point.y && point.y < itemBottom) return item;
+                    if (itemBottom > treeBottom) break;
+                    item = nextItem(tree, item);
+                }
+                return null;
+            }
+        }
+        return item;
+    }
+
+    TreeItem nextItem(Tree tree, TreeItem item) {
+        if (item is null) return null;
+        if (item.getExpanded() && item.getItemCount() > 0) return item.getItem(0);
+        TreeItem childItem = item;
+        TreeItem parentItem = childItem.getParentItem();
+        int index = parentItem is null ? tree.indexOf(childItem) : parentItem.indexOf(childItem);
+        int count = parentItem is null ? tree.getItemCount() : parentItem.getItemCount();
+        while (true) {
+            if (index + 1 < count) return parentItem is null ? tree.getItem(index + 1) : parentItem.getItem(index + 1);
+            if (parentItem is null) return null;
+            childItem = parentItem;
+            parentItem = childItem.getParentItem();
+            index = parentItem is null ? tree.indexOf(childItem) : parentItem.indexOf(childItem);
+            count = parentItem is null ? tree.getItemCount() : parentItem.getItemCount();
+        }
+    }
+
+    TreeItem previousItem(Tree tree, TreeItem item) {
+        if (item is null) return null;
+        TreeItem childItem = item;
+        TreeItem parentItem = childItem.getParentItem();
+        int index = parentItem is null ? tree.indexOf(childItem) : parentItem.indexOf(childItem);
+        if (index is 0) return parentItem;
+        TreeItem nextItem = parentItem is null ? tree.getItem(index-1) : parentItem.getItem(index-1);
+        int count = nextItem.getItemCount();
+        while (count > 0 && nextItem.getExpanded()) {
+            nextItem = nextItem.getItem(count - 1);
+            count = nextItem.getItemCount();
+        }
+        return nextItem;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/DropTargetEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,125 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.dnd.DropTargetEvent;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.events.TypedEvent;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swt.dnd.TransferData;
+import org.eclipse.swt.dnd.DNDEvent;
+import org.eclipse.swt.widgets.Event;
+
+/**
+ * The DropTargetEvent contains the event information passed in the methods of the DropTargetListener.
+ *
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class DropTargetEvent : TypedEvent {
+    /**
+     * The x-cordinate of the cursor relative to the <code>Display</code>
+     */
+    public int x;
+
+    /**
+     * The y-cordinate of the cursor relative to the <code>Display</code>
+     */
+    public int y;
+
+    /**
+     * The operation being performed.
+     * @see DND#DROP_NONE
+     * @see DND#DROP_MOVE
+     * @see DND#DROP_COPY
+     * @see DND#DROP_LINK
+     */
+    public int detail;
+
+    /**
+     * A bitwise OR'ing of the operations that the DragSource can support
+     * (e.g. DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK).
+     * The detail value must be a member of this list or DND.DROP_NONE.
+     * @see DND#DROP_NONE
+     * @see DND#DROP_MOVE
+     * @see DND#DROP_COPY
+     * @see DND#DROP_LINK
+     */
+    public int operations;
+
+    /**
+     * A bitwise OR'ing of the drag under effect feedback to be displayed to the user
+     * (e.g. DND.FEEDBACK_SELECT | DND.FEEDBACK_SCROLL | DND.FEEDBACK_EXPAND).
+     * <p>A value of DND.FEEDBACK_NONE indicates that no drag under effect will be displayed.</p>
+     * <p>Feedback effects will only be applied if they are applicable.</p>
+     * <p>The default value is DND.FEEDBACK_SELECT.</p>
+     * @see DND#FEEDBACK_NONE
+     * @see DND#FEEDBACK_SELECT
+     * @see DND#FEEDBACK_INSERT_BEFORE
+     * @see DND#FEEDBACK_INSERT_AFTER
+     * @see DND#FEEDBACK_SCROLL
+     * @see DND#FEEDBACK_EXPAND
+     */
+    public int feedback;
+
+    /**
+     * If the associated control is a table or tree, this field contains the item located
+     * at the cursor coordinates.
+     */
+    public Widget item;
+
+    /**
+     * The type of data that will be dropped.
+     */
+    public TransferData currentDataType;
+
+    /**
+     * A list of the types of data that the DragSource is capable of providing.
+     * The currentDataType must be a member of this list.
+     */
+    public TransferData[] dataTypes;
+
+    static const long serialVersionUID = 3256727264573338678L;
+
+/**
+ * Constructs a new instance of this class based on the
+ * information in the given untyped event.
+ *
+ * @param e the untyped event containing the information
+ */
+public this(DNDEvent e) {
+    super(cast(Event)e);
+    this.data = e.data;
+    this.x = e.x;
+    this.y = e.y;
+    this.detail = e.detail;
+    this.currentDataType = e.dataType;
+    this.dataTypes = e.dataTypes;
+    this.operations = e.operations;
+    this.feedback = e.feedback;
+    this.item = e.item;
+}
+void updateEvent(DNDEvent e) {
+    e.widget = this.widget;
+    e.time = this.time;
+    e.data = this.data;
+    e.x = this.x;
+    e.y = this.y;
+    e.detail = this.detail;
+    e.dataType = this.currentDataType;
+    e.dataTypes = this.dataTypes;
+    e.operations = this.operations;
+    e.feedback = this.feedback;
+    e.item = this.item;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/DropTargetListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,255 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.dnd.DropTargetListener;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.SWTEventListener;
+import org.eclipse.swt.dnd.DropTargetEvent;
+
+/**
+ * The <code>DropTargetListener</code> class provides event notification to the application
+ * for DropTarget events.
+ *
+ * <p>As the user moves the cursor into, over and out of a Control that has been designated
+ * as a DropTarget, events indicate what operation can be performed and what data can be
+ * transferred if a drop where to occur at that point.
+ * The application can respond to these events and change the type of data that will
+ * be dropped by modifying event.currentDataType, or change the operation that will be performed
+ * by modifying the event.detail field or stop any drop from happening on the current target
+ * by setting the event.detail field to DND_DROP_NONE.</p>
+ *
+ * <p>When the user causes a drop to happen by releasing the mouse over a valid drop target,
+ * the application has one last chance to change the data type of the drop through the
+ * DropAccept event.  If the drop is still allowed, the DropAccept event is immediately
+ * followed by the Drop event.  In the Drop event, the application can still change the
+ * operation that is performed but the data type is fixed.</p>
+ *
+ * @see DropTargetEvent
+ *
+ */
+public interface DropTargetListener : SWTEventListener {
+
+/**
+ * The cursor has entered the drop target boundaries.
+ *
+ * <p>The following fields in the DropTargetEvent apply:
+ * <ul>
+ * <li>(in)widget
+ * <li>(in)time
+ * <li>(in)x
+ * <li>(in)y
+ * <li>(in)dataTypes
+ * <li>(in,out)currentDataType
+ * <li>(in)operations
+ * <li>(in,out)detail
+ * <li>(in,out)feedback
+ * </ul></p>
+ *
+ * <p>The <code>operation</code> value is determined by the modifier keys pressed by the user.
+ * If no keys are pressed the <code>event.detail</code> field is set to DND.DROP_DEFAULT.
+ * If the application does not set the <code>event.detail</code> to something other
+ * than <code>DND.DROP_DEFAULT</code> the operation will be set to the platform defined standard
+ * default.</p>
+ *
+ * <p>The <code>currentDataType</code> is determined by the first transfer agent specified in
+ * setTransfer() that matches a data type provided by the drag source.</p>
+ *
+ * <p>It is possible to get a DragEnter event when the drag source does not provide any matching data.
+ * In this case, the default operation is DND.DROP_NONE and the currentDataType is null.</p>
+ *
+ * <p>The application can change the operation that will be performed by modifying the
+ * <code>detail</code> field but the choice must be one of the values in the <code>operations</code>
+ * field or DND.DROP_NONE.</p>
+ *
+ * <p>The application can also change the type of data being requested by
+ * modifying the <code>currentDataTypes</code> field  but the value must be one of the values
+ * in the <code>dataTypes</code> list.</p>
+ *
+ * @param event  the information associated with the drag enter event
+ *
+ * @see DropTargetEvent
+ */
+public void dragEnter(DropTargetEvent event);
+
+/**
+ * The cursor has left the drop target boundaries OR the drop has been cancelled OR the data
+ * is about to be dropped.
+ *
+ * <p>The following fields in the DropTargetEvent apply:
+ * <ul>
+ * <li>(in)widget
+ * <li>(in)time
+ * <li>(in)x
+ * <li>(in)y
+ * <li>(in)dataTypes
+ * <li>(in)currentDataType
+ * <li>(in)operations
+ * <li>(in)detail
+ * </ul></p>
+ *
+ * @param event  the information associated with the drag leave event
+ *
+ * @see DropTargetEvent
+ */
+public void dragLeave(DropTargetEvent event);
+
+/**
+ * The operation being performed has changed (usually due to the user changing the selected modifier key(s)
+ * while dragging).
+ *
+ * <p>The following fields in the DropTargetEvent apply:
+ * <ul>
+ * <li>(in)widget
+ * <li>(in)time
+ * <li>(in)x
+ * <li>(in)y
+ * <li>(in)dataTypes
+ * <li>(in,out)currentDataType
+ * <li>(in)operations
+ * <li>(in,out)detail
+ * <li>(in,out)feedback
+ * </ul></p>
+ *
+ * <p>The <code>operation</code> value is determined by the modifier keys pressed by the user.
+ * If no keys are pressed the <code>event.detail</code> field is set to DND.DROP_DEFAULT.
+ * If the application does not set the <code>event.detail</code> to something other than
+ * <code>DND.DROP_DEFAULT</code> the operation will be set to the platform defined standard default.</p>
+ *
+ * <p>The <code>currentDataType</code> value is determined by the value assigned to
+ * <code>currentDataType</code> in previous dragEnter and dragOver calls.</p>
+ *
+ * <p>The application can change the operation that will be performed by modifying the
+ * <code>detail</code> field but the choice must be one of the values in the <code>operations</code>
+ * field.</p>
+ *
+ * <p>The application can also change the type of data being requested by modifying
+ * the <code>currentDataTypes</code> field  but the value must be one of the values in the
+ * <code>dataTypes</code> list.</p>
+ *
+ * @param event  the information associated with the drag operation changed event
+ *
+ * @see DropTargetEvent
+ */
+public void dragOperationChanged(DropTargetEvent event);
+
+/**
+ * The cursor is moving over the drop target.
+ *
+ * <p>The following fields in the DropTargetEvent apply:
+ * <ul>
+ * <li>(in)widget
+ * <li>(in)time
+ * <li>(in)x
+ * <li>(in)y
+ * <li>(in)dataTypes
+ * <li>(in,out)currentDataType
+ * <li>(in)operations
+ * <li>(in,out)detail
+ * <li>(in,out)feedback
+ * </ul></p>
+ *
+ * <p>The <code>operation</code> value is determined by the value assigned to
+ * <code>currentDataType</code> in previous dragEnter and dragOver calls.</p>
+ *
+ * <p>The <code>currentDataType</code> value is determined by the value assigned to
+ * <code>currentDataType</code> in previous dragEnter and dragOver calls.</p>
+ *
+ * <p>The application can change the operation that will be performed by modifying the
+ * <code>detail</code> field but the choice must be one of the values in the <code>operations</code>
+ * field.</p>
+ *
+ * <p>The application can also change the type of data being requested by modifying the
+ * <code>currentDataTypes</code> field  but the value must be one of the values in the
+ * <code>dataTypes</code> list.</p>
+ *
+ * <p>NOTE: At this point the <code>data</code> field is null.  On some platforms, it is possible
+ * to obtain the data being transferred before the transfer occurs but in most platforms this is
+ * not possible.  On those platforms where the data is available, the application can access the
+ * data as follows:</p>
+ *
+ * <pre><code>
+ * public void dragOver(DropTargetEvent event) {
+ *       TextTransfer textTransfer = TextTransfer.getInstance();
+ *       String data = (String)textTransfer.nativeToJava(event.currentDataType);
+ *       if (data !is null) {
+ *           System.out.println("Data to be dropped is (Text)"+data);
+ *       }
+ * };
+ * </code></pre>
+ *
+ * @param event  the information associated with the drag over event
+ *
+ * @see DropTargetEvent
+ */
+public void dragOver(DropTargetEvent event);
+
+/**
+ * The data is being dropped.  The data field contains java format of the data being dropped.
+ * To determine the type of the data object, refer to the documentation for the Transfer subclass
+ * specified in event.currentDataType.
+ *
+ * <p>The following fields in DropTargetEvent apply:
+ * <ul>
+ * <li>(in)widget
+ * <li>(in)time
+ * <li>(in)x
+ * <li>(in)y
+ * <li>(in,out)detail
+ * <li>(in)currentDataType
+ * <li>(in)data
+ * </ul></p>
+ *
+ * <p>The application can refuse to perform the drop operation by setting the detail
+ * field to DND.DROP_NONE.</p>
+ *
+ * @param event the information associated with the drop event
+ *
+ * @see DropTargetEvent
+ */
+public void drop(DropTargetEvent event);
+
+/**
+ * The drop is about to be performed.
+ * The drop target is given a last chance to change the nature of the drop.
+ *
+ * <p>The following fields in the DropTargetEvent apply:
+ * <ul>
+ * <li>(in)widget
+ * <li>(in)time
+ * <li>(in)x
+ * <li>(in)y
+ * <li>(in)dataTypes
+ * <li>(in,out)currentDataType
+ * <li>(in)operations
+ * <li>(in,out)detail
+ * </ul></p>
+ *
+ * <p>The application can veto the drop by setting the <code>event.detail</code> field to
+ * <code>DND.DROP_NONE</code>.</p>
+ *
+ * <p>The application can change the operation that will be performed by modifying the
+ * <code>detail</code> field but the choice must be one of the values in the
+ * <code>operations</code> field.</p>
+ *
+ * <p>The application can also change the type of data being requested by modifying the
+ * <code>currentDataTypes</code> field  but the value must be one of the values in the <
+ * code>dataTypes</code> list.</p>
+ *
+ * @param event  the information associated with the drop accept event
+ *
+ * @see DropTargetEvent
+ */
+public void dropAccept(DropTargetEvent event);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/FileTransfer.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,194 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.dnd.FileTransfer;
+
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.dnd.ByteArrayTransfer;
+import org.eclipse.swt.dnd.TransferData;
+import org.eclipse.swt.dnd.DND;
+import java.lang.all;
+
+/**
+ * The class <code>FileTransfer</code> provides a platform specific mechanism
+ * for converting a list of files represented as a java <code>String[]</code> to a
+ * platform specific representation of the data and vice versa.
+ * Each <code>String</code> in the array contains the absolute path for a single
+ * file or directory.
+ *
+ * <p>An example of a java <code>String[]</code> containing a list of files is shown
+ * below:</p>
+ *
+ * <code><pre>
+ *     File file1 = new File("C:\temp\file1");
+ *     File file2 = new File("C:\temp\file2");
+ *     String[] fileData = new String[2];
+ *     fileData[0] = file1.getAbsolutePath();
+ *     fileData[1] = file2.getAbsolutePath();
+ * </code></pre>
+ *
+ * @see Transfer
+ */
+public class FileTransfer : ByteArrayTransfer {
+
+    private static FileTransfer _instance;
+    private static const String URI_LIST = "text/uri-list"; //$NON-NLS-1$
+    private static const int URI_LIST_ID;
+    private static const String separator = "\r\n";
+
+static this(){
+    URI_LIST_ID = registerType(URI_LIST);
+    _instance = new FileTransfer();
+}
+
+private this() {}
+
+/**
+ * Returns the singleton instance of the FileTransfer class.
+ *
+ * @return the singleton instance of the FileTransfer class
+ */
+public static FileTransfer getInstance () {
+    return _instance;
+}
+
+/**
+ * This implementation of <code>javaToNative</code> converts a list of file names
+ * represented by a java <code>String[]</code> to a platform specific representation.
+ * Each <code>String</code> in the array contains the absolute path for a single
+ * file or directory.
+ *
+ * @param object a java <code>String[]</code> containing the file names to be converted
+ * @param transferData an empty <code>TransferData</code> object that will
+ *      be filled in on return with the platform specific format of the data
+ *
+ * @see Transfer#nativeToJava
+ */
+public override void javaToNative(Object object, TransferData transferData) {
+    transferData.result = 0;
+    if (!checkFile(object) || !isSupportedType(transferData)) {
+        DND.error(DND.ERROR_INVALID_DATA);
+    }
+    String[] files = (cast(ArrayWrapperString2)object).array;
+    String buffer;
+    for (int i = 0; i < files.length; i++) {
+        String string = files[i];
+        if (string.ptr is null) continue;
+        if (string.length is 0) continue;
+        GError* error;
+        auto localePtr = OS.g_filename_from_utf8(string.ptr, -1, null, null, &error);
+        if (error !is null || localePtr is null) continue;
+        auto uriPtr = OS.g_filename_to_uri(localePtr, null, &error);
+        OS.g_free(localePtr);
+        if (error !is null || uriPtr is null) continue;
+        String temp = fromStringz( uriPtr ).dup;
+        OS.g_free(uriPtr);
+        int newLength = (i > 0) ? buffer.length+separator.length+temp.length :  temp.length;
+        String newBuffer = new char[newLength];
+        int offset = 0;
+        if (i > 0) {
+            System.arraycopy(buffer, 0, newBuffer, 0, buffer.length);
+            offset +=  buffer.length;
+            System.arraycopy(separator, 0, newBuffer, offset, separator.length);
+            offset += separator.length;
+        }
+        System.arraycopy(temp, 0, newBuffer, offset, temp.length);
+        buffer = newBuffer;
+    }
+    if (buffer.length is 0) return;
+    char* ptr = cast(char*)OS.g_malloc(buffer.length+1);
+    ptr[ 0 .. buffer.length ] = buffer;
+    ptr[ buffer.length ] = '\0';
+    transferData.pValue = ptr;
+    transferData.length = buffer.length;
+    transferData.format = 8;
+    transferData.result = 1;
+}
+/**
+ * This implementation of <code>nativeToJava</code> converts a platform specific
+ * representation of a list of file names to a java <code>String[]</code>.
+ * Each String in the array contains the absolute path for a single file or directory.
+ *
+ * @param transferData the platform specific representation of the data to be converted
+ * @return a java <code>String[]</code> containing a list of file names if the conversion
+ *      was successful; otherwise null
+ *
+ * @see Transfer#javaToNative
+ */
+public override Object nativeToJava(TransferData transferData) {
+    if ( !isSupportedType(transferData) ||  transferData.pValue is null ||  transferData.length <= 0 ) return null;
+    String temp = transferData.pValue[ 0 .. transferData.length ];
+    char*[] files;
+    int offset = 0;
+    for (int i = 0; i < temp.length - 1; i++) {
+        if (temp[i] is '\r' && temp[i+1] is '\n') {
+            int size =  i - offset;
+            char* file = cast(char*)OS.g_malloc(size + 1);
+            file[ 0 .. size ] = temp[ offset .. offset+size ];
+            file[ size ] = '\0';
+            files ~= file;
+            offset = i + 2;
+        }
+    }
+    if (offset < temp.length - 2) {
+        int size =  temp.length - offset;
+        char* file = cast(char*)OS.g_malloc(size + 1);
+        file[ 0 .. size ] = temp[ offset .. offset+size ];
+        file[ size ] = '\0';
+        files ~= file;
+    }
+    String[] fileNames;
+    for (int i = 0; i < files.length; i++) {
+        GError* error;
+        auto localePtr = OS.g_filename_from_uri(files[i], null, &error);
+        OS.g_free(files[i]);
+        if (error !is null || localePtr is null) continue;
+        auto utf8Ptr = OS.g_filename_to_utf8(localePtr, -1, null, null, &error);
+        OS.g_free(localePtr);
+        if (error !is null || utf8Ptr is null) continue;
+        String buffer = fromStringz( utf8Ptr ).dup;
+        OS.g_free(utf8Ptr);
+        String name = buffer;
+        String[] newFileNames = new String[]( fileNames.length + 1 );
+        System.arraycopy(fileNames, 0, newFileNames, 0, fileNames.length);
+        newFileNames[fileNames.length] = name;
+        fileNames = newFileNames;
+    }
+    if (fileNames.length is 0) return null;
+    return new ArrayWrapperString2( fileNames );
+}
+
+protected override int[] getTypeIds(){
+    return [URI_LIST_ID];
+}
+
+protected override String[] getTypeNames(){
+    return [URI_LIST];
+}
+
+bool checkFile(Object object) {
+    if( object is null ) return false;
+    ArrayWrapperString2 arr = cast(ArrayWrapperString2)object;
+    if( arr is null ) return false;
+    if( arr.array.length is 0 ) return false;
+
+    String[] strings = arr.array;
+    for (int i = 0; i < strings.length; i++) {
+        if (strings[i] is null || strings[i].length is 0) return false;
+    }
+    return true;
+}
+
+protected override bool validate(Object object) {
+    return checkFile(object);
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/HTMLTransfer.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.dnd.HTMLTransfer;
+
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.dnd.ByteArrayTransfer;
+import org.eclipse.swt.dnd.TransferData;
+import org.eclipse.swt.dnd.DND;
+import java.lang.all;
+
+static import tango.text.Util;
+
+/**
+ * The class <code>HTMLTransfer</code> provides a platform specific mechanism
+ * for converting text in HTML format represented as a java <code>String</code>
+ * to a platform specific representation of the data and vice versa.
+ *
+ * <p>An example of a java <code>String</code> containing HTML text is shown
+ * below:</p>
+ *
+ * <code><pre>
+ *     String htmlData = "<p>This is a paragraph of text.</p>";
+ * </code></pre>
+ *
+ * @see Transfer
+ */
+public class HTMLTransfer : ByteArrayTransfer {
+
+    private static HTMLTransfer _instance;
+    private static const String TEXT_HTML = "text/html"; //$NON-NLS-1$
+    private static const int TEXT_HTML_ID;
+    private static const String TEXT_HTML2 = "TEXT/HTML"; //$NON-NLS-1$
+    private static const int TEXT_HTML2_ID;
+
+static this(){
+    _instance = new HTMLTransfer();
+    TEXT_HTML_ID = registerType(TEXT_HTML);
+    TEXT_HTML2_ID = registerType(TEXT_HTML2);
+}
+
+private this() {}
+
+/**
+ * Returns the singleton instance of the HTMLTransfer class.
+ *
+ * @return the singleton instance of the HTMLTransfer class
+ */
+public static HTMLTransfer getInstance () {
+    return _instance;
+}
+
+/**
+ * This implementation of <code>javaToNative</code> converts HTML-formatted text
+ * represented by a java <code>String</code> to a platform specific representation.
+ *
+ * @param object a java <code>String</code> containing HTML text
+ * @param transferData an empty <code>TransferData</code> object that will
+ *      be filled in on return with the platform specific format of the data
+ * 
+ * @see Transfer#nativeToJava
+ */
+public override void javaToNative (Object object, TransferData transferData){
+    transferData.result = 0;
+    if (!checkHTML(object) || !isSupportedType(transferData)) {
+        DND.error(DND.ERROR_INVALID_DATA);
+    }
+    String string = (cast(ArrayWrapperString)object).array;
+    char* pValue = cast(char*)OS.g_malloc(string.length);
+    if (pValue is null) return;
+    pValue[0 .. string.length ] = string;
+    transferData.length = string.length;
+    transferData.format = 8;
+    transferData.pValue = pValue;
+    transferData.result = 1;
+}
+
+/**
+ * This implementation of <code>nativeToJava</code> converts a platform specific
+ * representation of HTML text to a java <code>String</code>.
+ *
+ * @param transferData the platform specific representation of the data to be converted
+ * @return a java <code>String</code> containing HTML text if the conversion was successful;
+ *      otherwise null
+ * 
+ * @see Transfer#javaToNative
+ */
+public override Object nativeToJava(TransferData transferData){
+    if ( !isSupportedType(transferData) ||  transferData.pValue is null ) return null;
+    /* Ensure byteCount is a multiple of 2 bytes */
+    int size = (transferData.format * transferData.length / 8) / 2 * 2;
+    if (size <= 0) return null;
+    String chars = transferData.pValue[ 0 .. size ].dup;
+    return new ArrayWrapperString( chars[ 0 .. tango.text.Util.locate( chars, '\0' ) ] );
+}
+protected override int[] getTypeIds() {
+    return [TEXT_HTML_ID, TEXT_HTML2_ID];
+}
+
+protected override String[] getTypeNames() {
+    return [TEXT_HTML, TEXT_HTML2];
+}
+
+bool checkHTML(Object object) {
+    if( object is null ) return false;
+    auto arr = cast(ArrayWrapperString)object;
+    if( arr is null ) return false;
+    if( arr.array.length is 0 ) return false;
+    return true;
+}
+
+protected override bool validate(Object object) {
+    return checkHTML(object);
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/ImageTransfer.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,196 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+module org.eclipse.swt.dnd.ImageTransfer;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.internal.Converter;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.dnd.ByteArrayTransfer;
+import org.eclipse.swt.dnd.TransferData;
+import org.eclipse.swt.dnd.DND;
+
+import java.lang.all;
+
+/**
+ * The class <code>ImageTransfer</code> provides a platform specific mechanism
+ * for converting an Image represented as a java <code>ImageData</code> to a 
+ * platform specific representation of the data and vice versa.
+ *
+ * <p>An example of a java <code>ImageData</code> is shown below:</p>
+ *
+ * <code><pre>
+ *     Image image = new Image(display, "C:\temp\img1.gif");
+ *     ImageData imgData = image.getImageData();
+ * </code></pre>
+ *
+ * @see Transfer
+ * 
+ * @since 3.4
+ */
+public class ImageTransfer : ByteArrayTransfer {
+
+    private static ImageTransfer _instance;
+
+    private static const String JPEG = "image/jpge"; //$NON-NLS-1$
+    private static int JPEG_ID;
+    private static const String PNG = "image/png"; //$NON-NLS-1$
+    private static int PNG_ID;
+    private static const String BMP = "image/bmp"; //$NON-NLS-1$
+    private static int BMP_ID;
+    private static const String EPS = "image/eps"; //$NON-NLS-1$
+    private static int EPS_ID;
+    private static const String PCX = "image/pcx"; //$NON-NLS-1$
+    private static int PCX_ID;
+    private static const String PPM = "image/ppm"; //$NON-NLS-1$
+    private static int PPM_ID;
+    private static const String RGB = "image/ppm"; //$NON-NLS-1$
+    private static int RGB_ID;
+    private static const String TGA = "image/tga"; //$NON-NLS-1$
+    private static int TGA_ID;
+    private static const String XBM = "image/xbm"; //$NON-NLS-1$
+    private static int XBM_ID;
+    private static const String XPM = "image/xpm"; //$NON-NLS-1$
+    private static int XPM_ID;
+    private static const String XV = "image/xv"; //$NON-NLS-1$
+    private static int XV_ID;
+
+static this(){
+    JPEG_ID = registerType(JPEG);
+    PNG_ID = registerType(PNG);
+    BMP_ID = registerType(BMP);
+    EPS_ID = registerType(EPS);
+    PCX_ID = registerType(PCX);
+    PPM_ID = registerType(PPM);
+    RGB_ID = registerType(RGB);
+    TGA_ID = registerType(TGA);
+    XBM_ID = registerType(XBM);
+    XPM_ID = registerType(XPM);
+    XV_ID = registerType(XV);
+    _instance = new ImageTransfer();
+}
+
+private this() {
+}
+
+/**
+ * Returns the singleton instance of the ImageTransfer class.
+ *
+ * @return the singleton instance of the ImageTransfer class
+ */
+public static ImageTransfer getInstance () {
+    return _instance;
+}
+
+/**
+ * This implementation of <code>javaToNative</code> converts an ImageData object represented
+ * by java <code>ImageData</code> to a platform specific representation.
+ *
+ * @param object a java <code>ImageData</code> containing the ImageData to be converted
+ * @param transferData an empty <code>TransferData</code> object that will
+ *      be filled in on return with the platform specific format of the data
+ * 
+ * @see Transfer#nativeToJava
+ */
+public void javaToNative(Object object, TransferData transferData) {
+    if (!checkImage(object) || !isSupportedType(transferData)) {
+        DND.error(DND.ERROR_INVALID_DATA);
+    }
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 4, 0)) return;
+
+    ImageData imgData = cast(ImageData)object;
+    if (imgData is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    Image image = new Image(Display.getCurrent(), imgData);
+    auto pixmap = image.pixmap;
+    int width = imgData.width;
+    int height = imgData.height;
+    auto pixbuf = OS.gdk_pixbuf_new(OS.GDK_COLORSPACE_RGB, true, 8, width, height);
+    if (pixbuf is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    auto colormap = OS.gdk_colormap_get_system();
+    OS.gdk_pixbuf_get_from_drawable(pixbuf, pixmap, colormap, 0, 0, 0, 0, width, height);
+
+    String typeStr = "";
+    if (transferData.type is  cast(void*)JPEG_ID) typeStr = "jpeg";
+    if (transferData.type is  cast(void*)PNG_ID) typeStr = "png";
+    if (transferData.type is  cast(void*)BMP_ID) typeStr = "bmp";
+    if (transferData.type is  cast(void*)EPS_ID) typeStr = "eps";
+    if (transferData.type is  cast(void*)PCX_ID) typeStr = "pcx";
+    if (transferData.type is  cast(void*)PPM_ID) typeStr = "ppm";
+    if (transferData.type is  cast(void*)RGB_ID) typeStr = "rgb";
+    if (transferData.type is  cast(void*)TGA_ID) typeStr = "tga";
+    if (transferData.type is  cast(void*)XBM_ID) typeStr = "xbm";
+    if (transferData.type is  cast(void*)XPM_ID) typeStr = "xpm";
+    if (transferData.type is  cast(void*)XV_ID) typeStr = "xv";
+    char* type = typeStr.ptr;
+    char* buffer;
+    uint len;
+    if (type is null) return;
+    OS.gdk_pixbuf_save_to_buffer0(pixbuf, &buffer, &len, type, null);
+    OS.g_object_unref(pixbuf);
+    image.dispose();
+    transferData.pValue = buffer;
+    transferData.length = (len + 3) / 4 * 4;
+    transferData.result = 1;
+    transferData.format = 32;
+}
+
+/**
+ * This implementation of <code>nativeToJava</code> converts a platform specific
+ * representation of an image to java <code>ImageData</code>.  
+ * 
+ * @param transferData the platform specific representation of the data to be converted
+ * @return a java <code>ImageData</code> of the image if the conversion was successful;
+ *      otherwise null
+ * 
+ * @see Transfer#javaToNative
+ */
+public Object nativeToJava(TransferData transferData) {
+    ImageData imgData = null;
+    if (transferData.length > 0)
+    {
+        auto loader = OS.gdk_pixbuf_loader_new();
+        OS.gdk_pixbuf_loader_write(loader, transferData.pValue, transferData.length, null);
+        OS.gdk_pixbuf_loader_close(loader, null);
+        auto pixbuf = OS.gdk_pixbuf_loader_get_pixbuf(loader);
+        if (pixbuf !is null) {
+            OS.g_object_ref(pixbuf);
+            GdkPixmap* pixmap_return;
+            OS.gdk_pixbuf_render_pixmap_and_mask(pixbuf, &pixmap_return, null, 0);
+            auto handle = pixmap_return;
+            if (handle is null) SWT.error(SWT.ERROR_NO_HANDLES);
+            OS.g_object_unref(loader);
+            Image img = Image.gtk_new(Display.getCurrent(), SWT.BITMAP, handle, null);
+            imgData = img.getImageData();
+            img.dispose();
+        }
+    }
+    return imgData;
+}
+
+protected int[] getTypeIds(){
+    return [JPEG_ID, PNG_ID, BMP_ID, EPS_ID, PCX_ID, PPM_ID, RGB_ID, TGA_ID, XBM_ID, XPM_ID, XV_ID];
+}
+
+protected String[] getTypeNames(){
+    return [JPEG, PNG, BMP, EPS, PCX, PPM, RGB, TGA, XBM, XPM, XV];
+}
+
+bool checkImage(Object object) {
+    if (object is null || !( null !is cast(ImageData)object )) return false;
+    return true;
+}
+
+protected bool validate(Object object) {
+    return checkImage(object);
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/RTFTransfer.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,128 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.dnd.RTFTransfer;
+
+import org.eclipse.swt.internal.Converter;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.dnd.ByteArrayTransfer;
+import org.eclipse.swt.dnd.TransferData;
+import org.eclipse.swt.dnd.DND;
+
+import java.lang.all;
+static import tango.text.Util;
+
+/**
+ * The class <code>RTFTransfer</code> provides a platform specific mechanism
+ * for converting text in RTF format represented as a java <code>String</code>
+ * to a platform specific representation of the data and vice versa.
+ *
+ * <p>An example of a java <code>String</code> containing RTF text is shown
+ * below:</p>
+ *
+ * <code><pre>
+ *     String rtfData = "{\\rtf1{\\colortbl;\\red255\\green0\\blue0;}\\uc1\\b\\i Hello World}";
+ * </code></pre>
+ *
+ * @see Transfer
+ */
+public class RTFTransfer : ByteArrayTransfer {
+
+    private static RTFTransfer _instance;
+    private static const String TEXT_RTF = "text/rtf"; //$NON-NLS-1$
+    private static const int TEXT_RTF_ID;
+    private static const String TEXT_RTF2 = "TEXT/RTF"; //$NON-NLS-1$
+    private static const int TEXT_RTF2_ID;
+    private static const String APPLICATION_RTF = "application/rtf"; //$NON-NLS-1$
+    private static const int APPLICATION_RTF_ID;
+
+static this(){
+    TEXT_RTF_ID = registerType(TEXT_RTF);
+    TEXT_RTF2_ID = registerType(TEXT_RTF2);
+    APPLICATION_RTF_ID = registerType(APPLICATION_RTF);
+    _instance = new RTFTransfer();
+}
+
+private this() {}
+
+/**
+ * Returns the singleton instance of the RTFTransfer class.
+ *
+ * @return the singleton instance of the RTFTransfer class
+ */
+public static RTFTransfer getInstance () {
+    return _instance;
+}
+
+/**
+ * This implementation of <code>javaToNative</code> converts RTF-formatted text
+ * represented by a java <code>String</code> to a platform specific representation.
+ *
+ * @param object a java <code>String</code> containing RTF text
+ * @param transferData an empty <code>TransferData</code> object that will
+ *      be filled in on return with the platform specific format of the data
+ *
+ * @see Transfer#nativeToJava
+ */
+public override void javaToNative (Object object, TransferData transferData){
+    transferData.result = 0;
+    if (!checkRTF(object) || !isSupportedType(transferData)) {
+        DND.error(DND.ERROR_INVALID_DATA);
+    }
+    String string = (cast(ArrayWrapperString)object).array;
+    char* pValue = cast(char*)OS.g_malloc(string.length + 1);
+    if (pValue is null) return;
+    pValue[ 0 .. string.length ] = string;
+    pValue[ string.length ] = '\0';
+    transferData.length = string.length;
+    transferData.format = 8;
+    transferData.pValue = pValue;
+    transferData.result = 1;
+}
+
+/**
+ * This implementation of <code>nativeToJava</code> converts a platform specific
+ * representation of RTF text to a java <code>String</code>.
+ *
+ * @param transferData the platform specific representation of the data to be converted
+ * @return a java <code>String</code> containing RTF text if the conversion was successful;
+ *      otherwise null
+ *
+ * @see Transfer#javaToNative
+ */
+public override Object nativeToJava(TransferData transferData){
+    if ( !isSupportedType(transferData) ||  transferData.pValue is null ) return null;
+    int size = transferData.format * transferData.length / 8;
+    if (size is 0) return null;
+    char [] chars = transferData.pValue[ 0 .. size];
+    return new ArrayWrapperString( chars[ 0 .. tango.text.Util.locate( chars, '\0' ) ].dup );
+}
+
+protected override int[] getTypeIds() {
+    return [TEXT_RTF_ID, TEXT_RTF2_ID, APPLICATION_RTF_ID];
+}
+
+protected override String[] getTypeNames() {
+    return [TEXT_RTF, TEXT_RTF2, APPLICATION_RTF];
+}
+
+bool checkRTF(Object object) {
+    if( object is null ) return false;
+    ArrayWrapperString astr = cast(ArrayWrapperString)object;
+    if( astr is null ) return false;
+    return astr.array.length > 0;
+}
+
+protected override bool validate(Object object) {
+    return checkRTF(object);
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/TableDragSourceEffect.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,152 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.dnd.TableDragSourceEffect;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.dnd.DragSourceEffect;
+import org.eclipse.swt.dnd.DragSourceEvent;
+
+
+/**
+ * This class provides default implementations to display a source image
+ * when a drag is initiated from a <code>Table</code>.
+ *
+ * <p>Classes that wish to provide their own source image for a <code>Table</code> can
+ * extend the <code>TableDragSourceEffect</code> class, override the
+ * <code>TableDragSourceEffect.dragStart</code> method and set the field
+ * <code>DragSourceEvent.image</code> with their own image.</p>
+ *
+ * Subclasses that override any methods of this class must call the corresponding
+ * <code>super</code> method to get the default drag source effect implementation.
+ *
+ * @see DragSourceEffect
+ * @see DragSourceEvent
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.3
+ */
+public class TableDragSourceEffect : DragSourceEffect {
+    Image dragSourceImage = null;
+
+    /**
+     * Creates a new <code>TableDragSourceEffect</code> to handle drag effect
+     * from the specified <code>Table</code>.
+     *
+     * @param table the <code>Table</code> that the user clicks on to initiate the drag
+     */
+    public this(Table table) {
+        super(table);
+    }
+
+    /**
+     * This implementation of <code>dragFinished</code> disposes the image
+     * that was created in <code>TableDragSourceEffect.dragStart</code>.
+     *
+     * Subclasses that override this method should call <code>super.dragFinished(event)</code>
+     * to dispose the image in the default implementation.
+     *
+     * @param event the information associated with the drag finished event
+     */
+    public override void dragFinished(DragSourceEvent event) {
+        if (dragSourceImage !is null) dragSourceImage.dispose();
+        dragSourceImage = null;
+    }
+
+    /**
+     * This implementation of <code>dragStart</code> will create a default
+     * image that will be used during the drag. The image should be disposed
+     * when the drag is completed in the <code>TableDragSourceEffect.dragFinished</code>
+     * method.
+     *
+     * Subclasses that override this method should call <code>super.dragStart(event)</code>
+     * to use the image from the default implementation.
+     *
+     * @param event the information associated with the drag start event
+     */
+    public override void dragStart(DragSourceEvent event) {
+        event.image = getDragSourceImage(event);
+    }
+
+    Image getDragSourceImage(DragSourceEvent event) {
+        if (dragSourceImage !is null) dragSourceImage.dispose();
+        dragSourceImage = null;
+
+        Table table = cast(Table) control;
+        if (OS.GTK_VERSION < OS.buildVERSION (2, 2, 0)) return null;
+        //TEMPORARY CODE
+        if (table.isListening(SWT.EraseItem) || table.isListening (SWT.PaintItem)) return null;
+        /*
+        * Bug in GTK.  gtk_tree_selection_get_selected_rows() segmentation faults
+        * in versions smaller than 2.2.4 if the model is NULL.  The fix is
+        * to give a valid pointer instead.
+        */
+        auto handle = table.handle;
+        auto selection = OS.gtk_tree_view_get_selection (handle);
+        int dummy;
+        void* model = OS.GTK_VERSION < OS.buildVERSION (2, 2, 4) ? &dummy : null;
+        auto list = OS.gtk_tree_selection_get_selected_rows (selection, &model);
+        if (list is null) return null;
+        int count = Math.min(10, OS.g_list_length (list));
+
+        Display display = table.getDisplay();
+        if (count is 1) {
+            auto path = OS.g_list_nth_data (list, 0);
+            auto pixmap = OS.gtk_tree_view_create_row_drag_icon(handle, path);
+            dragSourceImage =  Image.gtk_new(display, SWT.ICON, pixmap, null);
+        } else {
+            int width = 0, height = 0;
+            int w, h;
+            int[] yy, hh; yy.length = count; hh.length = count;
+            GdkDrawable*[] pixmaps; pixmaps.length = count;
+            GdkRectangle rect;
+            for (int i=0; i<count; i++) {
+                auto path = OS.g_list_nth_data (list, i);
+                OS.gtk_tree_view_get_cell_area (handle, path, null, &rect);
+                pixmaps[i] = OS.gtk_tree_view_create_row_drag_icon(handle, path);
+                OS.gdk_drawable_get_size(pixmaps[i], &w, &h);
+                width = Math.max(width, w);
+                height = rect.y + h - yy[0];
+                yy[i] = rect.y;
+                hh[i] = h;
+            }
+            auto source = OS.gdk_pixmap_new(OS.GDK_ROOT_PARENT(), width, height, -1);
+            auto gcSource = OS.gdk_gc_new(source);
+            auto mask = OS.gdk_pixmap_new(OS.GDK_ROOT_PARENT(), width, height, 1);
+            auto gcMask = OS.gdk_gc_new(mask);
+            GdkColor color;
+            color.pixel = 0;
+            OS.gdk_gc_set_foreground(gcMask, &color);
+            OS.gdk_draw_rectangle(mask, gcMask, 1, 0, 0, width, height);
+            color.pixel = 1;
+            OS.gdk_gc_set_foreground(gcMask, &color);
+            for (int i=0; i<count; i++) {
+                OS.gdk_draw_drawable(source, gcSource, pixmaps[i], 0, 0, 0, yy[i] - yy[0], -1, -1);
+                OS.gdk_draw_rectangle(mask, gcMask, 1, 0, yy[i] - yy[0], width, hh[i]);
+                OS.g_object_unref(pixmaps[i]);
+            }
+            OS.g_object_unref(gcSource);
+            OS.g_object_unref(gcMask);
+            dragSourceImage  = Image.gtk_new(display, SWT.ICON, source, mask);
+        }
+        OS.g_list_free (list);
+
+        return dragSourceImage;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/TableDropTargetEffect.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,193 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.dnd.TableDropTargetEffect;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.dnd.DropTargetEffect;
+import org.eclipse.swt.dnd.DropTargetEvent;
+import org.eclipse.swt.dnd.DND;
+
+
+/**
+ * This class provides a default drag under effect (eg. select, insert and scroll)
+ * when a drag occurs over a <code>Table</code>.
+ *
+ * <p>Classes that wish to provide their own drag under effect for a <code>Table</code>
+ * can extend the <code>TableDropTargetEffect</code> and override any applicable methods
+ * in <code>TableDropTargetEffect</code> to display their own drag under effect.</p>
+ *
+ * Subclasses that override any methods of this class must call the corresponding
+ * <code>super</code> method to get the default drag under effect implementation.
+ *
+ * <p>The feedback value is either one of the FEEDBACK constants defined in
+ * class <code>DND</code> which is applicable to instances of this class,
+ * or it must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>DND</code> effect constants.
+ * </p>
+ * <p>
+ * <dl>
+ * <dt><b>Feedback:</b></dt>
+ * <dd>FEEDBACK_SELECT, FEEDBACK_SCROLL</dd>
+ * </dl>
+ * </p>
+ *
+ * @see DropTargetAdapter
+ * @see DropTargetEvent
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.3
+ */
+public class TableDropTargetEffect : DropTargetEffect {
+    static const int SCROLL_HYSTERESIS = 150; // milli seconds
+
+    int scrollIndex;
+    long scrollBeginTime;
+
+    /**
+     * Creates a new <code>TableDropTargetEffect</code> to handle the drag under effect on the specified
+     * <code>Table</code>.
+     *
+     * @param table the <code>Table</code> over which the user positions the cursor to drop the data
+     */
+    public this(Table table) {
+        super(table);
+    }
+
+    int checkEffect(int effect) {
+        // Some effects are mutually exclusive.  Make sure that only one of the mutually exclusive effects has been specified.
+        if ((effect & DND.FEEDBACK_SELECT) !is 0) effect = effect & ~DND.FEEDBACK_INSERT_AFTER & ~DND.FEEDBACK_INSERT_BEFORE;
+        if ((effect & DND.FEEDBACK_INSERT_BEFORE) !is 0) effect = effect & ~DND.FEEDBACK_INSERT_AFTER;
+        return effect;
+    }
+
+    /**
+     * This implementation of <code>dragEnter</code> provides a default drag under effect
+     * for the feedback specified in <code>event.feedback</code>.
+     *
+     * For additional information see <code>DropTargetAdapter.dragEnter</code>.
+     *
+     * Subclasses that override this method should call <code>super.dragEnter(event)</code>
+     * to get the default drag under effect implementation.
+     *
+     * @param event  the information associated with the drag enter event
+     *
+     * @see DropTargetAdapter
+     * @see DropTargetEvent
+     */
+    public override void dragEnter(DropTargetEvent event) {
+        scrollBeginTime = 0;
+        scrollIndex = -1;
+    }
+
+    /**
+     * This implementation of <code>dragLeave</code> provides a default drag under effect
+     * for the feedback specified in <code>event.feedback</code>.
+     *
+     * For additional information see <code>DropTargetAdapter.dragLeave</code>.
+     *
+     * Subclasses that override this method should call <code>super.dragLeave(event)</code>
+     * to get the default drag under effect implementation.
+     *
+     * @param event  the information associated with the drag leave event
+     *
+     * @see DropTargetAdapter
+     * @see DropTargetEvent
+     */
+    public override void dragLeave(DropTargetEvent event) {
+        Table table = cast(Table) control;
+        auto handle = table.handle;
+        OS.gtk_tree_view_set_drag_dest_row(handle, null, OS.GTK_TREE_VIEW_DROP_BEFORE);
+
+        scrollBeginTime = 0;
+        scrollIndex = -1;
+    }
+
+    /**
+     * This implementation of <code>dragOver</code> provides a default drag under effect
+     * for the feedback specified in <code>event.feedback</code>. The class description
+     * lists the FEEDBACK constants that are applicable to the class.
+     *
+     * For additional information see <code>DropTargetAdapter.dragOver</code>.
+     *
+     * Subclasses that override this method should call <code>super.dragOver(event)</code>
+     * to get the default drag under effect implementation.
+     *
+     * @param event  the information associated with the drag over event
+     *
+     * @see DropTargetAdapter
+     * @see DropTargetEvent
+     * @see DND#FEEDBACK_SELECT
+     * @see DND#FEEDBACK_SCROLL
+     */
+    public override void dragOver(DropTargetEvent event) {
+        Table table = cast(Table) control;
+        auto handle = table.handle;
+        int effect = checkEffect(event.feedback);
+        Point coordinates = new Point(event.x, event.y);
+        coordinates = table.toControl(coordinates);
+        void* path;
+        OS.gtk_tree_view_get_path_at_pos (handle, coordinates.x, coordinates.y, &path, null, null, null);
+        int index = -1;
+        if (path !is null) {
+            auto indices = OS.gtk_tree_path_get_indices (path);
+            if (indices !is null) {
+                index = indices[0];
+            }
+        }
+        if ((effect & DND.FEEDBACK_SCROLL) is 0) {
+            scrollBeginTime = 0;
+            scrollIndex = -1;
+        } else {
+            if (index !is -1 && scrollIndex is index && scrollBeginTime !is 0) {
+                if (System.currentTimeMillis() >= scrollBeginTime) {
+                    if (coordinates.y < table.getItemHeight()) {
+                        OS.gtk_tree_path_prev(path);
+                    } else {
+                        OS.gtk_tree_path_next(path);
+                    }
+                    if (path !is null) {
+                        OS.gtk_tree_view_scroll_to_cell(handle, path, null, false, 0, 0);
+                        OS.gtk_tree_path_free(path);
+                        path = null;
+                        OS.gtk_tree_view_get_path_at_pos (handle, coordinates.x, coordinates.y, &path, null, null, null);
+                    }
+                    scrollBeginTime = 0;
+                    scrollIndex = -1;
+                }
+            } else {
+                scrollBeginTime = System.currentTimeMillis() + SCROLL_HYSTERESIS;
+                scrollIndex = index;
+            }
+        }
+        if (path !is null) {
+            int position = 0;
+            if ((effect & DND.FEEDBACK_SELECT) !is 0) position = OS.GTK_TREE_VIEW_DROP_INTO_OR_BEFORE;
+            //if ((effect & DND.FEEDBACK_INSERT_BEFORE) !is 0) position = OS.GTK_TREE_VIEW_DROP_BEFORE;
+            //if ((effect & DND.FEEDBACK_INSERT_AFTER) !is 0) position = OS.GTK_TREE_VIEW_DROP_AFTER;
+            if (position !is 0) {
+                OS.gtk_tree_view_set_drag_dest_row(handle, path, OS.GTK_TREE_VIEW_DROP_INTO_OR_BEFORE);
+            } else {
+                OS.gtk_tree_view_set_drag_dest_row(handle, null, OS.GTK_TREE_VIEW_DROP_BEFORE);
+            }
+        } else {
+            OS.gtk_tree_view_set_drag_dest_row(handle, null, OS.GTK_TREE_VIEW_DROP_BEFORE);
+        }
+        if (path !is null) OS.gtk_tree_path_free (path );
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/TextTransfer.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,154 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.dnd.TextTransfer;
+
+import org.eclipse.swt.internal.Converter;
+import org.eclipse.swt.internal.gtk.OS;
+import java.lang.all;
+import org.eclipse.swt.dnd.ByteArrayTransfer;
+import org.eclipse.swt.dnd.TransferData;
+import org.eclipse.swt.dnd.DND;
+
+
+/**
+ * The class <code>TextTransfer</code> provides a platform specific mechanism
+ * for converting plain text represented as a java <code>String</code>
+ * to a platform specific representation of the data and vice versa.
+ *
+ * <p>An example of a java <code>String</code> containing plain text is shown
+ * below:</p>
+ *
+ * <code><pre>
+ *     String textData = "Hello World";
+ * </code></pre>
+ *
+ * @see Transfer
+ */
+public class TextTransfer : ByteArrayTransfer {
+
+    private static TextTransfer _instance;
+    private static const String COMPOUND_TEXT = "COMPOUND_TEXT"; //$NON-NLS-1$
+    private static const String UTF8_STRING = "UTF8_STRING"; //$NON-NLS-1$
+    private static const String STRING = "STRING"; //$NON-NLS-1$
+    private static const int COMPOUND_TEXT_ID;
+    private static const int UTF8_STRING_ID;
+    private static const int STRING_ID;
+
+static this(){
+    COMPOUND_TEXT_ID = registerType(COMPOUND_TEXT);
+    UTF8_STRING_ID = registerType(UTF8_STRING);
+    STRING_ID = registerType(STRING);
+    _instance = new TextTransfer();
+}
+
+private this() {}
+
+/**
+ * Returns the singleton instance of the TextTransfer class.
+ *
+ * @return the singleton instance of the TextTransfer class
+ */
+public static TextTransfer getInstance () {
+    return _instance;
+}
+
+/**
+ * This implementation of <code>javaToNative</code> converts plain text
+ * represented by a java <code>String</code> to a platform specific representation.
+ *
+ * @param object a java <code>String</code> containing text
+ * @param transferData an empty <code>TransferData</code> object that will
+ *      be filled in on return with the platform specific format of the data
+ *
+ * @see Transfer#nativeToJava
+ */
+override public void javaToNative (Object object, TransferData transferData) {
+    transferData.result = 0;
+    if (!checkText(object) || !isSupportedType(transferData)) {
+        DND.error(DND.ERROR_INVALID_DATA);
+    }
+    String string = (cast(ArrayWrapperString)object).array;
+    char* utf8 = toStringz(string);
+    if  (transferData.type is cast(void*) COMPOUND_TEXT_ID) {
+        void* encoding;
+        int format;
+        char* ctext;
+        int length;
+        bool result = cast(bool) OS.gdk_utf8_to_compound_text(utf8, &encoding, &format, &ctext, &length);
+        if (!result) return;
+        transferData.type = encoding;
+        transferData.format = format;
+        transferData.length = length;
+        transferData.pValue = ctext;
+        transferData.result = 1;
+    }
+    if (transferData.type is cast(void*)UTF8_STRING_ID) {
+        char* pValue = cast(char*)OS.g_malloc(string.length+1);
+        if (pValue is  null) return;
+        pValue[ 0 .. string.length ] = string;
+        pValue[ string.length ] = '\0';
+        transferData.type = cast(void*)UTF8_STRING_ID;
+        transferData.format = 8;
+        transferData.length = string.length;
+        transferData.pValue = pValue;
+        transferData.result = 1;
+    }
+    if (transferData.type is cast(void*)STRING_ID) {
+        auto string_target = OS.gdk_utf8_to_string_target(utf8);
+        if (string_target is  null) return;
+        transferData.type = cast(void*)STRING_ID;
+        transferData.format = 8;
+        transferData.length = tango.stdc.string.strlen(string_target);
+        transferData.pValue = string_target;
+        transferData.result = 1;
+    }
+}
+
+/**
+ * This implementation of <code>nativeToJava</code> converts a platform specific
+ * representation of plain text to a java <code>String</code>.
+ *
+ * @param transferData the platform specific representation of the data to be converted
+ * @return a java <code>String</code> containing text if the conversion was successful; otherwise null
+ *
+ * @see Transfer#javaToNative
+ */
+override public Object nativeToJava(TransferData transferData){
+    if (!isSupportedType(transferData) ||  transferData.pValue is null) return null;
+    char** list;
+    int count = OS.gdk_text_property_to_utf8_list(transferData.type, transferData.format, transferData.pValue, transferData.length, &list);
+    if (count is 0) return null;
+    String utf8 = fromStringz( list[0] ).dup;
+    OS.g_strfreev(list);
+    return new ArrayWrapperString( utf8 );
+}
+
+override protected int[] getTypeIds() {
+    return [UTF8_STRING_ID, COMPOUND_TEXT_ID, STRING_ID];
+}
+
+override protected String[] getTypeNames() {
+    return [UTF8_STRING, COMPOUND_TEXT, STRING];
+}
+
+bool checkText(Object object) {
+    if( object is null ) return false;
+    ArrayWrapperString astr = cast(ArrayWrapperString)object;
+    if( astr is null ) return false;
+    return astr.array.length > 0;
+}
+
+protected override bool validate(Object object) {
+    return checkText(object);
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/Transfer.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,160 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.dnd.Transfer;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.internal.Converter;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.dnd.TransferData;
+
+
+/**
+ * <code>Transfer</code> provides a mechanism for converting between a java
+ * representation of data and a platform specific representation of data and
+ * vice versa.  It is used in data transfer operations such as drag and drop and
+ * clipboard copy/paste.
+ *
+ * <p>You should only need to become familiar with this class if you are
+ * implementing a Transfer subclass and you are unable to subclass the
+ * ByteArrayTransfer class.</p>
+ *
+ * @see ByteArrayTransfer
+ * @see <a href="http://www.eclipse.org/swt/snippets/#dnd">Drag and Drop snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: DNDExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public abstract class Transfer {
+
+/**
+ * Returns a list of the platform specific data types that can be converted using
+ * this transfer agent.
+ *
+ * <p>Only the data type fields of the <code>TransferData</code> objects are filled
+ * in.</p>
+ *
+ * @return a list of the data types that can be converted using this transfer agent
+ */
+abstract public TransferData[] getSupportedTypes();
+
+/**
+ * Returns true if the <code>TransferData</code> data type can be converted
+ * using this transfer agent, or false otherwise (including if transferData is
+ * <code>null</code>).
+ *
+ * @param transferData a platform specific description of a data type; only the data
+ *  type fields of the <code>TransferData</code> object need to be filled in
+ *
+ * @return true if the transferData data type can be converted using this transfer
+ * agent
+ */
+abstract public bool isSupportedType(TransferData transferData);
+
+/**
+ * Returns the platform specific names of the  data types that can be converted
+ * using this transfer agent.
+ *
+ * @return the platform specific names of the data types that can be converted
+ * using this transfer agent.
+ */
+abstract public String[] getTypeNames();
+
+/**
+ * Returns the platform specific ids of the  data types that can be converted using
+ * this transfer agent.
+ *
+ * @return the platform specific ids of the data types that can be converted using
+ * this transfer agent
+ */
+abstract public int[] getTypeIds();
+
+/**
+ * Converts a java representation of data to a platform specific representation of
+ * the data.
+ *
+ * <p>On a successful conversion, the transferData.result field will be set as follows:
+ * <ul>
+ * <li>Windows: COM.S_OK
+ * <li>Motif: 1
+ * <li>GTK: 1
+ * <li>Photon: 1
+ * </ul></p>
+ *
+ * <p>If this transfer agent is unable to perform the conversion, the transferData.result
+ * field will be set to a failure value as follows:
+ * <ul>
+ * <li>Windows: COM.DV_E_TYMED or COM.E_FAIL
+ * <li>Motif: 0
+ * <li>GTK: 0
+ * <li>Photon: 0
+ * </ul></p>
+ *
+ * @param object a java representation of the data to be converted; the type of
+ * Object that is passed in is dependent on the <code>Transfer</code> subclass.
+ *
+ * @param transferData an empty TransferData object; this object will be
+ * filled in on return with the platform specific representation of the data
+ *
+ * @exception org.eclipse.swt.SWTException <ul>
+ *    <li>ERROR_INVALID_DATA - if object does not contain data in a valid format or is <code>null</code></li>
+ * </ul>
+ */
+abstract public void javaToNative (Object object, TransferData transferData);
+
+/**
+ * Converts a platform specific representation of data to a java representation.
+ *
+ * @param transferData the platform specific representation of the data to be
+ * converted
+ *
+ * @return a java representation of the converted data if the conversion was
+ * successful; otherwise null.  If transferData is <code>null</code> then
+ * <code>null</code> is returned.  The type of Object that is returned is
+ * dependent on the <code>Transfer</code> subclass.
+ */
+abstract public Object nativeToJava(TransferData transferData);
+
+/**
+ * Registers a name for a data type and returns the associated unique identifier.
+ *
+ * <p>You may register the same type more than once, the same unique identifier
+ * will be returned if the type has been previously registered.</p>
+ *
+ * <p>Note: On windows, do <b>not</b> call this method with pre-defined
+ * Clipboard Format types such as CF_TEXT or CF_BITMAP because the
+ * pre-defined identifier will not be returned</p>
+ *
+ * @param formatName the name of a data type
+ *
+ * @return the unique identifier associated with this data type
+ */
+public static int registerType(String formatName){
+    if (formatName is null) return OS.GDK_NONE;
+    char* buffer = toStringz( formatName );
+    return cast(int)/*64*/OS.gdk_atom_intern(buffer, false);
+}
+
+/**
+ * Test that the object is of the correct format for this Transfer class.
+ *
+ * @param object a java representation of the data to be converted
+ *
+ * @return true if object is of the correct form for this transfer type
+ *
+ * @since 3.1
+ */
+public bool validate(Object object) {
+    return true;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/TransferData.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.dnd.TransferData;
+
+import java.lang.all;
+
+
+/**
+ * The <code>TransferData</code> class is a platform specific data structure for
+ * describing the type and the contents of data being converted by a transfer agent.
+ *
+ * <p>As an application writer, you do not need to know the specifics of
+ * TransferData.  TransferData instances are passed to a subclass of Transfer
+ * and the Transfer object manages the platform specific issues.
+ * You can ask a Transfer subclass if it can handle this data by calling
+ * Transfer.isSupportedType(transferData).</p>
+ *
+ * <p>You should only need to become familiar with the fields in this class if you
+ * are implementing a Transfer subclass and you are unable to subclass the
+ * ByteArrayTransfer class.</p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class TransferData {
+    /**
+     * The type is a unique identifier of a system format or user defined format.
+     * (Warning: This field is platform dependent)
+     * <p>
+     * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+     * public API. It is marked 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 accessed from application code.
+     * </p>
+     */
+    public void* type;
+
+    /**
+     * Specifies the number of units in pValue.
+     * (Warning: This field is platform dependent)
+     * <p>
+     * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+     * public API. It is marked 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 accessed from application code.
+     * </p>
+     *
+     * @see TransferData#format for the size of one unit
+     */
+    public int length;
+
+    /**
+     * Specifies the size in bits of a single unit in pValue.
+     * (Warning: This field is platform dependent)
+     * <p>
+     * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+     * public API. It is marked 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 accessed from application code.
+     * </p>
+     *
+     * This is most commonly 8 bits.
+     */
+    public int format;
+
+    /**
+     * Pointer to the data being transferred.
+     * (Warning: This field is platform dependent)
+     * <p>
+     * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+     * public API. It is marked 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 accessed from application code.
+     * </p>
+     */
+    public char* pValue;
+
+    /**
+     * The result field contains the result of converting a
+     * java data type into a platform specific value.
+     * (Warning: This field is platform dependent)
+     * <p>
+     * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+     * public API. It is marked 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 accessed from application code.
+     * </p>
+     * <p>The value of result is 1 if the conversion was successful.
+     * The value of result is 0 if the conversion failed.</p>
+     */
+    public int result;
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/TreeDragSourceEffect.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.dnd.TreeDragSourceEffect;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.dnd.DragSourceEffect;
+import org.eclipse.swt.dnd.DragSourceEvent;
+
+
+/**
+ * This class provides default implementations to display a source image
+ * when a drag is initiated from a <code>Tree</code>.
+ *
+ * <p>Classes that wish to provide their own source image for a <code>Tree</code> can
+ * extend <code>TreeDragSourceEffect</code> class and override the <code>TreeDragSourceEffect.dragStart</code>
+ * method and set the field <code>DragSourceEvent.image</code> with their own image.</p>
+ *
+ * Subclasses that override any methods of this class must call the corresponding
+ * <code>super</code> method to get the default drag under effect implementation.
+ *
+ * @see DragSourceEffect
+ * @see DragSourceEvent
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.3
+ */
+public class TreeDragSourceEffect : DragSourceEffect {
+    Image dragSourceImage = null;
+
+    /**
+     * Creates a new <code>TreeDragSourceEffect</code> to handle drag effect
+     * from the specified <code>Tree</code>.
+     *
+     * @param tree the <code>Tree</code> that the user clicks on to initiate the drag
+     */
+    public this(Tree tree) {
+        super(tree);
+    }
+
+    /**
+     * This implementation of <code>dragFinished</code> disposes the image
+     * that was created in <code>TreeDragSourceEffect.dragStart</code>.
+     *
+     * Subclasses that override this method should call <code>super.dragFinished(event)</code>
+     * to dispose the image in the default implementation.
+     *
+     * @param event the information associated with the drag finished event
+     */
+    public override void dragFinished(DragSourceEvent event) {
+        if (dragSourceImage !is null) dragSourceImage.dispose();
+        dragSourceImage = null;
+    }
+
+    /**
+     * This implementation of <code>dragStart</code> will create a default
+     * image that will be used during the drag. The image should be disposed
+     * when the drag is completed in the <code>TreeDragSourceEffect.dragFinished</code>
+     * method.
+     *
+     * Subclasses that override this method should call <code>super.dragStart(event)</code>
+     * to use the image from the default implementation.
+     *
+     * @param event the information associated with the drag start event
+     */
+    public override void dragStart(DragSourceEvent event) {
+        event.image = getDragSourceImage(event);
+    }
+
+    Image getDragSourceImage(DragSourceEvent event) {
+        if (dragSourceImage !is null) dragSourceImage.dispose();
+        dragSourceImage = null;
+
+        Tree tree = cast(Tree) control;
+        if (OS.GTK_VERSION < OS.buildVERSION (2, 2, 0)) return null;
+        //TEMPORARY CODE
+        if (tree.isListening(SWT.EraseItem) || tree.isListening (SWT.PaintItem)) return null;
+        /*
+        * Bug in GTK.  gtk_tree_selection_get_selected_rows() segmentation faults
+        * in versions smaller than 2.2.4 if the model is NULL.  The fix is
+        * to give a valid pointer instead.
+        */
+        auto handle = tree.handle;
+        auto selection = OS.gtk_tree_view_get_selection (handle);
+        int dummy;
+        void* model = OS.GTK_VERSION < OS.buildVERSION (2, 2, 4) ? &dummy : null;
+        auto list = OS.gtk_tree_selection_get_selected_rows (selection, &model);
+        if (list is null) return null;
+        int count = Math.min(10, OS.g_list_length (list));
+
+        Display display = tree.getDisplay();
+        if (count is 1) {
+            auto path = OS.g_list_nth_data (list, 0);
+            auto pixmap = OS.gtk_tree_view_create_row_drag_icon(handle, path);
+            dragSourceImage =  Image.gtk_new(display, SWT.ICON, pixmap, null);
+        } else {
+            int width = 0, height = 0;
+            int w , h;
+            int[] yy = new int[count], hh = new int[count];
+            GdkDrawable* [] pixmaps = new GdkDrawable*[count];
+            GdkRectangle rect;
+            for (int i=0; i<count; i++) {
+                auto path = OS.g_list_nth_data (list, i);
+                OS.gtk_tree_view_get_cell_area (handle, path, null, &rect);
+                pixmaps[i] = OS.gtk_tree_view_create_row_drag_icon(handle, path);
+                OS.gdk_drawable_get_size(pixmaps[i], &w, &h);
+                width = Math.max(width, w);
+                height = rect.y + h - yy[0];
+                yy[i] = rect.y;
+                hh[i] = h;
+            }
+            auto source = OS.gdk_pixmap_new(OS.GDK_ROOT_PARENT(), width, height, -1);
+            auto gcSource = OS.gdk_gc_new(source);
+            auto mask = OS.gdk_pixmap_new(OS.GDK_ROOT_PARENT(), width, height, 1);
+            auto gcMask = OS.gdk_gc_new(mask);
+            GdkColor color;
+            color.pixel = 0;
+            OS.gdk_gc_set_foreground(gcMask, &color);
+            OS.gdk_draw_rectangle(mask, gcMask, 1, 0, 0, width, height);
+            color.pixel = 1;
+            OS.gdk_gc_set_foreground(gcMask, &color);
+            for (int i=0; i<count; i++) {
+                OS.gdk_draw_drawable(source, gcSource, pixmaps[i], 0, 0, 0, yy[i] - yy[0], -1, -1);
+                OS.gdk_draw_rectangle(mask, gcMask, 1, 0, yy[i] - yy[0], width, hh[i]);
+                OS.g_object_unref(pixmaps[i]);
+            }
+            OS.g_object_unref(gcSource);
+            OS.g_object_unref(gcMask);
+            dragSourceImage  = Image.gtk_new(display, SWT.ICON, source, mask);
+        }
+        OS.g_list_free (list);
+
+        return dragSourceImage;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/TreeDropTargetEffect.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,228 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.dnd.TreeDropTargetEffect;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.dnd.DropTargetEffect;
+import org.eclipse.swt.dnd.DropTargetEvent;
+import org.eclipse.swt.dnd.DND;
+
+/**
+ * This class provides a default drag under effect (eg. select, insert, scroll and expand)
+ * when a drag occurs over a <code>Tree</code>.
+ *
+ * <p>Classes that wish to provide their own drag under effect for a <code>Tree</code>
+ * can extend the <code>TreeDropTargetEffect</code> class and override any applicable methods
+ * in <code>TreeDropTargetEffect</code> to display their own drag under effect.</p>
+ *
+ * Subclasses that override any methods of this class must call the corresponding
+ * <code>super</code> method to get the default drag under effect implementation.
+ *
+ * <p>The feedback value is either one of the FEEDBACK constants defined in
+ * class <code>DND</code> which is applicable to instances of this class,
+ * or it must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>DND</code> effect constants.
+ * </p>
+ * <p>
+ * <dl>
+ * <dt><b>Feedback:</b></dt>
+ * <dd>FEEDBACK_SELECT, FEEDBACK_INSERT_BEFORE, FEEDBACK_INSERT_AFTER, FEEDBACK_EXPAND, FEEDBACK_SCROLL</dd>
+ * </dl>
+ * </p><p>
+ * Note: Only one of the styles FEEDBACK_SELECT, FEEDBACK_INSERT_BEFORE or
+ * FEEDBACK_INSERT_AFTER may be specified.
+ * </p>
+ *
+ * @see DropTargetAdapter
+ * @see DropTargetEvent
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.3
+ */
+public class TreeDropTargetEffect : DropTargetEffect {
+    static const int SCROLL_HYSTERESIS = 150; // milli seconds
+    static const int EXPAND_HYSTERESIS = 1000; // milli seconds
+
+    int scrollIndex = -1;
+    long scrollBeginTime;
+
+    int expandIndex = -1;
+    long expandBeginTime;
+
+    /**
+     * Creates a new <code>TreeDropTargetEffect</code> to handle the drag under effect on the specified
+     * <code>Tree</code>.
+     *
+     * @param tree the <code>Tree</code> over which the user positions the cursor to drop the data
+     */
+    public this(Tree tree) {
+        super(tree);
+    }
+
+    int checkEffect(int effect) {
+        // Some effects are mutually exclusive.  Make sure that only one of the mutually exclusive effects has been specified.
+        if ((effect & DND.FEEDBACK_SELECT) !is 0) effect = effect & ~DND.FEEDBACK_INSERT_AFTER & ~DND.FEEDBACK_INSERT_BEFORE;
+        if ((effect & DND.FEEDBACK_INSERT_BEFORE) !is 0) effect = effect & ~DND.FEEDBACK_INSERT_AFTER;
+        return effect;
+    }
+
+    /**
+     * This implementation of <code>dragEnter</code> provides a default drag under effect
+     * for the feedback specified in <code>event.feedback</code>.
+     *
+     * For additional information see <code>DropTargetAdapter.dragEnter</code>.
+     *
+     * Subclasses that override this method should call <code>super.dragEnter(event)</code>
+     * to get the default drag under effect implementation.
+     *
+     * @param event  the information associated with the drag enter event
+     *
+     * @see DropTargetAdapter
+     * @see DropTargetEvent
+     */
+    public override void dragEnter(DropTargetEvent event) {
+        expandBeginTime = 0;
+        expandIndex = -1;
+        scrollBeginTime = 0;
+        scrollIndex = -1;
+    }
+
+    /**
+     * This implementation of <code>dragLeave</code> provides a default drag under effect
+     * for the feedback specified in <code>event.feedback</code>.
+     *
+     * For additional information see <code>DropTargetAdapter.dragLeave</code>.
+     *
+     * Subclasses that override this method should call <code>super.dragLeave(event)</code>
+     * to get the default drag under effect implementation.
+     *
+     * @param event  the information associated with the drag leave event
+     *
+     * @see DropTargetAdapter
+     * @see DropTargetEvent
+     */
+    public override void dragLeave(DropTargetEvent event) {
+        Tree tree = cast(Tree) control;
+        auto handle = tree.handle;
+        OS.gtk_tree_view_set_drag_dest_row(handle, null, OS.GTK_TREE_VIEW_DROP_BEFORE);
+
+        scrollBeginTime = 0;
+        scrollIndex = -1;
+        expandBeginTime = 0;
+        expandIndex = -1;
+    }
+
+    /**
+     * This implementation of <code>dragOver</code> provides a default drag under effect
+     * for the feedback specified in <code>event.feedback</code>.
+     *
+     * For additional information see <code>DropTargetAdapter.dragOver</code>.
+     *
+     * Subclasses that override this method should call <code>super.dragOver(event)</code>
+     * to get the default drag under effect implementation.
+     *
+     * @param event  the information associated with the drag over event
+     *
+     * @see DropTargetAdapter
+     * @see DropTargetEvent
+     * @see DND#FEEDBACK_SELECT
+     * @see DND#FEEDBACK_INSERT_BEFORE
+     * @see DND#FEEDBACK_INSERT_AFTER
+     * @see DND#FEEDBACK_SCROLL
+     */
+    public override void dragOver(DropTargetEvent event) {
+        Tree tree = cast(Tree) control;
+        int effect = checkEffect(event.feedback);
+
+        auto handle = tree.handle;
+        Point coordinates = new Point(event.x, event.y);
+        coordinates = tree.toControl(coordinates);
+        void* path;
+        OS.gtk_tree_view_get_path_at_pos (handle, coordinates.x, coordinates.y, &path, null, null, null);
+        int index = -1;
+        if (path !is null) {
+            auto indices = OS.gtk_tree_path_get_indices(path);
+            if (indices !is null) {
+                int depth = OS.gtk_tree_path_get_depth(path);
+                index = indices[depth - 1];
+            }
+        }
+        if ((effect & DND.FEEDBACK_SCROLL) is 0) {
+            scrollBeginTime = 0;
+            scrollIndex = -1;
+        } else {
+            if (index !is -1 && scrollIndex is index && scrollBeginTime !is 0) {
+                if (System.currentTimeMillis() >= scrollBeginTime) {
+                    GdkRectangle cellRect;
+                    OS.gtk_tree_view_get_cell_area (handle, path, null, &cellRect);
+                    if (cellRect.y < cellRect.height) {
+                        int tx, ty;
+                        OS.gtk_tree_view_widget_to_tree_coords(handle, cellRect.x, cellRect.y - cellRect.height, &tx, &ty);
+                        OS.gtk_tree_view_scroll_to_point (handle, -1, ty);
+                    } else {
+                        //scroll down
+                        OS.gtk_tree_view_get_path_at_pos (handle, coordinates.x, coordinates.y + cellRect.height, &path, null, null, null);
+                        if (path !is null) {
+                            OS.gtk_tree_view_scroll_to_cell(handle, path, null, false, 0, 0);
+                            OS.gtk_tree_path_free(path);
+                            path = null;
+                        }
+                        OS.gtk_tree_view_get_path_at_pos (handle, coordinates.x, coordinates.y, &path, null, null, null);
+                    }
+                    scrollBeginTime = 0;
+                    scrollIndex = -1;
+                }
+            } else {
+                scrollBeginTime = System.currentTimeMillis() + SCROLL_HYSTERESIS;
+                scrollIndex = index;
+            }
+        }
+        if ((effect & DND.FEEDBACK_EXPAND) is 0) {
+            expandBeginTime = 0;
+            expandIndex = -1;
+        } else {
+            if (index !is -1 && expandIndex is index && expandBeginTime !is 0) {
+                if (System.currentTimeMillis() >= expandBeginTime) {
+                    OS.gtk_tree_view_expand_row (handle, path, false);
+                    expandBeginTime = 0;
+                    expandIndex = -1;
+                }
+            } else {
+                expandBeginTime = System.currentTimeMillis() + EXPAND_HYSTERESIS;
+                expandIndex = index;
+            }
+        }
+        if (path !is null) {
+            int position = -1;
+            if ((effect & DND.FEEDBACK_SELECT) !is 0) position = OS.GTK_TREE_VIEW_DROP_INTO_OR_BEFORE;
+            if ((effect & DND.FEEDBACK_INSERT_BEFORE) !is 0) position = OS.GTK_TREE_VIEW_DROP_BEFORE;
+            if ((effect & DND.FEEDBACK_INSERT_AFTER) !is 0) position = OS.GTK_TREE_VIEW_DROP_AFTER;
+            if (position !is -1) {
+                OS.gtk_tree_view_set_drag_dest_row(handle, path, position);
+            } else {
+                OS.gtk_tree_view_set_drag_dest_row(handle, null, OS.GTK_TREE_VIEW_DROP_BEFORE);
+            }
+        } else {
+            OS.gtk_tree_view_set_drag_dest_row(handle, null, OS.GTK_TREE_VIEW_DROP_BEFORE);
+        }
+
+        if (path !is null) OS.gtk_tree_path_free (path );
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/URLTransfer.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,128 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+module org.eclipse.swt.dnd.URLTransfer;
+
+import org.eclipse.swt.internal.gtk.OS;
+
+import org.eclipse.swt.dnd.ByteArrayTransfer;
+import org.eclipse.swt.dnd.TransferData;
+import org.eclipse.swt.dnd.DND;
+
+import java.lang.all;
+
+/**
+ * The class <code>URLTransfer</code> provides a platform specific mechanism
+ * for converting text in URL format represented as a java <code>String</code>
+ * to a platform specific representation of the data and vice versa.  See
+ * <code>Transfer</code> for additional information. The string
+ *
+ * <p>An example of a java <code>String</code> containing a URL is shown below:</p>
+ *
+ * <code><pre>
+ *     String url = "http://www.eclipse.org";
+ * </code></pre>
+ *
+ * @see Transfer
+ */
+public class URLTransfer : ByteArrayTransfer {
+
+    static URLTransfer _instance;
+    private static const String TEXT_UNICODE = "text/unicode"; //$NON-NLS-1$
+    private static const String TEXT_XMOZURL = "text/x-moz-url"; //$NON-NLS-1$
+    private static int TEXT_UNICODE_ID;
+    private static int TEXT_XMOZURL_ID;
+
+static this(){
+    TEXT_UNICODE_ID = registerType(TEXT_UNICODE);
+    TEXT_XMOZURL_ID = registerType(TEXT_XMOZURL);
+    _instance = new URLTransfer();
+}
+
+private this() {}
+
+/**
+ * Returns the singleton instance of the URLTransfer class.
+ *
+ * @return the singleton instance of the URLTransfer class
+ */
+public static URLTransfer getInstance () {
+    return _instance;
+}
+
+/**
+ * This implementation of <code>javaToNative</code> converts a URL
+ * represented by a java <code>String</code> to a platform specific representation.
+ *
+ * @param object a java <code>String</code> containing a URL
+ * @param transferData an empty <code>TransferData</code> object that will
+ *      be filled in on return with the platform specific format of the data
+ * 
+ * @see Transfer#nativeToJava
+ */
+public void javaToNative (Object object, TransferData transferData){
+    transferData.result = 0;
+    if (!checkURL(object) || !isSupportedType(transferData)) {
+        DND.error(DND.ERROR_INVALID_DATA);
+    }
+    wchar[] string = (cast(ArrayWrapperString)object).array.toWCharArray();
+    int byteCount = (string.length+1)*2;
+    wchar* pValue = cast(wchar*)OS.g_malloc(byteCount);
+    if (pValue is null) return;
+    pValue[ 0 .. string.length ] = string[];
+    pValue[ string.length ] = '\0';
+    transferData.length = byteCount;
+    transferData.format = 8;
+    transferData.pValue = cast(char*)pValue;
+    transferData.result = 1;
+}
+
+/**
+ * This implementation of <code>nativeToJava</code> converts a platform 
+ * specific representation of a URL to a java <code>String</code>.
+ * 
+ * @param transferData the platform specific representation of the data to be converted
+ * @return a java <code>String</code> containing a URL if the conversion was successful;
+ *      otherwise null
+ * 
+ * @see Transfer#javaToNative
+ */
+public Object nativeToJava(TransferData transferData){
+    if (!isSupportedType(transferData) ||  transferData.pValue is null) return null;
+    /* Ensure byteCount is a multiple of 2 bytes */
+    int size = (transferData.format * transferData.length / 8) / 2 * 2;
+    if (size <= 0) return null;
+    // The string can be terminated with NULL or it is as a maximum of length size
+    for( int i = 0; i < size; i++ ){
+        if( (cast(wchar*)transferData.pValue)[i] == '\0' ){
+            size = i;
+            break;
+        }
+    }
+    String string = tango.text.convert.Utf.toString((cast(wchar*)transferData.pValue)[ 0 .. size ]);
+    return new ArrayWrapperString( string );
+}
+
+protected int[] getTypeIds(){
+    return [TEXT_XMOZURL_ID, TEXT_UNICODE_ID];
+}
+
+protected String[] getTypeNames(){
+    return [TEXT_XMOZURL, TEXT_UNICODE];
+}
+
+bool checkURL(Object object) {
+    return object !is null && (null !is cast(ArrayWrapperString)object) && (cast(ArrayWrapperString)object).array.length > 0;
+}
+
+protected bool validate(Object object) {
+    return checkURL(object);
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/dnd/all.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,33 @@
+module org.eclipse.swt.dnd.all;
+
+import java.lang.all;
+
+public import org.eclipse.swt.dnd.ByteArrayTransfer;
+public import org.eclipse.swt.dnd.Clipboard;
+public import org.eclipse.swt.dnd.ClipboardProxy;
+public import org.eclipse.swt.dnd.DND;
+public import org.eclipse.swt.dnd.DNDEvent;
+public import org.eclipse.swt.dnd.DNDListener;
+public import org.eclipse.swt.dnd.DragSource;
+public import org.eclipse.swt.dnd.DragSourceAdapter;
+public import org.eclipse.swt.dnd.DragSourceEffect;
+public import org.eclipse.swt.dnd.DragSourceEvent;
+public import org.eclipse.swt.dnd.DragSourceListener;
+public import org.eclipse.swt.dnd.DropTarget;
+public import org.eclipse.swt.dnd.DropTargetAdapter;
+public import org.eclipse.swt.dnd.DropTargetEffect;
+public import org.eclipse.swt.dnd.DropTargetEvent;
+public import org.eclipse.swt.dnd.DropTargetListener;
+public import org.eclipse.swt.dnd.FileTransfer;
+public import org.eclipse.swt.dnd.HTMLTransfer;
+public import org.eclipse.swt.dnd.ImageTransfer;
+public import org.eclipse.swt.dnd.RTFTransfer;
+public import org.eclipse.swt.dnd.TableDragSourceEffect;
+public import org.eclipse.swt.dnd.TableDropTargetEffect;
+public import org.eclipse.swt.dnd.TextTransfer;
+public import org.eclipse.swt.dnd.Transfer;
+public import org.eclipse.swt.dnd.TransferData;
+public import org.eclipse.swt.dnd.TreeDragSourceEffect;
+public import org.eclipse.swt.dnd.TreeDropTargetEffect;
+public import org.eclipse.swt.dnd.URLTransfer;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/ArmEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.ArmEvent;
+
+import java.lang.all;
+
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.events.TypedEvent;
+
+/**
+ * Instances of this class are sent as a result of
+ * a widget such as a menu item being armed.
+ *
+ * @see ArmListener
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public final class ArmEvent : TypedEvent {
+
+    //static final long serialVersionUID = 3258126964249212217L;
+
+/**
+ * Constructs a new instance of this class based on the
+ * information in the given untyped event.
+ *
+ * @param e the untyped event containing the information
+ */
+public this(Event e) {
+    super(e);
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/ArmListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.ArmListener;
+
+import java.lang.all;
+
+public import org.eclipse.swt.internal.SWTEventListener;
+public import org.eclipse.swt.events.ArmEvent;
+
+/**
+ * Classes which implement this interface provide a method
+ * that deals with the event that is generated when a widget,
+ * such as a menu item, is armed.
+ * <p>
+ * After creating an instance of a class that :
+ * this interface it can be added to a widget using the
+ * <code>addArmListener</code> method and removed using
+ * the <code>removeArmListener</code> method. When the
+ * widget is armed, the widgetArmed method will be invoked.
+ * </p>
+ *
+ * @see ArmEvent
+ */
+public interface ArmListener : SWTEventListener {
+
+/**
+ * Sent when a widget is armed, or 'about to be selected'.
+ *
+ * @param e an event containing information about the arm
+ */
+public void widgetArmed(ArmEvent e);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/ControlAdapter.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.ControlAdapter;
+
+import java.lang.all;
+
+import org.eclipse.swt.events.ControlListener;
+/**
+ * This adapter class provides default implementations for the
+ * methods described by the <code>ControlListener</code> interface.
+ * <p>
+ * Classes that wish to deal with <code>ControlEvent</code>s can
+ * extend this class and override only the methods which they are
+ * interested in.
+ * </p>
+ *
+ * @see ControlListener
+ * @see ControlEvent
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public abstract class ControlAdapter : ControlListener {
+
+/**
+ * Sent when the location (x, y) of a control changes relative
+ * to its parent (or relative to the display, for <code>Shell</code>s).
+ * The default behavior is to do nothing.
+ *
+ * @param e an event containing information about the move
+ */
+public void controlMoved(ControlEvent e) {
+}
+
+/**
+ * Sent when the size (width, height) of a control changes.
+ * The default behavior is to do nothing.
+ *
+ * @param e an event containing information about the resize
+ */
+public void controlResized(ControlEvent e) {
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/ControlEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.ControlEvent;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.events.TypedEvent;
+
+/**
+ * Instances of this class are sent as a result of
+ * controls being moved or resized.
+ *
+ * @see ControlListener
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public final class ControlEvent : TypedEvent {
+
+    //static final long serialVersionUID = 3258132436155119161L;
+
+/**
+ * Constructs a new instance of this class based on the
+ * information in the given untyped event.
+ *
+ * @param e the untyped event containing the information
+ */
+public this(Event e) {
+    super(e);
+}
+
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/ControlListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.ControlListener;
+
+import java.lang.all;
+
+public import org.eclipse.swt.internal.SWTEventListener;
+public import org.eclipse.swt.events.ControlEvent;
+
+/**
+ * Classes which implement this interface provide methods
+ * that deal with the events that are generated by moving
+ * and resizing controls.
+ * <p>
+ * After creating an instance of a class that :
+ * this interface it can be added to a control using the
+ * <code>addControlListener</code> method and removed using
+ * the <code>removeControlListener</code> method. When a
+ * control is moved or resized, the appropriate method will
+ * be invoked.
+ * </p>
+ *
+ * @see ControlAdapter
+ * @see ControlEvent
+ */
+public interface ControlListener : SWTEventListener {
+
+/**
+ * Sent when the location (x, y) of a control changes relative
+ * to its parent (or relative to the display, for <code>Shell</code>s).
+ *
+ * @param e an event containing information about the move
+ */
+public void controlMoved(ControlEvent e);
+
+/**
+ * Sent when the size (width, height) of a control changes.
+ *
+ * @param e an event containing information about the resize
+ */
+public void controlResized(ControlEvent e);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/DisposeEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.DisposeEvent;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.events.TypedEvent;
+
+/**
+ * Instances of this class are sent as a result of
+ * widgets being disposed.
+ *
+ * @see DisposeListener
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public final class DisposeEvent : TypedEvent {
+
+    //static final long serialVersionUID = 3257566187633521206L;
+
+/**
+ * Constructs a new instance of this class based on the
+ * information in the given untyped event.
+ *
+ * @param e the untyped event containing the information
+ */
+public this(Event e) {
+    super(e);
+}
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/DisposeListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.DisposeListener;
+
+import java.lang.all;
+
+
+public import org.eclipse.swt.internal.SWTEventListener;
+public import org.eclipse.swt.events.DisposeEvent;
+
+/**
+ * Classes which implement this interface provide a method
+ * that deals with the event that is generated when a widget
+ * is disposed.
+ * <p>
+ * After creating an instance of a class that :
+ * this interface it can be added to a widget using the
+ * <code>addDisposeListener</code> method and removed using
+ * the <code>removeDisposeListener</code> method. When a
+ * widget is disposed, the widgetDisposed method will
+ * be invoked.
+ * </p>
+ *
+ * @see DisposeEvent
+ */
+public interface DisposeListener : SWTEventListener {
+
+/**
+ * Sent when the widget is disposed.
+ *
+ * @param e an event containing information about the dispose
+ */
+public void widgetDisposed(DisposeEvent e);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/DragDetectEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.DragDetectEvent;
+
+import java.lang.all;
+
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.events.MouseEvent;
+
+/**
+ * Instances of this class are sent as a result of
+ * a drag gesture.
+ *
+ * @see DragDetectListener
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.3
+ */
+
+public final class DragDetectEvent : MouseEvent {
+
+    //private static final long serialVersionUID = -7229172519733647232L;
+
+/**
+ * Constructs a new instance of this class based on the
+ * information in the given untyped event.
+ *
+ * @param e the untyped event containing the information
+ */
+public this(Event e) {
+    super(e);
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/DragDetectListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.DragDetectListener;
+
+import java.lang.all;
+
+
+public import org.eclipse.swt.internal.SWTEventListener;
+public import org.eclipse.swt.events.DragDetectEvent;
+
+/**
+ * Classes which implement this interface provide methods
+ * that deal with the events that are generated when a drag
+ * gesture is detected.
+ * <p>
+ * After creating an instance of a class that :
+ * this interface it can be added to a control using the
+ * <code>addDragDetectListener</code> method and removed using
+ * the <code>removeDragDetectListener</code> method. When the
+ * drag is detected, the drageDetected method will be invoked.
+ * </p>
+ *
+ * @see DragDetectEvent
+ *
+ * @since 3.3
+ */
+public interface DragDetectListener : SWTEventListener {
+
+/**
+ * Sent when a drag gesture is detected.
+ *
+ * @param e an event containing information about the drag
+ */
+public void dragDetected(DragDetectEvent e);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/ExpandAdapter.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.ExpandAdapter;
+
+import java.lang.all;
+
+import org.eclipse.swt.events.ExpandListener;
+
+/**
+ * This adapter class provides default implementations for the
+ * methods described by the <code>ExpandListener</code> interface.
+ * <p>
+ * Classes that wish to deal with <code>ExpandEvent</code>s can
+ * extend this class and override only the methods which they are
+ * interested in.
+ * </p>
+ *
+ * @see ExpandListener
+ * @see ExpandEvent
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.2
+ */
+public abstract class ExpandAdapter : ExpandListener {
+
+/**
+ * Sent when an item is collapsed.
+ * The default behavior is to do nothing.
+ *
+ * @param e an event containing information about the operation
+ */
+public void itemCollapsed(ExpandEvent e) {
+}
+
+/**
+ * Sent when an item is expanded.
+ * The default behavior is to do nothing.
+ *
+ * @param e an event containing information about the operation
+ */
+public void itemExpanded(ExpandEvent e) {
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/ExpandEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.ExpandEvent;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.events.SelectionEvent;
+
+/**
+ * Instances of this class are sent as a result of
+ * <code>ExpandItem</code>s being expanded or collapsed.
+ *
+ * @see ExpandListener
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.2
+ */
+
+public class ExpandEvent : SelectionEvent {
+
+    //static final long serialVersionUID = 3976735856884987356L;
+
+/**
+ * Constructs a new instance of this class based on the
+ * information in the given untyped event.
+ *
+ * @param e the untyped event containing the information
+ */
+public this(Event e) {
+    super(e);
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/ExpandListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.ExpandListener;
+
+import java.lang.all;
+
+
+public import org.eclipse.swt.internal.SWTEventListener;
+public import org.eclipse.swt.events.ExpandEvent;
+
+/**
+ * Classes which implement this interface provide methods
+ * that deal with the expanding and collapsing of <code>ExpandItem</code>s.
+ *
+ * <p>
+ * After creating an instance of a class that :
+ * this interface it can be added to a <code>ExpandBar</code>
+ * control using the <code>addExpandListener</code> method and
+ * removed using the <code>removeExpandListener</code> method.
+ * When a item of the <code>ExpandBar</code> is expanded or
+ * collapsed, the appropriate method will be invoked.
+ * </p>
+ *
+ * @see ExpandAdapter
+ * @see ExpandEvent
+ *
+ * @since 3.2
+ */
+public interface ExpandListener : SWTEventListener {
+
+/**
+ * Sent when an item is collapsed.
+ *
+ * @param e an event containing information about the operation
+ */
+public void itemCollapsed(ExpandEvent e);
+
+/**
+ * Sent when an item is expanded.
+ *
+ * @param e an event containing information about the operation
+ */
+public void itemExpanded(ExpandEvent e);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/FocusAdapter.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.FocusAdapter;
+
+import java.lang.all;
+
+import org.eclipse.swt.events.FocusListener;
+
+/**
+ * This adapter class provides default implementations for the
+ * methods described by the <code>FocusListener</code> interface.
+ * <p>
+ * Classes that wish to deal with <code>FocusEvent</code>s can
+ * extend this class and override only the methods which they are
+ * interested in.
+ * </p>
+ *
+ * @see FocusListener
+ * @see FocusEvent
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public abstract class FocusAdapter : FocusListener {
+
+/**
+ * Sent when a control gets focus.
+ * The default behavior is to do nothing.
+ *
+ * @param e an event containing information about the focus change
+ */
+public void focusGained(FocusEvent e) {
+}
+
+/**
+ * Sent when a control loses focus.
+ * The default behavior is to do nothing.
+ *
+ * @param e an event containing information about the focus change
+ */
+public void focusLost(FocusEvent e) {
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/FocusEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.FocusEvent;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.events.TypedEvent;
+
+/**
+ * Instances of this class are sent as a result of
+ * widgets gaining and losing focus.
+ *
+ * @see FocusListener
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public final class FocusEvent : TypedEvent {
+
+    //static final long serialVersionUID = 3258134643684227381L;
+
+/**
+ * Constructs a new instance of this class based on the
+ * information in the given untyped event.
+ *
+ * @param e the untyped event containing the information
+ */
+public this(Event e) {
+    super(e);
+}
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/FocusListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.FocusListener;
+
+import java.lang.all;
+
+
+public import org.eclipse.swt.internal.SWTEventListener;
+public import org.eclipse.swt.events.FocusEvent;
+
+/**
+ * Classes which implement this interface provide methods
+ * that deal with the events that are generated as controls
+ * gain and lose focus.
+ * <p>
+ * After creating an instance of a class that :
+ * this interface it can be added to a control using the
+ * <code>addFocusListener</code> method and removed using
+ * the <code>removeFocusListener</code> method. When a
+ * control gains or loses focus, the appropriate method
+ * will be invoked.
+ * </p>
+ *
+ * @see FocusAdapter
+ * @see FocusEvent
+ */
+public interface FocusListener : SWTEventListener {
+
+/**
+ * Sent when a control gets focus.
+ *
+ * @param e an event containing information about the focus change
+ */
+public void focusGained(FocusEvent e);
+
+/**
+ * Sent when a control loses focus.
+ *
+ * @param e an event containing information about the focus change
+ */
+public void focusLost(FocusEvent e);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/HelpEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.HelpEvent;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.events.TypedEvent;
+
+/**
+ * Instances of this class are sent as a result of
+ * help being requested for a widget.
+ *
+ * @see HelpListener
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public final class HelpEvent : TypedEvent {
+
+    //static final long serialVersionUID = 3257001038606251315L;
+
+/**
+ * Constructs a new instance of this class based on the
+ * information in the given untyped event.
+ *
+ * @param e the untyped event containing the information
+ */
+public this(Event e) {
+    super(e);
+}
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/HelpListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.HelpListener;
+
+import java.lang.all;
+
+
+public import org.eclipse.swt.internal.SWTEventListener;
+public import org.eclipse.swt.events.HelpEvent;
+
+/**
+ * Classes which implement this interface provide a method
+ * that deals with the event that is generated when help is
+ * requested for a control, typically when the user presses F1.
+ * <p>
+ * After creating an instance of a class that :
+ * this interface it can be added to a control using the
+ * <code>addHelpListener</code> method and removed using
+ * the <code>removeHelpListener</code> method. When help
+ * is requested for a control, the helpRequested method
+ * will be invoked.
+ * </p>
+ *
+ * @see HelpEvent
+ */
+public interface HelpListener : SWTEventListener {
+
+/**
+ * Sent when help is requested for a control, typically
+ * when the user presses F1.
+ *
+ * @param e an event containing information about the help
+ */
+public void helpRequested(HelpEvent e);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/KeyAdapter.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.KeyAdapter;
+
+import java.lang.all;
+
+import org.eclipse.swt.events.KeyListener;
+
+/**
+ * This adapter class provides default implementations for the
+ * methods described by the <code>KeyListener</code> interface.
+ * <p>
+ * Classes that wish to deal with <code>KeyEvent</code>s can
+ * extend this class and override only the methods which they are
+ * interested in.
+ * </p>
+ *
+ * @see KeyListener
+ * @see KeyEvent
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public abstract class KeyAdapter : KeyListener {
+
+/**
+ * Sent when a key is pressed on the system keyboard.
+ * The default behavior is to do nothing.
+ *
+ * @param e an event containing information about the key press
+ */
+public void keyPressed(KeyEvent e) {
+}
+
+/**
+ * Sent when a key is released on the system keyboard.
+ * The default behavior is to do nothing.
+ *
+ * @param e an event containing information about the key release
+ */
+public void keyReleased(KeyEvent e) {
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/KeyEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.KeyEvent;
+
+
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.events.TypedEvent;
+
+import tango.text.convert.Format;
+import java.lang.all;
+
+/**
+ * Instances of this class are sent as a result of
+ * keys being pressed and released on the keyboard.
+ * <p>
+ * When a key listener is added to a control, the control
+ * will take part in widget traversal.  By default, all
+ * traversal keys (such as the tab key and so on) are
+ * delivered to the control.  In order for a control to take
+ * part in traversal, it should listen for traversal events.
+ * Otherwise, the user can traverse into a control but not
+ * out.  Note that native controls such as table and tree
+ * implement key traversal in the operating system.  It is
+ * not necessary to add traversal listeners for these controls,
+ * unless you want to override the default traversal.
+ * </p>
+ *
+ * @see KeyListener
+ * @see TraverseListener
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public class KeyEvent : TypedEvent {
+
+    /**
+     * the character represented by the key that was typed.
+     * This is the final character that results after all modifiers have been
+     * applied.  For example, when the user types Ctrl+A, the character value
+     * is 0x01.  It is important that applications do not attempt to modify the
+     * character value based on a stateMask (such as SWT.CTRL) or the resulting
+     * character will not be correct.
+     */
+    public wchar character = '\0';
+
+    /**
+     * the key code of the key that was typed,
+     * as defined by the key code constants in class <code>SWT</code>.
+     * When the character field of the event is ambiguous, this field
+     * contains the unicode value of the original character.  For example,
+     * typing Ctrl+M or Return both result in the character '\r' but the
+     * keyCode field will also contain '\r' when Return was typed.
+     *
+     * @see org.eclipse.swt.SWT
+     */
+    public int keyCode;
+
+    /**
+     * the state of the keyboard modifier keys at the time
+     * the event was generated, as defined by the key code
+     * constants in class <code>SWT</code>.
+     *
+     * @see org.eclipse.swt.SWT
+     */
+    public int stateMask;
+
+    /**
+     * A flag indicating whether the operation should be allowed.
+     * Setting this field to <code>false</code> will cancel the operation.
+     */
+    public bool doit;
+
+    static final long serialVersionUID = 3256442491011412789L;
+
+/**
+ * Constructs a new instance of this class based on the
+ * information in the given untyped event.
+ *
+ * @param e the untyped event containing the information
+ */
+public this(Event e) {
+    super(e);
+    this.character = e.character;
+    this.keyCode = e.keyCode;
+    this.stateMask = e.stateMask;
+    this.doit = e.doit;
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+public override String toString() {
+    return Format( "{} character={} keyCode={} stateMask={} doit={}}",
+        super.toString[ 0 .. $-2 ],
+        character, keyCode, stateMask, doit );
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/KeyListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.KeyListener;
+
+import java.lang.all;
+
+
+public import org.eclipse.swt.internal.SWTEventListener;
+public import org.eclipse.swt.events.KeyEvent;
+
+/**
+ * Classes which implement this interface provide methods
+ * that deal with the events that are generated as keys
+ * are pressed on the system keyboard.
+ * <p>
+ * After creating an instance of a class that :
+ * this interface it can be added to a control using the
+ * <code>addKeyListener</code> method and removed using
+ * the <code>removeKeyListener</code> method. When a
+ * key is pressed or released, the appropriate method will
+ * be invoked.
+ * </p>
+ *
+ * @see KeyAdapter
+ * @see KeyEvent
+ */
+public interface KeyListener : SWTEventListener {
+
+/**
+ * Sent when a key is pressed on the system keyboard.
+ *
+ * @param e an event containing information about the key press
+ */
+public void keyPressed(KeyEvent e);
+
+/**
+ * Sent when a key is released on the system keyboard.
+ *
+ * @param e an event containing information about the key release
+ */
+public void keyReleased(KeyEvent e);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/MenuAdapter.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.MenuAdapter;
+
+import java.lang.all;
+
+import org.eclipse.swt.events.MenuListener;
+
+/**
+ * This adapter class provides default implementations for the
+ * methods described by the <code>MenuListener</code> interface.
+ * <p>
+ * Classes that wish to deal with <code>MenuEvent</code>s can
+ * extend this class and override only the methods which they are
+ * interested in.
+ * </p>
+ *
+ * @see MenuListener
+ * @see MenuEvent
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public abstract class MenuAdapter : MenuListener {
+
+/**
+ * Sent when a menu is hidden.
+ * The default behavior is to do nothing.
+ *
+ * @param e an event containing information about the menu operation
+ */
+public void menuHidden(MenuEvent e) {
+}
+
+/**
+ * Sent when a menu is shown.
+ * The default behavior is to do nothing.
+ *
+ * @param e an event containing information about the menu operation
+ */
+public void menuShown(MenuEvent e) {
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/MenuDetectEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.MenuDetectEvent;
+
+
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.events.TypedEvent;
+
+import tango.text.convert.Format;
+import java.lang.all;
+
+/**
+ * Instances of this class are sent whenever the platform-
+ * specific trigger for showing a context menu is detected.
+ *
+ * @see MenuDetectListener
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.3
+ */
+
+public final class MenuDetectEvent : TypedEvent {
+
+    /**
+     * the display-relative x coordinate of the pointer
+     * at the time the context menu trigger occurred
+     */
+    public int x;
+
+    /**
+     * the display-relative y coordinate of the pointer
+     * at the time the context menu trigger occurred
+     */
+    public int y;
+
+    /**
+     * A flag indicating whether the operation should be allowed.
+     * Setting this field to <code>false</code> will cancel the operation.
+     */
+    public bool doit;
+
+    //private static final long serialVersionUID = -3061660596590828941L;
+
+/**
+ * Constructs a new instance of this class based on the
+ * information in the given untyped event.
+ *
+ * @param e the untyped event containing the information
+ */
+public this(Event e) {
+    super(e);
+    this.x = e.x;
+    this.y = e.y;
+    this.doit = e.doit;
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+public override String toString() {
+    return Format( "{} x={} y={} doit={}}", super.toString[ 0 .. $-2 ], x, y, doit );
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/MenuDetectListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.MenuDetectListener;
+
+import java.lang.all;
+
+
+public import org.eclipse.swt.internal.SWTEventListener;
+public import org.eclipse.swt.events.MenuDetectEvent;
+
+/**
+ * Classes which implement this interface provide methods
+ * that deal with the events that are generated when the
+ * platform-specific trigger for showing a context menu is
+ * detected.
+ * <p>
+ * After creating an instance of a class that :
+ * this interface it can be added to a control or TrayItem
+ * using the <code>addMenuDetectListener</code> method and
+ * removed using the <code>removeMenuDetectListener</code> method.
+ * When the context menu trigger occurs, the
+ * <code>menuDetected</code> method will be invoked.
+ * </p>
+ *
+ * @see MenuDetectEvent
+ *
+ * @since 3.3
+ */
+public interface MenuDetectListener : SWTEventListener {
+
+/**
+ * Sent when the platform-dependent trigger for showing a menu item is detected.
+ *
+ * @param e an event containing information about the menu detect
+ */
+public void menuDetected (MenuDetectEvent e);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/MenuEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.MenuEvent;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.events.TypedEvent;
+
+/**
+ * Instances of this class are sent as a result of
+ * menus being shown and hidden.
+ *
+ * @see MenuListener
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public final class MenuEvent : TypedEvent {
+
+    //static final long serialVersionUID = 3258132440332383025L;
+
+/**
+ * Constructs a new instance of this class based on the
+ * information in the given untyped event.
+ *
+ * @param e the untyped event containing the information
+ */
+public this(Event e) {
+    super(e);
+}
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/MenuListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.MenuListener;
+
+import java.lang.all;
+
+
+public import org.eclipse.swt.internal.SWTEventListener;
+public import org.eclipse.swt.events.MenuEvent;
+
+/**
+ * Classes which implement this interface provide methods
+ * that deal with the hiding and showing of menus.
+ * <p>
+ * After creating an instance of a class that :
+ * this interface it can be added to a menu using the
+ * <code>addMenuListener</code> method and removed using
+ * the <code>removeMenuListener</code> method. When the
+ * menu is hidden or shown, the appropriate method will
+ * be invoked.
+ * </p>
+ *
+ * @see MenuAdapter
+ * @see MenuEvent
+ */
+public interface MenuListener : SWTEventListener {
+
+/**
+ * Sent when a menu is hidden.
+ *
+ * @param e an event containing information about the menu operation
+ */
+public void menuHidden(MenuEvent e);
+
+/**
+ * Sent when a menu is shown.
+ *
+ * @param e an event containing information about the menu operation
+ */
+public void menuShown(MenuEvent e);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/ModifyEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.ModifyEvent;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.events.TypedEvent;
+
+/**
+ * Instances of this class are sent as a result of
+ * text being modified.
+ *
+ * @see ModifyListener
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public final class ModifyEvent : TypedEvent {
+
+    //static final long serialVersionUID = 3258129146227011891L;
+
+/**
+ * Constructs a new instance of this class based on the
+ * information in the given untyped event.
+ *
+ * @param e the untyped event containing the information
+ */
+public this(Event e) {
+    super(e);
+}
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/ModifyListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.ModifyListener;
+
+import java.lang.all;
+
+
+public import org.eclipse.swt.internal.SWTEventListener;
+public import org.eclipse.swt.events.ModifyEvent;
+
+/**
+ * Classes which implement this interface provide a method
+ * that deals with the events that are generated when text
+ * is modified.
+ * <p>
+ * After creating an instance of a class that :
+ * this interface it can be added to a text widget using the
+ * <code>addModifyListener</code> method and removed using
+ * the <code>removeModifyListener</code> method. When the
+ * text is modified, the modifyText method will be invoked.
+ * </p>
+ *
+ * @see ModifyEvent
+ */
+public interface ModifyListener : SWTEventListener {
+
+/**
+ * Sent when the text is modified.
+ *
+ * @param e an event containing information about the modify
+ */
+public void modifyText(ModifyEvent e);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/MouseAdapter.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.MouseAdapter;
+
+import java.lang.all;
+
+import org.eclipse.swt.events.MouseListener;
+
+/**
+ * This adapter class provides default implementations for the
+ * methods described by the <code>MouseListener</code> interface.
+ * <p>
+ * Classes that wish to deal with <code>MouseEvent</code>s
+ * which occur as mouse buttons are pressed and released can
+ * extend this class and override only the methods which they are
+ * interested in.
+ * </p>
+ *
+ * @see MouseListener
+ * @see MouseEvent
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public abstract class MouseAdapter : MouseListener {
+
+/**
+ * Sent when a mouse button is pressed twice within the
+ * (operating system specified) double click period.
+ * The default behavior is to do nothing.
+ *
+ * @param e an event containing information about the mouse double click
+ *
+ * @see org.eclipse.swt.widgets.Display#getDoubleClickTime()
+ */
+public void mouseDoubleClick(MouseEvent e) {
+}
+
+/**
+ * Sent when a mouse button is pressed.
+ * The default behavior is to do nothing.
+ *
+ * @param e an event containing information about the mouse button press
+ */
+public void mouseDown(MouseEvent e) {
+}
+
+/**
+ * Sent when a mouse button is released.
+ * The default behavior is to do nothing.
+ *
+ * @param e an event containing information about the mouse button release
+ */
+public void mouseUp(MouseEvent e) {
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/MouseEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.MouseEvent;
+
+
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.events.TypedEvent;
+
+import tango.text.convert.Format;
+import java.lang.all;
+
+/**
+ * Instances of this class are sent whenever mouse
+ * related actions occur. This includes mouse buttons
+ * being pressed and released, the mouse pointer being
+ * moved and the mouse pointer crossing widget boundaries.
+ * <p>
+ * Note: The <code>button</code> field is an integer that
+ * represents the mouse button number.  This is not the same
+ * as the <code>SWT</code> mask constants <code>BUTTONx</code>.
+ * </p>
+ *
+ * @see MouseListener
+ * @see MouseMoveListener
+ * @see MouseTrackListener
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public class MouseEvent : TypedEvent {
+
+    /**
+     * the button that was pressed or released; 1 for the
+     * first button, 2 for the second button, and 3 for the
+     * third button, etc.
+     */
+    public int button;
+
+    /**
+     * the state of the keyboard modifier keys at the time
+     * the event was generated
+     */
+    public int stateMask;
+
+    /**
+     * the widget-relative, x coordinate of the pointer
+     * at the time the mouse button was pressed or released
+     */
+    public int x;
+
+    /**
+     * the widget-relative, y coordinate of the pointer
+     * at the time the mouse button was pressed or released
+     */
+    public int y;
+
+    /**
+     * the number times the mouse has been clicked, as defined
+     * by the operating system; 1 for the first click, 2 for the
+     * second click and so on.
+     *
+     * @since 3.3
+     */
+    public int count;
+
+    //static final long serialVersionUID = 3257288037011566898L;
+
+/**
+ * Constructs a new instance of this class based on the
+ * information in the given untyped event.
+ *
+ * @param e the untyped event containing the information
+ */
+public this(Event e) {
+    super(e);
+    this.x = e.x;
+    this.y = e.y;
+    this.button = e.button;
+    this.stateMask = e.stateMask;
+    this.count = e.count;
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+public override String toString() {
+    return Format( "{} button={} stateMask={} x={} y={} count={}}",
+        super.toString[ 0 .. $-1 ],
+        button, stateMask, x, y, count );
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/MouseListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.MouseListener;
+
+import java.lang.all;
+
+
+public import org.eclipse.swt.internal.SWTEventListener;
+public import org.eclipse.swt.events.MouseEvent;
+
+/**
+ * Classes which implement this interface provide methods
+ * that deal with the events that are generated as mouse buttons
+ * are pressed.
+ * <p>
+ * After creating an instance of a class that :
+ * this interface it can be added to a control using the
+ * <code>addMouseListener</code> method and removed using
+ * the <code>removeMouseListener</code> method. When a
+ * mouse button is pressed or released, the appropriate method
+ * will be invoked.
+ * </p>
+ *
+ * @see MouseAdapter
+ * @see MouseEvent
+ */
+public interface MouseListener : SWTEventListener {
+
+/**
+ * Sent when a mouse button is pressed twice within the
+ * (operating system specified) double click period.
+ *
+ * @param e an event containing information about the mouse double click
+ *
+ * @see org.eclipse.swt.widgets.Display#getDoubleClickTime()
+ */
+public void mouseDoubleClick(MouseEvent e);
+
+/**
+ * Sent when a mouse button is pressed.
+ *
+ * @param e an event containing information about the mouse button press
+ */
+public void mouseDown(MouseEvent e);
+
+/**
+ * Sent when a mouse button is released.
+ *
+ * @param e an event containing information about the mouse button release
+ */
+public void mouseUp(MouseEvent e);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/MouseMoveListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.MouseMoveListener;
+
+import java.lang.all;
+
+
+public import org.eclipse.swt.internal.SWTEventListener;
+public import org.eclipse.swt.events.MouseEvent;
+
+/**
+ * Classes which implement this interface provide a method
+ * that deals with the events that are generated as the mouse
+ * pointer moves.
+ * <p>
+ * After creating an instance of a class that :
+ * this interface it can be added to a control using the
+ * <code>addMouseMoveListener</code> method and removed using
+ * the <code>removeMouseMoveListener</code> method. As the
+ * mouse moves, the mouseMove method will be invoked.
+ * </p>
+ *
+ * @see MouseEvent
+ */
+public interface MouseMoveListener : SWTEventListener {
+
+/**
+ * Sent when the mouse moves.
+ *
+ * @param e an event containing information about the mouse move
+ */
+public void mouseMove(MouseEvent e);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/MouseTrackAdapter.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.MouseTrackAdapter;
+
+import java.lang.all;
+
+import org.eclipse.swt.events.MouseTrackListener;
+
+/**
+ * This adapter class provides default implementations for the
+ * methods described by the <code>MouseTrackListener</code> interface.
+ * <p>
+ * Classes that wish to deal with <code>MouseEvent</code>s which
+ * occur as the mouse pointer passes (or hovers) over controls can
+ * extend this class and override only the methods which they are
+ * interested in.
+ * </p>
+ *
+ * @see MouseTrackListener
+ * @see MouseEvent
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public abstract class MouseTrackAdapter : MouseTrackListener {
+
+/**
+ * Sent when the mouse pointer passes into the area of
+ * the screen covered by a control.
+ * The default behavior is to do nothing.
+ *
+ * @param e an event containing information about the mouse enter
+ */
+public void mouseEnter(MouseEvent e) {
+}
+
+/**
+ * Sent when the mouse pointer passes out of the area of
+ * the screen covered by a control.
+ * The default behavior is to do nothing.
+ *
+ * @param e an event containing information about the mouse exit
+ */
+public void mouseExit(MouseEvent e) {
+}
+
+/**
+ * Sent when the mouse pointer hovers (that is, stops moving
+ * for an (operating system specified) period of time) over
+ * a control.
+ * The default behavior is to do nothing.
+ *
+ * @param e an event containing information about the hover
+ */
+public void mouseHover(MouseEvent e) {
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/MouseTrackListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.MouseTrackListener;
+
+import java.lang.all;
+
+
+public import org.eclipse.swt.internal.SWTEventListener;
+public import org.eclipse.swt.events.MouseEvent;
+
+/**
+ * Classes which implement this interface provide methods
+ * that deal with the events that are generated as the mouse
+ * pointer passes (or hovers) over controls.
+ * <p>
+ * After creating an instance of a class that :
+ * this interface it can be added to a control using the
+ * <code>addMouseTrackListener</code> method and removed using
+ * the <code>removeMouseTrackListener</code> method. When the
+ * mouse pointer passes into or out of the area of the screen
+ * covered by a control or pauses while over a control, the
+ * appropriate method will be invoked.
+ * </p>
+ *
+ * @see MouseTrackAdapter
+ * @see MouseEvent
+ */
+public interface MouseTrackListener : SWTEventListener {
+
+/**
+ * Sent when the mouse pointer passes into the area of
+ * the screen covered by a control.
+ *
+ * @param e an event containing information about the mouse enter
+ */
+public void mouseEnter(MouseEvent e);
+
+/**
+ * Sent when the mouse pointer passes out of the area of
+ * the screen covered by a control.
+ *
+ * @param e an event containing information about the mouse exit
+ */
+public void mouseExit(MouseEvent e);
+
+/**
+ * Sent when the mouse pointer hovers (that is, stops moving
+ * for an (operating system specified) period of time) over
+ * a control.
+ *
+ * @param e an event containing information about the hover
+ */
+public void mouseHover(MouseEvent e);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/MouseWheelListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.MouseWheelListener;
+
+import java.lang.all;
+
+
+public import org.eclipse.swt.internal.SWTEventListener;
+public import org.eclipse.swt.events.MouseEvent;
+
+/**
+ * Classes which implement this interface provide a method
+ * that deals with the event that is generated as the mouse
+ * wheel is scrolled.
+ * <p>
+ * After creating an instance of a class that :
+ * this interface it can be added to a control using the
+ * <code>addMouseWheelListener</code> method and removed using
+ * the <code>removeMouseWheelListener</code> method. When the
+ * mouse wheel is scrolled the <code>mouseScrolled</code> method
+ * will be invoked.
+ * </p>
+ *
+ * @see MouseEvent
+ *
+ * @since 3.3
+ */
+public interface MouseWheelListener : SWTEventListener {
+
+/**
+ * Sent when the mouse wheel is scrolled.
+ *
+ * @param e an event containing information about the mouse wheel action
+ */
+public void mouseScrolled (MouseEvent e);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/PaintEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.PaintEvent;
+
+
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.graphics.GC;
+
+import org.eclipse.swt.events.TypedEvent;
+
+import tango.text.convert.Format;
+import java.lang.all;
+
+/**
+ * Instances of this class are sent as a result of
+ * visible areas of controls requiring re-painting.
+ *
+ * @see PaintListener
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public final class PaintEvent : TypedEvent {
+
+    /**
+     * the graphics context to use when painting
+     * that is configured to use the colors, font and
+     * damaged region of the control.  It is valid
+     * only during the paint and must not be disposed
+     */
+    public GC gc;
+
+    /**
+     * the x offset of the bounding rectangle of the
+     * region that requires painting
+     */
+    public int x;
+
+    /**
+     * the y offset of the bounding rectangle of the
+     * region that requires painting
+     */
+    public int y;
+
+    /**
+     * the width of the bounding rectangle of the
+     * region that requires painting
+     */
+    public int width;
+
+    /**
+     * the height of the bounding rectangle of the
+     * region that requires painting
+     */
+    public int height;
+
+    /**
+     * the number of following paint events which
+     * are pending which may always be zero on
+     * some platforms
+     */
+    public int count;
+
+    //static final long serialVersionUID = 3256446919205992497L;
+
+/**
+ * Constructs a new instance of this class based on the
+ * information in the given untyped event.
+ *
+ * @param e the untyped event containing the information
+ */
+public this(Event e) {
+    super(e);
+    this.gc = e.gc;
+    this.x = e.x;
+    this.y = e.y;
+    this.width = e.width;
+    this.height = e.height;
+    this.count = e.count;
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+public override String toString() {
+    return Format( "{} gc={} x={} y={} width={} height={} count={}}",
+        super.toString[ 0 .. $-1 ],
+        gc is null ? "null" : gc.toString,
+        x,
+        y,
+        width,
+        height,
+        count );
+}
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/PaintListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.PaintListener;
+
+import java.lang.all;
+
+
+public import org.eclipse.swt.internal.SWTEventListener;
+public import org.eclipse.swt.events.PaintEvent;
+
+/**
+ * Classes which implement this interface provide methods
+ * that deal with the events that are generated when the
+ * control needs to be painted.
+ * <p>
+ * After creating an instance of a class that :
+ * this interface it can be added to a control using the
+ * <code>addPaintListener</code> method and removed using
+ * the <code>removePaintListener</code> method. When a
+ * paint event occurs, the paintControl method will be
+ * invoked.
+ * </p>
+ *
+ * @see PaintEvent
+ */
+public interface PaintListener : SWTEventListener {
+
+/**
+ * Sent when a paint event occurs for the control.
+ *
+ * @param e an event containing information about the paint
+ */
+public void paintControl(PaintEvent e);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/SelectionAdapter.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.SelectionAdapter;
+
+import java.lang.all;
+
+import org.eclipse.swt.events.SelectionListener;
+
+/**
+ * This adapter class provides default implementations for the
+ * methods described by the <code>SelectionListener</code> interface.
+ * <p>
+ * Classes that wish to deal with <code>SelectionEvent</code>s can
+ * extend this class and override only the methods which they are
+ * interested in.
+ * </p>
+ *
+ * @see SelectionListener
+ * @see SelectionEvent
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public abstract class SelectionAdapter : SelectionListener {
+
+/**
+ * Sent when selection occurs in the control.
+ * The default behavior is to do nothing.
+ *
+ * @param e an event containing information about the selection
+ */
+public void widgetSelected(SelectionEvent e) {
+}
+
+/**
+ * Sent when default selection occurs in the control.
+ * The default behavior is to do nothing.
+ *
+ * @param e an event containing information about the default selection
+ */
+public void widgetDefaultSelected(SelectionEvent e) {
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/SelectionEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,148 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.SelectionEvent;
+
+
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swt.events.TypedEvent;
+
+import tango.text.convert.Format;
+import java.lang.all;
+
+/**
+ * Instances of this class are sent as a result of
+ * widgets being selected.
+ * <p>
+ * Note: The fields that are filled in depend on the widget.
+ * </p>
+ *
+ * @see SelectionListener
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public class SelectionEvent : TypedEvent {
+
+    /**
+     * The item that was selected.
+     */
+    public Widget item;
+
+    /**
+     * Extra detail information about the selection, depending on the widget.
+     *
+     * <p><b>Sash</b><ul>
+     * <li>{@link org.eclipse.swt.SWT#DRAG}</li>
+     * </ul></p><p><b>ScrollBar and Slider</b><ul>
+     * <li>{@link org.eclipse.swt.SWT#DRAG}</li>
+     * <li>{@link org.eclipse.swt.SWT#HOME}</li>
+     * <li>{@link org.eclipse.swt.SWT#END}</li>
+     * <li>{@link org.eclipse.swt.SWT#ARROW_DOWN}</li>
+     * <li>{@link org.eclipse.swt.SWT#ARROW_UP}</li>
+     * <li>{@link org.eclipse.swt.SWT#PAGE_DOWN}</li>
+     * <li>{@link org.eclipse.swt.SWT#PAGE_UP}</li>
+     * </ul></p><p><b>Table and Tree</b><ul>
+     * <li>{@link org.eclipse.swt.SWT#CHECK}</li>
+     * </ul></p><p><b>Text</b><ul>
+     * <li>{@link org.eclipse.swt.SWT#CANCEL}</li>
+     * </ul></p><p><b>CoolItem and ToolItem</b><ul>
+     * <li>{@link org.eclipse.swt.SWT#ARROW}</li>
+     * </ul></p>
+     */
+    public int detail;
+
+    /**
+     * The x location of the selected area.
+     */
+    public int x;
+
+    /**
+     * The y location of selected area.
+     */
+    public int y;
+
+    /**
+     * The width of selected area.
+     */
+    public int width;
+
+    /**
+     * The height of selected area.
+     */
+    public int height;
+
+    /**
+     * The state of the keyboard modifier keys at the time
+     * the event was generated.
+     */
+    public int stateMask;
+
+    /**
+     * The text of the hyperlink that was selected.
+     * This will be either the text of the hyperlink or the value of its HREF,
+     * if one was specified.
+     *
+     * @see org.eclipse.swt.widgets.Link#setText(String)
+     * @since 3.1
+     */
+    public String text;
+
+    /**
+     * A flag indicating whether the operation should be allowed.
+     * Setting this field to <code>false</code> will cancel the
+     * operation, depending on the widget.
+     */
+    public bool doit;
+
+    //static final long serialVersionUID = 3976735856884987953L;
+
+/**
+ * Constructs a new instance of this class based on the
+ * information in the given untyped event.
+ *
+ * @param e the untyped event containing the information
+ */
+public this(Event e) {
+    super(e);
+    this.item = e.item;
+    this.x = e.x;
+    this.y = e.y;
+    this.width = e.width;
+    this.height = e.height;
+    this.detail = e.detail;
+    this.stateMask = e.stateMask;
+    this.text = e.text;
+    this.doit = e.doit;
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+public override String toString() {
+    return Format( "{} item={} detail={} x={} y={} width={} height={} stateMask={} text={} doit={}}",
+        super.toString[ 0 .. $-2 ],
+        item,
+        detail,
+        x,
+        y,
+        width,
+        height,
+        stateMask,
+        text,
+        doit );
+}
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/SelectionListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.SelectionListener;
+
+import java.lang.all;
+
+
+public import org.eclipse.swt.internal.SWTEventListener;
+public import org.eclipse.swt.events.SelectionEvent;
+
+import tango.core.Traits;
+import tango.core.Tuple;
+
+/**
+ * Classes which implement this interface provide methods
+ * that deal with the events that are generated when selection
+ * occurs in a control.
+ * <p>
+ * After creating an instance of a class that :
+ * this interface it can be added to a control using the
+ * <code>addSelectionListener</code> method and removed using
+ * the <code>removeSelectionListener</code> method. When
+ * selection occurs in a control the appropriate method
+ * will be invoked.
+ * </p>
+ *
+ * @see SelectionAdapter
+ * @see SelectionEvent
+ */
+public interface SelectionListener : SWTEventListener {
+
+    public enum {
+        SELECTION,
+        DEFAULTSELECTION
+    }
+/**
+ * Sent when selection occurs in the control.
+ * <p>
+ * For example, selection occurs in a List when the user selects
+ * an item or items with the keyboard or mouse.  On some platforms,
+ * the event occurs when a mouse button or key is pressed.  On others,
+ * it happens when the mouse or key is released.  The exact key or
+ * mouse gesture that causes this event is platform specific.
+ * </p>
+ *
+ * @param e an event containing information about the selection
+ */
+public void widgetSelected(SelectionEvent e);
+
+/**
+ * Sent when default selection occurs in the control.
+ * <p>
+ * For example, on some platforms default selection occurs in a List
+ * when the user double-clicks an item or types return in a Text.
+ * On some platforms, the event occurs when a mouse button or key is
+ * pressed.  On others, it happens when the mouse or key is released.
+ * The exact key or mouse gesture that causes this event is platform
+ * specific.
+ * </p>
+ *
+ * @param e an event containing information about the default selection
+ */
+public void widgetDefaultSelected(SelectionEvent e);
+}
+
+
+/// SWT extension
+private class _DgSelectionListenerT(Dg,T...) : SelectionListener {
+
+    alias ParameterTupleOf!(Dg) DgArgs;
+    static assert( is(DgArgs == Tuple!(SelectionEvent,T)),
+                "Delegate args not correct: "~DgArgs.stringof~" vs. (Event,"~T.stringof~")" );
+
+    Dg dg;
+    T  t;
+    int type;
+
+    private this( int type, Dg dg, T t ){
+        this.type = type;
+        this.dg = dg;
+        static if( T.length > 0 ){
+            this.t = t;
+        }
+    }
+
+    public void widgetSelected(SelectionEvent e){
+        if( type is SelectionListener.SELECTION ){
+            dg(e,t);
+        }
+    }
+    public void widgetDefaultSelected(SelectionEvent e){
+        if( type is SelectionListener.DEFAULTSELECTION ){
+            dg(e,t);
+        }
+    }
+}
+
+SelectionListener dgSelectionListener( Dg, T... )( int type, Dg dg, T args ){
+    return new _DgSelectionListenerT!( Dg, T )( type, dg, args );
+}
+
+SelectionListener dgSelectionListenerWidgetSelected( Dg, T... )( Dg dg, T args ){
+    return dgSelectionListener( SelectionListener.SELECTION, dg, args );
+}
+SelectionListener dgSelectionListenerWidgetDefaultSelected( Dg, T... )( Dg dg, T args ){
+    return dgSelectionListener( SelectionListener.DEFAULTSELECTION, dg, args );
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/ShellAdapter.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.ShellAdapter;
+
+import java.lang.all;
+
+import org.eclipse.swt.events.ShellListener;
+
+/**
+ * This adapter class provides default implementations for the
+ * methods described by the <code>ShellListener</code> interface.
+ * <p>
+ * Classes that wish to deal with <code>ShellEvent</code>s can
+ * extend this class and override only the methods which they are
+ * interested in.
+ * </p>
+ *
+ * @see ShellListener
+ * @see ShellEvent
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public abstract class ShellAdapter : ShellListener {
+
+/**
+ * Sent when a shell becomes the active window.
+ * The default behavior is to do nothing.
+ *
+ * @param e an event containing information about the activation
+ */
+public void shellActivated(ShellEvent e) {
+}
+
+/**
+ * Sent when a shell is closed.
+ * The default behavior is to do nothing.
+ *
+ * @param e an event containing information about the close
+ */
+public void shellClosed(ShellEvent e) {
+}
+
+/**
+ * Sent when a shell stops being the active window.
+ * The default behavior is to do nothing.
+ *
+ * @param e an event containing information about the deactivation
+ */
+public void shellDeactivated(ShellEvent e) {
+}
+
+/**
+ * Sent when a shell is un-minimized.
+ * The default behavior is to do nothing.
+ *
+ * @param e an event containing information about the un-minimization
+ */
+public void shellDeiconified(ShellEvent e) {
+}
+
+/**
+ * Sent when a shell is minimized.
+ * The default behavior is to do nothing.
+ *
+ * @param e an event containing information about the minimization
+ */
+public void shellIconified(ShellEvent e) {
+}
+}
+
+class ShellDelegator : ShellAdapter {
+    alias void delegate(ShellEvent) DFunc;
+    DFunc delShellActivated;
+    DFunc delShellClosed;
+    DFunc delShellDeactivated;
+    DFunc delShellDeiconified;
+    DFunc delShellIconified;
+
+private this(
+    DFunc delShellActivated,
+    DFunc delShellClosed,
+    DFunc delShellDeactivated,
+    DFunc delShellDeiconified,
+    DFunc delShellIconified )
+{
+    this.delShellActivated = delShellActivated;
+    this.delShellClosed = delShellClosed;
+    this.delShellDeactivated = delShellDeactivated;
+    this.delShellDeiconified = delShellDeiconified;
+    this.delShellIconified = delShellIconified;
+}
+
+static ShellDelegator createShellActivated( DFunc del ){
+    return new ShellDelegator( del, null, null, null, null );
+}
+static ShellDelegator createShellClosed( DFunc del ){
+    return new ShellDelegator( null, del, null, null, null );
+}
+
+public void shellActivated(ShellEvent e) {
+    if( delShellActivated !is null ) delShellActivated(e);
+}
+public void shellClosed(ShellEvent e) {
+    if( delShellClosed !is null ) delShellClosed(e);
+}
+public void shellDeactivated(ShellEvent e) {
+    if( delShellDeactivated !is null ) delShellDeactivated(e);
+}
+public void shellDeiconified(ShellEvent e) {
+    if( delShellDeiconified !is null ) delShellDeiconified(e);
+}
+public void shellIconified(ShellEvent e) {
+    if( delShellIconified !is null ) delShellIconified(e);
+}
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/ShellEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.ShellEvent;
+
+
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.events.TypedEvent;
+
+import tango.text.convert.Format;
+import java.lang.all;
+
+/**
+ * Instances of this class are sent as a result of
+ * operations being performed on shells.
+ *
+ * @see ShellListener
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public final class ShellEvent : TypedEvent {
+
+    /**
+     * A flag indicating whether the operation should be allowed.
+     * Setting this field to <code>false</code> will cancel the operation.
+     */
+    public bool doit;
+
+    //static final long serialVersionUID = 3257569490479888441L;
+
+/**
+ * Constructs a new instance of this class based on the
+ * information in the given untyped event.
+ *
+ * @param e the untyped event containing the information
+ */
+public this(Event e) {
+    super(e);
+    this.doit = e.doit;
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+public override String toString() {
+    return Format( "{} doit={}}", super.toString[ 0 .. $-2 ], doit );
+}
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/ShellListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.ShellListener;
+
+import java.lang.all;
+
+
+public import org.eclipse.swt.internal.SWTEventListener;
+public import org.eclipse.swt.events.ShellEvent;
+
+/**
+ * Classes which implement this interface provide methods
+ * that deal with changes in state of <code>Shell</code>s.
+ * <p>
+ * After creating an instance of a class that :
+ * this interface it can be added to a shell using the
+ * <code>addShellListener</code> method and removed using
+ * the <code>removeShellListener</code> method. When the
+ * state of the shell changes, the appropriate method will
+ * be invoked.
+ * </p>
+ *
+ * @see ShellAdapter
+ * @see ShellEvent
+ */
+public interface ShellListener : SWTEventListener {
+
+/**
+ * Sent when a shell becomes the active window.
+ *
+ * @param e an event containing information about the activation
+ */
+public void shellActivated(ShellEvent e);
+
+/**
+ * Sent when a shell is closed.
+ *
+ * @param e an event containing information about the close
+ */
+public void shellClosed(ShellEvent e);
+
+/**
+ * Sent when a shell stops being the active window.
+ *
+ * @param e an event containing information about the deactivation
+ */
+public void shellDeactivated(ShellEvent e);
+
+/**
+ * Sent when a shell is un-minimized.
+ *
+ * @param e an event containing information about the un-minimization
+ */
+public void shellDeiconified(ShellEvent e);
+
+/**
+ * Sent when a shell is minimized.
+ *
+ * @param e an event containing information about the minimization
+ */
+public void shellIconified(ShellEvent e);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/TraverseEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,140 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.TraverseEvent;
+
+
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.events.KeyEvent;
+
+import tango.text.convert.Format;
+import java.lang.all;
+
+/**
+ * Instances of this class are sent as a result of
+ * widget traversal actions.
+ * <p>
+ * The traversal event allows fine control over keyboard traversal
+ * in a control both to implement traversal and override the default
+ * traversal behavior defined by the system.  This is achieved using
+ * two fields, <code>detail</code> and <code>doit</code>.
+ * </p><p>
+ * When a control is traversed, a traverse event is sent.  The detail
+ * describes the type of traversal and the doit field indicates the default
+ * behavior of the system.  For example, when a right arrow key is pressed
+ * in a text control, the detail field is <code>TRAVERSE_ARROW_NEXT</code>
+ * and the doit field is <code>false</code>, indicating that the system
+ * will not traverse to the next tab item and the arrow key will be
+ * delivered to the text control.  If the same key is pressed in a radio
+ * button, the doit field will be <code>true</code>, indicating that
+ * traversal is to proceed to the next tab item, possibly another radio
+ * button in the group and that the arrow key is not to be delivered
+ * to the radio button.
+ * </p><p>
+ * How can the traversal event be used to implement traversal?
+ * When a tab key is pressed in a canvas, the detail field will be
+ * <code>TRAVERSE_TAB_NEXT</code> and the doit field will be
+ * <code>false</code>.  The default behavior of the system is to
+ * provide no traversal for canvas controls.  This means that by
+ * default in a canvas, a key listener will see every key that the
+ * user types, including traversal keys.  To understand why this
+ * is so, it is important to understand that only the widget implementor
+ * can decide which traversal is appropriate for the widget.  Returning
+ * to the <code>TRAVERSE_TAB_NEXT</code> example, a text widget implemented
+ * by a canvas would typically want to use the tab key to insert a
+ * tab character into the widget.  A list widget implementation, on the
+ * other hand, would like the system default traversal behavior.  Using
+ * only the doit flag, both implementations are possible.  The text widget
+ * implementor sets doit to <code>false</code>, ensuring that the system
+ * will not traverse and that the tab key will be delivered to key listeners.
+ * The list widget implementor sets doit to <code>true</code>, indicating
+ * that the system should perform tab traversal and that the key should not
+ * be delivered to the list widget.
+ * </p><p>
+ * How can the traversal event be used to override system traversal?
+ * When the return key is pressed in a single line text control, the
+ * detail field is <code>TRAVERSE_RETURN</code> and the doit field
+ * is <code>true</code>.  This means that the return key will be processed
+ * by the default button, not the text widget.  If the text widget has
+ * a default selection listener, it will not run because the return key
+ * will be processed by the default button.  Imagine that the text control
+ * is being used as an in-place editor and return is used to dispose the
+ * widget.  Setting doit to <code>false</code> will stop the system from
+ * activating the default button but the key will be delivered to the text
+ * control, running the key and selection listeners for the text.  How
+ * can <code>TRAVERSE_RETURN</code> be implemented so that the default button
+ * will not be activated and the text widget will not see the return key?
+ * This is achieved by setting doit to <code>true</code>, and the detail
+ * to <code>TRAVERSE_NONE</code>.
+ * </p><p>
+ * Note: A widget implementor will typically implement traversal using
+ * only the doit flag to either enable or disable system traversal.
+ * </p>
+ *
+ * @see TraverseListener
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public final class TraverseEvent : KeyEvent {
+
+    /**
+     * The traversal type.
+     * <p><ul>
+     * <li>{@link org.eclipse.swt.SWT#TRAVERSE_NONE}</li>
+     * <li>{@link org.eclipse.swt.SWT#TRAVERSE_ESCAPE}</li>
+     * <li>{@link org.eclipse.swt.SWT#TRAVERSE_RETURN}</li>
+     * <li>{@link org.eclipse.swt.SWT#TRAVERSE_TAB_NEXT}</li>
+     * <li>{@link org.eclipse.swt.SWT#TRAVERSE_TAB_PREVIOUS}</li>
+     * <li>{@link org.eclipse.swt.SWT#TRAVERSE_ARROW_NEXT}</li>
+     * <li>{@link org.eclipse.swt.SWT#TRAVERSE_ARROW_PREVIOUS}</li>
+     * <li>{@link org.eclipse.swt.SWT#TRAVERSE_MNEMONIC}</li>
+     * <li>{@link org.eclipse.swt.SWT#TRAVERSE_PAGE_NEXT}</li>
+     * <li>{@link org.eclipse.swt.SWT#TRAVERSE_PAGE_PREVIOUS}</li>
+     * </ul></p>
+     *
+     * Setting this field will change the type of traversal.
+     * For example, setting the detail to <code>TRAVERSE_NONE</code>
+     * causes no traversal action to be taken.
+     *
+     * When used in conjunction with the <code>doit</code> field, the
+     * traversal detail field can be useful when overriding the default
+     * traversal mechanism for a control. For example, setting the doit
+     * field to <code>false</code> will cancel the operation and allow
+     * the traversal key stroke to be delivered to the control. Setting
+     * the doit field to <code>true</code> indicates that the traversal
+     * described by the detail field is to be performed.
+     */
+    public int detail;
+
+    //static final long serialVersionUID = 3257565105301239349L;
+
+/**
+ * Constructs a new instance of this class based on the
+ * information in the given untyped event.
+ *
+ * @param e the untyped event containing the information
+ */
+public this(Event e) {
+    super(e);
+    this.detail = e.detail;
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+public override String toString() {
+    return Format( "{} detail={}}", super.toString[ 0 .. $-2 ], detail );
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/TraverseListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.TraverseListener;
+
+import java.lang.all;
+
+
+public import org.eclipse.swt.internal.SWTEventListener;
+public import org.eclipse.swt.events.TraverseEvent;
+
+/**
+ * Classes which implement this interface provide a method
+ * that deals with the events that are generated when a
+ * traverse event occurs in a control.
+ * <p>
+ * After creating an instance of a class that :
+ * this interface it can be added to a control using the
+ * <code>addTraverseListener</code> method and removed using
+ * the <code>removeTraverseListener</code> method. When a
+ * traverse event occurs in a control, the keyTraversed method
+ * will be invoked.
+ * </p>
+ *
+ * @see TraverseEvent
+ */
+public interface TraverseListener : SWTEventListener {
+
+/**
+ * Sent when a traverse event occurs in a control.
+ * <p>
+ * A traverse event occurs when the user presses a traversal
+ * key. Traversal keys are typically tab and arrow keys, along
+ * with certain other keys on some platforms. Traversal key
+ * constants beginning with <code>TRAVERSE_</code> are defined
+ * in the <code>SWT</code> class.
+ * </p>
+ *
+ * @param e an event containing information about the traverse
+ */
+public void keyTraversed(TraverseEvent e);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/TreeAdapter.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.TreeAdapter;
+
+import java.lang.all;
+
+import org.eclipse.swt.events.TreeListener;
+
+/**
+ * This adapter class provides default implementations for the
+ * methods described by the <code>TreeListener</code> interface.
+ * <p>
+ * Classes that wish to deal with <code>TreeEvent</code>s can
+ * extend this class and override only the methods which they are
+ * interested in.
+ * </p>
+ *
+ * @see TreeListener
+ * @see TreeEvent
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public abstract class TreeAdapter : TreeListener {
+
+/**
+ * Sent when a tree branch is collapsed.
+ * The default behavior is to do nothing.
+ *
+ * @param e an event containing information about the tree operation
+ */
+public void treeCollapsed(TreeEvent e) {
+}
+
+/**
+ * Sent when a tree branch is expanded.
+ * The default behavior is to do nothing.
+ *
+ * @param e an event containing information about the tree operation
+ */
+public void treeExpanded(TreeEvent e) {
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/TreeEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.TreeEvent;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.events.SelectionEvent;
+
+/**
+ * Instances of this class are sent as a result of
+ * trees being expanded and collapsed.
+ *
+ * @see TreeListener
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public final class TreeEvent : SelectionEvent {
+
+    //static final long serialVersionUID = 3257282548009677109L;
+
+/**
+ * Constructs a new instance of this class based on the
+ * information in the given untyped event.
+ *
+ * @param e the untyped event containing the information
+ */
+public this(Event e) {
+    super(e);
+}
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/TreeListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.TreeListener;
+
+import java.lang.all;
+
+
+public import org.eclipse.swt.internal.SWTEventListener;
+public import org.eclipse.swt.events.TreeEvent;
+
+/**
+ * Classes which implement this interface provide methods
+ * that deal with the expanding and collapsing of tree
+ * branches.
+ * <p>
+ * After creating an instance of a class that :
+ * this interface it can be added to a tree control using the
+ * <code>addTreeListener</code> method and removed using
+ * the <code>removeTreeListener</code> method. When a branch
+ * of the tree is expanded or collapsed, the appropriate method
+ * will be invoked.
+ * </p>
+ *
+ * @see TreeAdapter
+ * @see TreeEvent
+ */
+public interface TreeListener : SWTEventListener {
+
+/**
+ * Sent when a tree branch is collapsed.
+ *
+ * @param e an event containing information about the tree operation
+ */
+public void treeCollapsed(TreeEvent e);
+
+/**
+ * Sent when a tree branch is expanded.
+ *
+ * @param e an event containing information about the tree operation
+ */
+public void treeExpanded(TreeEvent e);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/TypedEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.TypedEvent;
+
+
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swt.internal.SWTEventObject;
+
+import tango.text.convert.Format;
+import tango.text.Util : split;
+import java.lang.all;
+
+/**
+ * This is the super class for all typed event classes provided
+ * by SWT. Typed events contain particular information which is
+ * applicable to the event occurrence.
+ *
+ * @see org.eclipse.swt.widgets.Event
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class TypedEvent : SWTEventObject {
+
+    /**
+     * the display where the event occurred
+     *
+     * @since 2.0
+     */
+    public Display display;
+
+    /**
+     * the widget that issued the event
+     */
+    public Widget widget;
+
+    /**
+     * the time that the event occurred.
+     *
+     * NOTE: This field is an unsigned integer and should
+     * be AND'ed with 0xFFFFFFFFL so that it can be treated
+     * as a signed long.
+     */
+    public int time;
+
+    /**
+     * a field for application use
+     */
+    public Object data;
+
+    //static final long serialVersionUID = 3257285846578377524L;
+
+/**
+ * Constructs a new instance of this class.
+ *
+ * @param object the object that fired the event
+ */
+public this(Object object) {
+    super(object);
+}
+
+/**
+ * Constructs a new instance of this class based on the
+ * information in the argument.
+ *
+ * @param e the low level event to initialize the receiver with
+ */
+public this(Event e) {
+    super(e.widget);
+    this.display = e.display;
+    this.widget = e.widget;
+    this.time = e.time;
+    this.data = e.data;
+}
+
+/**
+ * Returns the name of the event. This is the name of
+ * the class without the module name.
+ *
+ * @return the name of the event
+ */
+String getName () {
+    String str = this.classinfo.name;
+    return split( str, "." )[$-1];
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+public override String toString() {
+    String str_widget = widget is null ? "null" : widget.toString;
+    String str_data   = data is null ? "null" : data.toString;
+    return Format( "{}{{time={} data={}}", str_widget, time, str_data );
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/VerifyEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.VerifyEvent;
+
+
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.events.KeyEvent;
+
+import tango.text.convert.Format;
+import java.lang.all;
+
+/**
+ * Instances of this class are sent as a result of
+ * widgets handling keyboard events
+ *
+ * @see VerifyListener
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public final class VerifyEvent : KeyEvent {
+
+    /**
+     * the range of text being modified.
+     * Setting these fields has no effect.
+     */
+    public int start, end;
+
+    /**
+     * the new text that will be inserted.
+     * Setting this field will change the text that is about to
+     * be inserted or deleted.
+     */
+    public String text;
+
+    //static final long serialVersionUID = 3257003246269577014L;
+
+/**
+ * Constructs a new instance of this class based on the
+ * information in the given untyped event.
+ *
+ * @param e the untyped event containing the information
+ */
+public this(Event e) {
+    super(e);
+    this.start = e.start;
+    this.end = e.end;
+    this.text = e.text;
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+public override String toString() {
+    return Format( "{} start={} end={} text={}}", super.toString[ 0 .. $-2 ], start, end, text );
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/VerifyListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.events.VerifyListener;
+
+import java.lang.all;
+
+
+public import org.eclipse.swt.internal.SWTEventListener;
+public import org.eclipse.swt.events.VerifyEvent;
+
+/**
+ * Classes which implement this interface provide a method
+ * that deals with the events that are generated when text
+ * is about to be modified.
+ * <p>
+ * After creating an instance of a class that :
+ * this interface it can be added to a text control using the
+ * <code>addVerifyListener</code> method and removed using
+ * the <code>removeVerifyListener</code> method. When the
+ * text is about to be modified, the verifyText method
+ * will be invoked.
+ * </p>
+ *
+ * @see VerifyEvent
+ */
+public interface VerifyListener : SWTEventListener {
+
+/**
+ * Sent when the text is about to be modified.
+ * <p>
+ * A verify event occurs after the user has done something
+ * to modify the text (typically typed a key), but before
+ * the text is modified. The doit field in the verify event
+ * indicates whether or not to modify the text.
+ * </p>
+ *
+ * @param e an event containing information about the verify
+ */
+public void verifyText(VerifyEvent e);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/events/all.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,56 @@
+module org.eclipse.swt.events.all;
+
+import java.lang.all;
+
+public import org.eclipse.swt.events.FocusEvent;
+public import org.eclipse.swt.events.MenuListener;
+public import org.eclipse.swt.events.ShellAdapter;
+public import org.eclipse.swt.events.ModifyListener;
+public import org.eclipse.swt.events.MouseListener;
+public import org.eclipse.swt.events.MenuEvent;
+public import org.eclipse.swt.events.TraverseEvent;
+public import org.eclipse.swt.events.VerifyEvent;
+public import org.eclipse.swt.events.KeyEvent;
+public import org.eclipse.swt.events.FocusListener;
+public import org.eclipse.swt.events.PaintEvent;
+public import org.eclipse.swt.events.ModifyEvent;
+public import org.eclipse.swt.events.MouseWheelListener;
+public import org.eclipse.swt.events.DragDetectListener;
+public import org.eclipse.swt.events.MouseTrackAdapter;
+public import org.eclipse.swt.events.MouseEvent;
+public import org.eclipse.swt.events.ControlListener;
+public import org.eclipse.swt.events.TraverseListener;
+public import org.eclipse.swt.events.ExpandAdapter;
+public import org.eclipse.swt.events.SelectionEvent;
+public import org.eclipse.swt.events.DragDetectEvent;
+public import org.eclipse.swt.events.KeyAdapter;
+public import org.eclipse.swt.events.MenuDetectEvent;
+public import org.eclipse.swt.events.TypedEvent;
+public import org.eclipse.swt.events.ArmListener;
+public import org.eclipse.swt.events.ArmEvent;
+public import org.eclipse.swt.events.ShellListener;
+public import org.eclipse.swt.events.ControlEvent;
+public import org.eclipse.swt.events.MouseAdapter;
+public import org.eclipse.swt.events.VerifyListener;
+public import org.eclipse.swt.events.MouseTrackListener;
+public import org.eclipse.swt.events.KeyListener;
+public import org.eclipse.swt.events.ExpandEvent;
+public import org.eclipse.swt.events.ControlAdapter;
+public import org.eclipse.swt.events.MenuAdapter;
+public import org.eclipse.swt.events.FocusAdapter;
+public import org.eclipse.swt.events.ShellEvent;
+public import org.eclipse.swt.events.MouseMoveListener;
+public import org.eclipse.swt.events.SelectionAdapter;
+public import org.eclipse.swt.events.HelpListener;
+public import org.eclipse.swt.events.TreeAdapter;
+public import org.eclipse.swt.events.SelectionListener;
+public import org.eclipse.swt.events.TreeEvent;
+public import org.eclipse.swt.events.MenuDetectListener;
+public import org.eclipse.swt.events.DisposeListener;
+public import org.eclipse.swt.events.HelpEvent;
+public import org.eclipse.swt.events.PaintListener;
+public import org.eclipse.swt.events.DisposeEvent;
+public import org.eclipse.swt.events.TreeListener;
+public import org.eclipse.swt.events.ExpandListener;
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Color.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,301 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.Color;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.graphics.Resource;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.Device;
+
+import tango.text.convert.Format;
+
+
+/**
+ * Instances of this class manage the operating system resources that
+ * implement SWT's RGB color model. To create a color you can either
+ * specify the individual color components as integers in the range
+ * 0 to 255 or provide an instance of an <code>RGB</code>.
+ * <p>
+ * Application code must explicitly invoke the <code>Color.dispose()</code>
+ * method to release the operating system resources managed by each instance
+ * when those instances are no longer required.
+ * </p>
+ *
+ * @see RGB
+ * @see Device#getSystemColor
+ * @see <a href="http://www.eclipse.org/swt/snippets/#color">Color and RGB snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: PaintExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public final class Color : Resource {
+    alias Resource.init_ init_;
+    /**
+     * the handle to the OS color resource
+     * (Warning: This field is platform dependent)
+     * <p>
+     * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+     * public API. It is marked 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 accessed from application code.
+     * </p>
+     */
+    public GdkColor* handle;
+
+this(Device device) {
+    super(device);
+}
+
+/**
+ * Constructs a new instance of this class given a device and the
+ * desired red, green and blue values expressed as ints in the range
+ * 0 to 255 (where 0 is black and 255 is full brightness). On limited
+ * color devices, the color instance created by this call may not have
+ * the same RGB values as the ones specified by the arguments. The
+ * RGB values on the returned instance will be the color values of
+ * the operating system color.
+ * <p>
+ * You must dispose the color when it is no longer required.
+ * </p>
+ *
+ * @param device the device on which to allocate the color
+ * @param red the amount of red in the color
+ * @param green the amount of green in the color
+ * @param blue the amount of blue in the color
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the red, green or blue argument is not between 0 and 255</li>
+ * </ul>
+ *
+ * @see #dispose
+ */
+public this(Device device, int red, int green, int blue) {
+    super(device);
+    init_(red, green, blue);
+    init_();
+}
+
+/**
+ * Constructs a new instance of this class given a device and an
+ * <code>RGB</code> describing the desired red, green and blue values.
+ * On limited color devices, the color instance created by this call
+ * may not have the same RGB values as the ones specified by the
+ * argument. The RGB values on the returned instance will be the color
+ * values of the operating system color.
+ * <p>
+ * You must dispose the color when it is no longer required.
+ * </p>
+ *
+ * @param device the device on which to allocate the color
+ * @param rgb the RGB values of the desired color
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ *    <li>ERROR_NULL_ARGUMENT - if the rgb argument is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the red, green or blue components of the argument are not between 0 and 255</li>
+ * </ul>
+ *
+ * @see #dispose
+ */
+public this(Device device, RGB rgb) {
+    super(device);
+    if (rgb is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    init_(rgb.red, rgb.green, rgb.blue);
+    init_();
+}
+
+void destroy() {
+    int pixel = handle.pixel;
+    if (device.colorRefCount !is null) {
+        /* If this was the last reference, remove the color from the list */
+        if (--device.colorRefCount[pixel] is 0) {
+            device.gdkColors[pixel] = null;
+        }
+    }
+    auto colormap = OS.gdk_colormap_get_system();
+    OS.gdk_colormap_free_colors(colormap, handle, 1);
+    handle = null;
+}
+
+/**
+ * Compares the argument to the receiver, and returns true
+ * if they represent the <em>same</em> object using a class
+ * specific comparison.
+ *
+ * @param object the object to compare with this object
+ * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
+ *
+ * @see #hashCode
+ */
+public override int opEquals(Object object) {
+    if (object is this) return true;
+    if ( auto color = cast(Color)object ){
+        GdkColor* gdkColor = color.handle;
+        if (handle is gdkColor) return true;
+        return device is color.device && handle.red is gdkColor.red &&
+            handle.green is gdkColor.green && handle.blue is gdkColor.blue;
+    }
+    return false;
+}
+
+/**
+ * Returns the amount of blue in the color, from 0 to 255.
+ *
+ * @return the blue component of the color
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getBlue() {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    return (handle.blue >> 8) & 0xFF;
+}
+
+/**
+ * Returns the amount of green in the color, from 0 to 255.
+ *
+ * @return the green component of the color
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getGreen() {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    return (handle.green >> 8) & 0xFF;
+}
+
+/**
+ * Returns the amount of red in the color, from 0 to 255.
+ *
+ * @return the red component of the color
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getRed() {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    return (handle.red >> 8) & 0xFF;
+}
+
+/**
+ * Returns an integer hash code for the receiver. Any two
+ * objects that return <code>true</code> when passed to
+ * <code>equals</code> must return the same value for this
+ * method.
+ *
+ * @return the receiver's hash
+ *
+ * @see #equals
+ */
+public override hash_t toHash() {
+    if (isDisposed()) return 0;
+    return handle.red ^ handle.green ^ handle.blue;
+}
+
+/**
+ * Returns an <code>RGB</code> representing the receiver.
+ *
+ * @return the RGB for the color
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public RGB getRGB () {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    return new RGB(getRed(), getGreen(), getBlue());
+}
+
+/**
+ * Invokes platform specific functionality to allocate a new color.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Color</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param device the device on which to allocate the color
+ * @param handle the handle for the color
+ *
+ * @private
+ */
+public static Color gtk_new(Device device, GdkColor* gdkColor) {
+    Color color = new Color(device);
+    color.handle = gdkColor;
+    return color;
+}
+
+void init_(int red, int green, int blue) {
+    if ((red > 255) || (red < 0) ||
+        (green > 255) || (green < 0) ||
+        (blue > 255) || (blue < 0)) {
+            SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    GdkColor* gdkColor = new GdkColor();
+    gdkColor.red = cast(short)((red & 0xFF) | ((red & 0xFF) << 8));
+    gdkColor.green = cast(short)((green & 0xFF) | ((green & 0xFF) << 8));
+    gdkColor.blue = cast(short)((blue & 0xFF) | ((blue & 0xFF) << 8));
+    auto colormap = OS.gdk_colormap_get_system();
+    if (!OS.gdk_colormap_alloc_color(colormap, gdkColor, true, true)) {
+        /* Allocate black. */
+        gdkColor = new GdkColor();
+        OS.gdk_colormap_alloc_color(colormap, gdkColor, true, true);
+    }
+    handle = gdkColor;
+    if (device.colorRefCount !is null) {
+        /* Make a copy of the color to put in the colors array */
+        GdkColor* colorCopy = new GdkColor();
+        colorCopy.red = handle.red;
+        colorCopy.green = handle.green;
+        colorCopy.blue = handle.blue;
+        colorCopy.pixel = handle.pixel;
+        device.gdkColors[colorCopy.pixel] = colorCopy;
+        device.colorRefCount[colorCopy.pixel]++;
+    }
+}
+
+/**
+ * Returns <code>true</code> if the color has been disposed,
+ * and <code>false</code> otherwise.
+ * <p>
+ * This method gets the dispose state for the color.
+ * When a color has been disposed, it is an error to
+ * invoke any other method using the color.
+ *
+ * @return <code>true</code> when the color is disposed and <code>false</code> otherwise
+ */
+public override bool isDisposed() {
+    return handle is null;
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the receiver
+ */
+public override String toString () {
+    if (isDisposed()) return "Color {*DISPOSED*}";
+    return Format( "Color {{{}, {}, {}}", getRed(), getGreen(), getBlue());
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Cursor.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,541 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.Cursor;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Resource;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.PaletteData;
+
+import org.eclipse.swt.internal.gtk.OS;
+
+import tango.text.convert.Format;
+import tango.stdc.string;
+
+/**
+ * Instances of this class manage operating system resources that
+ * specify the appearance of the on-screen pointer. To create a
+ * cursor you specify the device and either a simple cursor style
+ * describing one of the standard operating system provided cursors
+ * or the image and mask data for the desired appearance.
+ * <p>
+ * Application code must explicitly invoke the <code>Cursor.dispose()</code>
+ * method to release the operating system resources managed by each instance
+ * when those instances are no longer required.
+ * </p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>
+ *   CURSOR_ARROW, CURSOR_WAIT, CURSOR_CROSS, CURSOR_APPSTARTING, CURSOR_HELP,
+ *   CURSOR_SIZEALL, CURSOR_SIZENESW, CURSOR_SIZENS, CURSOR_SIZENWSE, CURSOR_SIZEWE,
+ *   CURSOR_SIZEN, CURSOR_SIZES, CURSOR_SIZEE, CURSOR_SIZEW, CURSOR_SIZENE, CURSOR_SIZESE,
+ *   CURSOR_SIZESW, CURSOR_SIZENW, CURSOR_UPARROW, CURSOR_IBEAM, CURSOR_NO, CURSOR_HAND
+ * </dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the above styles may be specified.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#cursor">Cursor snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public final class Cursor : Resource {
+    /**
+     * the handle to the OS cursor resource
+     * (Warning: This field is platform dependent)
+     * <p>
+     * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+     * public API. It is marked 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 accessed from application code.
+     * </p>
+     */
+    public GdkCursor* handle;
+
+    static const byte[] APPSTARTING_SRC = [ cast(byte)
+        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+        0x0c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00,
+        0x7c, 0x00, 0x00, 0x00, cast(byte)0xfc, 0x00, 0x00, 0x00, cast(byte)0xfc, 0x01, 0x00, 0x00,
+        cast(byte)0xfc, 0x3b, 0x00, 0x00, 0x7c, 0x38, 0x00, 0x00, 0x6c, 0x54, 0x00, 0x00,
+        cast(byte)0xc4, cast(byte)0xdc, 0x00, 0x00, cast(byte)0xc0, 0x44, 0x00, 0x00, cast(byte)0x80, 0x39, 0x00, 0x00,
+        cast(byte)0x80, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00];
+
+    static const byte[] APPSTARTING_MASK = [ cast(byte)
+        0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00,
+        0x1e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00,
+        cast(byte)0xfe, 0x00, 0x00, 0x00, cast(byte)0xfe, 0x01, 0x00, 0x00, cast(byte)0xfe, 0x3b, 0x00, 0x00,
+        cast(byte)0xfe, 0x7f, 0x00, 0x00, cast(byte)0xfe, 0x7f, 0x00, 0x00, cast(byte)0xfe, cast(byte)0xfe, 0x00, 0x00,
+        cast(byte)0xee, cast(byte)0xff, 0x01, 0x00, cast(byte)0xe4, cast(byte)0xff, 0x00, 0x00, cast(byte)0xc0, 0x7f, 0x00, 0x00,
+        cast(byte)0xc0, 0x7f, 0x00, 0x00, cast(byte)0x80, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00];
+
+this (Device device) {
+    super(device);
+}
+
+/**
+ * Constructs a new cursor given a device and a style
+ * constant describing the desired cursor appearance.
+ * <p>
+ * You must dispose the cursor when it is no longer required.
+ * </p>
+ *
+ * @param device the device on which to allocate the cursor
+ * @param style the style of cursor to allocate
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ *    <li>ERROR_INVALID_ARGUMENT - when an unknown style is specified</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES - if a handle could not be obtained for cursor creation</li>
+ * </ul>
+ *
+ * @see SWT#CURSOR_ARROW
+ * @see SWT#CURSOR_WAIT
+ * @see SWT#CURSOR_CROSS
+ * @see SWT#CURSOR_APPSTARTING
+ * @see SWT#CURSOR_HELP
+ * @see SWT#CURSOR_SIZEALL
+ * @see SWT#CURSOR_SIZENESW
+ * @see SWT#CURSOR_SIZENS
+ * @see SWT#CURSOR_SIZENWSE
+ * @see SWT#CURSOR_SIZEWE
+ * @see SWT#CURSOR_SIZEN
+ * @see SWT#CURSOR_SIZES
+ * @see SWT#CURSOR_SIZEE
+ * @see SWT#CURSOR_SIZEW
+ * @see SWT#CURSOR_SIZENE
+ * @see SWT#CURSOR_SIZESE
+ * @see SWT#CURSOR_SIZESW
+ * @see SWT#CURSOR_SIZENW
+ * @see SWT#CURSOR_UPARROW
+ * @see SWT#CURSOR_IBEAM
+ * @see SWT#CURSOR_NO
+ * @see SWT#CURSOR_HAND
+ */
+public this(Device device, int style) {
+    super(device);
+    int shape = 0;
+    switch (style) {
+        case SWT.CURSOR_APPSTARTING:    break;
+        case SWT.CURSOR_ARROW:          shape = OS.GDK_LEFT_PTR; break;
+        case SWT.CURSOR_WAIT:           shape = OS.GDK_WATCH; break;
+        case SWT.CURSOR_CROSS:          shape = OS.GDK_CROSS; break;
+        case SWT.CURSOR_HAND:           shape = OS.GDK_HAND2; break;
+        case SWT.CURSOR_HELP:           shape = OS.GDK_QUESTION_ARROW; break;
+        case SWT.CURSOR_SIZEALL:        shape = OS.GDK_FLEUR; break;
+        case SWT.CURSOR_SIZENESW:       shape = OS.GDK_SIZING; break;
+        case SWT.CURSOR_SIZENS:         shape = OS.GDK_DOUBLE_ARROW; break;
+        case SWT.CURSOR_SIZENWSE:       shape = OS.GDK_SIZING; break;
+        case SWT.CURSOR_SIZEWE:         shape = OS.GDK_SB_H_DOUBLE_ARROW; break;
+        case SWT.CURSOR_SIZEN:          shape = OS.GDK_TOP_SIDE; break;
+        case SWT.CURSOR_SIZES:          shape = OS.GDK_BOTTOM_SIDE; break;
+        case SWT.CURSOR_SIZEE:          shape = OS.GDK_RIGHT_SIDE; break;
+        case SWT.CURSOR_SIZEW:          shape = OS.GDK_LEFT_SIDE; break;
+        case SWT.CURSOR_SIZENE:         shape = OS.GDK_TOP_RIGHT_CORNER; break;
+        case SWT.CURSOR_SIZESE:         shape = OS.GDK_BOTTOM_RIGHT_CORNER; break;
+        case SWT.CURSOR_SIZESW:         shape = OS.GDK_BOTTOM_LEFT_CORNER; break;
+        case SWT.CURSOR_SIZENW:         shape = OS.GDK_TOP_LEFT_CORNER; break;
+        case SWT.CURSOR_UPARROW:        shape = OS.GDK_SB_UP_ARROW; break;
+        case SWT.CURSOR_IBEAM:          shape = OS.GDK_XTERM; break;
+        case SWT.CURSOR_NO:             shape = OS.GDK_X_CURSOR; break;
+        default:
+            SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (shape is 0 && style is SWT.CURSOR_APPSTARTING) {
+        handle = createCursor(APPSTARTING_SRC, APPSTARTING_MASK, 32, 32, 2, 2, true);
+    } else {
+        handle = OS.gdk_cursor_new(shape);
+    }
+    if (handle is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    init_();
+}
+
+/**
+ * Constructs a new cursor given a device, image and mask
+ * data describing the desired cursor appearance, and the x
+ * and y coordinates of the <em>hotspot</em> (that is, the point
+ * within the area covered by the cursor which is considered
+ * to be where the on-screen pointer is "pointing").
+ * <p>
+ * The mask data is allowed to be null, but in this case the source
+ * must be an ImageData representing an icon that specifies both
+ * color data and mask data.
+ * <p>
+ * You must dispose the cursor when it is no longer required.
+ * </p>
+ *
+ * @param device the device on which to allocate the cursor
+ * @param source the color data for the cursor
+ * @param mask the mask data for the cursor (or null)
+ * @param hotspotX the x coordinate of the cursor's hotspot
+ * @param hotspotY the y coordinate of the cursor's hotspot
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ *    <li>ERROR_NULL_ARGUMENT - if the source is null</li>
+ *    <li>ERROR_NULL_ARGUMENT - if the mask is null and the source does not have a mask</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the source and the mask are not the same
+ *          size, or if the hotspot is outside the bounds of the image</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES - if a handle could not be obtained for cursor creation</li>
+ * </ul>
+ */
+public this(Device device, ImageData source, ImageData mask, int hotspotX, int hotspotY) {
+    super(device);
+    if (source is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (mask is null) {
+        if (!(source.getTransparencyType() is SWT.TRANSPARENCY_MASK)) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+        mask = source.getTransparencyMask();
+    }
+    /* Check the bounds. Mask must be the same size as source */
+    if (mask.width !is source.width || mask.height !is source.height) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    /* Check the hotspots */
+    if (hotspotX >= source.width || hotspotX < 0 ||
+        hotspotY >= source.height || hotspotY < 0) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    /* Convert depth to 1 */
+    source = ImageData.convertMask(source);
+    mask = ImageData.convertMask(mask);
+
+    /* Swap the bits in each byte and convert to appropriate scanline pad */
+    byte[] sourceData = new byte[source.data.length];
+    byte[] maskData = new byte[mask.data.length];
+    byte[] data = source.data;
+    for (int i = 0; i < data.length; i++) {
+        byte s = data[i];
+        sourceData[i] = cast(byte)(((s & 0x80) >> 7) |
+            ((s & 0x40) >> 5) |
+            ((s & 0x20) >> 3) |
+            ((s & 0x10) >> 1) |
+            ((s & 0x08) << 1) |
+            ((s & 0x04) << 3) |
+            ((s & 0x02) << 5) |
+            ((s & 0x01) << 7));
+        sourceData[i] = cast(byte) ~sourceData[i];
+    }
+    sourceData = ImageData.convertPad(sourceData, source.width, source.height, source.depth, source.scanlinePad, 1);
+    data = mask.data;
+    for (int i = 0; i < data.length; i++) {
+        byte s = data[i];
+        maskData[i] = cast(byte)(((s & 0x80) >> 7) |
+            ((s & 0x40) >> 5) |
+            ((s & 0x20) >> 3) |
+            ((s & 0x10) >> 1) |
+            ((s & 0x08) << 1) |
+            ((s & 0x04) << 3) |
+            ((s & 0x02) << 5) |
+            ((s & 0x01) << 7));
+        maskData[i] = cast(byte) ~maskData[i];
+    }
+    maskData = ImageData.convertPad(maskData, mask.width, mask.height, mask.depth, mask.scanlinePad, 1);
+    handle = createCursor(maskData, sourceData, source.width, source.height, hotspotX, hotspotY, true);
+    if (handle is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    init_();
+}
+
+/**
+ * Constructs a new cursor given a device, image data describing
+ * the desired cursor appearance, and the x and y coordinates of
+ * the <em>hotspot</em> (that is, the point within the area
+ * covered by the cursor which is considered to be where the
+ * on-screen pointer is "pointing").
+ * <p>
+ * You must dispose the cursor when it is no longer required.
+ * </p>
+ *
+ * @param device the device on which to allocate the cursor
+ * @param source the image data for the cursor
+ * @param hotspotX the x coordinate of the cursor's hotspot
+ * @param hotspotY the y coordinate of the cursor's hotspot
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ *    <li>ERROR_NULL_ARGUMENT - if the image is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the hotspot is outside the bounds of the
+ *       image</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES - if a handle could not be obtained for cursor creation</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public this(Device device, ImageData source, int hotspotX, int hotspotY) {
+    super(device);
+    if (source is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (hotspotX >= source.width || hotspotX < 0 ||
+        hotspotY >= source.height || hotspotY < 0) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    GdkDisplay* display;
+    if (OS.GTK_VERSION >= OS.buildVERSION(2, 4, 0) && OS.gdk_display_supports_cursor_color(display = OS.gdk_display_get_default ())) {
+        int width = source.width;
+        int height = source.height;
+        PaletteData palette = source.palette;
+        auto pixbuf = OS.gdk_pixbuf_new(OS.GDK_COLORSPACE_RGB, true, 8, width, height);
+        if (pixbuf is null) SWT.error(SWT.ERROR_NO_HANDLES);
+        int stride = OS.gdk_pixbuf_get_rowstride(pixbuf);
+        auto data = OS.gdk_pixbuf_get_pixels(pixbuf);
+        byte[] buffer = source.data;
+        if (!palette.isDirect || source.depth !is 24 || stride !is source.bytesPerLine || palette.redMask !is 0xFF000000 || palette.greenMask !is 0xFF0000 || palette.blueMask !is 0xFF00) {
+            buffer = new byte[source.width * source.height * 4];
+            if (palette.isDirect) {
+                ImageData.blit(ImageData.BLIT_SRC,
+                    source.data, source.depth, source.bytesPerLine, source.getByteOrder(), 0, 0, source.width, source.height, palette.redMask, palette.greenMask, palette.blueMask,
+                    ImageData.ALPHA_OPAQUE, null, 0, 0, 0,
+                    buffer, 32, source.width * 4, ImageData.MSB_FIRST, 0, 0, source.width, source.height, 0xFF000000, 0xFF0000, 0xFF00,
+                    false, false);
+            } else {
+                RGB[] rgbs = palette.getRGBs();
+                int length = rgbs.length;
+                byte[] srcReds = new byte[length];
+                byte[] srcGreens = new byte[length];
+                byte[] srcBlues = new byte[length];
+                for (int i = 0; i < rgbs.length; i++) {
+                    RGB rgb = rgbs[i];
+                    if (rgb is null) continue;
+                    srcReds[i] = cast(byte)rgb.red;
+                    srcGreens[i] = cast(byte)rgb.green;
+                    srcBlues[i] = cast(byte)rgb.blue;
+                }
+                ImageData.blit(ImageData.BLIT_SRC,
+                    source.data, source.depth, source.bytesPerLine, source.getByteOrder(), 0, 0, source.width, source.height, srcReds, srcGreens, srcBlues,
+                    ImageData.ALPHA_OPAQUE, null, 0, 0, 0,
+                    buffer, 32, source.width * 4, ImageData.MSB_FIRST, 0, 0, source.width, source.height, 0xFF000000, 0xFF0000, 0xFF00,
+                    false, false);
+            }
+            if (source.maskData !is null || source.transparentPixel !is -1) {
+                ImageData mask = source.getTransparencyMask();
+                byte[] maskData = mask.data;
+                int maskBpl = mask.bytesPerLine;
+                int offset = 3, maskOffset = 0;
+                for (int y = 0; y<source.height; y++) {
+                    for (int x = 0; x<source.width; x++) {
+                        buffer[offset] = ((maskData[maskOffset + (x >> 3)]) & (1 << (7 - (x & 0x7)))) !is 0 ? cast(byte)0xff : 0;
+                        offset += 4;
+                    }
+                    maskOffset += maskBpl;
+                }
+            } else if (source.alpha !is -1) {
+                byte alpha = cast(byte)source.alpha;
+                for (int i=3; i<buffer.length; i+=4) {
+                    buffer[i] = alpha;
+                }
+            } else if (source.alphaData !is null) {
+                byte[] alphaData = source.alphaData;
+                for (int i=3; i<buffer.length; i+=4) {
+                    buffer[i] = alphaData[i/4];
+                }
+            }
+        }
+        memmove(data, buffer.ptr, stride * height);
+        handle = OS.gdk_cursor_new_from_pixbuf(display, pixbuf, hotspotX, hotspotY);
+        OS.g_object_unref(pixbuf);
+    } else {
+
+        ImageData mask = source.getTransparencyMask();
+
+        /* Ensure depth is equal to 1 */
+        if (source.depth > 1) {
+            /* Create a destination image with no data */
+            ImageData newSource = new ImageData(
+                source.width, source.height, 1, ImageData.bwPalette(),
+                1, null, 0, null, null, -1, -1, 0, 0, 0, 0, 0);
+
+            byte[] newReds = [ cast(byte)0, cast(byte)255 ], newGreens = newReds, newBlues = newReds;
+
+            /* Convert the source to a black and white image of depth 1 */
+            PaletteData palette = source.palette;
+            if (palette.isDirect) {
+                ImageData.blit(ImageData.BLIT_SRC,
+                        source.data, source.depth, source.bytesPerLine, source.getByteOrder(), 0, 0, source.width, source.height, palette.redMask, palette.greenMask, palette.blueMask,
+                        ImageData.ALPHA_OPAQUE, null, 0, 0, 0,
+                        newSource.data, newSource.depth, newSource.bytesPerLine, newSource.getByteOrder(), 0, 0, newSource.width, newSource.height, newReds, newGreens, newBlues,
+                        false, false);
+            } else {
+                RGB[] rgbs = palette.getRGBs();
+                int length = rgbs.length;
+                byte[] srcReds = new byte[length];
+                byte[] srcGreens = new byte[length];
+                byte[] srcBlues = new byte[length];
+                for (int i = 0; i < rgbs.length; i++) {
+                    RGB rgb = rgbs[i];
+                    if (rgb is null) continue;
+                    srcReds[i] = cast(byte)rgb.red;
+                    srcGreens[i] = cast(byte)rgb.green;
+                    srcBlues[i] = cast(byte)rgb.blue;
+                }
+                ImageData.blit(ImageData.BLIT_SRC,
+                        source.data, source.depth, source.bytesPerLine, source.getByteOrder(), 0, 0, source.width, source.height, srcReds, srcGreens, srcBlues,
+                        ImageData.ALPHA_OPAQUE, null, 0, 0, 0,
+                        newSource.data, newSource.depth, newSource.bytesPerLine, newSource.getByteOrder(), 0, 0, newSource.width, newSource.height, newReds, newGreens, newBlues,
+                        false, false);
+            }
+            source = newSource;
+        }
+
+        /* Swap the bits in each byte and convert to appropriate scanline pad */
+        byte[] sourceData = new byte[source.data.length];
+        byte[] maskData = new byte[mask.data.length];
+        byte[] data = source.data;
+        for (int i = 0; i < data.length; i++) {
+            byte s = data[i];
+            sourceData[i] = cast(byte)(((s & 0x80) >> 7) |
+                ((s & 0x40) >> 5) |
+                ((s & 0x20) >> 3) |
+                ((s & 0x10) >> 1) |
+                ((s & 0x08) << 1) |
+                ((s & 0x04) << 3) |
+                ((s & 0x02) << 5) |
+                ((s & 0x01) << 7));
+        }
+        sourceData = ImageData.convertPad(sourceData, source.width, source.height, source.depth, source.scanlinePad, 1);
+        data = mask.data;
+        for (int i = 0; i < data.length; i++) {
+            byte s = data[i];
+            maskData[i] = cast(byte)(((s & 0x80) >> 7) |
+                ((s & 0x40) >> 5) |
+                ((s & 0x20) >> 3) |
+                ((s & 0x10) >> 1) |
+                ((s & 0x08) << 1) |
+                ((s & 0x04) << 3) |
+                ((s & 0x02) << 5) |
+                ((s & 0x01) << 7));
+        }
+        maskData = ImageData.convertPad(maskData, mask.width, mask.height, mask.depth, mask.scanlinePad, 1);
+        handle = createCursor(sourceData, maskData, source.width, source.height, hotspotX, hotspotY, false);
+    }
+    if (handle is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    init_();
+}
+
+GdkCursor* createCursor(byte[] sourceData, byte[] maskData, int width, int height, int hotspotX, int hotspotY, bool reverse) {
+    auto sourcePixmap = OS.gdk_bitmap_create_from_data(null, cast(char*)sourceData.ptr, width, height);
+    auto maskPixmap = OS.gdk_bitmap_create_from_data(null, cast(char*)maskData.ptr, width, height);
+    GdkCursor* cursor = null;
+    if (sourcePixmap !is null && maskPixmap !is null) {
+        GdkColor* foreground = new GdkColor();
+        if (!reverse) foreground.red = foreground.green = foreground.blue = 0xFFFF;
+        GdkColor* background = new GdkColor();
+        if (reverse) background.red = background.green = background.blue = 0xFFFF;
+        cursor = OS.gdk_cursor_new_from_pixmap (cast(GdkPixmap*)sourcePixmap, cast(GdkPixmap*)maskPixmap, foreground, background, hotspotX, hotspotY);
+    }
+    if (sourcePixmap !is null) OS.g_object_unref (sourcePixmap);
+    if (maskPixmap !is null) OS.g_object_unref (maskPixmap);
+    return cursor;
+}
+
+void destroy() {
+    OS.gdk_cursor_destroy(handle);
+    handle = null;
+}
+
+/**
+ * Compares the argument to the receiver, and returns true
+ * if they represent the <em>same</em> object using a class
+ * specific comparison.
+ *
+ * @param object the object to compare with this object
+ * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
+ *
+ * @see #hashCode
+ */
+public override int opEquals(Object object) {
+    if (object is this) return true;
+    if ( auto cursor = cast(Cursor)object ){
+        return device is cursor.device && handle is cursor.handle;
+    }
+    return false;
+}
+
+/**
+ * Invokes platform specific functionality to allocate a new cursor.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Cursor</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param device the device on which to allocate the color
+ * @param handle the handle for the cursor
+ *
+ * @private
+ */
+public static Cursor gtk_new(Device device, GdkCursor* handle) {
+    Cursor cursor = new Cursor(device);
+    cursor.handle = handle;
+    return cursor;
+}
+
+/**
+ * Returns an integer hash code for the receiver. Any two
+ * objects that return <code>true</code> when passed to
+ * <code>equals</code> must return the same value for this
+ * method.
+ *
+ * @return the receiver's hash
+ *
+ * @see #equals
+ */
+public override hash_t toHash() {
+    return cast(hash_t)handle;
+}
+
+/**
+ * Returns <code>true</code> if the cursor has been disposed,
+ * and <code>false</code> otherwise.
+ * <p>
+ * This method gets the dispose state for the cursor.
+ * When a cursor has been disposed, it is an error to
+ * invoke any other method using the cursor.
+ *
+ * @return <code>true</code> when the cursor is disposed and <code>false</code> otherwise
+ */
+public override bool isDisposed() {
+    return handle is null;
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the receiver
+ */
+public override String toString () {
+    if (isDisposed()) return "Cursor {*DISPOSED*}";
+    return Format( "Cursor {{{}}", handle );
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Device.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,876 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.Device;
+
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Drawable;
+import org.eclipse.swt.graphics.DeviceData;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GCData;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.internal.Compatibility;
+import org.eclipse.swt.internal.gtk.OS;
+import java.lang.all;
+
+import tango.core.Exception;
+
+/**
+ * This class is the abstract superclass of all device objects,
+ * such as the Display device and the Printer device. Devices
+ * can have a graphics context (GC) created for them, and they
+ * can be drawn on by sending messages to the associated GC.
+ *
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public abstract class Device : Drawable {
+    /**
+     * the handle to the X Display
+     * (Warning: This field is platform dependent)
+     * <p>
+     * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+     * public API. It is marked protected only so that it can be shared
+     * within the packages provided by SWT. It is not available on all
+     * platforms and should never be accessed from application code.
+     * </p>
+     */
+    protected void* xDisplay;
+    GtkWidget* shellHandle;
+
+    /* Debugging */
+    public static bool DEBUG = true;
+    bool debugging;
+    bool tracking;
+    Exception [] errors;
+    Object [] objects;
+    Object trackingLock;
+
+    /* Colormap and reference count */
+    GdkColor *[] gdkColors;
+    int [] colorRefCount;
+
+    /* Disposed flag */
+    bool disposed;
+
+    /* Warning and Error Handlers */
+    //int /*long*/ logProcFld;
+    //GLogFunc logCallback;
+    //NOT DONE - get list of valid names
+    String [] log_domains = ["GLib-GObject"[], "GLib", "GObject", "Pango", "ATK", "GdkPixbuf", "Gdk", "Gtk", "GnomeVFS"];
+    int [] handler_ids;// = new int [log_domains.length];
+    int warningLevel;
+
+    /* X Warning and Error Handlers */
+    static extern(C) int function(void *) mXIOErrorHandler;
+    static extern(C) int function(void *, XErrorEvent *) mXErrorHandler;
+    //static int mXErrorCallback, mXIOErrorCallback;
+
+    static int /*long*/ XErrorProc, XIOErrorProc, XNullErrorProc, XNullIOErrorProc;
+    static Device[] Devices;
+
+    /*
+    * The following colors are listed in the Windows
+    * Programmer's Reference as the colors in the default
+    * palette.
+    */
+    Color COLOR_BLACK, COLOR_DARK_RED, COLOR_DARK_GREEN, COLOR_DARK_YELLOW, COLOR_DARK_BLUE;
+    Color COLOR_DARK_MAGENTA, COLOR_DARK_CYAN, COLOR_GRAY, COLOR_DARK_GRAY, COLOR_RED;
+    Color COLOR_GREEN, COLOR_YELLOW, COLOR_BLUE, COLOR_MAGENTA, COLOR_CYAN, COLOR_WHITE;
+
+    /* System Font */
+    Font systemFont;
+
+    PangoTabArray* emptyTab;
+
+    bool useXRender;
+
+    static bool CAIRO_LOADED;
+
+    /*
+    * TEMPORARY CODE. When a graphics object is
+    * created and the device parameter is null,
+    * the current Display is used. This presents
+    * a problem because SWT graphics does not
+    * reference classes in SWT widgets. The correct
+    * fix is to remove this feature. Unfortunately,
+    * too many application programs rely on this
+    * feature.
+    *
+    * This code will be removed in the future.
+    */
+    protected static Device CurrentDevice;
+    protected static Runnable DeviceFinder;
+
+//synchronized static void static_this(){
+//    CREATE_LOCK = new Object();
+//    Devices = new Device[4];
+//}
+/*
+* TEMPORARY CODE.
+*/
+static synchronized Device getDevice () {
+    if (DeviceFinder !is null) DeviceFinder.run();
+    Device device = CurrentDevice;
+    CurrentDevice = null;
+    return device;
+}
+
+/**
+ * Constructs a new instance of this class.
+ * <p>
+ * You must dispose the device when it is no longer required.
+ * </p>
+ *
+ * @see #create
+ * @see #init
+ *
+ * @since 3.1
+ */
+public this() {
+    this(null);
+}
+
+/**
+ * Constructs a new instance of this class.
+ * <p>
+ * You must dispose the device when it is no longer required.
+ * </p>
+ *
+ * @param data the DeviceData which describes the receiver
+ *
+ * @see #create
+ * @see #init
+ * @see DeviceData
+ */
+public this(DeviceData data) {
+    handler_ids = new int [log_domains.length];
+    debugging = DEBUG;
+    tracking = DEBUG;
+
+    synchronized ( this.classinfo ) {
+        if (data !is null) {
+            debugging = data.debugging;
+            tracking = data.tracking;
+        }
+        if (tracking) {
+            errors = new Exception [128];
+            objects = new Object [128];
+            trackingLock = new Object ();
+        }
+        create (data);
+        init_ ();
+        register (this);
+    }
+}
+
+void checkCairo() {
+}
+
+/**
+ * Throws an <code>SWTException</code> if the receiver can not
+ * be accessed by the caller. This may include both checks on
+ * the state of the receiver and more generally on the entire
+ * execution context. This method <em>should</em> be called by
+ * device implementors to enforce the standard SWT invariants.
+ * <p>
+ * Currently, it is an error to invoke any method (other than
+ * <code>isDisposed()</code> and <code>dispose()</code>) on a
+ * device that has had its <code>dispose()</code> method called.
+ * </p><p>
+ * In future releases of SWT, there may be more or fewer error
+ * checks and exceptions may be thrown for different reasons.
+ * <p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+protected void checkDevice () {
+    if (disposed) SWT.error(SWT.ERROR_DEVICE_DISPOSED);
+}
+
+/**
+ * Creates the device in the operating system.  If the device
+ * does not have a handle, this method may do nothing depending
+ * on the device.
+ * <p>
+ * This method is called before <code>init</code>.
+ * </p><p>
+ * Subclasses are supposed to reimplement this method and not
+ * call the <code>super</code> implementation.
+ * </p>
+ *
+ * @param data the DeviceData which describes the receiver
+ *
+ * @see #init
+ */
+protected void create (DeviceData data) {
+}
+
+/**
+ * Disposes of the operating system resources associated with
+ * the receiver. After this method has been invoked, the receiver
+ * will answer <code>true</code> when sent the message
+ * <code>isDisposed()</code>.
+ *
+ * @see #release
+ * @see #destroy
+ * @see #checkDevice
+ */
+public void dispose () {
+    synchronized (Device.classinfo) {
+        if (isDisposed()) return;
+        checkDevice ();
+        release ();
+        destroy ();
+        deregister (this);
+        xDisplay = null;
+        disposed = true;
+        if (tracking) {
+            synchronized (trackingLock) {
+                objects = null;
+                errors = null;
+                trackingLock = null;
+            }
+        }
+    }
+}
+
+void dispose_Object (Object object) {
+    synchronized (trackingLock) {
+        for (int i=0; i<objects.length; i++) {
+            if (objects [i] is object) {
+                objects [i] = null;
+                errors [i] = null;
+                return;
+            }
+        }
+    }
+}
+
+static synchronized Device findDevice (void* xDisplay) {
+    for (int i=0; i<Devices.length; i++) {
+        Device device = Devices [i];
+        if (device !is null && device.xDisplay is xDisplay) {
+            return device;
+        }
+    }
+    return null;
+}
+
+synchronized static void deregister (Device device) {
+    for (int i=0; i<Devices.length; i++) {
+        if (device is Devices [i]) Devices [i] = null;
+    }
+}
+
+/**
+ * Destroys the device in the operating system and releases
+ * the device's handle.  If the device does not have a handle,
+ * this method may do nothing depending on the device.
+ * <p>
+ * This method is called after <code>release</code>.
+ * </p><p>
+ * Subclasses are supposed to reimplement this method and not
+ * call the <code>super</code> implementation.
+ * </p>
+ *
+ * @see #dispose
+ * @see #release
+ */
+protected void destroy () {
+}
+
+/**
+ * Returns a rectangle describing the receiver's size and location.
+ *
+ * @return the bounding rectangle
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Rectangle getBounds () {
+    checkDevice ();
+    return new Rectangle(0, 0, 0, 0);
+}
+
+/**
+ * Returns a <code>DeviceData</code> based on the receiver.
+ * Modifications made to this <code>DeviceData</code> will not
+ * affect the receiver.
+ *
+ * @return a <code>DeviceData</code> containing the device's data and attributes
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see DeviceData
+ */
+public DeviceData getDeviceData () {
+    checkDevice();
+    DeviceData data = new DeviceData ();
+    data.debugging = debugging;
+    data.tracking = tracking;
+    if (tracking) {
+        synchronized (trackingLock) {
+            int count = 0, length = objects.length;
+            for (int i=0; i<length; i++) {
+                if (objects [i] !is null) count++;
+            }
+            int index = 0;
+            data.objects = new Object [count];
+            data.errors = new Exception [count];
+            for (int i=0; i<length; i++) {
+                if (objects [i] !is null) {
+                    data.objects [index] = objects [i];
+                    data.errors [index] = errors [i];
+                    index++;
+                }
+            }
+        }
+    } else {
+        data.objects = null;
+        data.errors = null;
+    }
+    return data;
+}
+
+/**
+ * Returns a rectangle which describes the area of the
+ * receiver which is capable of displaying data.
+ *
+ * @return the client area
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getBounds
+ */
+public Rectangle getClientArea () {
+    checkDevice ();
+    return getBounds ();
+}
+
+/**
+ * Returns the bit depth of the screen, which is the number of
+ * bits it takes to represent the number of unique colors that
+ * the screen is currently capable of displaying. This number
+ * will typically be one of 1, 8, 15, 16, 24 or 32.
+ *
+ * @return the depth of the screen
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getDepth () {
+    checkDevice ();
+    return 0;
+}
+
+/**
+ * Returns a point whose x coordinate is the horizontal
+ * dots per inch of the display, and whose y coordinate
+ * is the vertical dots per inch of the display.
+ *
+ * @return the horizontal and vertical DPI
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Point getDPI () {
+    checkDevice ();
+    return new Point (72, 72);
+}
+
+/**
+ * Returns <code>FontData</code> objects which describe
+ * the fonts that match the given arguments. If the
+ * <code>faceName</code> is null, all fonts will be returned.
+ *
+ * @param faceName the name of the font to look for, or null
+ * @param scalable if true only scalable fonts are returned, otherwise only non-scalable fonts are returned.
+ * @return the matching font data
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public FontData[] getFontList (String faceName, bool scalable) {
+    checkDevice ();
+    if (!scalable) return new FontData[0];
+    PangoFontFamily* family;
+    PangoFontFace * face;
+    PangoFontFamily** families;
+    int n_families;
+    PangoFontFace ** faces;
+    int n_faces;
+    auto context = OS.gdk_pango_context_get();
+    OS.pango_context_list_families(context, &families, &n_families);
+    int nFds = 0;
+    FontData[] fds = new FontData[faceName !is null ? 4 : n_families];
+    for (int i=0; i<n_families; i++) {
+        family = families[i];
+        bool match = true;
+        if (faceName !is null) {
+            auto familyName = OS.pango_font_family_get_name(family);
+            match = Compatibility.equalsIgnoreCase(faceName, fromStringz( familyName ));
+        }
+        if (match) {
+            OS.pango_font_family_list_faces(family, &faces, &n_faces);
+            for (int j=0; j<n_faces; j++) {
+                face = faces[j];
+                auto fontDesc = OS.pango_font_face_describe(face);
+                Font font = Font.gtk_new(this, fontDesc);
+                FontData data = font.getFontData()[0];
+                if (nFds is fds.length) {
+                    FontData[] newFds = new FontData[fds.length + n_families];
+                    System.arraycopy(fds, 0, newFds, 0, nFds);
+                    fds = newFds;
+                }
+                fds[nFds++] = data;
+                OS.pango_font_description_free(fontDesc);
+            }
+            OS.g_free(faces);
+            if (faceName !is null) break;
+        }
+    }
+    OS.g_free(families);
+    OS.g_object_unref(context);
+    if (nFds is fds.length) return fds;
+    FontData[] result = new FontData[nFds];
+    System.arraycopy(fds, 0, result, 0, nFds);
+    return result;
+}
+
+/**
+ * Returns the matching standard color for the given
+ * constant, which should be one of the color constants
+ * specified in class <code>SWT</code>. Any value other
+ * than one of the SWT color constants which is passed
+ * in will result in the color black. This color should
+ * not be freed because it was allocated by the system,
+ * not the application.
+ *
+ * @param id the color constant
+ * @return the matching color
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see SWT
+ */
+public Color getSystemColor (int id) {
+    checkDevice ();
+    switch (id) {
+        case SWT.COLOR_BLACK:               return COLOR_BLACK;
+        case SWT.COLOR_DARK_RED:            return COLOR_DARK_RED;
+        case SWT.COLOR_DARK_GREEN:          return COLOR_DARK_GREEN;
+        case SWT.COLOR_DARK_YELLOW:         return COLOR_DARK_YELLOW;
+        case SWT.COLOR_DARK_BLUE:           return COLOR_DARK_BLUE;
+        case SWT.COLOR_DARK_MAGENTA:        return COLOR_DARK_MAGENTA;
+        case SWT.COLOR_DARK_CYAN:           return COLOR_DARK_CYAN;
+        case SWT.COLOR_GRAY:                return COLOR_GRAY;
+        case SWT.COLOR_DARK_GRAY:           return COLOR_DARK_GRAY;
+        case SWT.COLOR_RED:                 return COLOR_RED;
+        case SWT.COLOR_GREEN:               return COLOR_GREEN;
+        case SWT.COLOR_YELLOW:              return COLOR_YELLOW;
+        case SWT.COLOR_BLUE:                return COLOR_BLUE;
+        case SWT.COLOR_MAGENTA:             return COLOR_MAGENTA;
+        case SWT.COLOR_CYAN:                return COLOR_CYAN;
+        case SWT.COLOR_WHITE:               return COLOR_WHITE;
+        default:
+    }
+    return COLOR_BLACK;
+}
+
+/**
+ * Returns a reasonable font for applications to use.
+ * On some platforms, this will match the "default font"
+ * or "system font" if such can be found.  This font
+ * should not be freed because it was allocated by the
+ * system, not the application.
+ * <p>
+ * Typically, applications which want the default look
+ * should simply not set the font on the widgets they
+ * create. Widgets are always created with the correct
+ * default font for the class of user-interface component
+ * they represent.
+ * </p>
+ *
+ * @return a font
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Font getSystemFont () {
+    checkDevice ();
+    return systemFont;
+}
+
+/**
+ * Returns <code>true</code> if the underlying window system prints out
+ * warning messages on the console, and <code>setWarnings</code>
+ * had previously been called with <code>true</code>.
+ *
+ * @return <code>true</code>if warnings are being handled, and <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public bool getWarnings () {
+    checkDevice ();
+    return warningLevel is 0;
+}
+
+/**
+ * Initializes any internal resources needed by the
+ * device.
+ * <p>
+ * This method is called after <code>create</code>.
+ * </p><p>
+ * If subclasses reimplement this method, they must
+ * call the <code>super</code> implementation.
+ * </p>
+ *
+ * @see #create
+ */
+protected void init_ () {
+    if (xDisplay !is null) {
+        int event_basep, error_basep;
+        if (OS.XRenderQueryExtension (xDisplay, &event_basep, &error_basep)) {
+            int major_version, minor_version;
+            OS.XRenderQueryVersion (xDisplay, &major_version, &minor_version);
+            useXRender = major_version > 0 || (major_version is 0 && minor_version >= 8);
+        }
+    }
+
+    if (debugging) {
+        if (xDisplay !is null) {
+            /* Create the warning and error callbacks */
+            synchronized (this.classinfo) {
+                int index = 0;
+                while (index < Devices.length) {
+                    if (Devices [index] !is null) break;
+                    index++;
+                }
+                if (index is Devices.length) {
+                    OS.XSetErrorHandler ( & XErrorProcFunc );
+                    OS.XSetIOErrorHandler ( & XIOErrorProcFunc );
+                }
+            }
+            OS.XSynchronize (xDisplay, true);
+        }
+    }
+
+    /* Create GTK warnings and error callbacks */
+    if (xDisplay !is null) {
+        /* Set GTK warning and error handlers */
+        if (debugging) {
+            int flags = OS.G_LOG_LEVEL_MASK | OS.G_LOG_FLAG_FATAL | OS.G_LOG_FLAG_RECURSION;
+            for (int i=0; i<log_domains.length; i++) {
+                handler_ids [i] = OS.g_log_set_handler (log_domains [i].toStringzValidPtr(), flags, & logFunction, cast(void*)this);
+            }
+        }
+    }
+
+    /* Create the standard colors */
+    COLOR_BLACK = new Color (this, 0,0,0);
+    COLOR_DARK_RED = new Color (this, 0x80,0,0);
+    COLOR_DARK_GREEN = new Color (this, 0,0x80,0);
+    COLOR_DARK_YELLOW = new Color (this, 0x80,0x80,0);
+    COLOR_DARK_BLUE = new Color (this, 0,0,0x80);
+    COLOR_DARK_MAGENTA = new Color (this, 0x80,0,0x80);
+    COLOR_DARK_CYAN = new Color (this, 0,0x80,0x80);
+    COLOR_GRAY = new Color (this, 0xC0,0xC0,0xC0);
+    COLOR_DARK_GRAY = new Color (this, 0x80,0x80,0x80);
+    COLOR_RED = new Color (this, 0xFF,0,0);
+    COLOR_GREEN = new Color (this, 0,0xFF,0);
+    COLOR_YELLOW = new Color (this, 0xFF,0xFF,0);
+    COLOR_BLUE = new Color (this, 0,0,0xFF);
+    COLOR_MAGENTA = new Color (this, 0xFF,0,0xFF);
+    COLOR_CYAN = new Color (this, 0,0xFF,0xFF);
+    COLOR_WHITE = new Color (this, 0xFF,0xFF,0xFF);
+
+    emptyTab = OS.pango_tab_array_new(1, false);
+    if (emptyTab is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    OS.pango_tab_array_set_tab(emptyTab, 0, OS.PANGO_TAB_LEFT, 1);
+
+    shellHandle = OS.gtk_window_new(OS.GTK_WINDOW_TOPLEVEL);
+    if (shellHandle is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    OS.gtk_widget_realize(shellHandle);
+
+    /* Initialize the system font slot */
+    systemFont = getSystemFont ();
+}
+
+/**
+ * Invokes platform specific functionality to allocate a new GC handle.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Device</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param data the platform specific GC data
+ * @return the platform specific GC handle
+ */
+public abstract GdkGC* internal_new_GC (GCData data);
+
+/**
+ * Invokes platform specific functionality to dispose a GC handle.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Device</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param hDC the platform specific GC handle
+ * @param data the platform specific GC data
+ */
+public abstract void internal_dispose_GC (GdkGC* handle, GCData data);
+
+/**
+ * Returns <code>true</code> if the device has been disposed,
+ * and <code>false</code> otherwise.
+ * <p>
+ * This method gets the dispose state for the device.
+ * When a device has been disposed, it is an error to
+ * invoke any other method using the device.
+ *
+ * @return <code>true</code> when the device is disposed and <code>false</code> otherwise
+ */
+public bool isDisposed () {
+    synchronized (Device.classinfo) {
+        return disposed;
+    }
+}
+
+/**
+ * Loads the font specified by a file.  The font will be
+ * present in the list of fonts available to the application.
+ *
+ * @param path the font file path
+ * @return whether the font was successfully loaded
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if path is null</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see Font
+ *
+ * @since 3.3
+ */
+public bool loadFont (String path) {
+    checkDevice();
+    if (path is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    return cast(bool) OS.FcConfigAppFontAddFile (null, path.toStringzValidPtr());
+}
+
+private static extern(C) void logFunction (char* log_domain, int log_level, char* message, void* user_data) {
+    Device dev = cast(Device)user_data;
+    if (dev.warningLevel is 0) {
+        if (DEBUG || dev.debugging) {
+            ExceptionPrintStackTrace(new Exception (""));
+        }
+        OS.g_log_default_handler (log_domain, log_level, message, user_data);
+    }
+    return 0;
+}
+
+void new_Object (Object object) {
+    synchronized (trackingLock) {
+        for (int i=0; i<objects.length; i++) {
+            if (objects [i] is null) {
+                objects [i] = object;
+                errors [i] = new Exception ("");
+                return;
+            }
+        }
+        Object [] newObjects = new Object [objects.length + 128];
+        System.arraycopy (objects, 0, newObjects, 0, objects.length);
+        newObjects [objects.length] = object;
+        objects = newObjects;
+        Exception [] newErrors = new Exception [errors.length + 128];
+        System.arraycopy (errors, 0, newErrors, 0, errors.length);
+        newErrors [errors.length] = new Exception ("");
+        errors = newErrors;
+    }
+}
+
+static synchronized void register (Device device) {
+    for (int i=0; i<Devices.length; i++) {
+        if (Devices [i] is null) {
+            Devices [i] = device;
+            return;
+        }
+    }
+    Device [] newDevices = new Device [Devices.length + 4];
+    System.arraycopy (Devices, 0, newDevices, 0, Devices.length);
+    newDevices [Devices.length] = device;
+    Devices = newDevices;
+}
+
+/**
+ * Releases any internal resources back to the operating
+ * system and clears all fields except the device handle.
+ * <p>
+ * When a device is destroyed, resources that were acquired
+ * on behalf of the programmer need to be returned to the
+ * operating system.  For example, if the device allocated a
+ * font to be used as the system font, this font would be
+ * freed in <code>release</code>.  Also,to assist the garbage
+ * collector and minimize the amount of memory that is not
+ * reclaimed when the programmer keeps a reference to a
+ * disposed device, all fields except the handle are zero'd.
+ * The handle is needed by <code>destroy</code>.
+ * </p>
+ * This method is called before <code>destroy</code>.
+ * </p><p>
+ * If subclasses reimplement this method, they must
+ * call the <code>super</code> implementation.
+ * </p>
+ *
+ * @see #dispose
+ * @see #destroy
+ */
+protected void release () {
+    if (shellHandle !is null) OS.gtk_widget_destroy(shellHandle);
+    shellHandle = null;
+
+    if (gdkColors !is null) {
+        auto colormap = OS.gdk_colormap_get_system();
+        for (int i = 0; i < gdkColors.length; i++) {
+            GdkColor* color = gdkColors [i];
+            if (color !is null) {
+                while (colorRefCount [i] > 0) {
+                    OS.gdk_colormap_free_colors(colormap, color, 1);
+                    --colorRefCount [i];
+                }
+            }
+        }
+    }
+    gdkColors = null;
+    colorRefCount = null;
+    COLOR_BLACK = COLOR_DARK_RED = COLOR_DARK_GREEN = COLOR_DARK_YELLOW = COLOR_DARK_BLUE =
+    COLOR_DARK_MAGENTA = COLOR_DARK_CYAN = COLOR_GRAY = COLOR_DARK_GRAY = COLOR_RED =
+    COLOR_GREEN = COLOR_YELLOW = COLOR_BLUE = COLOR_MAGENTA = COLOR_CYAN = COLOR_WHITE = null;
+
+    if (emptyTab !is null ) OS.pango_tab_array_free(emptyTab);
+    emptyTab = null;
+
+    /* Free the GTK error and warning handler */
+    if (xDisplay !is null) {
+        for (int i=0; i<handler_ids.length; i++) {
+            if (handler_ids [i] !is 0 ) {
+                OS.g_log_remove_handler (log_domains [i].toStringzValidPtr(), handler_ids [i]);
+                handler_ids [i] = 0;
+            }
+        }
+        //logCallback.dispose ();  logCallback = null;
+        handler_ids = null;  log_domains = null;
+        //logProcFld = 0;
+    }
+}
+
+/**
+ * If the underlying window system supports printing warning messages
+ * to the console, setting warnings to <code>false</code> prevents these
+ * messages from being printed. If the argument is <code>true</code> then
+ * message printing is not blocked.
+ *
+ * @param warnings <code>true</code>if warnings should be printed, and <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setWarnings (bool warnings) {
+    checkDevice ();
+    if (warnings) {
+        if (--warningLevel is 0) {
+            if (debugging) return;
+            for (int i=0; i<handler_ids.length; i++) {
+                if (handler_ids [i] !is 0) {
+                    OS.g_log_remove_handler (log_domains [i].toStringzValidPtr(), handler_ids [i]);
+                    handler_ids [i] = 0;
+                }
+            }
+        }
+    } else {
+        if (warningLevel++ is 0) {
+            if (debugging) return;
+            int flags = OS.G_LOG_LEVEL_MASK | OS.G_LOG_FLAG_FATAL | OS.G_LOG_FLAG_RECURSION;
+            for (int i=0; i<log_domains.length; i++) {
+                handler_ids [i] = OS.g_log_set_handler (log_domains [i].toStringzValidPtr(), flags, & logFunction, cast(void*)this );
+            }
+        }
+    }
+}
+
+private static extern(C) int /*long*/ XErrorProcFunc (void* xDisplay, org.eclipse.swt.internal.gtk.OS.XErrorEvent* xErrorEvent) {
+    Device device = findDevice (xDisplay);
+    if (device !is null) {
+        if (device.warningLevel is 0) {
+            if (DEBUG || device.debugging) {
+                foreach( msg; (new Exception ("")).info ){
+                    getDwtLogger().error( __FILE__, __LINE__,  "{}", msg );
+                }
+            }
+            //PORTING_FIXME ??
+            //OS.Call (XErrorProc, xDisplay, xErrorEvent);
+        }
+    } else {
+        if (DEBUG) (new SWTError ()).printStackTrace ();
+        //PORTING_FIXME ??
+        //OS.Call (XErrorProc, xDisplay, xErrorEvent);
+    }
+    return 0;
+}
+
+private static extern(C)  int /*long*/ XIOErrorProcFunc (void* xDisplay) {
+    Device device = findDevice (xDisplay);
+    if (device !is null) {
+        if (DEBUG || device.debugging) {
+            foreach( msg; (new Exception ("")).info ){
+                getDwtLogger().error( __FILE__, __LINE__,  "trc {}", msg );
+            }
+        }
+    } else {
+        if (DEBUG) {
+            foreach( msg; (new Exception ("")).info ){
+                getDwtLogger().error( __FILE__, __LINE__,  "{}", msg );
+            }
+        }
+    }
+    //PORTING_FIXME ??
+    //OS.Call (XIOErrorProc, xDisplay, 0);
+    return 0;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/DeviceData.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.DeviceData;
+
+import java.lang.all;
+
+import tango.core.Exception;
+
+public class DeviceData {
+    /*
+    * The following fields are platform dependent.
+    * <p>
+    * <b>IMPORTANT:</b> These fields are <em>not</em> part of the SWT
+    * public API. They are marked public only so that they can be shared
+    * within the packages provided by SWT. They are not available on all
+    * platforms and should never be accessed from application code.
+    * </p>
+    */
+    public String display_name;
+    public String application_name;
+    public String application_class;
+
+    /*
+    * Debug fields - may not be honoured
+    * on some SWT platforms.
+    */
+    public bool debugging;
+    public bool tracking;
+    public Exception [] errors;
+    public Object [] objects;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Drawable.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.Drawable;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.graphics.GCData;
+import org.eclipse.swt.internal.gtk.OS;
+
+/**
+ * Implementers of <code>Drawable</code> can have a graphics context (GC)
+ * created for them, and then they can be drawn on by sending messages to
+ * their associated GC. SWT images, and device objects such as the Display
+ * device and the Printer device, are drawables.
+ * <p>
+ * <b>IMPORTANT:</b> This class is <em>not</em> part of the SWT
+ * public API. It is marked public only so that it can be shared
+ * within the packages provided by SWT. It should never be
+ * referenced from application code.
+ * </p>
+ *
+ * @see Device
+ * @see Image
+ * @see GC
+ */
+public interface Drawable {
+
+/**
+ * Invokes platform specific functionality to allocate a new GC handle.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Drawable</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param data the platform specific GC data
+ * @return the platform specific GC handle
+ */
+
+public GdkGC* internal_new_GC (GCData data);
+
+/**
+ * Invokes platform specific functionality to dispose a GC handle.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Drawable</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param handle the platform specific GC handle
+ * @param data the platform specific GC data
+ */
+public void internal_dispose_GC (GdkGC* handle, GCData data);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Font.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,297 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.Font;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Resource;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.internal.Converter;
+import org.eclipse.swt.internal.gtk.OS;
+
+import tango.text.convert.Format;
+
+/**
+ * Instances of this class manage operating system resources that
+ * define how text looks when it is displayed. Fonts may be constructed
+ * by providing a device and either name, size and style information
+ * or a <code>FontData</code> object which encapsulates this data.
+ * <p>
+ * Application code must explicitly invoke the <code>Font.dispose()</code>
+ * method to release the operating system resources managed by each instance
+ * when those instances are no longer required.
+ * </p>
+ *
+ * @see FontData
+ * @see <a href="http://www.eclipse.org/swt/snippets/#font">Font snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Examples: GraphicsExample, PaintExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public final class Font : Resource {
+
+    alias Resource.init_ init_;
+    /**
+     * the handle to the OS font resource
+     * (Warning: This field is platform dependent)
+     * <p>
+     * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+     * public API. It is marked 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 accessed from application code.
+     * </p>
+     */
+    public PangoFontDescription* handle;
+
+this(Device device) {
+    super(device);
+}
+
+/**
+ * Constructs a new font given a device and font data
+ * which describes the desired font's appearance.
+ * <p>
+ * You must dispose the font when it is no longer required.
+ * </p>
+ *
+ * @param device the device to create the font on
+ * @param fd the FontData that describes the desired font (must not be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ *    <li>ERROR_NULL_ARGUMENT - if the fd argument is null</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES - if a font could not be created from the given font data</li>
+ * </ul>
+ */
+public this(Device device, FontData fd) {
+    super(device);
+    if (fd is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    init_(fd.getName(), fd.getHeightF(), fd.getStyle(), fd.str);
+    init_();
+}
+
+/**
+ * Constructs a new font given a device and an array
+ * of font data which describes the desired font's
+ * appearance.
+ * <p>
+ * You must dispose the font when it is no longer required.
+ * </p>
+ *
+ * @param device the device to create the font on
+ * @param fds the array of FontData that describes the desired font (must not be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ *    <li>ERROR_NULL_ARGUMENT - if the fds argument is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the length of fds is zero</li>
+ *    <li>ERROR_NULL_ARGUMENT - if any fd in the array is null</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES - if a font could not be created from the given font data</li>
+ * </ul>
+ *
+ * @since 2.1
+ */
+public this(Device device, FontData[] fds) {
+    super(device);
+    if (fds is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (fds.length is 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    for (int i=0; i<fds.length; i++) {
+        if (fds[i] is null) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    FontData fd = fds[0];
+    init_(fd.getName(), fd.getHeightF(), fd.getStyle(), fd.str);
+    init_();
+}
+
+/**
+ * Constructs a new font given a device, a font name,
+ * the height of the desired font in points, and a font
+ * style.
+ * <p>
+ * You must dispose the font when it is no longer required.
+ * </p>
+ *
+ * @param device the device to create the font on
+ * @param name the name of the font (must not be null)
+ * @param height the font height in points
+ * @param style a bit or combination of NORMAL, BOLD, ITALIC
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ *    <li>ERROR_NULL_ARGUMENT - if the name argument is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the height is negative</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES - if a font could not be created from the given arguments</li>
+ * </ul>
+ */
+public this(Device device, String name, int height, int style) {
+    super(device);
+    init_(name, height, style, null);
+    init_();
+}
+
+/*public*/ this(Device device, String name, float height, int style) {
+    super(device);
+    init_(name, height, style, null);
+    init_();
+}
+
+void destroy() {
+    OS.pango_font_description_free(handle);
+    handle = null;
+}
+
+/**
+ * Compares the argument to the receiver, and returns true
+ * if they represent the <em>same</em> object using a class
+ * specific comparison.
+ *
+ * @param object the object to compare with this object
+ * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
+ *
+ * @see #hashCode
+ */
+public override int opEquals(Object object) {
+    if (object is this) return true;
+    if ( auto font = cast(Font)object ){
+       return handle is font.handle;
+    }
+    return false;
+}
+
+
+/**
+ * Returns an array of <code>FontData</code>s representing the receiver.
+ * On Windows, only one FontData will be returned per font. On X however,
+ * a <code>Font</code> object <em>may</em> be composed of multiple X
+ * fonts. To support this case, we return an array of font data objects.
+ *
+ * @return an array of font data objects describing the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public FontData[] getFontData() {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+
+    auto family = OS.pango_font_description_get_family(handle);
+    String name = fromStringz( family );
+    float height = cast(float)OS.pango_font_description_get_size(handle) / OS.PANGO_SCALE;
+    int pangoStyle = OS.pango_font_description_get_style(handle);
+    int pangoWeight = OS.pango_font_description_get_weight(handle);
+    int style = SWT.NORMAL;
+    if (pangoStyle is OS.PANGO_STYLE_ITALIC) style |= SWT.ITALIC;
+    if (pangoStyle is OS.PANGO_STYLE_OBLIQUE) style |= SWT.ROMAN;
+    if (pangoWeight >= OS.PANGO_WEIGHT_BOLD) style |= SWT.BOLD;
+    auto fontString = OS.pango_font_description_to_string (handle);
+    auto buffer = fromStringz( fontString ).dup;
+    FontData data = new FontData( buffer , height, style);
+    OS.g_free (fontString);
+    data.str = buffer;
+    return [data];
+}
+
+/**
+ * Invokes platform specific functionality to allocate a new font.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Font</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param device the device on which to allocate the color
+ * @param handle the handle for the font
+ *
+ * @private
+ */
+public static Font gtk_new(Device device, PangoFontDescription* handle) {
+    Font font = new Font(device);
+    font.handle = handle;
+    return font;
+}
+
+/**
+ * Returns an integer hash code for the receiver. Any two
+ * objects that return <code>true</code> when passed to
+ * <code>equals</code> must return the same value for this
+ * method.
+ *
+ * @return the receiver's hash
+ *
+ * @see #equals
+ */
+public override hash_t toHash() {
+    return cast(hash_t)/*64*/handle;
+}
+
+void init_(String name, float height, int style, char[] fontString) {
+    if (name is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (height < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    if (fontString !is null) {
+        handle = OS.pango_font_description_from_string (toStringz(fontString));
+        if (handle is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    } else {
+        handle = OS.pango_font_description_new();
+        if (handle is null) SWT.error(SWT.ERROR_NO_HANDLES);
+        //byte[] buffer = Converter.wcsToMbcs(null, name, true);
+        OS.pango_font_description_set_family(handle, toStringz(name) );
+        if (height > 0) {
+            OS.pango_font_description_set_size(handle, cast(int)(0.5f + height * OS.PANGO_SCALE));
+        }
+        OS.pango_font_description_set_stretch(handle, OS.PANGO_STRETCH_NORMAL);
+        int pangoStyle = OS.PANGO_STYLE_NORMAL;
+        int pangoWeight = OS.PANGO_WEIGHT_NORMAL;
+        if ((style & SWT.ITALIC) !is 0) pangoStyle = OS.PANGO_STYLE_ITALIC;
+        if ((style & SWT.ROMAN) !is 0) pangoStyle = OS.PANGO_STYLE_OBLIQUE;
+        if ((style & SWT.BOLD) !is 0) pangoWeight = OS.PANGO_WEIGHT_BOLD;
+        OS.pango_font_description_set_style(handle, pangoStyle);
+        OS.pango_font_description_set_weight(handle, pangoWeight);
+    }
+}
+
+/**
+ * Returns <code>true</code> if the font has been disposed,
+ * and <code>false</code> otherwise.
+ * <p>
+ * This method gets the dispose state for the font.
+ * When a font has been disposed, it is an error to
+ * invoke any other method using the font.
+ *
+ * @return <code>true</code> when the font is disposed and <code>false</code> otherwise
+ */
+public override bool isDisposed() {
+    return handle is null;
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the receiver
+ */
+public String toString () {
+    if (isDisposed()) return "Font {*DISPOSED*}";
+    return Format( "Font {{{}}", handle );
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/FontData.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,445 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.FontData;
+
+
+import org.eclipse.swt.SWT;
+
+import tango.text.convert.Format;
+import tango.text.Util : locate;
+import tango.util.Convert;
+import java.lang.all;
+
+/**
+ * Instances of this class describe operating system fonts.
+ * <p>
+ * For platform-independent behaviour, use the get and set methods
+ * corresponding to the following properties:
+ * <dl>
+ * <dt>height</dt><dd>the height of the font in points</dd>
+ * <dt>name</dt><dd>the face name of the font, which may include the foundry</dd>
+ * <dt>style</dt><dd>A bitwise combination of NORMAL, ITALIC and BOLD</dd>
+ * </dl>
+ * If extra, platform-dependent functionality is required:
+ * <ul>
+ * <li>On <em>Windows</em>, the data member of the <code>FontData</code>
+ * corresponds to a Windows <code>LOGFONT</code> structure whose fields
+ * may be retrieved and modified.</li>
+ * <li>On <em>X</em>, the fields of the <code>FontData</code> correspond
+ * to the entries in the font's XLFD name and may be retrieved and modified.
+ * </ul>
+ * Application code does <em>not</em> need to explicitly release the
+ * resources managed by each instance when those instances are no longer
+ * required, and thus no <code>dispose()</code> method is provided.
+ *
+ * @see Font
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public final class FontData {
+    /**
+     * the font name
+     * (Warning: This field is platform dependent)
+     * <p>
+     * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+     * public API. It is marked 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 accessed from application code.
+     * </p>
+     */
+    public String name;
+
+    /**
+     * The height of the font data in points
+     * (Warning: This field is platform dependent)
+     * <p>
+     * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+     * public API. It is marked 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 accessed from application code.
+     * </p>
+     */
+    public float height;
+
+    /**
+     * the font style
+     * (Warning: This field is platform dependent)
+     * <p>
+     * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+     * public API. It is marked 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 accessed from application code.
+     * </p>
+     */
+    public int style;
+
+    /**
+     * the Pango string
+     * (Warning: This field is platform dependent)
+     * <p>
+     * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+     * public API. It is marked 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 accessed from application code.
+     * </p>
+     */
+    public String str;
+
+    /**
+     * The locales of the font
+     */
+    String lang, country, variant;
+
+/**
+ * Constructs a new uninitialized font data.
+ */
+public this () {
+    this("", 12, SWT.NORMAL);
+}
+
+/**
+ * Constructs a new FontData given a string representation
+ * in the form generated by the <code>FontData.toString</code>
+ * method.
+ * <p>
+ * Note that the representation varies between platforms,
+ * and a FontData can only be created from a string that was
+ * generated on the same platform.
+ * </p>
+ *
+ * @param string the string representation of a <code>FontData</code> (must not be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument does not represent a valid description</li>
+ * </ul>
+ *
+ * @see #toString
+ */
+public this(String str) {
+    if (str is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    int start = 0;
+    int end = locate( str, '|' );
+    if (end is str.length ) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    String version1 = str[ start .. end ];
+    try {
+        if (to!(int)(version1) !is 1) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    } catch (ConversionException e) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+
+    start = end + 1;
+    end = locate( str, '|', start );
+    if (end is str.length ) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    String name = str[start .. end ];
+
+    start = end + 1;
+    end = locate( str, '|', start );
+    if (end is str.length ) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    float height = 0;
+    try {
+        height = to!(float)(str[start .. end]);
+    } catch (ConversionException e) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+
+    start = end + 1;
+    end = locate( str, '|', start );
+    if (end is str.length ) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    int style = 0;
+    try {
+        style = to!(int)( str[start .. end ]);
+    } catch (ConversionException e) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+
+    start = end + 1;
+    end = locate( str, '|', start );
+    setName(name);
+    setHeight(height);
+    setStyle(style);
+    if (end is str.length) return;
+    String platform = str[ start .. end ];
+
+    start = end + 1;
+    end = locate( str, '|', start );
+    if (end is str.length) return;
+    String version2 = str[ start .. end ];
+
+    if (platform.equals("GTK") && version2.equals("1")) {
+        return;
+    }
+}
+
+/**
+ * Constructs a new font data given a font name,
+ * the height of the desired font in points,
+ * and a font style.
+ *
+ * @param name the name of the font (must not be null)
+ * @param height the font height in points
+ * @param style a bit or combination of NORMAL, BOLD, ITALIC
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - when the font name is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the height is negative</li>
+ * </ul>
+ */
+public this(String name, int height, int style) {
+    setName(name);
+    setHeight(height);
+    setStyle(style);
+}
+
+/*public*/ this(String name, float height, int style) {
+    setName(name);
+    setHeight(height);
+    setStyle(style);
+}
+
+/**
+ * Compares the argument to the receiver, and returns true
+ * if they represent the <em>same</em> object using a class
+ * specific comparison.
+ *
+ * @param object the object to compare with this object
+ * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
+ *
+ * @see #hashCode
+ */
+public override int opEquals (Object object) {
+    if (object is this) return true;
+    if( auto data = cast(FontData)object ){
+        return name.equals(data.name) && height is data.height && style is data.style;
+    }
+    return false;
+}
+
+/**
+ * Returns the height of the receiver in points.
+ *
+ * @return the height of this FontData
+ *
+ * @see #setHeight(int)
+ */
+public int getHeight() {
+    return cast(int)(0.5f + height);
+}
+
+/*public*/ float getHeightF() {
+    return height;
+}
+
+/**
+ * Returns the locale of the receiver.
+ * <p>
+ * The locale determines which platform character set this
+ * font is going to use. Widgets and graphics operations that
+ * use this font will convert UNICODE strings to the platform
+ * character set of the specified locale.
+ * </p>
+ * <p>
+ * On platforms where there are multiple character sets for a
+ * given language/country locale, the variant portion of the
+ * locale will determine the character set.
+ * </p>
+ *
+ * @return the <code>String</code> representing a Locale object
+ * @since 3.0
+ */
+public String getLocale () {
+    String result;
+    const char sep = '_';
+    if (lang !is null) {
+        result ~= lang;
+        result ~= sep;
+    }
+    if (country !is null) {
+        result ~= country;
+        result ~= sep;
+    }
+    if (variant !is null) {
+        result ~= variant;
+    }
+
+    if (result) {
+        if (result[$-1] is sep) {
+            result = result[0 .. $ - 1];
+        }
+    }
+getDwtLogger().trace( __FILE__, __LINE__,  "getLocal {}", result );
+    return result;
+}
+
+/**
+ * Returns the name of the receiver.
+ * On platforms that support font foundries, the return value will
+ * be the foundry followed by a dash ("-") followed by the face name.
+ *
+ * @return the name of this <code>FontData</code>
+ *
+ * @see #setName
+ */
+public String getName() {
+    return name;
+}
+
+/**
+ * Returns the style of the receiver which is a bitwise OR of
+ * one or more of the <code>SWT</code> constants NORMAL, BOLD
+ * and ITALIC.
+ *
+ * @return the style of this <code>FontData</code>
+ *
+ * @see #setStyle
+ */
+public int getStyle() {
+    return style;
+}
+
+/**
+ * Returns an integer hash code for the receiver. Any two
+ * objects that return <code>true</code> when passed to
+ * <code>equals</code> must return the same value for this
+ * method.
+ *
+ * @return the receiver's hash
+ *
+ * @see #equals
+ */
+public override hash_t toHash () {
+    return typeid(String).getHash(&name) ^ getHeight() ^ style;
+}
+
+/**
+ * Sets the height of the receiver. The parameter is
+ * specified in terms of points, where a point is one
+ * seventy-second of an inch.
+ *
+ * @param height the height of the <code>FontData</code>
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the height is negative</li>
+ * </ul>
+ *
+ * @see #getHeight
+ */
+public void setHeight(int height) {
+    if (height < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    this.height = height;
+    this.str = null;
+}
+
+/*public*/ void setHeight(float height) {
+    if (height < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    this.height = height;
+    this.str = null;
+}
+
+/**
+ * Sets the locale of the receiver.
+ * <p>
+ * The locale determines which platform character set this
+ * font is going to use. Widgets and graphics operations that
+ * use this font will convert UNICODE strings to the platform
+ * character set of the specified locale.
+ * </p>
+ * <p>
+ * On platforms where there are multiple character sets for a
+ * given language/country locale, the variant portion of the
+ * locale will determine the character set.
+ * </p>
+ *
+ * @param locale the <code>String</code> representing a Locale object
+ * @see java.util.Locale#toString
+ */
+public void setLocale(String locale) {
+getDwtLogger().trace( __FILE__, __LINE__,  "setLocal {}", locale );
+    lang = country = variant = null;
+    if (locale !is null) {
+        char sep = '_';
+        int length = locale.length;
+        int firstSep, secondSep;
+
+        firstSep = locate( locale, sep );
+        if (firstSep is locale.length) {
+            firstSep = secondSep = length;
+        } else {
+            secondSep = locate( locale, sep, firstSep + 1);
+            if (secondSep is locale.length) secondSep = length;
+        }
+        if (firstSep > 0) lang = locale[0 .. firstSep];
+        if (secondSep > firstSep + 1) country = locale[firstSep + 1 .. secondSep ];
+        if (length > secondSep + 1) variant = locale[secondSep + 1 .. $ ];
+    }
+}
+
+/**
+ * Sets the name of the receiver.
+ * <p>
+ * Some platforms support font foundries. On these platforms, the name
+ * of the font specified in setName() may have one of the following forms:
+ * <ol>
+ * <li>a face name (for example, "courier")</li>
+ * <li>a foundry followed by a dash ("-") followed by a face name (for example, "adobe-courier")</li>
+ * </ol>
+ * In either case, the name returned from getName() will include the
+ * foundry.
+ * </p>
+ * <p>
+ * On platforms that do not support font foundries, only the face name
+ * (for example, "courier") is used in <code>setName()</code> and
+ * <code>getName()</code>.
+ * </p>
+ *
+ * @param name the name of the font data (must not be null)
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - when the font name is null</li>
+ * </ul>
+ *
+ * @see #getName
+ */
+public void setName(String name) {
+    if (name is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    this.name = name;
+    this.str = null;
+}
+
+/**
+ * Sets the style of the receiver to the argument which must
+ * be a bitwise OR of one or more of the <code>SWT</code>
+ * constants NORMAL, BOLD and ITALIC.  All other style bits are
+ * ignored.
+ *
+ * @param style the new style for this <code>FontData</code>
+ *
+ * @see #getStyle
+ */
+public void setStyle(int style) {
+    this.style = style;
+    this.str = null;
+}
+
+/**
+ * Returns a string representation of the receiver which is suitable
+ * for constructing an equivalent instance using the
+ * <code>FontData(String)</code> constructor.
+ *
+ * @return a string representation of the FontData
+ *
+ * @see FontData
+ */
+public override String toString() {
+    return Format( "1|{}|{}|{}|GTK|1|", getName, getHeightF, getStyle );
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/FontMetrics.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,138 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.FontMetrics;
+
+import java.lang.all;
+
+
+/**
+ * Instances of this class provide measurement information
+ * about fonts including ascent, descent, height, leading
+ * space between rows, and average character width.
+ * <code>FontMetrics</code> are obtained from <code>GC</code>s
+ * using the <code>getFontMetrics()</code> method.
+ *
+ * @see GC#getFontMetrics
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public final class FontMetrics {
+    int ascent, descent, averageCharWidth, leading, height;
+
+package this() {
+}
+
+/**
+ * Compares the argument to the receiver, and returns true
+ * if they represent the <em>same</em> object using a class
+ * specific comparison.
+ *
+ * @param object the object to compare with this object
+ * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
+ *
+ * @see #hashCode
+ */
+public override int opEquals (Object object) {
+    if (object is this) return true;
+    if( auto metrics = cast(FontMetrics)object ){
+        return ascent is metrics.ascent && descent is metrics.descent &&
+            averageCharWidth is metrics.averageCharWidth && leading is metrics.leading &&
+            height is metrics.height;
+    }
+    return false;
+}
+
+/**
+ * Returns the ascent of the font described by the receiver. A
+ * font's <em>ascent</em> is the distance from the baseline to the
+ * top of actual characters, not including any of the leading area,
+ * measured in pixels.
+ *
+ * @return the ascent of the font
+ */
+public int getAscent() {
+    return ascent;
+}
+
+/**
+ * Returns the average character width, measured in pixels,
+ * of the font described by the receiver.
+ *
+ * @return the average character width of the font
+ */
+public int getAverageCharWidth() {
+    return averageCharWidth;
+}
+
+/**
+ * Returns the descent of the font described by the receiver. A
+ * font's <em>descent</em> is the distance from the baseline to the
+ * bottom of actual characters, not including any of the leading area,
+ * measured in pixels.
+ *
+ * @return the descent of the font
+ */
+public int getDescent() {
+    return descent;
+}
+
+/**
+ * Returns the height of the font described by the receiver,
+ * measured in pixels. A font's <em>height</em> is the sum of
+ * its ascent, descent and leading area.
+ *
+ * @return the height of the font
+ *
+ * @see #getAscent
+ * @see #getDescent
+ * @see #getLeading
+ */
+public int getHeight() {
+    return height;
+}
+
+/**
+ * Returns the leading area of the font described by the
+ * receiver. A font's <em>leading area</em> is the space
+ * above its ascent which may include accents or other marks.
+ *
+ * @return the leading space of the font
+ */
+public int getLeading() {
+    return leading;
+}
+
+public static FontMetrics gtk_new(int ascent, int descent, int averageCharWidth, int leading, int height) {
+    FontMetrics fontMetrics = new FontMetrics();
+    fontMetrics.ascent = ascent;
+    fontMetrics.descent = descent;
+    fontMetrics.averageCharWidth = averageCharWidth;
+    fontMetrics.leading = leading;
+    fontMetrics.height = height;
+    return fontMetrics;
+}
+
+/**
+ * Returns an integer hash code for the receiver. Any two
+ * objects that return <code>true</code> when passed to
+ * <code>equals</code> must return the same value for this
+ * method.
+ *
+ * @return the receiver's hash
+ *
+ * @see #equals
+ */
+public override hash_t toHash() {
+    return ascent ^ descent ^ averageCharWidth ^ leading ^ height;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/GC.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,4021 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.GC;
+
+import org.eclipse.swt.graphics.Image;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Drawable;
+import org.eclipse.swt.graphics.Resource;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontMetrics;
+import org.eclipse.swt.graphics.GCData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.Path;
+import org.eclipse.swt.graphics.Pattern;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.Region;
+import org.eclipse.swt.graphics.Resource;
+import org.eclipse.swt.graphics.Transform;
+import org.eclipse.swt.graphics.LineAttributes;
+
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.internal.cairo.Cairo;
+import org.eclipse.swt.internal.Converter;
+import org.eclipse.swt.internal.Compatibility;
+import java.lang.all;
+
+import tango.text.convert.Format;
+import tango.stdc.string;
+
+
+/**
+ * Class <code>GC</code> is where all of the drawing capabilities that are
+ * supported by SWT are located. Instances are used to draw on either an
+ * <code>Image</code>, a <code>Control</code>, or directly on a <code>Display</code>.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>LEFT_TO_RIGHT, RIGHT_TO_LEFT</dd>
+ * </dl>
+ *
+ * <p>
+ * The SWT drawing coordinate system is the two-dimensional space with the origin
+ * (0,0) at the top left corner of the drawing area and with (x,y) values increasing
+ * to the right and downward respectively.
+ * </p>
+ *
+ * <p>
+ * Application code must explicitly invoke the <code>GC.dispose()</code>
+ * method to release the operating system resources managed by each instance
+ * when those instances are no longer required. This is <em>particularly</em>
+ * important on Windows95 and Windows98 where the operating system has a limited
+ * number of device contexts available.
+ * </p>
+ *
+ * <p>
+ * Note: Only one of LEFT_TO_RIGHT and RIGHT_TO_LEFT may be specified.
+ * </p>
+ *
+ * @see org.eclipse.swt.events.PaintEvent
+ * @see <a href="http://www.eclipse.org/swt/snippets/#gc">GC snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Examples: GraphicsExample, PaintExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public final class GC : Resource {
+
+    alias Resource.init_ init_;
+
+    /**
+     * the handle to the OS device context
+     * (Warning: This field is platform dependent)
+     * <p>
+     * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+     * public API. It is marked 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 accessed from application code.
+     * </p>
+     */
+    public GdkGC* handle;
+
+    Drawable drawable;
+    GCData data;
+
+    const static int FOREGROUND = 1 << 0;
+    const static int BACKGROUND = 1 << 1;
+    const static int FONT = 1 << 2;
+    const static int LINE_STYLE = 1 << 3;
+    const static int LINE_CAP = 1 << 4;
+    const static int LINE_JOIN = 1 << 5;
+    const static int LINE_WIDTH = 1 << 6;
+    const static int LINE_MITERLIMIT = 1 << 7;
+    const static int BACKGROUND_BG = 1 << 8;
+    const static int DRAW_OFFSET = 1 << 9;
+    const static int DRAW = FOREGROUND | LINE_WIDTH | LINE_STYLE  | LINE_CAP  | LINE_JOIN | LINE_MITERLIMIT | DRAW_OFFSET;
+    const static int FILL = BACKGROUND;
+
+    static const float[] LINE_DOT = [1, 1];
+    static const float[] LINE_DASH = [3, 1];
+    static const float[] LINE_DASHDOT = [3, 1, 1, 1];
+    static const float[] LINE_DASHDOTDOT = [3, 1, 1, 1, 1, 1];
+    static const float[] LINE_DOT_ZERO = [3, 3];
+    static const float[] LINE_DASH_ZERO = [18, 6];
+    static const float[] LINE_DASHDOT_ZERO = [9, 6, 3, 6];
+    static const float[] LINE_DASHDOTDOT_ZERO = [9, 3, 3, 3, 3, 3];
+
+this() {
+}
+
+/**
+ * Constructs a new instance of this class which has been
+ * configured to draw on the specified drawable. Sets the
+ * foreground color, background color and font in the GC
+ * to match those in the drawable.
+ * <p>
+ * You must dispose the graphics context when it is no longer required.
+ * </p>
+ * @param drawable the drawable to draw on
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the drawable is null</li>
+ *    <li>ERROR_NULL_ARGUMENT - if there is no current device</li>
+ *    <li>ERROR_INVALID_ARGUMENT
+ *          - if the drawable is an image that is not a bitmap or an icon
+ *          - if the drawable is an image or printer that is already selected
+ *            into another graphics context</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES if a handle could not be obtained for GC creation</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS if not called from the thread that created the drawable</li>
+ * </ul>
+ */
+public this(Drawable drawable) {
+    this(drawable, 0);
+}
+
+/**
+ * Constructs a new instance of this class which has been
+ * configured to draw on the specified drawable. Sets the
+ * foreground color, background color and font in the GC
+ * to match those in the drawable.
+ * <p>
+ * You must dispose the graphics context when it is no longer required.
+ * </p>
+ *
+ * @param drawable the drawable to draw on
+ * @param style the style of GC to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the drawable is null</li>
+ *    <li>ERROR_NULL_ARGUMENT - if there is no current device</li>
+ *    <li>ERROR_INVALID_ARGUMENT
+ *          - if the drawable is an image that is not a bitmap or an icon
+ *          - if the drawable is an image or printer that is already selected
+ *            into another graphics context</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES if a handle could not be obtained for GC creation</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS if not called from the thread that created the drawable</li>
+ * </ul>
+ *
+ * @since 2.1.2
+ */
+public this(Drawable drawable, int style) {
+    if (drawable is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    GCData data = new GCData();
+    data.style = checkStyle(style);
+    auto gdkGC = drawable.internal_new_GC(data);
+    Device device = data.device;
+    if (device is null) device = Device.getDevice();
+    if (device is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    this.device = data.device = device;
+    init_(drawable, data, gdkGC);
+    init_();
+}
+
+static void addCairoString(cairo_t* cairo, String str, float x, float y, Font font) {
+    char* buffer = toStringz( str );
+    if (OS.GTK_VERSION >= OS.buildVERSION(2, 8, 0)) {
+        auto layout = OS.pango_cairo_create_layout(cairo);
+        if (layout is null) SWT.error(SWT.ERROR_NO_HANDLES);
+        OS.pango_layout_set_text(layout, buffer, -1);
+        OS.pango_layout_set_font_description(layout, font.handle);
+        double currentX, currentY;
+        Cairo.cairo_get_current_point(cairo, &currentX, &currentY);
+        if (currentX !is x || currentY !is y) {
+            Cairo.cairo_move_to(cairo, x, y);
+        }
+        OS.pango_cairo_layout_path(cairo, layout);
+        OS.g_object_unref(layout);
+    } else {
+        GC.setCairoFont(cairo, font);
+        cairo_font_extents_t* extents = new cairo_font_extents_t();
+        Cairo.cairo_font_extents(cairo, extents);
+        double baseline = y + extents.ascent;
+        Cairo.cairo_move_to(cairo, x, baseline);
+        Cairo.cairo_text_path(cairo, buffer);
+    }
+}
+
+static int checkStyle (int style) {
+    if ((style & SWT.LEFT_TO_RIGHT) !is 0) style &= ~SWT.RIGHT_TO_LEFT;
+    return style & (SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT);
+}
+
+public static GC gtk_new(GdkGC* handle, GCData data) {
+    GC gc = new GC();
+    gc.device = data.device;
+    gc.init_(null, data, handle);
+    return gc;
+}
+
+public static GC gtk_new(Drawable drawable, GCData data) {
+    GC gc = new GC();
+    auto gdkGC = drawable.internal_new_GC(data);
+    gc.device = data.device;
+    gc.init_(drawable, data, gdkGC);
+    return gc;
+}
+
+void checkGC (int mask) {
+    int state = data.state;
+    if ((state & mask) is mask) return;
+    state = (state ^ mask) & mask;
+    data.state |= mask;
+    auto cairo = data.cairo;
+    if (cairo !is null) {
+        if ((state & (BACKGROUND | FOREGROUND)) !is 0) {
+            GdkColor* color;
+            Pattern pattern;
+            if ((state & FOREGROUND) !is 0) {
+                color = data.foreground;
+                pattern = data.foregroundPattern;
+                data.state &= ~BACKGROUND;
+            } else {
+                color = data.background;
+                pattern = data.backgroundPattern;
+                data.state &= ~FOREGROUND;
+            }
+            if  (pattern !is null) {
+                if ((data.style & SWT.MIRRORED) !is 0 && pattern.surface !is null) {
+                    auto newPattern = Cairo.cairo_pattern_create_for_surface(pattern.surface);
+                    if (newPattern is null) SWT.error(SWT.ERROR_NO_HANDLES);
+                    Cairo.cairo_pattern_set_extend(newPattern, Cairo.CAIRO_EXTEND_REPEAT);
+                    double[6] matrix; matrix[0] = -1; matrix[1] = 0; matrix[2] = 0; matrix[3] = 1; matrix[4] = 0; matrix[5] = 0;
+                    Cairo.cairo_pattern_set_matrix(newPattern, cast(cairo_matrix_t*) matrix.ptr);
+                    Cairo.cairo_set_source(cairo, newPattern);
+                    Cairo.cairo_pattern_destroy(newPattern);
+                } else {
+                    Cairo.cairo_set_source(cairo, pattern.handle);
+                }
+            } else {
+                Cairo.cairo_set_source_rgba(cairo, (color.red & 0xFFFF) / cast(float)0xFFFF, (color.green & 0xFFFF) / cast(float)0xFFFF, (color.blue & 0xFFFF) / cast(float)0xFFFF, data.alpha / cast(float)0xFF);
+            }
+        }
+        if ((state & FONT) !is 0) {
+            if (data.layout !is null) {
+                Font font = data.font;
+                OS.pango_layout_set_font_description(data.layout, font.handle);
+            }
+            if (OS.GTK_VERSION < OS.buildVERSION(2, 8, 0)) {
+                setCairoFont(cairo, data.font);
+            }
+        }
+        if ((state & LINE_CAP) !is 0) {
+            int cap_style = 0;
+            switch (data.lineCap) {
+                case SWT.CAP_ROUND: cap_style = Cairo.CAIRO_LINE_CAP_ROUND; break;
+                case SWT.CAP_FLAT: cap_style = Cairo.CAIRO_LINE_CAP_BUTT; break;
+                case SWT.CAP_SQUARE: cap_style = Cairo.CAIRO_LINE_CAP_SQUARE; break;
+                default:
+            }
+            Cairo.cairo_set_line_cap(cairo, cap_style);
+        }
+        if ((state & LINE_JOIN) !is 0) {
+            int join_style = 0;
+            switch (data.lineJoin) {
+                case SWT.JOIN_MITER: join_style = Cairo.CAIRO_LINE_JOIN_MITER; break;
+                case SWT.JOIN_ROUND:  join_style = Cairo.CAIRO_LINE_JOIN_ROUND; break;
+                case SWT.JOIN_BEVEL: join_style = Cairo.CAIRO_LINE_JOIN_BEVEL; break;
+                default:
+            }
+            Cairo.cairo_set_line_join(cairo, join_style);
+        }
+        if ((state & LINE_WIDTH) !is 0) {
+            Cairo.cairo_set_line_width(cairo, data.lineWidth is 0 ? 1 : data.lineWidth);
+            switch (data.lineStyle) {
+                case SWT.LINE_DOT:
+                case SWT.LINE_DASH:
+                case SWT.LINE_DASHDOT:
+                case SWT.LINE_DASHDOTDOT:
+                    state |= LINE_STYLE;
+                default:
+            }
+        }
+        if ((state & LINE_STYLE) !is 0) {
+            float dashesOffset = 0;
+            float[] dashes = null;
+            float width = data.lineWidth;
+            switch (data.lineStyle) {
+                case SWT.LINE_SOLID: break;
+                case SWT.LINE_DASH: dashes = width !is 0 ? LINE_DASH : LINE_DASH_ZERO; break;
+                case SWT.LINE_DOT: dashes = width !is 0 ? LINE_DOT : LINE_DOT_ZERO; break;
+                case SWT.LINE_DASHDOT: dashes = width !is 0 ? LINE_DASHDOT : LINE_DASHDOT_ZERO; break;
+                case SWT.LINE_DASHDOTDOT: dashes = width !is 0 ? LINE_DASHDOTDOT : LINE_DASHDOTDOT_ZERO; break;
+                case SWT.LINE_CUSTOM: dashes = data.lineDashes; break;
+                default:
+            }
+            if (dashes !is null) {
+                dashesOffset = data.lineDashesOffset;
+                double[] cairoDashes = new double[dashes.length];
+                for (int i = 0; i < cairoDashes.length; i++) {
+                    cairoDashes[i] = width is 0 || data.lineStyle is SWT.LINE_CUSTOM ? dashes[i] : dashes[i] * width;
+                }
+                Cairo.cairo_set_dash(cairo, cairoDashes.ptr, cairoDashes.length, dashesOffset);
+            } else {
+                Cairo.cairo_set_dash(cairo, null, 0, 0);
+            }
+        }
+        if ((state & LINE_MITERLIMIT) !is 0) {
+            Cairo.cairo_set_miter_limit(cairo, data.lineMiterLimit);
+        }
+        if ((state & DRAW_OFFSET) !is 0) {
+            data.cairoXoffset = data.cairoYoffset = 0;
+            double[] matrix = new double[6];
+            Cairo.cairo_get_matrix(cairo,cast(cairo_matrix_t*) matrix.ptr);
+            double dx = 1;
+            double dy = 1;
+            Cairo.cairo_user_to_device_distance(cairo, &dx, &dy);
+            double scaling = dx;
+            if (scaling < 0) scaling = -scaling;
+            double strokeWidth = data.lineWidth * scaling;
+            if (strokeWidth is 0 || (cast(int)strokeWidth % 2) is 1) {
+                data.cairoXoffset = 0.5 / scaling;
+            }
+            scaling = dy;
+            if (scaling < 0) scaling = -scaling;
+            strokeWidth = data.lineWidth * scaling;
+            if (strokeWidth is 0 || (cast(int)strokeWidth % 2) is 1) {
+                data.cairoYoffset = 0.5 / scaling;
+            }
+        }
+        return;
+    }
+    if ((state & (BACKGROUND | FOREGROUND)) !is 0) {
+        GdkColor* foreground;
+        if ((state & FOREGROUND) !is 0) {
+            foreground = data.foreground;
+            data.state &= ~BACKGROUND;
+        } else {
+            foreground = data.background;
+            data.state &= ~FOREGROUND;
+        }
+        OS.gdk_gc_set_foreground(handle, foreground);
+    }
+    if ((state & BACKGROUND_BG) !is 0) {
+        GdkColor* background = data.background;
+        OS.gdk_gc_set_background(handle, background);
+    }
+    if ((state & FONT) !is 0) {
+        if (data.layout !is null) {
+            Font font = data.font;
+            OS.pango_layout_set_font_description(data.layout, font.handle);
+        }
+    }
+    if ((state & (LINE_CAP | LINE_JOIN | LINE_STYLE | LINE_WIDTH)) !is 0) {
+        int cap_style = 0;
+        int join_style = 0;
+        int width = cast(int)data.lineWidth;
+        int line_style = 0;
+        float[] dashes = null;
+        switch (data.lineCap) {
+            case SWT.CAP_ROUND: cap_style = OS.GDK_CAP_ROUND; break;
+            case SWT.CAP_FLAT: cap_style = OS.GDK_CAP_BUTT; break;
+            case SWT.CAP_SQUARE: cap_style = OS.GDK_CAP_PROJECTING; break;
+                default:
+        }
+        switch (data.lineJoin) {
+            case SWT.JOIN_ROUND: join_style = OS.GDK_JOIN_ROUND; break;
+            case SWT.JOIN_MITER: join_style = OS.GDK_JOIN_MITER; break;
+            case SWT.JOIN_BEVEL: join_style = OS.GDK_JOIN_BEVEL; break;
+                default:
+        }
+        switch (data.lineStyle) {
+            case SWT.LINE_SOLID: break;
+            case SWT.LINE_DASH: dashes = width !is 0 ? LINE_DASH : LINE_DASH_ZERO; break;
+            case SWT.LINE_DOT: dashes = width !is 0 ? LINE_DOT : LINE_DOT_ZERO; break;
+            case SWT.LINE_DASHDOT: dashes = width !is 0 ? LINE_DASHDOT : LINE_DASHDOT_ZERO; break;
+            case SWT.LINE_DASHDOTDOT: dashes = width !is 0 ? LINE_DASHDOTDOT : LINE_DASHDOTDOT_ZERO; break;
+            case SWT.LINE_CUSTOM: dashes = data.lineDashes; break;
+                default:
+        }
+        if (dashes !is null) {
+            if ((state & LINE_STYLE) !is 0) {
+                String dash_list = new char[dashes.length];
+                for (int i = 0; i < dash_list.length; i++) {
+                    dash_list[i] = cast(char)(width is 0 || data.lineStyle is SWT.LINE_CUSTOM ? dashes[i] : dashes[i] * width);
+                }
+                OS.gdk_gc_set_dashes(handle, 0, dash_list.ptr, dash_list.length);
+            }
+            line_style = OS.GDK_LINE_ON_OFF_DASH;
+        } else {
+            line_style = OS.GDK_LINE_SOLID;
+        }
+        OS.gdk_gc_set_line_attributes(handle, width, line_style, cap_style, join_style);
+    }
+}
+
+GdkRegion* convertRgn(GdkRegion* rgn, double[] matrix) {
+    auto newRgn = OS.gdk_region_new();
+    int nRects;
+    GdkRectangle* rects;
+    OS.gdk_region_get_rectangles(rgn, &rects, &nRects);
+    GdkRectangle* rect;
+    int[8] pointArray;
+    double x, y;
+    for (int i=0; i<nRects; i++) {
+        rect = rects +i;
+        x = rect.x;
+        y = rect.y;
+        Cairo.cairo_matrix_transform_point(cast(cairo_matrix_t*)matrix.ptr, &x, &y);
+        pointArray[0] = cast(int)x;
+        pointArray[1] = cast(int)y;
+        x = rect.x + rect.width;
+        y = rect.y;
+        Cairo.cairo_matrix_transform_point(cast(cairo_matrix_t*)matrix.ptr, &x, &y);
+        pointArray[2] = cast(int)Math.round(x);
+        pointArray[3] = cast(int)y;
+        x = rect.x + rect.width;
+        y = rect.y + rect.height;
+        Cairo.cairo_matrix_transform_point(cast(cairo_matrix_t*)matrix.ptr, &x, &y);
+        pointArray[4] = cast(int)Math.round(x);
+        pointArray[5] = cast(int)Math.round(y);
+        x = rect.x;
+        y = rect.y + rect.height;
+        Cairo.cairo_matrix_transform_point(cast(cairo_matrix_t*)matrix.ptr, &x, &y);
+        pointArray[6] = cast(int)x;
+        pointArray[7] = cast(int)Math.round(y);
+        auto polyRgn = OS.gdk_region_polygon(cast(GdkPoint*)pointArray.ptr, pointArray.length / 2, OS.GDK_EVEN_ODD_RULE);
+        OS.gdk_region_union(newRgn, polyRgn);
+        OS.gdk_region_destroy(polyRgn);
+    }
+    if (rects !is null) OS.g_free(rects);
+    return newRgn;
+}
+
+/**
+ * Copies a rectangular area of the receiver at the specified
+ * position into the image, which must be of type <code>SWT.BITMAP</code>.
+ *
+ * @param image the image to copy into
+ * @param x the x coordinate in the receiver of the area to be copied
+ * @param y the y coordinate in the receiver of the area to be copied
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the image is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the image is not a bitmap or has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void copyArea(Image image, int x, int y) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (image is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (image.type !is SWT.BITMAP || image.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    Rectangle rect = image.getBounds();
+    auto gdkGC = OS.gdk_gc_new(image.pixmap);
+    if (gdkGC is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    OS.gdk_gc_set_subwindow(gdkGC, OS.GDK_INCLUDE_INFERIORS);
+    OS.gdk_draw_drawable(image.pixmap, gdkGC, data.drawable, x, y, 0, 0, rect.width, rect.height);
+    OS.g_object_unref(gdkGC);
+}
+
+/**
+ * Copies a rectangular area of the receiver at the source
+ * position onto the receiver at the destination position.
+ *
+ * @param srcX the x coordinate in the receiver of the area to be copied
+ * @param srcY the y coordinate in the receiver of the area to be copied
+ * @param width the width of the area to copy
+ * @param height the height of the area to copy
+ * @param destX the x coordinate in the receiver of the area to copy to
+ * @param destY the y coordinate in the receiver of the area to copy to
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void copyArea(int srcX, int srcY, int width, int height, int destX, int destY) {
+    copyArea(srcX, srcY, width, height, destX, destY, true);
+}
+/**
+ * Copies a rectangular area of the receiver at the source
+ * position onto the receiver at the destination position.
+ *
+ * @param srcX the x coordinate in the receiver of the area to be copied
+ * @param srcY the y coordinate in the receiver of the area to be copied
+ * @param width the width of the area to copy
+ * @param height the height of the area to copy
+ * @param destX the x coordinate in the receiver of the area to copy to
+ * @param destY the y coordinate in the receiver of the area to copy to
+ * @param paint if <code>true</code> paint events will be generated for old and obscured areas
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void copyArea(int srcX, int srcY, int width, int height, int destX, int destY, bool paint) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (width <= 0 || height <= 0) return;
+    int deltaX = destX - srcX, deltaY = destY - srcY;
+    if (deltaX is 0 && deltaY is 0) return;
+    auto drawable = data.drawable;
+    if (data.image is null && paint) OS.gdk_gc_set_exposures(handle, true);
+    OS.gdk_draw_drawable(drawable, handle, drawable, srcX, srcY, destX, destY, width, height);
+    if (data.image is null & paint) {
+        OS.gdk_gc_set_exposures(handle, false);
+        bool disjoint = (destX + width < srcX) || (srcX + width < destX) || (destY + height < srcY) || (srcY + height < destY);
+        GdkRectangle rect;
+        if (disjoint) {
+            rect.x = srcX;
+            rect.y = srcY;
+            rect.width = width;
+            rect.height = height;
+            OS.gdk_window_invalidate_rect (cast(GdkWindow*)drawable, &rect, false);
+//          OS.gdk_window_clear_area_e(drawable, srcX, srcY, width, height);
+        } else {
+            if (deltaX !is 0) {
+                int newX = destX - deltaX;
+                if (deltaX < 0) newX = destX + width;
+                rect.x = newX;
+                rect.y = srcY;
+                rect.width = Math.abs(deltaX);
+                rect.height = height;
+                OS.gdk_window_invalidate_rect (cast(GdkWindow*)drawable, &rect, false);
+//              OS.gdk_window_clear_area_e(drawable, newX, srcY, Math.abs(deltaX), height);
+            }
+            if (deltaY !is 0) {
+                int newY = destY - deltaY;
+                if (deltaY < 0) newY = destY + height;
+                rect.x = srcX;
+                rect.y = newY;
+                rect.width = width;
+                rect.height = Math.abs(deltaY);
+                OS.gdk_window_invalidate_rect (cast(GdkWindow*)drawable, &rect, false);
+//              OS.gdk_window_clear_area_e(drawable, srcX, newY, width, Math.abs(deltaY));
+            }
+        }
+    }
+}
+
+void createLayout() {
+    auto context = OS.gdk_pango_context_get();
+    if (context is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    data.context = context;
+    auto layout = OS.pango_layout_new(context);
+    if (layout is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    data.layout = layout;
+    OS.pango_context_set_language(context, OS.gtk_get_default_language());
+    OS.pango_context_set_base_dir(context, (data.style & SWT.MIRRORED) !is 0 ? OS.PANGO_DIRECTION_RTL : OS.PANGO_DIRECTION_LTR);
+    OS.gdk_pango_context_set_colormap(context, OS.gdk_colormap_get_system());
+    if (OS.GTK_VERSION >= OS.buildVERSION(2, 4, 0)) {
+        OS.pango_layout_set_auto_dir(layout, false);
+    }
+}
+
+void disposeLayout() {
+    data.str = null;
+    if (data.context !is null) OS.g_object_unref(data.context);
+    if (data.layout !is null) OS.g_object_unref(data.layout);
+    data.layout = null;
+    data.context = null;
+}
+
+void destroy() {
+    if (data.disposeCairo) {
+        auto cairo = data.cairo;
+        if (cairo !is null) Cairo.cairo_destroy(cairo);
+        data.cairo = null;
+    }
+
+    /* Free resources */
+    auto clipRgn = data.clipRgn;
+    if (clipRgn !is null) OS.gdk_region_destroy(clipRgn);
+    Image image = data.image;
+    if (image !is null) {
+        image.memGC = null;
+        if (image.transparentPixel !is -1) image.createMask();
+    }
+
+    disposeLayout();
+
+    /* Dispose the GC */
+    if (drawable !is null) {
+        drawable.internal_dispose_GC(handle, data);
+    }
+    data.drawable = null;
+    data.clipRgn = null;
+    drawable = null;
+    handle = null;
+    data.image = null;
+    data.str = null;
+    data = null;
+}
+
+/**
+ * Draws the outline of a circular or elliptical arc
+ * within the specified rectangular area.
+ * <p>
+ * The resulting arc begins at <code>startAngle</code> and extends
+ * for <code>arcAngle</code> degrees, using the current color.
+ * Angles are interpreted such that 0 degrees is at the 3 o'clock
+ * position. A positive value indicates a counter-clockwise rotation
+ * while a negative value indicates a clockwise rotation.
+ * </p><p>
+ * The center of the arc is the center of the rectangle whose origin
+ * is (<code>x</code>, <code>y</code>) and whose size is specified by the
+ * <code>width</code> and <code>height</code> arguments.
+ * </p><p>
+ * The resulting arc covers an area <code>width + 1</code> pixels wide
+ * by <code>height + 1</code> pixels tall.
+ * </p>
+ *
+ * @param x the x coordinate of the upper-left corner of the arc to be drawn
+ * @param y the y coordinate of the upper-left corner of the arc to be drawn
+ * @param width the width of the arc to be drawn
+ * @param height the height of the arc to be drawn
+ * @param startAngle the beginning angle
+ * @param arcAngle the angular extent of the arc, relative to the start angle
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    checkGC(DRAW);
+    if (width < 0) {
+        x = x + width;
+        width = -width;
+    }
+    if (height < 0) {
+        y = y + height;
+        height = -height;
+    }
+    if (width is 0 || height is 0 || arcAngle is 0) return;
+    auto cairo = data.cairo;
+    if (cairo !is null) {
+        double xOffset = data.cairoXoffset, yOffset = data.cairoYoffset;
+        if (width is height) {
+            if (arcAngle >= 0) {
+                Cairo.cairo_arc_negative(cairo, x + xOffset + width / 2f, y + yOffset + height / 2f, width / 2f, -startAngle * cast(float)Compatibility.PI / 180, -(startAngle + arcAngle) * cast(float)Compatibility.PI / 180);
+            } else {
+                Cairo.cairo_arc(cairo, x + xOffset + width / 2f, y + yOffset + height / 2f, width / 2f, -startAngle * cast(float)Compatibility.PI / 180, -(startAngle + arcAngle) * cast(float)Compatibility.PI / 180);
+            }
+        } else {
+            Cairo.cairo_save(cairo);
+            Cairo.cairo_translate(cairo, x + xOffset + width / 2f, y + yOffset + height / 2f);
+            Cairo.cairo_scale(cairo, width / 2f, height / 2f);
+            if (arcAngle >= 0) {
+                Cairo.cairo_arc_negative(cairo, 0, 0, 1, -startAngle * cast(float)Compatibility.PI / 180, -(startAngle + arcAngle) * cast(float)Compatibility.PI / 180);
+            } else {
+                Cairo.cairo_arc(cairo, 0, 0, 1, -startAngle * cast(float)Compatibility.PI / 180, -(startAngle + arcAngle) * cast(float)Compatibility.PI / 180);
+            }
+            Cairo.cairo_restore(cairo);
+        }
+        Cairo.cairo_stroke(cairo);
+        return;
+    }
+    OS.gdk_draw_arc(data.drawable, handle, 0, x, y, width, height, startAngle * 64, arcAngle * 64);
+}
+
+/**
+ * Draws a rectangle, based on the specified arguments, which has
+ * the appearance of the platform's <em>focus rectangle</em> if the
+ * platform supports such a notion, and otherwise draws a simple
+ * rectangle in the receiver's foreground color.
+ *
+ * @param x the x coordinate of the rectangle
+ * @param y the y coordinate of the rectangle
+ * @param width the width of the rectangle
+ * @param height the height of the rectangle
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #drawRectangle(int, int, int, int)
+ */
+public void drawFocus(int x, int y, int width, int height) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    /*
+    * Feature in GTK.  The function gtk_widget_get_default_style()
+    * can't be used here because gtk_paint_focus() uses GCs, which
+    * are not valid in the default style. The fix is to use a style
+    * from a widget.
+    */
+    auto style = OS.gtk_widget_get_style(data.device.shellHandle);
+    auto cairo = data.cairo;
+    if (cairo !is null) {
+        checkGC(FOREGROUND);
+        int lineWidth;
+        OS.gtk_widget_style_get1(data.device.shellHandle, OS.focus_line_width.ptr, &lineWidth );
+        Cairo.cairo_save(cairo);
+        Cairo.cairo_set_line_width(cairo, lineWidth);
+        double[] dashes = [1, 1];
+        double dash_offset = -lineWidth / 2f;
+        while (dash_offset < 0) dash_offset += 2;
+        Cairo.cairo_set_dash(cairo, dashes.ptr, dashes.length, dash_offset);
+        Cairo.cairo_rectangle(cairo, x + lineWidth / 2f, y + lineWidth / 2f, width, height);
+        Cairo.cairo_stroke(cairo);
+        Cairo.cairo_restore(cairo);
+        return;
+    }
+    char dummy;
+    OS.gtk_paint_focus(style,cast(GdkWindow *) data.drawable, OS.GTK_STATE_NORMAL, null, data.device.shellHandle, &dummy, x, y, width, height);
+}
+
+/**
+ * Draws the given image in the receiver at the specified
+ * coordinates.
+ *
+ * @param image the image to draw
+ * @param x the x coordinate of where to draw
+ * @param y the y coordinate of where to draw
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the image is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the given coordinates are outside the bounds of the image</li>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES - if no handles are available to perform the operation</li>
+ * </ul>
+ */
+public void drawImage(Image image, int x, int y) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (image is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (image.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    drawImage(image, 0, 0, -1, -1, x, y, -1, -1, true);
+}
+
+/**
+ * Copies a rectangular area from the source image into a (potentially
+ * different sized) rectangular area in the receiver. If the source
+ * and destination areas are of differing sizes, then the source
+ * area will be stretched or shrunk to fit the destination area
+ * as it is copied. The copy fails if any part of the source rectangle
+ * lies outside the bounds of the source image, or if any of the width
+ * or height arguments are negative.
+ *
+ * @param image the source image
+ * @param srcX the x coordinate in the source image to copy from
+ * @param srcY the y coordinate in the source image to copy from
+ * @param srcWidth the width in pixels to copy from the source
+ * @param srcHeight the height in pixels to copy from the source
+ * @param destX the x coordinate in the destination to copy to
+ * @param destY the y coordinate in the destination to copy to
+ * @param destWidth the width in pixels of the destination rectangle
+ * @param destHeight the height in pixels of the destination rectangle
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the image is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if any of the width or height arguments are negative.
+ *    <li>ERROR_INVALID_ARGUMENT - if the source rectangle is not contained within the bounds of the source image</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES - if no handles are available to perform the operation</li>
+ * </ul>
+ */
+public void drawImage(Image image, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (srcWidth is 0 || srcHeight is 0 || destWidth is 0 || destHeight is 0) return;
+    if (srcX < 0 || srcY < 0 || srcWidth < 0 || srcHeight < 0 || destWidth < 0 || destHeight < 0) {
+        SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (image is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (image.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    drawImage(image, srcX, srcY, srcWidth, srcHeight, destX, destY, destWidth, destHeight, false);
+}
+
+void drawImage(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight, bool simple) {
+    int width;
+    int height;
+    OS.gdk_drawable_get_size(srcImage.pixmap, &width, &height);
+    int imgWidth = width;
+    int imgHeight = height;
+    if (simple) {
+        srcWidth = destWidth = imgWidth;
+        srcHeight = destHeight = imgHeight;
+    } else {
+        simple = srcX is 0 && srcY is 0 &&
+            srcWidth is destWidth && destWidth is imgWidth &&
+            srcHeight is destHeight && destHeight is imgHeight;
+        if (srcX + srcWidth > imgWidth || srcY + srcHeight > imgHeight) {
+            SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+        }
+    }
+    auto cairo = data.cairo;
+    if (cairo !is null) {
+        if (data.alpha !is 0) {
+            srcImage.createSurface();
+            Cairo.cairo_save(cairo);
+            if ((data.style & SWT.MIRRORED) !is 0) {
+                Cairo.cairo_scale(cairo, -1f,  1);
+                Cairo.cairo_translate(cairo, - 2 * destX - destWidth, 0);
+            }
+            Cairo.cairo_rectangle(cairo, destX , destY, destWidth, destHeight);
+            Cairo.cairo_clip(cairo);
+            Cairo.cairo_translate(cairo, destX - srcX, destY - srcY);
+            if (srcWidth !is destWidth || srcHeight !is destHeight) {
+                Cairo.cairo_scale(cairo, destWidth / cast(float)srcWidth,  destHeight / cast(float)srcHeight);
+            }
+            int filter = Cairo.CAIRO_FILTER_GOOD;
+            switch (data.interpolation) {
+                case SWT.DEFAULT: filter = Cairo.CAIRO_FILTER_GOOD; break;
+                case SWT.NONE: filter = Cairo.CAIRO_FILTER_NEAREST; break;
+                case SWT.LOW: filter = Cairo.CAIRO_FILTER_FAST; break;
+                case SWT.HIGH: filter = Cairo.CAIRO_FILTER_BEST; break;
+                default:
+            }
+            auto pattern = Cairo.cairo_pattern_create_for_surface(srcImage.surface);
+            if (pattern is null) SWT.error(SWT.ERROR_NO_HANDLES);
+            if (srcWidth !is destWidth || srcHeight !is destHeight) {
+                /*
+                * Bug in Cairo.  When drawing the image streched with an interpolation
+                * alghorithm, the edges of the image are faded.  This is not a bug, but
+                * it is not desired.  To avoid the faded edges, it should be possible to
+                * use cairo_pattern_set_extend() to set the pattern extend to either
+                * CAIRO_EXTEND_REFLECT or CAIRO_EXTEND_PAD, but these are not implemented
+                * in some versions of cairo (1.2.x) and have bugs in others (in 1.4.2 it
+                * draws with black edges).  The fix is to implement CAIRO_EXTEND_REFLECT
+                * by creating an image that is 3 times bigger than the original, drawing
+                * the original image in every quadrant (with an appropriate transform) and
+                * use this image as the pattern.
+                *
+                * NOTE: For some reaons, it is necessary to use CAIRO_EXTEND_PAD with
+                * the image that was created or the edges are still faded.
+                */
+                if (Cairo.cairo_version () >= Cairo.CAIRO_VERSION_ENCODE(1, 4, 0)) {
+                    auto surface = Cairo.cairo_image_surface_create(Cairo.CAIRO_FORMAT_ARGB32, imgWidth * 3, imgHeight * 3);
+                    auto cr = Cairo.cairo_create(surface);
+                    Cairo.cairo_set_source_surface(cr, srcImage.surface, imgWidth, imgHeight);
+                    Cairo.cairo_paint(cr);
+                    Cairo.cairo_scale(cr, -1, -1);
+                    Cairo.cairo_set_source_surface(cr, srcImage.surface, -imgWidth, -imgHeight);
+                    Cairo.cairo_paint(cr);
+                    Cairo.cairo_set_source_surface(cr, srcImage.surface, -imgWidth * 3, -imgHeight);
+                    Cairo.cairo_paint(cr);
+                    Cairo.cairo_set_source_surface(cr, srcImage.surface, -imgWidth, -imgHeight * 3);
+                    Cairo.cairo_paint(cr);
+                    Cairo.cairo_set_source_surface(cr, srcImage.surface, -imgWidth * 3, -imgHeight * 3);
+                    Cairo.cairo_paint(cr);
+                    Cairo.cairo_scale(cr, 1, -1);
+                    Cairo.cairo_set_source_surface(cr, srcImage.surface, -imgWidth, imgHeight);
+                    Cairo.cairo_paint(cr);
+                    Cairo.cairo_set_source_surface(cr, srcImage.surface, -imgWidth * 3, imgHeight);
+                    Cairo.cairo_paint(cr);
+                    Cairo.cairo_scale(cr, -1, -1);
+                    Cairo.cairo_set_source_surface(cr, srcImage.surface, imgWidth, -imgHeight);
+                    Cairo.cairo_paint(cr);
+                    Cairo.cairo_set_source_surface(cr, srcImage.surface, imgWidth, -imgHeight * 3);
+                    Cairo.cairo_paint(cr);
+                    Cairo.cairo_destroy(cr);
+                    auto newPattern = Cairo.cairo_pattern_create_for_surface(surface);
+                    Cairo.cairo_surface_destroy(surface);
+                    if (newPattern is null) SWT.error(SWT.ERROR_NO_HANDLES);
+                    Cairo.cairo_pattern_destroy(pattern);
+                    pattern = newPattern;
+                    Cairo.cairo_pattern_set_extend(pattern, Cairo.CAIRO_EXTEND_PAD);
+                    double[] matrix = new double[6];
+                    Cairo.cairo_matrix_init_translate(cast(cairo_matrix_t*)matrix.ptr, imgWidth, imgHeight);
+                    Cairo.cairo_pattern_set_matrix(pattern, cast(cairo_matrix_t*)matrix.ptr);
+                }
+//              Cairo.cairo_pattern_set_extend(pattern, Cairo.CAIRO_EXTEND_REFLECT);
+            }
+            Cairo.cairo_pattern_set_filter(pattern, filter);
+            Cairo.cairo_set_source(cairo, pattern);
+            if (data.alpha !is 0xFF) {
+                Cairo.cairo_paint_with_alpha(cairo, data.alpha / cast(float)0xFF);
+            } else {
+                Cairo.cairo_paint(cairo);
+            }
+            Cairo.cairo_restore(cairo);
+            Cairo.cairo_pattern_destroy(pattern);
+        }
+        return;
+    }
+    if (srcImage.alpha !is -1 || srcImage.alphaData !is null) {
+        drawImageAlpha(srcImage, srcX, srcY, srcWidth, srcHeight, destX, destY, destWidth, destHeight, simple, imgWidth, imgHeight);
+    } else if (srcImage.transparentPixel !is -1 || srcImage.mask !is null) {
+        drawImageMask(srcImage, srcX, srcY, srcWidth, srcHeight, destX, destY, destWidth, destHeight, simple, imgWidth, imgHeight);
+    } else {
+        drawImage(srcImage, srcX, srcY, srcWidth, srcHeight, destX, destY, destWidth, destHeight, simple, imgWidth, imgHeight);
+    }
+}
+void drawImage(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight, bool simple, int imgWidth, int imgHeight) {
+    if (srcWidth is destWidth && srcHeight is destHeight) {
+        OS.gdk_draw_drawable(data.drawable, handle, srcImage.pixmap, srcX, srcY, destX, destY, destWidth, destHeight);
+    } else {
+        if (device.useXRender) {
+            drawImageXRender(srcImage, srcX, srcY, srcWidth, srcHeight, destX, destY, destWidth, destHeight, simple, imgWidth, imgHeight, null, -1);
+            return;
+        }
+        auto pixbuf = scale(srcImage.pixmap, srcX, srcY, srcWidth, srcHeight, destWidth, destHeight);
+        if (pixbuf !is null) {
+            OS.gdk_pixbuf_render_to_drawable(pixbuf, data.drawable, handle, 0, 0, destX, destY, destWidth, destHeight, OS.GDK_RGB_DITHER_NORMAL, 0, 0);
+            OS.g_object_unref(pixbuf);
+        }
+    }
+}
+void drawImageAlpha(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight, bool simple, int imgWidth, int imgHeight) {
+    if (srcImage.alpha is 0) return;
+    if (srcImage.alpha is 255) {
+        drawImage(srcImage, srcX, srcY, srcWidth, srcHeight, destX, destY, destWidth, destHeight, simple, imgWidth, imgHeight);
+        return;
+    }
+    if (device.useXRender) {
+        drawImageXRender(srcImage, srcX, srcY, srcWidth, srcHeight, destX, destY, destWidth, destHeight, simple, imgWidth, imgHeight, srcImage.mask, OS.PictStandardA8);
+        return;
+    }
+    auto pixbuf = OS.gdk_pixbuf_new(OS.GDK_COLORSPACE_RGB, true, 8, srcWidth, srcHeight);
+    if (pixbuf is null) return;
+    auto colormap = OS.gdk_colormap_get_system();
+    OS.gdk_pixbuf_get_from_drawable(pixbuf, srcImage.pixmap, colormap, srcX, srcY, 0, 0, srcWidth, srcHeight);
+    int stride = OS.gdk_pixbuf_get_rowstride(pixbuf);
+    auto pixels = OS.gdk_pixbuf_get_pixels(pixbuf);
+    byte[] line = new byte[stride];
+    byte alpha = cast(byte)srcImage.alpha;
+    byte[] alphaData = srcImage.alphaData;
+    for (int y=0; y<srcHeight; y++) {
+        int alphaIndex = (y + srcY) * imgWidth + srcX;
+        memmove(line.ptr, pixels + (y * stride), stride);
+        for (int x=3; x<stride; x+=4) {
+            line[x] = alphaData is null ? alpha : alphaData[alphaIndex++];
+        }
+        memmove(pixels + (y * stride), line.ptr, stride);
+    }
+    if (srcWidth !is destWidth || srcHeight !is destHeight) {
+        auto scaledPixbuf = OS.gdk_pixbuf_scale_simple(pixbuf, destWidth, destHeight, OS.GDK_INTERP_BILINEAR);
+        OS.g_object_unref(pixbuf);
+        if (scaledPixbuf is null) return;
+        pixbuf = scaledPixbuf;
+    }
+    /*
+    * Feature in GTK.  gdk_draw_pixbuf was introduced in GTK+ 2.2.0 and
+    * supports clipping.
+    */
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 2, 0)) {
+        OS.gdk_draw_pixbuf(data.drawable, handle, pixbuf, 0, 0, destX, destY, destWidth, destHeight, OS.GDK_RGB_DITHER_NORMAL, 0, 0);
+    } else {
+        OS.gdk_pixbuf_render_to_drawable_alpha(pixbuf, data.drawable, 0, 0, destX, destY, destWidth, destHeight, OS.GDK_PIXBUF_ALPHA_BILEVEL, 128, OS.GDK_RGB_DITHER_NORMAL, 0, 0);
+    }
+    OS.g_object_unref(pixbuf);
+}
+void drawImageMask(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight, bool simple, int imgWidth, int imgHeight) {
+    auto drawable = data.drawable;
+    auto colorPixmap = srcImage.pixmap;
+    /* Generate the mask if necessary. */
+    if (srcImage.transparentPixel !is -1) srcImage.createMask();
+    auto maskPixmap = srcImage.mask;
+
+    if (device.useXRender) {
+        drawImageXRender(srcImage, srcX, srcY, srcWidth, srcHeight, destX, destY, destWidth, destHeight, simple, imgWidth, imgHeight, maskPixmap, OS.PictStandardA1);
+    } else {
+        if (srcWidth !is destWidth || srcHeight !is destHeight) {
+            auto pixbuf = OS.gdk_pixbuf_new(OS.GDK_COLORSPACE_RGB, true, 8, srcWidth, srcHeight);
+            if (pixbuf !is null) {
+                auto colormap = OS.gdk_colormap_get_system();
+                OS.gdk_pixbuf_get_from_drawable(pixbuf, colorPixmap, colormap, srcX, srcY, 0, 0, srcWidth, srcHeight);
+                auto maskPixbuf = OS.gdk_pixbuf_new(OS.GDK_COLORSPACE_RGB, false, 8, srcWidth, srcHeight);
+                if (maskPixbuf !is null) {
+                    OS.gdk_pixbuf_get_from_drawable(maskPixbuf, maskPixmap, null, srcX, srcY, 0, 0, srcWidth, srcHeight);
+                    int stride = OS.gdk_pixbuf_get_rowstride(pixbuf);
+                    auto pixels = OS.gdk_pixbuf_get_pixels(pixbuf);
+                    byte[] line = new byte[stride];
+                    int maskStride = OS.gdk_pixbuf_get_rowstride(maskPixbuf);
+                    auto maskPixels = OS.gdk_pixbuf_get_pixels(maskPixbuf);
+                    byte[] maskLine = new byte[maskStride];
+                    for (int y=0; y<srcHeight; y++) {
+                        auto offset = pixels + (y * stride);
+                        memmove(line.ptr, offset, stride);
+                        auto maskOffset = maskPixels + (y * maskStride);
+                        memmove(maskLine.ptr, maskOffset, maskStride);
+                        for (int x=0; x<srcWidth; x++) {
+                            if (maskLine[x * 3] is 0) {
+                                line[x*4+3] = 0;
+                            }
+                        }
+                        memmove(offset, line.ptr, stride);
+                    }
+                    OS.g_object_unref(maskPixbuf);
+                    auto scaledPixbuf = OS.gdk_pixbuf_scale_simple(pixbuf, destWidth, destHeight, OS.GDK_INTERP_BILINEAR);
+                    if (scaledPixbuf !is null) {
+                        GdkPixmap * colorBuffer;
+                        GdkBitmap * maskBuffer;
+                        OS.gdk_pixbuf_render_pixmap_and_mask(scaledPixbuf, &colorBuffer, &maskBuffer, 128);
+                        colorPixmap = cast(GdkDrawable *)colorBuffer;
+                        maskPixmap = cast(GdkDrawable *)maskBuffer;
+                        OS.g_object_unref(scaledPixbuf);
+                    }
+                }
+                OS.g_object_unref(pixbuf);
+            }
+            srcX = 0;
+            srcY = 0;
+            srcWidth = destWidth;
+            srcHeight = destHeight;
+        }
+
+        /* Merge clipping with mask if necessary */
+        if (data.clipRgn !is null) {
+            int newWidth =  srcX + srcWidth;
+            int newHeight = srcY + srcHeight;
+            int bytesPerLine = (newWidth + 7) / 8;
+            String maskData = new char[bytesPerLine * newHeight];
+            auto mask = cast(GdkDrawable *) OS.gdk_bitmap_create_from_data(null, maskData.ptr, newWidth, newHeight);
+            if (mask !is null) {
+                auto gc = OS.gdk_gc_new(mask);
+                OS.gdk_region_offset(data.clipRgn, -destX + srcX, -destY + srcY);
+                OS.gdk_gc_set_clip_region(gc, data.clipRgn);
+                OS.gdk_region_offset(data.clipRgn, destX - srcX, destY - srcY);
+                GdkColor* color = new GdkColor();
+                color.pixel = 1;
+                OS.gdk_gc_set_foreground(gc, color);
+                OS.gdk_draw_rectangle(mask, gc, 1, 0, 0, newWidth, newHeight);
+                OS.gdk_gc_set_function(gc, OS.GDK_AND);
+                OS.gdk_draw_drawable(mask, gc, maskPixmap, 0, 0, 0, 0, newWidth, newHeight);
+                OS.g_object_unref(gc);
+                if (maskPixmap !is null && srcImage.mask !is maskPixmap) OS.g_object_unref(maskPixmap);
+                maskPixmap = mask;
+            }
+        }
+
+        /* Blit cliping the mask */
+        GdkGCValues* values = new GdkGCValues();
+        OS.gdk_gc_get_values(handle, values);
+        OS.gdk_gc_set_clip_mask(handle, cast(GdkBitmap *)maskPixmap);
+        OS.gdk_gc_set_clip_origin(handle, destX - srcX, destY - srcY);
+        OS.gdk_draw_drawable(drawable, handle, colorPixmap, srcX, srcY, destX, destY, srcWidth, srcHeight);
+        OS.gdk_gc_set_values(handle, values, OS.GDK_GC_CLIP_MASK | OS.GDK_GC_CLIP_X_ORIGIN | OS.GDK_GC_CLIP_Y_ORIGIN);
+        if (data.clipRgn !is null) OS.gdk_gc_set_clip_region(handle, data.clipRgn);
+    }
+
+    /* Destroy scaled pixmaps */
+    if (colorPixmap !is null && srcImage.pixmap !is colorPixmap) OS.g_object_unref(colorPixmap);
+    if (maskPixmap !is null && srcImage.mask !is maskPixmap) OS.g_object_unref(maskPixmap);
+    /* Destroy the image mask if the there is a GC created on the image */
+    if (srcImage.transparentPixel !is -1 && srcImage.memGC !is null) srcImage.destroyMask();
+}
+void drawImageXRender(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight, bool simple, int imgWidth, int imgHeight, GdkDrawable* maskPixmap, int maskType) {
+    int translateX = 0, translateY = 0;
+    auto drawable = data.drawable;
+    if (data.image is null && !data.realDrawable) {
+        int x, y;
+        GdkDrawable* real_drawable;
+        OS.gdk_window_get_internal_paint_info(cast(GdkWindow*)drawable, &real_drawable, &x, &y);
+        drawable = real_drawable;
+        translateX = -x;
+        translateY = -y;
+    }
+    auto xDisplay = OS.GDK_DISPLAY();
+    int maskPict = 0;
+    if (maskPixmap !is null) {
+        int attribCount = 0;
+        XRenderPictureAttributes* attrib;
+        if (srcImage.alpha !is -1) {
+            attribCount = 1;
+            attrib = new XRenderPictureAttributes();
+            attrib.repeat = true;
+        }
+        maskPict = OS.XRenderCreatePicture(cast(void*)xDisplay, OS.gdk_x11_drawable_get_xid(maskPixmap), OS.XRenderFindStandardFormat(cast(void*)xDisplay, maskType), attribCount, attrib);
+        if (maskPict is 0) SWT.error(SWT.ERROR_NO_HANDLES);
+    }
+    auto format = OS.XRenderFindVisualFormat(cast(void*)xDisplay, OS.gdk_x11_visual_get_xvisual(OS.gdk_visual_get_system()));
+    auto destPict = OS.XRenderCreatePicture(cast(void*)xDisplay, OS.gdk_x11_drawable_get_xid(drawable), format, 0, null);
+    if (destPict is 0) SWT.error(SWT.ERROR_NO_HANDLES);
+    int srcPict = OS.XRenderCreatePicture(xDisplay, OS.gdk_x11_drawable_get_xid(srcImage.pixmap), format, 0, null);
+    if (srcPict is 0) SWT.error(SWT.ERROR_NO_HANDLES);
+    if (srcWidth !is destWidth || srcHeight !is destHeight) {
+        int[] transform = [cast(int)((cast(float)srcWidth / destWidth) * 65536), 0, 0, 0, cast(int)((cast(float)srcHeight / destHeight) * 65536), 0, 0, 0, 65536];
+        OS.XRenderSetPictureTransform(xDisplay, srcPict, cast(XTransform*)transform.ptr);
+        if (maskPict !is 0) OS.XRenderSetPictureTransform(xDisplay, maskPict, cast(XTransform*)transform.ptr);
+        srcX *= destWidth / cast(float)srcWidth;
+        srcY *= destHeight / cast(float)srcHeight;
+    }
+    auto clipping = data.clipRgn;
+    if (data.damageRgn !is null) {
+        if (clipping is null) {
+            clipping = data.damageRgn;
+        } else {
+            clipping = OS.gdk_region_new();
+            OS.gdk_region_union(clipping, data.clipRgn);
+            OS.gdk_region_intersect(clipping, data.damageRgn);
+        }
+    }
+    if (clipping !is null) {
+        int nRects;
+        GdkRectangle* rects;
+        OS.gdk_region_get_rectangles(clipping, &rects, &nRects);
+        GdkRectangle* rect;
+        short[] xRects = new short[nRects * 4];
+        for (int i=0, j=0; i<nRects; i++, j+=4) {
+            rect = rects +i;
+            xRects[j  ] = cast(short)rect.x;
+            xRects[j+1] = cast(short)rect.y;
+            xRects[j+2] = cast(short)rect.width;
+            xRects[j+3] = cast(short)rect.height;
+        }
+        OS.XRenderSetPictureClipRectangles(xDisplay, destPict, translateX, translateY,cast(XRectangle*) xRects.ptr, nRects);
+        if (clipping !is data.clipRgn && clipping !is data.damageRgn) {
+            OS.gdk_region_destroy(clipping);
+        }
+        if (rects !is null) OS.g_free(rects);
+    }
+    OS.XRenderComposite(xDisplay, maskPict !is 0 ? OS.PictOpOver : OS.PictOpSrc, srcPict, maskPict, destPict, srcX, srcY, srcX, srcY, destX + translateX, destY + translateY, destWidth, destHeight);
+    OS.XRenderFreePicture(xDisplay, destPict);
+    OS.XRenderFreePicture(xDisplay, srcPict);
+    if (maskPict !is 0) OS.XRenderFreePicture(xDisplay, maskPict);
+}
+
+GdkPixbuf* scale(GdkDrawable* src, int srcX, int srcY, int srcWidth, int srcHeight, int destWidth, int destHeight) {
+    auto pixbuf = OS.gdk_pixbuf_new(OS.GDK_COLORSPACE_RGB, false, 8, srcWidth, srcHeight);
+    if (pixbuf is null) return null;
+    auto colormap = OS.gdk_colormap_get_system();
+    OS.gdk_pixbuf_get_from_drawable(pixbuf, src, colormap, srcX, srcY, 0, 0, srcWidth, srcHeight);
+    auto scaledPixbuf = OS.gdk_pixbuf_scale_simple(pixbuf, destWidth, destHeight, OS.GDK_INTERP_BILINEAR);
+    OS.g_object_unref(pixbuf);
+    return scaledPixbuf;
+}
+
+/**
+ * Draws a line, using the foreground color, between the points
+ * (<code>x1</code>, <code>y1</code>) and (<code>x2</code>, <code>y2</code>).
+ *
+ * @param x1 the first point's x coordinate
+ * @param y1 the first point's y coordinate
+ * @param x2 the second point's x coordinate
+ * @param y2 the second point's y coordinate
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void drawLine(int x1, int y1, int x2, int y2) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    checkGC(DRAW);
+    auto cairo = data.cairo;
+    if (cairo !is null) {
+        double xOffset = data.cairoXoffset, yOffset = data.cairoYoffset;
+        Cairo.cairo_move_to(cairo, x1 + xOffset, y1 + yOffset);
+        Cairo.cairo_line_to(cairo, x2 + xOffset, y2 + yOffset);
+        Cairo.cairo_stroke(cairo);
+        return;
+    }
+    OS.gdk_draw_line (data.drawable, handle, x1, y1, x2, y2);
+}
+
+/**
+ * Draws the outline of an oval, using the foreground color,
+ * within the specified rectangular area.
+ * <p>
+ * The result is a circle or ellipse that fits within the
+ * rectangle specified by the <code>x</code>, <code>y</code>,
+ * <code>width</code>, and <code>height</code> arguments.
+ * </p><p>
+ * The oval covers an area that is <code>width + 1</code>
+ * pixels wide and <code>height + 1</code> pixels tall.
+ * </p>
+ *
+ * @param x the x coordinate of the upper left corner of the oval to be drawn
+ * @param y the y coordinate of the upper left corner of the oval to be drawn
+ * @param width the width of the oval to be drawn
+ * @param height the height of the oval to be drawn
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void drawOval(int x, int y, int width, int height) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    checkGC(DRAW);
+    if (width < 0) {
+        x = x + width;
+        width = -width;
+    }
+    if (height < 0) {
+        y = y + height;
+        height = -height;
+    }
+    auto cairo = data.cairo;
+    if (cairo !is null) {
+        double xOffset = data.cairoXoffset, yOffset = data.cairoYoffset;
+        if (width is height) {
+            Cairo.cairo_arc_negative(cairo, x + xOffset + width / 2f, y + yOffset + height / 2f, width / 2f, 0, -2 * cast(float)Compatibility.PI);
+        } else {
+            Cairo.cairo_save(cairo);
+            Cairo.cairo_translate(cairo, x + xOffset + width / 2f, y + yOffset + height / 2f);
+            Cairo.cairo_scale(cairo, width / 2f, height / 2f);
+            Cairo.cairo_arc_negative(cairo, 0, 0, 1, 0, -2 * cast(float)Compatibility.PI);
+            Cairo.cairo_restore(cairo);
+        }
+        Cairo.cairo_stroke(cairo);
+        return;
+    }
+    OS.gdk_draw_arc(data.drawable, handle, 0, x, y, width, height, 0, 23040);
+}
+
+/**
+ * Draws the path described by the parameter.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param path the path to draw
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parameter is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the parameter has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ *
+ * @see Path
+ *
+ * @since 3.1
+ */
+public void drawPath(Path path) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (path is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (path.handle is null) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    initCairo();
+    checkGC(DRAW);
+    auto cairo = data.cairo;
+    Cairo.cairo_save(cairo);
+    double xOffset = data.cairoXoffset, yOffset = data.cairoYoffset;
+    Cairo.cairo_translate(cairo, xOffset, yOffset);
+    auto copy = Cairo.cairo_copy_path(path.handle);
+    if (copy is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    Cairo.cairo_append_path(cairo, copy);
+    Cairo.cairo_path_destroy(copy);
+    Cairo.cairo_stroke(cairo);
+    Cairo.cairo_restore(cairo);
+}
+
+/**
+ * Draws a pixel, using the foreground color, at the specified
+ * point (<code>x</code>, <code>y</code>).
+ * <p>
+ * Note that the receiver's line attributes do not affect this
+ * operation.
+ * </p>
+ *
+ * @param x the point's x coordinate
+ * @param y the point's y coordinate
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void drawPoint (int x, int y) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    checkGC(DRAW);
+    auto cairo = data.cairo;
+    if (cairo !is null) {
+        Cairo.cairo_rectangle(cairo, x, y, 1, 1);
+        Cairo.cairo_fill(cairo);
+        return;
+    }
+    OS.gdk_draw_point(data.drawable, handle, x, y);
+}
+
+/**
+ * Draws the closed polygon which is defined by the specified array
+ * of integer coordinates, using the receiver's foreground color. The array
+ * contains alternating x and y values which are considered to represent
+ * points which are the vertices of the polygon. Lines are drawn between
+ * each consecutive pair, and between the first pair and last pair in the
+ * array.
+ *
+ * @param pointArray an array of alternating x and y values which are the vertices of the polygon
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void drawPolygon(int[] pointArray) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    // SWT externsion: allow null array
+    //if (pointArray is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    checkGC(DRAW);
+    auto cairo = data.cairo;
+    if (cairo !is null) {
+        drawPolyline(cairo, pointArray, true);
+        Cairo.cairo_stroke(cairo);
+        return;
+    }
+    OS.gdk_draw_polygon(data.drawable, handle, 0, cast(GdkPoint*)pointArray.ptr, pointArray.length / 2);
+}
+
+/**
+ * Draws the polyline which is defined by the specified array
+ * of integer coordinates, using the receiver's foreground color. The array
+ * contains alternating x and y values which are considered to represent
+ * points which are the corners of the polyline. Lines are drawn between
+ * each consecutive pair, but not between the first pair and last pair in
+ * the array.
+ *
+ * @param pointArray an array of alternating x and y values which are the corners of the polyline
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void drawPolyline(int[] pointArray) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    // SWT externsion: allow null array
+    //if (pointArray is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    checkGC(DRAW);
+    auto cairo = data.cairo;
+    if (cairo !is null) {
+        drawPolyline(cairo, pointArray, false);
+        Cairo.cairo_stroke(cairo);
+        return;
+    }
+    OS.gdk_draw_lines(data.drawable, handle, cast(GdkPoint*)pointArray.ptr, pointArray.length / 2);
+}
+
+void drawPolyline(cairo_t* cairo, int[] pointArray, bool close) {
+    int count = pointArray.length / 2;
+    if (count is 0) return;
+    double xOffset = data.cairoXoffset, yOffset = data.cairoYoffset;
+    Cairo.cairo_move_to(cairo, pointArray[0] + xOffset, pointArray[1] + yOffset);
+    for (int i = 1, j=2; i < count; i++, j += 2) {
+        Cairo.cairo_line_to(cairo, pointArray[j] + xOffset, pointArray[j + 1] + yOffset);
+    }
+    if (close) Cairo.cairo_close_path(cairo);
+}
+
+/**
+ * Draws the outline of the rectangle specified by the arguments,
+ * using the receiver's foreground color. The left and right edges
+ * of the rectangle are at <code>x</code> and <code>x + width</code>.
+ * The top and bottom edges are at <code>y</code> and <code>y + height</code>.
+ *
+ * @param x the x coordinate of the rectangle to be drawn
+ * @param y the y coordinate of the rectangle to be drawn
+ * @param width the width of the rectangle to be drawn
+ * @param height the height of the rectangle to be drawn
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void drawRectangle(int x, int y, int width, int height) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    checkGC(DRAW);
+    if (width < 0) {
+        x = x + width;
+        width = -width;
+    }
+    if (height < 0) {
+        y = y + height;
+        height = -height;
+    }
+    auto cairo = data.cairo;
+    if (cairo !is null) {
+        double xOffset = data.cairoXoffset, yOffset = data.cairoYoffset;
+        Cairo.cairo_rectangle(cairo, x + xOffset, y + yOffset, width, height);
+        Cairo.cairo_stroke(cairo);
+        return;
+    }
+    OS.gdk_draw_rectangle(data.drawable, handle, 0, x, y, width, height);
+}
+
+/**
+ * Draws the outline of the specified rectangle, using the receiver's
+ * foreground color. The left and right edges of the rectangle are at
+ * <code>rect.x</code> and <code>rect.x + rect.width</code>. The top
+ * and bottom edges are at <code>rect.y</code> and
+ * <code>rect.y + rect.height</code>.
+ *
+ * @param rect the rectangle to draw
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the rectangle is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void drawRectangle(Rectangle rect) {
+    if (rect is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    drawRectangle (rect.x, rect.y, rect.width, rect.height);
+}
+/**
+ * Draws the outline of the round-cornered rectangle specified by
+ * the arguments, using the receiver's foreground color. The left and
+ * right edges of the rectangle are at <code>x</code> and <code>x + width</code>.
+ * The top and bottom edges are at <code>y</code> and <code>y + height</code>.
+ * The <em>roundness</em> of the corners is specified by the
+ * <code>arcWidth</code> and <code>arcHeight</code> arguments, which
+ * are respectively the width and height of the ellipse used to draw
+ * the corners.
+ *
+ * @param x the x coordinate of the rectangle to be drawn
+ * @param y the y coordinate of the rectangle to be drawn
+ * @param width the width of the rectangle to be drawn
+ * @param height the height of the rectangle to be drawn
+ * @param arcWidth the width of the arc
+ * @param arcHeight the height of the arc
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void drawRoundRectangle(int x, int y, int width, int height, int arcWidth, int arcHeight) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    checkGC(DRAW);
+    int nx = x;
+    int ny = y;
+    int nw = width;
+    int nh = height;
+    int naw = arcWidth;
+    int nah = arcHeight;
+    if (nw < 0) {
+        nw = 0 - nw;
+        nx = nx - nw;
+    }
+    if (nh < 0) {
+        nh = 0 - nh;
+        ny = ny -nh;
+    }
+    if (naw < 0) naw = 0 - naw;
+    if (nah < 0) nah = 0 - nah;
+    auto cairo = data.cairo;
+    if (cairo !is null) {
+        double xOffset = data.cairoXoffset, yOffset = data.cairoYoffset;
+        if (naw is 0 || nah is 0) {
+            Cairo.cairo_rectangle(cairo, x + xOffset, y + yOffset, width, height);
+        } else {
+            float naw2 = naw / 2f;
+            float nah2 = nah / 2f;
+            float fw = nw / naw2;
+            float fh = nh / nah2;
+            Cairo.cairo_save(cairo);
+            Cairo.cairo_translate(cairo, nx + xOffset, ny + yOffset);
+            Cairo.cairo_scale(cairo, naw2, nah2);
+            Cairo.cairo_move_to(cairo, fw - 1, 0);
+            Cairo.cairo_arc(cairo, fw - 1, 1, 1, Compatibility.PI + Compatibility.PI/2.0, Compatibility.PI*2.0);
+            Cairo.cairo_arc(cairo, fw - 1, fh - 1, 1, 0, Compatibility.PI/2.0);
+            Cairo.cairo_arc(cairo, 1, fh - 1, 1, Compatibility.PI/2, Compatibility.PI);
+            Cairo.cairo_arc(cairo, 1, 1, 1, Compatibility.PI, 270.0*Compatibility.PI/180.0);
+            Cairo.cairo_close_path(cairo);
+            Cairo.cairo_restore(cairo);
+        }
+        Cairo.cairo_stroke(cairo);
+        return;
+    }
+    int naw2 = naw / 2;
+    int nah2 = nah / 2;
+    auto drawable = data.drawable;
+    if (nw > naw) {
+        if (nh > nah) {
+            OS.gdk_draw_arc(drawable, handle, 0, nx, ny, naw, nah, 5760, 5760);
+            OS.gdk_draw_line(drawable, handle, nx + naw2, ny, nx + nw - naw2, ny);
+            OS.gdk_draw_arc(drawable, handle, 0, nx + nw - naw, ny, naw, nah, 0, 5760);
+            OS.gdk_draw_line(drawable, handle, nx + nw, ny + nah2, nx + nw, ny + nh - nah2);
+            OS.gdk_draw_arc(drawable, handle, 0, nx + nw - naw, ny + nh - nah, naw, nah, 17280, 5760);
+            OS.gdk_draw_line(drawable,handle, nx + naw2, ny + nh, nx + nw - naw2, ny + nh);
+            OS.gdk_draw_arc(drawable, handle, 0, nx, ny + nh - nah, naw, nah, 11520, 5760);
+            OS.gdk_draw_line(drawable, handle,  nx, ny + nah2, nx, ny + nh - nah2);
+        } else {
+            OS.gdk_draw_arc(drawable, handle, 0, nx, ny, naw, nh, 5760, 11520);
+            OS.gdk_draw_line(drawable, handle, nx + naw2, ny, nx + nw - naw2, ny);
+            OS.gdk_draw_arc(drawable, handle, 0, nx + nw - naw, ny, naw, nh, 17280, 11520);
+            OS.gdk_draw_line(drawable,handle, nx + naw2, ny + nh, nx + nw - naw2, ny + nh);
+        }
+    } else {
+        if (nh > nah) {
+            OS.gdk_draw_arc(drawable, handle, 0, nx, ny, nw, nah, 0, 11520);
+            OS.gdk_draw_line(drawable, handle, nx + nw, ny + nah2, nx + nw, ny + nh - nah2);
+            OS.gdk_draw_arc(drawable, handle, 0, nx, ny + nh - nah, nw, nah, 11520, 11520);
+            OS.gdk_draw_line(drawable,handle, nx, ny + nah2, nx, ny + nh - nah2);
+        } else {
+            OS.gdk_draw_arc(drawable, handle, 0, nx, ny, nw, nh, 0, 23040);
+        }
+    }
+}
+
+/**
+ * Draws the given str, using the receiver's current font and
+ * foreground color. No tab expansion or carriage return processing
+ * will be performed. The background of the rectangular area where
+ * the str is being drawn will be filled with the receiver's
+ * background color.
+ *
+ * @param str the str to be drawn
+ * @param x the x coordinate of the top left corner of the rectangular area where the str is to be drawn
+ * @param y the y coordinate of the top left corner of the rectangular area where the str is to be drawn
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void drawString (String str, int x, int y) {
+    drawString(str, x, y, false);
+}
+/**
+ * Draws the given str, using the receiver's current font and
+ * foreground color. No tab expansion or carriage return processing
+ * will be performed. If <code>isTransparent</code> is <code>true</code>,
+ * then the background of the rectangular area where the str is being
+ * drawn will not be modified, otherwise it will be filled with the
+ * receiver's background color.
+ *
+ * @param str the str to be drawn
+ * @param x the x coordinate of the top left corner of the rectangular area where the str is to be drawn
+ * @param y the y coordinate of the top left corner of the rectangular area where the str is to be drawn
+ * @param isTransparent if <code>true</code> the background will be transparent, otherwise it will be opaque
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void drawString(String str, int x, int y, bool isTransparent) {
+    drawText(str, x, y, isTransparent ? SWT.DRAW_TRANSPARENT : 0);
+}
+
+/**
+ * Draws the given str, using the receiver's current font and
+ * foreground color. Tab expansion and carriage return processing
+ * are performed. The background of the rectangular area where
+ * the text is being drawn will be filled with the receiver's
+ * background color.
+ *
+ * @param str the str to be drawn
+ * @param x the x coordinate of the top left corner of the rectangular area where the text is to be drawn
+ * @param y the y coordinate of the top left corner of the rectangular area where the text is to be drawn
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void drawText(String str, int x, int y) {
+    drawText(str, x, y, SWT.DRAW_DELIMITER | SWT.DRAW_TAB);
+}
+
+/**
+ * Draws the given str, using the receiver's current font and
+ * foreground color. Tab expansion and carriage return processing
+ * are performed. If <code>isTransparent</code> is <code>true</code>,
+ * then the background of the rectangular area where the text is being
+ * drawn will not be modified, otherwise it will be filled with the
+ * receiver's background color.
+ *
+ * @param str the str to be drawn
+ * @param x the x coordinate of the top left corner of the rectangular area where the text is to be drawn
+ * @param y the y coordinate of the top left corner of the rectangular area where the text is to be drawn
+ * @param isTransparent if <code>true</code> the background will be transparent, otherwise it will be opaque
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void drawText(String str, int x, int y, bool isTransparent) {
+    int flags = SWT.DRAW_DELIMITER | SWT.DRAW_TAB;
+    if (isTransparent) flags |= SWT.DRAW_TRANSPARENT;
+    drawText(str, x, y, flags);
+}
+
+/**
+ * Draws the given str, using the receiver's current font and
+ * foreground color. Tab expansion, line delimiter and mnemonic
+ * processing are performed according to the specified flags. If
+ * <code>flags</code> includes <code>DRAW_TRANSPARENT</code>,
+ * then the background of the rectangular area where the text is being
+ * drawn will not be modified, otherwise it will be filled with the
+ * receiver's background color.
+ * <p>
+ * The parameter <code>flags</code> may be a combination of:
+ * <dl>
+ * <dt><b>DRAW_DELIMITER</b></dt>
+ * <dd>draw multiple lines</dd>
+ * <dt><b>DRAW_TAB</b></dt>
+ * <dd>expand tabs</dd>
+ * <dt><b>DRAW_MNEMONIC</b></dt>
+ * <dd>underline the mnemonic character</dd>
+ * <dt><b>DRAW_TRANSPARENT</b></dt>
+ * <dd>transparent background</dd>
+ * </dl>
+ * </p>
+ *
+ * @param str the str to be drawn
+ * @param x the x coordinate of the top left corner of the rectangular area where the text is to be drawn
+ * @param y the y coordinate of the top left corner of the rectangular area where the text is to be drawn
+ * @param flags the flags specifying how to process the text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void drawText (String str, int x, int y, int flags) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    // SWT extension: allow null string
+    //if (str is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (str.length is 0) return;
+    auto cairo = data.cairo;
+    if (cairo !is null) {
+        if (OS.GTK_VERSION < OS.buildVERSION(2, 8, 0)) {
+            //TODO - honor flags
+            checkGC(FOREGROUND | FONT);
+            cairo_font_extents_t* extents = new cairo_font_extents_t();
+            Cairo.cairo_font_extents(cairo, extents);
+            double baseline = y + extents.ascent;
+            Cairo.cairo_move_to(cairo, x, baseline);
+            char* buffer = toStringz( str );
+            Cairo.cairo_show_text(cairo, buffer);
+            Cairo.cairo_new_path(cairo);
+            return;
+        }
+    }
+    setString(str, flags);
+    if (cairo !is null) {
+        if ((flags & SWT.DRAW_TRANSPARENT) is 0) {
+            checkGC(BACKGROUND);
+            int width, height;
+            OS.pango_layout_get_size(data.layout, &width, &height);
+            Cairo.cairo_rectangle(cairo, x, y, OS.PANGO_PIXELS(width), OS.PANGO_PIXELS(height));
+            Cairo.cairo_fill(cairo);
+        }
+        checkGC(FOREGROUND | FONT);
+        if ((data.style & SWT.MIRRORED) !is 0) {
+            Cairo.cairo_save(cairo);
+            int width, height;
+            OS.pango_layout_get_size(data.layout, &width, &height);
+            Cairo.cairo_scale(cairo, -1f,  1);
+            Cairo.cairo_translate(cairo, -2 * x - OS.PANGO_PIXELS(width), 0);
+        }
+        Cairo.cairo_move_to(cairo, x, y);
+        OS.pango_cairo_show_layout(cairo, data.layout);
+        if ((data.style & SWT.MIRRORED) !is 0) {
+            Cairo.cairo_restore(cairo);
+        }
+        Cairo.cairo_new_path(cairo);
+        return;
+    }
+    checkGC(FOREGROUND | FONT | BACKGROUND_BG);
+    GdkColor* background = null;
+    if ((flags & SWT.DRAW_TRANSPARENT) is 0) background = data.background;
+    if (!data.xorMode) {
+        OS.gdk_draw_layout_with_colors(data.drawable, handle, x, y, data.layout, null, background);
+    } else {
+        auto layout = data.layout;
+        int w, h;
+        OS.pango_layout_get_size(layout, &w, &h);
+        int width = OS.PANGO_PIXELS(w);
+        int height = OS.PANGO_PIXELS(h);
+        auto pixmap = OS.gdk_pixmap_new(cast(GdkDrawable*)OS.GDK_ROOT_PARENT(), width, height, -1);
+        if (pixmap is null) SWT.error(SWT.ERROR_NO_HANDLES);
+        auto gdkGC = OS.gdk_gc_new(cast(GdkDrawable*)pixmap);
+        if (gdkGC is null) SWT.error(SWT.ERROR_NO_HANDLES);
+        GdkColor* black = new GdkColor();
+        OS.gdk_gc_set_foreground(gdkGC, black);
+        OS.gdk_draw_rectangle(cast(GdkDrawable*)pixmap, gdkGC, 1, 0, 0, width, height);
+        OS.gdk_gc_set_foreground(gdkGC, data.foreground);
+        OS.gdk_draw_layout_with_colors(cast(GdkDrawable*)pixmap, gdkGC, 0, 0, layout, null, background);
+        OS.g_object_unref(gdkGC);
+        OS.gdk_draw_drawable(data.drawable, handle, cast(GdkDrawable*)pixmap, 0, 0, x, y, width, height);
+        OS.g_object_unref(pixmap);
+    }
+}
+
+/**
+ * Compares the argument to the receiver, and returns true
+ * if they represent the <em>same</em> object using a class
+ * specific comparison.
+ *
+ * @param object the object to compare with this object
+ * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
+ *
+ * @see #hashCode
+ */
+public override int opEquals(Object object) {
+    if (object is this) return true;
+    if ( auto gc = cast(GC)object){
+       return handle is gc.handle;
+    }
+    return false;
+}
+
+
+/**
+ * Fills the interior of a circular or elliptical arc within
+ * the specified rectangular area, with the receiver's background
+ * color.
+ * <p>
+ * The resulting arc begins at <code>startAngle</code> and extends
+ * for <code>arcAngle</code> degrees, using the current color.
+ * Angles are interpreted such that 0 degrees is at the 3 o'clock
+ * position. A positive value indicates a counter-clockwise rotation
+ * while a negative value indicates a clockwise rotation.
+ * </p><p>
+ * The center of the arc is the center of the rectangle whose origin
+ * is (<code>x</code>, <code>y</code>) and whose size is specified by the
+ * <code>width</code> and <code>height</code> arguments.
+ * </p><p>
+ * The resulting arc covers an area <code>width + 1</code> pixels wide
+ * by <code>height + 1</code> pixels tall.
+ * </p>
+ *
+ * @param x the x coordinate of the upper-left corner of the arc to be filled
+ * @param y the y coordinate of the upper-left corner of the arc to be filled
+ * @param width the width of the arc to be filled
+ * @param height the height of the arc to be filled
+ * @param startAngle the beginning angle
+ * @param arcAngle the angular extent of the arc, relative to the start angle
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #drawArc
+ */
+public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    checkGC(FILL);
+    if (width < 0) {
+        x = x + width;
+        width = -width;
+    }
+    if (height < 0) {
+        y = y + height;
+        height = -height;
+    }
+    if (width is 0 || height is 0 || arcAngle is 0) return;
+    auto cairo = data.cairo;
+    if (cairo !is null) {
+        if (width is height) {
+            if (arcAngle >= 0) {
+                Cairo.cairo_arc_negative(cairo, x + width / 2f, y + height / 2f, width / 2f, -startAngle * cast(float)Compatibility.PI / 180,  -(startAngle + arcAngle) * cast(float)Compatibility.PI / 180);
+            } else {
+                Cairo.cairo_arc(cairo, x + width / 2f, y + height / 2f, width / 2f, -startAngle * cast(float)Compatibility.PI / 180,  -(startAngle + arcAngle) * cast(float)Compatibility.PI / 180);
+            }
+            Cairo.cairo_line_to(cairo, x + width / 2f, y + height / 2f);
+        } else {
+            Cairo.cairo_save(cairo);
+            Cairo.cairo_translate(cairo, x + width / 2f, y + height / 2f);
+            Cairo.cairo_scale(cairo, width / 2f, height / 2f);
+            if (arcAngle >= 0) {
+                Cairo.cairo_arc_negative(cairo, 0, 0, 1, -startAngle * cast(float)Compatibility.PI / 180,  -(startAngle + arcAngle) * cast(float)Compatibility.PI / 180);
+            } else {
+                Cairo.cairo_arc(cairo, 0, 0, 1, -startAngle * cast(float)Compatibility.PI / 180,  -(startAngle + arcAngle) * cast(float)Compatibility.PI / 180);
+            }
+            Cairo.cairo_line_to(cairo, 0, 0);
+            Cairo.cairo_restore(cairo);
+        }
+        Cairo.cairo_fill(cairo);
+        return;
+    }
+    OS.gdk_draw_arc(data.drawable, handle, 1, x, y, width, height, startAngle * 64, arcAngle * 64);
+}
+
+/**
+ * Fills the interior of the specified rectangle with a gradient
+ * sweeping from left to right or top to bottom progressing
+ * from the receiver's foreground color to its background color.
+ *
+ * @param x the x coordinate of the rectangle to be filled
+ * @param y the y coordinate of the rectangle to be filled
+ * @param width the width of the rectangle to be filled, may be negative
+ *        (inverts direction of gradient if horizontal)
+ * @param height the height of the rectangle to be filled, may be negative
+ *        (inverts direction of gradient if vertical)
+ * @param vertical if true sweeps from top to bottom, else
+ *        sweeps from left to right
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #drawRectangle(int, int, int, int)
+ */
+public void fillGradientRectangle(int x, int y, int width, int height, bool vertical) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if ((width is 0) || (height is 0)) return;
+
+    /* Rewrite this to use GdkPixbuf */
+
+    RGB backgroundRGB, foregroundRGB;
+    backgroundRGB = getBackground().getRGB();
+    foregroundRGB = getForeground().getRGB();
+
+    RGB fromRGB, toRGB;
+    fromRGB = foregroundRGB;
+    toRGB   = backgroundRGB;
+    bool swapColors = false;
+    if (width < 0) {
+        x += width; width = -width;
+        if (! vertical) swapColors = true;
+    }
+    if (height < 0) {
+        y += height; height = -height;
+        if (vertical) swapColors = true;
+    }
+    if (swapColors) {
+        fromRGB = backgroundRGB;
+        toRGB   = foregroundRGB;
+    }
+    if (fromRGB.opEquals(toRGB)) {
+        fillRectangle(x, y, width, height);
+        return;
+    }
+    auto cairo = data.cairo;
+    if (cairo !is null) {
+        cairo_pattern_t* pattern;
+        if (vertical) {
+            pattern = Cairo.cairo_pattern_create_linear (0.0, 0.0, 0.0, 1.0);
+        } else {
+            pattern = Cairo.cairo_pattern_create_linear (0.0, 0.0, 1.0, 0.0);
+        }
+        Cairo.cairo_pattern_add_color_stop_rgba (pattern, 0, fromRGB.red / 255f, fromRGB.green / 255f, fromRGB.blue / 255f, data.alpha / 255f);
+        Cairo.cairo_pattern_add_color_stop_rgba (pattern, 1, toRGB.red / 255f, toRGB.green / 255f, toRGB.blue / 255f, data.alpha / 255f);
+        Cairo.cairo_save(cairo);
+        Cairo.cairo_translate(cairo, x, y);
+        Cairo.cairo_scale(cairo, width, height);
+        Cairo.cairo_rectangle(cairo, 0, 0, 1, 1);
+        Cairo.cairo_set_source(cairo, pattern);
+        Cairo.cairo_fill(cairo);
+        Cairo.cairo_restore(cairo);
+        Cairo.cairo_pattern_destroy(pattern);
+        return;
+    }
+    ImageData.fillGradientRectangle(this, data.device,
+        x, y, width, height, vertical, fromRGB, toRGB,
+        8, 8, 8);
+}
+
+/**
+ * Fills the interior of an oval, within the specified
+ * rectangular area, with the receiver's background
+ * color.
+ *
+ * @param x the x coordinate of the upper left corner of the oval to be filled
+ * @param y the y coordinate of the upper left corner of the oval to be filled
+ * @param width the width of the oval to be filled
+ * @param height the height of the oval to be filled
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #drawOval
+ */
+public void fillOval(int x, int y, int width, int height) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    checkGC(FILL);
+    if (width < 0) {
+        x = x + width;
+        width = -width;
+    }
+    if (height < 0) {
+        y = y + height;
+        height = -height;
+    }
+    auto cairo = data.cairo;
+    if (cairo !is null) {
+        if (width is height) {
+            Cairo.cairo_arc_negative(cairo, x + width / 2f, y + height / 2f, width / 2f, 0, 2 * cast(float)Compatibility.PI);
+        } else {
+            Cairo.cairo_save(cairo);
+            Cairo.cairo_translate(cairo, x + width / 2f, y + height / 2f);
+            Cairo.cairo_scale(cairo, width / 2f, height / 2f);
+            Cairo.cairo_arc_negative(cairo, 0, 0, 1, 0, 2 * cast(float)Compatibility.PI);
+            Cairo.cairo_restore(cairo);
+        }
+        Cairo.cairo_fill(cairo);
+        return;
+    }
+    OS.gdk_draw_arc(data.drawable, handle, 1, x, y, width, height, 0, 23040);
+}
+
+/**
+ * Fills the path described by the parameter.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param path the path to fill
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parameter is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the parameter has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ *
+ * @see Path
+ *
+ * @since 3.1
+ */
+public void fillPath (Path path) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (path is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (path.handle is null) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    initCairo();
+    checkGC(FILL);
+    auto cairo = data.cairo;
+    auto copy = Cairo.cairo_copy_path(path.handle);
+    if (copy is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    Cairo.cairo_append_path(cairo, copy);
+    Cairo.cairo_path_destroy(copy);
+    Cairo.cairo_fill(cairo);
+}
+
+/**
+ * Fills the interior of the closed polygon which is defined by the
+ * specified array of integer coordinates, using the receiver's
+ * background color. The array contains alternating x and y values
+ * which are considered to represent points which are the vertices of
+ * the polygon. Lines are drawn between each consecutive pair, and
+ * between the first pair and last pair in the array.
+ *
+ * @param pointArray an array of alternating x and y values which are the vertices of the polygon
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #drawPolygon
+ */
+public void fillPolygon(int[] pointArray) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    // SWT extension: allow null array
+    //if (pointArray is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    checkGC(FILL);
+    auto cairo = data.cairo;
+    if (cairo !is null) {
+        drawPolyline(cairo, pointArray, true);
+        Cairo.cairo_fill(cairo);
+        return;
+    }
+    OS.gdk_draw_polygon(data.drawable, handle, 1, cast(GdkPoint*)pointArray.ptr, pointArray.length / 2);
+}
+
+/**
+ * Fills the interior of the rectangle specified by the arguments,
+ * using the receiver's background color.
+ *
+ * @param x the x coordinate of the rectangle to be filled
+ * @param y the y coordinate of the rectangle to be filled
+ * @param width the width of the rectangle to be filled
+ * @param height the height of the rectangle to be filled
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #drawRectangle(int, int, int, int)
+ */
+public void fillRectangle(int x, int y, int width, int height) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    checkGC(FILL);
+    if (width < 0) {
+        x = x + width;
+        width = -width;
+    }
+    if (height < 0) {
+        y = y + height;
+        height = -height;
+    }
+    auto cairo = data.cairo;
+    if (cairo !is null) {
+        Cairo.cairo_rectangle(cairo, x, y, width, height);
+        Cairo.cairo_fill(cairo);
+        return;
+    }
+    OS.gdk_draw_rectangle(data.drawable, handle, 1, x, y, width, height);
+}
+
+/**
+ * Fills the interior of the specified rectangle, using the receiver's
+ * background color.
+ *
+ * @param rect the rectangle to be filled
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the rectangle is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #drawRectangle(int, int, int, int)
+ */
+public void fillRectangle(Rectangle rect) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (rect is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    fillRectangle(rect.x, rect.y, rect.width, rect.height);
+}
+
+/**
+ * Fills the interior of the round-cornered rectangle specified by
+ * the arguments, using the receiver's background color.
+ *
+ * @param x the x coordinate of the rectangle to be filled
+ * @param y the y coordinate of the rectangle to be filled
+ * @param width the width of the rectangle to be filled
+ * @param height the height of the rectangle to be filled
+ * @param arcWidth the width of the arc
+ * @param arcHeight the height of the arc
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #drawRoundRectangle
+ */
+public void fillRoundRectangle(int x, int y, int width, int height, int arcWidth, int arcHeight) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    checkGC(FILL);
+    int nx = x;
+    int ny = y;
+    int nw = width;
+    int nh = height;
+    int naw = arcWidth;
+    int nah = arcHeight;
+    if (nw < 0) {
+        nw = 0 - nw;
+        nx = nx - nw;
+    }
+    if (nh < 0) {
+        nh = 0 - nh;
+        ny = ny -nh;
+    }
+    if (naw < 0) naw = 0 - naw;
+    if (nah < 0) nah = 0 - nah;
+    auto cairo = data.cairo;
+    if (cairo !is null) {
+        if (naw is 0 || nah is 0) {
+            Cairo.cairo_rectangle(cairo, x, y, width, height);
+        } else {
+            float naw2 = naw / 2f;
+            float nah2 = nah / 2f;
+            float fw = nw / naw2;
+            float fh = nh / nah2;
+            Cairo.cairo_save(cairo);
+            Cairo.cairo_translate(cairo, nx, ny);
+            Cairo.cairo_scale(cairo, naw2, nah2);
+            Cairo.cairo_move_to(cairo, fw - 1, 0);
+            Cairo.cairo_arc(cairo, fw - 1, 1, 1, Compatibility.PI + Compatibility.PI/2.0, Compatibility.PI*2.0);
+            Cairo.cairo_arc(cairo, fw - 1, fh - 1, 1, 0, Compatibility.PI/2.0);
+            Cairo.cairo_arc(cairo, 1, fh - 1, 1, Compatibility.PI/2, Compatibility.PI);
+            Cairo.cairo_arc(cairo, 1, 1, 1, Compatibility.PI, 270.0*Compatibility.PI/180.0);
+            Cairo.cairo_close_path(cairo);
+            Cairo.cairo_restore(cairo);
+        }
+        Cairo.cairo_fill(cairo);
+        return;
+    }
+    int naw2 = naw / 2;
+    int nah2 = nah / 2;
+    auto drawable = data.drawable;
+    if (nw > naw) {
+        if (nh > nah) {
+            OS.gdk_draw_arc(drawable, handle, 1, nx, ny, naw, nah, 5760, 5760);
+            OS.gdk_draw_rectangle(drawable, handle, 1, nx + naw2, ny, nw - naw2 * 2, nh);
+            OS.gdk_draw_arc(drawable, handle, 1, nx + nw - naw, ny, naw, nah, 0, 5760);
+            OS.gdk_draw_rectangle(drawable, handle, 1, nx, ny + nah2, naw2, nh - nah2 * 2);
+            OS.gdk_draw_arc(drawable, handle, 1, nx + nw - naw, ny + nh - nah, naw, nah, 17280, 5760);
+            OS.gdk_draw_rectangle(drawable, handle, 1, nx + nw - naw2, ny + nah2, naw2, nh - nah2 * 2);
+            OS.gdk_draw_arc(drawable, handle, 1, nx, ny + nh - nah, naw, nah, 11520, 5760);
+        } else {
+            OS.gdk_draw_arc(drawable, handle, 1, nx, ny, naw, nh, 5760, 11520);
+            OS.gdk_draw_rectangle(drawable, handle, 1, nx + naw2, ny, nw - naw2 * 2, nh);
+            OS.gdk_draw_arc(drawable, handle, 1, nx + nw - naw, ny, naw, nh, 17280, 11520);
+        }
+    } else {
+        if (nh > nah) {
+            OS.gdk_draw_arc(drawable, handle, 1, nx, ny, nw, nah, 0, 11520);
+            OS.gdk_draw_rectangle(drawable, handle, 1, nx, ny + nah2, nw, nh - nah2 * 2);
+            OS.gdk_draw_arc(drawable, handle, 1, nx, ny + nh - nah, nw, nah, 11520, 11520);
+        } else {
+            OS.gdk_draw_arc(drawable, handle, 1, nx, ny, nw, nh, 0, 23040);
+        }
+    }
+}
+
+int fixMnemonic (char [] buffer) {
+    int i=0, j=0;
+    int mnemonic=-1;
+    while (i < buffer.length) {
+        if ((buffer [j++] = buffer [i++]) is '&') {
+            if (i is buffer.length) {continue;}
+            if (buffer [i] is '&') {i++; continue;}
+            if (mnemonic is -1) mnemonic = j;
+            j--;
+        }
+    }
+    while (j < buffer.length) buffer [j++] = 0;
+    return mnemonic;
+}
+
+/**
+ * Returns the <em>advance width</em> of the specified character in
+ * the font which is currently selected into the receiver.
+ * <p>
+ * The advance width is defined as the horizontal distance the cursor
+ * should move after printing the character in the selected font.
+ * </p>
+ *
+ * @param ch the character to measure
+ * @return the distance in the x direction to move past the character before painting the next
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getAdvanceWidth(char ch) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    //BOGUS
+    return stringExtent([ch]).x;
+}
+
+/**
+ * Returns <code>true</code> if receiver is using the operating system's
+ * advanced graphics subsystem.  Otherwise, <code>false</code> is returned
+ * to indicate that normal graphics are in use.
+ * <p>
+ * Advanced graphics may not be installed for the operating system.  In this
+ * case, <code>false</code> is always returned.  Some operating system have
+ * only one graphics subsystem.  If this subsystem supports advanced graphics,
+ * then <code>true</code> is always returned.  If any graphics operation such
+ * as alpha, antialias, patterns, interpolation, paths, clipping or transformation
+ * has caused the receiver to switch from regular to advanced graphics mode,
+ * <code>true</code> is returned.  If the receiver has been explicitly switched
+ * to advanced mode and this mode is supported, <code>true</code> is returned.
+ * </p>
+ *
+ * @return the advanced value
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #setAdvanced
+ *
+ * @since 3.1
+ */
+public bool getAdvanced() {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    return data.cairo !is null;
+}
+
+/**
+ * Returns the receiver's alpha value. The alpha value
+ * is between 0 (transparent) and 255 (opaque).
+ *
+ * @return the alpha value
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public int getAlpha() {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    return data.alpha;
+}
+
+/**
+ * Returns the receiver's anti-aliasing setting value, which will be
+ * one of <code>SWT.DEFAULT</code>, <code>SWT.OFF</code> or
+ * <code>SWT.ON</code>. Note that this controls anti-aliasing for all
+ * <em>non-text drawing</em> operations.
+ *
+ * @return the anti-aliasing setting
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getTextAntialias
+ *
+ * @since 3.1
+ */
+public int getAntialias() {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (data.cairo is null) return SWT.DEFAULT;
+    int antialias = Cairo.cairo_get_antialias(data.cairo);
+    switch (antialias) {
+        case Cairo.CAIRO_ANTIALIAS_DEFAULT: return SWT.DEFAULT;
+        case Cairo.CAIRO_ANTIALIAS_NONE: return SWT.OFF;
+        case Cairo.CAIRO_ANTIALIAS_GRAY:
+        case Cairo.CAIRO_ANTIALIAS_SUBPIXEL: return SWT.ON;
+                default:
+    }
+    return SWT.DEFAULT;
+}
+
+/**
+ * Returns the background color.
+ *
+ * @return the receiver's background color
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Color getBackground() {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    return Color.gtk_new(data.device, data.background);
+}
+
+/**
+ * Returns the background pattern. The default value is
+ * <code>null</code>.
+ *
+ * @return the receiver's background pattern
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see Pattern
+ *
+ * @since 3.1
+ */
+public Pattern getBackgroundPattern() {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    return data.backgroundPattern;
+}
+
+/**
+ * Returns the width of the specified character in the font
+ * selected into the receiver.
+ * <p>
+ * The width is defined as the space taken up by the actual
+ * character, not including the leading and tailing whitespace
+ * or overhang.
+ * </p>
+ *
+ * @param ch the character to measure
+ * @return the width of the character
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getCharWidth(char ch) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    //BOGUS
+    return stringExtent([ch]).x;
+}
+
+/**
+ * Returns the bounding rectangle of the receiver's clipping
+ * region. If no clipping region is set, the return value
+ * will be a rectangle which covers the entire bounds of the
+ * object the receiver is drawing on.
+ *
+ * @return the bounding rectangle of the clipping region
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Rectangle getClipping() {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    /* Calculate visible bounds in device space */
+    int x = 0, y = 0, width = 0, height = 0;
+    if (data.width !is -1 && data.height !is -1) {
+        width = data.width;
+        height = data.height;
+    } else {
+        int w, h;
+        OS.gdk_drawable_get_size(data.drawable, &w, &h);
+        width = w;
+        height = h;
+    }
+    /* Intersect visible bounds with clipping in device space and then convert then to user space */
+    auto cairo = data.cairo;
+    auto clipRgn = data.clipRgn;
+    auto damageRgn = data.damageRgn;
+    if (clipRgn !is null || damageRgn !is null || cairo !is null) {
+        auto rgn = OS.gdk_region_new();
+        GdkRectangle rect;
+        rect.width = width;
+        rect.height = height;
+        OS.gdk_region_union_with_rect(rgn, &rect);
+        if (damageRgn !is null) {
+            OS.gdk_region_intersect (rgn, damageRgn);
+        }
+        /* Intersect visible bounds with clipping */
+        if (clipRgn !is null) {
+            /* Convert clipping to device space if needed */
+            if (data.clippingTransform !is null) {
+                clipRgn = convertRgn(clipRgn, data.clippingTransform);
+                OS.gdk_region_intersect(rgn, clipRgn);
+                OS.gdk_region_destroy(clipRgn);
+            } else {
+                OS.gdk_region_intersect(rgn, clipRgn);
+            }
+        }
+        /* Convert to user space */
+        if (cairo !is null) {
+            double[] matrix = new double[6];
+            Cairo.cairo_get_matrix(cairo, cast(cairo_matrix_t*)matrix.ptr);
+            Cairo.cairo_matrix_invert(cast(cairo_matrix_t*)matrix.ptr);
+            clipRgn = convertRgn(rgn, matrix);
+            OS.gdk_region_destroy(rgn);
+            rgn = clipRgn;
+        }
+        OS.gdk_region_get_clipbox(rgn, &rect);
+        OS.gdk_region_destroy(rgn);
+        x = rect.x;
+        y = rect.y;
+        width = rect.width;
+        height = rect.height;
+    }
+    return new Rectangle(x, y, width, height);
+}
+
+/**
+ * Sets the region managed by the argument to the current
+ * clipping region of the receiver.
+ *
+ * @param region the region to fill with the clipping region
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the region is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the region is disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void getClipping(Region region) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (region is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (region.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    auto clipping = region.handle;
+    OS.gdk_region_subtract(clipping, clipping);
+    auto cairo = data.cairo;
+    auto clipRgn = data.clipRgn;
+    if (clipRgn is null) {
+        GdkRectangle rect;
+        if (data.width !is -1 && data.height !is -1) {
+            rect.width = data.width;
+            rect.height = data.height;
+        } else {
+            int width, height;
+            OS.gdk_drawable_get_size(data.drawable, &width, &height);
+            rect.width = width;
+            rect.height = height;
+        }
+        OS.gdk_region_union_with_rect(clipping, &rect);
+    } else {
+        /* Convert clipping to device space if needed */
+        if (data.clippingTransform !is null) {
+            auto rgn = convertRgn(clipRgn, data.clippingTransform);
+            OS.gdk_region_union(clipping, rgn);
+            OS.gdk_region_destroy(rgn);
+        } else {
+            OS.gdk_region_union(clipping, clipRgn);
+        }
+    }
+    if (data.damageRgn !is null) {
+        OS.gdk_region_intersect(clipping, data.damageRgn);
+    }
+    /* Convert to user space */
+    if (cairo !is null) {
+        double[] matrix = new double[6];
+        Cairo.cairo_get_matrix(cairo, cast(cairo_matrix_t*)matrix.ptr);
+        Cairo.cairo_matrix_invert(cast(cairo_matrix_t*)matrix.ptr);
+        auto rgn = convertRgn(clipping, matrix);
+        OS.gdk_region_subtract(clipping, clipping);
+        OS.gdk_region_union(clipping, rgn);
+        OS.gdk_region_destroy(rgn);
+    }
+}
+
+/**
+ * Returns the receiver's fill rule, which will be one of
+ * <code>SWT.FILL_EVEN_ODD</code> or <code>SWT.FILL_WINDING</code>.
+ *
+ * @return the receiver's fill rule
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public int getFillRule() {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    auto cairo = data.cairo;
+    if (cairo is null) return SWT.FILL_EVEN_ODD;
+    return Cairo.cairo_get_fill_rule(cairo) is Cairo.CAIRO_FILL_RULE_WINDING ? SWT.FILL_WINDING : SWT.FILL_EVEN_ODD;
+}
+
+/**
+ * Returns the font currently being used by the receiver
+ * to draw and measure text.
+ *
+ * @return the receiver's font
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Font getFont() {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    return data.font;
+}
+
+/**
+ * Returns a FontMetrics which contains information
+ * about the font currently being used by the receiver
+ * to draw and measure text.
+ *
+ * @return font metrics for the receiver's font
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public FontMetrics getFontMetrics() {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (data.context is null) createLayout();
+    checkGC(FONT);
+    Font font = data.font;
+    auto context = data.context;
+    auto lang = OS.pango_context_get_language(context);
+    auto metrics = OS.pango_context_get_metrics(context, font.handle, lang);
+    FontMetrics fm = new FontMetrics();
+    fm.ascent = OS.PANGO_PIXELS(OS.pango_font_metrics_get_ascent(metrics));
+    fm.descent = OS.PANGO_PIXELS(OS.pango_font_metrics_get_descent(metrics));
+    fm.averageCharWidth = OS.PANGO_PIXELS(OS.pango_font_metrics_get_approximate_char_width(metrics));
+    fm.height = fm.ascent + fm.descent;
+    OS.pango_font_metrics_unref(metrics);
+    return fm;
+}
+
+/**
+ * Returns the receiver's foreground color.
+ *
+ * @return the color used for drawing foreground things
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Color getForeground() {
+    if (handle is null) SWT.error(SWT.ERROR_WIDGET_DISPOSED);
+    return Color.gtk_new(data.device, data.foreground);
+}
+
+/**
+ * Returns the foreground pattern. The default value is
+ * <code>null</code>.
+ *
+ * @return the receiver's foreground pattern
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see Pattern
+ *
+ * @since 3.1
+ */
+public Pattern getForegroundPattern() {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    return data.foregroundPattern;
+}
+
+/**
+ * Returns the GCData.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>GC</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @return the receiver's GCData
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see GCData
+ *
+ * @since 3.2
+ */
+public GCData getGCData() {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    return data;
+}
+
+/**
+ * Returns the receiver's interpolation setting, which will be one of
+ * <code>SWT.DEFAULT</code>, <code>SWT.NONE</code>,
+ * <code>SWT.LOW</code> or <code>SWT.HIGH</code>.
+ *
+ * @return the receiver's interpolation setting
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public int getInterpolation() {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    return data.interpolation;
+}
+
+/**
+ * Returns the receiver's line attributes.
+ *
+ * @return the line attributes used for drawing lines
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.3
+ */
+public LineAttributes getLineAttributes() {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    float[] dashes = null;
+    if (data.lineDashes !is null) {
+        dashes = new float[data.lineDashes.length];
+        System.arraycopy(data.lineDashes, 0, dashes, 0, dashes.length);
+    }
+    return new LineAttributes(data.lineWidth, data.lineCap, data.lineJoin, data.lineStyle, dashes, data.lineDashesOffset, data.lineMiterLimit);
+}
+
+/**
+ * Returns the receiver's line cap style, which will be one
+ * of the constants <code>SWT.CAP_FLAT</code>, <code>SWT.CAP_ROUND</code>,
+ * or <code>SWT.CAP_SQUARE</code>.
+ *
+ * @return the cap style used for drawing lines
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public int getLineCap() {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    return data.lineCap;
+}
+
+/**
+ * Returns the receiver's line dash style. The default value is
+ * <code>null</code>.
+ *
+ * @return the line dash style used for drawing lines
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public int[] getLineDash() {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (data.lineDashes is null) return null;
+    int[] lineDashes = new int[data.lineDashes.length];
+    for (int i = 0; i < lineDashes.length; i++) {
+        lineDashes[i] = cast(int)data.lineDashes[i];
+    }
+    return lineDashes;
+}
+
+/**
+ * Returns the receiver's line join style, which will be one
+ * of the constants <code>SWT.JOIN_MITER</code>, <code>SWT.JOIN_ROUND</code>,
+ * or <code>SWT.JOIN_BEVEL</code>.
+ *
+ * @return the join style used for drawing lines
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public int getLineJoin() {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    return data.lineJoin;
+}
+
+/**
+ * Returns the receiver's line style, which will be one
+ * of the constants <code>SWT.LINE_SOLID</code>, <code>SWT.LINE_DASH</code>,
+ * <code>SWT.LINE_DOT</code>, <code>SWT.LINE_DASHDOT</code> or
+ * <code>SWT.LINE_DASHDOTDOT</code>.
+ *
+ * @return the style used for drawing lines
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getLineStyle() {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    return data.lineStyle;
+}
+
+/**
+ * Returns the width that will be used when drawing lines
+ * for all of the figure drawing operations (that is,
+ * <code>drawLine</code>, <code>drawRectangle</code>,
+ * <code>drawPolyline</code>, and so forth.
+ *
+ * @return the receiver's line width
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getLineWidth() {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    return cast(int)data.lineWidth;
+}
+
+/**
+ * Returns the receiver's style information.
+ * <p>
+ * Note that the value which is returned by this method <em>may
+ * not match</em> the value which was provided to the constructor
+ * when the receiver was created. This can occur when the underlying
+ * operating system does not support a particular combination of
+ * requested styles.
+ * </p>
+ *
+ * @return the style bits
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 2.1.2
+ */
+public int getStyle () {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    return data.style;
+}
+
+/**
+ * Returns the receiver's text drawing anti-aliasing setting value,
+ * which will be one of <code>SWT.DEFAULT</code>, <code>SWT.OFF</code> or
+ * <code>SWT.ON</code>. Note that this controls anti-aliasing
+ * <em>only</em> for text drawing operations.
+ *
+ * @return the anti-aliasing setting
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getAntialias
+ *
+ * @since 3.1
+ */
+public int getTextAntialias() {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (data.cairo is null) return SWT.DEFAULT;
+    int antialias = Cairo.CAIRO_ANTIALIAS_DEFAULT;
+    if (OS.GTK_VERSION < OS.buildVERSION(2, 8, 0)) {
+        auto options = Cairo.cairo_font_options_create();
+        Cairo.cairo_get_font_options(data.cairo, options);
+        antialias = Cairo.cairo_font_options_get_antialias(options);
+        Cairo.cairo_font_options_destroy(options);
+    } else {
+        if (data.context !is null) {
+            auto options = OS.pango_cairo_context_get_font_options(data.context);
+            if (options !is null) antialias = Cairo.cairo_font_options_get_antialias(options);
+        }
+    }
+    switch (antialias) {
+        case Cairo.CAIRO_ANTIALIAS_DEFAULT: return SWT.DEFAULT;
+        case Cairo.CAIRO_ANTIALIAS_NONE: return SWT.OFF;
+        case Cairo.CAIRO_ANTIALIAS_GRAY:
+        case Cairo.CAIRO_ANTIALIAS_SUBPIXEL: return SWT.ON;
+                default:
+    }
+    return SWT.DEFAULT;
+}
+
+/**
+ * Sets the parameter to the transform that is currently being
+ * used by the receiver.
+ *
+ * @param transform the destination to copy the transform into
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parameter is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the parameter has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see Transform
+ *
+ * @since 3.1
+ */
+public void getTransform(Transform transform) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (transform is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (transform.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    auto cairo = data.cairo;
+    if (cairo !is null) {
+        Cairo.cairo_get_matrix(cairo, cast(cairo_matrix_t*)transform.handle.ptr);
+        double[] identity = identity();
+        Cairo.cairo_matrix_invert(cast(cairo_matrix_t*)identity.ptr);
+        Cairo.cairo_matrix_multiply(cast(cairo_matrix_t*)transform.handle.ptr, cast(cairo_matrix_t*)transform.handle.ptr, cast(cairo_matrix_t*)identity.ptr);
+    } else {
+        transform.setElements(1, 0, 0, 1, 0, 0);
+    }
+}
+
+/**
+ * Returns <code>true</code> if this GC is drawing in the mode
+ * where the resulting color in the destination is the
+ * <em>exclusive or</em> of the color values in the source
+ * and the destination, and <code>false</code> if it is
+ * drawing in the mode where the destination color is being
+ * replaced with the source color value.
+ *
+ * @return <code>true</code> true if the receiver is in XOR mode, and false otherwise
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public bool getXORMode() {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    return data.xorMode;
+}
+
+/**
+ * Returns an integer hash code for the receiver. Any two
+ * objects that return <code>true</code> when passed to
+ * <code>equals</code> must return the same value for this
+ * method.
+ *
+ * @return the receiver's hash
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #equals
+ */
+public override hash_t toHash() {
+    return cast(hash_t)/*64*/handle;
+}
+
+double[] identity() {
+    double[] identity = new double[6];
+    if ((data.style & SWT.MIRRORED) !is 0) {
+        int w, h;
+        OS.gdk_drawable_get_size(data.drawable, &w, &h);
+        Cairo.cairo_matrix_init(cast(cairo_matrix_t*)identity.ptr, -1, 0, 0, 1, w, 0);
+    } else {
+        Cairo.cairo_matrix_init_identity(cast(cairo_matrix_t*)identity.ptr);
+    }
+    return identity;
+}
+
+void init_(Drawable drawable, GCData data, GdkGC* gdkGC) {
+    if (data.foreground !is null) data.state &= ~FOREGROUND;
+    if (data.background !is null) data.state &= ~(BACKGROUND | BACKGROUND_BG);
+    if (data.font !is null) data.state &= ~FONT;
+
+    Image image = data.image;
+    if (image !is null) {
+        image.memGC = this;
+        /*
+         * The transparent pixel mask might change when drawing on
+         * the image.  Destroy it so that it is regenerated when
+         * necessary.
+         */
+        if (image.transparentPixel !is -1) image.destroyMask();
+    }
+    this.drawable = drawable;
+    this.data = data;
+    handle = gdkGC;
+    if ((data.style & SWT.MIRRORED) !is 0) {
+      initCairo();
+      auto cairo = data.cairo;
+      Cairo.cairo_set_matrix(cairo, cast(cairo_matrix_t*) identity().ptr);
+    }
+}
+
+void initCairo() {
+    data.device.checkCairo();
+    auto cairo = data.cairo;
+    if (cairo !is null) return;
+    auto xDisplay = OS.GDK_DISPLAY();
+    auto xVisual = OS.gdk_x11_visual_get_xvisual(OS.gdk_visual_get_system());
+    uint xDrawable;
+    int translateX = 0, translateY = 0;
+    auto drawable = data.drawable;
+    if (data.image !is null) {
+        xDrawable = OS.GDK_PIXMAP_XID(drawable);
+    } else {
+        if (!data.realDrawable) {
+            int x, y;
+            GdkDrawable* real_drawable;
+            OS.gdk_window_get_internal_paint_info(cast(GdkWindow*)drawable, &real_drawable, &x, &y);
+            xDrawable = OS.gdk_x11_drawable_get_xid(real_drawable);
+            translateX = -x;
+            translateY = -y;
+        }
+    }
+    int w, h;
+    OS.gdk_drawable_get_size(drawable, &w, &h);
+    int width = w, height = h;
+    auto surface = Cairo.cairo_xlib_surface_create(cast(void*)xDisplay, xDrawable, xVisual, width, height);
+    if (surface is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    Cairo.cairo_surface_set_device_offset(surface, translateX, translateY);
+    data.cairo = cairo = Cairo.cairo_create(surface);
+    Cairo.cairo_surface_destroy(surface);
+    if (cairo is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    data.disposeCairo = true;
+    Cairo.cairo_set_fill_rule(cairo, Cairo.CAIRO_FILL_RULE_EVEN_ODD);
+    data.state &= ~(BACKGROUND | FOREGROUND | FONT | LINE_WIDTH | LINE_CAP | LINE_JOIN | LINE_STYLE | DRAW_OFFSET);
+    setCairoClip(cairo, data.clipRgn);
+}
+
+/**
+ * Returns <code>true</code> if the receiver has a clipping
+ * region set into it, and <code>false</code> otherwise.
+ * If this method returns false, the receiver will draw on all
+ * available space in the destination. If it returns true,
+ * it will draw only in the area that is covered by the region
+ * that can be accessed with <code>getClipping(region)</code>.
+ *
+ * @return <code>true</code> if the GC has a clipping region, and <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public bool isClipped() {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    return data.clipRgn !is null;
+}
+
+/**
+ * Returns <code>true</code> if the GC has been disposed,
+ * and <code>false</code> otherwise.
+ * <p>
+ * This method gets the dispose state for the GC.
+ * When a GC has been disposed, it is an error to
+ * invoke any other method using the GC.
+ *
+ * @return <code>true</code> when the GC is disposed and <code>false</code> otherwise
+ */
+public override bool isDisposed() {
+    return handle is null;
+}
+
+bool isIdentity(double[] matrix) {
+    if (matrix is null) return true;
+    return matrix[0] is 1 && matrix[1] is 0 && matrix[2] is 0 && matrix[3] is 1 && matrix[4] is 0 && matrix[5] is 0;
+}
+
+/**
+ * Sets the receiver to always use the operating system's advanced graphics
+ * subsystem for all graphics operations if the argument is <code>true</code>.
+ * If the argument is <code>false</code>, the advanced graphics subsystem is
+ * no longer used, advanced graphics state is cleared and the normal graphics
+ * subsystem is used from now on.
+ * <p>
+ * Normally, the advanced graphics subsystem is invoked automatically when
+ * any one of the alpha, antialias, patterns, interpolation, paths, clipping
+ * or transformation operations in the receiver is requested.  When the receiver
+ * is switched into advanced mode, the advanced graphics subsystem performs both
+ * advanced and normal graphics operations.  Because the two subsystems are
+ * different, their output may differ.  Switching to advanced graphics before
+ * any graphics operations are performed ensures that the output is consistent.
+ * </p><p>
+ * Advanced graphics may not be installed for the operating system.  In this
+ * case, this operation does nothing.  Some operating system have only one
+ * graphics subsystem, so switching from normal to advanced graphics does
+ * nothing.  However, switching from advanced to normal graphics will always
+ * clear the advanced graphics state, even for operating systems that have
+ * only one graphics subsystem.
+ * </p>
+ *
+ * @param advanced the new advanced graphics state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #setAlpha
+ * @see #setAntialias
+ * @see #setBackgroundPattern
+ * @see #setClipping(Path)
+ * @see #setForegroundPattern
+ * @see #setLineAttributes
+ * @see #setInterpolation
+ * @see #setTextAntialias
+ * @see #setTransform
+ * @see #getAdvanced
+ *
+ * @since 3.1
+ */
+public void setAdvanced(bool advanced) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if ((data.style & SWT.MIRRORED) !is 0) {
+        if (!advanced) {
+            setAlpha(0xFF);
+            setAntialias(SWT.DEFAULT);
+            setBackgroundPattern(null);
+            setClipping(cast(GdkRegion*)null);
+            setForegroundPattern(null);
+            setInterpolation(SWT.DEFAULT);
+            setTextAntialias(SWT.DEFAULT);
+            setTransform(null);
+        }
+        return;
+    }
+    if (advanced && data.cairo !is null) return;
+    if (advanced) {
+        try {
+            initCairo();
+        } catch (SWTException e) {}
+    } else {
+        if (!data.disposeCairo) return;
+        auto cairo = data.cairo;
+        if (cairo !is null) Cairo.cairo_destroy(cairo);
+        data.cairo = null;
+        data.interpolation = SWT.DEFAULT;
+        data.backgroundPattern = data.foregroundPattern = null;
+        data.state = 0;
+        setClipping(cast(GdkRegion*)null);
+    }
+}
+
+/**
+ * Sets the receiver's alpha value which must be
+ * between 0 (transparent) and 255 (opaque).
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ * @param alpha the alpha value
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ *
+ * @see #getAdvanced
+ * @see #setAdvanced
+ *
+ * @since 3.1
+ */
+public void setAlpha(int alpha) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (data.cairo is null && (alpha & 0xff) is 0xff) return;
+    initCairo();
+    data.alpha = alpha & 0xff;
+    data.state &= ~(BACKGROUND | FOREGROUND | BACKGROUND_BG);
+}
+
+/**
+ * Sets the receiver's anti-aliasing value to the parameter,
+ * which must be one of <code>SWT.DEFAULT</code>, <code>SWT.OFF</code>
+ * or <code>SWT.ON</code>. Note that this controls anti-aliasing for all
+ * <em>non-text drawing</em> operations.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param antialias the anti-aliasing setting
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the parameter is not one of <code>SWT.DEFAULT</code>,
+ *                                 <code>SWT.OFF</code> or <code>SWT.ON</code></li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ *
+ * @see #getAdvanced
+ * @see #setAdvanced
+ * @see #setTextAntialias
+ *
+ * @since 3.1
+ */
+public void setAntialias(int antialias) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (data.cairo is null && antialias is SWT.DEFAULT) return;
+    int mode = 0;
+    switch (antialias) {
+        case SWT.DEFAULT: mode = Cairo.CAIRO_ANTIALIAS_DEFAULT; break;
+        case SWT.OFF: mode = Cairo.CAIRO_ANTIALIAS_NONE; break;
+        case SWT.ON: mode = Cairo.CAIRO_ANTIALIAS_GRAY;
+            break;
+        default:
+            SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    initCairo();
+    auto cairo = data.cairo;
+    Cairo.cairo_set_antialias(cairo, mode);
+}
+
+/**
+ * Sets the background color. The background color is used
+ * for fill operations and as the background color when text
+ * is drawn.
+ *
+ * @param color the new background color for the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the color is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the color has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setBackground(Color color) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (color is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (color.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    data.background = color.handle;
+    data.backgroundPattern = null;
+    data.state &= ~(BACKGROUND | BACKGROUND_BG);
+}
+
+/**
+ * Sets the background pattern. The default value is <code>null</code>.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param pattern the new background pattern
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the parameter has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ *
+ * @see Pattern
+ * @see #getAdvanced
+ * @see #setAdvanced
+ *
+ * @since 3.1
+ */
+public void setBackgroundPattern(Pattern pattern) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (pattern !is null && pattern.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    if (data.cairo is null && pattern is null) return;
+    initCairo();
+    if (data.backgroundPattern is pattern) return;
+    data.backgroundPattern = pattern;
+    data.state &= ~BACKGROUND;
+}
+
+static void setCairoFont(cairo_t* cairo, Font font) {
+    setCairoFont(cairo, font.handle);
+}
+
+static void setCairoFont(cairo_t* cairo, PangoFontDescription* font) {
+    auto family = OS.pango_font_description_get_family(font);
+    int len = /*OS.*/strlen(family);
+    String buffer = new char[len + 1];
+    memmove(buffer.ptr, family, len);
+    //TODO - convert font height from pango to cairo
+    double height = OS.PANGO_PIXELS(OS.pango_font_description_get_size(font)) * 96 / 72;
+    int pangoStyle = OS.pango_font_description_get_style(font);
+    int pangoWeight = OS.pango_font_description_get_weight(font);
+    int slant = Cairo.CAIRO_FONT_SLANT_NORMAL;
+    if (pangoStyle is OS.PANGO_STYLE_ITALIC) slant = Cairo.CAIRO_FONT_SLANT_ITALIC;
+    if (pangoStyle is OS.PANGO_STYLE_OBLIQUE) slant = Cairo.CAIRO_FONT_SLANT_OBLIQUE;
+    int weight = Cairo.CAIRO_FONT_WEIGHT_NORMAL;
+    if (pangoWeight is OS.PANGO_WEIGHT_BOLD) weight = Cairo.CAIRO_FONT_WEIGHT_BOLD;
+    Cairo.cairo_select_font_face(cairo, buffer.ptr, slant, weight);
+    Cairo.cairo_set_font_size(cairo, height);
+}
+
+static void setCairoClip(cairo_t* cairo, GdkRegion* clipRgn) {
+    Cairo.cairo_reset_clip(cairo);
+    if (clipRgn is null) return;
+    if (OS.GTK_VERSION >= OS.buildVERSION(2, 8, 0)) {
+        OS.gdk_cairo_region(cairo, clipRgn);
+    } else {
+        int nRects;
+        GdkRectangle * rects;
+        OS.gdk_region_get_rectangles(clipRgn, &rects, &nRects);
+        //GdkRectangle* rect = new GdkRectangle();
+        for (int i=0; i<nRects; i++) {
+            Cairo.cairo_rectangle(cairo, rects[i].x, rects[i].y, rects[i].width, rects[i].height);
+        }
+        if (rects !is null) OS.g_free(rects);
+    }
+    Cairo.cairo_clip(cairo);
+}
+
+static void setCairoPatternColor( cairo_pattern_t* pattern, int offset, Color c, int alpha) {
+    GdkColor* color = c.handle;
+    double aa = (alpha & 0xFF) / cast(double)0xFF;
+    double red = ((color.red & 0xFFFF) / cast(double)0xFFFF);
+    double green = ((color.green & 0xFFFF) / cast(double)0xFFFF);
+    double blue = ((color.blue & 0xFFFF) / cast(double)0xFFFF);
+    Cairo.cairo_pattern_add_color_stop_rgba(pattern, offset, red, green, blue, aa);
+}
+
+void setClipping(GdkRegion* clipRgn) {
+    auto cairo = data.cairo;
+    if (clipRgn is null) {
+        if (data.clipRgn !is null) {
+            OS.gdk_region_destroy(data.clipRgn);
+            data.clipRgn = null;
+        }
+        if (cairo !is null) {
+            data.clippingTransform = null;
+            setCairoClip(cairo, clipRgn);
+        } else {
+            auto clipping = data.damageRgn !is null ? data.damageRgn : null;
+            OS.gdk_gc_set_clip_region(handle, clipping);
+        }
+    } else {
+        if (data.clipRgn is null) data.clipRgn = OS.gdk_region_new();
+        OS.gdk_region_subtract(data.clipRgn, data.clipRgn);
+        OS.gdk_region_union(data.clipRgn, clipRgn);
+        if (cairo !is null) {
+            if (data.clippingTransform is null) data.clippingTransform = new double[6];
+            Cairo.cairo_get_matrix(cairo,cast(cairo_matrix_t *) data.clippingTransform.ptr);
+            setCairoClip(cairo, clipRgn);
+        } else {
+            auto clipping = clipRgn;
+            if (data.damageRgn !is null) {
+                clipping = OS.gdk_region_new();
+                OS.gdk_region_union(clipping, clipRgn);
+                OS.gdk_region_intersect(clipping, data.damageRgn);
+            }
+            OS.gdk_gc_set_clip_region(handle, clipping);
+            if (clipping !is clipRgn) OS.gdk_region_destroy(clipping);
+        }
+    }
+}
+
+/**
+ * Sets the area of the receiver which can be changed
+ * by drawing operations to the rectangular area specified
+ * by the arguments.
+ *
+ * @param x the x coordinate of the clipping rectangle
+ * @param y the y coordinate of the clipping rectangle
+ * @param width the width of the clipping rectangle
+ * @param height the height of the clipping rectangle
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setClipping(int x, int y, int width, int height) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (width < 0) {
+        x = x + width;
+        width = -width;
+    }
+    if (height < 0) {
+        y = y + height;
+        height = -height;
+    }
+    GdkRectangle rect;
+    rect.x = x;
+    rect.y = y;
+    rect.width = width;
+    rect.height = height;
+    auto clipRgn = OS.gdk_region_new();
+    OS.gdk_region_union_with_rect(clipRgn, &rect);
+    setClipping(clipRgn);
+    OS.gdk_region_destroy(clipRgn);
+}
+
+/**
+ * Sets the area of the receiver which can be changed
+ * by drawing operations to the path specified
+ * by the argument.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param path the clipping path.
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the path has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ *
+ * @see Path
+ * @see #getAdvanced
+ * @see #setAdvanced
+ *
+ * @since 3.1
+ */
+public void setClipping(Path path) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (path !is null && path.isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    setClipping(cast(GdkRegion*)null);
+    if (path !is null) {
+        initCairo();
+        auto cairo = data.cairo;
+        auto copy = Cairo.cairo_copy_path(path.handle);
+        if (copy is null) SWT.error(SWT.ERROR_NO_HANDLES);
+        Cairo.cairo_append_path(cairo, copy);
+        Cairo.cairo_path_destroy(copy);
+        Cairo.cairo_clip(cairo);
+    }
+}
+
+/**
+ * Sets the area of the receiver which can be changed
+ * by drawing operations to the rectangular area specified
+ * by the argument.  Specifying <code>null</code> for the
+ * rectangle reverts the receiver's clipping area to its
+ * original value.
+ *
+ * @param rect the clipping rectangle or <code>null</code>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setClipping(Rectangle rect) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (rect is null) {
+        setClipping(cast(GdkRegion*)null);
+    } else {
+        setClipping(rect.x, rect.y, rect.width, rect.height);
+    }
+}
+/**
+ * Sets the area of the receiver which can be changed
+ * by drawing operations to the region specified
+ * by the argument.  Specifying <code>null</code> for the
+ * region reverts the receiver's clipping area to its
+ * original value.
+ *
+ * @param region the clipping region or <code>null</code>
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the region has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setClipping(Region region) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (region !is null && region.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    setClipping(region !is null ? region.handle : cast(GdkRegion*)null);
+}
+
+/**
+ * Sets the font which will be used by the receiver
+ * to draw and measure text to the argument. If the
+ * argument is null, then a default font appropriate
+ * for the platform will be used instead.
+ *
+ * @param font the new font for the receiver, or null to indicate a default font
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the font has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setFont(Font font) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (font !is null && font.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    data.font = font !is null ? font : data.device.systemFont;
+    data.state &= ~FONT;
+    data.stringWidth = data.stringHeight = -1;
+}
+
+/**
+ * Sets the receiver's fill rule to the parameter, which must be one of
+ * <code>SWT.FILL_EVEN_ODD</code> or <code>SWT.FILL_WINDING</code>.
+ *
+ * @param rule the new fill rule
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the rule is not one of <code>SWT.FILL_EVEN_ODD</code>
+ *                                 or <code>SWT.FILL_WINDING</code></li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void setFillRule(int rule) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    int cairo_mode = Cairo.CAIRO_FILL_RULE_EVEN_ODD;
+    switch (rule) {
+        case SWT.FILL_WINDING:
+            cairo_mode = Cairo.CAIRO_FILL_RULE_WINDING; break;
+        case SWT.FILL_EVEN_ODD:
+            cairo_mode = Cairo.CAIRO_FILL_RULE_EVEN_ODD; break;
+        default:
+            SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    //TODO - need fill rule in X, GDK has no API
+    initCairo();
+    auto cairo = data.cairo;
+    if (cairo !is null) {
+        Cairo.cairo_set_fill_rule(cairo, cairo_mode);
+    }
+}
+
+/**
+ * Sets the foreground color. The foreground color is used
+ * for drawing operations including when text is drawn.
+ *
+ * @param color the new foreground color for the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the color is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the color has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setForeground(Color color) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (color is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (color.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    data.foreground = color.handle;
+    data.foregroundPattern = null;
+    data.state &= ~FOREGROUND;
+}
+
+/**
+ * Sets the foreground pattern. The default value is <code>null</code>.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ * @param pattern the new foreground pattern
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the parameter has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ *
+ * @see Pattern
+ * @see #getAdvanced
+ * @see #setAdvanced
+ *
+ * @since 3.1
+ */
+public void setForegroundPattern(Pattern pattern) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (pattern !is null && pattern.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    if (data.cairo is null && pattern is null) return;
+    initCairo();
+    if (data.foregroundPattern is pattern) return;
+    data.foregroundPattern = pattern;
+    data.state &= ~FOREGROUND;
+}
+
+/**
+ * Sets the receiver's interpolation setting to the parameter, which
+ * must be one of <code>SWT.DEFAULT</code>, <code>SWT.NONE</code>,
+ * <code>SWT.LOW</code> or <code>SWT.HIGH</code>.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param interpolation the new interpolation setting
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the rule is not one of <code>SWT.DEFAULT</code>,
+ *                                 <code>SWT.NONE</code>, <code>SWT.LOW</code> or <code>SWT.HIGH</code>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ *
+ * @see #getAdvanced
+ * @see #setAdvanced
+ *
+ * @since 3.1
+ */
+public void setInterpolation(int interpolation) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (data.cairo is null && interpolation is SWT.DEFAULT) return;
+    switch (interpolation) {
+        case SWT.DEFAULT:
+        case SWT.NONE:
+        case SWT.LOW:
+        case SWT.HIGH:
+            break;
+        default:
+            SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    initCairo();
+    data.interpolation = interpolation;
+}
+
+/**
+ * Sets the receiver's line attributes.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ * @param attributes the line attributes
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the attributes is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if any of the line attributes is not valid</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ *
+ * @see LineAttributes
+ * @see #getAdvanced
+ * @see #setAdvanced
+ *
+ * @since 3.3
+ */
+public void setLineAttributes(LineAttributes attributes) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (attributes is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    int mask = 0;
+    float lineWidth = attributes.width;
+    if (lineWidth !is data.lineWidth) {
+        mask |= LINE_WIDTH | DRAW_OFFSET;
+    }
+    int lineStyle = attributes.style;
+    if (lineStyle !is data.lineStyle) {
+        mask |= LINE_STYLE;
+        switch (lineStyle) {
+            case SWT.LINE_SOLID:
+            case SWT.LINE_DASH:
+            case SWT.LINE_DOT:
+            case SWT.LINE_DASHDOT:
+            case SWT.LINE_DASHDOTDOT:
+                break;
+            case SWT.LINE_CUSTOM:
+                if (attributes.dash is null) lineStyle = SWT.LINE_SOLID;
+                break;
+            default:
+                SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+        }
+    }
+    int join = attributes.join;
+    if (join !is data.lineJoin) {
+        mask |= LINE_JOIN;
+        switch (join) {
+            case SWT.CAP_ROUND:
+            case SWT.CAP_FLAT:
+            case SWT.CAP_SQUARE:
+                break;
+            default:
+                SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+        }
+    }
+    int cap = attributes.cap;
+    if (cap !is data.lineCap) {
+        mask |= LINE_CAP;
+        switch (cap) {
+            case SWT.JOIN_MITER:
+            case SWT.JOIN_ROUND:
+            case SWT.JOIN_BEVEL:
+                break;
+            default:
+                SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+        }
+    }
+    float[] dashes = attributes.dash;
+    float[] lineDashes = data.lineDashes;
+    if (dashes !is null && dashes.length > 0) {
+        bool changed = lineDashes is null || lineDashes.length !is dashes.length;
+        for (int i = 0; i < dashes.length; i++) {
+            float dash = dashes[i];
+            if (dash <= 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+            if (!changed && lineDashes[i] !is dash) changed = true;
+        }
+        if (changed) {
+            float[] newDashes = new float[dashes.length];
+            System.arraycopy(dashes, 0, newDashes, 0, dashes.length);
+            dashes = newDashes;
+            mask |= LINE_STYLE;
+        } else {
+            dashes = lineDashes;
+        }
+    } else {
+        if (lineDashes !is null && lineDashes.length > 0) {
+            mask |= LINE_STYLE;
+        } else {
+            dashes = lineDashes;
+        }
+    }
+    float dashOffset = attributes.dashOffset;
+    if (dashOffset !is data.lineDashesOffset) {
+        mask |= LINE_STYLE;
+    }
+    float miterLimit = attributes.miterLimit;
+    if (miterLimit !is data.lineMiterLimit) {
+        mask |= LINE_MITERLIMIT;
+    }
+    initCairo();
+    if (mask is 0) return;
+    data.lineWidth = lineWidth;
+    data.lineStyle = lineStyle;
+    data.lineCap = cap;
+    data.lineJoin = join;
+    data.lineDashes = dashes;
+    data.lineDashesOffset = dashOffset;
+    data.lineMiterLimit = miterLimit;
+    data.state &= ~mask;
+}
+
+/**
+ * Sets the receiver's line cap style to the argument, which must be one
+ * of the constants <code>SWT.CAP_FLAT</code>, <code>SWT.CAP_ROUND</code>,
+ * or <code>SWT.CAP_SQUARE</code>.
+ *
+ * @param cap the cap style to be used for drawing lines
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the style is not valid</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void setLineCap(int cap) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (data.lineCap is cap) return;
+    switch (cap) {
+        case SWT.CAP_ROUND:
+        case SWT.CAP_FLAT:
+        case SWT.CAP_SQUARE:
+            break;
+        default:
+            SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    data.lineCap = cap;
+    data.state &= ~LINE_CAP;
+}
+
+/**
+ * Sets the receiver's line dash style to the argument. The default
+ * value is <code>null</code>. If the argument is not <code>null</code>,
+ * the receiver's line style is set to <code>SWT.LINE_CUSTOM</code>, otherwise
+ * it is set to <code>SWT.LINE_SOLID</code>.
+ *
+ * @param dashes the dash style to be used for drawing lines
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if any of the values in the array is less than or equal 0</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void setLineDash(int[] dashes) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    float[] lineDashes = data.lineDashes;
+    if (dashes !is null && dashes.length > 0) {
+        bool changed = data.lineStyle !is SWT.LINE_CUSTOM || lineDashes is null || lineDashes.length !is dashes.length;
+        for (int i = 0; i < dashes.length; i++) {
+            int dash = dashes[i];
+            if (dash <= 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+            if (!changed && lineDashes[i] !is dash) changed = true;
+        }
+        if (!changed) return;
+        data.lineDashes = new float[dashes.length];
+        for (int i = 0; i < dashes.length; i++) {
+            data.lineDashes[i] = dashes[i];
+        }
+        data.lineStyle = SWT.LINE_CUSTOM;
+    } else {
+        if (data.lineStyle is SWT.LINE_SOLID && (lineDashes is null || lineDashes.length is 0)) return;
+        data.lineDashes = null;
+        data.lineStyle = SWT.LINE_SOLID;
+    }
+    data.state &= ~LINE_STYLE;
+}
+
+/**
+ * Sets the receiver's line join style to the argument, which must be one
+ * of the constants <code>SWT.JOIN_MITER</code>, <code>SWT.JOIN_ROUND</code>,
+ * or <code>SWT.JOIN_BEVEL</code>.
+ *
+ * @param join the join style to be used for drawing lines
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the style is not valid</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void setLineJoin(int join) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (data.lineJoin is join) return;
+    switch (join) {
+        case SWT.JOIN_MITER:
+        case SWT.JOIN_ROUND:
+        case SWT.JOIN_BEVEL:
+            break;
+        default:
+            SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    data.lineJoin = join;
+    data.state &= ~LINE_JOIN;
+}
+
+/**
+ * Sets the receiver's line style to the argument, which must be one
+ * of the constants <code>SWT.LINE_SOLID</code>, <code>SWT.LINE_DASH</code>,
+ * <code>SWT.LINE_DOT</code>, <code>SWT.LINE_DASHDOT</code> or
+ * <code>SWT.LINE_DASHDOTDOT</code>.
+ *
+ * @param lineStyle the style to be used for drawing lines
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the style is not valid</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setLineStyle(int lineStyle) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (data.lineStyle is lineStyle) return;
+    switch (lineStyle) {
+        case SWT.LINE_SOLID:
+        case SWT.LINE_DASH:
+        case SWT.LINE_DOT:
+        case SWT.LINE_DASHDOT:
+        case SWT.LINE_DASHDOTDOT:
+            break;
+        case SWT.LINE_CUSTOM:
+            if (data.lineDashes is null) lineStyle = SWT.LINE_SOLID;
+            break;
+        default:
+            SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    data.lineStyle = lineStyle;
+    data.state &= ~LINE_STYLE;
+}
+
+/**
+ * Sets the width that will be used when drawing lines
+ * for all of the figure drawing operations (that is,
+ * <code>drawLine</code>, <code>drawRectangle</code>,
+ * <code>drawPolyline</code>, and so forth.
+ * <p>
+ * Note that line width of zero is used as a hint to
+ * indicate that the fastest possible line drawing
+ * algorithms should be used. This means that the
+ * output may be different from line width one.
+ * </p>
+ *
+ * @param lineWidth the width of a line
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setLineWidth(int lineWidth) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (data.lineWidth is lineWidth) return;
+    data.lineWidth = lineWidth;
+    data.state &= ~(LINE_WIDTH | DRAW_OFFSET);
+}
+
+void setString(String str, int flags) {
+    if (data.layout is null) createLayout();
+    if (str is data.str && (flags & ~SWT.DRAW_TRANSPARENT) is (data.drawFlags  & ~SWT.DRAW_TRANSPARENT)) {
+        return;
+    }
+    String buffer;
+    int mnemonic, len = str.length ;
+    auto layout = data.layout;
+    char[] text = str.dup;
+    if ((flags & SWT.DRAW_MNEMONIC) !is 0 && (mnemonic = fixMnemonic(text)) !is -1) {
+        char[] text1 = new char[mnemonic - 1];
+        System.arraycopy(text, 0, text1, 0, text1.length);
+        char[] buffer1 = text1.dup;
+        char[] text2 = new char[text.length - mnemonic];
+        System.arraycopy(text, mnemonic - 1, text2, 0, text2.length);
+        char[] buffer2 = text2.dup;
+        buffer = new char[buffer1.length + buffer2.length];
+        System.arraycopy(buffer1, 0, buffer, 0, buffer1.length);
+        System.arraycopy(buffer2, 0, buffer, buffer1.length, buffer2.length);
+        auto attr_list = OS.pango_attr_list_new();
+        auto attr = OS.pango_attr_underline_new(OS.PANGO_UNDERLINE_LOW);
+        attr.start_index = buffer1.length;
+        attr.end_index = buffer1.length + 1;
+        OS.pango_attr_list_insert(attr_list, attr);
+        OS.pango_layout_set_attributes(layout, attr_list);
+        OS.pango_attr_list_unref(attr_list);
+    } else {
+        buffer = text.dup;
+        OS.pango_layout_set_attributes(layout, null);
+    }
+    OS.pango_layout_set_text(layout, buffer.ptr, buffer.length);
+    OS.pango_layout_set_single_paragraph_mode(layout, (flags & SWT.DRAW_DELIMITER) is 0);
+    OS.pango_layout_set_tabs(layout, (flags & SWT.DRAW_TAB) !is 0 ? null : data.device.emptyTab);
+    data.str = str;
+    data.stringWidth = data.stringHeight = -1;
+    data.drawFlags = flags;
+}
+
+/**
+ * Sets the receiver's text anti-aliasing value to the parameter,
+ * which must be one of <code>SWT.DEFAULT</code>, <code>SWT.OFF</code>
+ * or <code>SWT.ON</code>. Note that this controls anti-aliasing only
+ * for all <em>text drawing</em> operations.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param antialias the anti-aliasing setting
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the parameter is not one of <code>SWT.DEFAULT</code>,
+ *                                 <code>SWT.OFF</code> or <code>SWT.ON</code></li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ *
+ * @see #getAdvanced
+ * @see #setAdvanced
+ * @see #setAntialias
+ *
+ * @since 3.1
+ */
+public void setTextAntialias(int antialias) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (data.cairo is null && antialias is SWT.DEFAULT) return;
+    int mode = 0;
+    switch (antialias) {
+        case SWT.DEFAULT: mode = Cairo.CAIRO_ANTIALIAS_DEFAULT; break;
+        case SWT.OFF: mode = Cairo.CAIRO_ANTIALIAS_NONE; break;
+        case SWT.ON: mode = Cairo.CAIRO_ANTIALIAS_GRAY;
+            break;
+        default:
+            SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    initCairo();
+    auto options = Cairo.cairo_font_options_create();
+    Cairo.cairo_font_options_set_antialias(options, mode);
+    if (OS.GTK_VERSION < OS.buildVERSION(2, 8, 0)) {
+        Cairo.cairo_set_font_options(data.cairo, options);
+    } else {
+        if (data.context is null) createLayout();
+        OS.pango_cairo_context_set_font_options(data.context, options);
+    }
+    Cairo.cairo_font_options_destroy(options);
+}
+
+/**
+ * Sets the transform that is currently being used by the receiver. If
+ * the argument is <code>null</code>, the current transform is set to
+ * the identity transform.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param transform the transform to set
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the parameter has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ *
+ * @see Transform
+ * @see #getAdvanced
+ * @see #setAdvanced
+ *
+ * @since 3.1
+ */
+public void setTransform(Transform transform) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (transform !is null && transform.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    if (data.cairo is null && transform is null) return;
+    initCairo();
+    auto cairo = data.cairo;
+    double[] identity = identity();
+    if (transform !is null) {
+        Cairo.cairo_matrix_multiply(cast(cairo_matrix_t*)identity.ptr, cast(cairo_matrix_t*)transform.handle.ptr, cast(cairo_matrix_t*)identity.ptr);
+    }
+    Cairo.cairo_set_matrix(cairo, cast(cairo_matrix_t*)identity.ptr);
+    data.state &= ~DRAW_OFFSET;
+}
+
+/**
+ * If the argument is <code>true</code>, puts the receiver
+ * in a drawing mode where the resulting color in the destination
+ * is the <em>exclusive or</em> of the color values in the source
+ * and the destination, and if the argument is <code>false</code>,
+ * puts the receiver in a drawing mode where the destination color
+ * is replaced with the source color value.
+ * <p>
+ * Note that this mode in fundamentally unsupportable on certain
+ * platforms, notably Carbon (Mac OS X). Clients that want their
+ * code to run on all platforms need to avoid this method.
+ * </p>
+ *
+ * @param xor if <code>true</code>, then <em>xor</em> mode is used, otherwise <em>source copy</em> mode is used
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @deprecated this functionality is not supported on some platforms
+ */
+public void setXORMode(bool xor) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    OS.gdk_gc_set_function(handle, xor ? OS.GDK_XOR : OS.GDK_COPY);
+    data.xorMode = xor;
+}
+
+/**
+ * Returns the extent of the given str. No tab
+ * expansion or carriage return processing will be performed.
+ * <p>
+ * The <em>extent</em> of a str is the width and height of
+ * the rectangular area it would cover if drawn in a particular
+ * font (in this case, the current font in the receiver).
+ * </p>
+ *
+ * @param str the str to measure
+ * @return a point containing the extent of the str
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Point stringExtent(String str) {
+    return textExtent(str, 0);
+}
+
+/**
+ * Returns the extent of the given str. Tab expansion and
+ * carriage return processing are performed.
+ * <p>
+ * The <em>extent</em> of a str is the width and height of
+ * the rectangular area it would cover if drawn in a particular
+ * font (in this case, the current font in the receiver).
+ * </p>
+ *
+ * @param str the str to measure
+ * @return a point containing the extent of the str
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Point textExtent(String str) {
+    return textExtent(str, SWT.DRAW_DELIMITER | SWT.DRAW_TAB);
+}
+
+/**
+ * Returns the extent of the given str. Tab expansion, line
+ * delimiter and mnemonic processing are performed according to
+ * the specified flags, which can be a combination of:
+ * <dl>
+ * <dt><b>DRAW_DELIMITER</b></dt>
+ * <dd>draw multiple lines</dd>
+ * <dt><b>DRAW_TAB</b></dt>
+ * <dd>expand tabs</dd>
+ * <dt><b>DRAW_MNEMONIC</b></dt>
+ * <dd>underline the mnemonic character</dd>
+ * <dt><b>DRAW_TRANSPARENT</b></dt>
+ * <dd>transparent background</dd>
+ * </dl>
+ * <p>
+ * The <em>extent</em> of a str is the width and height of
+ * the rectangular area it would cover if drawn in a particular
+ * font (in this case, the current font in the receiver).
+ * </p>
+ *
+ * @param str the str to measure
+ * @param flags the flags specifying how to process the text
+ * @return a point containing the extent of the str
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Point textExtent(String str, int flags) {
+    if (handle is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    //DWT_CHANGE: allow null for string
+    //if (str is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    auto cairo = data.cairo;
+    if (cairo !is null) {
+        if (OS.GTK_VERSION < OS.buildVERSION(2, 8, 0)) {
+            //TODO - honor flags
+            checkGC(FONT);
+            char* buffer = toStringz(str);
+            cairo_font_extents_t* font_extents = new cairo_font_extents_t();
+            Cairo.cairo_font_extents(cairo, font_extents);
+            cairo_text_extents_t* extents = new cairo_text_extents_t();
+            Cairo.cairo_text_extents(cairo, buffer, extents);
+            return new Point(cast(int)extents.width, cast(int)font_extents.height);
+        }
+    }
+    setString(str, flags);
+    checkGC(FONT);
+    if (data.stringWidth !is -1) return new Point(data.stringWidth, data.stringHeight);
+    int width, height;
+    OS.pango_layout_get_size(data.layout, &width, &height);
+    return new Point(data.stringWidth = OS.PANGO_PIXELS(width), data.stringHeight = OS.PANGO_PIXELS(height));
+}
+
+/**
+ * Returns a str containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a str representation of the receiver
+ */
+public override String toString () {
+    if (isDisposed()) return "GC {*DISPOSED*}";
+    return Format( "GC {{{}}", handle );
+}
+
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/GCData.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.GCData;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.Pattern;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Font;
+
+/**
+ * Instances of this class are descriptions of GCs in terms
+ * of unallocated platform-specific data fields.
+ * <p>
+ * <b>IMPORTANT:</b> This class is <em>not</em> part of the public
+ * API for SWT. It is marked public only so that it can be shared
+ * within the packages provided by SWT. It is not available on all
+ * platforms, and should never be called from application code.
+ * </p>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public final class GCData {
+    public Device device;
+    public int style, state = -1;
+    public GdkColor* foreground;
+    public GdkColor* background;
+    public Font font;
+    public Pattern foregroundPattern;
+    public Pattern backgroundPattern;
+    public GdkRegion* clipRgn;
+    public float lineWidth;
+    public int lineStyle = SWT.LINE_SOLID;
+    public float[] lineDashes;
+    public float lineDashesOffset;
+    public float lineMiterLimit = 10;
+    public int lineCap = SWT.CAP_FLAT;
+    public int lineJoin = SWT.JOIN_MITER;
+    public bool xorMode;
+    public int alpha = 0xFF;
+    public int interpolation = SWT.DEFAULT;
+
+    public PangoContext* context;
+    public PangoLayout* layout;
+    public GdkRegion* damageRgn;
+    public Image image;
+    public GdkDrawable* drawable;
+    public cairo_t* cairo;
+    public double cairoXoffset, cairoYoffset;
+    public bool disposeCairo;
+    public double[] clippingTransform;
+    public String str;
+    public int stringWidth = -1;
+    public int stringHeight = -1;
+    public int drawFlags;
+    public bool realDrawable;
+    public int width = -1, height = -1;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/GlyphMetrics.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.GlyphMetrics;
+
+import java.lang.all;
+
+import org.eclipse.swt.SWT;
+import tango.text.convert.Format;
+/**
+ * Instances of this class represent glyph metrics.
+ * <p>
+ * The hashCode() method in this class uses the values of the public
+ * fields to compute the hash value. When storing instances of the
+ * class in hashed collections, do not modify these fields after the
+ * object has been inserted.
+ * </p>
+ * <p>
+ * Application code does <em>not</em> need to explicitly release the
+ * resources managed by each instance when those instances are no longer
+ * required, and thus no <code>dispose()</code> method is provided.
+ * </p>
+ *
+ * @see TextStyle
+ * @see TextLayout
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.2
+ */
+public final class GlyphMetrics {
+
+    /**
+     * the ascent of the GlyphMetrics
+     */
+    public int ascent;
+
+    /**
+     * the descent of the GlyphMetrics
+     */
+    public int descent;
+
+    /**
+     * the width of the GlyphMetrics
+     */
+    public int width;
+
+/**
+ * Constructs an instance of this class with the given
+ * ascent, descent and width values.
+ *
+ * @param ascent the GlyphMetrics ascent
+ * @param descent the GlyphMetrics descent
+ * @param width the GlyphMetrics width
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the ascent, descent or width argument is negative</li>
+ * </ul>
+ */
+public this(int ascent, int descent, int width) {
+    if (ascent < 0 || descent < 0 || width < 0) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    this.ascent = ascent;
+    this.descent = descent;
+    this.width = width;
+}
+
+/**
+ * Compares the argument to the receiver, and returns true
+ * if they represent the <em>same</em> object using a class
+ * specific comparison.
+ *
+ * @param object the object to compare with this object
+ * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
+ *
+ * @see #hashCode()
+ */
+public override int opEquals (Object object) {
+    if (object is this) return true;
+    if (auto metrics = cast(GlyphMetrics)object ){
+       return metrics.ascent is ascent && metrics.descent is descent && metrics.width is width;
+    }
+    return false;
+}
+
+
+/**
+ * Returns an integer hash code for the receiver. Any two
+ * objects that return <code>true</code> when passed to
+ * <code>equals</code> must return the same value for this
+ * method.
+ *
+ * @return the receiver's hash
+ *
+ * @see #equals(Object)
+ */
+public override hash_t toHash () {
+    return ascent ^ descent ^ width;
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the <code>GlyphMetrics</code>
+ */
+public override String toString () {
+    return Format( "GlyphMetrics {{{}, {}, {}}", ascent, descent, width ); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Image.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,1185 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.Image;
+
+import org.eclipse.swt.internal.Converter;
+import org.eclipse.swt.internal.cairo.Cairo;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.Drawable;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.GCData;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.PaletteData;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.Resource;
+
+import java.io.InputStream;
+import java.lang.all;
+
+import tango.text.convert.Format;
+import tango.stdc.string;
+
+/**
+ * Instances of this class are graphics which have been prepared
+ * for display on a specific device. That is, they are ready
+ * to paint using methods such as <code>GC.drawImage()</code>
+ * and display on widgets with, for example, <code>Button.setImage()</code>.
+ * <p>
+ * If loaded from a file format that supports it, an
+ * <code>Image</code> may have transparency, meaning that certain
+ * pixels are specified as being transparent when drawn. Examples
+ * of file formats that support transparency are GIF and PNG.
+ * </p><p>
+ * There are two primary ways to use <code>Images</code>.
+ * The first is to load a graphic file from disk and create an
+ * <code>Image</code> from it. This is done using an <code>Image</code>
+ * constructor, for example:
+ * <pre>
+ *    Image i = new Image(device, "C:\\graphic.bmp");
+ * </pre>
+ * A graphic file may contain a color table specifying which
+ * colors the image was intended to possess. In the above example,
+ * these colors will be mapped to the closest available color in
+ * SWT. It is possible to get more control over the mapping of
+ * colors as the image is being created, using code of the form:
+ * <pre>
+ *    ImageData data = new ImageData("C:\\graphic.bmp");
+ *    RGB[] rgbs = data.getRGBs();
+ *    // At this point, rgbs contains specifications of all
+ *    // the colors contained within this image. You may
+ *    // allocate as many of these colors as you wish by
+ *    // using the Color constructor Color(RGB), then
+ *    // create the image:
+ *    Image i = new Image(device, data);
+ * </pre>
+ * <p>
+ * Applications which require even greater control over the image
+ * loading process should use the support provided in class
+ * <code>ImageLoader</code>.
+ * </p><p>
+ * Application code must explicitly invoke the <code>Image.dispose()</code>
+ * method to release the operating system resources managed by each instance
+ * when those instances are no longer required.
+ * </p>
+ *
+ * @see Color
+ * @see ImageData
+ * @see ImageLoader
+ * @see <a href="http://www.eclipse.org/swt/snippets/#image">Image snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Examples: GraphicsExample, ImageAnalyzer</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public final class Image : Resource, Drawable {
+    alias Resource.init_ init_;
+    /**
+     * specifies whether the receiver is a bitmap or an icon
+     * (one of <code>SWT.BITMAP</code>, <code>SWT.ICON</code>)
+     * <p>
+     * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+     * public API. 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 accessed from application code.
+     * </p>
+     */
+    public int type;
+
+    /**
+     * The handle to the OS pixmap resource.
+     * (Warning: This field is platform dependent)
+     * <p>
+     * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+     * public API. It is marked 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 accessed from application code.
+     * </p>
+     */
+    public GdkDrawable* pixmap;
+
+    /**
+     * The handle to the OS mask resource.
+     * (Warning: This field is platform dependent)
+     * <p>
+     * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+     * public API. It is marked 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 accessed from application code.
+     * </p>
+     */
+    public GdkDrawable* mask;
+
+    cairo_surface_t* surface;
+    cairo_surface_t* surfaceData;
+
+    /**
+     * specifies the transparent pixel
+     */
+    int transparentPixel = -1;
+
+    /**
+     * The GC the image is currently selected in.
+     */
+    GC memGC;
+
+    /**
+     * The alpha data of the image.
+     */
+    byte[] alphaData;
+
+    /**
+     * The global alpha value to be used for every pixel.
+     */
+    int alpha = -1;
+
+    /**
+     * The width of the image.
+     */
+    int width = -1;
+
+    /**
+     * The height of the image.
+     */
+    int height = -1;
+
+    /**
+     * Specifies the default scanline padding.
+     */
+    static const int DEFAULT_SCANLINE_PAD = 4;
+
+this(Device device) {
+    super(device);
+}
+
+/**
+ * Constructs an empty instance of this class with the
+ * specified width and height. The result may be drawn upon
+ * by creating a GC and using any of its drawing operations,
+ * as shown in the following example:
+ * <pre>
+ *    Image i = new Image(device, width, height);
+ *    GC gc = new GC(i);
+ *    gc.drawRectangle(0, 0, 50, 50);
+ *    gc.dispose();
+ * </pre>
+ * <p>
+ * Note: Some platforms may have a limitation on the size
+ * of image that can be created (size depends on width, height,
+ * and depth). For example, Windows 95, 98, and ME do not allow
+ * images larger than 16M.
+ * </p>
+ *
+ * @param device the device on which to create the image
+ * @param width the width of the new image
+ * @param height the height of the new image
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if either the width or height is negative or zero</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES if a handle could not be obtained for image creation</li>
+ * </ul>
+ */
+public this(Device device, int width, int height) {
+    super(device);
+    init_(width, height);
+    init_();
+}
+
+/**
+ * Constructs a new instance of this class based on the
+ * provided image, with an appearance that varies depending
+ * on the value of the flag. The possible flag values are:
+ * <dl>
+ * <dt><b>{@link SWT#IMAGE_COPY}</b></dt>
+ * <dd>the result is an identical copy of srcImage</dd>
+ * <dt><b>{@link SWT#IMAGE_DISABLE}</b></dt>
+ * <dd>the result is a copy of srcImage which has a <em>disabled</em> look</dd>
+ * <dt><b>{@link SWT#IMAGE_GRAY}</b></dt>
+ * <dd>the result is a copy of srcImage which has a <em>gray scale</em> look</dd>
+ * </dl>
+ *
+ * @param device the device on which to create the image
+ * @param srcImage the image to use as the source
+ * @param flag the style, either <code>IMAGE_COPY</code>, <code>IMAGE_DISABLE</code> or <code>IMAGE_GRAY</code>
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ *    <li>ERROR_NULL_ARGUMENT - if srcImage is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the flag is not one of <code>IMAGE_COPY</code>, <code>IMAGE_DISABLE</code> or <code>IMAGE_GRAY</code></li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_INVALID_IMAGE - if the image is not a bitmap or an icon, or is otherwise in an invalid state</li>
+ *    <li>ERROR_UNSUPPORTED_DEPTH - if the depth of the image is not supported</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES if a handle could not be obtained for image creation</li>
+ * </ul>
+ */
+public this(Device device, Image srcImage, int flag) {
+    super(device);
+    if (srcImage is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (srcImage.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    switch (flag) {
+        case SWT.IMAGE_COPY:
+        case SWT.IMAGE_DISABLE:
+        case SWT.IMAGE_GRAY:
+            break;
+        default:
+            SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    device = this.device;
+    this.type = srcImage.type;
+
+    /* Get source image size */
+    int w, h;
+    OS.gdk_drawable_get_size(srcImage.pixmap, &w, &h);
+    int width = w;
+    int height = h;
+
+    /* Copy the mask */
+    if ((srcImage.type is SWT.ICON && srcImage.mask !is null ) || srcImage.transparentPixel !is -1) {
+        /* Generate the mask if necessary. */
+        if (srcImage.transparentPixel !is -1) srcImage.createMask();
+        //PORTING_FIXME cast
+        GdkDrawable* mask = cast(GdkDrawable*) OS.gdk_pixmap_new( null, width, height, 1);
+        if (mask is null ) SWT.error(SWT.ERROR_NO_HANDLES);
+        auto gdkGC = OS.gdk_gc_new(mask);
+        if (gdkGC is null) SWT.error(SWT.ERROR_NO_HANDLES);
+        OS.gdk_draw_drawable(mask, gdkGC, srcImage.mask, 0, 0, 0, 0, width, height);
+        OS.g_object_unref(gdkGC);
+        this.mask = mask;
+        /* Destroy the image mask if the there is a GC created on the image */
+        if (srcImage.transparentPixel !is -1 && srcImage.memGC !is null) srcImage.destroyMask();
+    }
+
+    /* Copy transparent pixel and alpha data */
+    if (flag !is SWT.IMAGE_DISABLE) transparentPixel = srcImage.transparentPixel;
+    alpha = srcImage.alpha;
+    if (srcImage.alphaData !is null) {
+        alphaData = new byte[srcImage.alphaData.length];
+        System.arraycopy(srcImage.alphaData, 0, alphaData, 0, alphaData.length);
+    }
+    createAlphaMask(width, height);
+
+    /* Create the new pixmap */
+    auto pixmap = cast(GdkDrawable*) OS.gdk_pixmap_new (cast(GdkDrawable*)OS.GDK_ROOT_PARENT(), width, height, -1);
+    if (pixmap is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    auto gdkGC = OS.gdk_gc_new(pixmap);
+    if (gdkGC is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    this.pixmap = pixmap;
+
+    if (flag is SWT.IMAGE_COPY) {
+        OS.gdk_draw_drawable(pixmap, gdkGC, srcImage.pixmap, 0, 0, 0, 0, width, height);
+        OS.g_object_unref(gdkGC);
+    } else {
+
+        /* Retrieve the source pixmap data */
+        auto pixbuf = OS.gdk_pixbuf_new(OS.GDK_COLORSPACE_RGB, false, 8, width, height);
+        if (pixbuf is null) SWT.error(SWT.ERROR_NO_HANDLES);
+        auto colormap = OS.gdk_colormap_get_system();
+        OS.gdk_pixbuf_get_from_drawable(pixbuf, srcImage.pixmap, colormap, 0, 0, 0, 0, width, height);
+        int stride = OS.gdk_pixbuf_get_rowstride(pixbuf);
+        auto pixels = OS.gdk_pixbuf_get_pixels(pixbuf);
+
+        /* Apply transformation */
+        switch (flag) {
+            case SWT.IMAGE_DISABLE: {
+                Color zeroColor = device.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW);
+                RGB zeroRGB = zeroColor.getRGB();
+                byte zeroRed = cast(byte)zeroRGB.red;
+                byte zeroGreen = cast(byte)zeroRGB.green;
+                byte zeroBlue = cast(byte)zeroRGB.blue;
+                Color oneColor = device.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);
+                RGB oneRGB = oneColor.getRGB();
+                byte oneRed = cast(byte)oneRGB.red;
+                byte oneGreen = cast(byte)oneRGB.green;
+                byte oneBlue = cast(byte)oneRGB.blue;
+                byte[] line = new byte[stride];
+                for (int y=0; y<height; y++) {
+                    memmove(line.ptr, pixels + (y * stride), stride);
+                    for (int x=0; x<width; x++) {
+                        int offset = x*3;
+                        int red = line[offset] & 0xFF;
+                        int green = line[offset+1] & 0xFF;
+                        int blue = line[offset+2] & 0xFF;
+                        int intensity = red * red + green * green + blue * blue;
+                        if (intensity < 98304) {
+                            line[offset] = zeroRed;
+                            line[offset+1] = zeroGreen;
+                            line[offset+2] = zeroBlue;
+                        } else {
+                            line[offset] = oneRed;
+                            line[offset+1] = oneGreen;
+                            line[offset+2] = oneBlue;
+                        }
+                    }
+                    memmove(pixels + (y * stride), line.ptr, stride);
+                }
+                break;
+            }
+            case SWT.IMAGE_GRAY: {
+                byte[] line = new byte[stride];
+                for (int y=0; y<height; y++) {
+                memmove(line.ptr, pixels + (y * stride), stride);
+                    for (int x=0; x<width; x++) {
+                        int offset = x*3;
+                        int red = line[offset] & 0xFF;
+                        int green = line[offset+1] & 0xFF;
+                        int blue = line[offset+2] & 0xFF;
+                        byte intensity = cast(byte)((red+red+green+green+green+green+green+blue) >> 3);
+                        line[offset] = line[offset+1] = line[offset+2] = intensity;
+                    }
+                    memmove(pixels + (y * stride), line.ptr, stride);
+                }
+                break;
+            }
+        default:
+        }
+
+        /* Copy data back to destination pixmap */
+        OS.gdk_pixbuf_render_to_drawable(pixbuf, pixmap, gdkGC, 0, 0, 0, 0, width, height, OS.GDK_RGB_DITHER_NORMAL, 0, 0);
+
+        /* Free resources */
+        OS.g_object_unref(pixbuf);
+        OS.g_object_unref(gdkGC);
+    }
+    init_();
+}
+
+/**
+ * Constructs an empty instance of this class with the
+ * width and height of the specified rectangle. The result
+ * may be drawn upon by creating a GC and using any of its
+ * drawing operations, as shown in the following example:
+ * <pre>
+ *    Image i = new Image(device, boundsRectangle);
+ *    GC gc = new GC(i);
+ *    gc.drawRectangle(0, 0, 50, 50);
+ *    gc.dispose();
+ * </pre>
+ * <p>
+ * Note: Some platforms may have a limitation on the size
+ * of image that can be created (size depends on width, height,
+ * and depth). For example, Windows 95, 98, and ME do not allow
+ * images larger than 16M.
+ * </p>
+ *
+ * @param device the device on which to create the image
+ * @param bounds a rectangle specifying the image's width and height (must not be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ *    <li>ERROR_NULL_ARGUMENT - if the bounds rectangle is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if either the rectangle's width or height is negative</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES if a handle could not be obtained for image creation</li>
+ * </ul>
+ */
+public this(Device device, Rectangle bounds) {
+    super(device);
+    if (bounds is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    init_(bounds.width, bounds.height);
+    init_();
+}
+
+/**
+ * Constructs an instance of this class from the given
+ * <code>ImageData</code>.
+ *
+ * @param device the device on which to create the image
+ * @param data the image data to create the image from (must not be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ *    <li>ERROR_NULL_ARGUMENT - if the image data is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_UNSUPPORTED_DEPTH - if the depth of the ImageData is not supported</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES if a handle could not be obtained for image creation</li>
+ * </ul>
+ */
+public this(Device device, ImageData data) {
+    super(device);
+    init_(data);
+    init_();
+}
+
+/**
+ * Constructs an instance of this class, whose type is
+ * <code>SWT.ICON</code>, from the two given <code>ImageData</code>
+ * objects. The two images must be the same size. Pixel transparency
+ * in either image will be ignored.
+ * <p>
+ * The mask image should contain white wherever the icon is to be visible,
+ * and black wherever the icon is to be transparent. In addition,
+ * the source image should contain black wherever the icon is to be
+ * transparent.
+ * </p>
+ *
+ * @param device the device on which to create the icon
+ * @param source the color data for the icon
+ * @param mask the mask data for the icon
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ *    <li>ERROR_NULL_ARGUMENT - if either the source or mask is null </li>
+ *    <li>ERROR_INVALID_ARGUMENT - if source and mask are different sizes</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES if a handle could not be obtained for image creation</li>
+ * </ul>
+ */
+public this(Device device, ImageData source, ImageData mask) {
+    super(device);
+    if (source is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (mask is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (source.width !is mask.width || source.height !is mask.height) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    mask = ImageData.convertMask (mask);
+    ImageData image = new ImageData(source.width, source.height, source.depth, source.palette, source.scanlinePad, source.data);
+    image.maskPad = mask.scanlinePad;
+    image.maskData = mask.data;
+    init_(image);
+    init_();
+}
+
+/**
+ * Constructs an instance of this class by loading its representation
+ * from the specified input stream. Throws an error if an error
+ * occurs while loading the image, or if the result is an image
+ * of an unsupported type.  Application code is still responsible
+ * for closing the input stream.
+ * <p>
+ * This constructor is provided for convenience when loading a single
+ * image only. If the stream contains multiple images, only the first
+ * one will be loaded. To load multiple images, use
+ * <code>ImageLoader.load()</code>.
+ * </p><p>
+ * This constructor may be used to load a resource as follows:
+ * </p>
+ * <pre>
+ *     static Image loadImage (Display display, Class clazz, String string) {
+ *          InputStream stream = clazz.getResourceAsStream (string);
+ *          if (stream is null) return null;
+ *          Image image = null;
+ *          try {
+ *               image = new Image (display, stream);
+ *          } catch (SWTException ex) {
+ *          } finally {
+ *               try {
+ *                    stream.close ();
+ *               } catch (IOException ex) {}
+ *          }
+ *          return image;
+ *     }
+ * </pre>
+ *
+ * @param device the device on which to create the image
+ * @param stream the input stream to load the image from
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ *    <li>ERROR_NULL_ARGUMENT - if the stream is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_IO - if an IO error occurs while reading from the stream</li>
+ *    <li>ERROR_INVALID_IMAGE - if the image stream contains invalid data </li>
+ *    <li>ERROR_UNSUPPORTED_DEPTH - if the image stream describes an image with an unsupported depth</li>
+ *    <li>ERROR_UNSUPPORTED_FORMAT - if the image stream contains an unrecognized format</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES if a handle could not be obtained for image creation</li>
+ * </ul>
+ */
+public this(Device device, InputStream stream) {
+    super(device);
+    init_(new ImageData(stream));
+    init_();
+}
+
+/**
+ * Constructs an instance of this class by loading its representation
+ * from the file with the specified name. Throws an error if an error
+ * occurs while loading the image, or if the result is an image
+ * of an unsupported type.
+ * <p>
+ * This constructor is provided for convenience when loading
+ * a single image only. If the specified file contains
+ * multiple images, only the first one will be used.
+ *
+ * @param device the device on which to create the image
+ * @param filename the name of the file to load the image from
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ *    <li>ERROR_NULL_ARGUMENT - if the file name is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_IO - if an IO error occurs while reading from the file</li>
+ *    <li>ERROR_INVALID_IMAGE - if the image file contains invalid data </li>
+ *    <li>ERROR_UNSUPPORTED_DEPTH - if the image file describes an image with an unsupported depth</li>
+ *    <li>ERROR_UNSUPPORTED_FORMAT - if the image file contains an unrecognized format</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES if a handle could not be obtained for image creation</li>
+ * </ul>
+ */
+public this(Device device, String filename) {
+    super(device);
+    if (filename is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    try {
+        int length = filename.length;
+        auto pixbuf = OS.gdk_pixbuf_new_from_file(toStringz(filename), null);
+        if (pixbuf !is null) {
+            bool hasAlpha = cast(bool)OS.gdk_pixbuf_get_has_alpha(pixbuf);
+            if (hasAlpha) {
+                /*
+                * Bug in GTK. Depending on the image (seems to affect images that have
+                * some degree of transparency all over the image), gdk_pixbuff_render_pixmap_and_mask()
+                * will return a corrupt pixmap. To avoid this, read in and store the alpha channel data
+                * for the image and then set it to 0xFF to prevent any possible corruption from
+                * gdk_pixbuff_render_pixmap_and_mask().
+                */
+                int width = OS.gdk_pixbuf_get_width(pixbuf);
+                int height = OS.gdk_pixbuf_get_height(pixbuf);
+                int stride = OS.gdk_pixbuf_get_rowstride(pixbuf);
+                auto pixels = OS.gdk_pixbuf_get_pixels(pixbuf);
+                byte[] line = new byte[stride];
+                alphaData = new byte[width * height];
+                for (int y = 0; y < height; y++) {
+                    memmove(line.ptr, pixels + (y * stride), stride);
+                    for (int x = 0; x < width; x++) {
+                        alphaData[y*width+x] = line[x*4 + 3];
+                        line[x*4 + 3] = cast(byte) 0xFF;
+                    }
+                    memmove(pixels + (y * stride), line.ptr, stride);
+                }
+                createAlphaMask(width, height);
+            }
+            GdkPixmap* pixmap_return;
+            OS.gdk_pixbuf_render_pixmap_and_mask(pixbuf, &pixmap_return, null, 0);
+            this.type = SWT.BITMAP;
+            this.pixmap = cast(GdkDrawable*)pixmap_return;
+            if (pixmap is null) SWT.error(SWT.ERROR_NO_HANDLES);
+            OS.g_object_unref (pixbuf);
+            return;
+        }
+    } catch (SWTException e) {}
+    init_(new ImageData(filename));
+    init_();
+}
+
+void createAlphaMask (int width, int height) {
+    if (device.useXRender && (alpha !is -1 || alphaData !is null)) {
+        mask = cast(GdkDrawable*)OS.gdk_pixmap_new(null, alpha !is -1 ? 1 : width, alpha !is -1 ? 1 : height, 8);
+        if (mask is null) SWT.error(SWT.ERROR_NO_HANDLES);
+        auto gc = OS.gdk_gc_new(mask);
+        if (alpha !is -1) {
+            GdkColor* color = new GdkColor();
+            color.pixel = (alpha & 0xFF) << 8 | (alpha & 0xFF);
+            OS.gdk_gc_set_foreground(gc, color);
+            OS.gdk_draw_rectangle(mask, gc, 1, 0, 0, 1, 1);
+        } else {
+            GdkImage* imagePtr = OS.gdk_drawable_get_image(mask, 0, 0, width, height);
+            if (imagePtr is null) SWT.error(SWT.ERROR_NO_HANDLES);
+            GdkImage* gdkImage = new GdkImage();
+            *gdkImage = *imagePtr;
+            if (gdkImage.bpl is width) {
+                memmove(gdkImage.mem, alphaData.ptr, alphaData.length);
+            } else {
+                byte[] line = new byte[gdkImage.bpl];
+                for (int y = 0; y < height; y++) {
+                    System.arraycopy(alphaData, width * y, line, 0, width);
+                    memmove(gdkImage.mem + (gdkImage.bpl * y), line.ptr, gdkImage.bpl);
+                }
+            }
+            OS.gdk_draw_image(mask, gc, imagePtr, 0, 0, 0, 0, width, height);
+            OS.g_object_unref(imagePtr);
+        }
+        OS.g_object_unref(gc);
+    }
+}
+
+/**
+ * Create the receiver's mask if necessary.
+ */
+void createMask() {
+    if (mask !is null ) return;
+    mask = createMask(getImageData(), false);
+    if (mask is null ) SWT.error(SWT.ERROR_NO_HANDLES);
+}
+
+GdkDrawable* createMask(ImageData image, bool copy) {
+    ImageData mask = image.getTransparencyMask();
+    byte[] data = mask.data;
+    byte[] maskData = copy ? new byte[data.length] : data;
+    for (int i = 0; i < maskData.length; i++) {
+        byte s = data[i];
+        maskData[i] = cast(byte)(((s & 0x80) >> 7) | ((s & 0x40) >> 5) |
+            ((s & 0x20) >> 3) | ((s & 0x10) >> 1) | ((s & 0x08) << 1) |
+            ((s & 0x04) << 3) | ((s & 0x02) << 5) | ((s & 0x01) << 7));
+    }
+    maskData = ImageData.convertPad(maskData, mask.width, mask.height, mask.depth, mask.scanlinePad, 1);
+    return cast(GdkDrawable*)OS.gdk_bitmap_create_from_data(null, cast(char*)maskData.ptr, mask.width, mask.height);
+}
+
+void createSurface() {
+    if (surface !is null ) return;
+    /* Generate the mask if necessary. */
+    if (transparentPixel !is -1) createMask();
+    int w, h;
+    OS.gdk_drawable_get_size(pixmap, &w, &h);
+    int width = w, height = h;
+    if (mask !is null || alpha !is -1 || alphaData !is null) {
+        auto pixbuf = OS.gdk_pixbuf_new( OS.GDK_COLORSPACE_RGB, true, 8, width, height);
+        if (pixbuf is null) SWT.error(SWT.ERROR_NO_HANDLES);
+        auto colormap = OS.gdk_colormap_get_system();
+        OS.gdk_pixbuf_get_from_drawable(pixbuf, pixmap, colormap, 0, 0, 0, 0, width, height);
+        int stride = OS.gdk_pixbuf_get_rowstride(pixbuf);
+        auto pixels = OS.gdk_pixbuf_get_pixels(pixbuf);
+        byte[] line = new byte[stride];
+        if (mask !is null && OS.gdk_drawable_get_depth(mask) is 1) {
+            auto maskPixbuf = OS.gdk_pixbuf_new(OS.GDK_COLORSPACE_RGB, false, 8, width, height);
+            if (maskPixbuf is null) SWT.error(SWT.ERROR_NO_HANDLES);
+            OS.gdk_pixbuf_get_from_drawable(maskPixbuf, mask, null, 0, 0, 0, 0, width, height);
+            int maskStride = OS.gdk_pixbuf_get_rowstride(maskPixbuf);
+            auto maskPixels = OS.gdk_pixbuf_get_pixels(maskPixbuf);
+            byte[] maskLine = new byte[maskStride];
+            auto offset = pixels, maskOffset = maskPixels;
+            for (int y=0; y<height; y++) {
+                memmove(line.ptr, offset, stride);
+                memmove(maskLine.ptr, maskOffset, maskStride);
+                for (int x=0, offset1=0; x<width; x++, offset1 += 4) {
+                    if (maskLine[x * 3] is 0) {
+                        line[offset1 + 0] = line[offset1 + 1] = line[offset1 + 2] = line[offset1 + 3] = 0;
+                    }
+                    byte temp = line[offset1];
+                    line[offset1] = line[offset1 + 2];
+                    line[offset1 + 2] = temp;
+                }
+                memmove(offset, line.ptr, stride);
+                offset += stride;
+                maskOffset += maskStride;
+            }
+            OS.g_object_unref(maskPixbuf);
+        } else if (alpha !is -1) {
+            auto offset = pixels;
+            for (int y=0; y<height; y++) {
+                memmove(line.ptr, offset, stride);
+                for (int x=0, offset1=0; x<width; x++, offset1 += 4) {
+                    line[offset1+3] = cast(byte)alpha;
+                    /* pre-multiplied alpha */
+                    int r = ((line[offset1 + 0] & 0xFF) * alpha) + 128;
+                    r = (r + (r >> 8)) >> 8;
+                    int g = ((line[offset1 + 1] & 0xFF) * alpha) + 128;
+                    g = (g + (g >> 8)) >> 8;
+                    int b = ((line[offset1 + 2] & 0xFF) * alpha) + 128;
+                    b = (b + (b >> 8)) >> 8;
+                    line[offset1 + 0] = cast(byte)b;
+                    line[offset1 + 1] = cast(byte)g;
+                    line[offset1 + 2] = cast(byte)r;
+                }
+                memmove(offset, line.ptr, stride);
+                offset += stride;
+            }
+        } else if (alphaData !is null) {
+            auto offset = pixels;
+            for (int y = 0; y < h; y++) {
+                memmove (line.ptr, offset, stride);
+                for (int x=0, offset1=0; x<width; x++, offset1 += 4) {
+                    int alpha = alphaData [y*w+x] & 0xFF;
+                    line[offset1+3] = cast(byte)alpha;
+                    /* pre-multiplied alpha */
+                    int r = ((line[offset1 + 0] & 0xFF) * alpha) + 128;
+                    r = (r + (r >> 8)) >> 8;
+                    int g = ((line[offset1 + 1] & 0xFF) * alpha) + 128;
+                    g = (g + (g >> 8)) >> 8;
+                    int b = ((line[offset1 + 2] & 0xFF) * alpha) + 128;
+                    b = (b + (b >> 8)) >> 8;
+                    line[offset1 + 0] = cast(byte)b;
+                    line[offset1 + 1] = cast(byte)g;
+                    line[offset1 + 2] = cast(byte)r;
+                }
+                memmove (offset, line.ptr, stride);
+                offset += stride;
+            }
+        } else {
+            auto offset = pixels;
+            for (int y = 0; y < h; y++) {
+                memmove (line.ptr, offset, stride);
+                for (int x=0, offset1=0; x<width; x++, offset1 += 4) {
+                    line[offset1+3] = cast(byte)0xFF;
+                    byte temp = line[offset1];
+                    line[offset1] = line[offset1 + 2];
+                    line[offset1 + 2] = temp;
+                }
+                memmove (offset, line.ptr, stride);
+                offset += stride;
+            }
+        }
+        surfaceData = cast(cairo_surface_t*) OS.g_malloc(stride * height);
+        memmove(surfaceData, pixels, stride * height);
+        surface = Cairo.cairo_image_surface_create_for_data(cast(char*)surfaceData, Cairo.CAIRO_FORMAT_ARGB32, width, height, stride);
+        OS.g_object_unref(pixbuf);
+    } else {
+        auto xDisplay = OS.GDK_DISPLAY();
+        auto xDrawable = OS.GDK_PIXMAP_XID(pixmap);
+        auto xVisual = OS.gdk_x11_visual_get_xvisual(OS.gdk_visual_get_system());
+        // PORTING_FIXME  cast and types not good
+        surface = Cairo.cairo_xlib_surface_create(cast(void*)xDisplay, xDrawable, xVisual, width, height);
+    }
+    /* Destroy the image mask if the there is a GC created on the image */
+    if (transparentPixel !is -1 && memGC !is null) destroyMask();
+}
+
+/**
+ * Destroy the receiver's mask if it exists.
+ */
+void destroyMask() {
+    if (mask is null) return;
+    OS.g_object_unref(mask);
+    mask = null;
+}
+
+void destroy() {
+    if (memGC !is null) memGC.dispose();
+    if (pixmap !is null) OS.g_object_unref(pixmap);
+    if (mask !is null) OS.g_object_unref(mask);
+    if (surface !is null) Cairo.cairo_surface_destroy(surface);
+    if (surfaceData !is null) OS.g_free(surfaceData);
+    surfaceData = null;
+    surface = null;
+    pixmap = null;
+    mask = null;
+    memGC = null;
+}
+
+/**
+ * Compares the argument to the receiver, and returns true
+ * if they represent the <em>same</em> object using a class
+ * specific comparison.
+ *
+ * @param object the object to compare with this object
+ * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
+ *
+ * @see #hashCode
+ */
+public override int opEquals (Object object) {
+    if (object is this) return true;
+    if ( auto image = cast(Image)object ){
+        return device is image.device && pixmap is image.pixmap;
+    }
+    return false;
+}
+
+/**
+ * Returns the color to which to map the transparent pixel, or null if
+ * the receiver has no transparent pixel.
+ * <p>
+ * There are certain uses of Images that do not support transparency
+ * (for example, setting an image into a button or label). In these cases,
+ * it may be desired to simulate transparency by using the background
+ * color of the widget to paint the transparent pixels of the image.
+ * Use this method to check which color will be used in these cases
+ * in place of transparency. This value may be set with setBackground().
+ * <p>
+ *
+ * @return the background color of the image, or null if there is no transparency in the image
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Color getBackground() {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (transparentPixel is -1) return null;
+    //NOT DONE
+    return null;
+}
+
+/**
+ * Returns the bounds of the receiver. The rectangle will always
+ * have x and y values of 0, and the width and height of the
+ * image.
+ *
+ * @return a rectangle specifying the image's bounds
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_INVALID_IMAGE - if the image is not a bitmap or an icon</li>
+ * </ul>
+ */
+public Rectangle getBounds() {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (width !is -1 && height !is -1) {
+        return new Rectangle(0, 0, width, height);
+    }
+    int w; int h;
+    OS.gdk_drawable_get_size(pixmap, &w, &h);
+    return new Rectangle(0, 0, width = w, height = h);
+}
+
+/**
+ * Returns an <code>ImageData</code> based on the receiver
+ * Modifications made to this <code>ImageData</code> will not
+ * affect the Image.
+ *
+ * @return an <code>ImageData</code> containing the image's data and attributes
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_INVALID_IMAGE - if the image is not a bitmap or an icon</li>
+ * </ul>
+ *
+ * @see ImageData
+ */
+public ImageData getImageData() {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+
+    int w, h;
+    OS.gdk_drawable_get_size(pixmap, &w, &h);
+    int width = w, height = h;
+    auto pixbuf = OS.gdk_pixbuf_new(OS.GDK_COLORSPACE_RGB, false, 8, width, height);
+    if (pixbuf is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    auto colormap = OS.gdk_colormap_get_system();
+    OS.gdk_pixbuf_get_from_drawable(pixbuf, pixmap, colormap, 0, 0, 0, 0, width, height);
+    int stride = OS.gdk_pixbuf_get_rowstride(pixbuf);
+    auto pixels = OS.gdk_pixbuf_get_pixels(pixbuf);
+    byte[] srcData = new byte[stride * height];
+    memmove(srcData.ptr, pixels, srcData.length);
+    OS.g_object_unref(pixbuf);
+
+    PaletteData palette = new PaletteData(0xFF0000, 0xFF00, 0xFF);
+    ImageData data = new ImageData(width, height, 24, palette);
+    data.data = srcData;
+    data.bytesPerLine = stride;
+
+    if (transparentPixel is -1 && type is SWT.ICON && mask !is null) {
+        /* Get the icon mask data */
+        auto gdkImagePtr = OS.gdk_drawable_get_image(mask, 0, 0, width, height);
+        if (gdkImagePtr is null) SWT.error(SWT.ERROR_NO_HANDLES);
+        GdkImage* gdkImage = new GdkImage();
+        memmove(gdkImage, gdkImagePtr, GdkImage.sizeof );
+        byte[] maskData = new byte[gdkImage.bpl * gdkImage.height];
+        memmove(maskData.ptr, gdkImage.mem, maskData.length);
+        OS.g_object_unref(gdkImagePtr);
+        int maskPad;
+        for (maskPad = 1; maskPad < 128; maskPad++) {
+            int bpl = (((width + 7) / 8) + (maskPad - 1)) / maskPad * maskPad;
+            if (gdkImage.bpl is bpl) break;
+        }
+        /* Make mask scanline pad equals to 2 */
+        data.maskPad = 2;
+        maskData = ImageData.convertPad(maskData, width, height, 1, maskPad, data.maskPad);
+        /* Bit swap the mask data if necessary */
+        if (gdkImage.byte_order is OS.GDK_LSB_FIRST) {
+            for (int i = 0; i < maskData.length; i++) {
+                byte b = maskData[i];
+                maskData[i] = cast(byte)(((b & 0x01) << 7) | ((b & 0x02) << 5) |
+                    ((b & 0x04) << 3) | ((b & 0x08) << 1) | ((b & 0x10) >> 1) |
+                    ((b & 0x20) >> 3) | ((b & 0x40) >> 5) | ((b & 0x80) >> 7));
+            }
+        }
+        data.maskData = maskData;
+    }
+    data.transparentPixel = transparentPixel;
+    data.alpha = alpha;
+    if (alpha is -1 && alphaData !is null) {
+        data.alphaData = new byte[alphaData.length];
+        System.arraycopy(alphaData, 0, data.alphaData, 0, alphaData.length);
+    }
+    return data;
+}
+
+/**
+ * Invokes platform specific functionality to allocate a new image.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Image</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param device the device on which to allocate the color
+ * @param type the type of the image (<code>SWT.BITMAP</code> or <code>SWT.ICON</code>)
+ * @param pixmap the OS handle for the image
+ * @param mask the OS handle for the image mask
+ *
+ * @private
+ */
+public static Image gtk_new(Device device, int type, GdkDrawable* pixmap, GdkDrawable* mask) {
+    Image image = new Image(device);
+    image.type = type;
+    image.pixmap = cast(GdkDrawable*)pixmap;
+    image.mask = cast(GdkDrawable*)mask;
+    return image;
+}
+
+/**
+ * Returns an integer hash code for the receiver. Any two
+ * objects that return <code>true</code> when passed to
+ * <code>equals</code> must return the same value for this
+ * method.
+ *
+ * @return the receiver's hash
+ *
+ * @see #equals
+ */
+public override hash_t toHash () {
+    return cast(hash_t)/*64*/pixmap;
+}
+
+void init_(int width, int height) {
+    if (width <= 0 || height <= 0) {
+        SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+    }
+    this.type = SWT.BITMAP;
+
+    /* Create the pixmap */
+    this.pixmap = cast(GdkDrawable*) OS.gdk_pixmap_new(cast(GdkDrawable*)OS.GDK_ROOT_PARENT(), width, height, -1);
+    if (pixmap is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    /* Fill the bitmap with white */
+    GdkColor* white = new GdkColor();
+    white.red = 0xFFFF;
+    white.green = 0xFFFF;
+    white.blue = 0xFFFF;
+    auto colormap = OS.gdk_colormap_get_system();
+    OS.gdk_colormap_alloc_color(colormap, white, true, true);
+    auto gdkGC = OS.gdk_gc_new(pixmap);
+    OS.gdk_gc_set_foreground(gdkGC, white);
+    OS.gdk_draw_rectangle(pixmap, gdkGC, 1, 0, 0, width, height);
+    OS.g_object_unref(gdkGC);
+    OS.gdk_colormap_free_colors(colormap, white, 1);
+}
+
+void init_(ImageData image) {
+    if (image is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    int width = image.width;
+    int height = image.height;
+    PaletteData palette = image.palette;
+    if (!(((image.depth is 1 || image.depth is 2 || image.depth is 4 || image.depth is 8) && !palette.isDirect) ||
+        ((image.depth is 8) || (image.depth is 16 || image.depth is 24 || image.depth is 32) && palette.isDirect)))
+            SWT.error (SWT.ERROR_UNSUPPORTED_DEPTH);
+    auto pixbuf = OS.gdk_pixbuf_new( OS.GDK_COLORSPACE_RGB, false, 8, width, height);
+    if (pixbuf is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    int stride = OS.gdk_pixbuf_get_rowstride(pixbuf);
+    auto data = OS.gdk_pixbuf_get_pixels(pixbuf);
+    byte[] buffer = image.data;
+    if (!palette.isDirect || image.depth !is 24 || stride !is image.bytesPerLine || palette.redMask !is 0xFF0000 || palette.greenMask !is 0xFF00 || palette.blueMask !is 0xFF) {
+        buffer = new byte[stride * height];
+        if (palette.isDirect) {
+            ImageData.blit(ImageData.BLIT_SRC,
+                image.data, image.depth, image.bytesPerLine, image.getByteOrder(), 0, 0, width, height, palette.redMask, palette.greenMask, palette.blueMask,
+                ImageData.ALPHA_OPAQUE, null, 0, 0, 0,
+                buffer, 24, stride, ImageData.MSB_FIRST, 0, 0, width, height, 0xFF0000, 0xFF00, 0xFF,
+                false, false);
+        } else {
+            RGB[] rgbs = palette.getRGBs();
+            int length = rgbs.length;
+            byte[] srcReds = new byte[length];
+            byte[] srcGreens = new byte[length];
+            byte[] srcBlues = new byte[length];
+            for (int i = 0; i < rgbs.length; i++) {
+                RGB rgb = rgbs[i];
+                if (rgb is null) continue;
+                srcReds[i] = cast(byte)rgb.red;
+                srcGreens[i] = cast(byte)rgb.green;
+                srcBlues[i] = cast(byte)rgb.blue;
+            }
+            ImageData.blit(ImageData.BLIT_SRC,
+                image.data, image.depth, image.bytesPerLine, image.getByteOrder(), 0, 0, width, height, srcReds, srcGreens, srcBlues,
+                ImageData.ALPHA_OPAQUE, null, 0, 0, 0,
+                buffer, 24, stride, ImageData.MSB_FIRST, 0, 0, width, height, 0xFF0000, 0xFF00, 0xFF,
+                false, false);
+        }
+    }
+    memmove(data, buffer.ptr, stride * height);
+    auto pixmap = cast(GdkDrawable*) OS.gdk_pixmap_new (cast(GdkDrawable*) OS.GDK_ROOT_PARENT(), width, height, -1);
+    if (pixmap is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    auto gdkGC = OS.gdk_gc_new(pixmap);
+    if (gdkGC is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    OS.gdk_pixbuf_render_to_drawable(pixbuf, pixmap, gdkGC, 0, 0, 0, 0, width, height, OS.GDK_RGB_DITHER_NORMAL, 0, 0);
+    OS.g_object_unref(gdkGC);
+    OS.g_object_unref(pixbuf);
+
+    bool isIcon = image.getTransparencyType() is SWT.TRANSPARENCY_MASK;
+    if (isIcon || image.transparentPixel !is -1) {
+        if (image.transparentPixel !is -1) {
+            RGB rgb = null;
+            if (palette.isDirect) {
+                rgb = palette.getRGB(image.transparentPixel);
+            } else {
+                if (image.transparentPixel < palette.colors.length) {
+                    rgb = palette.getRGB(image.transparentPixel);
+                }
+            }
+            if (rgb !is null) {
+                transparentPixel = rgb.red << 16 | rgb.green << 8 | rgb.blue;
+            }
+        }
+        auto mask = createMask(image, isIcon);
+        if (mask is null) SWT.error(SWT.ERROR_NO_HANDLES);
+        this.mask = mask;
+        if (isIcon) {
+            this.type = SWT.ICON;
+        } else {
+            this.type = SWT.BITMAP;
+        }
+    } else {
+        this.type = SWT.BITMAP;
+        this.mask = null;
+        this.alpha = image.alpha;
+        if (image.alpha is -1 && image.alphaData !is null) {
+            this.alphaData = new byte[image.alphaData.length];
+            System.arraycopy(image.alphaData, 0, this.alphaData, 0, alphaData.length);
+        }
+        createAlphaMask(width, height);
+    }
+    this.pixmap = pixmap;
+}
+
+/**
+ * Invokes platform specific functionality to allocate a new GC handle.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Image</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param data the platform specific GC data
+ * @return the platform specific GC handle
+ */
+public GdkGC* internal_new_GC (GCData data) {
+    if (pixmap is null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (type !is SWT.BITMAP || memGC !is null) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    auto gdkGC = OS.gdk_gc_new(pixmap);
+    if (data !is null) {
+        int mask = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
+        if ((data.style & mask) is 0) {
+            data.style |= SWT.LEFT_TO_RIGHT;
+        } else {
+            if ((data.style & SWT.RIGHT_TO_LEFT) !is 0) {
+                data.style |= SWT.MIRRORED;
+            }
+        }
+        data.device = device;
+        data.drawable = pixmap;
+        data.background = device.COLOR_WHITE.handle;
+        data.foreground = device.COLOR_BLACK.handle;
+        data.font = device.systemFont;
+        data.image = this;
+    }
+    return gdkGC;
+}
+
+/**
+ * Invokes platform specific functionality to dispose a GC handle.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Image</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param hDC the platform specific GC handle
+ * @param data the platform specific GC data
+ */
+public void internal_dispose_GC ( GdkGC* gdkGC, GCData data) {
+    OS.g_object_unref(gdkGC);
+}
+
+/**
+ * Returns <code>true</code> if the image has been disposed,
+ * and <code>false</code> otherwise.
+ * <p>
+ * This method gets the dispose state for the image.
+ * When an image has been disposed, it is an error to
+ * invoke any other method using the image.
+ *
+ * @return <code>true</code> when the image is disposed and <code>false</code> otherwise
+ */
+public override bool isDisposed() {
+    return pixmap is null;
+}
+
+/**
+ * Sets the color to which to map the transparent pixel.
+ * <p>
+ * There are certain uses of <code>Images</code> that do not support
+ * transparency (for example, setting an image into a button or label).
+ * In these cases, it may be desired to simulate transparency by using
+ * the background color of the widget to paint the transparent pixels
+ * of the image. This method specifies the color that will be used in
+ * these cases. For example:
+ * <pre>
+ *    Button b = new Button();
+ *    image.setBackground(b.getBackground());
+ *    b.setImage(image);
+ * </pre>
+ * </p><p>
+ * The image may be modified by this operation (in effect, the
+ * transparent regions may be filled with the supplied color).  Hence
+ * this operation is not reversible and it is not legal to call
+ * this function twice or with a null argument.
+ * </p><p>
+ * This method has no effect if the receiver does not have a transparent
+ * pixel value.
+ * </p>
+ *
+ * @param color the color to use when a transparent pixel is specified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the color is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the color has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setBackground(Color color) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (color is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (color.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    if (transparentPixel is -1) return;
+    //NOT DONE
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the receiver
+ */
+public override String toString () {
+    if (isDisposed()) return "Image {*DISPOSED*}";
+    return Format( "Image {{{}}", pixmap);
+}
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/ImageData.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,3675 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.ImageData;
+
+
+import org.eclipse.swt.graphics.PaletteData;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.ImageDataLoader;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.CloneableCompatibility;
+import java.lang.all;
+
+public import java.io.InputStream;
+
+
+/**
+ * Instances of this class are device-independent descriptions
+ * of images. They are typically used as an intermediate format
+ * between loading from or writing to streams and creating an
+ * <code>Image</code>.
+ * <p>
+ * Note that the public fields <code>x</code>, <code>y</code>,
+ * <code>disposalMethod</code> and <code>delayTime</code> are
+ * typically only used when the image is in a set of images used
+ * for animation.
+ * </p>
+ *
+ * @see Image
+ * @see ImageLoader
+ * @see <a href="http://www.eclipse.org/swt/snippets/#image">ImageData snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ImageAnalyzer</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public final class ImageData : CloneableCompatibility {
+
+    /**
+     * The width of the image, in pixels.
+     */
+    public int width;
+
+    /**
+     * The height of the image, in pixels.
+     */
+    public int height;
+
+    /**
+     * The color depth of the image, in bits per pixel.
+     * <p>
+     * Note that a depth of 8 or less does not necessarily
+     * mean that the image is palette indexed, or
+     * conversely that a depth greater than 8 means that
+     * the image is direct color.  Check the associated
+     * PaletteData's isDirect field for such determinations.
+     */
+    public int depth;
+
+    /**
+     * The scanline padding.
+     * <p>
+     * If one scanline of the image is not a multiple of
+     * this number, it will be padded with zeros until it is.
+     * </p>
+     */
+    public int scanlinePad;
+
+    /**
+     * The number of bytes per scanline.
+     * <p>
+     * This is a multiple of the scanline padding.
+     * </p>
+     */
+    public int bytesPerLine;
+
+    /**
+     * The pixel data of the image.
+     * <p>
+     * Note that for 16 bit depth images the pixel data is stored
+     * in least significant byte order; however, for 24bit and
+     * 32bit depth images the pixel data is stored in most
+     * significant byte order.
+     * </p>
+     */
+    public byte[] data;
+
+    /**
+     * The color table for the image.
+     */
+    public PaletteData palette;
+
+    /**
+     * The transparent pixel.
+     * <p>
+     * Pixels with this value are transparent.
+     * </p><p>
+     * The default is -1 which means 'no transparent pixel'.
+     * </p>
+     */
+    public int transparentPixel;
+
+    /**
+     * An icon-specific field containing the data from the icon mask.
+     * <p>
+     * This is a 1 bit bitmap stored with the most significant
+     * bit first.  The number of bytes per scanline is
+     * '((width + 7) / 8 + (maskPad - 1)) / maskPad * maskPad'.
+     * </p><p>
+     * The default is null which means 'no transparency mask'.
+     * </p>
+     */
+    public byte[] maskData;
+
+    /**
+     * An icon-specific field containing the scanline pad of the mask.
+     * <p>
+     * If one scanline of the transparency mask is not a
+     * multiple of this number, it will be padded with zeros until
+     * it is.
+     * </p>
+     */
+    public int maskPad;
+
+    /**
+     * The alpha data of the image.
+     * <p>
+     * Every pixel can have an <em>alpha blending</em> value that
+     * varies from 0, meaning fully transparent, to 255 meaning
+     * fully opaque.  The number of bytes per scanline is
+     * 'width'.
+     * </p>
+     */
+    public byte[] alphaData;
+
+    /**
+     * The global alpha value to be used for every pixel.
+     * <p>
+     * If this value is set, the <code>alphaData</code> field
+     * is ignored and when the image is rendered each pixel
+     * will be blended with the background an amount
+     * proportional to this value.
+     * </p><p>
+     * The default is -1 which means 'no global alpha value'
+     * </p>
+     */
+    public int alpha;
+
+    /**
+     * The type of file from which the image was read.
+     *
+     * It is expressed as one of the following values:
+     * <dl>
+     * <dt><code>IMAGE_BMP</code></dt>
+     * <dd>Windows BMP file format, no compression</dd>
+     * <dt><code>IMAGE_BMP_RLE</code></dt>
+     * <dd>Windows BMP file format, RLE compression if appropriate</dd>
+     * <dt><code>IMAGE_GIF</code></dt>
+     * <dd>GIF file format</dd>
+     * <dt><code>IMAGE_ICO</code></dt>
+     * <dd>Windows ICO file format</dd>
+     * <dt><code>IMAGE_JPEG</code></dt>
+     * <dd>JPEG file format</dd>
+     * <dt><code>IMAGE_PNG</code></dt>
+     * <dd>PNG file format</dd>
+     * </dl>
+     */
+    public int type;
+
+    /**
+     * The x coordinate of the top left corner of the image
+     * within the logical screen (this field corresponds to
+     * the GIF89a Image Left Position value).
+     */
+    public int x;
+
+    /**
+     * The y coordinate of the top left corner of the image
+     * within the logical screen (this field corresponds to
+     * the GIF89a Image Top Position value).
+     */
+    public int y;
+
+    /**
+     * A description of how to dispose of the current image
+     * before displaying the next.
+     *
+     * It is expressed as one of the following values:
+     * <dl>
+     * <dt><code>DM_UNSPECIFIED</code></dt>
+     * <dd>disposal method not specified</dd>
+     * <dt><code>DM_FILL_NONE</code></dt>
+     * <dd>do nothing - leave the image in place</dd>
+     * <dt><code>DM_FILL_BACKGROUND</code></dt>
+     * <dd>fill with the background color</dd>
+     * <dt><code>DM_FILL_PREVIOUS</code></dt>
+     * <dd>restore the previous picture</dd>
+     * </dl>
+     * (this field corresponds to the GIF89a Disposal Method value)
+     */
+    public int disposalMethod;
+
+    /**
+     * The time to delay before displaying the next image
+     * in an animation (this field corresponds to the GIF89a
+     * Delay Time value).
+     */
+    public int delayTime;
+
+    /**
+     * Arbitrary channel width data to 8-bit conversion table.
+     */
+    private static byte[][] ANY_TO_EIGHT;
+    private static byte[] ONE_TO_ONE_MAPPING;
+
+    private static bool static_this_completed = false;
+    private static void static_this() {
+        if( static_this_completed ) return;
+        synchronized {
+            if( static_this_completed ) return;
+            ANY_TO_EIGHT = new byte[][](9);
+            for (int b = 0; b < 9; ++b) {
+                byte[] data = ANY_TO_EIGHT[b] = new byte[1 << b];
+                if (b is 0) continue;
+                int inc = 0;
+                for (int bit = 0x10000; (bit >>= b) !is 0;) inc |= bit;
+                for (int v = 0, p = 0; v < 0x10000; v+= inc) data[p++] = cast(byte)(v >> 8);
+            }
+            ONE_TO_ONE_MAPPING = ANY_TO_EIGHT[8];
+            static_this_completed = true;
+        }
+    }
+
+    /**
+     * Scaled 8x8 Bayer dither matrix.
+     */
+    static const int[][] DITHER_MATRIX = [
+        [ 0xfc0000, 0x7c0000, 0xdc0000, 0x5c0000, 0xf40000, 0x740000, 0xd40000, 0x540000 ],
+        [ 0x3c0000, 0xbc0000, 0x1c0000, 0x9c0000, 0x340000, 0xb40000, 0x140000, 0x940000 ],
+        [ 0xcc0000, 0x4c0000, 0xec0000, 0x6c0000, 0xc40000, 0x440000, 0xe40000, 0x640000 ],
+        [ 0x0c0000, 0x8c0000, 0x2c0000, 0xac0000, 0x040000, 0x840000, 0x240000, 0xa40000 ],
+        [ 0xf00000, 0x700000, 0xd00000, 0x500000, 0xf80000, 0x780000, 0xd80000, 0x580000 ],
+        [ 0x300000, 0xb00000, 0x100000, 0x900000, 0x380000, 0xb80000, 0x180000, 0x980000 ],
+        [ 0xc00000, 0x400000, 0xe00000, 0x600000, 0xc80000, 0x480000, 0xe80000, 0x680000 ],
+        [ 0x000000, 0x800000, 0x200000, 0xa00000, 0x080000, 0x880000, 0x280000, 0xa80000 ]
+    ];
+
+/**
+ * Constructs a new, empty ImageData with the given width, height,
+ * depth and palette. The data will be initialized to an (all zero)
+ * array of the appropriate size.
+ *
+ * @param width the width of the image
+ * @param height the height of the image
+ * @param depth the depth of the image
+ * @param palette the palette of the image (must not be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the width or height is negative, or if the depth is not
+ *          one of 1, 2, 4, 8, 16, 24 or 32</li>
+ *    <li>ERROR_NULL_ARGUMENT - if the palette is null</li>
+ * </ul>
+ */
+public this(int width, int height, int depth, PaletteData palette) {
+    this(width, height, depth, palette,
+        4, null, 0, null,
+        null, -1, -1, SWT.IMAGE_UNDEFINED,
+        0, 0, 0, 0);
+}
+
+/**
+ * Constructs a new, empty ImageData with the given width, height,
+ * depth, palette, scanlinePad and data.
+ *
+ * @param width the width of the image
+ * @param height the height of the image
+ * @param depth the depth of the image
+ * @param palette the palette of the image
+ * @param scanlinePad the padding of each line, in bytes
+ * @param data the data of the image
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the width or height is negative, or if the depth is not
+ *          one of 1, 2, 4, 8, 16, 24 or 32, or the data array is too small to contain the image data</li>
+ *    <li>ERROR_NULL_ARGUMENT - if the palette or data is null</li>
+ *    <li>ERROR_CANNOT_BE_ZERO - if the scanlinePad is zero</li>
+ * </ul>
+ */
+public this(int width, int height, int depth, PaletteData palette, int scanlinePad, byte[] data) {
+    this(width, height, depth, palette,
+        scanlinePad, checkData(data), 0, null,
+        null, -1, -1, SWT.IMAGE_UNDEFINED,
+        0, 0, 0, 0);
+}
+
+/**
+ * Constructs an <code>ImageData</code> loaded from the specified
+ * input stream. Throws an error if an error occurs while loading
+ * the image, or if the image has an unsupported type.  Application
+ * code is still responsible for closing the input stream.
+ * <p>
+ * This constructor is provided for convenience when loading a single
+ * image only. If the stream contains multiple images, only the first
+ * one will be loaded. To load multiple images, use
+ * <code>ImageLoader.load()</code>.
+ * </p><p>
+ * This constructor may be used to load a resource as follows:
+ * </p>
+ * <pre>
+ *     static ImageData loadImageData (Class clazz, String string) {
+ *          InputStream stream = clazz.getResourceAsStream (string);
+ *          if (stream is null) return null;
+ *          ImageData imageData = null;
+ *          try {
+ *               imageData = new ImageData (stream);
+ *          } catch (SWTException ex) {
+ *          } finally {
+ *               try {
+ *                    stream.close ();
+ *               } catch (IOException ex) {}
+ *          }
+ *          return imageData;
+ *     }
+ * </pre>
+ *
+ * @param stream the input stream to load the image from (must not be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the stream is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_IO - if an IO error occurs while reading from the stream</li>
+ *    <li>ERROR_INVALID_IMAGE - if the image stream contains invalid data</li>
+ *    <li>ERROR_UNSUPPORTED_FORMAT - if the image stream contains an unrecognized format</li>
+ * </ul>
+ *
+ * @see ImageLoader#load(InputStream)
+ */
+public this(InputStream stream) {
+    ImageData[] data = ImageDataLoader.load(stream);
+    if (data.length < 1) SWT.error(SWT.ERROR_INVALID_IMAGE);
+    ImageData i = data[0];
+    setAllFields(
+        i.width,
+        i.height,
+        i.depth,
+        i.scanlinePad,
+        i.bytesPerLine,
+        i.data,
+        i.palette,
+        i.transparentPixel,
+        i.maskData,
+        i.maskPad,
+        i.alphaData,
+        i.alpha,
+        i.type,
+        i.x,
+        i.y,
+        i.disposalMethod,
+        i.delayTime);
+}
+
+/**
+ * Constructs an <code>ImageData</code> loaded from a file with the
+ * specified name. Throws an error if an error occurs loading the
+ * image, or if the image has an unsupported type.
+ * <p>
+ * This constructor is provided for convenience when loading a single
+ * image only. If the file contains multiple images, only the first
+ * one will be loaded. To load multiple images, use
+ * <code>ImageLoader.load()</code>.
+ * </p>
+ *
+ * @param filename the name of the file to load the image from (must not be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the file name is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_IO - if an IO error occurs while reading from the file</li>
+ *    <li>ERROR_INVALID_IMAGE - if the image file contains invalid data</li>
+ *    <li>ERROR_UNSUPPORTED_FORMAT - if the image file contains an unrecognized format</li>
+ * </ul>
+ */
+public this(String filename) {
+    ImageData[] data = ImageDataLoader.load(filename);
+    if (data.length < 1) SWT.error(SWT.ERROR_INVALID_IMAGE);
+    ImageData i = data[0];
+    setAllFields(
+        i.width,
+        i.height,
+        i.depth,
+        i.scanlinePad,
+        i.bytesPerLine,
+        i.data,
+        i.palette,
+        i.transparentPixel,
+        i.maskData,
+        i.maskPad,
+        i.alphaData,
+        i.alpha,
+        i.type,
+        i.x,
+        i.y,
+        i.disposalMethod,
+        i.delayTime);
+}
+
+/**
+ * Prevents uninitialized instances from being created outside the package.
+ */
+private this() {
+}
+
+/**
+ * Constructs an image data by giving values for all non-computable fields.
+ * <p>
+ * This method is for internal use, and is not described further.
+ * </p>
+ */
+this(
+    int width, int height, int depth, PaletteData palette,
+    int scanlinePad, byte[] data, int maskPad, byte[] maskData,
+    byte[] alphaData, int alpha, int transparentPixel, int type,
+    int x, int y, int disposalMethod, int delayTime)
+{
+    if (palette is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (!(depth is 1 || depth is 2 || depth is 4 || depth is 8
+        || depth is 16 || depth is 24 || depth is 32)) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (width <= 0 || height <= 0) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (scanlinePad is 0) SWT.error (SWT.ERROR_CANNOT_BE_ZERO);
+
+    int bytesPerLine = (((width * depth + 7) / 8) + (scanlinePad - 1))
+        / scanlinePad * scanlinePad;
+
+    /*
+     * When the image is being loaded from a PNG, we need to use the theoretical minimum
+     * number of bytes per line to check whether there is enough data, because the actual
+     * number of bytes per line is calculated based on the given depth, which may be larger
+     * than the actual depth of the PNG.
+     */
+    int minBytesPerLine = type is SWT.IMAGE_PNG ? ((((width + 7) / 8) + 3) / 4) * 4 : bytesPerLine;
+    if (data !is null && data.length < minBytesPerLine * height) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    setAllFields(
+        width,
+        height,
+        depth,
+        scanlinePad,
+        bytesPerLine,
+        data !is null ? data : new byte[bytesPerLine * height],
+        palette,
+        transparentPixel,
+        maskData,
+        maskPad,
+        alphaData,
+        alpha,
+        type,
+        x,
+        y,
+        disposalMethod,
+        delayTime);
+}
+
+/**
+ * Initializes all fields in the receiver. This method must be called
+ * by all public constructors to ensure that all fields are initialized
+ * for a new ImageData object. If a new field is added to the class,
+ * then it must be added to this method.
+ * <p>
+ * This method is for internal use, and is not described further.
+ * </p>
+ */
+void setAllFields(int width, int height, int depth, int scanlinePad,
+    int bytesPerLine, byte[] data, PaletteData palette, int transparentPixel,
+    byte[] maskData, int maskPad, byte[] alphaData, int alpha,
+    int type, int x, int y, int disposalMethod, int delayTime) {
+
+    this.width = width;
+    this.height = height;
+    this.depth = depth;
+    this.scanlinePad = scanlinePad;
+    this.bytesPerLine = bytesPerLine;
+    this.data = data;
+    this.palette = palette;
+    this.transparentPixel = transparentPixel;
+    this.maskData = maskData;
+    this.maskPad = maskPad;
+    this.alphaData = alphaData;
+    this.alpha = alpha;
+    this.type = type;
+    this.x = x;
+    this.y = y;
+    this.disposalMethod = disposalMethod;
+    this.delayTime = delayTime;
+}
+
+/**
+ * Invokes internal SWT functionality to create a new instance of
+ * this class.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>ImageData</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is subject
+ * to change without notice, and should never be called from
+ * application code.
+ * </p>
+ * <p>
+ * This method is for internal use, and is not described further.
+ * </p>
+ */
+public static ImageData internal_new(
+    int width, int height, int depth, PaletteData palette,
+    int scanlinePad, byte[] data, int maskPad, byte[] maskData,
+    byte[] alphaData, int alpha, int transparentPixel, int type,
+    int x, int y, int disposalMethod, int delayTime)
+{
+    return new ImageData(
+        width, height, depth, palette, scanlinePad, data, maskPad, maskData,
+        alphaData, alpha, transparentPixel, type, x, y, disposalMethod, delayTime);
+}
+
+ImageData colorMaskImage(int pixel) {
+    ImageData mask = new ImageData(width, height, 1, bwPalette(),
+        2, null, 0, null, null, -1, -1, SWT.IMAGE_UNDEFINED,
+        0, 0, 0, 0);
+    int[] row = new int[width];
+    for (int y = 0; y < height; y++) {
+        getPixels(0, y, width, row, 0);
+        for (int i = 0; i < width; i++) {
+            if (pixel !is -1 && row[i] is pixel) {
+                row[i] = 0;
+            } else {
+                row[i] = 1;
+            }
+        }
+        mask.setPixels(0, y, width, row, 0);
+    }
+    return mask;
+}
+
+static byte[] checkData(byte [] data) {
+    if (data is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    return data;
+}
+
+/**
+ * Returns a new instance of the same class as the receiver,
+ * whose slots have been filled in with <em>copies</em> of
+ * the values in the slots of the receiver. That is, the
+ * returned object is a <em>deep copy</em> of the receiver.
+ *
+ * @return a copy of the receiver.
+ */
+public Object clone() {
+    byte[] cloneData = new byte[data.length];
+    System.arraycopy(data, 0, cloneData, 0, data.length);
+    byte[] cloneMaskData = null;
+    if (maskData !is null) {
+        cloneMaskData = new byte[maskData.length];
+        System.arraycopy(maskData, 0, cloneMaskData, 0, maskData.length);
+    }
+    byte[] cloneAlphaData = null;
+    if (alphaData !is null) {
+        cloneAlphaData = new byte[alphaData.length];
+        System.arraycopy(alphaData, 0, cloneAlphaData, 0, alphaData.length);
+    }
+    return new ImageData(
+        width,
+        height,
+        depth,
+        palette,
+        scanlinePad,
+        cloneData,
+        maskPad,
+        cloneMaskData,
+        cloneAlphaData,
+        alpha,
+        transparentPixel,
+        type,
+        x,
+        y,
+        disposalMethod,
+        delayTime);
+}
+
+/**
+ * Returns the alpha value at offset <code>x</code> in
+ * scanline <code>y</code> in the receiver's alpha data.
+ * The alpha value is between 0 (transparent) and
+ * 255 (opaque).
+ *
+ * @param x the x coordinate of the pixel to get the alpha value of
+ * @param y the y coordinate of the pixel to get the alpha value of
+ * @return the alpha value at the given coordinates
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if either argument is out of range</li>
+ * </ul>
+ */
+public int getAlpha(int x, int y) {
+    if (x >= width || y >= height || x < 0 || y < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+
+    if (alphaData is null) return 255;
+    return alphaData[y * width + x] & 0xFF;
+}
+
+/**
+ * Returns <code>getWidth</code> alpha values starting at offset
+ * <code>x</code> in scanline <code>y</code> in the receiver's alpha
+ * data starting at <code>startIndex</code>. The alpha values
+ * are unsigned, between <code>(byte)0</code> (transparent) and
+ * <code>(byte)255</code> (opaque).
+ *
+ * @param x the x position of the pixel to begin getting alpha values
+ * @param y the y position of the pixel to begin getting alpha values
+ * @param getWidth the width of the data to get
+ * @param alphas the buffer in which to put the alpha values
+ * @param startIndex the offset into the image to begin getting alpha values
+ *
+ * @exception IndexOutOfBoundsException if getWidth is too large
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if pixels is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if x or y is out of bounds</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if getWidth is negative</li>
+ * </ul>
+ */
+public void getAlphas(int x, int y, int getWidth, byte[] alphas, int startIndex) {
+    if (alphas is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (getWidth < 0 || x >= width || y >= height || x < 0 || y < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    if (getWidth is 0) return;
+
+    if (alphaData is null) {
+        int endIndex = startIndex + getWidth;
+        for (int i = startIndex; i < endIndex; i++) {
+            alphas[i] = cast(byte)255;
+        }
+        return;
+    }
+    // may throw an IndexOutOfBoundsException
+    System.arraycopy(alphaData, y * width + x, alphas, startIndex, getWidth);
+}
+
+/**
+ * Returns the pixel value at offset <code>x</code> in
+ * scanline <code>y</code> in the receiver's data.
+ *
+ * @param x the x position of the pixel to get
+ * @param y the y position of the pixel to get
+ * @return the pixel at the given coordinates
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if either argument is out of bounds</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_UNSUPPORTED_DEPTH if the depth is not one of 1, 2, 4, 8, 16, 24 or 32</li>
+ * </ul>
+ */
+public int getPixel(int x, int y) {
+    if (x >= width || y >= height || x < 0 || y < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    int index;
+    int theByte;
+    int mask;
+    switch (depth) {
+        case 32:
+            index = (y * bytesPerLine) + (x * 4);
+            return ((data[index] & 0xFF) << 24) + ((data[index+1] & 0xFF) << 16) +
+                    ((data[index+2] & 0xFF) << 8) + (data[index+3] & 0xFF);
+        case 24:
+            index = (y * bytesPerLine) + (x * 3);
+            return ((data[index] & 0xFF) << 16) + ((data[index+1] & 0xFF) << 8) +
+                (data[index+2] & 0xFF);
+        case 16:
+            index = (y * bytesPerLine) + (x * 2);
+            return ((data[index+1] & 0xFF) << 8) + (data[index] & 0xFF);
+        case 8:
+            index = (y * bytesPerLine) + x ;
+            return data[index] & 0xFF;
+        case 4:
+            index = (y * bytesPerLine) + (x >> 1);
+            theByte = data[index] & 0xFF;
+            if ((x & 0x1) is 0) {
+                return theByte >> 4;
+            } else {
+                return theByte & 0x0F;
+            }
+        case 2:
+            index = (y * bytesPerLine) + (x >> 2);
+            theByte = data[index] & 0xFF;
+            int offset = 3 - (x % 4);
+            mask = 3 << (offset * 2);
+            return (theByte & mask) >> (offset * 2);
+        case 1:
+            index = (y * bytesPerLine) + (x >> 3);
+            theByte = data[index] & 0xFF;
+            mask = 1 << (7 - (x & 0x7));
+            if ((theByte & mask) is 0) {
+                return 0;
+            } else {
+                return 1;
+            }
+        default:
+    }
+    SWT.error(SWT.ERROR_UNSUPPORTED_DEPTH);
+    return 0;
+}
+
+/**
+ * Returns <code>getWidth</code> pixel values starting at offset
+ * <code>x</code> in scanline <code>y</code> in the receiver's
+ * data starting at <code>startIndex</code>.
+ *
+ * @param x the x position of the first pixel to get
+ * @param y the y position of the first pixel to get
+ * @param getWidth the width of the data to get
+ * @param pixels the buffer in which to put the pixels
+ * @param startIndex the offset into the byte array to begin storing pixels
+ *
+ * @exception IndexOutOfBoundsException if getWidth is too large
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if pixels is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if x or y is out of bounds</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if getWidth is negative</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_UNSUPPORTED_DEPTH - if the depth is not one of 1, 2, 4 or 8
+ *        (For higher depths, use the int[] version of this method.)</li>
+ * </ul>
+ */
+public void getPixels(int x, int y, int getWidth, byte[] pixels, int startIndex) {
+    if (pixels is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (getWidth < 0 || x >= width || y >= height || x < 0 || y < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    if (getWidth is 0) return;
+    int index;
+    int theByte;
+    int mask = 0;
+    int n = getWidth;
+    int i = startIndex;
+    int srcX = x, srcY = y;
+    switch (depth) {
+        case 8:
+            index = (y * bytesPerLine) + x;
+            for (int j = 0; j < getWidth; j++) {
+                pixels[i] = data[index];
+                i++;
+                srcX++;
+                if (srcX >= width) {
+                    srcY++;
+                    index = srcY * bytesPerLine;
+                    srcX = 0;
+                } else {
+                    index++;
+                }
+            }
+            return;
+        case 4:
+            index = (y * bytesPerLine) + (x >> 1);
+            if ((x & 0x1) is 1) {
+                theByte = data[index] & 0xFF;
+                pixels[i] = cast(byte)(theByte & 0x0F);
+                i++;
+                n--;
+                srcX++;
+                if (srcX >= width) {
+                    srcY++;
+                    index = srcY * bytesPerLine;
+                    srcX = 0;
+                } else {
+                    index++;
+                }
+            }
+            while (n > 1) {
+                theByte = data[index] & 0xFF;
+                pixels[i] = cast(byte)(theByte >> 4);
+                i++;
+                n--;
+                srcX++;
+                if (srcX >= width) {
+                    srcY++;
+                    index = srcY * bytesPerLine;
+                    srcX = 0;
+                } else {
+                    pixels[i] = cast(byte)(theByte & 0x0F);
+                    i++;
+                    n--;
+                    srcX++;
+                    if (srcX >= width) {
+                        srcY++;
+                        index = srcY * bytesPerLine;
+                        srcX = 0;
+                    } else {
+                        index++;
+                    }
+                }
+            }
+            if (n > 0) {
+                theByte = data[index] & 0xFF;
+                pixels[i] = cast(byte)(theByte >> 4);
+            }
+            return;
+        case 2:
+            index = (y * bytesPerLine) + (x >> 2);
+            theByte = data[index] & 0xFF;
+            int offset;
+            while (n > 0) {
+                offset = 3 - (srcX % 4);
+                mask = 3 << (offset * 2);
+                pixels[i] = cast(byte)((theByte & mask) >> (offset * 2));
+                i++;
+                n--;
+                srcX++;
+                if (srcX >= width) {
+                    srcY++;
+                    index = srcY * bytesPerLine;
+                    if (n > 0) theByte = data[index] & 0xFF;
+                    srcX = 0;
+                } else {
+                    if (offset is 0) {
+                        index++;
+                        theByte = data[index] & 0xFF;
+                    }
+                }
+            }
+            return;
+        case 1:
+            index = (y * bytesPerLine) + (x >> 3);
+            theByte = data[index] & 0xFF;
+            while (n > 0) {
+                mask = 1 << (7 - (srcX & 0x7));
+                if ((theByte & mask) is 0) {
+                    pixels[i] = 0;
+                } else {
+                    pixels[i] = 1;
+                }
+                i++;
+                n--;
+                srcX++;
+                if (srcX >= width) {
+                    srcY++;
+                    index = srcY * bytesPerLine;
+                    if (n > 0) theByte = data[index] & 0xFF;
+                    srcX = 0;
+                } else {
+                    if (mask is 1) {
+                        index++;
+                        if (n > 0) theByte = data[index] & 0xFF;
+                    }
+                }
+            }
+            return;
+        default:
+    }
+    SWT.error(SWT.ERROR_UNSUPPORTED_DEPTH);
+}
+
+/**
+ * Returns <code>getWidth</code> pixel values starting at offset
+ * <code>x</code> in scanline <code>y</code> in the receiver's
+ * data starting at <code>startIndex</code>.
+ *
+ * @param x the x position of the first pixel to get
+ * @param y the y position of the first pixel to get
+ * @param getWidth the width of the data to get
+ * @param pixels the buffer in which to put the pixels
+ * @param startIndex the offset into the buffer to begin storing pixels
+ *
+ * @exception IndexOutOfBoundsException if getWidth is too large
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if pixels is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if x or y is out of bounds</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if getWidth is negative</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_UNSUPPORTED_DEPTH - if the depth is not one of 1, 2, 4, 8, 16, 24 or 32</li>
+ * </ul>
+ */
+public void getPixels(int x, int y, int getWidth, int[] pixels, int startIndex) {
+    if (pixels is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (getWidth < 0 || x >= width || y >= height || x < 0 || y < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    if (getWidth is 0) return;
+    int index;
+    int theByte;
+    int mask;
+    int n = getWidth;
+    int i = startIndex;
+    int srcX = x, srcY = y;
+    switch (depth) {
+        case 32:
+            index = (y * bytesPerLine) + (x * 4);
+            i = startIndex;
+            for (int j = 0; j < getWidth; j++) {
+                pixels[i] = ((data[index] & 0xFF) << 24) | ((data[index+1] & 0xFF) << 16)
+                    | ((data[index+2] & 0xFF) << 8) | (data[index+3] & 0xFF);
+                i++;
+                srcX++;
+                if (srcX >= width) {
+                    srcY++;
+                    index = srcY * bytesPerLine;
+                    srcX = 0;
+                } else {
+                    index += 4;
+                }
+            }
+            return;
+        case 24:
+            index = (y * bytesPerLine) + (x * 3);
+            for (int j = 0; j < getWidth; j++) {
+                pixels[i] = ((data[index] & 0xFF) << 16) | ((data[index+1] & 0xFF) << 8)
+                    | (data[index+2] & 0xFF);
+                i++;
+                srcX++;
+                if (srcX >= width) {
+                    srcY++;
+                    index = srcY * bytesPerLine;
+                    srcX = 0;
+                } else {
+                    index += 3;
+                }
+            }
+            return;
+        case 16:
+            index = (y * bytesPerLine) + (x * 2);
+            for (int j = 0; j < getWidth; j++) {
+                pixels[i] = ((data[index+1] & 0xFF) << 8) + (data[index] & 0xFF);
+                i++;
+                srcX++;
+                if (srcX >= width) {
+                    srcY++;
+                    index = srcY * bytesPerLine;
+                    srcX = 0;
+                } else {
+                    index += 2;
+                }
+            }
+            return;
+        case 8:
+            index = (y * bytesPerLine) + x;
+            for (int j = 0; j < getWidth; j++) {
+                pixels[i] = data[index] & 0xFF;
+                i++;
+                srcX++;
+                if (srcX >= width) {
+                    srcY++;
+                    index = srcY * bytesPerLine;
+                    srcX = 0;
+                } else {
+                    index++;
+                }
+            }
+            return;
+        case 4:
+            index = (y * bytesPerLine) + (x >> 1);
+            if ((x & 0x1) is 1) {
+                theByte = data[index] & 0xFF;
+                pixels[i] = theByte & 0x0F;
+                i++;
+                n--;
+                srcX++;
+                if (srcX >= width) {
+                    srcY++;
+                    index = srcY * bytesPerLine;
+                    srcX = 0;
+                } else {
+                    index++;
+                }
+            }
+            while (n > 1) {
+                theByte = data[index] & 0xFF;
+                pixels[i] = theByte >> 4;
+                i++;
+                n--;
+                srcX++;
+                if (srcX >= width) {
+                    srcY++;
+                    index = srcY * bytesPerLine;
+                    srcX = 0;
+                } else {
+                    pixels[i] = theByte & 0x0F;
+                    i++;
+                    n--;
+                    srcX++;
+                    if (srcX >= width) {
+                        srcY++;
+                        index = srcY * bytesPerLine;
+                        srcX = 0;
+                    } else {
+                        index++;
+                    }
+                }
+            }
+            if (n > 0) {
+                theByte = data[index] & 0xFF;
+                pixels[i] = theByte >> 4;
+            }
+            return;
+        case 2:
+            index = (y * bytesPerLine) + (x >> 2);
+            theByte = data[index] & 0xFF;
+            int offset;
+            while (n > 0) {
+                offset = 3 - (srcX % 4);
+                mask = 3 << (offset * 2);
+                pixels[i] = cast(byte)((theByte & mask) >> (offset * 2));
+                i++;
+                n--;
+                srcX++;
+                if (srcX >= width) {
+                    srcY++;
+                    index = srcY * bytesPerLine;
+                    if (n > 0) theByte = data[index] & 0xFF;
+                    srcX = 0;
+                } else {
+                    if (offset is 0) {
+                        index++;
+                        theByte = data[index] & 0xFF;
+                    }
+                }
+            }
+            return;
+        case 1:
+            index = (y * bytesPerLine) + (x >> 3);
+            theByte = data[index] & 0xFF;
+            while (n > 0) {
+                mask = 1 << (7 - (srcX & 0x7));
+                if ((theByte & mask) is 0) {
+                    pixels[i] = 0;
+                } else {
+                    pixels[i] = 1;
+                }
+                i++;
+                n--;
+                srcX++;
+                if (srcX >= width) {
+                    srcY++;
+                    index = srcY * bytesPerLine;
+                    if (n > 0) theByte = data[index] & 0xFF;
+                    srcX = 0;
+                } else {
+                    if (mask is 1) {
+                        index++;
+                        if (n > 0) theByte = data[index] & 0xFF;
+                    }
+                }
+            }
+            return;
+        default:
+    }
+    SWT.error(SWT.ERROR_UNSUPPORTED_DEPTH);
+}
+
+/**
+ * Returns an array of <code>RGB</code>s which comprise the
+ * indexed color table of the receiver, or null if the receiver
+ * has a direct color model.
+ *
+ * @return the RGB values for the image or null if direct color
+ *
+ * @see PaletteData#getRGBs()
+ */
+public RGB[] getRGBs() {
+    return palette.getRGBs();
+}
+
+/**
+ * Returns an <code>ImageData</code> which specifies the
+ * transparency mask information for the receiver. If the
+ * receiver has no transparency or is not an icon, returns
+ * an opaque mask.
+ *
+ * @return the transparency mask
+ */
+public ImageData getTransparencyMask() {
+    if (getTransparencyType() is SWT.TRANSPARENCY_MASK) {
+        return new ImageData(width, height, 1, bwPalette(), maskPad, maskData);
+    } else {
+        return colorMaskImage(transparentPixel);
+    }
+}
+
+/**
+ * Returns the image transparency type, which will be one of
+ * <code>SWT.TRANSPARENCY_NONE</code>, <code>SWT.TRANSPARENCY_MASK</code>,
+ * <code>SWT.TRANSPARENCY_PIXEL</code> or <code>SWT.TRANSPARENCY_ALPHA</code>.
+ *
+ * @return the receiver's transparency type
+ */
+public int getTransparencyType() {
+    if (maskData !is null) return SWT.TRANSPARENCY_MASK;
+    if (transparentPixel !is -1) return SWT.TRANSPARENCY_PIXEL;
+    if (alphaData !is null) return SWT.TRANSPARENCY_ALPHA;
+    return SWT.TRANSPARENCY_NONE;
+}
+
+/**
+ * Returns the byte order of the receiver.
+ *
+ * @return MSB_FIRST or LSB_FIRST
+ */
+int getByteOrder() {
+    return depth !is 16 ? MSB_FIRST : LSB_FIRST;
+}
+
+/**
+ * Returns a copy of the receiver which has been stretched or
+ * shrunk to the specified size. If either the width or height
+ * is negative, the resulting image will be inverted in the
+ * associated axis.
+ *
+ * @param width the width of the new ImageData
+ * @param height the height of the new ImageData
+ * @return a scaled copy of the image
+ */
+public ImageData scaledTo(int width, int height) {
+    /* Create a destination image with no data */
+    bool flipX = (width < 0);
+    if (flipX) width = - width;
+    bool flipY = (height < 0);
+    if (flipY) height = - height;
+
+    ImageData dest = new ImageData(
+        width, height, depth, palette,
+        scanlinePad, null, 0, null,
+        null, -1, transparentPixel, type,
+        x, y, disposalMethod, delayTime);
+
+    /* Scale the image contents */
+    if (palette.isDirect) blit(BLIT_SRC,
+        this.data, this.depth, this.bytesPerLine, this.getByteOrder(), 0, 0, this.width, this.height, 0, 0, 0,
+        ALPHA_OPAQUE, null, 0, 0, 0,
+        dest.data, dest.depth, dest.bytesPerLine, dest.getByteOrder(), 0, 0, dest.width, dest.height, 0, 0, 0,
+        flipX, flipY);
+    else blit(BLIT_SRC,
+        this.data, this.depth, this.bytesPerLine, this.getByteOrder(), 0, 0, this.width, this.height, null, null, null,
+        ALPHA_OPAQUE, null, 0, 0, 0,
+        dest.data, dest.depth, dest.bytesPerLine, dest.getByteOrder(), 0, 0, dest.width, dest.height, null, null, null,
+        flipX, flipY);
+
+    /* Scale the image mask or alpha */
+    if (maskData !is null) {
+        dest.maskPad = this.maskPad;
+        int destBpl = (dest.width + 7) / 8;
+        destBpl = (destBpl + (dest.maskPad - 1)) / dest.maskPad * dest.maskPad;
+        dest.maskData = new byte[destBpl * dest.height];
+        int srcBpl = (this.width + 7) / 8;
+        srcBpl = (srcBpl + (this.maskPad - 1)) / this.maskPad * this.maskPad;
+        blit(BLIT_SRC,
+            this.maskData, 1, srcBpl, MSB_FIRST, 0, 0, this.width, this.height, null, null, null,
+            ALPHA_OPAQUE, null, 0, 0, 0,
+            dest.maskData, 1, destBpl, MSB_FIRST, 0, 0, dest.width, dest.height, null, null, null,
+            flipX, flipY);
+    } else if (alpha !is -1) {
+        dest.alpha = this.alpha;
+    } else if (alphaData !is null) {
+        dest.alphaData = new byte[dest.width * dest.height];
+        blit(BLIT_SRC,
+            this.alphaData, 8, this.width, MSB_FIRST, 0, 0, this.width, this.height, null, null, null,
+            ALPHA_OPAQUE, null, 0, 0, 0,
+            dest.alphaData, 8, dest.width, MSB_FIRST, 0, 0, dest.width, dest.height, null, null, null,
+            flipX, flipY);
+    }
+    return dest;
+}
+
+/**
+ * Sets the alpha value at offset <code>x</code> in
+ * scanline <code>y</code> in the receiver's alpha data.
+ * The alpha value must be between 0 (transparent)
+ * and 255 (opaque).
+ *
+ * @param x the x coordinate of the alpha value to set
+ * @param y the y coordinate of the alpha value to set
+ * @param alpha the value to set the alpha to
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if x or y is out of bounds</li>
+ *  </ul>
+ */
+public void setAlpha(int x, int y, int alpha) {
+    if (x >= width || y >= height || x < 0 || y < 0 || alpha < 0 || alpha > 255)
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+
+    if (alphaData is null) alphaData = new byte[width * height];
+    alphaData[y * width + x] = cast(byte)alpha;
+}
+
+/**
+ * Sets the alpha values starting at offset <code>x</code> in
+ * scanline <code>y</code> in the receiver's alpha data to the
+ * values from the array <code>alphas</code> starting at
+ * <code>startIndex</code>. The alpha values must be between
+ * <code>(byte)0</code> (transparent) and <code>(byte)255</code> (opaque)
+ *
+ * @param x the x coordinate of the pixel to being setting the alpha values
+ * @param y the y coordinate of the pixel to being setting the alpha values
+ * @param putWidth the width of the alpha values to set
+ * @param alphas the alpha values to set
+ * @param startIndex the index at which to begin setting
+ *
+ * @exception IndexOutOfBoundsException if putWidth is too large
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if pixels is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if x or y is out of bounds</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if putWidth is negative</li>
+ * </ul>
+ */
+public void setAlphas(int x, int y, int putWidth, byte[] alphas, int startIndex) {
+    if (alphas is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (putWidth < 0 || x >= width || y >= height || x < 0 || y < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    if (putWidth is 0) return;
+
+    if (alphaData is null) alphaData = new byte[width * height];
+    // may throw an IndexOutOfBoundsException
+    System.arraycopy(alphas, startIndex, alphaData, y * width + x, putWidth);
+}
+
+/**
+ * Sets the pixel value at offset <code>x</code> in
+ * scanline <code>y</code> in the receiver's data.
+ *
+ * @param x the x coordinate of the pixel to set
+ * @param y the y coordinate of the pixel to set
+ * @param pixelValue the value to set the pixel to
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if x or y is out of bounds</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_UNSUPPORTED_DEPTH if the depth is not one of 1, 2, 4, 8, 16, 24 or 32</li>
+ * </ul>
+ */
+public void setPixel(int x, int y, int pixelValue) {
+    if (x >= width || y >= height || x < 0 || y < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    int index;
+    byte theByte;
+    int mask;
+    switch (depth) {
+        case 32:
+            index = (y * bytesPerLine) + (x * 4);
+            data[index]  = cast(byte)((pixelValue >> 24) & 0xFF);
+            data[index + 1] = cast(byte)((pixelValue >> 16) & 0xFF);
+            data[index + 2] = cast(byte)((pixelValue >> 8) & 0xFF);
+            data[index + 3] = cast(byte)(pixelValue & 0xFF);
+            return;
+        case 24:
+            index = (y * bytesPerLine) + (x * 3);
+            data[index] = cast(byte)((pixelValue >> 16) & 0xFF);
+            data[index + 1] = cast(byte)((pixelValue >> 8) & 0xFF);
+            data[index + 2] = cast(byte)(pixelValue & 0xFF);
+            return;
+        case 16:
+            index = (y * bytesPerLine) + (x * 2);
+            data[index + 1] = cast(byte)((pixelValue >> 8) & 0xFF);
+            data[index] = cast(byte)(pixelValue & 0xFF);
+            return;
+        case 8:
+            index = (y * bytesPerLine) + x ;
+            data[index] = cast(byte)(pixelValue & 0xFF);
+            return;
+        case 4:
+            index = (y * bytesPerLine) + (x >> 1);
+            if ((x & 0x1) is 0) {
+                data[index] = cast(byte)((data[index] & 0x0F) | ((pixelValue & 0x0F) << 4));
+            } else {
+                data[index] = cast(byte)((data[index] & 0xF0) | (pixelValue & 0x0F));
+            }
+            return;
+        case 2:
+            index = (y * bytesPerLine) + (x >> 2);
+            theByte = data[index];
+            int offset = 3 - (x % 4);
+            mask = 0xFF ^ (3 << (offset * 2));
+            data[index] = cast(byte)((data[index] & mask) | (pixelValue << (offset * 2)));
+            return;
+        case 1:
+            index = (y * bytesPerLine) + (x >> 3);
+            theByte = data[index];
+            mask = 1 << (7 - (x & 0x7));
+            if ((pixelValue & 0x1) is 1) {
+                data[index] = cast(byte)(theByte | mask);
+            } else {
+                data[index] = cast(byte)(theByte & (mask ^ -1));
+            }
+            return;
+        default:
+    }
+    SWT.error(SWT.ERROR_UNSUPPORTED_DEPTH);
+}
+
+/**
+ * Sets the pixel values starting at offset <code>x</code> in
+ * scanline <code>y</code> in the receiver's data to the
+ * values from the array <code>pixels</code> starting at
+ * <code>startIndex</code>.
+ *
+ * @param x the x position of the pixel to set
+ * @param y the y position of the pixel to set
+ * @param putWidth the width of the pixels to set
+ * @param pixels the pixels to set
+ * @param startIndex the index at which to begin setting
+ *
+ * @exception IndexOutOfBoundsException if putWidth is too large
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if pixels is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if x or y is out of bounds</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if putWidth is negative</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_UNSUPPORTED_DEPTH if the depth is not one of 1, 2, 4, 8
+ *        (For higher depths, use the int[] version of this method.)</li>
+ * </ul>
+ */
+public void setPixels(int x, int y, int putWidth, byte[] pixels, int startIndex) {
+    if (pixels is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (putWidth < 0 || x >= width || y >= height || x < 0 || y < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    if (putWidth is 0) return;
+    int index;
+    int theByte;
+    int mask;
+    int n = putWidth;
+    int i = startIndex;
+    int srcX = x, srcY = y;
+    switch (depth) {
+        case 8:
+            index = (y * bytesPerLine) + x;
+            for (int j = 0; j < putWidth; j++) {
+                data[index] = cast(byte)(pixels[i] & 0xFF);
+                i++;
+                srcX++;
+                if (srcX >= width) {
+                    srcY++;
+                    index = srcY * bytesPerLine;
+                    srcX = 0;
+                } else {
+                    index++;
+                }
+            }
+            return;
+        case 4:
+            index = (y * bytesPerLine) + (x >> 1);
+            bool high = (x & 0x1) is 0;
+            while (n > 0) {
+                theByte = pixels[i] & 0x0F;
+                if (high) {
+                    data[index] = cast(byte)((data[index] & 0x0F) | (theByte << 4));
+                } else {
+                    data[index] = cast(byte)((data[index] & 0xF0) | theByte);
+                }
+                i++;
+                n--;
+                srcX++;
+                if (srcX >= width) {
+                    srcY++;
+                    index = srcY * bytesPerLine;
+                    high = true;
+                    srcX = 0;
+                } else {
+                    if (!high) index++;
+                    high = !high;
+                }
+            }
+            return;
+        case 2:
+            byte [] masks = [ cast(byte)0xFC, cast(byte)0xF3, cast(byte)0xCF, cast(byte)0x3F ];
+            index = (y * bytesPerLine) + (x >> 2);
+            int offset = 3 - (x % 4);
+            while (n > 0) {
+                theByte = pixels[i] & 0x3;
+                data[index] = cast(byte)((data[index] & masks[offset]) | (theByte << (offset * 2)));
+                i++;
+                n--;
+                srcX++;
+                if (srcX >= width) {
+                    srcY++;
+                    index = srcY * bytesPerLine;
+                    offset = 0;
+                    srcX = 0;
+                } else {
+                    if (offset is 0) {
+                        index++;
+                        offset = 3;
+                    } else {
+                        offset--;
+                    }
+                }
+            }
+            return;
+        case 1:
+            index = (y * bytesPerLine) + (x >> 3);
+            while (n > 0) {
+                mask = 1 << (7 - (srcX & 0x7));
+                if ((pixels[i] & 0x1) is 1) {
+                    data[index] = cast(byte)((data[index] & 0xFF) | mask);
+                } else {
+                    data[index] = cast(byte)((data[index] & 0xFF) & (mask ^ -1));
+                }
+                i++;
+                n--;
+                srcX++;
+                if (srcX >= width) {
+                    srcY++;
+                    index = srcY * bytesPerLine;
+                    srcX = 0;
+                } else {
+                    if (mask is 1) {
+                        index++;
+                    }
+                }
+            }
+            return;
+        default:
+    }
+    SWT.error(SWT.ERROR_UNSUPPORTED_DEPTH);
+}
+
+/**
+ * Sets the pixel values starting at offset <code>x</code> in
+ * scanline <code>y</code> in the receiver's data to the
+ * values from the array <code>pixels</code> starting at
+ * <code>startIndex</code>.
+ *
+ * @param x the x position of the pixel to set
+ * @param y the y position of the pixel to set
+ * @param putWidth the width of the pixels to set
+ * @param pixels the pixels to set
+ * @param startIndex the index at which to begin setting
+ *
+ * @exception IndexOutOfBoundsException if putWidth is too large
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if pixels is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if x or y is out of bounds</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if putWidth is negative</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_UNSUPPORTED_DEPTH if the depth is not one of 1, 2, 4, 8, 16, 24 or 32</li>
+ * </ul>
+ */
+public void setPixels(int x, int y, int putWidth, int[] pixels, int startIndex) {
+    if (pixels is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (putWidth < 0 || x >= width || y >= height || x < 0 || y < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    if (putWidth is 0) return;
+    int index;
+    int theByte;
+    int mask;
+    int n = putWidth;
+    int i = startIndex;
+    int pixel;
+    int srcX = x, srcY = y;
+    switch (depth) {
+        case 32:
+            index = (y * bytesPerLine) + (x * 4);
+            for (int j = 0; j < putWidth; j++) {
+                pixel = pixels[i];
+                data[index] = cast(byte)((pixel >> 24) & 0xFF);
+                data[index + 1] = cast(byte)((pixel >> 16) & 0xFF);
+                data[index + 2] = cast(byte)((pixel >> 8) & 0xFF);
+                data[index + 3] = cast(byte)(pixel & 0xFF);
+                i++;
+                srcX++;
+                if (srcX >= width) {
+                    srcY++;
+                    index = srcY * bytesPerLine;
+                    srcX = 0;
+                } else {
+                    index += 4;
+                }
+            }
+            return;
+        case 24:
+            index = (y * bytesPerLine) + (x * 3);
+            for (int j = 0; j < putWidth; j++) {
+                pixel = pixels[i];
+                data[index] = cast(byte)((pixel >> 16) & 0xFF);
+                data[index + 1] = cast(byte)((pixel >> 8) & 0xFF);
+                data[index + 2] = cast(byte)(pixel & 0xFF);
+                i++;
+                srcX++;
+                if (srcX >= width) {
+                    srcY++;
+                    index = srcY * bytesPerLine;
+                    srcX = 0;
+                } else {
+                    index += 3;
+                }
+            }
+            return;
+        case 16:
+            index = (y * bytesPerLine) + (x * 2);
+            for (int j = 0; j < putWidth; j++) {
+                pixel = pixels[i];
+                data[index] = cast(byte)(pixel & 0xFF);
+                data[index + 1] = cast(byte)((pixel >> 8) & 0xFF);
+                i++;
+                srcX++;
+                if (srcX >= width) {
+                    srcY++;
+                    index = srcY * bytesPerLine;
+                    srcX = 0;
+                } else {
+                    index += 2;
+                }
+            }
+            return;
+        case 8:
+            index = (y * bytesPerLine) + x;
+            for (int j = 0; j < putWidth; j++) {
+                data[index] = cast(byte)(pixels[i] & 0xFF);
+                i++;
+                srcX++;
+                if (srcX >= width) {
+                    srcY++;
+                    index = srcY * bytesPerLine;
+                    srcX = 0;
+                } else {
+                    index++;
+                }
+            }
+            return;
+        case 4:
+            index = (y * bytesPerLine) + (x >> 1);
+            bool high = (x & 0x1) is 0;
+            while (n > 0) {
+                theByte = pixels[i] & 0x0F;
+                if (high) {
+                    data[index] = cast(byte)((data[index] & 0x0F) | (theByte << 4));
+                } else {
+                    data[index] = cast(byte)((data[index] & 0xF0) | theByte);
+                }
+                i++;
+                n--;
+                srcX++;
+                if (srcX >= width) {
+                    srcY++;
+                    index = srcY * bytesPerLine;
+                    high = true;
+                    srcX = 0;
+                } else {
+                    if (!high) index++;
+                    high = !high;
+                }
+            }
+            return;
+        case 2:
+            byte [] masks = [ cast(byte)0xFC, cast(byte)0xF3, cast(byte)0xCF, cast(byte)0x3F ];
+            index = (y * bytesPerLine) + (x >> 2);
+            int offset = 3 - (x % 4);
+            while (n > 0) {
+                theByte = pixels[i] & 0x3;
+                data[index] = cast(byte)((data[index] & masks[offset]) | (theByte << (offset * 2)));
+                i++;
+                n--;
+                srcX++;
+                if (srcX >= width) {
+                    srcY++;
+                    index = srcY * bytesPerLine;
+                    offset = 3;
+                    srcX = 0;
+                } else {
+                    if (offset is 0) {
+                        index++;
+                        offset = 3;
+                    } else {
+                        offset--;
+                    }
+                }
+            }
+            return;
+        case 1:
+            index = (y * bytesPerLine) + (x >> 3);
+            while (n > 0) {
+                mask = 1 << (7 - (srcX & 0x7));
+                if ((pixels[i] & 0x1) is 1) {
+                    data[index] = cast(byte)((data[index] & 0xFF) | mask);
+                } else {
+                    data[index] = cast(byte)((data[index] & 0xFF) & (mask ^ -1));
+                }
+                i++;
+                n--;
+                srcX++;
+                if (srcX >= width) {
+                    srcY++;
+                    index = srcY * bytesPerLine;
+                    srcX = 0;
+                } else {
+                    if (mask is 1) {
+                        index++;
+                    }
+                }
+            }
+            return;
+        default:
+    }
+    SWT.error(SWT.ERROR_UNSUPPORTED_DEPTH);
+}
+
+/**
+ * Returns a palette with 2 colors: black & white.
+ */
+static PaletteData bwPalette() {
+    return new PaletteData( [ new RGB(0, 0, 0), new RGB(255, 255, 255) ] );
+}
+
+/**
+ * Gets the offset of the most significant bit for
+ * the given mask.
+ */
+static int getMSBOffset(int mask) {
+    for (int i = 31; i >= 0; i--) {
+        if (((mask >> i) & 0x1) !is 0) return i + 1;
+    }
+    return 0;
+}
+
+/**
+ * Finds the closest match.
+ */
+static int closestMatch(int depth, byte red, byte green, byte blue, int redMask, int greenMask, int blueMask, byte[] reds, byte[] greens, byte[] blues) {
+    if (depth > 8) {
+        int rshift = 32 - getMSBOffset(redMask);
+        int gshift = 32 - getMSBOffset(greenMask);
+        int bshift = 32 - getMSBOffset(blueMask);
+        return (((red << 24) >>> rshift) & redMask) |
+            (((green << 24) >>> gshift) & greenMask) |
+            (((blue << 24) >>> bshift) & blueMask);
+    }
+    int r, g, b;
+    int minDistance = 0x7fffffff;
+    int nearestPixel = 0;
+    int n = reds.length;
+    for (int j = 0; j < n; j++) {
+        r = (reds[j] & 0xFF) - (red & 0xFF);
+        g = (greens[j] & 0xFF) - (green & 0xFF);
+        b = (blues[j] & 0xFF) - (blue & 0xFF);
+        int distance = r*r + g*g + b*b;
+        if (distance < minDistance) {
+            nearestPixel = j;
+            if (distance is 0) break;
+            minDistance = distance;
+        }
+    }
+    return nearestPixel;
+}
+
+static final ImageData convertMask(ImageData mask) {
+    if (mask.depth is 1) return mask;
+    PaletteData palette = new PaletteData([new RGB(0, 0, 0), new RGB(255,255,255)]);
+    ImageData newMask = new ImageData(mask.width, mask.height, 1, palette);
+    /* Find index of black in mask palette */
+    int blackIndex = 0;
+    RGB[] rgbs = mask.getRGBs();
+    if (rgbs !is null) {
+        while (blackIndex < rgbs.length) {
+            if (rgbs[blackIndex] is palette.colors[0] ) break;
+            blackIndex++;
+        }
+    }
+    int[] pixels = new int[mask.width];
+    for (int y = 0; y < mask.height; y++) {
+        mask.getPixels(0, y, mask.width, pixels, 0);
+        for (int i = 0; i < pixels.length; i++) {
+            if (pixels[i] is blackIndex) {
+                pixels[i] = 0;
+            } else {
+                pixels[i] = 1;
+            }
+        }
+        newMask.setPixels(0, y, mask.width, pixels, 0);
+    }
+    return newMask;
+}
+
+static final byte[] convertPad(byte[] data, int width, int height, int depth, int pad, int newPad) {
+    if (pad is newPad) return data;
+    int stride = (width * depth + 7) / 8;
+    int bpl = (stride + (pad - 1)) / pad * pad;
+    int newBpl = (stride + (newPad - 1)) / newPad * newPad;
+    byte[] newData = new byte[height * newBpl];
+    int srcIndex = 0, destIndex = 0;
+    for (int y = 0; y < height; y++) {
+        System.arraycopy(data, srcIndex, newData, destIndex, stride);
+        srcIndex += bpl;
+        destIndex += newBpl;
+    }
+    return newData;
+}
+
+/**
+ * Blit operation bits to be OR'ed together to specify the desired operation.
+ */
+static const int
+    BLIT_SRC = 1,     // copy source directly, else applies logic operations
+    BLIT_ALPHA = 2,   // enable alpha blending
+    BLIT_DITHER = 4;  // enable dithering in low color modes
+
+/**
+ * Alpha mode, values 0 - 255 specify global alpha level
+ */
+static const int
+    ALPHA_OPAQUE = 255,           // Fully opaque (ignores any alpha data)
+    ALPHA_TRANSPARENT = 0,        // Fully transparent (ignores any alpha data)
+    ALPHA_CHANNEL_SEPARATE = -1,  // Use alpha channel from separate alphaData
+    ALPHA_CHANNEL_SOURCE = -2,    // Use alpha channel embedded in sourceData
+    ALPHA_MASK_UNPACKED = -3,     // Use transparency mask formed by bytes in alphaData (non-zero is opaque)
+    ALPHA_MASK_PACKED = -4,       // Use transparency mask formed by packed bits in alphaData
+    ALPHA_MASK_INDEX = -5,        // Consider source palette indices transparent if in alphaData array
+    ALPHA_MASK_RGB = -6;          // Consider source RGBs transparent if in RGB888 format alphaData array
+
+/**
+ * Byte and bit order constants.
+ */
+static const int LSB_FIRST = 0;
+static const int MSB_FIRST = 1;
+
+/**
+ * Data types (internal)
+ */
+private static const int
+    // direct / true color formats with arbitrary masks & shifts
+    TYPE_GENERIC_8 = 0,
+    TYPE_GENERIC_16_MSB = 1,
+    TYPE_GENERIC_16_LSB = 2,
+    TYPE_GENERIC_24 = 3,
+    TYPE_GENERIC_32_MSB = 4,
+    TYPE_GENERIC_32_LSB = 5,
+    // palette indexed color formats
+    TYPE_INDEX_8 = 6,
+    TYPE_INDEX_4 = 7,
+    TYPE_INDEX_2 = 8,
+    TYPE_INDEX_1_MSB = 9,
+    TYPE_INDEX_1_LSB = 10;
+
+/**
+ * Blits a direct palette image into a direct palette image.
+ * <p>
+ * Note: When the source and destination depth, order and masks
+ * are pairwise equal and the blitter operation is BLIT_SRC,
+ * the masks are ignored.  Hence when not changing the image
+ * data format, 0 may be specified for the masks.
+ * </p>
+ *
+ * @param op the blitter operation: a combination of BLIT_xxx flags
+ *        (see BLIT_xxx constants)
+ * @param srcData the source byte array containing image data
+ * @param srcDepth the source depth: one of 8, 16, 24, 32
+ * @param srcStride the source number of bytes per line
+ * @param srcOrder the source byte ordering: one of MSB_FIRST or LSB_FIRST;
+ *        ignored if srcDepth is not 16 or 32
+ * @param srcX the top-left x-coord of the source blit region
+ * @param srcY the top-left y-coord of the source blit region
+ * @param srcWidth the width of the source blit region
+ * @param srcHeight the height of the source blit region
+ * @param srcRedMask the source red channel mask
+ * @param srcGreenMask the source green channel mask
+ * @param srcBlueMask the source blue channel mask
+ * @param alphaMode the alpha blending or mask mode, may be
+ *        an integer 0-255 for global alpha; ignored if BLIT_ALPHA
+ *        not specified in the blitter operations
+ *        (see ALPHA_MODE_xxx constants)
+ * @param alphaData the alpha blending or mask data, varies depending
+ *        on the value of alphaMode and sometimes ignored
+ * @param alphaStride the alpha data number of bytes per line
+ * @param alphaX the top-left x-coord of the alpha blit region
+ * @param alphaY the top-left y-coord of the alpha blit region
+ * @param destData the destination byte array containing image data
+ * @param destDepth the destination depth: one of 8, 16, 24, 32
+ * @param destStride the destination number of bytes per line
+ * @param destOrder the destination byte ordering: one of MSB_FIRST or LSB_FIRST;
+ *        ignored if destDepth is not 16 or 32
+ * @param destX the top-left x-coord of the destination blit region
+ * @param destY the top-left y-coord of the destination blit region
+ * @param destWidth the width of the destination blit region
+ * @param destHeight the height of the destination blit region
+ * @param destRedMask the destination red channel mask
+ * @param destGreenMask the destination green channel mask
+ * @param destBlueMask the destination blue channel mask
+ * @param flipX if true the resulting image is flipped along the vertical axis
+ * @param flipY if true the resulting image is flipped along the horizontal axis
+ */
+static void blit(int op,
+    byte[] srcData, int srcDepth, int srcStride, int srcOrder,
+    int srcX, int srcY, int srcWidth, int srcHeight,
+    int srcRedMask, int srcGreenMask, int srcBlueMask,
+    int alphaMode, byte[] alphaData, int alphaStride, int alphaX, int alphaY,
+    byte[] destData, int destDepth, int destStride, int destOrder,
+    int destX, int destY, int destWidth, int destHeight,
+    int destRedMask, int destGreenMask, int destBlueMask,
+    bool flipX, bool flipY) {
+
+    static_this();
+
+    if ((destWidth <= 0) || (destHeight <= 0) || (alphaMode is ALPHA_TRANSPARENT)) return;
+
+    // these should be supplied as params later
+    const int srcAlphaMask = 0, destAlphaMask = 0;
+
+    /*** Prepare scaling data ***/
+    int dwm1 = destWidth - 1;
+    int sfxi = (dwm1 !is 0) ? cast(int)(((cast(long)srcWidth << 16) - 1) / dwm1) : 0;
+    int dhm1 = destHeight - 1;
+    int sfyi = (dhm1 !is 0) ? cast(int)(((cast(long)srcHeight << 16) - 1) / dhm1) : 0;
+
+    /*** Prepare source-related data ***/
+    int sbpp, stype;
+    switch (srcDepth) {
+        case 8:
+            sbpp = 1;
+            stype = TYPE_GENERIC_8;
+            break;
+        case 16:
+            sbpp = 2;
+            stype = (srcOrder is MSB_FIRST) ? TYPE_GENERIC_16_MSB : TYPE_GENERIC_16_LSB;
+            break;
+        case 24:
+            sbpp = 3;
+            stype = TYPE_GENERIC_24;
+            break;
+        case 32:
+            sbpp = 4;
+            stype = (srcOrder is MSB_FIRST) ? TYPE_GENERIC_32_MSB : TYPE_GENERIC_32_LSB;
+            break;
+        default:
+            //throw new IllegalArgumentException("Invalid source type");
+            return;
+    }
+    int spr = srcY * srcStride + srcX * sbpp;
+
+    /*** Prepare destination-related data ***/
+    int dbpp, dtype;
+    switch (destDepth) {
+        case 8:
+            dbpp = 1;
+            dtype = TYPE_GENERIC_8;
+            break;
+        case 16:
+            dbpp = 2;
+            dtype = (destOrder is MSB_FIRST) ? TYPE_GENERIC_16_MSB : TYPE_GENERIC_16_LSB;
+            break;
+        case 24:
+            dbpp = 3;
+            dtype = TYPE_GENERIC_24;
+            break;
+        case 32:
+            dbpp = 4;
+            dtype = (destOrder is MSB_FIRST) ? TYPE_GENERIC_32_MSB : TYPE_GENERIC_32_LSB;
+            break;
+        default:
+            //throw new IllegalArgumentException("Invalid destination type");
+            return;
+    }
+    int dpr = ((flipY) ? destY + dhm1 : destY) * destStride + ((flipX) ? destX + dwm1 : destX) * dbpp;
+    int dprxi = (flipX) ? -dbpp : dbpp;
+    int dpryi = (flipY) ? -destStride : destStride;
+
+    /*** Prepare special processing data ***/
+    int apr;
+    if ((op & BLIT_ALPHA) !is 0) {
+        switch (alphaMode) {
+            case ALPHA_MASK_UNPACKED:
+            case ALPHA_CHANNEL_SEPARATE:
+                if (alphaData is null) alphaMode = 0x10000;
+                apr = alphaY * alphaStride + alphaX;
+                break;
+            case ALPHA_MASK_PACKED:
+                if (alphaData is null) alphaMode = 0x10000;
+                alphaStride <<= 3;
+                apr = alphaY * alphaStride + alphaX;
+                break;
+            case ALPHA_MASK_INDEX:
+                //throw new IllegalArgumentException("Invalid alpha type");
+                return;
+            case ALPHA_MASK_RGB:
+                if (alphaData is null) alphaMode = 0x10000;
+                apr = 0;
+                break;
+            default:
+                alphaMode = (alphaMode << 16) / 255; // prescale
+            case ALPHA_CHANNEL_SOURCE:
+                apr = 0;
+                break;
+        }
+    } else {
+        alphaMode = 0x10000;
+        apr = 0;
+    }
+
+    /*** Blit ***/
+    int dp = dpr;
+    int sp = spr;
+    if ((alphaMode is 0x10000) && (stype is dtype) &&
+        (srcRedMask is destRedMask) && (srcGreenMask is destGreenMask) &&
+        (srcBlueMask is destBlueMask) && (srcAlphaMask is destAlphaMask)) {
+        /*** Fast blit (straight copy) ***/
+        switch (sbpp) {
+            case 1:
+                for (int dy = destHeight, sfy = sfyi; dy > 0; --dy, sp = spr += (sfy >>> 16) * srcStride, sfy = (sfy & 0xffff) + sfyi, dp = dpr += dpryi) {
+                    for (int dx = destWidth, sfx = sfxi; dx > 0; --dx, dp += dprxi, sfx = (sfx & 0xffff) + sfxi) {
+                        destData[dp] = srcData[sp];
+                        sp += (sfx >>> 16);
+                    }
+                }
+                break;
+            case 2:
+                for (int dy = destHeight, sfy = sfyi; dy > 0; --dy, sp = spr += (sfy >>> 16) * srcStride, sfy = (sfy & 0xffff) + sfyi, dp = dpr += dpryi) {
+                    for (int dx = destWidth, sfx = sfxi; dx > 0; --dx, dp += dprxi, sfx = (sfx & 0xffff) + sfxi) {
+                        destData[dp] = srcData[sp];
+                        destData[dp + 1] = srcData[sp + 1];
+                        sp += (sfx >>> 16) * 2;
+                    }
+                }
+                break;
+            case 3:
+                for (int dy = destHeight, sfy = sfyi; dy > 0; --dy, sp = spr += (sfy >>> 16) * srcStride, sfy = (sfy & 0xffff) + sfyi, dp = dpr += dpryi) {
+                    for (int dx = destWidth, sfx = sfxi; dx > 0; --dx, dp += dprxi, sfx = (sfx & 0xffff) + sfxi) {
+                        destData[dp] = srcData[sp];
+                        destData[dp + 1] = srcData[sp + 1];
+                        destData[dp + 2] = srcData[sp + 2];
+                        sp += (sfx >>> 16) * 3;
+                    }
+                }
+                break;
+            case 4:
+                for (int dy = destHeight, sfy = sfyi; dy > 0; --dy, sp = spr += (sfy >>> 16) * srcStride, sfy = (sfy & 0xffff) + sfyi, dp = dpr += dpryi) {
+                    for (int dx = destWidth, sfx = sfxi; dx > 0; --dx, dp += dprxi, sfx = (sfx & 0xffff) + sfxi) {
+                        destData[dp] = srcData[sp];
+                        destData[dp + 1] = srcData[sp + 1];
+                        destData[dp + 2] = srcData[sp + 2];
+                        destData[dp + 3] = srcData[sp + 3];
+                        sp += (sfx >>> 16) * 4;
+                    }
+                }
+                break;
+        default:
+        }
+        return;
+    }
+    /*** Comprehensive blit (apply transformations) ***/
+    int srcRedShift = getChannelShift(srcRedMask);
+    byte[] srcReds = ANY_TO_EIGHT[getChannelWidth(srcRedMask, srcRedShift)];
+    int srcGreenShift = getChannelShift(srcGreenMask);
+    byte[] srcGreens = ANY_TO_EIGHT[getChannelWidth(srcGreenMask, srcGreenShift)];
+    int srcBlueShift = getChannelShift(srcBlueMask);
+    byte[] srcBlues = ANY_TO_EIGHT[getChannelWidth(srcBlueMask, srcBlueShift)];
+    int srcAlphaShift = getChannelShift(srcAlphaMask);
+    byte[] srcAlphas = ANY_TO_EIGHT[getChannelWidth(srcAlphaMask, srcAlphaShift)];
+
+    int destRedShift = getChannelShift(destRedMask);
+    int destRedWidth = getChannelWidth(destRedMask, destRedShift);
+    byte[] destReds = ANY_TO_EIGHT[destRedWidth];
+    int destRedPreShift = 8 - destRedWidth;
+    int destGreenShift = getChannelShift(destGreenMask);
+    int destGreenWidth = getChannelWidth(destGreenMask, destGreenShift);
+    byte[] destGreens = ANY_TO_EIGHT[destGreenWidth];
+    int destGreenPreShift = 8 - destGreenWidth;
+    int destBlueShift = getChannelShift(destBlueMask);
+    int destBlueWidth = getChannelWidth(destBlueMask, destBlueShift);
+    byte[] destBlues = ANY_TO_EIGHT[destBlueWidth];
+    int destBluePreShift = 8 - destBlueWidth;
+    int destAlphaShift = getChannelShift(destAlphaMask);
+    int destAlphaWidth = getChannelWidth(destAlphaMask, destAlphaShift);
+    byte[] destAlphas = ANY_TO_EIGHT[destAlphaWidth];
+    int destAlphaPreShift = 8 - destAlphaWidth;
+
+    int ap = apr, alpha = alphaMode;
+    int r = 0, g = 0, b = 0, a = 0;
+    int rq = 0, gq = 0, bq = 0, aq = 0;
+    for (int dy = destHeight, sfy = sfyi; dy > 0; --dy,
+            sp = spr += (sfy >>> 16) * srcStride,
+            ap = apr += (sfy >>> 16) * alphaStride,
+            sfy = (sfy & 0xffff) + sfyi,
+            dp = dpr += dpryi) {
+        for (int dx = destWidth, sfx = sfxi; dx > 0; --dx,
+                dp += dprxi,
+                sfx = (sfx & 0xffff) + sfxi) {
+            /*** READ NEXT PIXEL ***/
+            switch (stype) {
+                case TYPE_GENERIC_8: {
+                    int data = srcData[sp] & 0xff;
+                    sp += (sfx >>> 16);
+                    r = srcReds[(data & srcRedMask) >>> srcRedShift] & 0xff;
+                    g = srcGreens[(data & srcGreenMask) >>> srcGreenShift] & 0xff;
+                    b = srcBlues[(data & srcBlueMask) >>> srcBlueShift] & 0xff;
+                    a = srcAlphas[(data & srcAlphaMask) >>> srcAlphaShift] & 0xff;
+                } break;
+                case TYPE_GENERIC_16_MSB: {
+                    int data = ((srcData[sp] & 0xff) << 8) | (srcData[sp + 1] & 0xff);
+                    sp += (sfx >>> 16) * 2;
+                    r = srcReds[(data & srcRedMask) >>> srcRedShift] & 0xff;
+                    g = srcGreens[(data & srcGreenMask) >>> srcGreenShift] & 0xff;
+                    b = srcBlues[(data & srcBlueMask) >>> srcBlueShift] & 0xff;
+                    a = srcAlphas[(data & srcAlphaMask) >>> srcAlphaShift] & 0xff;
+                } break;
+                case TYPE_GENERIC_16_LSB: {
+                    int data = ((srcData[sp + 1] & 0xff) << 8) | (srcData[sp] & 0xff);
+                    sp += (sfx >>> 16) * 2;
+                    r = srcReds[(data & srcRedMask) >>> srcRedShift] & 0xff;
+                    g = srcGreens[(data & srcGreenMask) >>> srcGreenShift] & 0xff;
+                    b = srcBlues[(data & srcBlueMask) >>> srcBlueShift] & 0xff;
+                    a = srcAlphas[(data & srcAlphaMask) >>> srcAlphaShift] & 0xff;
+                } break;
+                case TYPE_GENERIC_24: {
+                    int data = (( ((srcData[sp] & 0xff) << 8) |
+                        (srcData[sp + 1] & 0xff)) << 8) |
+                        (srcData[sp + 2] & 0xff);
+                    sp += (sfx >>> 16) * 3;
+                    r = srcReds[(data & srcRedMask) >>> srcRedShift] & 0xff;
+                    g = srcGreens[(data & srcGreenMask) >>> srcGreenShift] & 0xff;
+                    b = srcBlues[(data & srcBlueMask) >>> srcBlueShift] & 0xff;
+                    a = srcAlphas[(data & srcAlphaMask) >>> srcAlphaShift] & 0xff;
+                } break;
+                case TYPE_GENERIC_32_MSB: {
+                    int data = (( (( ((srcData[sp] & 0xff) << 8) |
+                        (srcData[sp + 1] & 0xff)) << 8) |
+                        (srcData[sp + 2] & 0xff)) << 8) |
+                        (srcData[sp + 3] & 0xff);
+                    sp += (sfx >>> 16) * 4;
+                    r = srcReds[(data & srcRedMask) >>> srcRedShift] & 0xff;
+                    g = srcGreens[(data & srcGreenMask) >>> srcGreenShift] & 0xff;
+                    b = srcBlues[(data & srcBlueMask) >>> srcBlueShift] & 0xff;
+                    a = srcAlphas[(data & srcAlphaMask) >>> srcAlphaShift] & 0xff;
+                } break;
+                case TYPE_GENERIC_32_LSB: {
+                    int data = (( (( ((srcData[sp + 3] & 0xff) << 8) |
+                        (srcData[sp + 2] & 0xff)) << 8) |
+                        (srcData[sp + 1] & 0xff)) << 8) |
+                        (srcData[sp] & 0xff);
+                    sp += (sfx >>> 16) * 4;
+                    r = srcReds[(data & srcRedMask) >>> srcRedShift] & 0xff;
+                    g = srcGreens[(data & srcGreenMask) >>> srcGreenShift] & 0xff;
+                    b = srcBlues[(data & srcBlueMask) >>> srcBlueShift] & 0xff;
+                    a = srcAlphas[(data & srcAlphaMask) >>> srcAlphaShift] & 0xff;
+                } break;
+                default:
+            }
+
+            /*** DO SPECIAL PROCESSING IF REQUIRED ***/
+            switch (alphaMode) {
+                case ALPHA_CHANNEL_SEPARATE:
+                    alpha = ((alphaData[ap] & 0xff) << 16) / 255;
+                    ap += (sfx >> 16);
+                    break;
+                case ALPHA_CHANNEL_SOURCE:
+                    alpha = (a << 16) / 255;
+                    break;
+                case ALPHA_MASK_UNPACKED:
+                    alpha = (alphaData[ap] !is 0) ? 0x10000 : 0;
+                    ap += (sfx >> 16);
+                    break;
+                case ALPHA_MASK_PACKED:
+                    alpha = (alphaData[ap >> 3] << ((ap & 7) + 9)) & 0x10000;
+                    ap += (sfx >> 16);
+                    break;
+                case ALPHA_MASK_RGB:
+                    alpha = 0x10000;
+                    for (int i = 0; i < alphaData.length; i += 3) {
+                        if ((r is alphaData[i]) && (g is alphaData[i + 1]) && (b is alphaData[i + 2])) {
+                            alpha = 0x0000;
+                            break;
+                        }
+                    }
+                    break;
+                default:
+            }
+            if (alpha !is 0x10000) {
+                if (alpha is 0x0000) continue;
+                switch (dtype) {
+                    case TYPE_GENERIC_8: {
+                        int data = destData[dp] & 0xff;
+                        rq = destReds[(data & destRedMask) >>> destRedShift] & 0xff;
+                        gq = destGreens[(data & destGreenMask) >>> destGreenShift] & 0xff;
+                        bq = destBlues[(data & destBlueMask) >>> destBlueShift] & 0xff;
+                        aq = destAlphas[(data & destAlphaMask) >>> destAlphaShift] & 0xff;
+                    } break;
+                    case TYPE_GENERIC_16_MSB: {
+                        int data = ((destData[dp] & 0xff) << 8) | (destData[dp + 1] & 0xff);
+                        rq = destReds[(data & destRedMask) >>> destRedShift] & 0xff;
+                        gq = destGreens[(data & destGreenMask) >>> destGreenShift] & 0xff;
+                        bq = destBlues[(data & destBlueMask) >>> destBlueShift] & 0xff;
+                        aq = destAlphas[(data & destAlphaMask) >>> destAlphaShift] & 0xff;
+                    } break;
+                    case TYPE_GENERIC_16_LSB: {
+                        int data = ((destData[dp + 1] & 0xff) << 8) | (destData[dp] & 0xff);
+                        rq = destReds[(data & destRedMask) >>> destRedShift] & 0xff;
+                        gq = destGreens[(data & destGreenMask) >>> destGreenShift] & 0xff;
+                        bq = destBlues[(data & destBlueMask) >>> destBlueShift] & 0xff;
+                        aq = destAlphas[(data & destAlphaMask) >>> destAlphaShift] & 0xff;
+                    } break;
+                    case TYPE_GENERIC_24: {
+                        int data = (( ((destData[dp] & 0xff) << 8) |
+                            (destData[dp + 1] & 0xff)) << 8) |
+                            (destData[dp + 2] & 0xff);
+                        rq = destReds[(data & destRedMask) >>> destRedShift] & 0xff;
+                        gq = destGreens[(data & destGreenMask) >>> destGreenShift] & 0xff;
+                        bq = destBlues[(data & destBlueMask) >>> destBlueShift] & 0xff;
+                        aq = destAlphas[(data & destAlphaMask) >>> destAlphaShift] & 0xff;
+                    } break;
+                    case TYPE_GENERIC_32_MSB: {
+                        int data = (( (( ((destData[dp] & 0xff) << 8) |
+                            (destData[dp + 1] & 0xff)) << 8) |
+                            (destData[dp + 2] & 0xff)) << 8) |
+                            (destData[dp + 3] & 0xff);
+                        rq = destReds[(data & destRedMask) >>> destRedShift] & 0xff;
+                        gq = destGreens[(data & destGreenMask) >>> destGreenShift] & 0xff;
+                        bq = destBlues[(data & destBlueMask) >>> destBlueShift] & 0xff;
+                        aq = destAlphas[(data & destAlphaMask) >>> destAlphaShift] & 0xff;
+                    } break;
+                    case TYPE_GENERIC_32_LSB: {
+                        int data = (( (( ((destData[dp + 3] & 0xff) << 8) |
+                            (destData[dp + 2] & 0xff)) << 8) |
+                            (destData[dp + 1] & 0xff)) << 8) |
+                            (destData[dp] & 0xff);
+                        rq = destReds[(data & destRedMask) >>> destRedShift] & 0xff;
+                        gq = destGreens[(data & destGreenMask) >>> destGreenShift] & 0xff;
+                        bq = destBlues[(data & destBlueMask) >>> destBlueShift] & 0xff;
+                        aq = destAlphas[(data & destAlphaMask) >>> destAlphaShift] & 0xff;
+                    } break;
+                    default:
+                }
+                // Perform alpha blending
+                a = aq + ((a - aq) * alpha >> 16);
+                r = rq + ((r - rq) * alpha >> 16);
+                g = gq + ((g - gq) * alpha >> 16);
+                b = bq + ((b - bq) * alpha >> 16);
+            }
+
+            /*** WRITE NEXT PIXEL ***/
+            int data =
+                (r >>> destRedPreShift << destRedShift) |
+                (g >>> destGreenPreShift << destGreenShift) |
+                (b >>> destBluePreShift << destBlueShift) |
+                (a >>> destAlphaPreShift << destAlphaShift);
+            switch (dtype) {
+                case TYPE_GENERIC_8: {
+                    destData[dp] = cast(byte) data;
+                } break;
+                case TYPE_GENERIC_16_MSB: {
+                    destData[dp] = cast(byte) (data >>> 8);
+                    destData[dp + 1] = cast(byte) (data & 0xff);
+                } break;
+                case TYPE_GENERIC_16_LSB: {
+                    destData[dp] = cast(byte) (data & 0xff);
+                    destData[dp + 1] = cast(byte) (data >>> 8);
+                } break;
+                case TYPE_GENERIC_24: {
+                    destData[dp] = cast(byte) (data >>> 16);
+                    destData[dp + 1] = cast(byte) (data >>> 8);
+                    destData[dp + 2] = cast(byte) (data & 0xff);
+                } break;
+                case TYPE_GENERIC_32_MSB: {
+                    destData[dp] = cast(byte) (data >>> 24);
+                    destData[dp + 1] = cast(byte) (data >>> 16);
+                    destData[dp + 2] = cast(byte) (data >>> 8);
+                    destData[dp + 3] = cast(byte) (data & 0xff);
+                } break;
+                case TYPE_GENERIC_32_LSB: {
+                    destData[dp] = cast(byte) (data & 0xff);
+                    destData[dp + 1] = cast(byte) (data >>> 8);
+                    destData[dp + 2] = cast(byte) (data >>> 16);
+                    destData[dp + 3] = cast(byte) (data >>> 24);
+                } break;
+                default:
+            }
+        }
+    }
+}
+
+/**
+ * Blits an index palette image into an index palette image.
+ * <p>
+ * Note: The source and destination red, green, and blue
+ * arrays may be null if no alpha blending or dither is to be
+ * performed.
+ * </p>
+ *
+ * @param op the blitter operation: a combination of BLIT_xxx flags
+ *        (see BLIT_xxx constants)
+ * @param srcData the source byte array containing image data
+ * @param srcDepth the source depth: one of 1, 2, 4, 8
+ * @param srcStride the source number of bytes per line
+ * @param srcOrder the source byte ordering: one of MSB_FIRST or LSB_FIRST;
+ *        ignored if srcDepth is not 1
+ * @param srcX the top-left x-coord of the source blit region
+ * @param srcY the top-left y-coord of the source blit region
+ * @param srcWidth the width of the source blit region
+ * @param srcHeight the height of the source blit region
+ * @param srcReds the source palette red component intensities
+ * @param srcGreens the source palette green component intensities
+ * @param srcBlues the source palette blue component intensities
+ * @param alphaMode the alpha blending or mask mode, may be
+ *        an integer 0-255 for global alpha; ignored if BLIT_ALPHA
+ *        not specified in the blitter operations
+ *        (see ALPHA_MODE_xxx constants)
+ * @param alphaData the alpha blending or mask data, varies depending
+ *        on the value of alphaMode and sometimes ignored
+ * @param alphaStride the alpha data number of bytes per line
+ * @param alphaX the top-left x-coord of the alpha blit region
+ * @param alphaY the top-left y-coord of the alpha blit region
+ * @param destData the destination byte array containing image data
+ * @param destDepth the destination depth: one of 1, 2, 4, 8
+ * @param destStride the destination number of bytes per line
+ * @param destOrder the destination byte ordering: one of MSB_FIRST or LSB_FIRST;
+ *        ignored if destDepth is not 1
+ * @param destX the top-left x-coord of the destination blit region
+ * @param destY the top-left y-coord of the destination blit region
+ * @param destWidth the width of the destination blit region
+ * @param destHeight the height of the destination blit region
+ * @param destReds the destination palette red component intensities
+ * @param destGreens the destination palette green component intensities
+ * @param destBlues the destination palette blue component intensities
+ * @param flipX if true the resulting image is flipped along the vertical axis
+ * @param flipY if true the resulting image is flipped along the horizontal axis
+ */
+static void blit(int op,
+    byte[] srcData, int srcDepth, int srcStride, int srcOrder,
+    int srcX, int srcY, int srcWidth, int srcHeight,
+    byte[] srcReds, byte[] srcGreens, byte[] srcBlues,
+    int alphaMode, byte[] alphaData, int alphaStride, int alphaX, int alphaY,
+    byte[] destData, int destDepth, int destStride, int destOrder,
+    int destX, int destY, int destWidth, int destHeight,
+    byte[] destReds, byte[] destGreens, byte[] destBlues,
+    bool flipX, bool flipY) {
+
+    static_this();
+
+    if ((destWidth <= 0) || (destHeight <= 0) || (alphaMode is ALPHA_TRANSPARENT)) return;
+
+    /*** Prepare scaling data ***/
+    int dwm1 = destWidth - 1;
+    int sfxi = (dwm1 !is 0) ? cast(int)(((cast(long)srcWidth << 16) - 1) / dwm1) : 0;
+    int dhm1 = destHeight - 1;
+    int sfyi = (dhm1 !is 0) ? cast(int)(((cast(long)srcHeight << 16) - 1) / dhm1) : 0;
+
+    /*** Prepare source-related data ***/
+    int stype;
+    switch (srcDepth) {
+        case 8:
+            stype = TYPE_INDEX_8;
+            break;
+        case 4:
+            srcStride <<= 1;
+            stype = TYPE_INDEX_4;
+            break;
+        case 2:
+            srcStride <<= 2;
+            stype = TYPE_INDEX_2;
+            break;
+        case 1:
+            srcStride <<= 3;
+            stype = (srcOrder is MSB_FIRST) ? TYPE_INDEX_1_MSB : TYPE_INDEX_1_LSB;
+            break;
+        default:
+            //throw new IllegalArgumentException("Invalid source type");
+            return;
+    }
+    int spr = srcY * srcStride + srcX;
+
+    /*** Prepare destination-related data ***/
+    int dtype;
+    switch (destDepth) {
+        case 8:
+            dtype = TYPE_INDEX_8;
+            break;
+        case 4:
+            destStride <<= 1;
+            dtype = TYPE_INDEX_4;
+            break;
+        case 2:
+            destStride <<= 2;
+            dtype = TYPE_INDEX_2;
+            break;
+        case 1:
+            destStride <<= 3;
+            dtype = (destOrder is MSB_FIRST) ? TYPE_INDEX_1_MSB : TYPE_INDEX_1_LSB;
+            break;
+        default:
+            //throw new IllegalArgumentException("Invalid source type");
+            return;
+    }
+    int dpr = ((flipY) ? destY + dhm1 : destY) * destStride + ((flipX) ? destX + dwm1 : destX);
+    int dprxi = (flipX) ? -1 : 1;
+    int dpryi = (flipY) ? -destStride : destStride;
+
+    /*** Prepare special processing data ***/
+    int apr;
+    if ((op & BLIT_ALPHA) !is 0) {
+        switch (alphaMode) {
+            case ALPHA_MASK_UNPACKED:
+            case ALPHA_CHANNEL_SEPARATE:
+                if (alphaData is null) alphaMode = 0x10000;
+                apr = alphaY * alphaStride + alphaX;
+                break;
+            case ALPHA_MASK_PACKED:
+                if (alphaData is null) alphaMode = 0x10000;
+                alphaStride <<= 3;
+                apr = alphaY * alphaStride + alphaX;
+                break;
+            case ALPHA_MASK_INDEX:
+            case ALPHA_MASK_RGB:
+                if (alphaData is null) alphaMode = 0x10000;
+                apr = 0;
+                break;
+            default:
+                alphaMode = (alphaMode << 16) / 255; // prescale
+            case ALPHA_CHANNEL_SOURCE:
+                apr = 0;
+                break;
+        }
+    } else {
+        alphaMode = 0x10000;
+        apr = 0;
+    }
+    bool ditherEnabled = (op & BLIT_DITHER) !is 0;
+
+    /*** Blit ***/
+    int dp = dpr;
+    int sp = spr;
+    int ap = apr;
+    int destPaletteSize = 1 << destDepth;
+    if ((destReds !is null) && (destReds.length < destPaletteSize)) destPaletteSize = destReds.length;
+    byte[] paletteMapping = null;
+    bool isExactPaletteMapping = true;
+    switch (alphaMode) {
+        case 0x10000:
+            /*** If the palettes and formats are equivalent use a one-to-one mapping ***/
+            if ((stype is dtype) &&
+                (srcReds is destReds) && (srcGreens is destGreens) && (srcBlues is destBlues)) {
+                paletteMapping = ONE_TO_ONE_MAPPING;
+                break;
+            /*** If palettes have not been supplied, supply a suitable mapping ***/
+            } else if ((srcReds is null) || (destReds is null)) {
+                if (srcDepth <= destDepth) {
+                    paletteMapping = ONE_TO_ONE_MAPPING;
+                } else {
+                    paletteMapping = new byte[1 << srcDepth];
+                    int mask = (0xff << destDepth) >>> 8;
+                    for (int i = 0; i < paletteMapping.length; ++i) paletteMapping[i] = cast(byte)(i & mask);
+                }
+                break;
+            }
+        case ALPHA_MASK_UNPACKED:
+        case ALPHA_MASK_PACKED:
+        case ALPHA_MASK_INDEX:
+        case ALPHA_MASK_RGB:
+            /*** Generate a palette mapping ***/
+            int srcPaletteSize = 1 << srcDepth;
+            paletteMapping = new byte[srcPaletteSize];
+            if ((srcReds !is null) && (srcReds.length < srcPaletteSize)) srcPaletteSize = srcReds.length;
+            for (int i = 0, r, g, b, index; i < srcPaletteSize; ++i) {
+                r = srcReds[i] & 0xff;
+                g = srcGreens[i] & 0xff;
+                b = srcBlues[i] & 0xff;
+                index = 0;
+                int minDistance = 0x7fffffff;
+                for (int j = 0, dr, dg, db, distance; j < destPaletteSize; ++j) {
+                    dr = (destReds[j] & 0xff) - r;
+                    dg = (destGreens[j] & 0xff) - g;
+                    db = (destBlues[j] & 0xff) - b;
+                    distance = dr * dr + dg * dg + db * db;
+                    if (distance < minDistance) {
+                        index = j;
+                        if (distance is 0) break;
+                        minDistance = distance;
+                    }
+                }
+                paletteMapping[i] = cast(byte)index;
+                if (minDistance !is 0) isExactPaletteMapping = false;
+            }
+            break;
+        default:
+    }
+    if ((paletteMapping !is null) && (isExactPaletteMapping || ! ditherEnabled)) {
+        if ((stype is dtype) && (alphaMode is 0x10000)) {
+            /*** Fast blit (copy w/ mapping) ***/
+            switch (stype) {
+                case TYPE_INDEX_8:
+                    for (int dy = destHeight, sfy = sfyi; dy > 0; --dy, sp = spr += (sfy >>> 16) * srcStride, sfy = (sfy & 0xffff) + sfyi, dp = dpr += dpryi) {
+                        for (int dx = destWidth, sfx = sfxi; dx > 0; --dx, dp += dprxi, sfx = (sfx & 0xffff) + sfxi) {
+                            destData[dp] = paletteMapping[srcData[sp] & 0xff];
+                            sp += (sfx >>> 16);
+                        }
+                    }
+                    break;
+                case TYPE_INDEX_4:
+                    for (int dy = destHeight, sfy = sfyi; dy > 0; --dy, sp = spr += (sfy >>> 16) * srcStride, sfy = (sfy & 0xffff) + sfyi, dp = dpr += dpryi) {
+                        for (int dx = destWidth, sfx = sfxi; dx > 0; --dx, dp += dprxi, sfx = (sfx & 0xffff) + sfxi) {
+                            int v;
+                            if ((sp & 1) !is 0) v = paletteMapping[srcData[sp >> 1] & 0x0f];
+                            else v = (srcData[sp >> 1] >>> 4) & 0x0f;
+                            sp += (sfx >>> 16);
+                            if ((dp & 1) !is 0) destData[dp >> 1] = cast(byte)((destData[dp >> 1] & 0xf0) | v);
+                            else destData[dp >> 1] = cast(byte)((destData[dp >> 1] & 0x0f) | (v << 4));
+                        }
+                    }
+                    break;
+                case TYPE_INDEX_2:
+                    for (int dy = destHeight, sfy = sfyi; dy > 0; --dy, sp = spr += (sfy >>> 16) * srcStride, sfy = (sfy & 0xffff) + sfyi, dp = dpr += dpryi) {
+                        for (int dx = destWidth, sfx = sfxi; dx > 0; --dx, dp += dprxi, sfx = (sfx & 0xffff) + sfxi) {
+                            int index = paletteMapping[(srcData[sp >> 2] >>> (6 - (sp & 3) * 2)) & 0x03];
+                            sp += (sfx >>> 16);
+                            int shift = 6 - (dp & 3) * 2;
+                            destData[dp >> 2] = cast(byte)(destData[dp >> 2] & ~(0x03 << shift) | (index << shift));
+                        }
+                    }
+                    break;
+                case TYPE_INDEX_1_MSB:
+                    for (int dy = destHeight, sfy = sfyi; dy > 0; --dy, sp = spr += (sfy >>> 16) * srcStride, sfy = (sfy & 0xffff) + sfyi, dp = dpr += dpryi) {
+                        for (int dx = destWidth, sfx = sfxi; dx > 0; --dx, dp += dprxi, sfx = (sfx & 0xffff) + sfxi) {
+                            int index = paletteMapping[(srcData[sp >> 3] >>> (7 - (sp & 7))) & 0x01];
+                            sp += (sfx >>> 16);
+                            int shift = 7 - (dp & 7);
+                            destData[dp >> 3] = cast(byte)(destData[dp >> 3] & ~(0x01 << shift) | (index << shift));
+                        }
+                    }
+                    break;
+                case TYPE_INDEX_1_LSB:
+                    for (int dy = destHeight, sfy = sfyi; dy > 0; --dy, sp = spr += (sfy >>> 16) * srcStride, sfy = (sfy & 0xffff) + sfyi, dp = dpr += dpryi) {
+                        for (int dx = destWidth, sfx = sfxi; dx > 0; --dx, dp += dprxi, sfx = (sfx & 0xffff) + sfxi) {
+                            int index = paletteMapping[(srcData[sp >> 3] >>> (sp & 7)) & 0x01];
+                            sp += (sfx >>> 16);
+                            int shift = dp & 7;
+                            destData[dp >> 3] = cast(byte)(destData[dp >> 3] & ~(0x01 << shift) | (index << shift));
+                        }
+                    }
+                    break;
+                default:
+            }
+        } else {
+            /*** Convert between indexed modes using mapping and mask ***/
+            for (int dy = destHeight, sfy = sfyi; dy > 0; --dy,
+                    sp = spr += (sfy >>> 16) * srcStride,
+                    sfy = (sfy & 0xffff) + sfyi,
+                    dp = dpr += dpryi) {
+                for (int dx = destWidth, sfx = sfxi; dx > 0; --dx,
+                        dp += dprxi,
+                        sfx = (sfx & 0xffff) + sfxi) {
+                    int index;
+                    /*** READ NEXT PIXEL ***/
+                    switch (stype) {
+                        case TYPE_INDEX_8:
+                            index = srcData[sp] & 0xff;
+                            sp += (sfx >>> 16);
+                            break;
+                        case TYPE_INDEX_4:
+                            if ((sp & 1) !is 0) index = srcData[sp >> 1] & 0x0f;
+                            else index = (srcData[sp >> 1] >>> 4) & 0x0f;
+                            sp += (sfx >>> 16);
+                            break;
+                        case TYPE_INDEX_2:
+                            index = (srcData[sp >> 2] >>> (6 - (sp & 3) * 2)) & 0x03;
+                            sp += (sfx >>> 16);
+                            break;
+                        case TYPE_INDEX_1_MSB:
+                            index = (srcData[sp >> 3] >>> (7 - (sp & 7))) & 0x01;
+                            sp += (sfx >>> 16);
+                            break;
+                        case TYPE_INDEX_1_LSB:
+                            index = (srcData[sp >> 3] >>> (sp & 7)) & 0x01;
+                            sp += (sfx >>> 16);
+                            break;
+                        default:
+                            return;
+                    }
+                    /*** APPLY MASK ***/
+                    switch (alphaMode) {
+                        case ALPHA_MASK_UNPACKED: {
+                            byte mask = alphaData[ap];
+                            ap += (sfx >> 16);
+                            if (mask is 0) continue;
+                        } break;
+                        case ALPHA_MASK_PACKED: {
+                            int mask = alphaData[ap >> 3] & (1 << (ap & 7));
+                            ap += (sfx >> 16);
+                            if (mask is 0) continue;
+                        } break;
+                        case ALPHA_MASK_INDEX: {
+                            int i = 0;
+                            while (i < alphaData.length) {
+                                if (index is (alphaData[i] & 0xff)) break;
+                            }
+                            if (i < alphaData.length) continue;
+                        } break;
+                        case ALPHA_MASK_RGB: {
+                            byte r = srcReds[index], g = srcGreens[index], b = srcBlues[index];
+                            int i = 0;
+                            while (i < alphaData.length) {
+                                if ((r is alphaData[i]) && (g is alphaData[i + 1]) && (b is alphaData[i + 2])) break;
+                                i += 3;
+                            }
+                            if (i < alphaData.length) continue;
+                        } break;
+                        default:
+                    }
+                    index = paletteMapping[index] & 0xff;
+
+                    /*** WRITE NEXT PIXEL ***/
+                    switch (dtype) {
+                        case TYPE_INDEX_8:
+                            destData[dp] = cast(byte) index;
+                            break;
+                        case TYPE_INDEX_4:
+                            if ((dp & 1) !is 0) destData[dp >> 1] = cast(byte)((destData[dp >> 1] & 0xf0) | index);
+                            else destData[dp >> 1] = cast(byte)((destData[dp >> 1] & 0x0f) | (index << 4));
+                            break;
+                        case TYPE_INDEX_2: {
+                            int shift = 6 - (dp & 3) * 2;
+                            destData[dp >> 2] = cast(byte)(destData[dp >> 2] & ~(0x03 << shift) | (index << shift));
+                        } break;
+                        case TYPE_INDEX_1_MSB: {
+                            int shift = 7 - (dp & 7);
+                            destData[dp >> 3] = cast(byte)(destData[dp >> 3] & ~(0x01 << shift) | (index << shift));
+                        } break;
+                        case TYPE_INDEX_1_LSB: {
+                            int shift = dp & 7;
+                            destData[dp >> 3] = cast(byte)(destData[dp >> 3] & ~(0x01 << shift) | (index << shift));
+                        } break;
+                        default:
+                    }
+                }
+            }
+        }
+        return;
+    }
+
+    /*** Comprehensive blit (apply transformations) ***/
+    int alpha = alphaMode;
+    int index = 0;
+    int indexq = 0;
+    int lastindex = 0, lastr = -1, lastg = -1, lastb = -1;
+    int[] rerr, gerr, berr;
+    if (ditherEnabled) {
+        rerr = new int[destWidth + 2];
+        gerr = new int[destWidth + 2];
+        berr = new int[destWidth + 2];
+    } else {
+        rerr = null; gerr = null; berr = null;
+    }
+    for (int dy = destHeight, sfy = sfyi; dy > 0; --dy,
+            sp = spr += (sfy >>> 16) * srcStride,
+            ap = apr += (sfy >>> 16) * alphaStride,
+            sfy = (sfy & 0xffff) + sfyi,
+            dp = dpr += dpryi) {
+        int lrerr = 0, lgerr = 0, lberr = 0;
+        for (int dx = destWidth, sfx = sfxi; dx > 0; --dx,
+                dp += dprxi,
+                sfx = (sfx & 0xffff) + sfxi) {
+            /*** READ NEXT PIXEL ***/
+            switch (stype) {
+                case TYPE_INDEX_8:
+                    index = srcData[sp] & 0xff;
+                    sp += (sfx >>> 16);
+                    break;
+                case TYPE_INDEX_4:
+                    if ((sp & 1) !is 0) index = srcData[sp >> 1] & 0x0f;
+                    else index = (srcData[sp >> 1] >>> 4) & 0x0f;
+                    sp += (sfx >>> 16);
+                    break;
+                case TYPE_INDEX_2:
+                    index = (srcData[sp >> 2] >>> (6 - (sp & 3) * 2)) & 0x03;
+                    sp += (sfx >>> 16);
+                    break;
+                case TYPE_INDEX_1_MSB:
+                    index = (srcData[sp >> 3] >>> (7 - (sp & 7))) & 0x01;
+                    sp += (sfx >>> 16);
+                    break;
+                case TYPE_INDEX_1_LSB:
+                    index = (srcData[sp >> 3] >>> (sp & 7)) & 0x01;
+                    sp += (sfx >>> 16);
+                    break;
+                default:
+            }
+
+            /*** DO SPECIAL PROCESSING IF REQUIRED ***/
+            int r = srcReds[index] & 0xff, g = srcGreens[index] & 0xff, b = srcBlues[index] & 0xff;
+            switch (alphaMode) {
+                case ALPHA_CHANNEL_SEPARATE:
+                    alpha = ((alphaData[ap] & 0xff) << 16) / 255;
+                    ap += (sfx >> 16);
+                    break;
+                case ALPHA_MASK_UNPACKED:
+                    alpha = (alphaData[ap] !is 0) ? 0x10000 : 0;
+                    ap += (sfx >> 16);
+                    break;
+                case ALPHA_MASK_PACKED:
+                    alpha = (alphaData[ap >> 3] << ((ap & 7) + 9)) & 0x10000;
+                    ap += (sfx >> 16);
+                    break;
+                case ALPHA_MASK_INDEX: { // could speed up using binary search if we sorted the indices
+                    int i = 0;
+                    while (i < alphaData.length) {
+                        if (index is (alphaData[i] & 0xff)) break;
+                    }
+                    if (i < alphaData.length) continue;
+                } break;
+                case ALPHA_MASK_RGB: {
+                    int i = 0;
+                    while (i < alphaData.length) {
+                        if ((r is (alphaData[i] & 0xff)) &&
+                            (g is (alphaData[i + 1] & 0xff)) &&
+                            (b is (alphaData[i + 2] & 0xff))) break;
+                        i += 3;
+                    }
+                    if (i < alphaData.length) continue;
+                } break;
+                default:
+            }
+            if (alpha !is 0x10000) {
+                if (alpha is 0x0000) continue;
+                switch (dtype) {
+                    case TYPE_INDEX_8:
+                        indexq = destData[dp] & 0xff;
+                        break;
+                    case TYPE_INDEX_4:
+                        if ((dp & 1) !is 0) indexq = destData[dp >> 1] & 0x0f;
+                        else indexq = (destData[dp >> 1] >>> 4) & 0x0f;
+                        break;
+                    case TYPE_INDEX_2:
+                        indexq = (destData[dp >> 2] >>> (6 - (dp & 3) * 2)) & 0x03;
+                        break;
+                    case TYPE_INDEX_1_MSB:
+                        indexq = (destData[dp >> 3] >>> (7 - (dp & 7))) & 0x01;
+                        break;
+                    case TYPE_INDEX_1_LSB:
+                        indexq = (destData[dp >> 3] >>> (dp & 7)) & 0x01;
+                        break;
+                    default:
+                }
+                // Perform alpha blending
+                int rq = destReds[indexq] & 0xff;
+                int gq = destGreens[indexq] & 0xff;
+                int bq = destBlues[indexq] & 0xff;
+                r = rq + ((r - rq) * alpha >> 16);
+                g = gq + ((g - gq) * alpha >> 16);
+                b = bq + ((b - bq) * alpha >> 16);
+            }
+
+            /*** MAP COLOR TO THE PALETTE ***/
+            if (ditherEnabled) {
+                // Floyd-Steinberg error diffusion
+                r += rerr[dx] >> 4;
+                if (r < 0) r = 0; else if (r > 255) r = 255;
+                g += gerr[dx] >> 4;
+                if (g < 0) g = 0; else if (g > 255) g = 255;
+                b += berr[dx] >> 4;
+                if (b < 0) b = 0; else if (b > 255) b = 255;
+                rerr[dx] = lrerr;
+                gerr[dx] = lgerr;
+                berr[dx] = lberr;
+            }
+            if (r !is lastr || g !is lastg || b !is lastb) {
+                // moving the variable declarations out seems to make the JDK JIT happier...
+                for (int j = 0, dr, dg, db, distance, minDistance = 0x7fffffff; j < destPaletteSize; ++j) {
+                    dr = (destReds[j] & 0xff) - r;
+                    dg = (destGreens[j] & 0xff) - g;
+                    db = (destBlues[j] & 0xff) - b;
+                    distance = dr * dr + dg * dg + db * db;
+                    if (distance < minDistance) {
+                        lastindex = j;
+                        if (distance is 0) break;
+                        minDistance = distance;
+                    }
+                }
+                lastr = r; lastg = g; lastb = b;
+            }
+            if (ditherEnabled) {
+                // Floyd-Steinberg error diffusion, cont'd...
+                int dxm1 = dx - 1, dxp1 = dx + 1;
+                int acc;
+                rerr[dxp1] += acc = (lrerr = r - (destReds[lastindex] & 0xff)) + lrerr + lrerr;
+                rerr[dx] += acc += lrerr + lrerr;
+                rerr[dxm1] += acc + lrerr + lrerr;
+                gerr[dxp1] += acc = (lgerr = g - (destGreens[lastindex] & 0xff)) + lgerr + lgerr;
+                gerr[dx] += acc += lgerr + lgerr;
+                gerr[dxm1] += acc + lgerr + lgerr;
+                berr[dxp1] += acc = (lberr = b - (destBlues[lastindex] & 0xff)) + lberr + lberr;
+                berr[dx] += acc += lberr + lberr;
+                berr[dxm1] += acc + lberr + lberr;
+            }
+
+            /*** WRITE NEXT PIXEL ***/
+            switch (dtype) {
+                case TYPE_INDEX_8:
+                    destData[dp] = cast(byte) lastindex;
+                    break;
+                case TYPE_INDEX_4:
+                    if ((dp & 1) !is 0) destData[dp >> 1] = cast(byte)((destData[dp >> 1] & 0xf0) | lastindex);
+                    else destData[dp >> 1] = cast(byte)((destData[dp >> 1] & 0x0f) | (lastindex << 4));
+                    break;
+                case TYPE_INDEX_2: {
+                    int shift = 6 - (dp & 3) * 2;
+                    destData[dp >> 2] = cast(byte)(destData[dp >> 2] & ~(0x03 << shift) | (lastindex << shift));
+                } break;
+                case TYPE_INDEX_1_MSB: {
+                    int shift = 7 - (dp & 7);
+                    destData[dp >> 3] = cast(byte)(destData[dp >> 3] & ~(0x01 << shift) | (lastindex << shift));
+                } break;
+                case TYPE_INDEX_1_LSB: {
+                    int shift = dp & 7;
+                    destData[dp >> 3] = cast(byte)(destData[dp >> 3] & ~(0x01 << shift) | (lastindex << shift));
+                } break;
+                default:
+            }
+        }
+    }
+}
+
+/**
+ * Blits an index palette image into a direct palette image.
+ * <p>
+ * Note: The source and destination masks and palettes must
+ * always be fully specified.
+ * </p>
+ *
+ * @param op the blitter operation: a combination of BLIT_xxx flags
+ *        (see BLIT_xxx constants)
+ * @param srcData the source byte array containing image data
+ * @param srcDepth the source depth: one of 1, 2, 4, 8
+ * @param srcStride the source number of bytes per line
+ * @param srcOrder the source byte ordering: one of MSB_FIRST or LSB_FIRST;
+ *        ignored if srcDepth is not 1
+ * @param srcX the top-left x-coord of the source blit region
+ * @param srcY the top-left y-coord of the source blit region
+ * @param srcWidth the width of the source blit region
+ * @param srcHeight the height of the source blit region
+ * @param srcReds the source palette red component intensities
+ * @param srcGreens the source palette green component intensities
+ * @param srcBlues the source palette blue component intensities
+ * @param alphaMode the alpha blending or mask mode, may be
+ *        an integer 0-255 for global alpha; ignored if BLIT_ALPHA
+ *        not specified in the blitter operations
+ *        (see ALPHA_MODE_xxx constants)
+ * @param alphaData the alpha blending or mask data, varies depending
+ *        on the value of alphaMode and sometimes ignored
+ * @param alphaStride the alpha data number of bytes per line
+ * @param alphaX the top-left x-coord of the alpha blit region
+ * @param alphaY the top-left y-coord of the alpha blit region
+ * @param destData the destination byte array containing image data
+ * @param destDepth the destination depth: one of 8, 16, 24, 32
+ * @param destStride the destination number of bytes per line
+ * @param destOrder the destination byte ordering: one of MSB_FIRST or LSB_FIRST;
+ *        ignored if destDepth is not 16 or 32
+ * @param destX the top-left x-coord of the destination blit region
+ * @param destY the top-left y-coord of the destination blit region
+ * @param destWidth the width of the destination blit region
+ * @param destHeight the height of the destination blit region
+ * @param destRedMask the destination red channel mask
+ * @param destGreenMask the destination green channel mask
+ * @param destBlueMask the destination blue channel mask
+ * @param flipX if true the resulting image is flipped along the vertical axis
+ * @param flipY if true the resulting image is flipped along the horizontal axis
+ */
+static void blit(int op,
+    byte[] srcData, int srcDepth, int srcStride, int srcOrder,
+    int srcX, int srcY, int srcWidth, int srcHeight,
+    byte[] srcReds, byte[] srcGreens, byte[] srcBlues,
+    int alphaMode, byte[] alphaData, int alphaStride, int alphaX, int alphaY,
+    byte[] destData, int destDepth, int destStride, int destOrder,
+    int destX, int destY, int destWidth, int destHeight,
+    int destRedMask, int destGreenMask, int destBlueMask,
+    bool flipX, bool flipY) {
+
+    static_this();
+
+    if ((destWidth <= 0) || (destHeight <= 0) || (alphaMode is ALPHA_TRANSPARENT)) return;
+
+    // these should be supplied as params later
+    int destAlphaMask = 0;
+
+    /*** Prepare scaling data ***/
+    int dwm1 = destWidth - 1;
+    int sfxi = (dwm1 !is 0) ? cast(int)(((cast(long)srcWidth << 16) - 1) / dwm1) : 0;
+    int dhm1 = destHeight - 1;
+    int sfyi = (dhm1 !is 0) ? cast(int)(((cast(long)srcHeight << 16) - 1) / dhm1) : 0;
+
+    /*** Prepare source-related data ***/
+    int stype;
+    switch (srcDepth) {
+        case 8:
+            stype = TYPE_INDEX_8;
+            break;
+        case 4:
+            srcStride <<= 1;
+            stype = TYPE_INDEX_4;
+            break;
+        case 2:
+            srcStride <<= 2;
+            stype = TYPE_INDEX_2;
+            break;
+        case 1:
+            srcStride <<= 3;
+            stype = (srcOrder is MSB_FIRST) ? TYPE_INDEX_1_MSB : TYPE_INDEX_1_LSB;
+            break;
+        default:
+            //throw new IllegalArgumentException("Invalid source type");
+            return;
+    }
+    int spr = srcY * srcStride + srcX;
+
+    /*** Prepare destination-related data ***/
+    int dbpp, dtype;
+    switch (destDepth) {
+        case 8:
+            dbpp = 1;
+            dtype = TYPE_GENERIC_8;
+            break;
+        case 16:
+            dbpp = 2;
+            dtype = (destOrder is MSB_FIRST) ? TYPE_GENERIC_16_MSB : TYPE_GENERIC_16_LSB;
+            break;
+        case 24:
+            dbpp = 3;
+            dtype = TYPE_GENERIC_24;
+            break;
+        case 32:
+            dbpp = 4;
+            dtype = (destOrder is MSB_FIRST) ? TYPE_GENERIC_32_MSB : TYPE_GENERIC_32_LSB;
+            break;
+        default:
+            //throw new IllegalArgumentException("Invalid destination type");
+            return;
+    }
+    int dpr = ((flipY) ? destY + dhm1 : destY) * destStride + ((flipX) ? destX + dwm1 : destX) * dbpp;
+    int dprxi = (flipX) ? -dbpp : dbpp;
+    int dpryi = (flipY) ? -destStride : destStride;
+
+    /*** Prepare special processing data ***/
+    int apr;
+    if ((op & BLIT_ALPHA) !is 0) {
+        switch (alphaMode) {
+            case ALPHA_MASK_UNPACKED:
+            case ALPHA_CHANNEL_SEPARATE:
+                if (alphaData is null) alphaMode = 0x10000;
+                apr = alphaY * alphaStride + alphaX;
+                break;
+            case ALPHA_MASK_PACKED:
+                if (alphaData is null) alphaMode = 0x10000;
+                alphaStride <<= 3;
+                apr = alphaY * alphaStride + alphaX;
+                break;
+            case ALPHA_MASK_INDEX:
+            case ALPHA_MASK_RGB:
+                if (alphaData is null) alphaMode = 0x10000;
+                apr = 0;
+                break;
+            default:
+                alphaMode = (alphaMode << 16) / 255; // prescale
+            case ALPHA_CHANNEL_SOURCE:
+                apr = 0;
+                break;
+        }
+    } else {
+        alphaMode = 0x10000;
+        apr = 0;
+    }
+
+    /*** Comprehensive blit (apply transformations) ***/
+    int destRedShift = getChannelShift(destRedMask);
+    int destRedWidth = getChannelWidth(destRedMask, destRedShift);
+    byte[] destReds = ANY_TO_EIGHT[destRedWidth];
+    int destRedPreShift = 8 - destRedWidth;
+    int destGreenShift = getChannelShift(destGreenMask);
+    int destGreenWidth = getChannelWidth(destGreenMask, destGreenShift);
+    byte[] destGreens = ANY_TO_EIGHT[destGreenWidth];
+    int destGreenPreShift = 8 - destGreenWidth;
+    int destBlueShift = getChannelShift(destBlueMask);
+    int destBlueWidth = getChannelWidth(destBlueMask, destBlueShift);
+    byte[] destBlues = ANY_TO_EIGHT[destBlueWidth];
+    int destBluePreShift = 8 - destBlueWidth;
+    int destAlphaShift = getChannelShift(destAlphaMask);
+    int destAlphaWidth = getChannelWidth(destAlphaMask, destAlphaShift);
+    byte[] destAlphas = ANY_TO_EIGHT[destAlphaWidth];
+    int destAlphaPreShift = 8 - destAlphaWidth;
+
+    int dp = dpr;
+    int sp = spr;
+    int ap = apr, alpha = alphaMode;
+    int r = 0, g = 0, b = 0, a = 0, index = 0;
+    int rq = 0, gq = 0, bq = 0, aq = 0;
+    for (int dy = destHeight, sfy = sfyi; dy > 0; --dy,
+            sp = spr += (sfy >>> 16) * srcStride,
+            ap = apr += (sfy >>> 16) * alphaStride,
+            sfy = (sfy & 0xffff) + sfyi,
+            dp = dpr += dpryi) {
+        for (int dx = destWidth, sfx = sfxi; dx > 0; --dx,
+                dp += dprxi,
+                sfx = (sfx & 0xffff) + sfxi) {
+            /*** READ NEXT PIXEL ***/
+            switch (stype) {
+                case TYPE_INDEX_8:
+                    index = srcData[sp] & 0xff;
+                    sp += (sfx >>> 16);
+                    break;
+                case TYPE_INDEX_4:
+                    if ((sp & 1) !is 0) index = srcData[sp >> 1] & 0x0f;
+                    else index = (srcData[sp >> 1] >>> 4) & 0x0f;
+                    sp += (sfx >>> 16);
+                    break;
+                case TYPE_INDEX_2:
+                    index = (srcData[sp >> 2] >>> (6 - (sp & 3) * 2)) & 0x03;
+                    sp += (sfx >>> 16);
+                    break;
+                case TYPE_INDEX_1_MSB:
+                    index = (srcData[sp >> 3] >>> (7 - (sp & 7))) & 0x01;
+                    sp += (sfx >>> 16);
+                    break;
+                case TYPE_INDEX_1_LSB:
+                    index = (srcData[sp >> 3] >>> (sp & 7)) & 0x01;
+                    sp += (sfx >>> 16);
+                    break;
+                default:
+            }
+
+            /*** DO SPECIAL PROCESSING IF REQUIRED ***/
+            r = srcReds[index] & 0xff;
+            g = srcGreens[index] & 0xff;
+            b = srcBlues[index] & 0xff;
+            switch (alphaMode) {
+                case ALPHA_CHANNEL_SEPARATE:
+                    alpha = ((alphaData[ap] & 0xff) << 16) / 255;
+                    ap += (sfx >> 16);
+                    break;
+                case ALPHA_MASK_UNPACKED:
+                    alpha = (alphaData[ap] !is 0) ? 0x10000 : 0;
+                    ap += (sfx >> 16);
+                    break;
+                case ALPHA_MASK_PACKED:
+                    alpha = (alphaData[ap >> 3] << ((ap & 7) + 9)) & 0x10000;
+                    ap += (sfx >> 16);
+                    break;
+                case ALPHA_MASK_INDEX: { // could speed up using binary search if we sorted the indices
+                    int i = 0;
+                    while (i < alphaData.length) {
+                        if (index is (alphaData[i] & 0xff)) break;
+                    }
+                    if (i < alphaData.length) continue;
+                } break;
+                case ALPHA_MASK_RGB: {
+                    int i = 0;
+                    while (i < alphaData.length) {
+                        if ((r is (alphaData[i] & 0xff)) &&
+                            (g is (alphaData[i + 1] & 0xff)) &&
+                            (b is (alphaData[i + 2] & 0xff))) break;
+                        i += 3;
+                    }
+                    if (i < alphaData.length) continue;
+                } break;
+                default:
+            }
+            if (alpha !is 0x10000) {
+                if (alpha is 0x0000) continue;
+                switch (dtype) {
+                    case TYPE_GENERIC_8: {
+                        int data = destData[dp] & 0xff;
+                        rq = destReds[(data & destRedMask) >>> destRedShift] & 0xff;
+                        gq = destGreens[(data & destGreenMask) >>> destGreenShift] & 0xff;
+                        bq = destBlues[(data & destBlueMask) >>> destBlueShift] & 0xff;
+                        aq = destAlphas[(data & destAlphaMask) >>> destAlphaShift] & 0xff;
+                    } break;
+                    case TYPE_GENERIC_16_MSB: {
+                        int data = ((destData[dp] & 0xff) << 8) | (destData[dp + 1] & 0xff);
+                        rq = destReds[(data & destRedMask) >>> destRedShift] & 0xff;
+                        gq = destGreens[(data & destGreenMask) >>> destGreenShift] & 0xff;
+                        bq = destBlues[(data & destBlueMask) >>> destBlueShift] & 0xff;
+                        aq = destAlphas[(data & destAlphaMask) >>> destAlphaShift] & 0xff;
+                    } break;
+                    case TYPE_GENERIC_16_LSB: {
+                        int data = ((destData[dp + 1] & 0xff) << 8) | (destData[dp] & 0xff);
+                        rq = destReds[(data & destRedMask) >>> destRedShift] & 0xff;
+                        gq = destGreens[(data & destGreenMask) >>> destGreenShift] & 0xff;
+                        bq = destBlues[(data & destBlueMask) >>> destBlueShift] & 0xff;
+                        aq = destAlphas[(data & destAlphaMask) >>> destAlphaShift] & 0xff;
+                    } break;
+                    case TYPE_GENERIC_24: {
+                        int data = (( ((destData[dp] & 0xff) << 8) |
+                            (destData[dp + 1] & 0xff)) << 8) |
+                            (destData[dp + 2] & 0xff);
+                        rq = destReds[(data & destRedMask) >>> destRedShift] & 0xff;
+                        gq = destGreens[(data & destGreenMask) >>> destGreenShift] & 0xff;
+                        bq = destBlues[(data & destBlueMask) >>> destBlueShift] & 0xff;
+                        aq = destAlphas[(data & destAlphaMask) >>> destAlphaShift] & 0xff;
+                    } break;
+                    case TYPE_GENERIC_32_MSB: {
+                        int data = (( (( ((destData[dp] & 0xff) << 8) |
+                            (destData[dp + 1] & 0xff)) << 8) |
+                            (destData[dp + 2] & 0xff)) << 8) |
+                            (destData[dp + 3] & 0xff);
+                        rq = destReds[(data & destRedMask) >>> destRedShift] & 0xff;
+                        gq = destGreens[(data & destGreenMask) >>> destGreenShift] & 0xff;
+                        bq = destBlues[(data & destBlueMask) >>> destBlueShift] & 0xff;
+                        aq = destAlphas[(data & destAlphaMask) >>> destAlphaShift] & 0xff;
+                    } break;
+                    case TYPE_GENERIC_32_LSB: {
+                        int data = (( (( ((destData[dp + 3] & 0xff) << 8) |
+                            (destData[dp + 2] & 0xff)) << 8) |
+                            (destData[dp + 1] & 0xff)) << 8) |
+                            (destData[dp] & 0xff);
+                        rq = destReds[(data & destRedMask) >>> destRedShift] & 0xff;
+                        gq = destGreens[(data & destGreenMask) >>> destGreenShift] & 0xff;
+                        bq = destBlues[(data & destBlueMask) >>> destBlueShift] & 0xff;
+                        aq = destAlphas[(data & destAlphaMask) >>> destAlphaShift] & 0xff;
+                    } break;
+                    default:
+                }
+                // Perform alpha blending
+                a = aq + ((a - aq) * alpha >> 16);
+                r = rq + ((r - rq) * alpha >> 16);
+                g = gq + ((g - gq) * alpha >> 16);
+                b = bq + ((b - bq) * alpha >> 16);
+            }
+
+            /*** WRITE NEXT PIXEL ***/
+            int data =
+                (r >>> destRedPreShift << destRedShift) |
+                (g >>> destGreenPreShift << destGreenShift) |
+                (b >>> destBluePreShift << destBlueShift) |
+                (a >>> destAlphaPreShift << destAlphaShift);
+            switch (dtype) {
+                case TYPE_GENERIC_8: {
+                    destData[dp] = cast(byte) data;
+                } break;
+                case TYPE_GENERIC_16_MSB: {
+                    destData[dp] = cast(byte) (data >>> 8);
+                    destData[dp + 1] = cast(byte) (data & 0xff);
+                } break;
+                case TYPE_GENERIC_16_LSB: {
+                    destData[dp] = cast(byte) (data & 0xff);
+                    destData[dp + 1] = cast(byte) (data >>> 8);
+                } break;
+                case TYPE_GENERIC_24: {
+                    destData[dp] = cast(byte) (data >>> 16);
+                    destData[dp + 1] = cast(byte) (data >>> 8);
+                    destData[dp + 2] = cast(byte) (data & 0xff);
+                } break;
+                case TYPE_GENERIC_32_MSB: {
+                    destData[dp] = cast(byte) (data >>> 24);
+                    destData[dp + 1] = cast(byte) (data >>> 16);
+                    destData[dp + 2] = cast(byte) (data >>> 8);
+                    destData[dp + 3] = cast(byte) (data & 0xff);
+                } break;
+                case TYPE_GENERIC_32_LSB: {
+                    destData[dp] = cast(byte) (data & 0xff);
+                    destData[dp + 1] = cast(byte) (data >>> 8);
+                    destData[dp + 2] = cast(byte) (data >>> 16);
+                    destData[dp + 3] = cast(byte) (data >>> 24);
+                } break;
+                default:
+            }
+        }
+    }
+}
+
+/**
+ * Blits a direct palette image into an index palette image.
+ * <p>
+ * Note: The source and destination masks and palettes must
+ * always be fully specified.
+ * </p>
+ *
+ * @param op the blitter operation: a combination of BLIT_xxx flags
+ *        (see BLIT_xxx constants)
+ * @param srcData the source byte array containing image data
+ * @param srcDepth the source depth: one of 8, 16, 24, 32
+ * @param srcStride the source number of bytes per line
+ * @param srcOrder the source byte ordering: one of MSB_FIRST or LSB_FIRST;
+ *        ignored if srcDepth is not 16 or 32
+ * @param srcX the top-left x-coord of the source blit region
+ * @param srcY the top-left y-coord of the source blit region
+ * @param srcWidth the width of the source blit region
+ * @param srcHeight the height of the source blit region
+ * @param srcRedMask the source red channel mask
+ * @param srcGreenMask the source green channel mask
+ * @param srcBlueMask the source blue channel mask
+ * @param alphaMode the alpha blending or mask mode, may be
+ *        an integer 0-255 for global alpha; ignored if BLIT_ALPHA
+ *        not specified in the blitter operations
+ *        (see ALPHA_MODE_xxx constants)
+ * @param alphaData the alpha blending or mask data, varies depending
+ *        on the value of alphaMode and sometimes ignored
+ * @param alphaStride the alpha data number of bytes per line
+ * @param alphaX the top-left x-coord of the alpha blit region
+ * @param alphaY the top-left y-coord of the alpha blit region
+ * @param destData the destination byte array containing image data
+ * @param destDepth the destination depth: one of 1, 2, 4, 8
+ * @param destStride the destination number of bytes per line
+ * @param destOrder the destination byte ordering: one of MSB_FIRST or LSB_FIRST;
+ *        ignored if destDepth is not 1
+ * @param destX the top-left x-coord of the destination blit region
+ * @param destY the top-left y-coord of the destination blit region
+ * @param destWidth the width of the destination blit region
+ * @param destHeight the height of the destination blit region
+ * @param destReds the destination palette red component intensities
+ * @param destGreens the destination palette green component intensities
+ * @param destBlues the destination palette blue component intensities
+ * @param flipX if true the resulting image is flipped along the vertical axis
+ * @param flipY if true the resulting image is flipped along the horizontal axis
+ */
+static void blit(int op,
+    byte[] srcData, int srcDepth, int srcStride, int srcOrder,
+    int srcX, int srcY, int srcWidth, int srcHeight,
+    int srcRedMask, int srcGreenMask, int srcBlueMask,
+    int alphaMode, byte[] alphaData, int alphaStride, int alphaX, int alphaY,
+    byte[] destData, int destDepth, int destStride, int destOrder,
+    int destX, int destY, int destWidth, int destHeight,
+    byte[] destReds, byte[] destGreens, byte[] destBlues,
+    bool flipX, bool flipY) {
+
+    static_this();
+
+    if ((destWidth <= 0) || (destHeight <= 0) || (alphaMode is ALPHA_TRANSPARENT)) return;
+
+    // these should be supplied as params later
+    int srcAlphaMask = 0;
+
+    /*** Prepare scaling data ***/
+    int dwm1 = destWidth - 1;
+    int sfxi = (dwm1 !is 0) ? cast(int)(((cast(long)srcWidth << 16) - 1) / dwm1) : 0;
+    int dhm1 = destHeight - 1;
+    int sfyi = (dhm1 !is 0) ? cast(int)(((cast(long)srcHeight << 16) - 1) / dhm1) : 0;
+
+    /*** Prepare source-related data ***/
+    int sbpp, stype;
+    switch (srcDepth) {
+        case 8:
+            sbpp = 1;
+            stype = TYPE_GENERIC_8;
+            break;
+        case 16:
+            sbpp = 2;
+            stype = (srcOrder is MSB_FIRST) ? TYPE_GENERIC_16_MSB : TYPE_GENERIC_16_LSB;
+            break;
+        case 24:
+            sbpp = 3;
+            stype = TYPE_GENERIC_24;
+            break;
+        case 32:
+            sbpp = 4;
+            stype = (srcOrder is MSB_FIRST) ? TYPE_GENERIC_32_MSB : TYPE_GENERIC_32_LSB;
+            break;
+        default:
+            //throw new IllegalArgumentException("Invalid source type");
+            return;
+    }
+    int spr = srcY * srcStride + srcX * sbpp;
+
+    /*** Prepare destination-related data ***/
+    int dtype;
+    switch (destDepth) {
+        case 8:
+            dtype = TYPE_INDEX_8;
+            break;
+        case 4:
+            destStride <<= 1;
+            dtype = TYPE_INDEX_4;
+            break;
+        case 2:
+            destStride <<= 2;
+            dtype = TYPE_INDEX_2;
+            break;
+        case 1:
+            destStride <<= 3;
+            dtype = (destOrder is MSB_FIRST) ? TYPE_INDEX_1_MSB : TYPE_INDEX_1_LSB;
+            break;
+        default:
+            //throw new IllegalArgumentException("Invalid source type");
+            return;
+    }
+    int dpr = ((flipY) ? destY + dhm1 : destY) * destStride + ((flipX) ? destX + dwm1 : destX);
+    int dprxi = (flipX) ? -1 : 1;
+    int dpryi = (flipY) ? -destStride : destStride;
+
+    /*** Prepare special processing data ***/
+    int apr;
+    if ((op & BLIT_ALPHA) !is 0) {
+        switch (alphaMode) {
+            case ALPHA_MASK_UNPACKED:
+            case ALPHA_CHANNEL_SEPARATE:
+                if (alphaData is null) alphaMode = 0x10000;
+                apr = alphaY * alphaStride + alphaX;
+                break;
+            case ALPHA_MASK_PACKED:
+                if (alphaData is null) alphaMode = 0x10000;
+                alphaStride <<= 3;
+                apr = alphaY * alphaStride + alphaX;
+                break;
+            case ALPHA_MASK_INDEX:
+                //throw new IllegalArgumentException("Invalid alpha type");
+                return;
+            case ALPHA_MASK_RGB:
+                if (alphaData is null) alphaMode = 0x10000;
+                apr = 0;
+                break;
+            default:
+                alphaMode = (alphaMode << 16) / 255; // prescale
+            case ALPHA_CHANNEL_SOURCE:
+                apr = 0;
+                break;
+        }
+    } else {
+        alphaMode = 0x10000;
+        apr = 0;
+    }
+    bool ditherEnabled = (op & BLIT_DITHER) !is 0;
+
+    /*** Comprehensive blit (apply transformations) ***/
+    int srcRedShift = getChannelShift(srcRedMask);
+    byte[] srcReds = ANY_TO_EIGHT[getChannelWidth(srcRedMask, srcRedShift)];
+    int srcGreenShift = getChannelShift(srcGreenMask);
+    byte[] srcGreens = ANY_TO_EIGHT[getChannelWidth(srcGreenMask, srcGreenShift)];
+    int srcBlueShift = getChannelShift(srcBlueMask);
+    byte[] srcBlues = ANY_TO_EIGHT[getChannelWidth(srcBlueMask, srcBlueShift)];
+    int srcAlphaShift = getChannelShift(srcAlphaMask);
+    byte[] srcAlphas = ANY_TO_EIGHT[getChannelWidth(srcAlphaMask, srcAlphaShift)];
+
+    int dp = dpr;
+    int sp = spr;
+    int ap = apr, alpha = alphaMode;
+    int r = 0, g = 0, b = 0, a = 0;
+    int indexq = 0;
+    int lastindex = 0, lastr = -1, lastg = -1, lastb = -1;
+    int[] rerr, gerr, berr;
+    int destPaletteSize = 1 << destDepth;
+    if ((destReds !is null) && (destReds.length < destPaletteSize)) destPaletteSize = destReds.length;
+    if (ditherEnabled) {
+        rerr = new int[destWidth + 2];
+        gerr = new int[destWidth + 2];
+        berr = new int[destWidth + 2];
+    } else {
+        rerr = null; gerr = null; berr = null;
+    }
+    for (int dy = destHeight, sfy = sfyi; dy > 0; --dy,
+            sp = spr += (sfy >>> 16) * srcStride,
+            ap = apr += (sfy >>> 16) * alphaStride,
+            sfy = (sfy & 0xffff) + sfyi,
+            dp = dpr += dpryi) {
+        int lrerr = 0, lgerr = 0, lberr = 0;
+        for (int dx = destWidth, sfx = sfxi; dx > 0; --dx,
+                dp += dprxi,
+                sfx = (sfx & 0xffff) + sfxi) {
+            /*** READ NEXT PIXEL ***/
+            switch (stype) {
+                case TYPE_GENERIC_8: {
+                    int data = srcData[sp] & 0xff;
+                    sp += (sfx >>> 16);
+                    r = srcReds[(data & srcRedMask) >>> srcRedShift] & 0xff;
+                    g = srcGreens[(data & srcGreenMask) >>> srcGreenShift] & 0xff;
+                    b = srcBlues[(data & srcBlueMask) >>> srcBlueShift] & 0xff;
+                    a = srcAlphas[(data & srcAlphaMask) >>> srcAlphaShift] & 0xff;
+                } break;
+                case TYPE_GENERIC_16_MSB: {
+                    int data = ((srcData[sp] & 0xff) << 8) | (srcData[sp + 1] & 0xff);
+                    sp += (sfx >>> 16) * 2;
+                    r = srcReds[(data & srcRedMask) >>> srcRedShift] & 0xff;
+                    g = srcGreens[(data & srcGreenMask) >>> srcGreenShift] & 0xff;
+                    b = srcBlues[(data & srcBlueMask) >>> srcBlueShift] & 0xff;
+                    a = srcAlphas[(data & srcAlphaMask) >>> srcAlphaShift] & 0xff;
+                } break;
+                case TYPE_GENERIC_16_LSB: {
+                    int data = ((srcData[sp + 1] & 0xff) << 8) | (srcData[sp] & 0xff);
+                    sp += (sfx >>> 16) * 2;
+                    r = srcReds[(data & srcRedMask) >>> srcRedShift] & 0xff;
+                    g = srcGreens[(data & srcGreenMask) >>> srcGreenShift] & 0xff;
+                    b = srcBlues[(data & srcBlueMask) >>> srcBlueShift] & 0xff;
+                    a = srcAlphas[(data & srcAlphaMask) >>> srcAlphaShift] & 0xff;
+                } break;
+                case TYPE_GENERIC_24: {
+                    int data = (( ((srcData[sp] & 0xff) << 8) |
+                        (srcData[sp + 1] & 0xff)) << 8) |
+                        (srcData[sp + 2] & 0xff);
+                    sp += (sfx >>> 16) * 3;
+                    r = srcReds[(data & srcRedMask) >>> srcRedShift] & 0xff;
+                    g = srcGreens[(data & srcGreenMask) >>> srcGreenShift] & 0xff;
+                    b = srcBlues[(data & srcBlueMask) >>> srcBlueShift] & 0xff;
+                    a = srcAlphas[(data & srcAlphaMask) >>> srcAlphaShift] & 0xff;
+                } break;
+                case TYPE_GENERIC_32_MSB: {
+                    int data = (( (( ((srcData[sp] & 0xff) << 8) |
+                        (srcData[sp + 1] & 0xff)) << 8) |
+                        (srcData[sp + 2] & 0xff)) << 8) |
+                        (srcData[sp + 3] & 0xff);
+                    sp += (sfx >>> 16) * 4;
+                    r = srcReds[(data & srcRedMask) >>> srcRedShift] & 0xff;
+                    g = srcGreens[(data & srcGreenMask) >>> srcGreenShift] & 0xff;
+                    b = srcBlues[(data & srcBlueMask) >>> srcBlueShift] & 0xff;
+                    a = srcAlphas[(data & srcAlphaMask) >>> srcAlphaShift] & 0xff;
+                } break;
+                case TYPE_GENERIC_32_LSB: {
+                    int data = (( (( ((srcData[sp + 3] & 0xff) << 8) |
+                        (srcData[sp + 2] & 0xff)) << 8) |
+                        (srcData[sp + 1] & 0xff)) << 8) |
+                        (srcData[sp] & 0xff);
+                    sp += (sfx >>> 16) * 4;
+                    r = srcReds[(data & srcRedMask) >>> srcRedShift] & 0xff;
+                    g = srcGreens[(data & srcGreenMask) >>> srcGreenShift] & 0xff;
+                    b = srcBlues[(data & srcBlueMask) >>> srcBlueShift] & 0xff;
+                    a = srcAlphas[(data & srcAlphaMask) >>> srcAlphaShift] & 0xff;
+                } break;
+                default:
+            }
+
+            /*** DO SPECIAL PROCESSING IF REQUIRED ***/
+            switch (alphaMode) {
+                case ALPHA_CHANNEL_SEPARATE:
+                    alpha = ((alphaData[ap] & 0xff) << 16) / 255;
+                    ap += (sfx >> 16);
+                    break;
+                case ALPHA_CHANNEL_SOURCE:
+                    alpha = (a << 16) / 255;
+                    break;
+                case ALPHA_MASK_UNPACKED:
+                    alpha = (alphaData[ap] !is 0) ? 0x10000 : 0;
+                    ap += (sfx >> 16);
+                    break;
+                case ALPHA_MASK_PACKED:
+                    alpha = (alphaData[ap >> 3] << ((ap & 7) + 9)) & 0x10000;
+                    ap += (sfx >> 16);
+                    break;
+                case ALPHA_MASK_RGB:
+                    alpha = 0x10000;
+                    for (int i = 0; i < alphaData.length; i += 3) {
+                        if ((r is alphaData[i]) && (g is alphaData[i + 1]) && (b is alphaData[i + 2])) {
+                            alpha = 0x0000;
+                            break;
+                        }
+                    }
+                    break;
+                default:
+            }
+            if (alpha !is 0x10000) {
+                if (alpha is 0x0000) continue;
+                switch (dtype) {
+                    case TYPE_INDEX_8:
+                        indexq = destData[dp] & 0xff;
+                        break;
+                    case TYPE_INDEX_4:
+                        if ((dp & 1) !is 0) indexq = destData[dp >> 1] & 0x0f;
+                        else indexq = (destData[dp >> 1] >>> 4) & 0x0f;
+                        break;
+                    case TYPE_INDEX_2:
+                        indexq = (destData[dp >> 2] >>> (6 - (dp & 3) * 2)) & 0x03;
+                        break;
+                    case TYPE_INDEX_1_MSB:
+                        indexq = (destData[dp >> 3] >>> (7 - (dp & 7))) & 0x01;
+                        break;
+                    case TYPE_INDEX_1_LSB:
+                        indexq = (destData[dp >> 3] >>> (dp & 7)) & 0x01;
+                        break;
+                    default:
+                }
+                // Perform alpha blending
+                int rq = destReds[indexq] & 0xff;
+                int gq = destGreens[indexq] & 0xff;
+                int bq = destBlues[indexq] & 0xff;
+                r = rq + ((r - rq) * alpha >> 16);
+                g = gq + ((g - gq) * alpha >> 16);
+                b = bq + ((b - bq) * alpha >> 16);
+            }
+
+            /*** MAP COLOR TO THE PALETTE ***/
+            if (ditherEnabled) {
+                // Floyd-Steinberg error diffusion
+                r += rerr[dx] >> 4;
+                if (r < 0) r = 0; else if (r > 255) r = 255;
+                g += gerr[dx] >> 4;
+                if (g < 0) g = 0; else if (g > 255) g = 255;
+                b += berr[dx] >> 4;
+                if (b < 0) b = 0; else if (b > 255) b = 255;
+                rerr[dx] = lrerr;
+                gerr[dx] = lgerr;
+                berr[dx] = lberr;
+            }
+            if (r !is lastr || g !is lastg || b !is lastb) {
+                // moving the variable declarations out seems to make the JDK JIT happier...
+                for (int j = 0, dr, dg, db, distance, minDistance = 0x7fffffff; j < destPaletteSize; ++j) {
+                    dr = (destReds[j] & 0xff) - r;
+                    dg = (destGreens[j] & 0xff) - g;
+                    db = (destBlues[j] & 0xff) - b;
+                    distance = dr * dr + dg * dg + db * db;
+                    if (distance < minDistance) {
+                        lastindex = j;
+                        if (distance is 0) break;
+                        minDistance = distance;
+                    }
+                }
+                lastr = r; lastg = g; lastb = b;
+            }
+            if (ditherEnabled) {
+                // Floyd-Steinberg error diffusion, cont'd...
+                int dxm1 = dx - 1, dxp1 = dx + 1;
+                int acc;
+                rerr[dxp1] += acc = (lrerr = r - (destReds[lastindex] & 0xff)) + lrerr + lrerr;
+                rerr[dx] += acc += lrerr + lrerr;
+                rerr[dxm1] += acc + lrerr + lrerr;
+                gerr[dxp1] += acc = (lgerr = g - (destGreens[lastindex] & 0xff)) + lgerr + lgerr;
+                gerr[dx] += acc += lgerr + lgerr;
+                gerr[dxm1] += acc + lgerr + lgerr;
+                berr[dxp1] += acc = (lberr = b - (destBlues[lastindex] & 0xff)) + lberr + lberr;
+                berr[dx] += acc += lberr + lberr;
+                berr[dxm1] += acc + lberr + lberr;
+            }
+
+            /*** WRITE NEXT PIXEL ***/
+            switch (dtype) {
+                case TYPE_INDEX_8:
+                    destData[dp] = cast(byte) lastindex;
+                    break;
+                case TYPE_INDEX_4:
+                    if ((dp & 1) !is 0) destData[dp >> 1] = cast(byte)((destData[dp >> 1] & 0xf0) | lastindex);
+                    else destData[dp >> 1] = cast(byte)((destData[dp >> 1] & 0x0f) | (lastindex << 4));
+                    break;
+                case TYPE_INDEX_2: {
+                    int shift = 6 - (dp & 3) * 2;
+                    destData[dp >> 2] = cast(byte)(destData[dp >> 2] & ~(0x03 << shift) | (lastindex << shift));
+                } break;
+                case TYPE_INDEX_1_MSB: {
+                    int shift = 7 - (dp & 7);
+                    destData[dp >> 3] = cast(byte)(destData[dp >> 3] & ~(0x01 << shift) | (lastindex << shift));
+                } break;
+                case TYPE_INDEX_1_LSB: {
+                    int shift = dp & 7;
+                    destData[dp >> 3] = cast(byte)(destData[dp >> 3] & ~(0x01 << shift) | (lastindex << shift));
+                } break;
+                default:
+            }
+        }
+    }
+}
+
+/**
+ * Computes the required channel shift from a mask.
+ */
+static int getChannelShift(int mask) {
+    if (mask is 0) return 0;
+    int i;
+    for (i = 0; ((mask & 1) is 0) && (i < 32); ++i) {
+        mask >>>= 1;
+    }
+    return i;
+}
+
+/**
+ * Computes the required channel width (depth) from a mask.
+ */
+static int getChannelWidth(int mask, int shift) {
+    if (mask is 0) return 0;
+    int i;
+    mask >>>= shift;
+    for (i = shift; ((mask & 1) !is 0) && (i < 32); ++i) {
+        mask >>>= 1;
+    }
+    return i - shift;
+}
+
+/**
+ * Extracts a field from packed RGB data given a mask for that field.
+ */
+static byte getChannelField(int data, int mask) {
+    static_this();
+    int shift = getChannelShift(mask);
+    return ANY_TO_EIGHT[getChannelWidth(mask, shift)][(data & mask) >>> shift];
+}
+
+/**
+ * Creates an ImageData containing one band's worth of a gradient filled
+ * block.  If <code>vertical</code> is true, the band must be tiled
+ * horizontally to fill a region, otherwise it must be tiled vertically.
+ *
+ * @param width the width of the region to be filled
+ * @param height the height of the region to be filled
+ * @param vertical if true sweeps from top to bottom, else
+ *        sweeps from left to right
+ * @param fromRGB the color to start with
+ * @param toRGB the color to end with
+ * @param redBits the number of significant red bits, 0 for palette modes
+ * @param greenBits the number of significant green bits, 0 for palette modes
+ * @param blueBits the number of significant blue bits, 0 for palette modes
+ * @return the new ImageData
+ */
+static ImageData createGradientBand(
+    int width, int height, bool vertical,
+    RGB fromRGB, RGB toRGB,
+    int redBits, int greenBits, int blueBits) {
+    /* Gradients are drawn as tiled bands */
+    int bandWidth, bandHeight, bitmapDepth;
+    byte[] bitmapData;
+    PaletteData paletteData;
+    /* Select an algorithm depending on the depth of the screen */
+    if (redBits !is 0 && greenBits !is 0 && blueBits !is 0) {
+        paletteData = new PaletteData(0x0000ff00, 0x00ff0000, 0xff000000);
+        bitmapDepth = 32;
+        if (redBits >= 8 && greenBits >= 8 && blueBits >= 8) {
+            /* Precise color */
+            int steps;
+            if (vertical) {
+                bandWidth = 1;
+                bandHeight = height;
+                steps = bandHeight > 1 ? bandHeight - 1 : 1;
+            } else {
+                bandWidth = width;
+                bandHeight = 1;
+                steps = bandWidth > 1 ? bandWidth - 1 : 1;
+            }
+            int bytesPerLine = bandWidth * 4;
+            bitmapData = new byte[bandHeight * bytesPerLine];
+            buildPreciseGradientChannel(fromRGB.blue, toRGB.blue, steps, bandWidth, bandHeight, vertical, bitmapData, 0, bytesPerLine);
+            buildPreciseGradientChannel(fromRGB.green, toRGB.green, steps, bandWidth, bandHeight, vertical, bitmapData, 1, bytesPerLine);
+            buildPreciseGradientChannel(fromRGB.red, toRGB.red, steps, bandWidth, bandHeight, vertical, bitmapData, 2, bytesPerLine);
+        } else {
+            /* Dithered color */
+            int steps;
+            if (vertical) {
+                bandWidth = (width < 8) ? width : 8;
+                bandHeight = height;
+                steps = bandHeight > 1 ? bandHeight - 1 : 1;
+            } else {
+                bandWidth = width;
+                bandHeight = (height < 8) ? height : 8;
+                steps = bandWidth > 1 ? bandWidth - 1 : 1;
+            }
+            int bytesPerLine = bandWidth * 4;
+            bitmapData = new byte[bandHeight * bytesPerLine];
+            buildDitheredGradientChannel(fromRGB.blue, toRGB.blue, steps, bandWidth, bandHeight, vertical, bitmapData, 0, bytesPerLine, blueBits);
+            buildDitheredGradientChannel(fromRGB.green, toRGB.green, steps, bandWidth, bandHeight, vertical, bitmapData, 1, bytesPerLine, greenBits);
+            buildDitheredGradientChannel(fromRGB.red, toRGB.red, steps, bandWidth, bandHeight, vertical, bitmapData, 2, bytesPerLine, redBits);
+        }
+    } else {
+        /* Dithered two tone */
+        paletteData = new PaletteData([ fromRGB, toRGB ]);
+        bitmapDepth = 8;
+        int blendi;
+        if (vertical) {
+            bandWidth = (width < 8) ? width : 8;
+            bandHeight = height;
+            blendi = (bandHeight > 1) ? 0x1040000 / (bandHeight - 1) + 1 : 1;
+        } else {
+            bandWidth = width;
+            bandHeight = (height < 8) ? height : 8;
+            blendi = (bandWidth > 1) ? 0x1040000 / (bandWidth - 1) + 1 : 1;
+        }
+        int bytesPerLine = (bandWidth + 3) & -4;
+        bitmapData = new byte[bandHeight * bytesPerLine];
+        if (vertical) {
+            for (int dy = 0, blend = 0, dp = 0; dy < bandHeight;
+                ++dy, blend += blendi, dp += bytesPerLine) {
+                for (int dx = 0; dx < bandWidth; ++dx) {
+                    bitmapData[dp + dx] = (blend + DITHER_MATRIX[dy & 7][dx]) <
+                        0x1000000 ? cast(byte)0 : cast(byte)1;
+                }
+            }
+        } else {
+            for (int dx = 0, blend = 0; dx < bandWidth; ++dx, blend += blendi) {
+                for (int dy = 0, dptr = dx; dy < bandHeight; ++dy, dptr += bytesPerLine) {
+                    bitmapData[dptr] = (blend + DITHER_MATRIX[dy][dx & 7]) <
+                        0x1000000 ? cast(byte)0 : cast(byte)1;
+                }
+            }
+        }
+    }
+    return new ImageData(bandWidth, bandHeight, bitmapDepth, paletteData, 4, bitmapData);
+}
+
+/*
+ * Fill in gradated values for a color channel
+ */
+static final void buildPreciseGradientChannel(int from, int to, int steps,
+    int bandWidth, int bandHeight, bool vertical,
+    byte[] bitmapData, int dp, int bytesPerLine) {
+    int val = from << 16;
+    int inc = ((to << 16) - val) / steps + 1;
+    if (vertical) {
+        for (int dy = 0; dy < bandHeight; ++dy, dp += bytesPerLine) {
+            bitmapData[dp] = cast(byte)(val >>> 16);
+            val += inc;
+        }
+    } else {
+        for (int dx = 0; dx < bandWidth; ++dx, dp += 4) {
+            bitmapData[dp] = cast(byte)(val >>> 16);
+            val += inc;
+        }
+    }
+}
+
+/*
+ * Fill in dithered gradated values for a color channel
+ */
+static final void buildDitheredGradientChannel(int from, int to, int steps,
+    int bandWidth, int bandHeight, bool vertical,
+    byte[] bitmapData, int dp, int bytesPerLine, int bits) {
+    int mask = 0xff00 >>> bits;
+    int val = from << 16;
+    int inc = ((to << 16) - val) / steps + 1;
+    if (vertical) {
+        for (int dy = 0; dy < bandHeight; ++dy, dp += bytesPerLine) {
+            for (int dx = 0, dptr = dp; dx < bandWidth; ++dx, dptr += 4) {
+                int thresh = DITHER_MATRIX[dy & 7][dx] >>> bits;
+                int temp = val + thresh;
+                if (temp > 0xffffff) bitmapData[dptr] = -1;
+                else bitmapData[dptr] = cast(byte)((temp >>> 16) & mask);
+            }
+            val += inc;
+        }
+    } else {
+        for (int dx = 0; dx < bandWidth; ++dx, dp += 4) {
+            for (int dy = 0, dptr = dp; dy < bandHeight; ++dy, dptr += bytesPerLine) {
+                int thresh = DITHER_MATRIX[dy][dx & 7] >>> bits;
+                int temp = val + thresh;
+                if (temp > 0xffffff) bitmapData[dptr] = -1;
+                else bitmapData[dptr] = cast(byte)((temp >>> 16) & mask);
+            }
+            val += inc;
+        }
+    }
+}
+
+/**
+ * Renders a gradient onto a GC.
+ * <p>
+ * This is a GC helper.
+ * </p>
+ *
+ * @param gc the GC to render the gradient onto
+ * @param device the device the GC belongs to
+ * @param x the top-left x coordinate of the region to be filled
+ * @param y the top-left y coordinate of the region to be filled
+ * @param width the width of the region to be filled
+ * @param height the height of the region to be filled
+ * @param vertical if true sweeps from top to bottom, else
+ *        sweeps from left to right
+ * @param fromRGB the color to start with
+ * @param toRGB the color to end with
+ * @param redBits the number of significant red bits, 0 for palette modes
+ * @param greenBits the number of significant green bits, 0 for palette modes
+ * @param blueBits the number of significant blue bits, 0 for palette modes
+ */
+static void fillGradientRectangle(GC gc, Device device,
+    int x, int y, int width, int height, bool vertical,
+    RGB fromRGB, RGB toRGB,
+    int redBits, int greenBits, int blueBits) {
+    /* Create the bitmap and tile it */
+    ImageData band = createGradientBand(width, height, vertical,
+        fromRGB, toRGB, redBits, greenBits, blueBits);
+    Image image = new Image(device, band);
+    if ((band.width is 1) || (band.height is 1)) {
+        gc.drawImage(image, 0, 0, band.width, band.height, x, y, width, height);
+    } else {
+        if (vertical) {
+            for (int dx = 0; dx < width; dx += band.width) {
+                int blitWidth = width - dx;
+                if (blitWidth > band.width) blitWidth = band.width;
+                gc.drawImage(image, 0, 0, blitWidth, band.height, dx + x, y, blitWidth, band.height);
+            }
+        } else {
+            for (int dy = 0; dy < height; dy += band.height) {
+                int blitHeight = height - dy;
+                if (blitHeight > band.height) blitHeight = band.height;
+                gc.drawImage(image, 0, 0, band.width, blitHeight, x, dy + y, band.width, blitHeight);
+            }
+        }
+    }
+    image.dispose();
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/ImageDataLoader.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.ImageDataLoader;
+
+import java.lang.all;
+
+public import org.eclipse.swt.graphics.ImageData;
+public import java.io.InputStream;
+
+import org.eclipse.swt.graphics.ImageLoader;
+
+/**
+ * Internal class that separates ImageData from ImageLoader
+ * to allow removal of ImageLoader from the toolkit.
+ */
+class ImageDataLoader {
+
+    public static ImageData[] load(InputStream stream) {
+        return (new ImageLoader()).load(stream);
+    }
+
+    public static ImageData[] load(String filename) {
+        return (new ImageLoader()).load(filename);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/ImageLoader.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,331 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.ImageLoader;
+
+import java.lang.all;
+
+
+public import org.eclipse.swt.graphics.ImageLoaderListener;
+public import org.eclipse.swt.graphics.ImageLoaderEvent;
+public import org.eclipse.swt.graphics.ImageData;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.Compatibility;
+import org.eclipse.swt.internal.image.FileFormat;
+
+import tango.core.Exception;
+import tango.core.Array;
+
+
+/**
+ * Instances of this class are used to load images from,
+ * and save images to, a file or stream.
+ * <p>
+ * Currently supported image formats are:
+ * </p><ul>
+ * <li>BMP (Windows or OS/2 Bitmap)</li>
+ * <li>ICO (Windows Icon)</li>
+ * <li>JPEG</li>
+ * <li>GIF</li>
+ * <li>PNG</li>
+ * <li>TIFF</li>
+ * </ul>
+ * <code>ImageLoaders</code> can be used to:
+ * <ul>
+ * <li>load/save single images in all formats</li>
+ * <li>load/save multiple images (GIF/ICO/TIFF)</li>
+ * <li>load/save animated GIF images</li>
+ * <li>load interlaced GIF/PNG images</li>
+ * <li>load progressive JPEG images</li>
+ * </ul>
+ *
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ImageAnalyzer</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public class ImageLoader {
+
+    /**
+     * the array of ImageData objects in this ImageLoader.
+     * This array is read in when the load method is called,
+     * and it is written out when the save method is called
+     */
+    public ImageData[] data;
+
+    /**
+     * the width of the logical screen on which the images
+     * reside, in pixels (this corresponds to the GIF89a
+     * Logical Screen Width value)
+     */
+    public int logicalScreenWidth;
+
+    /**
+     * the height of the logical screen on which the images
+     * reside, in pixels (this corresponds to the GIF89a
+     * Logical Screen Height value)
+     */
+    public int logicalScreenHeight;
+
+    /**
+     * the background pixel for the logical screen (this
+     * corresponds to the GIF89a Background Color Index value).
+     * The default is -1 which means 'unspecified background'
+     *
+     */
+    public int backgroundPixel;
+
+    /**
+     * the number of times to repeat the display of a sequence
+     * of animated images (this corresponds to the commonly-used
+     * GIF application extension for "NETSCAPE 2.0 01").
+     * The default is 1. A value of 0 means 'display repeatedly'
+     */
+    public int repeatCount;
+
+    /*
+     * the set of ImageLoader event listeners, created on demand
+     */
+    ImageLoaderListener[] imageLoaderListeners;
+
+/**
+ * Construct a new empty ImageLoader.
+ */
+public this() {
+    reset();
+}
+
+/**
+ * Resets the fields of the ImageLoader, except for the
+ * <code>imageLoaderListeners</code> field.
+ */
+void reset() {
+    data = null;
+    logicalScreenWidth = 0;
+    logicalScreenHeight = 0;
+    backgroundPixel = -1;
+    repeatCount = 1;
+}
+
+/**
+ * Loads an array of <code>ImageData</code> objects from the
+ * specified input stream. Throws an error if either an error
+ * occurs while loading the images, or if the images are not
+ * of a supported type. Returns the loaded image data array.
+ *
+ * @param stream the input stream to load the images from
+ * @return an array of <code>ImageData</code> objects loaded from the specified input stream
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the stream is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_IO - if an IO error occurs while reading from the stream</li>
+ *    <li>ERROR_INVALID_IMAGE - if the image stream contains invalid data</li>
+ *    <li>ERROR_UNSUPPORTED_FORMAT - if the image stream contains an unrecognized format</li>
+ * </ul>
+ */
+public ImageData[] load(InputStream stream) {
+    if (stream is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    reset();
+    data = FileFormat.load(stream, this);
+    return data;
+}
+
+/**
+ * Loads an array of <code>ImageData</code> objects from the
+ * file with the specified name. Throws an error if either
+ * an error occurs while loading the images, or if the images are
+ * not of a supported type. Returns the loaded image data array.
+ *
+ * @param filename the name of the file to load the images from
+ * @return an array of <code>ImageData</code> objects loaded from the specified file
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the file name is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_IO - if an IO error occurs while reading from the file</li>
+ *    <li>ERROR_INVALID_IMAGE - if the image file contains invalid data</li>
+ *    <li>ERROR_UNSUPPORTED_FORMAT - if the image file contains an unrecognized format</li>
+ * </ul>
+ */
+public ImageData[] load(String filename) {
+    if (filename is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    InputStream stream = null;
+    void close(){
+        try {
+            if( stream !is null ) stream.close();
+        } catch (IOException e) {
+            // Ignore error
+        }
+    }
+    try {
+        stream = Compatibility.newFileInputStream(filename);
+        scope(exit) close();
+
+        return load(stream);
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+    return null;
+}
+
+/**
+ * Saves the image data in this ImageLoader to the specified stream.
+ * The format parameter can have one of the following values:
+ * <dl>
+ * <dt><code>IMAGE_BMP</code></dt>
+ * <dd>Windows BMP file format, no compression</dd>
+ * <dt><code>IMAGE_BMP_RLE</code></dt>
+ * <dd>Windows BMP file format, RLE compression if appropriate</dd>
+ * <dt><code>IMAGE_GIF</code></dt>
+ * <dd>GIF file format</dd>
+ * <dt><code>IMAGE_ICO</code></dt>
+ * <dd>Windows ICO file format</dd>
+ * <dt><code>IMAGE_JPEG</code></dt>
+ * <dd>JPEG file format</dd>
+ * <dt><code>IMAGE_PNG</code></dt>
+ * <dd>PNG file format</dd>
+ * </dl>
+ *
+ * @param stream the output stream to write the images to
+ * @param format the format to write the images in
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the stream is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_IO - if an IO error occurs while writing to the stream</li>
+ *    <li>ERROR_INVALID_IMAGE - if the image data contains invalid data</li>
+ *    <li>ERROR_UNSUPPORTED_FORMAT - if the image data cannot be saved to the requested format</li>
+ * </ul>
+ */
+public void save(OutputStream stream, int format) {
+    if (stream is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    FileFormat.save(stream, format, this);
+}
+
+/**
+ * Saves the image data in this ImageLoader to a file with the specified name.
+ * The format parameter can have one of the following values:
+ * <dl>
+ * <dt><code>IMAGE_BMP</code></dt>
+ * <dd>Windows BMP file format, no compression</dd>
+ * <dt><code>IMAGE_BMP_RLE</code></dt>
+ * <dd>Windows BMP file format, RLE compression if appropriate</dd>
+ * <dt><code>IMAGE_GIF</code></dt>
+ * <dd>GIF file format</dd>
+ * <dt><code>IMAGE_ICO</code></dt>
+ * <dd>Windows ICO file format</dd>
+ * <dt><code>IMAGE_JPEG</code></dt>
+ * <dd>JPEG file format</dd>
+ * <dt><code>IMAGE_PNG</code></dt>
+ * <dd>PNG file format</dd>
+ * </dl>
+ *
+ * @param filename the name of the file to write the images to
+ * @param format the format to write the images in
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the file name is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_IO - if an IO error occurs while writing to the file</li>
+ *    <li>ERROR_INVALID_IMAGE - if the image data contains invalid data</li>
+ *    <li>ERROR_UNSUPPORTED_FORMAT - if the image data cannot be saved to the requested format</li>
+ * </ul>
+ */
+public void save(String filename, int format) {
+    if (filename is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    OutputStream stream = null;
+    try {
+        stream = Compatibility.newFileOutputStream(filename);
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+    save(stream, format);
+    try {
+        stream.close();
+    } catch (IOException e) {
+    }
+}
+
+/**
+ * Adds the listener to the collection of listeners who will be
+ * notified when image data is either partially or completely loaded.
+ * <p>
+ * An ImageLoaderListener should be added before invoking
+ * one of the receiver's load methods. The listener's
+ * <code>imageDataLoaded</code> method is called when image
+ * data has been partially loaded, as is supported by interlaced
+ * GIF/PNG or progressive JPEG images.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ *
+ * @see ImageLoaderListener
+ * @see ImageLoaderEvent
+ */
+public void addImageLoaderListener(ImageLoaderListener listener) {
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    imageLoaderListeners ~= listener;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will be
+ * notified when image data is either partially or completely loaded.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ *
+ * @see #addImageLoaderListener(ImageLoaderListener)
+ */
+public void removeImageLoaderListener(ImageLoaderListener listener) {
+    if (listener is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    if (imageLoaderListeners.length is 0 ) return;
+    imageLoaderListeners.length = tango.core.Array.remove( imageLoaderListeners, listener, delegate bool(ImageLoaderListener l1, ImageLoaderListener l2 ){ return l1 is l2; });
+}
+
+/**
+ * Returns <code>true</code> if the receiver has image loader
+ * listeners, and <code>false</code> otherwise.
+ *
+ * @return <code>true</code> if there are <code>ImageLoaderListener</code>s, and <code>false</code> otherwise
+ *
+ * @see #addImageLoaderListener(ImageLoaderListener)
+ * @see #removeImageLoaderListener(ImageLoaderListener)
+ */
+public bool hasListeners() {
+    return imageLoaderListeners.length > 0;
+}
+
+/**
+ * Notifies all image loader listeners that an image loader event
+ * has occurred. Pass the specified event object to each listener.
+ *
+ * @param event the <code>ImageLoaderEvent</code> to send to each <code>ImageLoaderListener</code>
+ */
+public void notifyListeners(ImageLoaderEvent event) {
+    if (!hasListeners()) return;
+    foreach( listener; imageLoaderListeners ){
+        listener.imageDataLoaded(event);
+    }
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/ImageLoaderEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.ImageLoaderEvent;
+
+import java.lang.all;
+
+
+public import org.eclipse.swt.internal.SWTEventObject;
+public import org.eclipse.swt.graphics.ImageLoader;
+public import org.eclipse.swt.graphics.ImageData;
+
+import tango.text.convert.Format;
+
+/**
+ * Instances of this class are sent as a result of the incremental
+ * loading of image data.
+ * <p>
+ * <b>Notes:</b>
+ * </p><ul>
+ * <li>The number of events which will be sent when loading images
+ * is not constant. It varies by image type, and for JPEG images it
+ * varies from image to image.</li>
+ * <li>For image sources which contain multiple images, the
+ * <code>endOfImage</code> flag in the event will be set to true
+ * after each individual image is loaded.</li>
+ * </ul>
+ *
+ * @see ImageLoader
+ * @see ImageLoaderListener
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public class ImageLoaderEvent : SWTEventObject {
+
+    /**
+     * if the <code>endOfImage</code> flag is false, then this is a
+     * partially complete copy of the current <code>ImageData</code>,
+     * otherwise this is a completely loaded <code>ImageData</code>
+     */
+    public ImageData imageData;
+
+    /**
+     * the zero-based count of image data increments -- this is
+     * equivalent to the number of events that have been generated
+     * while loading a particular image
+     */
+    public int incrementCount;
+
+    /**
+     * If this flag is true, then the current image data has been
+     * completely loaded, otherwise the image data is only partially
+     * loaded, and further ImageLoader events will occur unless an
+     * exception is thrown
+     */
+    public bool endOfImage;
+
+    //static final long serialVersionUID = 3257284738325558065L;
+
+/**
+ * Constructs a new instance of this class given the event source and
+ * the values to store in its fields.
+ *
+ * @param source the ImageLoader that was loading when the event occurred
+ * @param imageData the image data for the event
+ * @param incrementCount the image data increment for the event
+ * @param endOfImage the end of image flag for the event
+ */
+public this(ImageLoader source, ImageData imageData, int incrementCount, bool endOfImage) {
+    super(source);
+    this.imageData = imageData;
+    this.incrementCount = incrementCount;
+    this.endOfImage = endOfImage;
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+public override String toString () {
+    return Format( "ImageLoaderEvent {source={} imageData={} incrementCount={} endOfImage={}}", source, imageData, incrementCount, endOfImage); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/ImageLoaderListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.ImageLoaderListener;
+
+import java.lang.all;
+
+
+public import org.eclipse.swt.graphics.ImageLoaderEvent;
+public import org.eclipse.swt.internal.SWTEventListener;
+
+/**
+ * Classes which implement this interface provide methods
+ * that deal with the incremental loading of image data.
+ * <p>
+ * After creating an instance of a class that implements
+ * this interface it can be added to an image loader using the
+ * <code>addImageLoaderListener</code> method and removed using
+ * the <code>removeImageLoaderListener</code> method. When
+ * image data is either partially or completely loaded, this
+ * method will be invoked.
+ * </p>
+ *
+ * @see ImageLoader
+ * @see ImageLoaderEvent
+ */
+
+public interface ImageLoaderListener : SWTEventListener {
+
+/**
+ * Sent when image data is either partially or completely loaded.
+ * <p>
+ * The timing of when this method is called varies depending on
+ * the format of the image being loaded.
+ * </p>
+ *
+ * @param e an event containing information about the image loading operation
+ */
+public void imageDataLoaded(ImageLoaderEvent e);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/LineAttributes.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.LineAttributes;
+
+import java.lang.all;
+
+import org.eclipse.swt.SWT;
+
+/**
+ * <code>LineAttributes</code> defines a set of line attributes that
+ * can be modified in a GC.
+ * <p>
+ * Application code does <em>not</em> need to explicitly release the
+ * resources managed by each instance when those instances are no longer
+ * required, and thus no <code>dispose()</code> method is provided.
+ * </p>
+ *
+ * @see GC#getLineAttributes()
+ * @see GC#setLineAttributes(LineAttributes)
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.3
+ */
+public class LineAttributes {
+
+    /**
+     * The line width.
+     */
+    public float width;
+
+    /**
+     * The line style.
+     *
+     * @see org.eclipse.swt.SWT#LINE_CUSTOM
+     * @see org.eclipse.swt.SWT#LINE_DASH
+     * @see org.eclipse.swt.SWT#LINE_DASHDOT
+     * @see org.eclipse.swt.SWT#LINE_DASHDOTDOT
+     * @see org.eclipse.swt.SWT#LINE_DOT
+     * @see org.eclipse.swt.SWT#LINE_SOLID
+     */
+    public int style;
+
+    /**
+     * The line cap style.
+     *
+     * @see org.eclipse.swt.SWT#CAP_FLAT
+     * @see org.eclipse.swt.SWT#CAP_ROUND
+     * @see org.eclipse.swt.SWT#CAP_SQUARE
+     */
+    public int cap;
+
+    /**
+     * The line join style.
+     *
+     * @see org.eclipse.swt.SWT#JOIN_BEVEL
+     * @see org.eclipse.swt.SWT#JOIN_MITER
+     * @see org.eclipse.swt.SWT#JOIN_ROUND
+     */
+    public int join;
+
+    /**
+     * The line dash style for SWT.LINE_CUSTOM.
+     */
+    public float[] dash;
+
+    /**
+     * The line dash style offset for SWT.LINE_CUSTOM.
+     */
+    public float dashOffset;
+
+    /**
+     * The line miter limit.
+     */
+    public float miterLimit;
+
+/**
+ * Create a new line attributes with the specified line width.
+ *
+ * @param width the line width
+ */
+public this(float width) {
+    this(width, SWT.CAP_FLAT, SWT.JOIN_MITER, SWT.LINE_SOLID, null, 0, 10);
+}
+
+/**
+ * Create a new line attributes with the specified line cap, join and width.
+ *
+ * @param width the line width
+ * @param cap the line cap style
+ * @param join the line join style
+ */
+public this(float width, int cap, int join) {
+    this(width, cap, join, SWT.LINE_SOLID, null, 0, 10);
+}
+
+/**
+ * Create a new line attributes with the specified arguments.
+ *
+ * @param width the line width
+ * @param cap the line cap style
+ * @param join the line join style
+ * @param style the line style
+ * @param dash the line dash style
+ * @param dashOffset the line dash style offset
+ * @param miterLimit the line miter limit
+ */
+public this(float width, int cap, int join, int style, float[] dash, float dashOffset, float miterLimit) {
+    this.width = width;
+    this.cap = cap;
+    this.join = join;
+    this.style = style;
+    this.dash = dash;
+    this.dashOffset = dashOffset;
+    this.miterLimit = miterLimit;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/PaletteData.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,219 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.PaletteData;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.RGB;
+
+/**
+ * Instances of this class describe the color data used by an image.
+ * <p>
+ * Depending on the depth of the image, the PaletteData can take one
+ * of two forms, indicated by the isDirect field:
+ * </p>
+ * <dl>
+ * <dt>
+ * <em>isDirect is false</em>
+ * </dt>
+ * <dd>
+ * If isDirect is <code>false</code>, this palette is an indexed
+ * palette which maps pixel values to RGBs. The actual RGB values
+ * may be retrieved by using the getRGBs() method.
+ * </dd>
+ * <dt>
+ * <em>isDirect is true</em>
+ * </dt>
+ * <dd>
+ * If isDirect is <code>true</code>, this palette is a direct color
+ * palette. Instead of containing RGB values, it contains red,
+ * green and blue mask and shift information which indicates how
+ * the color components may be extracted from a given pixel.
+ * This means that the RGB value is actually encoded in the pixel value.
+ * <p>
+ * In this case, the shift data is the number of bits required to shift
+ * the RGB value to the left in order to align the high bit of the
+ * corresponding mask with the high bit of the first byte. This number
+ * may be negative, so care must be taken when shifting. For example,
+ * with a red mask of 0xFF0000, the red shift would be -16. With a red
+ * mask of 0x1F, the red shift would be 3.
+ * </p>
+ * </dd>
+ * </dl>
+ *
+ * @see Image
+ * @see RGB
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public final class PaletteData {
+
+    /**
+     * true if the receiver is a direct palette,
+     * and false otherwise
+     */
+    public bool isDirect;
+
+    /**
+     * the RGB values for an indexed palette, where the
+     * indices of the array correspond to pixel values
+     */
+    public RGB[] colors;
+
+    /**
+     * the red mask for a direct palette
+     */
+    public int redMask;
+
+    /**
+     * the green mask for a direct palette
+     */
+    public int greenMask;
+
+    /**
+     * the blue mask for a direct palette
+     */
+    public int blueMask;
+
+    /**
+     * the red shift for a direct palette
+     */
+    public int redShift;
+
+    /**
+     * the green shift for a direct palette
+     */
+    public int greenShift;
+
+    /**
+     * the blue shift for a direct palette
+     */
+    public int blueShift;
+
+/**
+ * Constructs a new indexed palette given an array of RGB values.
+ *
+ * @param colors the array of <code>RGB</code>s for the palette
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ * </ul>
+ */
+public this(RGB[] colors) {
+    if (colors is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    this.colors = colors;
+    this.isDirect = false;
+}
+
+/**
+ * Constructs a new direct palette given the red, green and blue masks.
+ *
+ * @param redMask the red mask
+ * @param greenMask the green mask
+ * @param blueMask the blue mask
+ */
+public this(int redMask, int greenMask, int blueMask) {
+    this.redMask = redMask;
+    this.greenMask = greenMask;
+    this.blueMask = blueMask;
+    this.isDirect = true;
+    this.redShift = shiftForMask(redMask);
+    this.greenShift = shiftForMask(greenMask);
+    this.blueShift = shiftForMask(blueMask);
+}
+
+/**
+ * Returns the pixel value corresponding to the given <code>RGB</code>.
+ *
+ * @param rgb the RGB to get the pixel value for
+ * @return the pixel value for the given RGB
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the RGB is not found in the palette</li>
+ * </ul>
+ */
+public int getPixel(RGB rgb) {
+    if (rgb is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (isDirect) {
+        int pixel = 0;
+        pixel |= (redShift < 0 ? rgb.red << -redShift : rgb.red >>> redShift) & redMask;
+        pixel |= (greenShift < 0 ? rgb.green << -greenShift : rgb.green >>> greenShift) & greenMask;
+        pixel |= (blueShift < 0 ? rgb.blue << -blueShift : rgb.blue >>> blueShift) & blueMask;
+        return pixel;
+    } else {
+        for (int i = 0; i < colors.length; i++) {
+            if (colors[i].opEquals(rgb) ) return i;
+        }
+        /* The RGB did not exist in the palette */
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+        return 0;
+    }
+}
+
+/**
+ * Returns an <code>RGB</code> corresponding to the given pixel value.
+ *
+ * @param pixel the pixel to get the RGB value for
+ * @return the RGB value for the given pixel
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the pixel does not exist in the palette</li>
+ * </ul>
+ */
+public RGB getRGB(int pixel) {
+    if (isDirect) {
+        int r = pixel & redMask;
+        r = (redShift < 0) ? r >>> -redShift : r << redShift;
+        int g = pixel & greenMask;
+        g = (greenShift < 0) ? g >>> -greenShift : g << greenShift;
+        int b = pixel & blueMask;
+        b = (blueShift < 0) ? b >>> -blueShift : b << blueShift;
+        return new RGB(r, g, b);
+    } else {
+        if (pixel < 0 || pixel >= colors.length) {
+            SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+        }
+        return colors[pixel];
+    }
+}
+
+/**
+ * Returns all the RGB values in the receiver if it is an
+ * indexed palette, or null if it is a direct palette.
+ *
+ * @return the <code>RGB</code>s for the receiver or null
+ */
+public RGB[] getRGBs() {
+    return colors;
+}
+
+/**
+ * Computes the shift value for a given mask.
+ *
+ * @param mask the mask to compute the shift for
+ * @return the shift amount
+ *
+ * @see PaletteData
+ */
+int shiftForMask(int mask) {
+    for (int i = 31; i >= 0; i--) {
+        if (((mask >> i) & 0x1) !is 0) return 7 - i;
+    }
+    return 32;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Path.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,704 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.Path;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.Compatibility;
+import org.eclipse.swt.internal.cairo.Cairo;
+import org.eclipse.swt.graphics.Resource;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.GCData;
+import org.eclipse.swt.graphics.PathData;
+import java.lang.all;
+
+import tango.stdc.string;
+import tango.text.convert.Format;
+
+/**
+ * Instances of this class represent paths through the two-dimensional
+ * coordinate system. Paths do not have to be continuous, and can be
+ * described using lines, rectangles, arcs, cubic or quadratic bezier curves,
+ * glyphs, or other paths.
+ * <p>
+ * Application code must explicitly invoke the <code>Path.dispose()</code>
+ * method to release the operating system resources managed by each instance
+ * when those instances are no longer required.
+ * </p>
+ * <p>
+ * This class requires the operating system's advanced graphics subsystem
+ * which may not be available on some platforms.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#path">Path, Pattern snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: GraphicsExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ * 
+ * @since 3.1
+ */
+public class Path : Resource {
+    alias Resource.init_ init_;
+    /**
+     * the OS resource for the Path
+     * (Warning: This field is platform dependent)
+     * <p>
+     * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+     * public API. It is marked 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 accessed from application code.
+     * </p>
+     */
+    public cairo_t* handle;
+
+    bool moved, closed = true;
+
+/**
+ * Constructs a new empty Path.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param device the device on which to allocate the path
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the device is null and there is no current device</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES if a handle for the path could not be obtained</li>
+ * </ul>
+ *
+ * @see #dispose()
+ */
+public this (Device device) {
+    super(device);
+    this.device.checkCairo();
+    auto surface = Cairo.cairo_image_surface_create(Cairo.CAIRO_FORMAT_ARGB32, 1, 1);
+    if (surface is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    handle = Cairo.cairo_create(surface);
+    Cairo.cairo_surface_destroy(surface);
+    if (handle is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    init_();
+}
+
+/**
+ * Constructs a new Path that is a copy of <code>path</code>. If
+ * <code>flatness</code> is less than or equal to zero, an unflatten
+ * copy of the path is created. Otherwise, it specifies the maximum
+ * error between the path and its flatten copy. Smaller numbers give
+ * better approximation.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ * 
+ * @param device the device on which to allocate the path
+ * @param path the path to make a copy
+ * @param flatness the flatness value
+ * 
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the device is null and there is no current device</li>
+ *    <li>ERROR_NULL_ARGUMENT - if the path is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the path has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES if a handle for the path could not be obtained</li>
+ * </ul>
+ * 
+ * @see #dispose()
+ * @since 3.4
+ */
+public this (Device device, Path path, float flatness) {
+    super(device);
+    if (path is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (path.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    auto surface = Cairo.cairo_image_surface_create(Cairo.CAIRO_FORMAT_ARGB32, 1, 1);
+    if (surface is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    handle = Cairo.cairo_create(surface);
+    Cairo.cairo_surface_destroy(surface);
+    if (handle is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    cairo_path_t* copy;
+    flatness = Math.max(0, flatness);
+    if (flatness is 0) {
+        copy = Cairo.cairo_copy_path(path.handle);
+    } else {
+        double tolerance = Cairo.cairo_get_tolerance(path.handle);
+        Cairo.cairo_set_tolerance(path.handle, flatness);
+        copy = Cairo.cairo_copy_path_flat(path.handle);
+        Cairo.cairo_set_tolerance(path.handle, tolerance);
+    }
+    if (copy is null) {
+        Cairo.cairo_destroy(handle);
+        SWT.error(SWT.ERROR_NO_HANDLES);
+    }
+    Cairo.cairo_append_path(handle, copy);
+    Cairo.cairo_path_destroy(copy);
+    init_();
+}
+
+/**
+ * Constructs a new Path with the specifed PathData.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ * 
+ * @param device the device on which to allocate the path
+ * @param data the data for the path
+ * 
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the device is null and there is no current device</li>
+ *    <li>ERROR_NULL_ARGUMENT - if the data is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES if a handle for the path could not be obtained</li>
+ * </ul>
+ * 
+ * @see #dispose()
+ * @since 3.4
+ */
+public this (Device device, PathData data) {
+    this(device);
+    if (data is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    init_(data);
+}
+
+/**
+ * Adds to the receiver a circular or elliptical arc that lies within
+ * the specified rectangular area.
+ * <p>
+ * The resulting arc begins at <code>startAngle</code> and extends
+ * for <code>arcAngle</code> degrees.
+ * Angles are interpreted such that 0 degrees is at the 3 o'clock
+ * position. A positive value indicates a counter-clockwise rotation
+ * while a negative value indicates a clockwise rotation.
+ * </p><p>
+ * The center of the arc is the center of the rectangle whose origin
+ * is (<code>x</code>, <code>y</code>) and whose size is specified by the
+ * <code>width</code> and <code>height</code> arguments.
+ * </p><p>
+ * The resulting arc covers an area <code>width + 1</code> pixels wide
+ * by <code>height + 1</code> pixels tall.
+ * </p>
+ *
+ * @param x the x coordinate of the upper-left corner of the arc
+ * @param y the y coordinate of the upper-left corner of the arc
+ * @param width the width of the arc
+ * @param height the height of the arc
+ * @param startAngle the beginning angle
+ * @param arcAngle the angular extent of the arc, relative to the start angle
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void addArc(float x, float y, float width, float height, float startAngle, float arcAngle) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    moved = true;
+    if (width is height) {
+        float angle = -startAngle * cast(float)Compatibility.PI / 180;
+        if (closed) Cairo.cairo_move_to(handle, (x + width / 2f) + width / 2f * Math.cos(angle), (y + height / 2f) + height / 2f * Math.sin(angle));
+        if (arcAngle >= 0) {
+            Cairo.cairo_arc_negative(handle, x + width / 2f, y + height / 2f, width / 2f, angle, -(startAngle + arcAngle) * cast(float)Compatibility.PI / 180);
+        } else {
+            Cairo.cairo_arc(handle, x + width / 2f, y + height / 2f, width / 2f, angle, -(startAngle + arcAngle) * cast(float)Compatibility.PI / 180);
+        }
+    } else {
+        Cairo.cairo_save(handle);
+        Cairo.cairo_translate(handle, x + width / 2f, y + height / 2f);
+        Cairo.cairo_scale(handle, width / 2f, height / 2f);
+        float angle = -startAngle * cast(float)Compatibility.PI / 180;
+        if (closed) Cairo.cairo_move_to(handle, Math.cos(angle), Math.sin(angle));
+        if (arcAngle >= 0) {
+            Cairo.cairo_arc_negative(handle, 0, 0, 1, angle, -(startAngle + arcAngle) * cast(float)Compatibility.PI / 180);
+        } else {
+            Cairo.cairo_arc(handle, 0, 0, 1, angle, -(startAngle + arcAngle) * cast(float)Compatibility.PI / 180);
+        }
+        Cairo.cairo_restore(handle);
+    }
+    closed = false;
+    if (Math.abs(arcAngle) >= 360) close();
+}
+
+/**
+ * Adds to the receiver the path described by the parameter.
+ *
+ * @param path the path to add to the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parameter is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the parameter has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void addPath(Path path) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (path is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (path.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    moved = false;
+    auto copy = Cairo.cairo_copy_path(path.handle);
+    if (copy is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    Cairo.cairo_append_path(handle, copy);
+    Cairo.cairo_path_destroy(copy);
+    closed = path.closed;
+}
+
+/**
+ * Adds to the receiver the rectangle specified by x, y, width and height.
+ *
+ * @param x the x coordinate of the rectangle to add
+ * @param y the y coordinate of the rectangle to add
+ * @param width the width of the rectangle to add
+ * @param height the height of the rectangle to add
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void addRectangle(float x, float y, float width, float height) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    moved = false;
+    Cairo.cairo_rectangle(handle, x, y, width, height);
+    closed = true;
+}
+
+/**
+ * Adds to the receiver the pattern of glyphs generated by drawing
+ * the given string using the given font starting at the point (x, y).
+ *
+ * @param string the text to use
+ * @param x the x coordinate of the starting point
+ * @param y the y coordinate of the starting point
+ * @param font the font to use
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the font is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the font has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void addString(String str, float x, float y, Font font) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (font is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (font.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    moved = false;
+    GC.addCairoString(handle, str, x, y, font);
+    closed = true;
+}
+
+/**
+ * Closes the current sub path by adding to the receiver a line
+ * from the current point of the path back to the starting point
+ * of the sub path.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void close() {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    Cairo.cairo_close_path(handle);
+    moved = false;
+    closed = true;
+}
+
+/**
+ * Returns <code>true</code> if the specified point is contained by
+ * the receiver and false otherwise.
+ * <p>
+ * If outline is <code>true</code>, the point (x, y) checked for containment in
+ * the receiver's outline. If outline is <code>false</code>, the point is
+ * checked to see if it is contained within the bounds of the (closed) area
+ * covered by the receiver.
+ *
+ * @param x the x coordinate of the point to test for containment
+ * @param y the y coordinate of the point to test for containment
+ * @param gc the GC to use when testing for containment
+ * @param outline controls whether to check the outline or contained area of the path
+ * @return <code>true</code> if the path contains the point and <code>false</code> otherwise
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the gc is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the gc has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public bool contains(float x, float y, GC gc, bool outline) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (gc is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (gc.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    //TODO - see Windows
+    gc.initCairo();
+    gc.checkGC(GC.LINE_CAP | GC.LINE_JOIN | GC.LINE_STYLE | GC.LINE_WIDTH);
+    bool result = false;
+    auto cairo = gc.data.cairo;
+    auto copy = Cairo.cairo_copy_path(handle);
+    if (copy is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    Cairo.cairo_append_path(cairo, copy);
+    Cairo.cairo_path_destroy(copy);
+    if (outline) {
+        result = Cairo.cairo_in_stroke(cairo, x, y) !is 0;
+    } else {
+        result = Cairo.cairo_in_fill(cairo, x, y) !is 0;
+    }
+    Cairo.cairo_new_path(cairo);
+    return result;
+}
+
+/**
+ * Adds to the receiver a cubic bezier curve based on the parameters.
+ *
+ * @param cx1 the x coordinate of the first control point of the spline
+ * @param cy1 the y coordinate of the first control of the spline
+ * @param cx2 the x coordinate of the second control of the spline
+ * @param cy2 the y coordinate of the second control of the spline
+ * @param x the x coordinate of the end point of the spline
+ * @param y the y coordinate of the end point of the spline
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void cubicTo(float cx1, float cy1, float cx2, float cy2, float x, float y) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (!moved) {
+        double currentX, currentY;
+        Cairo.cairo_get_current_point(handle, &currentX, &currentY);
+        Cairo.cairo_move_to(handle, currentX, currentY);
+        moved = true;
+    }
+    Cairo.cairo_curve_to(handle, cx1, cy1, cx2, cy2, x, y);
+    closed = false;
+}
+
+/**
+ * Replaces the first four elements in the parameter with values that
+ * describe the smallest rectangle that will completely contain the
+ * receiver (i.e. the bounding box).
+ *
+ * @param bounds the array to hold the result
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parameter is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the parameter is too small to hold the bounding box</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void getBounds(float[] bounds) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (bounds is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (bounds.length < 4) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    auto copy = Cairo.cairo_copy_path(handle);
+    if (copy is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    cairo_path_t* path = new cairo_path_t();
+    memmove(path, copy, cairo_path_t.sizeof);
+    double minX = 0, minY = 0, maxX = 0, maxY = 0;
+    if (path.num_data > 0) {
+        minX = minY = double.max;
+        maxX = maxY = -double.max;
+        int i = 0;
+        cairo_path_data_t* data = new cairo_path_data_t();
+        while (i < path.num_data) {
+            *data = path.data[i];
+            switch (data.header.type) {
+                case Cairo.CAIRO_PATH_MOVE_TO:
+                    minX = Math.min(minX, path.data[i+1].point.x);
+                    minY = Math.min(minY, path.data[i+1].point.y);
+                    maxX = Math.max(maxX, path.data[i+1].point.x);
+                    maxY = Math.max(maxY, path.data[i+1].point.y);
+                    break;
+                case Cairo.CAIRO_PATH_LINE_TO:
+                    minX = Math.min(minX, path.data[i+1].point.x);
+                    minY = Math.min(minY, path.data[i+1].point.y);
+                    maxX = Math.max(maxX, path.data[i+1].point.x);
+                    maxY = Math.max(maxY, path.data[i+1].point.y);
+                    break;
+                case Cairo.CAIRO_PATH_CURVE_TO:
+                    minX = Math.min(minX, path.data[i+1].point.x);
+                    minY = Math.min(minY, path.data[i+1].point.y);
+                    maxX = Math.max(maxX, path.data[i+1].point.x);
+                    maxY = Math.max(maxY, path.data[i+1].point.y);
+                    minX = Math.min(minX, path.data[i+2].point.x);
+                    minY = Math.min(minY, path.data[i+2].point.y);
+                    maxX = Math.max(maxX, path.data[i+2].point.x);
+                    maxY = Math.max(maxY, path.data[i+2].point.y);
+                    minX = Math.min(minX, path.data[i+3].point.x);
+                    minY = Math.min(minY, path.data[i+3].point.y);
+                    maxX = Math.max(maxX, path.data[i+3].point.x);
+                    maxY = Math.max(maxY, path.data[i+3].point.y);
+                    break;
+                case Cairo.CAIRO_PATH_CLOSE_PATH: break;
+                default:
+            }
+            i += data.header.length;
+        }
+    }
+    bounds[0] = cast(float)minX;
+    bounds[1] = cast(float)minY;
+    bounds[2] = cast(float)(maxX - minX);
+    bounds[3] = cast(float)(maxY - minY);
+    Cairo.cairo_path_destroy(copy);
+}
+
+/**
+ * Replaces the first two elements in the parameter with values that
+ * describe the current point of the path.
+ *
+ * @param point the array to hold the result
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parameter is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the parameter is too small to hold the end point</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void getCurrentPoint(float[] point) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (point is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (point.length < 2) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    double x, y;
+    Cairo.cairo_get_current_point(handle, &x, &y);
+    point[0] = cast(float)x;
+    point[1] = cast(float)y;
+}
+
+/**
+ * Returns a device independent representation of the receiver.
+ *
+ * @return the PathData for the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see PathData
+ */
+public PathData getPathData() {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    auto copy = Cairo.cairo_copy_path(handle);
+    if (copy is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    cairo_path_t* path = new cairo_path_t();
+    *path = *copy;
+    byte[] types = new byte[path.num_data];
+    float[] pts = new float[path.num_data * 6];
+    int typeIndex = 0, ptsIndex = 0;
+    if (path.num_data > 0) {
+        int i = 0;
+        double[] points = new double[6];
+        cairo_path_data_t* data = new cairo_path_data_t();
+        while (i < path.num_data) {
+            switch (data.header.type) {
+                case Cairo.CAIRO_PATH_MOVE_TO:
+                    types[typeIndex++] = SWT.PATH_MOVE_TO;
+                    pts[ptsIndex++] = cast(float)path.data[i+1].point.x;
+                    pts[ptsIndex++] = cast(float)path.data[i+1].point.y;
+                    break;
+                case Cairo.CAIRO_PATH_LINE_TO:
+                    types[typeIndex++] = SWT.PATH_LINE_TO;
+                    pts[ptsIndex++] = cast(float)path.data[i+1].point.x;
+                    pts[ptsIndex++] = cast(float)path.data[i+1].point.y;
+                    break;
+                case Cairo.CAIRO_PATH_CURVE_TO:
+                    types[typeIndex++] = SWT.PATH_CUBIC_TO;
+                    pts[ptsIndex++] = cast(float)path.data[i+1].point.x;
+                    pts[ptsIndex++] = cast(float)path.data[i+1].point.y;
+                    pts[ptsIndex++] = cast(float)path.data[i+2].point.x;
+                    pts[ptsIndex++] = cast(float)path.data[i+2].point.y;
+                    pts[ptsIndex++] = cast(float)path.data[i+3].point.x;
+                    pts[ptsIndex++] = cast(float)path.data[i+3].point.y;
+                    break;
+                case Cairo.CAIRO_PATH_CLOSE_PATH:
+                    types[typeIndex++] = SWT.PATH_CLOSE;
+                    break;
+                default:
+            }
+            i += data.header.length;
+        }
+    }
+    if (typeIndex !is types.length) {
+        byte[] newTypes = new byte[typeIndex];
+        System.arraycopy(types, 0, newTypes, 0, typeIndex);
+        types = newTypes;
+    }
+    if (ptsIndex !is pts.length) {
+        float[] newPts = new float[ptsIndex];
+        System.arraycopy(pts, 0, newPts, 0, ptsIndex);
+        pts = newPts;
+    }
+    Cairo.cairo_path_destroy(copy);
+    PathData result = new PathData();
+    result.types = types;
+    result.points = pts;
+    return result;
+}
+
+/**
+ * Adds to the receiver a line from the current point to
+ * the point specified by (x, y).
+ *
+ * @param x the x coordinate of the end of the line to add
+ * @param y the y coordinate of the end of the line to add
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void lineTo(float x, float y) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (!moved) {
+        double currentX, currentY;
+        Cairo.cairo_get_current_point(handle, &currentX, &currentY);
+        Cairo.cairo_move_to(handle, currentX, currentY);
+        moved = true;
+    }
+    Cairo.cairo_line_to(handle, x, y);
+    closed = false;
+}
+
+/**
+ * Sets the current point of the receiver to the point
+ * specified by (x, y). Note that this starts a new
+ * sub path.
+ *
+ * @param x the x coordinate of the new end point
+ * @param y the y coordinate of the new end point
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void moveTo(float x, float y) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    /*
+    * Bug in Cairo.  If cairo_move_to() is not called at the
+    * begining of a subpath, the first cairo_line_to() or
+    * cairo_curve_to() segment do not output anything.  The fix
+    * is to detect that the app did not call cairo_move_to()
+    * before those calls and call it explicitly.
+    */
+    moved = true;
+    Cairo.cairo_move_to(handle, x, y);
+    closed = true;
+}
+
+/**
+ * Adds to the receiver a quadratic curve based on the parameters.
+ *
+ * @param cx the x coordinate of the control point of the spline
+ * @param cy the y coordinate of the control point of the spline
+ * @param x the x coordinate of the end point of the spline
+ * @param y the y coordinate of the end point of the spline
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void quadTo(float cx, float cy, float x, float y) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    double currentX, currentY;
+    Cairo.cairo_get_current_point(handle, &currentX, &currentY);
+    if (!moved) {
+        Cairo.cairo_move_to(handle, currentX, currentY);
+        moved = true;
+    }
+    float x0 = cast(float)currentX;
+    float y0 = cast(float)currentY;
+    float cx1 = x0 + 2 * (cx - x0) / 3;
+    float cy1 = y0 + 2 * (cy - y0) / 3;
+    float cx2 = cx1 + (x - x0) / 3;
+    float cy2 = cy1 + (y - y0) / 3;
+    Cairo.cairo_curve_to(handle, cx1, cy1, cx2, cy2, x, y);
+    closed = false;
+}
+
+void destroy() {
+    Cairo.cairo_destroy(handle);
+    handle = null;
+}
+
+void init_(PathData data) {
+    byte[] types = data.types;
+    float[] points = data.points;
+    for (int i = 0, j = 0; i < types.length; i++) {
+        switch (types[i]) {
+            case SWT.PATH_MOVE_TO:
+                moveTo(points[j++], points[j++]);
+                break;
+            case SWT.PATH_LINE_TO:
+                lineTo(points[j++], points[j++]);
+                break;
+            case SWT.PATH_CUBIC_TO:
+                cubicTo(points[j++], points[j++], points[j++], points[j++], points[j++], points[j++]);
+                break;
+            case SWT.PATH_QUAD_TO:
+                quadTo(points[j++], points[j++], points[j++], points[j++]);
+                break;
+            case SWT.PATH_CLOSE:
+                close();
+                break;
+            default:
+                dispose();
+                SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+        }
+    }
+}
+
+/**
+ * Returns <code>true</code> if the Path has been disposed,
+ * and <code>false</code> otherwise.
+ * <p>
+ * This method gets the dispose state for the Path.
+ * When a Path has been disposed, it is an error to
+ * invoke any other method using the Path.
+ *
+ * @return <code>true</code> when the Path is disposed, and <code>false</code> otherwise
+ */
+public override bool isDisposed() {
+    return handle is null;
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the receiver
+ */
+public override String toString() {
+    if (isDisposed()) return "Path {*DISPOSED*}";
+    return Format( "Path {{{}}", handle );
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/PathData.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.PathData;
+
+import java.lang.all;
+
+
+/**
+ * Instances of this class describe device-independent paths.
+ *
+ * @see Path
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.1
+ */
+public final class PathData {
+
+    /**
+     * The type of each point.
+     */
+    public byte[] types;
+
+    /**
+     * The points of a path.
+     */
+    public float[] points;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Pattern.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,218 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.Pattern;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Resource;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.internal.cairo.Cairo;
+
+import tango.text.convert.Format;
+
+/**
+ * Instances of this class represent patterns to use while drawing. Patterns
+ * can be specified either as bitmaps or gradients.
+ * <p>
+ * Application code must explicitly invoke the <code>Pattern.dispose()</code>
+ * method to release the operating system resources managed by each instance
+ * when those instances are no longer required.
+ * </p>
+ * <p>
+ * This class requires the operating system's advanced graphics subsystem
+ * which may not be available on some platforms.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#path">Path, Pattern snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: GraphicsExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.1
+ */
+public class Pattern : Resource {
+
+    /**
+     * the OS resource for the Pattern
+     * (Warning: This field is platform dependent)
+     * <p>
+     * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+     * public API. It is marked 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 accessed from application code.
+     * </p>
+     */
+    public cairo_pattern_t* handle;
+
+    cairo_surface_t * surface;
+
+/**
+ * Constructs a new Pattern given an image. Drawing with the resulting
+ * pattern will cause the image to be tiled over the resulting area.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param device the device on which to allocate the pattern
+ * @param image the image that the pattern will draw
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the device is null and there is no current device, or the image is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES if a handle for the pattern could not be obtained</li>
+ * </ul>
+ *
+ * @see #dispose()
+ */
+public this(Device device, Image image) {
+    super(device);
+    if (image is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (image.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    this.device.checkCairo();
+    image.createSurface();
+    handle = Cairo.cairo_pattern_create_for_surface(image.surface);
+    if (handle is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    Cairo.cairo_pattern_set_extend(handle, Cairo.CAIRO_EXTEND_REPEAT);
+    surface = image.surface;
+    init_();
+}
+
+/**
+ * Constructs a new Pattern that represents a linear, two color
+ * gradient. Drawing with the pattern will cause the resulting area to be
+ * tiled with the gradient specified by the arguments.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param device the device on which to allocate the pattern
+ * @param x1 the x coordinate of the starting corner of the gradient
+ * @param y1 the y coordinate of the starting corner of the gradient
+ * @param x2 the x coordinate of the ending corner of the gradient
+ * @param y2 the y coordinate of the ending corner of the gradient
+ * @param color1 the starting color of the gradient
+ * @param color2 the ending color of the gradient
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the device is null and there is no current device,
+ *                              or if either color1 or color2 is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if either color1 or color2 has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES if a handle for the pattern could not be obtained</li>
+ * </ul>
+ *
+ * @see #dispose()
+ */
+public this(Device device, float x1, float y1, float x2, float y2, Color color1, Color color2) {
+    this(device, x1, y1, x2, y2, color1, 0xFF, color2, 0xFF);
+}
+/**
+ * Constructs a new Pattern that represents a linear, two color
+ * gradient. Drawing with the pattern will cause the resulting area to be
+ * tiled with the gradient specified by the arguments.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param device the device on which to allocate the pattern
+ * @param x1 the x coordinate of the starting corner of the gradient
+ * @param y1 the y coordinate of the starting corner of the gradient
+ * @param x2 the x coordinate of the ending corner of the gradient
+ * @param y2 the y coordinate of the ending corner of the gradient
+ * @param color1 the starting color of the gradient
+ * @param alpha1 the starting alpha value of the gradient
+ * @param color2 the ending color of the gradient
+ * @param alpha2 the ending alpha value of the gradient
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the device is null and there is no current device,
+ *                              or if either color1 or color2 is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if either color1 or color2 has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES if a handle for the pattern could not be obtained</li>
+ * </ul>
+ *
+ * @see #dispose()
+ *
+ * @since 3.2
+ */
+public this(Device device, float x1, float y1, float x2, float y2, Color color1, int alpha1, Color color2, int alpha2) {
+    super(device);
+    if (color1 is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (color1.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    if (color2 is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (color2.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    this.device.checkCairo();
+    handle = Cairo.cairo_pattern_create_linear(x1, y1, x2, y2);
+    if (handle is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    GC.setCairoPatternColor(handle, 0, color1, alpha1);
+    GC.setCairoPatternColor(handle, 1, color2, alpha2);
+    Cairo.cairo_pattern_set_extend(handle, Cairo.CAIRO_EXTEND_REPEAT);
+    init_();
+}
+
+void destroy() {
+    Cairo.cairo_pattern_destroy(handle);
+    handle = null;
+    surface = null;
+}
+
+/**
+ * Returns <code>true</code> if the Pattern has been disposed,
+ * and <code>false</code> otherwise.
+ * <p>
+ * This method gets the dispose state for the Pattern.
+ * When a Pattern has been disposed, it is an error to
+ * invoke any other method using the Pattern.
+ *
+ * @return <code>true</code> when the Pattern is disposed, and <code>false</code> otherwise
+ */
+public override bool isDisposed() {
+    return handle is null;
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the receiver
+ */
+public override String toString() {
+    if (isDisposed()) return "Pattern {*DISPOSED*}";
+    return Format( "Pattern {{{}}", handle );
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Point.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.Point;
+
+import java.lang.all;
+
+
+public import org.eclipse.swt.internal.SerializableCompatibility;
+
+import tango.text.convert.Format;
+
+/**
+ * Instances of this class represent places on the (x, y)
+ * coordinate plane.
+ * <p>
+ * The coordinate space for rectangles and points is considered
+ * to have increasing values downward and to the right from its
+ * origin making this the normal, computer graphics oriented notion
+ * of (x, y) coordinates rather than the strict mathematical one.
+ * </p>
+ * <p>
+ * The hashCode() method in this class uses the values of the public
+ * fields to compute the hash value. When storing instances of the
+ * class in hashed collections, do not modify these fields after the
+ * object has been inserted.
+ * </p>
+ * <p>
+ * Application code does <em>not</em> need to explicitly release the
+ * resources managed by each instance when those instances are no longer
+ * required, and thus no <code>dispose()</code> method is provided.
+ * </p>
+ *
+ * @see Rectangle
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public final class Point : SerializableCompatibility {
+
+    /**
+     * the x coordinate of the point
+     */
+    public int x;
+
+    /**
+     * the y coordinate of the point
+     */
+    public int y;
+
+    //static final long serialVersionUID = 3257002163938146354L;
+
+/**
+ * Constructs a new point with the given x and y coordinates.
+ *
+ * @param x the x coordinate of the new point
+ * @param y the y coordinate of the new point
+ */
+public this (int x, int y) {
+    this.x = x;
+    this.y = y;
+}
+
+/**
+ * Compares the argument to the receiver, and returns true
+ * if they represent the <em>same</em> object using a class
+ * specific comparison.
+ *
+ * @param object the object to compare with this object
+ * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
+ *
+ * @see #hashCode()
+ */
+public override int opEquals (Object object) {
+    if (object is this) return true;
+    if ( auto p = cast(Point)object ){
+        return (p.x is this.x) && (p.y is this.y);
+    }
+    return false;
+}
+
+/**
+ * Returns an integer hash code for the receiver. Any two
+ * objects that return <code>true</code> when passed to
+ * <code>equals</code> must return the same value for this
+ * method.
+ *
+ * @return the receiver's hash
+ *
+ * @see #equals(Object)
+ */
+override public hash_t toHash () {
+    return x ^ y;
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the point
+ */
+override public String toString () {
+    return Format( "Point {{{}, {}}", x, y );; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+}
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/RGB.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,233 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.RGB;
+
+import java.lang.all;
+
+public import org.eclipse.swt.internal.SerializableCompatibility;
+
+import org.eclipse.swt.SWT;
+import tango.text.convert.Format;
+
+/**
+ * Instances of this class are descriptions of colors in
+ * terms of the primary additive color model (red, green and
+ * blue). A color may be described in terms of the relative
+ * intensities of these three primary colors. The brightness
+ * of each color is specified by a value in the range 0 to 255,
+ * where 0 indicates no color (blackness) and 255 indicates
+ * maximum intensity.
+ * <p>
+ * The hashCode() method in this class uses the values of the public
+ * fields to compute the hash value. When storing instances of the
+ * class in hashed collections, do not modify these fields after the
+ * object has been inserted.
+ * </p>
+ * <p>
+ * Application code does <em>not</em> need to explicitly release the
+ * resources managed by each instance when those instances are no longer
+ * required, and thus no <code>dispose()</code> method is provided.
+ * </p>
+ *
+ * @see Color
+ * @see <a href="http://www.eclipse.org/swt/snippets/#color">Color and RGB snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public final class RGB : SerializableCompatibility {
+
+    /**
+     * the red component of the RGB
+     */
+    public int red;
+
+    /**
+     * the green component of the RGB
+     */
+    public int green;
+
+    /**
+     * the blue component of the RGB
+     */
+    public int blue;
+
+    //static final long serialVersionUID = 3258415023461249074L;
+
+/**
+ * Constructs an instance of this class with the given
+ * red, green and blue values.
+ *
+ * @param red the red component of the new instance
+ * @param green the green component of the new instance
+ * @param blue the blue component of the new instance
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the red, green or blue argument is not between 0 and 255</li>
+ * </ul>
+ */
+public this (int red, int green, int blue) {
+    if ((red > 255) || (red < 0) ||
+        (green > 255) || (green < 0) ||
+        (blue > 255) || (blue < 0))
+            SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    this.red = red;
+    this.green = green;
+    this.blue = blue;
+}
+
+/**
+* Constructs an instance of this class with the given
+* hue, saturation, and brightness.
+*
+* @param hue the hue value for the HSB color (from 0 to 360)
+* @param saturation the saturation value for the HSB color (from 0 to 1)
+* @param brightness the brightness value for the HSB color (from 0 to 1)
+*
+* @exception IllegalArgumentException <ul>
+*    <li>ERROR_INVALID_ARGUMENT - if the hue is not between 0 and 360 or
+*    the saturation or brightness is not between 0 and 1</li>
+* </ul>
+*
+* @since 3.2
+*/
+public this (float hue, float saturation, float brightness) {
+    if (hue < 0 || hue > 360 || saturation < 0 || saturation > 1 ||
+        brightness < 0 || brightness > 1) {
+        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    float r, g, b;
+    if (saturation is 0) {
+        r = g = b = brightness;
+    } else {
+        if (hue is 360) hue = 0;
+        hue /= 60;
+        int i = cast(int)hue;
+        float f = hue - i;
+        float p = brightness * (1 - saturation);
+        float q = brightness * (1 - saturation * f);
+        float t = brightness * (1 - saturation * (1 - f));
+        switch(i) {
+            case 0:
+                r = brightness;
+                g = t;
+                b = p;
+                break;
+            case 1:
+                r = q;
+                g = brightness;
+                b = p;
+                break;
+            case 2:
+                r = p;
+                g = brightness;
+                b = t;
+                break;
+            case 3:
+                r = p;
+                g = q;
+                b = brightness;
+                break;
+            case 4:
+                r = t;
+                g = p;
+                b = brightness;
+                break;
+            case 5:
+            default:
+                r = brightness;
+                g = p;
+                b = q;
+                break;
+        }
+    }
+    red = cast(int)(r * 255 + 0.5);
+    green = cast(int)(g * 255 + 0.5);
+    blue = cast(int)(b * 255 + 0.5);
+}
+
+/**
+ * Returns the hue, saturation, and brightness of the color.
+ *
+ * @return color space values in float format (hue, saturation, brightness)
+ *
+ * @since 3.2
+ */
+public float[] getHSB() {
+    float r = red / 255f;
+    float g = green / 255f;
+    float b = blue / 255f;
+    float max = Math.max(Math.max(r, g), b);
+    float min = Math.min(Math.min(r, g), b);
+    float delta = max - min;
+    float hue = 0;
+    float brightness = max;
+    float saturation = max is 0 ? 0 : (max - min) / max;
+    if (delta !is 0) {
+        if (r is max) {
+            hue = (g  - b) / delta;
+        } else {
+            if (g is max) {
+                hue = 2 + (b - r) / delta;
+            } else {
+                hue = 4 + (r - g) / delta;
+            }
+        }
+        hue *= 60;
+        if (hue < 0) hue += 360;
+    }
+    return [ hue, saturation, brightness ];
+}
+
+/**
+ * Compares the argument to the receiver, and returns true
+ * if they represent the <em>same</em> object using a class
+ * specific comparison.
+ *
+ * @param object the object to compare with this object
+ * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
+ *
+ * @see #hashCode()
+ */
+public override int opEquals(Object object) {
+    if (object is this) return true;
+    if( auto rgb = cast(RGB) object ){
+        return (rgb.red is this.red) && (rgb.green is this.green) && (rgb.blue is this.blue);
+    }
+    return false;
+}
+
+/**
+ * Returns an integer hash code for the receiver. Any two
+ * objects that return <code>true</code> when passed to
+ * <code>equals</code> must return the same value for this
+ * method.
+ *
+ * @return the receiver's hash
+ *
+ * @see #equals(Object)
+ */
+override public hash_t toHash() {
+    return (blue << 16) | (green << 8) | red;
+}
+
+/**
+ * Returns a String containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a String representation of the <code>RGB</code>
+ */
+public override String toString() {
+    return Format( "RGB {{{}, {}, {}}", red, green, blue ); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Rectangle.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,354 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.Rectangle;
+
+import java.lang.all;
+
+public import org.eclipse.swt.graphics.Point;
+public import org.eclipse.swt.internal.SerializableCompatibility;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTError;
+import tango.text.convert.Format;
+
+/**
+ * Instances of this class represent rectangular areas in an
+ * (x, y) coordinate system. The top left corner of the rectangle
+ * is specified by its x and y values, and the extent of the
+ * rectangle is specified by its width and height.
+ * <p>
+ * The coordinate space for rectangles and points is considered
+ * to have increasing values downward and to the right from its
+ * origin making this the normal, computer graphics oriented notion
+ * of (x, y) coordinates rather than the strict mathematical one.
+ * </p>
+ * <p>
+ * The hashCode() method in this class uses the values of the public
+ * fields to compute the hash value. When storing instances of the
+ * class in hashed collections, do not modify these fields after the
+ * object has been inserted.
+ * </p>
+ * <p>
+ * Application code does <em>not</em> need to explicitly release the
+ * resources managed by each instance when those instances are no longer
+ * required, and thus no <code>dispose()</code> method is provided.
+ * </p>
+ *
+ * @see Point
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public final class Rectangle : SerializableCompatibility {
+
+    /**
+     * the x coordinate of the rectangle
+     */
+    public int x;
+
+    /**
+     * the y coordinate of the rectangle
+     */
+    public int y;
+
+    /**
+     * the width of the rectangle
+     */
+    public int width;
+
+    /**
+     * the height of the rectangle
+     */
+    public int height;
+
+    //static final long serialVersionUID = 3256439218279428914L;
+
+/**
+ * Construct a new instance of this class given the
+ * x, y, width and height values.
+ *
+ * @param x the x coordinate of the origin of the rectangle
+ * @param y the y coordinate of the origin of the rectangle
+ * @param width the width of the rectangle
+ * @param height the height of the rectangle
+ */
+public this (int x, int y, int width, int height) {
+    this.x = x;
+    this.y = y;
+    this.width = width;
+    this.height = height;
+}
+
+/**
+ * Destructively replaces the x, y, width and height values
+ * in the receiver with ones which represent the union of the
+ * rectangles specified by the receiver and the given rectangle.
+ * <p>
+ * The union of two rectangles is the smallest single rectangle
+ * that completely covers both of the areas covered by the two
+ * given rectangles.
+ * </p>
+ *
+ * @param rect the rectangle to merge with the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ * </ul>
+ */
+public void add (Rectangle rect) {
+    if (rect is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    int left = x < rect.x ? x : rect.x;
+    int top = y < rect.y ? y : rect.y;
+    int lhs = x + width;
+    int rhs = rect.x + rect.width;
+    int right = lhs > rhs ? lhs : rhs;
+    lhs = y + height;
+    rhs = rect.y + rect.height;
+    int bottom = lhs > rhs ? lhs : rhs;
+    x = left;  y = top;  width = right - left;  height = bottom - top;
+}
+
+/**
+ * Returns <code>true</code> if the point specified by the
+ * arguments is inside the area specified by the receiver,
+ * and <code>false</code> otherwise.
+ *
+ * @param x the x coordinate of the point to test for containment
+ * @param y the y coordinate of the point to test for containment
+ * @return <code>true</code> if the rectangle contains the point and <code>false</code> otherwise
+ */
+public bool contains (int x, int y) {
+    return (x >= this.x) && (y >= this.y) && ((x - this.x) < width) && ((y - this.y) < height);
+}
+
+/**
+ * Returns <code>true</code> if the given point is inside the
+ * area specified by the receiver, and <code>false</code>
+ * otherwise.
+ *
+ * @param pt the point to test for containment
+ * @return <code>true</code> if the rectangle contains the point and <code>false</code> otherwise
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ * </ul>
+ */
+public bool contains (Point pt) {
+    if (pt is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    return contains(pt.x, pt.y);
+}
+
+/**
+ * Compares the argument to the receiver, and returns true
+ * if they represent the <em>same</em> object using a class
+ * specific comparison.
+ *
+ * @param object the object to compare with this object
+ * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
+ *
+ * @see #hashCode()
+ */
+public override int opEquals (Object object) {
+    if (object is this) return true;
+    if( auto r = cast(Rectangle) object ){
+        return (r.x is this.x) && (r.y is this.y) && (r.width is this.width) && (r.height is this.height);
+    }
+    return false;
+}
+
+/**
+ * Returns an integer hash code for the receiver. Any two
+ * objects that return <code>true</code> when passed to
+ * <code>equals</code> must return the same value for this
+ * method.
+ *
+ * @return the receiver's hash
+ *
+ * @see #equals(Object)
+ */
+public override hash_t toHash () {
+    return x ^ y ^ width ^ height;
+}
+
+/**
+ * Destructively replaces the x, y, width and height values
+ * in the receiver with ones which represent the intersection of the
+ * rectangles specified by the receiver and the given rectangle.
+ *
+ * @param rect the rectangle to intersect with the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ * </ul>
+ *
+ * since 3.0
+ */
+public void intersect (Rectangle rect) {
+    if (rect is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (this is rect) return;
+    int left = x > rect.x ? x : rect.x;
+    int top = y > rect.y ? y : rect.y;
+    int lhs = x + width;
+    int rhs = rect.x + rect.width;
+    int right = lhs < rhs ? lhs : rhs;
+    lhs = y + height;
+    rhs = rect.y + rect.height;
+    int bottom = lhs < rhs ? lhs : rhs;
+    x = right < left ? 0 : left;
+    y = bottom < top ? 0 : top;
+    width = right < left ? 0 : right - left;
+    height = bottom < top ? 0 : bottom - top;
+}
+
+/**
+ * Returns a new rectangle which represents the intersection
+ * of the receiver and the given rectangle.
+ * <p>
+ * The intersection of two rectangles is the rectangle that
+ * covers the area which is contained within both rectangles.
+ * </p>
+ *
+ * @param rect the rectangle to intersect with the receiver
+ * @return the intersection of the receiver and the argument
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ * </ul>
+ */
+public Rectangle intersection (Rectangle rect) {
+    if (rect is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (this is rect) return new Rectangle (x, y, width, height);
+    int left = x > rect.x ? x : rect.x;
+    int top = y > rect.y ? y : rect.y;
+    int lhs = x + width;
+    int rhs = rect.x + rect.width;
+    int right = lhs < rhs ? lhs : rhs;
+    lhs = y + height;
+    rhs = rect.y + rect.height;
+    int bottom = lhs < rhs ? lhs : rhs;
+    return new Rectangle (
+        right < left ? 0 : left,
+        bottom < top ? 0 : top,
+        right < left ? 0 : right - left,
+        bottom < top ? 0 : bottom - top);
+}
+
+/**
+ * Returns <code>true</code> if the rectangle described by the
+ * arguments intersects with the receiver and <code>false</code>
+ * otherwise.
+ * <p>
+ * Two rectangles intersect if the area of the rectangle
+ * representing their intersection is not empty.
+ * </p>
+ *
+ * @param x the x coordinate of the origin of the rectangle
+ * @param y the y coordinate of the origin of the rectangle
+ * @param width the width of the rectangle
+ * @param height the height of the rectangle
+ * @return <code>true</code> if the rectangle intersects with the receiver, and <code>false</code> otherwise
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ * </ul>
+ *
+ * @see #intersection(Rectangle)
+ * @see #isEmpty()
+ *
+ * @since 3.0
+ */
+public bool intersects (int x, int y, int width, int height) {
+    return (x < this.x + this.width) && (y < this.y + this.height) &&
+        (x + width > this.x) && (y + height > this.y);
+}
+
+/**
+ * Returns <code>true</code> if the given rectangle intersects
+ * with the receiver and <code>false</code> otherwise.
+ * <p>
+ * Two rectangles intersect if the area of the rectangle
+ * representing their intersection is not empty.
+ * </p>
+ *
+ * @param rect the rectangle to test for intersection
+ * @return <code>true</code> if the rectangle intersects with the receiver, and <code>false</code> otherwise
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ * </ul>
+ *
+ * @see #intersection(Rectangle)
+ * @see #isEmpty()
+ */
+public bool intersects (Rectangle rect) {
+    if (rect is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    return rect is this || intersects (rect.x, rect.y, rect.width, rect.height);
+}
+
+/**
+ * Returns <code>true</code> if the receiver does not cover any
+ * area in the (x, y) coordinate plane, and <code>false</code> if
+ * the receiver does cover some area in the plane.
+ * <p>
+ * A rectangle is considered to <em>cover area</em> in the
+ * (x, y) coordinate plane if both its width and height are
+ * non-zero.
+ * </p>
+ *
+ * @return <code>true</code> if the receiver is empty, and <code>false</code> otherwise
+ */
+public bool isEmpty () {
+    return (width <= 0) || (height <= 0);
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the rectangle
+ */
+public override String toString () {
+    return Format( "Rectangle {{{}, {}, {}, {}}", x, y, width, height ); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+}
+
+/**
+ * Returns a new rectangle which represents the union of
+ * the receiver and the given rectangle.
+ * <p>
+ * The union of two rectangles is the smallest single rectangle
+ * that completely covers both of the areas covered by the two
+ * given rectangles.
+ * </p>
+ *
+ * @param rect the rectangle to perform union with
+ * @return the union of the receiver and the argument
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ * </ul>
+ *
+ * @see #add(Rectangle)
+ */
+public Rectangle makeUnion (Rectangle rect) {
+    if (rect is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    int left = x < rect.x ? x : rect.x;
+    int top = y < rect.y ? y : rect.y;
+    int lhs = x + width;
+    int rhs = rect.x + rect.width;
+    int right = lhs > rhs ? lhs : rhs;
+    lhs = y + height;
+    rhs = rect.y + rect.height;
+    int bottom = lhs > rhs ? lhs : rhs;
+    return new Rectangle (left, top, right - left, bottom - top);
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Region.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,605 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.Region;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Resource;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.internal.gtk.OS;
+
+import tango.text.convert.Format;
+
+/**
+ * Instances of this class represent areas of an x-y coordinate
+ * system that are aggregates of the areas covered by a number
+ * of polygons.
+ * <p>
+ * Application code must explicitly invoke the <code>Region.dispose()</code>
+ * method to release the operating system resources managed by each instance
+ * when those instances are no longer required.
+ * </p>
+ * 
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: GraphicsExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public final class Region : Resource {
+    /**
+     * the OS resource for the region
+     * (Warning: This field is platform dependent)
+     * <p>
+     * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+     * public API. It is marked 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 accessed from application code.
+     * </p>
+     */
+    public GdkRegion* handle;
+
+/**
+ * Constructs a new empty region.
+ *
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES if a handle could not be obtained for region creation</li>
+ * </ul>
+ */
+public this() {
+    this(null);
+}
+
+/**
+ * Constructs a new empty region.
+ * <p>
+ * You must dispose the region when it is no longer required.
+ * </p>
+ *
+ * @param device the device on which to allocate the region
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES if a handle could not be obtained for region creation</li>
+ * </ul>
+ *
+ * @see #dispose
+ *
+ * @since 3.0
+ */
+public this(Device device) {
+    super(device);
+    handle = OS.gdk_region_new();
+    if (handle is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    init_();
+}
+
+this(Device device, GdkRegion* handle) {
+    super(device);
+    this.handle = handle;
+}
+
+/**
+ * Adds the given polygon to the collection of polygons
+ * the receiver maintains to describe its area.
+ *
+ * @param pointArray points that describe the polygon to merge with the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+*
+ */
+public void add (int[] pointArray) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (pointArray is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    /*
+    * Bug in GTK. If gdk_region_polygon() is called with one point,
+    * it segment faults. The fix is to make sure that it is called
+    * with enough points for a polygon.
+    */
+    if (pointArray.length < 6) return;
+    auto polyRgn = OS.gdk_region_polygon(cast(GdkPoint*)pointArray.ptr, pointArray.length / 2, OS.GDK_EVEN_ODD_RULE);
+    OS.gdk_region_union(handle, polyRgn);
+    OS.gdk_region_destroy(polyRgn);
+}
+
+/**
+ * Adds the given rectangle to the collection of polygons
+ * the receiver maintains to describe its area.
+ *
+ * @param rect the rectangle to merge with the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the rectangle's width or height is negative</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void add(Rectangle rect) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (rect is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    add (rect.x, rect.y, rect.width, rect.height);
+}
+
+/**
+ * Adds the given rectangle to the collection of polygons
+ * the receiver maintains to describe its area.
+ *
+ * @param x the x coordinate of the rectangle
+ * @param y the y coordinate of the rectangle
+ * @param width the width coordinate of the rectangle
+ * @param height the height coordinate of the rectangle
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the rectangle's width or height is negative</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void add(int x, int y, int width, int height) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (width < 0 || height < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    GdkRectangle* gdkRect = new GdkRectangle();
+    gdkRect.x = x;
+    gdkRect.y = y;
+    gdkRect.width = width;
+    gdkRect.height = height;
+    OS.gdk_region_union_with_rect(handle, gdkRect);
+}
+
+/**
+ * Adds all of the polygons which make up the area covered
+ * by the argument to the collection of polygons the receiver
+ * maintains to describe its area.
+ *
+ * @param region the region to merge
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void add(Region region) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (region is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (region.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    OS.gdk_region_union(handle, region.handle);
+}
+
+/**
+ * Returns <code>true</code> if the point specified by the
+ * arguments is inside the area specified by the receiver,
+ * and <code>false</code> otherwise.
+ *
+ * @param x the x coordinate of the point to test for containment
+ * @param y the y coordinate of the point to test for containment
+ * @return <code>true</code> if the region contains the point and <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public bool contains(int x, int y) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    return cast(bool)OS.gdk_region_point_in(handle, x, y);
+}
+
+/**
+ * Returns <code>true</code> if the given point is inside the
+ * area specified by the receiver, and <code>false</code>
+ * otherwise.
+ *
+ * @param pt the point to test for containment
+ * @return <code>true</code> if the region contains the point and <code>false</code> otherwise
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public bool contains(Point pt) {
+    if (pt is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    return contains(pt.x, pt.y);
+}
+
+void destroy() {
+    OS.gdk_region_destroy(handle);
+    handle = null;
+}
+
+/**
+ * Compares the argument to the receiver, and returns true
+ * if they represent the <em>same</em> object using a class
+ * specific comparison.
+ *
+ * @param object the object to compare with this object
+ * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
+ *
+ * @see #hashCode
+ */
+public override int opEquals(Object object) {
+    if (this is object) return true;
+    if ( auto region = cast(Region)object ){
+        return handle is region.handle;
+    }
+    return false;
+}
+
+/**
+ * Returns a rectangle which represents the rectangular
+ * union of the collection of polygons the receiver
+ * maintains to describe its area.
+ *
+ * @return a bounding rectangle for the region
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see Rectangle#union
+ */
+public Rectangle getBounds() {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    GdkRectangle* gdkRect = new GdkRectangle();
+    OS.gdk_region_get_clipbox(handle, gdkRect);
+    return new Rectangle(gdkRect.x, gdkRect.y, gdkRect.width, gdkRect.height);
+}
+
+public static Region gtk_new(Device device, GdkRegion* handle) {
+    return new Region(device, handle);
+}
+
+/**
+ * Returns an integer hash code for the receiver. Any two
+ * objects that return <code>true</code> when passed to
+ * <code>equals</code> must return the same value for this
+ * method.
+ *
+ * @return the receiver's hash
+ *
+ * @see #equals
+ */
+public override hash_t toHash() {
+    return cast(hash_t)handle;
+}
+
+/**
+ * Intersects the given rectangle to the collection of polygons
+ * the receiver maintains to describe its area.
+ *
+ * @param rect the rectangle to intersect with the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the rectangle's width or height is negative</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void intersect(Rectangle rect) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (rect is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    intersect (rect.x, rect.y, rect.width, rect.height);
+}
+
+/**
+ * Intersects the given rectangle to the collection of polygons
+ * the receiver maintains to describe its area.
+ *
+ * @param x the x coordinate of the rectangle
+ * @param y the y coordinate of the rectangle
+ * @param width the width coordinate of the rectangle
+ * @param height the height coordinate of the rectangle
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the rectangle's width or height is negative</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void intersect(int x, int y, int width, int height) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (width < 0 || height < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    GdkRectangle* gdkRect = new GdkRectangle();
+    gdkRect.x = x;
+    gdkRect.y = y;
+    gdkRect.width = width;
+    gdkRect.height = height;
+    auto rectRgn = OS.gdk_region_rectangle(gdkRect);
+    OS.gdk_region_intersect(handle, rectRgn);
+    OS.gdk_region_destroy(rectRgn);
+}
+
+/**
+ * Intersects all of the polygons which make up the area covered
+ * by the argument to the collection of polygons the receiver
+ * maintains to describe its area.
+ *
+ * @param region the region to intersect
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void intersect(Region region) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (region is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (region.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    OS.gdk_region_intersect(handle, region.handle);
+}
+
+/**
+ * Returns <code>true</code> if the rectangle described by the
+ * arguments intersects with any of the polygons the receiver
+ * maintains to describe its area, and <code>false</code> otherwise.
+ *
+ * @param x the x coordinate of the origin of the rectangle
+ * @param y the y coordinate of the origin of the rectangle
+ * @param width the width of the rectangle
+ * @param height the height of the rectangle
+ * @return <code>true</code> if the rectangle intersects with the receiver, and <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see Rectangle#intersects(Rectangle)
+ */
+public bool intersects (int x, int y, int width, int height) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    GdkRectangle* gdkRect = new GdkRectangle();
+    gdkRect.x = x;
+    gdkRect.y = y;
+    gdkRect.width = width;
+    gdkRect.height = height;
+    return OS.gdk_region_rect_in(handle, gdkRect) !is OS.GDK_OVERLAP_RECTANGLE_OUT;
+}
+/**
+ * Returns <code>true</code> if the given rectangle intersects
+ * with any of the polygons the receiver maintains to describe
+ * its area and <code>false</code> otherwise.
+ *
+ * @param rect the rectangle to test for intersection
+ * @return <code>true</code> if the rectangle intersects with the receiver, and <code>false</code> otherwise
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see Rectangle#intersects(Rectangle)
+ */
+public bool intersects(Rectangle rect) {
+    if (rect is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    return intersects(rect.x, rect.y, rect.width, rect.height);
+}
+
+/**
+ * Returns <code>true</code> if the region has been disposed,
+ * and <code>false</code> otherwise.
+ * <p>
+ * This method gets the dispose state for the region.
+ * When a region has been disposed, it is an error to
+ * invoke any other method using the region.
+ *
+ * @return <code>true</code> when the region is disposed, and <code>false</code> otherwise
+ */
+public override bool isDisposed() {
+    return handle is null;
+}
+
+/**
+ * Returns <code>true</code> if the receiver does not cover any
+ * area in the (x, y) coordinate plane, and <code>false</code> if
+ * the receiver does cover some area in the plane.
+ *
+ * @return <code>true</code> if the receiver is empty, and <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public bool isEmpty() {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    return cast(bool)OS.gdk_region_empty(handle);
+}
+
+/**
+ * Subtracts the given polygon from the collection of polygons
+ * the receiver maintains to describe its area.
+ *
+ * @param pointArray points that describe the polygon to merge with the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void subtract (int[] pointArray) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (pointArray is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    /*
+    * Bug in GTK. If gdk_region_polygon() is called with one point,
+    * it segment faults. The fix is to make sure that it is called
+    * with enough points for a polygon.
+    */
+    if (pointArray.length < 6) return;
+    auto polyRgn = OS.gdk_region_polygon( cast(GdkPoint*)pointArray.ptr, pointArray.length / 2, OS.GDK_EVEN_ODD_RULE);
+    OS.gdk_region_subtract(handle, polyRgn);
+    OS.gdk_region_destroy(polyRgn);
+}
+
+/**
+ * Subtracts the given rectangle from the collection of polygons
+ * the receiver maintains to describe its area.
+ *
+ * @param rect the rectangle to subtract from the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the rectangle's width or height is negative</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void subtract(Rectangle rect) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (rect is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    subtract (rect.x, rect.y, rect.width, rect.height);
+}
+
+/**
+ * Subtracts the given rectangle from the collection of polygons
+ * the receiver maintains to describe its area.
+ *
+ * @param x the x coordinate of the rectangle
+ * @param y the y coordinate of the rectangle
+ * @param width the width coordinate of the rectangle
+ * @param height the height coordinate of the rectangle
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the rectangle's width or height is negative</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void subtract(int x, int y, int width, int height) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (width < 0 || height < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    GdkRectangle* gdkRect = new GdkRectangle();
+    gdkRect.x = x;
+    gdkRect.y = y;
+    gdkRect.width = width;
+    gdkRect.height = height;
+    auto rectRgn = OS.gdk_region_rectangle(gdkRect);
+    OS.gdk_region_subtract(handle, rectRgn);
+    OS.gdk_region_destroy(rectRgn);
+}
+
+/**
+ * Subtracts all of the polygons which make up the area covered
+ * by the argument from the collection of polygons the receiver
+ * maintains to describe its area.
+ *
+ * @param region the region to subtract
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void subtract(Region region) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (region is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (region.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    OS.gdk_region_subtract(handle, region.handle);
+}
+
+/**
+ * Translate all of the polygons the receiver maintains to describe
+ * its area by the specified point.
+ *
+ * @param x the x coordinate of the point to translate
+ * @param y the y coordinate of the point to translate
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void translate (int x, int y) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    OS.gdk_region_offset (handle, x, y);
+}
+
+/**
+ * Translate all of the polygons the receiver maintains to describe
+ * its area by the specified point.
+ *
+ * @param pt the point to translate
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void translate (Point pt) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (pt is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    translate (pt.x, pt.y);
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the receiver
+ */
+public override String toString () {
+    if (isDisposed()) return "Region {*DISPOSED*}";
+    return Format( "Region {{{}}", handle );
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Resource.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.Resource;
+
+import java.lang.all;
+
+import org.eclipse.swt.SWT;
+
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.internal.c.gdk;
+
+/**
+ * This class is the abstract superclass of all graphics resource objects.
+ * Resources created by the application must be disposed.
+ * <p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation. However, it has not been marked
+ * final to allow those outside of the SWT development team to implement
+ * patched versions of the class in order to get around specific
+ * limitations in advance of when those limitations can be addressed
+ * by the team.  Any class built using subclassing to access the internals
+ * of this class will likely fail to compile or run between releases and
+ * may be strongly platform specific. Subclassing should not be attempted
+ * without an intimate and detailed understanding of the workings of the
+ * hierarchy. No support is provided for user-written classes which are
+ * implemented as subclasses of this class.
+ * </p>
+ *
+ * @see #dispose
+ * @see #isDisposed
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.1
+ */
+public abstract class Resource {
+
+    /**
+     * the device where this resource was created
+     */
+    Device device;
+
+public this() {
+}
+
+this(Device device) {
+    if (device is null) device = Device.getDevice();
+    if (device is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    this.device = device;
+}
+
+void destroy() {
+}
+
+/**
+ * Disposes of the operating system resources associated with
+ * this resource. Applications must dispose of all resources
+ * which they allocate.
+ */
+public void dispose() {
+    if (device is null) return;
+    if (device.isDisposed()) return;
+    destroy();
+    if (device.tracking) device.dispose_Object(this);
+    device = null;
+}
+
+/**
+ * Returns the <code>Device</code> where this resource was
+ * created.
+ *
+ * @return <code>Device</code> the device of the receiver
+ *
+ * @since 3.2
+ */
+public Device getDevice() {
+    Device device = this.device;
+    if (device is null || isDisposed ()) SWT.error (SWT.ERROR_GRAPHIC_DISPOSED);
+    return device;
+}
+
+void init_() {
+    if (device.tracking) device.new_Object(this);
+}
+
+/**
+ * Returns <code>true</code> if the resource has been disposed,
+ * and <code>false</code> otherwise.
+ * <p>
+ * This method gets the dispose state for the resource.
+ * When a resource has been disposed, it is an error to
+ * invoke any other method using the resource.
+ *
+ * @return <code>true</code> when the resource is disposed and <code>false</code> otherwise
+ */
+public abstract bool isDisposed();
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/TextLayout.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,2239 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.TextLayout;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.Compatibility;
+import org.eclipse.swt.internal.cairo.Cairo;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.internal.Converter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontMetrics;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.GCData;
+import org.eclipse.swt.graphics.GlyphMetrics;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.Region;
+import org.eclipse.swt.graphics.Resource;
+import org.eclipse.swt.graphics.TextStyle;
+import java.lang.all;
+
+import tango.text.convert.Format;
+import tango.stdc.string;
+import tango.text.convert.Utf;
+
+/**
+ * <code>TextLayout</code> is a graphic object that represents
+ * styled text.
+ * <p>
+ * Instances of this class provide support for drawing, cursor
+ * navigation, hit testing, text wrapping, alignment, tab expansion
+ * line breaking, etc.  These are aspects required for rendering internationalized text.
+ * </p><p>
+ * Application code must explicitly invoke the <code>TextLayout#dispose()</code>
+ * method to release the operating system resources managed by each instance
+ * when those instances are no longer required.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#textlayout">TextLayout, TextStyle snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: CustomControlExample, StyledText tab</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.0
+ */
+public final class TextLayout : Resource {
+
+    static class StyleItem {
+        TextStyle style;
+        int start;
+
+        public override String toString () {
+            return Format( "StyleItem {{{}, {}}", start, style );
+        }
+    }
+
+    Font font;
+    String text;
+    int ascent, descent;
+    int[] segments;
+    int[] tabs;
+    StyleItem[] styles;
+    PangoLayout* layout;
+    PangoContext* context;
+    PangoAttrList* attrList;
+    int[] invalidOffsets;
+    // LTR_MARK LEFT-TO-RIGHT MARK
+    // RTL_MARK RIGHT-TO-LEFT MARK
+    // ZWS      ZERO WIDTH SPACE
+    // ZWNBS    ZERO WIDTH NO-BREAK SPACE
+    static const dchar LTR_MARK      = '\u200E'; // x"E2 80 8E" LEFT-TO-RIGHT MARK
+    static const dchar RTL_MARK      = '\u200F'; // x"E2 80 8F" RIGHT-TO-LEFT MARK
+    static const dchar ZWS           = '\u200B'; // x"E2 80 8B" ZERO WIDTH SPACE
+    static const dchar ZWNBS         = '\uFEFF'; // x"EF BB BF" ZERO WIDTH NO-BREAK SPACE
+    static const String STR_LTR_MARK = "\u200E";
+    static const String STR_RTL_MARK = "\u200F";
+    static const String STR_ZWS      = "\u200B";
+    static const String STR_ZWNBS    = "\uFEFF";
+
+/**
+ * Constructs a new instance of this class on the given device.
+ * <p>
+ * You must dispose the text layout when it is no longer required.
+ * </p>
+ *
+ * @param device the device on which to allocate the text layout
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ * </ul>
+ *
+ * @see #dispose()
+ */
+public this (Device device) {
+    super(device);
+    device = this.device;
+    context = OS.gdk_pango_context_get();
+    if (context is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    OS.pango_context_set_language(context, OS.gtk_get_default_language());
+    OS.pango_context_set_base_dir(context, OS.PANGO_DIRECTION_LTR);
+    OS.gdk_pango_context_set_colormap(context, OS.gdk_colormap_get_system());
+    layout = OS.pango_layout_new(context);
+    if (layout is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    OS.pango_layout_set_font_description(layout, device.systemFont.handle);
+    OS.pango_layout_set_wrap(layout, OS.PANGO_WRAP_WORD_CHAR);
+    OS.pango_layout_set_tabs(layout, device.emptyTab);
+    if (OS.GTK_VERSION >= OS.buildVERSION(2, 4, 0)) {
+        OS.pango_layout_set_auto_dir(layout, false);
+    }
+    text = "";
+    ascent = descent = -1;
+    styles = new StyleItem[2];
+    styles[0] = new StyleItem();
+    styles[1] = new StyleItem();
+    init_();
+}
+
+void checkLayout() {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+}
+
+void computeRuns () {
+    if (attrList !is null) return;
+    String segmentsText = getSegmentsText();
+    OS.pango_layout_set_text (layout, segmentsText.ptr, segmentsText.length);
+    if (styles.length is 2 && styles[0].style is null && ascent is -1 && descent is -1 && segments is null) return;
+    auto ptr = OS.pango_layout_get_text(layout);
+    attrList = OS.pango_attr_list_new();
+    PangoAttribute* attribute;
+    char[] chars = null;
+    int segementsLength = segmentsText.length;
+    if ((ascent !is -1  || descent !is -1) && segementsLength > 0) {
+        PangoRectangle rect;
+        if (ascent !is -1) rect.y =  -(ascent  * OS.PANGO_SCALE);
+        rect.height = (Math.max(0, ascent) + Math.max(0, descent)) * OS.PANGO_SCALE;
+        int lineCount = OS.pango_layout_get_line_count(layout);
+        chars = new char[segementsLength + lineCount * 6/*2*/];
+        int oldPos = 0, lineIndex = 0;
+        while (lineIndex < lineCount) {
+            auto line = OS.pango_layout_get_line(layout, lineIndex);
+            int bytePos = line.start_index;
+            /* Note: The length in bytes of ZWS and ZWNBS are both equals to 3 */
+            int offset = lineIndex * 6;
+            PangoAttribute* attr = OS.pango_attr_shape_new (&rect, &rect);
+            attribute = attr;
+            attribute.start_index = bytePos + offset;
+            attribute.end_index = bytePos + offset + 3;
+            OS.pango_attr_list_insert(attrList, attr);
+            attr = OS.pango_attr_shape_new (&rect, &rect);
+            attribute = attr;
+            attribute.start_index = bytePos + offset + 3;
+            attribute.end_index = bytePos + offset + 6;
+            OS.pango_attr_list_insert(attrList, attr);
+            int pos = bytePos;//OS.g_utf8_pointer_to_offset(ptr, ptr + bytePos);
+            chars[pos + lineIndex * 6 +0 .. pos + lineIndex * 6 + 3] = STR_ZWS;
+            chars[pos + lineIndex * 6 +3 .. pos + lineIndex * 6 + 6] = STR_ZWNBS;
+            chars[ oldPos + lineIndex*6 .. oldPos + lineIndex*6 + pos - oldPos ] =
+                segmentsText[ oldPos .. pos ];
+            oldPos = pos;
+            lineIndex++;
+        }
+        segmentsText.getChars(oldPos, segementsLength, chars,  oldPos + lineIndex * 6);
+        String buffer = chars;// Converter.wcsToMbcs(null, chars, false);
+
+        OS.pango_layout_set_text (layout, buffer.ptr, buffer.length);
+        ptr = OS.pango_layout_get_text(layout);
+    } else {
+        chars = segmentsText.dup;
+    }
+    int offsetCount = 0;
+    {
+        int i = 0;
+        while( i < chars.length ){
+            int incr;
+            dchar c = firstCodePoint( chars[ i .. $ ], incr );
+            if (c is LTR_MARK || c is RTL_MARK || c is ZWNBS || c is ZWS) {
+                offsetCount+=3;
+            }
+            i += incr;
+        }
+    }
+    invalidOffsets = new int[offsetCount];
+    offsetCount = 0;
+    {
+        int i = 0;
+        while( i < chars.length ){
+            int incr;
+            dchar c = firstCodePoint( chars[ i .. $ ], incr );
+            if (c is LTR_MARK || c is RTL_MARK || c is ZWNBS || c is ZWS) {
+                invalidOffsets[offsetCount++] = i;
+                invalidOffsets[offsetCount++] = i+1;
+                invalidOffsets[offsetCount++] = i+2;
+            }
+            i += incr;
+        }
+    }
+    int slen = strlen(ptr);
+    Font defaultFont = font !is null ? font : device.systemFont;
+    for (int i = 0; i < styles.length - 1; i++) {
+        StyleItem styleItem = styles[i];
+        TextStyle style = styleItem.style;
+        if (style is null) continue;
+        int start = translateOffset(styleItem.start);
+        int end = translateOffset(styles[i+1].start - 1);
+        int byteStart = start;//(OS.g_utf8_offset_to_pointer(ptr, start) - ptr);
+        int byteEnd = end+1;//(OS.g_utf8_offset_to_pointer(ptr, end + 1) - ptr);
+        byteStart = Math.min(byteStart, slen);
+        byteEnd = Math.min(byteEnd, slen);
+        Font font = style.font;
+        if (font !is null && !font.isDisposed() && !defaultFont.opEquals(font)) {
+            auto attr = OS.pango_attr_font_desc_new (font.handle);
+            attr.start_index = byteStart;
+            attr.end_index = byteEnd;
+            OS.pango_attr_list_insert(attrList, attr);
+        }
+        if (style.underline) {
+            int underlineStyle = OS.PANGO_UNDERLINE_NONE;
+            switch (style.underlineStyle) {
+                case SWT.UNDERLINE_SINGLE:
+                    underlineStyle = OS.PANGO_UNDERLINE_SINGLE;
+                    break;
+                case SWT.UNDERLINE_DOUBLE:
+                    underlineStyle = OS.PANGO_UNDERLINE_DOUBLE;
+                    break;
+                case SWT.UNDERLINE_SQUIGGLE:
+                case SWT.UNDERLINE_ERROR:
+                    if (OS.GTK_VERSION >= OS.buildVERSION(2, 4, 0)) {
+                        underlineStyle = OS.PANGO_UNDERLINE_ERROR;
+                    }
+                    break;
+            }
+            if (underlineStyle !is OS.PANGO_UNDERLINE_NONE && style.underlineColor is null) {
+                auto attr = OS.pango_attr_underline_new(underlineStyle);
+                attr.start_index = byteStart;
+                attr.end_index = byteEnd;
+                OS.pango_attr_list_insert(attrList, attr);
+            }
+        }
+        if (style.strikeout && style.strikeoutColor is null) {
+            auto attr = OS.pango_attr_strikethrough_new(true);
+            attr.start_index = byteStart;
+            attr.end_index = byteEnd;
+            OS.pango_attr_list_insert(attrList, attr);
+        }
+        Color foreground = style.foreground;
+        if (foreground !is null && !foreground.isDisposed()) {
+            GdkColor* fg = foreground.handle;
+            auto attr = OS.pango_attr_foreground_new(fg.red, fg.green, fg.blue);
+            attr.start_index = byteStart;
+            attr.end_index = byteEnd;
+            OS.pango_attr_list_insert(attrList, attr);
+        }
+        Color background = style.background;
+        if (background !is null && !background.isDisposed()) {
+            GdkColor* bg = background.handle;
+            auto attr = OS.pango_attr_background_new(bg.red, bg.green, bg.blue);
+            attr.start_index = byteStart;
+            attr.end_index = byteEnd;
+            OS.pango_attr_list_insert(attrList, attr);
+        }
+        GlyphMetrics metrics = style.metrics;
+        if (metrics !is null) {
+            PangoRectangle rect;
+            rect.y =  -(metrics.ascent * OS.PANGO_SCALE);
+            rect.height = (metrics.ascent + metrics.descent) * OS.PANGO_SCALE;
+            rect.width = metrics.width * OS.PANGO_SCALE;
+            auto attr = OS.pango_attr_shape_new (&rect, &rect);
+            attr.start_index = byteStart;
+            attr.end_index = byteEnd;
+            OS.pango_attr_list_insert(attrList, attr);
+        }
+        int rise = style.rise;
+        if (rise !is 0) {
+            auto attr = OS.pango_attr_rise_new (rise * OS.PANGO_SCALE);
+            attr.start_index = byteStart;
+            attr.end_index = byteEnd;
+            OS.pango_attr_list_insert(attrList, attr);
+        }
+    }
+    OS.pango_layout_set_attributes(layout, attrList);
+}
+
+int[] computePolyline(int left, int top, int right, int bottom) {
+    int height = bottom - top; // can be any number
+    int width = 2 * height; // must be even
+    int peaks = Compatibility.ceil(right - left, width);
+    if (peaks is 0 && right - left > 2) {
+        peaks = 1;
+    }
+    int length_ = ((2 * peaks) + 1) * 2;
+    if (length_ < 0) return new int[0];
+
+    int[] coordinates = new int[length_];
+    for (int i = 0; i < peaks; i++) {
+        int index = 4 * i;
+        coordinates[index] = left + (width * i);
+        coordinates[index+1] = bottom;
+        coordinates[index+2] = coordinates[index] + width / 2;
+        coordinates[index+3] = top;
+    }
+    coordinates[length_-2] = left + (width * peaks);
+    coordinates[length_-1] = bottom;
+    return coordinates;
+}
+
+void destroy() {
+    font = null;
+    text = null;
+    styles = null;
+    freeRuns();
+    if (layout !is null) OS.g_object_unref(layout);
+    layout = null;
+    if (context !is null) OS.g_object_unref(context);
+    context = null;
+}
+
+/**
+ * Draws the receiver's text using the specified GC at the specified
+ * point.
+ *
+ * @param gc the GC to draw
+ * @param x the x coordinate of the top left corner of the rectangular area where the text is to be drawn
+ * @param y the y coordinate of the top left corner of the rectangular area where the text is to be drawn
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the gc is null</li>
+ * </ul>
+ */
+public void draw(GC gc, int x, int y) {
+    draw(gc, x, y, -1, -1, null, null);
+}
+
+/**
+ * Draws the receiver's text using the specified GC at the specified
+ * point.
+ *
+ * @param gc the GC to draw
+ * @param x the x coordinate of the top left corner of the rectangular area where the text is to be drawn
+ * @param y the y coordinate of the top left corner of the rectangular area where the text is to be drawn
+ * @param selectionStart the offset where the selections starts, or -1 indicating no selection
+ * @param selectionEnd the offset where the selections ends, or -1 indicating no selection
+ * @param selectionForeground selection foreground, or NULL to use the system default color
+ * @param selectionBackground selection background, or NULL to use the system default color
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the gc is null</li>
+ * </ul>
+ */
+public void draw(GC gc, int x, int y, int selectionStart, int selectionEnd, Color selectionForeground, Color selectionBackground) {
+    draw(gc, x, y, selectionStart, selectionEnd, selectionForeground, selectionBackground, 0);
+}
+
+/**
+ * Draws the receiver's text using the specified GC at the specified
+ * point.
+ * <p>
+ * The parameter <code>flags</code> can include one of <code>SWT.DELIMITER_SELECTION</code>
+ * or <code>SWT.FULL_SELECTION</code> to specify the selection behavior on all lines except
+ * for the last line, and can also include <code>SWT.LAST_LINE_SELECTION</code> to extend
+ * the specified selection behavior to the last line.
+ * </p>
+ * @param gc the GC to draw
+ * @param x the x coordinate of the top left corner of the rectangular area where the text is to be drawn
+ * @param y the y coordinate of the top left corner of the rectangular area where the text is to be drawn
+ * @param selectionStart the offset where the selections starts, or -1 indicating no selection
+ * @param selectionEnd the offset where the selections ends, or -1 indicating no selection
+ * @param selectionForeground selection foreground, or NULL to use the system default color
+ * @param selectionBackground selection background, or NULL to use the system default color
+ * @param flags drawing options
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the gc is null</li>
+ * </ul>
+ *
+ * @since 3.3
+ */
+public void draw(GC gc, int x, int y, int selectionStart, int selectionEnd, Color selectionForeground, Color selectionBackground, int flags) {
+    checkLayout ();
+    computeRuns();
+    if (gc is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (gc.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    if (selectionForeground !is null && selectionForeground.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    if (selectionBackground !is null && selectionBackground.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    gc.checkGC(GC.FOREGROUND);
+    int length_ = text.length;
+    bool hasSelection = selectionStart <= selectionEnd && selectionStart !is -1 && selectionEnd !is -1;
+    GCData data = gc.data;
+    auto cairo = data.cairo;
+    if (flags !is 0 && (hasSelection || (flags & SWT.LAST_LINE_SELECTION) !is 0)) {
+        PangoLogAttr* attrs;
+        int nAttrs;
+        PangoLogAttr* logAttr = new PangoLogAttr();
+        PangoRectangle rect;
+        int lineCount = OS.pango_layout_get_line_count(layout);
+        auto ptr = OS.pango_layout_get_text(layout);
+        auto iter = OS.pango_layout_get_iter(layout);
+        if (selectionBackground is null) selectionBackground = device.getSystemColor(SWT.COLOR_LIST_SELECTION);
+        if (cairo !is null && OS.GTK_VERSION >= OS.buildVERSION(2, 8, 0)) {
+            Cairo.cairo_save(cairo);
+            GdkColor* color = selectionBackground.handle;
+            Cairo.cairo_set_source_rgba(cairo, (color.red & 0xFFFF) / cast(float)0xFFFF, (color.green & 0xFFFF) / cast(float)0xFFFF, (color.blue & 0xFFFF) / cast(float)0xFFFF, data.alpha / cast(float)0xFF);
+        } else {
+            OS.gdk_gc_set_foreground(gc.handle, selectionBackground.handle);
+        }
+        int lineIndex = 0;
+        do {
+            int lineEnd;
+            OS.pango_layout_iter_get_line_extents(iter, null, &rect);
+            if (OS.pango_layout_iter_next_line(iter)) {
+                int bytePos = OS.pango_layout_iter_get_index(iter);
+                lineEnd = bytePos;//OS.g_utf8_pointer_to_offset(ptr, ptr + bytePos);
+            } else {
+                lineEnd = OS.g_utf8_strlen(ptr, -1);
+            }
+            bool extent = false;
+            if (lineIndex is lineCount - 1 && (flags & SWT.LAST_LINE_SELECTION) !is 0) {
+                extent = true;
+            } else {
+                if (attrs is null) OS.pango_layout_get_log_attrs(layout, &attrs, &nAttrs);
+                *logAttr = attrs[lineEnd];
+                if (!( logAttr.bitfield0 & 0x01 /* PangoLogAttr.is_line_break is Bit0 */)) {
+                    if (selectionStart <= lineEnd && lineEnd <= selectionEnd) extent = true;
+                } else {
+                    if (selectionStart <= lineEnd && lineEnd < selectionEnd && (flags & SWT.FULL_SELECTION) !is 0) {
+                        extent = true;
+                    }
+                }
+            }
+            if (extent) {
+                int lineX = x + OS.PANGO_PIXELS(rect.x) + OS.PANGO_PIXELS(rect.width);
+                int lineY = y + OS.PANGO_PIXELS(rect.y);
+                int height = OS.PANGO_PIXELS(rect.height);
+                if (ascent !is -1 && descent !is -1) {
+                    height = Math.max (height, ascent + descent);
+                }
+                int width = (flags & SWT.FULL_SELECTION) !is 0 ? 0x7fffffff : height / 3;
+                if (cairo !is null && OS.GTK_VERSION >= OS.buildVERSION(2, 8, 0)) {
+                    Cairo.cairo_rectangle(cairo, lineX, lineY, width, height);
+                    Cairo.cairo_fill(cairo);
+                } else {
+                    OS.gdk_draw_rectangle(data.drawable, gc.handle, 1, lineX, lineY, width, height);
+                }
+            }
+            lineIndex++;
+        } while (lineIndex < lineCount);
+        OS.pango_layout_iter_free(iter);
+        if (attrs !is null) OS.g_free(attrs);
+        if (cairo !is null && OS.GTK_VERSION >= OS.buildVERSION(2, 8, 0)) {
+            Cairo.cairo_restore(cairo);
+        } else {
+            OS.gdk_gc_set_foreground(gc.handle, data.foreground);
+        }
+    }
+    if (length_ is 0) return;
+    if (!hasSelection) {
+        if (cairo !is null && OS.GTK_VERSION >= OS.buildVERSION(2, 8, 0)) {
+            if ((data.style & SWT.MIRRORED) !is 0) {
+                Cairo.cairo_save(cairo);
+                Cairo.cairo_scale(cairo, -1,  1);
+                Cairo.cairo_translate(cairo, -2 * x - width(), 0);
+            }
+            Cairo.cairo_move_to(cairo, x, y);
+            OS.pango_cairo_show_layout(cairo, layout);
+            drawBorder(gc, x, y, null);
+            if ((data.style & SWT.MIRRORED) !is 0) {
+                Cairo.cairo_restore(cairo);
+            }
+        } else {
+            OS.gdk_draw_layout(data.drawable, gc.handle, x, y, layout);
+            drawBorder(gc, x, y, null);
+        }
+    } else {
+        selectionStart = Math.min(Math.max(0, selectionStart), length_ - 1);
+        selectionEnd = Math.min(Math.max(0, selectionEnd), length_ - 1);
+        length_ = OS.g_utf8_strlen(OS.pango_layout_get_text(layout), -1);
+        selectionStart = translateOffset(selectionStart);
+        selectionEnd = translateOffset(selectionEnd);
+        if (selectionForeground is null) selectionForeground = device.getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT);
+        if (selectionBackground is null) selectionBackground = device.getSystemColor(SWT.COLOR_LIST_SELECTION);
+        bool fullSelection = selectionStart is 0 && selectionEnd is length_ - 1;
+        if (fullSelection) {
+            if (cairo !is null && OS.GTK_VERSION >= OS.buildVERSION(2, 8, 0)) {
+                auto ptr = OS.pango_layout_get_text(layout);
+                if ((data.style & SWT.MIRRORED) !is 0) {
+                    Cairo.cairo_save(cairo);
+                    Cairo.cairo_scale(cairo, -1,  1);
+                    Cairo.cairo_translate(cairo, -2 * x - width(), 0);
+                }
+                drawWithCairo(gc, x, y, 0, OS.strlen(ptr), fullSelection, selectionForeground.handle, selectionBackground.handle);
+                if ((data.style & SWT.MIRRORED) !is 0) {
+                    Cairo.cairo_restore(cairo);
+                }
+            } else {
+                OS.gdk_draw_layout_with_colors(data.drawable, gc.handle, x, y, layout, selectionForeground.handle, selectionBackground.handle);
+                drawBorder(gc, x, y, selectionForeground.handle);
+            }
+        } else {
+            auto ptr = OS.pango_layout_get_text(layout);
+            int byteSelStart = selectionStart;//(OS.g_utf8_offset_to_pointer(ptr, selectionStart) - ptr);
+            int byteSelEnd = selectionEnd + 1;//(OS.g_utf8_offset_to_pointer(ptr, selectionEnd + 1) - ptr);
+            int slen = strlen(ptr);
+            byteSelStart = Math.min(byteSelStart, slen);
+            byteSelEnd = Math.min(byteSelEnd, slen);
+            if (cairo !is null && OS.GTK_VERSION >= OS.buildVERSION(2, 8, 0)) {
+                if ((data.style & SWT.MIRRORED) !is 0) {
+                    Cairo.cairo_save(cairo);
+                    Cairo.cairo_scale(cairo, -1,  1);
+                    Cairo.cairo_translate(cairo, -2 * x - width(), 0);
+                }
+                drawWithCairo(gc, x, y, byteSelStart, byteSelEnd, fullSelection, selectionForeground.handle, selectionBackground.handle);
+                if ((data.style & SWT.MIRRORED) !is 0) {
+                    Cairo.cairo_restore(cairo);
+                }
+            } else {
+                Region clipping = new Region();
+                gc.getClipping(clipping);
+                OS.gdk_draw_layout(data.drawable, gc.handle, x, y, layout);
+                drawBorder(gc, x, y, null);
+                int[] ranges = [byteSelStart, byteSelEnd];
+                auto rgn = OS.gdk_pango_layout_get_clip_region(layout, x, y, ranges.ptr, ranges.length / 2);
+                if (rgn !is null) {
+                    OS.gdk_gc_set_clip_region(gc.handle, rgn);
+                    OS.gdk_region_destroy(rgn);
+                }
+                OS.gdk_draw_layout_with_colors(data.drawable, gc.handle, x, y, layout, selectionForeground.handle, selectionBackground.handle);
+                drawBorder(gc, x, y, selectionForeground.handle);
+                gc.setClipping(clipping);
+                clipping.dispose();
+            }
+        }
+    }
+}
+
+void drawWithCairo(GC gc, int x, int y, int start, int end, bool fullSelection, GdkColor* fg, GdkColor* bg) {
+    GCData data = gc.data;
+    cairo_t* cairo = data.cairo;
+    Cairo.cairo_save(cairo);
+    if (!fullSelection) {
+        Cairo.cairo_move_to(cairo, x, y);
+        OS.pango_cairo_show_layout(cairo, layout);
+        drawBorder(gc, x, y, null);
+    }
+    int[] ranges = [start, end];
+    auto rgn = OS.gdk_pango_layout_get_clip_region(layout, x, y, ranges.ptr, ranges.length / 2);
+    if (rgn !is null) {
+        OS.gdk_cairo_region(cairo, rgn);
+        Cairo.cairo_clip(cairo);
+        Cairo.cairo_set_source_rgba(cairo, (bg.red & 0xFFFF) / cast(float)0xFFFF, (bg.green & 0xFFFF) / cast(float)0xFFFF, (bg.blue & 0xFFFF) / cast(float)0xFFFF, data.alpha / cast(float)0xFF);
+        Cairo.cairo_paint(cairo);
+        OS.gdk_region_destroy(rgn);
+    }
+    Cairo.cairo_set_source_rgba(cairo, (fg.red & 0xFFFF) / cast(float)0xFFFF, (fg.green & 0xFFFF) / cast(float)0xFFFF, (fg.blue & 0xFFFF) / cast(float)0xFFFF, data.alpha / cast(float)0xFF);
+    Cairo.cairo_move_to(cairo, x, y);
+    OS.pango_cairo_show_layout(cairo, layout);
+    drawBorder(gc, x, y, fg);
+    Cairo.cairo_restore(cairo);
+}
+
+void drawBorder(GC gc, int x, int y, GdkColor* selectionColor) {
+    GCData data = gc.data;
+    auto cairo = data.cairo;
+    auto gdkGC = gc.handle;
+    auto ptr = OS.pango_layout_get_text(layout);
+    GdkGCValues* gcValues = null;
+    if (cairo !is null && OS.GTK_VERSION >= OS.buildVERSION(2, 8, 0)) {
+        Cairo.cairo_save(cairo);
+    }
+    for (int i = 0; i < styles.length - 1; i++) {
+        TextStyle style = styles[i].style;
+        if (style is null) continue;
+
+        bool drawBorder = style.borderStyle !is SWT.NONE;
+        if (drawBorder && !style.isAdherentBorder(styles[i+1].style)) {
+            int start = styles[i].start;
+            for (int j = i; j > 0 && style.isAdherentBorder(styles[j-1].style); j--) {
+                start = styles[j - 1].start;
+            }
+            start = translateOffset(start);
+            int end = translateOffset(styles[i+1].start - 1);
+            int byteStart = cast(int)/*64*/(OS.g_utf8_offset_to_pointer(ptr, start) - ptr);
+            int byteEnd = cast(int)/*64*/(OS.g_utf8_offset_to_pointer(ptr, end + 1) - ptr);
+            int[] ranges = [byteStart, byteEnd];
+            auto rgn = OS.gdk_pango_layout_get_clip_region(layout, x, y, ranges.ptr, ranges.length / 2);
+            if (rgn !is null) {
+                int nRects;
+                GdkRectangle* rects;
+                OS.gdk_region_get_rectangles(rgn, &rects, &nRects);
+                GdkRectangle rect;
+                GdkColor* color = null;
+                if (color is null && style.borderColor !is null) color = style.borderColor.handle;
+                if (color is null && selectionColor !is null) color = selectionColor;
+                if (color is null && style.foreground !is null) color = style.foreground.handle;
+                if (color is null) color = data.foreground;
+                int width = 1;
+                float[] dashes = null;
+                switch (style.borderStyle) {
+                    case SWT.BORDER_SOLID: break;
+                    case SWT.BORDER_DASH: dashes = width !is 0 ? GC.LINE_DASH : GC.LINE_DASH_ZERO; break;
+                    case SWT.BORDER_DOT: dashes = width !is 0 ? GC.LINE_DOT : GC.LINE_DOT_ZERO; break;
+                }
+                if (cairo !is null && OS.GTK_VERSION >= OS.buildVERSION(2, 8, 0)) {
+                    Cairo.cairo_set_source_rgba(cairo, (color.red & 0xFFFF) / cast(float)0xFFFF, (color.green & 0xFFFF) / cast(float)0xFFFF, (color.blue & 0xFFFF) / cast(float)0xFFFF, data.alpha / cast(float)0xFF);
+                    Cairo.cairo_set_line_width(cairo, width);
+                    if (dashes !is null) {
+                        double[] cairoDashes = new double[dashes.length];
+                        for (int j = 0; j < cairoDashes.length; j++) {
+                            cairoDashes[j] = width is 0 || data.lineStyle is SWT.LINE_CUSTOM ? dashes[j] : dashes[j] * width;
+                        }
+                        Cairo.cairo_set_dash(cairo, cairoDashes.ptr, cairoDashes.length, 0);
+                    } else {
+                        Cairo.cairo_set_dash(cairo, null, 0, 0);
+                    }
+                    for (int j=0; j<nRects; j++) {
+                        rect = rects[j];
+                        Cairo.cairo_rectangle(cairo, rect.x + 0.5, rect.y + 0.5, rect.width - 1, rect.height - 1);
+                    }
+                    Cairo.cairo_stroke(cairo);
+                } else {
+                    if (gcValues is null) {
+                        gcValues = new GdkGCValues();
+                        OS.gdk_gc_get_values(gdkGC, gcValues);
+                    }
+                    OS.gdk_gc_set_foreground(gdkGC, color);
+                    int cap_style = OS.GDK_CAP_BUTT;
+                    int join_style = OS.GDK_JOIN_MITER;
+                    int line_style = 0;
+                    if (dashes !is null) {
+                        byte[] dash_list = new byte[dashes.length];
+                        for (int j = 0; j < dash_list.length; j++) {
+                            dash_list[j] = cast(byte)(width is 0 || data.lineStyle is SWT.LINE_CUSTOM ? dashes[j] : dashes[j] * width);
+                        }
+                        OS.gdk_gc_set_dashes(gdkGC, 0, cast(char*)dash_list.ptr, dash_list.length);
+                        line_style = OS.GDK_LINE_ON_OFF_DASH;
+                    } else {
+                        line_style = OS.GDK_LINE_SOLID;
+                    }
+                    OS.gdk_gc_set_line_attributes(gdkGC, width, line_style, cap_style, join_style);
+                    for (int j=0; j<nRects; j++) {
+                        rect = rects[j];
+                        OS.gdk_draw_rectangle(data.drawable, gdkGC, 0, rect.x, rect.y, rect.width - 1, rect.height - 1);
+                    }
+                }
+                if (rects !is null) OS.g_free(rects);
+                OS.gdk_region_destroy(rgn);
+            }
+        }
+
+        bool drawUnderline = false;
+        if (style.underline && style.underlineColor !is null) drawUnderline = true;
+        if (style.underline && (style.underlineStyle is SWT.UNDERLINE_ERROR || style.underlineStyle is SWT.UNDERLINE_SQUIGGLE)&& OS.GTK_VERSION < OS.buildVERSION(2, 4, 0)) drawUnderline = true;
+        if (drawUnderline && !style.isAdherentUnderline(styles[i+1].style)) {
+            int start = styles[i].start;
+            for (int j = i; j > 0 && style.isAdherentUnderline(styles[j-1].style); j--) {
+                start = styles[j - 1].start;
+            }
+            start = translateOffset(start);
+            int end = translateOffset(styles[i+1].start - 1);
+            int byteStart = cast(int)/*64*/(OS.g_utf8_offset_to_pointer(ptr, start) - ptr);
+            int byteEnd = cast(int)/*64*/(OS.g_utf8_offset_to_pointer(ptr, end + 1) - ptr);
+            int[] ranges = [byteStart, byteEnd];
+            auto rgn = OS.gdk_pango_layout_get_clip_region(layout, x, y, ranges.ptr, ranges.length / 2);
+            if (rgn !is null) {
+                int nRects;
+                GdkRectangle* rects;
+                OS.gdk_region_get_rectangles(rgn, &rects, &nRects);
+                GdkRectangle rect;
+                GdkColor* color = null;
+                if (color is null && style.underlineColor !is null) color = style.underlineColor.handle;
+                if (color is null && selectionColor !is null) color = selectionColor;
+                if (color is null && style.foreground !is null) color = style.foreground.handle;
+                if (color is null) color = data.foreground;
+                if (cairo !is null && OS.GTK_VERSION >= OS.buildVERSION(2, 8, 0)) {
+                    Cairo.cairo_set_source_rgba(cairo, (color.red & 0xFFFF) / cast(float)0xFFFF, (color.green & 0xFFFF) / cast(float)0xFFFF, (color.blue & 0xFFFF) / cast(float)0xFFFF, data.alpha / cast(float)0xFF);
+                } else {
+                    if (gcValues is null) {
+                        gcValues = new GdkGCValues();
+                        OS.gdk_gc_get_values(gdkGC, gcValues);
+                    }
+                    OS.gdk_gc_set_foreground(gdkGC, color);
+                }
+                int underlinePosition = -1;
+                int underlineThickness = 1;
+                if (OS.GTK_VERSION >= OS.buildVERSION(2, 6, 0)) {
+                    Font font = style.font;
+                    if (font is null) font = this.font;
+                    if (font is null) font = device.systemFont;
+                    auto lang = OS.pango_context_get_language(context);
+                    auto metrics = OS.pango_context_get_metrics(context, font.handle, lang);
+                    underlinePosition = OS.PANGO_PIXELS(OS.pango_font_metrics_get_underline_position(metrics));
+                    underlineThickness = OS.PANGO_PIXELS(OS.pango_font_metrics_get_underline_thickness(metrics));
+                    OS.pango_font_metrics_unref(metrics);
+                }
+                for (int j=0; j<nRects; j++) {
+                    rect = rects[j];
+                    int offset = getOffset(rect.x - x, rect.y - y, null);
+                    int lineIndex = getLineIndex(offset);
+                    FontMetrics metrics = getLineMetrics(lineIndex);
+                    int underlineY = rect.y + metrics.ascent - underlinePosition - style.rise;
+                    switch (style.underlineStyle) {
+                        case SWT.UNDERLINE_SQUIGGLE:
+                        case SWT.UNDERLINE_ERROR: {
+                            int squigglyThickness = underlineThickness;
+                            int squigglyHeight = 2 * squigglyThickness;
+                            int squigglyY = Math.min(underlineY, rect.y + rect.height - squigglyHeight - 1);
+                            int[] points = computePolyline(rect.x, squigglyY, rect.x + rect.width, squigglyY + squigglyHeight);
+                            if (cairo !is null && OS.GTK_VERSION >= OS.buildVERSION(2, 8, 0)) {
+                                Cairo.cairo_set_line_width(cairo, squigglyThickness);
+                                Cairo.cairo_set_line_cap(cairo, Cairo.CAIRO_LINE_CAP_BUTT);
+                                Cairo.cairo_set_line_join(cairo, Cairo.CAIRO_LINE_JOIN_MITER);
+                                if (points.length > 0) {
+                                    double xOffset = 0.5, yOffset = 0.5;
+                                    Cairo.cairo_move_to(cairo, points[0] + xOffset, points[1] + yOffset);
+                                    for (int k = 2; k < points.length; k += 2) {
+                                        Cairo.cairo_line_to(cairo, points[k] + xOffset, points[k + 1] + yOffset);
+                                    }
+                                    Cairo.cairo_stroke(cairo);
+                                }
+                            } else {
+                                OS.gdk_gc_set_line_attributes(gdkGC, squigglyThickness, OS.GDK_LINE_SOLID, OS.GDK_CAP_BUTT, OS.GDK_JOIN_MITER);
+                                OS.gdk_draw_lines(data.drawable, gdkGC, cast(GdkPoint*)points.ptr, points.length / 2);
+                            }
+                            break;
+                        }
+                        case SWT.UNDERLINE_DOUBLE:
+                            if (cairo !is null && OS.GTK_VERSION >= OS.buildVERSION(2, 8, 0)) {
+                                Cairo.cairo_rectangle(cairo, rect.x, underlineY + underlineThickness * 2, rect.width, underlineThickness);
+                                Cairo.cairo_fill(cairo);
+                            } else {
+                                OS.gdk_draw_rectangle(data.drawable, gdkGC, 1, rect.x, underlineY + underlineThickness * 2, rect.width, underlineThickness);
+                            }
+                            //FALLTHROUGH
+                        case SWT.UNDERLINE_SINGLE:
+                            if (cairo !is null && OS.GTK_VERSION >= OS.buildVERSION(2, 8, 0)) {
+                                Cairo.cairo_rectangle(cairo, rect.x, underlineY, rect.width, underlineThickness);
+                                Cairo.cairo_fill(cairo);
+                            } else {
+                                OS.gdk_draw_rectangle(data.drawable, gdkGC, 1, rect.x, underlineY, rect.width, underlineThickness);
+                            }
+                            break;
+                    }
+                }
+                if (rects !is null) OS.g_free(rects);
+                OS.gdk_region_destroy(rgn);
+            }
+        }
+
+        bool drawStrikeout = false;
+        if (style.strikeout && style.strikeoutColor !is null) drawStrikeout = true;
+        if (drawStrikeout && !style.isAdherentStrikeout(styles[i+1].style)) {
+            int start = styles[i].start;
+            for (int j = i; j > 0 && style.isAdherentStrikeout(styles[j-1].style); j--) {
+                start = styles[j - 1].start;
+            }
+            start = translateOffset(start);
+            int end = translateOffset(styles[i+1].start - 1);
+            int byteStart = cast(int)/*64*/(OS.g_utf8_offset_to_pointer(ptr, start) - ptr);
+            int byteEnd = cast(int)/*64*/(OS.g_utf8_offset_to_pointer(ptr, end + 1) - ptr);
+            int[] ranges = [byteStart, byteEnd];
+            auto rgn = OS.gdk_pango_layout_get_clip_region(layout, x, y, ranges.ptr, ranges.length / 2);
+            if (rgn !is null) {
+                int nRects;
+                GdkRectangle* rects;
+                OS.gdk_region_get_rectangles(rgn, &rects, &nRects);
+                GdkRectangle rect;
+                GdkColor* color = null;
+                if (color is null && style.strikeoutColor !is null) color = style.strikeoutColor.handle;
+                if (color is null && selectionColor !is null) color = selectionColor;
+                if (color is null && style.foreground !is null) color = style.foreground.handle;
+                if (color is null) color = data.foreground;
+                if (cairo !is null && OS.GTK_VERSION >= OS.buildVERSION(2, 8, 0)) {
+                    Cairo.cairo_set_source_rgba(cairo, (color.red & 0xFFFF) / cast(float)0xFFFF, (color.green & 0xFFFF) / cast(float)0xFFFF, (color.blue & 0xFFFF) / cast(float)0xFFFF, data.alpha / cast(float)0xFF);
+                } else {
+                    if (gcValues is null) {
+                        gcValues = new GdkGCValues();
+                        OS.gdk_gc_get_values(gdkGC, gcValues);
+                    }
+                    OS.gdk_gc_set_foreground(gdkGC, color);
+                }
+                int strikeoutPosition = -1;
+                int strikeoutThickness = 1;
+                if (OS.GTK_VERSION >= OS.buildVERSION(2, 6, 0)) {
+                    Font font = style.font;
+                    if (font is null) font = this.font;
+                    if (font is null) font = device.systemFont;
+                    auto lang = OS.pango_context_get_language(context);
+                    auto metrics = OS.pango_context_get_metrics(context, font.handle, lang);
+                    strikeoutPosition = OS.PANGO_PIXELS(OS.pango_font_metrics_get_strikethrough_position(metrics));
+                    strikeoutThickness = OS.PANGO_PIXELS(OS.pango_font_metrics_get_strikethrough_thickness(metrics));
+                    OS.pango_font_metrics_unref(metrics);
+                }
+                for (int j=0; j<nRects; j++) {
+                    rect = rects[j];
+                    int strikeoutY = rect.y + rect.height / 2 - style.rise;
+                    if (OS.GTK_VERSION >= OS.buildVERSION(2, 6, 0)) {
+                        int offset = getOffset(rect.x - x, rect.y - y, null);
+                        int lineIndex = getLineIndex(offset);
+                        FontMetrics metrics = getLineMetrics(lineIndex);
+                        strikeoutY = rect.y + metrics.ascent - strikeoutPosition - style.rise;
+                    }
+                    if (cairo !is null && OS.GTK_VERSION >= OS.buildVERSION(2, 8, 0)) {
+                        Cairo.cairo_rectangle(cairo, rect.x, strikeoutY, rect.width, strikeoutThickness);
+                        Cairo.cairo_fill(cairo);
+                    } else {
+                        OS.gdk_draw_rectangle(data.drawable, gdkGC, 1, rect.x, strikeoutY, rect.width, strikeoutThickness);
+                    }
+                }
+                if (rects !is null) OS.g_free(rects);
+                OS.gdk_region_destroy(rgn);
+            }
+        }
+    }
+    if (gcValues !is null) {
+        int mask = OS.GDK_GC_FOREGROUND | OS.GDK_GC_LINE_WIDTH | OS.GDK_GC_LINE_STYLE | OS.GDK_GC_CAP_STYLE | OS.GDK_GC_JOIN_STYLE;
+        OS.gdk_gc_set_values(gdkGC, gcValues, mask);
+        data.state &= ~GC.LINE_STYLE;
+    }
+    if (cairo !is null && OS.GTK_VERSION >= OS.buildVERSION(2, 8, 0)) {
+        Cairo.cairo_restore(cairo);
+    }
+}
+
+void freeRuns() {
+    if (attrList is null) return;
+    OS.pango_layout_set_attributes(layout, null );
+    OS.pango_attr_list_unref(attrList);
+    attrList = null;
+    invalidOffsets = null;
+}
+
+/**
+ * Returns the receiver's horizontal text alignment, which will be one
+ * of <code>SWT.LEFT</code>, <code>SWT.CENTER</code> or
+ * <code>SWT.RIGHT</code>.
+ *
+ * @return the alignment used to positioned text horizontally
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getAlignment() {
+    checkLayout();
+    auto alignment = OS.pango_layout_get_alignment(layout);
+    bool rtl = OS.pango_context_get_base_dir(context) is OS.PANGO_DIRECTION_RTL;
+    switch ( cast(int)alignment) {
+        case OS.PANGO_ALIGN_LEFT: return rtl ? SWT.RIGHT : SWT.LEFT;
+        case OS.PANGO_ALIGN_RIGHT: return rtl ? SWT.LEFT : SWT.RIGHT;
+        default:
+    }
+    return SWT.CENTER;
+}
+
+/**
+ * Returns the ascent of the receiver.
+ *
+ * @return the ascent
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getDescent()
+ * @see #setDescent(int)
+ * @see #setAscent(int)
+ * @see #getLineMetrics(int)
+ */
+public int getAscent () {
+    checkLayout();
+    return ascent;
+}
+
+/**
+ * Returns the bounds of the receiver. The width returned is either the
+ * width of the longest line or the width set using {@link TextLayout#setWidth(int)}.
+ * To obtain the text bounds of a line use {@link TextLayout#getLineBounds(int)}.
+ *
+ * @return the bounds of the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #setWidth(int)
+ * @see #getLineBounds(int)
+ */
+public Rectangle getBounds() {
+    checkLayout();
+    computeRuns();
+    int w, h;
+    OS.pango_layout_get_size(layout, &w, &h);
+    int wrapWidth = OS.pango_layout_get_width(layout);
+    w = wrapWidth !is -1 ? wrapWidth : w + OS.pango_layout_get_indent(layout);
+    int width = OS.PANGO_PIXELS(w);
+    int height = OS.PANGO_PIXELS(h);
+    if (ascent !is -1 && descent !is -1) {
+        height = Math.max (height, ascent + descent);
+    }
+    return new Rectangle(0, 0, width, height);
+}
+
+/**
+ * Returns the bounds for the specified range of characters. The
+ * bounds is the smallest rectangle that encompasses all characters
+ * in the range. The start and end offsets are inclusive and will be
+ * clamped if out of range.
+ *
+ * @param start the start offset
+ * @param end the end offset
+ * @return the bounds of the character range
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Rectangle getBounds(int start, int end) {
+    checkLayout();
+    computeRuns();
+    int length_ = text.length;
+    if (length_ is 0) return new Rectangle(0, 0, 0, 0);
+    if (start > end) return new Rectangle(0, 0, 0, 0);
+    start = Math.min(Math.max(0, start), length_ - 1);
+    end = Math.min(Math.max(0, end), length_ - 1);
+    start = translateOffset(start);
+    end = translateOffset(end);
+    auto ptr = OS.pango_layout_get_text(layout);
+    auto cont = fromStringz(ptr);
+    start = cont.utf8AdjustOffset( start );
+    end = cont.utf8AdjustOffset( end );
+    int incr = 1;
+    if( end < cont.length ){
+        incr = cont.getRelativeCodePointOffset( end, 1 );
+    }
+    int byteStart = start;//(OS.g_utf8_offset_to_pointer (ptr, start) - ptr);
+    int byteEnd = end + incr;//(OS.g_utf8_offset_to_pointer (ptr, end + 1) - ptr);
+    int slen = strlen(ptr);
+    byteStart = Math.min(byteStart, slen);
+    byteEnd = Math.min(byteEnd, slen);
+    int[] ranges = [byteStart, byteEnd];
+    auto clipRegion = OS.gdk_pango_layout_get_clip_region(layout, 0, 0, ranges.ptr, 1);
+    if (clipRegion is null) return new Rectangle(0, 0, 0, 0);
+    GdkRectangle rect;
+
+    /*
+    * Bug in Pango. The region returned by gdk_pango_layout_get_clip_region()
+    * includes areas from lines outside of the requested range.  The fix
+    * is to subtract these areas from the clip region.
+    */
+    PangoRectangle* pangoRect = new PangoRectangle();
+    auto iter = OS.pango_layout_get_iter(layout);
+    if (iter is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    auto linesRegion = OS.gdk_region_new();
+    if (linesRegion is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    int lineEnd = 0;
+    do {
+        OS.pango_layout_iter_get_line_extents(iter, null, pangoRect);
+        if (OS.pango_layout_iter_next_line(iter)) {
+            lineEnd = OS.pango_layout_iter_get_index(iter) - 1;
+        } else {
+            lineEnd = slen;
+        }
+        if (byteStart > lineEnd) continue;
+        rect.x = OS.PANGO_PIXELS(pangoRect.x);
+        rect.y = OS.PANGO_PIXELS(pangoRect.y);
+        rect.width = OS.PANGO_PIXELS(pangoRect.width);
+        rect.height = OS.PANGO_PIXELS(pangoRect.height);
+        OS.gdk_region_union_with_rect(linesRegion, &rect);
+    } while (lineEnd + 1 <= byteEnd);
+    OS.gdk_region_intersect(clipRegion, linesRegion);
+    OS.gdk_region_destroy(linesRegion);
+    OS.pango_layout_iter_free(iter);
+
+    OS.gdk_region_get_clipbox(clipRegion, &rect);
+    OS.gdk_region_destroy(clipRegion);
+    if (OS.pango_context_get_base_dir(context) is OS.PANGO_DIRECTION_RTL) {
+        rect.x = width() - rect.x - rect.width;
+    }
+    return new Rectangle(rect.x, rect.y, rect.width, rect.height);
+}
+
+/**
+ * Returns the descent of the receiver.
+ *
+ * @return the descent
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getAscent()
+ * @see #setAscent(int)
+ * @see #setDescent(int)
+ * @see #getLineMetrics(int)
+ */
+public int getDescent () {
+    checkLayout();
+    return descent;
+}
+
+/**
+ * Returns the default font currently being used by the receiver
+ * to draw and measure text.
+ *
+ * @return the receiver's font
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Font getFont () {
+    checkLayout();
+    return font;
+}
+
+/**
+* Returns the receiver's indent.
+*
+* @return the receiver's indent
+*
+* @exception SWTException <ul>
+*    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+* </ul>
+*
+* @since 3.2
+*/
+public int getIndent () {
+    checkLayout();
+    return OS.PANGO_PIXELS(OS.pango_layout_get_indent(layout));
+}
+
+/**
+* Returns the receiver's justification.
+*
+* @return the receiver's justification
+*
+* @exception SWTException <ul>
+*    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+* </ul>
+*
+* @since 3.2
+*/
+public bool getJustify () {
+    checkLayout();
+    return cast(bool) OS.pango_layout_get_justify(layout);
+}
+
+/**
+ * Returns the embedding level for the specified character offset. The
+ * embedding level is usually used to determine the directionality of a
+ * character in bidirectional text.
+ *
+ * @param offset the character offset
+ * @return the embedding level
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the character offset is out of range</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ */
+public int getLevel(int offset) {
+    checkLayout();
+    computeRuns();
+    int length_ = text.length;
+    if (!(0 <= offset && offset <= length_)) SWT.error(SWT.ERROR_INVALID_RANGE);
+    offset = translateOffset(offset);
+    auto iter = OS.pango_layout_get_iter(layout);
+    if (iter is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    int level = 0;
+    PangoItem* item = new PangoItem();
+    PangoLayoutRun* run = new PangoLayoutRun();
+    auto ptr = OS.pango_layout_get_text(layout);
+    auto byteOffset = offset;//OS.g_utf8_offset_to_pointer(ptr, offset) - ptr;
+    int slen = strlen(ptr);
+    byteOffset = Math.min(byteOffset, slen);
+    do {
+        auto runPtr = OS.pango_layout_iter_get_run(iter);
+        if (runPtr !is null) {
+            memmove(run, runPtr, PangoLayoutRun.sizeof);
+            memmove(item, run.item, PangoItem.sizeof);
+            if (item.offset <= byteOffset && byteOffset < item.offset + item.length) {
+                level = item.analysis.level;
+                break;
+            }
+        }
+    } while (OS.pango_layout_iter_next_run(iter));
+    OS.pango_layout_iter_free(iter);
+    return level;
+}
+
+/**
+ * Returns the bounds of the line for the specified line index.
+ *
+ * @param lineIndex the line index
+ * @return the line bounds
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the line index is out of range</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Rectangle getLineBounds(int lineIndex) {
+    checkLayout();
+    computeRuns();
+    int lineCount = OS.pango_layout_get_line_count(layout);
+    if (!(0 <= lineIndex && lineIndex < lineCount)) SWT.error(SWT.ERROR_INVALID_RANGE);
+    auto iter = OS.pango_layout_get_iter(layout);
+    if (iter is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    for (int i = 0; i < lineIndex; i++) OS.pango_layout_iter_next_line(iter);
+    PangoRectangle rect;
+    OS.pango_layout_iter_get_line_extents(iter, null, &rect);
+    OS.pango_layout_iter_free(iter);
+    int x = OS.PANGO_PIXELS(rect.x);
+    int y = OS.PANGO_PIXELS(rect.y);
+    int width_ = OS.PANGO_PIXELS(rect.width);
+    int height = OS.PANGO_PIXELS(rect.height);
+    if (ascent !is -1 && descent !is -1) {
+        height = Math.max (height, ascent + descent);
+    }
+    if (OS.pango_context_get_base_dir(context) is OS.PANGO_DIRECTION_RTL) {
+        x = width() - x - width_;
+    }
+    return new Rectangle(x, y, width_, height);
+}
+
+/**
+ * Returns the receiver's line count. This includes lines caused
+ * by wrapping.
+ *
+ * @return the line count
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getLineCount() {
+    checkLayout ();
+    computeRuns();
+    return OS.pango_layout_get_line_count(layout);
+}
+
+/**
+ * Returns the index of the line that contains the specified
+ * character offset.
+ *
+ * @param offset the character offset
+ * @return the line index
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the character offset is out of range</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getLineIndex(int offset) {
+    checkLayout ();
+    computeRuns();
+    int length_ = text.length;
+    if (!(0 <= offset && offset <= length_)) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    offset = translateOffset(offset);
+    int line = 0;
+    auto ptr = OS.pango_layout_get_text(layout);
+    auto byteOffset = offset;//OS.g_utf8_offset_to_pointer(ptr,offset) - ptr;
+    int slen = strlen(ptr);
+    byteOffset = Math.min(byteOffset, slen);
+    auto iter = OS.pango_layout_get_iter(layout);
+    if (iter is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    while (OS.pango_layout_iter_next_line(iter)) {
+        if (OS.pango_layout_iter_get_index(iter) > byteOffset) break;
+        line++;
+    }
+    OS.pango_layout_iter_free(iter);
+    return line;
+}
+
+/**
+ * Returns the font metrics for the specified line index.
+ *
+ * @param lineIndex the line index
+ * @return the font metrics
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the line index is out of range</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public FontMetrics getLineMetrics (int lineIndex) {
+    checkLayout ();
+    computeRuns();
+    int lineCount = OS.pango_layout_get_line_count(layout);
+    if (!(0 <= lineIndex && lineIndex < lineCount)) SWT.error(SWT.ERROR_INVALID_RANGE);
+    int ascent = 0, descent = 0;
+    PangoLayoutLine* line = new PangoLayoutLine();
+    memmove(line, OS.pango_layout_get_line(layout, lineIndex), PangoLayoutLine.sizeof);
+    if (line.runs is null) {
+        auto font = this.font !is null ? this.font.handle : device.systemFont.handle;
+        auto lang = OS.pango_context_get_language(context);
+        auto metrics = OS.pango_context_get_metrics(context, font, lang);
+        ascent = OS.pango_font_metrics_get_ascent(metrics);
+        descent = OS.pango_font_metrics_get_descent(metrics);
+        OS.pango_font_metrics_unref(metrics);
+    } else {
+        PangoRectangle rect;
+        OS.pango_layout_line_get_extents(OS.pango_layout_get_line(layout, lineIndex), null, &rect);
+        ascent = -rect.y;
+        descent = rect.height - ascent;
+    }
+    ascent = Math.max(this.ascent, OS.PANGO_PIXELS(ascent));
+    descent = Math.max(this.descent, OS.PANGO_PIXELS(descent));
+    return FontMetrics.gtk_new(ascent, descent, 0, 0, ascent + descent);
+}
+
+/**
+ * Returns the line offsets.  Each value in the array is the
+ * offset for the first character in a line except for the last
+ * value, which contains the length of the text.
+ *
+ * @return the line offsets
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int[] getLineOffsets() {
+    checkLayout();
+    computeRuns();
+    int lineCount = OS.pango_layout_get_line_count(layout);
+    int[] offsets = new int [lineCount + 1];
+    auto ptr = OS.pango_layout_get_text(layout);
+    for (int i = 0; i < lineCount; i++) {
+        auto line = OS.pango_layout_get_line(layout, i);
+        int pos = cast(int)/*64*/OS.g_utf8_pointer_to_offset(ptr, ptr + line.start_index);
+        offsets[i] = untranslateOffset(pos);
+    }
+    offsets[lineCount] = text.length;
+    return offsets;
+}
+
+/**
+ * Returns the location for the specified character offset. The
+ * <code>trailing</code> argument indicates whether the offset
+ * corresponds to the leading or trailing edge of the cluster.
+ *
+ * @param offset the character offset
+ * @param trailing the trailing flag
+ * @return the location of the character offset
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getOffset(Point, int[])
+ * @see #getOffset(int, int, int[])
+ */
+public Point getLocation(int offset, bool trailing) {
+    checkLayout();
+    computeRuns();
+    int length_ = text.length;
+    if (!(0 <= offset && offset <= length_)) SWT.error(SWT.ERROR_INVALID_RANGE);
+    offset = translateOffset(offset);
+    auto ptr = OS.pango_layout_get_text(layout);
+    auto cont = fromStringz(ptr);
+    offset = cont.utf8AdjustOffset(offset);
+    // leading ZWS+ZWNBS are 2 codepoints in 6 bytes, so we miss 4 bytes here
+    int byteOffset = offset;//(OS.g_utf8_offset_to_pointer(ptr, offset) - ptr);
+    int slen = cont.length;
+    byteOffset = Math.min(byteOffset, slen);
+    PangoRectangle* pos = new PangoRectangle();
+    OS.pango_layout_index_to_pos(layout, byteOffset, pos);
+    int x = trailing ? pos.x + pos.width : pos.x;
+    int y = pos.y;
+    x = OS.PANGO_PIXELS(x);
+    if (OS.pango_context_get_base_dir(context) is OS.PANGO_DIRECTION_RTL) {
+        x = width() - x;
+    }
+    return new Point(x, OS.PANGO_PIXELS(y));
+}
+
+/**
+ * Returns the next offset for the specified offset and movement
+ * type.  The movement is one of <code>SWT.MOVEMENT_CHAR</code>,
+ * <code>SWT.MOVEMENT_CLUSTER</code>, <code>SWT.MOVEMENT_WORD</code>,
+ * <code>SWT.MOVEMENT_WORD_END</code> or <code>SWT.MOVEMENT_WORD_START</code>.
+ *
+ * @param offset the start offset
+ * @param movement the movement type
+ * @return the next offset
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the offset is out of range</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getPreviousOffset(int, int)
+ */
+public int getNextOffset (int offset, int movement) {
+    return _getOffset(offset, movement, true);
+}
+
+int _getOffset (int offset, int movement, bool forward) {
+    checkLayout();
+    computeRuns();
+    int length_ = text.length;
+    if (!(0 <= offset && offset <= length_)) SWT.error(SWT.ERROR_INVALID_RANGE);
+    if (forward) {
+        if (offset is length_) return length_;
+    } else {
+        if (offset is 0) return 0;
+    }
+    auto cont = OS.pango_layout_get_text(layout);
+    assert( cont );
+    auto dcont = fromStringz(cont);
+    int step = forward ? 1 : -1;
+    if ((movement & SWT.MOVEMENT_CHAR) !is 0){
+        //PORTING take care of utf8
+        int toffset = translateOffset(offset);
+        toffset = dcont.utf8AdjustOffset( toffset );
+        int incr = dcont.getRelativeCodePointOffset( toffset, step );
+        return offset + incr;
+    }
+    PangoLogAttr* attrs;
+    int nAttrs;
+    // return one attr per codepoint (=char in pango)
+    OS.pango_layout_get_log_attrs(layout, &attrs, &nAttrs);
+    if (attrs is null) return offset + step;
+    length_ = dcont.length;//OS.g_utf8_strlen(cont, -1);
+    offset = translateOffset(offset);
+    offset = dcont.utf8AdjustOffset( offset );
+
+    PangoLogAttr* logAttr;
+    offset = validateOffset( dcont, offset, step);
+    // the loop is byte oriented
+    while (0 < offset && offset < length_) {
+        logAttr = & attrs[ OS.g_utf8_pointer_to_offset( cont, cont+offset) ];
+        if (((movement & SWT.MOVEMENT_CLUSTER) !is 0) && logAttr.is_cursor_position ) break;
+        if ((movement & SWT.MOVEMENT_WORD) !is 0) {
+            if (forward) {
+                if (logAttr.is_word_end ) break;
+            } else {
+                if (logAttr.is_word_start ) break;
+            }
+        }
+        if ((movement & SWT.MOVEMENT_WORD_START) !is 0) {
+            if (logAttr.is_word_start ) break;
+        }
+        if ((movement & SWT.MOVEMENT_WORD_END) !is 0) {
+            if (logAttr.is_word_end ) break;
+        }
+        offset = validateOffset( dcont, offset, step);
+    }
+    OS.g_free(attrs);
+    return Math.min(Math.max(0, untranslateOffset(offset)), text.length);
+}
+
+/**
+ * Returns the character offset for the specified point.
+ * For a typical character, the trailing argument will be filled in to
+ * indicate whether the point is closer to the leading edge (0) or
+ * the trailing edge (1).  When the point is over a cluster composed
+ * of multiple characters, the trailing argument will be filled with the
+ * position of the character in the cluster that is closest to
+ * the point.
+ *
+ * @param point the point
+ * @param trailing the trailing buffer
+ * @return the character offset
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the trailing length is less than <code>1</code></li>
+ *    <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getLocation(int, bool)
+ */
+public int getOffset(Point point, int[] trailing) {
+    checkLayout();
+    if (point is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    return getOffset(point.x, point.y, trailing);
+}
+
+/**
+ * Returns the character offset for the specified point.
+ * For a typical character, the trailing argument will be filled in to
+ * indicate whether the point is closer to the leading edge (0) or
+ * the trailing edge (1).  When the point is over a cluster composed
+ * of multiple characters, the trailing argument will be filled with the
+ * position of the character in the cluster that is closest to
+ * the point.
+ *
+ * @param x the x coordinate of the point
+ * @param y the y coordinate of the point
+ * @param trailing the trailing buffer
+ * @return the character offset
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the trailing length is less than <code>1</code></li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getLocation(int, bool)
+ */
+public int getOffset(int x, int y, int[] trailing) {
+    checkLayout();
+    computeRuns();
+    if (trailing !is null && trailing.length < 1) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    if (OS.pango_context_get_base_dir(context) is OS.PANGO_DIRECTION_RTL) {
+        x = width() - x;
+    }
+
+    /*
+    * Feature in GTK.  pango_layout_xy_to_index() returns the
+    * logical end/start offset of a line when the coordinates are outside
+    * the line bounds. In SWT the correct behavior is to return the closest
+    * visual offset. The fix is to clamp the coordinates inside the
+    * line bounds.
+    */
+    auto iter = OS.pango_layout_get_iter(layout);
+    if (iter is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    PangoRectangle rect;
+    do {
+        OS.pango_layout_iter_get_line_extents(iter, null, &rect);
+        rect.y = OS.PANGO_PIXELS(rect.y);
+        rect.height = OS.PANGO_PIXELS(rect.height);
+        if (rect.y <= y && y < rect.y + rect.height) {
+            rect.x = OS.PANGO_PIXELS(rect.x);
+            rect.width = OS.PANGO_PIXELS(rect.width);
+            if (x >= rect.x + rect.width) x = rect.x + rect.width - 1;
+            if (x < rect.x) x = rect.x;
+            break;
+        }
+    } while (OS.pango_layout_iter_next_line(iter));
+    OS.pango_layout_iter_free(iter);
+
+    int index;
+    int piTrailing;
+    OS.pango_layout_xy_to_index(layout, x * OS.PANGO_SCALE, y * OS.PANGO_SCALE, &index, &piTrailing);
+    auto ptr = OS.pango_layout_get_text(layout);
+    int offset = index;//OS.g_utf8_pointer_to_offset(ptr, ptr + index);
+    if (trailing !is null) trailing[0] = piTrailing;
+    return untranslateOffset(offset);
+}
+
+/**
+ * Returns the orientation of the receiver.
+ *
+ * @return the orientation style
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getOrientation() {
+    checkLayout();
+    int baseDir = OS.pango_context_get_base_dir(context);
+    return baseDir is OS.PANGO_DIRECTION_RTL ? SWT.RIGHT_TO_LEFT : SWT.LEFT_TO_RIGHT;
+}
+
+/**
+ * Returns the previous offset for the specified offset and movement
+ * type.  The movement is one of <code>SWT.MOVEMENT_CHAR</code>,
+ * <code>SWT.MOVEMENT_CLUSTER</code> or <code>SWT.MOVEMENT_WORD</code>,
+ * <code>SWT.MOVEMENT_WORD_END</code> or <code>SWT.MOVEMENT_WORD_START</code>.
+ *
+ * @param offset the start offset
+ * @param movement the movement type
+ * @return the previous offset
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the offset is out of range</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getNextOffset(int, int)
+ */
+public int getPreviousOffset (int index, int movement) {
+    return _getOffset(index, movement, false);
+}
+
+/**
+ * Gets the ranges of text that are associated with a <code>TextStyle</code>.
+ *
+ * @return the ranges, an array of offsets representing the start and end of each
+ * text style.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getStyles()
+ *
+ * @since 3.2
+ */
+public int[] getRanges () {
+    checkLayout();
+    int[] result = new int[styles.length * 2];
+    int count = 0;
+    for (int i=0; i<styles.length - 1; i++) {
+        if (styles[i].style !is null) {
+            result[count++] = styles[i].start;
+            result[count++] = styles[i + 1].start - 1;
+        }
+    }
+    if (count !is result.length) {
+        int[] newResult = new int[count];
+        System.arraycopy(result, 0, newResult, 0, count);
+        result = newResult;
+    }
+    return result;
+}
+
+/**
+ * Returns the text segments offsets of the receiver.
+ *
+ * @return the text segments offsets
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int[] getSegments() {
+    checkLayout();
+    return segments;
+}
+
+String getSegmentsText() {
+    if (segments is null) return text;
+    int nSegments = segments.length;
+    if (nSegments <= 1) return text;
+    int len = text.length;
+    if (len is 0) return text;
+    if (nSegments is 2) {
+        if (segments[0] is 0 && segments[1] is len) return text;
+    }
+    char[] oldChars = text[0..len].dup;
+    char[] newChars = new char[len + nSegments*3];
+    int charCount = 0, segmentCount = 0;
+    String separator = getOrientation() is SWT.RIGHT_TO_LEFT ? STR_RTL_MARK : STR_LTR_MARK;
+    while (charCount < len) {
+        if (segmentCount < nSegments && charCount is segments[segmentCount]) {
+            newChars[charCount + segmentCount .. charCount + segmentCount + separator.length ] = separator;
+            segmentCount+=separator.length;
+        } else {
+            newChars[charCount + segmentCount] = oldChars[charCount];
+            charCount++;
+        }
+    }
+    if (segmentCount < nSegments) {
+        segments[segmentCount] = charCount;
+        newChars[charCount + segmentCount .. charCount + segmentCount + separator.length ] = separator;
+        segmentCount+=separator.length;
+    }
+    return newChars[ 0 .. Math.min(charCount + segmentCount, newChars.length) ];
+}
+
+/**
+ * Returns the line spacing of the receiver.
+ *
+ * @return the line spacing
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getSpacing () {
+    checkLayout();
+    return OS.PANGO_PIXELS(OS.pango_layout_get_spacing(layout));
+}
+
+/**
+ * Gets the style of the receiver at the specified character offset.
+ *
+ * @param offset the text offset
+ * @return the style or <code>null</code> if not set
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the character offset is out of range</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public TextStyle getStyle (int offset) {
+    checkLayout();
+    int length_ = text.length;
+    if (!(0 <= offset && offset < length_)) SWT.error(SWT.ERROR_INVALID_RANGE);
+    for (int i=1; i<styles.length; i++) {
+        StyleItem item = styles[i];
+        if (item.start > offset) {
+            return styles[i - 1].style;
+        }
+    }
+    return null;
+}
+
+/**
+ * Gets all styles of the receiver.
+ *
+ * @return the styles
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getRanges()
+ *
+ * @since 3.2
+ */
+public TextStyle[] getStyles () {
+    checkLayout();
+    TextStyle[] result = new TextStyle[styles.length];
+    int count = 0;
+    for (int i=0; i<styles.length; i++) {
+        if (styles[i].style !is null) {
+            result[count++] = styles[i].style;
+        }
+    }
+    if (count !is result.length) {
+        TextStyle[] newResult = new TextStyle[count];
+        System.arraycopy(result, 0, newResult, 0, count);
+        result = newResult;
+    }
+    return result;
+}
+
+/**
+ * Returns the tab list of the receiver.
+ *
+ * @return the tab list
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int[] getTabs() {
+    checkLayout();
+    return tabs;
+}
+
+/**
+ * Gets the receiver's text, which will be an empty
+ * string if it has never been set.
+ *
+ * @return the receiver's text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public String getText () {
+    checkLayout ();
+    return text;
+}
+
+/**
+ * Returns the width of the receiver.
+ *
+ * @return the width
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getWidth () {
+    checkLayout ();
+    int width = OS.pango_layout_get_width(layout);
+    return width !is -1 ? OS.PANGO_PIXELS(width) : -1;
+}
+
+/**
+ * Returns <code>true</code> if the text layout has been disposed,
+ * and <code>false</code> otherwise.
+ * <p>
+ * This method gets the dispose state for the text layout.
+ * When a text layout has been disposed, it is an error to
+ * invoke any other method using the text layout.
+ * </p>
+ *
+ * @return <code>true</code> when the text layout is disposed and <code>false</code> otherwise
+ */
+public override bool isDisposed () {
+    return layout is null;
+}
+
+/**
+ * Sets the text alignment for the receiver. The alignment controls
+ * how a line of text is positioned horizontally. The argument should
+ * be one of <code>SWT.LEFT</code>, <code>SWT.RIGHT</code> or <code>SWT.CENTER</code>.
+ * <p>
+ * The default alignment is <code>SWT.LEFT</code>.  Note that the receiver's
+ * width must be set in order to use <code>SWT.RIGHT</code> or <code>SWT.CENTER</code>
+ * alignment.
+ * </p>
+ *
+ * @param alignment the new alignment
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #setWidth(int)
+ */
+public void setAlignment (int alignment) {
+    checkLayout();
+    int mask = SWT.LEFT | SWT.CENTER | SWT.RIGHT;
+    alignment &= mask;
+    if (alignment is 0) return;
+    if ((alignment & SWT.LEFT) !is 0) alignment = SWT.LEFT;
+    if ((alignment & SWT.RIGHT) !is 0) alignment = SWT.RIGHT;
+    bool rtl = OS.pango_context_get_base_dir(context) is OS.PANGO_DIRECTION_RTL;
+    int align_ = OS.PANGO_ALIGN_CENTER;
+    switch (alignment) {
+        case SWT.LEFT:
+            align_ = rtl ? OS.PANGO_ALIGN_RIGHT : OS.PANGO_ALIGN_LEFT;
+            break;
+        case SWT.RIGHT:
+            align_ = rtl ? OS.PANGO_ALIGN_LEFT : OS.PANGO_ALIGN_RIGHT;
+            break;
+    }
+    OS.pango_layout_set_alignment(layout, align_);
+}
+
+/**
+ * Sets the ascent of the receiver. The ascent is distance in pixels
+ * from the baseline to the top of the line and it is applied to all
+ * lines. The default value is <code>-1</code> which means that the
+ * ascent is calculated from the line fonts.
+ *
+ * @param ascent the new ascent
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the ascent is less than <code>-1</code></li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #setDescent(int)
+ * @see #getLineMetrics(int)
+ */
+public void setAscent (int ascent) {
+    checkLayout();
+    if (ascent < -1) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    if (this.ascent is ascent) return;
+    freeRuns();
+    this.ascent = ascent;
+}
+
+/**
+ * Sets the descent of the receiver. The descent is distance in pixels
+ * from the baseline to the bottom of the line and it is applied to all
+ * lines. The default value is <code>-1</code> which means that the
+ * descent is calculated from the line fonts.
+ *
+ * @param descent the new descent
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the descent is less than <code>-1</code></li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #setAscent(int)
+ * @see #getLineMetrics(int)
+ */
+public void setDescent (int descent) {
+    checkLayout();
+    if (descent < -1) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    if (this.descent is descent) return;
+    freeRuns();
+    this.descent = descent;
+}
+
+/**
+ * Sets the default font which will be used by the receiver
+ * to draw and measure text. If the
+ * argument is null, then a default font appropriate
+ * for the platform will be used instead. Note that a text
+ * style can override the default font.
+ *
+ * @param font the new font for the receiver, or null to indicate a default font
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the font has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setFont (Font font) {
+    checkLayout ();
+    if (font !is null && font.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    Font oldFont = this.font;
+    if (oldFont is font) return;
+    freeRuns();
+    this.font = font;
+    if (oldFont !is null && oldFont.opEquals(font)) return;
+    OS.pango_layout_set_font_description(layout, font !is null ? font.handle : device.systemFont.handle);
+}
+
+/**
+ * Sets the indent of the receiver. This indent it applied of the first line of
+ * each paragraph.
+ *
+ * @param indent new indent
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setIndent (int indent) {
+    checkLayout();
+    if (indent < 0) return;
+    OS.pango_layout_set_indent(layout, indent * OS.PANGO_SCALE);
+}
+
+/**
+ * Sets the justification of the receiver. Note that the receiver's
+ * width must be set in order to use justification.
+ *
+ * @param justify new justify
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setJustify (bool justify) {
+    checkLayout();
+    OS.pango_layout_set_justify(layout, justify);
+}
+
+/**
+ * Sets the orientation of the receiver, which must be one
+ * of <code>SWT.LEFT_TO_RIGHT</code> or <code>SWT.RIGHT_TO_LEFT</code>.
+ *
+ * @param orientation new orientation style
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setOrientation(int orientation) {
+    checkLayout();
+    int mask = SWT.RIGHT_TO_LEFT | SWT.LEFT_TO_RIGHT;
+    orientation &= mask;
+    if (orientation is 0) return;
+    if ((orientation & SWT.LEFT_TO_RIGHT) !is 0) orientation = SWT.LEFT_TO_RIGHT;
+    int baseDir = orientation is SWT.RIGHT_TO_LEFT ? OS.PANGO_DIRECTION_RTL : OS.PANGO_DIRECTION_LTR;
+    if (OS.pango_context_get_base_dir(context) is baseDir) return;
+    OS.pango_context_set_base_dir(context, baseDir);
+    OS.pango_layout_context_changed(layout);
+    int align_ = OS.pango_layout_get_alignment(layout);
+    if (align_ !is OS.PANGO_ALIGN_CENTER) {
+        align_ = align_ is OS.PANGO_ALIGN_LEFT ? OS.PANGO_ALIGN_RIGHT : OS.PANGO_ALIGN_LEFT;
+        OS.pango_layout_set_alignment(layout, align_);
+    }
+}
+
+/**
+ * Sets the line spacing of the receiver.  The line spacing
+ * is the space left between lines.
+ *
+ * @param spacing the new line spacing
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the spacing is negative</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setSpacing (int spacing) {
+    checkLayout();
+    if (spacing < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    OS.pango_layout_set_spacing(layout, spacing * OS.PANGO_SCALE);
+}
+
+/**
+ * Sets the offsets of the receiver's text segments. Text segments are used to
+ * override the default behaviour of the bidirectional algorithm.
+ * Bidirectional reordering can happen within a text segment but not
+ * between two adjacent segments.
+ * <p>
+ * Each text segment is determined by two consecutive offsets in the
+ * <code>segments</code> arrays. The first element of the array should
+ * always be zero and the last one should always be equals to length of
+ * the text.
+ * </p>
+ *
+ * @param segments the text segments offset
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setSegments(int[] segments) {
+    checkLayout();
+    if (this.segments is null && segments is null) return;
+    if (this.segments !is null && segments !is null) {
+        if (this.segments.length is segments.length) {
+            int i;
+            for (i = 0; i <segments.length; i++) {
+                if (this.segments[i] !is segments[i]) break;
+            }
+            if (i is segments.length) return;
+        }
+    }
+    freeRuns();
+    this.segments = segments;
+}
+
+/**
+ * Sets the style of the receiver for the specified range.  Styles previously
+ * set for that range will be overwritten.  The start and end offsets are
+ * inclusive and will be clamped if out of range.
+ *
+ * @param style the style
+ * @param start the start offset
+ * @param end the end offset
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setStyle (TextStyle style, int start, int end) {
+    checkLayout();
+    int length_ = text.length;
+    if (length_ is 0) return;
+    if (start > end) return;
+    start = Math.min(Math.max(0, start), length_ - 1);
+    end = Math.min(Math.max(0, end), length_ - 1);
+    start = text.utf8AdjustOffset( start );
+    end = text.utf8AdjustOffset( end );
+
+
+    /*
+    * Bug in Pango. Pango 1.2.2 will cause a segmentation fault if a style
+    * is not applied for a whole ligature.  The fix is to applied the
+    * style for the whole ligature.
+    *
+    * NOTE that fix only LamAlef ligatures.
+    */
+    int relIndex;
+    if ((start > 0 ) && isAlef(text[ start .. $ ].firstCodePoint()) && isLam(text.getRelativeCodePoint( start, -1, relIndex ))) {
+        start += relIndex;
+    }
+    if ((end < length_ - 1) && isLam(text[ end .. $ ].firstCodePoint()) && isAlef(text.getRelativeCodePoint(end, 1,relIndex))) {
+        end += relIndex;
+    }
+
+    int low = -1;
+    int high = styles.length;
+    while (high - low > 1) {
+        int index = (high + low) / 2;
+        if (styles[index + 1].start > start) {
+            high = index;
+        } else {
+            low = index;
+        }
+    }
+    if (0 <= high && high < styles.length) {
+        StyleItem item = styles[high];
+        if (item.start is start && styles[high + 1].start - 1 is end) {
+            if (style is null) {
+                if (item.style is null) return;
+            } else {
+                if (style.opEquals(item.style)) return;
+            }
+        }
+    }
+    freeRuns();
+    int modifyStart = high;
+    int modifyEnd = modifyStart;
+    while (modifyEnd < styles.length) {
+        if (styles[modifyEnd + 1].start > end) break;
+        modifyEnd++;
+    }
+    if (modifyStart is modifyEnd) {
+        int styleStart = styles[modifyStart].start;
+        int styleEnd = styles[modifyEnd + 1].start - 1;
+        if (styleStart is start && styleEnd is end) {
+            styles[modifyStart].style = style;
+            return;
+        }
+        if (styleStart !is start && styleEnd !is end) {
+            StyleItem[] newStyles = new StyleItem[styles.length + 2];
+            System.arraycopy(styles, 0, newStyles, 0, modifyStart + 1);
+            StyleItem item = new StyleItem();
+            item.start = start;
+            item.style = style;
+            newStyles[modifyStart + 1] = item;
+            item = new StyleItem();
+            item.start = end + 1;
+            item.style = styles[modifyStart].style;
+            newStyles[modifyStart + 2] = item;
+            System.arraycopy(styles, modifyEnd + 1, newStyles, modifyEnd + 3, styles.length - modifyEnd - 1);
+            styles = newStyles;
+            return;
+        }
+    }
+    if (start is styles[modifyStart].start) modifyStart--;
+    if (end is styles[modifyEnd + 1].start - 1) modifyEnd++;
+    int newLength = styles.length + 1 - (modifyEnd - modifyStart - 1);
+    StyleItem[] newStyles = new StyleItem[newLength];
+    System.arraycopy(styles, 0, newStyles, 0, modifyStart + 1);
+    StyleItem item = new StyleItem();
+    item.start = start;
+    item.style = style;
+    newStyles[modifyStart + 1] = item;
+    styles[modifyEnd].start = end + 1;
+    System.arraycopy(styles, modifyEnd, newStyles, modifyStart + 2, styles.length - modifyEnd);
+    styles = newStyles;
+}
+
+/**
+ * Sets the receiver's tab list. Each value in the tab list specifies
+ * the space in pixels from the origin of the text layout to the respective
+ * tab stop.  The last tab stop width is repeated continuously.
+ *
+ * @param tabs the new tab list
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setTabs(int[] tabs) {
+    checkLayout();
+    if (this.tabs is null && tabs is null) return;
+    if (this.tabs!is null && tabs !is null) {
+        if (this.tabs.length is tabs.length) {
+            int i;
+            for (i = 0; i <tabs.length; i++) {
+                if (this.tabs[i] !is tabs[i]) break;
+            }
+            if (i is tabs.length) return;
+        }
+    }
+    this.tabs = tabs;
+    if (tabs is null) {
+        OS.pango_layout_set_tabs(layout, device.emptyTab);
+    } else {
+        auto tabArray = OS.pango_tab_array_new(tabs.length, true);
+        if (tabArray !is null) {
+            for (int i = 0; i < tabs.length; i++) {
+                OS.pango_tab_array_set_tab(tabArray, i, OS.PANGO_TAB_LEFT, tabs[i]);
+            }
+            OS.pango_layout_set_tabs(layout, tabArray);
+            OS.pango_tab_array_free(tabArray);
+        }
+    }
+    /*
+    * Bug in Pango. A change in the tab stop array is not automatically reflected in the
+    * pango layout object because the call pango_layout_set_tabs() does not free the
+    * lines cache. The fix to use pango_layout_context_changed() to free the lines cache.
+    */
+    OS.pango_layout_context_changed(layout);
+}
+
+/**
+ * Sets the receiver's text.
+ *
+ * @param text the new text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setText (String text) {
+    checkLayout ();
+    if (text.equals(this.text)) return;
+    freeRuns();
+    this.text = text;
+    styles = new StyleItem[2];
+    styles[0] = new StyleItem();
+    styles[1] = new StyleItem();
+    styles[styles.length - 1].start = text.length;
+}
+
+/**
+ * Sets the line width of the receiver, which determines how
+ * text should be wrapped and aligned. The default value is
+ * <code>-1</code> which means wrapping is disabled.
+ *
+ * @param width the new width
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the width is <code>0</code> or less than <code>-1</code></li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #setAlignment(int)
+ */
+public void setWidth (int width) {
+    checkLayout ();
+    if (width < -1 || width is 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    freeRuns();
+    if (width is -1) {
+        OS.pango_layout_set_width(layout, -1);
+        bool rtl = OS.pango_context_get_base_dir(context) is OS.PANGO_DIRECTION_RTL;
+        OS.pango_layout_set_alignment(layout, rtl ? OS.PANGO_ALIGN_RIGHT : OS.PANGO_ALIGN_LEFT);
+    } else {
+        OS.pango_layout_set_width(layout, width * OS.PANGO_SCALE);
+    }
+}
+
+static final bool isLam(int ch) {
+    return ch is 0x0644;
+}
+
+static final bool isAlef(int ch) {
+    switch (ch) {
+        case 0x0622:
+        case 0x0623:
+        case 0x0625:
+        case 0x0627:
+        case 0x0649:
+        case 0x0670:
+        case 0x0671:
+        case 0x0672:
+        case 0x0673:
+        case 0x0675:
+            return true;
+        default:
+    }
+    return false;
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the receiver
+ */
+public override String toString () {
+    if (isDisposed()) return "TextLayout {*DISPOSED*}";
+    return Format( "TextLayout {{{}}", layout );
+}
+
+/*
+ *  Translate a client offset to an internal offset
+ */
+int translateOffset(int offset) {
+    int length_ = text.length;
+    if (length_ is 0) return offset;
+    if (invalidOffsets is null) return offset;
+    for (int i = 0; i < invalidOffsets.length; i++) {
+        if (offset < invalidOffsets[i]) break;
+        offset++;
+    }
+    return offset;
+}
+
+/*
+ *  Translate an internal offset to a client offset
+ */
+int untranslateOffset(int offset) {
+    int length_ = text.length;
+    if (length_ is 0) return offset;
+    if (invalidOffsets is null) return offset;
+    for (int i = 0; i < invalidOffsets.length; i++) {
+        if (offset is invalidOffsets[i]) {
+            offset++;
+            continue;
+        }
+        if (offset < invalidOffsets[i]) {
+            return offset - i;
+        }
+    }
+    return offset - invalidOffsets.length;
+}
+
+int validateOffset( String cont, int offset, int step) {
+    if (invalidOffsets is null) return offset + step;
+    int i = step > 0 ? 0 : invalidOffsets.length - 1;
+    do {
+        if( offset is 0 && step < 0 ){
+            offset += step;
+        }
+        else{
+            offset += cont.getRelativeCodePointOffset( offset, step );
+        }
+        while (0 <= i && i < invalidOffsets.length) {
+            if (invalidOffsets[i] is offset) break;
+            i += step;
+        }
+    } while (0 <= i && i < invalidOffsets.length);
+    return offset;
+}
+
+int width () {
+    int wrapWidth = OS.pango_layout_get_width(layout);
+    if (wrapWidth !is -1) return OS.PANGO_PIXELS(wrapWidth);
+    int w, h;
+    OS.pango_layout_get_size(layout, &w, &h);
+    return OS.PANGO_PIXELS(w + OS.pango_layout_get_indent(layout));
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/TextStyle.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,344 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.TextStyle;
+
+import java.lang.all;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GlyphMetrics;
+
+import tango.util.Convert;
+/**
+ * <code>TextStyle</code> defines a set of styles that can be applied
+ * to a range of text.
+ * <p>
+ * The hashCode() method in this class uses the values of the public
+ * fields to compute the hash value. When storing instances of the
+ * class in hashed collections, do not modify these fields after the
+ * object has been inserted.
+ * </p>
+ * <p>
+ * Application code does <em>not</em> need to explicitly release the
+ * resources managed by each instance when those instances are no longer
+ * required, and thus no <code>dispose()</code> method is provided.
+ * </p>
+ *
+ * @see TextLayout
+ * @see Font
+ * @see Color
+ * @see <a href="http://www.eclipse.org/swt/snippets/#textlayout">TextLayout, TextStyle snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.0
+ */
+public class TextStyle {
+
+    /**
+     * the font of the style
+     */
+    public Font font;
+
+    /**
+     * the foreground of the style
+     */
+    public Color foreground;
+
+    /**
+     * the background of the style
+     */
+    public Color background;
+
+    /**
+     * the underline flag of the style. The default underline
+     * style is <code>SWT.UNDERLINE_SINGLE</code>.
+     *
+     *
+     * @since 3.1
+     */
+    public bool underline;
+
+    /**
+     * the underline color of the style
+     *
+     * @since 3.4
+     */
+    public Color underlineColor;
+
+    /**
+     * the underline style. This style is ignored when
+     * <code>underline</code> is false.
+     * <p>
+     * This value should be one of <code>SWT.UNDERLINE_SINGLE</code>,
+     * <code>SWT.UNDERLINE_DOUBLE</code>, <code>SWT.UNDERLINE_ERROR</code>,
+     * or <code>SWT.UNDERLINE_SQUIGGLE</code>.
+     * </p>
+     *
+     * @see SWT#UNDERLINE_SINGLE
+     * @see SWT#UNDERLINE_DOUBLE
+     * @see SWT#UNDERLINE_ERROR
+     * @see SWT#UNDERLINE_SQUIGGLE
+     *
+     * @since 3.4
+     */
+    public int underlineStyle;
+
+    /**
+     * the strikeout flag of the style
+     *
+     * @since 3.1
+     */
+    public bool strikeout;
+
+    /**
+     * the strikeout color of the style
+     *
+     * @since 3.4
+     */
+    public Color strikeoutColor;
+
+    /**
+     * the border style. The default border style is <code>SWT.NONE</code>.
+     * <p>
+     * This value should be one of <code>SWT.BORDER_SOLID</code>,
+     * <code>SWT.BORDER_DASH</code>,<code>SWT.BORDER_DOT</code> or
+     * <code>SWT.NONE</code>.
+     * </p>
+     *
+     * @see SWT#BORDER_SOLID
+     * @see SWT#BORDER_DASH
+     * @see SWT#BORDER_DOT
+     * @see SWT#NONE
+     *
+     * @since 3.4
+     */
+    public int borderStyle;
+
+    /**
+     * the border color of the style
+     *
+     * @since 3.4
+     */
+    public Color borderColor;
+
+    /**
+     * the GlyphMetrics of the style
+     *
+     * @since 3.2
+     */
+    public GlyphMetrics metrics;
+
+    /**
+     * the baseline rise of the style.
+     *
+     * @since 3.2
+     */
+    public int rise;
+
+/**
+ * Create an empty text style.
+ *
+ * @since 3.4
+ */
+public this () {
+}
+
+/**
+ * Create a new text style with the specified font, foreground
+ * and background.
+ *
+ * @param font the font of the style, <code>null</code> if none
+ * @param foreground the foreground color of the style, <code>null</code> if none
+ * @param background the background color of the style, <code>null</code> if none
+ */
+public this (Font font, Color foreground, Color background) {
+    if (font !is null && font.isDisposed()) SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+    if (foreground !is null && foreground.isDisposed()) SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+    if (background !is null && background.isDisposed()) SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+    this.font = font;
+    this.foreground = foreground;
+    this.background = background;
+}
+
+
+/**
+ * Create a new text style from an existing text style.
+ *
+ *@param style the style to copy
+ *
+ * @since 3.4
+ */
+public this (TextStyle style) {
+    if (style is null) SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+    font = style.font;
+    foreground = style.foreground;
+    background = style.background;
+    underline = style.underline;
+    underlineColor = style.underlineColor;
+    underlineStyle = style.underlineStyle;
+    strikeout = style.strikeout;
+    strikeoutColor = style.strikeoutColor;
+    borderStyle = style.borderStyle;
+    borderColor = style.borderColor;
+    metrics = style.metrics;
+    rise = style.rise;
+}
+
+/**
+ * Compares the argument to the receiver, and returns true
+ * if they represent the <em>same</em> object using a class
+ * specific comparison.
+ *
+ * @param object the object to compare with this object
+ * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
+ *
+ * @see #hashCode()
+ */
+public override int opEquals(Object object) {
+    if (object is this) return true;
+    if (object is null) return false;
+    if (!(cast(TextStyle)object)) return false;
+    TextStyle style = cast(TextStyle)object;
+    if (foreground !is null) {
+        if ( foreground !is style.foreground ) return false;
+    } else if (style.foreground !is null) return false;
+    if (background !is null) {
+        if ( background !is style.background ) return false;
+    } else if (style.background !is null) return false;
+    if (font !is null) {
+        if (font !is style.font) return false;
+    } else if (style.font !is null) return false;
+    if (metrics !is null || style.metrics !is null) return false;
+    if (underline !is style.underline) return false;
+    if (underlineStyle !is style.underlineStyle) return false;
+    if (borderStyle !is style.borderStyle) return false;
+    if (strikeout !is style.strikeout) return false;
+    if (rise !is style.rise) return false;
+    if (underlineColor !is null) {
+        if (!underlineColor.opEquals(style.underlineColor)) return false;
+    } else if (style.underlineColor !is null) return false;
+    if (strikeoutColor !is null) {
+        if (!strikeoutColor.opEquals(style.strikeoutColor)) return false;
+    } else if (style.strikeoutColor !is null) return false;
+    if (underlineStyle !is style.underlineStyle) return false;
+    if (borderColor !is null) {
+        if (!borderColor.opEquals(style.borderColor)) return false;
+    } else if (style.borderColor !is null) return false;
+    return true;
+}
+
+/**
+ * Returns an integer hash code for the receiver. Any two
+ * objects that return <code>true</code> when passed to
+ * <code>equals</code> must return the same value for this
+ * method.
+ *
+ * @return the receiver's hash
+ *
+ * @see #equals(Object)
+ */
+public override hash_t toHash() {
+    int hash = 0;
+    if (foreground !is null) hash ^= foreground.toHash();
+    if (background !is null) hash ^= background.toHash();
+    if (font !is null) hash ^= font.toHash();
+    if (metrics !is null) hash ^= metrics.toHash();
+    if (underline) hash ^= hash;
+    if (strikeout) hash ^= hash;
+    hash ^= rise;
+    if (underlineColor !is null) hash ^= underlineColor.toHash();
+    if (strikeoutColor !is null) hash ^= strikeoutColor.toHash();
+    if (borderColor !is null) hash ^= borderColor.toHash();
+    hash ^= underlineStyle;
+    return hash;
+}
+
+bool isAdherentBorder(TextStyle style) {
+    if (this is style) return true;
+    if (style is null) return false;
+    if (borderStyle !is style.borderStyle) return false;
+    if (borderColor !is null) {
+        if (!borderColor.opEquals(style.borderColor)) return false;
+    } else if (style.borderColor !is null) return false;
+    return true;
+}
+
+bool isAdherentUnderline(TextStyle style) {
+    if (this is style) return true;
+    if (style is null) return false;
+    if (underline !is style.underline) return false;
+    if (underlineStyle !is style.underlineStyle) return false;
+    if (underlineColor !is null) {
+        if (!underlineColor.opEquals(style.underlineColor)) return false;
+    } else if (style.underlineColor !is null) return false;
+    return true;
+}
+
+bool isAdherentStrikeout(TextStyle style) {
+    if (this is style) return true;
+    if (style is null) return false;
+    if (strikeout !is style.strikeout) return false;
+    if (strikeoutColor !is null) {
+        if (!strikeoutColor.opEquals(style.strikeoutColor)) return false;
+    } else if (style.strikeoutColor !is null) return false;
+    return true;
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the <code>TextStyle</code>
+ */
+override public String toString () {
+    String buffer = "TextStyle {";
+    int startLength = buffer.length;
+    if (font !is null) {
+        if (buffer.length > startLength) buffer ~= ", ";
+        buffer ~= "font=";
+        buffer ~= font.toString;
+    }
+    if (foreground !is null) {
+        if (buffer.length > startLength) buffer ~= ", ";
+        buffer ~= "foreground=";
+        buffer ~= foreground.toString;
+    }
+    if (background !is null) {
+        if (buffer.length > startLength) buffer ~= ", ";
+        buffer ~= "background=";
+        buffer ~= background.toString;
+    }
+    if (underline) {
+        if (buffer.length > startLength) buffer ~= ", ";
+        buffer ~= "underlined";
+    }
+    if (strikeout) {
+        if (buffer.length > startLength) buffer ~= ", ";
+        buffer ~= "striked out";
+    }
+    if (rise !is 0) {
+        if (buffer.length > startLength) buffer ~= ", ";
+        buffer ~= "rise=";
+        buffer ~= to!(String)(rise);
+    }
+    if (metrics !is null) {
+        if (buffer.length > startLength) buffer ~= ", ";
+        buffer ~= "metrics=";
+        buffer ~= metrics.toString;
+    }
+    buffer ~= "}";
+    return buffer;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/Transform.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,395 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.graphics.Transform;
+
+import java.lang.all;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.Compatibility;
+import org.eclipse.swt.internal.cairo.Cairo;
+import org.eclipse.swt.graphics.Resource;
+import org.eclipse.swt.graphics.Device;
+
+import tango.text.convert.Format;
+
+/**
+ * Instances of this class represent transformation matrices for
+ * points expressed as (x, y) pairs of floating point numbers.
+ * <p>
+ * Application code must explicitly invoke the <code>Transform.dispose()</code>
+ * method to release the operating system resources managed by each instance
+ * when those instances are no longer required.
+ * </p>
+ * <p>
+ * This class requires the operating system's advanced graphics subsystem
+ * which may not be available on some platforms.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: GraphicsExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ * 
+ * @since 3.1
+ */
+public class Transform : Resource {
+    /**
+     * the OS resource for the Transform
+     * (Warning: This field is platform dependent)
+     * <p>
+     * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+     * public API. It is marked 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 accessed from application code.
+     * </p>
+     */
+    public double[] handle;
+
+/**
+ * Constructs a new identity Transform.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param device the device on which to allocate the Transform
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES if a handle for the Transform could not be obtained</li>
+ * </ul>
+ *
+ * @see #dispose()
+ */
+public this (Device device) {
+    this(device, 1, 0, 0, 1, 0, 0);
+}
+
+/**
+ * Constructs a new Transform given an array of elements that represent the
+ * matrix that describes the transformation.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param device the device on which to allocate the Transform
+ * @param elements an array of floats that describe the transformation matrix
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device, or the elements array is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the elements array is too small to hold the matrix values</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES if a handle for the Transform could not be obtained</li>
+ * </ul>
+ *
+ * @see #dispose()
+ */
+public this(Device device, float[] elements) {
+    this (device, checkTransform(elements)[0], elements[1], elements[2], elements[3], elements[4], elements[5]);
+}
+
+/**
+ * Constructs a new Transform given all of the elements that represent the
+ * matrix that describes the transformation.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param device the device on which to allocate the Transform
+ * @param m11 the first element of the first row of the matrix
+ * @param m12 the second element of the first row of the matrix
+ * @param m21 the first element of the second row of the matrix
+ * @param m22 the second element of the second row of the matrix
+ * @param dx the third element of the first row of the matrix
+ * @param dy the third element of the second row of the matrix
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES if a handle for the Transform could not be obtained</li>
+ * </ul>
+ *
+ * @see #dispose()
+ */
+public this (Device device, float m11, float m12, float m21, float m22, float dx, float dy) {
+    super(device);
+    this.device.checkCairo();
+    handle = new double[6];
+    if (handle is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    Cairo.cairo_matrix_init( cast(cairo_matrix_t*)handle.ptr, m11, m12, m21, m22, dx, dy);
+    init_();
+}
+
+static float[] checkTransform(float[] elements) {
+    if (elements is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (elements.length < 6) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    return elements;
+}
+
+void destroy() {
+    handle = null;
+}
+
+/**
+ * Fills the parameter with the values of the transformation matrix
+ * that the receiver represents, in the order {m11, m12, m21, m22, dx, dy}.
+ *
+ * @param elements array to hold the matrix values
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parameter is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the parameter is too small to hold the matrix values</li>
+ * </ul>
+ */
+public void getElements(float[] elements) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (elements is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (elements.length < 6) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    elements[0] = cast(float)handle[0];
+    elements[1] = cast(float)handle[1];
+    elements[2] = cast(float)handle[2];
+    elements[3] = cast(float)handle[3];
+    elements[4] = cast(float)handle[4];
+    elements[5] = cast(float)handle[5];
+}
+
+/**
+ * Modifies the receiver such that the matrix it represents becomes the
+ * identity matrix. 
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ * 
+ * @since 3.4
+ */
+public void identity() {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    Cairo.cairo_matrix_init(cast(cairo_matrix_t*)handle.ptr, 1, 0, 0, 1, 0, 0);
+}
+
+/**
+ * Modifies the receiver such that the matrix it represents becomes
+ * the mathematical inverse of the matrix it previously represented.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_CANNOT_INVERT_MATRIX - if the matrix is not invertible</li>
+ * </ul>
+ */
+public void invert() {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (Cairo.cairo_matrix_invert(cast(cairo_matrix_t*)handle.ptr) !is 0) {
+        SWT.error(SWT.ERROR_CANNOT_INVERT_MATRIX);
+    }
+}
+
+/**
+ * Returns <code>true</code> if the Transform has been disposed,
+ * and <code>false</code> otherwise.
+ * <p>
+ * This method gets the dispose state for the Transform.
+ * When a Transform has been disposed, it is an error to
+ * invoke any other method using the Transform.
+ *
+ * @return <code>true</code> when the Transform is disposed, and <code>false</code> otherwise
+ */
+public override bool isDisposed() {
+    return handle is null;
+}
+
+/**
+ * Returns <code>true</code> if the Transform represents the identity matrix
+ * and false otherwise.
+ *
+ * @return <code>true</code> if the receiver is an identity Transform, and <code>false</code> otherwise
+ */
+public bool isIdentity() {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    float[] m  = new float[6];
+    getElements(m);
+    return m[0] is 1 && m[1] is 0 && m[2] is 0 && m[3] is 1 && m[4] is 0 && m[5] is 0;
+}
+
+/**
+ * Modifies the receiver such that the matrix it represents becomes the
+ * the result of multiplying the matrix it previously represented by the
+ * argument.
+ *
+ * @param matrix the matrix to multiply the receiver by
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parameter is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the parameter has been disposed</li>
+ * </ul>
+ */
+public void multiply(Transform matrix) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (matrix is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (matrix.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    Cairo.cairo_matrix_multiply(cast(cairo_matrix_t*)handle.ptr,cast(cairo_matrix_t*)matrix.handle.ptr, cast(cairo_matrix_t*)handle.ptr);
+}
+
+/**
+ * Modifies the receiver so that it represents a transformation that is
+ * equivalent to its previous transformation rotated by the specified angle.
+ * The angle is specified in degrees and for the identity transform 0 degrees
+ * is at the 3 o'clock position. A positive value indicates a clockwise rotation
+ * while a negative value indicates a counter-clockwise rotation.
+ *
+ * @param angle the angle to rotate the transformation by
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void rotate(float angle) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    Cairo.cairo_matrix_rotate(cast(cairo_matrix_t*)handle.ptr, angle * cast(float)Compatibility.PI / 180);
+}
+
+/**
+ * Modifies the receiver so that it represents a transformation that is
+ * equivalent to its previous transformation scaled by (scaleX, scaleY).
+ *
+ * @param scaleX the amount to scale in the X direction
+ * @param scaleY the amount to scale in the Y direction
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void scale(float scaleX, float scaleY) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    Cairo.cairo_matrix_scale(cast(cairo_matrix_t*)handle.ptr, scaleX, scaleY);
+}
+
+/**
+ * Modifies the receiver to represent a new transformation given all of
+ * the elements that represent the matrix that describes that transformation.
+ *
+ * @param m11 the first element of the first row of the matrix
+ * @param m12 the second element of the first row of the matrix
+ * @param m21 the first element of the second row of the matrix
+ * @param m22 the second element of the second row of the matrix
+ * @param dx the third element of the first row of the matrix
+ * @param dy the third element of the second row of the matrix
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setElements(float m11, float m12, float m21, float m22, float dx, float dy) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    Cairo.cairo_matrix_init(cast(cairo_matrix_t*)handle.ptr, m11, m12, m21, m22, dx, dy);
+}
+
+/**
+ * Modifies the receiver so that it represents a transformation that is
+ * equivalent to its previous transformation sheared by (shearX, shearY).
+ * 
+ * @param shearX the shear factor in the X direction
+ * @param shearY the shear factor in the Y direction
+ * 
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ * 
+ * @since 3.4
+ */
+public void shear(float shearX, float shearY) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    double[] matrix = [ 1.0, shearX, shearY, 1, 0, 0];
+    Cairo.cairo_matrix_multiply(cast(cairo_matrix_t*)handle.ptr, cast(cairo_matrix_t*)matrix.ptr, cast(cairo_matrix_t*)handle.ptr);
+}
+
+/**
+ * Given an array containing points described by alternating x and y values,
+ * modify that array such that each point has been replaced with the result of
+ * applying the transformation represented by the receiver to that point.
+ *
+ * @param pointArray an array of alternating x and y values to be transformed
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the point array is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void transform(float[] pointArray) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    if (pointArray is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    double dx, dy;
+    int length = pointArray.length / 2;
+    for (int i = 0, j = 0; i < length; i++, j += 2) {
+        dx = pointArray[j];
+        dy = pointArray[j + 1];
+        Cairo.cairo_matrix_transform_point(cast(cairo_matrix_t*)handle.ptr, &dx, &dy);
+        pointArray[j] = cast(float)dx;
+        pointArray[j + 1] = cast(float)dy;
+    }
+}
+
+/**
+ * Modifies the receiver so that it represents a transformation that is
+ * equivalent to its previous transformation translated by (offsetX, offsetY).
+ *
+ * @param offsetX the distance to translate in the X direction
+ * @param offsetY the distance to translate in the Y direction
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void translate(float offsetX, float offsetY) {
+    if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+    Cairo.cairo_matrix_translate(cast(cairo_matrix_t*)handle.ptr, offsetX, offsetY);
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the receiver
+ */
+public override String toString() {
+    if (isDisposed()) return "Transform {*DISPOSED*}";
+    float[] elements = new float[6];
+    getElements(elements);
+    return Format( "Transform {{{}}", elements );
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/graphics/all.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,36 @@
+module org.eclipse.swt.graphics.all;
+
+import java.lang.all;
+
+public import org.eclipse.swt.graphics.Color;
+public import org.eclipse.swt.graphics.Cursor;
+public import org.eclipse.swt.graphics.Device;
+public import org.eclipse.swt.graphics.DeviceData;
+public import org.eclipse.swt.graphics.Drawable;
+public import org.eclipse.swt.graphics.Font;
+public import org.eclipse.swt.graphics.FontData;
+public import org.eclipse.swt.graphics.FontMetrics;
+public import org.eclipse.swt.graphics.GC;
+public import org.eclipse.swt.graphics.GCData;
+public import org.eclipse.swt.graphics.GlyphMetrics;
+public import org.eclipse.swt.graphics.Image;
+public import org.eclipse.swt.graphics.ImageData;
+public import org.eclipse.swt.graphics.ImageDataLoader;
+public import org.eclipse.swt.graphics.ImageLoader;
+public import org.eclipse.swt.graphics.ImageLoaderEvent;
+public import org.eclipse.swt.graphics.ImageLoaderListener;
+public import org.eclipse.swt.graphics.LineAttributes;
+public import org.eclipse.swt.graphics.PaletteData;
+public import org.eclipse.swt.graphics.Path;
+public import org.eclipse.swt.graphics.PathData;
+public import org.eclipse.swt.graphics.Pattern;
+public import org.eclipse.swt.graphics.Point;
+public import org.eclipse.swt.graphics.RGB;
+public import org.eclipse.swt.graphics.Rectangle;
+public import org.eclipse.swt.graphics.Region;
+public import org.eclipse.swt.graphics.Resource;
+public import org.eclipse.swt.graphics.TextLayout;
+public import org.eclipse.swt.graphics.TextStyle;
+public import org.eclipse.swt.graphics.Transform;
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/BidiUtil.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.BidiUtil;
+
+import java.lang.all;
+
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.internal.gtk.OS;
+
+/*
+ * This class is supplied so that the StyledText code that supports bidi text (supported
+ * for win platforms) is not platform dependent.  Bidi text is not implemented on
+ * emulated platforms.
+ */
+public class BidiUtil {
+    // Keyboard language types
+    public static const int KEYBOARD_NON_BIDI = 0;
+    public static const int KEYBOARD_BIDI = 1;
+
+    // bidi rendering input flag constants, not used
+    // on emulated platforms
+    public static const int CLASSIN = 1;
+    public static const int LINKBEFORE = 2;
+    public static const int LINKAFTER = 4;
+
+    // bidi rendering/ordering constants, not used on
+    // emulated platforms
+    public static const int CLASS_HEBREW = 2;
+    public static const int CLASS_ARABIC = 2;
+    public static const int CLASS_LOCALNUMBER = 4;
+    public static const int CLASS_LATINNUMBER = 5;
+    public static const int REORDER = 0;
+    public static const int LIGATE = 0;
+    public static const int GLYPHSHAPE = 0;
+
+/*
+ * Not implemented.
+ */
+public static void addLanguageListener(GtkWidget* hwnd, Runnable runnable) {
+}
+public static void addLanguageListener (Control control, Runnable runnable) {
+}
+/*
+ * Not implemented.
+ *
+ */
+public static void drawGlyphs(GC gc, char[] renderBuffer, int[] renderDx, int x, int y) {
+}
+/*
+ * Bidi not supported on emulated platforms.
+ *
+ */
+public static bool isBidiPlatform() {
+    return false;
+}
+/*
+ * Not implemented.
+ */
+public static bool isKeyboardBidi() {
+    return false;
+}
+/*
+ * Not implemented.
+ */
+public static int getFontBidiAttributes(GC gc) {
+    return 0;
+}
+/*
+ *  Not implemented.
+ *
+ */
+public static void getOrderInfo(GC gc, String text, int[] order, byte[] classBuffer, int flags, int [] offsets) {
+}
+/*
+ *  Not implemented. Returns null.
+ *
+ */
+public static char[] getRenderInfo(GC gc, String text, int[] order, byte[] classBuffer, int[] dx, int flags, int[] offsets) {
+    return null;
+}
+/*
+ * Not implemented. Returns 0.
+ */
+public static int getKeyboardLanguage() {
+    return 0;
+}
+/*
+ * Not implemented.
+ */
+public static void removeLanguageListener(GtkWidget* hwnd) {
+}
+public static void removeLanguageListener (Control control) {
+}
+/*
+ * Not implemented.
+ */
+public static void setKeyboardLanguage(int language) {
+}
+/*
+ * Not implemented.
+ */
+public static bool setOrientation(GtkWidget* hwnd, int orientation) {
+    return false;
+}
+public static bool setOrientation (Control control, int orientation) {
+    return false;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/CloneableCompatibility.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.CloneableCompatibility;
+
+import java.lang.all;
+
+/**
+ * This interface is the cross-platform version of the
+ * java.lang.Cloneable interface.
+ * <p>
+ * It is part of our effort to provide support for both J2SE
+ * and J2ME platforms. Under this scheme, classes need to
+ * implement CloneableCompatibility instead of java.lang.Cloneable.
+ * </p>
+ * <p>
+ * Note: java.lang.Cloneable is not part of CLDC.
+ * </p>
+ */
+public interface CloneableCompatibility : Cloneable {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/Compatibility.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,418 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.Compatibility;
+
+import java.lang.all;
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.InputStream;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.text.MessageFormat;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+import java.util.zip.InflaterInputStream;
+//import java.util.zip.DeflaterOutputStream;
+
+import org.eclipse.swt.SWT;
+
+import Unicode = tango.text.Unicode;
+import tango.sys.Process;
+import tango.text.convert.Format;
+
+/**
+ * This class is a placeholder for utility methods commonly
+ * used on J2SE platforms but not supported on some J2ME
+ * profiles.
+ * <p>
+ * It is part of our effort to provide support for both J2SE
+ * and J2ME platforms.
+ * </p>
+ * <p>
+ * IMPORTANT: some of the methods have been modified from their
+ * J2SE parents. Refer to the description of each method for
+ * specific changes.
+ * </p>
+ * <ul>
+ * <li>Exceptions thrown may differ since J2ME's set of
+ * exceptions is a subset of J2SE's one.
+ * </li>
+ * <li>The range of the mathematic functions is subject to
+ * change.
+ * </li>
+ * </ul>
+ */
+public final class Compatibility {
+
+/**
+ * Returns the PI constant as a double.
+ */
+public static const real PI = Math.PI;
+
+static const real toRadians = PI / 180;
+
+/**
+ * Answers the length of the side adjacent to the given angle
+ * of a right triangle. In other words, it returns the integer
+ * conversion of length * cos (angle).
+ * <p>
+ * IMPORTANT: the j2me version has an additional restriction on
+ * the argument. length must be between -32767 and 32767 (inclusive).
+ * </p>
+ *
+ * @param angle the angle in degrees
+ * @param length the length of the triangle's hypotenuse
+ * @return the integer conversion of length * cos (angle)
+ */
+public static int cos(int angle, int length) {
+    return cast(int)(Math.cos(angle * toRadians) * length);
+}
+
+/**
+ * Answers the length of the side opposite to the given angle
+ * of a right triangle. In other words, it returns the integer
+ * conversion of length * sin (angle).
+ * <p>
+ * IMPORTANT: the j2me version has an additional restriction on
+ * the argument. length must be between -32767 and 32767 (inclusive).
+ * </p>
+ *
+ * @param angle the angle in degrees
+ * @param length the length of the triangle's hypotenuse
+ * @return the integer conversion of length * sin (angle)
+ */
+public static int sin(int angle, int length) {
+    return cast(int)(Math.sin(angle * toRadians) * length);
+}
+
+/**
+ * Answers the most negative (i.e. closest to negative infinity)
+ * integer value which is greater than the number obtained by dividing
+ * the first argument p by the second argument q.
+ *
+ * @param p numerator
+ * @param q denominator (must be different from zero)
+ * @return the ceiling of the rational number p / q.
+ */
+public static int ceil(int p, int q) {
+    return cast(int)Math.ceil(cast(float)p / q);
+}
+
+/**
+ * Answers whether the indicated file exists or not.
+ *
+ * @param parent the file's parent directory
+ * @param child the file's name
+ * @return true if the file exists
+ */
+public static bool fileExists(String parent, String child) {
+    return (new File (parent, child)).exists();
+}
+
+/**
+ * Answers the most positive (i.e. closest to positive infinity)
+ * integer value which is less than the number obtained by dividing
+ * the first argument p by the second argument q.
+ *
+ * @param p numerator
+ * @param q denominator (must be different from zero)
+ * @return the floor of the rational number p / q.
+ */
+public static int floor(int p, int q) {
+    return cast(int)Math.floor(cast(double)p / q);
+}
+
+/**
+ * Answers the result of rounding to the closest integer the number obtained
+ * by dividing the first argument p by the second argument q.
+ * <p>
+ * IMPORTANT: the j2me version has an additional restriction on
+ * the arguments. p must be within the range 0 - 32767 (inclusive).
+ * q must be within the range 1 - 32767 (inclusive).
+ * </p>
+ *
+ * @param p numerator
+ * @param q denominator (must be different from zero)
+ * @return the closest integer to the rational number p / q
+ */
+public static int round(int p, int q) {
+    return cast(int)Math.round(cast(float)p / q);
+}
+
+/**
+ * Returns 2 raised to the power of the argument.
+ *
+ * @param n an int value between 0 and 30 (inclusive)
+ * @return 2 raised to the power of the argument
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the argument is not between 0 and 30 (inclusive)</li>
+ * </ul>
+ */
+public static int pow2(int n) {
+    if (n >= 1 && n <= 30)
+        return 2 << (n - 1);
+    else if (n != 0) {
+        SWT.error(SWT.ERROR_INVALID_RANGE);
+    }
+    return 1;
+}
+
+/**
+ * Create an DeflaterOutputStream if such things are supported.
+ *
+ * @param stream the output stream
+ * @return a deflater stream or <code>null</code>
+ * @exception IOException
+ *
+ * @since 3.4
+ */
+public static OutputStream newDeflaterOutputStream(OutputStream stream) {
+    implMissing(__FILE__,__LINE__);
+    return null;
+    //DWT_TODO return new DeflaterOutputStream(stream);
+}
+
+/**
+ * Open a file if such things are supported.
+ *
+ * @param filename the name of the file to open
+ * @return a stream on the file if it could be opened.
+ * @exception IOException
+ */
+public static InputStream newFileInputStream(String filename) {
+    return new FileInputStream(filename);
+}
+
+/**
+ * Open a file if such things are supported.
+ *
+ * @param filename the name of the file to open
+ * @return a stream on the file if it could be opened.
+ * @exception IOException
+ */
+public static OutputStream newFileOutputStream(String filename) {
+    return new FileOutputStream(filename);
+}
+
+/**
+ * Create an InflaterInputStream if such things are supported.
+ *
+ * @param stream the input stream
+ * @return a inflater stream or <code>null</code>
+ * @exception IOException
+ *
+ * @since 3.3
+ */
+public static InflaterInputStream newInflaterInputStream(InputStream stream) {
+    return new InflaterInputStream(stream);
+}
+
+/**
+ * Answers whether the character is a letter.
+ *
+ * @param c the character
+ * @return true when the character is a letter
+ */
+public static bool isLetter(dchar c) {
+    return Unicode.isLetter(c);
+}
+
+/**
+ * Answers whether the character is a letter or a digit.
+ *
+ * @param c the character
+ * @return true when the character is a letter or a digit
+ */
+public static bool isLetterOrDigit(dchar c) {
+    return Unicode.isLetterOrDigit(c);
+}
+
+/**
+ * Answers whether the character is a Unicode space character.
+ *
+ * @param c  the character
+ * @return true when the character is a Unicode space character
+ */
+public static bool isSpaceChar(dchar c) {
+    return Unicode.isSpace(c);
+}
+
+/**
+ * Answers whether the character is a whitespace character.
+ *
+ * @param c the character to test
+ * @return true if the character is whitespace
+ */
+public static bool isWhitespace(dchar c) {
+    return Unicode.isWhitespace(c);
+}
+
+/**
+ * Execute a program in a separate platform process if the
+ * underlying platform support this.
+ * <p>
+ * The new process inherits the environment of the caller.
+ * </p>
+ *
+ * @param prog the name of the program to execute
+ *
+ * @exception ProcessException
+ *  if the program cannot be executed
+ */
+public static void exec(String prog) {
+    auto proc = new Process( prog );
+    proc.execute;
+}
+
+/**
+ * Execute progArray[0] in a separate platform process if the
+ * underlying platform support this.
+ * <p>
+ * The new process inherits the environment of the caller.
+ * <p>
+ *
+ * @param progArray array containing the program to execute and its arguments
+ *
+ * @exception ProcessException
+ *  if the program cannot be executed
+ */
+public static void exec(String[] progArray) {
+    auto proc = new Process( progArray );
+    proc.execute;
+}
+
+const ImportData[] SWTMessagesBundleData = [
+    getImportData!( "org.eclipse.swt.internal.SWTMessages.properties" ),
+    getImportData!( "org.eclipse.swt.internal.SWTMessages_ar.properties" ),
+    getImportData!( "org.eclipse.swt.internal.SWTMessages_cs.properties" ),
+    getImportData!( "org.eclipse.swt.internal.SWTMessages_da.properties" ),
+    getImportData!( "org.eclipse.swt.internal.SWTMessages_de.properties" ),
+    getImportData!( "org.eclipse.swt.internal.SWTMessages_el.properties" ),
+    getImportData!( "org.eclipse.swt.internal.SWTMessages_es.properties" ),
+    getImportData!( "org.eclipse.swt.internal.SWTMessages_fi.properties" ),
+    getImportData!( "org.eclipse.swt.internal.SWTMessages_fr.properties" ),
+    getImportData!( "org.eclipse.swt.internal.SWTMessages_hu.properties" ),
+    getImportData!( "org.eclipse.swt.internal.SWTMessages_it.properties" ),
+    getImportData!( "org.eclipse.swt.internal.SWTMessages_iw.properties" ),
+    getImportData!( "org.eclipse.swt.internal.SWTMessages_ja.properties" ),
+    getImportData!( "org.eclipse.swt.internal.SWTMessages_ko.properties" ),
+    getImportData!( "org.eclipse.swt.internal.SWTMessages_nl.properties" ),
+    getImportData!( "org.eclipse.swt.internal.SWTMessages_no.properties" ),
+    getImportData!( "org.eclipse.swt.internal.SWTMessages_pl.properties" ),
+    getImportData!( "org.eclipse.swt.internal.SWTMessages_pt_BR.properties" ),
+    getImportData!( "org.eclipse.swt.internal.SWTMessages_pt.properties" ),
+    getImportData!( "org.eclipse.swt.internal.SWTMessages_ru.properties" ),
+    getImportData!( "org.eclipse.swt.internal.SWTMessages_sv.properties" ),
+    getImportData!( "org.eclipse.swt.internal.SWTMessages_tr.properties" ),
+    getImportData!( "org.eclipse.swt.internal.SWTMessages_zh_HK.properties" ),
+    getImportData!( "org.eclipse.swt.internal.SWTMessages_zh.properties" ),
+    getImportData!( "org.eclipse.swt.internal.SWTMessages_zh_TW.properties" )
+];
+
+private static ResourceBundle msgs = null;
+
+/**
+ * Returns the NLS'ed message for the given argument. This is only being
+ * called from SWT.
+ *
+ * @param key the key to look up
+ * @return the message for the given key
+ *
+ * @see SWT#getMessage(String)
+ */
+public static String getMessage(String key) {
+    String answer = key;
+
+    if (key is null) {
+        SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    }
+    if (msgs is null) {
+        try {
+            msgs = ResourceBundle.getBundle(SWTMessagesBundleData); //$NON-NLS-1$
+        } catch (MissingResourceException ex) {
+            answer = key ~ " (no resource bundle)"; //$NON-NLS-1$
+        }
+    }
+    if (msgs !is null) {
+        try {
+            answer = msgs.getString(key);
+        } catch (MissingResourceException ex2) {}
+    }
+    return answer;
+}
+
+public static String getMessage(String key, Object[] args) {
+    String answer = key;
+
+    if (key is null || args is null) {
+        SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    }
+    if (msgs is null) {
+        try {
+            msgs = ResourceBundle.getBundle(SWTMessagesBundleData); //$NON-NLS-1$
+        } catch (MissingResourceException ex) {
+            answer = key ~ " (no resource bundle)"; //$NON-NLS-1$
+        }
+    }
+    if (msgs !is null) {
+        try {
+            char[] frmt = msgs.getString(key);
+            switch( args.length ){
+            case 0: answer = Format(frmt); break;
+            case 1: answer = Format(frmt, args[0]); break;
+            case 2: answer = Format(frmt, args[0], args[1]); break;
+            case 3: answer = Format(frmt, args[0], args[1], args[2]); break;
+            case 4: answer = Format(frmt, args[0], args[1], args[2], args[3]); break;
+            case 5: answer = Format(frmt, args[0], args[1], args[2], args[3], args[4]); break;
+            default:
+                implMissing(__FILE__, __LINE__ );
+            }
+        } catch (MissingResourceException ex2) {}
+    }
+    return answer;
+}
+
+
+/**
+ * Interrupt the current thread.
+ * <p>
+ * Note that this is not available on CLDC.
+ * </p>
+ */
+public static void interrupt() {
+    //PORTING_FIXME: how to implement??
+    //Thread.currentThread().interrupt();
+}
+
+/**
+ * Compares two instances of class String ignoring the case of the
+ * characters and answers if they are equal.
+ *
+ * @param s1 string
+ * @param s2 string
+ * @return true if the two instances of class String are equal
+ */
+public static bool equalsIgnoreCase(String s1, String s2) {
+    String s1b = new char[ s1.length ];
+    String s2b = new char[ s1.length ];
+    scope(exit){
+        delete s1b;
+        delete s2b;
+    }
+    String s1c = Unicode.toFold( s1, s1b );
+    String s2c = Unicode.toFold( s2, s2b );
+    return s1c == s2c;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/Converter.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.Converter;
+
+import java.lang.all;
+
+extern(C) {
+    struct GError{};
+    char*     g_utf16_to_utf8     ( wchar  *str,
+                    int             len,
+                    int             *items_read,
+                    int             *items_written,
+                    GError          **error);
+    wchar* g_utf8_to_utf16     ( char      *str,
+                    int              len,
+                    int             *items_read,
+                    int             *items_written,
+                    GError          **error);
+    void g_free (void* ptr );
+}
+
+/**
+ * This class implements the conversions between unicode characters
+ * and the <em>platform supported</em> representation for characters.
+ * <p>
+ * Note that, unicode characters which can not be found in the platform
+ * encoding will be converted to an arbitrary platform specific character.
+ * </p>
+ */
+public final class Converter {
+    public static const char  [] NullByteArray = "\0";
+    public static const char  [] EmptyByteArray = "";
+    public static const wchar [] EmptyCharArray = "";
+
+/**
+ * Returns the default code page for the platform where the
+ * application is currently running.
+ *
+ * @return the default code page
+ */
+public static String defaultCodePage () {
+    return "UTF8";
+}
+
+public static wchar [] mbcsToWcs (String codePage, char [] buffer) {
+    int items_written;
+    wchar* ptr = g_utf8_to_utf16 (toStringz(buffer), buffer.length, null, &items_written, null);
+    if (!ptr){
+        return EmptyCharArray;
+    }
+    wchar[] chars = ptr[ 0 .. items_written].dup;
+    g_free (ptr);
+    return chars;
+}
+
+/+ // only difference with String vs. String arg, so no diff in org.eclipse.swt
+public static char [] wcsToMbcs (String codePage, String str, bool terminate) {
+    int length = str.length ();
+    wchar [] buffer = new wchar [length];
+    string.getChars (0, length, buffer, 0);
+    return wcsToMbcs (codePage, buffer, terminate);
+}
++/
+
+public static char [] wcsToMbcs (String codePage, wchar [] buffer, bool terminate) {
+    int items_read, items_written;
+    /*
+    * Note that g_utf16_to_utf8()  stops converting
+    * when it finds the first NULL.
+    */
+    char* ptr = g_utf16_to_utf8 (toString16z(buffer), buffer.length, & items_read, & items_written, null);
+    if (!ptr) {
+        return terminate ? NullByteArray : EmptyByteArray;
+    }
+    char [] bytes = new char [items_written + (terminate ? 1 : 0)];
+    bytes[ 0 .. items_written ] = ptr[ 0 .. items_written ];
+    if( terminate ){
+        bytes[ items_written ] = 0;
+    }
+    g_free (ptr);
+    return bytes;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/LONG.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.LONG;
+
+import java.lang.all;
+
+alias Integer LONG;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/Library.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,251 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.Library;
+
+import java.lang.all;
+
+import tango.util.Convert;
+
+// do it here, so it can be evaluated at compile time
+// this saves a static ctor.
+private int buildSWT_VERSION (int major, int minor) {
+    return major * 1000 + minor;
+}
+
+
+public class Library {
+
+    /* SWT Version - Mmmm (M=major, mmm=minor) */
+
+    /**
+     * SWT Major version number (must be >= 0)
+     */
+    static const int MAJOR_VERSION = 3;
+
+    /**
+     * SWT Minor version number (must be in the range 0..999)
+     */
+    static const int MINOR_VERSION = 449;
+
+    /**
+     * SWT revision number (must be >= 0)
+     */
+    static const int REVISION = 0;
+
+    /**
+     * The JAVA and SWT versions
+     */
+    //public static const int JAVA_VERSION;
+    public static const int SWT_VERSION = .buildSWT_VERSION(MAJOR_VERSION, MINOR_VERSION);
+
+    version( linux ){
+        static const String SEPARATOR = "\n";
+    }
+    else {
+        static assert( false, "only linux supported for this port" );
+    }
+
+
+static int parseVersion(String aVersion) {
+    if (aVersion == null) return 0;
+    int major = 0, minor = 0, micro = 0;
+    int length = aVersion.length, index = 0, start = 0;
+    bool isDigit( char c ){
+        return c >= '0' && c <= '9';
+    }
+    while (index < length && isDigit(aVersion[index])) index++;
+    try {
+        if (start < length) major = to!(int)( aVersion[start .. index] );
+    } catch (ConversionException e) {}
+    start = ++index;
+    while (index < length && isDigit(aVersion[index])) index++;
+    try {
+        if (start < length) minor = to!(int)(aVersion[start .. index]);
+    } catch (ConversionException e) {}
+    start = ++index;
+    while (index < length && isDigit(aVersion[index])) index++;
+    try {
+        if (start < length) micro = to!(int)(aVersion[start .. index]);
+    } catch (ConversionException e) {}
+    return buildJAVA_VERSION(major, minor, micro);
+}
+
+/**
+ * Returns the Java version number as an integer.
+ *
+ * @param major
+ * @param minor
+ * @param micro
+ * @return the version
+ */
+public static int buildJAVA_VERSION (int major, int minor, int micro) {
+    return (major << 16) + (minor << 8) + micro;
+}
+
+/**
+ * Returns the SWT version number as an integer.
+ *
+ * @param major
+ * @param minor
+ * @return the version
+ */
+public static int buildSWT_VERSION (int major, int minor) {
+    return .buildSWT_VERSION(major, minor);
+}
+/+ PORTING_LEFT
+static bool extract (String fileName, String mappedName) {
+    FileOutputStream os = null;
+    InputStream is = null;
+    File file = new File(fileName);
+    try {
+        if (!file.exists ()) {
+            is = Library.class.getResourceAsStream ("/" + mappedName); //$NON-NLS-1$
+            if (is != null) {
+                int read;
+                byte [] buffer = new byte [4096];
+                os = new FileOutputStream (fileName);
+                while ((read = is.read (buffer)) != -1) {
+                    os.write(buffer, 0, read);
+                }
+                os.close ();
+                is.close ();
+                if (!Platform.PLATFORM.equals ("win32")) { //$NON-NLS-1$
+                    try {
+                        Runtime.getRuntime ().exec (new String []{"chmod", "755", fileName}).waitFor(); //$NON-NLS-1$ //$NON-NLS-2$
+                    } catch (Throwable e) {}
+                }
+                if (load (fileName)) return true;
+            }
+        }
+    } catch (Throwable e) {
+        try {
+            if (os != null) os.close ();
+        } catch (IOException e1) {}
+        try {
+            if (is != null) is.close ();
+        } catch (IOException e1) {}
+    }
+    if (file.exists ()) file.delete ();
+    return false;
+}
+
+static bool load (String libName) {
+    try {
+        if (libName.indexOf (SEPARATOR) != -1) {
+            System.load (libName);
+        } else {
+            System.loadLibrary (libName);
+        }
+        return true;
+    } catch (UnsatisfiedLinkError e) {}
+    return false;
+}
+
+/**
+ * Loads the shared library that matches the version of the
+ * Java code which is currently running.  SWT shared libraries
+ * follow an encoding scheme where the major, minor and revision
+ * numbers are embedded in the library name and this along with
+ * <code>name</code> is used to load the library.  If this fails,
+ * <code>name</code> is used in another attempt to load the library,
+ * this time ignoring the SWT version encoding scheme.
+ *
+ * @param name the name of the library to load
+ */
+public static void loadLibrary (String name) {
+    loadLibrary (name, true);
+}
+
+/**
+ * Loads the shared library that matches the version of the
+ * Java code which is currently running.  SWT shared libraries
+ * follow an encoding scheme where the major, minor and revision
+ * numbers are embedded in the library name and this along with
+ * <code>name</code> is used to load the library.  If this fails,
+ * <code>name</code> is used in another attempt to load the library,
+ * this time ignoring the SWT version encoding scheme.
+ *
+ * @param name the name of the library to load
+ * @param mapName true if the name should be mapped, false otherwise
+ */
+public static void loadLibrary (String name, boolean mapName) {
+    String prop = System.getProperty ("sun.arch.data.model"); //$NON-NLS-1$
+    if (prop is null) prop = System.getProperty ("com.ibm.vm.bitmode"); //$NON-NLS-1$
+    if (prop !is null) {
+        if ("32".equals (prop)) { //$NON-NLS-1$
+             if (0x1FFFFFFFFL is (int /*long*/)0x1FFFFFFFFL) {
+                throw new UnsatisfiedLinkError ("Cannot load 64-bit SWT libraries on 32-bit JVM"); //$NON-NLS-1$
+             }
+        }
+        if ("64".equals (prop)) { //$NON-NLS-1$
+            if (0x1FFFFFFFFL !is (int /*long*/)0x1FFFFFFFFL) {
+                throw new UnsatisfiedLinkError ("Cannot load 32-bit SWT libraries on 64-bit JVM"); //$NON-NLS-1$
+            }       
+        }
+    }
+
+    /* Compute the library name and mapped name */
+    String libName1, libName2, mappedName1, mappedName2;
+    if (mapName) {
+        String version = System.getProperty ("swt.version"); //$NON-NLS-1$
+        if (version == null) {
+            version = "" + MAJOR_VERSION; //$NON-NLS-1$
+            /* Force 3 digits in minor version number */
+            if (MINOR_VERSION < 10) {
+                version += "00"; //$NON-NLS-1$
+            } else {
+                if (MINOR_VERSION < 100) version += "0"; //$NON-NLS-1$
+            }
+            version += MINOR_VERSION;
+            /* No "r" until first revision */
+            if (REVISION > 0) version += "r" + REVISION; //$NON-NLS-1$
+        }
+        libName1 = name + "-" + Platform.PLATFORM + "-" + version;  //$NON-NLS-1$ //$NON-NLS-2$
+        libName2 = name + "-" + Platform.PLATFORM;  //$NON-NLS-1$
+        mappedName1 = System.mapLibraryName (libName1);
+        mappedName2 = System.mapLibraryName (libName2);
+    } else {
+        libName1 = libName2 = mappedName1 = mappedName2 = name;
+    }
+
+    /* Try loading library from swt library path */
+    String path = System.getProperty ("swt.library.path"); //$NON-NLS-1$
+    if (path != null) {
+        path = new File (path).getAbsolutePath ();
+        if (load (path + SEPARATOR + mappedName1)) return;
+        if (mapName && load (path + SEPARATOR + mappedName2)) return;
+    }
+
+    /* Try loading library from java library path */
+    if (load (libName1)) return;
+    if (mapName && load (libName2)) return;
+
+    /* Try loading library from the tmp directory if swt library path is not specified */
+    if (path == null) {
+        path = System.getProperty ("java.io.tmpdir"); //$NON-NLS-1$
+        path = new File (path).getAbsolutePath ();
+        if (load (path + SEPARATOR + mappedName1)) return;
+        if (mapName && load (path + SEPARATOR + mappedName2)) return;
+    }
+
+    /* Try extracting and loading library from jar */
+    if (path != null) {
+        if (extract (path + SEPARATOR + mappedName1, mappedName1)) return;
+        if (mapName && extract (path + SEPARATOR + mappedName2, mappedName2)) return;
+    }
+
+    /* Failed to find the library */
+    throw new UnsatisfiedLinkError ("no " + libName1 + " or " + libName2 + " in swt.library.path, java.library.path or the jar file"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+}
++/
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/Lock.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.Lock;
+
+import java.lang.all;
+
+import tango.core.Thread;
+import tango.core.sync.Mutex;
+import tango.core.sync.Condition;
+
+/**
+ * Instance of this represent a recursive monitor.
+ */
+public class Lock {
+    int count, waitCount;
+    Thread owner;
+    Mutex mutex;
+    Condition cond;
+
+    public this() {
+        mutex = new Mutex;
+        cond = new Condition(mutex);
+    }
+/**
+ * Locks the monitor and returns the lock count. If
+ * the lock is owned by another thread, wait until
+ * the lock is released.
+ *
+ * @return the lock count
+ */
+public int lock() {
+    synchronized (mutex) {
+        Thread current = Thread.getThis();
+        if (owner !is current) {
+            waitCount++;
+            while (count > 0) {
+                try {
+                    cond.wait();
+                } catch (SyncException e) {
+                    /* Wait forever, just like synchronized blocks */
+                }
+            }
+            --waitCount;
+            owner = current;
+        }
+        return ++count;
+    }
+}
+
+/**
+ * Unlocks the monitor. If the current thread is not
+ * the monitor owner, do nothing.
+ */
+public void unlock() {
+    synchronized (mutex) {
+        Thread current = Thread.getThis();
+        if (owner is current) {
+            if (--count is 0) {
+                owner = null;
+                if (waitCount > 0) cond.notifyAll();
+            }
+        }
+    }
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/Platform.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others. All rights reserved.
+ * The contents of this file are made available under the terms
+ * of the GNU Lesser General Public License (LGPL) Version 2.1 that
+ * accompanies this distribution (lgpl-v21.txt).  The LGPL is also
+ * available at http://www.gnu.org/licenses/lgpl.html.  If the version
+ * of the LGPL at http://www.gnu.org is different to the version of
+ * the LGPL accompanying this distribution and there is any conflict
+ * between the two license versions, the terms of the LGPL accompanying
+ * this distribution shall govern.
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.Platform;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.Lock;
+
+public class Platform {
+    public static const String PLATFORM = "gtk"; //$NON-NLS-1$
+    public static const Lock lock;
+    static this() {
+        lock = new Lock();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/SWTEventListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.SWTEventListener;
+
+import java.lang.all;
+import java.util.EventListener;
+
+
+/**
+ * This interface is the cross-platform version of the
+ * java.util.EventListener interface.
+ * <p>
+ * It is part of our effort to provide support for both J2SE
+ * and J2ME platforms. Under this scheme, classes need to
+ * implement SWTEventListener instead of java.util.EventListener.
+ * </p>
+ * <p>
+ * Note: java.util.EventListener is not part of CDC and CLDC.
+ * </p>
+ */
+public interface SWTEventListener : EventListener {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/SWTEventObject.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.SWTEventObject;
+
+
+import java.lang.all;
+import tango.core.Exception;
+import java.util.EventObject;
+
+/**
+ * This class is the cross-platform version of the
+ * java.util.EventObject class.
+ * <p>
+ * It is part of our effort to provide support for both J2SE
+ * and J2ME platforms. Under this scheme, classes need to
+ * extend SWTEventObject instead of java.util.EventObject.
+ * </p>
+ * <p>
+ * Note: java.util.EventObject is not part of CDC and CLDC.
+ * </p>
+ */
+public class SWTEventObject : EventObject {
+
+    //static final long serialVersionUID = 3258125873411470903L;
+
+/**
+ * Constructs a new instance of this class.
+ *
+ * @param source the object which fired the event
+ */
+public this(Object source) {
+    super(source);
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/SerializableCompatibility.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.SerializableCompatibility;
+
+import java.lang.all;
+
+
+//import java.io.Serializable;
+///PORTING_TYPE
+interface Serializable{}
+
+/**
+ * This interface is the cross-platform version of the
+ * java.io.Serializable interface.
+ * <p>
+ * It is part of our effort to provide support for both J2SE
+ * and J2ME platforms. Under this scheme, classes need to
+ * implement SerializableCompatibility instead of
+ * java.io.Serializable.
+ * </p>
+ * <p>
+ * Note: java.io.Serializable is not part of CLDC.
+ * </p>
+ */
+public interface SerializableCompatibility : Serializable {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/accessibility/gtk/ATK.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,183 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others. All rights reserved.
+ * The contents of this file are made available under the terms
+ * of the GNU Lesser General Public License (LGPL) Version 2.1 that
+ * accompanies this distribution (lgpl-v21.txt).  The LGPL is also
+ * available at http://www.gnu.org/licenses/lgpl.html.  If the version
+ * of the LGPL at http://www.gnu.org is different to the version of
+ * the LGPL accompanying this distribution and there is any conflict
+ * between the two license versions, the terms of the LGPL accompanying
+ * this distribution shall govern.
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.accessibility.gtk.ATK;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.internal.Library;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.internal.c.atk;
+import org.eclipse.swt.internal.c.gtk;
+
+import tango.core.Traits;
+
+alias org.eclipse.swt.internal.c.atk.AtkObjectFactory AtkObjectFactory;
+alias org.eclipse.swt.internal.c.atk.AtkObjectClass AtkObjectClass;
+alias org.eclipse.swt.internal.c.atk.AtkActionIface AtkActionIface;
+alias org.eclipse.swt.internal.c.atk.AtkComponentIface AtkComponentIface;
+alias org.eclipse.swt.internal.c.atk.AtkHypertextIface AtkHypertextIface;
+alias org.eclipse.swt.internal.c.atk.AtkSelectionIface AtkSelectionIface;
+alias org.eclipse.swt.internal.c.atk.AtkTextIface AtkTextIface;
+alias org.eclipse.swt.internal.c.atk.AtkObject AtkObject;
+alias org.eclipse.swt.internal.c.atk.AtkStateSet AtkStateSet;
+alias org.eclipse.swt.internal.c.atk.AtkObjectFactoryClass AtkObjectFactoryClass;
+alias org.eclipse.swt.internal.c.atk.AtkHyperlink AtkHyperlink;
+
+alias org.eclipse.swt.internal.c.gtk.GtkAccessible GtkAccessible;
+
+private AtkActionIface* ATK_ACTION_GET_IFACE( AtkObject* ){
+    return null;
+}
+private AtkComponentIface* ATK_COMPONENT_GET_IFACE( AtkObject* ){
+    return null;
+}
+private AtkObjectFactoryClass* ATK_OBJECT_FACTORY_CLASS( void* ){
+    return null;
+}
+private AtkSelectionIface* ATK_SELECTION_GET_IFACE( AtkObject* ){
+    return null;
+}
+private AtkTextIface* ATK_TEXT_GET_IFACE(AtkObject*){
+    return null;
+}
+private GtkAccessible* GTK_ACCESSIBLE(AtkObject*){
+    return null;
+}
+
+
+template NameOfFunc(alias f) {
+    // Note: highly dependent on the .stringof formatting
+    // the value begins with "& " which is why the first two chars are cut off
+    version( LDC ){
+        // stringof in LLVMDC is "&foobar"
+        const char[] NameOfFunc = (&f).stringof[1 .. $];
+    }
+    else{
+        // stringof in DMD is "& foobar"
+        const char[] NameOfFunc = (&f).stringof[2 .. $];
+    }
+}
+
+template ForwardGtkAtkCFunc( alias cFunc ) {
+    alias ParameterTupleOf!(cFunc) P;
+    alias ReturnTypeOf!(cFunc) R;
+    mixin("public static R " ~ NameOfFunc!(cFunc) ~ "( P p ){
+        lock.lock();
+        scope(exit) lock.unlock();
+        return cFunc(p);
+    }");
+}
+/+
+// alternative template implementation, might be more stable
+template ForwardGtkOsCFunc(String name) {
+  alias typeof(mixin(name)) func;
+  alias ParameterTupleOf!(func) Params;
+  alias ReturnTypeOf!(func) Ret;
+  mixin("public static Ret "~name~"( Params p ) {
+    return ."~name~"(p);
+  }");
+}
++/
+
+public class ATK : OS {
+
+    /** Constants */
+    public static const int ATK_RELATION_LABELLED_BY = 4;
+    public static const int ATK_ROLE_CHECK_BOX = 7;
+    public static const int ATK_ROLE_COMBO_BOX = 11;
+    public static const int ATK_ROLE_DIALOG = 16;
+    public static const int ATK_ROLE_DRAWING_AREA = 18;
+    public static const int ATK_ROLE_WINDOW = 68;
+    public static const int ATK_ROLE_LABEL = 28;
+    public static const int ATK_ROLE_LIST = 30;
+    public static const int ATK_ROLE_LIST_ITEM = 31;
+    public static const int ATK_ROLE_MENU = 32;
+    public static const int ATK_ROLE_MENU_BAR = 33;
+    public static const int ATK_ROLE_MENU_ITEM = 34;
+    public static const int ATK_ROLE_PAGE_TAB = 36;
+    public static const int ATK_ROLE_PAGE_TAB_LIST = 37;
+    public static const int ATK_ROLE_PROGRESS_BAR = 41;
+    public static const int ATK_ROLE_PUSH_BUTTON = 42;
+    public static const int ATK_ROLE_RADIO_BUTTON = 43;
+    public static const int ATK_ROLE_SCROLL_BAR = 47;
+    public static const int ATK_ROLE_SEPARATOR = 49;
+    public static const int ATK_ROLE_SLIDER = 50;
+    public static const int ATK_ROLE_TABLE = 54;
+    public static const int ATK_ROLE_TABLE_CELL = 55;
+    public static const int ATK_ROLE_TABLE_COLUMN_HEADER = 56;
+    public static const int ATK_ROLE_TABLE_ROW_HEADER = 57;
+    public static const int ATK_ROLE_TEXT = 60;
+    public static const int ATK_ROLE_TOOL_BAR = 62;
+    public static const int ATK_ROLE_TOOL_TIP = 63;
+    public static const int ATK_ROLE_TREE = 64;
+    public static const int ATK_STATE_ARMED = 2;
+    public static const int ATK_STATE_BUSY = 3;
+    public static const int ATK_STATE_CHECKED = 4;
+    public static const int ATK_STATE_DEFUNCT = 5;
+    public static const int ATK_STATE_EDITABLE = 6;
+    public static const int ATK_STATE_ENABLED = 7;
+    public static const int ATK_STATE_EXPANDED = 9;
+    public static const int ATK_STATE_FOCUSABLE = 10;
+    public static const int ATK_STATE_FOCUSED = 11;
+    public static const int ATK_STATE_MULTISELECTABLE = 16;
+    public static const int ATK_STATE_PRESSED = 18;
+    public static const int ATK_STATE_RESIZABLE = 19;
+    public static const int ATK_STATE_SELECTABLE = 20;
+    public static const int ATK_STATE_SELECTED = 21;
+    public static const int ATK_STATE_SHOWING = 23;
+    public static const int ATK_STATE_TRANSIENT = 26;
+    public static const int ATK_STATE_VISIBLE = 28;
+    public static const int ATK_TEXT_BOUNDARY_CHAR = 0;
+    public static const int ATK_TEXT_BOUNDARY_WORD_START = 1;
+    public static const int ATK_TEXT_BOUNDARY_WORD_END = 2;
+    public static const int ATK_TEXT_BOUNDARY_SENTENCE_START = 3;
+    public static const int ATK_TEXT_BOUNDARY_SENTENCE_END = 4;
+    public static const int ATK_TEXT_BOUNDARY_LINE_START = 5;
+    public static const int ATK_TEXT_BOUNDARY_LINE_END = 6;
+    public static const int ATK_XY_WINDOW = 1;
+
+    /** Signals */
+    public static const String selection_changed = "selection_changed";
+    public static const String text_changed_insert = "text_changed::insert";
+    public static const String text_changed_delete = "text_changed::delete";
+    public static const String text_caret_moved = "text_caret_moved";
+    public static const String text_selection_changed = "text_selection_changed";
+
+    mixin ForwardGtkAtkCFunc!(.ATK_ACTION_GET_IFACE );
+    mixin ForwardGtkAtkCFunc!(.ATK_COMPONENT_GET_IFACE);
+    mixin ForwardGtkAtkCFunc!(.ATK_OBJECT_FACTORY_CLASS );
+    mixin ForwardGtkAtkCFunc!(.ATK_SELECTION_GET_IFACE );
+    mixin ForwardGtkAtkCFunc!(.ATK_TEXT_GET_IFACE );
+    mixin ForwardGtkAtkCFunc!(.GTK_ACCESSIBLE );
+    mixin ForwardGtkAtkCFunc!(.atk_focus_tracker_notify );
+    mixin ForwardGtkAtkCFunc!(.atk_get_default_registry );
+    mixin ForwardGtkAtkCFunc!(.atk_object_factory_create_accessible );
+    mixin ForwardGtkAtkCFunc!(.atk_object_factory_get_accessible_type );
+    mixin ForwardGtkAtkCFunc!(.atk_object_initialize );
+    mixin ForwardGtkAtkCFunc!(.atk_object_ref_relation_set );
+    mixin ForwardGtkAtkCFunc!(.atk_registry_get_factory );
+    mixin ForwardGtkAtkCFunc!(.atk_registry_set_factory_type );
+    mixin ForwardGtkAtkCFunc!(.atk_relation_set_get_n_relations );
+    mixin ForwardGtkAtkCFunc!(.atk_relation_set_get_relation );
+    mixin ForwardGtkAtkCFunc!(.atk_relation_set_remove );
+    mixin ForwardGtkAtkCFunc!(.atk_state_set_add_state );
+    mixin ForwardGtkAtkCFunc!(.atk_state_set_new );
+
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/X.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,275 @@
+/******************************************************************************
+    Based on the generated files from the BCD tool
+    modified by: Frank Benoit <keinfarbton@googlemail.com>
+******************************************************************************/
+module org.eclipse.swt.internal.c.X;
+
+import java.lang.all;
+
+extern(C):
+align(4):
+
+const int X_PROTOCOL = 11;
+const int X_PROTOCOL_REVISION = 0;
+const int None = 0;
+const int ParentRelative = 1;
+const int CopyFromParent = 0;
+const int PointerWindow = 0;
+const int InputFocus = 1;
+const int PointerRoot = 1;
+const int AnyPropertyType = 0;
+const int AnyKey = 0;
+const int AnyButton = 0;
+const int AllTemporary = 0;
+const int CurrentTime = 0;
+const int NoSymbol = 0;
+const int NoEventMask = 0;
+const int KeyPress = 2;
+const int KeyRelease = 3;
+const int ButtonPress = 4;
+const int ButtonRelease = 5;
+const int MotionNotify = 6;
+const int EnterNotify = 7;
+const int LeaveNotify = 8;
+const int FocusIn = 9;
+const int FocusOut = 10;
+const int KeymapNotify = 11;
+const int Expose = 12;
+const int GraphicsExpose = 13;
+const int NoExpose = 14;
+const int VisibilityNotify = 15;
+const int CreateNotify = 16;
+const int DestroyNotify = 17;
+const int UnmapNotify = 18;
+const int MapNotify = 19;
+const int MapRequest = 20;
+const int ReparentNotify = 21;
+const int ConfigureNotify = 22;
+const int ConfigureRequest = 23;
+const int GravityNotify = 24;
+const int ResizeRequest = 25;
+const int CirculateNotify = 26;
+const int CirculateRequest = 27;
+const int PropertyNotify = 28;
+const int SelectionClear = 29;
+const int SelectionRequest = 30;
+const int SelectionNotify = 31;
+const int ColormapNotify = 32;
+const int ClientMessage = 33;
+const int MappingNotify = 34;
+const int LASTEvent = 35;
+const int ShiftMapIndex = 0;
+const int LockMapIndex = 1;
+const int ControlMapIndex = 2;
+const int Mod1MapIndex = 3;
+const int Mod2MapIndex = 4;
+const int Mod3MapIndex = 5;
+const int Mod4MapIndex = 6;
+const int Mod5MapIndex = 7;
+const int Button1 = 1;
+const int Button2 = 2;
+const int Button3 = 3;
+const int Button4 = 4;
+const int Button5 = 5;
+const int NotifyNormal = 0;
+const int NotifyGrab = 1;
+const int NotifyUngrab = 2;
+const int NotifyWhileGrabbed = 3;
+const int NotifyHint = 1;
+const int NotifyAncestor = 0;
+const int NotifyVirtual = 1;
+const int NotifyInferior = 2;
+const int NotifyNonlinear = 3;
+const int NotifyNonlinearVirtual = 4;
+const int NotifyPointer = 5;
+const int NotifyPointerRoot = 6;
+const int NotifyDetailNone = 7;
+const int VisibilityUnobscured = 0;
+const int VisibilityPartiallyObscured = 1;
+const int VisibilityFullyObscured = 2;
+const int PlaceOnTop = 0;
+const int PlaceOnBottom = 1;
+const int FamilyInternet = 0;
+const int FamilyDECnet = 1;
+const int FamilyChaos = 2;
+const int FamilyInternet6 = 6;
+const int FamilyServerInterpreted = 5;
+const int PropertyNewValue = 0;
+const int PropertyDelete = 1;
+const int ColormapUninstalled = 0;
+const int ColormapInstalled = 1;
+const int GrabModeSync = 0;
+const int GrabModeAsync = 1;
+const int GrabSuccess = 0;
+const int AlreadyGrabbed = 1;
+const int GrabInvalidTime = 2;
+const int GrabNotViewable = 3;
+const int GrabFrozen = 4;
+const int AsyncPointer = 0;
+const int SyncPointer = 1;
+const int ReplayPointer = 2;
+const int AsyncKeyboard = 3;
+const int SyncKeyboard = 4;
+const int ReplayKeyboard = 5;
+const int AsyncBoth = 6;
+const int SyncBoth = 7;
+const int RevertToParent = 2;
+const int Success = 0;
+const int BadRequest = 1;
+const int BadValue = 2;
+const int BadWindow = 3;
+const int BadPixmap = 4;
+const int BadAtom = 5;
+const int BadCursor = 6;
+const int BadFont = 7;
+const int BadMatch = 8;
+const int BadDrawable = 9;
+const int BadAccess = 10;
+const int BadAlloc = 11;
+const int BadColor = 12;
+const int BadGC = 13;
+const int BadIDChoice = 14;
+const int BadName = 15;
+const int BadLength = 16;
+const int BadImplementation = 17;
+const int FirstExtensionError = 128;
+const int LastExtensionError = 255;
+const int InputOutput = 1;
+const int InputOnly = 2;
+const int ForgetGravity = 0;
+const int NorthWestGravity = 1;
+const int NorthGravity = 2;
+const int NorthEastGravity = 3;
+const int WestGravity = 4;
+const int CenterGravity = 5;
+const int EastGravity = 6;
+const int SouthWestGravity = 7;
+const int SouthGravity = 8;
+const int SouthEastGravity = 9;
+const int StaticGravity = 10;
+const int UnmapGravity = 0;
+const int NotUseful = 0;
+const int WhenMapped = 1;
+const int Always = 2;
+const int IsUnmapped = 0;
+const int IsUnviewable = 1;
+const int IsViewable = 2;
+const int SetModeInsert = 0;
+const int SetModeDelete = 1;
+const int DestroyAll = 0;
+const int RetainPermanent = 1;
+const int RetainTemporary = 2;
+const int Above = 0;
+const int Below = 1;
+const int TopIf = 2;
+const int BottomIf = 3;
+const int Opposite = 4;
+const int RaiseLowest = 0;
+const int LowerHighest = 1;
+const int PropModeReplace = 0;
+const int PropModePrepend = 1;
+const int PropModeAppend = 2;
+const int GXclear = 0x0;
+const int GXand = 0x1;
+const int GXandReverse = 0x2;
+const int GXcopy = 0x3;
+const int GXandInverted = 0x4;
+const int GXnoop = 0x5;
+const int GXxor = 0x6;
+const int GXor = 0x7;
+const int GXnor = 0x8;
+const int GXequiv = 0x9;
+const int GXinvert = 0xa;
+const int GXorReverse = 0xb;
+const int GXcopyInverted = 0xc;
+const int GXorInverted = 0xd;
+const double GXnand = 0xe;
+const int GXset = 0xf;
+const int LineSolid = 0;
+const int LineOnOffDash = 1;
+const int LineDoubleDash = 2;
+const int CapNotLast = 0;
+const int CapButt = 1;
+const int CapRound = 2;
+const int CapProjecting = 3;
+const int JoinMiter = 0;
+const int JoinRound = 1;
+const int JoinBevel = 2;
+const int FillSolid = 0;
+const int FillTiled = 1;
+const int FillStippled = 2;
+const int FillOpaqueStippled = 3;
+const int EvenOddRule = 0;
+const int WindingRule = 1;
+const int ClipByChildren = 0;
+const int IncludeInferiors = 1;
+const int Unsorted = 0;
+const int YSorted = 1;
+const int YXSorted = 2;
+const int YXBanded = 3;
+const int CoordModeOrigin = 0;
+const int CoordModePrevious = 1;
+const int Complex = 0;
+const int Nonconvex = 1;
+const int Convex = 2;
+const int ArcChord = 0;
+const int ArcPieSlice = 1;
+const int GCLastBit = 22;
+const int FontLeftToRight = 0;
+const int FontRightToLeft = 1;
+const int FontChange = 255;
+const int XYBitmap = 0;
+const int XYPixmap = 1;
+const int ZPixmap = 2;
+const int AllocNone = 0;
+const int AllocAll = 1;
+const int CursorShape = 0;
+const int TileShape = 1;
+const int StippleShape = 2;
+const int AutoRepeatModeOff = 0;
+const int AutoRepeatModeOn = 1;
+const int AutoRepeatModeDefault = 2;
+const int LedModeOff = 0;
+const int LedModeOn = 1;
+const int MappingSuccess = 0;
+const int MappingBusy = 1;
+const int MappingFailed = 2;
+const int MappingModifier = 0;
+const int MappingKeyboard = 1;
+const int MappingPointer = 2;
+const int DontPreferBlanking = 0;
+const int PreferBlanking = 1;
+const int DefaultBlanking = 2;
+const int DisableScreenSaver = 0;
+const int DisableScreenInterval = 0;
+const int DontAllowExposures = 0;
+const int AllowExposures = 1;
+const int DefaultExposures = 2;
+const int ScreenSaverReset = 0;
+const int ScreenSaverActive = 1;
+const int HostInsert = 0;
+const int HostDelete = 1;
+const int EnableAccess = 1;
+const int DisableAccess = 0;
+const int StaticGray = 0;
+const int GrayScale = 1;
+const int StaticColor = 2;
+const int PseudoColor = 3;
+const int TrueColor = 4;
+const int DirectColor = 5;
+const int LSBFirst = 0;
+const int MSBFirst = 1;
+alias char KeyCode;
+alias uint XID;
+alias uint KeySym;
+alias uint GContext;
+alias uint Colormap;
+alias uint Cursor;
+alias uint Pixmap;
+alias uint Font;
+alias uint Drawable;
+alias uint Window;
+alias uint Time;
+alias uint VisualID;
+alias uint Atom;
+alias uint Mask;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/XInput.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,596 @@
+/******************************************************************************
+    Based on the generated files from the BCD tool
+    modified by: Frank Benoit <keinfarbton@googlemail.com>
+******************************************************************************/
+module org.eclipse.swt.internal.c.XInput;
+
+import java.lang.all;
+
+public import org.eclipse.swt.internal.c.Xlib;
+
+extern(C):
+align(4):
+
+struct XExtensionVersion{ int a; int b; };
+
+
+
+const int _deviceKeyPress = 0;
+const int _deviceKeyRelease = 1;
+const int _deviceButtonPress = 0;
+const int _deviceButtonRelease = 1;
+const int _deviceMotionNotify = 0;
+const int _deviceFocusIn = 0;
+const int _deviceFocusOut = 1;
+const int _proximityIn = 0;
+const int _proximityOut = 1;
+const int _deviceStateNotify = 0;
+const int _deviceMappingNotify = 1;
+const int _changeDeviceNotify = 2;
+alias _XValuatorInfo XValuatorInfo;
+alias _XValuatorInfo * XValuatorInfoPtr;
+alias _XAxisInfo * XAxisInfoPtr;
+alias _XAxisInfo XAxisInfo;
+alias _XButtonInfo XButtonInfo;
+alias _XButtonInfo * XButtonInfoPtr;
+alias _XKeyInfo XKeyInfo;
+alias _XKeyInfo * XKeyInfoPtr;
+alias _XDeviceInfo XDeviceInfo;
+alias _XDeviceInfo * XDeviceInfoPtr;
+alias _XAnyClassinfo * XAnyClassPtr;
+alias _XAnyClassinfo XAnyClassInfo;
+alias XDeviceEnableControl XDeviceEnableState;
+alias XDeviceAbsAreaControl XDeviceAbsAreaState;
+alias XDeviceAbsCalibControl XDeviceAbsCalibState;
+alias XProximityNotifyEvent XProximityOutEvent;
+alias XProximityNotifyEvent XProximityInEvent;
+alias XDeviceFocusChangeEvent XDeviceFocusOutEvent;
+alias XDeviceFocusChangeEvent XDeviceFocusInEvent;
+alias XDeviceButtonEvent XDeviceButtonReleasedEvent;
+alias XDeviceButtonEvent XDeviceButtonPressedEvent;
+alias XDeviceKeyEvent XDeviceKeyReleasedEvent;
+alias XDeviceKeyEvent XDeviceKeyPressedEvent;
+alias void function(void *, char *, int, int, char * *) _BCD_func__1398;
+alias int function(void *) _BCD_func__1440;
+alias int function(void *, XErrorEvent *) _BCD_func__1441;
+alias void function(void *, char *, char *) _BCD_func__1515;
+alias int function(void *, char *, char *) _BCD_func__1516;
+alias void function(void *, char *, char *) _BCD_func__1517;
+struct XButtonState {
+char c_class;
+char length;
+short num_buttons;
+char [32] buttons;
+}
+struct XKeyState {
+char c_class;
+char length;
+short num_keys;
+char [32] keys;
+}
+struct XValuatorState {
+char c_class;
+char length;
+char num_valuators;
+char mode;
+int * valuators;
+}
+struct XDeviceState {
+uint device_id;
+int num_classes;
+XInputClass * data;
+}
+struct XDeviceTimeCoord {
+uint time;
+int * data;
+}
+struct XEventList {
+uint event_type;
+uint device;
+}
+struct XDevice {
+uint device_id;
+int num_classes;
+XInputClassInfo * classes;
+}
+struct XInputClassInfo {
+char input_class;
+char event_type_base;
+}
+struct _XValuatorInfo {
+uint c_class;
+int length;
+char num_axes;
+char mode;
+uint motion_buffer;
+_XAxisInfo * axes;
+}
+struct _XAxisInfo {
+int resolution;
+int min_value;
+int max_value;
+}
+struct _XButtonInfo {
+uint c_class;
+int length;
+short num_buttons;
+}
+struct _XKeyInfo {
+uint c_class;
+int length;
+ushort min_keycode;
+ushort max_keycode;
+ushort num_keys;
+}
+struct _XDeviceInfo {
+uint id;
+uint type;
+char * name;
+int num_classes;
+int use;
+_XAnyClassinfo * inputclassinfo;
+}
+struct _XAnyClassinfo {
+uint c_class;
+int length;
+}
+struct XDeviceEnableControl {
+uint control;
+int length;
+int enable;
+}
+struct XDeviceCoreState {
+uint control;
+int length;
+int status;
+int iscore;
+}
+struct XDeviceCoreControl {
+uint control;
+int length;
+int status;
+}
+struct XDeviceAbsAreaControl {
+uint control;
+int length;
+int offset_x;
+int offset_y;
+int width;
+int height;
+int screen;
+uint following;
+}
+struct XDeviceAbsCalibControl {
+uint control;
+int length;
+int min_x;
+int max_x;
+int min_y;
+int max_y;
+int flip_x;
+int flip_y;
+int rotation;
+int button_threshold;
+}
+struct XDeviceResolutionState {
+uint control;
+int length;
+int num_valuators;
+int * resolutions;
+int * min_resolutions;
+int * max_resolutions;
+}
+struct XDeviceResolutionControl {
+uint control;
+int length;
+int first_valuator;
+int num_valuators;
+int * resolutions;
+}
+struct XDeviceControl {
+uint control;
+int length;
+}
+struct XLedFeedbackControl {
+uint c_class;
+int length;
+uint id;
+int led_mask;
+int led_values;
+}
+struct XBellFeedbackControl {
+uint c_class;
+int length;
+uint id;
+int percent;
+int pitch;
+int duration;
+}
+struct XIntegerFeedbackControl {
+uint c_class;
+int length;
+uint id;
+int int_to_display;
+}
+struct XStringFeedbackControl {
+uint c_class;
+int length;
+uint id;
+int num_keysyms;
+uint * syms_to_display;
+}
+struct XKbdFeedbackControl {
+uint c_class;
+int length;
+uint id;
+int click;
+int percent;
+int pitch;
+int duration;
+int led_mask;
+int led_value;
+int key;
+int auto_repeat_mode;
+}
+struct XPtrFeedbackControl {
+uint c_class;
+int length;
+uint id;
+int accelNum;
+int accelDenom;
+int threshold;
+}
+struct XFeedbackControl {
+uint c_class;
+int length;
+uint id;
+}
+struct XLedFeedbackState {
+uint c_class;
+int length;
+uint id;
+int led_values;
+int led_mask;
+}
+struct XBellFeedbackState {
+uint c_class;
+int length;
+uint id;
+int percent;
+int pitch;
+int duration;
+}
+struct XStringFeedbackState {
+uint c_class;
+int length;
+uint id;
+int max_symbols;
+int num_syms_supported;
+uint * syms_supported;
+}
+struct XIntegerFeedbackState {
+uint c_class;
+int length;
+uint id;
+int resolution;
+int minVal;
+int maxVal;
+}
+struct XPtrFeedbackState {
+uint c_class;
+int length;
+uint id;
+int accelNum;
+int accelDenom;
+int threshold;
+}
+struct XKbdFeedbackState {
+uint c_class;
+int length;
+uint id;
+int click;
+int percent;
+int pitch;
+int duration;
+int led_mask;
+int global_auto_repeat;
+char [32] auto_repeats;
+}
+struct XFeedbackState {
+uint c_class;
+int length;
+uint id;
+}
+struct XDevicePresenceNotifyEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint window;
+uint time;
+int devchange;
+uint deviceid;
+uint control;
+}
+struct XChangeDeviceNotifyEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint window;
+uint deviceid;
+uint time;
+int request;
+}
+struct XDeviceMappingEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint window;
+uint deviceid;
+uint time;
+int request;
+int first_keycode;
+int count;
+}
+struct XButtonStatus {
+char c_class;
+char length;
+short num_buttons;
+char [32] buttons;
+}
+struct XKeyStatus {
+char c_class;
+char length;
+short num_keys;
+char [32] keys;
+}
+struct XValuatorStatus {
+char c_class;
+char length;
+char num_valuators;
+char mode;
+int [6] valuators;
+}
+struct XDeviceStateNotifyEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint window;
+uint deviceid;
+uint time;
+int num_classes;
+char [64] data;
+}
+struct XInputClass {
+char c_class;
+char length;
+}
+struct XProximityNotifyEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint window;
+uint deviceid;
+uint root;
+uint subwindow;
+uint time;
+int x;
+int y;
+int x_root;
+int y_root;
+uint state;
+int same_screen;
+uint device_state;
+char axes_count;
+char first_axis;
+int [6] axis_data;
+}
+struct XDeviceFocusChangeEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint window;
+uint deviceid;
+int mode;
+int detail;
+uint time;
+}
+struct XDeviceMotionEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint window;
+uint deviceid;
+uint root;
+uint subwindow;
+uint time;
+int x;
+int y;
+int x_root;
+int y_root;
+uint state;
+char is_hint;
+int same_screen;
+uint device_state;
+char axes_count;
+char first_axis;
+int [6] axis_data;
+}
+struct XDeviceButtonEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint window;
+uint deviceid;
+uint root;
+uint subwindow;
+uint time;
+int x;
+int y;
+int x_root;
+int y_root;
+uint state;
+uint button;
+int same_screen;
+uint device_state;
+char axes_count;
+char first_axis;
+int [6] axis_data;
+}
+struct XDeviceKeyEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint window;
+uint deviceid;
+uint root;
+uint subwindow;
+uint time;
+int x;
+int y;
+int x_root;
+int y_root;
+uint state;
+uint keycode;
+int same_screen;
+uint device_state;
+char axes_count;
+char first_axis;
+int [6] axis_data;
+}
+version(DYNLINK){
+extern (C) void function(XDeviceControl *)XFreeDeviceControl;
+extern (C) void function(XDeviceTimeCoord *)XFreeDeviceMotionEvents;
+extern (C) XDeviceTimeCoord * function(void *, XDevice *, uint, uint, int *, int *, int *)XGetDeviceMotionEvents;
+extern (C) int function(void *, XDevice *, uint, int, int, uint *, _XEvent *)XSendExtensionEvent;
+extern (C) uint * function(void *, uint, int *)XGetDeviceDontPropagateList;
+extern (C) int function(void *, uint, int, uint *, int)XChangeDeviceDontPropagateList;
+extern (C) int function(void *, uint, int *, uint * *, int *, uint * *)XGetSelectedExtensionEvents;
+extern (C) int function(void *, uint, uint *, int)XSelectExtensionEvent;
+extern (C) int function(void *, XDevice *, int, XDeviceControl *)XChangeDeviceControl;
+extern (C) XDeviceControl * function(void *, XDevice *, int)XGetDeviceControl;
+extern (C) int function(void *, XDevice *, int *, int, int)XSetDeviceValuators;
+extern (C) int function(void *, XDevice *, int)XSetDeviceMode;
+extern (C) int function(void *, XDevice *)XCloseDevice;
+extern (C) XDevice * function(void *, uint)XOpenDevice;
+extern (C) void function(_XDeviceInfo *)XFreeDeviceList;
+extern (C) _XDeviceInfo * function(void *, int *)XListInputDevices;
+extern (C) XExtensionVersion * function(void *, char *)XGetExtensionVersion;
+extern (C) void function(XDeviceState *)XFreeDeviceState;
+extern (C) XDeviceState * function(void *, XDevice *)XQueryDeviceState;
+extern (C) int function(void *, XDevice *, char *, uint)XGetDeviceButtonMapping;
+extern (C) int function(void *, XDevice *, char *, int)XSetDeviceButtonMapping;
+extern (C) int function(void *, XDevice *, XModifierKeymap *)XSetDeviceModifierMapping;
+extern (C) XModifierKeymap * function(void *, XDevice *)XGetDeviceModifierMapping;
+extern (C) int function(void *, XDevice *, int, int, uint *, int)XChangeDeviceKeyMapping;
+extern (C) uint * function(void *, XDevice *, char, int, int *)XGetDeviceKeyMapping;
+extern (C) int function(void *, XDevice *, uint, uint, int)XDeviceBell;
+extern (C) int function(void *, XDevice *, uint, XFeedbackControl *)XChangeFeedbackControl;
+extern (C) void function(XFeedbackState *)XFreeFeedbackList;
+extern (C) XFeedbackState * function(void *, XDevice *, int *)XGetFeedbackControl;
+extern (C) int function(void *, XDevice *, uint, int, uint)XSetDeviceFocus;
+extern (C) int function(void *, XDevice *, uint *, int *, uint *)XGetDeviceFocus;
+extern (C) int function(void *, XDevice *, int, uint)XAllowDeviceEvents;
+extern (C) int function(void *, XDevice *, uint, uint, XDevice *, uint)XUngrabDeviceButton;
+extern (C) int function(void *, XDevice *, uint, uint, XDevice *, uint, int, uint, uint *, int, int)XGrabDeviceButton;
+extern (C) int function(void *, XDevice *, uint, uint, XDevice *, uint)XUngrabDeviceKey;
+extern (C) int function(void *, XDevice *, uint, uint, XDevice *, uint, int, uint, uint *, int, int)XGrabDeviceKey;
+extern (C) int function(void *, XDevice *, uint)XUngrabDevice;
+extern (C) int function(void *, XDevice *, uint, int, int, uint *, int, int, uint)XGrabDevice;
+extern (C) int function(void *, XDevice *, int, int)XChangePointerDevice;
+extern (C) int function(void *, XDevice *)XChangeKeyboardDevice;
+
+
+Symbol[] symbols = [
+    { "XFreeDeviceControl",  cast(void**)& XFreeDeviceControl},
+    { "XFreeDeviceMotionEvents",  cast(void**)& XFreeDeviceMotionEvents},
+    { "XGetDeviceMotionEvents",  cast(void**)& XGetDeviceMotionEvents},
+    { "XSendExtensionEvent",  cast(void**)& XSendExtensionEvent},
+    { "XGetDeviceDontPropagateList",  cast(void**)& XGetDeviceDontPropagateList},
+    { "XChangeDeviceDontPropagateList",  cast(void**)& XChangeDeviceDontPropagateList},
+    { "XGetSelectedExtensionEvents",  cast(void**)& XGetSelectedExtensionEvents},
+    { "XSelectExtensionEvent",  cast(void**)& XSelectExtensionEvent},
+    { "XChangeDeviceControl",  cast(void**)& XChangeDeviceControl},
+    { "XGetDeviceControl",  cast(void**)& XGetDeviceControl},
+    { "XSetDeviceValuators",  cast(void**)& XSetDeviceValuators},
+    { "XSetDeviceMode",  cast(void**)& XSetDeviceMode},
+    { "XCloseDevice",  cast(void**)& XCloseDevice},
+    { "XOpenDevice",  cast(void**)& XOpenDevice},
+    { "XFreeDeviceList",  cast(void**)& XFreeDeviceList},
+    { "XListInputDevices",  cast(void**)& XListInputDevices},
+    { "XGetExtensionVersion",  cast(void**)& XGetExtensionVersion},
+    { "XFreeDeviceState",  cast(void**)& XFreeDeviceState},
+    { "XQueryDeviceState",  cast(void**)& XQueryDeviceState},
+    { "XGetDeviceButtonMapping",  cast(void**)& XGetDeviceButtonMapping},
+    { "XSetDeviceButtonMapping",  cast(void**)& XSetDeviceButtonMapping},
+    { "XSetDeviceModifierMapping",  cast(void**)& XSetDeviceModifierMapping},
+    { "XGetDeviceModifierMapping",  cast(void**)& XGetDeviceModifierMapping},
+    { "XChangeDeviceKeyMapping",  cast(void**)& XChangeDeviceKeyMapping},
+    { "XGetDeviceKeyMapping",  cast(void**)& XGetDeviceKeyMapping},
+    { "XDeviceBell",  cast(void**)& XDeviceBell},
+    { "XChangeFeedbackControl",  cast(void**)& XChangeFeedbackControl},
+    { "XFreeFeedbackList",  cast(void**)& XFreeFeedbackList},
+    { "XGetFeedbackControl",  cast(void**)& XGetFeedbackControl},
+    { "XSetDeviceFocus",  cast(void**)& XSetDeviceFocus},
+    { "XGetDeviceFocus",  cast(void**)& XGetDeviceFocus},
+    { "XAllowDeviceEvents",  cast(void**)& XAllowDeviceEvents},
+    { "XUngrabDeviceButton",  cast(void**)& XUngrabDeviceButton},
+    { "XGrabDeviceButton",  cast(void**)& XGrabDeviceButton},
+    { "XUngrabDeviceKey",  cast(void**)& XUngrabDeviceKey},
+    { "XGrabDeviceKey",  cast(void**)& XGrabDeviceKey},
+    { "XUngrabDevice",  cast(void**)& XUngrabDevice},
+    { "XGrabDevice",  cast(void**)& XGrabDevice},
+    { "XChangePointerDevice",  cast(void**)& XChangePointerDevice},
+    { "XChangeKeyboardDevice",  cast(void**)& XChangeKeyboardDevice},
+];
+
+} else { // version(DYNLINK)
+extern (C) void XFreeDeviceControl(XDeviceControl *);
+extern (C) void XFreeDeviceMotionEvents(XDeviceTimeCoord *);
+extern (C) XDeviceTimeCoord * XGetDeviceMotionEvents(void *, XDevice *, uint, uint, int *, int *, int *);
+extern (C) int XSendExtensionEvent(void *, XDevice *, uint, int, int, uint *, _XEvent *);
+extern (C) uint * XGetDeviceDontPropagateList(void *, uint, int *);
+extern (C) int XChangeDeviceDontPropagateList(void *, uint, int, uint *, int);
+extern (C) int XGetSelectedExtensionEvents(void *, uint, int *, uint * *, int *, uint * *);
+extern (C) int XSelectExtensionEvent(void *, uint, uint *, int);
+extern (C) int XChangeDeviceControl(void *, XDevice *, int, XDeviceControl *);
+extern (C) XDeviceControl * XGetDeviceControl(void *, XDevice *, int);
+extern (C) int XSetDeviceValuators(void *, XDevice *, int *, int, int);
+extern (C) int XSetDeviceMode(void *, XDevice *, int);
+extern (C) int XCloseDevice(void *, XDevice *);
+extern (C) XDevice * XOpenDevice(void *, uint);
+extern (C) void XFreeDeviceList(_XDeviceInfo *);
+extern (C) _XDeviceInfo * XListInputDevices(void *, int *);
+extern (C) XExtensionVersion * XGetExtensionVersion(void *, char *);
+extern (C) void XFreeDeviceState(XDeviceState *);
+extern (C) XDeviceState * XQueryDeviceState(void *, XDevice *);
+extern (C) int XGetDeviceButtonMapping(void *, XDevice *, char *, uint);
+extern (C) int XSetDeviceButtonMapping(void *, XDevice *, char *, int);
+extern (C) int XSetDeviceModifierMapping(void *, XDevice *, XModifierKeymap *);
+extern (C) XModifierKeymap * XGetDeviceModifierMapping(void *, XDevice *);
+extern (C) int XChangeDeviceKeyMapping(void *, XDevice *, int, int, uint *, int);
+extern (C) uint * XGetDeviceKeyMapping(void *, XDevice *, char, int, int *);
+extern (C) int XDeviceBell(void *, XDevice *, uint, uint, int);
+extern (C) int XChangeFeedbackControl(void *, XDevice *, uint, XFeedbackControl *);
+extern (C) void XFreeFeedbackList(XFeedbackState *);
+extern (C) XFeedbackState * XGetFeedbackControl(void *, XDevice *, int *);
+extern (C) int XSetDeviceFocus(void *, XDevice *, uint, int, uint);
+extern (C) int XGetDeviceFocus(void *, XDevice *, uint *, int *, uint *);
+extern (C) int XAllowDeviceEvents(void *, XDevice *, int, uint);
+extern (C) int XUngrabDeviceButton(void *, XDevice *, uint, uint, XDevice *, uint);
+extern (C) int XGrabDeviceButton(void *, XDevice *, uint, uint, XDevice *, uint, int, uint, uint *, int, int);
+extern (C) int XUngrabDeviceKey(void *, XDevice *, uint, uint, XDevice *, uint);
+extern (C) int XGrabDeviceKey(void *, XDevice *, uint, uint, XDevice *, uint, int, uint, uint *, int, int);
+extern (C) int XUngrabDevice(void *, XDevice *, uint);
+extern (C) int XGrabDevice(void *, XDevice *, uint, int, int, uint *, int, int, uint);
+extern (C) int XChangePointerDevice(void *, XDevice *, int, int);
+extern (C) int XChangeKeyboardDevice(void *, XDevice *);
+} // version(DYNLINK)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/XTest.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,82 @@
+/******************************************************************************
+    Based on the generated files from the BCD tool
+    modified by: Frank Benoit <keinfarbton@googlemail.com>
+******************************************************************************/
+module org.eclipse.swt.internal.c.XTest;
+
+import java.lang.all;
+
+public import org.eclipse.swt.internal.c.Xlib;
+public import org.eclipse.swt.internal.c.XInput;
+
+extern(C):
+align(4):
+
+const int X_XTestGetVersion = 0;
+const int X_XTestCompareCursor = 1;
+const int X_XTestFakeInput = 2;
+const int X_XTestGrabControl = 3;
+const int XTestNumberEvents = 0;
+const int XTestNumberErrors = 0;
+const int XTestMajorVersion = 2;
+const int XTestMinorVersion = 2;
+const String XTestExtensionName = "XTEST";
+alias void function(void *, char *, int, int, char * *) _BCD_func__1414;
+alias int function(void *) _BCD_func__1456;
+alias int function(void *, XErrorEvent *) _BCD_func__1457;
+alias void function(void *, char *, char *) _BCD_func__1530;
+alias int function(void *, char *, char *) _BCD_func__1531;
+alias void function(void *, char *, char *) _BCD_func__1532;
+version(DYNLINK){
+extern (C) int function(void *)XTestDiscard;
+extern (C) void function(Visual *, uint)XTestSetVisualIDOfVisual;
+extern (C) void function(void *, uint)XTestSetGContextOfGC;
+extern (C) int function(void *, int)XTestGrabControl;
+extern (C) int function(void *, XDevice *, int, int, int *, int, uint)XTestFakeDeviceMotionEvent;
+extern (C) int function(void *, XDevice *, int, int *, int, uint)XTestFakeProximityEvent;
+extern (C) int function(void *, XDevice *, uint, int, int *, int, uint)XTestFakeDeviceButtonEvent;
+extern (C) int function(void *, XDevice *, uint, int, int *, int, uint)XTestFakeDeviceKeyEvent;
+extern (C) int function(void *, int, int, uint)XTestFakeRelativeMotionEvent;
+extern (C) int function(void *, int, int, int, uint)XTestFakeMotionEvent;
+extern (C) int function(void *, uint, int, uint)XTestFakeButtonEvent;
+extern (C) int function(void *, uint, int, uint)XTestFakeKeyEvent;
+extern (C) int function(void *, uint)XTestCompareCurrentCursorWithWindow;
+extern (C) int function(void *, uint, uint)XTestCompareCursorWithWindow;
+extern (C) int function(void *, int *, int *, int *, int *)XTestQueryExtension;
+
+
+Symbol[] symbols = [
+    { "XTestDiscard",  cast(void**)& XTestDiscard},
+    { "XTestSetVisualIDOfVisual",  cast(void**)& XTestSetVisualIDOfVisual},
+    { "XTestSetGContextOfGC",  cast(void**)& XTestSetGContextOfGC},
+    { "XTestGrabControl",  cast(void**)& XTestGrabControl},
+    { "XTestFakeDeviceMotionEvent",  cast(void**)& XTestFakeDeviceMotionEvent},
+    { "XTestFakeProximityEvent",  cast(void**)& XTestFakeProximityEvent},
+    { "XTestFakeDeviceButtonEvent",  cast(void**)& XTestFakeDeviceButtonEvent},
+    { "XTestFakeDeviceKeyEvent",  cast(void**)& XTestFakeDeviceKeyEvent},
+    { "XTestFakeRelativeMotionEvent",  cast(void**)& XTestFakeRelativeMotionEvent},
+    { "XTestFakeMotionEvent",  cast(void**)& XTestFakeMotionEvent},
+    { "XTestFakeButtonEvent",  cast(void**)& XTestFakeButtonEvent},
+    { "XTestFakeKeyEvent",  cast(void**)& XTestFakeKeyEvent},
+    { "XTestCompareCurrentCursorWithWindow",  cast(void**)& XTestCompareCurrentCursorWithWindow},
+    { "XTestCompareCursorWithWindow",  cast(void**)& XTestCompareCursorWithWindow},
+    { "XTestQueryExtension",  cast(void**)& XTestQueryExtension},
+];
+
+} else { // version(DYNLINK)
+extern (C) int XTestDiscard(void *);
+extern (C) void XTestSetVisualIDOfVisual(Visual *, uint);
+extern (C) void XTestSetGContextOfGC(void *, uint);
+extern (C) int XTestGrabControl(void *, int);
+extern (C) int XTestFakeDeviceMotionEvent(void *, XDevice *, int, int, int *, int, uint);
+extern (C) int XTestFakeProximityEvent(void *, XDevice *, int, int *, int, uint);
+extern (C) int XTestFakeDeviceButtonEvent(void *, XDevice *, uint, int, int *, int, uint);
+extern (C) int XTestFakeDeviceKeyEvent(void *, XDevice *, uint, int, int *, int, uint);
+extern (C) int XTestFakeRelativeMotionEvent(void *, int, int, uint);
+extern (C) int XTestFakeMotionEvent(void *, int, int, int, uint);
+extern (C) int XTestFakeButtonEvent(void *, uint, int, uint);
+extern (C) int XTestFakeKeyEvent(void *, uint, int, uint);
+extern (C) int XTestCompareCurrentCursorWithWindow(void *, uint);
+extern (C) int XTestCompareCursorWithWindow(void *, uint, uint);
+extern (C) int XTestQueryExtension(void *, int *, int *, int *, int *);
+} // version(DYNLINK)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/Xlib.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,2197 @@
+/******************************************************************************
+    Based on the generated files from the BCD tool
+    modified by: Frank Benoit <keinfarbton@googlemail.com>
+******************************************************************************/
+module org.eclipse.swt.internal.c.Xlib;
+
+import java.lang.all;
+
+extern(C):
+align(4):
+
+const int XlibSpecificationRelease = 6;
+const int X_HAVE_UTF8_STRING = 1;
+const int True = 1;
+const int False = 0;
+const int QueuedAlready = 0;
+const int QueuedAfterReading = 1;
+const int QueuedAfterFlush = 2;
+const String XNRequiredCharSet = "requiredCharSet";
+const String XNQueryOrientation = "queryOrientation";
+const String XNBaseFontName = "baseFontName";
+const String XNOMAutomatic = "omAutomatic";
+const String XNMissingCharSet = "missingCharSet";
+const String XNDefaultString = "defaultString";
+const String XNOrientation = "orientation";
+const String XNDirectionalDependentDrawing = "directionalDependentDrawing";
+const String XNContextualDrawing = "contextualDrawing";
+const String XNFontInfo = "fontInfo";
+const int XIMPreeditArea = 0x0001;
+const int XIMPreeditCallbacks = 0x0002;
+const int XIMPreeditPosition = 0x0004;
+const int XIMPreeditNothing = 0x0008;
+const int XIMPreeditNone = 0x0010;
+const int XIMStatusArea = 0x0100;
+const int XIMStatusCallbacks = 0x0200;
+const int XIMStatusNothing = 0x0400;
+const int XIMStatusNone = 0x0800;
+const String XNVaNestedList = "XNVaNestedList";
+const String XNQueryInputStyle = "queryInputStyle";
+const String XNClientWindow = "clientWindow";
+const String XNInputStyle = "inputStyle";
+const String XNFocusWindow = "focusWindow";
+const String XNResourceName = "resourceName";
+const String XNResourceClass = "resourceClass";
+const String XNGeometryCallback = "geometryCallback";
+const String XNDestroyCallback = "destroyCallback";
+const String XNFilterEvents = "filterEvents";
+const String XNPreeditStartCallback = "preeditStartCallback";
+const String XNPreeditDoneCallback = "preeditDoneCallback";
+const String XNPreeditDrawCallback = "preeditDrawCallback";
+const String XNPreeditCaretCallback = "preeditCaretCallback";
+const String XNPreeditStateNotifyCallback = "preeditStateNotifyCallback";
+const String XNPreeditAttributes = "preeditAttributes";
+const String XNStatusStartCallback = "statusStartCallback";
+const String XNStatusDoneCallback = "statusDoneCallback";
+const String XNStatusDrawCallback = "statusDrawCallback";
+const String XNStatusAttributes = "statusAttributes";
+const String XNArea = "area";
+const String XNAreaNeeded = "areaNeeded";
+const String XNSpotLocation = "spotLocation";
+const String XNColormap = "colorMap";
+const String XNStdColormap = "stdColorMap";
+const String XNForeground = "foreground";
+const String XNBackground = "background";
+const String XNBackgroundPixmap = "backgroundPixmap";
+const String XNFontSet = "fontSet";
+const String XNLineSpace = "lineSpace";
+const String XNCursor = "cursor";
+const String XNQueryIMValuesList = "queryIMValuesList";
+const String XNQueryICValuesList = "queryICValuesList";
+const String XNVisiblePosition = "visiblePosition";
+const String XNR6PreeditCallback = "r6PreeditCallback";
+const String XNStringConversionCallback = "stringConversionCallback";
+const String XNStringConversion = "stringConversion";
+const String XNResetState = "resetState";
+const String XNHotKey = "hotKey";
+const String XNHotKeyState = "hotKeyState";
+const String XNPreeditState = "preeditState";
+const String XNSeparatorofNestedList = "separatorofNestedList";
+const int XBufferOverflow = -1;
+const int XLookupNone = 1;
+const int XLookupChars = 2;
+const int XLookupKeySym = 3;
+const int XLookupBoth = 4;
+const int XIMReverse = 1;
+const int XIMPreeditUnKnown = 0;
+const int XIMPreeditEnable = 1;
+const int XIMInitialState = 1;
+alias void Display;
+alias char * XPointer;
+alias void function(void *, char *, int, int, char * *) _BCD_func__846;
+alias _BCD_func__846 XConnectionWatchProc;
+alias int function(void *) _BCD_func__894;
+alias _BCD_func__894 XIOErrorHandler;
+alias int function(void *, XErrorEvent *) _BCD_func__895;
+alias _BCD_func__895 XErrorHandler;
+alias uint XIMHotKeyState;
+alias _XIMHotKeyTriggers XIMHotKeyTriggers;
+alias _XIMHotKeyTrigger XIMHotKeyTrigger;
+alias _XIMStatusDrawCallbackStruct XIMStatusDrawCallbackStruct;
+alias _XIMText XIMText;
+enum XIMStatusDataType {
+XIMTextType=0,
+XIMBitmapType=1,
+}
+alias _XIMPreeditCaretCallbackStruct XIMPreeditCaretCallbackStruct;
+enum XIMCaretDirection {
+XIMForwardChar=0,
+XIMBackwardChar=1,
+XIMForwardWord=2,
+XIMBackwardWord=3,
+XIMCaretUp=4,
+XIMCaretDown=5,
+XIMNextLine=6,
+XIMPreviousLine=7,
+XIMLineStart=8,
+XIMLineEnd=9,
+XIMAbsolutePosition=10,
+XIMDontChange=11,
+}
+enum XIMCaretStyle {
+XIMIsInvisible=0,
+XIMIsPrimary=1,
+XIMIsSecondary=2,
+}
+alias _XIMPreeditDrawCallbackStruct XIMPreeditDrawCallbackStruct;
+alias _XIMStringConversionCallbackStruct XIMStringConversionCallbackStruct;
+alias ushort XIMStringConversionPosition;
+alias ushort XIMStringConversionOperation;
+alias _XIMStringConversionText XIMStringConversionText;
+alias ushort XIMStringConversionType;
+alias uint XIMStringConversionFeedback;
+alias uint XIMResetState;
+alias _XIMPreeditStateNotifyCallbackStruct XIMPreeditStateNotifyCallbackStruct;
+alias uint XIMPreeditState;
+alias uint XIMFeedback;
+alias int function(void *, char *, char *) _BCD_func__970;
+alias _BCD_func__970 XICProc;
+alias void function(void *, char *, char *) _BCD_func__971;
+alias _BCD_func__971 XIMProc;
+alias void * XVaNestedList;
+alias uint XIMStyle;
+alias void function(void *, char *, char *) _BCD_func__969;
+alias _BCD_func__969 XIDProc;
+alias void * XIC;
+alias void * XIM;
+enum XOrientation {
+XOMOrientation_LTR_TTB=0,
+XOMOrientation_RTL_TTB=1,
+XOMOrientation_TTB_LTR=2,
+XOMOrientation_TTB_RTL=3,
+XOMOrientation_Context=4,
+}
+alias void * XFontSet;
+alias void * XOC;
+alias void * XOM;
+alias void * GC;
+alias _XExtData XExtData;
+alias _XEvent XEvent;
+alias XFocusChangeEvent XFocusOutEvent;
+alias XFocusChangeEvent XFocusInEvent;
+alias XCrossingEvent XLeaveWindowEvent;
+alias XCrossingEvent XEnterWindowEvent;
+alias XMotionEvent XPointerMovedEvent;
+alias XButtonEvent XButtonReleasedEvent;
+alias XButtonEvent XButtonPressedEvent;
+alias XKeyEvent XKeyReleasedEvent;
+alias XKeyEvent XKeyPressedEvent;
+alias uint function(void *) _BCD_func__2044;
+alias int function(void *) _BCD_func__2045;
+alias _XImage XImage;
+alias _XImage * function(void *, Visual *, uint, int, int, char *, uint, uint, int, int) _BCD_func__2099;
+alias int function(_XImage *) _BCD_func__2100;
+alias uint function(_XImage *, int, int) _BCD_func__2101;
+alias int function(_XImage *, int, int, uint) _BCD_func__2102;
+alias _XImage * function(_XImage *, int, int, uint, uint) _BCD_func__2103;
+alias int function(_XImage *, int) _BCD_func__2104;
+alias int function(_XExtData *) _BCD_func__2075;
+alias int function(void *, _XEvent *, char *) _BCD_func__1795;
+struct XIMValuesList {
+ushort count_values;
+char * * supported_values;
+}
+struct _XIMHotKeyTriggers {
+int num_hot_key;
+_XIMHotKeyTrigger * key;
+}
+struct _XIMHotKeyTrigger {
+uint keysym;
+int modifier;
+int modifier_mask;
+}
+union N28_XIMStatusDrawCallbackStruct4__91E {
+_XIMText * text;
+uint bitmap;
+}
+struct _XIMStatusDrawCallbackStruct {
+int type;
+N28_XIMStatusDrawCallbackStruct4__91E data;
+}
+struct _XIMPreeditCaretCallbackStruct {
+int position;
+int direction;
+int style;
+}
+struct _XIMPreeditDrawCallbackStruct {
+int caret;
+int chg_first;
+int chg_length;
+_XIMText * text;
+}
+struct _XIMStringConversionCallbackStruct {
+ushort position;
+int direction;
+ushort operation;
+ushort factor;
+_XIMStringConversionText * text;
+}
+union N24_XIMStringConversionText4__87E {
+char * mbs;
+wchar * wcs;
+}
+struct _XIMStringConversionText {
+ushort length;
+uint * feedback;
+int encoding_is_wchar;
+N24_XIMStringConversionText4__87E string;
+}
+struct _XIMPreeditStateNotifyCallbackStruct {
+uint state;
+}
+union N8_XIMText4__86E {
+char * multi_byte;
+wchar * wide_char;
+}
+struct _XIMText {
+ushort length;
+uint * feedback;
+int encoding_is_wchar;
+N8_XIMText4__86E string;
+}
+struct XICCallback {
+char * client_data;
+_BCD_func__970 callback;
+}
+struct XIMCallback {
+char * client_data;
+_BCD_func__971 callback;
+}
+struct XIMStyles {
+ushort count_styles;
+uint * supported_styles;
+}
+struct XOMFontInfo {
+int num_font;
+XFontStruct * * font_struct_list;
+char * * font_name_list;
+}
+struct XOMOrientation {
+int num_orientation;
+int * orientation;
+}
+struct XOMCharSetList {
+int charset_count;
+char * * charset_list;
+}
+struct XwcTextItem {
+wchar * chars;
+int nchars;
+int delta;
+void * font_set;
+}
+struct XmbTextItem {
+char * chars;
+int nchars;
+int delta;
+void * font_set;
+}
+struct XFontSetExtents {
+XRectangle max_ink_extent;
+XRectangle max_logical_extent;
+}
+union XEDataObject {
+void * display;
+void * gc;
+Visual * visual;
+Screen * screen;
+ScreenFormat * pixmap_format;
+XFontStruct * font;
+}
+struct XTextItem16 {
+XChar2b * chars;
+int nchars;
+int delta;
+uint font;
+}
+struct XChar2b {
+char byte1;
+char byte2;
+}
+struct XTextItem {
+char * chars;
+int nchars;
+int delta;
+uint font;
+}
+struct XFontStruct {
+_XExtData * ext_data;
+uint fid;
+uint direction;
+uint min_char_or_byte2;
+uint max_char_or_byte2;
+uint min_byte1;
+uint max_byte1;
+int all_chars_exist;
+uint default_char;
+int n_properties;
+XFontProp * properties;
+XCharStruct min_bounds;
+XCharStruct max_bounds;
+XCharStruct * per_char;
+int ascent;
+int descent;
+}
+struct XFontProp {
+uint name;
+uint card32;
+}
+struct XCharStruct {
+short lbearing;
+short rbearing;
+short width;
+short ascent;
+short descent;
+ushort attributes;
+}
+union _XEvent {
+int type;
+XAnyEvent xany;
+XKeyEvent xkey;
+XButtonEvent xbutton;
+XMotionEvent xmotion;
+XCrossingEvent xcrossing;
+XFocusChangeEvent xfocus;
+XExposeEvent xexpose;
+XGraphicsExposeEvent xgraphicsexpose;
+XNoExposeEvent xnoexpose;
+XVisibilityEvent xvisibility;
+XCreateWindowEvent xcreatewindow;
+XDestroyWindowEvent xdestroywindow;
+XUnmapEvent xunmap;
+XMapEvent xmap;
+XMapRequestEvent xmaprequest;
+XReparentEvent xreparent;
+XConfigureEvent xconfigure;
+XGravityEvent xgravity;
+XResizeRequestEvent xresizerequest;
+XConfigureRequestEvent xconfigurerequest;
+XCirculateEvent xcirculate;
+XCirculateRequestEvent xcirculaterequest;
+XPropertyEvent xproperty;
+XSelectionClearEvent xselectionclear;
+XSelectionRequestEvent xselectionrequest;
+XSelectionEvent xselection;
+XColormapEvent xcolormap;
+XClientMessageEvent xclient;
+XMappingEvent xmapping;
+XErrorEvent xerror;
+XKeymapEvent xkeymap;
+int [24] pad;
+}
+struct XAnyEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint window;
+}
+struct XErrorEvent {
+int type;
+void * display;
+uint resourceid;
+uint serial;
+char error_code;
+char request_code;
+char minor_code;
+}
+struct XMappingEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint window;
+int request;
+int first_keycode;
+int count;
+}
+union N19XClientMessageEvent4__65E {
+char [20] b;
+short [10] s;
+int [5] l;
+}
+struct XClientMessageEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint window;
+uint message_type;
+int format;
+N19XClientMessageEvent4__65E data;
+}
+struct XColormapEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint window;
+uint colormap;
+int c_new;
+int state;
+}
+struct XSelectionEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint requestor;
+uint selection;
+uint target;
+uint property;
+uint time;
+}
+struct XSelectionRequestEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint owner;
+uint requestor;
+uint selection;
+uint target;
+uint property;
+uint time;
+}
+struct XSelectionClearEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint window;
+uint selection;
+uint time;
+}
+struct XPropertyEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint window;
+uint atom;
+uint time;
+int state;
+}
+struct XCirculateRequestEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint parent;
+uint window;
+int place;
+}
+struct XCirculateEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint event;
+uint window;
+int place;
+}
+struct XConfigureRequestEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint parent;
+uint window;
+int x;
+int y;
+int width;
+int height;
+int border_width;
+uint above;
+int detail;
+uint value_mask;
+}
+struct XResizeRequestEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint window;
+int width;
+int height;
+}
+struct XGravityEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint event;
+uint window;
+int x;
+int y;
+}
+struct XConfigureEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint event;
+uint window;
+int x;
+int y;
+int width;
+int height;
+int border_width;
+uint above;
+int override_redirect;
+}
+struct XReparentEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint event;
+uint window;
+uint parent;
+int x;
+int y;
+int override_redirect;
+}
+struct XMapRequestEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint parent;
+uint window;
+}
+struct XMapEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint event;
+uint window;
+int override_redirect;
+}
+struct XUnmapEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint event;
+uint window;
+int from_configure;
+}
+struct XDestroyWindowEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint event;
+uint window;
+}
+struct XCreateWindowEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint parent;
+uint window;
+int x;
+int y;
+int width;
+int height;
+int border_width;
+int override_redirect;
+}
+struct XVisibilityEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint window;
+int state;
+}
+struct XNoExposeEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint drawable;
+int major_code;
+int minor_code;
+}
+struct XGraphicsExposeEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint drawable;
+int x;
+int y;
+int width;
+int height;
+int count;
+int major_code;
+int minor_code;
+}
+struct XExposeEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint window;
+int x;
+int y;
+int width;
+int height;
+int count;
+}
+struct XKeymapEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint window;
+char [32] key_vector;
+}
+struct XFocusChangeEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint window;
+int mode;
+int detail;
+}
+struct XCrossingEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint window;
+uint root;
+uint subwindow;
+uint time;
+int x;
+int y;
+int x_root;
+int y_root;
+int mode;
+int detail;
+int same_screen;
+int focus;
+uint state;
+}
+struct XMotionEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint window;
+uint root;
+uint subwindow;
+uint time;
+int x;
+int y;
+int x_root;
+int y_root;
+uint state;
+char is_hint;
+int same_screen;
+}
+struct XButtonEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint window;
+uint root;
+uint subwindow;
+uint time;
+int x;
+int y;
+int x_root;
+int y_root;
+uint state;
+uint button;
+int same_screen;
+}
+struct XKeyEvent {
+int type;
+uint serial;
+int send_event;
+void * display;
+uint window;
+uint root;
+uint subwindow;
+uint time;
+int x;
+int y;
+int x_root;
+int y_root;
+uint state;
+uint keycode;
+int same_screen;
+}
+struct XModifierKeymap {
+int max_keypermod;
+char * modifiermap;
+}
+struct XTimeCoord {
+uint time;
+short x;
+short y;
+}
+struct XKeyboardState {
+int key_click_percent;
+int bell_percent;
+uint bell_pitch;
+uint bell_duration;
+uint led_mask;
+int global_auto_repeat;
+char [32] auto_repeats;
+}
+struct XKeyboardControl {
+int key_click_percent;
+int bell_percent;
+int bell_pitch;
+int bell_duration;
+int led;
+int led_mode;
+int key;
+int auto_repeat_mode;
+}
+struct XArc {
+short x;
+short y;
+ushort width;
+ushort height;
+short angle1;
+short angle2;
+}
+struct XRectangle {
+short x;
+short y;
+ushort width;
+ushort height;
+}
+struct XPoint {
+short x;
+short y;
+}
+struct XSegment {
+short x1;
+short y1;
+short x2;
+short y2;
+}
+struct XColor {
+uint pixel;
+ushort red;
+ushort green;
+ushort blue;
+char flags;
+char pad;
+}
+struct XWindowChanges {
+int x;
+int y;
+int width;
+int height;
+int border_width;
+uint sibling;
+int stack_mode;
+}
+struct funcs {
+_BCD_func__2099 create_image;
+_BCD_func__2100 destroy_image;
+_BCD_func__2101 get_pixel;
+_BCD_func__2102 put_pixel;
+_BCD_func__2103 sub_image;
+_BCD_func__2104 add_pixel;
+}
+struct _XImage {
+int width;
+int height;
+int xoffset;
+int format;
+char * data;
+int byte_order;
+int bitmap_unit;
+int bitmap_bit_order;
+int bitmap_pad;
+int depth;
+int bytes_per_line;
+int bits_per_pixel;
+uint red_mask;
+uint green_mask;
+uint blue_mask;
+char * obdata;
+funcs f;
+}
+struct XServerInterpretedAddress {
+int typelength;
+int valuelength;
+char * type;
+char * value;
+}
+struct XHostAddress {
+int family;
+int length;
+char * address;
+}
+struct XWindowAttributes {
+int x;
+int y;
+int width;
+int height;
+int border_width;
+int depth;
+Visual * visual;
+uint root;
+int c_class;
+int bit_gravity;
+int win_gravity;
+int backing_store;
+uint backing_planes;
+uint backing_pixel;
+int save_under;
+uint colormap;
+int map_installed;
+int map_state;
+int all_event_masks;
+int your_event_mask;
+int do_not_propagate_mask;
+int override_redirect;
+Screen * screen;
+}
+struct XSetWindowAttributes {
+uint background_pixmap;
+uint background_pixel;
+uint border_pixmap;
+uint border_pixel;
+int bit_gravity;
+int win_gravity;
+int backing_store;
+uint backing_planes;
+uint backing_pixel;
+int save_under;
+int event_mask;
+int do_not_propagate_mask;
+int override_redirect;
+uint colormap;
+uint cursor;
+}
+struct ScreenFormat {
+_XExtData * ext_data;
+int depth;
+int bits_per_pixel;
+int scanline_pad;
+}
+struct Screen {
+_XExtData * ext_data;
+void * display;
+uint root;
+int width;
+int height;
+int mwidth;
+int mheight;
+int ndepths;
+Depth * depths;
+int root_depth;
+Visual * root_visual;
+void * default_gc;
+uint cmap;
+uint white_pixel;
+uint black_pixel;
+int max_maps;
+int min_maps;
+int backing_store;
+int save_unders;
+int root_input_mask;
+}
+struct Depth {
+int depth;
+int nvisuals;
+Visual * visuals;
+}
+struct Visual {
+_XExtData * ext_data;
+uint visualid;
+int c_class;
+uint red_mask;
+uint green_mask;
+uint blue_mask;
+int bits_per_rgb;
+int map_entries;
+}
+struct XGCValues {
+int function_;
+uint plane_mask;
+uint foreground;
+uint background;
+int line_width;
+int line_style;
+int cap_style;
+int join_style;
+int fill_style;
+int fill_rule;
+int arc_mode;
+uint tile;
+uint stipple;
+int ts_x_origin;
+int ts_y_origin;
+uint font;
+int subwindow_mode;
+int graphics_exposures;
+int clip_x_origin;
+int clip_y_origin;
+uint clip_mask;
+int dash_offset;
+char dashes;
+}
+struct XPixmapFormatValues {
+int depth;
+int bits_per_pixel;
+int scanline_pad;
+}
+struct XExtCodes {
+int extension;
+int major_opcode;
+int first_event;
+int first_error;
+}
+struct _XExtData {
+int number;
+_XExtData * next;
+_BCD_func__2075 free_private;
+char * private_data;
+}
+version(DYNLINK){
+extern (C) int function(char *, wchar)_Xwctomb;
+extern (C) int function(wchar *, char *, int)_Xmbtowc;
+extern (C) void function(char *, int, char *, int)XSetAuthorization;
+extern (C) void function(void *, _BCD_func__846, char *)XRemoveConnectionWatch;
+extern (C) int function(void *, _BCD_func__846, char *)XAddConnectionWatch;
+extern (C) void function(void *, int)XProcessInternalConnection;
+extern (C) int function(void *, int * *, int *)XInternalConnectionNumbers;
+extern (C) int function(void *, void *, char *, char *, _BCD_func__969, char *)XUnregisterIMInstantiateCallback;
+extern (C) int function(void *, void *, char *, char *, _BCD_func__969, char *)XRegisterIMInstantiateCallback;
+extern (C) void * function(int, ...)XVaCreateNestedList;
+extern (C) int function(void *, XKeyEvent *, char *, int, uint *, int *)Xutf8LookupString;
+extern (C) int function(void *, XKeyEvent *, wchar *, int, uint *, int *)XwcLookupString;
+extern (C) int function(void *, XKeyEvent *, char *, int, uint *, int *)XmbLookupString;
+extern (C) int function(_XEvent *, uint)XFilterEvent;
+extern (C) void * function(void *)XIMOfIC;
+extern (C) char * function(void *, ...)XGetICValues;
+extern (C) char * function(void *, ...)XSetICValues;
+extern (C) char * function(void *)Xutf8ResetIC;
+extern (C) char * function(void *)XmbResetIC;
+extern (C) wchar * function(void *)XwcResetIC;
+extern (C) void function(void *)XUnsetICFocus;
+extern (C) void function(void *)XSetICFocus;
+extern (C) void function(void *)XDestroyIC;
+extern (C) void * function(void *, ...)XCreateIC;
+extern (C) char * function(void *)XLocaleOfIM;
+extern (C) void * function(void *)XDisplayOfIM;
+extern (C) char * function(void *, ...)XSetIMValues;
+extern (C) char * function(void *, ...)XGetIMValues;
+extern (C) int function(void *)XCloseIM;
+extern (C) void * function(void *, void *, char *, char *)XOpenIM;
+extern (C) void function(void *, uint, void *, void *, int, int, char *, int)Xutf8DrawImageString;
+extern (C) void function(void *, uint, void *, void *, int, int, wchar *, int)XwcDrawImageString;
+extern (C) void function(void *, uint, void *, void *, int, int, char *, int)XmbDrawImageString;
+extern (C) void function(void *, uint, void *, void *, int, int, char *, int)Xutf8DrawString;
+extern (C) void function(void *, uint, void *, void *, int, int, wchar *, int)XwcDrawString;
+extern (C) void function(void *, uint, void *, void *, int, int, char *, int)XmbDrawString;
+extern (C) void function(void *, uint, void *, int, int, XmbTextItem *, int)Xutf8DrawText;
+extern (C) void function(void *, uint, void *, int, int, XwcTextItem *, int)XwcDrawText;
+extern (C) void function(void *, uint, void *, int, int, XmbTextItem *, int)XmbDrawText;
+extern (C) int function(void *, char *, int, XRectangle *, XRectangle *, int, int *, XRectangle *, XRectangle *)Xutf8TextPerCharExtents;
+extern (C) int function(void *, wchar *, int, XRectangle *, XRectangle *, int, int *, XRectangle *, XRectangle *)XwcTextPerCharExtents;
+extern (C) int function(void *, char *, int, XRectangle *, XRectangle *, int, int *, XRectangle *, XRectangle *)XmbTextPerCharExtents;
+extern (C) int function(void *, char *, int, XRectangle *, XRectangle *)Xutf8TextExtents;
+extern (C) int function(void *, wchar *, int, XRectangle *, XRectangle *)XwcTextExtents;
+extern (C) int function(void *, char *, int, XRectangle *, XRectangle *)XmbTextExtents;
+extern (C) int function(void *, char *, int)Xutf8TextEscapement;
+extern (C) int function(void *, wchar *, int)XwcTextEscapement;
+extern (C) int function(void *, char *, int)XmbTextEscapement;
+extern (C) XFontSetExtents * function(void *)XExtentsOfFontSet;
+extern (C) int function(void *)XContextualDrawing;
+extern (C) int function(void *)XDirectionalDependentDrawing;
+extern (C) int function(void *)XContextDependentDrawing;
+extern (C) char * function(void *)XLocaleOfFontSet;
+extern (C) char * function(void *)XBaseFontNameListOfFontSet;
+extern (C) int function(void *, XFontStruct * * *, char * * *)XFontsOfFontSet;
+extern (C) void function(void *, void *)XFreeFontSet;
+extern (C) void * function(void *, char *, char * * *, int *, char * *)XCreateFontSet;
+extern (C) char * function(void *, ...)XGetOCValues;
+extern (C) char * function(void *, ...)XSetOCValues;
+extern (C) void * function(void *)XOMOfOC;
+extern (C) void function(void *)XDestroyOC;
+extern (C) void * function(void *, ...)XCreateOC;
+extern (C) char * function(void *)XLocaleOfOM;
+extern (C) void * function(void *)XDisplayOfOM;
+extern (C) char * function(void *, ...)XGetOMValues;
+extern (C) char * function(void *, ...)XSetOMValues;
+extern (C) int function(void *)XCloseOM;
+extern (C) void * function(void *, void *, char *, char *)XOpenOM;
+extern (C) char * function(char *)XSetLocaleModifiers;
+extern (C) int function()XSupportsLocale;
+extern (C) int function(void *, char *, uint, uint, uint, int, int)XWriteBitmapFile;
+extern (C) int function(void *, uint, int, _XEvent *)XWindowEvent;
+extern (C) int function(Screen *)XWidthOfScreen;
+extern (C) int function(Screen *)XWidthMMOfScreen;
+extern (C) int function(void *, uint, uint, int, int, uint, uint, int, int)XWarpPointer;
+extern (C) int function(void *)XVendorRelease;
+extern (C) int function(void *, uint)XUnmapWindow;
+extern (C) int function(void *, uint)XUnmapSubwindows;
+extern (C) int function(void *, uint)XUnloadFont;
+extern (C) int function(void *, uint)XUninstallColormap;
+extern (C) int function(void *)XUngrabServer;
+extern (C) int function(void *, uint)XUngrabPointer;
+extern (C) int function(void *, uint)XUngrabKeyboard;
+extern (C) int function(void *, int, uint, uint)XUngrabKey;
+extern (C) int function(void *, uint, uint, uint)XUngrabButton;
+extern (C) int function(void *, uint)XUndefineCursor;
+extern (C) int function(void *, uint, uint, int, int, int *, int *, uint *)XTranslateCoordinates;
+extern (C) int function(XFontStruct *, XChar2b *, int)XTextWidth16;
+extern (C) int function(XFontStruct *, char *, int)XTextWidth;
+extern (C) int function(XFontStruct *, XChar2b *, int, int *, int *, int *, XCharStruct *)XTextExtents16;
+extern (C) int function(XFontStruct *, char *, int, int *, int *, int *, XCharStruct *)XTextExtents;
+extern (C) int function(void *, int)XSync;
+extern (C) int function(void *, uint, char *, uint, int)XStoreNamedColor;
+extern (C) int function(void *, uint, char *)XStoreName;
+extern (C) int function(void *, uint, XColor *, int)XStoreColors;
+extern (C) int function(void *, uint, XColor *)XStoreColor;
+extern (C) int function(void *, char *, int)XStoreBytes;
+extern (C) int function(void *, char *, int, int)XStoreBuffer;
+extern (C) int function(void *, uint, uint)XSetWindowColormap;
+extern (C) int function(void *, uint, uint)XSetWindowBorderWidth;
+extern (C) int function(void *, uint, uint)XSetWindowBorderPixmap;
+extern (C) int function(void *, uint, uint)XSetWindowBorder;
+extern (C) int function(void *, uint, uint)XSetWindowBackgroundPixmap;
+extern (C) int function(void *, uint, uint)XSetWindowBackground;
+extern (C) int function(void *, void *, uint)XSetTile;
+extern (C) int function(void *, void *, int, int)XSetTSOrigin;
+extern (C) int function(void *, void *, int)XSetSubwindowMode;
+extern (C) int function(void *, void *, uint)XSetStipple;
+extern (C) int function(void *, void *, uint, uint, int, uint)XSetState;
+extern (C) int function(void *, uint, uint, uint)XSetSelectionOwner;
+extern (C) int function(void *, int, int, int, int)XSetScreenSaver;
+extern (C) int function(void *, char *, int)XSetPointerMapping;
+extern (C) int function(void *, void *, uint)XSetPlaneMask;
+extern (C) int function(void *, XModifierKeymap *)XSetModifierMapping;
+extern (C) int function(void *, void *, uint, int, int, int)XSetLineAttributes;
+extern (C) int function(void *, uint, int, uint)XSetInputFocus;
+extern (C) int function(void *, uint, char *)XSetIconName;
+extern (C) int function(void *, void *, int)XSetGraphicsExposures;
+extern (C) int function(void *, void *, int)XSetFunction;
+extern (C) int function(void *, void *, uint)XSetForeground;
+extern (C) int function(void *, char * *, int)XSetFontPath;
+extern (C) int function(void *, void *, uint)XSetFont;
+extern (C) int function(void *, void *, int)XSetFillStyle;
+extern (C) int function(void *, void *, int)XSetFillRule;
+extern (C) int function(void *, void *, int, char *, int)XSetDashes;
+extern (C) int function(void *, uint, char * *, int)XSetCommand;
+extern (C) int function(void *, int)XSetCloseDownMode;
+extern (C) int function(void *, void *, int, int, XRectangle *, int, int)XSetClipRectangles;
+extern (C) int function(void *, void *, int, int)XSetClipOrigin;
+extern (C) int function(void *, void *, uint)XSetClipMask;
+extern (C) int function(void *, void *, uint)XSetBackground;
+extern (C) int function(void *, void *, int)XSetArcMode;
+extern (C) int function(void *, int)XSetAccessControl;
+extern (C) int function(void *, uint, int, int, _XEvent *)XSendEvent;
+extern (C) int function(void *, uint, int)XSelectInput;
+extern (C) int function(void *)XScreenCount;
+extern (C) int function(void *, uint, uint *, int, int)XRotateWindowProperties;
+extern (C) int function(void *, int)XRotateBuffers;
+extern (C) int function(void *, uint *, int)XRestackWindows;
+extern (C) int function(void *, uint, uint, uint)XResizeWindow;
+extern (C) int function(void *)XResetScreenSaver;
+extern (C) int function(void *, uint, uint, int, int)XReparentWindow;
+extern (C) int function(void *, XHostAddress *, int)XRemoveHosts;
+extern (C) int function(void *, XHostAddress *)XRemoveHost;
+extern (C) int function(void *, uint)XRemoveFromSaveSet;
+extern (C) int function(XMappingEvent *)XRefreshKeyboardMapping;
+extern (C) int function(void *, uint, XColor *, XColor *)XRecolorCursor;
+extern (C) int function(void *, uint, uint *, int, char *, int)XRebindKeysym;
+extern (C) int function(char *, uint *, uint *, char * *, int *, int *)XReadBitmapFileData;
+extern (C) int function(void *, uint, char *, uint *, uint *, uint *, int *, int *)XReadBitmapFile;
+extern (C) int function(void *, uint)XRaiseWindow;
+extern (C) int function(void *, uint, uint *, uint *, uint * *, uint *)XQueryTree;
+extern (C) int function(void *, uint, XChar2b *, int, int *, int *, int *, XCharStruct *)XQueryTextExtents16;
+extern (C) int function(void *, uint, char *, int, int *, int *, int *, XCharStruct *)XQueryTextExtents;
+extern (C) int function(void *, uint, uint *, uint *, int *, int *, int *, int *, uint *)XQueryPointer;
+extern (C) int function(void *, char *)XQueryKeymap;
+extern (C) int function(void *, char *, int *, int *, int *)XQueryExtension;
+extern (C) int function(void *, uint, XColor *, int)XQueryColors;
+extern (C) int function(void *, uint, XColor *)XQueryColor;
+extern (C) int function(void *, uint, uint, uint, uint *, uint *)XQueryBestTile;
+extern (C) int function(void *, uint, uint, uint, uint *, uint *)XQueryBestStipple;
+extern (C) int function(void *, int, uint, uint, uint, uint *, uint *)XQueryBestSize;
+extern (C) int function(void *, uint, uint, uint, uint *, uint *)XQueryBestCursor;
+extern (C) int function(void *)XQLength;
+extern (C) int function(void *, uint, void *, _XImage *, int, int, int, int, uint, uint)XPutImage;
+extern (C) int function(void *, _XEvent *)XPutBackEvent;
+extern (C) int function(void *)XProtocolVersion;
+extern (C) int function(void *)XProtocolRevision;
+extern (C) int function(Screen *)XPlanesOfScreen;
+extern (C) int function(void *)XPending;
+extern (C) int function(void *, _XEvent *, _BCD_func__1795, char *)XPeekIfEvent;
+extern (C) int function(void *, _XEvent *)XPeekEvent;
+extern (C) int function(char *, int *, int *, uint *, uint *)XParseGeometry;
+extern (C) int function(void *, uint, char *, XColor *)XParseColor;
+extern (C) int function(void *)XNoOp;
+extern (C) int function(void *, _XEvent *)XNextEvent;
+extern (C) int function(void *, uint, int, int)XMoveWindow;
+extern (C) int function(void *, uint, int, int, uint, uint)XMoveResizeWindow;
+extern (C) int function(Screen *)XMinCmapsOfScreen;
+extern (C) int function(Screen *)XMaxCmapsOfScreen;
+extern (C) int function(void *, int, _XEvent *)XMaskEvent;
+extern (C) int function(void *, uint)XMapWindow;
+extern (C) int function(void *, uint)XMapSubwindows;
+extern (C) int function(void *, uint)XMapRaised;
+extern (C) int function(void *, uint)XLowerWindow;
+extern (C) int function(void *, uint, char *, XColor *, XColor *)XLookupColor;
+extern (C) int function(void *, uint)XKillClient;
+extern (C) char function(void *, uint)XKeysymToKeycode;
+extern (C) int function(void *, uint)XInstallColormap;
+extern (C) int function(void *)XImageByteOrder;
+extern (C) int function(void *, _XEvent *, _BCD_func__1795, char *)XIfEvent;
+extern (C) int function(Screen *)XHeightOfScreen;
+extern (C) int function(Screen *)XHeightMMOfScreen;
+extern (C) int function(void *)XGrabServer;
+extern (C) int function(void *, uint, int, uint, int, int, uint, uint, uint)XGrabPointer;
+extern (C) int function(void *, uint, int, int, int, uint)XGrabKeyboard;
+extern (C) int function(void *, int, uint, uint, int, int, int)XGrabKey;
+extern (C) int function(void *, uint, uint, uint, int, uint, int, int, uint, uint)XGrabButton;
+extern (C) int function(void *, uint, XWindowAttributes *)XGetWindowAttributes;
+extern (C) int function(void *, uint, uint, int, int, int, uint, uint *, int *, uint *, uint *, char * *)XGetWindowProperty;
+extern (C) int function(void *, uint, uint *)XGetTransientForHint;
+extern (C) int function(void *, int *, int *, int *, int *)XGetScreenSaver;
+extern (C) int function(void *, char *, int)XGetPointerMapping;
+extern (C) int function(void *, int *, int *, int *)XGetPointerControl;
+extern (C) int function(void *, XKeyboardState *)XGetKeyboardControl;
+extern (C) int function(void *, uint *, int *)XGetInputFocus;
+extern (C) int function(void *, uint, char * *)XGetIconName;
+extern (C) int function(void *, uint, uint *, int *, int *, uint *, uint *, uint *, uint *)XGetGeometry;
+extern (C) int function(void *, void *, uint, XGCValues *)XGetGCValues;
+extern (C) int function(XFontStruct *, uint, uint *)XGetFontProperty;
+extern (C) int function(void *, int, char *, int)XGetErrorText;
+extern (C) int function(void *, char *, char *, char *, char *, int)XGetErrorDatabaseText;
+extern (C) int function(void *, int, char *, char *, uint, uint, uint, int, int, int *, int *, int *, int *)XGeometry;
+extern (C) int function(void *, uint)XFreePixmap;
+extern (C) int function(XModifierKeymap *)XFreeModifiermap;
+extern (C) int function(void *, void *)XFreeGC;
+extern (C) int function(char * *)XFreeFontPath;
+extern (C) int function(char * *)XFreeFontNames;
+extern (C) int function(char * *, XFontStruct *, int)XFreeFontInfo;
+extern (C) int function(void *, XFontStruct *)XFreeFont;
+extern (C) int function(char * *)XFreeExtensionList;
+extern (C) int function(void *, uint)XFreeCursor;
+extern (C) int function(void *, uint, uint *, int, uint)XFreeColors;
+extern (C) int function(void *, uint)XFreeColormap;
+extern (C) int function(void *)XFree;
+extern (C) int function(void *, int)XForceScreenSaver;
+extern (C) int function(void *)XFlush;
+extern (C) int function(void *, uint, void *, XRectangle *, int)XFillRectangles;
+extern (C) int function(void *, uint, void *, int, int, uint, uint)XFillRectangle;
+extern (C) int function(void *, uint, void *, XPoint *, int, int, int)XFillPolygon;
+extern (C) int function(void *, uint, void *, XArc *, int)XFillArcs;
+extern (C) int function(void *, uint, void *, int, int, uint, uint, int, int)XFillArc;
+extern (C) int function(void *, uint, char * *)XFetchName;
+extern (C) int function(void *, int)XEventsQueued;
+extern (C) int function(void *)XEnableAccessControl;
+extern (C) int function(void *, uint, void *, int, int, XTextItem16 *, int)XDrawText16;
+extern (C) int function(void *, uint, void *, int, int, XTextItem *, int)XDrawText;
+extern (C) int function(void *, uint, void *, int, int, XChar2b *, int)XDrawString16;
+extern (C) int function(void *, uint, void *, int, int, char *, int)XDrawString;
+extern (C) int function(void *, uint, void *, XSegment *, int)XDrawSegments;
+extern (C) int function(void *, uint, void *, XRectangle *, int)XDrawRectangles;
+extern (C) int function(void *, uint, void *, int, int, uint, uint)XDrawRectangle;
+extern (C) int function(void *, uint, void *, XPoint *, int, int)XDrawPoints;
+extern (C) int function(void *, uint, void *, int, int)XDrawPoint;
+extern (C) int function(void *, uint, void *, XPoint *, int, int)XDrawLines;
+extern (C) int function(void *, uint, void *, int, int, int, int)XDrawLine;
+extern (C) int function(void *, uint, void *, int, int, XChar2b *, int)XDrawImageString16;
+extern (C) int function(void *, uint, void *, int, int, char *, int)XDrawImageString;
+extern (C) int function(void *, uint, void *, XArc *, int)XDrawArcs;
+extern (C) int function(void *, uint, void *, int, int, uint, uint, int, int)XDrawArc;
+extern (C) int function(void *, int)XDisplayWidthMM;
+extern (C) int function(void *, int)XDisplayWidth;
+extern (C) int function(void *, int)XDisplayPlanes;
+extern (C) int function(void *, int *, int *)XDisplayKeycodes;
+extern (C) int function(void *, int)XDisplayHeightMM;
+extern (C) int function(void *, int)XDisplayHeight;
+extern (C) int function(void *, int)XDisplayCells;
+extern (C) int function(void *)XDisableAccessControl;
+extern (C) int function(Screen *)XDoesSaveUnders;
+extern (C) int function(Screen *)XDoesBackingStore;
+extern (C) int function(void *, uint)XDestroySubwindows;
+extern (C) int function(void *, uint)XDestroyWindow;
+extern (C) int function(void *, uint, uint)XDeleteProperty;
+extern (C) int function(void *, uint, uint)XDefineCursor;
+extern (C) int function(void *)XDefaultScreen;
+extern (C) int function(Screen *)XDefaultDepthOfScreen;
+extern (C) int function(void *, int)XDefaultDepth;
+extern (C) int function(void *, uint, uint, void *, int, int, uint, uint, int, int, uint)XCopyPlane;
+extern (C) int function(void *, void *, uint, void *)XCopyGC;
+extern (C) int function(void *, uint, uint, void *, int, int, uint, uint, int, int)XCopyArea;
+extern (C) int function(void *, uint, uint, uint, uint, uint)XConvertSelection;
+extern (C) int function(void *)XConnectionNumber;
+extern (C) int function(void *, uint, uint, XWindowChanges *)XConfigureWindow;
+extern (C) int function(void *)XCloseDisplay;
+extern (C) int function(void *, uint)XClearWindow;
+extern (C) int function(void *, uint, int, int, uint, uint, int)XClearArea;
+extern (C) int function(void *, uint)XCirculateSubwindowsUp;
+extern (C) int function(void *, uint)XCirculateSubwindowsDown;
+extern (C) int function(void *, uint, int)XCirculateSubwindows;
+extern (C) int function(void *, uint, int, _XEvent *)XCheckWindowEvent;
+extern (C) int function(void *, uint, int, _XEvent *)XCheckTypedWindowEvent;
+extern (C) int function(void *, int, _XEvent *)XCheckTypedEvent;
+extern (C) int function(void *, int, _XEvent *)XCheckMaskEvent;
+extern (C) int function(void *, _XEvent *, _BCD_func__1795, char *)XCheckIfEvent;
+extern (C) int function(void *, uint, uint, XSetWindowAttributes *)XChangeWindowAttributes;
+extern (C) int function(void *, uint, int)XChangeSaveSet;
+extern (C) int function(void *, uint, uint, uint, int, int, char *, int)XChangeProperty;
+extern (C) int function(void *, int, int, int, int, int)XChangePointerControl;
+extern (C) int function(void *, int, int, uint *, int)XChangeKeyboardMapping;
+extern (C) int function(void *, uint, XKeyboardControl *)XChangeKeyboardControl;
+extern (C) int function(void *, void *, uint, XGCValues *)XChangeGC;
+extern (C) int function(void *, uint, uint, uint)XChangeActivePointerGrab;
+extern (C) int function(Screen *)XCellsOfScreen;
+extern (C) int function(void *)XBitmapUnit;
+extern (C) int function(void *)XBitmapPad;
+extern (C) int function(void *)XBitmapBitOrder;
+extern (C) int function(void *, int)XBell;
+extern (C) int function(void *)XAutoRepeatOn;
+extern (C) int function(void *)XAutoRepeatOff;
+extern (C) int function(void *, int, uint)XAllowEvents;
+extern (C) int function(void *, uint, char *, XColor *, XColor *)XAllocNamedColor;
+extern (C) int function(void *, uint, int, uint *, int, int, int, int, uint *, uint *, uint *)XAllocColorPlanes;
+extern (C) int function(void *, uint, int, uint *, uint, uint *, uint)XAllocColorCells;
+extern (C) int function(void *, uint, XColor *)XAllocColor;
+extern (C) int function(void *, uint)XAddToSaveSet;
+extern (C) int function(_XExtData * *, _XExtData *)XAddToExtensionList;
+extern (C) int function(void *, XHostAddress *, int)XAddHosts;
+extern (C) int function(void *, XHostAddress *)XAddHost;
+extern (C) int function(void *)XActivateScreenSaver;
+extern (C) int function(void *, uint, uint)XSetTransientForHint;
+extern (C) void function(char * *)XFreeStringList;
+extern (C) int function(void *, uint, uint *, int)XSetWMColormapWindows;
+extern (C) int function(void *, uint, uint * *, int *)XGetWMColormapWindows;
+extern (C) int function(void *, uint, char * * *, int *)XGetCommand;
+extern (C) int function(void *, uint, int)XWithdrawWindow;
+extern (C) int function(void *, uint, int)XIconifyWindow;
+extern (C) int function(void *, uint, uint *, int)XSetWMProtocols;
+extern (C) int function(void *, uint, uint * *, int *)XGetWMProtocols;
+extern (C) int function(void *, uint, int, uint, XWindowChanges *)XReconfigureWMWindow;
+extern (C) int * function(void *, int, int *)XListDepths;
+extern (C) XPixmapFormatValues * function(void *, int *)XListPixmapFormats;
+extern (C) _BCD_func__894 function(_BCD_func__894)XSetIOErrorHandler;
+extern (C) _BCD_func__895 function(_BCD_func__895)XSetErrorHandler;
+extern (C) int function(Screen *)XScreenNumberOfScreen;
+extern (C) int function(Screen *)XEventMaskOfScreen;
+extern (C) Screen * function(void *)XDefaultScreenOfDisplay;
+extern (C) Screen * function(void *, int)XScreenOfDisplay;
+extern (C) void * function(Screen *)XDisplayOfScreen;
+extern (C) uint function(Screen *)XDefaultColormapOfScreen;
+extern (C) uint function(void *, int)XDefaultColormap;
+extern (C) char * function(void *)XDisplayString;
+extern (C) char * function(void *)XServerVendor;
+extern (C) uint function(void *)XLastKnownRequestProcessed;
+extern (C) uint function(void *)XNextRequest;
+extern (C) uint function(Screen *)XWhitePixelOfScreen;
+extern (C) uint function(Screen *)XBlackPixelOfScreen;
+extern (C) uint function()XAllPlanes;
+extern (C) uint function(void *, int)XWhitePixel;
+extern (C) uint function(void *, int)XBlackPixel;
+extern (C) void * function(Screen *)XDefaultGCOfScreen;
+extern (C) void * function(void *, int)XDefaultGC;
+extern (C) Visual * function(Screen *)XDefaultVisualOfScreen;
+extern (C) Visual * function(void *, int)XDefaultVisual;
+extern (C) uint function(Screen *)XRootWindowOfScreen;
+extern (C) uint function(void *)XDefaultRootWindow;
+extern (C) uint function(void *, int)XRootWindow;
+extern (C) _XExtData * * function(XEDataObject)XEHeadOfExtensionList;
+extern (C) _XExtData * function(_XExtData * *, int)XFindOnExtensionList;
+extern (C) XExtCodes * function(void *)XAddExtension;
+extern (C) XExtCodes * function(void *, char *)XInitExtension;
+extern (C) void function(void *)XUnlockDisplay;
+extern (C) void function(void *)XLockDisplay;
+extern (C) int function()XInitThreads;
+extern (C) uint function(Visual *)XVisualIDFromVisual;
+extern (C) uint function(void *)XDisplayMotionBufferSize;
+extern (C) char * function(Screen *)XScreenResourceString;
+extern (C) char * function(void *)XResourceManagerString;
+extern (C) int function(void *)XExtendedMaxRequestSize;
+extern (C) int function(void *)XMaxRequestSize;
+extern (C) uint function(char *)XStringToKeysym;
+extern (C) uint * function(void *, char, int, int *)XGetKeyboardMapping;
+extern (C) uint function(XKeyEvent *, int)XLookupKeysym;
+extern (C) uint function(void *, char, int)XKeycodeToKeysym;
+extern (C) XHostAddress * function(void *, int *, int *)XListHosts;
+extern (C) uint * function(void *, uint, int *)XListProperties;
+extern (C) char * * function(void *, int *)XListExtensions;
+extern (C) char * * function(void *, int *)XGetFontPath;
+extern (C) char * * function(void *, char *, int, int *, XFontStruct * *)XListFontsWithInfo;
+extern (C) char * * function(void *, char *, int, int *)XListFonts;
+extern (C) uint * function(void *, uint, int *)XListInstalledColormaps;
+extern (C) uint function(void *, uint, int, int, uint, uint, uint, int, uint, Visual *, uint, XSetWindowAttributes *)XCreateWindow;
+extern (C) uint function(void *, uint)XGetSelectionOwner;
+extern (C) uint function(void *, uint, int, int, uint, uint, uint, uint, uint)XCreateSimpleWindow;
+extern (C) uint function(void *, uint, char *, uint, uint, uint, uint, uint)XCreatePixmapFromBitmapData;
+extern (C) uint function(void *, uint, char *, uint, uint)XCreateBitmapFromData;
+extern (C) uint function(void *, uint, uint, uint, uint)XCreatePixmap;
+extern (C) void function(void *, void *)XFlushGC;
+extern (C) uint function(void *)XGContextFromGC;
+extern (C) void * function(void *, uint, uint, XGCValues *)XCreateGC;
+extern (C) uint function(void *, char *)XLoadFont;
+extern (C) uint function(void *, uint)XCreateFontCursor;
+extern (C) uint function(void *, uint, uint, uint, uint, XColor *, XColor *)XCreateGlyphCursor;
+extern (C) uint function(void *, uint, uint, XColor *, XColor *, uint, uint)XCreatePixmapCursor;
+extern (C) uint function(void *, uint, Visual *, int)XCreateColormap;
+extern (C) uint function(void *, uint)XCopyColormapAndFree;
+extern (C) int function(void *, char * *, int, int, uint *)XInternAtoms;
+extern (C) uint function(void *, char *, int)XInternAtom;
+extern (C) _BCD_func__894 function(void *, _BCD_func__894)XSetAfterFunction;
+extern (C) _BCD_func__894 function(void *, int)XSynchronize;
+extern (C) char * function(uint)XKeysymToString;
+extern (C) char * function(char *)XDisplayName;
+extern (C) char * function(void *, char *, char *)XGetDefault;
+extern (C) int function(void *, uint *, int, char * *)XGetAtomNames;
+extern (C) char * function(void *, uint)XGetAtomName;
+extern (C) char * function(void *, int *, int)XFetchBuffer;
+extern (C) char * function(void *, int *)XFetchBytes;
+extern (C) void function()XrmInitialize;
+extern (C) void * function(char *)XOpenDisplay;
+extern (C) _XImage * function(void *, uint, int, int, uint, uint, uint, int, _XImage *, int, int)XGetSubImage;
+extern (C) _XImage * function(void *, uint, int, int, uint, uint, uint, int)XGetImage;
+extern (C) int function(_XImage *)XInitImage;
+extern (C) _XImage * function(void *, Visual *, uint, int, int, char *, uint, uint, int, int)XCreateImage;
+extern (C) XModifierKeymap * function(int)XNewModifiermap;
+extern (C) XModifierKeymap * function(XModifierKeymap *, char, int)XInsertModifiermapEntry;
+extern (C) XModifierKeymap * function(void *)XGetModifierMapping;
+extern (C) XModifierKeymap * function(XModifierKeymap *, char, int)XDeleteModifiermapEntry;
+extern (C) XTimeCoord * function(void *, uint, uint, uint, int *)XGetMotionEvents;
+extern (C) XFontStruct * function(void *, uint)XQueryFont;
+extern (C) XFontStruct * function(void *, char *)XLoadQueryFont;
+extern (C) extern int* _Xdebug;
+extern (C) int function(char *, int)_Xmblen;
+
+
+Symbol[] symbols = [
+    { "_Xwctomb",  cast(void**)& _Xwctomb},
+    { "_Xmbtowc",  cast(void**)& _Xmbtowc},
+    { "XSetAuthorization",  cast(void**)& XSetAuthorization},
+    { "XRemoveConnectionWatch",  cast(void**)& XRemoveConnectionWatch},
+    { "XAddConnectionWatch",  cast(void**)& XAddConnectionWatch},
+    { "XProcessInternalConnection",  cast(void**)& XProcessInternalConnection},
+    { "XInternalConnectionNumbers",  cast(void**)& XInternalConnectionNumbers},
+    { "XUnregisterIMInstantiateCallback",  cast(void**)& XUnregisterIMInstantiateCallback},
+    { "XRegisterIMInstantiateCallback",  cast(void**)& XRegisterIMInstantiateCallback},
+    { "XVaCreateNestedList",  cast(void**)& XVaCreateNestedList},
+    { "Xutf8LookupString",  cast(void**)& Xutf8LookupString},
+    { "XwcLookupString",  cast(void**)& XwcLookupString},
+    { "XmbLookupString",  cast(void**)& XmbLookupString},
+    { "XFilterEvent",  cast(void**)& XFilterEvent},
+    { "XIMOfIC",  cast(void**)& XIMOfIC},
+    { "XGetICValues",  cast(void**)& XGetICValues},
+    { "XSetICValues",  cast(void**)& XSetICValues},
+    { "Xutf8ResetIC",  cast(void**)& Xutf8ResetIC},
+    { "XmbResetIC",  cast(void**)& XmbResetIC},
+    { "XwcResetIC",  cast(void**)& XwcResetIC},
+    { "XUnsetICFocus",  cast(void**)& XUnsetICFocus},
+    { "XSetICFocus",  cast(void**)& XSetICFocus},
+    { "XDestroyIC",  cast(void**)& XDestroyIC},
+    { "XCreateIC",  cast(void**)& XCreateIC},
+    { "XLocaleOfIM",  cast(void**)& XLocaleOfIM},
+    { "XDisplayOfIM",  cast(void**)& XDisplayOfIM},
+    { "XSetIMValues",  cast(void**)& XSetIMValues},
+    { "XGetIMValues",  cast(void**)& XGetIMValues},
+    { "XCloseIM",  cast(void**)& XCloseIM},
+    { "XOpenIM",  cast(void**)& XOpenIM},
+    { "Xutf8DrawImageString",  cast(void**)& Xutf8DrawImageString},
+    { "XwcDrawImageString",  cast(void**)& XwcDrawImageString},
+    { "XmbDrawImageString",  cast(void**)& XmbDrawImageString},
+    { "Xutf8DrawString",  cast(void**)& Xutf8DrawString},
+    { "XwcDrawString",  cast(void**)& XwcDrawString},
+    { "XmbDrawString",  cast(void**)& XmbDrawString},
+    { "Xutf8DrawText",  cast(void**)& Xutf8DrawText},
+    { "XwcDrawText",  cast(void**)& XwcDrawText},
+    { "XmbDrawText",  cast(void**)& XmbDrawText},
+    { "Xutf8TextPerCharExtents",  cast(void**)& Xutf8TextPerCharExtents},
+    { "XwcTextPerCharExtents",  cast(void**)& XwcTextPerCharExtents},
+    { "XmbTextPerCharExtents",  cast(void**)& XmbTextPerCharExtents},
+    { "Xutf8TextExtents",  cast(void**)& Xutf8TextExtents},
+    { "XwcTextExtents",  cast(void**)& XwcTextExtents},
+    { "XmbTextExtents",  cast(void**)& XmbTextExtents},
+    { "Xutf8TextEscapement",  cast(void**)& Xutf8TextEscapement},
+    { "XwcTextEscapement",  cast(void**)& XwcTextEscapement},
+    { "XmbTextEscapement",  cast(void**)& XmbTextEscapement},
+    { "XExtentsOfFontSet",  cast(void**)& XExtentsOfFontSet},
+    { "XContextualDrawing",  cast(void**)& XContextualDrawing},
+    { "XDirectionalDependentDrawing",  cast(void**)& XDirectionalDependentDrawing},
+    { "XContextDependentDrawing",  cast(void**)& XContextDependentDrawing},
+    { "XLocaleOfFontSet",  cast(void**)& XLocaleOfFontSet},
+    { "XBaseFontNameListOfFontSet",  cast(void**)& XBaseFontNameListOfFontSet},
+    { "XFontsOfFontSet",  cast(void**)& XFontsOfFontSet},
+    { "XFreeFontSet",  cast(void**)& XFreeFontSet},
+    { "XCreateFontSet",  cast(void**)& XCreateFontSet},
+    { "XGetOCValues",  cast(void**)& XGetOCValues},
+    { "XSetOCValues",  cast(void**)& XSetOCValues},
+    { "XOMOfOC",  cast(void**)& XOMOfOC},
+    { "XDestroyOC",  cast(void**)& XDestroyOC},
+    { "XCreateOC",  cast(void**)& XCreateOC},
+    { "XLocaleOfOM",  cast(void**)& XLocaleOfOM},
+    { "XDisplayOfOM",  cast(void**)& XDisplayOfOM},
+    { "XGetOMValues",  cast(void**)& XGetOMValues},
+    { "XSetOMValues",  cast(void**)& XSetOMValues},
+    { "XCloseOM",  cast(void**)& XCloseOM},
+    { "XOpenOM",  cast(void**)& XOpenOM},
+    { "XSetLocaleModifiers",  cast(void**)& XSetLocaleModifiers},
+    { "XSupportsLocale",  cast(void**)& XSupportsLocale},
+    { "XWriteBitmapFile",  cast(void**)& XWriteBitmapFile},
+    { "XWindowEvent",  cast(void**)& XWindowEvent},
+    { "XWidthOfScreen",  cast(void**)& XWidthOfScreen},
+    { "XWidthMMOfScreen",  cast(void**)& XWidthMMOfScreen},
+    { "XWarpPointer",  cast(void**)& XWarpPointer},
+    { "XVendorRelease",  cast(void**)& XVendorRelease},
+    { "XUnmapWindow",  cast(void**)& XUnmapWindow},
+    { "XUnmapSubwindows",  cast(void**)& XUnmapSubwindows},
+    { "XUnloadFont",  cast(void**)& XUnloadFont},
+    { "XUninstallColormap",  cast(void**)& XUninstallColormap},
+    { "XUngrabServer",  cast(void**)& XUngrabServer},
+    { "XUngrabPointer",  cast(void**)& XUngrabPointer},
+    { "XUngrabKeyboard",  cast(void**)& XUngrabKeyboard},
+    { "XUngrabKey",  cast(void**)& XUngrabKey},
+    { "XUngrabButton",  cast(void**)& XUngrabButton},
+    { "XUndefineCursor",  cast(void**)& XUndefineCursor},
+    { "XTranslateCoordinates",  cast(void**)& XTranslateCoordinates},
+    { "XTextWidth16",  cast(void**)& XTextWidth16},
+    { "XTextWidth",  cast(void**)& XTextWidth},
+    { "XTextExtents16",  cast(void**)& XTextExtents16},
+    { "XTextExtents",  cast(void**)& XTextExtents},
+    { "XSync",  cast(void**)& XSync},
+    { "XStoreNamedColor",  cast(void**)& XStoreNamedColor},
+    { "XStoreName",  cast(void**)& XStoreName},
+    { "XStoreColors",  cast(void**)& XStoreColors},
+    { "XStoreColor",  cast(void**)& XStoreColor},
+    { "XStoreBytes",  cast(void**)& XStoreBytes},
+    { "XStoreBuffer",  cast(void**)& XStoreBuffer},
+    { "XSetWindowColormap",  cast(void**)& XSetWindowColormap},
+    { "XSetWindowBorderWidth",  cast(void**)& XSetWindowBorderWidth},
+    { "XSetWindowBorderPixmap",  cast(void**)& XSetWindowBorderPixmap},
+    { "XSetWindowBorder",  cast(void**)& XSetWindowBorder},
+    { "XSetWindowBackgroundPixmap",  cast(void**)& XSetWindowBackgroundPixmap},
+    { "XSetWindowBackground",  cast(void**)& XSetWindowBackground},
+    { "XSetTile",  cast(void**)& XSetTile},
+    { "XSetTSOrigin",  cast(void**)& XSetTSOrigin},
+    { "XSetSubwindowMode",  cast(void**)& XSetSubwindowMode},
+    { "XSetStipple",  cast(void**)& XSetStipple},
+    { "XSetState",  cast(void**)& XSetState},
+    { "XSetSelectionOwner",  cast(void**)& XSetSelectionOwner},
+    { "XSetScreenSaver",  cast(void**)& XSetScreenSaver},
+    { "XSetPointerMapping",  cast(void**)& XSetPointerMapping},
+    { "XSetPlaneMask",  cast(void**)& XSetPlaneMask},
+    { "XSetModifierMapping",  cast(void**)& XSetModifierMapping},
+    { "XSetLineAttributes",  cast(void**)& XSetLineAttributes},
+    { "XSetInputFocus",  cast(void**)& XSetInputFocus},
+    { "XSetIconName",  cast(void**)& XSetIconName},
+    { "XSetGraphicsExposures",  cast(void**)& XSetGraphicsExposures},
+    { "XSetFunction",  cast(void**)& XSetFunction},
+    { "XSetForeground",  cast(void**)& XSetForeground},
+    { "XSetFontPath",  cast(void**)& XSetFontPath},
+    { "XSetFont",  cast(void**)& XSetFont},
+    { "XSetFillStyle",  cast(void**)& XSetFillStyle},
+    { "XSetFillRule",  cast(void**)& XSetFillRule},
+    { "XSetDashes",  cast(void**)& XSetDashes},
+    { "XSetCommand",  cast(void**)& XSetCommand},
+    { "XSetCloseDownMode",  cast(void**)& XSetCloseDownMode},
+    { "XSetClipRectangles",  cast(void**)& XSetClipRectangles},
+    { "XSetClipOrigin",  cast(void**)& XSetClipOrigin},
+    { "XSetClipMask",  cast(void**)& XSetClipMask},
+    { "XSetBackground",  cast(void**)& XSetBackground},
+    { "XSetArcMode",  cast(void**)& XSetArcMode},
+    { "XSetAccessControl",  cast(void**)& XSetAccessControl},
+    { "XSendEvent",  cast(void**)& XSendEvent},
+    { "XSelectInput",  cast(void**)& XSelectInput},
+    { "XScreenCount",  cast(void**)& XScreenCount},
+    { "XRotateWindowProperties",  cast(void**)& XRotateWindowProperties},
+    { "XRotateBuffers",  cast(void**)& XRotateBuffers},
+    { "XRestackWindows",  cast(void**)& XRestackWindows},
+    { "XResizeWindow",  cast(void**)& XResizeWindow},
+    { "XResetScreenSaver",  cast(void**)& XResetScreenSaver},
+    { "XReparentWindow",  cast(void**)& XReparentWindow},
+    { "XRemoveHosts",  cast(void**)& XRemoveHosts},
+    { "XRemoveHost",  cast(void**)& XRemoveHost},
+    { "XRemoveFromSaveSet",  cast(void**)& XRemoveFromSaveSet},
+    { "XRefreshKeyboardMapping",  cast(void**)& XRefreshKeyboardMapping},
+    { "XRecolorCursor",  cast(void**)& XRecolorCursor},
+    { "XRebindKeysym",  cast(void**)& XRebindKeysym},
+    { "XReadBitmapFileData",  cast(void**)& XReadBitmapFileData},
+    { "XReadBitmapFile",  cast(void**)& XReadBitmapFile},
+    { "XRaiseWindow",  cast(void**)& XRaiseWindow},
+    { "XQueryTree",  cast(void**)& XQueryTree},
+    { "XQueryTextExtents16",  cast(void**)& XQueryTextExtents16},
+    { "XQueryTextExtents",  cast(void**)& XQueryTextExtents},
+    { "XQueryPointer",  cast(void**)& XQueryPointer},
+    { "XQueryKeymap",  cast(void**)& XQueryKeymap},
+    { "XQueryExtension",  cast(void**)& XQueryExtension},
+    { "XQueryColors",  cast(void**)& XQueryColors},
+    { "XQueryColor",  cast(void**)& XQueryColor},
+    { "XQueryBestTile",  cast(void**)& XQueryBestTile},
+    { "XQueryBestStipple",  cast(void**)& XQueryBestStipple},
+    { "XQueryBestSize",  cast(void**)& XQueryBestSize},
+    { "XQueryBestCursor",  cast(void**)& XQueryBestCursor},
+    { "XQLength",  cast(void**)& XQLength},
+    { "XPutImage",  cast(void**)& XPutImage},
+    { "XPutBackEvent",  cast(void**)& XPutBackEvent},
+    { "XProtocolVersion",  cast(void**)& XProtocolVersion},
+    { "XProtocolRevision",  cast(void**)& XProtocolRevision},
+    { "XPlanesOfScreen",  cast(void**)& XPlanesOfScreen},
+    { "XPending",  cast(void**)& XPending},
+    { "XPeekIfEvent",  cast(void**)& XPeekIfEvent},
+    { "XPeekEvent",  cast(void**)& XPeekEvent},
+    { "XParseGeometry",  cast(void**)& XParseGeometry},
+    { "XParseColor",  cast(void**)& XParseColor},
+    { "XNoOp",  cast(void**)& XNoOp},
+    { "XNextEvent",  cast(void**)& XNextEvent},
+    { "XMoveWindow",  cast(void**)& XMoveWindow},
+    { "XMoveResizeWindow",  cast(void**)& XMoveResizeWindow},
+    { "XMinCmapsOfScreen",  cast(void**)& XMinCmapsOfScreen},
+    { "XMaxCmapsOfScreen",  cast(void**)& XMaxCmapsOfScreen},
+    { "XMaskEvent",  cast(void**)& XMaskEvent},
+    { "XMapWindow",  cast(void**)& XMapWindow},
+    { "XMapSubwindows",  cast(void**)& XMapSubwindows},
+    { "XMapRaised",  cast(void**)& XMapRaised},
+    { "XLowerWindow",  cast(void**)& XLowerWindow},
+    { "XLookupColor",  cast(void**)& XLookupColor},
+    { "XKillClient",  cast(void**)& XKillClient},
+    { "XKeysymToKeycode",  cast(void**)& XKeysymToKeycode},
+    { "XInstallColormap",  cast(void**)& XInstallColormap},
+    { "XImageByteOrder",  cast(void**)& XImageByteOrder},
+    { "XIfEvent",  cast(void**)& XIfEvent},
+    { "XHeightOfScreen",  cast(void**)& XHeightOfScreen},
+    { "XHeightMMOfScreen",  cast(void**)& XHeightMMOfScreen},
+    { "XGrabServer",  cast(void**)& XGrabServer},
+    { "XGrabPointer",  cast(void**)& XGrabPointer},
+    { "XGrabKeyboard",  cast(void**)& XGrabKeyboard},
+    { "XGrabKey",  cast(void**)& XGrabKey},
+    { "XGrabButton",  cast(void**)& XGrabButton},
+    { "XGetWindowAttributes",  cast(void**)& XGetWindowAttributes},
+    { "XGetWindowProperty",  cast(void**)& XGetWindowProperty},
+    { "XGetTransientForHint",  cast(void**)& XGetTransientForHint},
+    { "XGetScreenSaver",  cast(void**)& XGetScreenSaver},
+    { "XGetPointerMapping",  cast(void**)& XGetPointerMapping},
+    { "XGetPointerControl",  cast(void**)& XGetPointerControl},
+    { "XGetKeyboardControl",  cast(void**)& XGetKeyboardControl},
+    { "XGetInputFocus",  cast(void**)& XGetInputFocus},
+    { "XGetIconName",  cast(void**)& XGetIconName},
+    { "XGetGeometry",  cast(void**)& XGetGeometry},
+    { "XGetGCValues",  cast(void**)& XGetGCValues},
+    { "XGetFontProperty",  cast(void**)& XGetFontProperty},
+    { "XGetErrorText",  cast(void**)& XGetErrorText},
+    { "XGetErrorDatabaseText",  cast(void**)& XGetErrorDatabaseText},
+    { "XGeometry",  cast(void**)& XGeometry},
+    { "XFreePixmap",  cast(void**)& XFreePixmap},
+    { "XFreeModifiermap",  cast(void**)& XFreeModifiermap},
+    { "XFreeGC",  cast(void**)& XFreeGC},
+    { "XFreeFontPath",  cast(void**)& XFreeFontPath},
+    { "XFreeFontNames",  cast(void**)& XFreeFontNames},
+    { "XFreeFontInfo",  cast(void**)& XFreeFontInfo},
+    { "XFreeFont",  cast(void**)& XFreeFont},
+    { "XFreeExtensionList",  cast(void**)& XFreeExtensionList},
+    { "XFreeCursor",  cast(void**)& XFreeCursor},
+    { "XFreeColors",  cast(void**)& XFreeColors},
+    { "XFreeColormap",  cast(void**)& XFreeColormap},
+    { "XFree",  cast(void**)& XFree},
+    { "XForceScreenSaver",  cast(void**)& XForceScreenSaver},
+    { "XFlush",  cast(void**)& XFlush},
+    { "XFillRectangles",  cast(void**)& XFillRectangles},
+    { "XFillRectangle",  cast(void**)& XFillRectangle},
+    { "XFillPolygon",  cast(void**)& XFillPolygon},
+    { "XFillArcs",  cast(void**)& XFillArcs},
+    { "XFillArc",  cast(void**)& XFillArc},
+    { "XFetchName",  cast(void**)& XFetchName},
+    { "XEventsQueued",  cast(void**)& XEventsQueued},
+    { "XEnableAccessControl",  cast(void**)& XEnableAccessControl},
+    { "XDrawText16",  cast(void**)& XDrawText16},
+    { "XDrawText",  cast(void**)& XDrawText},
+    { "XDrawString16",  cast(void**)& XDrawString16},
+    { "XDrawString",  cast(void**)& XDrawString},
+    { "XDrawSegments",  cast(void**)& XDrawSegments},
+    { "XDrawRectangles",  cast(void**)& XDrawRectangles},
+    { "XDrawRectangle",  cast(void**)& XDrawRectangle},
+    { "XDrawPoints",  cast(void**)& XDrawPoints},
+    { "XDrawPoint",  cast(void**)& XDrawPoint},
+    { "XDrawLines",  cast(void**)& XDrawLines},
+    { "XDrawLine",  cast(void**)& XDrawLine},
+    { "XDrawImageString16",  cast(void**)& XDrawImageString16},
+    { "XDrawImageString",  cast(void**)& XDrawImageString},
+    { "XDrawArcs",  cast(void**)& XDrawArcs},
+    { "XDrawArc",  cast(void**)& XDrawArc},
+    { "XDisplayWidthMM",  cast(void**)& XDisplayWidthMM},
+    { "XDisplayWidth",  cast(void**)& XDisplayWidth},
+    { "XDisplayPlanes",  cast(void**)& XDisplayPlanes},
+    { "XDisplayKeycodes",  cast(void**)& XDisplayKeycodes},
+    { "XDisplayHeightMM",  cast(void**)& XDisplayHeightMM},
+    { "XDisplayHeight",  cast(void**)& XDisplayHeight},
+    { "XDisplayCells",  cast(void**)& XDisplayCells},
+    { "XDisableAccessControl",  cast(void**)& XDisableAccessControl},
+    { "XDoesSaveUnders",  cast(void**)& XDoesSaveUnders},
+    { "XDoesBackingStore",  cast(void**)& XDoesBackingStore},
+    { "XDestroySubwindows",  cast(void**)& XDestroySubwindows},
+    { "XDestroyWindow",  cast(void**)& XDestroyWindow},
+    { "XDeleteProperty",  cast(void**)& XDeleteProperty},
+    { "XDefineCursor",  cast(void**)& XDefineCursor},
+    { "XDefaultScreen",  cast(void**)& XDefaultScreen},
+    { "XDefaultDepthOfScreen",  cast(void**)& XDefaultDepthOfScreen},
+    { "XDefaultDepth",  cast(void**)& XDefaultDepth},
+    { "XCopyPlane",  cast(void**)& XCopyPlane},
+    { "XCopyGC",  cast(void**)& XCopyGC},
+    { "XCopyArea",  cast(void**)& XCopyArea},
+    { "XConvertSelection",  cast(void**)& XConvertSelection},
+    { "XConnectionNumber",  cast(void**)& XConnectionNumber},
+    { "XConfigureWindow",  cast(void**)& XConfigureWindow},
+    { "XCloseDisplay",  cast(void**)& XCloseDisplay},
+    { "XClearWindow",  cast(void**)& XClearWindow},
+    { "XClearArea",  cast(void**)& XClearArea},
+    { "XCirculateSubwindowsUp",  cast(void**)& XCirculateSubwindowsUp},
+    { "XCirculateSubwindowsDown",  cast(void**)& XCirculateSubwindowsDown},
+    { "XCirculateSubwindows",  cast(void**)& XCirculateSubwindows},
+    { "XCheckWindowEvent",  cast(void**)& XCheckWindowEvent},
+    { "XCheckTypedWindowEvent",  cast(void**)& XCheckTypedWindowEvent},
+    { "XCheckTypedEvent",  cast(void**)& XCheckTypedEvent},
+    { "XCheckMaskEvent",  cast(void**)& XCheckMaskEvent},
+    { "XCheckIfEvent",  cast(void**)& XCheckIfEvent},
+    { "XChangeWindowAttributes",  cast(void**)& XChangeWindowAttributes},
+    { "XChangeSaveSet",  cast(void**)& XChangeSaveSet},
+    { "XChangeProperty",  cast(void**)& XChangeProperty},
+    { "XChangePointerControl",  cast(void**)& XChangePointerControl},
+    { "XChangeKeyboardMapping",  cast(void**)& XChangeKeyboardMapping},
+    { "XChangeKeyboardControl",  cast(void**)& XChangeKeyboardControl},
+    { "XChangeGC",  cast(void**)& XChangeGC},
+    { "XChangeActivePointerGrab",  cast(void**)& XChangeActivePointerGrab},
+    { "XCellsOfScreen",  cast(void**)& XCellsOfScreen},
+    { "XBitmapUnit",  cast(void**)& XBitmapUnit},
+    { "XBitmapPad",  cast(void**)& XBitmapPad},
+    { "XBitmapBitOrder",  cast(void**)& XBitmapBitOrder},
+    { "XBell",  cast(void**)& XBell},
+    { "XAutoRepeatOn",  cast(void**)& XAutoRepeatOn},
+    { "XAutoRepeatOff",  cast(void**)& XAutoRepeatOff},
+    { "XAllowEvents",  cast(void**)& XAllowEvents},
+    { "XAllocNamedColor",  cast(void**)& XAllocNamedColor},
+    { "XAllocColorPlanes",  cast(void**)& XAllocColorPlanes},
+    { "XAllocColorCells",  cast(void**)& XAllocColorCells},
+    { "XAllocColor",  cast(void**)& XAllocColor},
+    { "XAddToSaveSet",  cast(void**)& XAddToSaveSet},
+    { "XAddToExtensionList",  cast(void**)& XAddToExtensionList},
+    { "XAddHosts",  cast(void**)& XAddHosts},
+    { "XAddHost",  cast(void**)& XAddHost},
+    { "XActivateScreenSaver",  cast(void**)& XActivateScreenSaver},
+    { "XSetTransientForHint",  cast(void**)& XSetTransientForHint},
+    { "XFreeStringList",  cast(void**)& XFreeStringList},
+    { "XSetWMColormapWindows",  cast(void**)& XSetWMColormapWindows},
+    { "XGetWMColormapWindows",  cast(void**)& XGetWMColormapWindows},
+    { "XGetCommand",  cast(void**)& XGetCommand},
+    { "XWithdrawWindow",  cast(void**)& XWithdrawWindow},
+    { "XIconifyWindow",  cast(void**)& XIconifyWindow},
+    { "XSetWMProtocols",  cast(void**)& XSetWMProtocols},
+    { "XGetWMProtocols",  cast(void**)& XGetWMProtocols},
+    { "XReconfigureWMWindow",  cast(void**)& XReconfigureWMWindow},
+    { "XListDepths",  cast(void**)& XListDepths},
+    { "XListPixmapFormats",  cast(void**)& XListPixmapFormats},
+    { "XSetIOErrorHandler",  cast(void**)& XSetIOErrorHandler},
+    { "XSetErrorHandler",  cast(void**)& XSetErrorHandler},
+    { "XScreenNumberOfScreen",  cast(void**)& XScreenNumberOfScreen},
+    { "XEventMaskOfScreen",  cast(void**)& XEventMaskOfScreen},
+    { "XDefaultScreenOfDisplay",  cast(void**)& XDefaultScreenOfDisplay},
+    { "XScreenOfDisplay",  cast(void**)& XScreenOfDisplay},
+    { "XDisplayOfScreen",  cast(void**)& XDisplayOfScreen},
+    { "XDefaultColormapOfScreen",  cast(void**)& XDefaultColormapOfScreen},
+    { "XDefaultColormap",  cast(void**)& XDefaultColormap},
+    { "XDisplayString",  cast(void**)& XDisplayString},
+    { "XServerVendor",  cast(void**)& XServerVendor},
+    { "XLastKnownRequestProcessed",  cast(void**)& XLastKnownRequestProcessed},
+    { "XNextRequest",  cast(void**)& XNextRequest},
+    { "XWhitePixelOfScreen",  cast(void**)& XWhitePixelOfScreen},
+    { "XBlackPixelOfScreen",  cast(void**)& XBlackPixelOfScreen},
+    { "XAllPlanes",  cast(void**)& XAllPlanes},
+    { "XWhitePixel",  cast(void**)& XWhitePixel},
+    { "XBlackPixel",  cast(void**)& XBlackPixel},
+    { "XDefaultGCOfScreen",  cast(void**)& XDefaultGCOfScreen},
+    { "XDefaultGC",  cast(void**)& XDefaultGC},
+    { "XDefaultVisualOfScreen",  cast(void**)& XDefaultVisualOfScreen},
+    { "XDefaultVisual",  cast(void**)& XDefaultVisual},
+    { "XRootWindowOfScreen",  cast(void**)& XRootWindowOfScreen},
+    { "XDefaultRootWindow",  cast(void**)& XDefaultRootWindow},
+    { "XRootWindow",  cast(void**)& XRootWindow},
+    { "XEHeadOfExtensionList",  cast(void**)& XEHeadOfExtensionList},
+    { "XFindOnExtensionList",  cast(void**)& XFindOnExtensionList},
+    { "XAddExtension",  cast(void**)& XAddExtension},
+    { "XInitExtension",  cast(void**)& XInitExtension},
+    { "XUnlockDisplay",  cast(void**)& XUnlockDisplay},
+    { "XLockDisplay",  cast(void**)& XLockDisplay},
+    { "XInitThreads",  cast(void**)& XInitThreads},
+    { "XVisualIDFromVisual",  cast(void**)& XVisualIDFromVisual},
+    { "XDisplayMotionBufferSize",  cast(void**)& XDisplayMotionBufferSize},
+    { "XScreenResourceString",  cast(void**)& XScreenResourceString},
+    { "XResourceManagerString",  cast(void**)& XResourceManagerString},
+    { "XExtendedMaxRequestSize",  cast(void**)& XExtendedMaxRequestSize},
+    { "XMaxRequestSize",  cast(void**)& XMaxRequestSize},
+    { "XStringToKeysym",  cast(void**)& XStringToKeysym},
+    { "XGetKeyboardMapping",  cast(void**)& XGetKeyboardMapping},
+    { "XLookupKeysym",  cast(void**)& XLookupKeysym},
+    { "XKeycodeToKeysym",  cast(void**)& XKeycodeToKeysym},
+    { "XListHosts",  cast(void**)& XListHosts},
+    { "XListProperties",  cast(void**)& XListProperties},
+    { "XListExtensions",  cast(void**)& XListExtensions},
+    { "XGetFontPath",  cast(void**)& XGetFontPath},
+    { "XListFontsWithInfo",  cast(void**)& XListFontsWithInfo},
+    { "XListFonts",  cast(void**)& XListFonts},
+    { "XListInstalledColormaps",  cast(void**)& XListInstalledColormaps},
+    { "XCreateWindow",  cast(void**)& XCreateWindow},
+    { "XGetSelectionOwner",  cast(void**)& XGetSelectionOwner},
+    { "XCreateSimpleWindow",  cast(void**)& XCreateSimpleWindow},
+    { "XCreatePixmapFromBitmapData",  cast(void**)& XCreatePixmapFromBitmapData},
+    { "XCreateBitmapFromData",  cast(void**)& XCreateBitmapFromData},
+    { "XCreatePixmap",  cast(void**)& XCreatePixmap},
+    { "XFlushGC",  cast(void**)& XFlushGC},
+    { "XGContextFromGC",  cast(void**)& XGContextFromGC},
+    { "XCreateGC",  cast(void**)& XCreateGC},
+    { "XLoadFont",  cast(void**)& XLoadFont},
+    { "XCreateFontCursor",  cast(void**)& XCreateFontCursor},
+    { "XCreateGlyphCursor",  cast(void**)& XCreateGlyphCursor},
+    { "XCreatePixmapCursor",  cast(void**)& XCreatePixmapCursor},
+    { "XCreateColormap",  cast(void**)& XCreateColormap},
+    { "XCopyColormapAndFree",  cast(void**)& XCopyColormapAndFree},
+    { "XInternAtoms",  cast(void**)& XInternAtoms},
+    { "XInternAtom",  cast(void**)& XInternAtom},
+    { "XSetAfterFunction",  cast(void**)& XSetAfterFunction},
+    { "XSynchronize",  cast(void**)& XSynchronize},
+    { "XKeysymToString",  cast(void**)& XKeysymToString},
+    { "XDisplayName",  cast(void**)& XDisplayName},
+    { "XGetDefault",  cast(void**)& XGetDefault},
+    { "XGetAtomNames",  cast(void**)& XGetAtomNames},
+    { "XGetAtomName",  cast(void**)& XGetAtomName},
+    { "XFetchBuffer",  cast(void**)& XFetchBuffer},
+    { "XFetchBytes",  cast(void**)& XFetchBytes},
+    { "XrmInitialize",  cast(void**)& XrmInitialize},
+    { "XOpenDisplay",  cast(void**)& XOpenDisplay},
+    { "XGetSubImage",  cast(void**)& XGetSubImage},
+    { "XGetImage",  cast(void**)& XGetImage},
+    { "XInitImage",  cast(void**)& XInitImage},
+    { "XCreateImage",  cast(void**)& XCreateImage},
+    { "XNewModifiermap",  cast(void**)& XNewModifiermap},
+    { "XInsertModifiermapEntry",  cast(void**)& XInsertModifiermapEntry},
+    { "XGetModifierMapping",  cast(void**)& XGetModifierMapping},
+    { "XDeleteModifiermapEntry",  cast(void**)& XDeleteModifiermapEntry},
+    { "XGetMotionEvents",  cast(void**)& XGetMotionEvents},
+    { "XQueryFont",  cast(void**)& XQueryFont},
+    { "XLoadQueryFont",  cast(void**)& XLoadQueryFont},
+    { "_Xdebug",  cast(void**)& _Xdebug},
+    { "_Xmblen",  cast(void**)& _Xmblen},
+];
+
+} else { // version(DYNLINK)
+extern (C) int _Xwctomb(char *, wchar);
+extern (C) int _Xmbtowc(wchar *, char *, int);
+extern (C) void XSetAuthorization(char *, int, char *, int);
+extern (C) void XRemoveConnectionWatch(void *, _BCD_func__846, char *);
+extern (C) int XAddConnectionWatch(void *, _BCD_func__846, char *);
+extern (C) void XProcessInternalConnection(void *, int);
+extern (C) int XInternalConnectionNumbers(void *, int * *, int *);
+extern (C) int XUnregisterIMInstantiateCallback(void *, void *, char *, char *, _BCD_func__969, char *);
+extern (C) int XRegisterIMInstantiateCallback(void *, void *, char *, char *, _BCD_func__969, char *);
+extern (C) void * XVaCreateNestedList(int, ...);
+extern (C) int Xutf8LookupString(void *, XKeyEvent *, char *, int, uint *, int *);
+extern (C) int XwcLookupString(void *, XKeyEvent *, wchar *, int, uint *, int *);
+extern (C) int XmbLookupString(void *, XKeyEvent *, char *, int, uint *, int *);
+extern (C) int XFilterEvent(_XEvent *, uint);
+extern (C) void * XIMOfIC(void *);
+extern (C) char * XGetICValues(void *, ...);
+extern (C) char * XSetICValues(void *, ...);
+extern (C) char * Xutf8ResetIC(void *);
+extern (C) char * XmbResetIC(void *);
+extern (C) wchar * XwcResetIC(void *);
+extern (C) void XUnsetICFocus(void *);
+extern (C) void XSetICFocus(void *);
+extern (C) void XDestroyIC(void *);
+extern (C) void * XCreateIC(void *, ...);
+extern (C) char * XLocaleOfIM(void *);
+extern (C) void * XDisplayOfIM(void *);
+extern (C) char * XSetIMValues(void *, ...);
+extern (C) char * XGetIMValues(void *, ...);
+extern (C) int XCloseIM(void *);
+extern (C) void * XOpenIM(void *, void *, char *, char *);
+extern (C) void Xutf8DrawImageString(void *, uint, void *, void *, int, int, char *, int);
+extern (C) void XwcDrawImageString(void *, uint, void *, void *, int, int, wchar *, int);
+extern (C) void XmbDrawImageString(void *, uint, void *, void *, int, int, char *, int);
+extern (C) void Xutf8DrawString(void *, uint, void *, void *, int, int, char *, int);
+extern (C) void XwcDrawString(void *, uint, void *, void *, int, int, wchar *, int);
+extern (C) void XmbDrawString(void *, uint, void *, void *, int, int, char *, int);
+extern (C) void Xutf8DrawText(void *, uint, void *, int, int, XmbTextItem *, int);
+extern (C) void XwcDrawText(void *, uint, void *, int, int, XwcTextItem *, int);
+extern (C) void XmbDrawText(void *, uint, void *, int, int, XmbTextItem *, int);
+extern (C) int Xutf8TextPerCharExtents(void *, char *, int, XRectangle *, XRectangle *, int, int *, XRectangle *, XRectangle *);
+extern (C) int XwcTextPerCharExtents(void *, wchar *, int, XRectangle *, XRectangle *, int, int *, XRectangle *, XRectangle *);
+extern (C) int XmbTextPerCharExtents(void *, char *, int, XRectangle *, XRectangle *, int, int *, XRectangle *, XRectangle *);
+extern (C) int Xutf8TextExtents(void *, char *, int, XRectangle *, XRectangle *);
+extern (C) int XwcTextExtents(void *, wchar *, int, XRectangle *, XRectangle *);
+extern (C) int XmbTextExtents(void *, char *, int, XRectangle *, XRectangle *);
+extern (C) int Xutf8TextEscapement(void *, char *, int);
+extern (C) int XwcTextEscapement(void *, wchar *, int);
+extern (C) int XmbTextEscapement(void *, char *, int);
+extern (C) XFontSetExtents * XExtentsOfFontSet(void *);
+extern (C) int XContextualDrawing(void *);
+extern (C) int XDirectionalDependentDrawing(void *);
+extern (C) int XContextDependentDrawing(void *);
+extern (C) char * XLocaleOfFontSet(void *);
+extern (C) char * XBaseFontNameListOfFontSet(void *);
+extern (C) int XFontsOfFontSet(void *, XFontStruct * * *, char * * *);
+extern (C) void XFreeFontSet(void *, void *);
+extern (C) void * XCreateFontSet(void *, char *, char * * *, int *, char * *);
+extern (C) char * XGetOCValues(void *, ...);
+extern (C) char * XSetOCValues(void *, ...);
+extern (C) void * XOMOfOC(void *);
+extern (C) void XDestroyOC(void *);
+extern (C) void * XCreateOC(void *, ...);
+extern (C) char * XLocaleOfOM(void *);
+extern (C) void * XDisplayOfOM(void *);
+extern (C) char * XGetOMValues(void *, ...);
+extern (C) char * XSetOMValues(void *, ...);
+extern (C) int XCloseOM(void *);
+extern (C) void * XOpenOM(void *, void *, char *, char *);
+extern (C) char * XSetLocaleModifiers(char *);
+extern (C) int XSupportsLocale();
+extern (C) int XWriteBitmapFile(void *, char *, uint, uint, uint, int, int);
+extern (C) int XWindowEvent(void *, uint, int, _XEvent *);
+extern (C) int XWidthOfScreen(Screen *);
+extern (C) int XWidthMMOfScreen(Screen *);
+extern (C) int XWarpPointer(void *, uint, uint, int, int, uint, uint, int, int);
+extern (C) int XVendorRelease(void *);
+extern (C) int XUnmapWindow(void *, uint);
+extern (C) int XUnmapSubwindows(void *, uint);
+extern (C) int XUnloadFont(void *, uint);
+extern (C) int XUninstallColormap(void *, uint);
+extern (C) int XUngrabServer(void *);
+extern (C) int XUngrabPointer(void *, uint);
+extern (C) int XUngrabKeyboard(void *, uint);
+extern (C) int XUngrabKey(void *, int, uint, uint);
+extern (C) int XUngrabButton(void *, uint, uint, uint);
+extern (C) int XUndefineCursor(void *, uint);
+extern (C) int XTranslateCoordinates(void *, uint, uint, int, int, int *, int *, uint *);
+extern (C) int XTextWidth16(XFontStruct *, XChar2b *, int);
+extern (C) int XTextWidth(XFontStruct *, char *, int);
+extern (C) int XTextExtents16(XFontStruct *, XChar2b *, int, int *, int *, int *, XCharStruct *);
+extern (C) int XTextExtents(XFontStruct *, char *, int, int *, int *, int *, XCharStruct *);
+extern (C) int XSync(void *, int);
+extern (C) int XStoreNamedColor(void *, uint, char *, uint, int);
+extern (C) int XStoreName(void *, uint, char *);
+extern (C) int XStoreColors(void *, uint, XColor *, int);
+extern (C) int XStoreColor(void *, uint, XColor *);
+extern (C) int XStoreBytes(void *, char *, int);
+extern (C) int XStoreBuffer(void *, char *, int, int);
+extern (C) int XSetWindowColormap(void *, uint, uint);
+extern (C) int XSetWindowBorderWidth(void *, uint, uint);
+extern (C) int XSetWindowBorderPixmap(void *, uint, uint);
+extern (C) int XSetWindowBorder(void *, uint, uint);
+extern (C) int XSetWindowBackgroundPixmap(void *, uint, uint);
+extern (C) int XSetWindowBackground(void *, uint, uint);
+extern (C) int XSetTile(void *, void *, uint);
+extern (C) int XSetTSOrigin(void *, void *, int, int);
+extern (C) int XSetSubwindowMode(void *, void *, int);
+extern (C) int XSetStipple(void *, void *, uint);
+extern (C) int XSetState(void *, void *, uint, uint, int, uint);
+extern (C) int XSetSelectionOwner(void *, uint, uint, uint);
+extern (C) int XSetScreenSaver(void *, int, int, int, int);
+extern (C) int XSetPointerMapping(void *, char *, int);
+extern (C) int XSetPlaneMask(void *, void *, uint);
+extern (C) int XSetModifierMapping(void *, XModifierKeymap *);
+extern (C) int XSetLineAttributes(void *, void *, uint, int, int, int);
+extern (C) int XSetInputFocus(void *, uint, int, uint);
+extern (C) int XSetIconName(void *, uint, char *);
+extern (C) int XSetGraphicsExposures(void *, void *, int);
+extern (C) int XSetFunction(void *, void *, int);
+extern (C) int XSetForeground(void *, void *, uint);
+extern (C) int XSetFontPath(void *, char * *, int);
+extern (C) int XSetFont(void *, void *, uint);
+extern (C) int XSetFillStyle(void *, void *, int);
+extern (C) int XSetFillRule(void *, void *, int);
+extern (C) int XSetDashes(void *, void *, int, char *, int);
+extern (C) int XSetCommand(void *, uint, char * *, int);
+extern (C) int XSetCloseDownMode(void *, int);
+extern (C) int XSetClipRectangles(void *, void *, int, int, XRectangle *, int, int);
+extern (C) int XSetClipOrigin(void *, void *, int, int);
+extern (C) int XSetClipMask(void *, void *, uint);
+extern (C) int XSetBackground(void *, void *, uint);
+extern (C) int XSetArcMode(void *, void *, int);
+extern (C) int XSetAccessControl(void *, int);
+extern (C) int XSendEvent(void *, uint, int, int, _XEvent *);
+extern (C) int XSelectInput(void *, uint, int);
+extern (C) int XScreenCount(void *);
+extern (C) int XRotateWindowProperties(void *, uint, uint *, int, int);
+extern (C) int XRotateBuffers(void *, int);
+extern (C) int XRestackWindows(void *, uint *, int);
+extern (C) int XResizeWindow(void *, uint, uint, uint);
+extern (C) int XResetScreenSaver(void *);
+extern (C) int XReparentWindow(void *, uint, uint, int, int);
+extern (C) int XRemoveHosts(void *, XHostAddress *, int);
+extern (C) int XRemoveHost(void *, XHostAddress *);
+extern (C) int XRemoveFromSaveSet(void *, uint);
+extern (C) int XRefreshKeyboardMapping(XMappingEvent *);
+extern (C) int XRecolorCursor(void *, uint, XColor *, XColor *);
+extern (C) int XRebindKeysym(void *, uint, uint *, int, char *, int);
+extern (C) int XReadBitmapFileData(char *, uint *, uint *, char * *, int *, int *);
+extern (C) int XReadBitmapFile(void *, uint, char *, uint *, uint *, uint *, int *, int *);
+extern (C) int XRaiseWindow(void *, uint);
+extern (C) int XQueryTree(void *, uint, uint *, uint *, uint * *, uint *);
+extern (C) int XQueryTextExtents16(void *, uint, XChar2b *, int, int *, int *, int *, XCharStruct *);
+extern (C) int XQueryTextExtents(void *, uint, char *, int, int *, int *, int *, XCharStruct *);
+extern (C) int XQueryPointer(void *, uint, uint *, uint *, int *, int *, int *, int *, uint *);
+extern (C) int XQueryKeymap(void *, char *);
+extern (C) int XQueryExtension(void *, char *, int *, int *, int *);
+extern (C) int XQueryColors(void *, uint, XColor *, int);
+extern (C) int XQueryColor(void *, uint, XColor *);
+extern (C) int XQueryBestTile(void *, uint, uint, uint, uint *, uint *);
+extern (C) int XQueryBestStipple(void *, uint, uint, uint, uint *, uint *);
+extern (C) int XQueryBestSize(void *, int, uint, uint, uint, uint *, uint *);
+extern (C) int XQueryBestCursor(void *, uint, uint, uint, uint *, uint *);
+extern (C) int XQLength(void *);
+extern (C) int XPutImage(void *, uint, void *, _XImage *, int, int, int, int, uint, uint);
+extern (C) int XPutBackEvent(void *, _XEvent *);
+extern (C) int XProtocolVersion(void *);
+extern (C) int XProtocolRevision(void *);
+extern (C) int XPlanesOfScreen(Screen *);
+extern (C) int XPending(void *);
+extern (C) int XPeekIfEvent(void *, _XEvent *, _BCD_func__1795, char *);
+extern (C) int XPeekEvent(void *, _XEvent *);
+extern (C) int XParseGeometry(char *, int *, int *, uint *, uint *);
+extern (C) int XParseColor(void *, uint, char *, XColor *);
+extern (C) int XNoOp(void *);
+extern (C) int XNextEvent(void *, _XEvent *);
+extern (C) int XMoveWindow(void *, uint, int, int);
+extern (C) int XMoveResizeWindow(void *, uint, int, int, uint, uint);
+extern (C) int XMinCmapsOfScreen(Screen *);
+extern (C) int XMaxCmapsOfScreen(Screen *);
+extern (C) int XMaskEvent(void *, int, _XEvent *);
+extern (C) int XMapWindow(void *, uint);
+extern (C) int XMapSubwindows(void *, uint);
+extern (C) int XMapRaised(void *, uint);
+extern (C) int XLowerWindow(void *, uint);
+extern (C) int XLookupColor(void *, uint, char *, XColor *, XColor *);
+extern (C) int XKillClient(void *, uint);
+extern (C) char XKeysymToKeycode(void *, uint);
+extern (C) int XInstallColormap(void *, uint);
+extern (C) int XImageByteOrder(void *);
+extern (C) int XIfEvent(void *, _XEvent *, _BCD_func__1795, char *);
+extern (C) int XHeightOfScreen(Screen *);
+extern (C) int XHeightMMOfScreen(Screen *);
+extern (C) int XGrabServer(void *);
+extern (C) int XGrabPointer(void *, uint, int, uint, int, int, uint, uint, uint);
+extern (C) int XGrabKeyboard(void *, uint, int, int, int, uint);
+extern (C) int XGrabKey(void *, int, uint, uint, int, int, int);
+extern (C) int XGrabButton(void *, uint, uint, uint, int, uint, int, int, uint, uint);
+extern (C) int XGetWindowAttributes(void *, uint, XWindowAttributes *);
+extern (C) int XGetWindowProperty(void *, uint, uint, int, int, int, uint, uint *, int *, uint *, uint *, char * *);
+extern (C) int XGetTransientForHint(void *, uint, uint *);
+extern (C) int XGetScreenSaver(void *, int *, int *, int *, int *);
+extern (C) int XGetPointerMapping(void *, char *, int);
+extern (C) int XGetPointerControl(void *, int *, int *, int *);
+extern (C) int XGetKeyboardControl(void *, XKeyboardState *);
+extern (C) int XGetInputFocus(void *, uint *, int *);
+extern (C) int XGetIconName(void *, uint, char * *);
+extern (C) int XGetGeometry(void *, uint, uint *, int *, int *, uint *, uint *, uint *, uint *);
+extern (C) int XGetGCValues(void *, void *, uint, XGCValues *);
+extern (C) int XGetFontProperty(XFontStruct *, uint, uint *);
+extern (C) int XGetErrorText(void *, int, char *, int);
+extern (C) int XGetErrorDatabaseText(void *, char *, char *, char *, char *, int);
+extern (C) int XGeometry(void *, int, char *, char *, uint, uint, uint, int, int, int *, int *, int *, int *);
+extern (C) int XFreePixmap(void *, uint);
+extern (C) int XFreeModifiermap(XModifierKeymap *);
+extern (C) int XFreeGC(void *, void *);
+extern (C) int XFreeFontPath(char * *);
+extern (C) int XFreeFontNames(char * *);
+extern (C) int XFreeFontInfo(char * *, XFontStruct *, int);
+extern (C) int XFreeFont(void *, XFontStruct *);
+extern (C) int XFreeExtensionList(char * *);
+extern (C) int XFreeCursor(void *, uint);
+extern (C) int XFreeColors(void *, uint, uint *, int, uint);
+extern (C) int XFreeColormap(void *, uint);
+extern (C) int XFree(void *);
+extern (C) int XForceScreenSaver(void *, int);
+extern (C) int XFlush(void *);
+extern (C) int XFillRectangles(void *, uint, void *, XRectangle *, int);
+extern (C) int XFillRectangle(void *, uint, void *, int, int, uint, uint);
+extern (C) int XFillPolygon(void *, uint, void *, XPoint *, int, int, int);
+extern (C) int XFillArcs(void *, uint, void *, XArc *, int);
+extern (C) int XFillArc(void *, uint, void *, int, int, uint, uint, int, int);
+extern (C) int XFetchName(void *, uint, char * *);
+extern (C) int XEventsQueued(void *, int);
+extern (C) int XEnableAccessControl(void *);
+extern (C) int XDrawText16(void *, uint, void *, int, int, XTextItem16 *, int);
+extern (C) int XDrawText(void *, uint, void *, int, int, XTextItem *, int);
+extern (C) int XDrawString16(void *, uint, void *, int, int, XChar2b *, int);
+extern (C) int XDrawString(void *, uint, void *, int, int, char *, int);
+extern (C) int XDrawSegments(void *, uint, void *, XSegment *, int);
+extern (C) int XDrawRectangles(void *, uint, void *, XRectangle *, int);
+extern (C) int XDrawRectangle(void *, uint, void *, int, int, uint, uint);
+extern (C) int XDrawPoints(void *, uint, void *, XPoint *, int, int);
+extern (C) int XDrawPoint(void *, uint, void *, int, int);
+extern (C) int XDrawLines(void *, uint, void *, XPoint *, int, int);
+extern (C) int XDrawLine(void *, uint, void *, int, int, int, int);
+extern (C) int XDrawImageString16(void *, uint, void *, int, int, XChar2b *, int);
+extern (C) int XDrawImageString(void *, uint, void *, int, int, char *, int);
+extern (C) int XDrawArcs(void *, uint, void *, XArc *, int);
+extern (C) int XDrawArc(void *, uint, void *, int, int, uint, uint, int, int);
+extern (C) int XDisplayWidthMM(void *, int);
+extern (C) int XDisplayWidth(void *, int);
+extern (C) int XDisplayPlanes(void *, int);
+extern (C) int XDisplayKeycodes(void *, int *, int *);
+extern (C) int XDisplayHeightMM(void *, int);
+extern (C) int XDisplayHeight(void *, int);
+extern (C) int XDisplayCells(void *, int);
+extern (C) int XDisableAccessControl(void *);
+extern (C) int XDoesSaveUnders(Screen *);
+extern (C) int XDoesBackingStore(Screen *);
+extern (C) int XDestroySubwindows(void *, uint);
+extern (C) int XDestroyWindow(void *, uint);
+extern (C) int XDeleteProperty(void *, uint, uint);
+extern (C) int XDefineCursor(void *, uint, uint);
+extern (C) int XDefaultScreen(void *);
+extern (C) int XDefaultDepthOfScreen(Screen *);
+extern (C) int XDefaultDepth(void *, int);
+extern (C) int XCopyPlane(void *, uint, uint, void *, int, int, uint, uint, int, int, uint);
+extern (C) int XCopyGC(void *, void *, uint, void *);
+extern (C) int XCopyArea(void *, uint, uint, void *, int, int, uint, uint, int, int);
+extern (C) int XConvertSelection(void *, uint, uint, uint, uint, uint);
+extern (C) int XConnectionNumber(void *);
+extern (C) int XConfigureWindow(void *, uint, uint, XWindowChanges *);
+extern (C) int XCloseDisplay(void *);
+extern (C) int XClearWindow(void *, uint);
+extern (C) int XClearArea(void *, uint, int, int, uint, uint, int);
+extern (C) int XCirculateSubwindowsUp(void *, uint);
+extern (C) int XCirculateSubwindowsDown(void *, uint);
+extern (C) int XCirculateSubwindows(void *, uint, int);
+extern (C) int XCheckWindowEvent(void *, uint, int, _XEvent *);
+extern (C) int XCheckTypedWindowEvent(void *, uint, int, _XEvent *);
+extern (C) int XCheckTypedEvent(void *, int, _XEvent *);
+extern (C) int XCheckMaskEvent(void *, int, _XEvent *);
+extern (C) int XCheckIfEvent(void *, _XEvent *, _BCD_func__1795, char *);
+extern (C) int XChangeWindowAttributes(void *, uint, uint, XSetWindowAttributes *);
+extern (C) int XChangeSaveSet(void *, uint, int);
+extern (C) int XChangeProperty(void *, uint, uint, uint, int, int, char *, int);
+extern (C) int XChangePointerControl(void *, int, int, int, int, int);
+extern (C) int XChangeKeyboardMapping(void *, int, int, uint *, int);
+extern (C) int XChangeKeyboardControl(void *, uint, XKeyboardControl *);
+extern (C) int XChangeGC(void *, void *, uint, XGCValues *);
+extern (C) int XChangeActivePointerGrab(void *, uint, uint, uint);
+extern (C) int XCellsOfScreen(Screen *);
+extern (C) int XBitmapUnit(void *);
+extern (C) int XBitmapPad(void *);
+extern (C) int XBitmapBitOrder(void *);
+extern (C) int XBell(void *, int);
+extern (C) int XAutoRepeatOn(void *);
+extern (C) int XAutoRepeatOff(void *);
+extern (C) int XAllowEvents(void *, int, uint);
+extern (C) int XAllocNamedColor(void *, uint, char *, XColor *, XColor *);
+extern (C) int XAllocColorPlanes(void *, uint, int, uint *, int, int, int, int, uint *, uint *, uint *);
+extern (C) int XAllocColorCells(void *, uint, int, uint *, uint, uint *, uint);
+extern (C) int XAllocColor(void *, uint, XColor *);
+extern (C) int XAddToSaveSet(void *, uint);
+extern (C) int XAddToExtensionList(_XExtData * *, _XExtData *);
+extern (C) int XAddHosts(void *, XHostAddress *, int);
+extern (C) int XAddHost(void *, XHostAddress *);
+extern (C) int XActivateScreenSaver(void *);
+extern (C) int XSetTransientForHint(void *, uint, uint);
+extern (C) void XFreeStringList(char * *);
+extern (C) int XSetWMColormapWindows(void *, uint, uint *, int);
+extern (C) int XGetWMColormapWindows(void *, uint, uint * *, int *);
+extern (C) int XGetCommand(void *, uint, char * * *, int *);
+extern (C) int XWithdrawWindow(void *, uint, int);
+extern (C) int XIconifyWindow(void *, uint, int);
+extern (C) int XSetWMProtocols(void *, uint, uint *, int);
+extern (C) int XGetWMProtocols(void *, uint, uint * *, int *);
+extern (C) int XReconfigureWMWindow(void *, uint, int, uint, XWindowChanges *);
+extern (C) int * XListDepths(void *, int, int *);
+extern (C) XPixmapFormatValues * XListPixmapFormats(void *, int *);
+extern (C) _BCD_func__894 XSetIOErrorHandler(_BCD_func__894);
+extern (C) _BCD_func__895 XSetErrorHandler(_BCD_func__895);
+extern (C) int XScreenNumberOfScreen(Screen *);
+extern (C) int XEventMaskOfScreen(Screen *);
+extern (C) Screen * XDefaultScreenOfDisplay(void *);
+extern (C) Screen * XScreenOfDisplay(void *, int);
+extern (C) void * XDisplayOfScreen(Screen *);
+extern (C) uint XDefaultColormapOfScreen(Screen *);
+extern (C) uint XDefaultColormap(void *, int);
+extern (C) char * XDisplayString(void *);
+extern (C) char * XServerVendor(void *);
+extern (C) uint XLastKnownRequestProcessed(void *);
+extern (C) uint XNextRequest(void *);
+extern (C) uint XWhitePixelOfScreen(Screen *);
+extern (C) uint XBlackPixelOfScreen(Screen *);
+extern (C) uint XAllPlanes();
+extern (C) uint XWhitePixel(void *, int);
+extern (C) uint XBlackPixel(void *, int);
+extern (C) void * XDefaultGCOfScreen(Screen *);
+extern (C) void * XDefaultGC(void *, int);
+extern (C) Visual * XDefaultVisualOfScreen(Screen *);
+extern (C) Visual * XDefaultVisual(void *, int);
+extern (C) uint XRootWindowOfScreen(Screen *);
+extern (C) uint XDefaultRootWindow(void *);
+extern (C) uint XRootWindow(void *, int);
+extern (C) _XExtData * * XEHeadOfExtensionList(XEDataObject);
+extern (C) _XExtData * XFindOnExtensionList(_XExtData * *, int);
+extern (C) XExtCodes * XAddExtension(void *);
+extern (C) XExtCodes * XInitExtension(void *, char *);
+extern (C) void XUnlockDisplay(void *);
+extern (C) void XLockDisplay(void *);
+extern (C) int XInitThreads();
+extern (C) uint XVisualIDFromVisual(Visual *);
+extern (C) uint XDisplayMotionBufferSize(void *);
+extern (C) char * XScreenResourceString(Screen *);
+extern (C) char * XResourceManagerString(void *);
+extern (C) int XExtendedMaxRequestSize(void *);
+extern (C) int XMaxRequestSize(void *);
+extern (C) uint XStringToKeysym(char *);
+extern (C) uint * XGetKeyboardMapping(void *, char, int, int *);
+extern (C) uint XLookupKeysym(XKeyEvent *, int);
+extern (C) uint XKeycodeToKeysym(void *, char, int);
+extern (C) XHostAddress * XListHosts(void *, int *, int *);
+extern (C) uint * XListProperties(void *, uint, int *);
+extern (C) char * * XListExtensions(void *, int *);
+extern (C) char * * XGetFontPath(void *, int *);
+extern (C) char * * XListFontsWithInfo(void *, char *, int, int *, XFontStruct * *);
+extern (C) char * * XListFonts(void *, char *, int, int *);
+extern (C) uint * XListInstalledColormaps(void *, uint, int *);
+extern (C) uint XCreateWindow(void *, uint, int, int, uint, uint, uint, int, uint, Visual *, uint, XSetWindowAttributes *);
+extern (C) uint XGetSelectionOwner(void *, uint);
+extern (C) uint XCreateSimpleWindow(void *, uint, int, int, uint, uint, uint, uint, uint);
+extern (C) uint XCreatePixmapFromBitmapData(void *, uint, char *, uint, uint, uint, uint, uint);
+extern (C) uint XCreateBitmapFromData(void *, uint, char *, uint, uint);
+extern (C) uint XCreatePixmap(void *, uint, uint, uint, uint);
+extern (C) void XFlushGC(void *, void *);
+extern (C) uint XGContextFromGC(void *);
+extern (C) void * XCreateGC(void *, uint, uint, XGCValues *);
+extern (C) uint XLoadFont(void *, char *);
+extern (C) uint XCreateFontCursor(void *, uint);
+extern (C) uint XCreateGlyphCursor(void *, uint, uint, uint, uint, XColor *, XColor *);
+extern (C) uint XCreatePixmapCursor(void *, uint, uint, XColor *, XColor *, uint, uint);
+extern (C) uint XCreateColormap(void *, uint, Visual *, int);
+extern (C) uint XCopyColormapAndFree(void *, uint);
+extern (C) int XInternAtoms(void *, char * *, int, int, uint *);
+extern (C) uint XInternAtom(void *, char *, int);
+extern (C) _BCD_func__894 XSetAfterFunction(void *, _BCD_func__894);
+extern (C) _BCD_func__894 XSynchronize(void *, int);
+extern (C) char * XKeysymToString(uint);
+extern (C) char * XDisplayName(char *);
+extern (C) char * XGetDefault(void *, char *, char *);
+extern (C) int XGetAtomNames(void *, uint *, int, char * *);
+extern (C) char * XGetAtomName(void *, uint);
+extern (C) char * XFetchBuffer(void *, int *, int);
+extern (C) char * XFetchBytes(void *, int *);
+extern (C) void XrmInitialize();
+extern (C) void * XOpenDisplay(char *);
+extern (C) _XImage * XGetSubImage(void *, uint, int, int, uint, uint, uint, int, _XImage *, int, int);
+extern (C) _XImage * XGetImage(void *, uint, int, int, uint, uint, uint, int);
+extern (C) int XInitImage(_XImage *);
+extern (C) _XImage * XCreateImage(void *, Visual *, uint, int, int, char *, uint, uint, int, int);
+extern (C) XModifierKeymap * XNewModifiermap(int);
+extern (C) XModifierKeymap * XInsertModifiermapEntry(XModifierKeymap *, char, int);
+extern (C) XModifierKeymap * XGetModifierMapping(void *);
+extern (C) XModifierKeymap * XDeleteModifiermapEntry(XModifierKeymap *, char, int);
+extern (C) XTimeCoord * XGetMotionEvents(void *, uint, uint, uint, int *);
+extern (C) XFontStruct * XQueryFont(void *, uint);
+extern (C) XFontStruct * XLoadQueryFont(void *, char *);
+extern (C) extern int _Xdebug;
+extern (C) int _Xmblen(char *, int);
+} // version(DYNLINK)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/Xrender.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,323 @@
+/******************************************************************************
+    Based on the generated files from the BCD tool
+    modified by: Frank Benoit <keinfarbton@googlemail.com>
+******************************************************************************/
+module org.eclipse.swt.internal.c.Xrender;
+
+import java.lang.all;
+
+public import org.eclipse.swt.internal.c.Xlib;
+
+extern(C):
+align(4):
+
+const int PictStandardARGB32 = 0;
+const int PictStandardRGB24 = 1;
+const int PictStandardA8 = 2;
+const int PictStandardA4 = 3;
+const int PictStandardA1 = 4;
+const int PictStandardNUM = 5;
+alias _XConicalGradient XConicalGradient;
+alias _XPointFixed XPointFixed;
+alias int XFixed;
+alias _XRadialGradient XRadialGradient;
+alias _XCircle XCircle;
+alias _XLinearGradient XLinearGradient;
+alias _XTrap XTrap;
+alias _XSpanFix XSpanFix;
+alias _XAnimCursor XAnimCursor;
+alias _XIndexValue XIndexValue;
+alias _XFilters XFilters;
+alias _XTransform XTransform;
+alias _XTrapezoid XTrapezoid;
+alias _XLineFixed XLineFixed;
+alias _XTriangle XTriangle;
+alias _XPointDouble XPointDouble;
+alias double XDouble;
+alias _XGlyphElt32 XGlyphElt32;
+alias _XGlyphElt16 XGlyphElt16;
+alias _XGlyphElt8 XGlyphElt8;
+alias _XGlyphInfo XGlyphInfo;
+alias _XRenderPictureAttributes XRenderPictureAttributes;
+alias void function(void *, char *, int, int, char * *) _BCD_func__1287;
+alias int function(void *) _BCD_func__1329;
+alias int function(void *, XErrorEvent *) _BCD_func__1330;
+alias void function(void *, char *, char *) _BCD_func__1403;
+alias int function(void *, char *, char *) _BCD_func__1404;
+alias void function(void *, char *, char *) _BCD_func__1405;
+struct _XConicalGradient {
+_XPointFixed center;
+int angle;
+}
+struct _XRadialGradient {
+_XCircle inner;
+_XCircle outer;
+}
+struct _XLinearGradient {
+_XPointFixed p1;
+_XPointFixed p2;
+}
+struct _XTrap {
+_XSpanFix top;
+_XSpanFix bottom;
+}
+struct _XSpanFix {
+int left;
+int right;
+int y;
+}
+struct _XAnimCursor {
+uint cursor;
+uint delay;
+}
+struct _XIndexValue {
+uint pixel;
+ushort red;
+ushort green;
+ushort blue;
+ushort alpha;
+}
+struct _XFilters {
+int nfilter;
+char * * filter;
+int nalias;
+short * alias_;
+}
+struct _XTransform {
+int [3] [3] matrix;
+}
+struct _XTrapezoid {
+int top;
+int bottom;
+_XLineFixed left;
+_XLineFixed right;
+}
+struct _XCircle {
+int x;
+int y;
+int radius;
+}
+struct _XTriangle {
+_XPointFixed p1;
+_XPointFixed p2;
+_XPointFixed p3;
+}
+struct _XLineFixed {
+_XPointFixed p1;
+_XPointFixed p2;
+}
+struct _XPointFixed {
+int x;
+int y;
+}
+struct _XPointDouble {
+double x;
+double y;
+}
+struct _XGlyphElt32 {
+uint glyphset;
+uint * chars;
+int nchars;
+int xOff;
+int yOff;
+}
+struct _XGlyphElt16 {
+uint glyphset;
+ushort * chars;
+int nchars;
+int xOff;
+int yOff;
+}
+struct _XGlyphElt8 {
+uint glyphset;
+char * chars;
+int nchars;
+int xOff;
+int yOff;
+}
+struct _XGlyphInfo {
+ushort width;
+ushort height;
+short x;
+short y;
+short xOff;
+short yOff;
+}
+struct XRenderColor {
+ushort red;
+ushort green;
+ushort blue;
+ushort alpha;
+}
+struct _XRenderPictureAttributes {
+int repeat;
+uint alpha_map;
+int alpha_x_origin;
+int alpha_y_origin;
+int clip_x_origin;
+int clip_y_origin;
+uint clip_mask;
+int graphics_exposures;
+int subwindow_mode;
+int poly_edge;
+int poly_mode;
+uint dither;
+int component_alpha;
+}
+struct XRenderPictFormat {
+uint id;
+int type;
+int depth;
+XRenderDirectFormat direct;
+uint colormap;
+}
+struct XRenderDirectFormat {
+short red;
+short redMask;
+short green;
+short greenMask;
+short blue;
+short blueMask;
+short alpha;
+short alphaMask;
+}
+version(DYNLINK){
+extern (C) uint function(void *, _XConicalGradient *, int *, XRenderColor *, int)XRenderCreateConicalGradient;
+extern (C) uint function(void *, _XRadialGradient *, int *, XRenderColor *, int)XRenderCreateRadialGradient;
+extern (C) uint function(void *, _XLinearGradient *, int *, XRenderColor *, int)XRenderCreateLinearGradient;
+extern (C) uint function(void *, XRenderColor *)XRenderCreateSolidFill;
+extern (C) void function(void *, uint, int, int, _XTrap *, int)XRenderAddTraps;
+extern (C) uint function(void *, int, _XAnimCursor *)XRenderCreateAnimCursor;
+extern (C) void function(void *, uint, char *, int *, int)XRenderSetPictureFilter;
+extern (C) _XFilters * function(void *, uint)XRenderQueryFilters;
+extern (C) uint function(void *, uint, uint, uint)XRenderCreateCursor;
+extern (C) int function(void *, char *, XRenderColor *)XRenderParseColor;
+extern (C) void function(void *, int, uint, uint, XRenderPictFormat *, int, int, int, int, _XPointDouble *, int, int)XRenderCompositeDoublePoly;
+extern (C) void function(void *, int, uint, uint, XRenderPictFormat *, int, int, _XPointFixed *, int)XRenderCompositeTriFan;
+extern (C) void function(void *, int, uint, uint, XRenderPictFormat *, int, int, _XPointFixed *, int)XRenderCompositeTriStrip;
+extern (C) void function(void *, int, uint, uint, XRenderPictFormat *, int, int, _XTriangle *, int)XRenderCompositeTriangles;
+extern (C) void function(void *, int, uint, uint, XRenderPictFormat *, int, int, _XTrapezoid *, int)XRenderCompositeTrapezoids;
+extern (C) void function(void *, int, uint, XRenderColor *, XRectangle *, int)XRenderFillRectangles;
+extern (C) void function(void *, int, uint, XRenderColor *, int, int, uint, uint)XRenderFillRectangle;
+extern (C) void function(void *, int, uint, uint, XRenderPictFormat *, int, int, int, int, _XGlyphElt32 *, int)XRenderCompositeText32;
+extern (C) void function(void *, int, uint, uint, XRenderPictFormat *, int, int, int, int, _XGlyphElt16 *, int)XRenderCompositeText16;
+extern (C) void function(void *, int, uint, uint, XRenderPictFormat *, int, int, int, int, _XGlyphElt8 *, int)XRenderCompositeText8;
+extern (C) void function(void *, int, uint, uint, XRenderPictFormat *, uint, int, int, int, int, uint *, int)XRenderCompositeString32;
+extern (C) void function(void *, int, uint, uint, XRenderPictFormat *, uint, int, int, int, int, ushort *, int)XRenderCompositeString16;
+extern (C) void function(void *, int, uint, uint, XRenderPictFormat *, uint, int, int, int, int, char *, int)XRenderCompositeString8;
+extern (C) void function(void *, uint, uint *, int)XRenderFreeGlyphs;
+extern (C) void function(void *, uint, uint *, _XGlyphInfo *, int, char *, int)XRenderAddGlyphs;
+extern (C) void function(void *, uint)XRenderFreeGlyphSet;
+extern (C) uint function(void *, uint)XRenderReferenceGlyphSet;
+extern (C) uint function(void *, XRenderPictFormat *)XRenderCreateGlyphSet;
+extern (C) void function(void *, int, uint, uint, uint, int, int, int, int, int, int, uint, uint)XRenderComposite;
+extern (C) void function(void *, uint)XRenderFreePicture;
+extern (C) void function(void *, uint, _XTransform *)XRenderSetPictureTransform;
+extern (C) void function(void *, uint, void *)XRenderSetPictureClipRegion;
+extern (C) void function(void *, uint, int, int, XRectangle *, int)XRenderSetPictureClipRectangles;
+extern (C) void function(void *, uint, uint, _XRenderPictureAttributes *)XRenderChangePicture;
+extern (C) uint function(void *, uint, XRenderPictFormat *, uint, _XRenderPictureAttributes *)XRenderCreatePicture;
+extern (C) _XIndexValue * function(void *, XRenderPictFormat *, int *)XRenderQueryPictIndexValues;
+extern (C) XRenderPictFormat * function(void *, int)XRenderFindStandardFormat;
+extern (C) XRenderPictFormat * function(void *, uint, XRenderPictFormat *, int)XRenderFindFormat;
+extern (C) XRenderPictFormat * function(void *, Visual *)XRenderFindVisualFormat;
+extern (C) int function(void *, int, int)XRenderSetSubpixelOrder;
+extern (C) int function(void *, int)XRenderQuerySubpixelOrder;
+extern (C) int function(void *)XRenderQueryFormats;
+extern (C) int function(void *, int *, int *)XRenderQueryVersion;
+extern (C) int function(void *, int *, int *)XRenderQueryExtension;
+
+
+Symbol[] symbols = [
+    { "XRenderCreateConicalGradient",  cast(void**)& XRenderCreateConicalGradient},
+    { "XRenderCreateRadialGradient",  cast(void**)& XRenderCreateRadialGradient},
+    { "XRenderCreateLinearGradient",  cast(void**)& XRenderCreateLinearGradient},
+    { "XRenderCreateSolidFill",  cast(void**)& XRenderCreateSolidFill},
+    { "XRenderAddTraps",  cast(void**)& XRenderAddTraps},
+    { "XRenderCreateAnimCursor",  cast(void**)& XRenderCreateAnimCursor},
+    { "XRenderSetPictureFilter",  cast(void**)& XRenderSetPictureFilter},
+    { "XRenderQueryFilters",  cast(void**)& XRenderQueryFilters},
+    { "XRenderCreateCursor",  cast(void**)& XRenderCreateCursor},
+    { "XRenderParseColor",  cast(void**)& XRenderParseColor},
+    { "XRenderCompositeDoublePoly",  cast(void**)& XRenderCompositeDoublePoly},
+    { "XRenderCompositeTriFan",  cast(void**)& XRenderCompositeTriFan},
+    { "XRenderCompositeTriStrip",  cast(void**)& XRenderCompositeTriStrip},
+    { "XRenderCompositeTriangles",  cast(void**)& XRenderCompositeTriangles},
+    { "XRenderCompositeTrapezoids",  cast(void**)& XRenderCompositeTrapezoids},
+    { "XRenderFillRectangles",  cast(void**)& XRenderFillRectangles},
+    { "XRenderFillRectangle",  cast(void**)& XRenderFillRectangle},
+    { "XRenderCompositeText32",  cast(void**)& XRenderCompositeText32},
+    { "XRenderCompositeText16",  cast(void**)& XRenderCompositeText16},
+    { "XRenderCompositeText8",  cast(void**)& XRenderCompositeText8},
+    { "XRenderCompositeString32",  cast(void**)& XRenderCompositeString32},
+    { "XRenderCompositeString16",  cast(void**)& XRenderCompositeString16},
+    { "XRenderCompositeString8",  cast(void**)& XRenderCompositeString8},
+    { "XRenderFreeGlyphs",  cast(void**)& XRenderFreeGlyphs},
+    { "XRenderAddGlyphs",  cast(void**)& XRenderAddGlyphs},
+    { "XRenderFreeGlyphSet",  cast(void**)& XRenderFreeGlyphSet},
+    { "XRenderReferenceGlyphSet",  cast(void**)& XRenderReferenceGlyphSet},
+    { "XRenderCreateGlyphSet",  cast(void**)& XRenderCreateGlyphSet},
+    { "XRenderComposite",  cast(void**)& XRenderComposite},
+    { "XRenderFreePicture",  cast(void**)& XRenderFreePicture},
+    { "XRenderSetPictureTransform",  cast(void**)& XRenderSetPictureTransform},
+    { "XRenderSetPictureClipRegion",  cast(void**)& XRenderSetPictureClipRegion},
+    { "XRenderSetPictureClipRectangles",  cast(void**)& XRenderSetPictureClipRectangles},
+    { "XRenderChangePicture",  cast(void**)& XRenderChangePicture},
+    { "XRenderCreatePicture",  cast(void**)& XRenderCreatePicture},
+    { "XRenderQueryPictIndexValues",  cast(void**)& XRenderQueryPictIndexValues},
+    { "XRenderFindStandardFormat",  cast(void**)& XRenderFindStandardFormat},
+    { "XRenderFindFormat",  cast(void**)& XRenderFindFormat},
+    { "XRenderFindVisualFormat",  cast(void**)& XRenderFindVisualFormat},
+    { "XRenderSetSubpixelOrder",  cast(void**)& XRenderSetSubpixelOrder},
+    { "XRenderQuerySubpixelOrder",  cast(void**)& XRenderQuerySubpixelOrder},
+    { "XRenderQueryFormats",  cast(void**)& XRenderQueryFormats},
+    { "XRenderQueryVersion",  cast(void**)& XRenderQueryVersion},
+    { "XRenderQueryExtension",  cast(void**)& XRenderQueryExtension},
+];
+
+} else { // version(DYNLINK)
+extern (C) uint XRenderCreateConicalGradient(void *, _XConicalGradient *, int *, XRenderColor *, int);
+extern (C) uint XRenderCreateRadialGradient(void *, _XRadialGradient *, int *, XRenderColor *, int);
+extern (C) uint XRenderCreateLinearGradient(void *, _XLinearGradient *, int *, XRenderColor *, int);
+extern (C) uint XRenderCreateSolidFill(void *, XRenderColor *);
+extern (C) void XRenderAddTraps(void *, uint, int, int, _XTrap *, int);
+extern (C) uint XRenderCreateAnimCursor(void *, int, _XAnimCursor *);
+extern (C) void XRenderSetPictureFilter(void *, uint, char *, int *, int);
+extern (C) _XFilters * XRenderQueryFilters(void *, uint);
+extern (C) uint XRenderCreateCursor(void *, uint, uint, uint);
+extern (C) int XRenderParseColor(void *, char *, XRenderColor *);
+extern (C) void XRenderCompositeDoublePoly(void *, int, uint, uint, XRenderPictFormat *, int, int, int, int, _XPointDouble *, int, int);
+extern (C) void XRenderCompositeTriFan(void *, int, uint, uint, XRenderPictFormat *, int, int, _XPointFixed *, int);
+extern (C) void XRenderCompositeTriStrip(void *, int, uint, uint, XRenderPictFormat *, int, int, _XPointFixed *, int);
+extern (C) void XRenderCompositeTriangles(void *, int, uint, uint, XRenderPictFormat *, int, int, _XTriangle *, int);
+extern (C) void XRenderCompositeTrapezoids(void *, int, uint, uint, XRenderPictFormat *, int, int, _XTrapezoid *, int);
+extern (C) void XRenderFillRectangles(void *, int, uint, XRenderColor *, XRectangle *, int);
+extern (C) void XRenderFillRectangle(void *, int, uint, XRenderColor *, int, int, uint, uint);
+extern (C) void XRenderCompositeText32(void *, int, uint, uint, XRenderPictFormat *, int, int, int, int, _XGlyphElt32 *, int);
+extern (C) void XRenderCompositeText16(void *, int, uint, uint, XRenderPictFormat *, int, int, int, int, _XGlyphElt16 *, int);
+extern (C) void XRenderCompositeText8(void *, int, uint, uint, XRenderPictFormat *, int, int, int, int, _XGlyphElt8 *, int);
+extern (C) void XRenderCompositeString32(void *, int, uint, uint, XRenderPictFormat *, uint, int, int, int, int, uint *, int);
+extern (C) void XRenderCompositeString16(void *, int, uint, uint, XRenderPictFormat *, uint, int, int, int, int, ushort *, int);
+extern (C) void XRenderCompositeString8(void *, int, uint, uint, XRenderPictFormat *, uint, int, int, int, int, char *, int);
+extern (C) void XRenderFreeGlyphs(void *, uint, uint *, int);
+extern (C) void XRenderAddGlyphs(void *, uint, uint *, _XGlyphInfo *, int, char *, int);
+extern (C) void XRenderFreeGlyphSet(void *, uint);
+extern (C) uint XRenderReferenceGlyphSet(void *, uint);
+extern (C) uint XRenderCreateGlyphSet(void *, XRenderPictFormat *);
+extern (C) void XRenderComposite(void *, int, uint, uint, uint, int, int, int, int, int, int, uint, uint);
+extern (C) void XRenderFreePicture(void *, uint);
+extern (C) void XRenderSetPictureTransform(void *, uint, _XTransform *);
+extern (C) void XRenderSetPictureClipRegion(void *, uint, void *);
+extern (C) void XRenderSetPictureClipRectangles(void *, uint, int, int, XRectangle *, int);
+extern (C) void XRenderChangePicture(void *, uint, uint, _XRenderPictureAttributes *);
+extern (C) uint XRenderCreatePicture(void *, uint, XRenderPictFormat *, uint, _XRenderPictureAttributes *);
+extern (C) _XIndexValue * XRenderQueryPictIndexValues(void *, XRenderPictFormat *, int *);
+extern (C) XRenderPictFormat * XRenderFindStandardFormat(void *, int);
+extern (C) XRenderPictFormat * XRenderFindFormat(void *, uint, XRenderPictFormat *, int);
+extern (C) XRenderPictFormat * XRenderFindVisualFormat(void *, Visual *);
+extern (C) int XRenderSetSubpixelOrder(void *, int, int);
+extern (C) int XRenderQuerySubpixelOrder(void *, int);
+extern (C) int XRenderQueryFormats(void *);
+extern (C) int XRenderQueryVersion(void *, int *, int *);
+extern (C) int XRenderQueryExtension(void *, int *, int *);
+} // version(DYNLINK)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/Xutil.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,367 @@
+/******************************************************************************
+    Based on the generated files from the BCD tool
+    modified by: Frank Benoit <keinfarbton@googlemail.com>
+******************************************************************************/
+module org.eclipse.swt.internal.c.Xutil;
+
+import java.lang.all;
+
+public import org.eclipse.swt.internal.c.Xlib;
+
+extern(C):
+align(4):
+
+const int NoValue = 0x0000;
+const int XValue = 0x0001;
+const int YValue = 0x0002;
+const int WidthValue = 0x0004;
+const int HeightValue = 0x0008;
+const int AllValues = 0x000F;
+const int XNegative = 0x0010;
+const int YNegative = 0x0020;
+const int WithdrawnState = 0;
+const int NormalState = 1;
+const int IconicState = 3;
+const int DontCareState = 0;
+const int ZoomState = 2;
+const int InactiveState = 4;
+const int XNoMemory = -1;
+const int XLocaleNotSupported = -2;
+const int XConverterNotFound = -3;
+const int RectangleOut = 0;
+const int RectangleIn = 1;
+const int RectanglePart = 2;
+const int VisualNoMask = 0x0;
+const int VisualIDMask = 0x1;
+const int VisualScreenMask = 0x2;
+const int VisualDepthMask = 0x4;
+const int VisualClassMask = 0x8;
+const int VisualRedMaskMask = 0x10;
+const int VisualGreenMaskMask = 0x20;
+const int VisualBlueMaskMask = 0x40;
+const int VisualColormapSizeMask = 0x80;
+const int VisualBitsPerRGBMask = 0x100;
+const int VisualAllMask = 0x1FF;
+const int BitmapSuccess = 0;
+const int BitmapOpenFailed = 1;
+const int BitmapFileInvalid = 2;
+const int BitmapNoMemory = 3;
+const int XCSUCCESS = 0;
+const int XCNOMEM = 1;
+const int XCNOENT = 2;
+alias int XContext;
+alias void * Region;
+alias _XComposeStatus XComposeStatus;
+enum XICCEncodingStyle {
+XStringStyle=0,
+XCompoundTextStyle=1,
+XTextStyle=2,
+XStdICCTextStyle=3,
+XUTF8StringStyle=4,
+}
+alias void function(void *, char *, int, int, char * *) _BCD_func__1029;
+alias int function(void *) _BCD_func__1071;
+alias int function(void *, XErrorEvent *) _BCD_func__1072;
+alias void function(void *, char *, char *) _BCD_func__1145;
+alias int function(void *, char *, char *) _BCD_func__1146;
+alias void function(void *, char *, char *) _BCD_func__1147;
+struct XStandardColormap {
+uint colormap;
+uint red_max;
+uint red_mult;
+uint green_max;
+uint green_mult;
+uint blue_max;
+uint blue_mult;
+uint base_pixel;
+uint visualid;
+uint killid;
+}
+struct XVisualInfo {
+Visual * visual;
+uint visualid;
+int screen;
+int depth;
+int c_class;
+uint red_mask;
+uint green_mask;
+uint blue_mask;
+int colormap_size;
+int bits_per_rgb;
+}
+struct _XComposeStatus {
+char * compose_ptr;
+int chars_matched;
+}
+struct XClassHint {
+char * res_name;
+char * res_class;
+}
+struct XIconSize {
+int min_width;
+int min_height;
+int max_width;
+int max_height;
+int width_inc;
+int height_inc;
+}
+struct XTextProperty {
+char * value;
+uint encoding;
+int format;
+uint nitems;
+}
+struct XWMHints {
+int flags;
+int input;
+int initial_state;
+uint icon_pixmap;
+uint icon_window;
+int icon_x;
+int icon_y;
+uint icon_mask;
+uint window_group;
+}
+struct N10XSizeHints4__94E {
+int x;
+int y;
+}
+struct XSizeHints {
+int flags;
+int x;
+int y;
+int width;
+int height;
+int min_width;
+int min_height;
+int max_width;
+int max_height;
+int width_inc;
+int height_inc;
+N10XSizeHints4__94E min_aspect;
+N10XSizeHints4__94E max_aspect;
+int base_width;
+int base_height;
+int win_gravity;
+}
+version(DYNLINK){
+extern (C) int function(void *, void *, void *)XXorRegion;
+extern (C) int function(void *, int, char *, char *, uint, XSizeHints *, int *, int *, int *, int *, int *)XWMGeometry;
+extern (C) int function(void *, void *, void *)XUnionRegion;
+extern (C) int function(XRectangle *, void *, void *)XUnionRectWithRegion;
+extern (C) int function(void *, XTextProperty *, char * * *, int *)Xutf8TextPropertyToTextList;
+extern (C) int function(void *, XTextProperty *, wchar * * *, int *)XwcTextPropertyToTextList;
+extern (C) int function(void *, XTextProperty *, char * * *, int *)XmbTextPropertyToTextList;
+extern (C) int function(XTextProperty *, char * * *, int *)XTextPropertyToStringList;
+extern (C) void function(wchar * *)XwcFreeStringList;
+extern (C) int function(void *, char * *, int, int, XTextProperty *)Xutf8TextListToTextProperty;
+extern (C) int function(void *, wchar * *, int, int, XTextProperty *)XwcTextListToTextProperty;
+extern (C) int function(void *, char * *, int, int, XTextProperty *)XmbTextListToTextProperty;
+extern (C) int function(void *, void *, void *)XSubtractRegion;
+extern (C) int function(char * *, int, XTextProperty *)XStringListToTextProperty;
+extern (C) int function(void *, int, int)XShrinkRegion;
+extern (C) int function(void *, uint, XSizeHints *)XSetZoomHints;
+extern (C) void function(void *, uint, XStandardColormap *, uint)XSetStandardColormap;
+extern (C) int function(void *, void *, void *)XSetRegion;
+extern (C) void function(void *, uint, XSizeHints *, uint)XSetWMSizeHints;
+extern (C) void function(void *, uint, char *, char *, char * *, int, XSizeHints *, XWMHints *, XClassHint *)Xutf8SetWMProperties;
+extern (C) void function(void *, uint, char *, char *, char * *, int, XSizeHints *, XWMHints *, XClassHint *)XmbSetWMProperties;
+extern (C) void function(void *, uint, XTextProperty *, XTextProperty *, char * *, int, XSizeHints *, XWMHints *, XClassHint *)XSetWMProperties;
+extern (C) void function(void *, uint, XSizeHints *)XSetWMNormalHints;
+extern (C) void function(void *, uint, XTextProperty *)XSetWMName;
+extern (C) void function(void *, uint, XTextProperty *)XSetWMIconName;
+extern (C) int function(void *, uint, XWMHints *)XSetWMHints;
+extern (C) void function(void *, uint, XTextProperty *)XSetWMClientMachine;
+extern (C) void function(void *, uint, XTextProperty *, uint)XSetTextProperty;
+extern (C) int function(void *, uint, char *, char *, uint, char * *, int, XSizeHints *)XSetStandardProperties;
+extern (C) int function(void *, uint, XSizeHints *, uint)XSetSizeHints;
+extern (C) void function(void *, uint, XStandardColormap *, int, uint)XSetRGBColormaps;
+extern (C) int function(void *, uint, XSizeHints *)XSetNormalHints;
+extern (C) int function(void *, uint, XIconSize *, int)XSetIconSizes;
+extern (C) int function(void *, uint, XClassHint *)XSetClassHint;
+extern (C) int function(void *, uint, int, char *)XSaveContext;
+extern (C) int function(void *, int, int, uint, uint)XRectInRegion;
+extern (C) void * function(XPoint *, int, int)XPolygonRegion;
+extern (C) int function(void *, int, int)XPointInRegion;
+extern (C) int function(void *, int, int)XOffsetRegion;
+extern (C) int function(void *, int, int, int, XVisualInfo *)XMatchVisualInfo;
+extern (C) int function(XKeyEvent *, char *, int, uint *, _XComposeStatus *)XLookupString;
+extern (C) void function(uint, uint *, uint *)XConvertCase;
+extern (C) int function(void *, void *, void *)XIntersectRegion;
+extern (C) int function(void *, uint, XSizeHints *)XGetZoomHints;
+extern (C) int function(void *, uint, XSizeHints *, int *, uint)XGetWMSizeHints;
+extern (C) int function(void *, uint, XSizeHints *, int *)XGetWMNormalHints;
+extern (C) int function(void *, uint, XTextProperty *)XGetWMName;
+extern (C) int function(void *, uint, XTextProperty *)XGetWMIconName;
+extern (C) XWMHints * function(void *, uint)XGetWMHints;
+extern (C) int function(void *, uint, XTextProperty *)XGetWMClientMachine;
+extern (C) XVisualInfo * function(void *, int, XVisualInfo *, int *)XGetVisualInfo;
+extern (C) int function(void *, uint, XTextProperty *, uint)XGetTextProperty;
+extern (C) int function(void *, uint, XStandardColormap *, uint)XGetStandardColormap;
+extern (C) int function(void *, uint, XSizeHints *, uint)XGetSizeHints;
+extern (C) int function(void *, uint, XStandardColormap * *, int *, uint)XGetRGBColormaps;
+extern (C) int function(void *, uint, XSizeHints *)XGetNormalHints;
+extern (C) int function(void *, uint, XIconSize * *, int *)XGetIconSizes;
+extern (C) int function(void *, uint, XClassHint *)XGetClassHint;
+extern (C) int function(void *, uint, int, char * *)XFindContext;
+extern (C) int function(void *, void *)XEqualRegion;
+extern (C) int function(void *)XEmptyRegion;
+extern (C) int function(void *)XDestroyRegion;
+extern (C) int function(void *, uint, int)XDeleteContext;
+extern (C) char * function()XDefaultString;
+extern (C) void * function()XCreateRegion;
+extern (C) int function(void *, XRectangle *)XClipBox;
+extern (C) XWMHints * function()XAllocWMHints;
+extern (C) XStandardColormap * function()XAllocStandardColormap;
+extern (C) XSizeHints * function()XAllocSizeHints;
+extern (C) XIconSize * function()XAllocIconSize;
+extern (C) XClassHint * function()XAllocClassHint;
+
+
+Symbol[] symbols = [
+    { "XXorRegion",  cast(void**)& XXorRegion},
+    { "XWMGeometry",  cast(void**)& XWMGeometry},
+    { "XUnionRegion",  cast(void**)& XUnionRegion},
+    { "XUnionRectWithRegion",  cast(void**)& XUnionRectWithRegion},
+    { "Xutf8TextPropertyToTextList",  cast(void**)& Xutf8TextPropertyToTextList},
+    { "XwcTextPropertyToTextList",  cast(void**)& XwcTextPropertyToTextList},
+    { "XmbTextPropertyToTextList",  cast(void**)& XmbTextPropertyToTextList},
+    { "XTextPropertyToStringList",  cast(void**)& XTextPropertyToStringList},
+    { "XwcFreeStringList",  cast(void**)& XwcFreeStringList},
+    { "Xutf8TextListToTextProperty",  cast(void**)& Xutf8TextListToTextProperty},
+    { "XwcTextListToTextProperty",  cast(void**)& XwcTextListToTextProperty},
+    { "XmbTextListToTextProperty",  cast(void**)& XmbTextListToTextProperty},
+    { "XSubtractRegion",  cast(void**)& XSubtractRegion},
+    { "XStringListToTextProperty",  cast(void**)& XStringListToTextProperty},
+    { "XShrinkRegion",  cast(void**)& XShrinkRegion},
+    { "XSetZoomHints",  cast(void**)& XSetZoomHints},
+    { "XSetStandardColormap",  cast(void**)& XSetStandardColormap},
+    { "XSetRegion",  cast(void**)& XSetRegion},
+    { "XSetWMSizeHints",  cast(void**)& XSetWMSizeHints},
+    { "Xutf8SetWMProperties",  cast(void**)& Xutf8SetWMProperties},
+    { "XmbSetWMProperties",  cast(void**)& XmbSetWMProperties},
+    { "XSetWMProperties",  cast(void**)& XSetWMProperties},
+    { "XSetWMNormalHints",  cast(void**)& XSetWMNormalHints},
+    { "XSetWMName",  cast(void**)& XSetWMName},
+    { "XSetWMIconName",  cast(void**)& XSetWMIconName},
+    { "XSetWMHints",  cast(void**)& XSetWMHints},
+    { "XSetWMClientMachine",  cast(void**)& XSetWMClientMachine},
+    { "XSetTextProperty",  cast(void**)& XSetTextProperty},
+    { "XSetStandardProperties",  cast(void**)& XSetStandardProperties},
+    { "XSetSizeHints",  cast(void**)& XSetSizeHints},
+    { "XSetRGBColormaps",  cast(void**)& XSetRGBColormaps},
+    { "XSetNormalHints",  cast(void**)& XSetNormalHints},
+    { "XSetIconSizes",  cast(void**)& XSetIconSizes},
+    { "XSetClassHint",  cast(void**)& XSetClassHint},
+    { "XSaveContext",  cast(void**)& XSaveContext},
+    { "XRectInRegion",  cast(void**)& XRectInRegion},
+    { "XPolygonRegion",  cast(void**)& XPolygonRegion},
+    { "XPointInRegion",  cast(void**)& XPointInRegion},
+    { "XOffsetRegion",  cast(void**)& XOffsetRegion},
+    { "XMatchVisualInfo",  cast(void**)& XMatchVisualInfo},
+    { "XLookupString",  cast(void**)& XLookupString},
+    { "XConvertCase",  cast(void**)& XConvertCase},
+    { "XIntersectRegion",  cast(void**)& XIntersectRegion},
+    { "XGetZoomHints",  cast(void**)& XGetZoomHints},
+    { "XGetWMSizeHints",  cast(void**)& XGetWMSizeHints},
+    { "XGetWMNormalHints",  cast(void**)& XGetWMNormalHints},
+    { "XGetWMName",  cast(void**)& XGetWMName},
+    { "XGetWMIconName",  cast(void**)& XGetWMIconName},
+    { "XGetWMHints",  cast(void**)& XGetWMHints},
+    { "XGetWMClientMachine",  cast(void**)& XGetWMClientMachine},
+    { "XGetVisualInfo",  cast(void**)& XGetVisualInfo},
+    { "XGetTextProperty",  cast(void**)& XGetTextProperty},
+    { "XGetStandardColormap",  cast(void**)& XGetStandardColormap},
+    { "XGetSizeHints",  cast(void**)& XGetSizeHints},
+    { "XGetRGBColormaps",  cast(void**)& XGetRGBColormaps},
+    { "XGetNormalHints",  cast(void**)& XGetNormalHints},
+    { "XGetIconSizes",  cast(void**)& XGetIconSizes},
+    { "XGetClassHint",  cast(void**)& XGetClassHint},
+    { "XFindContext",  cast(void**)& XFindContext},
+    { "XEqualRegion",  cast(void**)& XEqualRegion},
+    { "XEmptyRegion",  cast(void**)& XEmptyRegion},
+    { "XDestroyRegion",  cast(void**)& XDestroyRegion},
+    { "XDeleteContext",  cast(void**)& XDeleteContext},
+    { "XDefaultString",  cast(void**)& XDefaultString},
+    { "XCreateRegion",  cast(void**)& XCreateRegion},
+    { "XClipBox",  cast(void**)& XClipBox},
+    { "XAllocWMHints",  cast(void**)& XAllocWMHints},
+    { "XAllocStandardColormap",  cast(void**)& XAllocStandardColormap},
+    { "XAllocSizeHints",  cast(void**)& XAllocSizeHints},
+    { "XAllocIconSize",  cast(void**)& XAllocIconSize},
+    { "XAllocClassHint",  cast(void**)& XAllocClassHint},
+];
+
+} else { // version(DYNLINK)
+extern (C) int XXorRegion(void *, void *, void *);
+extern (C) int XWMGeometry(void *, int, char *, char *, uint, XSizeHints *, int *, int *, int *, int *, int *);
+extern (C) int XUnionRegion(void *, void *, void *);
+extern (C) int XUnionRectWithRegion(XRectangle *, void *, void *);
+extern (C) int Xutf8TextPropertyToTextList(void *, XTextProperty *, char * * *, int *);
+extern (C) int XwcTextPropertyToTextList(void *, XTextProperty *, wchar * * *, int *);
+extern (C) int XmbTextPropertyToTextList(void *, XTextProperty *, char * * *, int *);
+extern (C) int XTextPropertyToStringList(XTextProperty *, char * * *, int *);
+extern (C) void XwcFreeStringList(wchar * *);
+extern (C) int Xutf8TextListToTextProperty(void *, char * *, int, int, XTextProperty *);
+extern (C) int XwcTextListToTextProperty(void *, wchar * *, int, int, XTextProperty *);
+extern (C) int XmbTextListToTextProperty(void *, char * *, int, int, XTextProperty *);
+extern (C) int XSubtractRegion(void *, void *, void *);
+extern (C) int XStringListToTextProperty(char * *, int, XTextProperty *);
+extern (C) int XShrinkRegion(void *, int, int);
+extern (C) int XSetZoomHints(void *, uint, XSizeHints *);
+extern (C) void XSetStandardColormap(void *, uint, XStandardColormap *, uint);
+extern (C) int XSetRegion(void *, void *, void *);
+extern (C) void XSetWMSizeHints(void *, uint, XSizeHints *, uint);
+extern (C) void Xutf8SetWMProperties(void *, uint, char *, char *, char * *, int, XSizeHints *, XWMHints *, XClassHint *);
+extern (C) void XmbSetWMProperties(void *, uint, char *, char *, char * *, int, XSizeHints *, XWMHints *, XClassHint *);
+extern (C) void XSetWMProperties(void *, uint, XTextProperty *, XTextProperty *, char * *, int, XSizeHints *, XWMHints *, XClassHint *);
+extern (C) void XSetWMNormalHints(void *, uint, XSizeHints *);
+extern (C) void XSetWMName(void *, uint, XTextProperty *);
+extern (C) void XSetWMIconName(void *, uint, XTextProperty *);
+extern (C) int XSetWMHints(void *, uint, XWMHints *);
+extern (C) void XSetWMClientMachine(void *, uint, XTextProperty *);
+extern (C) void XSetTextProperty(void *, uint, XTextProperty *, uint);
+extern (C) int XSetStandardProperties(void *, uint, char *, char *, uint, char * *, int, XSizeHints *);
+extern (C) int XSetSizeHints(void *, uint, XSizeHints *, uint);
+extern (C) void XSetRGBColormaps(void *, uint, XStandardColormap *, int, uint);
+extern (C) int XSetNormalHints(void *, uint, XSizeHints *);
+extern (C) int XSetIconSizes(void *, uint, XIconSize *, int);
+extern (C) int XSetClassHint(void *, uint, XClassHint *);
+extern (C) int XSaveContext(void *, uint, int, char *);
+extern (C) int XRectInRegion(void *, int, int, uint, uint);
+extern (C) void * XPolygonRegion(XPoint *, int, int);
+extern (C) int XPointInRegion(void *, int, int);
+extern (C) int XOffsetRegion(void *, int, int);
+extern (C) int XMatchVisualInfo(void *, int, int, int, XVisualInfo *);
+extern (C) int XLookupString(XKeyEvent *, char *, int, uint *, _XComposeStatus *);
+extern (C) void XConvertCase(uint, uint *, uint *);
+extern (C) int XIntersectRegion(void *, void *, void *);
+extern (C) int XGetZoomHints(void *, uint, XSizeHints *);
+extern (C) int XGetWMSizeHints(void *, uint, XSizeHints *, int *, uint);
+extern (C) int XGetWMNormalHints(void *, uint, XSizeHints *, int *);
+extern (C) int XGetWMName(void *, uint, XTextProperty *);
+extern (C) int XGetWMIconName(void *, uint, XTextProperty *);
+extern (C) XWMHints * XGetWMHints(void *, uint);
+extern (C) int XGetWMClientMachine(void *, uint, XTextProperty *);
+extern (C) XVisualInfo * XGetVisualInfo(void *, int, XVisualInfo *, int *);
+extern (C) int XGetTextProperty(void *, uint, XTextProperty *, uint);
+extern (C) int XGetStandardColormap(void *, uint, XStandardColormap *, uint);
+extern (C) int XGetSizeHints(void *, uint, XSizeHints *, uint);
+extern (C) int XGetRGBColormaps(void *, uint, XStandardColormap * *, int *, uint);
+extern (C) int XGetNormalHints(void *, uint, XSizeHints *);
+extern (C) int XGetIconSizes(void *, uint, XIconSize * *, int *);
+extern (C) int XGetClassHint(void *, uint, XClassHint *);
+extern (C) int XFindContext(void *, uint, int, char * *);
+extern (C) int XEqualRegion(void *, void *);
+extern (C) int XEmptyRegion(void *);
+extern (C) int XDestroyRegion(void *);
+extern (C) int XDeleteContext(void *, uint, int);
+extern (C) char * XDefaultString();
+extern (C) void * XCreateRegion();
+extern (C) int XClipBox(void *, XRectangle *);
+extern (C) XWMHints * XAllocWMHints();
+extern (C) XStandardColormap * XAllocStandardColormap();
+extern (C) XSizeHints * XAllocSizeHints();
+extern (C) XIconSize * XAllocIconSize();
+extern (C) XClassHint * XAllocClassHint();
+} // version(DYNLINK)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/atk.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,1524 @@
+/******************************************************************************
+    Based on the generated files from the BCD tool
+    modified by: Frank Benoit <benoit@tionex.de>
+******************************************************************************/
+module org.eclipse.swt.internal.c.atk;
+
+import java.lang.all;
+
+public import org.eclipse.swt.internal.c.glib_object;
+
+extern(C):
+align(4):
+
+
+alias _AtkValueIface AtkValueIface;
+alias void AtkValue;
+alias void function(void *, _GValue *) _BCD_func__4131;
+alias int function(void *, _GValue *) _BCD_func__4132;
+alias int function(void *) _BCD_func__2817;
+alias _BCD_func__2817 AtkFunction;
+alias _AtkMiscClass AtkMiscClass;
+alias _AtkMisc AtkMisc;
+alias void function(_AtkMisc *) _BCD_func__4134;
+alias _AtkTableIface AtkTableIface;
+alias _AtkObject AtkObject;
+alias void AtkTable;
+alias _AtkObject * function(void *, int, int) _BCD_func__4137;
+alias int function(void *, int, int) _BCD_func__4138;
+alias int function(void *, int) _BCD_func__4139;
+alias int function(void *) _BCD_func__4140;
+alias _AtkObject * function(void *) _BCD_func__4141;
+alias char * function(void *, int) _BCD_func__4142;
+alias _AtkObject * function(void *, int) _BCD_func__4143;
+alias void function(void *, _AtkObject *) _BCD_func__4144;
+alias void function(void *, int, char *) _BCD_func__4145;
+alias void function(void *, int, _AtkObject *) _BCD_func__4146;
+alias int function(void *, int * *) _BCD_func__4147;
+alias int function(void *, int) _BCD_func__4148;
+alias int function(void *, int, int) _BCD_func__4149;
+alias void function(void *, int, int) _BCD_func__4150;
+alias void function(void *) _BCD_func__4151;
+alias _AtkStreamableContentIface AtkStreamableContentIface;
+alias void AtkStreamableContent;
+alias int function(void *) _BCD_func__4153;
+alias char * function(void *, int) _BCD_func__4154;
+alias _GIOChannel * function(void *, char *) _BCD_func__4155;
+alias char * function(void *, char *) _BCD_func__4156;
+alias _AtkStateSetClass AtkStateSetClass;
+alias _AtkSelectionIface AtkSelectionIface;
+alias void AtkSelection;
+alias int function(void *, int) _BCD_func__4159;
+alias int function(void *) _BCD_func__4160;
+alias _AtkObject * function(void *, int) _BCD_func__4161;
+alias int function(void *) _BCD_func__4162;
+alias void function(void *) _BCD_func__4163;
+alias _AtkRelationSetClass AtkRelationSetClass;
+alias _AtkRelationClass AtkRelationClass;
+alias _AtkRelation AtkRelation;
+enum AtkRelationType {
+ATK_RELATION_NULL=0,
+ATK_RELATION_CONTROLLED_BY=1,
+ATK_RELATION_CONTROLLER_FOR=2,
+ATK_RELATION_LABEL_FOR=3,
+ATK_RELATION_LABELLED_BY=4,
+ATK_RELATION_MEMBER_OF=5,
+ATK_RELATION_NODE_CHILD_OF=6,
+ATK_RELATION_FLOWS_TO=7,
+ATK_RELATION_FLOWS_FROM=8,
+ATK_RELATION_SUBWINDOW_OF=9,
+ATK_RELATION_EMBEDS=10,
+ATK_RELATION_EMBEDDED_BY=11,
+ATK_RELATION_POPUP_FOR=12,
+ATK_RELATION_PARENT_WINDOW_OF=13,
+ATK_RELATION_DESCRIBED_BY=14,
+ATK_RELATION_DESCRIPTION_FOR=15,
+ATK_RELATION_LAST_DEFINED=16,
+}
+alias _AtkRegistryClass AtkRegistryClass;
+alias _AtkRegistry AtkRegistry;
+alias _AtkNoOpObjectFactoryClass AtkNoOpObjectFactoryClass;
+alias _AtkObjectFactoryClass AtkObjectFactoryClass;
+alias _AtkNoOpObjectFactory AtkNoOpObjectFactory;
+alias _AtkObjectFactory AtkObjectFactory;
+alias _AtkObject * function(_GObject *) _BCD_func__4172;
+alias void function(_AtkObjectFactory *) _BCD_func__4173;
+alias uint function() _BCD_func__4174;
+alias _AtkNoOpObjectClass AtkNoOpObjectClass;
+alias _AtkObjectClass AtkObjectClass;
+alias _AtkNoOpObject AtkNoOpObject;
+alias _AtkImageIface AtkImageIface;
+alias void AtkImage;
+enum AtkCoordType {
+ATK_XY_SCREEN=0,
+ATK_XY_WINDOW=1,
+}
+alias void function(void *, int *, int *, int) _BCD_func__4179;
+alias char * function(void *) _BCD_func__4180;
+alias void function(void *, int *, int *) _BCD_func__4181;
+alias int function(void *, char *) _BCD_func__4182;
+alias _AtkHypertextIface AtkHypertextIface;
+alias _AtkHyperlink AtkHyperlink;
+alias void AtkHypertext;
+alias _AtkHyperlink * function(void *, int) _BCD_func__4184;
+alias int function(void *) _BCD_func__4185;
+alias int function(void *, int) _BCD_func__4186;
+alias void function(void *, int) _BCD_func__4187;
+alias _AtkHyperlinkImplIface AtkHyperlinkImplIface;
+alias void AtkHyperlinkImpl;
+alias _AtkHyperlink * function(void *) _BCD_func__4189;
+alias _AtkHyperlinkClass AtkHyperlinkClass;
+alias char * function(_AtkHyperlink *, int) _BCD_func__4191;
+alias _AtkObject * function(_AtkHyperlink *, int) _BCD_func__4192;
+alias int function(_AtkHyperlink *) _BCD_func__4193;
+alias int function(_AtkHyperlink *) _BCD_func__4194;
+alias uint function(_AtkHyperlink *) _BCD_func__4195;
+alias void function(_AtkHyperlink *) _BCD_func__4196;
+enum AtkHyperlinkStateFlags {
+ATK_HYPERLINK_IS_INLINE=1,
+}
+alias _AtkGObjectAccessibleClass AtkGObjectAccessibleClass;
+alias _AtkGObjectAccessible AtkGObjectAccessible;
+alias _AtkEditableTextIface AtkEditableTextIface;
+alias void AtkEditableText;
+alias _GSList AtkAttributeSet;
+alias int function(void *, _GSList *, int, int) _BCD_func__4201;
+alias void function(void *, char *) _BCD_func__4202;
+alias void function(void *, char *, int, int *) _BCD_func__4203;
+alias void function(void *, int, int) _BCD_func__4204;
+alias void function(void *, int) _BCD_func__4205;
+enum AtkTextClipType {
+ATK_TEXT_CLIP_NONE=0,
+ATK_TEXT_CLIP_MIN=1,
+ATK_TEXT_CLIP_MAX=2,
+ATK_TEXT_CLIP_BOTH=3,
+}
+alias _AtkTextRange AtkTextRange;
+alias _AtkTextRectangle AtkTextRectangle;
+enum AtkTextBoundary {
+ATK_TEXT_BOUNDARY_CHAR=0,
+ATK_TEXT_BOUNDARY_WORD_START=1,
+ATK_TEXT_BOUNDARY_WORD_END=2,
+ATK_TEXT_BOUNDARY_SENTENCE_START=3,
+ATK_TEXT_BOUNDARY_SENTENCE_END=4,
+ATK_TEXT_BOUNDARY_LINE_START=5,
+ATK_TEXT_BOUNDARY_LINE_END=6,
+}
+alias _AtkTextIface AtkTextIface;
+alias void AtkText;
+alias char * function(void *, int, int) _BCD_func__4209;
+alias char * function(void *, int, int, int *, int *) _BCD_func__4210;
+alias uint function(void *, int) _BCD_func__4211;
+alias int function(void *) _BCD_func__4212;
+alias _GSList * function(void *, int, int *, int *) _BCD_func__4213;
+alias _GSList * function(void *) _BCD_func__4214;
+alias void function(void *, int, int *, int *, int *, int *, int) _BCD_func__4215;
+alias int function(void *, int, int, int) _BCD_func__4216;
+alias char * function(void *, int, int *, int *) _BCD_func__4217;
+alias int function(void *, int, int) _BCD_func__4218;
+alias int function(void *, int) _BCD_func__4219;
+alias int function(void *, int, int, int) _BCD_func__4220;
+alias void function(void *, int, int) _BCD_func__4221;
+alias void function(void *, int) _BCD_func__4222;
+alias void function(void *) _BCD_func__4223;
+alias void function(void *, int, int, int, _AtkTextRectangle *) _BCD_func__4224;
+alias _AtkTextRange * * function(void *, _AtkTextRectangle *, int, int, int) _BCD_func__4225;
+enum AtkTextAttribute {
+ATK_TEXT_ATTR_INVALID=0,
+ATK_TEXT_ATTR_LEFT_MARGIN=1,
+ATK_TEXT_ATTR_RIGHT_MARGIN=2,
+ATK_TEXT_ATTR_INDENT=3,
+ATK_TEXT_ATTR_INVISIBLE=4,
+ATK_TEXT_ATTR_EDITABLE=5,
+ATK_TEXT_ATTR_PIXELS_ABOVE_LINES=6,
+ATK_TEXT_ATTR_PIXELS_BELOW_LINES=7,
+ATK_TEXT_ATTR_PIXELS_INSIDE_WRAP=8,
+ATK_TEXT_ATTR_BG_FULL_HEIGHT=9,
+ATK_TEXT_ATTR_RISE=10,
+ATK_TEXT_ATTR_UNDERLINE=11,
+ATK_TEXT_ATTR_STRIKETHROUGH=12,
+ATK_TEXT_ATTR_SIZE=13,
+ATK_TEXT_ATTR_SCALE=14,
+ATK_TEXT_ATTR_WEIGHT=15,
+ATK_TEXT_ATTR_LANGUAGE=16,
+ATK_TEXT_ATTR_FAMILY_NAME=17,
+ATK_TEXT_ATTR_BG_COLOR=18,
+ATK_TEXT_ATTR_FG_COLOR=19,
+ATK_TEXT_ATTR_BG_STIPPLE=20,
+ATK_TEXT_ATTR_FG_STIPPLE=21,
+ATK_TEXT_ATTR_WRAP_MODE=22,
+ATK_TEXT_ATTR_DIRECTION=23,
+ATK_TEXT_ATTR_JUSTIFICATION=24,
+ATK_TEXT_ATTR_STRETCH=25,
+ATK_TEXT_ATTR_VARIANT=26,
+ATK_TEXT_ATTR_STYLE=27,
+ATK_TEXT_ATTR_LAST_DEFINED=28,
+}
+alias _AtkDocumentIface AtkDocumentIface;
+alias void AtkDocument;
+alias char * function(void *) _BCD_func__4227;
+alias void * function(void *) _BCD_func__4228;
+alias _GSList * function(void *) _BCD_func__4229;
+alias char * function(void *, char *) _BCD_func__4230;
+alias int function(void *, char *, char *) _BCD_func__4231;
+alias _AtkRectangle AtkRectangle;
+alias void function(_AtkObject *, int) _BCD_func__2758;
+alias _BCD_func__2758 AtkFocusHandler;
+alias _AtkComponentIface AtkComponentIface;
+alias void AtkComponent;
+alias uint function(void *, _BCD_func__2758) _BCD_func__4234;
+alias int function(void *, int, int, int) _BCD_func__4235;
+alias _AtkObject * function(void *, int, int, int) _BCD_func__4236;
+alias void function(void *, int *, int *, int *, int *, int) _BCD_func__4237;
+alias void function(void *, int *, int *, int) _BCD_func__4238;
+alias void function(void *, int *, int *) _BCD_func__4239;
+alias int function(void *) _BCD_func__4240;
+alias void function(void *, uint) _BCD_func__4241;
+alias int function(void *, int, int, int, int, int) _BCD_func__4242;
+alias int function(void *, int, int) _BCD_func__4243;
+enum AtkLayer {
+ATK_LAYER_INVALID=0,
+ATK_LAYER_BACKGROUND=1,
+ATK_LAYER_CANVAS=2,
+ATK_LAYER_WIDGET=3,
+ATK_LAYER_MDI=4,
+ATK_LAYER_POPUP=5,
+ATK_LAYER_OVERLAY=6,
+ATK_LAYER_WINDOW=7,
+}
+alias int function(void *) _BCD_func__4244;
+alias int function(void *) _BCD_func__4245;
+alias void function(void *, _AtkRectangle *) _BCD_func__4246;
+alias double function(void *) _BCD_func__4247;
+enum AtkKeyEventType {
+ATK_KEY_EVENT_PRESS=0,
+ATK_KEY_EVENT_RELEASE=1,
+ATK_KEY_EVENT_LAST_DEFINED=2,
+}
+alias _AtkKeyEventStruct AtkKeyEventStruct;
+alias int function(_AtkKeyEventStruct *, void *) _BCD_func__2777;
+alias _BCD_func__2777 AtkKeySnoopFunc;
+alias void function() _BCD_func__2778;
+alias _BCD_func__2778 AtkEventListenerInit;
+alias void function(_AtkObject *) _BCD_func__2779;
+alias _BCD_func__2779 AtkEventListener;
+alias _AtkUtilClass AtkUtilClass;
+alias int function(_GSignalInvocationHint *, uint, _GValue *, void *) _BCD_func__3077;
+alias uint function(_BCD_func__3077, char *) _BCD_func__4250;
+alias void function(uint) _BCD_func__4251;
+alias uint function(_BCD_func__2777, void *) _BCD_func__4252;
+alias _AtkObject * function() _BCD_func__4253;
+alias char * function() _BCD_func__4254;
+alias _AtkUtil AtkUtil;
+alias _AtkActionIface AtkActionIface;
+alias void AtkAction;
+alias int function(void *, int) _BCD_func__4257;
+alias int function(void *) _BCD_func__4258;
+alias char * function(void *, int) _BCD_func__4259;
+alias int function(void *, int, char *) _BCD_func__4260;
+alias _AtkPropertyValues AtkPropertyValues;
+alias void function(_AtkObject *, _AtkPropertyValues *) _BCD_func__2816;
+alias _BCD_func__2816 AtkPropertyChangeHandler;
+alias _AtkStateSet AtkStateSet;
+alias _AtkRelationSet AtkRelationSet;
+alias char * function(_AtkObject *) _BCD_func__4265;
+alias _AtkObject * function(_AtkObject *) _BCD_func__4266;
+alias int function(_AtkObject *) _BCD_func__4267;
+alias _AtkObject * function(_AtkObject *, int) _BCD_func__4268;
+alias _AtkRelationSet * function(_AtkObject *) _BCD_func__4269;
+enum AtkRole {
+ATK_ROLE_INVALID=0,
+ATK_ROLE_ACCEL_LABEL=1,
+ATK_ROLE_ALERT=2,
+ATK_ROLE_ANIMATION=3,
+ATK_ROLE_ARROW=4,
+ATK_ROLE_CALENDAR=5,
+ATK_ROLE_CANVAS=6,
+ATK_ROLE_CHECK_BOX=7,
+ATK_ROLE_CHECK_MENU_ITEM=8,
+ATK_ROLE_COLOR_CHOOSER=9,
+ATK_ROLE_COLUMN_HEADER=10,
+ATK_ROLE_COMBO_BOX=11,
+ATK_ROLE_DATE_EDITOR=12,
+ATK_ROLE_DESKTOP_ICON=13,
+ATK_ROLE_DESKTOP_FRAME=14,
+ATK_ROLE_DIAL=15,
+ATK_ROLE_DIALOG=16,
+ATK_ROLE_DIRECTORY_PANE=17,
+ATK_ROLE_DRAWING_AREA=18,
+ATK_ROLE_FILE_CHOOSER=19,
+ATK_ROLE_FILLER=20,
+ATK_ROLE_FONT_CHOOSER=21,
+ATK_ROLE_FRAME=22,
+ATK_ROLE_GLASS_PANE=23,
+ATK_ROLE_HTML_CONTAINER=24,
+ATK_ROLE_ICON=25,
+ATK_ROLE_IMAGE=26,
+ATK_ROLE_INTERNAL_FRAME=27,
+ATK_ROLE_LABEL=28,
+ATK_ROLE_LAYERED_PANE=29,
+ATK_ROLE_LIST=30,
+ATK_ROLE_LIST_ITEM=31,
+ATK_ROLE_MENU=32,
+ATK_ROLE_MENU_BAR=33,
+ATK_ROLE_MENU_ITEM=34,
+ATK_ROLE_OPTION_PANE=35,
+ATK_ROLE_PAGE_TAB=36,
+ATK_ROLE_PAGE_TAB_LIST=37,
+ATK_ROLE_PANEL=38,
+ATK_ROLE_PASSWORD_TEXT=39,
+ATK_ROLE_POPUP_MENU=40,
+ATK_ROLE_PROGRESS_BAR=41,
+ATK_ROLE_PUSH_BUTTON=42,
+ATK_ROLE_RADIO_BUTTON=43,
+ATK_ROLE_RADIO_MENU_ITEM=44,
+ATK_ROLE_ROOT_PANE=45,
+ATK_ROLE_ROW_HEADER=46,
+ATK_ROLE_SCROLL_BAR=47,
+ATK_ROLE_SCROLL_PANE=48,
+ATK_ROLE_SEPARATOR=49,
+ATK_ROLE_SLIDER=50,
+ATK_ROLE_SPLIT_PANE=51,
+ATK_ROLE_SPIN_BUTTON=52,
+ATK_ROLE_STATUSBAR=53,
+ATK_ROLE_TABLE=54,
+ATK_ROLE_TABLE_CELL=55,
+ATK_ROLE_TABLE_COLUMN_HEADER=56,
+ATK_ROLE_TABLE_ROW_HEADER=57,
+ATK_ROLE_TEAR_OFF_MENU_ITEM=58,
+ATK_ROLE_TERMINAL=59,
+ATK_ROLE_TEXT=60,
+ATK_ROLE_TOGGLE_BUTTON=61,
+ATK_ROLE_TOOL_BAR=62,
+ATK_ROLE_TOOL_TIP=63,
+ATK_ROLE_TREE=64,
+ATK_ROLE_TREE_TABLE=65,
+ATK_ROLE_UNKNOWN=66,
+ATK_ROLE_VIEWPORT=67,
+ATK_ROLE_WINDOW=68,
+ATK_ROLE_HEADER=69,
+ATK_ROLE_FOOTER=70,
+ATK_ROLE_PARAGRAPH=71,
+ATK_ROLE_RULER=72,
+ATK_ROLE_APPLICATION=73,
+ATK_ROLE_AUTOCOMPLETE=74,
+ATK_ROLE_EDITBAR=75,
+ATK_ROLE_EMBEDDED=76,
+ATK_ROLE_ENTRY=77,
+ATK_ROLE_CHART=78,
+ATK_ROLE_CAPTION=79,
+ATK_ROLE_DOCUMENT_FRAME=80,
+ATK_ROLE_HEADING=81,
+ATK_ROLE_PAGE=82,
+ATK_ROLE_SECTION=83,
+ATK_ROLE_REDUNDANT_OBJECT=84,
+ATK_ROLE_FORM=85,
+ATK_ROLE_LINK=86,
+ATK_ROLE_INPUT_METHOD_WINDOW=87,
+ATK_ROLE_LAST_DEFINED=88,
+}
+alias int function(_AtkObject *) _BCD_func__4270;
+alias int function(_AtkObject *) _BCD_func__4271;
+alias _AtkStateSet * function(_AtkObject *) _BCD_func__4272;
+alias void function(_AtkObject *, char *) _BCD_func__4273;
+alias void function(_AtkObject *, _AtkObject *) _BCD_func__4274;
+alias void function(_AtkObject *, int) _BCD_func__4275;
+alias uint function(_AtkObject *, _BCD_func__2816 *) _BCD_func__4276;
+alias void function(_AtkObject *, uint) _BCD_func__4277;
+alias void function(_AtkObject *, void *) _BCD_func__4278;
+alias void function(_AtkObject *, uint, void *) _BCD_func__4279;
+alias void function(_AtkObject *, char *, int) _BCD_func__4280;
+alias void function(_AtkObject *, void * *) _BCD_func__4281;
+alias _GSList * function(_AtkObject *) _BCD_func__4282;
+alias _AtkImplementorIface AtkImplementorIface;
+alias void AtkImplementor;
+alias _AtkObject * function(void *) _BCD_func__4285;
+alias _AtkAttribute AtkAttribute;
+alias ulong AtkState;
+enum AtkStateType {
+ATK_STATE_INVALID=0,
+ATK_STATE_ACTIVE=1,
+ATK_STATE_ARMED=2,
+ATK_STATE_BUSY=3,
+ATK_STATE_CHECKED=4,
+ATK_STATE_DEFUNCT=5,
+ATK_STATE_EDITABLE=6,
+ATK_STATE_ENABLED=7,
+ATK_STATE_EXPANDABLE=8,
+ATK_STATE_EXPANDED=9,
+ATK_STATE_FOCUSABLE=10,
+ATK_STATE_FOCUSED=11,
+ATK_STATE_HORIZONTAL=12,
+ATK_STATE_ICONIFIED=13,
+ATK_STATE_MODAL=14,
+ATK_STATE_MULTI_LINE=15,
+ATK_STATE_MULTISELECTABLE=16,
+ATK_STATE_OPAQUE=17,
+ATK_STATE_PRESSED=18,
+ATK_STATE_RESIZABLE=19,
+ATK_STATE_SELECTABLE=20,
+ATK_STATE_SELECTED=21,
+ATK_STATE_SENSITIVE=22,
+ATK_STATE_SHOWING=23,
+ATK_STATE_SINGLE_LINE=24,
+ATK_STATE_STALE=25,
+ATK_STATE_TRANSIENT=26,
+ATK_STATE_VERTICAL=27,
+ATK_STATE_VISIBLE=28,
+ATK_STATE_MANAGES_DESCENDANTS=29,
+ATK_STATE_INDETERMINATE=30,
+ATK_STATE_TRUNCATED=31,
+ATK_STATE_REQUIRED=32,
+ATK_STATE_INVALID_ENTRY=33,
+ATK_STATE_SUPPORTS_AUTOCOMPLETION=34,
+ATK_STATE_SELECTABLE_TEXT=35,
+ATK_STATE_DEFAULT=36,
+ATK_STATE_ANIMATED=37,
+ATK_STATE_VISITED=38,
+ATK_STATE_LAST_DEFINED=39,
+}
+alias void function(void *, uint, uint, _GInterfaceInfo *) _BCD_func__2892;
+alias void function(void *, uint, _GTypeInfo *, _GTypeValueTable *) _BCD_func__2893;
+alias void function(void *) _BCD_func__2894;
+alias void function(void *, _GObject *, int) _BCD_func__3041;
+alias void function(void *, _GObject *) _BCD_func__3047;
+alias void function(_GObject *) _BCD_func__3048;
+alias void function(_GObject *, uint, _GValue *, _GParamSpec *) _BCD_func__3049;
+alias void function(_GObject *, uint, _GValue *, _GParamSpec *) _BCD_func__3050;
+alias int function(_GSignalInvocationHint *, _GValue *, _GValue *, void *) _BCD_func__3076;
+alias void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *) _BCD_func__3078;
+alias void function(void *, _GClosure *) _BCD_func__3097;
+alias void function(_GValue *, _GValue *) _BCD_func__3155;
+alias void function(void *) _BCD_func__3183;
+alias void * function(void *) _BCD_func__3184;
+alias void function(void *, void *) _BCD_func__3188;
+alias int function(void *, _GTypeClass *) _BCD_func__3189;
+alias void function(_GTypeInstance *, void *) _BCD_func__3190;
+alias int function(void *, void *, void *) _BCD_func__3244;
+alias int function(void *, void *, void *) _BCD_func__3262;
+alias void function(_GScanner *, char *, int) _BCD_func__3265;
+alias int function(void *, _GString *, void *) _BCD_func__3338;
+alias void function(void *, void *, void *, _GError * *) _BCD_func__3356;
+alias int function(void *, void *, void *, _GError * *) _BCD_func__3357;
+alias int function(char *, char *, void *, _GError * *) _BCD_func__3358;
+alias void * function(void *, void *) _BCD_func__3369;
+alias void function(_GNode *, void *) _BCD_func__3370;
+alias int function(_GNode *, void *) _BCD_func__3371;
+alias void function(char *) _BCD_func__3379;
+alias void function(char *, int, char *, void *) _BCD_func__3381;
+alias int function(_GIOChannel *, int, void *) _BCD_func__3399;
+alias int function(_GPollFD *, uint, int) _BCD_func__3452;
+alias void function(int, int, void *) _BCD_func__3458;
+alias void function(_GHookList *, _GHook *) _BCD_func__3490;
+alias int function(_GHook *, void *) _BCD_func__3491;
+alias void function(_GHook *, void *) _BCD_func__3492;
+alias int function(_GHook *, _GHook *) _BCD_func__3493;
+alias void function(uint, void *, void *) _BCD_func__3527;
+alias int function(char *, char *, uint) _BCD_func__3530;
+alias char * function(void *) _BCD_func__3531;
+alias char * function(char *, void *) _BCD_func__3722;
+alias void function(void *, void *, void *) _BCD_func__3723;
+alias uint function(void *) _BCD_func__3724;
+alias int function(void *, void *) _BCD_func__3725;
+alias int function(void *, void *, void *) _BCD_func__3726;
+alias int function(void *, void *) _BCD_func__3727;
+struct _AtkValueIface {
+_GTypeInterface parent;
+_BCD_func__4131 get_current_value;
+_BCD_func__4131 get_maximum_value;
+_BCD_func__4131 get_minimum_value;
+_BCD_func__4132 set_current_value;
+_BCD_func__4131 get_minimum_increment;
+_BCD_func__2817 pad1;
+}
+struct _AtkMiscClass {
+_GObjectClass parent;
+_BCD_func__4134 threads_enter;
+_BCD_func__4134 threads_leave;
+void * [32] vfuncs;
+}
+struct _AtkMisc {
+_GObject parent;
+}
+struct _AtkTableIface {
+_GTypeInterface parent;
+_BCD_func__4137 ref_at;
+_BCD_func__4138 get_index_at;
+_BCD_func__4139 get_column_at_index;
+_BCD_func__4139 get_row_at_index;
+_BCD_func__4140 get_n_columns;
+_BCD_func__4140 get_n_rows;
+_BCD_func__4138 get_column_extent_at;
+_BCD_func__4138 get_row_extent_at;
+_BCD_func__4141 get_caption;
+_BCD_func__4142 get_column_description;
+_BCD_func__4143 get_column_header;
+_BCD_func__4142 get_row_description;
+_BCD_func__4143 get_row_header;
+_BCD_func__4141 get_summary;
+_BCD_func__4144 set_caption;
+_BCD_func__4145 set_column_description;
+_BCD_func__4146 set_column_header;
+_BCD_func__4145 set_row_description;
+_BCD_func__4146 set_row_header;
+_BCD_func__4144 set_summary;
+_BCD_func__4147 get_selected_columns;
+_BCD_func__4147 get_selected_rows;
+_BCD_func__4148 is_column_selected;
+_BCD_func__4148 is_row_selected;
+_BCD_func__4149 is_selected;
+_BCD_func__4148 add_row_selection;
+_BCD_func__4148 remove_row_selection;
+_BCD_func__4148 add_column_selection;
+_BCD_func__4148 remove_column_selection;
+_BCD_func__4150 row_inserted;
+_BCD_func__4150 column_inserted;
+_BCD_func__4150 row_deleted;
+_BCD_func__4150 column_deleted;
+_BCD_func__4151 row_reordered;
+_BCD_func__4151 column_reordered;
+_BCD_func__4151 model_changed;
+_BCD_func__2817 pad1;
+_BCD_func__2817 pad2;
+_BCD_func__2817 pad3;
+_BCD_func__2817 pad4;
+}
+struct _AtkStreamableContentIface {
+_GTypeInterface parent;
+_BCD_func__4153 get_n_mime_types;
+_BCD_func__4154 get_mime_type;
+_BCD_func__4155 get_stream;
+_BCD_func__4156 get_uri;
+_BCD_func__2817 pad1;
+_BCD_func__2817 pad2;
+_BCD_func__2817 pad3;
+}
+struct _AtkStateSetClass {
+_GObjectClass parent;
+}
+struct _AtkSelectionIface {
+_GTypeInterface parent;
+_BCD_func__4159 add_selection;
+_BCD_func__4160 clear_selection;
+_BCD_func__4161 ref_selection;
+_BCD_func__4162 get_selection_count;
+_BCD_func__4159 is_child_selected;
+_BCD_func__4159 remove_selection;
+_BCD_func__4160 select_all_selection;
+_BCD_func__4163 selection_changed;
+_BCD_func__2817 pad1;
+_BCD_func__2817 pad2;
+}
+struct _AtkRelationSetClass {
+_GObjectClass parent;
+_BCD_func__2817 pad1;
+_BCD_func__2817 pad2;
+}
+struct _AtkRelationClass {
+_GObjectClass parent;
+}
+struct _AtkRelation {
+_GObject parent;
+_GPtrArray * target;
+int relationship;
+}
+struct _AtkRegistryClass {
+_GObjectClass parent_class;
+}
+struct _AtkRegistry {
+_GObject parent;
+void * factory_type_registry;
+void * factory_singleton_cache;
+}
+struct _AtkNoOpObjectFactoryClass {
+_AtkObjectFactoryClass parent_class;
+}
+struct _AtkNoOpObjectFactory {
+_AtkObjectFactory parent;
+}
+struct _AtkObjectFactoryClass {
+_GObjectClass parent_class;
+_BCD_func__4172 create_accessible;
+_BCD_func__4173 invalidate;
+_BCD_func__4174 get_accessible_type;
+_BCD_func__2817 pad1;
+_BCD_func__2817 pad2;
+}
+struct _AtkObjectFactory {
+_GObject parent;
+}
+struct _AtkNoOpObjectClass {
+_AtkObjectClass parent_class;
+}
+struct _AtkNoOpObject {
+_AtkObject parent;
+}
+struct _AtkImageIface {
+_GTypeInterface parent;
+_BCD_func__4179 get_image_position;
+_BCD_func__4180 get_image_description;
+_BCD_func__4181 get_image_size;
+_BCD_func__4182 set_image_description;
+_BCD_func__4180 get_image_locale;
+_BCD_func__2817 pad1;
+}
+struct _AtkHypertextIface {
+_GTypeInterface parent;
+_BCD_func__4184 get_link;
+_BCD_func__4185 get_n_links;
+_BCD_func__4186 get_link_index;
+_BCD_func__4187 link_selected;
+_BCD_func__2817 pad1;
+_BCD_func__2817 pad2;
+_BCD_func__2817 pad3;
+}
+struct _AtkHyperlinkImplIface {
+_GTypeInterface parent;
+_BCD_func__4189 get_hyperlink;
+_BCD_func__2817 pad1;
+}
+struct _AtkHyperlinkClass {
+_GObjectClass parent;
+_BCD_func__4191 get_uri;
+_BCD_func__4192 get_object;
+_BCD_func__4193 get_end_index;
+_BCD_func__4193 get_start_index;
+_BCD_func__4194 is_valid;
+_BCD_func__4193 get_n_anchors;
+_BCD_func__4195 link_state;
+_BCD_func__4194 is_selected_link;
+_BCD_func__4196 link_activated;
+_BCD_func__2817 pad1;
+}
+struct _AtkHyperlink {
+_GObject parent;
+}
+struct _AtkGObjectAccessibleClass {
+_AtkObjectClass parent_class;
+_BCD_func__2817 pad1;
+_BCD_func__2817 pad2;
+}
+struct _AtkGObjectAccessible {
+_AtkObject parent;
+}
+struct _AtkEditableTextIface {
+_GTypeInterface parent_interface;
+_BCD_func__4201 set_run_attributes;
+_BCD_func__4202 set_text_contents;
+_BCD_func__4203 insert_text;
+_BCD_func__4204 copy_text;
+_BCD_func__4204 cut_text;
+_BCD_func__4204 delete_text;
+_BCD_func__4205 paste_text;
+_BCD_func__2817 pad1;
+_BCD_func__2817 pad2;
+}
+struct _AtkTextRange {
+_AtkTextRectangle bounds;
+int start_offset;
+int end_offset;
+char * content;
+}
+struct _AtkTextRectangle {
+int x;
+int y;
+int width;
+int height;
+}
+struct _AtkTextIface {
+_GTypeInterface parent;
+_BCD_func__4209 get_text;
+_BCD_func__4210 get_text_after_offset;
+_BCD_func__4210 get_text_at_offset;
+_BCD_func__4211 get_character_at_offset;
+_BCD_func__4210 get_text_before_offset;
+_BCD_func__4212 get_caret_offset;
+_BCD_func__4213 get_run_attributes;
+_BCD_func__4214 get_default_attributes;
+_BCD_func__4215 get_character_extents;
+_BCD_func__4212 get_character_count;
+_BCD_func__4216 get_offset_at_point;
+_BCD_func__4212 get_n_selections;
+_BCD_func__4217 get_selection;
+_BCD_func__4218 add_selection;
+_BCD_func__4219 remove_selection;
+_BCD_func__4220 set_selection;
+_BCD_func__4219 set_caret_offset;
+_BCD_func__4221 text_changed;
+_BCD_func__4222 text_caret_moved;
+_BCD_func__4223 text_selection_changed;
+_BCD_func__4223 text_attributes_changed;
+_BCD_func__4224 get_range_extents;
+_BCD_func__4225 get_bounded_ranges;
+_BCD_func__2817 pad4;
+}
+struct _AtkDocumentIface {
+_GTypeInterface parent;
+_BCD_func__4227 get_document_type;
+_BCD_func__4228 get_document;
+_BCD_func__4227 get_document_locale;
+_BCD_func__4229 get_document_attributes;
+_BCD_func__4230 get_document_attribute_value;
+_BCD_func__4231 set_document_attribute;
+_BCD_func__2817 pad1;
+_BCD_func__2817 pad2;
+_BCD_func__2817 pad3;
+_BCD_func__2817 pad4;
+}
+struct _AtkRectangle {
+int x;
+int y;
+int width;
+int height;
+}
+struct _AtkComponentIface {
+_GTypeInterface parent;
+_BCD_func__4234 add_focus_handler;
+_BCD_func__4235 contains;
+_BCD_func__4236 ref_accessible_at_point;
+_BCD_func__4237 get_extents;
+_BCD_func__4238 get_position;
+_BCD_func__4239 get_size;
+_BCD_func__4240 grab_focus;
+_BCD_func__4241 remove_focus_handler;
+_BCD_func__4242 set_extents;
+_BCD_func__4235 set_position;
+_BCD_func__4243 set_size;
+_BCD_func__4244 get_layer;
+_BCD_func__4245 get_mdi_zorder;
+_BCD_func__4246 bounds_changed;
+_BCD_func__4247 get_alpha;
+}
+struct _AtkKeyEventStruct {
+int type;
+uint state;
+uint keyval;
+int length;
+char * string;
+ushort keycode;
+uint timestamp;
+}
+struct _AtkUtilClass {
+_GObjectClass parent;
+_BCD_func__4250 add_global_event_listener;
+_BCD_func__4251 remove_global_event_listener;
+_BCD_func__4252 add_key_event_listener;
+_BCD_func__4251 remove_key_event_listener;
+_BCD_func__4253 get_root;
+_BCD_func__4254 get_toolkit_name;
+_BCD_func__4254 get_toolkit_version;
+}
+struct _AtkUtil {
+_GObject parent;
+}
+struct _AtkActionIface {
+_GTypeInterface parent;
+_BCD_func__4257 do_action;
+_BCD_func__4258 get_n_actions;
+_BCD_func__4259 get_description;
+_BCD_func__4259 get_name;
+_BCD_func__4259 get_keybinding;
+_BCD_func__4260 set_description;
+_BCD_func__4259 get_localized_name;
+_BCD_func__2817 pad2;
+}
+struct _AtkPropertyValues {
+char * property_name;
+_GValue old_value;
+_GValue new_value;
+}
+struct _AtkStateSet {
+_GObject parent;
+}
+struct _AtkRelationSet {
+_GObject parent;
+_GPtrArray * relations;
+}
+struct _AtkObjectClass {
+_GObjectClass parent;
+_BCD_func__4265 get_name;
+_BCD_func__4265 get_description;
+_BCD_func__4266 get_parent;
+_BCD_func__4267 get_n_children;
+_BCD_func__4268 ref_child;
+_BCD_func__4267 get_index_in_parent;
+_BCD_func__4269 ref_relation_set;
+_BCD_func__4270 get_role;
+_BCD_func__4271 get_layer;
+_BCD_func__4267 get_mdi_zorder;
+_BCD_func__4272 ref_state_set;
+_BCD_func__4273 set_name;
+_BCD_func__4273 set_description;
+_BCD_func__4274 set_parent;
+_BCD_func__4275 set_role;
+_BCD_func__4276 connect_property_change_handler;
+_BCD_func__4277 remove_property_change_handler;
+_BCD_func__4278 initialize;
+_BCD_func__4279 children_changed;
+_BCD_func__2758 focus_event;
+_BCD_func__2816 property_change;
+_BCD_func__4280 state_change;
+_BCD_func__2779 visible_data_changed;
+_BCD_func__4281 active_descendant_changed;
+_BCD_func__4282 get_attributes;
+_BCD_func__2817 pad1;
+_BCD_func__2817 pad2;
+}
+struct _AtkObject {
+_GObject parent;
+char * description;
+char * name;
+_AtkObject * accessible_parent;
+int role;
+_AtkRelationSet * relation_set;
+int layer;
+}
+struct _AtkImplementorIface {
+_GTypeInterface parent;
+_BCD_func__4285 ref_accessible;
+}
+struct _AtkAttribute {
+char * name;
+char * value;
+}
+version(DYNLINK){
+extern (C) void function(void *, _GValue *)atk_value_get_minimum_increment;
+extern (C) int function(void *, _GValue *)atk_value_set_current_value;
+extern (C) void function(void *, _GValue *)atk_value_get_minimum_value;
+extern (C) void function(void *, _GValue *)atk_value_get_maximum_value;
+extern (C) void function(void *, _GValue *)atk_value_get_current_value;
+extern (C) uint function()atk_value_get_type;
+extern (C) _AtkMisc * function()atk_misc_get_instance;
+extern (C) void function(_AtkMisc *)atk_misc_threads_leave;
+extern (C) void function(_AtkMisc *)atk_misc_threads_enter;
+extern (C) uint function()atk_misc_get_type;
+extern (C) extern _AtkMisc ** atk_misc_instance;
+extern (C) int function(void *, int)atk_table_remove_column_selection;
+extern (C) int function(void *, int)atk_table_add_column_selection;
+extern (C) int function(void *, int)atk_table_remove_row_selection;
+extern (C) int function(void *, int)atk_table_add_row_selection;
+extern (C) int function(void *, int, int)atk_table_is_selected;
+extern (C) int function(void *, int)atk_table_is_row_selected;
+extern (C) int function(void *, int)atk_table_is_column_selected;
+extern (C) int function(void *, int * *)atk_table_get_selected_rows;
+extern (C) int function(void *, int * *)atk_table_get_selected_columns;
+extern (C) void function(void *, _AtkObject *)atk_table_set_summary;
+extern (C) void function(void *, int, _AtkObject *)atk_table_set_row_header;
+extern (C) void function(void *, int, char *)atk_table_set_row_description;
+extern (C) void function(void *, int, _AtkObject *)atk_table_set_column_header;
+extern (C) void function(void *, int, char *)atk_table_set_column_description;
+extern (C) void function(void *, _AtkObject *)atk_table_set_caption;
+extern (C) _AtkObject * function(void *)atk_table_get_summary;
+extern (C) _AtkObject * function(void *, int)atk_table_get_row_header;
+extern (C) char * function(void *, int)atk_table_get_row_description;
+extern (C) _AtkObject * function(void *, int)atk_table_get_column_header;
+extern (C) char * function(void *, int)atk_table_get_column_description;
+extern (C) _AtkObject * function(void *)atk_table_get_caption;
+extern (C) int function(void *, int, int)atk_table_get_row_extent_at;
+extern (C) int function(void *, int, int)atk_table_get_column_extent_at;
+extern (C) int function(void *)atk_table_get_n_rows;
+extern (C) int function(void *)atk_table_get_n_columns;
+extern (C) int function(void *, int)atk_table_get_row_at_index;
+extern (C) int function(void *, int)atk_table_get_column_at_index;
+extern (C) int function(void *, int, int)atk_table_get_index_at;
+extern (C) _AtkObject * function(void *, int, int)atk_table_ref_at;
+extern (C) uint function()atk_table_get_type;
+extern (C) char * function(void *, char *)atk_streamable_content_get_uri;
+extern (C) _GIOChannel * function(void *, char *)atk_streamable_content_get_stream;
+extern (C) char * function(void *, int)atk_streamable_content_get_mime_type;
+extern (C) int function(void *)atk_streamable_content_get_n_mime_types;
+extern (C) uint function()atk_streamable_content_get_type;
+extern (C) _AtkStateSet * function(_AtkStateSet *, _AtkStateSet *)atk_state_set_xor_sets;
+extern (C) _AtkStateSet * function(_AtkStateSet *, _AtkStateSet *)atk_state_set_or_sets;
+extern (C) _AtkStateSet * function(_AtkStateSet *, _AtkStateSet *)atk_state_set_and_sets;
+extern (C) int function(_AtkStateSet *, int)atk_state_set_remove_state;
+extern (C) int function(_AtkStateSet *, int *, int)atk_state_set_contains_states;
+extern (C) int function(_AtkStateSet *, int)atk_state_set_contains_state;
+extern (C) void function(_AtkStateSet *)atk_state_set_clear_states;
+extern (C) void function(_AtkStateSet *, int *, int)atk_state_set_add_states;
+extern (C) int function(_AtkStateSet *, int)atk_state_set_add_state;
+extern (C) int function(_AtkStateSet *)atk_state_set_is_empty;
+extern (C) _AtkStateSet * function()atk_state_set_new;
+extern (C) uint function()atk_state_set_get_type;
+extern (C) int function(void *)atk_selection_select_all_selection;
+extern (C) int function(void *, int)atk_selection_remove_selection;
+extern (C) int function(void *, int)atk_selection_is_child_selected;
+extern (C) int function(void *)atk_selection_get_selection_count;
+extern (C) _AtkObject * function(void *, int)atk_selection_ref_selection;
+extern (C) int function(void *)atk_selection_clear_selection;
+extern (C) int function(void *, int)atk_selection_add_selection;
+extern (C) uint function()atk_selection_get_type;
+extern (C) void function(_AtkRelationSet *, int, _AtkObject *)atk_relation_set_add_relation_by_type;
+extern (C) _AtkRelation * function(_AtkRelationSet *, int)atk_relation_set_get_relation_by_type;
+extern (C) _AtkRelation * function(_AtkRelationSet *, int)atk_relation_set_get_relation;
+extern (C) int function(_AtkRelationSet *)atk_relation_set_get_n_relations;
+extern (C) void function(_AtkRelationSet *, _AtkRelation *)atk_relation_set_add;
+extern (C) void function(_AtkRelationSet *, _AtkRelation *)atk_relation_set_remove;
+extern (C) int function(_AtkRelationSet *, int)atk_relation_set_contains;
+extern (C) _AtkRelationSet * function()atk_relation_set_new;
+extern (C) uint function()atk_relation_set_get_type;
+extern (C) void function(_AtkRelation *, _AtkObject *)atk_relation_add_target;
+extern (C) _GPtrArray * function(_AtkRelation *)atk_relation_get_target;
+extern (C) int function(_AtkRelation *)atk_relation_get_relation_type;
+extern (C) _AtkRelation * function(_AtkObject * *, int, int)atk_relation_new;
+extern (C) int function(char *)atk_relation_type_for_name;
+extern (C) char * function(int)atk_relation_type_get_name;
+extern (C) int function(char *)atk_relation_type_register;
+extern (C) uint function()atk_relation_get_type;
+extern (C) _AtkRegistry * function()atk_get_default_registry;
+extern (C) _AtkObjectFactory * function(_AtkRegistry *, uint)atk_registry_get_factory;
+extern (C) uint function(_AtkRegistry *, uint)atk_registry_get_factory_type;
+extern (C) void function(_AtkRegistry *, uint, uint)atk_registry_set_factory_type;
+extern (C) uint function()atk_registry_get_type;
+extern (C) _AtkObjectFactory * function()atk_no_op_object_factory_new;
+extern (C) uint function()atk_no_op_object_factory_get_type;
+extern (C) uint function(_AtkObjectFactory *)atk_object_factory_get_accessible_type;
+extern (C) void function(_AtkObjectFactory *)atk_object_factory_invalidate;
+extern (C) _AtkObject * function(_AtkObjectFactory *, _GObject *)atk_object_factory_create_accessible;
+extern (C) uint function()atk_object_factory_get_type;
+extern (C) _AtkObject * function(_GObject *)atk_no_op_object_new;
+extern (C) uint function()atk_no_op_object_get_type;
+extern (C) char * function(void *)atk_image_get_image_locale;
+extern (C) void function(void *, int *, int *, int)atk_image_get_image_position;
+extern (C) int function(void *, char *)atk_image_set_image_description;
+extern (C) void function(void *, int *, int *)atk_image_get_image_size;
+extern (C) char * function(void *)atk_image_get_image_description;
+extern (C) uint function()atk_image_get_type;
+extern (C) int function(void *, int)atk_hypertext_get_link_index;
+extern (C) int function(void *)atk_hypertext_get_n_links;
+extern (C) _AtkHyperlink * function(void *, int)atk_hypertext_get_link;
+extern (C) uint function()atk_hypertext_get_type;
+extern (C) _AtkHyperlink * function(void *)atk_hyperlink_impl_get_hyperlink;
+extern (C) uint function()atk_hyperlink_impl_get_type;
+extern (C) int function(_AtkHyperlink *)atk_hyperlink_is_selected_link;
+extern (C) int function(_AtkHyperlink *)atk_hyperlink_get_n_anchors;
+extern (C) int function(_AtkHyperlink *)atk_hyperlink_is_inline;
+extern (C) int function(_AtkHyperlink *)atk_hyperlink_is_valid;
+extern (C) int function(_AtkHyperlink *)atk_hyperlink_get_start_index;
+extern (C) int function(_AtkHyperlink *)atk_hyperlink_get_end_index;
+extern (C) _AtkObject * function(_AtkHyperlink *, int)atk_hyperlink_get_object;
+extern (C) char * function(_AtkHyperlink *, int)atk_hyperlink_get_uri;
+extern (C) uint function()atk_hyperlink_get_type;
+extern (C) _GObject * function(_AtkGObjectAccessible *)atk_gobject_accessible_get_object;
+extern (C) _AtkObject * function(_GObject *)atk_gobject_accessible_for_object;
+extern (C) uint function()atk_gobject_accessible_get_type;
+extern (C) void function(void *, int)atk_editable_text_paste_text;
+extern (C) void function(void *, int, int)atk_editable_text_delete_text;
+extern (C) void function(void *, int, int)atk_editable_text_cut_text;
+extern (C) void function(void *, int, int)atk_editable_text_copy_text;
+extern (C) void function(void *, char *, int, int *)atk_editable_text_insert_text;
+extern (C) void function(void *, char *)atk_editable_text_set_text_contents;
+extern (C) int function(void *, _GSList *, int, int)atk_editable_text_set_run_attributes;
+extern (C) uint function()atk_editable_text_get_type;
+extern (C) char * function(int, int)atk_text_attribute_get_value;
+extern (C) int function(char *)atk_text_attribute_for_name;
+extern (C) char * function(int)atk_text_attribute_get_name;
+extern (C) void function(_GSList *)atk_attribute_set_free;
+extern (C) void function(_AtkTextRange * *)atk_text_free_ranges;
+extern (C) _AtkTextRange * * function(void *, _AtkTextRectangle *, int, int, int)atk_text_get_bounded_ranges;
+extern (C) void function(void *, int, int, int, _AtkTextRectangle *)atk_text_get_range_extents;
+extern (C) int function(void *, int)atk_text_set_caret_offset;
+extern (C) int function(void *, int, int, int)atk_text_set_selection;
+extern (C) int function(void *, int)atk_text_remove_selection;
+extern (C) int function(void *, int, int)atk_text_add_selection;
+extern (C) char * function(void *, int, int *, int *)atk_text_get_selection;
+extern (C) int function(void *)atk_text_get_n_selections;
+extern (C) int function(void *, int, int, int)atk_text_get_offset_at_point;
+extern (C) int function(void *)atk_text_get_character_count;
+extern (C) _GSList * function(void *)atk_text_get_default_attributes;
+extern (C) _GSList * function(void *, int, int *, int *)atk_text_get_run_attributes;
+extern (C) void function(void *, int, int *, int *, int *, int *, int)atk_text_get_character_extents;
+extern (C) int function(void *)atk_text_get_caret_offset;
+extern (C) char * function(void *, int, int, int *, int *)atk_text_get_text_before_offset;
+extern (C) char * function(void *, int, int, int *, int *)atk_text_get_text_at_offset;
+extern (C) char * function(void *, int, int, int *, int *)atk_text_get_text_after_offset;
+extern (C) uint function(void *, int)atk_text_get_character_at_offset;
+extern (C) char * function(void *, int, int)atk_text_get_text;
+extern (C) uint function()atk_text_get_type;
+extern (C) int function(char *)atk_text_attribute_register;
+extern (C) int function(void *, char *, char *)atk_document_set_attribute_value;
+extern (C) char * function(void *, char *)atk_document_get_attribute_value;
+extern (C) _GSList * function(void *)atk_document_get_attributes;
+extern (C) char * function(void *)atk_document_get_locale;
+extern (C) void * function(void *)atk_document_get_document;
+extern (C) char * function(void *)atk_document_get_document_type;
+extern (C) uint function()atk_document_get_type;
+extern (C) double function(void *)atk_component_get_alpha;
+extern (C) int function(void *, int, int)atk_component_set_size;
+extern (C) int function(void *, int, int, int)atk_component_set_position;
+extern (C) int function(void *, int, int, int, int, int)atk_component_set_extents;
+extern (C) void function(void *, uint)atk_component_remove_focus_handler;
+extern (C) int function(void *)atk_component_grab_focus;
+extern (C) int function(void *)atk_component_get_mdi_zorder;
+extern (C) int function(void *)atk_component_get_layer;
+extern (C) void function(void *, int *, int *)atk_component_get_size;
+extern (C) void function(void *, int *, int *, int)atk_component_get_position;
+extern (C) void function(void *, int *, int *, int *, int *, int)atk_component_get_extents;
+extern (C) _AtkObject * function(void *, int, int, int)atk_component_ref_accessible_at_point;
+extern (C) int function(void *, int, int, int)atk_component_contains;
+extern (C) uint function(void *, _BCD_func__2758)atk_component_add_focus_handler;
+extern (C) uint function()atk_component_get_type;
+extern (C) uint function()atk_rectangle_get_type;
+extern (C) char * function()atk_get_version;
+extern (C) char * function()atk_get_toolkit_version;
+extern (C) char * function()atk_get_toolkit_name;
+extern (C) _AtkObject * function()atk_get_focus_object;
+extern (C) _AtkObject * function()atk_get_root;
+extern (C) void function(uint)atk_remove_key_event_listener;
+extern (C) uint function(_BCD_func__2777, void *)atk_add_key_event_listener;
+extern (C) void function(uint)atk_remove_global_event_listener;
+extern (C) uint function(_BCD_func__3077, char *)atk_add_global_event_listener;
+extern (C) void function(_AtkObject *)atk_focus_tracker_notify;
+extern (C) void function(_BCD_func__2778)atk_focus_tracker_init;
+extern (C) void function(uint)atk_remove_focus_tracker;
+extern (C) uint function(_BCD_func__2779)atk_add_focus_tracker;
+extern (C) uint function()atk_util_get_type;
+extern (C) char * function(void *, int)atk_action_get_localized_name;
+extern (C) int function(void *, int, char *)atk_action_set_description;
+extern (C) char * function(void *, int)atk_action_get_keybinding;
+extern (C) char * function(void *, int)atk_action_get_name;
+extern (C) char * function(void *, int)atk_action_get_description;
+extern (C) int function(void *)atk_action_get_n_actions;
+extern (C) int function(void *, int)atk_action_do_action;
+extern (C) uint function()atk_action_get_type;
+extern (C) char * function(int)atk_role_get_localized_name;
+extern (C) int function(_AtkObject *, int, _AtkObject *)atk_object_remove_relationship;
+extern (C) int function(_AtkObject *, int, _AtkObject *)atk_object_add_relationship;
+extern (C) int function(char *)atk_role_for_name;
+extern (C) char * function(int)atk_role_get_name;
+extern (C) void function(_AtkObject *, void *)atk_object_initialize;
+extern (C) void function(_AtkObject *, ulong, int)atk_object_notify_state_change;
+extern (C) void function(_AtkObject *, uint)atk_object_remove_property_change_handler;
+extern (C) uint function(_AtkObject *, _BCD_func__2816 *)atk_object_connect_property_change_handler;
+extern (C) void function(_AtkObject *, int)atk_object_set_role;
+extern (C) void function(_AtkObject *, _AtkObject *)atk_object_set_parent;
+extern (C) void function(_AtkObject *, char *)atk_object_set_description;
+extern (C) void function(_AtkObject *, char *)atk_object_set_name;
+extern (C) int function(_AtkObject *)atk_object_get_index_in_parent;
+extern (C) _AtkStateSet * function(_AtkObject *)atk_object_ref_state_set;
+extern (C) _GSList * function(_AtkObject *)atk_object_get_attributes;
+extern (C) int function(_AtkObject *)atk_object_get_mdi_zorder;
+extern (C) int function(_AtkObject *)atk_object_get_layer;
+extern (C) int function(_AtkObject *)atk_object_get_role;
+extern (C) _AtkRelationSet * function(_AtkObject *)atk_object_ref_relation_set;
+extern (C) _AtkObject * function(_AtkObject *, int)atk_object_ref_accessible_child;
+extern (C) int function(_AtkObject *)atk_object_get_n_accessible_children;
+extern (C) _AtkObject * function(_AtkObject *)atk_object_get_parent;
+extern (C) char * function(_AtkObject *)atk_object_get_description;
+extern (C) char * function(_AtkObject *)atk_object_get_name;
+extern (C) _AtkObject * function(void *)atk_implementor_ref_accessible;
+extern (C) uint function()atk_implementor_get_type;
+extern (C) uint function()atk_object_get_type;
+extern (C) int function(char *)atk_role_register;
+extern (C) int function(char *)atk_state_type_for_name;
+extern (C) char * function(int)atk_state_type_get_name;
+extern (C) int function(char *)atk_state_type_register;
+
+
+Symbol[] symbols = [
+    { "atk_value_get_minimum_increment",  cast(void**)& atk_value_get_minimum_increment},
+    { "atk_value_set_current_value",  cast(void**)& atk_value_set_current_value},
+    { "atk_value_get_minimum_value",  cast(void**)& atk_value_get_minimum_value},
+    { "atk_value_get_maximum_value",  cast(void**)& atk_value_get_maximum_value},
+    { "atk_value_get_current_value",  cast(void**)& atk_value_get_current_value},
+    { "atk_value_get_type",  cast(void**)& atk_value_get_type},
+    { "atk_misc_get_instance",  cast(void**)& atk_misc_get_instance},
+    { "atk_misc_threads_leave",  cast(void**)& atk_misc_threads_leave},
+    { "atk_misc_threads_enter",  cast(void**)& atk_misc_threads_enter},
+    { "atk_misc_get_type",  cast(void**)& atk_misc_get_type},
+    { "atk_misc_instance",  cast(void**)& atk_misc_instance},
+    { "atk_table_remove_column_selection",  cast(void**)& atk_table_remove_column_selection},
+    { "atk_table_add_column_selection",  cast(void**)& atk_table_add_column_selection},
+    { "atk_table_remove_row_selection",  cast(void**)& atk_table_remove_row_selection},
+    { "atk_table_add_row_selection",  cast(void**)& atk_table_add_row_selection},
+    { "atk_table_is_selected",  cast(void**)& atk_table_is_selected},
+    { "atk_table_is_row_selected",  cast(void**)& atk_table_is_row_selected},
+    { "atk_table_is_column_selected",  cast(void**)& atk_table_is_column_selected},
+    { "atk_table_get_selected_rows",  cast(void**)& atk_table_get_selected_rows},
+    { "atk_table_get_selected_columns",  cast(void**)& atk_table_get_selected_columns},
+    { "atk_table_set_summary",  cast(void**)& atk_table_set_summary},
+    { "atk_table_set_row_header",  cast(void**)& atk_table_set_row_header},
+    { "atk_table_set_row_description",  cast(void**)& atk_table_set_row_description},
+    { "atk_table_set_column_header",  cast(void**)& atk_table_set_column_header},
+    { "atk_table_set_column_description",  cast(void**)& atk_table_set_column_description},
+    { "atk_table_set_caption",  cast(void**)& atk_table_set_caption},
+    { "atk_table_get_summary",  cast(void**)& atk_table_get_summary},
+    { "atk_table_get_row_header",  cast(void**)& atk_table_get_row_header},
+    { "atk_table_get_row_description",  cast(void**)& atk_table_get_row_description},
+    { "atk_table_get_column_header",  cast(void**)& atk_table_get_column_header},
+    { "atk_table_get_column_description",  cast(void**)& atk_table_get_column_description},
+    { "atk_table_get_caption",  cast(void**)& atk_table_get_caption},
+    { "atk_table_get_row_extent_at",  cast(void**)& atk_table_get_row_extent_at},
+    { "atk_table_get_column_extent_at",  cast(void**)& atk_table_get_column_extent_at},
+    { "atk_table_get_n_rows",  cast(void**)& atk_table_get_n_rows},
+    { "atk_table_get_n_columns",  cast(void**)& atk_table_get_n_columns},
+    { "atk_table_get_row_at_index",  cast(void**)& atk_table_get_row_at_index},
+    { "atk_table_get_column_at_index",  cast(void**)& atk_table_get_column_at_index},
+    { "atk_table_get_index_at",  cast(void**)& atk_table_get_index_at},
+    { "atk_table_ref_at",  cast(void**)& atk_table_ref_at},
+    { "atk_table_get_type",  cast(void**)& atk_table_get_type},
+    { "atk_streamable_content_get_uri",  cast(void**)& atk_streamable_content_get_uri},
+    { "atk_streamable_content_get_stream",  cast(void**)& atk_streamable_content_get_stream},
+    { "atk_streamable_content_get_mime_type",  cast(void**)& atk_streamable_content_get_mime_type},
+    { "atk_streamable_content_get_n_mime_types",  cast(void**)& atk_streamable_content_get_n_mime_types},
+    { "atk_streamable_content_get_type",  cast(void**)& atk_streamable_content_get_type},
+    { "atk_state_set_xor_sets",  cast(void**)& atk_state_set_xor_sets},
+    { "atk_state_set_or_sets",  cast(void**)& atk_state_set_or_sets},
+    { "atk_state_set_and_sets",  cast(void**)& atk_state_set_and_sets},
+    { "atk_state_set_remove_state",  cast(void**)& atk_state_set_remove_state},
+    { "atk_state_set_contains_states",  cast(void**)& atk_state_set_contains_states},
+    { "atk_state_set_contains_state",  cast(void**)& atk_state_set_contains_state},
+    { "atk_state_set_clear_states",  cast(void**)& atk_state_set_clear_states},
+    { "atk_state_set_add_states",  cast(void**)& atk_state_set_add_states},
+    { "atk_state_set_add_state",  cast(void**)& atk_state_set_add_state},
+    { "atk_state_set_is_empty",  cast(void**)& atk_state_set_is_empty},
+    { "atk_state_set_new",  cast(void**)& atk_state_set_new},
+    { "atk_state_set_get_type",  cast(void**)& atk_state_set_get_type},
+    { "atk_selection_select_all_selection",  cast(void**)& atk_selection_select_all_selection},
+    { "atk_selection_remove_selection",  cast(void**)& atk_selection_remove_selection},
+    { "atk_selection_is_child_selected",  cast(void**)& atk_selection_is_child_selected},
+    { "atk_selection_get_selection_count",  cast(void**)& atk_selection_get_selection_count},
+    { "atk_selection_ref_selection",  cast(void**)& atk_selection_ref_selection},
+    { "atk_selection_clear_selection",  cast(void**)& atk_selection_clear_selection},
+    { "atk_selection_add_selection",  cast(void**)& atk_selection_add_selection},
+    { "atk_selection_get_type",  cast(void**)& atk_selection_get_type},
+    { "atk_relation_set_add_relation_by_type",  cast(void**)& atk_relation_set_add_relation_by_type},
+    { "atk_relation_set_get_relation_by_type",  cast(void**)& atk_relation_set_get_relation_by_type},
+    { "atk_relation_set_get_relation",  cast(void**)& atk_relation_set_get_relation},
+    { "atk_relation_set_get_n_relations",  cast(void**)& atk_relation_set_get_n_relations},
+    { "atk_relation_set_add",  cast(void**)& atk_relation_set_add},
+    { "atk_relation_set_remove",  cast(void**)& atk_relation_set_remove},
+    { "atk_relation_set_contains",  cast(void**)& atk_relation_set_contains},
+    { "atk_relation_set_new",  cast(void**)& atk_relation_set_new},
+    { "atk_relation_set_get_type",  cast(void**)& atk_relation_set_get_type},
+    { "atk_relation_add_target",  cast(void**)& atk_relation_add_target},
+    { "atk_relation_get_target",  cast(void**)& atk_relation_get_target},
+    { "atk_relation_get_relation_type",  cast(void**)& atk_relation_get_relation_type},
+    { "atk_relation_new",  cast(void**)& atk_relation_new},
+    { "atk_relation_type_for_name",  cast(void**)& atk_relation_type_for_name},
+    { "atk_relation_type_get_name",  cast(void**)& atk_relation_type_get_name},
+    { "atk_relation_type_register",  cast(void**)& atk_relation_type_register},
+    { "atk_relation_get_type",  cast(void**)& atk_relation_get_type},
+    { "atk_get_default_registry",  cast(void**)& atk_get_default_registry},
+    { "atk_registry_get_factory",  cast(void**)& atk_registry_get_factory},
+    { "atk_registry_get_factory_type",  cast(void**)& atk_registry_get_factory_type},
+    { "atk_registry_set_factory_type",  cast(void**)& atk_registry_set_factory_type},
+    { "atk_registry_get_type",  cast(void**)& atk_registry_get_type},
+    { "atk_no_op_object_factory_new",  cast(void**)& atk_no_op_object_factory_new},
+    { "atk_no_op_object_factory_get_type",  cast(void**)& atk_no_op_object_factory_get_type},
+    { "atk_object_factory_get_accessible_type",  cast(void**)& atk_object_factory_get_accessible_type},
+    { "atk_object_factory_invalidate",  cast(void**)& atk_object_factory_invalidate},
+    { "atk_object_factory_create_accessible",  cast(void**)& atk_object_factory_create_accessible},
+    { "atk_object_factory_get_type",  cast(void**)& atk_object_factory_get_type},
+    { "atk_no_op_object_new",  cast(void**)& atk_no_op_object_new},
+    { "atk_no_op_object_get_type",  cast(void**)& atk_no_op_object_get_type},
+    { "atk_image_get_image_locale",  cast(void**)& atk_image_get_image_locale},
+    { "atk_image_get_image_position",  cast(void**)& atk_image_get_image_position},
+    { "atk_image_set_image_description",  cast(void**)& atk_image_set_image_description},
+    { "atk_image_get_image_size",  cast(void**)& atk_image_get_image_size},
+    { "atk_image_get_image_description",  cast(void**)& atk_image_get_image_description},
+    { "atk_image_get_type",  cast(void**)& atk_image_get_type},
+    { "atk_hypertext_get_link_index",  cast(void**)& atk_hypertext_get_link_index},
+    { "atk_hypertext_get_n_links",  cast(void**)& atk_hypertext_get_n_links},
+    { "atk_hypertext_get_link",  cast(void**)& atk_hypertext_get_link},
+    { "atk_hypertext_get_type",  cast(void**)& atk_hypertext_get_type},
+    { "atk_hyperlink_impl_get_hyperlink",  cast(void**)& atk_hyperlink_impl_get_hyperlink},
+    { "atk_hyperlink_impl_get_type",  cast(void**)& atk_hyperlink_impl_get_type},
+    { "atk_hyperlink_is_selected_link",  cast(void**)& atk_hyperlink_is_selected_link},
+    { "atk_hyperlink_get_n_anchors",  cast(void**)& atk_hyperlink_get_n_anchors},
+    { "atk_hyperlink_is_inline",  cast(void**)& atk_hyperlink_is_inline},
+    { "atk_hyperlink_is_valid",  cast(void**)& atk_hyperlink_is_valid},
+    { "atk_hyperlink_get_start_index",  cast(void**)& atk_hyperlink_get_start_index},
+    { "atk_hyperlink_get_end_index",  cast(void**)& atk_hyperlink_get_end_index},
+    { "atk_hyperlink_get_object",  cast(void**)& atk_hyperlink_get_object},
+    { "atk_hyperlink_get_uri",  cast(void**)& atk_hyperlink_get_uri},
+    { "atk_hyperlink_get_type",  cast(void**)& atk_hyperlink_get_type},
+    { "atk_gobject_accessible_get_object",  cast(void**)& atk_gobject_accessible_get_object},
+    { "atk_gobject_accessible_for_object",  cast(void**)& atk_gobject_accessible_for_object},
+    { "atk_gobject_accessible_get_type",  cast(void**)& atk_gobject_accessible_get_type},
+    { "atk_editable_text_paste_text",  cast(void**)& atk_editable_text_paste_text},
+    { "atk_editable_text_delete_text",  cast(void**)& atk_editable_text_delete_text},
+    { "atk_editable_text_cut_text",  cast(void**)& atk_editable_text_cut_text},
+    { "atk_editable_text_copy_text",  cast(void**)& atk_editable_text_copy_text},
+    { "atk_editable_text_insert_text",  cast(void**)& atk_editable_text_insert_text},
+    { "atk_editable_text_set_text_contents",  cast(void**)& atk_editable_text_set_text_contents},
+    { "atk_editable_text_set_run_attributes",  cast(void**)& atk_editable_text_set_run_attributes},
+    { "atk_editable_text_get_type",  cast(void**)& atk_editable_text_get_type},
+    { "atk_text_attribute_get_value",  cast(void**)& atk_text_attribute_get_value},
+    { "atk_text_attribute_for_name",  cast(void**)& atk_text_attribute_for_name},
+    { "atk_text_attribute_get_name",  cast(void**)& atk_text_attribute_get_name},
+    { "atk_attribute_set_free",  cast(void**)& atk_attribute_set_free},
+    { "atk_text_free_ranges",  cast(void**)& atk_text_free_ranges},
+    { "atk_text_get_bounded_ranges",  cast(void**)& atk_text_get_bounded_ranges},
+    { "atk_text_get_range_extents",  cast(void**)& atk_text_get_range_extents},
+    { "atk_text_set_caret_offset",  cast(void**)& atk_text_set_caret_offset},
+    { "atk_text_set_selection",  cast(void**)& atk_text_set_selection},
+    { "atk_text_remove_selection",  cast(void**)& atk_text_remove_selection},
+    { "atk_text_add_selection",  cast(void**)& atk_text_add_selection},
+    { "atk_text_get_selection",  cast(void**)& atk_text_get_selection},
+    { "atk_text_get_n_selections",  cast(void**)& atk_text_get_n_selections},
+    { "atk_text_get_offset_at_point",  cast(void**)& atk_text_get_offset_at_point},
+    { "atk_text_get_character_count",  cast(void**)& atk_text_get_character_count},
+    { "atk_text_get_default_attributes",  cast(void**)& atk_text_get_default_attributes},
+    { "atk_text_get_run_attributes",  cast(void**)& atk_text_get_run_attributes},
+    { "atk_text_get_character_extents",  cast(void**)& atk_text_get_character_extents},
+    { "atk_text_get_caret_offset",  cast(void**)& atk_text_get_caret_offset},
+    { "atk_text_get_text_before_offset",  cast(void**)& atk_text_get_text_before_offset},
+    { "atk_text_get_text_at_offset",  cast(void**)& atk_text_get_text_at_offset},
+    { "atk_text_get_text_after_offset",  cast(void**)& atk_text_get_text_after_offset},
+    { "atk_text_get_character_at_offset",  cast(void**)& atk_text_get_character_at_offset},
+    { "atk_text_get_text",  cast(void**)& atk_text_get_text},
+    { "atk_text_get_type",  cast(void**)& atk_text_get_type},
+    { "atk_text_attribute_register",  cast(void**)& atk_text_attribute_register},
+    { "atk_document_set_attribute_value",  cast(void**)& atk_document_set_attribute_value},
+    { "atk_document_get_attribute_value",  cast(void**)& atk_document_get_attribute_value},
+    { "atk_document_get_attributes",  cast(void**)& atk_document_get_attributes},
+    { "atk_document_get_locale",  cast(void**)& atk_document_get_locale},
+    { "atk_document_get_document",  cast(void**)& atk_document_get_document},
+    { "atk_document_get_document_type",  cast(void**)& atk_document_get_document_type},
+    { "atk_document_get_type",  cast(void**)& atk_document_get_type},
+    { "atk_component_get_alpha",  cast(void**)& atk_component_get_alpha},
+    { "atk_component_set_size",  cast(void**)& atk_component_set_size},
+    { "atk_component_set_position",  cast(void**)& atk_component_set_position},
+    { "atk_component_set_extents",  cast(void**)& atk_component_set_extents},
+    { "atk_component_remove_focus_handler",  cast(void**)& atk_component_remove_focus_handler},
+    { "atk_component_grab_focus",  cast(void**)& atk_component_grab_focus},
+    { "atk_component_get_mdi_zorder",  cast(void**)& atk_component_get_mdi_zorder},
+    { "atk_component_get_layer",  cast(void**)& atk_component_get_layer},
+    { "atk_component_get_size",  cast(void**)& atk_component_get_size},
+    { "atk_component_get_position",  cast(void**)& atk_component_get_position},
+    { "atk_component_get_extents",  cast(void**)& atk_component_get_extents},
+    { "atk_component_ref_accessible_at_point",  cast(void**)& atk_component_ref_accessible_at_point},
+    { "atk_component_contains",  cast(void**)& atk_component_contains},
+    { "atk_component_add_focus_handler",  cast(void**)& atk_component_add_focus_handler},
+    { "atk_component_get_type",  cast(void**)& atk_component_get_type},
+    { "atk_rectangle_get_type",  cast(void**)& atk_rectangle_get_type},
+    { "atk_get_version",  cast(void**)& atk_get_version},
+    { "atk_get_toolkit_version",  cast(void**)& atk_get_toolkit_version},
+    { "atk_get_toolkit_name",  cast(void**)& atk_get_toolkit_name},
+    { "atk_get_focus_object",  cast(void**)& atk_get_focus_object},
+    { "atk_get_root",  cast(void**)& atk_get_root},
+    { "atk_remove_key_event_listener",  cast(void**)& atk_remove_key_event_listener},
+    { "atk_add_key_event_listener",  cast(void**)& atk_add_key_event_listener},
+    { "atk_remove_global_event_listener",  cast(void**)& atk_remove_global_event_listener},
+    { "atk_add_global_event_listener",  cast(void**)& atk_add_global_event_listener},
+    { "atk_focus_tracker_notify",  cast(void**)& atk_focus_tracker_notify},
+    { "atk_focus_tracker_init",  cast(void**)& atk_focus_tracker_init},
+    { "atk_remove_focus_tracker",  cast(void**)& atk_remove_focus_tracker},
+    { "atk_add_focus_tracker",  cast(void**)& atk_add_focus_tracker},
+    { "atk_util_get_type",  cast(void**)& atk_util_get_type},
+    { "atk_action_get_localized_name",  cast(void**)& atk_action_get_localized_name},
+    { "atk_action_set_description",  cast(void**)& atk_action_set_description},
+    { "atk_action_get_keybinding",  cast(void**)& atk_action_get_keybinding},
+    { "atk_action_get_name",  cast(void**)& atk_action_get_name},
+    { "atk_action_get_description",  cast(void**)& atk_action_get_description},
+    { "atk_action_get_n_actions",  cast(void**)& atk_action_get_n_actions},
+    { "atk_action_do_action",  cast(void**)& atk_action_do_action},
+    { "atk_action_get_type",  cast(void**)& atk_action_get_type},
+    { "atk_role_get_localized_name",  cast(void**)& atk_role_get_localized_name},
+    { "atk_object_remove_relationship",  cast(void**)& atk_object_remove_relationship},
+    { "atk_object_add_relationship",  cast(void**)& atk_object_add_relationship},
+    { "atk_role_for_name",  cast(void**)& atk_role_for_name},
+    { "atk_role_get_name",  cast(void**)& atk_role_get_name},
+    { "atk_object_initialize",  cast(void**)& atk_object_initialize},
+    { "atk_object_notify_state_change",  cast(void**)& atk_object_notify_state_change},
+    { "atk_object_remove_property_change_handler",  cast(void**)& atk_object_remove_property_change_handler},
+    { "atk_object_connect_property_change_handler",  cast(void**)& atk_object_connect_property_change_handler},
+    { "atk_object_set_role",  cast(void**)& atk_object_set_role},
+    { "atk_object_set_parent",  cast(void**)& atk_object_set_parent},
+    { "atk_object_set_description",  cast(void**)& atk_object_set_description},
+    { "atk_object_set_name",  cast(void**)& atk_object_set_name},
+    { "atk_object_get_index_in_parent",  cast(void**)& atk_object_get_index_in_parent},
+    { "atk_object_ref_state_set",  cast(void**)& atk_object_ref_state_set},
+    { "atk_object_get_attributes",  cast(void**)& atk_object_get_attributes},
+    { "atk_object_get_mdi_zorder",  cast(void**)& atk_object_get_mdi_zorder},
+    { "atk_object_get_layer",  cast(void**)& atk_object_get_layer},
+    { "atk_object_get_role",  cast(void**)& atk_object_get_role},
+    { "atk_object_ref_relation_set",  cast(void**)& atk_object_ref_relation_set},
+    { "atk_object_ref_accessible_child",  cast(void**)& atk_object_ref_accessible_child},
+    { "atk_object_get_n_accessible_children",  cast(void**)& atk_object_get_n_accessible_children},
+    { "atk_object_get_parent",  cast(void**)& atk_object_get_parent},
+    { "atk_object_get_description",  cast(void**)& atk_object_get_description},
+    { "atk_object_get_name",  cast(void**)& atk_object_get_name},
+    { "atk_implementor_ref_accessible",  cast(void**)& atk_implementor_ref_accessible},
+    { "atk_implementor_get_type",  cast(void**)& atk_implementor_get_type},
+    { "atk_object_get_type",  cast(void**)& atk_object_get_type},
+    { "atk_role_register",  cast(void**)& atk_role_register},
+    { "atk_state_type_for_name",  cast(void**)& atk_state_type_for_name},
+    { "atk_state_type_get_name",  cast(void**)& atk_state_type_get_name},
+    { "atk_state_type_register",  cast(void**)& atk_state_type_register},
+];
+
+} else { // version(DYNLINK)
+extern (C) void atk_value_get_minimum_increment(void *, _GValue *);
+extern (C) int atk_value_set_current_value(void *, _GValue *);
+extern (C) void atk_value_get_minimum_value(void *, _GValue *);
+extern (C) void atk_value_get_maximum_value(void *, _GValue *);
+extern (C) void atk_value_get_current_value(void *, _GValue *);
+extern (C) uint atk_value_get_type();
+extern (C) _AtkMisc * atk_misc_get_instance();
+extern (C) void atk_misc_threads_leave(_AtkMisc *);
+extern (C) void atk_misc_threads_enter(_AtkMisc *);
+extern (C) uint atk_misc_get_type();
+extern (C) extern _AtkMisc * atk_misc_instance;
+extern (C) int atk_table_remove_column_selection(void *, int);
+extern (C) int atk_table_add_column_selection(void *, int);
+extern (C) int atk_table_remove_row_selection(void *, int);
+extern (C) int atk_table_add_row_selection(void *, int);
+extern (C) int atk_table_is_selected(void *, int, int);
+extern (C) int atk_table_is_row_selected(void *, int);
+extern (C) int atk_table_is_column_selected(void *, int);
+extern (C) int atk_table_get_selected_rows(void *, int * *);
+extern (C) int atk_table_get_selected_columns(void *, int * *);
+extern (C) void atk_table_set_summary(void *, _AtkObject *);
+extern (C) void atk_table_set_row_header(void *, int, _AtkObject *);
+extern (C) void atk_table_set_row_description(void *, int, char *);
+extern (C) void atk_table_set_column_header(void *, int, _AtkObject *);
+extern (C) void atk_table_set_column_description(void *, int, char *);
+extern (C) void atk_table_set_caption(void *, _AtkObject *);
+extern (C) _AtkObject * atk_table_get_summary(void *);
+extern (C) _AtkObject * atk_table_get_row_header(void *, int);
+extern (C) char * atk_table_get_row_description(void *, int);
+extern (C) _AtkObject * atk_table_get_column_header(void *, int);
+extern (C) char * atk_table_get_column_description(void *, int);
+extern (C) _AtkObject * atk_table_get_caption(void *);
+extern (C) int atk_table_get_row_extent_at(void *, int, int);
+extern (C) int atk_table_get_column_extent_at(void *, int, int);
+extern (C) int atk_table_get_n_rows(void *);
+extern (C) int atk_table_get_n_columns(void *);
+extern (C) int atk_table_get_row_at_index(void *, int);
+extern (C) int atk_table_get_column_at_index(void *, int);
+extern (C) int atk_table_get_index_at(void *, int, int);
+extern (C) _AtkObject * atk_table_ref_at(void *, int, int);
+extern (C) uint atk_table_get_type();
+extern (C) char * atk_streamable_content_get_uri(void *, char *);
+extern (C) _GIOChannel * atk_streamable_content_get_stream(void *, char *);
+extern (C) char * atk_streamable_content_get_mime_type(void *, int);
+extern (C) int atk_streamable_content_get_n_mime_types(void *);
+extern (C) uint atk_streamable_content_get_type();
+extern (C) _AtkStateSet * atk_state_set_xor_sets(_AtkStateSet *, _AtkStateSet *);
+extern (C) _AtkStateSet * atk_state_set_or_sets(_AtkStateSet *, _AtkStateSet *);
+extern (C) _AtkStateSet * atk_state_set_and_sets(_AtkStateSet *, _AtkStateSet *);
+extern (C) int atk_state_set_remove_state(_AtkStateSet *, int);
+extern (C) int atk_state_set_contains_states(_AtkStateSet *, int *, int);
+extern (C) int atk_state_set_contains_state(_AtkStateSet *, int);
+extern (C) void atk_state_set_clear_states(_AtkStateSet *);
+extern (C) void atk_state_set_add_states(_AtkStateSet *, int *, int);
+extern (C) int atk_state_set_add_state(_AtkStateSet *, int);
+extern (C) int atk_state_set_is_empty(_AtkStateSet *);
+extern (C) _AtkStateSet * atk_state_set_new();
+extern (C) uint atk_state_set_get_type();
+extern (C) int atk_selection_select_all_selection(void *);
+extern (C) int atk_selection_remove_selection(void *, int);
+extern (C) int atk_selection_is_child_selected(void *, int);
+extern (C) int atk_selection_get_selection_count(void *);
+extern (C) _AtkObject * atk_selection_ref_selection(void *, int);
+extern (C) int atk_selection_clear_selection(void *);
+extern (C) int atk_selection_add_selection(void *, int);
+extern (C) uint atk_selection_get_type();
+extern (C) void atk_relation_set_add_relation_by_type(_AtkRelationSet *, int, _AtkObject *);
+extern (C) _AtkRelation * atk_relation_set_get_relation_by_type(_AtkRelationSet *, int);
+extern (C) _AtkRelation * atk_relation_set_get_relation(_AtkRelationSet *, int);
+extern (C) int atk_relation_set_get_n_relations(_AtkRelationSet *);
+extern (C) void atk_relation_set_add(_AtkRelationSet *, _AtkRelation *);
+extern (C) void atk_relation_set_remove(_AtkRelationSet *, _AtkRelation *);
+extern (C) int atk_relation_set_contains(_AtkRelationSet *, int);
+extern (C) _AtkRelationSet * atk_relation_set_new();
+extern (C) uint atk_relation_set_get_type();
+extern (C) void atk_relation_add_target(_AtkRelation *, _AtkObject *);
+extern (C) _GPtrArray * atk_relation_get_target(_AtkRelation *);
+extern (C) int atk_relation_get_relation_type(_AtkRelation *);
+extern (C) _AtkRelation * atk_relation_new(_AtkObject * *, int, int);
+extern (C) int atk_relation_type_for_name(char *);
+extern (C) char * atk_relation_type_get_name(int);
+extern (C) int atk_relation_type_register(char *);
+extern (C) uint atk_relation_get_type();
+extern (C) _AtkRegistry * atk_get_default_registry();
+extern (C) _AtkObjectFactory * atk_registry_get_factory(_AtkRegistry *, uint);
+extern (C) uint atk_registry_get_factory_type(_AtkRegistry *, uint);
+extern (C) void atk_registry_set_factory_type(_AtkRegistry *, uint, uint);
+extern (C) uint atk_registry_get_type();
+extern (C) _AtkObjectFactory * atk_no_op_object_factory_new();
+extern (C) uint atk_no_op_object_factory_get_type();
+extern (C) uint atk_object_factory_get_accessible_type(_AtkObjectFactory *);
+extern (C) void atk_object_factory_invalidate(_AtkObjectFactory *);
+extern (C) _AtkObject * atk_object_factory_create_accessible(_AtkObjectFactory *, _GObject *);
+extern (C) uint atk_object_factory_get_type();
+extern (C) _AtkObject * atk_no_op_object_new(_GObject *);
+extern (C) uint atk_no_op_object_get_type();
+extern (C) char * atk_image_get_image_locale(void *);
+extern (C) void atk_image_get_image_position(void *, int *, int *, int);
+extern (C) int atk_image_set_image_description(void *, char *);
+extern (C) void atk_image_get_image_size(void *, int *, int *);
+extern (C) char * atk_image_get_image_description(void *);
+extern (C) uint atk_image_get_type();
+extern (C) int atk_hypertext_get_link_index(void *, int);
+extern (C) int atk_hypertext_get_n_links(void *);
+extern (C) _AtkHyperlink * atk_hypertext_get_link(void *, int);
+extern (C) uint atk_hypertext_get_type();
+extern (C) _AtkHyperlink * atk_hyperlink_impl_get_hyperlink(void *);
+extern (C) uint atk_hyperlink_impl_get_type();
+extern (C) int atk_hyperlink_is_selected_link(_AtkHyperlink *);
+extern (C) int atk_hyperlink_get_n_anchors(_AtkHyperlink *);
+extern (C) int atk_hyperlink_is_inline(_AtkHyperlink *);
+extern (C) int atk_hyperlink_is_valid(_AtkHyperlink *);
+extern (C) int atk_hyperlink_get_start_index(_AtkHyperlink *);
+extern (C) int atk_hyperlink_get_end_index(_AtkHyperlink *);
+extern (C) _AtkObject * atk_hyperlink_get_object(_AtkHyperlink *, int);
+extern (C) char * atk_hyperlink_get_uri(_AtkHyperlink *, int);
+extern (C) uint atk_hyperlink_get_type();
+extern (C) _GObject * atk_gobject_accessible_get_object(_AtkGObjectAccessible *);
+extern (C) _AtkObject * atk_gobject_accessible_for_object(_GObject *);
+extern (C) uint atk_gobject_accessible_get_type();
+extern (C) void atk_editable_text_paste_text(void *, int);
+extern (C) void atk_editable_text_delete_text(void *, int, int);
+extern (C) void atk_editable_text_cut_text(void *, int, int);
+extern (C) void atk_editable_text_copy_text(void *, int, int);
+extern (C) void atk_editable_text_insert_text(void *, char *, int, int *);
+extern (C) void atk_editable_text_set_text_contents(void *, char *);
+extern (C) int atk_editable_text_set_run_attributes(void *, _GSList *, int, int);
+extern (C) uint atk_editable_text_get_type();
+extern (C) char * atk_text_attribute_get_value(int, int);
+extern (C) int atk_text_attribute_for_name(char *);
+extern (C) char * atk_text_attribute_get_name(int);
+extern (C) void atk_attribute_set_free(_GSList *);
+extern (C) void atk_text_free_ranges(_AtkTextRange * *);
+extern (C) _AtkTextRange * * atk_text_get_bounded_ranges(void *, _AtkTextRectangle *, int, int, int);
+extern (C) void atk_text_get_range_extents(void *, int, int, int, _AtkTextRectangle *);
+extern (C) int atk_text_set_caret_offset(void *, int);
+extern (C) int atk_text_set_selection(void *, int, int, int);
+extern (C) int atk_text_remove_selection(void *, int);
+extern (C) int atk_text_add_selection(void *, int, int);
+extern (C) char * atk_text_get_selection(void *, int, int *, int *);
+extern (C) int atk_text_get_n_selections(void *);
+extern (C) int atk_text_get_offset_at_point(void *, int, int, int);
+extern (C) int atk_text_get_character_count(void *);
+extern (C) _GSList * atk_text_get_default_attributes(void *);
+extern (C) _GSList * atk_text_get_run_attributes(void *, int, int *, int *);
+extern (C) void atk_text_get_character_extents(void *, int, int *, int *, int *, int *, int);
+extern (C) int atk_text_get_caret_offset(void *);
+extern (C) char * atk_text_get_text_before_offset(void *, int, int, int *, int *);
+extern (C) char * atk_text_get_text_at_offset(void *, int, int, int *, int *);
+extern (C) char * atk_text_get_text_after_offset(void *, int, int, int *, int *);
+extern (C) uint atk_text_get_character_at_offset(void *, int);
+extern (C) char * atk_text_get_text(void *, int, int);
+extern (C) uint atk_text_get_type();
+extern (C) int atk_text_attribute_register(char *);
+extern (C) int atk_document_set_attribute_value(void *, char *, char *);
+extern (C) char * atk_document_get_attribute_value(void *, char *);
+extern (C) _GSList * atk_document_get_attributes(void *);
+extern (C) char * atk_document_get_locale(void *);
+extern (C) void * atk_document_get_document(void *);
+extern (C) char * atk_document_get_document_type(void *);
+extern (C) uint atk_document_get_type();
+extern (C) double atk_component_get_alpha(void *);
+extern (C) int atk_component_set_size(void *, int, int);
+extern (C) int atk_component_set_position(void *, int, int, int);
+extern (C) int atk_component_set_extents(void *, int, int, int, int, int);
+extern (C) void atk_component_remove_focus_handler(void *, uint);
+extern (C) int atk_component_grab_focus(void *);
+extern (C) int atk_component_get_mdi_zorder(void *);
+extern (C) int atk_component_get_layer(void *);
+extern (C) void atk_component_get_size(void *, int *, int *);
+extern (C) void atk_component_get_position(void *, int *, int *, int);
+extern (C) void atk_component_get_extents(void *, int *, int *, int *, int *, int);
+extern (C) _AtkObject * atk_component_ref_accessible_at_point(void *, int, int, int);
+extern (C) int atk_component_contains(void *, int, int, int);
+extern (C) uint atk_component_add_focus_handler(void *, _BCD_func__2758);
+extern (C) uint atk_component_get_type();
+extern (C) uint atk_rectangle_get_type();
+extern (C) char * atk_get_version();
+extern (C) char * atk_get_toolkit_version();
+extern (C) char * atk_get_toolkit_name();
+extern (C) _AtkObject * atk_get_focus_object();
+extern (C) _AtkObject * atk_get_root();
+extern (C) void atk_remove_key_event_listener(uint);
+extern (C) uint atk_add_key_event_listener(_BCD_func__2777, void *);
+extern (C) void atk_remove_global_event_listener(uint);
+extern (C) uint atk_add_global_event_listener(_BCD_func__3077, char *);
+extern (C) void atk_focus_tracker_notify(_AtkObject *);
+extern (C) void atk_focus_tracker_init(_BCD_func__2778);
+extern (C) void atk_remove_focus_tracker(uint);
+extern (C) uint atk_add_focus_tracker(_BCD_func__2779);
+extern (C) uint atk_util_get_type();
+extern (C) char * atk_action_get_localized_name(void *, int);
+extern (C) int atk_action_set_description(void *, int, char *);
+extern (C) char * atk_action_get_keybinding(void *, int);
+extern (C) char * atk_action_get_name(void *, int);
+extern (C) char * atk_action_get_description(void *, int);
+extern (C) int atk_action_get_n_actions(void *);
+extern (C) int atk_action_do_action(void *, int);
+extern (C) uint atk_action_get_type();
+extern (C) char * atk_role_get_localized_name(int);
+extern (C) int atk_object_remove_relationship(_AtkObject *, int, _AtkObject *);
+extern (C) int atk_object_add_relationship(_AtkObject *, int, _AtkObject *);
+extern (C) int atk_role_for_name(char *);
+extern (C) char * atk_role_get_name(int);
+extern (C) void atk_object_initialize(_AtkObject *, void *);
+extern (C) void atk_object_notify_state_change(_AtkObject *, ulong, int);
+extern (C) void atk_object_remove_property_change_handler(_AtkObject *, uint);
+extern (C) uint atk_object_connect_property_change_handler(_AtkObject *, _BCD_func__2816 *);
+extern (C) void atk_object_set_role(_AtkObject *, int);
+extern (C) void atk_object_set_parent(_AtkObject *, _AtkObject *);
+extern (C) void atk_object_set_description(_AtkObject *, char *);
+extern (C) void atk_object_set_name(_AtkObject *, char *);
+extern (C) int atk_object_get_index_in_parent(_AtkObject *);
+extern (C) _AtkStateSet * atk_object_ref_state_set(_AtkObject *);
+extern (C) _GSList * atk_object_get_attributes(_AtkObject *);
+extern (C) int atk_object_get_mdi_zorder(_AtkObject *);
+extern (C) int atk_object_get_layer(_AtkObject *);
+extern (C) int atk_object_get_role(_AtkObject *);
+extern (C) _AtkRelationSet * atk_object_ref_relation_set(_AtkObject *);
+extern (C) _AtkObject * atk_object_ref_accessible_child(_AtkObject *, int);
+extern (C) int atk_object_get_n_accessible_children(_AtkObject *);
+extern (C) _AtkObject * atk_object_get_parent(_AtkObject *);
+extern (C) char * atk_object_get_description(_AtkObject *);
+extern (C) char * atk_object_get_name(_AtkObject *);
+extern (C) _AtkObject * atk_implementor_ref_accessible(void *);
+extern (C) uint atk_implementor_get_type();
+extern (C) uint atk_object_get_type();
+extern (C) int atk_role_register(char *);
+extern (C) int atk_state_type_for_name(char *);
+extern (C) char * atk_state_type_get_name(int);
+extern (C) int atk_state_type_register(char *);
+} // version(DYNLINK)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/cairo.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,907 @@
+/******************************************************************************
+    Based on the generated files from the BCD tool
+    modified by: Frank Benoit <benoit@tionex.de>
+******************************************************************************/
+module org.eclipse.swt.internal.c.cairo;
+
+import java.lang.all;
+
+extern(C):
+align(4):
+
+const int CAIRO_VERSION_MAJOR = 1;
+const int CAIRO_VERSION_MINOR = 4;
+const int CAIRO_VERSION_MICRO = 10;
+const String CAIRO_VERSION_STRING = "1.4.10";
+const int CAIRO_HAS_SVG_SURFACE = 1;
+const int CAIRO_HAS_PDF_SURFACE = 1;
+const int CAIRO_HAS_PS_SURFACE = 1;
+const int CAIRO_HAS_FT_FONT = 1;
+const int CAIRO_HAS_PNG_FUNCTIONS = 1;
+const int CAIRO_HAS_XLIB_XRENDER_SURFACE = 1;
+const int CAIRO_HAS_XLIB_SURFACE = 1;
+const int CAIRO_FORMAT_RGB16_565 = 4;
+enum _cairo_filter {
+CAIRO_FILTER_FAST=0,
+CAIRO_FILTER_GOOD=1,
+CAIRO_FILTER_BEST=2,
+CAIRO_FILTER_NEAREST=3,
+CAIRO_FILTER_BILINEAR=4,
+CAIRO_FILTER_GAUSSIAN=5,
+}
+alias int cairo_filter_t;
+enum _cairo_extend {
+CAIRO_EXTEND_NONE=0,
+CAIRO_EXTEND_REPEAT=1,
+CAIRO_EXTEND_REFLECT=2,
+CAIRO_EXTEND_PAD=3,
+}
+alias int cairo_extend_t;
+enum _cairo_pattern_type {
+CAIRO_PATTERN_TYPE_SOLID=0,
+CAIRO_PATTERN_TYPE_SURFACE=1,
+CAIRO_PATTERN_TYPE_LINEAR=2,
+CAIRO_PATTERN_TYPE_RADIAL=3,
+}
+alias int cairo_pattern_type_t;
+enum _cairo_format {
+CAIRO_FORMAT_ARGB32=0,
+CAIRO_FORMAT_RGB24=1,
+CAIRO_FORMAT_A8=2,
+CAIRO_FORMAT_A1=3,
+}
+alias int cairo_format_t;
+enum _cairo_surface_type {
+CAIRO_SURFACE_TYPE_IMAGE=0,
+CAIRO_SURFACE_TYPE_PDF=1,
+CAIRO_SURFACE_TYPE_PS=2,
+CAIRO_SURFACE_TYPE_XLIB=3,
+CAIRO_SURFACE_TYPE_XCB=4,
+CAIRO_SURFACE_TYPE_GLITZ=5,
+CAIRO_SURFACE_TYPE_QUARTZ=6,
+CAIRO_SURFACE_TYPE_WIN32=7,
+CAIRO_SURFACE_TYPE_BEOS=8,
+CAIRO_SURFACE_TYPE_DIRECTFB=9,
+CAIRO_SURFACE_TYPE_SVG=10,
+CAIRO_SURFACE_TYPE_OS2=11,
+}
+alias int cairo_surface_type_t;
+alias cairo_path cairo_path_t;
+enum _cairo_status {
+CAIRO_STATUS_SUCCESS=0,
+CAIRO_STATUS_NO_MEMORY=1,
+CAIRO_STATUS_INVALID_RESTORE=2,
+CAIRO_STATUS_INVALID_POP_GROUP=3,
+CAIRO_STATUS_NO_CURRENT_POINT=4,
+CAIRO_STATUS_INVALID_MATRIX=5,
+CAIRO_STATUS_INVALID_STATUS=6,
+CAIRO_STATUS_NULL_POINTER=7,
+CAIRO_STATUS_INVALID_STRING=8,
+CAIRO_STATUS_INVALID_PATH_DATA=9,
+CAIRO_STATUS_READ_ERROR=10,
+CAIRO_STATUS_WRITE_ERROR=11,
+CAIRO_STATUS_SURFACE_FINISHED=12,
+CAIRO_STATUS_SURFACE_TYPE_MISMATCH=13,
+CAIRO_STATUS_PATTERN_TYPE_MISMATCH=14,
+CAIRO_STATUS_INVALID_CONTENT=15,
+CAIRO_STATUS_INVALID_FORMAT=16,
+CAIRO_STATUS_INVALID_VISUAL=17,
+CAIRO_STATUS_FILE_NOT_FOUND=18,
+CAIRO_STATUS_INVALID_DASH=19,
+CAIRO_STATUS_INVALID_DSC_COMMENT=20,
+CAIRO_STATUS_INVALID_INDEX=21,
+CAIRO_STATUS_CLIP_NOT_REPRESENTABLE=22,
+}
+alias int cairo_status_t;
+alias _cairo_path_data_t cairo_path_data_t;
+enum _cairo_path_data_type {
+CAIRO_PATH_MOVE_TO=0,
+CAIRO_PATH_LINE_TO=1,
+CAIRO_PATH_CURVE_TO=2,
+CAIRO_PATH_CLOSE_PATH=3,
+}
+alias int cairo_path_data_type_t;
+enum _cairo_font_type {
+CAIRO_FONT_TYPE_TOY=0,
+CAIRO_FONT_TYPE_FT=1,
+CAIRO_FONT_TYPE_WIN32=2,
+CAIRO_FONT_TYPE_ATSUI=3,
+}
+alias int cairo_font_type_t;
+alias void cairo_font_options_t;
+enum _cairo_hint_metrics {
+CAIRO_HINT_METRICS_DEFAULT=0,
+CAIRO_HINT_METRICS_OFF=1,
+CAIRO_HINT_METRICS_ON=2,
+}
+alias int cairo_hint_metrics_t;
+enum _cairo_hint_style {
+CAIRO_HINT_STYLE_DEFAULT=0,
+CAIRO_HINT_STYLE_NONE=1,
+CAIRO_HINT_STYLE_SLIGHT=2,
+CAIRO_HINT_STYLE_MEDIUM=3,
+CAIRO_HINT_STYLE_FULL=4,
+}
+alias int cairo_hint_style_t;
+enum _cairo_subpixel_order {
+CAIRO_SUBPIXEL_ORDER_DEFAULT=0,
+CAIRO_SUBPIXEL_ORDER_RGB=1,
+CAIRO_SUBPIXEL_ORDER_BGR=2,
+CAIRO_SUBPIXEL_ORDER_VRGB=3,
+CAIRO_SUBPIXEL_ORDER_VBGR=4,
+}
+alias int cairo_subpixel_order_t;
+enum _cairo_font_weight {
+CAIRO_FONT_WEIGHT_NORMAL=0,
+CAIRO_FONT_WEIGHT_BOLD=1,
+}
+alias int cairo_font_weight_t;
+enum _cairo_font_slant {
+CAIRO_FONT_SLANT_NORMAL=0,
+CAIRO_FONT_SLANT_ITALIC=1,
+CAIRO_FONT_SLANT_OBLIQUE=2,
+}
+alias int cairo_font_slant_t;
+alias void cairo_font_face_t;
+alias void cairo_scaled_font_t;
+alias _cairo_rectangle_list cairo_rectangle_list_t;
+alias _cairo_rectangle cairo_rectangle_t;
+enum _cairo_line_join {
+CAIRO_LINE_JOIN_MITER=0,
+CAIRO_LINE_JOIN_ROUND=1,
+CAIRO_LINE_JOIN_BEVEL=2,
+}
+alias int cairo_line_join_t;
+enum _cairo_line_cap {
+CAIRO_LINE_CAP_BUTT=0,
+CAIRO_LINE_CAP_ROUND=1,
+CAIRO_LINE_CAP_SQUARE=2,
+}
+alias int cairo_line_cap_t;
+enum _cairo_fill_rule {
+CAIRO_FILL_RULE_WINDING=0,
+CAIRO_FILL_RULE_EVEN_ODD=1,
+}
+alias int cairo_fill_rule_t;
+enum _cairo_antialias {
+CAIRO_ANTIALIAS_DEFAULT=0,
+CAIRO_ANTIALIAS_NONE=1,
+CAIRO_ANTIALIAS_GRAY=2,
+CAIRO_ANTIALIAS_SUBPIXEL=3,
+}
+alias int cairo_antialias_t;
+enum _cairo_operator {
+CAIRO_OPERATOR_CLEAR=0,
+CAIRO_OPERATOR_SOURCE=1,
+CAIRO_OPERATOR_OVER=2,
+CAIRO_OPERATOR_IN=3,
+CAIRO_OPERATOR_OUT=4,
+CAIRO_OPERATOR_ATOP=5,
+CAIRO_OPERATOR_DEST=6,
+CAIRO_OPERATOR_DEST_OVER=7,
+CAIRO_OPERATOR_DEST_IN=8,
+CAIRO_OPERATOR_DEST_OUT=9,
+CAIRO_OPERATOR_DEST_ATOP=10,
+CAIRO_OPERATOR_XOR=11,
+CAIRO_OPERATOR_ADD=12,
+CAIRO_OPERATOR_SATURATE=13,
+}
+alias int cairo_operator_t;
+alias int function(void *, char *, uint) _BCD_func__476;
+alias _BCD_func__476 cairo_read_func_t;
+alias int function(void *, char *, uint) _BCD_func__477;
+alias _BCD_func__477 cairo_write_func_t;
+enum _cairo_content {
+CAIRO_CONTENT_COLOR=4096,
+CAIRO_CONTENT_ALPHA=8192,
+CAIRO_CONTENT_COLOR_ALPHA=12288,
+}
+alias int cairo_content_t;
+alias _cairo_user_data_key cairo_user_data_key_t;
+alias void function(void *) _BCD_func__481;
+alias _BCD_func__481 cairo_destroy_func_t;
+alias void cairo_pattern_t;
+alias _cairo_matrix cairo_matrix_t;
+alias void cairo_surface_t;
+alias void cairo_t;
+alias int cairo_bool_t;
+struct cairo_path {
+int status;
+_cairo_path_data_t * data;
+int num_data;
+}
+struct N18_cairo_path_data_t3__3E {
+int type;
+int length;
+}
+struct N18_cairo_path_data_t3__4E {
+double x;
+double y;
+}
+union _cairo_path_data_t {
+N18_cairo_path_data_t3__3E header;
+N18_cairo_path_data_t3__4E point;
+}
+struct cairo_font_extents_t {
+double ascent;
+double descent;
+double height;
+double max_x_advance;
+double max_y_advance;
+}
+struct cairo_text_extents_t {
+double x_bearing;
+double y_bearing;
+double width;
+double height;
+double x_advance;
+double y_advance;
+}
+struct cairo_glyph_t {
+uint index;
+double x;
+double y;
+}
+struct _cairo_rectangle_list {
+int status;
+_cairo_rectangle * rectangles;
+int num_rectangles;
+}
+struct _cairo_rectangle {
+double x;
+double y;
+double width;
+double height;
+}
+struct _cairo_user_data_key {
+int unused;
+}
+struct _cairo_matrix {
+double xx;
+double yx;
+double xy;
+double yy;
+double x0;
+double y0;
+}
+version(DYNLINK){
+extern (C) void function()cairo_debug_reset_static_data;
+extern (C) void function(_cairo_matrix *, double *, double *)cairo_matrix_transform_point;
+extern (C) void function(_cairo_matrix *, double *, double *)cairo_matrix_transform_distance;
+extern (C) void function(_cairo_matrix *, _cairo_matrix *, _cairo_matrix *)cairo_matrix_multiply;
+extern (C) int function(_cairo_matrix *)cairo_matrix_invert;
+extern (C) void function(_cairo_matrix *, double)cairo_matrix_rotate;
+extern (C) void function(_cairo_matrix *, double, double)cairo_matrix_scale;
+extern (C) void function(_cairo_matrix *, double, double)cairo_matrix_translate;
+extern (C) void function(_cairo_matrix *, double)cairo_matrix_init_rotate;
+extern (C) void function(_cairo_matrix *, double, double)cairo_matrix_init_scale;
+extern (C) void function(_cairo_matrix *, double, double)cairo_matrix_init_translate;
+extern (C) void function(_cairo_matrix *)cairo_matrix_init_identity;
+extern (C) void function(_cairo_matrix *, double, double, double, double, double, double)cairo_matrix_init;
+extern (C) int function(void *, double *, double *, double *, double *, double *, double *)cairo_pattern_get_radial_circles;
+extern (C) int function(void *, double *, double *, double *, double *)cairo_pattern_get_linear_points;
+extern (C) int function(void *, int *)cairo_pattern_get_color_stop_count;
+extern (C) int function(void *, int, double *, double *, double *, double *, double *)cairo_pattern_get_color_stop_rgba;
+extern (C) int function(void *, void * *)cairo_pattern_get_surface;
+extern (C) int function(void *, double *, double *, double *, double *)cairo_pattern_get_rgba;
+extern (C) int function(void *)cairo_pattern_get_filter;
+extern (C) void function(void *, int)cairo_pattern_set_filter;
+extern (C) int function(void *)cairo_pattern_get_extend;
+extern (C) void function(void *, int)cairo_pattern_set_extend;
+extern (C) void function(void *, _cairo_matrix *)cairo_pattern_get_matrix;
+extern (C) void function(void *, _cairo_matrix *)cairo_pattern_set_matrix;
+extern (C) void function(void *, double, double, double, double, double)cairo_pattern_add_color_stop_rgba;
+extern (C) void function(void *, double, double, double, double)cairo_pattern_add_color_stop_rgb;
+extern (C) int function(void *)cairo_pattern_get_type;
+extern (C) int function(void *, _cairo_user_data_key *, void *, _BCD_func__481)cairo_pattern_set_user_data;
+extern (C) void * function(void *, _cairo_user_data_key *)cairo_pattern_get_user_data;
+extern (C) int function(void *)cairo_pattern_status;
+extern (C) uint function(void *)cairo_pattern_get_reference_count;
+extern (C) void function(void *)cairo_pattern_destroy;
+extern (C) void * function(void *)cairo_pattern_reference;
+extern (C) void * function(double, double, double, double, double, double)cairo_pattern_create_radial;
+extern (C) void * function(double, double, double, double)cairo_pattern_create_linear;
+extern (C) void * function(void *)cairo_pattern_create_for_surface;
+extern (C) void * function(double, double, double, double)cairo_pattern_create_rgba;
+extern (C) void * function(double, double, double)cairo_pattern_create_rgb;
+extern (C) void * function(_BCD_func__476, void *)cairo_image_surface_create_from_png_stream;
+extern (C) void * function(char *)cairo_image_surface_create_from_png;
+extern (C) int function(void *)cairo_image_surface_get_stride;
+extern (C) int function(void *)cairo_image_surface_get_height;
+extern (C) int function(void *)cairo_image_surface_get_width;
+extern (C) int function(void *)cairo_image_surface_get_format;
+extern (C) char * function(void *)cairo_image_surface_get_data;
+extern (C) void * function(char *, int, int, int, int)cairo_image_surface_create_for_data;
+extern (C) void * function(int, int, int)cairo_image_surface_create;
+extern (C) void function(void *, double, double)cairo_surface_set_fallback_resolution;
+extern (C) void function(void *, double *, double *)cairo_surface_get_device_offset;
+extern (C) void function(void *, double, double)cairo_surface_set_device_offset;
+extern (C) void function(void *, int, int, int, int)cairo_surface_mark_dirty_rectangle;
+extern (C) void function(void *)cairo_surface_mark_dirty;
+extern (C) void function(void *)cairo_surface_flush;
+extern (C) void function(void *, void *)cairo_surface_get_font_options;
+extern (C) int function(void *, _cairo_user_data_key *, void *, _BCD_func__481)cairo_surface_set_user_data;
+extern (C) void * function(void *, _cairo_user_data_key *)cairo_surface_get_user_data;
+extern (C) int function(void *, _BCD_func__477, void *)cairo_surface_write_to_png_stream;
+extern (C) int function(void *, char *)cairo_surface_write_to_png;
+extern (C) int function(void *)cairo_surface_get_content;
+extern (C) int function(void *)cairo_surface_get_type;
+extern (C) int function(void *)cairo_surface_status;
+extern (C) uint function(void *)cairo_surface_get_reference_count;
+extern (C) void function(void *)cairo_surface_destroy;
+extern (C) void function(void *)cairo_surface_finish;
+extern (C) void * function(void *)cairo_surface_reference;
+extern (C) void * function(void *, int, int, int)cairo_surface_create_similar;
+extern (C) char * function(int)cairo_status_to_string;
+extern (C) int function(void *)cairo_status;
+extern (C) void function(cairo_path *)cairo_path_destroy;
+extern (C) void function(void *, cairo_path *)cairo_append_path;
+extern (C) cairo_path * function(void *)cairo_copy_path_flat;
+extern (C) cairo_path * function(void *)cairo_copy_path;
+extern (C) void * function(void *)cairo_get_group_target;
+extern (C) void * function(void *)cairo_get_target;
+extern (C) void function(void *, _cairo_matrix *)cairo_get_matrix;
+extern (C) void function(void *, double *, double *)cairo_get_dash;
+extern (C) int function(void *)cairo_get_dash_count;
+extern (C) double function(void *)cairo_get_miter_limit;
+extern (C) int function(void *)cairo_get_line_join;
+extern (C) int function(void *)cairo_get_line_cap;
+extern (C) double function(void *)cairo_get_line_width;
+extern (C) int function(void *)cairo_get_fill_rule;
+extern (C) void function(void *, double *, double *)cairo_get_current_point;
+extern (C) int function(void *)cairo_get_antialias;
+extern (C) double function(void *)cairo_get_tolerance;
+extern (C) void * function(void *)cairo_get_source;
+extern (C) int function(void *)cairo_get_operator;
+extern (C) void function(void *, void *)cairo_scaled_font_get_font_options;
+extern (C) void function(void *, _cairo_matrix *)cairo_scaled_font_get_ctm;
+extern (C) void function(void *, _cairo_matrix *)cairo_scaled_font_get_font_matrix;
+extern (C) void * function(void *)cairo_scaled_font_get_font_face;
+extern (C) void function(void *, cairo_glyph_t *, int, cairo_text_extents_t *)cairo_scaled_font_glyph_extents;
+extern (C) void function(void *, char *, cairo_text_extents_t *)cairo_scaled_font_text_extents;
+extern (C) void function(void *, cairo_font_extents_t *)cairo_scaled_font_extents;
+extern (C) int function(void *, _cairo_user_data_key *, void *, _BCD_func__481)cairo_scaled_font_set_user_data;
+extern (C) void * function(void *, _cairo_user_data_key *)cairo_scaled_font_get_user_data;
+extern (C) int function(void *)cairo_scaled_font_get_type;
+extern (C) int function(void *)cairo_scaled_font_status;
+extern (C) uint function(void *)cairo_scaled_font_get_reference_count;
+extern (C) void function(void *)cairo_scaled_font_destroy;
+extern (C) void * function(void *)cairo_scaled_font_reference;
+extern (C) void * function(void *, _cairo_matrix *, _cairo_matrix *, void *)cairo_scaled_font_create;
+extern (C) int function(void *, _cairo_user_data_key *, void *, _BCD_func__481)cairo_font_face_set_user_data;
+extern (C) void * function(void *, _cairo_user_data_key *)cairo_font_face_get_user_data;
+extern (C) int function(void *)cairo_font_face_get_type;
+extern (C) int function(void *)cairo_font_face_status;
+extern (C) uint function(void *)cairo_font_face_get_reference_count;
+extern (C) void function(void *)cairo_font_face_destroy;
+extern (C) void * function(void *)cairo_font_face_reference;
+extern (C) void function(void *, cairo_font_extents_t *)cairo_font_extents;
+extern (C) void function(void *, cairo_glyph_t *, int, cairo_text_extents_t *)cairo_glyph_extents;
+extern (C) void function(void *, char *, cairo_text_extents_t *)cairo_text_extents;
+extern (C) void function(void *, cairo_glyph_t *, int)cairo_glyph_path;
+extern (C) void function(void *, char *)cairo_text_path;
+extern (C) void function(void *, cairo_glyph_t *, int)cairo_show_glyphs;
+extern (C) void function(void *, char *)cairo_show_text;
+extern (C) void * function(void *)cairo_get_scaled_font;
+extern (C) void function(void *, void *)cairo_set_scaled_font;
+extern (C) void * function(void *)cairo_get_font_face;
+extern (C) void function(void *, void *)cairo_set_font_face;
+extern (C) void function(void *, void *)cairo_get_font_options;
+extern (C) void function(void *, void *)cairo_set_font_options;
+extern (C) void function(void *, _cairo_matrix *)cairo_get_font_matrix;
+extern (C) void function(void *, _cairo_matrix *)cairo_set_font_matrix;
+extern (C) void function(void *, double)cairo_set_font_size;
+extern (C) void function(void *, char *, int, int)cairo_select_font_face;
+extern (C) int function(void *)cairo_font_options_get_hint_metrics;
+extern (C) void function(void *, int)cairo_font_options_set_hint_metrics;
+extern (C) int function(void *)cairo_font_options_get_hint_style;
+extern (C) void function(void *, int)cairo_font_options_set_hint_style;
+extern (C) int function(void *)cairo_font_options_get_subpixel_order;
+extern (C) void function(void *, int)cairo_font_options_set_subpixel_order;
+extern (C) int function(void *)cairo_font_options_get_antialias;
+extern (C) void function(void *, int)cairo_font_options_set_antialias;
+extern (C) uint function(void *)cairo_font_options_hash;
+extern (C) int function(void *, void *)cairo_font_options_equal;
+extern (C) void function(void *, void *)cairo_font_options_merge;
+extern (C) int function(void *)cairo_font_options_status;
+extern (C) void function(void *)cairo_font_options_destroy;
+extern (C) void * function(void *)cairo_font_options_copy;
+extern (C) void * function()cairo_font_options_create;
+extern (C) void function(_cairo_rectangle_list *)cairo_rectangle_list_destroy;
+extern (C) _cairo_rectangle_list * function(void *)cairo_copy_clip_rectangle_list;
+extern (C) void function(void *, double *, double *, double *, double *)cairo_clip_extents;
+extern (C) void function(void *)cairo_clip_preserve;
+extern (C) void function(void *)cairo_clip;
+extern (C) void function(void *)cairo_reset_clip;
+extern (C) void function(void *, double *, double *, double *, double *)cairo_fill_extents;
+extern (C) void function(void *, double *, double *, double *, double *)cairo_stroke_extents;
+extern (C) int function(void *, double, double)cairo_in_fill;
+extern (C) int function(void *, double, double)cairo_in_stroke;
+extern (C) void function(void *)cairo_show_page;
+extern (C) void function(void *)cairo_copy_page;
+extern (C) void function(void *)cairo_fill_preserve;
+extern (C) void function(void *)cairo_fill;
+extern (C) void function(void *)cairo_stroke_preserve;
+extern (C) void function(void *)cairo_stroke;
+extern (C) void function(void *, void *, double, double)cairo_mask_surface;
+extern (C) void function(void *, void *)cairo_mask;
+extern (C) void function(void *, double)cairo_paint_with_alpha;
+extern (C) void function(void *)cairo_paint;
+extern (C) void function(void *)cairo_close_path;
+extern (C) void function(void *, double, double, double, double)cairo_rectangle;
+extern (C) void function(void *, double, double, double, double, double, double)cairo_rel_curve_to;
+extern (C) void function(void *, double, double)cairo_rel_line_to;
+extern (C) void function(void *, double, double)cairo_rel_move_to;
+extern (C) void function(void *, double, double, double, double, double)cairo_arc_negative;
+extern (C) void function(void *, double, double, double, double, double)cairo_arc;
+extern (C) void function(void *, double, double, double, double, double, double)cairo_curve_to;
+extern (C) void function(void *, double, double)cairo_line_to;
+extern (C) void function(void *)cairo_new_sub_path;
+extern (C) void function(void *, double, double)cairo_move_to;
+extern (C) void function(void *)cairo_new_path;
+extern (C) void function(void *, double *, double *)cairo_device_to_user_distance;
+extern (C) void function(void *, double *, double *)cairo_device_to_user;
+extern (C) void function(void *, double *, double *)cairo_user_to_device_distance;
+extern (C) void function(void *, double *, double *)cairo_user_to_device;
+extern (C) void function(void *)cairo_identity_matrix;
+extern (C) void function(void *, _cairo_matrix *)cairo_set_matrix;
+extern (C) void function(void *, _cairo_matrix *)cairo_transform;
+extern (C) void function(void *, double)cairo_rotate;
+extern (C) void function(void *, double, double)cairo_scale;
+extern (C) void function(void *, double, double)cairo_translate;
+extern (C) void function(void *, double)cairo_set_miter_limit;
+extern (C) void function(void *, double *, int, double)cairo_set_dash;
+extern (C) void function(void *, int)cairo_set_line_join;
+extern (C) void function(void *, int)cairo_set_line_cap;
+extern (C) void function(void *, double)cairo_set_line_width;
+extern (C) void function(void *, int)cairo_set_fill_rule;
+extern (C) void function(void *, int)cairo_set_antialias;
+extern (C) void function(void *, double)cairo_set_tolerance;
+extern (C) void function(void *, void *, double, double)cairo_set_source_surface;
+extern (C) void function(void *, double, double, double, double)cairo_set_source_rgba;
+extern (C) void function(void *, double, double, double)cairo_set_source_rgb;
+extern (C) void function(void *, void *)cairo_set_source;
+extern (C) void function(void *, int)cairo_set_operator;
+extern (C) void function(void *)cairo_pop_group_to_source;
+extern (C) void * function(void *)cairo_pop_group;
+extern (C) void function(void *, int)cairo_push_group_with_content;
+extern (C) void function(void *)cairo_push_group;
+extern (C) void function(void *)cairo_restore;
+extern (C) void function(void *)cairo_save;
+extern (C) int function(void *, _cairo_user_data_key *, void *, _BCD_func__481)cairo_set_user_data;
+extern (C) void * function(void *, _cairo_user_data_key *)cairo_get_user_data;
+extern (C) uint function(void *)cairo_get_reference_count;
+extern (C) void function(void *)cairo_destroy;
+extern (C) void * function(void *)cairo_reference;
+extern (C) void * function(void *)cairo_create;
+extern (C) char * function()cairo_version_string;
+extern (C) int function()cairo_version;
+
+
+Symbol[] symbols = [
+    { "cairo_debug_reset_static_data",  cast(void**)& cairo_debug_reset_static_data},
+    { "cairo_matrix_transform_point",  cast(void**)& cairo_matrix_transform_point},
+    { "cairo_matrix_transform_distance",  cast(void**)& cairo_matrix_transform_distance},
+    { "cairo_matrix_multiply",  cast(void**)& cairo_matrix_multiply},
+    { "cairo_matrix_invert",  cast(void**)& cairo_matrix_invert},
+    { "cairo_matrix_rotate",  cast(void**)& cairo_matrix_rotate},
+    { "cairo_matrix_scale",  cast(void**)& cairo_matrix_scale},
+    { "cairo_matrix_translate",  cast(void**)& cairo_matrix_translate},
+    { "cairo_matrix_init_rotate",  cast(void**)& cairo_matrix_init_rotate},
+    { "cairo_matrix_init_scale",  cast(void**)& cairo_matrix_init_scale},
+    { "cairo_matrix_init_translate",  cast(void**)& cairo_matrix_init_translate},
+    { "cairo_matrix_init_identity",  cast(void**)& cairo_matrix_init_identity},
+    { "cairo_matrix_init",  cast(void**)& cairo_matrix_init},
+    { "cairo_pattern_get_radial_circles",  cast(void**)& cairo_pattern_get_radial_circles},
+    { "cairo_pattern_get_linear_points",  cast(void**)& cairo_pattern_get_linear_points},
+    { "cairo_pattern_get_color_stop_count",  cast(void**)& cairo_pattern_get_color_stop_count},
+    { "cairo_pattern_get_color_stop_rgba",  cast(void**)& cairo_pattern_get_color_stop_rgba},
+    { "cairo_pattern_get_surface",  cast(void**)& cairo_pattern_get_surface},
+    { "cairo_pattern_get_rgba",  cast(void**)& cairo_pattern_get_rgba},
+    { "cairo_pattern_get_filter",  cast(void**)& cairo_pattern_get_filter},
+    { "cairo_pattern_set_filter",  cast(void**)& cairo_pattern_set_filter},
+    { "cairo_pattern_get_extend",  cast(void**)& cairo_pattern_get_extend},
+    { "cairo_pattern_set_extend",  cast(void**)& cairo_pattern_set_extend},
+    { "cairo_pattern_get_matrix",  cast(void**)& cairo_pattern_get_matrix},
+    { "cairo_pattern_set_matrix",  cast(void**)& cairo_pattern_set_matrix},
+    { "cairo_pattern_add_color_stop_rgba",  cast(void**)& cairo_pattern_add_color_stop_rgba},
+    { "cairo_pattern_add_color_stop_rgb",  cast(void**)& cairo_pattern_add_color_stop_rgb},
+    { "cairo_pattern_get_type",  cast(void**)& cairo_pattern_get_type},
+    { "cairo_pattern_set_user_data",  cast(void**)& cairo_pattern_set_user_data},
+    { "cairo_pattern_get_user_data",  cast(void**)& cairo_pattern_get_user_data},
+    { "cairo_pattern_status",  cast(void**)& cairo_pattern_status},
+    { "cairo_pattern_get_reference_count",  cast(void**)& cairo_pattern_get_reference_count},
+    { "cairo_pattern_destroy",  cast(void**)& cairo_pattern_destroy},
+    { "cairo_pattern_reference",  cast(void**)& cairo_pattern_reference},
+    { "cairo_pattern_create_radial",  cast(void**)& cairo_pattern_create_radial},
+    { "cairo_pattern_create_linear",  cast(void**)& cairo_pattern_create_linear},
+    { "cairo_pattern_create_for_surface",  cast(void**)& cairo_pattern_create_for_surface},
+    { "cairo_pattern_create_rgba",  cast(void**)& cairo_pattern_create_rgba},
+    { "cairo_pattern_create_rgb",  cast(void**)& cairo_pattern_create_rgb},
+    { "cairo_image_surface_create_from_png_stream",  cast(void**)& cairo_image_surface_create_from_png_stream},
+    { "cairo_image_surface_create_from_png",  cast(void**)& cairo_image_surface_create_from_png},
+    { "cairo_image_surface_get_stride",  cast(void**)& cairo_image_surface_get_stride},
+    { "cairo_image_surface_get_height",  cast(void**)& cairo_image_surface_get_height},
+    { "cairo_image_surface_get_width",  cast(void**)& cairo_image_surface_get_width},
+    { "cairo_image_surface_get_format",  cast(void**)& cairo_image_surface_get_format},
+    { "cairo_image_surface_get_data",  cast(void**)& cairo_image_surface_get_data},
+    { "cairo_image_surface_create_for_data",  cast(void**)& cairo_image_surface_create_for_data},
+    { "cairo_image_surface_create",  cast(void**)& cairo_image_surface_create},
+    { "cairo_surface_set_fallback_resolution",  cast(void**)& cairo_surface_set_fallback_resolution},
+    { "cairo_surface_get_device_offset",  cast(void**)& cairo_surface_get_device_offset},
+    { "cairo_surface_set_device_offset",  cast(void**)& cairo_surface_set_device_offset},
+    { "cairo_surface_mark_dirty_rectangle",  cast(void**)& cairo_surface_mark_dirty_rectangle},
+    { "cairo_surface_mark_dirty",  cast(void**)& cairo_surface_mark_dirty},
+    { "cairo_surface_flush",  cast(void**)& cairo_surface_flush},
+    { "cairo_surface_get_font_options",  cast(void**)& cairo_surface_get_font_options},
+    { "cairo_surface_set_user_data",  cast(void**)& cairo_surface_set_user_data},
+    { "cairo_surface_get_user_data",  cast(void**)& cairo_surface_get_user_data},
+    { "cairo_surface_write_to_png_stream",  cast(void**)& cairo_surface_write_to_png_stream},
+    { "cairo_surface_write_to_png",  cast(void**)& cairo_surface_write_to_png},
+    { "cairo_surface_get_content",  cast(void**)& cairo_surface_get_content},
+    { "cairo_surface_get_type",  cast(void**)& cairo_surface_get_type},
+    { "cairo_surface_status",  cast(void**)& cairo_surface_status},
+    { "cairo_surface_get_reference_count",  cast(void**)& cairo_surface_get_reference_count},
+    { "cairo_surface_destroy",  cast(void**)& cairo_surface_destroy},
+    { "cairo_surface_finish",  cast(void**)& cairo_surface_finish},
+    { "cairo_surface_reference",  cast(void**)& cairo_surface_reference},
+    { "cairo_surface_create_similar",  cast(void**)& cairo_surface_create_similar},
+    { "cairo_status_to_string",  cast(void**)& cairo_status_to_string},
+    { "cairo_status",  cast(void**)& cairo_status},
+    { "cairo_path_destroy",  cast(void**)& cairo_path_destroy},
+    { "cairo_append_path",  cast(void**)& cairo_append_path},
+    { "cairo_copy_path_flat",  cast(void**)& cairo_copy_path_flat},
+    { "cairo_copy_path",  cast(void**)& cairo_copy_path},
+    { "cairo_get_group_target",  cast(void**)& cairo_get_group_target},
+    { "cairo_get_target",  cast(void**)& cairo_get_target},
+    { "cairo_get_matrix",  cast(void**)& cairo_get_matrix},
+    { "cairo_get_dash",  cast(void**)& cairo_get_dash},
+    { "cairo_get_dash_count",  cast(void**)& cairo_get_dash_count},
+    { "cairo_get_miter_limit",  cast(void**)& cairo_get_miter_limit},
+    { "cairo_get_line_join",  cast(void**)& cairo_get_line_join},
+    { "cairo_get_line_cap",  cast(void**)& cairo_get_line_cap},
+    { "cairo_get_line_width",  cast(void**)& cairo_get_line_width},
+    { "cairo_get_fill_rule",  cast(void**)& cairo_get_fill_rule},
+    { "cairo_get_current_point",  cast(void**)& cairo_get_current_point},
+    { "cairo_get_antialias",  cast(void**)& cairo_get_antialias},
+    { "cairo_get_tolerance",  cast(void**)& cairo_get_tolerance},
+    { "cairo_get_source",  cast(void**)& cairo_get_source},
+    { "cairo_get_operator",  cast(void**)& cairo_get_operator},
+    { "cairo_scaled_font_get_font_options",  cast(void**)& cairo_scaled_font_get_font_options},
+    { "cairo_scaled_font_get_ctm",  cast(void**)& cairo_scaled_font_get_ctm},
+    { "cairo_scaled_font_get_font_matrix",  cast(void**)& cairo_scaled_font_get_font_matrix},
+    { "cairo_scaled_font_get_font_face",  cast(void**)& cairo_scaled_font_get_font_face},
+    { "cairo_scaled_font_glyph_extents",  cast(void**)& cairo_scaled_font_glyph_extents},
+    { "cairo_scaled_font_text_extents",  cast(void**)& cairo_scaled_font_text_extents},
+    { "cairo_scaled_font_extents",  cast(void**)& cairo_scaled_font_extents},
+    { "cairo_scaled_font_set_user_data",  cast(void**)& cairo_scaled_font_set_user_data},
+    { "cairo_scaled_font_get_user_data",  cast(void**)& cairo_scaled_font_get_user_data},
+    { "cairo_scaled_font_get_type",  cast(void**)& cairo_scaled_font_get_type},
+    { "cairo_scaled_font_status",  cast(void**)& cairo_scaled_font_status},
+    { "cairo_scaled_font_get_reference_count",  cast(void**)& cairo_scaled_font_get_reference_count},
+    { "cairo_scaled_font_destroy",  cast(void**)& cairo_scaled_font_destroy},
+    { "cairo_scaled_font_reference",  cast(void**)& cairo_scaled_font_reference},
+    { "cairo_scaled_font_create",  cast(void**)& cairo_scaled_font_create},
+    { "cairo_font_face_set_user_data",  cast(void**)& cairo_font_face_set_user_data},
+    { "cairo_font_face_get_user_data",  cast(void**)& cairo_font_face_get_user_data},
+    { "cairo_font_face_get_type",  cast(void**)& cairo_font_face_get_type},
+    { "cairo_font_face_status",  cast(void**)& cairo_font_face_status},
+    { "cairo_font_face_get_reference_count",  cast(void**)& cairo_font_face_get_reference_count},
+    { "cairo_font_face_destroy",  cast(void**)& cairo_font_face_destroy},
+    { "cairo_font_face_reference",  cast(void**)& cairo_font_face_reference},
+    { "cairo_font_extents",  cast(void**)& cairo_font_extents},
+    { "cairo_glyph_extents",  cast(void**)& cairo_glyph_extents},
+    { "cairo_text_extents",  cast(void**)& cairo_text_extents},
+    { "cairo_glyph_path",  cast(void**)& cairo_glyph_path},
+    { "cairo_text_path",  cast(void**)& cairo_text_path},
+    { "cairo_show_glyphs",  cast(void**)& cairo_show_glyphs},
+    { "cairo_show_text",  cast(void**)& cairo_show_text},
+    { "cairo_get_scaled_font",  cast(void**)& cairo_get_scaled_font},
+    { "cairo_set_scaled_font",  cast(void**)& cairo_set_scaled_font},
+    { "cairo_get_font_face",  cast(void**)& cairo_get_font_face},
+    { "cairo_set_font_face",  cast(void**)& cairo_set_font_face},
+    { "cairo_get_font_options",  cast(void**)& cairo_get_font_options},
+    { "cairo_set_font_options",  cast(void**)& cairo_set_font_options},
+    { "cairo_get_font_matrix",  cast(void**)& cairo_get_font_matrix},
+    { "cairo_set_font_matrix",  cast(void**)& cairo_set_font_matrix},
+    { "cairo_set_font_size",  cast(void**)& cairo_set_font_size},
+    { "cairo_select_font_face",  cast(void**)& cairo_select_font_face},
+    { "cairo_font_options_get_hint_metrics",  cast(void**)& cairo_font_options_get_hint_metrics},
+    { "cairo_font_options_set_hint_metrics",  cast(void**)& cairo_font_options_set_hint_metrics},
+    { "cairo_font_options_get_hint_style",  cast(void**)& cairo_font_options_get_hint_style},
+    { "cairo_font_options_set_hint_style",  cast(void**)& cairo_font_options_set_hint_style},
+    { "cairo_font_options_get_subpixel_order",  cast(void**)& cairo_font_options_get_subpixel_order},
+    { "cairo_font_options_set_subpixel_order",  cast(void**)& cairo_font_options_set_subpixel_order},
+    { "cairo_font_options_get_antialias",  cast(void**)& cairo_font_options_get_antialias},
+    { "cairo_font_options_set_antialias",  cast(void**)& cairo_font_options_set_antialias},
+    { "cairo_font_options_hash",  cast(void**)& cairo_font_options_hash},
+    { "cairo_font_options_equal",  cast(void**)& cairo_font_options_equal},
+    { "cairo_font_options_merge",  cast(void**)& cairo_font_options_merge},
+    { "cairo_font_options_status",  cast(void**)& cairo_font_options_status},
+    { "cairo_font_options_destroy",  cast(void**)& cairo_font_options_destroy},
+    { "cairo_font_options_copy",  cast(void**)& cairo_font_options_copy},
+    { "cairo_font_options_create",  cast(void**)& cairo_font_options_create},
+    { "cairo_rectangle_list_destroy",  cast(void**)& cairo_rectangle_list_destroy},
+    { "cairo_copy_clip_rectangle_list",  cast(void**)& cairo_copy_clip_rectangle_list},
+    { "cairo_clip_extents",  cast(void**)& cairo_clip_extents},
+    { "cairo_clip_preserve",  cast(void**)& cairo_clip_preserve},
+    { "cairo_clip",  cast(void**)& cairo_clip},
+    { "cairo_reset_clip",  cast(void**)& cairo_reset_clip},
+    { "cairo_fill_extents",  cast(void**)& cairo_fill_extents},
+    { "cairo_stroke_extents",  cast(void**)& cairo_stroke_extents},
+    { "cairo_in_fill",  cast(void**)& cairo_in_fill},
+    { "cairo_in_stroke",  cast(void**)& cairo_in_stroke},
+    { "cairo_show_page",  cast(void**)& cairo_show_page},
+    { "cairo_copy_page",  cast(void**)& cairo_copy_page},
+    { "cairo_fill_preserve",  cast(void**)& cairo_fill_preserve},
+    { "cairo_fill",  cast(void**)& cairo_fill},
+    { "cairo_stroke_preserve",  cast(void**)& cairo_stroke_preserve},
+    { "cairo_stroke",  cast(void**)& cairo_stroke},
+    { "cairo_mask_surface",  cast(void**)& cairo_mask_surface},
+    { "cairo_mask",  cast(void**)& cairo_mask},
+    { "cairo_paint_with_alpha",  cast(void**)& cairo_paint_with_alpha},
+    { "cairo_paint",  cast(void**)& cairo_paint},
+    { "cairo_close_path",  cast(void**)& cairo_close_path},
+    { "cairo_rectangle",  cast(void**)& cairo_rectangle},
+    { "cairo_rel_curve_to",  cast(void**)& cairo_rel_curve_to},
+    { "cairo_rel_line_to",  cast(void**)& cairo_rel_line_to},
+    { "cairo_rel_move_to",  cast(void**)& cairo_rel_move_to},
+    { "cairo_arc_negative",  cast(void**)& cairo_arc_negative},
+    { "cairo_arc",  cast(void**)& cairo_arc},
+    { "cairo_curve_to",  cast(void**)& cairo_curve_to},
+    { "cairo_line_to",  cast(void**)& cairo_line_to},
+    { "cairo_new_sub_path",  cast(void**)& cairo_new_sub_path},
+    { "cairo_move_to",  cast(void**)& cairo_move_to},
+    { "cairo_new_path",  cast(void**)& cairo_new_path},
+    { "cairo_device_to_user_distance",  cast(void**)& cairo_device_to_user_distance},
+    { "cairo_device_to_user",  cast(void**)& cairo_device_to_user},
+    { "cairo_user_to_device_distance",  cast(void**)& cairo_user_to_device_distance},
+    { "cairo_user_to_device",  cast(void**)& cairo_user_to_device},
+    { "cairo_identity_matrix",  cast(void**)& cairo_identity_matrix},
+    { "cairo_set_matrix",  cast(void**)& cairo_set_matrix},
+    { "cairo_transform",  cast(void**)& cairo_transform},
+    { "cairo_rotate",  cast(void**)& cairo_rotate},
+    { "cairo_scale",  cast(void**)& cairo_scale},
+    { "cairo_translate",  cast(void**)& cairo_translate},
+    { "cairo_set_miter_limit",  cast(void**)& cairo_set_miter_limit},
+    { "cairo_set_dash",  cast(void**)& cairo_set_dash},
+    { "cairo_set_line_join",  cast(void**)& cairo_set_line_join},
+    { "cairo_set_line_cap",  cast(void**)& cairo_set_line_cap},
+    { "cairo_set_line_width",  cast(void**)& cairo_set_line_width},
+    { "cairo_set_fill_rule",  cast(void**)& cairo_set_fill_rule},
+    { "cairo_set_antialias",  cast(void**)& cairo_set_antialias},
+    { "cairo_set_tolerance",  cast(void**)& cairo_set_tolerance},
+    { "cairo_set_source_surface",  cast(void**)& cairo_set_source_surface},
+    { "cairo_set_source_rgba",  cast(void**)& cairo_set_source_rgba},
+    { "cairo_set_source_rgb",  cast(void**)& cairo_set_source_rgb},
+    { "cairo_set_source",  cast(void**)& cairo_set_source},
+    { "cairo_set_operator",  cast(void**)& cairo_set_operator},
+    { "cairo_pop_group_to_source",  cast(void**)& cairo_pop_group_to_source},
+    { "cairo_pop_group",  cast(void**)& cairo_pop_group},
+    { "cairo_push_group_with_content",  cast(void**)& cairo_push_group_with_content},
+    { "cairo_push_group",  cast(void**)& cairo_push_group},
+    { "cairo_restore",  cast(void**)& cairo_restore},
+    { "cairo_save",  cast(void**)& cairo_save},
+    { "cairo_set_user_data",  cast(void**)& cairo_set_user_data},
+    { "cairo_get_user_data",  cast(void**)& cairo_get_user_data},
+    { "cairo_get_reference_count",  cast(void**)& cairo_get_reference_count},
+    { "cairo_destroy",  cast(void**)& cairo_destroy},
+    { "cairo_reference",  cast(void**)& cairo_reference},
+    { "cairo_create",  cast(void**)& cairo_create},
+    { "cairo_version_string",  cast(void**)& cairo_version_string},
+    { "cairo_version",  cast(void**)& cairo_version},
+];
+
+} else { // version(DYNLINK)
+extern (C) void cairo_debug_reset_static_data();
+extern (C) void cairo_matrix_transform_point(_cairo_matrix *, double *, double *);
+extern (C) void cairo_matrix_transform_distance(_cairo_matrix *, double *, double *);
+extern (C) void cairo_matrix_multiply(_cairo_matrix *, _cairo_matrix *, _cairo_matrix *);
+extern (C) int cairo_matrix_invert(_cairo_matrix *);
+extern (C) void cairo_matrix_rotate(_cairo_matrix *, double);
+extern (C) void cairo_matrix_scale(_cairo_matrix *, double, double);
+extern (C) void cairo_matrix_translate(_cairo_matrix *, double, double);
+extern (C) void cairo_matrix_init_rotate(_cairo_matrix *, double);
+extern (C) void cairo_matrix_init_scale(_cairo_matrix *, double, double);
+extern (C) void cairo_matrix_init_translate(_cairo_matrix *, double, double);
+extern (C) void cairo_matrix_init_identity(_cairo_matrix *);
+extern (C) void cairo_matrix_init(_cairo_matrix *, double, double, double, double, double, double);
+extern (C) int cairo_pattern_get_radial_circles(void *, double *, double *, double *, double *, double *, double *);
+extern (C) int cairo_pattern_get_linear_points(void *, double *, double *, double *, double *);
+extern (C) int cairo_pattern_get_color_stop_count(void *, int *);
+extern (C) int cairo_pattern_get_color_stop_rgba(void *, int, double *, double *, double *, double *, double *);
+extern (C) int cairo_pattern_get_surface(void *, void * *);
+extern (C) int cairo_pattern_get_rgba(void *, double *, double *, double *, double *);
+extern (C) int cairo_pattern_get_filter(void *);
+extern (C) void cairo_pattern_set_filter(void *, int);
+extern (C) int cairo_pattern_get_extend(void *);
+extern (C) void cairo_pattern_set_extend(void *, int);
+extern (C) void cairo_pattern_get_matrix(void *, _cairo_matrix *);
+extern (C) void cairo_pattern_set_matrix(void *, _cairo_matrix *);
+extern (C) void cairo_pattern_add_color_stop_rgba(void *, double, double, double, double, double);
+extern (C) void cairo_pattern_add_color_stop_rgb(void *, double, double, double, double);
+extern (C) int cairo_pattern_get_type(void *);
+extern (C) int cairo_pattern_set_user_data(void *, _cairo_user_data_key *, void *, _BCD_func__481);
+extern (C) void * cairo_pattern_get_user_data(void *, _cairo_user_data_key *);
+extern (C) int cairo_pattern_status(void *);
+extern (C) uint cairo_pattern_get_reference_count(void *);
+extern (C) void cairo_pattern_destroy(void *);
+extern (C) void * cairo_pattern_reference(void *);
+extern (C) void * cairo_pattern_create_radial(double, double, double, double, double, double);
+extern (C) void * cairo_pattern_create_linear(double, double, double, double);
+extern (C) void * cairo_pattern_create_for_surface(void *);
+extern (C) void * cairo_pattern_create_rgba(double, double, double, double);
+extern (C) void * cairo_pattern_create_rgb(double, double, double);
+extern (C) void * cairo_image_surface_create_from_png_stream(_BCD_func__476, void *);
+extern (C) void * cairo_image_surface_create_from_png(char *);
+extern (C) int cairo_image_surface_get_stride(void *);
+extern (C) int cairo_image_surface_get_height(void *);
+extern (C) int cairo_image_surface_get_width(void *);
+extern (C) int cairo_image_surface_get_format(void *);
+extern (C) char * cairo_image_surface_get_data(void *);
+extern (C) void * cairo_image_surface_create_for_data(char *, int, int, int, int);
+extern (C) void * cairo_image_surface_create(int, int, int);
+extern (C) void cairo_surface_set_fallback_resolution(void *, double, double);
+extern (C) void cairo_surface_get_device_offset(void *, double *, double *);
+extern (C) void cairo_surface_set_device_offset(void *, double, double);
+extern (C) void cairo_surface_mark_dirty_rectangle(void *, int, int, int, int);
+extern (C) void cairo_surface_mark_dirty(void *);
+extern (C) void cairo_surface_flush(void *);
+extern (C) void cairo_surface_get_font_options(void *, void *);
+extern (C) int cairo_surface_set_user_data(void *, _cairo_user_data_key *, void *, _BCD_func__481);
+extern (C) void * cairo_surface_get_user_data(void *, _cairo_user_data_key *);
+extern (C) int cairo_surface_write_to_png_stream(void *, _BCD_func__477, void *);
+extern (C) int cairo_surface_write_to_png(void *, char *);
+extern (C) int cairo_surface_get_content(void *);
+extern (C) int cairo_surface_get_type(void *);
+extern (C) int cairo_surface_status(void *);
+extern (C) uint cairo_surface_get_reference_count(void *);
+extern (C) void cairo_surface_destroy(void *);
+extern (C) void cairo_surface_finish(void *);
+extern (C) void * cairo_surface_reference(void *);
+extern (C) void * cairo_surface_create_similar(void *, int, int, int);
+extern (C) char * cairo_status_to_string(int);
+extern (C) int cairo_status(void *);
+extern (C) void cairo_path_destroy(cairo_path *);
+extern (C) void cairo_append_path(void *, cairo_path *);
+extern (C) cairo_path * cairo_copy_path_flat(void *);
+extern (C) cairo_path * cairo_copy_path(void *);
+extern (C) void * cairo_get_group_target(void *);
+extern (C) void * cairo_get_target(void *);
+extern (C) void cairo_get_matrix(void *, _cairo_matrix *);
+extern (C) void cairo_get_dash(void *, double *, double *);
+extern (C) int cairo_get_dash_count(void *);
+extern (C) double cairo_get_miter_limit(void *);
+extern (C) int cairo_get_line_join(void *);
+extern (C) int cairo_get_line_cap(void *);
+extern (C) double cairo_get_line_width(void *);
+extern (C) int cairo_get_fill_rule(void *);
+extern (C) void cairo_get_current_point(void *, double *, double *);
+extern (C) int cairo_get_antialias(void *);
+extern (C) double cairo_get_tolerance(void *);
+extern (C) void * cairo_get_source(void *);
+extern (C) int cairo_get_operator(void *);
+extern (C) void cairo_scaled_font_get_font_options(void *, void *);
+extern (C) void cairo_scaled_font_get_ctm(void *, _cairo_matrix *);
+extern (C) void cairo_scaled_font_get_font_matrix(void *, _cairo_matrix *);
+extern (C) void * cairo_scaled_font_get_font_face(void *);
+extern (C) void cairo_scaled_font_glyph_extents(void *, cairo_glyph_t *, int, cairo_text_extents_t *);
+extern (C) void cairo_scaled_font_text_extents(void *, char *, cairo_text_extents_t *);
+extern (C) void cairo_scaled_font_extents(void *, cairo_font_extents_t *);
+extern (C) int cairo_scaled_font_set_user_data(void *, _cairo_user_data_key *, void *, _BCD_func__481);
+extern (C) void * cairo_scaled_font_get_user_data(void *, _cairo_user_data_key *);
+extern (C) int cairo_scaled_font_get_type(void *);
+extern (C) int cairo_scaled_font_status(void *);
+extern (C) uint cairo_scaled_font_get_reference_count(void *);
+extern (C) void cairo_scaled_font_destroy(void *);
+extern (C) void * cairo_scaled_font_reference(void *);
+extern (C) void * cairo_scaled_font_create(void *, _cairo_matrix *, _cairo_matrix *, void *);
+extern (C) int cairo_font_face_set_user_data(void *, _cairo_user_data_key *, void *, _BCD_func__481);
+extern (C) void * cairo_font_face_get_user_data(void *, _cairo_user_data_key *);
+extern (C) int cairo_font_face_get_type(void *);
+extern (C) int cairo_font_face_status(void *);
+extern (C) uint cairo_font_face_get_reference_count(void *);
+extern (C) void cairo_font_face_destroy(void *);
+extern (C) void * cairo_font_face_reference(void *);
+extern (C) void cairo_font_extents(void *, cairo_font_extents_t *);
+extern (C) void cairo_glyph_extents(void *, cairo_glyph_t *, int, cairo_text_extents_t *);
+extern (C) void cairo_text_extents(void *, char *, cairo_text_extents_t *);
+extern (C) void cairo_glyph_path(void *, cairo_glyph_t *, int);
+extern (C) void cairo_text_path(void *, char *);
+extern (C) void cairo_show_glyphs(void *, cairo_glyph_t *, int);
+extern (C) void cairo_show_text(void *, char *);
+extern (C) void * cairo_get_scaled_font(void *);
+extern (C) void cairo_set_scaled_font(void *, void *);
+extern (C) void * cairo_get_font_face(void *);
+extern (C) void cairo_set_font_face(void *, void *);
+extern (C) void cairo_get_font_options(void *, void *);
+extern (C) void cairo_set_font_options(void *, void *);
+extern (C) void cairo_get_font_matrix(void *, _cairo_matrix *);
+extern (C) void cairo_set_font_matrix(void *, _cairo_matrix *);
+extern (C) void cairo_set_font_size(void *, double);
+extern (C) void cairo_select_font_face(void *, char *, int, int);
+extern (C) int cairo_font_options_get_hint_metrics(void *);
+extern (C) void cairo_font_options_set_hint_metrics(void *, int);
+extern (C) int cairo_font_options_get_hint_style(void *);
+extern (C) void cairo_font_options_set_hint_style(void *, int);
+extern (C) int cairo_font_options_get_subpixel_order(void *);
+extern (C) void cairo_font_options_set_subpixel_order(void *, int);
+extern (C) int cairo_font_options_get_antialias(void *);
+extern (C) void cairo_font_options_set_antialias(void *, int);
+extern (C) uint cairo_font_options_hash(void *);
+extern (C) int cairo_font_options_equal(void *, void *);
+extern (C) void cairo_font_options_merge(void *, void *);
+extern (C) int cairo_font_options_status(void *);
+extern (C) void cairo_font_options_destroy(void *);
+extern (C) void * cairo_font_options_copy(void *);
+extern (C) void * cairo_font_options_create();
+extern (C) void cairo_rectangle_list_destroy(_cairo_rectangle_list *);
+extern (C) _cairo_rectangle_list * cairo_copy_clip_rectangle_list(void *);
+extern (C) void cairo_clip_extents(void *, double *, double *, double *, double *);
+extern (C) void cairo_clip_preserve(void *);
+extern (C) void cairo_clip(void *);
+extern (C) void cairo_reset_clip(void *);
+extern (C) void cairo_fill_extents(void *, double *, double *, double *, double *);
+extern (C) void cairo_stroke_extents(void *, double *, double *, double *, double *);
+extern (C) int cairo_in_fill(void *, double, double);
+extern (C) int cairo_in_stroke(void *, double, double);
+extern (C) void cairo_show_page(void *);
+extern (C) void cairo_copy_page(void *);
+extern (C) void cairo_fill_preserve(void *);
+extern (C) void cairo_fill(void *);
+extern (C) void cairo_stroke_preserve(void *);
+extern (C) void cairo_stroke(void *);
+extern (C) void cairo_mask_surface(void *, void *, double, double);
+extern (C) void cairo_mask(void *, void *);
+extern (C) void cairo_paint_with_alpha(void *, double);
+extern (C) void cairo_paint(void *);
+extern (C) void cairo_close_path(void *);
+extern (C) void cairo_rectangle(void *, double, double, double, double);
+extern (C) void cairo_rel_curve_to(void *, double, double, double, double, double, double);
+extern (C) void cairo_rel_line_to(void *, double, double);
+extern (C) void cairo_rel_move_to(void *, double, double);
+extern (C) void cairo_arc_negative(void *, double, double, double, double, double);
+extern (C) void cairo_arc(void *, double, double, double, double, double);
+extern (C) void cairo_curve_to(void *, double, double, double, double, double, double);
+extern (C) void cairo_line_to(void *, double, double);
+extern (C) void cairo_new_sub_path(void *);
+extern (C) void cairo_move_to(void *, double, double);
+extern (C) void cairo_new_path(void *);
+extern (C) void cairo_device_to_user_distance(void *, double *, double *);
+extern (C) void cairo_device_to_user(void *, double *, double *);
+extern (C) void cairo_user_to_device_distance(void *, double *, double *);
+extern (C) void cairo_user_to_device(void *, double *, double *);
+extern (C) void cairo_identity_matrix(void *);
+extern (C) void cairo_set_matrix(void *, _cairo_matrix *);
+extern (C) void cairo_transform(void *, _cairo_matrix *);
+extern (C) void cairo_rotate(void *, double);
+extern (C) void cairo_scale(void *, double, double);
+extern (C) void cairo_translate(void *, double, double);
+extern (C) void cairo_set_miter_limit(void *, double);
+extern (C) void cairo_set_dash(void *, double *, int, double);
+extern (C) void cairo_set_line_join(void *, int);
+extern (C) void cairo_set_line_cap(void *, int);
+extern (C) void cairo_set_line_width(void *, double);
+extern (C) void cairo_set_fill_rule(void *, int);
+extern (C) void cairo_set_antialias(void *, int);
+extern (C) void cairo_set_tolerance(void *, double);
+extern (C) void cairo_set_source_surface(void *, void *, double, double);
+extern (C) void cairo_set_source_rgba(void *, double, double, double, double);
+extern (C) void cairo_set_source_rgb(void *, double, double, double);
+extern (C) void cairo_set_source(void *, void *);
+extern (C) void cairo_set_operator(void *, int);
+extern (C) void cairo_pop_group_to_source(void *);
+extern (C) void * cairo_pop_group(void *);
+extern (C) void cairo_push_group_with_content(void *, int);
+extern (C) void cairo_push_group(void *);
+extern (C) void cairo_restore(void *);
+extern (C) void cairo_save(void *);
+extern (C) int cairo_set_user_data(void *, _cairo_user_data_key *, void *, _BCD_func__481);
+extern (C) void * cairo_get_user_data(void *, _cairo_user_data_key *);
+extern (C) uint cairo_get_reference_count(void *);
+extern (C) void cairo_destroy(void *);
+extern (C) void * cairo_reference(void *);
+extern (C) void * cairo_create(void *);
+extern (C) char * cairo_version_string();
+extern (C) int cairo_version();
+} // version(DYNLINK)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/cairo_pdf.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,32 @@
+/******************************************************************************
+    Based on the generated files from the BCD tool
+    modified by: Frank Benoit <benoit@tionex.de>
+******************************************************************************/
+module org.eclipse.swt.internal.c.cairo_pdf;
+
+import java.lang.all;
+public import org.eclipse.swt.internal.c.glib_object;
+public import org.eclipse.swt.internal.c.cairo;
+
+align(4):
+
+alias int function(void *, char *, uint) _BCD_func__480;
+alias int function(void *, char *, uint) _BCD_func__479;
+alias void function(void *) _BCD_func__484;
+version(DYNLINK){
+extern (C) void function(void *, double, double)cairo_pdf_surface_set_size;
+extern (C) void * function(_BCD_func__480, void *, double, double)cairo_pdf_surface_create_for_stream;
+extern (C) void * function(char *, double, double)cairo_pdf_surface_create;
+
+
+Symbol[] symbols = [
+    { "cairo_pdf_surface_set_size",  cast(void**)& cairo_pdf_surface_set_size},
+    { "cairo_pdf_surface_create_for_stream",  cast(void**)& cairo_pdf_surface_create_for_stream},
+    { "cairo_pdf_surface_create",  cast(void**)& cairo_pdf_surface_create},
+];
+
+} else { // version(DYNLINK)
+extern (C) void cairo_pdf_surface_set_size(void *, double, double);
+extern (C) void * cairo_pdf_surface_create_for_stream(_BCD_func__480, void *, double, double);
+extern (C) void * cairo_pdf_surface_create(char *, double, double);
+} // version(DYNLINK)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/cairo_ps.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,53 @@
+/******************************************************************************
+    Based on the generated files from the BCD tool
+    modified by: Frank Benoit <benoit@tionex.de>
+******************************************************************************/
+module org.eclipse.swt.internal.c.cairo_ps;
+
+import java.lang.all;
+public import org.eclipse.swt.internal.c.glib_object;
+public import org.eclipse.swt.internal.c.cairo;
+
+align(4):
+
+alias int function(void *, char *, uint) _BCD_func__879;
+alias int function(void *) _BCD_func__133;
+alias int function(void *, long *, int) _BCD_func__135;
+alias int function(void *, char *, uint) _BCD_func__137;
+alias int function(void *, char *, uint) _BCD_func__139;
+alias void function(void *) _BCD_func__734;
+alias int function(void * *, char *) _BCD_func__735;
+alias int function(char *, char * * *, uint *) _BCD_func__736;
+alias int function(void *, char *, char *, char *, char *) _BCD_func__737;
+alias int function(__gconv_step *, __gconv_step_data *, void *, char *, char * *, char *, char * *, uint *) _BCD_func__738;
+alias void function(__gconv_step *) _BCD_func__739;
+alias int function(__gconv_step *) _BCD_func__740;
+alias uint function(__gconv_step *, char) _BCD_func__741;
+alias int function(__gconv_step *, __gconv_step_data *, char * *, char *, char * *, uint *, int, int) _BCD_func__742;
+alias int function(void *, char *, uint) _BCD_func__878;
+version(DYNLINK){
+extern (C) void function(void *)cairo_ps_surface_dsc_begin_page_setup;
+extern (C) void function(void *)cairo_ps_surface_dsc_begin_setup;
+extern (C) void function(void *, char *)cairo_ps_surface_dsc_comment;
+extern (C) void function(void *, double, double)cairo_ps_surface_set_size;
+extern (C) void * function(_BCD_func__879, void *, double, double)cairo_ps_surface_create_for_stream;
+extern (C) void * function(char *, double, double)cairo_ps_surface_create;
+
+
+Symbol[] symbols = [
+    { "cairo_ps_surface_dsc_begin_page_setup",  cast(void**)& cairo_ps_surface_dsc_begin_page_setup},
+    { "cairo_ps_surface_dsc_begin_setup",  cast(void**)& cairo_ps_surface_dsc_begin_setup},
+    { "cairo_ps_surface_dsc_comment",  cast(void**)& cairo_ps_surface_dsc_comment},
+    { "cairo_ps_surface_set_size",  cast(void**)& cairo_ps_surface_set_size},
+    { "cairo_ps_surface_create_for_stream",  cast(void**)& cairo_ps_surface_create_for_stream},
+    { "cairo_ps_surface_create",  cast(void**)& cairo_ps_surface_create},
+];
+
+} else { // version(DYNLINK)
+extern (C) void cairo_ps_surface_dsc_begin_page_setup(void *);
+extern (C) void cairo_ps_surface_dsc_begin_setup(void *);
+extern (C) void cairo_ps_surface_dsc_comment(void *, char *);
+extern (C) void cairo_ps_surface_set_size(void *, double, double);
+extern (C) void * cairo_ps_surface_create_for_stream(_BCD_func__879, void *, double, double);
+extern (C) void * cairo_ps_surface_create(char *, double, double);
+} // version(DYNLINK)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/cairo_xlib.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,65 @@
+/******************************************************************************
+    Based on the generated files from the BCD tool
+    modified by: Frank Benoit <keinfarbton@googlemail.com>
+******************************************************************************/
+module org.eclipse.swt.internal.c.cairo_xlib;
+
+import java.lang.all;
+
+public import org.eclipse.swt.internal.c.cairo_xlib;
+public import org.eclipse.swt.internal.c.cairo;
+public import org.eclipse.swt.internal.c.Xlib;
+
+extern(C):
+align(4):
+
+alias void function(void *, char *, int, int, char * *) _BCD_func__1143;
+alias int function(void *) _BCD_func__1190;
+alias int function(void *, XErrorEvent *) _BCD_func__1191;
+alias void function(void *, char *, char *) _BCD_func__1264;
+alias int function(void *, char *, char *) _BCD_func__1265;
+alias void function(void *, char *, char *) _BCD_func__1266;
+alias int function(void *, char *, uint) _BCD_func__2139;
+alias int function(void *, char *, uint) _BCD_func__2140;
+alias void function(void *) _BCD_func__2144;
+version(DYNLINK){
+extern (C) int function(void *)cairo_xlib_surface_get_height;
+extern (C) int function(void *)cairo_xlib_surface_get_width;
+extern (C) int function(void *)cairo_xlib_surface_get_depth;
+extern (C) Visual * function(void *)cairo_xlib_surface_get_visual;
+extern (C) Screen * function(void *)cairo_xlib_surface_get_screen;
+extern (C) uint function(void *)cairo_xlib_surface_get_drawable;
+extern (C) void * function(void *)cairo_xlib_surface_get_display;
+extern (C) void function(void *, uint, int, int)cairo_xlib_surface_set_drawable;
+extern (C) void function(void *, int, int)cairo_xlib_surface_set_size;
+extern (C) void * function(void *, uint, Screen *, int, int)cairo_xlib_surface_create_for_bitmap;
+extern (C) void * function(void *, uint, Visual *, int, int)cairo_xlib_surface_create;
+
+
+Symbol[] symbols = [
+    { "cairo_xlib_surface_get_height",  cast(void**)& cairo_xlib_surface_get_height},
+    { "cairo_xlib_surface_get_width",  cast(void**)& cairo_xlib_surface_get_width},
+    { "cairo_xlib_surface_get_depth",  cast(void**)& cairo_xlib_surface_get_depth},
+    { "cairo_xlib_surface_get_visual",  cast(void**)& cairo_xlib_surface_get_visual},
+    { "cairo_xlib_surface_get_screen",  cast(void**)& cairo_xlib_surface_get_screen},
+    { "cairo_xlib_surface_get_drawable",  cast(void**)& cairo_xlib_surface_get_drawable},
+    { "cairo_xlib_surface_get_display",  cast(void**)& cairo_xlib_surface_get_display},
+    { "cairo_xlib_surface_set_drawable",  cast(void**)& cairo_xlib_surface_set_drawable},
+    { "cairo_xlib_surface_set_size",  cast(void**)& cairo_xlib_surface_set_size},
+    { "cairo_xlib_surface_create_for_bitmap",  cast(void**)& cairo_xlib_surface_create_for_bitmap},
+    { "cairo_xlib_surface_create",  cast(void**)& cairo_xlib_surface_create},
+];
+
+} else { // version(DYNLINK)
+extern (C) int cairo_xlib_surface_get_height(void *);
+extern (C) int cairo_xlib_surface_get_width(void *);
+extern (C) int cairo_xlib_surface_get_depth(void *);
+extern (C) Visual * cairo_xlib_surface_get_visual(void *);
+extern (C) Screen * cairo_xlib_surface_get_screen(void *);
+extern (C) uint cairo_xlib_surface_get_drawable(void *);
+extern (C) void * cairo_xlib_surface_get_display(void *);
+extern (C) void cairo_xlib_surface_set_drawable(void *, uint, int, int);
+extern (C) void cairo_xlib_surface_set_size(void *, int, int);
+extern (C) void * cairo_xlib_surface_create_for_bitmap(void *, uint, Screen *, int, int);
+extern (C) void * cairo_xlib_surface_create(void *, uint, Visual *, int, int);
+} // version(DYNLINK)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/cairo_xlib_xrender.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,33 @@
+/******************************************************************************
+    Based on the generated files from the BCD tool
+    modified by: Frank Benoit <keinfarbton@googlemail.com>
+******************************************************************************/
+module org.eclipse.swt.internal.c.cairo_xlib_xrender;
+
+import java.lang.all;
+public import org.eclipse.swt.internal.c.cairo_xlib_xrender;
+public import org.eclipse.swt.internal.c.cairo;
+public import org.eclipse.swt.internal.c.Xrender;
+
+extern(C):
+align(4):
+alias void function(void *, char *, int, int, char * *) _BCD_func__1573;
+alias int function(void *) _BCD_func__1614;
+alias int function(void *, XErrorEvent *) _BCD_func__1615;
+alias void function(void *, char *, char *) _BCD_func__1688;
+alias int function(void *, char *, char *) _BCD_func__1689;
+alias void function(void *, char *, char *) _BCD_func__1690;
+alias int function(void *, char *, uint) _BCD_func__2562;
+alias int function(void *, char *, uint) _BCD_func__2563;
+alias void function(void *) _BCD_func__2567;
+version(DYNLINK){
+extern (C) void * function(void *, uint, Screen *, XRenderPictFormat *, int, int)cairo_xlib_surface_create_with_xrender_format;
+
+
+Symbol[] symbols = [
+    { "cairo_xlib_surface_create_with_xrender_format",  cast(void**)& cairo_xlib_surface_create_with_xrender_format},
+];
+
+} else { // version(DYNLINK)
+extern (C) void * cairo_xlib_surface_create_with_xrender_format(void *, uint, Screen *, XRenderPictFormat *, int, int);
+} // version(DYNLINK)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/gdk.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,3466 @@
+/******************************************************************************
+    Based on the generated files from the BCD tool
+    modified by: Frank Benoit <keinfarbton@googlemail.com>
+******************************************************************************/
+module org.eclipse.swt.internal.c.gdk;
+
+import java.lang.all;
+public import org.eclipse.swt.internal.c.pango;
+public import org.eclipse.swt.internal.c.cairo;
+public import org.eclipse.swt.internal.c.glib_object;
+
+extern(C):
+align(4):
+
+const int GDK_CURRENT_TIME = 0;
+const int GDK_PARENT_RELATIVE = 1;
+const int GDK_PIXBUF_FEATURES_H = 1;
+const String GDK_PIXBUF_VERSION = "2.12.0";
+const int GDK_MAX_TIMECOORD_AXES = 128;
+alias _GdkWindowObjectClass GdkWindowObjectClass;
+alias _GdkDrawableClass GdkDrawableClass;
+alias _GdkWindowObject GdkWindowObject;
+alias _GdkDrawable GdkDrawable;
+alias _GdkColor GdkColor;
+alias _GdkDrawable GdkPixmap;
+alias void GdkRegion;
+enum GdkWindowState {
+GDK_WINDOW_STATE_WITHDRAWN=1,
+GDK_WINDOW_STATE_ICONIFIED=2,
+GDK_WINDOW_STATE_MAXIMIZED=4,
+GDK_WINDOW_STATE_STICKY=8,
+GDK_WINDOW_STATE_FULLSCREEN=16,
+GDK_WINDOW_STATE_ABOVE=32,
+GDK_WINDOW_STATE_BELOW=64,
+}
+enum GdkEventMask {
+GDK_EXPOSURE_MASK=2,
+GDK_POINTER_MOTION_MASK=4,
+GDK_POINTER_MOTION_HINT_MASK=8,
+GDK_BUTTON_MOTION_MASK=16,
+GDK_BUTTON1_MOTION_MASK=32,
+GDK_BUTTON2_MOTION_MASK=64,
+GDK_BUTTON3_MOTION_MASK=128,
+GDK_BUTTON_PRESS_MASK=256,
+GDK_BUTTON_RELEASE_MASK=512,
+GDK_KEY_PRESS_MASK=1024,
+GDK_KEY_RELEASE_MASK=2048,
+GDK_ENTER_NOTIFY_MASK=4096,
+GDK_LEAVE_NOTIFY_MASK=8192,
+GDK_FOCUS_CHANGE_MASK=16384,
+GDK_STRUCTURE_MASK=32768,
+GDK_PROPERTY_CHANGE_MASK=65536,
+GDK_VISIBILITY_NOTIFY_MASK=131072,
+GDK_PROXIMITY_IN_MASK=262144,
+GDK_PROXIMITY_OUT_MASK=524288,
+GDK_SUBSTRUCTURE_MASK=1048576,
+GDK_SCROLL_MASK=2097152,
+GDK_ALL_EVENTS_MASK=4194302,
+}
+enum GdkWindowEdge {
+GDK_WINDOW_EDGE_NORTH_WEST=0,
+GDK_WINDOW_EDGE_NORTH=1,
+GDK_WINDOW_EDGE_NORTH_EAST=2,
+GDK_WINDOW_EDGE_WEST=3,
+GDK_WINDOW_EDGE_EAST=4,
+GDK_WINDOW_EDGE_SOUTH_WEST=5,
+GDK_WINDOW_EDGE_SOUTH=6,
+GDK_WINDOW_EDGE_SOUTH_EAST=7,
+}
+enum GdkGravity {
+GDK_GRAVITY_NORTH_WEST=1,
+GDK_GRAVITY_NORTH=2,
+GDK_GRAVITY_NORTH_EAST=3,
+GDK_GRAVITY_WEST=4,
+GDK_GRAVITY_CENTER=5,
+GDK_GRAVITY_EAST=6,
+GDK_GRAVITY_SOUTH_WEST=7,
+GDK_GRAVITY_SOUTH=8,
+GDK_GRAVITY_SOUTH_EAST=9,
+GDK_GRAVITY_STATIC=10,
+}
+enum GdkWMFunction {
+GDK_FUNC_ALL=1,
+GDK_FUNC_RESIZE=2,
+GDK_FUNC_MOVE=4,
+GDK_FUNC_MINIMIZE=8,
+GDK_FUNC_MAXIMIZE=16,
+GDK_FUNC_CLOSE=32,
+}
+enum GdkWMDecoration {
+GDK_DECOR_ALL=1,
+GDK_DECOR_BORDER=2,
+GDK_DECOR_RESIZEH=4,
+GDK_DECOR_TITLE=8,
+GDK_DECOR_MENU=16,
+GDK_DECOR_MINIMIZE=32,
+GDK_DECOR_MAXIMIZE=64,
+}
+enum GdkWindowTypeHint {
+GDK_WINDOW_TYPE_HINT_NORMAL=0,
+GDK_WINDOW_TYPE_HINT_DIALOG=1,
+GDK_WINDOW_TYPE_HINT_MENU=2,
+GDK_WINDOW_TYPE_HINT_TOOLBAR=3,
+GDK_WINDOW_TYPE_HINT_SPLASHSCREEN=4,
+GDK_WINDOW_TYPE_HINT_UTILITY=5,
+GDK_WINDOW_TYPE_HINT_DOCK=6,
+GDK_WINDOW_TYPE_HINT_DESKTOP=7,
+GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU=8,
+GDK_WINDOW_TYPE_HINT_POPUP_MENU=9,
+GDK_WINDOW_TYPE_HINT_TOOLTIP=10,
+GDK_WINDOW_TYPE_HINT_NOTIFICATION=11,
+GDK_WINDOW_TYPE_HINT_COMBO=12,
+GDK_WINDOW_TYPE_HINT_DND=13,
+}
+enum GdkWindowHints {
+GDK_HINT_POS=1,
+GDK_HINT_MIN_SIZE=2,
+GDK_HINT_MAX_SIZE=4,
+GDK_HINT_BASE_SIZE=8,
+GDK_HINT_ASPECT=16,
+GDK_HINT_RESIZE_INC=32,
+GDK_HINT_WIN_GRAVITY=64,
+GDK_HINT_USER_POS=128,
+GDK_HINT_USER_SIZE=256,
+}
+enum GdkWindowAttributesType {
+GDK_WA_TITLE=2,
+GDK_WA_X=4,
+GDK_WA_Y=8,
+GDK_WA_CURSOR=16,
+GDK_WA_COLORMAP=32,
+GDK_WA_VISUAL=64,
+GDK_WA_WMCLASS=128,
+GDK_WA_NOREDIR=256,
+GDK_WA_TYPE_HINT=512,
+}
+enum GdkWindowType {
+GDK_WINDOW_ROOT=0,
+GDK_WINDOW_TOPLEVEL=1,
+GDK_WINDOW_CHILD=2,
+GDK_WINDOW_DIALOG=3,
+GDK_WINDOW_TEMP=4,
+GDK_WINDOW_FOREIGN=5,
+}
+enum GdkWindowClass {
+GDK_INPUT_OUTPUT=0,
+GDK_INPUT_ONLY=1,
+}
+alias _GdkPointerHooks GdkPointerHooks;
+alias _GdkDrawable GdkWindow;
+enum GdkModifierType {
+GDK_SHIFT_MASK=1,
+GDK_LOCK_MASK=2,
+GDK_CONTROL_MASK=4,
+GDK_MOD1_MASK=8,
+GDK_MOD2_MASK=16,
+GDK_MOD3_MASK=32,
+GDK_MOD4_MASK=64,
+GDK_MOD5_MASK=128,
+GDK_BUTTON1_MASK=256,
+GDK_BUTTON2_MASK=512,
+GDK_BUTTON3_MASK=1024,
+GDK_BUTTON4_MASK=2048,
+GDK_BUTTON5_MASK=4096,
+GDK_SUPER_MASK=67108864,
+GDK_HYPER_MASK=134217728,
+GDK_META_MASK=268435456,
+GDK_RELEASE_MASK=1073741824,
+GDK_MODIFIER_MASK=1543512063,
+}
+alias _GdkDrawable * function(_GdkDrawable *, int *, int *, int *) _BCD_func__6478;
+alias _GdkScreen GdkScreen;
+alias _GdkDrawable * function(_GdkScreen *, int *, int *) _BCD_func__6479;
+alias _GdkWindowAttr GdkWindowAttr;
+alias _GdkVisual GdkVisual;
+alias _GdkColormap GdkColormap;
+alias _GdkCursor GdkCursor;
+alias _GdkGeometry GdkGeometry;
+enum GdkVisualType {
+GDK_VISUAL_STATIC_GRAY=0,
+GDK_VISUAL_GRAYSCALE=1,
+GDK_VISUAL_STATIC_COLOR=2,
+GDK_VISUAL_PSEUDO_COLOR=3,
+GDK_VISUAL_TRUE_COLOR=4,
+GDK_VISUAL_DIRECT_COLOR=5,
+}
+alias void GdkVisualClass;
+alias void * GdkAtom;
+alias void * GdkSelectionType;
+alias void * GdkTarget;
+alias void * GdkSelection;
+alias _GdkScreenClass GdkScreenClass;
+alias void function(_GdkScreen *) _BCD_func__6483;
+alias _GdkSpan GdkSpan;
+alias void function(_GdkSpan *, void *) _BCD_func__4157;
+alias _BCD_func__4157 GdkSpanFunc;
+enum GdkOverlapType {
+GDK_OVERLAP_RECTANGLE_IN=0,
+GDK_OVERLAP_RECTANGLE_OUT=1,
+GDK_OVERLAP_RECTANGLE_PART=2,
+}
+enum GdkFillRule {
+GDK_EVEN_ODD_RULE=0,
+GDK_WINDING_RULE=1,
+}
+enum GdkPropMode {
+GDK_PROP_MODE_REPLACE=0,
+GDK_PROP_MODE_PREPEND=1,
+GDK_PROP_MODE_APPEND=2,
+}
+alias _GdkPixmapObjectClass GdkPixmapObjectClass;
+alias _GdkPixmapObject GdkPixmapObject;
+alias _GdkPangoAttrEmbossColor GdkPangoAttrEmbossColor;
+alias _GdkPangoAttrEmbossed GdkPangoAttrEmbossed;
+alias _GdkPangoAttrStipple GdkPangoAttrStipple;
+alias _GdkDrawable GdkBitmap;
+alias void GdkPangoRendererPrivate;
+alias _GdkPangoRendererClass GdkPangoRendererClass;
+alias _GdkPangoRenderer GdkPangoRenderer;
+alias _GdkDisplayManagerClass GdkDisplayManagerClass;
+alias void GdkDisplayManager;
+alias _GdkDisplay GdkDisplay;
+alias void function(void *, _GdkDisplay *) _BCD_func__6492;
+alias _GdkKeymapClass GdkKeymapClass;
+alias _GdkKeymap GdkKeymap;
+alias void function(_GdkKeymap *) _BCD_func__6494;
+alias _GdkKeymapKey GdkKeymapKey;
+alias _GdkImageClass GdkImageClass;
+enum GdkImageType {
+GDK_IMAGE_NORMAL=0,
+GDK_IMAGE_SHARED=1,
+GDK_IMAGE_FASTEST=2,
+}
+enum GdkFontType {
+GDK_FONT_FONT=0,
+GDK_FONT_FONTSET=1,
+}
+alias _GdkTrapezoid GdkTrapezoid;
+alias _GdkGC GdkGC;
+alias _GdkGCValues GdkGCValues;
+enum GdkGCValuesMask {
+GDK_GC_FOREGROUND=1,
+GDK_GC_BACKGROUND=2,
+GDK_GC_FONT=4,
+GDK_GC_FUNCTION=8,
+GDK_GC_FILL=16,
+GDK_GC_TILE=32,
+GDK_GC_STIPPLE=64,
+GDK_GC_CLIP_MASK=128,
+GDK_GC_SUBWINDOW=256,
+GDK_GC_TS_X_ORIGIN=512,
+GDK_GC_TS_Y_ORIGIN=1024,
+GDK_GC_CLIP_X_ORIGIN=2048,
+GDK_GC_CLIP_Y_ORIGIN=4096,
+GDK_GC_EXPOSURES=8192,
+GDK_GC_LINE_WIDTH=16384,
+GDK_GC_LINE_STYLE=32768,
+GDK_GC_CAP_STYLE=65536,
+GDK_GC_JOIN_STYLE=131072,
+}
+alias _GdkGC * function(_GdkDrawable *, _GdkGCValues *, int) _BCD_func__6500;
+alias void function(_GdkDrawable *, _GdkGC *, int, int, int, int, int) _BCD_func__6501;
+alias void function(_GdkDrawable *, _GdkGC *, int, int, int, int, int, int, int) _BCD_func__6502;
+alias _GdkPoint GdkPoint;
+alias void function(_GdkDrawable *, _GdkGC *, int, _GdkPoint *, int) _BCD_func__6503;
+alias _GdkFont GdkFont;
+alias void function(_GdkDrawable *, _GdkFont *, _GdkGC *, int, int, char *, int) _BCD_func__6504;
+alias uint GdkWChar;
+alias void function(_GdkDrawable *, _GdkFont *, _GdkGC *, int, int, uint *, int) _BCD_func__6505;
+alias void function(_GdkDrawable *, _GdkGC *, _GdkDrawable *, int, int, int, int, int, int) _BCD_func__6506;
+alias void function(_GdkDrawable *, _GdkGC *, _GdkPoint *, int) _BCD_func__6507;
+alias _GdkSegment GdkSegment;
+alias void function(_GdkDrawable *, _GdkGC *, _GdkSegment *, int) _BCD_func__6508;
+alias void function(_GdkDrawable *, _GdkGC *, void *, int, int, _PangoGlyphString *) _BCD_func__6509;
+alias _GdkImage GdkImage;
+alias void function(_GdkDrawable *, _GdkGC *, _GdkImage *, int, int, int, int, int, int) _BCD_func__6510;
+alias int function(_GdkDrawable *) _BCD_func__6511;
+alias void function(_GdkDrawable *, int *, int *) _BCD_func__6512;
+alias void function(_GdkDrawable *, _GdkColormap *) _BCD_func__6513;
+alias _GdkColormap * function(_GdkDrawable *) _BCD_func__6514;
+alias _GdkVisual * function(_GdkDrawable *) _BCD_func__6515;
+alias _GdkScreen * function(_GdkDrawable *) _BCD_func__6516;
+alias _GdkImage * function(_GdkDrawable *, int, int, int, int) _BCD_func__6517;
+alias void * function(_GdkDrawable *) _BCD_func__6518;
+alias _GdkDrawable * function(_GdkDrawable *, int, int, int, int, int *, int *) _BCD_func__6519;
+alias void GdkPixbuf;
+enum GdkRgbDither {
+GDK_RGB_DITHER_NONE=0,
+GDK_RGB_DITHER_NORMAL=1,
+GDK_RGB_DITHER_MAX=2,
+}
+alias void function(_GdkDrawable *, _GdkGC *, void *, int, int, int, int, int, int, int, int, int) _BCD_func__6520;
+alias _GdkImage * function(_GdkDrawable *, _GdkImage *, int, int, int, int, int, int) _BCD_func__6521;
+alias void function(_GdkDrawable *, _GdkGC *, _PangoMatrix *, void *, int, int, _PangoGlyphString *) _BCD_func__6522;
+alias void function(_GdkDrawable *, _GdkGC *, _GdkTrapezoid *, int) _BCD_func__6523;
+alias void * function(_GdkDrawable *) _BCD_func__6524;
+alias void function() _BCD_func__5298;
+enum GdkSubwindowMode {
+GDK_CLIP_BY_CHILDREN=0,
+GDK_INCLUDE_INFERIORS=1,
+}
+enum GdkLineStyle {
+GDK_LINE_SOLID=0,
+GDK_LINE_ON_OFF_DASH=1,
+GDK_LINE_DOUBLE_DASH=2,
+}
+enum GdkJoinStyle {
+GDK_JOIN_MITER=0,
+GDK_JOIN_ROUND=1,
+GDK_JOIN_BEVEL=2,
+}
+enum GdkFunction {
+GDK_COPY=0,
+GDK_INVERT=1,
+GDK_XOR=2,
+GDK_CLEAR=3,
+GDK_AND=4,
+GDK_AND_REVERSE=5,
+GDK_AND_INVERT=6,
+GDK_NOOP=7,
+GDK_OR=8,
+GDK_EQUIV=9,
+GDK_OR_REVERSE=10,
+GDK_COPY_INVERT=11,
+GDK_OR_INVERT=12,
+GDK_NAND=13,
+GDK_NOR=14,
+GDK_SET=15,
+}
+enum GdkFill {
+GDK_SOLID=0,
+GDK_TILED=1,
+GDK_STIPPLED=2,
+GDK_OPAQUE_STIPPLED=3,
+}
+enum GdkCapStyle {
+GDK_CAP_NOT_LAST=0,
+GDK_CAP_BUTT=1,
+GDK_CAP_ROUND=2,
+GDK_CAP_PROJECTING=3,
+}
+alias _GdkGCClass GdkGCClass;
+alias void function(_GdkGC *, _GdkGCValues *) _BCD_func__6526;
+alias void function(_GdkGC *, _GdkGCValues *, int) _BCD_func__6527;
+alias void function(_GdkGC *, int, char *, int) _BCD_func__6528;
+alias _GdkDisplayPointerHooks GdkDisplayPointerHooks;
+alias void function(_GdkDisplay *, _GdkScreen * *, int *, int *, int *) _BCD_func__6531;
+alias _GdkDrawable * function(_GdkDisplay *, _GdkDrawable *, int *, int *, int *) _BCD_func__6532;
+alias _GdkDrawable * function(_GdkDisplay *, int *, int *) _BCD_func__6533;
+alias _GdkDisplayClass GdkDisplayClass;
+alias char * function(_GdkDisplay *) _BCD_func__6535;
+alias int function(_GdkDisplay *) _BCD_func__6536;
+alias _GdkScreen * function(_GdkDisplay *, int) _BCD_func__6537;
+alias _GdkScreen * function(_GdkDisplay *) _BCD_func__6538;
+alias void function(_GdkDisplay *, int) _BCD_func__6539;
+enum GdkOwnerChange {
+GDK_OWNER_CHANGE_NEW_OWNER=0,
+GDK_OWNER_CHANGE_DESTROY=1,
+GDK_OWNER_CHANGE_CLOSE=2,
+}
+enum GdkSettingAction {
+GDK_SETTING_ACTION_NEW=0,
+GDK_SETTING_ACTION_CHANGED=1,
+GDK_SETTING_ACTION_DELETED=2,
+}
+enum GdkPropertyState {
+GDK_PROPERTY_NEW_VALUE=0,
+GDK_PROPERTY_DELETE=1,
+}
+enum GdkCrossingMode {
+GDK_CROSSING_NORMAL=0,
+GDK_CROSSING_GRAB=1,
+GDK_CROSSING_UNGRAB=2,
+}
+enum GdkNotifyType {
+GDK_NOTIFY_ANCESTOR=0,
+GDK_NOTIFY_VIRTUAL=1,
+GDK_NOTIFY_INFERIOR=2,
+GDK_NOTIFY_NONLINEAR=3,
+GDK_NOTIFY_NONLINEAR_VIRTUAL=4,
+GDK_NOTIFY_UNKNOWN=5,
+}
+enum GdkScrollDirection {
+GDK_SCROLL_UP=0,
+GDK_SCROLL_DOWN=1,
+GDK_SCROLL_LEFT=2,
+GDK_SCROLL_RIGHT=3,
+}
+enum GdkVisibilityState {
+GDK_VISIBILITY_UNOBSCURED=0,
+GDK_VISIBILITY_PARTIAL=1,
+GDK_VISIBILITY_FULLY_OBSCURED=2,
+}
+enum GdkEventType {
+GDK_NOTHING=-1,
+GDK_DELETE=0,
+GDK_DESTROY=1,
+GDK_EXPOSE=2,
+GDK_MOTION_NOTIFY=3,
+GDK_BUTTON_PRESS=4,
+GDK_2BUTTON_PRESS=5,
+GDK_3BUTTON_PRESS=6,
+GDK_BUTTON_RELEASE=7,
+GDK_KEY_PRESS=8,
+GDK_KEY_RELEASE=9,
+GDK_ENTER_NOTIFY=10,
+GDK_LEAVE_NOTIFY=11,
+GDK_FOCUS_CHANGE=12,
+GDK_CONFIGURE=13,
+GDK_MAP=14,
+GDK_UNMAP=15,
+GDK_PROPERTY_NOTIFY=16,
+GDK_SELECTION_CLEAR=17,
+GDK_SELECTION_REQUEST=18,
+GDK_SELECTION_NOTIFY=19,
+GDK_PROXIMITY_IN=20,
+GDK_PROXIMITY_OUT=21,
+GDK_DRAG_ENTER=22,
+GDK_DRAG_LEAVE=23,
+GDK_DRAG_MOTION=24,
+GDK_DRAG_STATUS=25,
+GDK_DROP_START=26,
+GDK_DROP_FINISHED=27,
+GDK_CLIENT_EVENT=28,
+GDK_VISIBILITY_NOTIFY=29,
+GDK_NO_EXPOSE=30,
+GDK_SCROLL=31,
+GDK_WINDOW_STATE=32,
+GDK_SETTING=33,
+GDK_OWNER_CHANGE=34,
+GDK_GRAB_BROKEN=35,
+}
+enum GdkFilterReturn {
+GDK_FILTER_CONTINUE=0,
+GDK_FILTER_TRANSLATE=1,
+GDK_FILTER_REMOVE=2,
+}
+alias void GdkXEvent;
+alias _GdkEvent GdkEvent;
+alias int function(void *, _GdkEvent *, void *) _BCD_func__4335;
+alias _BCD_func__4335 GdkFilterFunc;
+alias void function(_GdkEvent *, void *) _BCD_func__4336;
+alias _BCD_func__4336 GdkEventFunc;
+alias _GdkEventAny GdkEventAny;
+alias _GdkEventExpose GdkEventExpose;
+alias _GdkEventNoExpose GdkEventNoExpose;
+alias _GdkEventVisibility GdkEventVisibility;
+alias _GdkEventMotion GdkEventMotion;
+alias _GdkEventButton GdkEventButton;
+alias _GdkEventScroll GdkEventScroll;
+alias _GdkEventKey GdkEventKey;
+alias _GdkEventCrossing GdkEventCrossing;
+alias _GdkEventFocus GdkEventFocus;
+alias _GdkEventConfigure GdkEventConfigure;
+alias _GdkEventProperty GdkEventProperty;
+alias _GdkEventSelection GdkEventSelection;
+alias _GdkEventOwnerChange GdkEventOwnerChange;
+alias _GdkEventProximity GdkEventProximity;
+alias _GdkEventClient GdkEventClient;
+alias _GdkEventDND GdkEventDND;
+alias _GdkEventWindowState GdkEventWindowState;
+alias _GdkEventSetting GdkEventSetting;
+alias _GdkEventGrabBroken GdkEventGrabBroken;
+alias _GdkDragContext GdkDragContext;
+alias _GdkDevice GdkDevice;
+alias uint GdkNativeWindow;
+alias _GdkRectangle GdkRectangle;
+enum GdkAxisUse {
+GDK_AXIS_IGNORE=0,
+GDK_AXIS_X=1,
+GDK_AXIS_Y=2,
+GDK_AXIS_PRESSURE=3,
+GDK_AXIS_XTILT=4,
+GDK_AXIS_YTILT=5,
+GDK_AXIS_WHEEL=6,
+GDK_AXIS_LAST=7,
+}
+enum GdkInputMode {
+GDK_MODE_DISABLED=0,
+GDK_MODE_SCREEN=1,
+GDK_MODE_WINDOW=2,
+}
+enum GdkInputSource {
+GDK_SOURCE_MOUSE=0,
+GDK_SOURCE_PEN=1,
+GDK_SOURCE_ERASER=2,
+GDK_SOURCE_CURSOR=3,
+}
+enum GdkExtensionMode {
+GDK_EXTENSION_EVENTS_NONE=0,
+GDK_EXTENSION_EVENTS_ALL=1,
+GDK_EXTENSION_EVENTS_CURSOR=2,
+}
+alias _GdkTimeCoord GdkTimeCoord;
+alias void GdkDeviceClass;
+alias _GdkDeviceAxis GdkDeviceAxis;
+alias _GdkDeviceKey GdkDeviceKey;
+alias _GdkDragContextClass GdkDragContextClass;
+enum GdkDragProtocol {
+GDK_DRAG_PROTO_MOTIF=0,
+GDK_DRAG_PROTO_XDND=1,
+GDK_DRAG_PROTO_ROOTWIN=2,
+GDK_DRAG_PROTO_NONE=3,
+GDK_DRAG_PROTO_WIN32_DROPFILES=4,
+GDK_DRAG_PROTO_OLE2=5,
+GDK_DRAG_PROTO_LOCAL=6,
+}
+enum GdkDragAction {
+GDK_ACTION_DEFAULT=1,
+GDK_ACTION_COPY=2,
+GDK_ACTION_MOVE=4,
+GDK_ACTION_LINK=8,
+GDK_ACTION_PRIVATE=16,
+GDK_ACTION_ASK=32,
+}
+enum GdkCursorType {
+GDK_X_CURSOR=0,
+GDK_ARROW=2,
+GDK_BASED_ARROW_DOWN=4,
+GDK_BASED_ARROW_UP=6,
+GDK_BOAT=8,
+GDK_BOGOSITY=10,
+GDK_BOTTOM_LEFT_CORNER=12,
+GDK_BOTTOM_RIGHT_CORNER=14,
+GDK_BOTTOM_SIDE=16,
+GDK_BOTTOM_TEE=18,
+GDK_BOX_SPIRAL=20,
+GDK_CENTER_PTR=22,
+GDK_CIRCLE=24,
+GDK_CLOCK=26,
+GDK_COFFEE_MUG=28,
+GDK_CROSS=30,
+GDK_CROSS_REVERSE=32,
+GDK_CROSSHAIR=34,
+GDK_DIAMOND_CROSS=36,
+GDK_DOT=38,
+GDK_DOTBOX=40,
+GDK_DOUBLE_ARROW=42,
+GDK_DRAFT_LARGE=44,
+GDK_DRAFT_SMALL=46,
+GDK_DRAPED_BOX=48,
+GDK_EXCHANGE=50,
+GDK_FLEUR=52,
+GDK_GOBBLER=54,
+GDK_GUMBY=56,
+GDK_HAND1=58,
+GDK_HAND2=60,
+GDK_HEART=62,
+GDK_ICON=64,
+GDK_IRON_CROSS=66,
+GDK_LEFT_PTR=68,
+GDK_LEFT_SIDE=70,
+GDK_LEFT_TEE=72,
+GDK_LEFTBUTTON=74,
+GDK_LL_ANGLE=76,
+GDK_LR_ANGLE=78,
+GDK_MAN=80,
+GDK_MIDDLEBUTTON=82,
+GDK_MOUSE=84,
+GDK_PENCIL=86,
+GDK_PIRATE=88,
+GDK_PLUS=90,
+GDK_QUESTION_ARROW=92,
+GDK_RIGHT_PTR=94,
+GDK_RIGHT_SIDE=96,
+GDK_RIGHT_TEE=98,
+GDK_RIGHTBUTTON=100,
+GDK_RTL_LOGO=102,
+GDK_SAILBOAT=104,
+GDK_SB_DOWN_ARROW=106,
+GDK_SB_H_DOUBLE_ARROW=108,
+GDK_SB_LEFT_ARROW=110,
+GDK_SB_RIGHT_ARROW=112,
+GDK_SB_UP_ARROW=114,
+GDK_SB_V_DOUBLE_ARROW=116,
+GDK_SHUTTLE=118,
+GDK_SIZING=120,
+GDK_SPIDER=122,
+GDK_SPRAYCAN=124,
+GDK_STAR=126,
+GDK_TARGET=128,
+GDK_TCROSS=130,
+GDK_TOP_LEFT_ARROW=132,
+GDK_TOP_LEFT_CORNER=134,
+GDK_TOP_RIGHT_CORNER=136,
+GDK_TOP_SIDE=138,
+GDK_TOP_TEE=140,
+GDK_TREK=142,
+GDK_UL_ANGLE=144,
+GDK_UMBRELLA=146,
+GDK_UR_ANGLE=148,
+GDK_WATCH=150,
+GDK_XTERM=152,
+GDK_LAST_CURSOR=153,
+GDK_CURSOR_IS_PIXMAP=-1,
+}
+alias _GdkPixbufLoaderClass GdkPixbufLoaderClass;
+alias _GdkPixbufLoader GdkPixbufLoader;
+alias void function(_GdkPixbufLoader *, int, int) _BCD_func__6572;
+alias void function(_GdkPixbufLoader *) _BCD_func__6573;
+alias void function(_GdkPixbufLoader *, int, int, int, int) _BCD_func__6574;
+alias void GdkPixbufFormat;
+alias void GdkPixbufSimpleAnimClass;
+alias void GdkPixbufSimpleAnim;
+alias void GdkPixbufAnimationIter;
+alias void GdkPixbufAnimation;
+enum GdkPixbufRotation {
+GDK_PIXBUF_ROTATE_NONE=0,
+GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE=90,
+GDK_PIXBUF_ROTATE_UPSIDEDOWN=180,
+GDK_PIXBUF_ROTATE_CLOCKWISE=270,
+}
+enum GdkInterpType {
+GDK_INTERP_NEAREST=0,
+GDK_INTERP_TILES=1,
+GDK_INTERP_BILINEAR=2,
+GDK_INTERP_HYPER=3,
+}
+alias int function(char *, uint, _GError * *, void *) _BCD_func__4618;
+alias _BCD_func__4618 GdkPixbufSaveFunc;
+enum GdkPixbufError {
+GDK_PIXBUF_ERROR_CORRUPT_IMAGE=0,
+GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY=1,
+GDK_PIXBUF_ERROR_BAD_OPTION=2,
+GDK_PIXBUF_ERROR_UNKNOWN_TYPE=3,
+GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION=4,
+GDK_PIXBUF_ERROR_FAILED=5,
+}
+alias void function(char *, void *) _BCD_func__4621;
+alias _BCD_func__4621 GdkPixbufDestroyNotify;
+enum GdkColorspace {
+GDK_COLORSPACE_RGB=0,
+}
+enum GdkPixbufAlphaMode {
+GDK_PIXBUF_ALPHA_BILEVEL=0,
+GDK_PIXBUF_ALPHA_FULL=1,
+}
+alias _GdkRgbCmap GdkRgbCmap;
+alias _GdkColormapClass GdkColormapClass;
+alias void function(void *) _BCD_func__4634;
+alias _BCD_func__4634 GdkDestroyNotify;
+enum GdkInputCondition {
+GDK_INPUT_READ=1,
+GDK_INPUT_WRITE=2,
+GDK_INPUT_EXCEPTION=4,
+}
+alias void function(void *, int, int) _BCD_func__4635;
+alias _BCD_func__4635 GdkInputFunction;
+enum GdkGrabStatus {
+GDK_GRAB_SUCCESS=0,
+GDK_GRAB_ALREADY_GRABBED=1,
+GDK_GRAB_INVALID_TIME=2,
+GDK_GRAB_NOT_VIEWABLE=3,
+GDK_GRAB_FROZEN=4,
+}
+enum GdkStatus {
+GDK_OK=0,
+GDK_ERROR=-1,
+GDK_ERROR_PARAM=-2,
+GDK_ERROR_FILE=-3,
+GDK_ERROR_MEM=-4,
+}
+enum GdkByteOrder {
+GDK_LSB_FIRST=0,
+GDK_MSB_FIRST=1,
+}
+alias int function(void *) _BCD_func__5647;
+alias int function(_GdkDrawable *, void *) _BCD_func__6008;
+alias void function(void *, _PangoAttrShape *, int, void *) _BCD_func__4593;
+alias void function(void *) _BCD_func__4610;
+alias char * function(void *) _BCD_func__4611;
+alias int function(void *) _BCD_func__1140;
+alias int function(void *, long *, int) _BCD_func__1142;
+alias int function(void *, char *, uint) _BCD_func__1144;
+alias int function(void *, char *, uint) _BCD_func__1146;
+alias int function(void * *, char *) _BCD_func__4808;
+alias int function(char *, char * * *, uint *) _BCD_func__4809;
+alias int function(void *, char *, char *, char *, char *) _BCD_func__4810;
+alias int function(__gconv_step *, __gconv_step_data *, void *, char *, char * *, char *, char * *, uint *) _BCD_func__4811;
+alias void function(__gconv_step *) _BCD_func__4812;
+alias int function(__gconv_step *) _BCD_func__4813;
+alias uint function(__gconv_step *, char) _BCD_func__4814;
+alias int function(__gconv_step *, __gconv_step_data *, char * *, char *, char * *, uint *, int, int) _BCD_func__4815;
+alias int function(void *, void *, void *) _BCD_func__4965;
+alias void * function(void *) _BCD_func__4989;
+alias int function(_PangoAttribute *, void *) _BCD_func__4990;
+alias void function(void *, uint, uint, _GInterfaceInfo *) _BCD_func__5093;
+alias void function(void *, uint, _GTypeInfo *, _GTypeValueTable *) _BCD_func__5094;
+alias void function(void *) _BCD_func__5095;
+alias void function(void *, _GObject *, int) _BCD_func__5243;
+alias void function(void *, _GObject *) _BCD_func__5247;
+alias void function(_GObject *) _BCD_func__5248;
+alias void function(_GObject *, uint, _GValue *, _GParamSpec *) _BCD_func__5249;
+alias void function(_GObject *, uint, _GValue *, _GParamSpec *) _BCD_func__5250;
+alias int function(_GSignalInvocationHint *, _GValue *, _GValue *, void *) _BCD_func__5276;
+alias int function(_GSignalInvocationHint *, uint, _GValue *, void *) _BCD_func__5277;
+alias void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *) _BCD_func__5278;
+alias void function(void *, _GClosure *) _BCD_func__5297;
+alias void function(_GValue *, _GValue *) _BCD_func__5355;
+alias void * function(void *) _BCD_func__5383;
+alias void function(void *, void *) _BCD_func__5387;
+alias int function(void *, _GTypeClass *) _BCD_func__5388;
+alias void function(_GTypeInstance *, void *) _BCD_func__5389;
+alias int function(void *, void *, void *) _BCD_func__5443;
+alias int function(void *, void *, void *) _BCD_func__5457;
+alias void function(_GScanner *, char *, int) _BCD_func__5460;
+alias int function(void *, _GString *, void *) _BCD_func__5532;
+alias void function(void *, void *, void *, _GError * *) _BCD_func__5549;
+alias int function(void *, void *, void *, _GError * *) _BCD_func__5550;
+alias int function(char *, char *, void *, _GError * *) _BCD_func__5551;
+alias void * function(void *, void *) _BCD_func__5562;
+alias void function(_GNode *, void *) _BCD_func__5563;
+alias int function(_GNode *, void *) _BCD_func__5564;
+alias void function(char *) _BCD_func__5572;
+alias void function(char *, int, char *, void *) _BCD_func__5574;
+alias int function(_GIOChannel *, int, void *) _BCD_func__5589;
+alias int function(_GPollFD *, uint, int) _BCD_func__5640;
+alias void function(int, int, void *) _BCD_func__5646;
+alias void function(_GHookList *, _GHook *) _BCD_func__5682;
+alias int function(_GHook *, void *) _BCD_func__5683;
+alias void function(_GHook *, void *) _BCD_func__5684;
+alias int function(_GHook *, _GHook *) _BCD_func__5685;
+alias void function(uint, void *, void *) _BCD_func__5719;
+alias int function(char *, char *, uint) _BCD_func__5722;
+alias char * function(void *) _BCD_func__5723;
+alias char * function(char *, void *) _BCD_func__5908;
+alias void function(void *, void *, void *) _BCD_func__5909;
+alias uint function(void *) _BCD_func__5910;
+alias int function(void *, void *) _BCD_func__5911;
+alias int function(void *, void *, void *) _BCD_func__5912;
+alias int function(void *, void *) _BCD_func__5913;
+alias int function(void *, char *, uint) _BCD_func__5985;
+alias int function(void *, char *, uint) _BCD_func__5986;
+struct _GdkWindowObjectClass {
+_GdkDrawableClass parent_class;
+}
+struct _GdkWindowObject {
+_GdkDrawable parent_instance;
+_GdkDrawable * impl;
+_GdkWindowObject * parent;
+void * user_data;
+int x;
+int y;
+int extension_events;
+_GList * filters;
+_GList * children;
+_GdkColor bg_color;
+_GdkDrawable * bg_pixmap;
+_GSList * paint_stack;
+void * update_area;
+uint update_freeze_count;
+char window_type;
+char depth;
+char resize_count;
+int state;
+uint bitfield0;
+// uint guffaw_gravity // bits 0 .. 1
+// uint input_only // bits 1 .. 2
+// uint modal_hint // bits 2 .. 3
+// uint composited // bits 3 .. 4
+// uint destroyed // bits 4 .. 6
+// uint accept_focus // bits 6 .. 7
+// uint focus_on_map // bits 7 .. 8
+// uint shaped // bits 8 .. 9
+int event_mask;
+uint update_and_descendants_freeze_count;
+}
+struct _GdkPointerHooks {
+_BCD_func__6478 get_pointer;
+_BCD_func__6479 window_at_pointer;
+}
+struct _GdkWindowAttr {
+char * title;
+int event_mask;
+int x;
+int y;
+int width;
+int height;
+int wclass;
+_GdkVisual * visual;
+_GdkColormap * colormap;
+int window_type;
+_GdkCursor * cursor;
+char * wmclass_name;
+char * wmclass_class;
+int override_redirect;
+int type_hint;
+}
+struct _GdkGeometry {
+int min_width;
+int min_height;
+int max_width;
+int max_height;
+int base_width;
+int base_height;
+int width_inc;
+int height_inc;
+double min_aspect;
+double max_aspect;
+int win_gravity;
+}
+struct _GdkScreenClass {
+_GObjectClass parent_class;
+_BCD_func__6483 size_changed;
+_BCD_func__6483 composited_changed;
+}
+struct _GdkPixmapObjectClass {
+_GdkDrawableClass parent_class;
+}
+struct _GdkPixmapObject {
+_GdkDrawable parent_instance;
+_GdkDrawable * impl;
+int depth;
+}
+struct _GdkPangoAttrEmbossColor {
+_PangoAttribute attr;
+_PangoColor color;
+}
+struct _GdkPangoAttrEmbossed {
+_PangoAttribute attr;
+int embossed;
+}
+struct _GdkPangoAttrStipple {
+_PangoAttribute attr;
+_GdkDrawable * stipple;
+}
+struct _GdkPangoRendererClass {
+_PangoRendererClass parent_class;
+}
+struct _GdkPangoRenderer {
+_PangoRenderer parent_instance;
+void * priv;
+}
+struct _GdkDisplayManagerClass {
+_GObjectClass parent_class;
+_BCD_func__6492 display_opened;
+}
+struct _GdkKeymapClass {
+_GObjectClass parent_class;
+_BCD_func__6494 direction_changed;
+_BCD_func__6494 keys_changed;
+}
+struct _GdkKeymap {
+_GObject parent_instance;
+_GdkDisplay * display;
+}
+struct _GdkKeymapKey {
+uint keycode;
+int group;
+int level;
+}
+struct _GdkImageClass {
+_GObjectClass parent_class;
+}
+struct _GdkTrapezoid {
+double y1;
+double x11;
+double x21;
+double y2;
+double x12;
+double x22;
+}
+struct _GdkDrawableClass {
+_GObjectClass parent_class;
+_BCD_func__6500 create_gc;
+_BCD_func__6501 draw_rectangle;
+_BCD_func__6502 draw_arc;
+_BCD_func__6503 draw_polygon;
+_BCD_func__6504 draw_text;
+_BCD_func__6505 draw_text_wc;
+_BCD_func__6506 draw_drawable;
+_BCD_func__6507 draw_points;
+_BCD_func__6508 draw_segments;
+_BCD_func__6507 draw_lines;
+_BCD_func__6509 draw_glyphs;
+_BCD_func__6510 draw_image;
+_BCD_func__6511 get_depth;
+_BCD_func__6512 get_size;
+_BCD_func__6513 set_colormap;
+_BCD_func__6514 get_colormap;
+_BCD_func__6515 get_visual;
+_BCD_func__6516 get_screen;
+_BCD_func__6517 get_image;
+_BCD_func__6518 get_clip_region;
+_BCD_func__6518 get_visible_region;
+_BCD_func__6519 get_composite_drawable;
+_BCD_func__6520 draw_pixbuf;
+_BCD_func__6521 _copy_to_image;
+_BCD_func__6522 draw_glyphs_transformed;
+_BCD_func__6523 draw_trapezoids;
+_BCD_func__6524 ref_cairo_surface;
+_BCD_func__5298 _gdk_reserved4;
+_BCD_func__5298 _gdk_reserved5;
+_BCD_func__5298 _gdk_reserved6;
+_BCD_func__5298 _gdk_reserved7;
+_BCD_func__5298 _gdk_reserved9;
+_BCD_func__5298 _gdk_reserved10;
+_BCD_func__5298 _gdk_reserved11;
+_BCD_func__5298 _gdk_reserved12;
+_BCD_func__5298 _gdk_reserved13;
+_BCD_func__5298 _gdk_reserved14;
+_BCD_func__5298 _gdk_reserved15;
+_BCD_func__5298 _gdk_reserved16;
+}
+struct _GdkGCClass {
+_GObjectClass parent_class;
+_BCD_func__6526 get_values;
+_BCD_func__6527 set_values;
+_BCD_func__6528 set_dashes;
+_BCD_func__5298 _gdk_reserved1;
+_BCD_func__5298 _gdk_reserved2;
+_BCD_func__5298 _gdk_reserved3;
+_BCD_func__5298 _gdk_reserved4;
+}
+struct _GdkGCValues {
+_GdkColor foreground;
+_GdkColor background;
+_GdkFont * font;
+int function_;
+int fill;
+_GdkDrawable * tile;
+_GdkDrawable * stipple;
+_GdkDrawable * clip_mask;
+int subwindow_mode;
+int ts_x_origin;
+int ts_y_origin;
+int clip_x_origin;
+int clip_y_origin;
+int graphics_exposures;
+int line_width;
+int line_style;
+int cap_style;
+int join_style;
+}
+struct _GdkDisplayPointerHooks {
+_BCD_func__6531 get_pointer;
+_BCD_func__6532 window_get_pointer;
+_BCD_func__6533 window_at_pointer;
+}
+struct _GdkDisplayClass {
+_GObjectClass parent_class;
+_BCD_func__6535 get_display_name;
+_BCD_func__6536 get_n_screens;
+_BCD_func__6537 get_screen;
+_BCD_func__6538 get_default_screen;
+_BCD_func__6539 closed;
+}
+union _GdkEvent {
+int type;
+_GdkEventAny any;
+_GdkEventExpose expose;
+_GdkEventNoExpose no_expose;
+_GdkEventVisibility visibility;
+_GdkEventMotion motion;
+_GdkEventButton button;
+_GdkEventScroll scroll;
+_GdkEventKey key;
+_GdkEventCrossing crossing;
+_GdkEventFocus focus_change;
+_GdkEventConfigure configure;
+_GdkEventProperty property;
+_GdkEventSelection selection;
+_GdkEventOwnerChange owner_change;
+_GdkEventProximity proximity;
+_GdkEventClient client;
+_GdkEventDND dnd;
+_GdkEventWindowState window_state;
+_GdkEventSetting setting;
+_GdkEventGrabBroken grab_broken;
+}
+struct _GdkEventGrabBroken {
+int type;
+_GdkDrawable * window;
+char send_event;
+int keyboard;
+int implicit;
+_GdkDrawable * grab_window;
+}
+struct _GdkEventSetting {
+int type;
+_GdkDrawable * window;
+char send_event;
+int action;
+char * name;
+}
+struct _GdkEventWindowState {
+int type;
+_GdkDrawable * window;
+char send_event;
+int changed_mask;
+int new_window_state;
+}
+struct _GdkEventDND {
+int type;
+_GdkDrawable * window;
+char send_event;
+_GdkDragContext * context;
+uint time;
+short x_root;
+short y_root;
+}
+union N15_GdkEventClient5__115E {
+char [20] b;
+short [10] s;
+int [5] l;
+}
+struct _GdkEventClient {
+int type;
+_GdkDrawable * window;
+char send_event;
+void * message_type;
+ushort data_format;
+N15_GdkEventClient5__115E data;
+}
+struct _GdkEventProximity {
+int type;
+_GdkDrawable * window;
+char send_event;
+uint time;
+_GdkDevice * device;
+}
+struct _GdkEventOwnerChange {
+int type;
+_GdkDrawable * window;
+char send_event;
+uint owner;
+int reason;
+void * selection;
+uint time;
+uint selection_time;
+}
+struct _GdkEventSelection {
+int type;
+_GdkDrawable * window;
+char send_event;
+void * selection;
+void * target;
+void * property;
+uint time;
+uint requestor;
+}
+struct _GdkEventProperty {
+int type;
+_GdkDrawable * window;
+char send_event;
+void * atom;
+uint time;
+uint state;
+}
+struct _GdkEventConfigure {
+int type;
+_GdkDrawable * window;
+char send_event;
+int x;
+int y;
+int width;
+int height;
+}
+struct _GdkEventCrossing {
+int type;
+_GdkDrawable * window;
+char send_event;
+_GdkDrawable * subwindow;
+uint time;
+double x;
+double y;
+double x_root;
+double y_root;
+int mode;
+int detail;
+int focus;
+uint state;
+}
+struct _GdkEventFocus {
+int type;
+_GdkDrawable * window;
+char send_event;
+short in_;
+}
+struct _GdkEventKey {
+int type;
+_GdkDrawable * window;
+char send_event;
+uint time;
+uint state;
+uint keyval;
+int length;
+char * string;
+ushort hardware_keycode;
+char group;
+ubyte bitfield0;
+// uint is_modifier // bits 0 .. 1
+}
+struct _GdkEventScroll {
+int type;
+_GdkDrawable * window;
+char send_event;
+uint time;
+double x;
+double y;
+uint state;
+int direction;
+_GdkDevice * device;
+double x_root;
+double y_root;
+}
+struct _GdkEventButton {
+int type;
+_GdkDrawable * window;
+char send_event;
+uint time;
+double x;
+double y;
+double * axes;
+uint state;
+uint button;
+_GdkDevice * device;
+double x_root;
+double y_root;
+}
+struct _GdkEventMotion {
+int type;
+_GdkDrawable * window;
+char send_event;
+uint time;
+double x;
+double y;
+double * axes;
+uint state;
+short is_hint;
+_GdkDevice * device;
+double x_root;
+double y_root;
+}
+struct _GdkEventVisibility {
+int type;
+_GdkDrawable * window;
+char send_event;
+int state;
+}
+struct _GdkEventNoExpose {
+int type;
+_GdkDrawable * window;
+char send_event;
+}
+struct _GdkEventExpose {
+int type;
+_GdkDrawable * window;
+char send_event;
+_GdkRectangle area;
+void * region;
+int count;
+}
+struct _GdkEventAny {
+int type;
+_GdkDrawable * window;
+char send_event;
+}
+struct _GdkTimeCoord {
+uint time;
+double [128] axes;
+}
+struct _GdkDevice {
+_GObject parent_instance;
+char * name;
+int source;
+int mode;
+int has_cursor;
+int num_axes;
+_GdkDeviceAxis * axes;
+int num_keys;
+_GdkDeviceKey * keys;
+}
+struct _GdkDeviceAxis {
+int use;
+double min;
+double max;
+}
+struct _GdkDeviceKey {
+uint keyval;
+int modifiers;
+}
+struct _GdkDragContextClass {
+_GObjectClass parent_class;
+}
+struct _GdkDragContext {
+_GObject parent_instance;
+int protocol;
+int is_source;
+_GdkDrawable * source_window;
+_GdkDrawable * dest_window;
+_GList * targets;
+int actions;
+int suggested_action;
+int action;
+uint start_time;
+void * windowing_data;
+}
+struct _GdkPixbufLoaderClass {
+_GObjectClass parent_class;
+_BCD_func__6572 size_prepared;
+_BCD_func__6573 area_prepared;
+_BCD_func__6574 area_updated;
+_BCD_func__6573 closed;
+}
+struct _GdkPixbufLoader {
+_GObject parent_instance;
+void * priv;
+}
+struct _GdkRgbCmap {
+uint [256] colors;
+int n_colors;
+_GSList * info_list;
+}
+struct _GdkColormapClass {
+_GObjectClass parent_class;
+}
+struct _GdkScreen {
+_GObject parent_instance;
+uint bitfield0;
+// uint closed // bits 0 .. 1
+_GdkGC * [32] normal_gcs;
+_GdkGC * [32] exposure_gcs;
+void * font_options;
+double resolution;
+}
+struct _GdkDisplay {
+_GObject parent_instance;
+_GList * queued_events;
+_GList * queued_tail;
+uint [2] button_click_time;
+_GdkDrawable * [2] button_window;
+int [2] button_number;
+uint double_click_time;
+_GdkDevice * core_pointer;
+_GdkDisplayPointerHooks * pointer_hooks;
+uint bitfield0;
+// uint closed // bits 0 .. 1
+uint double_click_distance;
+int [2] button_x;
+int [2] button_y;
+}
+struct _GdkDrawable {
+_GObject parent_instance;
+}
+struct _GdkVisual {
+_GObject parent_instance;
+int type;
+int depth;
+int byte_order;
+int colormap_size;
+int bits_per_rgb;
+uint red_mask;
+int red_shift;
+int red_prec;
+uint green_mask;
+int green_shift;
+int green_prec;
+uint blue_mask;
+int blue_shift;
+int blue_prec;
+}
+struct _GdkImage {
+_GObject parent_instance;
+int type;
+_GdkVisual * visual;
+int byte_order;
+int width;
+int height;
+ushort depth;
+ushort bpp;
+ushort bpl;
+ushort bits_per_pixel;
+void * mem;
+_GdkColormap * colormap;
+void * windowing_data;
+}
+struct _GdkGC {
+_GObject parent_instance;
+int clip_x_origin;
+int clip_y_origin;
+int ts_x_origin;
+int ts_y_origin;
+_GdkColormap * colormap;
+}
+struct _GdkFont {
+int type;
+int ascent;
+int descent;
+}
+struct _GdkCursor {
+int type;
+uint ref_count;
+}
+struct _GdkColormap {
+_GObject parent_instance;
+int size;
+_GdkColor * colors;
+_GdkVisual * visual;
+void * windowing_data;
+}
+struct _GdkColor {
+uint pixel;
+ushort red;
+ushort green;
+ushort blue;
+}
+struct _GdkSpan {
+int x;
+int y;
+int width;
+}
+struct _GdkSegment {
+int x1;
+int y1;
+int x2;
+int y2;
+}
+struct _GdkRectangle {
+int x;
+int y;
+int width;
+int height;
+}
+struct _GdkPoint {
+int x;
+int y;
+}
+version(DYNLINK){
+extern (C) uint function(uint, _BCD_func__5647, void *)gdk_threads_add_timeout;
+extern (C) uint function(int, uint, _BCD_func__5647, void *, _BCD_func__4634)gdk_threads_add_timeout_full;
+extern (C) uint function(_BCD_func__5647, void *)gdk_threads_add_idle;
+extern (C) uint function(int, _BCD_func__5647, void *, _BCD_func__4634)gdk_threads_add_idle_full;
+extern (C) void function(_BCD_func__5298, _BCD_func__5298)gdk_threads_set_lock_functions;
+extern (C) void function()gdk_threads_init;
+extern (C) void function()gdk_threads_leave;
+extern (C) void function()gdk_threads_enter;
+extern (C) extern _BCD_func__5298* gdk_threads_unlock;
+extern (C) extern _BCD_func__5298* gdk_threads_lock;
+extern (C) extern void ** gdk_threads_mutex;
+extern (C) void function(char *)gdk_notify_startup_complete_with_id;
+extern (C) void function()gdk_notify_startup_complete;
+extern (C) int function(_GdkDisplay *, _GdkEvent *, uint)gdk_event_send_client_message_for_display;
+extern (C) void function(_GdkEvent *)gdk_event_send_clientmessage_toall;
+extern (C) int function(_GdkEvent *, uint)gdk_event_send_client_message;
+extern (C) int function(uint *, char *, int)gdk_mbstowcs;
+extern (C) char * function(uint *)gdk_wcstombs;
+extern (C) uint function()gdk_rectangle_get_type;
+extern (C) void function(_GdkRectangle *, _GdkRectangle *, _GdkRectangle *)gdk_rectangle_union;
+extern (C) int function(_GdkRectangle *, _GdkRectangle *, _GdkRectangle *)gdk_rectangle_intersect;
+extern (C) void function(uint)gdk_set_double_click_time;
+extern (C) void function()gdk_flush;
+extern (C) void function()gdk_beep;
+extern (C) int function()gdk_screen_height_mm;
+extern (C) int function()gdk_screen_width_mm;
+extern (C) int function()gdk_screen_height;
+extern (C) int function()gdk_screen_width;
+extern (C) int function()gdk_pointer_is_grabbed;
+extern (C) void function(uint)gdk_keyboard_ungrab;
+extern (C) void function(uint)gdk_pointer_ungrab;
+extern (C) int function(_GdkDisplay *, _GdkDrawable * *, int *)gdk_keyboard_grab_info_libgtk_only;
+extern (C) int function(_GdkDisplay *, _GdkDrawable * *, int *)gdk_pointer_grab_info_libgtk_only;
+extern (C) int function(_GdkDrawable *, int, uint)gdk_keyboard_grab;
+extern (C) int function(_GdkDrawable *, int, int, _GdkDrawable *, _GdkCursor *, uint)gdk_pointer_grab;
+extern (C) void function(int)gdk_input_remove;
+extern (C) int function(int, int, _BCD_func__4635, void *)gdk_input_add;
+extern (C) int function(int, int, _BCD_func__4635, void *, _BCD_func__4634)gdk_input_add_full;
+extern (C) char * function()gdk_get_display_arg_name;
+extern (C) char * function()gdk_get_display;
+extern (C) int function()gdk_get_use_xshm;
+extern (C) void function(int)gdk_set_use_xshm;
+extern (C) int function()gdk_error_trap_pop;
+extern (C) void function()gdk_error_trap_push;
+extern (C) void function(char *)gdk_set_program_class;
+extern (C) char * function()gdk_get_program_class;
+extern (C) char * function()gdk_set_locale;
+extern (C) void function(int)gdk_exit;
+extern (C) void function()gdk_pre_parse_libgtk_only;
+extern (C) void function(void *)gdk_add_option_entries_libgtk_only;
+extern (C) int function(int *, char * * *)gdk_init_check;
+extern (C) void function(int *, char * * *)gdk_init;
+extern (C) void function(int *, char * * *)gdk_parse_args;
+extern (C) _GdkDrawable * function()gdk_get_default_root_window;
+extern (C) _GdkPointerHooks * function(_GdkPointerHooks *)gdk_set_pointer_hooks;
+extern (C) void function(_GdkDrawable *)gdk_window_configure_finished;
+extern (C) void function(_GdkDrawable *)gdk_window_enable_synchronized_configure;
+extern (C) void function(_GdkDrawable *, _GdkDrawable * *, int *, int *)gdk_window_get_internal_paint_info;
+extern (C) void function(_GdkGeometry *, uint, int, int, int *, int *)gdk_window_constrain_size;
+extern (C) void function(int)gdk_window_set_debug_updates;
+extern (C) void function(_GdkDrawable *, int)gdk_window_process_updates;
+extern (C) void function()gdk_window_process_all_updates;
+extern (C) void function(_GdkDrawable *)gdk_window_thaw_toplevel_updates_libgtk_only;
+extern (C) void function(_GdkDrawable *)gdk_window_freeze_toplevel_updates_libgtk_only;
+extern (C) void function(_GdkDrawable *)gdk_window_thaw_updates;
+extern (C) void function(_GdkDrawable *)gdk_window_freeze_updates;
+extern (C) void * function(_GdkDrawable *)gdk_window_get_update_area;
+extern (C) void function(_GdkDrawable *, void *, _BCD_func__6008, void *)gdk_window_invalidate_maybe_recurse;
+extern (C) void function(_GdkDrawable *, void *, int)gdk_window_invalidate_region;
+extern (C) void function(_GdkDrawable *, _GdkRectangle *, int)gdk_window_invalidate_rect;
+extern (C) void function(_GdkDrawable *, int, int, int, uint)gdk_window_begin_move_drag;
+extern (C) void function(_GdkDrawable *, int, int, int, int, uint)gdk_window_begin_resize_drag;
+extern (C) void function(_GdkDrawable *)gdk_window_register_dnd;
+extern (C) void function(_GdkDrawable *, double)gdk_window_set_opacity;
+extern (C) void function(_GdkDrawable *, int)gdk_window_set_keep_below;
+extern (C) void function(_GdkDrawable *, int)gdk_window_set_keep_above;
+extern (C) void function(_GdkDrawable *)gdk_window_unfullscreen;
+extern (C) void function(_GdkDrawable *)gdk_window_fullscreen;
+extern (C) void function(_GdkDrawable *)gdk_window_unmaximize;
+extern (C) void function(_GdkDrawable *)gdk_window_maximize;
+extern (C) void function(_GdkDrawable *)gdk_window_unstick;
+extern (C) void function(_GdkDrawable *)gdk_window_stick;
+extern (C) void function(_GdkDrawable *)gdk_window_deiconify;
+extern (C) void function(_GdkDrawable *)gdk_window_iconify;
+extern (C) void function(_GdkDrawable *)gdk_window_beep;
+extern (C) _GList * function()gdk_window_get_toplevels;
+extern (C) void function(_GdkDrawable *, int)gdk_window_set_functions;
+extern (C) int function(_GdkDrawable *, int *)gdk_window_get_decorations;
+extern (C) void function(_GdkDrawable *, int)gdk_window_set_decorations;
+extern (C) _GdkDrawable * function(_GdkDrawable *)gdk_window_get_group;
+extern (C) void function(_GdkDrawable *, _GdkDrawable *)gdk_window_set_group;
+extern (C) void function(_GdkDrawable *, char *)gdk_window_set_icon_name;
+extern (C) void function(_GdkDrawable *, _GdkDrawable *, _GdkDrawable *, _GdkDrawable *)gdk_window_set_icon;
+extern (C) void function(_GdkDrawable *, _GList *)gdk_window_set_icon_list;
+extern (C) void function(_GdkDrawable *, int)gdk_window_set_events;
+extern (C) int function(_GdkDrawable *)gdk_window_get_events;
+extern (C) _GList * function(_GdkDrawable *)gdk_window_peek_children;
+extern (C) _GList * function(_GdkDrawable *)gdk_window_get_children;
+extern (C) _GdkDrawable * function(_GdkDrawable *)gdk_window_get_toplevel;
+extern (C) _GdkDrawable * function(_GdkDrawable *)gdk_window_get_parent;
+extern (C) _GdkDrawable * function(_GdkDrawable *, int *, int *, int *)gdk_window_get_pointer;
+extern (C) void function(_GdkDrawable *, _GdkRectangle *)gdk_window_get_frame_extents;
+extern (C) void function(_GdkDrawable *, int *, int *)gdk_window_get_root_origin;
+extern (C) int function(_GdkDrawable *, int *, int *)gdk_window_get_deskrelative_origin;
+extern (C) int function(_GdkDrawable *, int *, int *)gdk_window_get_origin;
+extern (C) void function(_GdkDrawable *, int *, int *)gdk_window_get_position;
+extern (C) void function(_GdkDrawable *, int *, int *, int *, int *, int *)gdk_window_get_geometry;
+extern (C) void function(_GdkDrawable *, void * *)gdk_window_get_user_data;
+extern (C) void function(_GdkDrawable *, _GdkCursor *)gdk_window_set_cursor;
+extern (C) void function(_GdkDrawable *, _GdkDrawable *, int)gdk_window_set_back_pixmap;
+extern (C) void function(_GdkDrawable *, _GdkColor *)gdk_window_set_background;
+extern (C) void function(_GdkDrawable *, _GdkDrawable *)gdk_window_set_transient_for;
+extern (C) void function(_GdkDrawable *, char *)gdk_window_set_startup_id;
+extern (C) void function(_GdkDrawable *, char *)gdk_window_set_role;
+extern (C) void function(_GdkDrawable *, char *)gdk_window_set_title;
+extern (C) void function(_GdkDrawable *)gdk_window_end_paint;
+extern (C) void function(_GdkDrawable *, void *)gdk_window_begin_paint_region;
+extern (C) void function(_GdkDrawable *, _GdkRectangle *)gdk_window_begin_paint_rect;
+extern (C) void function(char *)gdk_set_sm_client_id;
+extern (C) void function(_GdkDrawable *, _GdkGeometry *, int)gdk_window_set_geometry_hints;
+extern (C) void function(_GdkDrawable *, int)gdk_window_set_urgency_hint;
+extern (C) void function(_GdkDrawable *, int)gdk_window_set_skip_pager_hint;
+extern (C) void function(_GdkDrawable *, int)gdk_window_set_skip_taskbar_hint;
+extern (C) void function(_GdkDrawable *, int)gdk_window_set_modal_hint;
+extern (C) int function(_GdkDrawable *)gdk_window_get_type_hint;
+extern (C) void function(_GdkDrawable *, int)gdk_window_set_type_hint;
+extern (C) void function(_GdkDrawable *, int, int, int, int, int, int, int)gdk_window_set_hints;
+extern (C) _GdkDrawable * function(_GdkDisplay *, uint)gdk_window_lookup_for_display;
+extern (C) _GdkDrawable * function(_GdkDisplay *, uint)gdk_window_foreign_new_for_display;
+extern (C) _GdkDrawable * function(uint)gdk_window_lookup;
+extern (C) _GdkDrawable * function(uint)gdk_window_foreign_new;
+extern (C) int function(_GdkDrawable *, int)gdk_window_set_static_gravities;
+extern (C) int function(_GdkDrawable *)gdk_window_get_state;
+extern (C) int function(_GdkDrawable *)gdk_window_is_viewable;
+extern (C) int function(_GdkDrawable *)gdk_window_is_visible;
+extern (C) void function(_GdkDrawable *)gdk_window_merge_child_input_shapes;
+extern (C) void function(_GdkDrawable *)gdk_window_set_child_input_shapes;
+extern (C) void function(_GdkDrawable *, void *, int, int)gdk_window_input_shape_combine_region;
+extern (C) void function(_GdkDrawable *, _GdkDrawable *, int, int)gdk_window_input_shape_combine_mask;
+extern (C) void function(_GdkDrawable *)gdk_window_merge_child_shapes;
+extern (C) void function(_GdkDrawable *, int)gdk_window_set_composited;
+extern (C) void function(_GdkDrawable *)gdk_window_set_child_shapes;
+extern (C) void function(_GdkDrawable *, void *, int, int)gdk_window_shape_combine_region;
+extern (C) void function(_GdkDrawable *, _GdkDrawable *, int, int)gdk_window_shape_combine_mask;
+extern (C) void function(_GdkDrawable *, void *, int, int)gdk_window_move_region;
+extern (C) void function(_GdkDrawable *, int, int)gdk_window_scroll;
+extern (C) void function(_GdkDrawable *, _BCD_func__4335, void *)gdk_window_remove_filter;
+extern (C) void function(_GdkDrawable *, _BCD_func__4335, void *)gdk_window_add_filter;
+extern (C) void function(_GdkDrawable *, int)gdk_window_set_focus_on_map;
+extern (C) void function(_GdkDrawable *, int)gdk_window_set_accept_focus;
+extern (C) void function(_GdkDrawable *, int)gdk_window_set_override_redirect;
+extern (C) void function(_GdkDrawable *, void *)gdk_window_set_user_data;
+extern (C) void function(_GdkDrawable *, uint)gdk_window_focus;
+extern (C) void function(_GdkDrawable *)gdk_window_lower;
+extern (C) void function(_GdkDrawable *)gdk_window_raise;
+extern (C) void function(_GdkDrawable *, int, int, int, int)gdk_window_clear_area_e;
+extern (C) void function(_GdkDrawable *, int, int, int, int)gdk_window_clear_area;
+extern (C) void function(_GdkDrawable *)gdk_window_clear;
+extern (C) void function(_GdkDrawable *, _GdkDrawable *, int, int)gdk_window_reparent;
+extern (C) void function(_GdkDrawable *, int, int, int, int)gdk_window_move_resize;
+extern (C) void function(_GdkDrawable *, int, int)gdk_window_resize;
+extern (C) void function(_GdkDrawable *, int, int)gdk_window_move;
+extern (C) void function(_GdkDrawable *)gdk_window_show_unraised;
+extern (C) void function(_GdkDrawable *)gdk_window_withdraw;
+extern (C) void function(_GdkDrawable *)gdk_window_hide;
+extern (C) void function(_GdkDrawable *)gdk_window_show;
+extern (C) _GdkDrawable * function(int *, int *)gdk_window_at_pointer;
+extern (C) int function(_GdkDrawable *)gdk_window_get_window_type;
+extern (C) void function(_GdkDrawable *)gdk_window_destroy;
+extern (C) _GdkDrawable * function(_GdkDrawable *, _GdkWindowAttr *, int)gdk_window_new;
+extern (C) uint function()gdk_window_object_get_type;
+extern (C) _GdkScreen * function(_GdkVisual *)gdk_visual_get_screen;
+extern (C) _GList * function()gdk_list_visuals;
+extern (C) void function(int * *, int *)gdk_query_visual_types;
+extern (C) void function(int * *, int *)gdk_query_depths;
+extern (C) _GdkVisual * function(int, int)gdk_visual_get_best_with_both;
+extern (C) _GdkVisual * function(int)gdk_visual_get_best_with_type;
+extern (C) _GdkVisual * function(int)gdk_visual_get_best_with_depth;
+extern (C) _GdkVisual * function()gdk_visual_get_best;
+extern (C) _GdkVisual * function()gdk_visual_get_system;
+extern (C) int function()gdk_visual_get_best_type;
+extern (C) int function()gdk_visual_get_best_depth;
+extern (C) uint function()gdk_visual_get_type;
+extern (C) int function(_GdkScreen *, char *, _GError * *)gdk_spawn_command_line_on_screen;
+extern (C) int function(_GdkScreen *, char *, char * *, char * *, int, _BCD_func__4634, void *, int *, int *, int *, int *, _GError * *)gdk_spawn_on_screen_with_pipes;
+extern (C) int function(_GdkScreen *, char *, char * *, char * *, int, _BCD_func__4634, void *, int *, _GError * *)gdk_spawn_on_screen;
+extern (C) void function(_GdkDisplay *, uint, void *, void *, void *, uint)gdk_selection_send_notify_for_display;
+extern (C) void function(uint, void *, void *, void *, uint)gdk_selection_send_notify;
+extern (C) int function(_GdkDrawable *, char * *, void * *, int *)gdk_selection_property_get;
+extern (C) void function(_GdkDrawable *, void *, void *, uint)gdk_selection_convert;
+extern (C) _GdkDrawable * function(_GdkDisplay *, void *)gdk_selection_owner_get_for_display;
+extern (C) int function(_GdkDisplay *, _GdkDrawable *, void *, uint, int)gdk_selection_owner_set_for_display;
+extern (C) _GdkDrawable * function(void *)gdk_selection_owner_get;
+extern (C) int function(_GdkDrawable *, void *, uint, int)gdk_selection_owner_set;
+extern (C) _GList * function(_GdkScreen *)gdk_screen_get_window_stack;
+extern (C) _GdkDrawable * function(_GdkScreen *)gdk_screen_get_active_window;
+extern (C) double function(_GdkScreen *)gdk_screen_get_resolution;
+extern (C) void function(_GdkScreen *, double)gdk_screen_set_resolution;
+extern (C) void * function(_GdkScreen *)gdk_screen_get_font_options;
+extern (C) void function(_GdkScreen *, void *)gdk_screen_set_font_options;
+extern (C) int function(_GdkScreen *, char *, _GValue *)gdk_screen_get_setting;
+extern (C) _GdkScreen * function()gdk_screen_get_default;
+extern (C) void function(_GdkScreen *, _GdkEvent *)gdk_screen_broadcast_client_message;
+extern (C) int function(_GdkScreen *, _GdkDrawable *)gdk_screen_get_monitor_at_window;
+extern (C) int function(_GdkScreen *, int, int)gdk_screen_get_monitor_at_point;
+extern (C) void function(_GdkScreen *, int, _GdkRectangle *)gdk_screen_get_monitor_geometry;
+extern (C) int function(_GdkScreen *)gdk_screen_get_n_monitors;
+extern (C) char * function(_GdkScreen *)gdk_screen_make_display_name;
+extern (C) _GList * function(_GdkScreen *)gdk_screen_get_toplevel_windows;
+extern (C) _GList * function(_GdkScreen *)gdk_screen_list_visuals;
+extern (C) int function(_GdkScreen *)gdk_screen_get_height_mm;
+extern (C) int function(_GdkScreen *)gdk_screen_get_width_mm;
+extern (C) int function(_GdkScreen *)gdk_screen_get_height;
+extern (C) int function(_GdkScreen *)gdk_screen_get_width;
+extern (C) int function(_GdkScreen *)gdk_screen_get_number;
+extern (C) _GdkDisplay * function(_GdkScreen *)gdk_screen_get_display;
+extern (C) _GdkDrawable * function(_GdkScreen *)gdk_screen_get_root_window;
+extern (C) int function(_GdkScreen *)gdk_screen_is_composited;
+extern (C) _GdkVisual * function(_GdkScreen *)gdk_screen_get_rgba_visual;
+extern (C) _GdkColormap * function(_GdkScreen *)gdk_screen_get_rgba_colormap;
+extern (C) _GdkVisual * function(_GdkScreen *)gdk_screen_get_rgb_visual;
+extern (C) _GdkColormap * function(_GdkScreen *)gdk_screen_get_rgb_colormap;
+extern (C) _GdkVisual * function(_GdkScreen *)gdk_screen_get_system_visual;
+extern (C) _GdkColormap * function(_GdkScreen *)gdk_screen_get_system_colormap;
+extern (C) void function(_GdkScreen *, _GdkColormap *)gdk_screen_set_default_colormap;
+extern (C) _GdkColormap * function(_GdkScreen *)gdk_screen_get_default_colormap;
+extern (C) uint function()gdk_screen_get_type;
+extern (C) void function(void *, _GdkSpan *, int, int, _BCD_func__4157, void *)gdk_region_spans_intersect_foreach;
+extern (C) void function(void *, void *)gdk_region_xor;
+extern (C) void function(void *, void *)gdk_region_subtract;
+extern (C) void function(void *, void *)gdk_region_union;
+extern (C) void function(void *, void *)gdk_region_intersect;
+extern (C) void function(void *, _GdkRectangle *)gdk_region_union_with_rect;
+extern (C) void function(void *, int, int)gdk_region_shrink;
+extern (C) void function(void *, int, int)gdk_region_offset;
+extern (C) int function(void *, _GdkRectangle *)gdk_region_rect_in;
+extern (C) int function(void *, int, int)gdk_region_point_in;
+extern (C) int function(void *, void *)gdk_region_equal;
+extern (C) int function(void *)gdk_region_empty;
+extern (C) void function(void *, _GdkRectangle * *, int *)gdk_region_get_rectangles;
+extern (C) void function(void *, _GdkRectangle *)gdk_region_get_clipbox;
+extern (C) void function(void *)gdk_region_destroy;
+extern (C) void * function(_GdkRectangle *)gdk_region_rectangle;
+extern (C) void * function(void *)gdk_region_copy;
+extern (C) void * function(_GdkPoint *, int, int)gdk_region_polygon;
+extern (C) void * function()gdk_region_new;
+extern (C) void function(char *)gdk_free_compound_text;
+extern (C) void function(char * *)gdk_free_text_list;
+extern (C) int function(_GdkDisplay *, char *, void * *, int *, char * *, int *)gdk_utf8_to_compound_text_for_display;
+extern (C) int function(_GdkDisplay *, char *, void * *, int *, char * *, int *)gdk_string_to_compound_text_for_display;
+extern (C) char * function(char *)gdk_utf8_to_string_target;
+extern (C) int function(_GdkDisplay *, void *, int, char *, int, char * * *)gdk_text_property_to_utf8_list_for_display;
+extern (C) int function(_GdkDisplay *, void *, int, char *, int, char * * *)gdk_text_property_to_text_list_for_display;
+extern (C) int function(char *, void * *, int *, char * *, int *)gdk_string_to_compound_text;
+extern (C) int function(char *, void * *, int *, char * *, int *)gdk_utf8_to_compound_text;
+extern (C) int function(void *, int, char *, int, char * * *)gdk_text_property_to_utf8_list;
+extern (C) int function(void *, int, char *, int, char * * *)gdk_text_property_to_text_list;
+extern (C) void function(_GdkDrawable *, void *)gdk_property_delete;
+extern (C) void function(_GdkDrawable *, void *, void *, int, int, char *, int)gdk_property_change;
+extern (C) int function(_GdkDrawable *, void *, void *, uint, uint, int, void * *, int *, int *, char * *)gdk_property_get;
+extern (C) char * function(void *)gdk_atom_name;
+extern (C) void * function(char *)gdk_atom_intern_static_string;
+extern (C) void * function(char *, int)gdk_atom_intern;
+extern (C) _GdkDrawable * function(_GdkScreen *, uint, int, int, int)gdk_pixmap_foreign_new_for_screen;
+extern (C) _GdkDrawable * function(_GdkDisplay *, uint)gdk_pixmap_lookup_for_display;
+extern (C) _GdkDrawable * function(_GdkDisplay *, uint)gdk_pixmap_foreign_new_for_display;
+extern (C) _GdkDrawable * function(uint)gdk_pixmap_lookup;
+extern (C) _GdkDrawable * function(uint)gdk_pixmap_foreign_new;
+extern (C) _GdkDrawable * function(_GdkDrawable *, _GdkColormap *, _GdkDrawable * *, _GdkColor *, char * *)gdk_pixmap_colormap_create_from_xpm_d;
+extern (C) _GdkDrawable * function(_GdkDrawable *, _GdkDrawable * *, _GdkColor *, char * *)gdk_pixmap_create_from_xpm_d;
+extern (C) _GdkDrawable * function(_GdkDrawable *, _GdkColormap *, _GdkDrawable * *, _GdkColor *, char *)gdk_pixmap_colormap_create_from_xpm;
+extern (C) _GdkDrawable * function(_GdkDrawable *, _GdkDrawable * *, _GdkColor *, char *)gdk_pixmap_create_from_xpm;
+extern (C) _GdkDrawable * function(_GdkDrawable *, char *, int, int, int, _GdkColor *, _GdkColor *)gdk_pixmap_create_from_data;
+extern (C) _GdkDrawable * function(_GdkDrawable *, char *, int, int)gdk_bitmap_create_from_data;
+extern (C) _GdkDrawable * function(_GdkDrawable *, int, int, int)gdk_pixmap_new;
+extern (C) uint function()gdk_pixmap_get_type;
+extern (C) _PangoAttribute * function(_GdkColor *)gdk_pango_attr_emboss_color_new;
+extern (C) _PangoAttribute * function(int)gdk_pango_attr_embossed_new;
+extern (C) _PangoAttribute * function(_GdkDrawable *)gdk_pango_attr_stipple_new;
+extern (C) void * function(void *, int, int, int *, int)gdk_pango_layout_get_clip_region;
+extern (C) void * function(_PangoLayoutLine *, int, int, int *, int)gdk_pango_layout_line_get_clip_region;
+extern (C) void function(void *, _GdkColormap *)gdk_pango_context_set_colormap;
+extern (C) void * function()gdk_pango_context_get;
+extern (C) void * function(_GdkScreen *)gdk_pango_context_get_for_screen;
+extern (C) void function(_GdkPangoRenderer *, int, _GdkColor *)gdk_pango_renderer_set_override_color;
+extern (C) void function(_GdkPangoRenderer *, int, _GdkDrawable *)gdk_pango_renderer_set_stipple;
+extern (C) void function(_GdkPangoRenderer *, _GdkGC *)gdk_pango_renderer_set_gc;
+extern (C) void function(_GdkPangoRenderer *, _GdkDrawable *)gdk_pango_renderer_set_drawable;
+extern (C) _PangoRenderer * function(_GdkScreen *)gdk_pango_renderer_get_default;
+extern (C) _PangoRenderer * function(_GdkScreen *)gdk_pango_renderer_new;
+extern (C) uint function()gdk_pango_renderer_get_type;
+extern (C) _GSList * function(void *)gdk_display_manager_list_displays;
+extern (C) void function(void *, _GdkDisplay *)gdk_display_manager_set_default_display;
+extern (C) _GdkDisplay * function(void *)gdk_display_manager_get_default_display;
+extern (C) void * function()gdk_display_manager_get;
+extern (C) uint function()gdk_display_manager_get_type;
+extern (C) uint function(uint)gdk_unicode_to_keyval;
+extern (C) uint function(uint)gdk_keyval_to_unicode;
+extern (C) int function(uint)gdk_keyval_is_lower;
+extern (C) int function(uint)gdk_keyval_is_upper;
+extern (C) uint function(uint)gdk_keyval_to_lower;
+extern (C) uint function(uint)gdk_keyval_to_upper;
+extern (C) void function(uint, uint *, uint *)gdk_keyval_convert_case;
+extern (C) uint function(char *)gdk_keyval_from_name;
+extern (C) char * function(uint)gdk_keyval_name;
+extern (C) int function(_GdkKeymap *)gdk_keymap_have_bidi_layouts;
+extern (C) int function(_GdkKeymap *)gdk_keymap_get_direction;
+extern (C) int function(_GdkKeymap *, uint, _GdkKeymapKey * *, uint * *, int *)gdk_keymap_get_entries_for_keycode;
+extern (C) int function(_GdkKeymap *, uint, _GdkKeymapKey * *, int *)gdk_keymap_get_entries_for_keyval;
+extern (C) int function(_GdkKeymap *, uint, int, int, uint *, int *, int *, int *)gdk_keymap_translate_keyboard_state;
+extern (C) uint function(_GdkKeymap *, _GdkKeymapKey *)gdk_keymap_lookup_key;
+extern (C) _GdkKeymap * function(_GdkDisplay *)gdk_keymap_get_for_display;
+extern (C) _GdkKeymap * function()gdk_keymap_get_default;
+extern (C) uint function()gdk_keymap_get_type;
+extern (C) _GdkColormap * function(_GdkImage *)gdk_image_get_colormap;
+extern (C) void function(_GdkImage *, _GdkColormap *)gdk_image_set_colormap;
+extern (C) uint function(_GdkImage *, int, int)gdk_image_get_pixel;
+extern (C) void function(_GdkImage *, int, int, uint)gdk_image_put_pixel;
+extern (C) void function(_GdkImage *)gdk_image_unref;
+extern (C) _GdkImage * function(_GdkImage *)gdk_image_ref;
+extern (C) _GdkImage * function(_GdkDrawable *, int, int, int, int)gdk_image_get;
+extern (C) _GdkImage * function(int, _GdkVisual *, int, int)gdk_image_new;
+extern (C) uint function()gdk_image_get_type;
+extern (C) _GdkDisplay * function(_GdkFont *)gdk_font_get_display;
+extern (C) void function(_GdkFont *, char *, int *, int *, int *, int *, int *)gdk_string_extents;
+extern (C) void function(_GdkFont *, uint *, int, int *, int *, int *, int *, int *)gdk_text_extents_wc;
+extern (C) void function(_GdkFont *, char *, int, int *, int *, int *, int *, int *)gdk_text_extents;
+extern (C) int function(_GdkFont *, char)gdk_char_height;
+extern (C) int function(_GdkFont *, char *, int)gdk_text_height;
+extern (C) int function(_GdkFont *, char *)gdk_string_height;
+extern (C) int function(_GdkFont *, char)gdk_char_measure;
+extern (C) int function(_GdkFont *, char *, int)gdk_text_measure;
+extern (C) int function(_GdkFont *, char *)gdk_string_measure;
+extern (C) int function(_GdkFont *, uint)gdk_char_width_wc;
+extern (C) int function(_GdkFont *, char)gdk_char_width;
+extern (C) int function(_GdkFont *, uint *, int)gdk_text_width_wc;
+extern (C) int function(_GdkFont *, char *, int)gdk_text_width;
+extern (C) int function(_GdkFont *, char *)gdk_string_width;
+extern (C) _GdkFont * function(void *)gdk_font_from_description;
+extern (C) _GdkFont * function(char *)gdk_fontset_load;
+extern (C) _GdkFont * function(char *)gdk_font_load;
+extern (C) _GdkFont * function(_GdkDisplay *, void *)gdk_font_from_description_for_display;
+extern (C) _GdkFont * function(_GdkDisplay *, char *)gdk_fontset_load_for_display;
+extern (C) _GdkFont * function(_GdkDisplay *, char *)gdk_font_load_for_display;
+extern (C) int function(_GdkFont *, _GdkFont *)gdk_font_equal;
+extern (C) int function(_GdkFont *)gdk_font_id;
+extern (C) void function(_GdkFont *)gdk_font_unref;
+extern (C) _GdkFont * function(_GdkFont *)gdk_font_ref;
+extern (C) uint function()gdk_font_get_type;
+extern (C) uint function()gdk_window_edge_get_type;
+extern (C) uint function()gdk_gravity_get_type;
+extern (C) uint function()gdk_wm_function_get_type;
+extern (C) uint function()gdk_wm_decoration_get_type;
+extern (C) uint function()gdk_window_type_hint_get_type;
+extern (C) uint function()gdk_window_hints_get_type;
+extern (C) uint function()gdk_window_attributes_type_get_type;
+extern (C) uint function()gdk_window_type_get_type;
+extern (C) uint function()gdk_window_class_get_type;
+extern (C) uint function()gdk_visual_type_get_type;
+extern (C) uint function()gdk_grab_status_get_type;
+extern (C) uint function()gdk_status_get_type;
+extern (C) uint function()gdk_input_condition_get_type;
+extern (C) uint function()gdk_modifier_type_get_type;
+extern (C) uint function()gdk_byte_order_get_type;
+extern (C) uint function()gdk_rgb_dither_get_type;
+extern (C) uint function()gdk_overlap_type_get_type;
+extern (C) uint function()gdk_fill_rule_get_type;
+extern (C) uint function()gdk_prop_mode_get_type;
+extern (C) uint function()gdk_axis_use_get_type;
+extern (C) uint function()gdk_input_mode_get_type;
+extern (C) uint function()gdk_input_source_get_type;
+extern (C) uint function()gdk_extension_mode_get_type;
+extern (C) uint function()gdk_image_type_get_type;
+extern (C) uint function()gdk_gc_values_mask_get_type;
+extern (C) uint function()gdk_subwindow_mode_get_type;
+extern (C) uint function()gdk_line_style_get_type;
+extern (C) uint function()gdk_join_style_get_type;
+extern (C) uint function()gdk_function_get_type;
+extern (C) uint function()gdk_fill_get_type;
+extern (C) uint function()gdk_cap_style_get_type;
+extern (C) uint function()gdk_font_type_get_type;
+extern (C) uint function()gdk_owner_change_get_type;
+extern (C) uint function()gdk_setting_action_get_type;
+extern (C) uint function()gdk_window_state_get_type;
+extern (C) uint function()gdk_property_state_get_type;
+extern (C) uint function()gdk_crossing_mode_get_type;
+extern (C) uint function()gdk_notify_type_get_type;
+extern (C) uint function()gdk_scroll_direction_get_type;
+extern (C) uint function()gdk_visibility_state_get_type;
+extern (C) uint function()gdk_event_mask_get_type;
+extern (C) uint function()gdk_event_type_get_type;
+extern (C) uint function()gdk_filter_return_get_type;
+extern (C) uint function()gdk_drag_protocol_get_type;
+extern (C) uint function()gdk_drag_action_get_type;
+extern (C) uint function()gdk_cursor_type_get_type;
+extern (C) void * function(_GdkDrawable *)gdk_drawable_get_visible_region;
+extern (C) void * function(_GdkDrawable *)gdk_drawable_get_clip_region;
+extern (C) _GdkImage * function(_GdkDrawable *, _GdkImage *, int, int, int, int, int, int)gdk_drawable_copy_to_image;
+extern (C) _GdkImage * function(_GdkDrawable *, int, int, int, int)gdk_drawable_get_image;
+extern (C) void function(_GdkDrawable *, _GdkGC *, _GdkTrapezoid *, int)gdk_draw_trapezoids;
+extern (C) void function(_GdkDrawable *, _GdkGC *, _PangoMatrix *, void *, int, int, _PangoGlyphString *)gdk_draw_glyphs_transformed;
+extern (C) void function(_GdkDrawable *, _GdkGC *, int, int, void *, _GdkColor *, _GdkColor *)gdk_draw_layout_with_colors;
+extern (C) void function(_GdkDrawable *, _GdkGC *, int, int, _PangoLayoutLine *, _GdkColor *, _GdkColor *)gdk_draw_layout_line_with_colors;
+extern (C) void function(_GdkDrawable *, _GdkGC *, int, int, void *)gdk_draw_layout;
+extern (C) void function(_GdkDrawable *, _GdkGC *, int, int, _PangoLayoutLine *)gdk_draw_layout_line;
+extern (C) void function(_GdkDrawable *, _GdkGC *, void *, int, int, _PangoGlyphString *)gdk_draw_glyphs;
+extern (C) void function(_GdkDrawable *, _GdkGC *, void *, int, int, int, int, int, int, int, int, int)gdk_draw_pixbuf;
+extern (C) void function(_GdkDrawable *, _GdkGC *, _GdkPoint *, int)gdk_draw_lines;
+extern (C) void function(_GdkDrawable *, _GdkGC *, _GdkSegment *, int)gdk_draw_segments;
+extern (C) void function(_GdkDrawable *, _GdkGC *, _GdkPoint *, int)gdk_draw_points;
+extern (C) void function(_GdkDrawable *, _GdkGC *, _GdkImage *, int, int, int, int, int, int)gdk_draw_image;
+extern (C) void function(_GdkDrawable *, _GdkGC *, _GdkDrawable *, int, int, int, int, int, int)gdk_draw_drawable;
+extern (C) void function(_GdkDrawable *, _GdkFont *, _GdkGC *, int, int, uint *, int)gdk_draw_text_wc;
+extern (C) void function(_GdkDrawable *, _GdkFont *, _GdkGC *, int, int, char *, int)gdk_draw_text;
+extern (C) void function(_GdkDrawable *, _GdkFont *, _GdkGC *, int, int, char *)gdk_draw_string;
+extern (C) void function(_GdkDrawable *, _GdkGC *, int, _GdkPoint *, int)gdk_draw_polygon;
+extern (C) void function(_GdkDrawable *, _GdkGC *, int, int, int, int, int, int, int)gdk_draw_arc;
+extern (C) void function(_GdkDrawable *, _GdkGC *, int, int, int, int, int)gdk_draw_rectangle;
+extern (C) void function(_GdkDrawable *, _GdkGC *, int, int, int, int)gdk_draw_line;
+extern (C) void function(_GdkDrawable *, _GdkGC *, int, int)gdk_draw_point;
+extern (C) void function(_GdkDrawable *)gdk_drawable_unref;
+extern (C) _GdkDrawable * function(_GdkDrawable *)gdk_drawable_ref;
+extern (C) _GdkDisplay * function(_GdkDrawable *)gdk_drawable_get_display;
+extern (C) _GdkScreen * function(_GdkDrawable *)gdk_drawable_get_screen;
+extern (C) int function(_GdkDrawable *)gdk_drawable_get_depth;
+extern (C) _GdkVisual * function(_GdkDrawable *)gdk_drawable_get_visual;
+extern (C) _GdkColormap * function(_GdkDrawable *)gdk_drawable_get_colormap;
+extern (C) void function(_GdkDrawable *, _GdkColormap *)gdk_drawable_set_colormap;
+extern (C) void function(_GdkDrawable *, int *, int *)gdk_drawable_get_size;
+extern (C) void * function(_GdkDrawable *, char *)gdk_drawable_get_data;
+extern (C) void function(_GdkDrawable *, char *, void *, _BCD_func__4634)gdk_drawable_set_data;
+extern (C) uint function()gdk_drawable_get_type;
+extern (C) _GdkScreen * function(_GdkGC *)gdk_gc_get_screen;
+extern (C) void function(_GdkGC *, _GdkColor *)gdk_gc_set_rgb_bg_color;
+extern (C) void function(_GdkGC *, _GdkColor *)gdk_gc_set_rgb_fg_color;
+extern (C) _GdkColormap * function(_GdkGC *)gdk_gc_get_colormap;
+extern (C) void function(_GdkGC *, _GdkColormap *)gdk_gc_set_colormap;
+extern (C) void function(_GdkGC *, _GdkGC *)gdk_gc_copy;
+extern (C) void function(_GdkGC *, int, int)gdk_gc_offset;
+extern (C) void function(_GdkGC *, int, char *, int)gdk_gc_set_dashes;
+extern (C) void function(_GdkGC *, int, int, int, int)gdk_gc_set_line_attributes;
+extern (C) void function(_GdkGC *, int)gdk_gc_set_exposures;
+extern (C) void function(_GdkGC *, int)gdk_gc_set_subwindow;
+extern (C) void function(_GdkGC *, void *)gdk_gc_set_clip_region;
+extern (C) void function(_GdkGC *, _GdkRectangle *)gdk_gc_set_clip_rectangle;
+extern (C) void function(_GdkGC *, _GdkDrawable *)gdk_gc_set_clip_mask;
+extern (C) void function(_GdkGC *, int, int)gdk_gc_set_clip_origin;
+extern (C) void function(_GdkGC *, int, int)gdk_gc_set_ts_origin;
+extern (C) void function(_GdkGC *, _GdkDrawable *)gdk_gc_set_stipple;
+extern (C) void function(_GdkGC *, _GdkDrawable *)gdk_gc_set_tile;
+extern (C) void function(_GdkGC *, int)gdk_gc_set_fill;
+extern (C) void function(_GdkGC *, int)gdk_gc_set_function;
+extern (C) void function(_GdkGC *, _GdkFont *)gdk_gc_set_font;
+extern (C) void function(_GdkGC *, _GdkColor *)gdk_gc_set_background;
+extern (C) void function(_GdkGC *, _GdkColor *)gdk_gc_set_foreground;
+extern (C) void function(_GdkGC *, _GdkGCValues *, int)gdk_gc_set_values;
+extern (C) void function(_GdkGC *, _GdkGCValues *)gdk_gc_get_values;
+extern (C) void function(_GdkGC *)gdk_gc_unref;
+extern (C) _GdkGC * function(_GdkGC *)gdk_gc_ref;
+extern (C) _GdkGC * function(_GdkDrawable *, _GdkGCValues *, int)gdk_gc_new_with_values;
+extern (C) _GdkGC * function(_GdkDrawable *)gdk_gc_new;
+extern (C) uint function()gdk_gc_get_type;
+extern (C) int function(_GdkDisplay *)gdk_display_supports_composite;
+extern (C) int function(_GdkDisplay *)gdk_display_supports_input_shapes;
+extern (C) int function(_GdkDisplay *)gdk_display_supports_shapes;
+extern (C) void function(_GdkDisplay *, _GdkDrawable *, uint, void * *, int)gdk_display_store_clipboard;
+extern (C) int function(_GdkDisplay *)gdk_display_supports_clipboard_persistence;
+extern (C) int function(_GdkDisplay *, void *)gdk_display_request_selection_notification;
+extern (C) int function(_GdkDisplay *)gdk_display_supports_selection_notification;
+extern (C) _GdkDrawable * function(_GdkDisplay *)gdk_display_get_default_group;
+extern (C) void function(_GdkDisplay *, uint *, uint *)gdk_display_get_maximal_cursor_size;
+extern (C) uint function(_GdkDisplay *)gdk_display_get_default_cursor_size;
+extern (C) int function(_GdkDisplay *)gdk_display_supports_cursor_color;
+extern (C) int function(_GdkDisplay *)gdk_display_supports_cursor_alpha;
+extern (C) _GdkDisplay * function()gdk_display_open_default_libgtk_only;
+extern (C) _GdkDisplayPointerHooks * function(_GdkDisplay *, _GdkDisplayPointerHooks *)gdk_display_set_pointer_hooks;
+extern (C) void function(_GdkDisplay *, _GdkScreen *, int, int)gdk_display_warp_pointer;
+extern (C) _GdkDrawable * function(_GdkDisplay *, int *, int *)gdk_display_get_window_at_pointer;
+extern (C) void function(_GdkDisplay *, _GdkScreen * *, int *, int *, int *)gdk_display_get_pointer;
+extern (C) _GdkDevice * function(_GdkDisplay *)gdk_display_get_core_pointer;
+extern (C) _GdkDisplay * function()gdk_display_get_default;
+extern (C) void function(_GdkDisplay *, uint)gdk_display_set_double_click_distance;
+extern (C) void function(_GdkDisplay *, uint)gdk_display_set_double_click_time;
+extern (C) void function(_GdkDisplay *, void *, _BCD_func__4335, void *)gdk_display_add_client_message_filter;
+extern (C) void function(_GdkDisplay *, _GdkEvent *)gdk_display_put_event;
+extern (C) _GdkEvent * function(_GdkDisplay *)gdk_display_peek_event;
+extern (C) _GdkEvent * function(_GdkDisplay *)gdk_display_get_event;
+extern (C) _GList * function(_GdkDisplay *)gdk_display_list_devices;
+extern (C) void function(_GdkDisplay *)gdk_display_close;
+extern (C) void function(_GdkDisplay *)gdk_display_flush;
+extern (C) void function(_GdkDisplay *)gdk_display_sync;
+extern (C) void function(_GdkDisplay *)gdk_display_beep;
+extern (C) int function(_GdkDisplay *)gdk_display_pointer_is_grabbed;
+extern (C) void function(_GdkDisplay *, uint)gdk_display_keyboard_ungrab;
+extern (C) void function(_GdkDisplay *, uint)gdk_display_pointer_ungrab;
+extern (C) _GdkScreen * function(_GdkDisplay *)gdk_display_get_default_screen;
+extern (C) _GdkScreen * function(_GdkDisplay *, int)gdk_display_get_screen;
+extern (C) int function(_GdkDisplay *)gdk_display_get_n_screens;
+extern (C) char * function(_GdkDisplay *)gdk_display_get_name;
+extern (C) _GdkDisplay * function(char *)gdk_display_open;
+extern (C) uint function()gdk_display_get_type;
+extern (C) int function(char *, _GValue *)gdk_setting_get;
+extern (C) void function(void *, _BCD_func__4335, void *)gdk_add_client_message_filter;
+extern (C) int function()gdk_get_show_events;
+extern (C) void function(int)gdk_set_show_events;
+extern (C) _GdkScreen * function(_GdkEvent *)gdk_event_get_screen;
+extern (C) void function(_GdkEvent *, _GdkScreen *)gdk_event_set_screen;
+extern (C) void function(_BCD_func__4336, void *, _BCD_func__4634)gdk_event_handler_set;
+extern (C) void function(_GdkEventMotion *)gdk_event_request_motions;
+extern (C) int function(_GdkEvent *, int, double *)gdk_event_get_axis;
+extern (C) int function(_GdkEvent *, double *, double *)gdk_event_get_root_coords;
+extern (C) int function(_GdkEvent *, double *, double *)gdk_event_get_coords;
+extern (C) int function(_GdkEvent *, int *)gdk_event_get_state;
+extern (C) uint function(_GdkEvent *)gdk_event_get_time;
+extern (C) void function(_GdkEvent *)gdk_event_free;
+extern (C) _GdkEvent * function(_GdkEvent *)gdk_event_copy;
+extern (C) _GdkEvent * function(int)gdk_event_new;
+extern (C) void function(_GdkEvent *)gdk_event_put;
+extern (C) _GdkEvent * function(_GdkDrawable *)gdk_event_get_graphics_expose;
+extern (C) _GdkEvent * function()gdk_event_peek;
+extern (C) _GdkEvent * function()gdk_event_get;
+extern (C) int function()gdk_events_pending;
+extern (C) uint function()gdk_event_get_type;
+extern (C) _GdkDevice * function()gdk_device_get_core_pointer;
+extern (C) void function(_GdkDrawable *, int, int)gdk_input_set_extension_events;
+extern (C) int function(_GdkDevice *, double *, int, double *)gdk_device_get_axis;
+extern (C) void function(_GdkTimeCoord * *, int)gdk_device_free_history;
+extern (C) int function(_GdkDevice *, _GdkDrawable *, uint, uint, _GdkTimeCoord * * *, int *)gdk_device_get_history;
+extern (C) void function(_GdkDevice *, _GdkDrawable *, double *, int *)gdk_device_get_state;
+extern (C) void function(_GdkDevice *, uint, int)gdk_device_set_axis_use;
+extern (C) void function(_GdkDevice *, uint, uint, int)gdk_device_set_key;
+extern (C) int function(_GdkDevice *, int)gdk_device_set_mode;
+extern (C) void function(_GdkDevice *, int)gdk_device_set_source;
+extern (C) _GList * function()gdk_devices_list;
+extern (C) uint function()gdk_device_get_type;
+extern (C) int function(_GdkDragContext *)gdk_drag_drop_succeeded;
+extern (C) void function(_GdkDragContext *, uint)gdk_drag_abort;
+extern (C) void function(_GdkDragContext *, uint)gdk_drag_drop;
+extern (C) int function(_GdkDragContext *, _GdkDrawable *, int, int, int, int, int, uint)gdk_drag_motion;
+extern (C) void function(_GdkDragContext *, _GdkDrawable *, int, int, _GdkDrawable * *, int *)gdk_drag_find_window;
+extern (C) uint function(uint, int *)gdk_drag_get_protocol;
+extern (C) void function(_GdkDragContext *, _GdkDrawable *, _GdkScreen *, int, int, _GdkDrawable * *, int *)gdk_drag_find_window_for_screen;
+extern (C) uint function(_GdkDisplay *, uint, int *)gdk_drag_get_protocol_for_display;
+extern (C) _GdkDragContext * function(_GdkDrawable *, _GList *)gdk_drag_begin;
+extern (C) void * function(_GdkDragContext *)gdk_drag_get_selection;
+extern (C) void function(_GdkDragContext *, int, uint)gdk_drop_finish;
+extern (C) void function(_GdkDragContext *, int, uint)gdk_drop_reply;
+extern (C) void function(_GdkDragContext *, int, uint)gdk_drag_status;
+extern (C) void function(_GdkDragContext *)gdk_drag_context_unref;
+extern (C) void function(_GdkDragContext *)gdk_drag_context_ref;
+extern (C) _GdkDragContext * function()gdk_drag_context_new;
+extern (C) uint function()gdk_drag_context_get_type;
+extern (C) void * function(_GdkCursor *)gdk_cursor_get_image;
+extern (C) _GdkCursor * function(_GdkDisplay *, char *)gdk_cursor_new_from_name;
+extern (C) void function(_GdkCursor *)gdk_cursor_unref;
+extern (C) _GdkCursor * function(_GdkCursor *)gdk_cursor_ref;
+extern (C) _GdkDisplay * function(_GdkCursor *)gdk_cursor_get_display;
+extern (C) _GdkCursor * function(_GdkDisplay *, void *, int, int)gdk_cursor_new_from_pixbuf;
+extern (C) _GdkCursor * function(_GdkDrawable *, _GdkDrawable *, _GdkColor *, _GdkColor *, int, int)gdk_cursor_new_from_pixmap;
+extern (C) _GdkCursor * function(int)gdk_cursor_new;
+extern (C) _GdkCursor * function(_GdkDisplay *, int)gdk_cursor_new_for_display;
+extern (C) uint function()gdk_cursor_get_type;
+extern (C) void function(void *, void *)gdk_cairo_region;
+extern (C) void function(void *, _GdkRectangle *)gdk_cairo_rectangle;
+extern (C) void function(void *, _GdkDrawable *, double, double)gdk_cairo_set_source_pixmap;
+extern (C) void function(void *, void *, double, double)gdk_cairo_set_source_pixbuf;
+extern (C) void function(void *, _GdkColor *)gdk_cairo_set_source_color;
+extern (C) void * function(_GdkDrawable *)gdk_cairo_create;
+extern (C) void * function(void *, _GdkImage *, _GdkColormap *, int, int, int, int, int, int)gdk_pixbuf_get_from_image;
+extern (C) void * function(void *, _GdkDrawable *, _GdkColormap *, int, int, int, int, int, int)gdk_pixbuf_get_from_drawable;
+extern (C) void function(void *, _GdkDrawable * *, _GdkDrawable * *, int)gdk_pixbuf_render_pixmap_and_mask;
+extern (C) void function(void *, _GdkColormap *, _GdkDrawable * *, _GdkDrawable * *, int)gdk_pixbuf_render_pixmap_and_mask_for_colormap;
+extern (C) void function(void *, _GdkDrawable *, int, int, int, int, int, int, int, int, int, int, int)gdk_pixbuf_render_to_drawable_alpha;
+extern (C) void function(void *, _GdkDrawable *, _GdkGC *, int, int, int, int, int, int, int, int, int)gdk_pixbuf_render_to_drawable;
+extern (C) void function(void *, _GdkDrawable *, int, int, int, int, int, int, int)gdk_pixbuf_render_threshold_alpha;
+extern (C) uint function()gdk_pixbuf_rotation_get_type;
+extern (C) uint function()gdk_interp_type_get_type;
+extern (C) uint function()gdk_pixbuf_error_get_type;
+extern (C) uint function()gdk_colorspace_get_type;
+extern (C) uint function()gdk_pixbuf_alpha_mode_get_type;
+extern (C) void * function(_GdkPixbufLoader *)gdk_pixbuf_loader_get_format;
+extern (C) int function(_GdkPixbufLoader *, _GError * *)gdk_pixbuf_loader_close;
+extern (C) void * function(_GdkPixbufLoader *)gdk_pixbuf_loader_get_animation;
+extern (C) void * function(_GdkPixbufLoader *)gdk_pixbuf_loader_get_pixbuf;
+extern (C) int function(_GdkPixbufLoader *, char *, uint, _GError * *)gdk_pixbuf_loader_write;
+extern (C) void function(_GdkPixbufLoader *, int, int)gdk_pixbuf_loader_set_size;
+extern (C) _GdkPixbufLoader * function(char *, _GError * *)gdk_pixbuf_loader_new_with_mime_type;
+extern (C) _GdkPixbufLoader * function(char *, _GError * *)gdk_pixbuf_loader_new_with_type;
+extern (C) _GdkPixbufLoader * function()gdk_pixbuf_loader_new;
+extern (C) uint function()gdk_pixbuf_loader_get_type;
+extern (C) void * function(char *, int *, int *)gdk_pixbuf_get_file_info;
+extern (C) char * function(void *)gdk_pixbuf_format_get_license;
+extern (C) void function(void *, int)gdk_pixbuf_format_set_disabled;
+extern (C) int function(void *)gdk_pixbuf_format_is_disabled;
+extern (C) int function(void *)gdk_pixbuf_format_is_scalable;
+extern (C) int function(void *)gdk_pixbuf_format_is_writable;
+extern (C) char * * function(void *)gdk_pixbuf_format_get_extensions;
+extern (C) char * * function(void *)gdk_pixbuf_format_get_mime_types;
+extern (C) char * function(void *)gdk_pixbuf_format_get_description;
+extern (C) char * function(void *)gdk_pixbuf_format_get_name;
+extern (C) _GSList * function()gdk_pixbuf_get_formats;
+extern (C) void function(void *, void *)gdk_pixbuf_simple_anim_add_frame;
+extern (C) void * function(int, int, float)gdk_pixbuf_simple_anim_new;
+extern (C) uint function()gdk_pixbuf_simple_anim_iter_get_type;
+extern (C) uint function()gdk_pixbuf_simple_anim_get_type;
+extern (C) int function(void *, _GTimeVal *)gdk_pixbuf_animation_iter_advance;
+extern (C) int function(void *)gdk_pixbuf_animation_iter_on_currently_loading_frame;
+extern (C) void * function(void *)gdk_pixbuf_animation_iter_get_pixbuf;
+extern (C) int function(void *)gdk_pixbuf_animation_iter_get_delay_time;
+extern (C) uint function()gdk_pixbuf_animation_iter_get_type;
+extern (C) void * function(void *, _GTimeVal *)gdk_pixbuf_animation_get_iter;
+extern (C) void * function(void *)gdk_pixbuf_animation_get_static_image;
+extern (C) int function(void *)gdk_pixbuf_animation_is_static_image;
+extern (C) int function(void *)gdk_pixbuf_animation_get_height;
+extern (C) int function(void *)gdk_pixbuf_animation_get_width;
+extern (C) void function(void *)gdk_pixbuf_animation_unref;
+extern (C) void * function(void *)gdk_pixbuf_animation_ref;
+extern (C) void * function(char *, _GError * *)gdk_pixbuf_animation_new_from_file;
+extern (C) uint function()gdk_pixbuf_animation_get_type;
+extern (C) void * function(void *, int)gdk_pixbuf_flip;
+extern (C) void * function(void *, int)gdk_pixbuf_rotate_simple;
+extern (C) void * function(void *, int, int, int, int, int, uint, uint)gdk_pixbuf_composite_color_simple;
+extern (C) void * function(void *, int, int, int)gdk_pixbuf_scale_simple;
+extern (C) void function(void *, void *, int, int, int, int, double, double, double, double, int, int, int, int, int, uint, uint)gdk_pixbuf_composite_color;
+extern (C) void function(void *, void *, int, int, int, int, double, double, double, double, int, int)gdk_pixbuf_composite;
+extern (C) void function(void *, void *, int, int, int, int, double, double, double, double, int)gdk_pixbuf_scale;
+extern (C) char * function(void *, char *)gdk_pixbuf_get_option;
+extern (C) void * function(void *)gdk_pixbuf_apply_embedded_orientation;
+extern (C) void function(void *, void *, float, int)gdk_pixbuf_saturate_and_pixelate;
+extern (C) void function(void *, int, int, int, int, void *, int, int)gdk_pixbuf_copy_area;
+extern (C) void * function(void *, int, char, char, char)gdk_pixbuf_add_alpha;
+extern (C) int function(void *, char * *, uint *, char *, char * *, char * *, _GError * *)gdk_pixbuf_save_to_bufferv;
+extern (C) int function(void *, char * *, uint *, char *, _GError * *, ...)gdk_pixbuf_save_to_buffer;
+extern (C) int function(void *, _BCD_func__4618, void *, char *, char * *, char * *, _GError * *)gdk_pixbuf_save_to_callbackv;
+extern (C) int function(void *, _BCD_func__4618, void *, char *, _GError * *, ...)gdk_pixbuf_save_to_callback;
+extern (C) int function(void *, char *, char *, char * *, char * *, _GError * *)gdk_pixbuf_savev;
+extern (C) int function(void *, char *, char *, _GError * *, ...)gdk_pixbuf_save;
+extern (C) void function(void *, uint)gdk_pixbuf_fill;
+extern (C) void * function(int, char *, int, _GError * *)gdk_pixbuf_new_from_inline;
+extern (C) void * function(char * *)gdk_pixbuf_new_from_xpm_data;
+extern (C) void * function(char *, int, int, int, int, int, int, _BCD_func__4621, void *)gdk_pixbuf_new_from_data;
+extern (C) void * function(char *, int, int, int, _GError * *)gdk_pixbuf_new_from_file_at_scale;
+extern (C) void * function(char *, int, int, _GError * *)gdk_pixbuf_new_from_file_at_size;
+extern (C) void * function(char *, _GError * *)gdk_pixbuf_new_from_file;
+extern (C) void * function(void *, int, int, int, int)gdk_pixbuf_new_subpixbuf;
+extern (C) void * function(void *)gdk_pixbuf_copy;
+extern (C) void * function(int, int, int, int, int)gdk_pixbuf_new;
+extern (C) int function(void *)gdk_pixbuf_get_rowstride;
+extern (C) int function(void *)gdk_pixbuf_get_height;
+extern (C) int function(void *)gdk_pixbuf_get_width;
+extern (C) char * function(void *)gdk_pixbuf_get_pixels;
+extern (C) int function(void *)gdk_pixbuf_get_bits_per_sample;
+extern (C) int function(void *)gdk_pixbuf_get_has_alpha;
+extern (C) int function(void *)gdk_pixbuf_get_n_channels;
+extern (C) int function(void *)gdk_pixbuf_get_colorspace;
+extern (C) void function(void *)gdk_pixbuf_unref;
+extern (C) void * function(void *)gdk_pixbuf_ref;
+extern (C) uint function()gdk_pixbuf_get_type;
+extern (C) uint function()gdk_pixbuf_error_quark;
+extern (C) extern char ** gdk_pixbuf_version;
+extern (C) extern uint* gdk_pixbuf_micro_version;
+extern (C) extern uint* gdk_pixbuf_minor_version;
+extern (C) extern uint* gdk_pixbuf_major_version;
+extern (C) int function(_GdkColormap *)gdk_rgb_colormap_ditherable;
+extern (C) int function()gdk_rgb_ditherable;
+extern (C) _GdkVisual * function()gdk_rgb_get_visual;
+extern (C) _GdkColormap * function()gdk_rgb_get_colormap;
+extern (C) void function(int)gdk_rgb_set_min_colors;
+extern (C) void function(int)gdk_rgb_set_install;
+extern (C) void function(int)gdk_rgb_set_verbose;
+extern (C) void function(_GdkRgbCmap *)gdk_rgb_cmap_free;
+extern (C) _GdkRgbCmap * function(uint *, int)gdk_rgb_cmap_new;
+extern (C) void function(_GdkDrawable *, _GdkGC *, int, int, int, int, int, char *, int, _GdkRgbCmap *)gdk_draw_indexed_image;
+extern (C) void function(_GdkDrawable *, _GdkGC *, int, int, int, int, int, char *, int)gdk_draw_gray_image;
+extern (C) void function(_GdkDrawable *, _GdkGC *, int, int, int, int, int, char *, int, int, int)gdk_draw_rgb_32_image_dithalign;
+extern (C) void function(_GdkDrawable *, _GdkGC *, int, int, int, int, int, char *, int)gdk_draw_rgb_32_image;
+extern (C) void function(_GdkDrawable *, _GdkGC *, int, int, int, int, int, char *, int, int, int)gdk_draw_rgb_image_dithalign;
+extern (C) void function(_GdkDrawable *, _GdkGC *, int, int, int, int, int, char *, int)gdk_draw_rgb_image;
+extern (C) void function(_GdkColormap *, _GdkColor *)gdk_rgb_find_color;
+extern (C) void function(_GdkGC *, uint)gdk_rgb_gc_set_background;
+extern (C) void function(_GdkGC *, uint)gdk_rgb_gc_set_foreground;
+extern (C) uint function(uint)gdk_rgb_xpixel_from_rgb;
+extern (C) void function()gdk_rgb_init;
+extern (C) void function(_GdkColormap *, uint *, int, uint)gdk_colors_free;
+extern (C) int function(_GdkColormap *, int, uint *, int, uint *, int)gdk_colors_alloc;
+extern (C) int function(_GdkColormap *, _GdkColor *)gdk_color_change;
+extern (C) int function(_GdkColormap *, _GdkColor *)gdk_color_alloc;
+extern (C) int function(_GdkColormap *, _GdkColor *)gdk_color_black;
+extern (C) int function(_GdkColormap *, _GdkColor *)gdk_color_white;
+extern (C) void function(_GdkColormap *, _GdkColor *, int)gdk_colors_store;
+extern (C) uint function()gdk_color_get_type;
+extern (C) char * function(_GdkColor *)gdk_color_to_string;
+extern (C) int function(_GdkColor *, _GdkColor *)gdk_color_equal;
+extern (C) uint function(_GdkColor *)gdk_color_hash;
+extern (C) int function(char *, _GdkColor *)gdk_color_parse;
+extern (C) void function(_GdkColor *)gdk_color_free;
+extern (C) _GdkColor * function(_GdkColor *)gdk_color_copy;
+extern (C) _GdkVisual * function(_GdkColormap *)gdk_colormap_get_visual;
+extern (C) void function(_GdkColormap *, uint, _GdkColor *)gdk_colormap_query_color;
+extern (C) void function(_GdkColormap *, _GdkColor *, int)gdk_colormap_free_colors;
+extern (C) int function(_GdkColormap *, _GdkColor *, int, int)gdk_colormap_alloc_color;
+extern (C) int function(_GdkColormap *, _GdkColor *, int, int, int, int *)gdk_colormap_alloc_colors;
+extern (C) void function(_GdkColormap *, int)gdk_colormap_change;
+extern (C) int function()gdk_colormap_get_system_size;
+extern (C) _GdkScreen * function(_GdkColormap *)gdk_colormap_get_screen;
+extern (C) _GdkColormap * function()gdk_colormap_get_system;
+extern (C) void function(_GdkColormap *)gdk_colormap_unref;
+extern (C) _GdkColormap * function(_GdkColormap *)gdk_colormap_ref;
+extern (C) _GdkColormap * function(_GdkVisual *, int)gdk_colormap_new;
+extern (C) uint function()gdk_colormap_get_type;
+
+
+Symbol[] symbols = [
+    { "gdk_threads_add_timeout",  cast(void**)& gdk_threads_add_timeout},
+    { "gdk_threads_add_timeout_full",  cast(void**)& gdk_threads_add_timeout_full},
+    { "gdk_threads_add_idle",  cast(void**)& gdk_threads_add_idle},
+    { "gdk_threads_add_idle_full",  cast(void**)& gdk_threads_add_idle_full},
+    { "gdk_threads_set_lock_functions",  cast(void**)& gdk_threads_set_lock_functions},
+    { "gdk_threads_init",  cast(void**)& gdk_threads_init},
+    { "gdk_threads_leave",  cast(void**)& gdk_threads_leave},
+    { "gdk_threads_enter",  cast(void**)& gdk_threads_enter},
+    { "gdk_threads_unlock",  cast(void**)& gdk_threads_unlock},
+    { "gdk_threads_lock",  cast(void**)& gdk_threads_lock},
+    { "gdk_threads_mutex",  cast(void**)& gdk_threads_mutex},
+    { "gdk_notify_startup_complete_with_id",  cast(void**)& gdk_notify_startup_complete_with_id},
+    { "gdk_notify_startup_complete",  cast(void**)& gdk_notify_startup_complete},
+    { "gdk_event_send_client_message_for_display",  cast(void**)& gdk_event_send_client_message_for_display},
+    { "gdk_event_send_clientmessage_toall",  cast(void**)& gdk_event_send_clientmessage_toall},
+    { "gdk_event_send_client_message",  cast(void**)& gdk_event_send_client_message},
+    { "gdk_mbstowcs",  cast(void**)& gdk_mbstowcs},
+    { "gdk_wcstombs",  cast(void**)& gdk_wcstombs},
+    { "gdk_rectangle_get_type",  cast(void**)& gdk_rectangle_get_type},
+    { "gdk_rectangle_union",  cast(void**)& gdk_rectangle_union},
+    { "gdk_rectangle_intersect",  cast(void**)& gdk_rectangle_intersect},
+    { "gdk_set_double_click_time",  cast(void**)& gdk_set_double_click_time},
+    { "gdk_flush",  cast(void**)& gdk_flush},
+    { "gdk_beep",  cast(void**)& gdk_beep},
+    { "gdk_screen_height_mm",  cast(void**)& gdk_screen_height_mm},
+    { "gdk_screen_width_mm",  cast(void**)& gdk_screen_width_mm},
+    { "gdk_screen_height",  cast(void**)& gdk_screen_height},
+    { "gdk_screen_width",  cast(void**)& gdk_screen_width},
+    { "gdk_pointer_is_grabbed",  cast(void**)& gdk_pointer_is_grabbed},
+    { "gdk_keyboard_ungrab",  cast(void**)& gdk_keyboard_ungrab},
+    { "gdk_pointer_ungrab",  cast(void**)& gdk_pointer_ungrab},
+    { "gdk_keyboard_grab_info_libgtk_only",  cast(void**)& gdk_keyboard_grab_info_libgtk_only},
+    { "gdk_pointer_grab_info_libgtk_only",  cast(void**)& gdk_pointer_grab_info_libgtk_only},
+    { "gdk_keyboard_grab",  cast(void**)& gdk_keyboard_grab},
+    { "gdk_pointer_grab",  cast(void**)& gdk_pointer_grab},
+    { "gdk_input_remove",  cast(void**)& gdk_input_remove},
+    { "gdk_input_add",  cast(void**)& gdk_input_add},
+    { "gdk_input_add_full",  cast(void**)& gdk_input_add_full},
+    { "gdk_get_display_arg_name",  cast(void**)& gdk_get_display_arg_name},
+    { "gdk_get_display",  cast(void**)& gdk_get_display},
+    { "gdk_get_use_xshm",  cast(void**)& gdk_get_use_xshm},
+    { "gdk_set_use_xshm",  cast(void**)& gdk_set_use_xshm},
+    { "gdk_error_trap_pop",  cast(void**)& gdk_error_trap_pop},
+    { "gdk_error_trap_push",  cast(void**)& gdk_error_trap_push},
+    { "gdk_set_program_class",  cast(void**)& gdk_set_program_class},
+    { "gdk_get_program_class",  cast(void**)& gdk_get_program_class},
+    { "gdk_set_locale",  cast(void**)& gdk_set_locale},
+    { "gdk_exit",  cast(void**)& gdk_exit},
+    { "gdk_pre_parse_libgtk_only",  cast(void**)& gdk_pre_parse_libgtk_only},
+    { "gdk_add_option_entries_libgtk_only",  cast(void**)& gdk_add_option_entries_libgtk_only},
+    { "gdk_init_check",  cast(void**)& gdk_init_check},
+    { "gdk_init",  cast(void**)& gdk_init},
+    { "gdk_parse_args",  cast(void**)& gdk_parse_args},
+    { "gdk_get_default_root_window",  cast(void**)& gdk_get_default_root_window},
+    { "gdk_set_pointer_hooks",  cast(void**)& gdk_set_pointer_hooks},
+    { "gdk_window_configure_finished",  cast(void**)& gdk_window_configure_finished},
+    { "gdk_window_enable_synchronized_configure",  cast(void**)& gdk_window_enable_synchronized_configure},
+    { "gdk_window_get_internal_paint_info",  cast(void**)& gdk_window_get_internal_paint_info},
+    { "gdk_window_constrain_size",  cast(void**)& gdk_window_constrain_size},
+    { "gdk_window_set_debug_updates",  cast(void**)& gdk_window_set_debug_updates},
+    { "gdk_window_process_updates",  cast(void**)& gdk_window_process_updates},
+    { "gdk_window_process_all_updates",  cast(void**)& gdk_window_process_all_updates},
+    { "gdk_window_thaw_toplevel_updates_libgtk_only",  cast(void**)& gdk_window_thaw_toplevel_updates_libgtk_only},
+    { "gdk_window_freeze_toplevel_updates_libgtk_only",  cast(void**)& gdk_window_freeze_toplevel_updates_libgtk_only},
+    { "gdk_window_thaw_updates",  cast(void**)& gdk_window_thaw_updates},
+    { "gdk_window_freeze_updates",  cast(void**)& gdk_window_freeze_updates},
+    { "gdk_window_get_update_area",  cast(void**)& gdk_window_get_update_area},
+    { "gdk_window_invalidate_maybe_recurse",  cast(void**)& gdk_window_invalidate_maybe_recurse},
+    { "gdk_window_invalidate_region",  cast(void**)& gdk_window_invalidate_region},
+    { "gdk_window_invalidate_rect",  cast(void**)& gdk_window_invalidate_rect},
+    { "gdk_window_begin_move_drag",  cast(void**)& gdk_window_begin_move_drag},
+    { "gdk_window_begin_resize_drag",  cast(void**)& gdk_window_begin_resize_drag},
+    { "gdk_window_register_dnd",  cast(void**)& gdk_window_register_dnd},
+    { "gdk_window_set_opacity",  cast(void**)& gdk_window_set_opacity},
+    { "gdk_window_set_keep_below",  cast(void**)& gdk_window_set_keep_below},
+    { "gdk_window_set_keep_above",  cast(void**)& gdk_window_set_keep_above},
+    { "gdk_window_unfullscreen",  cast(void**)& gdk_window_unfullscreen},
+    { "gdk_window_fullscreen",  cast(void**)& gdk_window_fullscreen},
+    { "gdk_window_unmaximize",  cast(void**)& gdk_window_unmaximize},
+    { "gdk_window_maximize",  cast(void**)& gdk_window_maximize},
+    { "gdk_window_unstick",  cast(void**)& gdk_window_unstick},
+    { "gdk_window_stick",  cast(void**)& gdk_window_stick},
+    { "gdk_window_deiconify",  cast(void**)& gdk_window_deiconify},
+    { "gdk_window_iconify",  cast(void**)& gdk_window_iconify},
+    { "gdk_window_beep",  cast(void**)& gdk_window_beep},
+    { "gdk_window_get_toplevels",  cast(void**)& gdk_window_get_toplevels},
+    { "gdk_window_set_functions",  cast(void**)& gdk_window_set_functions},
+    { "gdk_window_get_decorations",  cast(void**)& gdk_window_get_decorations},
+    { "gdk_window_set_decorations",  cast(void**)& gdk_window_set_decorations},
+    { "gdk_window_get_group",  cast(void**)& gdk_window_get_group},
+    { "gdk_window_set_group",  cast(void**)& gdk_window_set_group},
+    { "gdk_window_set_icon_name",  cast(void**)& gdk_window_set_icon_name},
+    { "gdk_window_set_icon",  cast(void**)& gdk_window_set_icon},
+    { "gdk_window_set_icon_list",  cast(void**)& gdk_window_set_icon_list},
+    { "gdk_window_set_events",  cast(void**)& gdk_window_set_events},
+    { "gdk_window_get_events",  cast(void**)& gdk_window_get_events},
+    { "gdk_window_peek_children",  cast(void**)& gdk_window_peek_children},
+    { "gdk_window_get_children",  cast(void**)& gdk_window_get_children},
+    { "gdk_window_get_toplevel",  cast(void**)& gdk_window_get_toplevel},
+    { "gdk_window_get_parent",  cast(void**)& gdk_window_get_parent},
+    { "gdk_window_get_pointer",  cast(void**)& gdk_window_get_pointer},
+    { "gdk_window_get_frame_extents",  cast(void**)& gdk_window_get_frame_extents},
+    { "gdk_window_get_root_origin",  cast(void**)& gdk_window_get_root_origin},
+    { "gdk_window_get_deskrelative_origin",  cast(void**)& gdk_window_get_deskrelative_origin},
+    { "gdk_window_get_origin",  cast(void**)& gdk_window_get_origin},
+    { "gdk_window_get_position",  cast(void**)& gdk_window_get_position},
+    { "gdk_window_get_geometry",  cast(void**)& gdk_window_get_geometry},
+    { "gdk_window_get_user_data",  cast(void**)& gdk_window_get_user_data},
+    { "gdk_window_set_cursor",  cast(void**)& gdk_window_set_cursor},
+    { "gdk_window_set_back_pixmap",  cast(void**)& gdk_window_set_back_pixmap},
+    { "gdk_window_set_background",  cast(void**)& gdk_window_set_background},
+    { "gdk_window_set_transient_for",  cast(void**)& gdk_window_set_transient_for},
+    { "gdk_window_set_startup_id",  cast(void**)& gdk_window_set_startup_id},
+    { "gdk_window_set_role",  cast(void**)& gdk_window_set_role},
+    { "gdk_window_set_title",  cast(void**)& gdk_window_set_title},
+    { "gdk_window_end_paint",  cast(void**)& gdk_window_end_paint},
+    { "gdk_window_begin_paint_region",  cast(void**)& gdk_window_begin_paint_region},
+    { "gdk_window_begin_paint_rect",  cast(void**)& gdk_window_begin_paint_rect},
+    { "gdk_set_sm_client_id",  cast(void**)& gdk_set_sm_client_id},
+    { "gdk_window_set_geometry_hints",  cast(void**)& gdk_window_set_geometry_hints},
+    { "gdk_window_set_urgency_hint",  cast(void**)& gdk_window_set_urgency_hint},
+    { "gdk_window_set_skip_pager_hint",  cast(void**)& gdk_window_set_skip_pager_hint},
+    { "gdk_window_set_skip_taskbar_hint",  cast(void**)& gdk_window_set_skip_taskbar_hint},
+    { "gdk_window_set_modal_hint",  cast(void**)& gdk_window_set_modal_hint},
+    { "gdk_window_get_type_hint",  cast(void**)& gdk_window_get_type_hint},
+    { "gdk_window_set_type_hint",  cast(void**)& gdk_window_set_type_hint},
+    { "gdk_window_set_hints",  cast(void**)& gdk_window_set_hints},
+    { "gdk_window_lookup_for_display",  cast(void**)& gdk_window_lookup_for_display},
+    { "gdk_window_foreign_new_for_display",  cast(void**)& gdk_window_foreign_new_for_display},
+    { "gdk_window_lookup",  cast(void**)& gdk_window_lookup},
+    { "gdk_window_foreign_new",  cast(void**)& gdk_window_foreign_new},
+    { "gdk_window_set_static_gravities",  cast(void**)& gdk_window_set_static_gravities},
+    { "gdk_window_get_state",  cast(void**)& gdk_window_get_state},
+    { "gdk_window_is_viewable",  cast(void**)& gdk_window_is_viewable},
+    { "gdk_window_is_visible",  cast(void**)& gdk_window_is_visible},
+    { "gdk_window_merge_child_input_shapes",  cast(void**)& gdk_window_merge_child_input_shapes},
+    { "gdk_window_set_child_input_shapes",  cast(void**)& gdk_window_set_child_input_shapes},
+    { "gdk_window_input_shape_combine_region",  cast(void**)& gdk_window_input_shape_combine_region},
+    { "gdk_window_input_shape_combine_mask",  cast(void**)& gdk_window_input_shape_combine_mask},
+    { "gdk_window_merge_child_shapes",  cast(void**)& gdk_window_merge_child_shapes},
+    { "gdk_window_set_composited",  cast(void**)& gdk_window_set_composited},
+    { "gdk_window_set_child_shapes",  cast(void**)& gdk_window_set_child_shapes},
+    { "gdk_window_shape_combine_region",  cast(void**)& gdk_window_shape_combine_region},
+    { "gdk_window_shape_combine_mask",  cast(void**)& gdk_window_shape_combine_mask},
+    { "gdk_window_move_region",  cast(void**)& gdk_window_move_region},
+    { "gdk_window_scroll",  cast(void**)& gdk_window_scroll},
+    { "gdk_window_remove_filter",  cast(void**)& gdk_window_remove_filter},
+    { "gdk_window_add_filter",  cast(void**)& gdk_window_add_filter},
+    { "gdk_window_set_focus_on_map",  cast(void**)& gdk_window_set_focus_on_map},
+    { "gdk_window_set_accept_focus",  cast(void**)& gdk_window_set_accept_focus},
+    { "gdk_window_set_override_redirect",  cast(void**)& gdk_window_set_override_redirect},
+    { "gdk_window_set_user_data",  cast(void**)& gdk_window_set_user_data},
+    { "gdk_window_focus",  cast(void**)& gdk_window_focus},
+    { "gdk_window_lower",  cast(void**)& gdk_window_lower},
+    { "gdk_window_raise",  cast(void**)& gdk_window_raise},
+    { "gdk_window_clear_area_e",  cast(void**)& gdk_window_clear_area_e},
+    { "gdk_window_clear_area",  cast(void**)& gdk_window_clear_area},
+    { "gdk_window_clear",  cast(void**)& gdk_window_clear},
+    { "gdk_window_reparent",  cast(void**)& gdk_window_reparent},
+    { "gdk_window_move_resize",  cast(void**)& gdk_window_move_resize},
+    { "gdk_window_resize",  cast(void**)& gdk_window_resize},
+    { "gdk_window_move",  cast(void**)& gdk_window_move},
+    { "gdk_window_show_unraised",  cast(void**)& gdk_window_show_unraised},
+    { "gdk_window_withdraw",  cast(void**)& gdk_window_withdraw},
+    { "gdk_window_hide",  cast(void**)& gdk_window_hide},
+    { "gdk_window_show",  cast(void**)& gdk_window_show},
+    { "gdk_window_at_pointer",  cast(void**)& gdk_window_at_pointer},
+    { "gdk_window_get_window_type",  cast(void**)& gdk_window_get_window_type},
+    { "gdk_window_destroy",  cast(void**)& gdk_window_destroy},
+    { "gdk_window_new",  cast(void**)& gdk_window_new},
+    { "gdk_window_object_get_type",  cast(void**)& gdk_window_object_get_type},
+    { "gdk_visual_get_screen",  cast(void**)& gdk_visual_get_screen},
+    { "gdk_list_visuals",  cast(void**)& gdk_list_visuals},
+    { "gdk_query_visual_types",  cast(void**)& gdk_query_visual_types},
+    { "gdk_query_depths",  cast(void**)& gdk_query_depths},
+    { "gdk_visual_get_best_with_both",  cast(void**)& gdk_visual_get_best_with_both},
+    { "gdk_visual_get_best_with_type",  cast(void**)& gdk_visual_get_best_with_type},
+    { "gdk_visual_get_best_with_depth",  cast(void**)& gdk_visual_get_best_with_depth},
+    { "gdk_visual_get_best",  cast(void**)& gdk_visual_get_best},
+    { "gdk_visual_get_system",  cast(void**)& gdk_visual_get_system},
+    { "gdk_visual_get_best_type",  cast(void**)& gdk_visual_get_best_type},
+    { "gdk_visual_get_best_depth",  cast(void**)& gdk_visual_get_best_depth},
+    { "gdk_visual_get_type",  cast(void**)& gdk_visual_get_type},
+    { "gdk_spawn_command_line_on_screen",  cast(void**)& gdk_spawn_command_line_on_screen},
+    { "gdk_spawn_on_screen_with_pipes",  cast(void**)& gdk_spawn_on_screen_with_pipes},
+    { "gdk_spawn_on_screen",  cast(void**)& gdk_spawn_on_screen},
+    { "gdk_selection_send_notify_for_display",  cast(void**)& gdk_selection_send_notify_for_display},
+    { "gdk_selection_send_notify",  cast(void**)& gdk_selection_send_notify},
+    { "gdk_selection_property_get",  cast(void**)& gdk_selection_property_get},
+    { "gdk_selection_convert",  cast(void**)& gdk_selection_convert},
+    { "gdk_selection_owner_get_for_display",  cast(void**)& gdk_selection_owner_get_for_display},
+    { "gdk_selection_owner_set_for_display",  cast(void**)& gdk_selection_owner_set_for_display},
+    { "gdk_selection_owner_get",  cast(void**)& gdk_selection_owner_get},
+    { "gdk_selection_owner_set",  cast(void**)& gdk_selection_owner_set},
+    { "gdk_screen_get_window_stack",  cast(void**)& gdk_screen_get_window_stack},
+    { "gdk_screen_get_active_window",  cast(void**)& gdk_screen_get_active_window},
+    { "gdk_screen_get_resolution",  cast(void**)& gdk_screen_get_resolution},
+    { "gdk_screen_set_resolution",  cast(void**)& gdk_screen_set_resolution},
+    { "gdk_screen_get_font_options",  cast(void**)& gdk_screen_get_font_options},
+    { "gdk_screen_set_font_options",  cast(void**)& gdk_screen_set_font_options},
+    { "gdk_screen_get_setting",  cast(void**)& gdk_screen_get_setting},
+    { "gdk_screen_get_default",  cast(void**)& gdk_screen_get_default},
+    { "gdk_screen_broadcast_client_message",  cast(void**)& gdk_screen_broadcast_client_message},
+    { "gdk_screen_get_monitor_at_window",  cast(void**)& gdk_screen_get_monitor_at_window},
+    { "gdk_screen_get_monitor_at_point",  cast(void**)& gdk_screen_get_monitor_at_point},
+    { "gdk_screen_get_monitor_geometry",  cast(void**)& gdk_screen_get_monitor_geometry},
+    { "gdk_screen_get_n_monitors",  cast(void**)& gdk_screen_get_n_monitors},
+    { "gdk_screen_make_display_name",  cast(void**)& gdk_screen_make_display_name},
+    { "gdk_screen_get_toplevel_windows",  cast(void**)& gdk_screen_get_toplevel_windows},
+    { "gdk_screen_list_visuals",  cast(void**)& gdk_screen_list_visuals},
+    { "gdk_screen_get_height_mm",  cast(void**)& gdk_screen_get_height_mm},
+    { "gdk_screen_get_width_mm",  cast(void**)& gdk_screen_get_width_mm},
+    { "gdk_screen_get_height",  cast(void**)& gdk_screen_get_height},
+    { "gdk_screen_get_width",  cast(void**)& gdk_screen_get_width},
+    { "gdk_screen_get_number",  cast(void**)& gdk_screen_get_number},
+    { "gdk_screen_get_display",  cast(void**)& gdk_screen_get_display},
+    { "gdk_screen_get_root_window",  cast(void**)& gdk_screen_get_root_window},
+    { "gdk_screen_is_composited",  cast(void**)& gdk_screen_is_composited},
+    { "gdk_screen_get_rgba_visual",  cast(void**)& gdk_screen_get_rgba_visual},
+    { "gdk_screen_get_rgba_colormap",  cast(void**)& gdk_screen_get_rgba_colormap},
+    { "gdk_screen_get_rgb_visual",  cast(void**)& gdk_screen_get_rgb_visual},
+    { "gdk_screen_get_rgb_colormap",  cast(void**)& gdk_screen_get_rgb_colormap},
+    { "gdk_screen_get_system_visual",  cast(void**)& gdk_screen_get_system_visual},
+    { "gdk_screen_get_system_colormap",  cast(void**)& gdk_screen_get_system_colormap},
+    { "gdk_screen_set_default_colormap",  cast(void**)& gdk_screen_set_default_colormap},
+    { "gdk_screen_get_default_colormap",  cast(void**)& gdk_screen_get_default_colormap},
+    { "gdk_screen_get_type",  cast(void**)& gdk_screen_get_type},
+    { "gdk_region_spans_intersect_foreach",  cast(void**)& gdk_region_spans_intersect_foreach},
+    { "gdk_region_xor",  cast(void**)& gdk_region_xor},
+    { "gdk_region_subtract",  cast(void**)& gdk_region_subtract},
+    { "gdk_region_union",  cast(void**)& gdk_region_union},
+    { "gdk_region_intersect",  cast(void**)& gdk_region_intersect},
+    { "gdk_region_union_with_rect",  cast(void**)& gdk_region_union_with_rect},
+    { "gdk_region_shrink",  cast(void**)& gdk_region_shrink},
+    { "gdk_region_offset",  cast(void**)& gdk_region_offset},
+    { "gdk_region_rect_in",  cast(void**)& gdk_region_rect_in},
+    { "gdk_region_point_in",  cast(void**)& gdk_region_point_in},
+    { "gdk_region_equal",  cast(void**)& gdk_region_equal},
+    { "gdk_region_empty",  cast(void**)& gdk_region_empty},
+    { "gdk_region_get_rectangles",  cast(void**)& gdk_region_get_rectangles},
+    { "gdk_region_get_clipbox",  cast(void**)& gdk_region_get_clipbox},
+    { "gdk_region_destroy",  cast(void**)& gdk_region_destroy},
+    { "gdk_region_rectangle",  cast(void**)& gdk_region_rectangle},
+    { "gdk_region_copy",  cast(void**)& gdk_region_copy},
+    { "gdk_region_polygon",  cast(void**)& gdk_region_polygon},
+    { "gdk_region_new",  cast(void**)& gdk_region_new},
+    { "gdk_free_compound_text",  cast(void**)& gdk_free_compound_text},
+    { "gdk_free_text_list",  cast(void**)& gdk_free_text_list},
+    { "gdk_utf8_to_compound_text_for_display",  cast(void**)& gdk_utf8_to_compound_text_for_display},
+    { "gdk_string_to_compound_text_for_display",  cast(void**)& gdk_string_to_compound_text_for_display},
+    { "gdk_utf8_to_string_target",  cast(void**)& gdk_utf8_to_string_target},
+    { "gdk_text_property_to_utf8_list_for_display",  cast(void**)& gdk_text_property_to_utf8_list_for_display},
+    { "gdk_text_property_to_text_list_for_display",  cast(void**)& gdk_text_property_to_text_list_for_display},
+    { "gdk_string_to_compound_text",  cast(void**)& gdk_string_to_compound_text},
+    { "gdk_utf8_to_compound_text",  cast(void**)& gdk_utf8_to_compound_text},
+    { "gdk_text_property_to_utf8_list",  cast(void**)& gdk_text_property_to_utf8_list},
+    { "gdk_text_property_to_text_list",  cast(void**)& gdk_text_property_to_text_list},
+    { "gdk_property_delete",  cast(void**)& gdk_property_delete},
+    { "gdk_property_change",  cast(void**)& gdk_property_change},
+    { "gdk_property_get",  cast(void**)& gdk_property_get},
+    { "gdk_atom_name",  cast(void**)& gdk_atom_name},
+    { "gdk_atom_intern_static_string",  cast(void**)& gdk_atom_intern_static_string},
+    { "gdk_atom_intern",  cast(void**)& gdk_atom_intern},
+    { "gdk_pixmap_foreign_new_for_screen",  cast(void**)& gdk_pixmap_foreign_new_for_screen},
+    { "gdk_pixmap_lookup_for_display",  cast(void**)& gdk_pixmap_lookup_for_display},
+    { "gdk_pixmap_foreign_new_for_display",  cast(void**)& gdk_pixmap_foreign_new_for_display},
+    { "gdk_pixmap_lookup",  cast(void**)& gdk_pixmap_lookup},
+    { "gdk_pixmap_foreign_new",  cast(void**)& gdk_pixmap_foreign_new},
+    { "gdk_pixmap_colormap_create_from_xpm_d",  cast(void**)& gdk_pixmap_colormap_create_from_xpm_d},
+    { "gdk_pixmap_create_from_xpm_d",  cast(void**)& gdk_pixmap_create_from_xpm_d},
+    { "gdk_pixmap_colormap_create_from_xpm",  cast(void**)& gdk_pixmap_colormap_create_from_xpm},
+    { "gdk_pixmap_create_from_xpm",  cast(void**)& gdk_pixmap_create_from_xpm},
+    { "gdk_pixmap_create_from_data",  cast(void**)& gdk_pixmap_create_from_data},
+    { "gdk_bitmap_create_from_data",  cast(void**)& gdk_bitmap_create_from_data},
+    { "gdk_pixmap_new",  cast(void**)& gdk_pixmap_new},
+    { "gdk_pixmap_get_type",  cast(void**)& gdk_pixmap_get_type},
+    { "gdk_pango_attr_emboss_color_new",  cast(void**)& gdk_pango_attr_emboss_color_new},
+    { "gdk_pango_attr_embossed_new",  cast(void**)& gdk_pango_attr_embossed_new},
+    { "gdk_pango_attr_stipple_new",  cast(void**)& gdk_pango_attr_stipple_new},
+    { "gdk_pango_layout_get_clip_region",  cast(void**)& gdk_pango_layout_get_clip_region},
+    { "gdk_pango_layout_line_get_clip_region",  cast(void**)& gdk_pango_layout_line_get_clip_region},
+    { "gdk_pango_context_set_colormap",  cast(void**)& gdk_pango_context_set_colormap},
+    { "gdk_pango_context_get",  cast(void**)& gdk_pango_context_get},
+    { "gdk_pango_context_get_for_screen",  cast(void**)& gdk_pango_context_get_for_screen},
+    { "gdk_pango_renderer_set_override_color",  cast(void**)& gdk_pango_renderer_set_override_color},
+    { "gdk_pango_renderer_set_stipple",  cast(void**)& gdk_pango_renderer_set_stipple},
+    { "gdk_pango_renderer_set_gc",  cast(void**)& gdk_pango_renderer_set_gc},
+    { "gdk_pango_renderer_set_drawable",  cast(void**)& gdk_pango_renderer_set_drawable},
+    { "gdk_pango_renderer_get_default",  cast(void**)& gdk_pango_renderer_get_default},
+    { "gdk_pango_renderer_new",  cast(void**)& gdk_pango_renderer_new},
+    { "gdk_pango_renderer_get_type",  cast(void**)& gdk_pango_renderer_get_type},
+    { "gdk_display_manager_list_displays",  cast(void**)& gdk_display_manager_list_displays},
+    { "gdk_display_manager_set_default_display",  cast(void**)& gdk_display_manager_set_default_display},
+    { "gdk_display_manager_get_default_display",  cast(void**)& gdk_display_manager_get_default_display},
+    { "gdk_display_manager_get",  cast(void**)& gdk_display_manager_get},
+    { "gdk_display_manager_get_type",  cast(void**)& gdk_display_manager_get_type},
+    { "gdk_unicode_to_keyval",  cast(void**)& gdk_unicode_to_keyval},
+    { "gdk_keyval_to_unicode",  cast(void**)& gdk_keyval_to_unicode},
+    { "gdk_keyval_is_lower",  cast(void**)& gdk_keyval_is_lower},
+    { "gdk_keyval_is_upper",  cast(void**)& gdk_keyval_is_upper},
+    { "gdk_keyval_to_lower",  cast(void**)& gdk_keyval_to_lower},
+    { "gdk_keyval_to_upper",  cast(void**)& gdk_keyval_to_upper},
+    { "gdk_keyval_convert_case",  cast(void**)& gdk_keyval_convert_case},
+    { "gdk_keyval_from_name",  cast(void**)& gdk_keyval_from_name},
+    { "gdk_keyval_name",  cast(void**)& gdk_keyval_name},
+    { "gdk_keymap_have_bidi_layouts",  cast(void**)& gdk_keymap_have_bidi_layouts},
+    { "gdk_keymap_get_direction",  cast(void**)& gdk_keymap_get_direction},
+    { "gdk_keymap_get_entries_for_keycode",  cast(void**)& gdk_keymap_get_entries_for_keycode},
+    { "gdk_keymap_get_entries_for_keyval",  cast(void**)& gdk_keymap_get_entries_for_keyval},
+    { "gdk_keymap_translate_keyboard_state",  cast(void**)& gdk_keymap_translate_keyboard_state},
+    { "gdk_keymap_lookup_key",  cast(void**)& gdk_keymap_lookup_key},
+    { "gdk_keymap_get_for_display",  cast(void**)& gdk_keymap_get_for_display},
+    { "gdk_keymap_get_default",  cast(void**)& gdk_keymap_get_default},
+    { "gdk_keymap_get_type",  cast(void**)& gdk_keymap_get_type},
+    { "gdk_image_get_colormap",  cast(void**)& gdk_image_get_colormap},
+    { "gdk_image_set_colormap",  cast(void**)& gdk_image_set_colormap},
+    { "gdk_image_get_pixel",  cast(void**)& gdk_image_get_pixel},
+    { "gdk_image_put_pixel",  cast(void**)& gdk_image_put_pixel},
+    { "gdk_image_unref",  cast(void**)& gdk_image_unref},
+    { "gdk_image_ref",  cast(void**)& gdk_image_ref},
+    { "gdk_image_get",  cast(void**)& gdk_image_get},
+    { "gdk_image_new",  cast(void**)& gdk_image_new},
+    { "gdk_image_get_type",  cast(void**)& gdk_image_get_type},
+    { "gdk_font_get_display",  cast(void**)& gdk_font_get_display},
+    { "gdk_string_extents",  cast(void**)& gdk_string_extents},
+    { "gdk_text_extents_wc",  cast(void**)& gdk_text_extents_wc},
+    { "gdk_text_extents",  cast(void**)& gdk_text_extents},
+    { "gdk_char_height",  cast(void**)& gdk_char_height},
+    { "gdk_text_height",  cast(void**)& gdk_text_height},
+    { "gdk_string_height",  cast(void**)& gdk_string_height},
+    { "gdk_char_measure",  cast(void**)& gdk_char_measure},
+    { "gdk_text_measure",  cast(void**)& gdk_text_measure},
+    { "gdk_string_measure",  cast(void**)& gdk_string_measure},
+    { "gdk_char_width_wc",  cast(void**)& gdk_char_width_wc},
+    { "gdk_char_width",  cast(void**)& gdk_char_width},
+    { "gdk_text_width_wc",  cast(void**)& gdk_text_width_wc},
+    { "gdk_text_width",  cast(void**)& gdk_text_width},
+    { "gdk_string_width",  cast(void**)& gdk_string_width},
+    { "gdk_font_from_description",  cast(void**)& gdk_font_from_description},
+    { "gdk_fontset_load",  cast(void**)& gdk_fontset_load},
+    { "gdk_font_load",  cast(void**)& gdk_font_load},
+    { "gdk_font_from_description_for_display",  cast(void**)& gdk_font_from_description_for_display},
+    { "gdk_fontset_load_for_display",  cast(void**)& gdk_fontset_load_for_display},
+    { "gdk_font_load_for_display",  cast(void**)& gdk_font_load_for_display},
+    { "gdk_font_equal",  cast(void**)& gdk_font_equal},
+    { "gdk_font_id",  cast(void**)& gdk_font_id},
+    { "gdk_font_unref",  cast(void**)& gdk_font_unref},
+    { "gdk_font_ref",  cast(void**)& gdk_font_ref},
+    { "gdk_font_get_type",  cast(void**)& gdk_font_get_type},
+    { "gdk_window_edge_get_type",  cast(void**)& gdk_window_edge_get_type},
+    { "gdk_gravity_get_type",  cast(void**)& gdk_gravity_get_type},
+    { "gdk_wm_function_get_type",  cast(void**)& gdk_wm_function_get_type},
+    { "gdk_wm_decoration_get_type",  cast(void**)& gdk_wm_decoration_get_type},
+    { "gdk_window_type_hint_get_type",  cast(void**)& gdk_window_type_hint_get_type},
+    { "gdk_window_hints_get_type",  cast(void**)& gdk_window_hints_get_type},
+    { "gdk_window_attributes_type_get_type",  cast(void**)& gdk_window_attributes_type_get_type},
+    { "gdk_window_type_get_type",  cast(void**)& gdk_window_type_get_type},
+    { "gdk_window_class_get_type",  cast(void**)& gdk_window_class_get_type},
+    { "gdk_visual_type_get_type",  cast(void**)& gdk_visual_type_get_type},
+    { "gdk_grab_status_get_type",  cast(void**)& gdk_grab_status_get_type},
+    { "gdk_status_get_type",  cast(void**)& gdk_status_get_type},
+    { "gdk_input_condition_get_type",  cast(void**)& gdk_input_condition_get_type},
+    { "gdk_modifier_type_get_type",  cast(void**)& gdk_modifier_type_get_type},
+    { "gdk_byte_order_get_type",  cast(void**)& gdk_byte_order_get_type},
+    { "gdk_rgb_dither_get_type",  cast(void**)& gdk_rgb_dither_get_type},
+    { "gdk_overlap_type_get_type",  cast(void**)& gdk_overlap_type_get_type},
+    { "gdk_fill_rule_get_type",  cast(void**)& gdk_fill_rule_get_type},
+    { "gdk_prop_mode_get_type",  cast(void**)& gdk_prop_mode_get_type},
+    { "gdk_axis_use_get_type",  cast(void**)& gdk_axis_use_get_type},
+    { "gdk_input_mode_get_type",  cast(void**)& gdk_input_mode_get_type},
+    { "gdk_input_source_get_type",  cast(void**)& gdk_input_source_get_type},
+    { "gdk_extension_mode_get_type",  cast(void**)& gdk_extension_mode_get_type},
+    { "gdk_image_type_get_type",  cast(void**)& gdk_image_type_get_type},
+    { "gdk_gc_values_mask_get_type",  cast(void**)& gdk_gc_values_mask_get_type},
+    { "gdk_subwindow_mode_get_type",  cast(void**)& gdk_subwindow_mode_get_type},
+    { "gdk_line_style_get_type",  cast(void**)& gdk_line_style_get_type},
+    { "gdk_join_style_get_type",  cast(void**)& gdk_join_style_get_type},
+    { "gdk_function_get_type",  cast(void**)& gdk_function_get_type},
+    { "gdk_fill_get_type",  cast(void**)& gdk_fill_get_type},
+    { "gdk_cap_style_get_type",  cast(void**)& gdk_cap_style_get_type},
+    { "gdk_font_type_get_type",  cast(void**)& gdk_font_type_get_type},
+    { "gdk_owner_change_get_type",  cast(void**)& gdk_owner_change_get_type},
+    { "gdk_setting_action_get_type",  cast(void**)& gdk_setting_action_get_type},
+    { "gdk_window_state_get_type",  cast(void**)& gdk_window_state_get_type},
+    { "gdk_property_state_get_type",  cast(void**)& gdk_property_state_get_type},
+    { "gdk_crossing_mode_get_type",  cast(void**)& gdk_crossing_mode_get_type},
+    { "gdk_notify_type_get_type",  cast(void**)& gdk_notify_type_get_type},
+    { "gdk_scroll_direction_get_type",  cast(void**)& gdk_scroll_direction_get_type},
+    { "gdk_visibility_state_get_type",  cast(void**)& gdk_visibility_state_get_type},
+    { "gdk_event_mask_get_type",  cast(void**)& gdk_event_mask_get_type},
+    { "gdk_event_type_get_type",  cast(void**)& gdk_event_type_get_type},
+    { "gdk_filter_return_get_type",  cast(void**)& gdk_filter_return_get_type},
+    { "gdk_drag_protocol_get_type",  cast(void**)& gdk_drag_protocol_get_type},
+    { "gdk_drag_action_get_type",  cast(void**)& gdk_drag_action_get_type},
+    { "gdk_cursor_type_get_type",  cast(void**)& gdk_cursor_type_get_type},
+    { "gdk_drawable_get_visible_region",  cast(void**)& gdk_drawable_get_visible_region},
+    { "gdk_drawable_get_clip_region",  cast(void**)& gdk_drawable_get_clip_region},
+    { "gdk_drawable_copy_to_image",  cast(void**)& gdk_drawable_copy_to_image},
+    { "gdk_drawable_get_image",  cast(void**)& gdk_drawable_get_image},
+    { "gdk_draw_trapezoids",  cast(void**)& gdk_draw_trapezoids},
+    { "gdk_draw_glyphs_transformed",  cast(void**)& gdk_draw_glyphs_transformed},
+    { "gdk_draw_layout_with_colors",  cast(void**)& gdk_draw_layout_with_colors},
+    { "gdk_draw_layout_line_with_colors",  cast(void**)& gdk_draw_layout_line_with_colors},
+    { "gdk_draw_layout",  cast(void**)& gdk_draw_layout},
+    { "gdk_draw_layout_line",  cast(void**)& gdk_draw_layout_line},
+    { "gdk_draw_glyphs",  cast(void**)& gdk_draw_glyphs},
+    { "gdk_draw_pixbuf",  cast(void**)& gdk_draw_pixbuf},
+    { "gdk_draw_lines",  cast(void**)& gdk_draw_lines},
+    { "gdk_draw_segments",  cast(void**)& gdk_draw_segments},
+    { "gdk_draw_points",  cast(void**)& gdk_draw_points},
+    { "gdk_draw_image",  cast(void**)& gdk_draw_image},
+    { "gdk_draw_drawable",  cast(void**)& gdk_draw_drawable},
+    { "gdk_draw_text_wc",  cast(void**)& gdk_draw_text_wc},
+    { "gdk_draw_text",  cast(void**)& gdk_draw_text},
+    { "gdk_draw_string",  cast(void**)& gdk_draw_string},
+    { "gdk_draw_polygon",  cast(void**)& gdk_draw_polygon},
+    { "gdk_draw_arc",  cast(void**)& gdk_draw_arc},
+    { "gdk_draw_rectangle",  cast(void**)& gdk_draw_rectangle},
+    { "gdk_draw_line",  cast(void**)& gdk_draw_line},
+    { "gdk_draw_point",  cast(void**)& gdk_draw_point},
+    { "gdk_drawable_unref",  cast(void**)& gdk_drawable_unref},
+    { "gdk_drawable_ref",  cast(void**)& gdk_drawable_ref},
+    { "gdk_drawable_get_display",  cast(void**)& gdk_drawable_get_display},
+    { "gdk_drawable_get_screen",  cast(void**)& gdk_drawable_get_screen},
+    { "gdk_drawable_get_depth",  cast(void**)& gdk_drawable_get_depth},
+    { "gdk_drawable_get_visual",  cast(void**)& gdk_drawable_get_visual},
+    { "gdk_drawable_get_colormap",  cast(void**)& gdk_drawable_get_colormap},
+    { "gdk_drawable_set_colormap",  cast(void**)& gdk_drawable_set_colormap},
+    { "gdk_drawable_get_size",  cast(void**)& gdk_drawable_get_size},
+    { "gdk_drawable_get_data",  cast(void**)& gdk_drawable_get_data},
+    { "gdk_drawable_set_data",  cast(void**)& gdk_drawable_set_data},
+    { "gdk_drawable_get_type",  cast(void**)& gdk_drawable_get_type},
+    { "gdk_gc_get_screen",  cast(void**)& gdk_gc_get_screen},
+    { "gdk_gc_set_rgb_bg_color",  cast(void**)& gdk_gc_set_rgb_bg_color},
+    { "gdk_gc_set_rgb_fg_color",  cast(void**)& gdk_gc_set_rgb_fg_color},
+    { "gdk_gc_get_colormap",  cast(void**)& gdk_gc_get_colormap},
+    { "gdk_gc_set_colormap",  cast(void**)& gdk_gc_set_colormap},
+    { "gdk_gc_copy",  cast(void**)& gdk_gc_copy},
+    { "gdk_gc_offset",  cast(void**)& gdk_gc_offset},
+    { "gdk_gc_set_dashes",  cast(void**)& gdk_gc_set_dashes},
+    { "gdk_gc_set_line_attributes",  cast(void**)& gdk_gc_set_line_attributes},
+    { "gdk_gc_set_exposures",  cast(void**)& gdk_gc_set_exposures},
+    { "gdk_gc_set_subwindow",  cast(void**)& gdk_gc_set_subwindow},
+    { "gdk_gc_set_clip_region",  cast(void**)& gdk_gc_set_clip_region},
+    { "gdk_gc_set_clip_rectangle",  cast(void**)& gdk_gc_set_clip_rectangle},
+    { "gdk_gc_set_clip_mask",  cast(void**)& gdk_gc_set_clip_mask},
+    { "gdk_gc_set_clip_origin",  cast(void**)& gdk_gc_set_clip_origin},
+    { "gdk_gc_set_ts_origin",  cast(void**)& gdk_gc_set_ts_origin},
+    { "gdk_gc_set_stipple",  cast(void**)& gdk_gc_set_stipple},
+    { "gdk_gc_set_tile",  cast(void**)& gdk_gc_set_tile},
+    { "gdk_gc_set_fill",  cast(void**)& gdk_gc_set_fill},
+    { "gdk_gc_set_function",  cast(void**)& gdk_gc_set_function},
+    { "gdk_gc_set_font",  cast(void**)& gdk_gc_set_font},
+    { "gdk_gc_set_background",  cast(void**)& gdk_gc_set_background},
+    { "gdk_gc_set_foreground",  cast(void**)& gdk_gc_set_foreground},
+    { "gdk_gc_set_values",  cast(void**)& gdk_gc_set_values},
+    { "gdk_gc_get_values",  cast(void**)& gdk_gc_get_values},
+    { "gdk_gc_unref",  cast(void**)& gdk_gc_unref},
+    { "gdk_gc_ref",  cast(void**)& gdk_gc_ref},
+    { "gdk_gc_new_with_values",  cast(void**)& gdk_gc_new_with_values},
+    { "gdk_gc_new",  cast(void**)& gdk_gc_new},
+    { "gdk_gc_get_type",  cast(void**)& gdk_gc_get_type},
+    { "gdk_display_supports_composite",  cast(void**)& gdk_display_supports_composite},
+    { "gdk_display_supports_input_shapes",  cast(void**)& gdk_display_supports_input_shapes},
+    { "gdk_display_supports_shapes",  cast(void**)& gdk_display_supports_shapes},
+    { "gdk_display_store_clipboard",  cast(void**)& gdk_display_store_clipboard},
+    { "gdk_display_supports_clipboard_persistence",  cast(void**)& gdk_display_supports_clipboard_persistence},
+    { "gdk_display_request_selection_notification",  cast(void**)& gdk_display_request_selection_notification},
+    { "gdk_display_supports_selection_notification",  cast(void**)& gdk_display_supports_selection_notification},
+    { "gdk_display_get_default_group",  cast(void**)& gdk_display_get_default_group},
+    { "gdk_display_get_maximal_cursor_size",  cast(void**)& gdk_display_get_maximal_cursor_size},
+    { "gdk_display_get_default_cursor_size",  cast(void**)& gdk_display_get_default_cursor_size},
+    { "gdk_display_supports_cursor_color",  cast(void**)& gdk_display_supports_cursor_color},
+    { "gdk_display_supports_cursor_alpha",  cast(void**)& gdk_display_supports_cursor_alpha},
+    { "gdk_display_open_default_libgtk_only",  cast(void**)& gdk_display_open_default_libgtk_only},
+    { "gdk_display_set_pointer_hooks",  cast(void**)& gdk_display_set_pointer_hooks},
+    { "gdk_display_warp_pointer",  cast(void**)& gdk_display_warp_pointer},
+    { "gdk_display_get_window_at_pointer",  cast(void**)& gdk_display_get_window_at_pointer},
+    { "gdk_display_get_pointer",  cast(void**)& gdk_display_get_pointer},
+    { "gdk_display_get_core_pointer",  cast(void**)& gdk_display_get_core_pointer},
+    { "gdk_display_get_default",  cast(void**)& gdk_display_get_default},
+    { "gdk_display_set_double_click_distance",  cast(void**)& gdk_display_set_double_click_distance},
+    { "gdk_display_set_double_click_time",  cast(void**)& gdk_display_set_double_click_time},
+    { "gdk_display_add_client_message_filter",  cast(void**)& gdk_display_add_client_message_filter},
+    { "gdk_display_put_event",  cast(void**)& gdk_display_put_event},
+    { "gdk_display_peek_event",  cast(void**)& gdk_display_peek_event},
+    { "gdk_display_get_event",  cast(void**)& gdk_display_get_event},
+    { "gdk_display_list_devices",  cast(void**)& gdk_display_list_devices},
+    { "gdk_display_close",  cast(void**)& gdk_display_close},
+    { "gdk_display_flush",  cast(void**)& gdk_display_flush},
+    { "gdk_display_sync",  cast(void**)& gdk_display_sync},
+    { "gdk_display_beep",  cast(void**)& gdk_display_beep},
+    { "gdk_display_pointer_is_grabbed",  cast(void**)& gdk_display_pointer_is_grabbed},
+    { "gdk_display_keyboard_ungrab",  cast(void**)& gdk_display_keyboard_ungrab},
+    { "gdk_display_pointer_ungrab",  cast(void**)& gdk_display_pointer_ungrab},
+    { "gdk_display_get_default_screen",  cast(void**)& gdk_display_get_default_screen},
+    { "gdk_display_get_screen",  cast(void**)& gdk_display_get_screen},
+    { "gdk_display_get_n_screens",  cast(void**)& gdk_display_get_n_screens},
+    { "gdk_display_get_name",  cast(void**)& gdk_display_get_name},
+    { "gdk_display_open",  cast(void**)& gdk_display_open},
+    { "gdk_display_get_type",  cast(void**)& gdk_display_get_type},
+    { "gdk_setting_get",  cast(void**)& gdk_setting_get},
+    { "gdk_add_client_message_filter",  cast(void**)& gdk_add_client_message_filter},
+    { "gdk_get_show_events",  cast(void**)& gdk_get_show_events},
+    { "gdk_set_show_events",  cast(void**)& gdk_set_show_events},
+    { "gdk_event_get_screen",  cast(void**)& gdk_event_get_screen},
+    { "gdk_event_set_screen",  cast(void**)& gdk_event_set_screen},
+    { "gdk_event_handler_set",  cast(void**)& gdk_event_handler_set},
+    { "gdk_event_request_motions",  cast(void**)& gdk_event_request_motions},
+    { "gdk_event_get_axis",  cast(void**)& gdk_event_get_axis},
+    { "gdk_event_get_root_coords",  cast(void**)& gdk_event_get_root_coords},
+    { "gdk_event_get_coords",  cast(void**)& gdk_event_get_coords},
+    { "gdk_event_get_state",  cast(void**)& gdk_event_get_state},
+    { "gdk_event_get_time",  cast(void**)& gdk_event_get_time},
+    { "gdk_event_free",  cast(void**)& gdk_event_free},
+    { "gdk_event_copy",  cast(void**)& gdk_event_copy},
+    { "gdk_event_new",  cast(void**)& gdk_event_new},
+    { "gdk_event_put",  cast(void**)& gdk_event_put},
+    { "gdk_event_get_graphics_expose",  cast(void**)& gdk_event_get_graphics_expose},
+    { "gdk_event_peek",  cast(void**)& gdk_event_peek},
+    { "gdk_event_get",  cast(void**)& gdk_event_get},
+    { "gdk_events_pending",  cast(void**)& gdk_events_pending},
+    { "gdk_event_get_type",  cast(void**)& gdk_event_get_type},
+    { "gdk_device_get_core_pointer",  cast(void**)& gdk_device_get_core_pointer},
+    { "gdk_input_set_extension_events",  cast(void**)& gdk_input_set_extension_events},
+    { "gdk_device_get_axis",  cast(void**)& gdk_device_get_axis},
+    { "gdk_device_free_history",  cast(void**)& gdk_device_free_history},
+    { "gdk_device_get_history",  cast(void**)& gdk_device_get_history},
+    { "gdk_device_get_state",  cast(void**)& gdk_device_get_state},
+    { "gdk_device_set_axis_use",  cast(void**)& gdk_device_set_axis_use},
+    { "gdk_device_set_key",  cast(void**)& gdk_device_set_key},
+    { "gdk_device_set_mode",  cast(void**)& gdk_device_set_mode},
+    { "gdk_device_set_source",  cast(void**)& gdk_device_set_source},
+    { "gdk_devices_list",  cast(void**)& gdk_devices_list},
+    { "gdk_device_get_type",  cast(void**)& gdk_device_get_type},
+    { "gdk_drag_drop_succeeded",  cast(void**)& gdk_drag_drop_succeeded},
+    { "gdk_drag_abort",  cast(void**)& gdk_drag_abort},
+    { "gdk_drag_drop",  cast(void**)& gdk_drag_drop},
+    { "gdk_drag_motion",  cast(void**)& gdk_drag_motion},
+    { "gdk_drag_find_window",  cast(void**)& gdk_drag_find_window},
+    { "gdk_drag_get_protocol",  cast(void**)& gdk_drag_get_protocol},
+    { "gdk_drag_find_window_for_screen",  cast(void**)& gdk_drag_find_window_for_screen},
+    { "gdk_drag_get_protocol_for_display",  cast(void**)& gdk_drag_get_protocol_for_display},
+    { "gdk_drag_begin",  cast(void**)& gdk_drag_begin},
+    { "gdk_drag_get_selection",  cast(void**)& gdk_drag_get_selection},
+    { "gdk_drop_finish",  cast(void**)& gdk_drop_finish},
+    { "gdk_drop_reply",  cast(void**)& gdk_drop_reply},
+    { "gdk_drag_status",  cast(void**)& gdk_drag_status},
+    { "gdk_drag_context_unref",  cast(void**)& gdk_drag_context_unref},
+    { "gdk_drag_context_ref",  cast(void**)& gdk_drag_context_ref},
+    { "gdk_drag_context_new",  cast(void**)& gdk_drag_context_new},
+    { "gdk_drag_context_get_type",  cast(void**)& gdk_drag_context_get_type},
+    { "gdk_cursor_get_image",  cast(void**)& gdk_cursor_get_image},
+    { "gdk_cursor_new_from_name",  cast(void**)& gdk_cursor_new_from_name},
+    { "gdk_cursor_unref",  cast(void**)& gdk_cursor_unref},
+    { "gdk_cursor_ref",  cast(void**)& gdk_cursor_ref},
+    { "gdk_cursor_get_display",  cast(void**)& gdk_cursor_get_display},
+    { "gdk_cursor_new_from_pixbuf",  cast(void**)& gdk_cursor_new_from_pixbuf},
+    { "gdk_cursor_new_from_pixmap",  cast(void**)& gdk_cursor_new_from_pixmap},
+    { "gdk_cursor_new",  cast(void**)& gdk_cursor_new},
+    { "gdk_cursor_new_for_display",  cast(void**)& gdk_cursor_new_for_display},
+    { "gdk_cursor_get_type",  cast(void**)& gdk_cursor_get_type},
+    { "gdk_cairo_region",  cast(void**)& gdk_cairo_region},
+    { "gdk_cairo_rectangle",  cast(void**)& gdk_cairo_rectangle},
+    { "gdk_cairo_set_source_pixmap",  cast(void**)& gdk_cairo_set_source_pixmap},
+    { "gdk_cairo_set_source_pixbuf",  cast(void**)& gdk_cairo_set_source_pixbuf},
+    { "gdk_cairo_set_source_color",  cast(void**)& gdk_cairo_set_source_color},
+    { "gdk_cairo_create",  cast(void**)& gdk_cairo_create},
+    { "gdk_pixbuf_get_from_image",  cast(void**)& gdk_pixbuf_get_from_image},
+    { "gdk_pixbuf_get_from_drawable",  cast(void**)& gdk_pixbuf_get_from_drawable},
+    { "gdk_pixbuf_render_pixmap_and_mask",  cast(void**)& gdk_pixbuf_render_pixmap_and_mask},
+    { "gdk_pixbuf_render_pixmap_and_mask_for_colormap",  cast(void**)& gdk_pixbuf_render_pixmap_and_mask_for_colormap},
+    { "gdk_pixbuf_render_to_drawable_alpha",  cast(void**)& gdk_pixbuf_render_to_drawable_alpha},
+    { "gdk_pixbuf_render_to_drawable",  cast(void**)& gdk_pixbuf_render_to_drawable},
+    { "gdk_pixbuf_render_threshold_alpha",  cast(void**)& gdk_pixbuf_render_threshold_alpha},
+    { "gdk_pixbuf_rotation_get_type",  cast(void**)& gdk_pixbuf_rotation_get_type},
+    { "gdk_interp_type_get_type",  cast(void**)& gdk_interp_type_get_type},
+    { "gdk_pixbuf_error_get_type",  cast(void**)& gdk_pixbuf_error_get_type},
+    { "gdk_colorspace_get_type",  cast(void**)& gdk_colorspace_get_type},
+    { "gdk_pixbuf_alpha_mode_get_type",  cast(void**)& gdk_pixbuf_alpha_mode_get_type},
+    { "gdk_pixbuf_loader_get_format",  cast(void**)& gdk_pixbuf_loader_get_format},
+    { "gdk_pixbuf_loader_close",  cast(void**)& gdk_pixbuf_loader_close},
+    { "gdk_pixbuf_loader_get_animation",  cast(void**)& gdk_pixbuf_loader_get_animation},
+    { "gdk_pixbuf_loader_get_pixbuf",  cast(void**)& gdk_pixbuf_loader_get_pixbuf},
+    { "gdk_pixbuf_loader_write",  cast(void**)& gdk_pixbuf_loader_write},
+    { "gdk_pixbuf_loader_set_size",  cast(void**)& gdk_pixbuf_loader_set_size},
+    { "gdk_pixbuf_loader_new_with_mime_type",  cast(void**)& gdk_pixbuf_loader_new_with_mime_type},
+    { "gdk_pixbuf_loader_new_with_type",  cast(void**)& gdk_pixbuf_loader_new_with_type},
+    { "gdk_pixbuf_loader_new",  cast(void**)& gdk_pixbuf_loader_new},
+    { "gdk_pixbuf_loader_get_type",  cast(void**)& gdk_pixbuf_loader_get_type},
+    { "gdk_pixbuf_get_file_info",  cast(void**)& gdk_pixbuf_get_file_info},
+    { "gdk_pixbuf_format_get_license",  cast(void**)& gdk_pixbuf_format_get_license},
+    { "gdk_pixbuf_format_set_disabled",  cast(void**)& gdk_pixbuf_format_set_disabled},
+    { "gdk_pixbuf_format_is_disabled",  cast(void**)& gdk_pixbuf_format_is_disabled},
+    { "gdk_pixbuf_format_is_scalable",  cast(void**)& gdk_pixbuf_format_is_scalable},
+    { "gdk_pixbuf_format_is_writable",  cast(void**)& gdk_pixbuf_format_is_writable},
+    { "gdk_pixbuf_format_get_extensions",  cast(void**)& gdk_pixbuf_format_get_extensions},
+    { "gdk_pixbuf_format_get_mime_types",  cast(void**)& gdk_pixbuf_format_get_mime_types},
+    { "gdk_pixbuf_format_get_description",  cast(void**)& gdk_pixbuf_format_get_description},
+    { "gdk_pixbuf_format_get_name",  cast(void**)& gdk_pixbuf_format_get_name},
+    { "gdk_pixbuf_get_formats",  cast(void**)& gdk_pixbuf_get_formats},
+    { "gdk_pixbuf_simple_anim_add_frame",  cast(void**)& gdk_pixbuf_simple_anim_add_frame},
+    { "gdk_pixbuf_simple_anim_new",  cast(void**)& gdk_pixbuf_simple_anim_new},
+    { "gdk_pixbuf_simple_anim_iter_get_type",  cast(void**)& gdk_pixbuf_simple_anim_iter_get_type},
+    { "gdk_pixbuf_simple_anim_get_type",  cast(void**)& gdk_pixbuf_simple_anim_get_type},
+    { "gdk_pixbuf_animation_iter_advance",  cast(void**)& gdk_pixbuf_animation_iter_advance},
+    { "gdk_pixbuf_animation_iter_on_currently_loading_frame",  cast(void**)& gdk_pixbuf_animation_iter_on_currently_loading_frame},
+    { "gdk_pixbuf_animation_iter_get_pixbuf",  cast(void**)& gdk_pixbuf_animation_iter_get_pixbuf},
+    { "gdk_pixbuf_animation_iter_get_delay_time",  cast(void**)& gdk_pixbuf_animation_iter_get_delay_time},
+    { "gdk_pixbuf_animation_iter_get_type",  cast(void**)& gdk_pixbuf_animation_iter_get_type},
+    { "gdk_pixbuf_animation_get_iter",  cast(void**)& gdk_pixbuf_animation_get_iter},
+    { "gdk_pixbuf_animation_get_static_image",  cast(void**)& gdk_pixbuf_animation_get_static_image},
+    { "gdk_pixbuf_animation_is_static_image",  cast(void**)& gdk_pixbuf_animation_is_static_image},
+    { "gdk_pixbuf_animation_get_height",  cast(void**)& gdk_pixbuf_animation_get_height},
+    { "gdk_pixbuf_animation_get_width",  cast(void**)& gdk_pixbuf_animation_get_width},
+    { "gdk_pixbuf_animation_unref",  cast(void**)& gdk_pixbuf_animation_unref},
+    { "gdk_pixbuf_animation_ref",  cast(void**)& gdk_pixbuf_animation_ref},
+    { "gdk_pixbuf_animation_new_from_file",  cast(void**)& gdk_pixbuf_animation_new_from_file},
+    { "gdk_pixbuf_animation_get_type",  cast(void**)& gdk_pixbuf_animation_get_type},
+    { "gdk_pixbuf_flip",  cast(void**)& gdk_pixbuf_flip},
+    { "gdk_pixbuf_rotate_simple",  cast(void**)& gdk_pixbuf_rotate_simple},
+    { "gdk_pixbuf_composite_color_simple",  cast(void**)& gdk_pixbuf_composite_color_simple},
+    { "gdk_pixbuf_scale_simple",  cast(void**)& gdk_pixbuf_scale_simple},
+    { "gdk_pixbuf_composite_color",  cast(void**)& gdk_pixbuf_composite_color},
+    { "gdk_pixbuf_composite",  cast(void**)& gdk_pixbuf_composite},
+    { "gdk_pixbuf_scale",  cast(void**)& gdk_pixbuf_scale},
+    { "gdk_pixbuf_get_option",  cast(void**)& gdk_pixbuf_get_option},
+    { "gdk_pixbuf_apply_embedded_orientation",  cast(void**)& gdk_pixbuf_apply_embedded_orientation},
+    { "gdk_pixbuf_saturate_and_pixelate",  cast(void**)& gdk_pixbuf_saturate_and_pixelate},
+    { "gdk_pixbuf_copy_area",  cast(void**)& gdk_pixbuf_copy_area},
+    { "gdk_pixbuf_add_alpha",  cast(void**)& gdk_pixbuf_add_alpha},
+    { "gdk_pixbuf_save_to_bufferv",  cast(void**)& gdk_pixbuf_save_to_bufferv},
+    { "gdk_pixbuf_save_to_buffer",  cast(void**)& gdk_pixbuf_save_to_buffer},
+    { "gdk_pixbuf_save_to_callbackv",  cast(void**)& gdk_pixbuf_save_to_callbackv},
+    { "gdk_pixbuf_save_to_callback",  cast(void**)& gdk_pixbuf_save_to_callback},
+    { "gdk_pixbuf_savev",  cast(void**)& gdk_pixbuf_savev},
+    { "gdk_pixbuf_save",  cast(void**)& gdk_pixbuf_save},
+    { "gdk_pixbuf_fill",  cast(void**)& gdk_pixbuf_fill},
+    { "gdk_pixbuf_new_from_inline",  cast(void**)& gdk_pixbuf_new_from_inline},
+    { "gdk_pixbuf_new_from_xpm_data",  cast(void**)& gdk_pixbuf_new_from_xpm_data},
+    { "gdk_pixbuf_new_from_data",  cast(void**)& gdk_pixbuf_new_from_data},
+    { "gdk_pixbuf_new_from_file_at_scale",  cast(void**)& gdk_pixbuf_new_from_file_at_scale},
+    { "gdk_pixbuf_new_from_file_at_size",  cast(void**)& gdk_pixbuf_new_from_file_at_size},
+    { "gdk_pixbuf_new_from_file",  cast(void**)& gdk_pixbuf_new_from_file},
+    { "gdk_pixbuf_new_subpixbuf",  cast(void**)& gdk_pixbuf_new_subpixbuf},
+    { "gdk_pixbuf_copy",  cast(void**)& gdk_pixbuf_copy},
+    { "gdk_pixbuf_new",  cast(void**)& gdk_pixbuf_new},
+    { "gdk_pixbuf_get_rowstride",  cast(void**)& gdk_pixbuf_get_rowstride},
+    { "gdk_pixbuf_get_height",  cast(void**)& gdk_pixbuf_get_height},
+    { "gdk_pixbuf_get_width",  cast(void**)& gdk_pixbuf_get_width},
+    { "gdk_pixbuf_get_pixels",  cast(void**)& gdk_pixbuf_get_pixels},
+    { "gdk_pixbuf_get_bits_per_sample",  cast(void**)& gdk_pixbuf_get_bits_per_sample},
+    { "gdk_pixbuf_get_has_alpha",  cast(void**)& gdk_pixbuf_get_has_alpha},
+    { "gdk_pixbuf_get_n_channels",  cast(void**)& gdk_pixbuf_get_n_channels},
+    { "gdk_pixbuf_get_colorspace",  cast(void**)& gdk_pixbuf_get_colorspace},
+    { "gdk_pixbuf_unref",  cast(void**)& gdk_pixbuf_unref},
+    { "gdk_pixbuf_ref",  cast(void**)& gdk_pixbuf_ref},
+    { "gdk_pixbuf_get_type",  cast(void**)& gdk_pixbuf_get_type},
+    { "gdk_pixbuf_error_quark",  cast(void**)& gdk_pixbuf_error_quark},
+    { "gdk_pixbuf_version",  cast(void**)& gdk_pixbuf_version},
+    { "gdk_pixbuf_micro_version",  cast(void**)& gdk_pixbuf_micro_version},
+    { "gdk_pixbuf_minor_version",  cast(void**)& gdk_pixbuf_minor_version},
+    { "gdk_pixbuf_major_version",  cast(void**)& gdk_pixbuf_major_version},
+    { "gdk_rgb_colormap_ditherable",  cast(void**)& gdk_rgb_colormap_ditherable},
+    { "gdk_rgb_ditherable",  cast(void**)& gdk_rgb_ditherable},
+    { "gdk_rgb_get_visual",  cast(void**)& gdk_rgb_get_visual},
+    { "gdk_rgb_get_colormap",  cast(void**)& gdk_rgb_get_colormap},
+    { "gdk_rgb_set_min_colors",  cast(void**)& gdk_rgb_set_min_colors},
+    { "gdk_rgb_set_install",  cast(void**)& gdk_rgb_set_install},
+    { "gdk_rgb_set_verbose",  cast(void**)& gdk_rgb_set_verbose},
+    { "gdk_rgb_cmap_free",  cast(void**)& gdk_rgb_cmap_free},
+    { "gdk_rgb_cmap_new",  cast(void**)& gdk_rgb_cmap_new},
+    { "gdk_draw_indexed_image",  cast(void**)& gdk_draw_indexed_image},
+    { "gdk_draw_gray_image",  cast(void**)& gdk_draw_gray_image},
+    { "gdk_draw_rgb_32_image_dithalign",  cast(void**)& gdk_draw_rgb_32_image_dithalign},
+    { "gdk_draw_rgb_32_image",  cast(void**)& gdk_draw_rgb_32_image},
+    { "gdk_draw_rgb_image_dithalign",  cast(void**)& gdk_draw_rgb_image_dithalign},
+    { "gdk_draw_rgb_image",  cast(void**)& gdk_draw_rgb_image},
+    { "gdk_rgb_find_color",  cast(void**)& gdk_rgb_find_color},
+    { "gdk_rgb_gc_set_background",  cast(void**)& gdk_rgb_gc_set_background},
+    { "gdk_rgb_gc_set_foreground",  cast(void**)& gdk_rgb_gc_set_foreground},
+    { "gdk_rgb_xpixel_from_rgb",  cast(void**)& gdk_rgb_xpixel_from_rgb},
+    { "gdk_rgb_init",  cast(void**)& gdk_rgb_init},
+    { "gdk_colors_free",  cast(void**)& gdk_colors_free},
+    { "gdk_colors_alloc",  cast(void**)& gdk_colors_alloc},
+    { "gdk_color_change",  cast(void**)& gdk_color_change},
+    { "gdk_color_alloc",  cast(void**)& gdk_color_alloc},
+    { "gdk_color_black",  cast(void**)& gdk_color_black},
+    { "gdk_color_white",  cast(void**)& gdk_color_white},
+    { "gdk_colors_store",  cast(void**)& gdk_colors_store},
+    { "gdk_color_get_type",  cast(void**)& gdk_color_get_type},
+    { "gdk_color_to_string",  cast(void**)& gdk_color_to_string},
+    { "gdk_color_equal",  cast(void**)& gdk_color_equal},
+    { "gdk_color_hash",  cast(void**)& gdk_color_hash},
+    { "gdk_color_parse",  cast(void**)& gdk_color_parse},
+    { "gdk_color_free",  cast(void**)& gdk_color_free},
+    { "gdk_color_copy",  cast(void**)& gdk_color_copy},
+    { "gdk_colormap_get_visual",  cast(void**)& gdk_colormap_get_visual},
+    { "gdk_colormap_query_color",  cast(void**)& gdk_colormap_query_color},
+    { "gdk_colormap_free_colors",  cast(void**)& gdk_colormap_free_colors},
+    { "gdk_colormap_alloc_color",  cast(void**)& gdk_colormap_alloc_color},
+    { "gdk_colormap_alloc_colors",  cast(void**)& gdk_colormap_alloc_colors},
+    { "gdk_colormap_change",  cast(void**)& gdk_colormap_change},
+    { "gdk_colormap_get_system_size",  cast(void**)& gdk_colormap_get_system_size},
+    { "gdk_colormap_get_screen",  cast(void**)& gdk_colormap_get_screen},
+    { "gdk_colormap_get_system",  cast(void**)& gdk_colormap_get_system},
+    { "gdk_colormap_unref",  cast(void**)& gdk_colormap_unref},
+    { "gdk_colormap_ref",  cast(void**)& gdk_colormap_ref},
+    { "gdk_colormap_new",  cast(void**)& gdk_colormap_new},
+    { "gdk_colormap_get_type",  cast(void**)& gdk_colormap_get_type},
+];
+
+} else { // version(DYNLINK)
+extern (C) uint gdk_threads_add_timeout(uint, _BCD_func__5647, void *);
+extern (C) uint gdk_threads_add_timeout_full(int, uint, _BCD_func__5647, void *, _BCD_func__4634);
+extern (C) uint gdk_threads_add_idle(_BCD_func__5647, void *);
+extern (C) uint gdk_threads_add_idle_full(int, _BCD_func__5647, void *, _BCD_func__4634);
+extern (C) void gdk_threads_set_lock_functions(_BCD_func__5298, _BCD_func__5298);
+extern (C) void gdk_threads_init();
+extern (C) void gdk_threads_leave();
+extern (C) void gdk_threads_enter();
+extern (C) extern _BCD_func__5298 gdk_threads_unlock;
+extern (C) extern _BCD_func__5298 gdk_threads_lock;
+extern (C) extern void * gdk_threads_mutex;
+extern (C) void gdk_notify_startup_complete_with_id(char *);
+extern (C) void gdk_notify_startup_complete();
+extern (C) int gdk_event_send_client_message_for_display(_GdkDisplay *, _GdkEvent *, uint);
+extern (C) void gdk_event_send_clientmessage_toall(_GdkEvent *);
+extern (C) int gdk_event_send_client_message(_GdkEvent *, uint);
+extern (C) int gdk_mbstowcs(uint *, char *, int);
+extern (C) char * gdk_wcstombs(uint *);
+extern (C) uint gdk_rectangle_get_type();
+extern (C) void gdk_rectangle_union(_GdkRectangle *, _GdkRectangle *, _GdkRectangle *);
+extern (C) int gdk_rectangle_intersect(_GdkRectangle *, _GdkRectangle *, _GdkRectangle *);
+extern (C) void gdk_set_double_click_time(uint);
+extern (C) void gdk_flush();
+extern (C) void gdk_beep();
+extern (C) int gdk_screen_height_mm();
+extern (C) int gdk_screen_width_mm();
+extern (C) int gdk_screen_height();
+extern (C) int gdk_screen_width();
+extern (C) int gdk_pointer_is_grabbed();
+extern (C) void gdk_keyboard_ungrab(uint);
+extern (C) void gdk_pointer_ungrab(uint);
+extern (C) int gdk_keyboard_grab_info_libgtk_only(_GdkDisplay *, _GdkDrawable * *, int *);
+extern (C) int gdk_pointer_grab_info_libgtk_only(_GdkDisplay *, _GdkDrawable * *, int *);
+extern (C) int gdk_keyboard_grab(_GdkDrawable *, int, uint);
+extern (C) int gdk_pointer_grab(_GdkDrawable *, int, int, _GdkDrawable *, _GdkCursor *, uint);
+extern (C) void gdk_input_remove(int);
+extern (C) int gdk_input_add(int, int, _BCD_func__4635, void *);
+extern (C) int gdk_input_add_full(int, int, _BCD_func__4635, void *, _BCD_func__4634);
+extern (C) char * gdk_get_display_arg_name();
+extern (C) char * gdk_get_display();
+extern (C) int gdk_get_use_xshm();
+extern (C) void gdk_set_use_xshm(int);
+extern (C) int gdk_error_trap_pop();
+extern (C) void gdk_error_trap_push();
+extern (C) void gdk_set_program_class(char *);
+extern (C) char * gdk_get_program_class();
+extern (C) char * gdk_set_locale();
+extern (C) void gdk_exit(int);
+extern (C) void gdk_pre_parse_libgtk_only();
+extern (C) void gdk_add_option_entries_libgtk_only(void *);
+extern (C) int gdk_init_check(int *, char * * *);
+extern (C) void gdk_init(int *, char * * *);
+extern (C) void gdk_parse_args(int *, char * * *);
+extern (C) _GdkDrawable * gdk_get_default_root_window();
+extern (C) _GdkPointerHooks * gdk_set_pointer_hooks(_GdkPointerHooks *);
+extern (C) void gdk_window_configure_finished(_GdkDrawable *);
+extern (C) void gdk_window_enable_synchronized_configure(_GdkDrawable *);
+extern (C) void gdk_window_get_internal_paint_info(_GdkDrawable *, _GdkDrawable * *, int *, int *);
+extern (C) void gdk_window_constrain_size(_GdkGeometry *, uint, int, int, int *, int *);
+extern (C) void gdk_window_set_debug_updates(int);
+extern (C) void gdk_window_process_updates(_GdkDrawable *, int);
+extern (C) void gdk_window_process_all_updates();
+extern (C) void gdk_window_thaw_toplevel_updates_libgtk_only(_GdkDrawable *);
+extern (C) void gdk_window_freeze_toplevel_updates_libgtk_only(_GdkDrawable *);
+extern (C) void gdk_window_thaw_updates(_GdkDrawable *);
+extern (C) void gdk_window_freeze_updates(_GdkDrawable *);
+extern (C) void * gdk_window_get_update_area(_GdkDrawable *);
+extern (C) void gdk_window_invalidate_maybe_recurse(_GdkDrawable *, void *, _BCD_func__6008, void *);
+extern (C) void gdk_window_invalidate_region(_GdkDrawable *, void *, int);
+extern (C) void gdk_window_invalidate_rect(_GdkDrawable *, _GdkRectangle *, int);
+extern (C) void gdk_window_begin_move_drag(_GdkDrawable *, int, int, int, uint);
+extern (C) void gdk_window_begin_resize_drag(_GdkDrawable *, int, int, int, int, uint);
+extern (C) void gdk_window_register_dnd(_GdkDrawable *);
+extern (C) void gdk_window_set_opacity(_GdkDrawable *, double);
+extern (C) void gdk_window_set_keep_below(_GdkDrawable *, int);
+extern (C) void gdk_window_set_keep_above(_GdkDrawable *, int);
+extern (C) void gdk_window_unfullscreen(_GdkDrawable *);
+extern (C) void gdk_window_fullscreen(_GdkDrawable *);
+extern (C) void gdk_window_unmaximize(_GdkDrawable *);
+extern (C) void gdk_window_maximize(_GdkDrawable *);
+extern (C) void gdk_window_unstick(_GdkDrawable *);
+extern (C) void gdk_window_stick(_GdkDrawable *);
+extern (C) void gdk_window_deiconify(_GdkDrawable *);
+extern (C) void gdk_window_iconify(_GdkDrawable *);
+extern (C) void gdk_window_beep(_GdkDrawable *);
+extern (C) _GList * gdk_window_get_toplevels();
+extern (C) void gdk_window_set_functions(_GdkDrawable *, int);
+extern (C) int gdk_window_get_decorations(_GdkDrawable *, int *);
+extern (C) void gdk_window_set_decorations(_GdkDrawable *, int);
+extern (C) _GdkDrawable * gdk_window_get_group(_GdkDrawable *);
+extern (C) void gdk_window_set_group(_GdkDrawable *, _GdkDrawable *);
+extern (C) void gdk_window_set_icon_name(_GdkDrawable *, char *);
+extern (C) void gdk_window_set_icon(_GdkDrawable *, _GdkDrawable *, _GdkDrawable *, _GdkDrawable *);
+extern (C) void gdk_window_set_icon_list(_GdkDrawable *, _GList *);
+extern (C) void gdk_window_set_events(_GdkDrawable *, int);
+extern (C) int gdk_window_get_events(_GdkDrawable *);
+extern (C) _GList * gdk_window_peek_children(_GdkDrawable *);
+extern (C) _GList * gdk_window_get_children(_GdkDrawable *);
+extern (C) _GdkDrawable * gdk_window_get_toplevel(_GdkDrawable *);
+extern (C) _GdkDrawable * gdk_window_get_parent(_GdkDrawable *);
+extern (C) _GdkDrawable * gdk_window_get_pointer(_GdkDrawable *, int *, int *, int *);
+extern (C) void gdk_window_get_frame_extents(_GdkDrawable *, _GdkRectangle *);
+extern (C) void gdk_window_get_root_origin(_GdkDrawable *, int *, int *);
+extern (C) int gdk_window_get_deskrelative_origin(_GdkDrawable *, int *, int *);
+extern (C) int gdk_window_get_origin(_GdkDrawable *, int *, int *);
+extern (C) void gdk_window_get_position(_GdkDrawable *, int *, int *);
+extern (C) void gdk_window_get_geometry(_GdkDrawable *, int *, int *, int *, int *, int *);
+extern (C) void gdk_window_get_user_data(_GdkDrawable *, void * *);
+extern (C) void gdk_window_set_cursor(_GdkDrawable *, _GdkCursor *);
+extern (C) void gdk_window_set_back_pixmap(_GdkDrawable *, _GdkDrawable *, int);
+extern (C) void gdk_window_set_background(_GdkDrawable *, _GdkColor *);
+extern (C) void gdk_window_set_transient_for(_GdkDrawable *, _GdkDrawable *);
+extern (C) void gdk_window_set_startup_id(_GdkDrawable *, char *);
+extern (C) void gdk_window_set_role(_GdkDrawable *, char *);
+extern (C) void gdk_window_set_title(_GdkDrawable *, char *);
+extern (C) void gdk_window_end_paint(_GdkDrawable *);
+extern (C) void gdk_window_begin_paint_region(_GdkDrawable *, void *);
+extern (C) void gdk_window_begin_paint_rect(_GdkDrawable *, _GdkRectangle *);
+extern (C) void gdk_set_sm_client_id(char *);
+extern (C) void gdk_window_set_geometry_hints(_GdkDrawable *, _GdkGeometry *, int);
+extern (C) void gdk_window_set_urgency_hint(_GdkDrawable *, int);
+extern (C) void gdk_window_set_skip_pager_hint(_GdkDrawable *, int);
+extern (C) void gdk_window_set_skip_taskbar_hint(_GdkDrawable *, int);
+extern (C) void gdk_window_set_modal_hint(_GdkDrawable *, int);
+extern (C) int gdk_window_get_type_hint(_GdkDrawable *);
+extern (C) void gdk_window_set_type_hint(_GdkDrawable *, int);
+extern (C) void gdk_window_set_hints(_GdkDrawable *, int, int, int, int, int, int, int);
+extern (C) _GdkDrawable * gdk_window_lookup_for_display(_GdkDisplay *, uint);
+extern (C) _GdkDrawable * gdk_window_foreign_new_for_display(_GdkDisplay *, uint);
+extern (C) _GdkDrawable * gdk_window_lookup(uint);
+extern (C) _GdkDrawable * gdk_window_foreign_new(uint);
+extern (C) int gdk_window_set_static_gravities(_GdkDrawable *, int);
+extern (C) int gdk_window_get_state(_GdkDrawable *);
+extern (C) int gdk_window_is_viewable(_GdkDrawable *);
+extern (C) int gdk_window_is_visible(_GdkDrawable *);
+extern (C) void gdk_window_merge_child_input_shapes(_GdkDrawable *);
+extern (C) void gdk_window_set_child_input_shapes(_GdkDrawable *);
+extern (C) void gdk_window_input_shape_combine_region(_GdkDrawable *, void *, int, int);
+extern (C) void gdk_window_input_shape_combine_mask(_GdkDrawable *, _GdkDrawable *, int, int);
+extern (C) void gdk_window_merge_child_shapes(_GdkDrawable *);
+extern (C) void gdk_window_set_composited(_GdkDrawable *, int);
+extern (C) void gdk_window_set_child_shapes(_GdkDrawable *);
+extern (C) void gdk_window_shape_combine_region(_GdkDrawable *, void *, int, int);
+extern (C) void gdk_window_shape_combine_mask(_GdkDrawable *, _GdkDrawable *, int, int);
+extern (C) void gdk_window_move_region(_GdkDrawable *, void *, int, int);
+extern (C) void gdk_window_scroll(_GdkDrawable *, int, int);
+extern (C) void gdk_window_remove_filter(_GdkDrawable *, _BCD_func__4335, void *);
+extern (C) void gdk_window_add_filter(_GdkDrawable *, _BCD_func__4335, void *);
+extern (C) void gdk_window_set_focus_on_map(_GdkDrawable *, int);
+extern (C) void gdk_window_set_accept_focus(_GdkDrawable *, int);
+extern (C) void gdk_window_set_override_redirect(_GdkDrawable *, int);
+extern (C) void gdk_window_set_user_data(_GdkDrawable *, void *);
+extern (C) void gdk_window_focus(_GdkDrawable *, uint);
+extern (C) void gdk_window_lower(_GdkDrawable *);
+extern (C) void gdk_window_raise(_GdkDrawable *);
+extern (C) void gdk_window_clear_area_e(_GdkDrawable *, int, int, int, int);
+extern (C) void gdk_window_clear_area(_GdkDrawable *, int, int, int, int);
+extern (C) void gdk_window_clear(_GdkDrawable *);
+extern (C) void gdk_window_reparent(_GdkDrawable *, _GdkDrawable *, int, int);
+extern (C) void gdk_window_move_resize(_GdkDrawable *, int, int, int, int);
+extern (C) void gdk_window_resize(_GdkDrawable *, int, int);
+extern (C) void gdk_window_move(_GdkDrawable *, int, int);
+extern (C) void gdk_window_show_unraised(_GdkDrawable *);
+extern (C) void gdk_window_withdraw(_GdkDrawable *);
+extern (C) void gdk_window_hide(_GdkDrawable *);
+extern (C) void gdk_window_show(_GdkDrawable *);
+extern (C) _GdkDrawable * gdk_window_at_pointer(int *, int *);
+extern (C) int gdk_window_get_window_type(_GdkDrawable *);
+extern (C) void gdk_window_destroy(_GdkDrawable *);
+extern (C) _GdkDrawable * gdk_window_new(_GdkDrawable *, _GdkWindowAttr *, int);
+extern (C) uint gdk_window_object_get_type();
+extern (C) _GdkScreen * gdk_visual_get_screen(_GdkVisual *);
+extern (C) _GList * gdk_list_visuals();
+extern (C) void gdk_query_visual_types(int * *, int *);
+extern (C) void gdk_query_depths(int * *, int *);
+extern (C) _GdkVisual * gdk_visual_get_best_with_both(int, int);
+extern (C) _GdkVisual * gdk_visual_get_best_with_type(int);
+extern (C) _GdkVisual * gdk_visual_get_best_with_depth(int);
+extern (C) _GdkVisual * gdk_visual_get_best();
+extern (C) _GdkVisual * gdk_visual_get_system();
+extern (C) int gdk_visual_get_best_type();
+extern (C) int gdk_visual_get_best_depth();
+extern (C) uint gdk_visual_get_type();
+extern (C) int gdk_spawn_command_line_on_screen(_GdkScreen *, char *, _GError * *);
+extern (C) int gdk_spawn_on_screen_with_pipes(_GdkScreen *, char *, char * *, char * *, int, _BCD_func__4634, void *, int *, int *, int *, int *, _GError * *);
+extern (C) int gdk_spawn_on_screen(_GdkScreen *, char *, char * *, char * *, int, _BCD_func__4634, void *, int *, _GError * *);
+extern (C) void gdk_selection_send_notify_for_display(_GdkDisplay *, uint, void *, void *, void *, uint);
+extern (C) void gdk_selection_send_notify(uint, void *, void *, void *, uint);
+extern (C) int gdk_selection_property_get(_GdkDrawable *, char * *, void * *, int *);
+extern (C) void gdk_selection_convert(_GdkDrawable *, void *, void *, uint);
+extern (C) _GdkDrawable * gdk_selection_owner_get_for_display(_GdkDisplay *, void *);
+extern (C) int gdk_selection_owner_set_for_display(_GdkDisplay *, _GdkDrawable *, void *, uint, int);
+extern (C) _GdkDrawable * gdk_selection_owner_get(void *);
+extern (C) int gdk_selection_owner_set(_GdkDrawable *, void *, uint, int);
+extern (C) _GList * gdk_screen_get_window_stack(_GdkScreen *);
+extern (C) _GdkDrawable * gdk_screen_get_active_window(_GdkScreen *);
+extern (C) double gdk_screen_get_resolution(_GdkScreen *);
+extern (C) void gdk_screen_set_resolution(_GdkScreen *, double);
+extern (C) void * gdk_screen_get_font_options(_GdkScreen *);
+extern (C) void gdk_screen_set_font_options(_GdkScreen *, void *);
+extern (C) int gdk_screen_get_setting(_GdkScreen *, char *, _GValue *);
+extern (C) _GdkScreen * gdk_screen_get_default();
+extern (C) void gdk_screen_broadcast_client_message(_GdkScreen *, _GdkEvent *);
+extern (C) int gdk_screen_get_monitor_at_window(_GdkScreen *, _GdkDrawable *);
+extern (C) int gdk_screen_get_monitor_at_point(_GdkScreen *, int, int);
+extern (C) void gdk_screen_get_monitor_geometry(_GdkScreen *, int, _GdkRectangle *);
+extern (C) int gdk_screen_get_n_monitors(_GdkScreen *);
+extern (C) char * gdk_screen_make_display_name(_GdkScreen *);
+extern (C) _GList * gdk_screen_get_toplevel_windows(_GdkScreen *);
+extern (C) _GList * gdk_screen_list_visuals(_GdkScreen *);
+extern (C) int gdk_screen_get_height_mm(_GdkScreen *);
+extern (C) int gdk_screen_get_width_mm(_GdkScreen *);
+extern (C) int gdk_screen_get_height(_GdkScreen *);
+extern (C) int gdk_screen_get_width(_GdkScreen *);
+extern (C) int gdk_screen_get_number(_GdkScreen *);
+extern (C) _GdkDisplay * gdk_screen_get_display(_GdkScreen *);
+extern (C) _GdkDrawable * gdk_screen_get_root_window(_GdkScreen *);
+extern (C) int gdk_screen_is_composited(_GdkScreen *);
+extern (C) _GdkVisual * gdk_screen_get_rgba_visual(_GdkScreen *);
+extern (C) _GdkColormap * gdk_screen_get_rgba_colormap(_GdkScreen *);
+extern (C) _GdkVisual * gdk_screen_get_rgb_visual(_GdkScreen *);
+extern (C) _GdkColormap * gdk_screen_get_rgb_colormap(_GdkScreen *);
+extern (C) _GdkVisual * gdk_screen_get_system_visual(_GdkScreen *);
+extern (C) _GdkColormap * gdk_screen_get_system_colormap(_GdkScreen *);
+extern (C) void gdk_screen_set_default_colormap(_GdkScreen *, _GdkColormap *);
+extern (C) _GdkColormap * gdk_screen_get_default_colormap(_GdkScreen *);
+extern (C) uint gdk_screen_get_type();
+extern (C) void gdk_region_spans_intersect_foreach(void *, _GdkSpan *, int, int, _BCD_func__4157, void *);
+extern (C) void gdk_region_xor(void *, void *);
+extern (C) void gdk_region_subtract(void *, void *);
+extern (C) void gdk_region_union(void *, void *);
+extern (C) void gdk_region_intersect(void *, void *);
+extern (C) void gdk_region_union_with_rect(void *, _GdkRectangle *);
+extern (C) void gdk_region_shrink(void *, int, int);
+extern (C) void gdk_region_offset(void *, int, int);
+extern (C) int gdk_region_rect_in(void *, _GdkRectangle *);
+extern (C) int gdk_region_point_in(void *, int, int);
+extern (C) int gdk_region_equal(void *, void *);
+extern (C) int gdk_region_empty(void *);
+extern (C) void gdk_region_get_rectangles(void *, _GdkRectangle * *, int *);
+extern (C) void gdk_region_get_clipbox(void *, _GdkRectangle *);
+extern (C) void gdk_region_destroy(void *);
+extern (C) void * gdk_region_rectangle(_GdkRectangle *);
+extern (C) void * gdk_region_copy(void *);
+extern (C) void * gdk_region_polygon(_GdkPoint *, int, int);
+extern (C) void * gdk_region_new();
+extern (C) void gdk_free_compound_text(char *);
+extern (C) void gdk_free_text_list(char * *);
+extern (C) int gdk_utf8_to_compound_text_for_display(_GdkDisplay *, char *, void * *, int *, char * *, int *);
+extern (C) int gdk_string_to_compound_text_for_display(_GdkDisplay *, char *, void * *, int *, char * *, int *);
+extern (C) char * gdk_utf8_to_string_target(char *);
+extern (C) int gdk_text_property_to_utf8_list_for_display(_GdkDisplay *, void *, int, char *, int, char * * *);
+extern (C) int gdk_text_property_to_text_list_for_display(_GdkDisplay *, void *, int, char *, int, char * * *);
+extern (C) int gdk_string_to_compound_text(char *, void * *, int *, char * *, int *);
+extern (C) int gdk_utf8_to_compound_text(char *, void * *, int *, char * *, int *);
+extern (C) int gdk_text_property_to_utf8_list(void *, int, char *, int, char * * *);
+extern (C) int gdk_text_property_to_text_list(void *, int, char *, int, char * * *);
+extern (C) void gdk_property_delete(_GdkDrawable *, void *);
+extern (C) void gdk_property_change(_GdkDrawable *, void *, void *, int, int, char *, int);
+extern (C) int gdk_property_get(_GdkDrawable *, void *, void *, uint, uint, int, void * *, int *, int *, char * *);
+extern (C) char * gdk_atom_name(void *);
+extern (C) void * gdk_atom_intern_static_string(char *);
+extern (C) void * gdk_atom_intern(char *, int);
+extern (C) _GdkDrawable * gdk_pixmap_foreign_new_for_screen(_GdkScreen *, uint, int, int, int);
+extern (C) _GdkDrawable * gdk_pixmap_lookup_for_display(_GdkDisplay *, uint);
+extern (C) _GdkDrawable * gdk_pixmap_foreign_new_for_display(_GdkDisplay *, uint);
+extern (C) _GdkDrawable * gdk_pixmap_lookup(uint);
+extern (C) _GdkDrawable * gdk_pixmap_foreign_new(uint);
+extern (C) _GdkDrawable * gdk_pixmap_colormap_create_from_xpm_d(_GdkDrawable *, _GdkColormap *, _GdkDrawable * *, _GdkColor *, char * *);
+extern (C) _GdkDrawable * gdk_pixmap_create_from_xpm_d(_GdkDrawable *, _GdkDrawable * *, _GdkColor *, char * *);
+extern (C) _GdkDrawable * gdk_pixmap_colormap_create_from_xpm(_GdkDrawable *, _GdkColormap *, _GdkDrawable * *, _GdkColor *, char *);
+extern (C) _GdkDrawable * gdk_pixmap_create_from_xpm(_GdkDrawable *, _GdkDrawable * *, _GdkColor *, char *);
+extern (C) _GdkDrawable * gdk_pixmap_create_from_data(_GdkDrawable *, char *, int, int, int, _GdkColor *, _GdkColor *);
+extern (C) _GdkDrawable * gdk_bitmap_create_from_data(_GdkDrawable *, char *, int, int);
+extern (C) _GdkDrawable * gdk_pixmap_new(_GdkDrawable *, int, int, int);
+extern (C) uint gdk_pixmap_get_type();
+extern (C) _PangoAttribute * gdk_pango_attr_emboss_color_new(_GdkColor *);
+extern (C) _PangoAttribute * gdk_pango_attr_embossed_new(int);
+extern (C) _PangoAttribute * gdk_pango_attr_stipple_new(_GdkDrawable *);
+extern (C) void * gdk_pango_layout_get_clip_region(void *, int, int, int *, int);
+extern (C) void * gdk_pango_layout_line_get_clip_region(_PangoLayoutLine *, int, int, int *, int);
+extern (C) void gdk_pango_context_set_colormap(void *, _GdkColormap *);
+extern (C) void * gdk_pango_context_get();
+extern (C) void * gdk_pango_context_get_for_screen(_GdkScreen *);
+extern (C) void gdk_pango_renderer_set_override_color(_GdkPangoRenderer *, int, _GdkColor *);
+extern (C) void gdk_pango_renderer_set_stipple(_GdkPangoRenderer *, int, _GdkDrawable *);
+extern (C) void gdk_pango_renderer_set_gc(_GdkPangoRenderer *, _GdkGC *);
+extern (C) void gdk_pango_renderer_set_drawable(_GdkPangoRenderer *, _GdkDrawable *);
+extern (C) _PangoRenderer * gdk_pango_renderer_get_default(_GdkScreen *);
+extern (C) _PangoRenderer * gdk_pango_renderer_new(_GdkScreen *);
+extern (C) uint gdk_pango_renderer_get_type();
+extern (C) _GSList * gdk_display_manager_list_displays(void *);
+extern (C) void gdk_display_manager_set_default_display(void *, _GdkDisplay *);
+extern (C) _GdkDisplay * gdk_display_manager_get_default_display(void *);
+extern (C) void * gdk_display_manager_get();
+extern (C) uint gdk_display_manager_get_type();
+extern (C) uint gdk_unicode_to_keyval(uint);
+extern (C) uint gdk_keyval_to_unicode(uint);
+extern (C) int gdk_keyval_is_lower(uint);
+extern (C) int gdk_keyval_is_upper(uint);
+extern (C) uint gdk_keyval_to_lower(uint);
+extern (C) uint gdk_keyval_to_upper(uint);
+extern (C) void gdk_keyval_convert_case(uint, uint *, uint *);
+extern (C) uint gdk_keyval_from_name(char *);
+extern (C) char * gdk_keyval_name(uint);
+extern (C) int gdk_keymap_have_bidi_layouts(_GdkKeymap *);
+extern (C) int gdk_keymap_get_direction(_GdkKeymap *);
+extern (C) int gdk_keymap_get_entries_for_keycode(_GdkKeymap *, uint, _GdkKeymapKey * *, uint * *, int *);
+extern (C) int gdk_keymap_get_entries_for_keyval(_GdkKeymap *, uint, _GdkKeymapKey * *, int *);
+extern (C) int gdk_keymap_translate_keyboard_state(_GdkKeymap *, uint, int, int, uint *, int *, int *, int *);
+extern (C) uint gdk_keymap_lookup_key(_GdkKeymap *, _GdkKeymapKey *);
+extern (C) _GdkKeymap * gdk_keymap_get_for_display(_GdkDisplay *);
+extern (C) _GdkKeymap * gdk_keymap_get_default();
+extern (C) uint gdk_keymap_get_type();
+extern (C) _GdkColormap * gdk_image_get_colormap(_GdkImage *);
+extern (C) void gdk_image_set_colormap(_GdkImage *, _GdkColormap *);
+extern (C) uint gdk_image_get_pixel(_GdkImage *, int, int);
+extern (C) void gdk_image_put_pixel(_GdkImage *, int, int, uint);
+extern (C) void gdk_image_unref(_GdkImage *);
+extern (C) _GdkImage * gdk_image_ref(_GdkImage *);
+extern (C) _GdkImage * gdk_image_get(_GdkDrawable *, int, int, int, int);
+extern (C) _GdkImage * gdk_image_new(int, _GdkVisual *, int, int);
+extern (C) uint gdk_image_get_type();
+extern (C) _GdkDisplay * gdk_font_get_display(_GdkFont *);
+extern (C) void gdk_string_extents(_GdkFont *, char *, int *, int *, int *, int *, int *);
+extern (C) void gdk_text_extents_wc(_GdkFont *, uint *, int, int *, int *, int *, int *, int *);
+extern (C) void gdk_text_extents(_GdkFont *, char *, int, int *, int *, int *, int *, int *);
+extern (C) int gdk_char_height(_GdkFont *, char);
+extern (C) int gdk_text_height(_GdkFont *, char *, int);
+extern (C) int gdk_string_height(_GdkFont *, char *);
+extern (C) int gdk_char_measure(_GdkFont *, char);
+extern (C) int gdk_text_measure(_GdkFont *, char *, int);
+extern (C) int gdk_string_measure(_GdkFont *, char *);
+extern (C) int gdk_char_width_wc(_GdkFont *, uint);
+extern (C) int gdk_char_width(_GdkFont *, char);
+extern (C) int gdk_text_width_wc(_GdkFont *, uint *, int);
+extern (C) int gdk_text_width(_GdkFont *, char *, int);
+extern (C) int gdk_string_width(_GdkFont *, char *);
+extern (C) _GdkFont * gdk_font_from_description(void *);
+extern (C) _GdkFont * gdk_fontset_load(char *);
+extern (C) _GdkFont * gdk_font_load(char *);
+extern (C) _GdkFont * gdk_font_from_description_for_display(_GdkDisplay *, void *);
+extern (C) _GdkFont * gdk_fontset_load_for_display(_GdkDisplay *, char *);
+extern (C) _GdkFont * gdk_font_load_for_display(_GdkDisplay *, char *);
+extern (C) int gdk_font_equal(_GdkFont *, _GdkFont *);
+extern (C) int gdk_font_id(_GdkFont *);
+extern (C) void gdk_font_unref(_GdkFont *);
+extern (C) _GdkFont * gdk_font_ref(_GdkFont *);
+extern (C) uint gdk_font_get_type();
+extern (C) uint gdk_window_edge_get_type();
+extern (C) uint gdk_gravity_get_type();
+extern (C) uint gdk_wm_function_get_type();
+extern (C) uint gdk_wm_decoration_get_type();
+extern (C) uint gdk_window_type_hint_get_type();
+extern (C) uint gdk_window_hints_get_type();
+extern (C) uint gdk_window_attributes_type_get_type();
+extern (C) uint gdk_window_type_get_type();
+extern (C) uint gdk_window_class_get_type();
+extern (C) uint gdk_visual_type_get_type();
+extern (C) uint gdk_grab_status_get_type();
+extern (C) uint gdk_status_get_type();
+extern (C) uint gdk_input_condition_get_type();
+extern (C) uint gdk_modifier_type_get_type();
+extern (C) uint gdk_byte_order_get_type();
+extern (C) uint gdk_rgb_dither_get_type();
+extern (C) uint gdk_overlap_type_get_type();
+extern (C) uint gdk_fill_rule_get_type();
+extern (C) uint gdk_prop_mode_get_type();
+extern (C) uint gdk_axis_use_get_type();
+extern (C) uint gdk_input_mode_get_type();
+extern (C) uint gdk_input_source_get_type();
+extern (C) uint gdk_extension_mode_get_type();
+extern (C) uint gdk_image_type_get_type();
+extern (C) uint gdk_gc_values_mask_get_type();
+extern (C) uint gdk_subwindow_mode_get_type();
+extern (C) uint gdk_line_style_get_type();
+extern (C) uint gdk_join_style_get_type();
+extern (C) uint gdk_function_get_type();
+extern (C) uint gdk_fill_get_type();
+extern (C) uint gdk_cap_style_get_type();
+extern (C) uint gdk_font_type_get_type();
+extern (C) uint gdk_owner_change_get_type();
+extern (C) uint gdk_setting_action_get_type();
+extern (C) uint gdk_window_state_get_type();
+extern (C) uint gdk_property_state_get_type();
+extern (C) uint gdk_crossing_mode_get_type();
+extern (C) uint gdk_notify_type_get_type();
+extern (C) uint gdk_scroll_direction_get_type();
+extern (C) uint gdk_visibility_state_get_type();
+extern (C) uint gdk_event_mask_get_type();
+extern (C) uint gdk_event_type_get_type();
+extern (C) uint gdk_filter_return_get_type();
+extern (C) uint gdk_drag_protocol_get_type();
+extern (C) uint gdk_drag_action_get_type();
+extern (C) uint gdk_cursor_type_get_type();
+extern (C) void * gdk_drawable_get_visible_region(_GdkDrawable *);
+extern (C) void * gdk_drawable_get_clip_region(_GdkDrawable *);
+extern (C) _GdkImage * gdk_drawable_copy_to_image(_GdkDrawable *, _GdkImage *, int, int, int, int, int, int);
+extern (C) _GdkImage * gdk_drawable_get_image(_GdkDrawable *, int, int, int, int);
+extern (C) void gdk_draw_trapezoids(_GdkDrawable *, _GdkGC *, _GdkTrapezoid *, int);
+extern (C) void gdk_draw_glyphs_transformed(_GdkDrawable *, _GdkGC *, _PangoMatrix *, void *, int, int, _PangoGlyphString *);
+extern (C) void gdk_draw_layout_with_colors(_GdkDrawable *, _GdkGC *, int, int, void *, _GdkColor *, _GdkColor *);
+extern (C) void gdk_draw_layout_line_with_colors(_GdkDrawable *, _GdkGC *, int, int, _PangoLayoutLine *, _GdkColor *, _GdkColor *);
+extern (C) void gdk_draw_layout(_GdkDrawable *, _GdkGC *, int, int, void *);
+extern (C) void gdk_draw_layout_line(_GdkDrawable *, _GdkGC *, int, int, _PangoLayoutLine *);
+extern (C) void gdk_draw_glyphs(_GdkDrawable *, _GdkGC *, void *, int, int, _PangoGlyphString *);
+extern (C) void gdk_draw_pixbuf(_GdkDrawable *, _GdkGC *, void *, int, int, int, int, int, int, int, int, int);
+extern (C) void gdk_draw_lines(_GdkDrawable *, _GdkGC *, _GdkPoint *, int);
+extern (C) void gdk_draw_segments(_GdkDrawable *, _GdkGC *, _GdkSegment *, int);
+extern (C) void gdk_draw_points(_GdkDrawable *, _GdkGC *, _GdkPoint *, int);
+extern (C) void gdk_draw_image(_GdkDrawable *, _GdkGC *, _GdkImage *, int, int, int, int, int, int);
+extern (C) void gdk_draw_drawable(_GdkDrawable *, _GdkGC *, _GdkDrawable *, int, int, int, int, int, int);
+extern (C) void gdk_draw_text_wc(_GdkDrawable *, _GdkFont *, _GdkGC *, int, int, uint *, int);
+extern (C) void gdk_draw_text(_GdkDrawable *, _GdkFont *, _GdkGC *, int, int, char *, int);
+extern (C) void gdk_draw_string(_GdkDrawable *, _GdkFont *, _GdkGC *, int, int, char *);
+extern (C) void gdk_draw_polygon(_GdkDrawable *, _GdkGC *, int, _GdkPoint *, int);
+extern (C) void gdk_draw_arc(_GdkDrawable *, _GdkGC *, int, int, int, int, int, int, int);
+extern (C) void gdk_draw_rectangle(_GdkDrawable *, _GdkGC *, int, int, int, int, int);
+extern (C) void gdk_draw_line(_GdkDrawable *, _GdkGC *, int, int, int, int);
+extern (C) void gdk_draw_point(_GdkDrawable *, _GdkGC *, int, int);
+extern (C) void gdk_drawable_unref(_GdkDrawable *);
+extern (C) _GdkDrawable * gdk_drawable_ref(_GdkDrawable *);
+extern (C) _GdkDisplay * gdk_drawable_get_display(_GdkDrawable *);
+extern (C) _GdkScreen * gdk_drawable_get_screen(_GdkDrawable *);
+extern (C) int gdk_drawable_get_depth(_GdkDrawable *);
+extern (C) _GdkVisual * gdk_drawable_get_visual(_GdkDrawable *);
+extern (C) _GdkColormap * gdk_drawable_get_colormap(_GdkDrawable *);
+extern (C) void gdk_drawable_set_colormap(_GdkDrawable *, _GdkColormap *);
+extern (C) void gdk_drawable_get_size(_GdkDrawable *, int *, int *);
+extern (C) void * gdk_drawable_get_data(_GdkDrawable *, char *);
+extern (C) void gdk_drawable_set_data(_GdkDrawable *, char *, void *, _BCD_func__4634);
+extern (C) uint gdk_drawable_get_type();
+extern (C) _GdkScreen * gdk_gc_get_screen(_GdkGC *);
+extern (C) void gdk_gc_set_rgb_bg_color(_GdkGC *, _GdkColor *);
+extern (C) void gdk_gc_set_rgb_fg_color(_GdkGC *, _GdkColor *);
+extern (C) _GdkColormap * gdk_gc_get_colormap(_GdkGC *);
+extern (C) void gdk_gc_set_colormap(_GdkGC *, _GdkColormap *);
+extern (C) void gdk_gc_copy(_GdkGC *, _GdkGC *);
+extern (C) void gdk_gc_offset(_GdkGC *, int, int);
+extern (C) void gdk_gc_set_dashes(_GdkGC *, int, char *, int);
+extern (C) void gdk_gc_set_line_attributes(_GdkGC *, int, int, int, int);
+extern (C) void gdk_gc_set_exposures(_GdkGC *, int);
+extern (C) void gdk_gc_set_subwindow(_GdkGC *, int);
+extern (C) void gdk_gc_set_clip_region(_GdkGC *, void *);
+extern (C) void gdk_gc_set_clip_rectangle(_GdkGC *, _GdkRectangle *);
+extern (C) void gdk_gc_set_clip_mask(_GdkGC *, _GdkDrawable *);
+extern (C) void gdk_gc_set_clip_origin(_GdkGC *, int, int);
+extern (C) void gdk_gc_set_ts_origin(_GdkGC *, int, int);
+extern (C) void gdk_gc_set_stipple(_GdkGC *, _GdkDrawable *);
+extern (C) void gdk_gc_set_tile(_GdkGC *, _GdkDrawable *);
+extern (C) void gdk_gc_set_fill(_GdkGC *, int);
+extern (C) void gdk_gc_set_function(_GdkGC *, int);
+extern (C) void gdk_gc_set_font(_GdkGC *, _GdkFont *);
+extern (C) void gdk_gc_set_background(_GdkGC *, _GdkColor *);
+extern (C) void gdk_gc_set_foreground(_GdkGC *, _GdkColor *);
+extern (C) void gdk_gc_set_values(_GdkGC *, _GdkGCValues *, int);
+extern (C) void gdk_gc_get_values(_GdkGC *, _GdkGCValues *);
+extern (C) void gdk_gc_unref(_GdkGC *);
+extern (C) _GdkGC * gdk_gc_ref(_GdkGC *);
+extern (C) _GdkGC * gdk_gc_new_with_values(_GdkDrawable *, _GdkGCValues *, int);
+extern (C) _GdkGC * gdk_gc_new(_GdkDrawable *);
+extern (C) uint gdk_gc_get_type();
+extern (C) int gdk_display_supports_composite(_GdkDisplay *);
+extern (C) int gdk_display_supports_input_shapes(_GdkDisplay *);
+extern (C) int gdk_display_supports_shapes(_GdkDisplay *);
+extern (C) void gdk_display_store_clipboard(_GdkDisplay *, _GdkDrawable *, uint, void * *, int);
+extern (C) int gdk_display_supports_clipboard_persistence(_GdkDisplay *);
+extern (C) int gdk_display_request_selection_notification(_GdkDisplay *, void *);
+extern (C) int gdk_display_supports_selection_notification(_GdkDisplay *);
+extern (C) _GdkDrawable * gdk_display_get_default_group(_GdkDisplay *);
+extern (C) void gdk_display_get_maximal_cursor_size(_GdkDisplay *, uint *, uint *);
+extern (C) uint gdk_display_get_default_cursor_size(_GdkDisplay *);
+extern (C) int gdk_display_supports_cursor_color(_GdkDisplay *);
+extern (C) int gdk_display_supports_cursor_alpha(_GdkDisplay *);
+extern (C) _GdkDisplay * gdk_display_open_default_libgtk_only();
+extern (C) _GdkDisplayPointerHooks * gdk_display_set_pointer_hooks(_GdkDisplay *, _GdkDisplayPointerHooks *);
+extern (C) void gdk_display_warp_pointer(_GdkDisplay *, _GdkScreen *, int, int);
+extern (C) _GdkDrawable * gdk_display_get_window_at_pointer(_GdkDisplay *, int *, int *);
+extern (C) void gdk_display_get_pointer(_GdkDisplay *, _GdkScreen * *, int *, int *, int *);
+extern (C) _GdkDevice * gdk_display_get_core_pointer(_GdkDisplay *);
+extern (C) _GdkDisplay * gdk_display_get_default();
+extern (C) void gdk_display_set_double_click_distance(_GdkDisplay *, uint);
+extern (C) void gdk_display_set_double_click_time(_GdkDisplay *, uint);
+extern (C) void gdk_display_add_client_message_filter(_GdkDisplay *, void *, _BCD_func__4335, void *);
+extern (C) void gdk_display_put_event(_GdkDisplay *, _GdkEvent *);
+extern (C) _GdkEvent * gdk_display_peek_event(_GdkDisplay *);
+extern (C) _GdkEvent * gdk_display_get_event(_GdkDisplay *);
+extern (C) _GList * gdk_display_list_devices(_GdkDisplay *);
+extern (C) void gdk_display_close(_GdkDisplay *);
+extern (C) void gdk_display_flush(_GdkDisplay *);
+extern (C) void gdk_display_sync(_GdkDisplay *);
+extern (C) void gdk_display_beep(_GdkDisplay *);
+extern (C) int gdk_display_pointer_is_grabbed(_GdkDisplay *);
+extern (C) void gdk_display_keyboard_ungrab(_GdkDisplay *, uint);
+extern (C) void gdk_display_pointer_ungrab(_GdkDisplay *, uint);
+extern (C) _GdkScreen * gdk_display_get_default_screen(_GdkDisplay *);
+extern (C) _GdkScreen * gdk_display_get_screen(_GdkDisplay *, int);
+extern (C) int gdk_display_get_n_screens(_GdkDisplay *);
+extern (C) char * gdk_display_get_name(_GdkDisplay *);
+extern (C) _GdkDisplay * gdk_display_open(char *);
+extern (C) uint gdk_display_get_type();
+extern (C) int gdk_setting_get(char *, _GValue *);
+extern (C) void gdk_add_client_message_filter(void *, _BCD_func__4335, void *);
+extern (C) int gdk_get_show_events();
+extern (C) void gdk_set_show_events(int);
+extern (C) _GdkScreen * gdk_event_get_screen(_GdkEvent *);
+extern (C) void gdk_event_set_screen(_GdkEvent *, _GdkScreen *);
+extern (C) void gdk_event_handler_set(_BCD_func__4336, void *, _BCD_func__4634);
+extern (C) void gdk_event_request_motions(_GdkEventMotion *);
+extern (C) int gdk_event_get_axis(_GdkEvent *, int, double *);
+extern (C) int gdk_event_get_root_coords(_GdkEvent *, double *, double *);
+extern (C) int gdk_event_get_coords(_GdkEvent *, double *, double *);
+extern (C) int gdk_event_get_state(_GdkEvent *, int *);
+extern (C) uint gdk_event_get_time(_GdkEvent *);
+extern (C) void gdk_event_free(_GdkEvent *);
+extern (C) _GdkEvent * gdk_event_copy(_GdkEvent *);
+extern (C) _GdkEvent * gdk_event_new(int);
+extern (C) void gdk_event_put(_GdkEvent *);
+extern (C) _GdkEvent * gdk_event_get_graphics_expose(_GdkDrawable *);
+extern (C) _GdkEvent * gdk_event_peek();
+extern (C) _GdkEvent * gdk_event_get();
+extern (C) int gdk_events_pending();
+extern (C) uint gdk_event_get_type();
+extern (C) _GdkDevice * gdk_device_get_core_pointer();
+extern (C) void gdk_input_set_extension_events(_GdkDrawable *, int, int);
+extern (C) int gdk_device_get_axis(_GdkDevice *, double *, int, double *);
+extern (C) void gdk_device_free_history(_GdkTimeCoord * *, int);
+extern (C) int gdk_device_get_history(_GdkDevice *, _GdkDrawable *, uint, uint, _GdkTimeCoord * * *, int *);
+extern (C) void gdk_device_get_state(_GdkDevice *, _GdkDrawable *, double *, int *);
+extern (C) void gdk_device_set_axis_use(_GdkDevice *, uint, int);
+extern (C) void gdk_device_set_key(_GdkDevice *, uint, uint, int);
+extern (C) int gdk_device_set_mode(_GdkDevice *, int);
+extern (C) void gdk_device_set_source(_GdkDevice *, int);
+extern (C) _GList * gdk_devices_list();
+extern (C) uint gdk_device_get_type();
+extern (C) int gdk_drag_drop_succeeded(_GdkDragContext *);
+extern (C) void gdk_drag_abort(_GdkDragContext *, uint);
+extern (C) void gdk_drag_drop(_GdkDragContext *, uint);
+extern (C) int gdk_drag_motion(_GdkDragContext *, _GdkDrawable *, int, int, int, int, int, uint);
+extern (C) void gdk_drag_find_window(_GdkDragContext *, _GdkDrawable *, int, int, _GdkDrawable * *, int *);
+extern (C) uint gdk_drag_get_protocol(uint, int *);
+extern (C) void gdk_drag_find_window_for_screen(_GdkDragContext *, _GdkDrawable *, _GdkScreen *, int, int, _GdkDrawable * *, int *);
+extern (C) uint gdk_drag_get_protocol_for_display(_GdkDisplay *, uint, int *);
+extern (C) _GdkDragContext * gdk_drag_begin(_GdkDrawable *, _GList *);
+extern (C) void * gdk_drag_get_selection(_GdkDragContext *);
+extern (C) void gdk_drop_finish(_GdkDragContext *, int, uint);
+extern (C) void gdk_drop_reply(_GdkDragContext *, int, uint);
+extern (C) void gdk_drag_status(_GdkDragContext *, int, uint);
+extern (C) void gdk_drag_context_unref(_GdkDragContext *);
+extern (C) void gdk_drag_context_ref(_GdkDragContext *);
+extern (C) _GdkDragContext * gdk_drag_context_new();
+extern (C) uint gdk_drag_context_get_type();
+extern (C) void * gdk_cursor_get_image(_GdkCursor *);
+extern (C) _GdkCursor * gdk_cursor_new_from_name(_GdkDisplay *, char *);
+extern (C) void gdk_cursor_unref(_GdkCursor *);
+extern (C) _GdkCursor * gdk_cursor_ref(_GdkCursor *);
+extern (C) _GdkDisplay * gdk_cursor_get_display(_GdkCursor *);
+extern (C) _GdkCursor * gdk_cursor_new_from_pixbuf(_GdkDisplay *, void *, int, int);
+extern (C) _GdkCursor * gdk_cursor_new_from_pixmap(_GdkDrawable *, _GdkDrawable *, _GdkColor *, _GdkColor *, int, int);
+extern (C) _GdkCursor * gdk_cursor_new(int);
+extern (C) _GdkCursor * gdk_cursor_new_for_display(_GdkDisplay *, int);
+extern (C) uint gdk_cursor_get_type();
+extern (C) void gdk_cairo_region(void *, void *);
+extern (C) void gdk_cairo_rectangle(void *, _GdkRectangle *);
+extern (C) void gdk_cairo_set_source_pixmap(void *, _GdkDrawable *, double, double);
+extern (C) void gdk_cairo_set_source_pixbuf(void *, void *, double, double);
+extern (C) void gdk_cairo_set_source_color(void *, _GdkColor *);
+extern (C) void * gdk_cairo_create(_GdkDrawable *);
+extern (C) void * gdk_pixbuf_get_from_image(void *, _GdkImage *, _GdkColormap *, int, int, int, int, int, int);
+extern (C) void * gdk_pixbuf_get_from_drawable(void *, _GdkDrawable *, _GdkColormap *, int, int, int, int, int, int);
+extern (C) void gdk_pixbuf_render_pixmap_and_mask(void *, _GdkDrawable * *, _GdkDrawable * *, int);
+extern (C) void gdk_pixbuf_render_pixmap_and_mask_for_colormap(void *, _GdkColormap *, _GdkDrawable * *, _GdkDrawable * *, int);
+extern (C) void gdk_pixbuf_render_to_drawable_alpha(void *, _GdkDrawable *, int, int, int, int, int, int, int, int, int, int, int);
+extern (C) void gdk_pixbuf_render_to_drawable(void *, _GdkDrawable *, _GdkGC *, int, int, int, int, int, int, int, int, int);
+extern (C) void gdk_pixbuf_render_threshold_alpha(void *, _GdkDrawable *, int, int, int, int, int, int, int);
+extern (C) uint gdk_pixbuf_rotation_get_type();
+extern (C) uint gdk_interp_type_get_type();
+extern (C) uint gdk_pixbuf_error_get_type();
+extern (C) uint gdk_colorspace_get_type();
+extern (C) uint gdk_pixbuf_alpha_mode_get_type();
+extern (C) void * gdk_pixbuf_loader_get_format(_GdkPixbufLoader *);
+extern (C) int gdk_pixbuf_loader_close(_GdkPixbufLoader *, _GError * *);
+extern (C) void * gdk_pixbuf_loader_get_animation(_GdkPixbufLoader *);
+extern (C) void * gdk_pixbuf_loader_get_pixbuf(_GdkPixbufLoader *);
+extern (C) int gdk_pixbuf_loader_write(_GdkPixbufLoader *, char *, uint, _GError * *);
+extern (C) void gdk_pixbuf_loader_set_size(_GdkPixbufLoader *, int, int);
+extern (C) _GdkPixbufLoader * gdk_pixbuf_loader_new_with_mime_type(char *, _GError * *);
+extern (C) _GdkPixbufLoader * gdk_pixbuf_loader_new_with_type(char *, _GError * *);
+extern (C) _GdkPixbufLoader * gdk_pixbuf_loader_new();
+extern (C) uint gdk_pixbuf_loader_get_type();
+extern (C) void * gdk_pixbuf_get_file_info(char *, int *, int *);
+extern (C) char * gdk_pixbuf_format_get_license(void *);
+extern (C) void gdk_pixbuf_format_set_disabled(void *, int);
+extern (C) int gdk_pixbuf_format_is_disabled(void *);
+extern (C) int gdk_pixbuf_format_is_scalable(void *);
+extern (C) int gdk_pixbuf_format_is_writable(void *);
+extern (C) char * * gdk_pixbuf_format_get_extensions(void *);
+extern (C) char * * gdk_pixbuf_format_get_mime_types(void *);
+extern (C) char * gdk_pixbuf_format_get_description(void *);
+extern (C) char * gdk_pixbuf_format_get_name(void *);
+extern (C) _GSList * gdk_pixbuf_get_formats();
+extern (C) void gdk_pixbuf_simple_anim_add_frame(void *, void *);
+extern (C) void * gdk_pixbuf_simple_anim_new(int, int, float);
+extern (C) uint gdk_pixbuf_simple_anim_iter_get_type();
+extern (C) uint gdk_pixbuf_simple_anim_get_type();
+extern (C) int gdk_pixbuf_animation_iter_advance(void *, _GTimeVal *);
+extern (C) int gdk_pixbuf_animation_iter_on_currently_loading_frame(void *);
+extern (C) void * gdk_pixbuf_animation_iter_get_pixbuf(void *);
+extern (C) int gdk_pixbuf_animation_iter_get_delay_time(void *);
+extern (C) uint gdk_pixbuf_animation_iter_get_type();
+extern (C) void * gdk_pixbuf_animation_get_iter(void *, _GTimeVal *);
+extern (C) void * gdk_pixbuf_animation_get_static_image(void *);
+extern (C) int gdk_pixbuf_animation_is_static_image(void *);
+extern (C) int gdk_pixbuf_animation_get_height(void *);
+extern (C) int gdk_pixbuf_animation_get_width(void *);
+extern (C) void gdk_pixbuf_animation_unref(void *);
+extern (C) void * gdk_pixbuf_animation_ref(void *);
+extern (C) void * gdk_pixbuf_animation_new_from_file(char *, _GError * *);
+extern (C) uint gdk_pixbuf_animation_get_type();
+extern (C) void * gdk_pixbuf_flip(void *, int);
+extern (C) void * gdk_pixbuf_rotate_simple(void *, int);
+extern (C) void * gdk_pixbuf_composite_color_simple(void *, int, int, int, int, int, uint, uint);
+extern (C) void * gdk_pixbuf_scale_simple(void *, int, int, int);
+extern (C) void gdk_pixbuf_composite_color(void *, void *, int, int, int, int, double, double, double, double, int, int, int, int, int, uint, uint);
+extern (C) void gdk_pixbuf_composite(void *, void *, int, int, int, int, double, double, double, double, int, int);
+extern (C) void gdk_pixbuf_scale(void *, void *, int, int, int, int, double, double, double, double, int);
+extern (C) char * gdk_pixbuf_get_option(void *, char *);
+extern (C) void * gdk_pixbuf_apply_embedded_orientation(void *);
+extern (C) void gdk_pixbuf_saturate_and_pixelate(void *, void *, float, int);
+extern (C) void gdk_pixbuf_copy_area(void *, int, int, int, int, void *, int, int);
+extern (C) void * gdk_pixbuf_add_alpha(void *, int, char, char, char);
+extern (C) int gdk_pixbuf_save_to_bufferv(void *, char * *, uint *, char *, char * *, char * *, _GError * *);
+extern (C) int gdk_pixbuf_save_to_buffer(void *, char * *, uint *, char *, _GError * *, ...);
+extern (C) int gdk_pixbuf_save_to_callbackv(void *, _BCD_func__4618, void *, char *, char * *, char * *, _GError * *);
+extern (C) int gdk_pixbuf_save_to_callback(void *, _BCD_func__4618, void *, char *, _GError * *, ...);
+extern (C) int gdk_pixbuf_savev(void *, char *, char *, char * *, char * *, _GError * *);
+extern (C) int gdk_pixbuf_save(void *, char *, char *, _GError * *, ...);
+extern (C) void gdk_pixbuf_fill(void *, uint);
+extern (C) void * gdk_pixbuf_new_from_inline(int, char *, int, _GError * *);
+extern (C) void * gdk_pixbuf_new_from_xpm_data(char * *);
+extern (C) void * gdk_pixbuf_new_from_data(char *, int, int, int, int, int, int, _BCD_func__4621, void *);
+extern (C) void * gdk_pixbuf_new_from_file_at_scale(char *, int, int, int, _GError * *);
+extern (C) void * gdk_pixbuf_new_from_file_at_size(char *, int, int, _GError * *);
+extern (C) void * gdk_pixbuf_new_from_file(char *, _GError * *);
+extern (C) void * gdk_pixbuf_new_subpixbuf(void *, int, int, int, int);
+extern (C) void * gdk_pixbuf_copy(void *);
+extern (C) void * gdk_pixbuf_new(int, int, int, int, int);
+extern (C) int gdk_pixbuf_get_rowstride(void *);
+extern (C) int gdk_pixbuf_get_height(void *);
+extern (C) int gdk_pixbuf_get_width(void *);
+extern (C) char * gdk_pixbuf_get_pixels(void *);
+extern (C) int gdk_pixbuf_get_bits_per_sample(void *);
+extern (C) int gdk_pixbuf_get_has_alpha(void *);
+extern (C) int gdk_pixbuf_get_n_channels(void *);
+extern (C) int gdk_pixbuf_get_colorspace(void *);
+extern (C) void gdk_pixbuf_unref(void *);
+extern (C) void * gdk_pixbuf_ref(void *);
+extern (C) uint gdk_pixbuf_get_type();
+extern (C) uint gdk_pixbuf_error_quark();
+extern (C) extern char * gdk_pixbuf_version;
+extern (C) extern uint gdk_pixbuf_micro_version;
+extern (C) extern uint gdk_pixbuf_minor_version;
+extern (C) extern uint gdk_pixbuf_major_version;
+extern (C) int gdk_rgb_colormap_ditherable(_GdkColormap *);
+extern (C) int gdk_rgb_ditherable();
+extern (C) _GdkVisual * gdk_rgb_get_visual();
+extern (C) _GdkColormap * gdk_rgb_get_colormap();
+extern (C) void gdk_rgb_set_min_colors(int);
+extern (C) void gdk_rgb_set_install(int);
+extern (C) void gdk_rgb_set_verbose(int);
+extern (C) void gdk_rgb_cmap_free(_GdkRgbCmap *);
+extern (C) _GdkRgbCmap * gdk_rgb_cmap_new(uint *, int);
+extern (C) void gdk_draw_indexed_image(_GdkDrawable *, _GdkGC *, int, int, int, int, int, char *, int, _GdkRgbCmap *);
+extern (C) void gdk_draw_gray_image(_GdkDrawable *, _GdkGC *, int, int, int, int, int, char *, int);
+extern (C) void gdk_draw_rgb_32_image_dithalign(_GdkDrawable *, _GdkGC *, int, int, int, int, int, char *, int, int, int);
+extern (C) void gdk_draw_rgb_32_image(_GdkDrawable *, _GdkGC *, int, int, int, int, int, char *, int);
+extern (C) void gdk_draw_rgb_image_dithalign(_GdkDrawable *, _GdkGC *, int, int, int, int, int, char *, int, int, int);
+extern (C) void gdk_draw_rgb_image(_GdkDrawable *, _GdkGC *, int, int, int, int, int, char *, int);
+extern (C) void gdk_rgb_find_color(_GdkColormap *, _GdkColor *);
+extern (C) void gdk_rgb_gc_set_background(_GdkGC *, uint);
+extern (C) void gdk_rgb_gc_set_foreground(_GdkGC *, uint);
+extern (C) uint gdk_rgb_xpixel_from_rgb(uint);
+extern (C) void gdk_rgb_init();
+extern (C) void gdk_colors_free(_GdkColormap *, uint *, int, uint);
+extern (C) int gdk_colors_alloc(_GdkColormap *, int, uint *, int, uint *, int);
+extern (C) int gdk_color_change(_GdkColormap *, _GdkColor *);
+extern (C) int gdk_color_alloc(_GdkColormap *, _GdkColor *);
+extern (C) int gdk_color_black(_GdkColormap *, _GdkColor *);
+extern (C) int gdk_color_white(_GdkColormap *, _GdkColor *);
+extern (C) void gdk_colors_store(_GdkColormap *, _GdkColor *, int);
+extern (C) uint gdk_color_get_type();
+extern (C) char * gdk_color_to_string(_GdkColor *);
+extern (C) int gdk_color_equal(_GdkColor *, _GdkColor *);
+extern (C) uint gdk_color_hash(_GdkColor *);
+extern (C) int gdk_color_parse(char *, _GdkColor *);
+extern (C) void gdk_color_free(_GdkColor *);
+extern (C) _GdkColor * gdk_color_copy(_GdkColor *);
+extern (C) _GdkVisual * gdk_colormap_get_visual(_GdkColormap *);
+extern (C) void gdk_colormap_query_color(_GdkColormap *, uint, _GdkColor *);
+extern (C) void gdk_colormap_free_colors(_GdkColormap *, _GdkColor *, int);
+extern (C) int gdk_colormap_alloc_color(_GdkColormap *, _GdkColor *, int, int);
+extern (C) int gdk_colormap_alloc_colors(_GdkColormap *, _GdkColor *, int, int, int, int *);
+extern (C) void gdk_colormap_change(_GdkColormap *, int);
+extern (C) int gdk_colormap_get_system_size();
+extern (C) _GdkScreen * gdk_colormap_get_screen(_GdkColormap *);
+extern (C) _GdkColormap * gdk_colormap_get_system();
+extern (C) void gdk_colormap_unref(_GdkColormap *);
+extern (C) _GdkColormap * gdk_colormap_ref(_GdkColormap *);
+extern (C) _GdkColormap * gdk_colormap_new(_GdkVisual *, int);
+extern (C) uint gdk_colormap_get_type();
+} // version(DYNLINK)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/gdkx.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,254 @@
+/******************************************************************************
+    Based on the generated files from the BCD tool
+    modified by: Frank Benoit <keinfarbton@googlemail.com>
+******************************************************************************/
+module org.eclipse.swt.internal.c.gdkx;
+
+import java.lang.all;
+public import org.eclipse.swt.internal.c.pango;
+public import org.eclipse.swt.internal.c.cairo;
+public import org.eclipse.swt.internal.c.glib_object;
+public import org.eclipse.swt.internal.c.gdk;
+public import org.eclipse.swt.internal.c.Xlib;
+public import org.eclipse.swt.internal.c.Xutil;
+
+extern(C):
+align(4):
+
+alias void function(void *, char *, int, int, char * *) _BCD_func__4613;
+alias int function(void *) _BCD_func__4653;
+alias int function(void *, XErrorEvent *) _BCD_func__4654;
+alias void function(void *, char *, char *) _BCD_func__4726;
+alias int function(void *, char *, char *) _BCD_func__4727;
+alias void function(void *, char *, char *) _BCD_func__4728;
+alias void function(void *) _BCD_func__5695;
+alias char * function(void *) _BCD_func__5696;
+alias int function(char *, uint, _GError * *, void *) _BCD_func__5702;
+alias void function(char *, void *) _BCD_func__5706;
+alias void function(_GdkSpan *, void *) _BCD_func__5720;
+alias int function(void *, _GdkEvent *, void *) _BCD_func__5762;
+alias void function(_GdkEvent *, void *) _BCD_func__5763;
+alias int function(void *, char *, uint) _BCD_func__6083;
+alias int function(void *, char *, uint) _BCD_func__6084;
+alias void function(void *) _BCD_func__6088;
+alias void function(void *, int, int) _BCD_func__6097;
+alias int function(void *) _BCD_func__1886;
+alias int function(void *, long *, int) _BCD_func__1888;
+alias int function(void *, char *, uint) _BCD_func__1890;
+alias int function(void *, char *, uint) _BCD_func__1892;
+alias int function(void * *, char *) _BCD_func__6246;
+alias int function(char *, char * * *, uint *) _BCD_func__6247;
+alias int function(void *, char *, char *, char *, char *) _BCD_func__6248;
+alias int function(__gconv_step *, __gconv_step_data *, void *, char *, char * *, char *, char * *, uint *) _BCD_func__6249;
+alias void function(__gconv_step *) _BCD_func__6250;
+alias int function(__gconv_step *) _BCD_func__6251;
+alias uint function(__gconv_step *, char) _BCD_func__6252;
+alias int function(__gconv_step *, __gconv_step_data *, char * *, char *, char * *, uint *, int, int) _BCD_func__6253;
+alias int function(void *, void *, void *) _BCD_func__6405;
+alias void * function(void *) _BCD_func__6430;
+alias int function(_PangoAttribute *, void *) _BCD_func__6431;
+alias void function(void *, uint, uint, _GInterfaceInfo *) _BCD_func__6533;
+alias void function(void *, uint, _GTypeInfo *, _GTypeValueTable *) _BCD_func__6534;
+alias void function(void *) _BCD_func__6535;
+alias void function(void *, _GObject *, int) _BCD_func__6683;
+alias void function(void *, _GObject *) _BCD_func__6688;
+alias void function(_GObject *) _BCD_func__6689;
+alias void function(_GObject *, uint, _GValue *, _GParamSpec *) _BCD_func__6690;
+alias void function(_GObject *, uint, _GValue *, _GParamSpec *) _BCD_func__6691;
+alias int function(_GSignalInvocationHint *, _GValue *, _GValue *, void *) _BCD_func__6717;
+alias int function(_GSignalInvocationHint *, uint, _GValue *, void *) _BCD_func__6718;
+alias void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *) _BCD_func__6719;
+alias void function(void *, _GClosure *) _BCD_func__6738;
+alias void function() _BCD_func__6739;
+alias void function(_GValue *, _GValue *) _BCD_func__6796;
+alias void * function(void *) _BCD_func__6824;
+alias void function(void *, void *) _BCD_func__6828;
+alias int function(void *, _GTypeClass *) _BCD_func__6829;
+alias void function(_GTypeInstance *, void *) _BCD_func__6830;
+alias int function(void *, void *, void *) _BCD_func__6885;
+alias int function(void *, void *, void *) _BCD_func__6900;
+alias void function(_GScanner *, char *, int) _BCD_func__6903;
+alias int function(void *, _GString *, void *) _BCD_func__6975;
+alias void function(void *, void *, void *, _GError * *) _BCD_func__6993;
+alias int function(void *, void *, void *, _GError * *) _BCD_func__6994;
+alias int function(char *, char *, void *, _GError * *) _BCD_func__6995;
+alias void * function(void *, void *) _BCD_func__7006;
+alias void function(_GNode *, void *) _BCD_func__7007;
+alias int function(_GNode *, void *) _BCD_func__7008;
+alias void function(char *) _BCD_func__7016;
+alias void function(char *, int, char *, void *) _BCD_func__7018;
+alias int function(_GIOChannel *, int, void *) _BCD_func__7033;
+alias int function(_GPollFD *, uint, int) _BCD_func__7085;
+alias void function(int, int, void *) _BCD_func__7091;
+alias int function(void *) _BCD_func__7092;
+alias void function(_GHookList *, _GHook *) _BCD_func__7127;
+alias int function(_GHook *, void *) _BCD_func__7128;
+alias void function(_GHook *, void *) _BCD_func__7129;
+alias int function(_GHook *, _GHook *) _BCD_func__7130;
+alias void function(uint, void *, void *) _BCD_func__7164;
+alias int function(char *, char *, uint) _BCD_func__7167;
+alias char * function(void *) _BCD_func__7168;
+alias char * function(char *, void *) _BCD_func__7349;
+alias void function(void *, void *, void *) _BCD_func__7350;
+alias uint function(void *) _BCD_func__7351;
+alias int function(void *, void *) _BCD_func__7352;
+alias int function(void *, void *, void *) _BCD_func__7353;
+alias int function(void *, void *) _BCD_func__7354;
+version(DYNLINK){
+extern (C) char * function(_GdkFont *)gdk_x11_font_get_name;
+extern (C) void * function(_GdkFont *)gdk_x11_font_get_xdisplay;
+extern (C) void * function(_GdkFont *)gdk_x11_font_get_xfont;
+extern (C) void function(void *, int, int)gdk_x11_register_standard_event_type;
+extern (C) void function(void *)gdk_x11_display_ungrab;
+extern (C) void function(void *)gdk_x11_display_grab;
+extern (C) char * function(uint)gdk_x11_get_xatom_name;
+extern (C) uint function(char *)gdk_x11_get_xatom_by_name;
+extern (C) void * function(uint)gdk_x11_xatom_to_atom;
+extern (C) uint function(void *)gdk_x11_atom_to_xatom;
+extern (C) char * function(void *, uint)gdk_x11_get_xatom_name_for_display;
+extern (C) uint function(void *, char *)gdk_x11_get_xatom_by_name_for_display;
+extern (C) void * function(void *, uint)gdk_x11_xatom_to_atom_for_display;
+extern (C) uint function(void *, void *)gdk_x11_atom_to_xatom_for_display;
+extern (C) void * function(void *)gdk_x11_lookup_xdisplay;
+extern (C) void function()gdk_x11_ungrab_server;
+extern (C) void function()gdk_x11_grab_server;
+extern (C) int function(void *)gdk_net_wm_supports;
+extern (C) void * function(uint)gdk_xid_table_lookup;
+extern (C) int function(void *, void *)gdk_x11_screen_supports_net_wm_hint;
+extern (C) void function(void *, char *, ...)gdk_x11_display_broadcast_startup_message;
+extern (C) void function(void *, char *, int)gdk_x11_display_set_cursor_theme;
+extern (C) char * function(void *)gdk_x11_display_get_startup_notification_id;
+extern (C) uint function(void *)gdk_x11_display_get_user_time;
+extern (C) uint function(_GdkDrawable *)gdk_x11_get_server_time;
+extern (C) void * function(void *, uint)gdk_xid_table_lookup_for_display;
+extern (C) _GdkColormap * function(_GdkVisual *, uint)gdk_x11_colormap_foreign_new;
+extern (C) _GdkVisual * function(uint)gdkx_visual_get;
+extern (C) _GdkVisual * function(void *, uint)gdk_x11_screen_lookup_visual;
+extern (C) int function()gdk_x11_get_default_screen;
+extern (C) void * function()gdk_x11_get_default_xdisplay;
+extern (C) uint function()gdk_x11_get_default_root_xwindow;
+extern (C) char * function(void *)gdk_x11_screen_get_window_manager_name;
+extern (C) void function(_GdkDrawable *)gdk_x11_window_move_to_current_desktop;
+extern (C) void function(_GdkDrawable *, uint)gdk_x11_window_set_user_time;
+extern (C) int function(void *)gdk_x11_screen_get_screen_number;
+extern (C) Screen * function(void *)gdk_x11_screen_get_xscreen;
+extern (C) void * function(_GdkGC *)gdk_x11_gc_get_xgc;
+extern (C) void * function(_GdkGC *)gdk_x11_gc_get_xdisplay;
+extern (C) Visual * function(_GdkVisual *)gdk_x11_visual_get_xvisual;
+extern (C) void * function(void *)gdk_x11_display_get_xdisplay;
+extern (C) uint function(_GdkCursor *)gdk_x11_cursor_get_xcursor;
+extern (C) void * function(_GdkCursor *)gdk_x11_cursor_get_xdisplay;
+extern (C) uint function(_GdkColormap *)gdk_x11_colormap_get_xcolormap;
+extern (C) void * function(_GdkColormap *)gdk_x11_colormap_get_xdisplay;
+extern (C) _XImage * function(_GdkImage *)gdk_x11_image_get_ximage;
+extern (C) void * function(_GdkImage *)gdk_x11_image_get_xdisplay;
+extern (C) uint function(_GdkDrawable *)gdk_x11_drawable_get_xid;
+extern (C) void * function(_GdkDrawable *)gdk_x11_drawable_get_xdisplay;
+extern (C) extern void ** gdk_display;
+
+
+Symbol[] symbols = [
+    { "gdk_x11_font_get_name",  cast(void**)& gdk_x11_font_get_name},
+    { "gdk_x11_font_get_xdisplay",  cast(void**)& gdk_x11_font_get_xdisplay},
+    { "gdk_x11_font_get_xfont",  cast(void**)& gdk_x11_font_get_xfont},
+    { "gdk_x11_register_standard_event_type",  cast(void**)& gdk_x11_register_standard_event_type},
+    { "gdk_x11_display_ungrab",  cast(void**)& gdk_x11_display_ungrab},
+    { "gdk_x11_display_grab",  cast(void**)& gdk_x11_display_grab},
+    { "gdk_x11_get_xatom_name",  cast(void**)& gdk_x11_get_xatom_name},
+    { "gdk_x11_get_xatom_by_name",  cast(void**)& gdk_x11_get_xatom_by_name},
+    { "gdk_x11_xatom_to_atom",  cast(void**)& gdk_x11_xatom_to_atom},
+    { "gdk_x11_atom_to_xatom",  cast(void**)& gdk_x11_atom_to_xatom},
+    { "gdk_x11_get_xatom_name_for_display",  cast(void**)& gdk_x11_get_xatom_name_for_display},
+    { "gdk_x11_get_xatom_by_name_for_display",  cast(void**)& gdk_x11_get_xatom_by_name_for_display},
+    { "gdk_x11_xatom_to_atom_for_display",  cast(void**)& gdk_x11_xatom_to_atom_for_display},
+    { "gdk_x11_atom_to_xatom_for_display",  cast(void**)& gdk_x11_atom_to_xatom_for_display},
+    { "gdk_x11_lookup_xdisplay",  cast(void**)& gdk_x11_lookup_xdisplay},
+    { "gdk_x11_ungrab_server",  cast(void**)& gdk_x11_ungrab_server},
+    { "gdk_x11_grab_server",  cast(void**)& gdk_x11_grab_server},
+    { "gdk_net_wm_supports",  cast(void**)& gdk_net_wm_supports},
+    { "gdk_xid_table_lookup",  cast(void**)& gdk_xid_table_lookup},
+    { "gdk_x11_screen_supports_net_wm_hint",  cast(void**)& gdk_x11_screen_supports_net_wm_hint},
+    { "gdk_x11_display_broadcast_startup_message",  cast(void**)& gdk_x11_display_broadcast_startup_message},
+    { "gdk_x11_display_set_cursor_theme",  cast(void**)& gdk_x11_display_set_cursor_theme},
+    { "gdk_x11_display_get_startup_notification_id",  cast(void**)& gdk_x11_display_get_startup_notification_id},
+    { "gdk_x11_display_get_user_time",  cast(void**)& gdk_x11_display_get_user_time},
+    { "gdk_x11_get_server_time",  cast(void**)& gdk_x11_get_server_time},
+    { "gdk_xid_table_lookup_for_display",  cast(void**)& gdk_xid_table_lookup_for_display},
+    { "gdk_x11_colormap_foreign_new",  cast(void**)& gdk_x11_colormap_foreign_new},
+    { "gdkx_visual_get",  cast(void**)& gdkx_visual_get},
+    { "gdk_x11_screen_lookup_visual",  cast(void**)& gdk_x11_screen_lookup_visual},
+    { "gdk_x11_get_default_screen",  cast(void**)& gdk_x11_get_default_screen},
+    { "gdk_x11_get_default_xdisplay",  cast(void**)& gdk_x11_get_default_xdisplay},
+    { "gdk_x11_get_default_root_xwindow",  cast(void**)& gdk_x11_get_default_root_xwindow},
+    { "gdk_x11_screen_get_window_manager_name",  cast(void**)& gdk_x11_screen_get_window_manager_name},
+    { "gdk_x11_window_move_to_current_desktop",  cast(void**)& gdk_x11_window_move_to_current_desktop},
+    { "gdk_x11_window_set_user_time",  cast(void**)& gdk_x11_window_set_user_time},
+    { "gdk_x11_screen_get_screen_number",  cast(void**)& gdk_x11_screen_get_screen_number},
+    { "gdk_x11_screen_get_xscreen",  cast(void**)& gdk_x11_screen_get_xscreen},
+    { "gdk_x11_gc_get_xgc",  cast(void**)& gdk_x11_gc_get_xgc},
+    { "gdk_x11_gc_get_xdisplay",  cast(void**)& gdk_x11_gc_get_xdisplay},
+    { "gdk_x11_visual_get_xvisual",  cast(void**)& gdk_x11_visual_get_xvisual},
+    { "gdk_x11_display_get_xdisplay",  cast(void**)& gdk_x11_display_get_xdisplay},
+    { "gdk_x11_cursor_get_xcursor",  cast(void**)& gdk_x11_cursor_get_xcursor},
+    { "gdk_x11_cursor_get_xdisplay",  cast(void**)& gdk_x11_cursor_get_xdisplay},
+    { "gdk_x11_colormap_get_xcolormap",  cast(void**)& gdk_x11_colormap_get_xcolormap},
+    { "gdk_x11_colormap_get_xdisplay",  cast(void**)& gdk_x11_colormap_get_xdisplay},
+    { "gdk_x11_image_get_ximage",  cast(void**)& gdk_x11_image_get_ximage},
+    { "gdk_x11_image_get_xdisplay",  cast(void**)& gdk_x11_image_get_xdisplay},
+    { "gdk_x11_drawable_get_xid",  cast(void**)& gdk_x11_drawable_get_xid},
+    { "gdk_x11_drawable_get_xdisplay",  cast(void**)& gdk_x11_drawable_get_xdisplay},
+    { "gdk_display",  cast(void**)& gdk_display},
+];
+
+} else { // version(DYNLINK)
+extern (C) char * gdk_x11_font_get_name(_GdkFont *);
+extern (C) void * gdk_x11_font_get_xdisplay(_GdkFont *);
+extern (C) void * gdk_x11_font_get_xfont(_GdkFont *);
+extern (C) void gdk_x11_register_standard_event_type(void *, int, int);
+extern (C) void gdk_x11_display_ungrab(void *);
+extern (C) void gdk_x11_display_grab(void *);
+extern (C) char * gdk_x11_get_xatom_name(uint);
+extern (C) uint gdk_x11_get_xatom_by_name(char *);
+extern (C) void * gdk_x11_xatom_to_atom(uint);
+extern (C) uint gdk_x11_atom_to_xatom(void *);
+extern (C) char * gdk_x11_get_xatom_name_for_display(void *, uint);
+extern (C) uint gdk_x11_get_xatom_by_name_for_display(void *, char *);
+extern (C) void * gdk_x11_xatom_to_atom_for_display(void *, uint);
+extern (C) uint gdk_x11_atom_to_xatom_for_display(void *, void *);
+extern (C) void * gdk_x11_lookup_xdisplay(void *);
+extern (C) void gdk_x11_ungrab_server();
+extern (C) void gdk_x11_grab_server();
+extern (C) int gdk_net_wm_supports(void *);
+extern (C) void * gdk_xid_table_lookup(uint);
+extern (C) int gdk_x11_screen_supports_net_wm_hint(void *, void *);
+extern (C) void gdk_x11_display_broadcast_startup_message(void *, char *, ...);
+extern (C) void gdk_x11_display_set_cursor_theme(void *, char *, int);
+extern (C) char * gdk_x11_display_get_startup_notification_id(void *);
+extern (C) uint gdk_x11_display_get_user_time(void *);
+extern (C) uint gdk_x11_get_server_time(_GdkDrawable *);
+extern (C) void * gdk_xid_table_lookup_for_display(void *, uint);
+extern (C) _GdkColormap * gdk_x11_colormap_foreign_new(_GdkVisual *, uint);
+extern (C) _GdkVisual * gdkx_visual_get(uint);
+extern (C) _GdkVisual * gdk_x11_screen_lookup_visual(void *, uint);
+extern (C) int gdk_x11_get_default_screen();
+extern (C) void * gdk_x11_get_default_xdisplay();
+extern (C) uint gdk_x11_get_default_root_xwindow();
+extern (C) char * gdk_x11_screen_get_window_manager_name(void *);
+extern (C) void gdk_x11_window_move_to_current_desktop(_GdkDrawable *);
+extern (C) void gdk_x11_window_set_user_time(_GdkDrawable *, uint);
+extern (C) int gdk_x11_screen_get_screen_number(void *);
+extern (C) Screen * gdk_x11_screen_get_xscreen(void *);
+extern (C) void * gdk_x11_gc_get_xgc(_GdkGC *);
+extern (C) void * gdk_x11_gc_get_xdisplay(_GdkGC *);
+extern (C) Visual * gdk_x11_visual_get_xvisual(_GdkVisual *);
+extern (C) void * gdk_x11_display_get_xdisplay(void *);
+extern (C) uint gdk_x11_cursor_get_xcursor(_GdkCursor *);
+extern (C) void * gdk_x11_cursor_get_xdisplay(_GdkCursor *);
+extern (C) uint gdk_x11_colormap_get_xcolormap(_GdkColormap *);
+extern (C) void * gdk_x11_colormap_get_xdisplay(_GdkColormap *);
+extern (C) _XImage * gdk_x11_image_get_ximage(_GdkImage *);
+extern (C) void * gdk_x11_image_get_xdisplay(_GdkImage *);
+extern (C) uint gdk_x11_drawable_get_xid(_GdkDrawable *);
+extern (C) void * gdk_x11_drawable_get_xdisplay(_GdkDrawable *);
+extern (C) extern void * gdk_display;
+} // version(DYNLINK)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/glib_object.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,5827 @@
+/******************************************************************************
+    Based on the generated files from the BCD tool
+    modified by: Frank Benoit <keinfarbton@googlemail.com>
+******************************************************************************/
+module org.eclipse.swt.internal.c.glib_object;
+
+import java.lang.all;
+
+extern(C):
+align(4):
+
+struct __gconv_step{}
+struct __gconv_step_data{}
+struct _GStaticMutex { ubyte[28] dummy; }
+struct _GSystemThread{ ubyte[ 8] dummy; }
+// gen ..
+
+
+const String G_GNUC_FUNCTION = "";
+const String G_GNUC_PRETTY_FUNCTION = "";
+const double G_E = 2.7182818284590452353602874713526624977572470937000;
+const double G_LN2 = 0.69314718055994530941723212145817656807550013436026;
+const double G_LN10 = 2.3025850929940456840179914546843642076011014886288;
+const double G_PI = 3.1415926535897932384626433832795028841971693993751;
+const double G_PI_2 = 1.5707963267948966192313216916397514420985846996876;
+const double G_PI_4 = 0.78539816339744830961566084581987572104929234984378;
+const double G_SQRT2 = 1.4142135623730950488016887242096980785696718753769;
+const int G_LITTLE_ENDIAN = 1234;
+const int G_BIG_ENDIAN = 4321;
+const int G_PDP_ENDIAN = 3412;
+const String G_DIR_SEPARATOR_S = "/";
+const String G_SEARCHPATH_SEPARATOR_S = ":";
+const double G_MUTEX_DEBUG_MAGIC = 0xf8e18ad7;
+const int G_ALLOC_ONLY = 1;
+const int G_ALLOC_AND_FREE = 2;
+const int G_DATALIST_FLAGS_MASK = 0x3;
+const int G_PRIORITY_HIGH = -100;
+const int G_PRIORITY_DEFAULT = 0;
+const int G_PRIORITY_HIGH_IDLE = 100;
+const int G_PRIORITY_DEFAULT_IDLE = 200;
+const int G_PRIORITY_LOW = 300;
+const String G_KEY_FILE_DESKTOP_KEY_TYPE = "Type";
+const String G_KEY_FILE_DESKTOP_KEY_VERSION = "Version";
+const String G_KEY_FILE_DESKTOP_KEY_NAME = "Name";
+const String G_KEY_FILE_DESKTOP_KEY_GENERIC_NAME = "GenericName";
+const String G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY = "NoDisplay";
+const String G_KEY_FILE_DESKTOP_KEY_COMMENT = "Comment";
+const String G_KEY_FILE_DESKTOP_KEY_ICON = "Icon";
+const String G_KEY_FILE_DESKTOP_KEY_HIDDEN = "Hidden";
+const String G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN = "OnlyShowIn";
+const String G_KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN = "NotShowIn";
+const String G_KEY_FILE_DESKTOP_KEY_TRY_EXEC = "TryExec";
+const String G_KEY_FILE_DESKTOP_KEY_EXEC = "Exec";
+const String G_KEY_FILE_DESKTOP_KEY_PATH = "Path";
+const String G_KEY_FILE_DESKTOP_KEY_TERMINAL = "Terminal";
+const String G_KEY_FILE_DESKTOP_KEY_MIME_TYPE = "MimeType";
+const String G_KEY_FILE_DESKTOP_KEY_CATEGORIES = "Categories";
+const String G_KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY = "StartupNotify";
+const String G_KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS = "StartupWMClass";
+const String G_KEY_FILE_DESKTOP_KEY_URL = "URL";
+const String G_KEY_FILE_DESKTOP_TYPE_APPLICATION = "Application";
+const String G_KEY_FILE_DESKTOP_TYPE_LINK = "Link";
+const String G_KEY_FILE_DESKTOP_TYPE_DIRECTORY = "Directory";
+const String G_OPTION_REMAINING = "";
+const String G_CSET_A_2_Z = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+const String G_CSET_a_2_z = "abcdefghijklmnopqrstuvwxyz";
+const String G_CSET_DIGITS = "0123456789";
+const String G_CSET_LATINC = "\300\301\302\303\304\305\306";
+const String G_CSET_LATINS = "\337\340\341\342\343\344\345\346";
+const int G_USEC_PER_SEC = 1000000;
+const int G_SIGNAL_FLAGS_MASK = 0x7f;
+const int G_SIGNAL_MATCH_MASK = 0x3f;
+alias char gchar;
+alias char * gchararray;
+alias _GValueArray GValueArray;
+alias uint guint;
+alias _GValue GValue;
+alias void GTypePlugin;
+alias _GInterfaceInfo GInterfaceInfo;
+alias void function(void *, uint, uint, _GInterfaceInfo *) _BCD_func__2124;
+alias _BCD_func__2124 GTypePluginCompleteInterfaceInfo;
+alias _GTypeInfo GTypeInfo;
+alias _GTypeValueTable GTypeValueTable;
+alias void function(void *, uint, _GTypeInfo *, _GTypeValueTable *) _BCD_func__2125;
+alias _BCD_func__2125 GTypePluginCompleteTypeInfo;
+alias void function(void *) _BCD_func__2126;
+alias _BCD_func__2126 GTypePluginUnuse;
+alias _BCD_func__2126 GTypePluginUse;
+alias _GTypePluginClass GTypePluginClass;
+alias _GTypeInterface GTypeInterface;
+alias _GTypeModuleClass GTypeModuleClass;
+alias _GObjectClass GObjectClass;
+alias int gint;
+alias int gboolean;
+alias _GTypeModule GTypeModule;
+alias int function(_GTypeModule *) _BCD_func__3215;
+alias void function(_GTypeModule *) _BCD_func__3216;
+alias void function() _BCD_func__2331;
+alias _GObject GObject;
+alias _GSList GSList;
+alias _GParamSpecGType GParamSpecGType;
+alias _GParamSpec GParamSpec;
+alias uint gulong;
+alias uint GType;
+alias _GParamSpecOverride GParamSpecOverride;
+alias _GParamSpecObject GParamSpecObject;
+alias _GParamSpecValueArray GParamSpecValueArray;
+alias _GParamSpecPointer GParamSpecPointer;
+alias _GParamSpecBoxed GParamSpecBoxed;
+alias _GParamSpecParam GParamSpecParam;
+alias _GParamSpecString GParamSpecString;
+alias _GParamSpecDouble GParamSpecDouble;
+alias double gdouble;
+alias _GParamSpecFloat GParamSpecFloat;
+alias float gfloat;
+alias _GParamSpecFlags GParamSpecFlags;
+alias _GFlagsClass GFlagsClass;
+alias _GParamSpecEnum GParamSpecEnum;
+alias _GEnumClass GEnumClass;
+alias _GParamSpecUnichar GParamSpecUnichar;
+alias uint gunichar;
+alias _GParamSpecUInt64 GParamSpecUInt64;
+alias _GParamSpecInt64 GParamSpecInt64;
+alias _GParamSpecULong GParamSpecULong;
+alias _GParamSpecLong GParamSpecLong;
+alias int glong;
+alias _GParamSpecUInt GParamSpecUInt;
+alias _GParamSpecInt GParamSpecInt;
+alias _GParamSpecBoolean GParamSpecBoolean;
+alias _GParamSpecUChar GParamSpecUChar;
+alias _GParamSpecChar GParamSpecChar;
+alias void function(void *, _GObject *, int) _BCD_func__2274;
+alias _BCD_func__2274 GToggleNotify;
+alias void function(void *, _GObject *) _BCD_func__2280;
+alias _BCD_func__2280 GWeakNotify;
+alias void function(_GObject *) _BCD_func__2281;
+alias _BCD_func__2281 GObjectFinalizeFunc;
+alias void function(_GObject *, uint, _GValue *, _GParamSpec *) _BCD_func__2282;
+alias _BCD_func__2282 GObjectSetPropertyFunc;
+alias void function(_GObject *, uint, _GValue *, _GParamSpec *) _BCD_func__2283;
+alias _BCD_func__2283 GObjectGetPropertyFunc;
+alias _GObjectConstructParam GObjectConstructParam;
+alias _GObjectClass GInitiallyUnownedClass;
+alias _GObject GInitiallyUnowned;
+alias _GTypeClass GTypeClass;
+alias _GObject * function(uint, uint, _GObjectConstructParam *) _BCD_func__3242;
+alias void function(_GObject *, uint, _GParamSpec * *) _BCD_func__3243;
+alias void function(_GObject *, _GParamSpec *) _BCD_func__3244;
+alias void * gpointer;
+alias _GTypeInstance GTypeInstance;
+alias void GData;
+enum GSignalMatchType {
+G_SIGNAL_MATCH_ID=1,
+G_SIGNAL_MATCH_DETAIL=2,
+G_SIGNAL_MATCH_CLOSURE=4,
+G_SIGNAL_MATCH_FUNC=8,
+G_SIGNAL_MATCH_DATA=16,
+G_SIGNAL_MATCH_UNBLOCKED=32,
+}
+enum GConnectFlags {
+G_CONNECT_AFTER=1,
+G_CONNECT_SWAPPED=2,
+}
+enum GSignalFlags {
+G_SIGNAL_RUN_FIRST=1,
+G_SIGNAL_RUN_LAST=2,
+G_SIGNAL_RUN_CLEANUP=4,
+G_SIGNAL_NO_RECURSE=8,
+G_SIGNAL_DETAILED=16,
+G_SIGNAL_ACTION=32,
+G_SIGNAL_NO_HOOKS=64,
+}
+alias _GSignalInvocationHint GSignalInvocationHint;
+alias int function(_GSignalInvocationHint *, _GValue *, _GValue *, void *) _BCD_func__2309;
+alias _BCD_func__2309 GSignalAccumulator;
+alias int function(_GSignalInvocationHint *, uint, _GValue *, void *) _BCD_func__2310;
+alias _BCD_func__2310 GSignalEmissionHook;
+alias _GClosure GClosure;
+alias void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *) _BCD_func__2311;
+alias _BCD_func__2311 GClosureMarshal;
+alias _BCD_func__2311 GSignalCMarshaller;
+alias uint GQuark;
+alias _GSignalQuery GSignalQuery;
+alias _GCClosure GCClosure;
+alias void function(void *, _GClosure *) _BCD_func__2330;
+alias _BCD_func__2330 GClosureNotify;
+alias _BCD_func__2331 GCallback;
+alias _GClosureNotifyData GClosureNotifyData;
+alias _GParamSpecTypeInfo GParamSpecTypeInfo;
+alias void function(_GParamSpec *) _BCD_func__3253;
+alias void function(_GParamSpec *, _GValue *) _BCD_func__3254;
+alias int function(_GParamSpec *, _GValue *) _BCD_func__3255;
+alias int function(_GParamSpec *, _GValue *, _GValue *) _BCD_func__3256;
+alias void GParamSpecPool;
+alias _GParameter GParameter;
+alias _GParamSpecClass GParamSpecClass;
+enum GParamFlags {
+G_PARAM_READABLE=1,
+G_PARAM_WRITABLE=2,
+G_PARAM_CONSTRUCT=4,
+G_PARAM_CONSTRUCT_ONLY=8,
+G_PARAM_LAX_VALIDATION=16,
+G_PARAM_STATIC_NAME=32,
+G_PARAM_PRIVATE=32,
+G_PARAM_STATIC_NICK=64,
+G_PARAM_STATIC_BLURB=128,
+}
+alias void function(_GValue *, _GValue *) _BCD_func__2389;
+alias _BCD_func__2389 GValueTransform;
+alias _GFlagsValue GFlagsValue;
+alias _GEnumValue GEnumValue;
+alias char * * GStrv;
+alias void function(void *) _BCD_func__2417;
+alias _BCD_func__2417 GBoxedFreeFunc;
+alias void * function(void *) _BCD_func__2418;
+alias _BCD_func__2418 GBoxedCopyFunc;
+enum GTypeFlags {
+G_TYPE_FLAG_ABSTRACT=16,
+G_TYPE_FLAG_VALUE_ABSTRACT=32,
+}
+enum GTypeFundamentalFlags {
+G_TYPE_FLAG_CLASSED=1,
+G_TYPE_FLAG_INSTANTIATABLE=2,
+G_TYPE_FLAG_DERIVABLE=4,
+G_TYPE_FLAG_DEEP_DERIVABLE=8,
+}
+alias void function(void *, void *) _BCD_func__2422;
+alias _BCD_func__2422 GTypeInterfaceCheckFunc;
+alias int function(void *, _GTypeClass *) _BCD_func__2423;
+alias _BCD_func__2423 GTypeClassCacheFunc;
+alias _BCD_func__2422 GInterfaceFinalizeFunc;
+alias _BCD_func__2422 GInterfaceInitFunc;
+alias void function(_GTypeInstance *, void *) _BCD_func__2424;
+alias _BCD_func__2424 GInstanceInitFunc;
+alias _BCD_func__2422 GClassFinalizeFunc;
+alias _BCD_func__2422 GClassInitFunc;
+alias _BCD_func__2417 GBaseFinalizeFunc;
+alias _BCD_func__2417 GBaseInitFunc;
+enum GTypeDebugFlags {
+G_TYPE_DEBUG_NONE=0,
+G_TYPE_DEBUG_OBJECTS=1,
+G_TYPE_DEBUG_SIGNALS=2,
+G_TYPE_DEBUG_MASK=3,
+}
+alias _GTypeQuery GTypeQuery;
+alias void function(_GValue *) _BCD_func__3266;
+alias void * function(_GValue *) _BCD_func__3267;
+alias void GTypeCValue;
+alias char * function(_GValue *, uint, void *, uint) _BCD_func__3268;
+alias char * function(_GValue *, uint, void *, uint) _BCD_func__3269;
+alias _GTypeFundamentalInfo GTypeFundamentalInfo;
+alias void * gconstpointer;
+alias int function(void *, void *, void *) _BCD_func__2478;
+alias _BCD_func__2478 GTraverseFunc;
+alias void GTree;
+alias void GTimer;
+alias _GThreadPool GThreadPool;
+alias _BCD_func__2422 GFunc;
+enum GAsciiType {
+G_ASCII_ALNUM=1,
+G_ASCII_ALPHA=2,
+G_ASCII_CNTRL=4,
+G_ASCII_DIGIT=8,
+G_ASCII_GRAPH=16,
+G_ASCII_LOWER=32,
+G_ASCII_PRINT=64,
+G_ASCII_PUNCT=128,
+G_ASCII_SPACE=256,
+G_ASCII_UPPER=512,
+G_ASCII_XDIGIT=1024,
+}
+enum GSpawnFlags {
+G_SPAWN_LEAVE_DESCRIPTORS_OPEN=1,
+G_SPAWN_DO_NOT_REAP_CHILD=2,
+G_SPAWN_SEARCH_PATH=4,
+G_SPAWN_STDOUT_TO_DEV_NULL=8,
+G_SPAWN_STDERR_TO_DEV_NULL=16,
+G_SPAWN_CHILD_INHERITS_STDIN=32,
+G_SPAWN_FILE_AND_ARGV_ZERO=64,
+}
+alias _BCD_func__2417 GSpawnChildSetupFunc;
+enum GSpawnError {
+G_SPAWN_ERROR_FORK=0,
+G_SPAWN_ERROR_READ=1,
+G_SPAWN_ERROR_CHDIR=2,
+G_SPAWN_ERROR_ACCES=3,
+G_SPAWN_ERROR_PERM=4,
+G_SPAWN_ERROR_2BIG=5,
+G_SPAWN_ERROR_NOEXEC=6,
+G_SPAWN_ERROR_NAMETOOLONG=7,
+G_SPAWN_ERROR_NOENT=8,
+G_SPAWN_ERROR_NOMEM=9,
+G_SPAWN_ERROR_NOTDIR=10,
+G_SPAWN_ERROR_LOOP=11,
+G_SPAWN_ERROR_TXTBUSY=12,
+G_SPAWN_ERROR_IO=13,
+G_SPAWN_ERROR_NFILE=14,
+G_SPAWN_ERROR_MFILE=15,
+G_SPAWN_ERROR_INVAL=16,
+G_SPAWN_ERROR_ISDIR=17,
+G_SPAWN_ERROR_LIBBAD=18,
+G_SPAWN_ERROR_FAILED=19,
+}
+enum GShellError {
+G_SHELL_ERROR_BAD_QUOTING=0,
+G_SHELL_ERROR_EMPTY_STRING=1,
+G_SHELL_ERROR_FAILED=2,
+}
+alias void GSequenceIter;
+alias int function(void *, void *, void *) _BCD_func__2497;
+alias _BCD_func__2497 GSequenceIterCompareFunc;
+alias void GSequence;
+enum GTokenType {
+G_TOKEN_EOF=0,
+G_TOKEN_LEFT_PAREN=40,
+G_TOKEN_RIGHT_PAREN=41,
+G_TOKEN_LEFT_CURLY=123,
+G_TOKEN_RIGHT_CURLY=125,
+G_TOKEN_LEFT_BRACE=91,
+G_TOKEN_RIGHT_BRACE=93,
+G_TOKEN_EQUAL_SIGN=61,
+G_TOKEN_COMMA=44,
+G_TOKEN_NONE=256,
+G_TOKEN_ERROR=257,
+G_TOKEN_CHAR=258,
+G_TOKEN_BINARY=259,
+G_TOKEN_OCTAL=260,
+G_TOKEN_INT=261,
+G_TOKEN_HEX=262,
+G_TOKEN_FLOAT=263,
+G_TOKEN_STRING=264,
+G_TOKEN_SYMBOL=265,
+G_TOKEN_IDENTIFIER=266,
+G_TOKEN_IDENTIFIER_NULL=267,
+G_TOKEN_COMMENT_SINGLE=268,
+G_TOKEN_COMMENT_MULTI=269,
+G_TOKEN_LAST=270,
+}
+enum GErrorType {
+G_ERR_UNKNOWN=0,
+G_ERR_UNEXP_EOF=1,
+G_ERR_UNEXP_EOF_IN_STRING=2,
+G_ERR_UNEXP_EOF_IN_COMMENT=3,
+G_ERR_NON_DIGIT_IN_CONST=4,
+G_ERR_DIGIT_RADIX=5,
+G_ERR_FLOAT_RADIX=6,
+G_ERR_FLOAT_MALFORMED=7,
+}
+alias _GScanner GScanner;
+alias void function(_GScanner *, char *, int) _BCD_func__2500;
+alias _BCD_func__2500 GScannerMsgFunc;
+alias _GTokenValue GTokenValue;
+alias char guchar;
+alias _GScannerConfig GScannerConfig;
+alias void GHashTable;
+alias void GMatchInfo;
+alias _GString GString;
+alias int function(void *, _GString *, void *) _BCD_func__2573;
+alias _BCD_func__2573 GRegexEvalCallback;
+alias void GRegex;
+enum GRegexMatchFlags {
+G_REGEX_MATCH_ANCHORED=16,
+G_REGEX_MATCH_NOTBOL=128,
+G_REGEX_MATCH_NOTEOL=256,
+G_REGEX_MATCH_NOTEMPTY=1024,
+G_REGEX_MATCH_PARTIAL=32768,
+G_REGEX_MATCH_NEWLINE_CR=1048576,
+G_REGEX_MATCH_NEWLINE_LF=2097152,
+G_REGEX_MATCH_NEWLINE_CRLF=3145728,
+G_REGEX_MATCH_NEWLINE_ANY=4194304,
+}
+enum GRegexCompileFlags {
+G_REGEX_CASELESS=1,
+G_REGEX_MULTILINE=2,
+G_REGEX_DOTALL=4,
+G_REGEX_EXTENDED=8,
+G_REGEX_ANCHORED=16,
+G_REGEX_DOLLAR_ENDONLY=32,
+G_REGEX_UNGREEDY=512,
+G_REGEX_RAW=2048,
+G_REGEX_NO_AUTO_CAPTURE=4096,
+G_REGEX_OPTIMIZE=8192,
+G_REGEX_DUPNAMES=524288,
+G_REGEX_NEWLINE_CR=1048576,
+G_REGEX_NEWLINE_LF=2097152,
+G_REGEX_NEWLINE_CRLF=3145728,
+}
+enum GRegexError {
+G_REGEX_ERROR_COMPILE=0,
+G_REGEX_ERROR_OPTIMIZE=1,
+G_REGEX_ERROR_REPLACE=2,
+G_REGEX_ERROR_MATCH=3,
+}
+alias _GTuples GTuples;
+alias void GRelation;
+alias void GRand;
+alias _GQueue GQueue;
+alias _GList GList;
+alias void GPatternSpec;
+enum GOptionError {
+G_OPTION_ERROR_UNKNOWN_OPTION=0,
+G_OPTION_ERROR_BAD_VALUE=1,
+G_OPTION_ERROR_FAILED=2,
+}
+alias void GOptionContext;
+alias void GOptionGroup;
+alias _GError GError;
+alias void function(void *, void *, void *, _GError * *) _BCD_func__2591;
+alias _BCD_func__2591 GOptionErrorFunc;
+alias int function(void *, void *, void *, _GError * *) _BCD_func__2592;
+alias _BCD_func__2592 GOptionParseFunc;
+alias int function(char *, char *, void *, _GError * *) _BCD_func__2593;
+alias _BCD_func__2593 GOptionArgFunc;
+enum GOptionArg {
+G_OPTION_ARG_NONE=0,
+G_OPTION_ARG_STRING=1,
+G_OPTION_ARG_INT=2,
+G_OPTION_ARG_CALLBACK=3,
+G_OPTION_ARG_FILENAME=4,
+G_OPTION_ARG_STRING_ARRAY=5,
+G_OPTION_ARG_FILENAME_ARRAY=6,
+G_OPTION_ARG_DOUBLE=7,
+G_OPTION_ARG_INT64=8,
+}
+enum GOptionFlags {
+G_OPTION_FLAG_HIDDEN=1,
+G_OPTION_FLAG_IN_MAIN=2,
+G_OPTION_FLAG_REVERSE=4,
+G_OPTION_FLAG_NO_ARG=8,
+G_OPTION_FLAG_FILENAME=16,
+G_OPTION_FLAG_OPTIONAL_ARG=32,
+G_OPTION_FLAG_NOALIAS=64,
+}
+alias _GOptionEntry GOptionEntry;
+alias void * function(void *, void *) _BCD_func__2604;
+alias _BCD_func__2604 GCopyFunc;
+alias _GNode GNode;
+alias void function(_GNode *, void *) _BCD_func__2605;
+alias _BCD_func__2605 GNodeForeachFunc;
+alias int function(_GNode *, void *) _BCD_func__2606;
+alias _BCD_func__2606 GNodeTraverseFunc;
+enum GTraverseType {
+G_IN_ORDER=0,
+G_PRE_ORDER=1,
+G_POST_ORDER=2,
+G_LEVEL_ORDER=3,
+}
+enum GTraverseFlags {
+G_TRAVERSE_LEAVES=1,
+G_TRAVERSE_NON_LEAVES=2,
+G_TRAVERSE_ALL=3,
+G_TRAVERSE_MASK=3,
+G_TRAVERSE_LEAFS=1,
+G_TRAVERSE_NON_LEAFS=2,
+}
+alias void function(char *) _BCD_func__2614;
+alias _BCD_func__2614 GPrintFunc;
+enum GLogLevelFlags {
+G_LOG_FLAG_RECURSION=1,
+G_LOG_FLAG_FATAL=2,
+G_LOG_LEVEL_ERROR=4,
+G_LOG_LEVEL_CRITICAL=8,
+G_LOG_LEVEL_WARNING=16,
+G_LOG_LEVEL_MESSAGE=32,
+G_LOG_LEVEL_INFO=64,
+G_LOG_LEVEL_DEBUG=128,
+G_LOG_LEVEL_MASK=-4,
+}
+alias void function(char *, int, char *, void *) _BCD_func__2616;
+alias _BCD_func__2616 GLogFunc;
+alias _GMarkupParser GMarkupParser;
+alias void GMarkupParseContext;
+alias void function(void *, char *, char * *, char * *, void *, _GError * *) _BCD_func__3288;
+alias void function(void *, char *, void *, _GError * *) _BCD_func__3289;
+alias void function(void *, char *, uint, void *, _GError * *) _BCD_func__3290;
+alias void function(void *, _GError *, void *) _BCD_func__3291;
+enum GMarkupParseFlags {
+G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG=1,
+G_MARKUP_TREAT_CDATA_AS_TEXT=2,
+}
+enum GMarkupError {
+G_MARKUP_ERROR_BAD_UTF8=0,
+G_MARKUP_ERROR_EMPTY=1,
+G_MARKUP_ERROR_PARSE=2,
+G_MARKUP_ERROR_UNKNOWN_ELEMENT=3,
+G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE=4,
+G_MARKUP_ERROR_INVALID_CONTENT=5,
+}
+alias void GMappedFile;
+enum GKeyFileFlags {
+G_KEY_FILE_NONE=0,
+G_KEY_FILE_KEEP_COMMENTS=1,
+G_KEY_FILE_KEEP_TRANSLATIONS=2,
+}
+alias void GKeyFile;
+enum GKeyFileError {
+G_KEY_FILE_ERROR_UNKNOWN_ENCODING=0,
+G_KEY_FILE_ERROR_PARSE=1,
+G_KEY_FILE_ERROR_NOT_FOUND=2,
+G_KEY_FILE_ERROR_KEY_NOT_FOUND=3,
+G_KEY_FILE_ERROR_GROUP_NOT_FOUND=4,
+G_KEY_FILE_ERROR_INVALID_VALUE=5,
+}
+alias _GIOChannel GIOChannel;
+enum GIOCondition {
+G_IO_IN=1,
+G_IO_OUT=4,
+G_IO_PRI=2,
+G_IO_ERR=8,
+G_IO_HUP=16,
+G_IO_NVAL=32,
+}
+alias int function(_GIOChannel *, int, void *) _BCD_func__2635;
+alias _BCD_func__2635 GIOFunc;
+enum GIOFlags {
+G_IO_FLAG_APPEND=1,
+G_IO_FLAG_NONBLOCK=2,
+G_IO_FLAG_IS_READABLE=4,
+G_IO_FLAG_IS_WRITEABLE=8,
+G_IO_FLAG_IS_SEEKABLE=16,
+G_IO_FLAG_MASK=31,
+G_IO_FLAG_GET_MASK=31,
+G_IO_FLAG_SET_MASK=3,
+}
+enum GSeekType {
+G_SEEK_CUR=0,
+G_SEEK_SET=1,
+G_SEEK_END=2,
+}
+enum GIOStatus {
+G_IO_STATUS_ERROR=0,
+G_IO_STATUS_NORMAL=1,
+G_IO_STATUS_EOF=2,
+G_IO_STATUS_AGAIN=3,
+}
+enum GIOChannelError {
+G_IO_CHANNEL_ERROR_FBIG=0,
+G_IO_CHANNEL_ERROR_INVAL=1,
+G_IO_CHANNEL_ERROR_IO=2,
+G_IO_CHANNEL_ERROR_ISDIR=3,
+G_IO_CHANNEL_ERROR_NOSPC=4,
+G_IO_CHANNEL_ERROR_NXIO=5,
+G_IO_CHANNEL_ERROR_OVERFLOW=6,
+G_IO_CHANNEL_ERROR_PIPE=7,
+G_IO_CHANNEL_ERROR_FAILED=8,
+}
+enum GIOError {
+G_IO_ERROR_NONE=0,
+G_IO_ERROR_AGAIN=1,
+G_IO_ERROR_INVAL=2,
+G_IO_ERROR_UNKNOWN=3,
+}
+alias _GIOFuncs GIOFuncs;
+alias int function(_GIOChannel *, char *, uint, uint *, _GError * *) _BCD_func__3293;
+alias int function(_GIOChannel *, char *, uint, uint *, _GError * *) _BCD_func__3294;
+alias int function(_GIOChannel *, long, int, _GError * *) _BCD_func__3295;
+alias int function(_GIOChannel *, _GError * *) _BCD_func__3296;
+alias _GSource GSource;
+alias _GSource * function(_GIOChannel *, int) _BCD_func__3297;
+alias void function(_GIOChannel *) _BCD_func__3298;
+alias int function(_GIOChannel *, int, _GError * *) _BCD_func__3299;
+alias int function(_GIOChannel *) _BCD_func__3300;
+alias void * GIConv;
+alias void GStringChunk;
+enum GNormalizeMode {
+G_NORMALIZE_DEFAULT=0,
+G_NORMALIZE_NFD=0,
+G_NORMALIZE_DEFAULT_COMPOSE=1,
+G_NORMALIZE_NFC=1,
+G_NORMALIZE_ALL=2,
+G_NORMALIZE_NFKD=2,
+G_NORMALIZE_ALL_COMPOSE=3,
+G_NORMALIZE_NFKC=3,
+}
+enum GUnicodeScript {
+G_UNICODE_SCRIPT_INVALID_CODE=-1,
+G_UNICODE_SCRIPT_COMMON=0,
+G_UNICODE_SCRIPT_INHERITED=1,
+G_UNICODE_SCRIPT_ARABIC=2,
+G_UNICODE_SCRIPT_ARMENIAN=3,
+G_UNICODE_SCRIPT_BENGALI=4,
+G_UNICODE_SCRIPT_BOPOMOFO=5,
+G_UNICODE_SCRIPT_CHEROKEE=6,
+G_UNICODE_SCRIPT_COPTIC=7,
+G_UNICODE_SCRIPT_CYRILLIC=8,
+G_UNICODE_SCRIPT_DESERET=9,
+G_UNICODE_SCRIPT_DEVANAGARI=10,
+G_UNICODE_SCRIPT_ETHIOPIC=11,
+G_UNICODE_SCRIPT_GEORGIAN=12,
+G_UNICODE_SCRIPT_GOTHIC=13,
+G_UNICODE_SCRIPT_GREEK=14,
+G_UNICODE_SCRIPT_GUJARATI=15,
+G_UNICODE_SCRIPT_GURMUKHI=16,
+G_UNICODE_SCRIPT_HAN=17,
+G_UNICODE_SCRIPT_HANGUL=18,
+G_UNICODE_SCRIPT_HEBREW=19,
+G_UNICODE_SCRIPT_HIRAGANA=20,
+G_UNICODE_SCRIPT_KANNADA=21,
+G_UNICODE_SCRIPT_KATAKANA=22,
+G_UNICODE_SCRIPT_KHMER=23,
+G_UNICODE_SCRIPT_LAO=24,
+G_UNICODE_SCRIPT_LATIN=25,
+G_UNICODE_SCRIPT_MALAYALAM=26,
+G_UNICODE_SCRIPT_MONGOLIAN=27,
+G_UNICODE_SCRIPT_MYANMAR=28,
+G_UNICODE_SCRIPT_OGHAM=29,
+G_UNICODE_SCRIPT_OLD_ITALIC=30,
+G_UNICODE_SCRIPT_ORIYA=31,
+G_UNICODE_SCRIPT_RUNIC=32,
+G_UNICODE_SCRIPT_SINHALA=33,
+G_UNICODE_SCRIPT_SYRIAC=34,
+G_UNICODE_SCRIPT_TAMIL=35,
+G_UNICODE_SCRIPT_TELUGU=36,
+G_UNICODE_SCRIPT_THAANA=37,
+G_UNICODE_SCRIPT_THAI=38,
+G_UNICODE_SCRIPT_TIBETAN=39,
+G_UNICODE_SCRIPT_CANADIAN_ABORIGINAL=40,
+G_UNICODE_SCRIPT_YI=41,
+G_UNICODE_SCRIPT_TAGALOG=42,
+G_UNICODE_SCRIPT_HANUNOO=43,
+G_UNICODE_SCRIPT_BUHID=44,
+G_UNICODE_SCRIPT_TAGBANWA=45,
+G_UNICODE_SCRIPT_BRAILLE=46,
+G_UNICODE_SCRIPT_CYPRIOT=47,
+G_UNICODE_SCRIPT_LIMBU=48,
+G_UNICODE_SCRIPT_OSMANYA=49,
+G_UNICODE_SCRIPT_SHAVIAN=50,
+G_UNICODE_SCRIPT_LINEAR_B=51,
+G_UNICODE_SCRIPT_TAI_LE=52,
+G_UNICODE_SCRIPT_UGARITIC=53,
+G_UNICODE_SCRIPT_NEW_TAI_LUE=54,
+G_UNICODE_SCRIPT_BUGINESE=55,
+G_UNICODE_SCRIPT_GLAGOLITIC=56,
+G_UNICODE_SCRIPT_TIFINAGH=57,
+G_UNICODE_SCRIPT_SYLOTI_NAGRI=58,
+G_UNICODE_SCRIPT_OLD_PERSIAN=59,
+G_UNICODE_SCRIPT_KHAROSHTHI=60,
+G_UNICODE_SCRIPT_UNKNOWN=61,
+G_UNICODE_SCRIPT_BALINESE=62,
+G_UNICODE_SCRIPT_CUNEIFORM=63,
+G_UNICODE_SCRIPT_PHOENICIAN=64,
+G_UNICODE_SCRIPT_PHAGS_PA=65,
+G_UNICODE_SCRIPT_NKO=66,
+}
+enum GUnicodeBreakType {
+G_UNICODE_BREAK_MANDATORY=0,
+G_UNICODE_BREAK_CARRIAGE_RETURN=1,
+G_UNICODE_BREAK_LINE_FEED=2,
+G_UNICODE_BREAK_COMBINING_MARK=3,
+G_UNICODE_BREAK_SURROGATE=4,
+G_UNICODE_BREAK_ZERO_WIDTH_SPACE=5,
+G_UNICODE_BREAK_INSEPARABLE=6,
+G_UNICODE_BREAK_NON_BREAKING_GLUE=7,
+G_UNICODE_BREAK_CONTINGENT=8,
+G_UNICODE_BREAK_SPACE=9,
+G_UNICODE_BREAK_AFTER=10,
+G_UNICODE_BREAK_BEFORE=11,
+G_UNICODE_BREAK_BEFORE_AND_AFTER=12,
+G_UNICODE_BREAK_HYPHEN=13,
+G_UNICODE_BREAK_NON_STARTER=14,
+G_UNICODE_BREAK_OPEN_PUNCTUATION=15,
+G_UNICODE_BREAK_CLOSE_PUNCTUATION=16,
+G_UNICODE_BREAK_QUOTATION=17,
+G_UNICODE_BREAK_EXCLAMATION=18,
+G_UNICODE_BREAK_IDEOGRAPHIC=19,
+G_UNICODE_BREAK_NUMERIC=20,
+G_UNICODE_BREAK_INFIX_SEPARATOR=21,
+G_UNICODE_BREAK_SYMBOL=22,
+G_UNICODE_BREAK_ALPHABETIC=23,
+G_UNICODE_BREAK_PREFIX=24,
+G_UNICODE_BREAK_POSTFIX=25,
+G_UNICODE_BREAK_COMPLEX_CONTEXT=26,
+G_UNICODE_BREAK_AMBIGUOUS=27,
+G_UNICODE_BREAK_UNKNOWN=28,
+G_UNICODE_BREAK_NEXT_LINE=29,
+G_UNICODE_BREAK_WORD_JOINER=30,
+G_UNICODE_BREAK_HANGUL_L_JAMO=31,
+G_UNICODE_BREAK_HANGUL_V_JAMO=32,
+G_UNICODE_BREAK_HANGUL_T_JAMO=33,
+G_UNICODE_BREAK_HANGUL_LV_SYLLABLE=34,
+G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE=35,
+}
+enum GUnicodeType {
+G_UNICODE_CONTROL=0,
+G_UNICODE_FORMAT=1,
+G_UNICODE_UNASSIGNED=2,
+G_UNICODE_PRIVATE_USE=3,
+G_UNICODE_SURROGATE=4,
+G_UNICODE_LOWERCASE_LETTER=5,
+G_UNICODE_MODIFIER_LETTER=6,
+G_UNICODE_OTHER_LETTER=7,
+G_UNICODE_TITLECASE_LETTER=8,
+G_UNICODE_UPPERCASE_LETTER=9,
+G_UNICODE_COMBINING_MARK=10,
+G_UNICODE_ENCLOSING_MARK=11,
+G_UNICODE_NON_SPACING_MARK=12,
+G_UNICODE_DECIMAL_NUMBER=13,
+G_UNICODE_LETTER_NUMBER=14,
+G_UNICODE_OTHER_NUMBER=15,
+G_UNICODE_CONNECT_PUNCTUATION=16,
+G_UNICODE_DASH_PUNCTUATION=17,
+G_UNICODE_CLOSE_PUNCTUATION=18,
+G_UNICODE_FINAL_PUNCTUATION=19,
+G_UNICODE_INITIAL_PUNCTUATION=20,
+G_UNICODE_OTHER_PUNCTUATION=21,
+G_UNICODE_OPEN_PUNCTUATION=22,
+G_UNICODE_CURRENCY_SYMBOL=23,
+G_UNICODE_MODIFIER_SYMBOL=24,
+G_UNICODE_MATH_SYMBOL=25,
+G_UNICODE_OTHER_SYMBOL=26,
+G_UNICODE_LINE_SEPARATOR=27,
+G_UNICODE_PARAGRAPH_SEPARATOR=28,
+G_UNICODE_SPACE_SEPARATOR=29,
+}
+alias ushort gunichar2;
+alias _GPollFD GPollFD;
+alias int function(_GPollFD *, uint, int) _BCD_func__2688;
+alias _BCD_func__2688 GPollFunc;
+alias ushort gushort;
+alias _BCD_func__2331 GSourceDummyMarshal;
+alias void function(int, int, void *) _BCD_func__2694;
+alias _BCD_func__2694 GChildWatchFunc;
+alias int function(void *) _BCD_func__2695;
+alias _BCD_func__2695 GSourceFunc;
+alias _GSourceFuncs GSourceFuncs;
+alias int function(_GSource *, int *) _BCD_func__3305;
+alias int function(_GSource *) _BCD_func__3306;
+alias int function(_GSource *, _BCD_func__2695, void *) _BCD_func__3307;
+alias void function(_GSource *) _BCD_func__3308;
+alias _GSourceCallbackFuncs GSourceCallbackFuncs;
+alias void function(void *, _GSource *, _BCD_func__2695 *, void * *) _BCD_func__3310;
+alias void GMainContext;
+alias void GMainLoop;
+enum GHookFlagMask {
+G_HOOK_FLAG_ACTIVE=1,
+G_HOOK_FLAG_IN_CALL=2,
+G_HOOK_FLAG_MASK=15,
+}
+alias _GHookList GHookList;
+alias _GHook GHook;
+alias void function(_GHookList *, _GHook *) _BCD_func__2731;
+alias _BCD_func__2731 GHookFinalizeFunc;
+alias _BCD_func__2695 GHookCheckFunc;
+alias _BCD_func__2417 GHookFunc;
+alias int function(_GHook *, void *) _BCD_func__2732;
+alias _BCD_func__2732 GHookCheckMarshaller;
+alias void function(_GHook *, void *) _BCD_func__2733;
+alias _BCD_func__2733 GHookMarshaller;
+alias _BCD_func__2732 GHookFindFunc;
+alias int function(_GHook *, _GHook *) _BCD_func__2734;
+alias _BCD_func__2734 GHookCompareFunc;
+alias _BCD_func__2417 GDestroyNotify;
+alias _BCD_func__2478 GHRFunc;
+enum GFileTest {
+G_FILE_TEST_IS_REGULAR=1,
+G_FILE_TEST_IS_SYMLINK=2,
+G_FILE_TEST_IS_DIR=4,
+G_FILE_TEST_IS_EXECUTABLE=8,
+G_FILE_TEST_EXISTS=16,
+}
+enum GFileError {
+G_FILE_ERROR_EXIST=0,
+G_FILE_ERROR_ISDIR=1,
+G_FILE_ERROR_ACCES=2,
+G_FILE_ERROR_NAMETOOLONG=3,
+G_FILE_ERROR_NOENT=4,
+G_FILE_ERROR_NOTDIR=5,
+G_FILE_ERROR_NXIO=6,
+G_FILE_ERROR_NODEV=7,
+G_FILE_ERROR_ROFS=8,
+G_FILE_ERROR_TXTBSY=9,
+G_FILE_ERROR_FAULT=10,
+G_FILE_ERROR_LOOP=11,
+G_FILE_ERROR_NOSPC=12,
+G_FILE_ERROR_NOMEM=13,
+G_FILE_ERROR_MFILE=14,
+G_FILE_ERROR_NFILE=15,
+G_FILE_ERROR_BADF=16,
+G_FILE_ERROR_INVAL=17,
+G_FILE_ERROR_PIPE=18,
+G_FILE_ERROR_AGAIN=19,
+G_FILE_ERROR_INTR=20,
+G_FILE_ERROR_IO=21,
+G_FILE_ERROR_PERM=22,
+G_FILE_ERROR_NOSYS=23,
+G_FILE_ERROR_FAILED=24,
+}
+alias void GDir;
+enum GDateMonth {
+G_DATE_BAD_MONTH=0,
+G_DATE_JANUARY=1,
+G_DATE_FEBRUARY=2,
+G_DATE_MARCH=3,
+G_DATE_APRIL=4,
+G_DATE_MAY=5,
+G_DATE_JUNE=6,
+G_DATE_JULY=7,
+G_DATE_AUGUST=8,
+G_DATE_SEPTEMBER=9,
+G_DATE_OCTOBER=10,
+G_DATE_NOVEMBER=11,
+G_DATE_DECEMBER=12,
+}
+enum GDateWeekday {
+G_DATE_BAD_WEEKDAY=0,
+G_DATE_MONDAY=1,
+G_DATE_TUESDAY=2,
+G_DATE_WEDNESDAY=3,
+G_DATE_THURSDAY=4,
+G_DATE_FRIDAY=5,
+G_DATE_SATURDAY=6,
+G_DATE_SUNDAY=7,
+}
+enum GDateDMY {
+G_DATE_DAY=0,
+G_DATE_MONTH=1,
+G_DATE_YEAR=2,
+}
+alias _GDate GDate;
+alias char GDateDay;
+alias ushort GDateYear;
+alias int GTime;
+alias void function(uint, void *, void *) _BCD_func__2768;
+alias _BCD_func__2768 GDataForeachFunc;
+enum GConvertError {
+G_CONVERT_ERROR_NO_CONVERSION=0,
+G_CONVERT_ERROR_ILLEGAL_SEQUENCE=1,
+G_CONVERT_ERROR_FAILED=2,
+G_CONVERT_ERROR_PARTIAL_INPUT=3,
+G_CONVERT_ERROR_BAD_URI=4,
+G_CONVERT_ERROR_NOT_ABSOLUTE_PATH=5,
+}
+alias int function(char *, char *, uint) _BCD_func__2771;
+alias _BCD_func__2771 GCompletionStrncmpFunc;
+alias char * function(void *) _BCD_func__2772;
+alias _BCD_func__2772 GCompletionFunc;
+alias _GCompletion GCompletion;
+alias _BCD_func__2417 GCacheDestroyFunc;
+alias _BCD_func__2418 GCacheDupFunc;
+alias _BCD_func__2418 GCacheNewFunc;
+alias void GCache;
+alias void GMemChunk;
+alias void GAllocator;
+alias _GMemVTable GMemVTable;
+alias void * function(uint) _BCD_func__3319;
+alias void * function(void *, uint) _BCD_func__3320;
+alias void * function(uint, uint) _BCD_func__3321;
+enum GSliceConfig {
+G_SLICE_CONFIG_ALWAYS_MALLOC=1,
+G_SLICE_CONFIG_BYPASS_MAGAZINES=2,
+G_SLICE_CONFIG_WORKING_SET_MSECS=3,
+G_SLICE_CONFIG_COLOR_INCREMENT=4,
+G_SLICE_CONFIG_CHUNK_SIZES=5,
+G_SLICE_CONFIG_CONTENTION_COUNTER=6,
+}
+alias void GBookmarkFile;
+enum GBookmarkFileError {
+G_BOOKMARK_FILE_ERROR_INVALID_URI=0,
+G_BOOKMARK_FILE_ERROR_INVALID_VALUE=1,
+G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED=2,
+G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND=3,
+G_BOOKMARK_FILE_ERROR_READ=4,
+G_BOOKMARK_FILE_ERROR_UNKNOWN_ENCODING=5,
+G_BOOKMARK_FILE_ERROR_WRITE=6,
+G_BOOKMARK_FILE_ERROR_FILE_NOT_FOUND=7,
+}
+alias void GAsyncQueue;
+alias _GOnce GOnce;
+enum GOnceStatus {
+G_ONCE_STATUS_NOTCALLED=0,
+G_ONCE_STATUS_PROGRESS=1,
+G_ONCE_STATUS_READY=2,
+}
+alias _GStaticRWLock GStaticRWLock;
+alias void GCond;
+alias _GStaticRecMutex GStaticRecMutex;
+alias _GThreadFunctions GThreadFunctions;
+alias void GMutex;
+alias void * function() _BCD_func__3330;
+alias void function(void *) _BCD_func__3331;
+alias int function(void *) _BCD_func__3332;
+alias void * function() _BCD_func__3333;
+alias void function(void *) _BCD_func__3334;
+alias void function(void *, void *) _BCD_func__3335;
+alias _GTimeVal GTimeVal;
+alias int function(void *, void *, _GTimeVal *) _BCD_func__3336;
+alias void GPrivate;
+alias void * function(_BCD_func__2417) _BCD_func__3337;
+alias void * function(void *) _BCD_func__3338;
+alias void function(void *, void *) _BCD_func__3339;
+enum GThreadPriority {
+G_THREAD_PRIORITY_LOW=0,
+G_THREAD_PRIORITY_NORMAL=1,
+G_THREAD_PRIORITY_HIGH=2,
+G_THREAD_PRIORITY_URGENT=3,
+}
+alias void function(_BCD_func__2418, void *, uint, int, int, int, void *, _GError * *) _BCD_func__3340;
+alias void function(void *, int) _BCD_func__3341;
+alias int function(void *, void *) _BCD_func__3342;
+alias _GStaticPrivate GStaticPrivate;
+alias _GThread GThread;
+alias _BCD_func__2418 GThreadFunc;
+enum GThreadError {
+G_THREAD_ERROR_AGAIN=0,
+}
+alias _GTrashStack GTrashStack;
+alias _BCD_func__2331 GVoidFunc;
+alias _GDebugKey GDebugKey;
+enum GUserDirectory {
+G_USER_DIRECTORY_DESKTOP=0,
+G_USER_DIRECTORY_DOCUMENTS=1,
+G_USER_DIRECTORY_DOWNLOAD=2,
+G_USER_DIRECTORY_MUSIC=3,
+G_USER_DIRECTORY_PICTURES=4,
+G_USER_DIRECTORY_PUBLIC_SHARE=5,
+G_USER_DIRECTORY_TEMPLATES=6,
+G_USER_DIRECTORY_VIDEOS=7,
+G_USER_N_DIRECTORIES=8,
+}
+alias _GPtrArray GPtrArray;
+alias _GByteArray GByteArray;
+alias _GArray GArray;
+alias _GFloatIEEE754 GFloatIEEE754;
+alias _GDoubleIEEE754 GDoubleIEEE754;
+alias char * function(char *, void *) _BCD_func__2964;
+alias _BCD_func__2964 GTranslateFunc;
+alias _BCD_func__2417 GFreeFunc;
+alias void function(void *, void *, void *) _BCD_func__2965;
+alias _BCD_func__2965 GHFunc;
+alias uint function(void *) _BCD_func__2966;
+alias _BCD_func__2966 GHashFunc;
+alias int function(void *, void *) _BCD_func__2967;
+alias _BCD_func__2967 GEqualFunc;
+alias int function(void *, void *, void *) _BCD_func__2968;
+alias _BCD_func__2968 GCompareDataFunc;
+alias int function(void *, void *) _BCD_func__2969;
+alias _BCD_func__2969 GCompareFunc;
+alias short gshort;
+alias ulong function() _BCD_func__3161;
+struct _GValueArray {
+uint n_values;
+_GValue * values;
+uint n_prealloced;
+}
+struct _GTypePluginClass {
+_GTypeInterface base_iface;
+_BCD_func__2126 use_plugin;
+_BCD_func__2126 unuse_plugin;
+_BCD_func__2125 complete_type_info;
+_BCD_func__2124 complete_interface_info;
+}
+struct _GTypeModuleClass {
+_GObjectClass parent_class;
+_BCD_func__3215 load;
+_BCD_func__3216 unload;
+_BCD_func__2331 reserved1;
+_BCD_func__2331 reserved2;
+_BCD_func__2331 reserved3;
+_BCD_func__2331 reserved4;
+}
+struct _GTypeModule {
+_GObject parent_instance;
+uint use_count;
+_GSList * type_infos;
+_GSList * interface_infos;
+char * name;
+}
+struct _GParamSpecGType {
+_GParamSpec parent_instance;
+uint is_a_type;
+}
+struct _GParamSpecOverride {
+_GParamSpec parent_instance;
+_GParamSpec * overridden;
+}
+struct _GParamSpecObject {
+_GParamSpec parent_instance;
+}
+struct _GParamSpecValueArray {
+_GParamSpec parent_instance;
+_GParamSpec * element_spec;
+uint fixed_n_elements;
+}
+struct _GParamSpecPointer {
+_GParamSpec parent_instance;
+}
+struct _GParamSpecBoxed {
+_GParamSpec parent_instance;
+}
+struct _GParamSpecParam {
+_GParamSpec parent_instance;
+}
+struct _GParamSpecString {
+_GParamSpec parent_instance;
+char * default_value;
+char * cset_first;
+char * cset_nth;
+char substitutor;
+ubyte bitfield0;
+// uint null_fold_if_empty // bits 0 .. 1
+// uint ensure_non_null // bits 1 .. 2
+}
+struct _GParamSpecDouble {
+_GParamSpec parent_instance;
+double minimum;
+double maximum;
+double default_value;
+double epsilon;
+}
+struct _GParamSpecFloat {
+_GParamSpec parent_instance;
+float minimum;
+float maximum;
+float default_value;
+float epsilon;
+}
+struct _GParamSpecFlags {
+_GParamSpec parent_instance;
+_GFlagsClass * flags_class;
+uint default_value;
+}
+struct _GParamSpecEnum {
+_GParamSpec parent_instance;
+_GEnumClass * enum_class;
+int default_value;
+}
+struct _GParamSpecUnichar {
+_GParamSpec parent_instance;
+uint default_value;
+}
+struct _GParamSpecUInt64 {
+_GParamSpec parent_instance;
+ulong minimum;
+ulong maximum;
+ulong default_value;
+}
+struct _GParamSpecInt64 {
+_GParamSpec parent_instance;
+long minimum;
+long maximum;
+long default_value;
+}
+struct _GParamSpecULong {
+_GParamSpec parent_instance;
+uint minimum;
+uint maximum;
+uint default_value;
+}
+struct _GParamSpecLong {
+_GParamSpec parent_instance;
+int minimum;
+int maximum;
+int default_value;
+}
+struct _GParamSpecUInt {
+_GParamSpec parent_instance;
+uint minimum;
+uint maximum;
+uint default_value;
+}
+struct _GParamSpecInt {
+_GParamSpec parent_instance;
+int minimum;
+int maximum;
+int default_value;
+}
+struct _GParamSpecBoolean {
+_GParamSpec parent_instance;
+int default_value;
+}
+struct _GParamSpecUChar {
+_GParamSpec parent_instance;
+char minimum;
+char maximum;
+char default_value;
+}
+struct _GParamSpecChar {
+_GParamSpec parent_instance;
+char minimum;
+char maximum;
+char default_value;
+}
+struct _GObjectConstructParam {
+_GParamSpec * pspec;
+_GValue * value;
+}
+struct _GObjectClass {
+_GTypeClass g_type_class;
+_GSList * construct_properties;
+_BCD_func__3242 constructor;
+_BCD_func__2282 set_property;
+_BCD_func__2283 get_property;
+_BCD_func__2281 dispose;
+_BCD_func__2281 finalize;
+_BCD_func__3243 dispatch_properties_changed;
+_BCD_func__3244 notify;
+_BCD_func__2281 constructed;
+void * [7] pdummy;
+}
+struct _GObject {
+_GTypeInstance g_type_instance;
+uint ref_count;
+void * qdata;
+}
+struct _GSignalInvocationHint {
+uint signal_id;
+uint detail;
+int run_type;
+}
+struct _GSignalQuery {
+uint signal_id;
+char * signal_name;
+uint itype;
+int signal_flags;
+uint return_type;
+uint n_params;
+uint * param_types;
+}
+struct _GCClosure {
+_GClosure closure;
+void * callback;
+}
+struct _GClosureNotifyData {
+void * data;
+_BCD_func__2330 notify;
+}
+struct _GClosure {
+uint bitfield0;
+// uint ref_count // bits 0 .. 15
+// uint meta_marshal // bits 15 .. 16
+// uint n_guards // bits 16 .. 17
+// uint n_fnotifiers // bits 17 .. 19
+// uint n_inotifiers // bits 19 .. 27
+// uint in_inotify // bits 27 .. 28
+// uint floating // bits 28 .. 29
+// uint derivative_flag // bits 29 .. 30
+// uint in_marshal // bits 30 .. 31
+// uint is_invalid // bits 31 .. 32
+_BCD_func__2311 marshal;
+void * data;
+_GClosureNotifyData * notifiers;
+}
+struct _GParamSpecTypeInfo {
+ushort instance_size;
+ushort n_preallocs;
+_BCD_func__3253 instance_init;
+uint value_type;
+_BCD_func__3253 finalize;
+_BCD_func__3254 value_set_default;
+_BCD_func__3255 value_validate;
+_BCD_func__3256 values_cmp;
+}
+struct _GParameter {
+char * name;
+_GValue value;
+}
+struct _GParamSpecClass {
+_GTypeClass g_type_class;
+uint value_type;
+_BCD_func__3253 finalize;
+_BCD_func__3254 value_set_default;
+_BCD_func__3255 value_validate;
+_BCD_func__3256 values_cmp;
+void * [4] dummy;
+}
+struct _GParamSpec {
+_GTypeInstance g_type_instance;
+char * name;
+int flags;
+uint value_type;
+uint owner_type;
+char * _nick;
+char * _blurb;
+void * qdata;
+uint ref_count;
+uint param_id;
+}
+struct _GFlagsValue {
+uint value;
+char * value_name;
+char * value_nick;
+}
+struct _GEnumValue {
+int value;
+char * value_name;
+char * value_nick;
+}
+struct _GFlagsClass {
+_GTypeClass g_type_class;
+uint mask;
+uint n_values;
+_GFlagsValue * values;
+}
+struct _GEnumClass {
+_GTypeClass g_type_class;
+int minimum;
+int maximum;
+uint n_values;
+_GEnumValue * values;
+}
+struct _GTypeQuery {
+uint type;
+char * type_name;
+uint class_size;
+uint instance_size;
+}
+struct _GTypeValueTable {
+_BCD_func__3266 value_init;
+_BCD_func__3266 value_free;
+_BCD_func__2389 value_copy;
+_BCD_func__3267 value_peek_pointer;
+char * collect_format;
+_BCD_func__3268 collect_value;
+char * lcopy_format;
+_BCD_func__3269 lcopy_value;
+}
+struct _GInterfaceInfo {
+_BCD_func__2422 interface_init;
+_BCD_func__2422 interface_finalize;
+void * interface_data;
+}
+struct _GTypeFundamentalInfo {
+int type_flags;
+}
+struct _GTypeInfo {
+ushort class_size;
+_BCD_func__2417 base_init;
+_BCD_func__2417 base_finalize;
+_BCD_func__2422 class_init;
+_BCD_func__2422 class_finalize;
+void * class_data;
+ushort instance_size;
+ushort n_preallocs;
+_BCD_func__2424 instance_init;
+_GTypeValueTable * value_table;
+}
+struct _GTypeInstance {
+_GTypeClass * g_class;
+}
+struct _GTypeInterface {
+uint g_type;
+uint g_instance_type;
+}
+struct _GTypeClass {
+uint g_type;
+}
+union N7_GValue4__49E {
+int v_int;
+uint v_uint;
+int v_long;
+uint v_ulong;
+long v_int64;
+ulong v_uint64;
+float v_float;
+double v_double;
+void * v_pointer;
+}
+struct _GValue {
+uint g_type;
+N7_GValue4__49E [2] data;
+}
+struct _GThreadPool {
+_BCD_func__2422 func;
+void * user_data;
+int exclusive;
+}
+union _GTokenValue {
+void * v_symbol;
+char * v_identifier;
+uint v_binary;
+uint v_octal;
+uint v_int;
+ulong v_int64;
+double v_float;
+uint v_hex;
+char * v_string;
+char * v_comment;
+char v_char;
+uint v_error;
+}
+struct _GScannerConfig {
+char * cset_skip_characters;
+char * cset_identifier_first;
+char * cset_identifier_nth;
+char * cpair_comment_single;
+uint bitfield0;
+// uint case_sensitive // bits 0 .. 1
+// uint skip_comment_multi // bits 1 .. 2
+// uint skip_comment_single // bits 2 .. 3
+// uint scan_comment_multi // bits 3 .. 4
+// uint scan_identifier // bits 4 .. 5
+// uint scan_identifier_1char // bits 5 .. 6
+// uint scan_identifier_NULL // bits 6 .. 7
+// uint scan_symbols // bits 7 .. 8
+// uint scan_binary // bits 8 .. 9
+// uint scan_octal // bits 9 .. 10
+// uint scan_float // bits 10 .. 11
+// uint scan_hex // bits 11 .. 12
+// uint scan_hex_dollar // bits 12 .. 13
+// uint scan_string_sq // bits 13 .. 14
+// uint scan_string_dq // bits 14 .. 15
+// uint numbers_2_int // bits 15 .. 16
+// uint int_2_float // bits 16 .. 17
+// uint identifier_2_string // bits 17 .. 18
+// uint char_2_token // bits 18 .. 19
+// uint symbol_2_token // bits 19 .. 20
+// uint scope_0_fallback // bits 20 .. 21
+// uint store_int64 // bits 21 .. 22
+uint padding_dummy;
+}
+struct _GScanner {
+void * user_data;
+uint max_parse_errors;
+uint parse_errors;
+char * input_name;
+void * qdata;
+_GScannerConfig * config;
+int token;
+_GTokenValue value;
+uint line;
+uint position;
+int next_token;
+_GTokenValue next_value;
+uint next_line;
+uint next_position;
+void * symbol_table;
+int input_fd;
+char * text;
+char * text_end;
+char * buffer;
+uint scope_id;
+_BCD_func__2500 msg_handler;
+}
+struct _GTuples {
+uint len;
+}
+struct _GQueue {
+_GList * head;
+_GList * tail;
+uint length;
+}
+struct _GOptionEntry {
+char * long_name;
+char short_name;
+int flags;
+int arg;
+void * arg_data;
+char * description;
+char * arg_description;
+}
+struct _GNode {
+void * data;
+_GNode * next;
+_GNode * prev;
+_GNode * parent;
+_GNode * children;
+}
+struct _GMarkupParser {
+_BCD_func__3288 start_element;
+_BCD_func__3289 end_element;
+_BCD_func__3290 text;
+_BCD_func__3290 passthrough;
+_BCD_func__3291 error;
+}
+struct _GIOFuncs {
+_BCD_func__3293 io_read;
+_BCD_func__3294 io_write;
+_BCD_func__3295 io_seek;
+_BCD_func__3296 io_close;
+_BCD_func__3297 io_create_watch;
+_BCD_func__3298 io_free;
+_BCD_func__3299 io_set_flags;
+_BCD_func__3300 io_get_flags;
+}
+struct _GIOChannel {
+int ref_count;
+_GIOFuncs * funcs;
+char * encoding;
+void * read_cd;
+void * write_cd;
+char * line_term;
+uint line_term_len;
+uint buf_size;
+_GString * read_buf;
+_GString * encoded_read_buf;
+_GString * write_buf;
+char [6] partial_write_buf;
+ubyte bitfield0;
+// uint use_buffer // bits 0 .. 1
+// uint do_encode // bits 1 .. 2
+// uint close_on_unref // bits 2 .. 3
+// uint is_readable // bits 3 .. 4
+// uint is_writeable // bits 4 .. 5
+// uint is_seekable // bits 5 .. 6
+void * reserved1;
+void * reserved2;
+}
+struct _GString {
+char * str;
+uint len;
+uint allocated_len;
+}
+struct _GPollFD {
+int fd;
+ushort events;
+ushort revents;
+}
+struct _GSourceFuncs {
+_BCD_func__3305 prepare;
+_BCD_func__3306 check;
+_BCD_func__3307 dispatch;
+_BCD_func__3308 finalize;
+_BCD_func__2695 closure_callback;
+_BCD_func__2331 closure_marshal;
+}
+struct _GSourceCallbackFuncs {
+_BCD_func__2417 ref_;
+_BCD_func__2417 unref;
+_BCD_func__3310 get;
+}
+struct _GSource {
+void * callback_data;
+_GSourceCallbackFuncs * callback_funcs;
+_GSourceFuncs * source_funcs;
+uint ref_count;
+void * context;
+int priority;
+uint flags;
+uint source_id;
+_GSList * poll_fds;
+_GSource * prev;
+_GSource * next;
+void * reserved1;
+void * reserved2;
+}
+struct _GSList {
+void * data;
+_GSList * next;
+}
+struct _GHookList {
+uint seq_id;
+uint bitfield0;
+// uint hook_size // bits 0 .. 16
+// uint is_setup // bits 16 .. 17
+_GHook * hooks;
+void * dummy3;
+_BCD_func__2731 finalize_hook;
+void * [2] dummy;
+}
+struct _GHook {
+void * data;
+_GHook * next;
+_GHook * prev;
+uint ref_count;
+uint hook_id;
+uint flags;
+void * func;
+_BCD_func__2417 destroy;
+}
+struct _GDate {
+uint bitfield0;
+// uint julian_days // bits 0 .. 32
+uint bitfield1;
+// uint julian // bits 32 .. 33
+// uint dmy // bits 33 .. 34
+// uint day // bits 34 .. 40
+// uint month // bits 40 .. 44
+// uint year // bits 44 .. 60
+}
+struct _GCompletion {
+_GList * items;
+_BCD_func__2772 func;
+char * prefix;
+_GList * cache;
+_BCD_func__2771 strncmp_func;
+}
+struct _GList {
+void * data;
+_GList * next;
+_GList * prev;
+}
+struct _GMemVTable {
+_BCD_func__3319 malloc;
+_BCD_func__3320 realloc;
+_BCD_func__2417 free;
+_BCD_func__3321 calloc;
+_BCD_func__3319 try_malloc;
+_BCD_func__3320 try_realloc;
+}
+struct _GOnce {
+int status;
+void * retval;
+}
+struct _GStaticRWLock {
+_GStaticMutex mutex;
+void * read_cond;
+void * write_cond;
+uint read_counter;
+int have_writer;
+uint want_to_read;
+uint want_to_write;
+}
+struct _GStaticRecMutex {
+_GStaticMutex mutex;
+uint depth;
+_GSystemThread owner;
+}
+struct _GThreadFunctions {
+_BCD_func__3330 mutex_new;
+_BCD_func__3331 mutex_lock;
+_BCD_func__3332 mutex_trylock;
+_BCD_func__3331 mutex_unlock;
+_BCD_func__3331 mutex_free;
+_BCD_func__3333 cond_new;
+_BCD_func__3334 cond_signal;
+_BCD_func__3334 cond_broadcast;
+_BCD_func__3335 cond_wait;
+_BCD_func__3336 cond_timed_wait;
+_BCD_func__3334 cond_free;
+_BCD_func__3337 private_new;
+_BCD_func__3338 private_get;
+_BCD_func__3339 private_set;
+_BCD_func__3340 thread_create;
+_BCD_func__2331 thread_yield;
+_BCD_func__2417 thread_join;
+_BCD_func__2331 thread_exit;
+_BCD_func__3341 thread_set_priority;
+_BCD_func__2417 thread_self;
+_BCD_func__3342 thread_equal;
+}
+struct _GStaticPrivate {
+uint index;
+}
+struct _GThread {
+_BCD_func__2418 func;
+void * data;
+int joinable;
+int priority;
+}
+struct _GTrashStack {
+_GTrashStack * next;
+}
+struct _GDebugKey {
+char * key;
+uint value;
+}
+struct _GError {
+uint domain;
+int code;
+char * message;
+}
+struct _GPtrArray {
+void * * pdata;
+uint len;
+}
+struct _GByteArray {
+char * data;
+uint len;
+}
+struct _GArray {
+char * data;
+uint len;
+}
+struct _GTimeVal {
+int tv_sec;
+int tv_usec;
+}
+struct N14_GFloatIEEE7543__1E {
+uint bitfield0;
+// uint mantissa // bits 0 .. 23
+// uint biased_exponent // bits 23 .. 31
+// uint sign // bits 31 .. 32
+}
+union _GFloatIEEE754 {
+float v_float;
+N14_GFloatIEEE7543__1E mpn;
+}
+struct N15_GDoubleIEEE7543__2E {
+uint bitfield0;
+// uint mantissa_low // bits 0 .. 32
+uint bitfield1;
+// uint mantissa_high // bits 32 .. 52
+// uint biased_exponent // bits 52 .. 63
+// uint sign // bits 63 .. 64
+}
+union _GDoubleIEEE754 {
+double v_double;
+N15_GDoubleIEEE7543__2E mpn;
+}
+version(DYNLINK){
+extern (C) void function(_GValue *, char *)g_value_set_string_take_ownership;
+extern (C) void function(_GValue *, char *)g_value_take_string;
+extern (C) char * function(_GValue *)g_strdup_value_contents;
+extern (C) uint function(char *)g_pointer_type_register_static;
+extern (C) uint function(_GValue *)g_value_get_gtype;
+extern (C) void function(_GValue *, uint)g_value_set_gtype;
+extern (C) uint function()g_gtype_get_type;
+extern (C) void * function(_GValue *)g_value_get_pointer;
+extern (C) void function(_GValue *, void *)g_value_set_pointer;
+extern (C) char * function(_GValue *)g_value_dup_string;
+extern (C) char * function(_GValue *)g_value_get_string;
+extern (C) void function(_GValue *, char *)g_value_set_static_string;
+extern (C) void function(_GValue *, char *)g_value_set_string;
+extern (C) double function(_GValue *)g_value_get_double;
+extern (C) void function(_GValue *, double)g_value_set_double;
+extern (C) float function(_GValue *)g_value_get_float;
+extern (C) void function(_GValue *, float)g_value_set_float;
+extern (C) ulong function(_GValue *)g_value_get_uint64;
+extern (C) void function(_GValue *, ulong)g_value_set_uint64;
+extern (C) long function(_GValue *)g_value_get_int64;
+extern (C) void function(_GValue *, long)g_value_set_int64;
+extern (C) uint function(_GValue *)g_value_get_ulong;
+extern (C) void function(_GValue *, uint)g_value_set_ulong;
+extern (C) int function(_GValue *)g_value_get_long;
+extern (C) void function(_GValue *, int)g_value_set_long;
+extern (C) uint function(_GValue *)g_value_get_uint;
+extern (C) void function(_GValue *, uint)g_value_set_uint;
+extern (C) int function(_GValue *)g_value_get_int;
+extern (C) void function(_GValue *, int)g_value_set_int;
+extern (C) int function(_GValue *)g_value_get_boolean;
+extern (C) void function(_GValue *, int)g_value_set_boolean;
+extern (C) char function(_GValue *)g_value_get_uchar;
+extern (C) void function(_GValue *, char)g_value_set_uchar;
+extern (C) char function(_GValue *)g_value_get_char;
+extern (C) void function(_GValue *, char)g_value_set_char;
+extern (C) _GValueArray * function(_GValueArray *, _BCD_func__2968, void *)g_value_array_sort_with_data;
+extern (C) _GValueArray * function(_GValueArray *, _BCD_func__2969)g_value_array_sort;
+extern (C) _GValueArray * function(_GValueArray *, uint)g_value_array_remove;
+extern (C) _GValueArray * function(_GValueArray *, uint, _GValue *)g_value_array_insert;
+extern (C) _GValueArray * function(_GValueArray *, _GValue *)g_value_array_append;
+extern (C) _GValueArray * function(_GValueArray *, _GValue *)g_value_array_prepend;
+extern (C) _GValueArray * function(_GValueArray *)g_value_array_copy;
+extern (C) void function(_GValueArray *)g_value_array_free;
+extern (C) _GValueArray * function(uint)g_value_array_new;
+extern (C) _GValue * function(_GValueArray *, uint)g_value_array_get_nth;
+extern (C) void function(void *, uint, uint, _GInterfaceInfo *)g_type_plugin_complete_interface_info;
+extern (C) void function(void *, uint, _GTypeInfo *, _GTypeValueTable *)g_type_plugin_complete_type_info;
+extern (C) void function(void *)g_type_plugin_unuse;
+extern (C) void function(void *)g_type_plugin_use;
+extern (C) uint function()g_type_plugin_get_type;
+extern (C) uint function(_GTypeModule *, char *, _GFlagsValue *)g_type_module_register_flags;
+extern (C) uint function(_GTypeModule *, char *, _GEnumValue *)g_type_module_register_enum;
+extern (C) void function(_GTypeModule *, uint, uint, _GInterfaceInfo *)g_type_module_add_interface;
+extern (C) uint function(_GTypeModule *, uint, char *, _GTypeInfo *, int)g_type_module_register_type;
+extern (C) void function(_GTypeModule *, char *)g_type_module_set_name;
+extern (C) void function(_GTypeModule *)g_type_module_unuse;
+extern (C) int function(_GTypeModule *)g_type_module_use;
+extern (C) uint function()g_type_module_get_type;
+extern (C) uint function()g_io_condition_get_type;
+extern (C) uint function()g_io_channel_get_type;
+extern (C) void function(_GSource *, _GClosure *)g_source_set_closure;
+extern (C) extern uint ** g_param_spec_types;
+extern (C) _GParamSpec * function(char *, char *, char *, uint, int)g_param_spec_gtype;
+extern (C) _GParamSpec * function(char *, _GParamSpec *)g_param_spec_override;
+extern (C) _GParamSpec * function(char *, char *, char *, uint, int)g_param_spec_object;
+extern (C) _GParamSpec * function(char *, char *, char *, _GParamSpec *, int)g_param_spec_value_array;
+extern (C) _GParamSpec * function(char *, char *, char *, int)g_param_spec_pointer;
+extern (C) _GParamSpec * function(char *, char *, char *, uint, int)g_param_spec_boxed;
+extern (C) _GParamSpec * function(char *, char *, char *, uint, int)g_param_spec_param;
+extern (C) _GParamSpec * function(char *, char *, char *, char *, int)g_param_spec_string;
+extern (C) _GParamSpec * function(char *, char *, char *, double, double, double, int)g_param_spec_double;
+extern (C) _GParamSpec * function(char *, char *, char *, float, float, float, int)g_param_spec_float;
+extern (C) _GParamSpec * function(char *, char *, char *, uint, uint, int)g_param_spec_flags;
+extern (C) _GParamSpec * function(char *, char *, char *, uint, int, int)g_param_spec_enum;
+extern (C) _GParamSpec * function(char *, char *, char *, uint, int)g_param_spec_unichar;
+extern (C) _GParamSpec * function(char *, char *, char *, ulong, ulong, ulong, int)g_param_spec_uint64;
+extern (C) _GParamSpec * function(char *, char *, char *, long, long, long, int)g_param_spec_int64;
+extern (C) _GParamSpec * function(char *, char *, char *, uint, uint, uint, int)g_param_spec_ulong;
+extern (C) _GParamSpec * function(char *, char *, char *, int, int, int, int)g_param_spec_long;
+extern (C) _GParamSpec * function(char *, char *, char *, uint, uint, uint, int)g_param_spec_uint;
+extern (C) _GParamSpec * function(char *, char *, char *, int, int, int, int)g_param_spec_int;
+extern (C) _GParamSpec * function(char *, char *, char *, int, int)g_param_spec_boolean;
+extern (C) _GParamSpec * function(char *, char *, char *, char, char, char, int)g_param_spec_uchar;
+extern (C) _GParamSpec * function(char *, char *, char *, char, char, char, int)g_param_spec_char;
+extern (C) uint function(uint, void *)g_object_compat_control;
+extern (C) void function(_GValue *, void *)g_value_set_object_take_ownership;
+extern (C) void function(_GValue *, void *)g_value_take_object;
+extern (C) void function(_GObject *)g_object_run_dispose;
+extern (C) void function(_GObject *)g_object_force_floating;
+extern (C) uint function(void *, char *, _BCD_func__2331, void *, int)g_signal_connect_object;
+extern (C) void * function(_GValue *)g_value_dup_object;
+extern (C) void * function(_GValue *)g_value_get_object;
+extern (C) void function(_GValue *, void *)g_value_set_object;
+extern (C) _GClosure * function(uint, _GObject *)g_closure_new_object;
+extern (C) _GClosure * function(_BCD_func__2331, _GObject *)g_cclosure_new_object_swap;
+extern (C) _GClosure * function(_BCD_func__2331, _GObject *)g_cclosure_new_object;
+extern (C) void function(_GObject *, _GClosure *)g_object_watch_closure;
+extern (C) void * function(_GObject *, char *)g_object_steal_data;
+extern (C) void function(_GObject *, char *, void *, _BCD_func__2417)g_object_set_data_full;
+extern (C) void function(_GObject *, char *, void *)g_object_set_data;
+extern (C) void * function(_GObject *, char *)g_object_get_data;
+extern (C) void * function(_GObject *, uint)g_object_steal_qdata;
+extern (C) void function(_GObject *, uint, void *, _BCD_func__2417)g_object_set_qdata_full;
+extern (C) void function(_GObject *, uint, void *)g_object_set_qdata;
+extern (C) void * function(_GObject *, uint)g_object_get_qdata;
+extern (C) void function(_GObject *, _BCD_func__2274, void *)g_object_remove_toggle_ref;
+extern (C) void function(_GObject *, _BCD_func__2274, void *)g_object_add_toggle_ref;
+extern (C) void function(_GObject *, void * *)g_object_remove_weak_pointer;
+extern (C) void function(_GObject *, void * *)g_object_add_weak_pointer;
+extern (C) void function(_GObject *, _BCD_func__2280, void *)g_object_weak_unref;
+extern (C) void function(_GObject *, _BCD_func__2280, void *)g_object_weak_ref;
+extern (C) void function(void *)g_object_unref;
+extern (C) void * function(void *)g_object_ref;
+extern (C) void * function(void *)g_object_ref_sink;
+extern (C) int function(void *)g_object_is_floating;
+extern (C) void function(_GObject *)g_object_thaw_notify;
+extern (C) void function(_GObject *, char *)g_object_notify;
+extern (C) void function(_GObject *)g_object_freeze_notify;
+extern (C) void function(_GObject *, char *, _GValue *)g_object_get_property;
+extern (C) void function(_GObject *, char *, _GValue *)g_object_set_property;
+extern (C) void function(_GObject *, char *, char *)g_object_get_valist;
+extern (C) void function(_GObject *, char *, char *)g_object_set_valist;
+extern (C) void function(void *, char *, ...)g_object_disconnect;
+extern (C) void * function(void *, char *, ...)g_object_connect;
+extern (C) void function(void *, char *, ...)g_object_get;
+extern (C) void function(void *, char *, ...)g_object_set;
+extern (C) _GObject * function(uint, char *, char *)g_object_new_valist;
+extern (C) void * function(uint, uint, _GParameter *)g_object_newv;
+extern (C) void * function(uint, char *, ...)g_object_new;
+extern (C) _GParamSpec * * function(void *, uint *)g_object_interface_list_properties;
+extern (C) _GParamSpec * function(void *, char *)g_object_interface_find_property;
+extern (C) void function(void *, _GParamSpec *)g_object_interface_install_property;
+extern (C) void function(_GObjectClass *, uint, char *)g_object_class_override_property;
+extern (C) _GParamSpec * * function(_GObjectClass *, uint *)g_object_class_list_properties;
+extern (C) _GParamSpec * function(_GObjectClass *, char *)g_object_class_find_property;
+extern (C) void function(_GObjectClass *, uint, _GParamSpec *)g_object_class_install_property;
+extern (C) uint function()g_initially_unowned_get_type;
+extern (C) void function(uint)_g_signals_destroy;
+extern (C) void function(void *)g_signal_handlers_destroy;
+extern (C) int function(_GSignalInvocationHint *, _GValue *, _GValue *, void *)g_signal_accumulator_true_handled;
+extern (C) void function(_GValue *, _GValue *)g_signal_chain_from_overridden;
+extern (C) void function(uint, uint, _GClosure *)g_signal_override_class_closure;
+extern (C) uint function(void *, int, uint, uint, _GClosure *, void *, void *)g_signal_handlers_disconnect_matched;
+extern (C) uint function(void *, int, uint, uint, _GClosure *, void *, void *)g_signal_handlers_unblock_matched;
+extern (C) uint function(void *, int, uint, uint, _GClosure *, void *, void *)g_signal_handlers_block_matched;
+extern (C) uint function(void *, int, uint, uint, _GClosure *, void *, void *)g_signal_handler_find;
+extern (C) int function(void *, uint)g_signal_handler_is_connected;
+extern (C) void function(void *, uint)g_signal_handler_disconnect;
+extern (C) void function(void *, uint)g_signal_handler_unblock;
+extern (C) void function(void *, uint)g_signal_handler_block;
+extern (C) uint function(void *, char *, _BCD_func__2331, void *, _BCD_func__2330, int)g_signal_connect_data;
+extern (C) uint function(void *, char *, _GClosure *, int)g_signal_connect_closure;
+extern (C) uint function(void *, uint, uint, _GClosure *, int)g_signal_connect_closure_by_id;
+extern (C) int function(void *, uint, uint, int)g_signal_has_handler_pending;
+extern (C) void function(uint, uint)g_signal_remove_emission_hook;
+extern (C) uint function(uint, uint, _BCD_func__2310, void *, _BCD_func__2417)g_signal_add_emission_hook;
+extern (C) void function(void *, char *)g_signal_stop_emission_by_name;
+extern (C) void function(void *, uint, uint)g_signal_stop_emission;
+extern (C) _GSignalInvocationHint * function(void *)g_signal_get_invocation_hint;
+extern (C) int function(char *, uint, uint *, uint *, int)g_signal_parse_name;
+extern (C) uint * function(uint, uint *)g_signal_list_ids;
+extern (C) void function(uint, _GSignalQuery *)g_signal_query;
+extern (C) char * function(uint)g_signal_name;
+extern (C) uint function(char *, uint)g_signal_lookup;
+extern (C) void function(void *, char *, ...)g_signal_emit_by_name;
+extern (C) void function(void *, uint, uint, ...)g_signal_emit;
+extern (C) void function(void *, uint, uint, char *)g_signal_emit_valist;
+extern (C) void function(_GValue *, uint, uint, _GValue *)g_signal_emitv;
+extern (C) uint function(char *, uint, int, uint, _BCD_func__2309, void *, _BCD_func__2311, uint, uint, ...)g_signal_new;
+extern (C) uint function(char *, uint, int, _GClosure *, _BCD_func__2309, void *, _BCD_func__2311, uint, uint, char *)g_signal_new_valist;
+extern (C) uint function(char *, uint, int, _GClosure *, _BCD_func__2309, void *, _BCD_func__2311, uint, uint, uint *)g_signal_newv;
+extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)g_cclosure_marshal_STRING__OBJECT_POINTER;
+extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)g_cclosure_marshal_BOOLEAN__FLAGS;
+extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)g_cclosure_marshal_VOID__UINT_POINTER;
+extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)g_cclosure_marshal_VOID__OBJECT;
+extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)g_cclosure_marshal_VOID__POINTER;
+extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)g_cclosure_marshal_VOID__BOXED;
+extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)g_cclosure_marshal_VOID__PARAM;
+extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)g_cclosure_marshal_VOID__STRING;
+extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)g_cclosure_marshal_VOID__DOUBLE;
+extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)g_cclosure_marshal_VOID__FLOAT;
+extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)g_cclosure_marshal_VOID__FLAGS;
+extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)g_cclosure_marshal_VOID__ENUM;
+extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)g_cclosure_marshal_VOID__ULONG;
+extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)g_cclosure_marshal_VOID__LONG;
+extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)g_cclosure_marshal_VOID__UINT;
+extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)g_cclosure_marshal_VOID__INT;
+extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)g_cclosure_marshal_VOID__UCHAR;
+extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)g_cclosure_marshal_VOID__CHAR;
+extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)g_cclosure_marshal_VOID__BOOLEAN;
+extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)g_cclosure_marshal_VOID__VOID;
+extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *)g_closure_invoke;
+extern (C) void function(_GClosure *)g_closure_invalidate;
+extern (C) void function(_GClosure *, void *, _BCD_func__2311)g_closure_set_meta_marshal;
+extern (C) void function(_GClosure *, _BCD_func__2311)g_closure_set_marshal;
+extern (C) void function(_GClosure *, void *, _BCD_func__2330, void *, _BCD_func__2330)g_closure_add_marshal_guards;
+extern (C) void function(_GClosure *, void *, _BCD_func__2330)g_closure_remove_invalidate_notifier;
+extern (C) void function(_GClosure *, void *, _BCD_func__2330)g_closure_add_invalidate_notifier;
+extern (C) void function(_GClosure *, void *, _BCD_func__2330)g_closure_remove_finalize_notifier;
+extern (C) void function(_GClosure *, void *, _BCD_func__2330)g_closure_add_finalize_notifier;
+extern (C) _GClosure * function(uint, void *)g_closure_new_simple;
+extern (C) void function(_GClosure *)g_closure_unref;
+extern (C) void function(_GClosure *)g_closure_sink;
+extern (C) _GClosure * function(_GClosure *)g_closure_ref;
+extern (C) _GClosure * function(uint, uint)g_signal_type_cclosure_new;
+extern (C) _GClosure * function(_BCD_func__2331, void *, _BCD_func__2330)g_cclosure_new_swap;
+extern (C) _GClosure * function(_BCD_func__2331, void *, _BCD_func__2330)g_cclosure_new;
+extern (C) _GParamSpec * * function(void *, uint, uint *)g_param_spec_pool_list;
+extern (C) _GList * function(void *, uint)g_param_spec_pool_list_owned;
+extern (C) _GParamSpec * function(void *, char *, uint, int)g_param_spec_pool_lookup;
+extern (C) void function(void *, _GParamSpec *)g_param_spec_pool_remove;
+extern (C) void function(void *, _GParamSpec *, uint)g_param_spec_pool_insert;
+extern (C) void * function(int)g_param_spec_pool_new;
+extern (C) void * function(uint, char *, char *, char *, int)g_param_spec_internal;
+extern (C) uint function(char *, _GParamSpecTypeInfo *, uint)_g_param_type_register_static_constant;
+extern (C) uint function(char *, _GParamSpecTypeInfo *)g_param_type_register_static;
+extern (C) void function(_GValue *, _GParamSpec *)g_value_set_param_take_ownership;
+extern (C) void function(_GValue *, _GParamSpec *)g_value_take_param;
+extern (C) _GParamSpec * function(_GValue *)g_value_dup_param;
+extern (C) _GParamSpec * function(_GValue *)g_value_get_param;
+extern (C) void function(_GValue *, _GParamSpec *)g_value_set_param;
+extern (C) char * function(_GParamSpec *)g_param_spec_get_blurb;
+extern (C) char * function(_GParamSpec *)g_param_spec_get_nick;
+extern (C) char * function(_GParamSpec *)g_param_spec_get_name;
+extern (C) int function(_GParamSpec *, _GValue *, _GValue *)g_param_values_cmp;
+extern (C) int function(_GParamSpec *, _GValue *, _GValue *, int)g_param_value_convert;
+extern (C) int function(_GParamSpec *, _GValue *)g_param_value_validate;
+extern (C) int function(_GParamSpec *, _GValue *)g_param_value_defaults;
+extern (C) void function(_GParamSpec *, _GValue *)g_param_value_set_default;
+extern (C) _GParamSpec * function(_GParamSpec *)g_param_spec_get_redirect_target;
+extern (C) void * function(_GParamSpec *, uint)g_param_spec_steal_qdata;
+extern (C) void function(_GParamSpec *, uint, void *, _BCD_func__2417)g_param_spec_set_qdata_full;
+extern (C) void function(_GParamSpec *, uint, void *)g_param_spec_set_qdata;
+extern (C) void * function(_GParamSpec *, uint)g_param_spec_get_qdata;
+extern (C) _GParamSpec * function(_GParamSpec *)g_param_spec_ref_sink;
+extern (C) void function(_GParamSpec *)g_param_spec_sink;
+extern (C) void function(_GParamSpec *)g_param_spec_unref;
+extern (C) _GParamSpec * function(_GParamSpec *)g_param_spec_ref;
+extern (C) void function(uint, uint, _BCD_func__2389)g_value_register_transform_func;
+extern (C) int function(_GValue *, _GValue *)g_value_transform;
+extern (C) int function(uint, uint)g_value_type_transformable;
+extern (C) int function(uint, uint)g_value_type_compatible;
+extern (C) void * function(_GValue *)g_value_peek_pointer;
+extern (C) int function(_GValue *)g_value_fits_pointer;
+extern (C) void function(_GValue *, void *)g_value_set_instance;
+extern (C) void function(_GValue *)g_value_unset;
+extern (C) _GValue * function(_GValue *)g_value_reset;
+extern (C) void function(_GValue *, _GValue *)g_value_copy;
+extern (C) _GValue * function(_GValue *, uint)g_value_init;
+extern (C) void function(uint, _GTypeInfo *, _GFlagsValue *)g_flags_complete_type_info;
+extern (C) void function(uint, _GTypeInfo *, _GEnumValue *)g_enum_complete_type_info;
+extern (C) uint function(char *, _GFlagsValue *)g_flags_register_static;
+extern (C) uint function(char *, _GEnumValue *)g_enum_register_static;
+extern (C) uint function(_GValue *)g_value_get_flags;
+extern (C) void function(_GValue *, uint)g_value_set_flags;
+extern (C) int function(_GValue *)g_value_get_enum;
+extern (C) void function(_GValue *, int)g_value_set_enum;
+extern (C) _GFlagsValue * function(_GFlagsClass *, char *)g_flags_get_value_by_nick;
+extern (C) _GFlagsValue * function(_GFlagsClass *, char *)g_flags_get_value_by_name;
+extern (C) _GFlagsValue * function(_GFlagsClass *, uint)g_flags_get_first_value;
+extern (C) _GEnumValue * function(_GEnumClass *, char *)g_enum_get_value_by_nick;
+extern (C) _GEnumValue * function(_GEnumClass *, char *)g_enum_get_value_by_name;
+extern (C) _GEnumValue * function(_GEnumClass *, int)g_enum_get_value;
+extern (C) uint function()g_regex_get_type;
+extern (C) uint function()g_hash_table_get_type;
+extern (C) uint function()g_gstring_get_type;
+extern (C) uint function()g_strv_get_type;
+extern (C) uint function()g_date_get_type;
+extern (C) uint function()g_value_array_get_type;
+extern (C) uint function()g_value_get_type;
+extern (C) uint function()g_closure_get_type;
+extern (C) void function(_GValue *, void *)g_value_set_boxed_take_ownership;
+extern (C) void function(_GValue *, void *)g_value_take_boxed;
+extern (C) uint function(char *, _BCD_func__2418, _BCD_func__2417)g_boxed_type_register_static;
+extern (C) void * function(_GValue *)g_value_dup_boxed;
+extern (C) void * function(_GValue *)g_value_get_boxed;
+extern (C) void function(_GValue *, void *)g_value_set_static_boxed;
+extern (C) void function(_GValue *, void *)g_value_set_boxed;
+extern (C) void function(uint, void *)g_boxed_free;
+extern (C) void * function(uint, void *)g_boxed_copy;
+extern (C) extern int* _g_type_debug_flags;
+extern (C) void function()g_signal_init;
+extern (C) void function()g_value_transforms_init;
+extern (C) void function()g_param_spec_types_init;
+extern (C) void function()g_object_type_init;
+extern (C) void function()g_boxed_type_init;
+extern (C) void function()g_param_type_init;
+extern (C) void function()g_enum_types_init;
+extern (C) void function()g_value_types_init;
+extern (C) void function()g_value_c_init;
+extern (C) char * function(_GTypeClass *)g_type_name_from_class;
+extern (C) char * function(_GTypeInstance *)g_type_name_from_instance;
+extern (C) int function(uint, uint)g_type_test_flags;
+extern (C) int function(_GValue *, uint)g_type_check_value_holds;
+extern (C) int function(_GValue *)g_type_check_value;
+extern (C) int function(uint)g_type_check_is_value_type;
+extern (C) int function(_GTypeClass *, uint)g_type_check_class_is_a;
+extern (C) _GTypeClass * function(_GTypeClass *, uint)g_type_check_class_cast;
+extern (C) int function(_GTypeInstance *, uint)g_type_check_instance_is_a;
+extern (C) _GTypeInstance * function(_GTypeInstance *, uint)g_type_check_instance_cast;
+extern (C) int function(_GTypeInstance *)g_type_check_instance;
+extern (C) _GTypeValueTable * function(uint)g_type_value_table_peek;
+extern (C) void function(void *, _BCD_func__2422)g_type_remove_interface_check;
+extern (C) void function(void *, _BCD_func__2422)g_type_add_interface_check;
+extern (C) void function(void *)g_type_class_unref_uncached;
+extern (C) void function(void *, _BCD_func__2423)g_type_remove_class_cache_func;
+extern (C) void function(void *, _BCD_func__2423)g_type_add_class_cache_func;
+extern (C) void function(_GTypeInstance *)g_type_free_instance;
+extern (C) _GTypeInstance * function(uint)g_type_create_instance;
+extern (C) uint function(uint)g_type_fundamental;
+extern (C) uint function()g_type_fundamental_next;
+extern (C) void * function(uint, uint)g_type_interface_get_plugin;
+extern (C) void * function(uint)g_type_get_plugin;
+extern (C) void * function(_GTypeInstance *, uint)g_type_instance_get_private;
+extern (C) void function(void *, uint)g_type_class_add_private;
+extern (C) uint * function(uint, uint *)g_type_interface_prerequisites;
+extern (C) void function(uint, uint)g_type_interface_add_prerequisite;
+extern (C) void function(uint, uint, void *)g_type_add_interface_dynamic;
+extern (C) void function(uint, uint, _GInterfaceInfo *)g_type_add_interface_static;
+extern (C) uint function(uint, char *, _GTypeInfo *, _GTypeFundamentalInfo *, int)g_type_register_fundamental;
+extern (C) uint function(uint, char *, void *, int)g_type_register_dynamic;
+extern (C) uint function(uint, char *, uint, _BCD_func__2422, uint, _BCD_func__2424, int)g_type_register_static_simple;
+extern (C) uint function(uint, char *, _GTypeInfo *, int)g_type_register_static;
+extern (C) void function(uint, _GTypeQuery *)g_type_query;
+extern (C) void * function(uint, uint)g_type_get_qdata;
+extern (C) void function(uint, uint, void *)g_type_set_qdata;
+extern (C) uint * function(uint, uint *)g_type_interfaces;
+extern (C) uint * function(uint, uint *)g_type_children;
+extern (C) void function(void *)g_type_default_interface_unref;
+extern (C) void * function(uint)g_type_default_interface_peek;
+extern (C) void * function(uint)g_type_default_interface_ref;
+extern (C) void * function(void *)g_type_interface_peek_parent;
+extern (C) void * function(void *, uint)g_type_interface_peek;
+extern (C) void * function(void *)g_type_class_peek_parent;
+extern (C) void function(void *)g_type_class_unref;
+extern (C) void * function(uint)g_type_class_peek_static;
+extern (C) void * function(uint)g_type_class_peek;
+extern (C) void * function(uint)g_type_class_ref;
+extern (C) int function(uint, uint)g_type_is_a;
+extern (C) uint function(uint, uint)g_type_next_base;
+extern (C) uint function(uint)g_type_depth;
+extern (C) uint function(uint)g_type_parent;
+extern (C) uint function(char *)g_type_from_name;
+extern (C) uint function(uint)g_type_qname;
+extern (C) char * function(uint)g_type_name;
+extern (C) void function(int)g_type_init_with_debug_flags;
+extern (C) void function()g_type_init;
+extern (C) int function(void *)g_tree_nnodes;
+extern (C) int function(void *)g_tree_height;
+extern (C) void * function(void *, _BCD_func__2969, void *)g_tree_search;
+extern (C) void function(void *, _BCD_func__2478, int, void *)g_tree_traverse;
+extern (C) void function(void *, _BCD_func__2478, void *)g_tree_foreach;
+extern (C) int function(void *, void *, void * *, void * *)g_tree_lookup_extended;
+extern (C) void * function(void *, void *)g_tree_lookup;
+extern (C) int function(void *, void *)g_tree_steal;
+extern (C) int function(void *, void *)g_tree_remove;
+extern (C) void function(void *, void *, void *)g_tree_replace;
+extern (C) void function(void *, void *, void *)g_tree_insert;
+extern (C) void function(void *)g_tree_destroy;
+extern (C) void * function(_BCD_func__2968, void *, _BCD_func__2417, _BCD_func__2417)g_tree_new_full;
+extern (C) void * function(_BCD_func__2968, void *)g_tree_new_with_data;
+extern (C) void * function(_BCD_func__2969)g_tree_new;
+extern (C) char * function(_GTimeVal *)g_time_val_to_iso8601;
+extern (C) int function(char *, _GTimeVal *)g_time_val_from_iso8601;
+extern (C) void function(_GTimeVal *, int)g_time_val_add;
+extern (C) void function(uint)g_usleep;
+extern (C) double function(void *, uint *)g_timer_elapsed;
+extern (C) void function(void *)g_timer_continue;
+extern (C) void function(void *)g_timer_reset;
+extern (C) void function(void *)g_timer_stop;
+extern (C) void function(void *)g_timer_start;
+extern (C) void function(void *)g_timer_destroy;
+extern (C) void * function()g_timer_new;
+extern (C) uint function()g_thread_pool_get_max_idle_time;
+extern (C) void function(uint)g_thread_pool_set_max_idle_time;
+extern (C) void function(_GThreadPool *, _BCD_func__2968, void *)g_thread_pool_set_sort_function;
+extern (C) void function()g_thread_pool_stop_unused_threads;
+extern (C) uint function()g_thread_pool_get_num_unused_threads;
+extern (C) int function()g_thread_pool_get_max_unused_threads;
+extern (C) void function(int)g_thread_pool_set_max_unused_threads;
+extern (C) void function(_GThreadPool *, int, int)g_thread_pool_free;
+extern (C) uint function(_GThreadPool *)g_thread_pool_unprocessed;
+extern (C) uint function(_GThreadPool *)g_thread_pool_get_num_threads;
+extern (C) int function(_GThreadPool *)g_thread_pool_get_max_threads;
+extern (C) void function(_GThreadPool *, int, _GError * *)g_thread_pool_set_max_threads;
+extern (C) void function(_GThreadPool *, void *, _GError * *)g_thread_pool_push;
+extern (C) _GThreadPool * function(_BCD_func__2422, void *, int, int, _GError * *)g_thread_pool_new;
+extern (C) char * function(char *, char *)g_strip_context;
+extern (C) char * function(char *, char *)g_stpcpy;
+extern (C) uint function(char * *)g_strv_length;
+extern (C) char * * function(char * *)g_strdupv;
+extern (C) void function(char * *)g_strfreev;
+extern (C) char * function(char *, char * *)g_strjoinv;
+extern (C) char * * function(char *, char *, int)g_strsplit_set;
+extern (C) char * * function(char *, char *, int)g_strsplit;
+extern (C) void * function(void *, uint)g_memdup;
+extern (C) char * function(char *, char *)g_strescape;
+extern (C) char * function(char *)g_strcompress;
+extern (C) char * function(char *, ...)g_strjoin;
+extern (C) char * function(char *, ...)g_strconcat;
+extern (C) char * function(uint, char)g_strnfill;
+extern (C) char * function(char *, uint)g_strndup;
+extern (C) char * function(char *, char *)g_strdup_vprintf;
+extern (C) char * function(char *, ...)g_strdup_printf;
+extern (C) char * function(char *)g_strdup;
+extern (C) char * function(char *)g_strup;
+extern (C) char * function(char *)g_strdown;
+extern (C) int function(char *, char *, uint)g_strncasecmp;
+extern (C) int function(char *, char *)g_strcasecmp;
+extern (C) char * function(char *, int)g_ascii_strup;
+extern (C) char * function(char *, int)g_ascii_strdown;
+extern (C) int function(char *, char *, uint)g_ascii_strncasecmp;
+extern (C) int function(char *, char *)g_ascii_strcasecmp;
+extern (C) char * function(char *)g_strchomp;
+extern (C) char * function(char *)g_strchug;
+extern (C) char * function(char *, int, char *, double)g_ascii_formatd;
+extern (C) char * function(char *, int, double)g_ascii_dtostr;
+extern (C) long function(char *, char * *, uint)g_ascii_strtoll;
+extern (C) ulong function(char *, char * *, uint)g_ascii_strtoull;
+extern (C) double function(char *, char * *)g_ascii_strtod;
+extern (C) double function(char *, char * *)g_strtod;
+extern (C) int function(char *, char *)g_str_has_prefix;
+extern (C) int function(char *, char *)g_str_has_suffix;
+extern (C) char * function(char *, int, char *)g_strrstr_len;
+extern (C) char * function(char *, char *)g_strrstr;
+extern (C) char * function(char *, int, char *)g_strstr_len;
+extern (C) uint function(char *, char *, uint)g_strlcat;
+extern (C) uint function(char *, char *, uint)g_strlcpy;
+extern (C) char * function(char *)g_strreverse;
+extern (C) char * function(int)g_strsignal;
+extern (C) char * function(int)g_strerror;
+extern (C) char * function(char *, char *, char)g_strcanon;
+extern (C) char * function(char *, char *, char)g_strdelimit;
+extern (C) int function(char)g_ascii_xdigit_value;
+extern (C) int function(char)g_ascii_digit_value;
+extern (C) char function(char)g_ascii_toupper;
+extern (C) char function(char)g_ascii_tolower;
+extern (C) extern ushort ** g_ascii_table;
+extern (C) void function(int)g_spawn_close_pid;
+extern (C) int function(char *, _GError * *)g_spawn_command_line_async;
+extern (C) int function(char *, char * *, char * *, int *, _GError * *)g_spawn_command_line_sync;
+extern (C) int function(char *, char * *, char * *, int, _BCD_func__2417, void *, char * *, char * *, int *, _GError * *)g_spawn_sync;
+extern (C) int function(char *, char * *, char * *, int, _BCD_func__2417, void *, int *, int *, int *, int *, _GError * *)g_spawn_async_with_pipes;
+extern (C) int function(char *, char * *, char * *, int, _BCD_func__2417, void *, int *, _GError * *)g_spawn_async;
+extern (C) uint function()g_spawn_error_quark;
+extern (C) int function(char *, int *, char * * *, _GError * *)g_shell_parse_argv;
+extern (C) char * function(char *, _GError * *)g_shell_unquote;
+extern (C) char * function(char *)g_shell_quote;
+extern (C) uint function()g_shell_error_quark;
+extern (C) void * function(void *, void *)g_sequence_range_get_midpoint;
+extern (C) int function(void *, void *)g_sequence_iter_compare;
+extern (C) void * function(void *)g_sequence_iter_get_sequence;
+extern (C) void * function(void *, int)g_sequence_iter_move;
+extern (C) int function(void *)g_sequence_iter_get_position;
+extern (C) void * function(void *)g_sequence_iter_prev;
+extern (C) void * function(void *)g_sequence_iter_next;
+extern (C) int function(void *)g_sequence_iter_is_end;
+extern (C) int function(void *)g_sequence_iter_is_begin;
+extern (C) void function(void *, void *)g_sequence_set;
+extern (C) void * function(void *)g_sequence_get;
+extern (C) void * function(void *, void *, _BCD_func__2497, void *)g_sequence_search_iter;
+extern (C) void * function(void *, void *, _BCD_func__2968, void *)g_sequence_search;
+extern (C) void function(void *, void *, void *)g_sequence_move_range;
+extern (C) void function(void *, void *)g_sequence_remove_range;
+extern (C) void function(void *)g_sequence_remove;
+extern (C) void function(void *, _BCD_func__2497, void *)g_sequence_sort_changed_iter;
+extern (C) void function(void *, _BCD_func__2968, void *)g_sequence_sort_changed;
+extern (C) void * function(void *, void *, _BCD_func__2497, void *)g_sequence_insert_sorted_iter;
+extern (C) void * function(void *, void *, _BCD_func__2968, void *)g_sequence_insert_sorted;
+extern (C) void function(void *, void *)g_sequence_swap;
+extern (C) void function(void *, void *)g_sequence_move;
+extern (C) void * function(void *, void *)g_sequence_insert_before;
+extern (C) void * function(void *, void *)g_sequence_prepend;
+extern (C) void * function(void *, void *)g_sequence_append;
+extern (C) void * function(void *, int)g_sequence_get_iter_at_pos;
+extern (C) void * function(void *)g_sequence_get_end_iter;
+extern (C) void * function(void *)g_sequence_get_begin_iter;
+extern (C) void function(void *, _BCD_func__2497, void *)g_sequence_sort_iter;
+extern (C) void function(void *, _BCD_func__2968, void *)g_sequence_sort;
+extern (C) void function(void *, void *, _BCD_func__2422, void *)g_sequence_foreach_range;
+extern (C) void function(void *, _BCD_func__2422, void *)g_sequence_foreach;
+extern (C) int function(void *)g_sequence_get_length;
+extern (C) void function(void *)g_sequence_free;
+extern (C) void * function(_BCD_func__2417)g_sequence_new;
+extern (C) void function(_GScanner *, char *, ...)g_scanner_warn;
+extern (C) void function(_GScanner *, char *, ...)g_scanner_error;
+extern (C) void function(_GScanner *, int, char *, char *, char *, char *, int)g_scanner_unexp_token;
+extern (C) void * function(_GScanner *, char *)g_scanner_lookup_symbol;
+extern (C) void function(_GScanner *, uint, _BCD_func__2965, void *)g_scanner_scope_foreach_symbol;
+extern (C) void * function(_GScanner *, uint, char *)g_scanner_scope_lookup_symbol;
+extern (C) void function(_GScanner *, uint, char *)g_scanner_scope_remove_symbol;
+extern (C) void function(_GScanner *, uint, char *, void *)g_scanner_scope_add_symbol;
+extern (C) uint function(_GScanner *, uint)g_scanner_set_scope;
+extern (C) int function(_GScanner *)g_scanner_eof;
+extern (C) uint function(_GScanner *)g_scanner_cur_position;
+extern (C) uint function(_GScanner *)g_scanner_cur_line;
+extern (C) _GTokenValue function(_GScanner *)g_scanner_cur_value;
+extern (C) int function(_GScanner *)g_scanner_cur_token;
+extern (C) int function(_GScanner *)g_scanner_peek_next_token;
+extern (C) int function(_GScanner *)g_scanner_get_next_token;
+extern (C) void function(_GScanner *, char *, uint)g_scanner_input_text;
+extern (C) void function(_GScanner *)g_scanner_sync_file_offset;
+extern (C) void function(_GScanner *, int)g_scanner_input_file;
+extern (C) void function(_GScanner *)g_scanner_destroy;
+extern (C) _GScanner * function(_GScannerConfig *)g_scanner_new;
+extern (C) char * * function(void *)g_match_info_fetch_all;
+extern (C) int function(void *, char *, int *, int *)g_match_info_fetch_named_pos;
+extern (C) char * function(void *, char *)g_match_info_fetch_named;
+extern (C) int function(void *, int, int *, int *)g_match_info_fetch_pos;
+extern (C) char * function(void *, int)g_match_info_fetch;
+extern (C) char * function(void *, char *, _GError * *)g_match_info_expand_references;
+extern (C) int function(void *)g_match_info_is_partial_match;
+extern (C) int function(void *)g_match_info_get_match_count;
+extern (C) int function(void *)g_match_info_matches;
+extern (C) int function(void *, _GError * *)g_match_info_next;
+extern (C) void function(void *)g_match_info_free;
+extern (C) char * function(void *)g_match_info_get_string;
+extern (C) void * function(void *)g_match_info_get_regex;
+extern (C) int function(char *, int *, _GError * *)g_regex_check_replacement;
+extern (C) char * function(void *, char *, int, int, int, _BCD_func__2573, void *, _GError * *)g_regex_replace_eval;
+extern (C) char * function(void *, char *, int, int, char *, int, _GError * *)g_regex_replace_literal;
+extern (C) char * function(void *, char *, int, int, char *, int, _GError * *)g_regex_replace;
+extern (C) char * * function(void *, char *, int, int, int, int, _GError * *)g_regex_split_full;
+extern (C) char * * function(void *, char *, int)g_regex_split;
+extern (C) char * * function(char *, char *, int, int)g_regex_split_simple;
+extern (C) int function(void *, char *, int, int, int, void * *, _GError * *)g_regex_match_all_full;
+extern (C) int function(void *, char *, int, void * *)g_regex_match_all;
+extern (C) int function(void *, char *, int, int, int, void * *, _GError * *)g_regex_match_full;
+extern (C) int function(void *, char *, int, void * *)g_regex_match;
+extern (C) int function(char *, char *, int, int)g_regex_match_simple;
+extern (C) char * function(char *, int)g_regex_escape_string;
+extern (C) int function(void *, char *)g_regex_get_string_number;
+extern (C) int function(void *)g_regex_get_capture_count;
+extern (C) int function(void *)g_regex_get_max_backref;
+extern (C) char * function(void *)g_regex_get_pattern;
+extern (C) void function(void *)g_regex_unref;
+extern (C) void * function(void *)g_regex_ref;
+extern (C) void * function(char *, int, int, _GError * *)g_regex_new;
+extern (C) uint function()g_regex_error_quark;
+extern (C) void * function(_GTuples *, int, int)g_tuples_index;
+extern (C) void function(_GTuples *)g_tuples_destroy;
+extern (C) void function(void *)g_relation_print;
+extern (C) int function(void *, ...)g_relation_exists;
+extern (C) int function(void *, void *, int)g_relation_count;
+extern (C) _GTuples * function(void *, void *, int)g_relation_select;
+extern (C) int function(void *, void *, int)g_relation_delete;
+extern (C) void function(void *, ...)g_relation_insert;
+extern (C) void function(void *, int, _BCD_func__2966, _BCD_func__2967)g_relation_index;
+extern (C) void function(void *)g_relation_destroy;
+extern (C) void * function(int)g_relation_new;
+extern (C) double function(double, double)g_random_double_range;
+extern (C) double function()g_random_double;
+extern (C) int function(int, int)g_random_int_range;
+extern (C) uint function()g_random_int;
+extern (C) void function(uint)g_random_set_seed;
+extern (C) double function(void *, double, double)g_rand_double_range;
+extern (C) double function(void *)g_rand_double;
+extern (C) int function(void *, int, int)g_rand_int_range;
+extern (C) uint function(void *)g_rand_int;
+extern (C) void function(void *, uint *, uint)g_rand_set_seed_array;
+extern (C) void function(void *, uint)g_rand_set_seed;
+extern (C) void * function(void *)g_rand_copy;
+extern (C) void function(void *)g_rand_free;
+extern (C) void * function()g_rand_new;
+extern (C) void * function(uint *, uint)g_rand_new_with_seed_array;
+extern (C) void * function(uint)g_rand_new_with_seed;
+extern (C) void function(_GQueue *, _GList *)g_queue_delete_link;
+extern (C) void function(_GQueue *, _GList *)g_queue_unlink;
+extern (C) int function(_GQueue *, _GList *)g_queue_link_index;
+extern (C) _GList * function(_GQueue *, uint)g_queue_peek_nth_link;
+extern (C) _GList * function(_GQueue *)g_queue_peek_tail_link;
+extern (C) _GList * function(_GQueue *)g_queue_peek_head_link;
+extern (C) _GList * function(_GQueue *, uint)g_queue_pop_nth_link;
+extern (C) _GList * function(_GQueue *)g_queue_pop_tail_link;
+extern (C) _GList * function(_GQueue *)g_queue_pop_head_link;
+extern (C) void function(_GQueue *, int, _GList *)g_queue_push_nth_link;
+extern (C) void function(_GQueue *, _GList *)g_queue_push_tail_link;
+extern (C) void function(_GQueue *, _GList *)g_queue_push_head_link;
+extern (C) void function(_GQueue *, void *, _BCD_func__2968, void *)g_queue_insert_sorted;
+extern (C) void function(_GQueue *, _GList *, void *)g_queue_insert_after;
+extern (C) void function(_GQueue *, _GList *, void *)g_queue_insert_before;
+extern (C) void function(_GQueue *, void *)g_queue_remove_all;
+extern (C) void function(_GQueue *, void *)g_queue_remove;
+extern (C) int function(_GQueue *, void *)g_queue_index;
+extern (C) void * function(_GQueue *, uint)g_queue_peek_nth;
+extern (C) void * function(_GQueue *)g_queue_peek_tail;
+extern (C) void * function(_GQueue *)g_queue_peek_head;
+extern (C) void * function(_GQueue *, uint)g_queue_pop_nth;
+extern (C) void * function(_GQueue *)g_queue_pop_tail;
+extern (C) void * function(_GQueue *)g_queue_pop_head;
+extern (C) void function(_GQueue *, void *, int)g_queue_push_nth;
+extern (C) void function(_GQueue *, void *)g_queue_push_tail;
+extern (C) void function(_GQueue *, void *)g_queue_push_head;
+extern (C) void function(_GQueue *, _BCD_func__2968, void *)g_queue_sort;
+extern (C) _GList * function(_GQueue *, void *, _BCD_func__2969)g_queue_find_custom;
+extern (C) _GList * function(_GQueue *, void *)g_queue_find;
+extern (C) void function(_GQueue *, _BCD_func__2422, void *)g_queue_foreach;
+extern (C) _GQueue * function(_GQueue *)g_queue_copy;
+extern (C) void function(_GQueue *)g_queue_reverse;
+extern (C) uint function(_GQueue *)g_queue_get_length;
+extern (C) int function(_GQueue *)g_queue_is_empty;
+extern (C) void function(_GQueue *)g_queue_clear;
+extern (C) void function(_GQueue *)g_queue_init;
+extern (C) void function(_GQueue *)g_queue_free;
+extern (C) _GQueue * function()g_queue_new;
+extern (C) void function(void *, int, uint, _BCD_func__2968, void *)g_qsort_with_data;
+extern (C) uint function(uint)g_spaced_primes_closest;
+extern (C) int function(char *, char *)g_pattern_match_simple;
+extern (C) int function(void *, char *)g_pattern_match_string;
+extern (C) int function(void *, uint, char *, char *)g_pattern_match;
+extern (C) int function(void *, void *)g_pattern_spec_equal;
+extern (C) void function(void *)g_pattern_spec_free;
+extern (C) void * function(char *)g_pattern_spec_new;
+extern (C) void function(void *, char *)g_option_group_set_translation_domain;
+extern (C) void function(void *, _BCD_func__2964, void *, _BCD_func__2417)g_option_group_set_translate_func;
+extern (C) void function(void *, _GOptionEntry *)g_option_group_add_entries;
+extern (C) void function(void *)g_option_group_free;
+extern (C) void function(void *, _BCD_func__2591)g_option_group_set_error_hook;
+extern (C) void function(void *, _BCD_func__2592, _BCD_func__2592)g_option_group_set_parse_hooks;
+extern (C) void * function(char *, char *, char *, void *, _BCD_func__2417)g_option_group_new;
+extern (C) char * function(void *, int, void *)g_option_context_get_help;
+extern (C) void * function(void *)g_option_context_get_main_group;
+extern (C) void function(void *, void *)g_option_context_set_main_group;
+extern (C) void function(void *, void *)g_option_context_add_group;
+extern (C) void function(void *, char *)g_option_context_set_translation_domain;
+extern (C) void function(void *, _BCD_func__2964, void *, _BCD_func__2417)g_option_context_set_translate_func;
+extern (C) int function(void *, int *, char * * *, _GError * *)g_option_context_parse;
+extern (C) void function(void *, _GOptionEntry *, char *)g_option_context_add_main_entries;
+extern (C) int function(void *)g_option_context_get_ignore_unknown_options;
+extern (C) void function(void *, int)g_option_context_set_ignore_unknown_options;
+extern (C) int function(void *)g_option_context_get_help_enabled;
+extern (C) void function(void *, int)g_option_context_set_help_enabled;
+extern (C) void function(void *)g_option_context_free;
+extern (C) char * function(void *)g_option_context_get_description;
+extern (C) void function(void *, char *)g_option_context_set_description;
+extern (C) char * function(void *)g_option_context_get_summary;
+extern (C) void function(void *, char *)g_option_context_set_summary;
+extern (C) void * function(char *)g_option_context_new;
+extern (C) uint function()g_option_error_quark;
+extern (C) void function()g_node_pop_allocator;
+extern (C) void function(void *)g_node_push_allocator;
+extern (C) _GNode * function(_GNode *)g_node_last_sibling;
+extern (C) _GNode * function(_GNode *)g_node_first_sibling;
+extern (C) int function(_GNode *, void *)g_node_child_index;
+extern (C) int function(_GNode *, _GNode *)g_node_child_position;
+extern (C) _GNode * function(_GNode *, int, void *)g_node_find_child;
+extern (C) _GNode * function(_GNode *)g_node_last_child;
+extern (C) _GNode * function(_GNode *, uint)g_node_nth_child;
+extern (C) uint function(_GNode *)g_node_n_children;
+extern (C) void function(_GNode *)g_node_reverse_children;
+extern (C) void function(_GNode *, int, _BCD_func__2605, void *)g_node_children_foreach;
+extern (C) uint function(_GNode *)g_node_max_height;
+extern (C) void function(_GNode *, int, int, int, _BCD_func__2606, void *)g_node_traverse;
+extern (C) _GNode * function(_GNode *, int, int, void *)g_node_find;
+extern (C) uint function(_GNode *)g_node_depth;
+extern (C) int function(_GNode *, _GNode *)g_node_is_ancestor;
+extern (C) _GNode * function(_GNode *)g_node_get_root;
+extern (C) uint function(_GNode *, int)g_node_n_nodes;
+extern (C) _GNode * function(_GNode *, _GNode *)g_node_prepend;
+extern (C) _GNode * function(_GNode *, _GNode *, _GNode *)g_node_insert_after;
+extern (C) _GNode * function(_GNode *, _GNode *, _GNode *)g_node_insert_before;
+extern (C) _GNode * function(_GNode *, int, _GNode *)g_node_insert;
+extern (C) _GNode * function(_GNode *)g_node_copy;
+extern (C) _GNode * function(_GNode *, _BCD_func__2604, void *)g_node_copy_deep;
+extern (C) void function(_GNode *)g_node_unlink;
+extern (C) void function(_GNode *)g_node_destroy;
+extern (C) _GNode * function(void *)g_node_new;
+extern (C) _BCD_func__2614 function(_BCD_func__2614)g_set_printerr_handler;
+extern (C) void function(char *, ...)g_printerr;
+extern (C) _BCD_func__2614 function(_BCD_func__2614)g_set_print_handler;
+extern (C) void function(char *, ...)g_print;
+extern (C) void function(char *, char *, int, char *, char *)g_assert_warning;
+extern (C) void function(char *, char *, char *)g_return_if_fail_warning;
+extern (C) void function(char *, int, char *, void *)_g_log_fallback_handler;
+extern (C) int function(int)g_log_set_always_fatal;
+extern (C) int function(char *, int)g_log_set_fatal_mask;
+extern (C) void function(char *, int, char *, char *)g_logv;
+extern (C) void function(char *, int, char *, ...)g_log;
+extern (C) _BCD_func__2616 function(_BCD_func__2616, void *)g_log_set_default_handler;
+extern (C) void function(char *, int, char *, void *)g_log_default_handler;
+extern (C) void function(char *, uint)g_log_remove_handler;
+extern (C) uint function(char *, int, _BCD_func__2616, void *)g_log_set_handler;
+extern (C) uint function(char *, char *)g_printf_string_upper_bound;
+extern (C) char * function(char *, char *)g_markup_vprintf_escaped;
+extern (C) char * function(char *, ...)g_markup_printf_escaped;
+extern (C) char * function(char *, int)g_markup_escape_text;
+extern (C) void function(void *, int *, int *)g_markup_parse_context_get_position;
+extern (C) char * function(void *)g_markup_parse_context_get_element;
+extern (C) int function(void *, _GError * *)g_markup_parse_context_end_parse;
+extern (C) int function(void *, char *, int, _GError * *)g_markup_parse_context_parse;
+extern (C) void function(void *)g_markup_parse_context_free;
+extern (C) void * function(_GMarkupParser *, int, void *, _BCD_func__2417)g_markup_parse_context_new;
+extern (C) uint function()g_markup_error_quark;
+extern (C) void function(void *)g_mapped_file_free;
+extern (C) char * function(void *)g_mapped_file_get_contents;
+extern (C) uint function(void *)g_mapped_file_get_length;
+extern (C) void * function(char *, int, _GError * *)g_mapped_file_new;
+extern (C) void function(void *, char *, _GError * *)g_key_file_remove_group;
+extern (C) void function(void *, char *, char *, _GError * *)g_key_file_remove_key;
+extern (C) void function(void *, char *, char *, _GError * *)g_key_file_remove_comment;
+extern (C) char * function(void *, char *, char *, _GError * *)g_key_file_get_comment;
+extern (C) void function(void *, char *, char *, char *, _GError * *)g_key_file_set_comment;
+extern (C) void function(void *, char *, char *, int *, uint)g_key_file_set_integer_list;
+extern (C) double * function(void *, char *, char *, uint *, _GError * *)g_key_file_get_double_list;
+extern (C) void function(void *, char *, char *, double *, uint)g_key_file_set_double_list;
+extern (C) int * function(void *, char *, char *, uint *, _GError * *)g_key_file_get_integer_list;
+extern (C) void function(void *, char *, char *, int *, uint)g_key_file_set_boolean_list;
+extern (C) int * function(void *, char *, char *, uint *, _GError * *)g_key_file_get_boolean_list;
+extern (C) void function(void *, char *, char *, char *, char * *, uint)g_key_file_set_locale_string_list;
+extern (C) char * * function(void *, char *, char *, char *, uint *, _GError * *)g_key_file_get_locale_string_list;
+extern (C) void function(void *, char *, char *, char * *, uint)g_key_file_set_string_list;
+extern (C) char * * function(void *, char *, char *, uint *, _GError * *)g_key_file_get_string_list;
+extern (C) void function(void *, char *, char *, double)g_key_file_set_double;
+extern (C) double function(void *, char *, char *, _GError * *)g_key_file_get_double;
+extern (C) void function(void *, char *, char *, int)g_key_file_set_integer;
+extern (C) int function(void *, char *, char *, _GError * *)g_key_file_get_integer;
+extern (C) void function(void *, char *, char *, int)g_key_file_set_boolean;
+extern (C) int function(void *, char *, char *, _GError * *)g_key_file_get_boolean;
+extern (C) void function(void *, char *, char *, char *, char *)g_key_file_set_locale_string;
+extern (C) char * function(void *, char *, char *, char *, _GError * *)g_key_file_get_locale_string;
+extern (C) void function(void *, char *, char *, char *)g_key_file_set_string;
+extern (C) char * function(void *, char *, char *, _GError * *)g_key_file_get_string;
+extern (C) void function(void *, char *, char *, char *)g_key_file_set_value;
+extern (C) char * function(void *, char *, char *, _GError * *)g_key_file_get_value;
+extern (C) int function(void *, char *, char *, _GError * *)g_key_file_has_key;
+extern (C) int function(void *, char *)g_key_file_has_group;
+extern (C) char * * function(void *, char *, uint *, _GError * *)g_key_file_get_keys;
+extern (C) char * * function(void *, uint *)g_key_file_get_groups;
+extern (C) char * function(void *)g_key_file_get_start_group;
+extern (C) char * function(void *, uint *, _GError * *)g_key_file_to_data;
+extern (C) int function(void *, char *, char * *, int, _GError * *)g_key_file_load_from_data_dirs;
+extern (C) int function(void *, char *, char * *, char * *, int, _GError * *)g_key_file_load_from_dirs;
+extern (C) int function(void *, char *, uint, int, _GError * *)g_key_file_load_from_data;
+extern (C) int function(void *, char *, int, _GError * *)g_key_file_load_from_file;
+extern (C) void function(void *, char)g_key_file_set_list_separator;
+extern (C) void function(void *)g_key_file_free;
+extern (C) void * function()g_key_file_new;
+extern (C) uint function()g_key_file_error_quark;
+extern (C) extern _GSourceFuncs* g_io_watch_funcs;
+extern (C) int function(_GIOChannel *)g_io_channel_unix_get_fd;
+extern (C) _GIOChannel * function(int)g_io_channel_unix_new;
+extern (C) int function(int)g_io_channel_error_from_errno;
+extern (C) uint function()g_io_channel_error_quark;
+extern (C) _GIOChannel * function(char *, char *, _GError * *)g_io_channel_new_file;
+extern (C) int function(_GIOChannel *, long, int, _GError * *)g_io_channel_seek_position;
+extern (C) int function(_GIOChannel *, uint, _GError * *)g_io_channel_write_unichar;
+extern (C) int function(_GIOChannel *, char *, int, uint *, _GError * *)g_io_channel_write_chars;
+extern (C) int function(_GIOChannel *, uint *, _GError * *)g_io_channel_read_unichar;
+extern (C) int function(_GIOChannel *, char *, uint, uint *, _GError * *)g_io_channel_read_chars;
+extern (C) int function(_GIOChannel *, char * *, uint *, _GError * *)g_io_channel_read_to_end;
+extern (C) int function(_GIOChannel *, _GString *, uint *, _GError * *)g_io_channel_read_line_string;
+extern (C) int function(_GIOChannel *, char * *, uint *, uint *, _GError * *)g_io_channel_read_line;
+extern (C) int function(_GIOChannel *, _GError * *)g_io_channel_flush;
+extern (C) int function(_GIOChannel *)g_io_channel_get_close_on_unref;
+extern (C) void function(_GIOChannel *, int)g_io_channel_set_close_on_unref;
+extern (C) char * function(_GIOChannel *)g_io_channel_get_encoding;
+extern (C) int function(_GIOChannel *, char *, _GError * *)g_io_channel_set_encoding;
+extern (C) int function(_GIOChannel *)g_io_channel_get_buffered;
+extern (C) void function(_GIOChannel *, int)g_io_channel_set_buffered;
+extern (C) char * function(_GIOChannel *, int *)g_io_channel_get_line_term;
+extern (C) void function(_GIOChannel *, char *, int)g_io_channel_set_line_term;
+extern (C) int function(_GIOChannel *)g_io_channel_get_flags;
+extern (C) int function(_GIOChannel *, int, _GError * *)g_io_channel_set_flags;
+extern (C) int function(_GIOChannel *)g_io_channel_get_buffer_condition;
+extern (C) uint function(_GIOChannel *)g_io_channel_get_buffer_size;
+extern (C) void function(_GIOChannel *, uint)g_io_channel_set_buffer_size;
+extern (C) uint function(_GIOChannel *, int, _BCD_func__2635, void *)g_io_add_watch;
+extern (C) _GSource * function(_GIOChannel *, int)g_io_create_watch;
+extern (C) uint function(_GIOChannel *, int, int, _BCD_func__2635, void *, _BCD_func__2417)g_io_add_watch_full;
+extern (C) int function(_GIOChannel *, int, _GError * *)g_io_channel_shutdown;
+extern (C) void function(_GIOChannel *)g_io_channel_close;
+extern (C) int function(_GIOChannel *, long, int)g_io_channel_seek;
+extern (C) int function(_GIOChannel *, char *, uint, uint *)g_io_channel_write;
+extern (C) int function(_GIOChannel *, char *, uint, uint *)g_io_channel_read;
+extern (C) void function(_GIOChannel *)g_io_channel_unref;
+extern (C) _GIOChannel * function(_GIOChannel *)g_io_channel_ref;
+extern (C) void function(_GIOChannel *)g_io_channel_init;
+extern (C) _GString * function(_GString *)g_string_up;
+extern (C) _GString * function(_GString *)g_string_down;
+extern (C) _GString * function(_GString *, char)g_string_append_c_inline;
+extern (C) void function(_GString *, char *, ...)g_string_append_printf;
+extern (C) void function(_GString *, char *, char *)g_string_append_vprintf;
+extern (C) void function(_GString *, char *, ...)g_string_printf;
+extern (C) void function(_GString *, char *, char *)g_string_vprintf;
+extern (C) _GString * function(_GString *)g_string_ascii_up;
+extern (C) _GString * function(_GString *)g_string_ascii_down;
+extern (C) _GString * function(_GString *, int, int)g_string_erase;
+extern (C) _GString * function(_GString *, uint, char *, int)g_string_overwrite_len;
+extern (C) _GString * function(_GString *, uint, char *)g_string_overwrite;
+extern (C) _GString * function(_GString *, int, uint)g_string_insert_unichar;
+extern (C) _GString * function(_GString *, int, char)g_string_insert_c;
+extern (C) _GString * function(_GString *, int, char *)g_string_insert;
+extern (C) _GString * function(_GString *, char *, int)g_string_prepend_len;
+extern (C) _GString * function(_GString *, uint)g_string_prepend_unichar;
+extern (C) _GString * function(_GString *, char)g_string_prepend_c;
+extern (C) _GString * function(_GString *, char *)g_string_prepend;
+extern (C) _GString * function(_GString *, uint)g_string_append_unichar;
+extern (C) _GString * function(_GString *, char)g_string_append_c;
+extern (C) _GString * function(_GString *, char *, int)g_string_append_len;
+extern (C) _GString * function(_GString *, char *)g_string_append;
+extern (C) _GString * function(_GString *, int, char *, int)g_string_insert_len;
+extern (C) _GString * function(_GString *, uint)g_string_set_size;
+extern (C) _GString * function(_GString *, uint)g_string_truncate;
+extern (C) _GString * function(_GString *, char *)g_string_assign;
+extern (C) uint function(_GString *)g_string_hash;
+extern (C) int function(_GString *, _GString *)g_string_equal;
+extern (C) char * function(_GString *, int)g_string_free;
+extern (C) _GString * function(uint)g_string_sized_new;
+extern (C) _GString * function(char *, int)g_string_new_len;
+extern (C) _GString * function(char *)g_string_new;
+extern (C) char * function(void *, char *)g_string_chunk_insert_const;
+extern (C) char * function(void *, char *, int)g_string_chunk_insert_len;
+extern (C) char * function(void *, char *)g_string_chunk_insert;
+extern (C) void function(void *)g_string_chunk_clear;
+extern (C) void function(void *)g_string_chunk_free;
+extern (C) void * function(uint)g_string_chunk_new;
+extern (C) char * function(char *)_g_utf8_make_valid;
+extern (C) int function(uint)g_unichar_get_script;
+extern (C) int function(uint, uint *)g_unichar_get_mirror_char;
+extern (C) char * function(char *, int)g_utf8_collate_key_for_filename;
+extern (C) char * function(char *, int)g_utf8_collate_key;
+extern (C) int function(char *, char *)g_utf8_collate;
+extern (C) char * function(char *, int, int)g_utf8_normalize;
+extern (C) char * function(char *, int)g_utf8_casefold;
+extern (C) char * function(char *, int)g_utf8_strdown;
+extern (C) char * function(char *, int)g_utf8_strup;
+extern (C) int function(uint)g_unichar_validate;
+extern (C) int function(char *, int, char * *)g_utf8_validate;
+extern (C) int function(uint, char *)g_unichar_to_utf8;
+extern (C) char * function(uint *, int, int *, int *, _GError * *)g_ucs4_to_utf8;
+extern (C) ushort * function(uint *, int, int *, int *, _GError * *)g_ucs4_to_utf16;
+extern (C) char * function(ushort *, int, int *, int *, _GError * *)g_utf16_to_utf8;
+extern (C) uint * function(ushort *, int, int *, int *, _GError * *)g_utf16_to_ucs4;
+extern (C) uint * function(char *, int, int *)g_utf8_to_ucs4_fast;
+extern (C) uint * function(char *, int, int *, int *, _GError * *)g_utf8_to_ucs4;
+extern (C) ushort * function(char *, int, int *, int *, _GError * *)g_utf8_to_utf16;
+extern (C) char * function(char *, int)g_utf8_strreverse;
+extern (C) char * function(char *, int, uint)g_utf8_strrchr;
+extern (C) char * function(char *, int, uint)g_utf8_strchr;
+extern (C) char * function(char *, char *, uint)g_utf8_strncpy;
+extern (C) int function(char *, int)g_utf8_strlen;
+extern (C) char * function(char *, char *)g_utf8_find_prev_char;
+extern (C) char * function(char *, char *)g_utf8_find_next_char;
+extern (C) char * function(char *)g_utf8_prev_char;
+extern (C) int function(char *, char *)g_utf8_pointer_to_offset;
+extern (C) char * function(char *, int)g_utf8_offset_to_pointer;
+extern (C) uint function(char *, int)g_utf8_get_char_validated;
+extern (C) uint function(char *)g_utf8_get_char;
+extern (C) extern char ** g_utf8_skip;
+extern (C) uint * function(uint, uint *)g_unicode_canonical_decomposition;
+extern (C) void function(uint *, uint)g_unicode_canonical_ordering;
+extern (C) int function(uint)g_unichar_combining_class;
+extern (C) int function(uint)g_unichar_break_type;
+extern (C) int function(uint)g_unichar_type;
+extern (C) int function(uint)g_unichar_xdigit_value;
+extern (C) int function(uint)g_unichar_digit_value;
+extern (C) uint function(uint)g_unichar_totitle;
+extern (C) uint function(uint)g_unichar_tolower;
+extern (C) uint function(uint)g_unichar_toupper;
+extern (C) int function(uint)g_unichar_ismark;
+extern (C) int function(uint)g_unichar_iszerowidth;
+extern (C) int function(uint)g_unichar_iswide_cjk;
+extern (C) int function(uint)g_unichar_iswide;
+extern (C) int function(uint)g_unichar_isdefined;
+extern (C) int function(uint)g_unichar_istitle;
+extern (C) int function(uint)g_unichar_isxdigit;
+extern (C) int function(uint)g_unichar_isupper;
+extern (C) int function(uint)g_unichar_isspace;
+extern (C) int function(uint)g_unichar_ispunct;
+extern (C) int function(uint)g_unichar_isprint;
+extern (C) int function(uint)g_unichar_islower;
+extern (C) int function(uint)g_unichar_isgraph;
+extern (C) int function(uint)g_unichar_isdigit;
+extern (C) int function(uint)g_unichar_iscntrl;
+extern (C) int function(uint)g_unichar_isalpha;
+extern (C) int function(uint)g_unichar_isalnum;
+extern (C) int function(char * *)g_get_charset;
+extern (C) extern _GSourceFuncs* g_idle_funcs;
+extern (C) extern _GSourceFuncs* g_child_watch_funcs;
+extern (C) extern _GSourceFuncs* g_timeout_funcs;
+extern (C) int function(void *)g_idle_remove_by_data;
+extern (C) uint function(int, _BCD_func__2695, void *, _BCD_func__2417)g_idle_add_full;
+extern (C) uint function(_BCD_func__2695, void *)g_idle_add;
+extern (C) uint function(int, _BCD_func__2694, void *)g_child_watch_add;
+extern (C) uint function(int, int, _BCD_func__2694, void *, _BCD_func__2417)g_child_watch_add_full;
+extern (C) uint function(uint, _BCD_func__2695, void *)g_timeout_add_seconds;
+extern (C) uint function(int, uint, _BCD_func__2695, void *, _BCD_func__2417)g_timeout_add_seconds_full;
+extern (C) uint function(uint, _BCD_func__2695, void *)g_timeout_add;
+extern (C) uint function(int, uint, _BCD_func__2695, void *, _BCD_func__2417)g_timeout_add_full;
+extern (C) int function(_GSourceFuncs *, void *)g_source_remove_by_funcs_user_data;
+extern (C) int function(void *)g_source_remove_by_user_data;
+extern (C) int function(uint)g_source_remove;
+extern (C) void function(_GTimeVal *)g_get_current_time;
+extern (C) _GSource * function(uint)g_timeout_source_new_seconds;
+extern (C) _GSource * function(uint)g_timeout_source_new;
+extern (C) _GSource * function(int)g_child_watch_source_new;
+extern (C) _GSource * function()g_idle_source_new;
+extern (C) void function(_GSource *, _GTimeVal *)g_source_get_current_time;
+extern (C) void function(_GSource *, _GPollFD *)g_source_remove_poll;
+extern (C) void function(_GSource *, _GPollFD *)g_source_add_poll;
+extern (C) void function(_GSource *, void *, _GSourceCallbackFuncs *)g_source_set_callback_indirect;
+extern (C) int function(_GSource *)g_source_is_destroyed;
+extern (C) void function(_GSource *, _GSourceFuncs *)g_source_set_funcs;
+extern (C) void function(_GSource *, _BCD_func__2695, void *, _BCD_func__2417)g_source_set_callback;
+extern (C) void * function(_GSource *)g_source_get_context;
+extern (C) uint function(_GSource *)g_source_get_id;
+extern (C) int function(_GSource *)g_source_get_can_recurse;
+extern (C) void function(_GSource *, int)g_source_set_can_recurse;
+extern (C) int function(_GSource *)g_source_get_priority;
+extern (C) void function(_GSource *, int)g_source_set_priority;
+extern (C) void function(_GSource *)g_source_destroy;
+extern (C) uint function(_GSource *, void *)g_source_attach;
+extern (C) void function(_GSource *)g_source_unref;
+extern (C) _GSource * function(_GSource *)g_source_ref;
+extern (C) _GSource * function(_GSourceFuncs *, uint)g_source_new;
+extern (C) void * function(void *)g_main_loop_get_context;
+extern (C) int function(void *)g_main_loop_is_running;
+extern (C) void function(void *)g_main_loop_unref;
+extern (C) void * function(void *)g_main_loop_ref;
+extern (C) void function(void *)g_main_loop_quit;
+extern (C) void function(void *)g_main_loop_run;
+extern (C) void * function(void *, int)g_main_loop_new;
+extern (C) _GSource * function()g_main_current_source;
+extern (C) int function()g_main_depth;
+extern (C) void function(void *, _GPollFD *)g_main_context_remove_poll;
+extern (C) void function(void *, _GPollFD *, int)g_main_context_add_poll;
+extern (C) _BCD_func__2688 function(void *)g_main_context_get_poll_func;
+extern (C) void function(void *, _BCD_func__2688)g_main_context_set_poll_func;
+extern (C) void function(void *)g_main_context_dispatch;
+extern (C) int function(void *, int, _GPollFD *, int)g_main_context_check;
+extern (C) int function(void *, int, int *, _GPollFD *, int)g_main_context_query;
+extern (C) int function(void *, int *)g_main_context_prepare;
+extern (C) int function(void *, void *, void *)g_main_context_wait;
+extern (C) int function(void *)g_main_context_is_owner;
+extern (C) void function(void *)g_main_context_release;
+extern (C) int function(void *)g_main_context_acquire;
+extern (C) void function(void *)g_main_context_wakeup;
+extern (C) _GSource * function(void *, _GSourceFuncs *, void *)g_main_context_find_source_by_funcs_user_data;
+extern (C) _GSource * function(void *, void *)g_main_context_find_source_by_user_data;
+extern (C) _GSource * function(void *, uint)g_main_context_find_source_by_id;
+extern (C) int function(void *)g_main_context_pending;
+extern (C) int function(void *, int)g_main_context_iteration;
+extern (C) void * function()g_main_context_default;
+extern (C) void function(void *)g_main_context_unref;
+extern (C) void * function(void *)g_main_context_ref;
+extern (C) void * function()g_main_context_new;
+extern (C) void function()g_slist_pop_allocator;
+extern (C) void function(void *)g_slist_push_allocator;
+extern (C) void * function(_GSList *, uint)g_slist_nth_data;
+extern (C) _GSList * function(_GSList *, _BCD_func__2968, void *)g_slist_sort_with_data;
+extern (C) _GSList * function(_GSList *, _BCD_func__2969)g_slist_sort;
+extern (C) void function(_GSList *, _BCD_func__2422, void *)g_slist_foreach;
+extern (C) uint function(_GSList *)g_slist_length;
+extern (C) _GSList * function(_GSList *)g_slist_last;
+extern (C) int function(_GSList *, void *)g_slist_index;
+extern (C) int function(_GSList *, _GSList *)g_slist_position;
+extern (C) _GSList * function(_GSList *, void *, _BCD_func__2969)g_slist_find_custom;
+extern (C) _GSList * function(_GSList *, void *)g_slist_find;
+extern (C) _GSList * function(_GSList *, uint)g_slist_nth;
+extern (C) _GSList * function(_GSList *)g_slist_copy;
+extern (C) _GSList * function(_GSList *)g_slist_reverse;
+extern (C) _GSList * function(_GSList *, _GSList *)g_slist_delete_link;
+extern (C) _GSList * function(_GSList *, _GSList *)g_slist_remove_link;
+extern (C) _GSList * function(_GSList *, void *)g_slist_remove_all;
+extern (C) _GSList * function(_GSList *, void *)g_slist_remove;
+extern (C) _GSList * function(_GSList *, _GSList *)g_slist_concat;
+extern (C) _GSList * function(_GSList *, _GSList *, void *)g_slist_insert_before;
+extern (C) _GSList * function(_GSList *, void *, _BCD_func__2968, void *)g_slist_insert_sorted_with_data;
+extern (C) _GSList * function(_GSList *, void *, _BCD_func__2969)g_slist_insert_sorted;
+extern (C) _GSList * function(_GSList *, void *, int)g_slist_insert;
+extern (C) _GSList * function(_GSList *, void *)g_slist_prepend;
+extern (C) _GSList * function(_GSList *, void *)g_slist_append;
+extern (C) void function(_GSList *)g_slist_free_1;
+extern (C) void function(_GSList *)g_slist_free;
+extern (C) _GSList * function()g_slist_alloc;
+extern (C) void function(_GHookList *, int, _BCD_func__2732, void *)g_hook_list_marshal_check;
+extern (C) void function(_GHookList *, int, _BCD_func__2733, void *)g_hook_list_marshal;
+extern (C) void function(_GHookList *, int)g_hook_list_invoke_check;
+extern (C) void function(_GHookList *, int)g_hook_list_invoke;
+extern (C) int function(_GHook *, _GHook *)g_hook_compare_ids;
+extern (C) _GHook * function(_GHookList *, _GHook *, int)g_hook_next_valid;
+extern (C) _GHook * function(_GHookList *, int)g_hook_first_valid;
+extern (C) _GHook * function(_GHookList *, int, void *, void *)g_hook_find_func_data;
+extern (C) _GHook * function(_GHookList *, int, void *)g_hook_find_func;
+extern (C) _GHook * function(_GHookList *, int, void *)g_hook_find_data;
+extern (C) _GHook * function(_GHookList *, int, _BCD_func__2732, void *)g_hook_find;
+extern (C) _GHook * function(_GHookList *, uint)g_hook_get;
+extern (C) void function(_GHookList *, _GHook *, _BCD_func__2734)g_hook_insert_sorted;
+extern (C) void function(_GHookList *, _GHook *, _GHook *)g_hook_insert_before;
+extern (C) void function(_GHookList *, _GHook *)g_hook_prepend;
+extern (C) void function(_GHookList *, _GHook *)g_hook_destroy_link;
+extern (C) int function(_GHookList *, uint)g_hook_destroy;
+extern (C) void function(_GHookList *, _GHook *)g_hook_unref;
+extern (C) _GHook * function(_GHookList *, _GHook *)g_hook_ref;
+extern (C) void function(_GHookList *, _GHook *)g_hook_free;
+extern (C) _GHook * function(_GHookList *)g_hook_alloc;
+extern (C) void function(_GHookList *)g_hook_list_clear;
+extern (C) void function(_GHookList *, uint)g_hook_list_init;
+extern (C) int function(void *, void *)g_direct_equal;
+extern (C) uint function(void *)g_direct_hash;
+extern (C) uint function(void *)g_int_hash;
+extern (C) int function(void *, void *)g_int_equal;
+extern (C) uint function(void *)g_str_hash;
+extern (C) int function(void *, void *)g_str_equal;
+extern (C) void function(void *)g_hash_table_unref;
+extern (C) void * function(void *)g_hash_table_ref;
+extern (C) _GList * function(void *)g_hash_table_get_values;
+extern (C) _GList * function(void *)g_hash_table_get_keys;
+extern (C) uint function(void *)g_hash_table_size;
+extern (C) uint function(void *, _BCD_func__2478, void *)g_hash_table_foreach_steal;
+extern (C) uint function(void *, _BCD_func__2478, void *)g_hash_table_foreach_remove;
+extern (C) void * function(void *, _BCD_func__2478, void *)g_hash_table_find;
+extern (C) void function(void *, _BCD_func__2965, void *)g_hash_table_foreach;
+extern (C) int function(void *, void *, void * *, void * *)g_hash_table_lookup_extended;
+extern (C) void * function(void *, void *)g_hash_table_lookup;
+extern (C) void function(void *)g_hash_table_steal_all;
+extern (C) int function(void *, void *)g_hash_table_steal;
+extern (C) void function(void *)g_hash_table_remove_all;
+extern (C) int function(void *, void *)g_hash_table_remove;
+extern (C) void function(void *, void *, void *)g_hash_table_replace;
+extern (C) void function(void *, void *, void *)g_hash_table_insert;
+extern (C) void function(void *)g_hash_table_destroy;
+extern (C) void * function(_BCD_func__2966, _BCD_func__2967, _BCD_func__2417, _BCD_func__2417)g_hash_table_new_full;
+extern (C) void * function(_BCD_func__2966, _BCD_func__2967)g_hash_table_new;
+extern (C) int function(char *, int)g_mkdir_with_parents;
+extern (C) char * function(char * *)g_build_filenamev;
+extern (C) char * function(char *, ...)g_build_filename;
+extern (C) char * function(char *, char * *)g_build_pathv;
+extern (C) char * function(char *, char *, ...)g_build_path;
+extern (C) int function(char *, char * *, _GError * *)g_file_open_tmp;
+extern (C) int function(char *)g_mkstemp;
+extern (C) char * function(char *, _GError * *)g_file_read_link;
+extern (C) int function(char *, char *, int, _GError * *)g_file_set_contents;
+extern (C) int function(char *, char * *, uint *, _GError * *)g_file_get_contents;
+extern (C) int function(char *, int)g_file_test;
+extern (C) int function(int)g_file_error_from_errno;
+extern (C) uint function()g_file_error_quark;
+extern (C) void function(void *)g_dir_close;
+extern (C) void function(void *)g_dir_rewind;
+extern (C) char * function(void *)g_dir_read_name;
+extern (C) void * function(char *, uint, _GError * *)g_dir_open;
+extern (C) uint function(char *, uint, char *, _GDate *)g_date_strftime;
+extern (C) void function(_GDate *, _GDate *)g_date_order;
+extern (C) void function(_GDate *, _GDate *, _GDate *)g_date_clamp;
+extern (C) void function(_GDate *, tm *)g_date_to_struct_tm;
+extern (C) int function(_GDate *, _GDate *)g_date_compare;
+extern (C) int function(_GDate *, _GDate *)g_date_days_between;
+extern (C) char function(ushort)g_date_get_sunday_weeks_in_year;
+extern (C) char function(ushort)g_date_get_monday_weeks_in_year;
+extern (C) char function(int, ushort)g_date_get_days_in_month;
+extern (C) int function(ushort)g_date_is_leap_year;
+extern (C) void function(_GDate *, uint)g_date_subtract_years;
+extern (C) void function(_GDate *, uint)g_date_add_years;
+extern (C) void function(_GDate *, uint)g_date_subtract_months;
+extern (C) void function(_GDate *, uint)g_date_add_months;
+extern (C) void function(_GDate *, uint)g_date_subtract_days;
+extern (C) void function(_GDate *, uint)g_date_add_days;
+extern (C) int function(_GDate *)g_date_is_last_of_month;
+extern (C) int function(_GDate *)g_date_is_first_of_month;
+extern (C) void function(_GDate *, uint)g_date_set_julian;
+extern (C) void function(_GDate *, char, int, ushort)g_date_set_dmy;
+extern (C) void function(_GDate *, ushort)g_date_set_year;
+extern (C) void function(_GDate *, char)g_date_set_day;
+extern (C) void function(_GDate *, int)g_date_set_month;
+extern (C) void function(_GDate *, int)g_date_set_time;
+extern (C) void function(_GDate *, _GTimeVal *)g_date_set_time_val;
+extern (C) void function(_GDate *, int)g_date_set_time_t;
+extern (C) void function(_GDate *, char *)g_date_set_parse;
+extern (C) void function(_GDate *, uint)g_date_clear;
+extern (C) uint function(_GDate *)g_date_get_iso8601_week_of_year;
+extern (C) uint function(_GDate *)g_date_get_sunday_week_of_year;
+extern (C) uint function(_GDate *)g_date_get_monday_week_of_year;
+extern (C) uint function(_GDate *)g_date_get_day_of_year;
+extern (C) uint function(_GDate *)g_date_get_julian;
+extern (C) char function(_GDate *)g_date_get_day;
+extern (C) ushort function(_GDate *)g_date_get_year;
+extern (C) int function(_GDate *)g_date_get_month;
+extern (C) int function(_GDate *)g_date_get_weekday;
+extern (C) int function(char, int, ushort)g_date_valid_dmy;
+extern (C) int function(uint)g_date_valid_julian;
+extern (C) int function(int)g_date_valid_weekday;
+extern (C) int function(ushort)g_date_valid_year;
+extern (C) int function(int)g_date_valid_month;
+extern (C) int function(char)g_date_valid_day;
+extern (C) int function(_GDate *)g_date_valid;
+extern (C) void function(_GDate *)g_date_free;
+extern (C) _GDate * function(uint)g_date_new_julian;
+extern (C) _GDate * function(char, int, ushort)g_date_new_dmy;
+extern (C) _GDate * function()g_date_new;
+extern (C) void function(void *, _BCD_func__2768, void *)g_dataset_foreach;
+extern (C) void * function(void *, uint)g_dataset_id_remove_no_notify;
+extern (C) void function(void *, uint, void *, _BCD_func__2417)g_dataset_id_set_data_full;
+extern (C) void * function(void *, uint)g_dataset_id_get_data;
+extern (C) void function(void *)g_dataset_destroy;
+extern (C) uint function(void * *)g_datalist_get_flags;
+extern (C) void function(void * *, uint)g_datalist_unset_flags;
+extern (C) void function(void * *, uint)g_datalist_set_flags;
+extern (C) void function(void * *, _BCD_func__2768, void *)g_datalist_foreach;
+extern (C) void * function(void * *, uint)g_datalist_id_remove_no_notify;
+extern (C) void function(void * *, uint, void *, _BCD_func__2417)g_datalist_id_set_data_full;
+extern (C) void * function(void * *, uint)g_datalist_id_get_data;
+extern (C) void function(void * *)g_datalist_clear;
+extern (C) void function(void * *)g_datalist_init;
+extern (C) char * * function(char *)g_uri_list_extract_uris;
+extern (C) char * function(char *)g_filename_display_basename;
+extern (C) int function(char * * *)g_get_filename_charsets;
+extern (C) char * function(char *)g_filename_display_name;
+extern (C) char * function(char *, char *, _GError * *)g_filename_to_uri;
+extern (C) char * function(char *, char * *, _GError * *)g_filename_from_uri;
+extern (C) char * function(char *, int, uint *, uint *, _GError * *)g_filename_from_utf8;
+extern (C) char * function(char *, int, uint *, uint *, _GError * *)g_filename_to_utf8;
+extern (C) char * function(char *, int, uint *, uint *, _GError * *)g_locale_from_utf8;
+extern (C) char * function(char *, int, uint *, uint *, _GError * *)g_locale_to_utf8;
+extern (C) char * function(char *, int, char *, char *, char *, uint *, uint *, _GError * *)g_convert_with_fallback;
+extern (C) char * function(char *, int, void *, uint *, uint *, _GError * *)g_convert_with_iconv;
+extern (C) char * function(char *, int, char *, char *, uint *, uint *, _GError * *)g_convert;
+extern (C) int function(void *)g_iconv_close;
+extern (C) uint function(void *, char * *, uint *, char * *, uint *)g_iconv;
+extern (C) void * function(char *, char *)g_iconv_open;
+extern (C) uint function()g_convert_error_quark;
+extern (C) void function(_GCompletion *)g_completion_free;
+extern (C) void function(_GCompletion *, _BCD_func__2771)g_completion_set_compare;
+extern (C) _GList * function(_GCompletion *, char *, char * *)g_completion_complete_utf8;
+extern (C) _GList * function(_GCompletion *, char *, char * *)g_completion_complete;
+extern (C) void function(_GCompletion *)g_completion_clear_items;
+extern (C) void function(_GCompletion *, _GList *)g_completion_remove_items;
+extern (C) void function(_GCompletion *, _GList *)g_completion_add_items;
+extern (C) _GCompletion * function(_BCD_func__2772)g_completion_new;
+extern (C) void function(void *, _BCD_func__2965, void *)g_cache_value_foreach;
+extern (C) void function(void *, _BCD_func__2965, void *)g_cache_key_foreach;
+extern (C) void function(void *, void *)g_cache_remove;
+extern (C) void * function(void *, void *)g_cache_insert;
+extern (C) void function(void *)g_cache_destroy;
+extern (C) void * function(_BCD_func__2418, _BCD_func__2417, _BCD_func__2418, _BCD_func__2417, _BCD_func__2966, _BCD_func__2966, _BCD_func__2967)g_cache_new;
+extern (C) void function()g_list_pop_allocator;
+extern (C) void function(void *)g_list_push_allocator;
+extern (C) void * function(_GList *, uint)g_list_nth_data;
+extern (C) _GList * function(_GList *, _BCD_func__2968, void *)g_list_sort_with_data;
+extern (C) _GList * function(_GList *, _BCD_func__2969)g_list_sort;
+extern (C) void function(_GList *, _BCD_func__2422, void *)g_list_foreach;
+extern (C) uint function(_GList *)g_list_length;
+extern (C) _GList * function(_GList *)g_list_first;
+extern (C) _GList * function(_GList *)g_list_last;
+extern (C) int function(_GList *, void *)g_list_index;
+extern (C) int function(_GList *, _GList *)g_list_position;
+extern (C) _GList * function(_GList *, void *, _BCD_func__2969)g_list_find_custom;
+extern (C) _GList * function(_GList *, void *)g_list_find;
+extern (C) _GList * function(_GList *, uint)g_list_nth_prev;
+extern (C) _GList * function(_GList *, uint)g_list_nth;
+extern (C) _GList * function(_GList *)g_list_copy;
+extern (C) _GList * function(_GList *)g_list_reverse;
+extern (C) _GList * function(_GList *, _GList *)g_list_delete_link;
+extern (C) _GList * function(_GList *, _GList *)g_list_remove_link;
+extern (C) _GList * function(_GList *, void *)g_list_remove_all;
+extern (C) _GList * function(_GList *, void *)g_list_remove;
+extern (C) _GList * function(_GList *, _GList *)g_list_concat;
+extern (C) _GList * function(_GList *, _GList *, void *)g_list_insert_before;
+extern (C) _GList * function(_GList *, void *, _BCD_func__2968, void *)g_list_insert_sorted_with_data;
+extern (C) _GList * function(_GList *, void *, _BCD_func__2969)g_list_insert_sorted;
+extern (C) _GList * function(_GList *, void *, int)g_list_insert;
+extern (C) _GList * function(_GList *, void *)g_list_prepend;
+extern (C) _GList * function(_GList *, void *)g_list_append;
+extern (C) void function(_GList *)g_list_free_1;
+extern (C) void function(_GList *)g_list_free;
+extern (C) _GList * function()g_list_alloc;
+extern (C) void function(void *)g_allocator_free;
+extern (C) void * function(char *, uint)g_allocator_new;
+extern (C) void function()g_blow_chunks;
+extern (C) void function()g_mem_chunk_info;
+extern (C) void function(void *)g_mem_chunk_print;
+extern (C) void function(void *)g_mem_chunk_reset;
+extern (C) void function(void *)g_mem_chunk_clean;
+extern (C) void function(void *, void *)g_mem_chunk_free;
+extern (C) void * function(void *)g_mem_chunk_alloc0;
+extern (C) void * function(void *)g_mem_chunk_alloc;
+extern (C) void function(void *)g_mem_chunk_destroy;
+extern (C) void * function(char *, int, uint, int)g_mem_chunk_new;
+extern (C) void function()g_mem_profile;
+extern (C) extern _GMemVTable ** glib_mem_profiler_table;
+extern (C) extern int* g_mem_gc_friendly;
+extern (C) int function()g_mem_is_system_malloc;
+extern (C) void function(_GMemVTable *)g_mem_set_vtable;
+extern (C) void * function(void *, uint)g_try_realloc;
+extern (C) void * function(uint)g_try_malloc0;
+extern (C) void * function(uint)g_try_malloc;
+extern (C) void function(void *)g_free;
+extern (C) void * function(void *, uint)g_realloc;
+extern (C) void * function(uint)g_malloc0;
+extern (C) void * function(uint)g_malloc;
+extern (C) long * function(int, long, uint *)g_slice_get_config_state;
+extern (C) long function(int)g_slice_get_config;
+extern (C) void function(int, long)g_slice_set_config;
+extern (C) void function(uint, void *, uint)g_slice_free_chain_with_offset;
+extern (C) void function(uint, void *)g_slice_free1;
+extern (C) void * function(uint, void *)g_slice_copy;
+extern (C) void * function(uint)g_slice_alloc0;
+extern (C) void * function(uint)g_slice_alloc;
+extern (C) int function(void *, char *, char *, _GError * *)g_bookmark_file_move_item;
+extern (C) int function(void *, char *, _GError * *)g_bookmark_file_remove_item;
+extern (C) int function(void *, char *, char *, _GError * *)g_bookmark_file_remove_application;
+extern (C) int function(void *, char *, char *, _GError * *)g_bookmark_file_remove_group;
+extern (C) char * * function(void *, uint *)g_bookmark_file_get_uris;
+extern (C) int function(void *)g_bookmark_file_get_size;
+extern (C) int function(void *, char *)g_bookmark_file_has_item;
+extern (C) int function(void *, char *, _GError * *)g_bookmark_file_get_visited;
+extern (C) void function(void *, char *, int)g_bookmark_file_set_visited;
+extern (C) int function(void *, char *, _GError * *)g_bookmark_file_get_modified;
+extern (C) void function(void *, char *, int)g_bookmark_file_set_modified;
+extern (C) int function(void *, char *, _GError * *)g_bookmark_file_get_added;
+extern (C) void function(void *, char *, int)g_bookmark_file_set_added;
+extern (C) int function(void *, char *, char * *, char * *, _GError * *)g_bookmark_file_get_icon;
+extern (C) void function(void *, char *, char *, char *)g_bookmark_file_set_icon;
+extern (C) int function(void *, char *, _GError * *)g_bookmark_file_get_is_private;
+extern (C) void function(void *, char *, int)g_bookmark_file_set_is_private;
+extern (C) int function(void *, char *, char *, char * *, uint *, int *, _GError * *)g_bookmark_file_get_app_info;
+extern (C) int function(void *, char *, char *, char *, int, int, _GError * *)g_bookmark_file_set_app_info;
+extern (C) char * * function(void *, char *, uint *, _GError * *)g_bookmark_file_get_applications;
+extern (C) int function(void *, char *, char *, _GError * *)g_bookmark_file_has_application;
+extern (C) void function(void *, char *, char *, char *)g_bookmark_file_add_application;
+extern (C) char * * function(void *, char *, uint *, _GError * *)g_bookmark_file_get_groups;
+extern (C) int function(void *, char *, char *, _GError * *)g_bookmark_file_has_group;
+extern (C) void function(void *, char *, char *)g_bookmark_file_add_group;
+extern (C) void function(void *, char *, char * *, uint)g_bookmark_file_set_groups;
+extern (C) char * function(void *, char *, _GError * *)g_bookmark_file_get_mime_type;
+extern (C) void function(void *, char *, char *)g_bookmark_file_set_mime_type;
+extern (C) char * function(void *, char *, _GError * *)g_bookmark_file_get_description;
+extern (C) void function(void *, char *, char *)g_bookmark_file_set_description;
+extern (C) char * function(void *, char *, _GError * *)g_bookmark_file_get_title;
+extern (C) void function(void *, char *, char *)g_bookmark_file_set_title;
+extern (C) int function(void *, char *, _GError * *)g_bookmark_file_to_file;
+extern (C) char * function(void *, uint *, _GError * *)g_bookmark_file_to_data;
+extern (C) int function(void *, char *, char * *, _GError * *)g_bookmark_file_load_from_data_dirs;
+extern (C) int function(void *, char *, uint, _GError * *)g_bookmark_file_load_from_data;
+extern (C) int function(void *, char *, _GError * *)g_bookmark_file_load_from_file;
+extern (C) void function(void *)g_bookmark_file_free;
+extern (C) void * function()g_bookmark_file_new;
+extern (C) uint function()g_bookmark_file_error_quark;
+extern (C) char * function(char *, uint *)g_base64_decode;
+extern (C) uint function(char *, uint, char *, int *, uint *)g_base64_decode_step;
+extern (C) char * function(char *, uint)g_base64_encode;
+extern (C) uint function(int, char *, int *, int *)g_base64_encode_close;
+extern (C) uint function(char *, uint, int, char *, int *, int *)g_base64_encode_step;
+extern (C) void function(char *)g_on_error_stack_trace;
+extern (C) void function(char *)g_on_error_query;
+extern (C) void * function(void *)_g_async_queue_get_mutex;
+extern (C) void function(void *, _BCD_func__2968, void *)g_async_queue_sort_unlocked;
+extern (C) void function(void *, _BCD_func__2968, void *)g_async_queue_sort;
+extern (C) int function(void *)g_async_queue_length_unlocked;
+extern (C) int function(void *)g_async_queue_length;
+extern (C) void * function(void *, _GTimeVal *)g_async_queue_timed_pop_unlocked;
+extern (C) void * function(void *, _GTimeVal *)g_async_queue_timed_pop;
+extern (C) void * function(void *)g_async_queue_try_pop_unlocked;
+extern (C) void * function(void *)g_async_queue_try_pop;
+extern (C) void * function(void *)g_async_queue_pop_unlocked;
+extern (C) void * function(void *)g_async_queue_pop;
+extern (C) void function(void *, void *, _BCD_func__2968, void *)g_async_queue_push_sorted_unlocked;
+extern (C) void function(void *, void *, _BCD_func__2968, void *)g_async_queue_push_sorted;
+extern (C) void function(void *, void *)g_async_queue_push_unlocked;
+extern (C) void function(void *, void *)g_async_queue_push;
+extern (C) void function(void *)g_async_queue_unref_and_unlock;
+extern (C) void function(void *)g_async_queue_ref_unlocked;
+extern (C) void function(void *)g_async_queue_unref;
+extern (C) void * function(void *)g_async_queue_ref;
+extern (C) void function(void *)g_async_queue_unlock;
+extern (C) void function(void *)g_async_queue_lock;
+extern (C) void * function()g_async_queue_new;
+extern (C) void function()glib_dummy_decl;
+extern (C) void function(uint *, uint)g_once_init_leave;
+extern (C) int function(uint *)g_once_init_enter_impl;
+extern (C) int function(uint *)g_once_init_enter;
+extern (C) void * function(_GOnce *, _BCD_func__2418, void *)g_once_impl;
+extern (C) void function(_BCD_func__2422, void *)g_thread_foreach;
+extern (C) void function(_GStaticRWLock *)g_static_rw_lock_free;
+extern (C) void function(_GStaticRWLock *)g_static_rw_lock_writer_unlock;
+extern (C) int function(_GStaticRWLock *)g_static_rw_lock_writer_trylock;
+extern (C) void function(_GStaticRWLock *)g_static_rw_lock_writer_lock;
+extern (C) void function(_GStaticRWLock *)g_static_rw_lock_reader_unlock;
+extern (C) int function(_GStaticRWLock *)g_static_rw_lock_reader_trylock;
+extern (C) void function(_GStaticRWLock *)g_static_rw_lock_reader_lock;
+extern (C) void function(_GStaticRWLock *)g_static_rw_lock_init;
+extern (C) void function(_GStaticRecMutex *)g_static_rec_mutex_free;
+extern (C) uint function(_GStaticRecMutex *)g_static_rec_mutex_unlock_full;
+extern (C) void function(_GStaticRecMutex *, uint)g_static_rec_mutex_lock_full;
+extern (C) void function(_GStaticRecMutex *)g_static_rec_mutex_unlock;
+extern (C) int function(_GStaticRecMutex *)g_static_rec_mutex_trylock;
+extern (C) void function(_GStaticRecMutex *)g_static_rec_mutex_lock;
+extern (C) void function(_GStaticRecMutex *)g_static_rec_mutex_init;
+extern (C) void function(_GStaticPrivate *)g_static_private_free;
+extern (C) void function(_GStaticPrivate *, void *, _BCD_func__2417)g_static_private_set;
+extern (C) void * function(_GStaticPrivate *)g_static_private_get;
+extern (C) void function(_GStaticPrivate *)g_static_private_init;
+extern (C) void function(_GStaticMutex *)g_static_mutex_free;
+extern (C) void function(_GStaticMutex *)g_static_mutex_init;
+extern (C) void function(_GThread *, int)g_thread_set_priority;
+extern (C) void * function(_GThread *)g_thread_join;
+extern (C) void function(void *)g_thread_exit;
+extern (C) _GThread * function()g_thread_self;
+extern (C) _GThread * function(_BCD_func__2418, void *, uint, int, int, int, _GError * *)g_thread_create_full;
+extern (C) void * function(void * *)g_static_mutex_get_mutex_impl;
+extern (C) void function(_GThreadFunctions *)g_thread_init_with_errorcheck_mutexes;
+extern (C) void function(_GThreadFunctions *)g_thread_init;
+extern (C) extern _BCD_func__3161* g_thread_gettime;
+extern (C) extern int* g_threads_got_initialized;
+extern (C) extern int* g_thread_use_default_impl;
+extern (C) extern _GThreadFunctions* g_thread_functions_for_glib_use;
+extern (C) uint function()g_thread_error_quark;
+extern (C) void function(void * *, void *)g_atomic_pointer_set;
+extern (C) void * function(void * *)g_atomic_pointer_get;
+extern (C) void function(int *, int)g_atomic_int_set;
+extern (C) int function(int *)g_atomic_int_get;
+extern (C) int function(void * *, void *, void *)g_atomic_pointer_compare_and_exchange;
+extern (C) int function(int *, int, int)g_atomic_int_compare_and_exchange;
+extern (C) void function(int *, int)g_atomic_int_add;
+extern (C) int function(int *, int)g_atomic_int_exchange_and_add;
+extern (C) char * function(uint, uint, uint)glib_check_version;
+extern (C) extern uint* glib_binary_age;
+extern (C) extern uint* glib_interface_age;
+extern (C) extern uint* glib_micro_version;
+extern (C) extern uint* glib_minor_version;
+extern (C) extern uint* glib_major_version;
+extern (C) uint function(_GTrashStack * *)g_trash_stack_height;
+extern (C) void * function(_GTrashStack * *)g_trash_stack_peek;
+extern (C) void * function(_GTrashStack * *)g_trash_stack_pop;
+extern (C) void function(_GTrashStack * *, void *)g_trash_stack_push;
+extern (C) uint function(uint)g_bit_storage;
+extern (C) int function(uint, int)g_bit_nth_msf;
+extern (C) int function(uint, int)g_bit_nth_lsf;
+extern (C) char * function(char *)g_find_program_in_path;
+extern (C) void function(_BCD_func__2331)g_atexit;
+extern (C) char * function(char *, char *)_g_getenv_nomalloc;
+extern (C) char * * function()g_listenv;
+extern (C) void function(char *)g_unsetenv;
+extern (C) int function(char *, char *, int)g_setenv;
+extern (C) char * function(char *)g_getenv;
+extern (C) void function(void * *)g_nullify_pointer;
+extern (C) char * function(char *)g_path_get_dirname;
+extern (C) char * function(char *)g_path_get_basename;
+extern (C) char * function()g_get_current_dir;
+extern (C) char * function(char *)g_basename;
+extern (C) char * function(char *)g_path_skip_root;
+extern (C) int function(char *)g_path_is_absolute;
+extern (C) int function(char *, uint, char *, char *)g_vsnprintf;
+extern (C) int function(char *, uint, char *, ...)g_snprintf;
+extern (C) uint function(char *, _GDebugKey *, uint)g_parse_debug_string;
+extern (C) char * function(int)g_get_user_special_dir;
+extern (C) char * * function()g_get_language_names;
+extern (C) char * * function()g_get_system_config_dirs;
+extern (C) char * * function()g_get_system_data_dirs;
+extern (C) char * function()g_get_user_cache_dir;
+extern (C) char * function()g_get_user_config_dir;
+extern (C) char * function()g_get_user_data_dir;
+extern (C) void function(char *)g_set_application_name;
+extern (C) char * function()g_get_application_name;
+extern (C) void function(char *)g_set_prgname;
+extern (C) char * function()g_get_prgname;
+extern (C) char * function()g_get_host_name;
+extern (C) char * function()g_get_tmp_dir;
+extern (C) char * function()g_get_home_dir;
+extern (C) char * function()g_get_real_name;
+extern (C) char * function()g_get_user_name;
+extern (C) void function(_GError * *)g_clear_error;
+extern (C) void function(_GError * *, _GError *)g_propagate_error;
+extern (C) void function(_GError * *, uint, int, char *, ...)g_set_error;
+extern (C) int function(_GError *, uint, int)g_error_matches;
+extern (C) _GError * function(_GError *)g_error_copy;
+extern (C) void function(_GError *)g_error_free;
+extern (C) _GError * function(uint, int, char *)g_error_new_literal;
+extern (C) _GError * function(uint, int, char *, ...)g_error_new;
+extern (C) char * function(char *)g_intern_static_string;
+extern (C) char * function(char *)g_intern_string;
+extern (C) char * function(uint)g_quark_to_string;
+extern (C) uint function(char *)g_quark_from_string;
+extern (C) uint function(char *)g_quark_from_static_string;
+extern (C) uint function(char *)g_quark_try_string;
+extern (C) void function(_GByteArray *, _BCD_func__2968, void *)g_byte_array_sort_with_data;
+extern (C) void function(_GByteArray *, _BCD_func__2969)g_byte_array_sort;
+extern (C) _GByteArray * function(_GByteArray *, uint, uint)g_byte_array_remove_range;
+extern (C) _GByteArray * function(_GByteArray *, uint)g_byte_array_remove_index_fast;
+extern (C) _GByteArray * function(_GByteArray *, uint)g_byte_array_remove_index;
+extern (C) _GByteArray * function(_GByteArray *, uint)g_byte_array_set_size;
+extern (C) _GByteArray * function(_GByteArray *, char *, uint)g_byte_array_prepend;
+extern (C) _GByteArray * function(_GByteArray *, char *, uint)g_byte_array_append;
+extern (C) char * function(_GByteArray *, int)g_byte_array_free;
+extern (C) _GByteArray * function(uint)g_byte_array_sized_new;
+extern (C) _GByteArray * function()g_byte_array_new;
+extern (C) void function(_GPtrArray *, _BCD_func__2422, void *)g_ptr_array_foreach;
+extern (C) void function(_GPtrArray *, _BCD_func__2968, void *)g_ptr_array_sort_with_data;
+extern (C) void function(_GPtrArray *, _BCD_func__2969)g_ptr_array_sort;
+extern (C) void function(_GPtrArray *, void *)g_ptr_array_add;
+extern (C) void function(_GPtrArray *, uint, uint)g_ptr_array_remove_range;
+extern (C) int function(_GPtrArray *, void *)g_ptr_array_remove_fast;
+extern (C) int function(_GPtrArray *, void *)g_ptr_array_remove;
+extern (C) void * function(_GPtrArray *, uint)g_ptr_array_remove_index_fast;
+extern (C) void * function(_GPtrArray *, uint)g_ptr_array_remove_index;
+extern (C) void function(_GPtrArray *, int)g_ptr_array_set_size;
+extern (C) void * * function(_GPtrArray *, int)g_ptr_array_free;
+extern (C) _GPtrArray * function(uint)g_ptr_array_sized_new;
+extern (C) _GPtrArray * function()g_ptr_array_new;
+extern (C) void function(_GArray *, _BCD_func__2968, void *)g_array_sort_with_data;
+extern (C) void function(_GArray *, _BCD_func__2969)g_array_sort;
+extern (C) _GArray * function(_GArray *, uint, uint)g_array_remove_range;
+extern (C) _GArray * function(_GArray *, uint)g_array_remove_index_fast;
+extern (C) _GArray * function(_GArray *, uint)g_array_remove_index;
+extern (C) _GArray * function(_GArray *, uint)g_array_set_size;
+extern (C) _GArray * function(_GArray *, uint, void *, uint)g_array_insert_vals;
+extern (C) _GArray * function(_GArray *, void *, uint)g_array_prepend_vals;
+extern (C) _GArray * function(_GArray *, void *, uint)g_array_append_vals;
+extern (C) char * function(_GArray *, int)g_array_free;
+extern (C) _GArray * function(int, int, uint, uint)g_array_sized_new;
+extern (C) _GArray * function(int, int, uint)g_array_new;
+
+
+Symbol[] symbols = [
+    { "g_value_set_string_take_ownership",  cast(void**)& g_value_set_string_take_ownership},
+    { "g_value_take_string",  cast(void**)& g_value_take_string},
+    { "g_strdup_value_contents",  cast(void**)& g_strdup_value_contents},
+    { "g_pointer_type_register_static",  cast(void**)& g_pointer_type_register_static},
+    { "g_value_get_gtype",  cast(void**)& g_value_get_gtype},
+    { "g_value_set_gtype",  cast(void**)& g_value_set_gtype},
+    { "g_gtype_get_type",  cast(void**)& g_gtype_get_type},
+    { "g_value_get_pointer",  cast(void**)& g_value_get_pointer},
+    { "g_value_set_pointer",  cast(void**)& g_value_set_pointer},
+    { "g_value_dup_string",  cast(void**)& g_value_dup_string},
+    { "g_value_get_string",  cast(void**)& g_value_get_string},
+    { "g_value_set_static_string",  cast(void**)& g_value_set_static_string},
+    { "g_value_set_string",  cast(void**)& g_value_set_string},
+    { "g_value_get_double",  cast(void**)& g_value_get_double},
+    { "g_value_set_double",  cast(void**)& g_value_set_double},
+    { "g_value_get_float",  cast(void**)& g_value_get_float},
+    { "g_value_set_float",  cast(void**)& g_value_set_float},
+    { "g_value_get_uint64",  cast(void**)& g_value_get_uint64},
+    { "g_value_set_uint64",  cast(void**)& g_value_set_uint64},
+    { "g_value_get_int64",  cast(void**)& g_value_get_int64},
+    { "g_value_set_int64",  cast(void**)& g_value_set_int64},
+    { "g_value_get_ulong",  cast(void**)& g_value_get_ulong},
+    { "g_value_set_ulong",  cast(void**)& g_value_set_ulong},
+    { "g_value_get_long",  cast(void**)& g_value_get_long},
+    { "g_value_set_long",  cast(void**)& g_value_set_long},
+    { "g_value_get_uint",  cast(void**)& g_value_get_uint},
+    { "g_value_set_uint",  cast(void**)& g_value_set_uint},
+    { "g_value_get_int",  cast(void**)& g_value_get_int},
+    { "g_value_set_int",  cast(void**)& g_value_set_int},
+    { "g_value_get_boolean",  cast(void**)& g_value_get_boolean},
+    { "g_value_set_boolean",  cast(void**)& g_value_set_boolean},
+    { "g_value_get_uchar",  cast(void**)& g_value_get_uchar},
+    { "g_value_set_uchar",  cast(void**)& g_value_set_uchar},
+    { "g_value_get_char",  cast(void**)& g_value_get_char},
+    { "g_value_set_char",  cast(void**)& g_value_set_char},
+    { "g_value_array_sort_with_data",  cast(void**)& g_value_array_sort_with_data},
+    { "g_value_array_sort",  cast(void**)& g_value_array_sort},
+    { "g_value_array_remove",  cast(void**)& g_value_array_remove},
+    { "g_value_array_insert",  cast(void**)& g_value_array_insert},
+    { "g_value_array_append",  cast(void**)& g_value_array_append},
+    { "g_value_array_prepend",  cast(void**)& g_value_array_prepend},
+    { "g_value_array_copy",  cast(void**)& g_value_array_copy},
+    { "g_value_array_free",  cast(void**)& g_value_array_free},
+    { "g_value_array_new",  cast(void**)& g_value_array_new},
+    { "g_value_array_get_nth",  cast(void**)& g_value_array_get_nth},
+    { "g_type_plugin_complete_interface_info",  cast(void**)& g_type_plugin_complete_interface_info},
+    { "g_type_plugin_complete_type_info",  cast(void**)& g_type_plugin_complete_type_info},
+    { "g_type_plugin_unuse",  cast(void**)& g_type_plugin_unuse},
+    { "g_type_plugin_use",  cast(void**)& g_type_plugin_use},
+    { "g_type_plugin_get_type",  cast(void**)& g_type_plugin_get_type},
+    { "g_type_module_register_flags",  cast(void**)& g_type_module_register_flags},
+    { "g_type_module_register_enum",  cast(void**)& g_type_module_register_enum},
+    { "g_type_module_add_interface",  cast(void**)& g_type_module_add_interface},
+    { "g_type_module_register_type",  cast(void**)& g_type_module_register_type},
+    { "g_type_module_set_name",  cast(void**)& g_type_module_set_name},
+    { "g_type_module_unuse",  cast(void**)& g_type_module_unuse},
+    { "g_type_module_use",  cast(void**)& g_type_module_use},
+    { "g_type_module_get_type",  cast(void**)& g_type_module_get_type},
+    { "g_io_condition_get_type",  cast(void**)& g_io_condition_get_type},
+    { "g_io_channel_get_type",  cast(void**)& g_io_channel_get_type},
+    { "g_source_set_closure",  cast(void**)& g_source_set_closure},
+    { "g_param_spec_types",  cast(void**)& g_param_spec_types},
+    { "g_param_spec_gtype",  cast(void**)& g_param_spec_gtype},
+    { "g_param_spec_override",  cast(void**)& g_param_spec_override},
+    { "g_param_spec_object",  cast(void**)& g_param_spec_object},
+    { "g_param_spec_value_array",  cast(void**)& g_param_spec_value_array},
+    { "g_param_spec_pointer",  cast(void**)& g_param_spec_pointer},
+    { "g_param_spec_boxed",  cast(void**)& g_param_spec_boxed},
+    { "g_param_spec_param",  cast(void**)& g_param_spec_param},
+    { "g_param_spec_string",  cast(void**)& g_param_spec_string},
+    { "g_param_spec_double",  cast(void**)& g_param_spec_double},
+    { "g_param_spec_float",  cast(void**)& g_param_spec_float},
+    { "g_param_spec_flags",  cast(void**)& g_param_spec_flags},
+    { "g_param_spec_enum",  cast(void**)& g_param_spec_enum},
+    { "g_param_spec_unichar",  cast(void**)& g_param_spec_unichar},
+    { "g_param_spec_uint64",  cast(void**)& g_param_spec_uint64},
+    { "g_param_spec_int64",  cast(void**)& g_param_spec_int64},
+    { "g_param_spec_ulong",  cast(void**)& g_param_spec_ulong},
+    { "g_param_spec_long",  cast(void**)& g_param_spec_long},
+    { "g_param_spec_uint",  cast(void**)& g_param_spec_uint},
+    { "g_param_spec_int",  cast(void**)& g_param_spec_int},
+    { "g_param_spec_boolean",  cast(void**)& g_param_spec_boolean},
+    { "g_param_spec_uchar",  cast(void**)& g_param_spec_uchar},
+    { "g_param_spec_char",  cast(void**)& g_param_spec_char},
+    { "g_object_compat_control",  cast(void**)& g_object_compat_control},
+    { "g_value_set_object_take_ownership",  cast(void**)& g_value_set_object_take_ownership},
+    { "g_value_take_object",  cast(void**)& g_value_take_object},
+    { "g_object_run_dispose",  cast(void**)& g_object_run_dispose},
+    { "g_object_force_floating",  cast(void**)& g_object_force_floating},
+    { "g_signal_connect_object",  cast(void**)& g_signal_connect_object},
+    { "g_value_dup_object",  cast(void**)& g_value_dup_object},
+    { "g_value_get_object",  cast(void**)& g_value_get_object},
+    { "g_value_set_object",  cast(void**)& g_value_set_object},
+    { "g_closure_new_object",  cast(void**)& g_closure_new_object},
+    { "g_cclosure_new_object_swap",  cast(void**)& g_cclosure_new_object_swap},
+    { "g_cclosure_new_object",  cast(void**)& g_cclosure_new_object},
+    { "g_object_watch_closure",  cast(void**)& g_object_watch_closure},
+    { "g_object_steal_data",  cast(void**)& g_object_steal_data},
+    { "g_object_set_data_full",  cast(void**)& g_object_set_data_full},
+    { "g_object_set_data",  cast(void**)& g_object_set_data},
+    { "g_object_get_data",  cast(void**)& g_object_get_data},
+    { "g_object_steal_qdata",  cast(void**)& g_object_steal_qdata},
+    { "g_object_set_qdata_full",  cast(void**)& g_object_set_qdata_full},
+    { "g_object_set_qdata",  cast(void**)& g_object_set_qdata},
+    { "g_object_get_qdata",  cast(void**)& g_object_get_qdata},
+    { "g_object_remove_toggle_ref",  cast(void**)& g_object_remove_toggle_ref},
+    { "g_object_add_toggle_ref",  cast(void**)& g_object_add_toggle_ref},
+    { "g_object_remove_weak_pointer",  cast(void**)& g_object_remove_weak_pointer},
+    { "g_object_add_weak_pointer",  cast(void**)& g_object_add_weak_pointer},
+    { "g_object_weak_unref",  cast(void**)& g_object_weak_unref},
+    { "g_object_weak_ref",  cast(void**)& g_object_weak_ref},
+    { "g_object_unref",  cast(void**)& g_object_unref},
+    { "g_object_ref",  cast(void**)& g_object_ref},
+    { "g_object_ref_sink",  cast(void**)& g_object_ref_sink},
+    { "g_object_is_floating",  cast(void**)& g_object_is_floating},
+    { "g_object_thaw_notify",  cast(void**)& g_object_thaw_notify},
+    { "g_object_notify",  cast(void**)& g_object_notify},
+    { "g_object_freeze_notify",  cast(void**)& g_object_freeze_notify},
+    { "g_object_get_property",  cast(void**)& g_object_get_property},
+    { "g_object_set_property",  cast(void**)& g_object_set_property},
+    { "g_object_get_valist",  cast(void**)& g_object_get_valist},
+    { "g_object_set_valist",  cast(void**)& g_object_set_valist},
+    { "g_object_disconnect",  cast(void**)& g_object_disconnect},
+    { "g_object_connect",  cast(void**)& g_object_connect},
+    { "g_object_get",  cast(void**)& g_object_get},
+    { "g_object_set",  cast(void**)& g_object_set},
+    { "g_object_new_valist",  cast(void**)& g_object_new_valist},
+    { "g_object_newv",  cast(void**)& g_object_newv},
+    { "g_object_new",  cast(void**)& g_object_new},
+    { "g_object_interface_list_properties",  cast(void**)& g_object_interface_list_properties},
+    { "g_object_interface_find_property",  cast(void**)& g_object_interface_find_property},
+    { "g_object_interface_install_property",  cast(void**)& g_object_interface_install_property},
+    { "g_object_class_override_property",  cast(void**)& g_object_class_override_property},
+    { "g_object_class_list_properties",  cast(void**)& g_object_class_list_properties},
+    { "g_object_class_find_property",  cast(void**)& g_object_class_find_property},
+    { "g_object_class_install_property",  cast(void**)& g_object_class_install_property},
+    { "g_initially_unowned_get_type",  cast(void**)& g_initially_unowned_get_type},
+    { "_g_signals_destroy",  cast(void**)& _g_signals_destroy},
+    { "g_signal_handlers_destroy",  cast(void**)& g_signal_handlers_destroy},
+    { "g_signal_accumulator_true_handled",  cast(void**)& g_signal_accumulator_true_handled},
+    { "g_signal_chain_from_overridden",  cast(void**)& g_signal_chain_from_overridden},
+    { "g_signal_override_class_closure",  cast(void**)& g_signal_override_class_closure},
+    { "g_signal_handlers_disconnect_matched",  cast(void**)& g_signal_handlers_disconnect_matched},
+    { "g_signal_handlers_unblock_matched",  cast(void**)& g_signal_handlers_unblock_matched},
+    { "g_signal_handlers_block_matched",  cast(void**)& g_signal_handlers_block_matched},
+    { "g_signal_handler_find",  cast(void**)& g_signal_handler_find},
+    { "g_signal_handler_is_connected",  cast(void**)& g_signal_handler_is_connected},
+    { "g_signal_handler_disconnect",  cast(void**)& g_signal_handler_disconnect},
+    { "g_signal_handler_unblock",  cast(void**)& g_signal_handler_unblock},
+    { "g_signal_handler_block",  cast(void**)& g_signal_handler_block},
+    { "g_signal_connect_data",  cast(void**)& g_signal_connect_data},
+    { "g_signal_connect_closure",  cast(void**)& g_signal_connect_closure},
+    { "g_signal_connect_closure_by_id",  cast(void**)& g_signal_connect_closure_by_id},
+    { "g_signal_has_handler_pending",  cast(void**)& g_signal_has_handler_pending},
+    { "g_signal_remove_emission_hook",  cast(void**)& g_signal_remove_emission_hook},
+    { "g_signal_add_emission_hook",  cast(void**)& g_signal_add_emission_hook},
+    { "g_signal_stop_emission_by_name",  cast(void**)& g_signal_stop_emission_by_name},
+    { "g_signal_stop_emission",  cast(void**)& g_signal_stop_emission},
+    { "g_signal_get_invocation_hint",  cast(void**)& g_signal_get_invocation_hint},
+    { "g_signal_parse_name",  cast(void**)& g_signal_parse_name},
+    { "g_signal_list_ids",  cast(void**)& g_signal_list_ids},
+    { "g_signal_query",  cast(void**)& g_signal_query},
+    { "g_signal_name",  cast(void**)& g_signal_name},
+    { "g_signal_lookup",  cast(void**)& g_signal_lookup},
+    { "g_signal_emit_by_name",  cast(void**)& g_signal_emit_by_name},
+    { "g_signal_emit",  cast(void**)& g_signal_emit},
+    { "g_signal_emit_valist",  cast(void**)& g_signal_emit_valist},
+    { "g_signal_emitv",  cast(void**)& g_signal_emitv},
+    { "g_signal_new",  cast(void**)& g_signal_new},
+    { "g_signal_new_valist",  cast(void**)& g_signal_new_valist},
+    { "g_signal_newv",  cast(void**)& g_signal_newv},
+    { "g_cclosure_marshal_STRING__OBJECT_POINTER",  cast(void**)& g_cclosure_marshal_STRING__OBJECT_POINTER},
+    { "g_cclosure_marshal_BOOLEAN__FLAGS",  cast(void**)& g_cclosure_marshal_BOOLEAN__FLAGS},
+    { "g_cclosure_marshal_VOID__UINT_POINTER",  cast(void**)& g_cclosure_marshal_VOID__UINT_POINTER},
+    { "g_cclosure_marshal_VOID__OBJECT",  cast(void**)& g_cclosure_marshal_VOID__OBJECT},
+    { "g_cclosure_marshal_VOID__POINTER",  cast(void**)& g_cclosure_marshal_VOID__POINTER},
+    { "g_cclosure_marshal_VOID__BOXED",  cast(void**)& g_cclosure_marshal_VOID__BOXED},
+    { "g_cclosure_marshal_VOID__PARAM",  cast(void**)& g_cclosure_marshal_VOID__PARAM},
+    { "g_cclosure_marshal_VOID__STRING",  cast(void**)& g_cclosure_marshal_VOID__STRING},
+    { "g_cclosure_marshal_VOID__DOUBLE",  cast(void**)& g_cclosure_marshal_VOID__DOUBLE},
+    { "g_cclosure_marshal_VOID__FLOAT",  cast(void**)& g_cclosure_marshal_VOID__FLOAT},
+    { "g_cclosure_marshal_VOID__FLAGS",  cast(void**)& g_cclosure_marshal_VOID__FLAGS},
+    { "g_cclosure_marshal_VOID__ENUM",  cast(void**)& g_cclosure_marshal_VOID__ENUM},
+    { "g_cclosure_marshal_VOID__ULONG",  cast(void**)& g_cclosure_marshal_VOID__ULONG},
+    { "g_cclosure_marshal_VOID__LONG",  cast(void**)& g_cclosure_marshal_VOID__LONG},
+    { "g_cclosure_marshal_VOID__UINT",  cast(void**)& g_cclosure_marshal_VOID__UINT},
+    { "g_cclosure_marshal_VOID__INT",  cast(void**)& g_cclosure_marshal_VOID__INT},
+    { "g_cclosure_marshal_VOID__UCHAR",  cast(void**)& g_cclosure_marshal_VOID__UCHAR},
+    { "g_cclosure_marshal_VOID__CHAR",  cast(void**)& g_cclosure_marshal_VOID__CHAR},
+    { "g_cclosure_marshal_VOID__BOOLEAN",  cast(void**)& g_cclosure_marshal_VOID__BOOLEAN},
+    { "g_cclosure_marshal_VOID__VOID",  cast(void**)& g_cclosure_marshal_VOID__VOID},
+    { "g_closure_invoke",  cast(void**)& g_closure_invoke},
+    { "g_closure_invalidate",  cast(void**)& g_closure_invalidate},
+    { "g_closure_set_meta_marshal",  cast(void**)& g_closure_set_meta_marshal},
+    { "g_closure_set_marshal",  cast(void**)& g_closure_set_marshal},
+    { "g_closure_add_marshal_guards",  cast(void**)& g_closure_add_marshal_guards},
+    { "g_closure_remove_invalidate_notifier",  cast(void**)& g_closure_remove_invalidate_notifier},
+    { "g_closure_add_invalidate_notifier",  cast(void**)& g_closure_add_invalidate_notifier},
+    { "g_closure_remove_finalize_notifier",  cast(void**)& g_closure_remove_finalize_notifier},
+    { "g_closure_add_finalize_notifier",  cast(void**)& g_closure_add_finalize_notifier},
+    { "g_closure_new_simple",  cast(void**)& g_closure_new_simple},
+    { "g_closure_unref",  cast(void**)& g_closure_unref},
+    { "g_closure_sink",  cast(void**)& g_closure_sink},
+    { "g_closure_ref",  cast(void**)& g_closure_ref},
+    { "g_signal_type_cclosure_new",  cast(void**)& g_signal_type_cclosure_new},
+    { "g_cclosure_new_swap",  cast(void**)& g_cclosure_new_swap},
+    { "g_cclosure_new",  cast(void**)& g_cclosure_new},
+    { "g_param_spec_pool_list",  cast(void**)& g_param_spec_pool_list},
+    { "g_param_spec_pool_list_owned",  cast(void**)& g_param_spec_pool_list_owned},
+    { "g_param_spec_pool_lookup",  cast(void**)& g_param_spec_pool_lookup},
+    { "g_param_spec_pool_remove",  cast(void**)& g_param_spec_pool_remove},
+    { "g_param_spec_pool_insert",  cast(void**)& g_param_spec_pool_insert},
+    { "g_param_spec_pool_new",  cast(void**)& g_param_spec_pool_new},
+    { "g_param_spec_internal",  cast(void**)& g_param_spec_internal},
+    { "_g_param_type_register_static_constant",  cast(void**)& _g_param_type_register_static_constant},
+    { "g_param_type_register_static",  cast(void**)& g_param_type_register_static},
+    { "g_value_set_param_take_ownership",  cast(void**)& g_value_set_param_take_ownership},
+    { "g_value_take_param",  cast(void**)& g_value_take_param},
+    { "g_value_dup_param",  cast(void**)& g_value_dup_param},
+    { "g_value_get_param",  cast(void**)& g_value_get_param},
+    { "g_value_set_param",  cast(void**)& g_value_set_param},
+    { "g_param_spec_get_blurb",  cast(void**)& g_param_spec_get_blurb},
+    { "g_param_spec_get_nick",  cast(void**)& g_param_spec_get_nick},
+    { "g_param_spec_get_name",  cast(void**)& g_param_spec_get_name},
+    { "g_param_values_cmp",  cast(void**)& g_param_values_cmp},
+    { "g_param_value_convert",  cast(void**)& g_param_value_convert},
+    { "g_param_value_validate",  cast(void**)& g_param_value_validate},
+    { "g_param_value_defaults",  cast(void**)& g_param_value_defaults},
+    { "g_param_value_set_default",  cast(void**)& g_param_value_set_default},
+    { "g_param_spec_get_redirect_target",  cast(void**)& g_param_spec_get_redirect_target},
+    { "g_param_spec_steal_qdata",  cast(void**)& g_param_spec_steal_qdata},
+    { "g_param_spec_set_qdata_full",  cast(void**)& g_param_spec_set_qdata_full},
+    { "g_param_spec_set_qdata",  cast(void**)& g_param_spec_set_qdata},
+    { "g_param_spec_get_qdata",  cast(void**)& g_param_spec_get_qdata},
+    { "g_param_spec_ref_sink",  cast(void**)& g_param_spec_ref_sink},
+    { "g_param_spec_sink",  cast(void**)& g_param_spec_sink},
+    { "g_param_spec_unref",  cast(void**)& g_param_spec_unref},
+    { "g_param_spec_ref",  cast(void**)& g_param_spec_ref},
+    { "g_value_register_transform_func",  cast(void**)& g_value_register_transform_func},
+    { "g_value_transform",  cast(void**)& g_value_transform},
+    { "g_value_type_transformable",  cast(void**)& g_value_type_transformable},
+    { "g_value_type_compatible",  cast(void**)& g_value_type_compatible},
+    { "g_value_peek_pointer",  cast(void**)& g_value_peek_pointer},
+    { "g_value_fits_pointer",  cast(void**)& g_value_fits_pointer},
+    { "g_value_set_instance",  cast(void**)& g_value_set_instance},
+    { "g_value_unset",  cast(void**)& g_value_unset},
+    { "g_value_reset",  cast(void**)& g_value_reset},
+    { "g_value_copy",  cast(void**)& g_value_copy},
+    { "g_value_init",  cast(void**)& g_value_init},
+    { "g_flags_complete_type_info",  cast(void**)& g_flags_complete_type_info},
+    { "g_enum_complete_type_info",  cast(void**)& g_enum_complete_type_info},
+    { "g_flags_register_static",  cast(void**)& g_flags_register_static},
+    { "g_enum_register_static",  cast(void**)& g_enum_register_static},
+    { "g_value_get_flags",  cast(void**)& g_value_get_flags},
+    { "g_value_set_flags",  cast(void**)& g_value_set_flags},
+    { "g_value_get_enum",  cast(void**)& g_value_get_enum},
+    { "g_value_set_enum",  cast(void**)& g_value_set_enum},
+    { "g_flags_get_value_by_nick",  cast(void**)& g_flags_get_value_by_nick},
+    { "g_flags_get_value_by_name",  cast(void**)& g_flags_get_value_by_name},
+    { "g_flags_get_first_value",  cast(void**)& g_flags_get_first_value},
+    { "g_enum_get_value_by_nick",  cast(void**)& g_enum_get_value_by_nick},
+    { "g_enum_get_value_by_name",  cast(void**)& g_enum_get_value_by_name},
+    { "g_enum_get_value",  cast(void**)& g_enum_get_value},
+    { "g_regex_get_type",  cast(void**)& g_regex_get_type},
+    { "g_hash_table_get_type",  cast(void**)& g_hash_table_get_type},
+    { "g_gstring_get_type",  cast(void**)& g_gstring_get_type},
+    { "g_strv_get_type",  cast(void**)& g_strv_get_type},
+    { "g_date_get_type",  cast(void**)& g_date_get_type},
+    { "g_value_array_get_type",  cast(void**)& g_value_array_get_type},
+    { "g_value_get_type",  cast(void**)& g_value_get_type},
+    { "g_closure_get_type",  cast(void**)& g_closure_get_type},
+    { "g_value_set_boxed_take_ownership",  cast(void**)& g_value_set_boxed_take_ownership},
+    { "g_value_take_boxed",  cast(void**)& g_value_take_boxed},
+    { "g_boxed_type_register_static",  cast(void**)& g_boxed_type_register_static},
+    { "g_value_dup_boxed",  cast(void**)& g_value_dup_boxed},
+    { "g_value_get_boxed",  cast(void**)& g_value_get_boxed},
+    { "g_value_set_static_boxed",  cast(void**)& g_value_set_static_boxed},
+    { "g_value_set_boxed",  cast(void**)& g_value_set_boxed},
+    { "g_boxed_free",  cast(void**)& g_boxed_free},
+    { "g_boxed_copy",  cast(void**)& g_boxed_copy},
+    { "_g_type_debug_flags",  cast(void**)& _g_type_debug_flags},
+    { "g_signal_init",  cast(void**)& g_signal_init},
+    { "g_value_transforms_init",  cast(void**)& g_value_transforms_init},
+    { "g_param_spec_types_init",  cast(void**)& g_param_spec_types_init},
+    { "g_object_type_init",  cast(void**)& g_object_type_init},
+    { "g_boxed_type_init",  cast(void**)& g_boxed_type_init},
+    { "g_param_type_init",  cast(void**)& g_param_type_init},
+    { "g_enum_types_init",  cast(void**)& g_enum_types_init},
+    { "g_value_types_init",  cast(void**)& g_value_types_init},
+    { "g_value_c_init",  cast(void**)& g_value_c_init},
+    { "g_type_name_from_class",  cast(void**)& g_type_name_from_class},
+    { "g_type_name_from_instance",  cast(void**)& g_type_name_from_instance},
+    { "g_type_test_flags",  cast(void**)& g_type_test_flags},
+    { "g_type_check_value_holds",  cast(void**)& g_type_check_value_holds},
+    { "g_type_check_value",  cast(void**)& g_type_check_value},
+    { "g_type_check_is_value_type",  cast(void**)& g_type_check_is_value_type},
+    { "g_type_check_class_is_a",  cast(void**)& g_type_check_class_is_a},
+    { "g_type_check_class_cast",  cast(void**)& g_type_check_class_cast},
+    { "g_type_check_instance_is_a",  cast(void**)& g_type_check_instance_is_a},
+    { "g_type_check_instance_cast",  cast(void**)& g_type_check_instance_cast},
+    { "g_type_check_instance",  cast(void**)& g_type_check_instance},
+    { "g_type_value_table_peek",  cast(void**)& g_type_value_table_peek},
+    { "g_type_remove_interface_check",  cast(void**)& g_type_remove_interface_check},
+    { "g_type_add_interface_check",  cast(void**)& g_type_add_interface_check},
+    { "g_type_class_unref_uncached",  cast(void**)& g_type_class_unref_uncached},
+    { "g_type_remove_class_cache_func",  cast(void**)& g_type_remove_class_cache_func},
+    { "g_type_add_class_cache_func",  cast(void**)& g_type_add_class_cache_func},
+    { "g_type_free_instance",  cast(void**)& g_type_free_instance},
+    { "g_type_create_instance",  cast(void**)& g_type_create_instance},
+    { "g_type_fundamental",  cast(void**)& g_type_fundamental},
+    { "g_type_fundamental_next",  cast(void**)& g_type_fundamental_next},
+    { "g_type_interface_get_plugin",  cast(void**)& g_type_interface_get_plugin},
+    { "g_type_get_plugin",  cast(void**)& g_type_get_plugin},
+    { "g_type_instance_get_private",  cast(void**)& g_type_instance_get_private},
+    { "g_type_class_add_private",  cast(void**)& g_type_class_add_private},
+    { "g_type_interface_prerequisites",  cast(void**)& g_type_interface_prerequisites},
+    { "g_type_interface_add_prerequisite",  cast(void**)& g_type_interface_add_prerequisite},
+    { "g_type_add_interface_dynamic",  cast(void**)& g_type_add_interface_dynamic},
+    { "g_type_add_interface_static",  cast(void**)& g_type_add_interface_static},
+    { "g_type_register_fundamental",  cast(void**)& g_type_register_fundamental},
+    { "g_type_register_dynamic",  cast(void**)& g_type_register_dynamic},
+    { "g_type_register_static_simple",  cast(void**)& g_type_register_static_simple},
+    { "g_type_register_static",  cast(void**)& g_type_register_static},
+    { "g_type_query",  cast(void**)& g_type_query},
+    { "g_type_get_qdata",  cast(void**)& g_type_get_qdata},
+    { "g_type_set_qdata",  cast(void**)& g_type_set_qdata},
+    { "g_type_interfaces",  cast(void**)& g_type_interfaces},
+    { "g_type_children",  cast(void**)& g_type_children},
+    { "g_type_default_interface_unref",  cast(void**)& g_type_default_interface_unref},
+    { "g_type_default_interface_peek",  cast(void**)& g_type_default_interface_peek},
+    { "g_type_default_interface_ref",  cast(void**)& g_type_default_interface_ref},
+    { "g_type_interface_peek_parent",  cast(void**)& g_type_interface_peek_parent},
+    { "g_type_interface_peek",  cast(void**)& g_type_interface_peek},
+    { "g_type_class_peek_parent",  cast(void**)& g_type_class_peek_parent},
+    { "g_type_class_unref",  cast(void**)& g_type_class_unref},
+    { "g_type_class_peek_static",  cast(void**)& g_type_class_peek_static},
+    { "g_type_class_peek",  cast(void**)& g_type_class_peek},
+    { "g_type_class_ref",  cast(void**)& g_type_class_ref},
+    { "g_type_is_a",  cast(void**)& g_type_is_a},
+    { "g_type_next_base",  cast(void**)& g_type_next_base},
+    { "g_type_depth",  cast(void**)& g_type_depth},
+    { "g_type_parent",  cast(void**)& g_type_parent},
+    { "g_type_from_name",  cast(void**)& g_type_from_name},
+    { "g_type_qname",  cast(void**)& g_type_qname},
+    { "g_type_name",  cast(void**)& g_type_name},
+    { "g_type_init_with_debug_flags",  cast(void**)& g_type_init_with_debug_flags},
+    { "g_type_init",  cast(void**)& g_type_init},
+    { "g_tree_nnodes",  cast(void**)& g_tree_nnodes},
+    { "g_tree_height",  cast(void**)& g_tree_height},
+    { "g_tree_search",  cast(void**)& g_tree_search},
+    { "g_tree_traverse",  cast(void**)& g_tree_traverse},
+    { "g_tree_foreach",  cast(void**)& g_tree_foreach},
+    { "g_tree_lookup_extended",  cast(void**)& g_tree_lookup_extended},
+    { "g_tree_lookup",  cast(void**)& g_tree_lookup},
+    { "g_tree_steal",  cast(void**)& g_tree_steal},
+    { "g_tree_remove",  cast(void**)& g_tree_remove},
+    { "g_tree_replace",  cast(void**)& g_tree_replace},
+    { "g_tree_insert",  cast(void**)& g_tree_insert},
+    { "g_tree_destroy",  cast(void**)& g_tree_destroy},
+    { "g_tree_new_full",  cast(void**)& g_tree_new_full},
+    { "g_tree_new_with_data",  cast(void**)& g_tree_new_with_data},
+    { "g_tree_new",  cast(void**)& g_tree_new},
+    { "g_time_val_to_iso8601",  cast(void**)& g_time_val_to_iso8601},
+    { "g_time_val_from_iso8601",  cast(void**)& g_time_val_from_iso8601},
+    { "g_time_val_add",  cast(void**)& g_time_val_add},
+    { "g_usleep",  cast(void**)& g_usleep},
+    { "g_timer_elapsed",  cast(void**)& g_timer_elapsed},
+    { "g_timer_continue",  cast(void**)& g_timer_continue},
+    { "g_timer_reset",  cast(void**)& g_timer_reset},
+    { "g_timer_stop",  cast(void**)& g_timer_stop},
+    { "g_timer_start",  cast(void**)& g_timer_start},
+    { "g_timer_destroy",  cast(void**)& g_timer_destroy},
+    { "g_timer_new",  cast(void**)& g_timer_new},
+    { "g_thread_pool_get_max_idle_time",  cast(void**)& g_thread_pool_get_max_idle_time},
+    { "g_thread_pool_set_max_idle_time",  cast(void**)& g_thread_pool_set_max_idle_time},
+    { "g_thread_pool_set_sort_function",  cast(void**)& g_thread_pool_set_sort_function},
+    { "g_thread_pool_stop_unused_threads",  cast(void**)& g_thread_pool_stop_unused_threads},
+    { "g_thread_pool_get_num_unused_threads",  cast(void**)& g_thread_pool_get_num_unused_threads},
+    { "g_thread_pool_get_max_unused_threads",  cast(void**)& g_thread_pool_get_max_unused_threads},
+    { "g_thread_pool_set_max_unused_threads",  cast(void**)& g_thread_pool_set_max_unused_threads},
+    { "g_thread_pool_free",  cast(void**)& g_thread_pool_free},
+    { "g_thread_pool_unprocessed",  cast(void**)& g_thread_pool_unprocessed},
+    { "g_thread_pool_get_num_threads",  cast(void**)& g_thread_pool_get_num_threads},
+    { "g_thread_pool_get_max_threads",  cast(void**)& g_thread_pool_get_max_threads},
+    { "g_thread_pool_set_max_threads",  cast(void**)& g_thread_pool_set_max_threads},
+    { "g_thread_pool_push",  cast(void**)& g_thread_pool_push},
+    { "g_thread_pool_new",  cast(void**)& g_thread_pool_new},
+    { "g_strip_context",  cast(void**)& g_strip_context},
+    { "g_stpcpy",  cast(void**)& g_stpcpy},
+    { "g_strv_length",  cast(void**)& g_strv_length},
+    { "g_strdupv",  cast(void**)& g_strdupv},
+    { "g_strfreev",  cast(void**)& g_strfreev},
+    { "g_strjoinv",  cast(void**)& g_strjoinv},
+    { "g_strsplit_set",  cast(void**)& g_strsplit_set},
+    { "g_strsplit",  cast(void**)& g_strsplit},
+    { "g_memdup",  cast(void**)& g_memdup},
+    { "g_strescape",  cast(void**)& g_strescape},
+    { "g_strcompress",  cast(void**)& g_strcompress},
+    { "g_strjoin",  cast(void**)& g_strjoin},
+    { "g_strconcat",  cast(void**)& g_strconcat},
+    { "g_strnfill",  cast(void**)& g_strnfill},
+    { "g_strndup",  cast(void**)& g_strndup},
+    { "g_strdup_vprintf",  cast(void**)& g_strdup_vprintf},
+    { "g_strdup_printf",  cast(void**)& g_strdup_printf},
+    { "g_strdup",  cast(void**)& g_strdup},
+    { "g_strup",  cast(void**)& g_strup},
+    { "g_strdown",  cast(void**)& g_strdown},
+    { "g_strncasecmp",  cast(void**)& g_strncasecmp},
+    { "g_strcasecmp",  cast(void**)& g_strcasecmp},
+    { "g_ascii_strup",  cast(void**)& g_ascii_strup},
+    { "g_ascii_strdown",  cast(void**)& g_ascii_strdown},
+    { "g_ascii_strncasecmp",  cast(void**)& g_ascii_strncasecmp},
+    { "g_ascii_strcasecmp",  cast(void**)& g_ascii_strcasecmp},
+    { "g_strchomp",  cast(void**)& g_strchomp},
+    { "g_strchug",  cast(void**)& g_strchug},
+    { "g_ascii_formatd",  cast(void**)& g_ascii_formatd},
+    { "g_ascii_dtostr",  cast(void**)& g_ascii_dtostr},
+    { "g_ascii_strtoll",  cast(void**)& g_ascii_strtoll},
+    { "g_ascii_strtoull",  cast(void**)& g_ascii_strtoull},
+    { "g_ascii_strtod",  cast(void**)& g_ascii_strtod},
+    { "g_strtod",  cast(void**)& g_strtod},
+    { "g_str_has_prefix",  cast(void**)& g_str_has_prefix},
+    { "g_str_has_suffix",  cast(void**)& g_str_has_suffix},
+    { "g_strrstr_len",  cast(void**)& g_strrstr_len},
+    { "g_strrstr",  cast(void**)& g_strrstr},
+    { "g_strstr_len",  cast(void**)& g_strstr_len},
+    { "g_strlcat",  cast(void**)& g_strlcat},
+    { "g_strlcpy",  cast(void**)& g_strlcpy},
+    { "g_strreverse",  cast(void**)& g_strreverse},
+    { "g_strsignal",  cast(void**)& g_strsignal},
+    { "g_strerror",  cast(void**)& g_strerror},
+    { "g_strcanon",  cast(void**)& g_strcanon},
+    { "g_strdelimit",  cast(void**)& g_strdelimit},
+    { "g_ascii_xdigit_value",  cast(void**)& g_ascii_xdigit_value},
+    { "g_ascii_digit_value",  cast(void**)& g_ascii_digit_value},
+    { "g_ascii_toupper",  cast(void**)& g_ascii_toupper},
+    { "g_ascii_tolower",  cast(void**)& g_ascii_tolower},
+    { "g_ascii_table",  cast(void**)& g_ascii_table},
+    { "g_spawn_close_pid",  cast(void**)& g_spawn_close_pid},
+    { "g_spawn_command_line_async",  cast(void**)& g_spawn_command_line_async},
+    { "g_spawn_command_line_sync",  cast(void**)& g_spawn_command_line_sync},
+    { "g_spawn_sync",  cast(void**)& g_spawn_sync},
+    { "g_spawn_async_with_pipes",  cast(void**)& g_spawn_async_with_pipes},
+    { "g_spawn_async",  cast(void**)& g_spawn_async},
+    { "g_spawn_error_quark",  cast(void**)& g_spawn_error_quark},
+    { "g_shell_parse_argv",  cast(void**)& g_shell_parse_argv},
+    { "g_shell_unquote",  cast(void**)& g_shell_unquote},
+    { "g_shell_quote",  cast(void**)& g_shell_quote},
+    { "g_shell_error_quark",  cast(void**)& g_shell_error_quark},
+    { "g_sequence_range_get_midpoint",  cast(void**)& g_sequence_range_get_midpoint},
+    { "g_sequence_iter_compare",  cast(void**)& g_sequence_iter_compare},
+    { "g_sequence_iter_get_sequence",  cast(void**)& g_sequence_iter_get_sequence},
+    { "g_sequence_iter_move",  cast(void**)& g_sequence_iter_move},
+    { "g_sequence_iter_get_position",  cast(void**)& g_sequence_iter_get_position},
+    { "g_sequence_iter_prev",  cast(void**)& g_sequence_iter_prev},
+    { "g_sequence_iter_next",  cast(void**)& g_sequence_iter_next},
+    { "g_sequence_iter_is_end",  cast(void**)& g_sequence_iter_is_end},
+    { "g_sequence_iter_is_begin",  cast(void**)& g_sequence_iter_is_begin},
+    { "g_sequence_set",  cast(void**)& g_sequence_set},
+    { "g_sequence_get",  cast(void**)& g_sequence_get},
+    { "g_sequence_search_iter",  cast(void**)& g_sequence_search_iter},
+    { "g_sequence_search",  cast(void**)& g_sequence_search},
+    { "g_sequence_move_range",  cast(void**)& g_sequence_move_range},
+    { "g_sequence_remove_range",  cast(void**)& g_sequence_remove_range},
+    { "g_sequence_remove",  cast(void**)& g_sequence_remove},
+    { "g_sequence_sort_changed_iter",  cast(void**)& g_sequence_sort_changed_iter},
+    { "g_sequence_sort_changed",  cast(void**)& g_sequence_sort_changed},
+    { "g_sequence_insert_sorted_iter",  cast(void**)& g_sequence_insert_sorted_iter},
+    { "g_sequence_insert_sorted",  cast(void**)& g_sequence_insert_sorted},
+    { "g_sequence_swap",  cast(void**)& g_sequence_swap},
+    { "g_sequence_move",  cast(void**)& g_sequence_move},
+    { "g_sequence_insert_before",  cast(void**)& g_sequence_insert_before},
+    { "g_sequence_prepend",  cast(void**)& g_sequence_prepend},
+    { "g_sequence_append",  cast(void**)& g_sequence_append},
+    { "g_sequence_get_iter_at_pos",  cast(void**)& g_sequence_get_iter_at_pos},
+    { "g_sequence_get_end_iter",  cast(void**)& g_sequence_get_end_iter},
+    { "g_sequence_get_begin_iter",  cast(void**)& g_sequence_get_begin_iter},
+    { "g_sequence_sort_iter",  cast(void**)& g_sequence_sort_iter},
+    { "g_sequence_sort",  cast(void**)& g_sequence_sort},
+    { "g_sequence_foreach_range",  cast(void**)& g_sequence_foreach_range},
+    { "g_sequence_foreach",  cast(void**)& g_sequence_foreach},
+    { "g_sequence_get_length",  cast(void**)& g_sequence_get_length},
+    { "g_sequence_free",  cast(void**)& g_sequence_free},
+    { "g_sequence_new",  cast(void**)& g_sequence_new},
+    { "g_scanner_warn",  cast(void**)& g_scanner_warn},
+    { "g_scanner_error",  cast(void**)& g_scanner_error},
+    { "g_scanner_unexp_token",  cast(void**)& g_scanner_unexp_token},
+    { "g_scanner_lookup_symbol",  cast(void**)& g_scanner_lookup_symbol},
+    { "g_scanner_scope_foreach_symbol",  cast(void**)& g_scanner_scope_foreach_symbol},
+    { "g_scanner_scope_lookup_symbol",  cast(void**)& g_scanner_scope_lookup_symbol},
+    { "g_scanner_scope_remove_symbol",  cast(void**)& g_scanner_scope_remove_symbol},
+    { "g_scanner_scope_add_symbol",  cast(void**)& g_scanner_scope_add_symbol},
+    { "g_scanner_set_scope",  cast(void**)& g_scanner_set_scope},
+    { "g_scanner_eof",  cast(void**)& g_scanner_eof},
+    { "g_scanner_cur_position",  cast(void**)& g_scanner_cur_position},
+    { "g_scanner_cur_line",  cast(void**)& g_scanner_cur_line},
+    { "g_scanner_cur_value",  cast(void**)& g_scanner_cur_value},
+    { "g_scanner_cur_token",  cast(void**)& g_scanner_cur_token},
+    { "g_scanner_peek_next_token",  cast(void**)& g_scanner_peek_next_token},
+    { "g_scanner_get_next_token",  cast(void**)& g_scanner_get_next_token},
+    { "g_scanner_input_text",  cast(void**)& g_scanner_input_text},
+    { "g_scanner_sync_file_offset",  cast(void**)& g_scanner_sync_file_offset},
+    { "g_scanner_input_file",  cast(void**)& g_scanner_input_file},
+    { "g_scanner_destroy",  cast(void**)& g_scanner_destroy},
+    { "g_scanner_new",  cast(void**)& g_scanner_new},
+    { "g_match_info_fetch_all",  cast(void**)& g_match_info_fetch_all},
+    { "g_match_info_fetch_named_pos",  cast(void**)& g_match_info_fetch_named_pos},
+    { "g_match_info_fetch_named",  cast(void**)& g_match_info_fetch_named},
+    { "g_match_info_fetch_pos",  cast(void**)& g_match_info_fetch_pos},
+    { "g_match_info_fetch",  cast(void**)& g_match_info_fetch},
+    { "g_match_info_expand_references",  cast(void**)& g_match_info_expand_references},
+    { "g_match_info_is_partial_match",  cast(void**)& g_match_info_is_partial_match},
+    { "g_match_info_get_match_count",  cast(void**)& g_match_info_get_match_count},
+    { "g_match_info_matches",  cast(void**)& g_match_info_matches},
+    { "g_match_info_next",  cast(void**)& g_match_info_next},
+    { "g_match_info_free",  cast(void**)& g_match_info_free},
+    { "g_match_info_get_string",  cast(void**)& g_match_info_get_string},
+    { "g_match_info_get_regex",  cast(void**)& g_match_info_get_regex},
+    { "g_regex_check_replacement",  cast(void**)& g_regex_check_replacement},
+    { "g_regex_replace_eval",  cast(void**)& g_regex_replace_eval},
+    { "g_regex_replace_literal",  cast(void**)& g_regex_replace_literal},
+    { "g_regex_replace",  cast(void**)& g_regex_replace},
+    { "g_regex_split_full",  cast(void**)& g_regex_split_full},
+    { "g_regex_split",  cast(void**)& g_regex_split},
+    { "g_regex_split_simple",  cast(void**)& g_regex_split_simple},
+    { "g_regex_match_all_full",  cast(void**)& g_regex_match_all_full},
+    { "g_regex_match_all",  cast(void**)& g_regex_match_all},
+    { "g_regex_match_full",  cast(void**)& g_regex_match_full},
+    { "g_regex_match",  cast(void**)& g_regex_match},
+    { "g_regex_match_simple",  cast(void**)& g_regex_match_simple},
+    { "g_regex_escape_string",  cast(void**)& g_regex_escape_string},
+    { "g_regex_get_string_number",  cast(void**)& g_regex_get_string_number},
+    { "g_regex_get_capture_count",  cast(void**)& g_regex_get_capture_count},
+    { "g_regex_get_max_backref",  cast(void**)& g_regex_get_max_backref},
+    { "g_regex_get_pattern",  cast(void**)& g_regex_get_pattern},
+    { "g_regex_unref",  cast(void**)& g_regex_unref},
+    { "g_regex_ref",  cast(void**)& g_regex_ref},
+    { "g_regex_new",  cast(void**)& g_regex_new},
+    { "g_regex_error_quark",  cast(void**)& g_regex_error_quark},
+    { "g_tuples_index",  cast(void**)& g_tuples_index},
+    { "g_tuples_destroy",  cast(void**)& g_tuples_destroy},
+    { "g_relation_print",  cast(void**)& g_relation_print},
+    { "g_relation_exists",  cast(void**)& g_relation_exists},
+    { "g_relation_count",  cast(void**)& g_relation_count},
+    { "g_relation_select",  cast(void**)& g_relation_select},
+    { "g_relation_delete",  cast(void**)& g_relation_delete},
+    { "g_relation_insert",  cast(void**)& g_relation_insert},
+    { "g_relation_index",  cast(void**)& g_relation_index},
+    { "g_relation_destroy",  cast(void**)& g_relation_destroy},
+    { "g_relation_new",  cast(void**)& g_relation_new},
+    { "g_random_double_range",  cast(void**)& g_random_double_range},
+    { "g_random_double",  cast(void**)& g_random_double},
+    { "g_random_int_range",  cast(void**)& g_random_int_range},
+    { "g_random_int",  cast(void**)& g_random_int},
+    { "g_random_set_seed",  cast(void**)& g_random_set_seed},
+    { "g_rand_double_range",  cast(void**)& g_rand_double_range},
+    { "g_rand_double",  cast(void**)& g_rand_double},
+    { "g_rand_int_range",  cast(void**)& g_rand_int_range},
+    { "g_rand_int",  cast(void**)& g_rand_int},
+    { "g_rand_set_seed_array",  cast(void**)& g_rand_set_seed_array},
+    { "g_rand_set_seed",  cast(void**)& g_rand_set_seed},
+    { "g_rand_copy",  cast(void**)& g_rand_copy},
+    { "g_rand_free",  cast(void**)& g_rand_free},
+    { "g_rand_new",  cast(void**)& g_rand_new},
+    { "g_rand_new_with_seed_array",  cast(void**)& g_rand_new_with_seed_array},
+    { "g_rand_new_with_seed",  cast(void**)& g_rand_new_with_seed},
+    { "g_queue_delete_link",  cast(void**)& g_queue_delete_link},
+    { "g_queue_unlink",  cast(void**)& g_queue_unlink},
+    { "g_queue_link_index",  cast(void**)& g_queue_link_index},
+    { "g_queue_peek_nth_link",  cast(void**)& g_queue_peek_nth_link},
+    { "g_queue_peek_tail_link",  cast(void**)& g_queue_peek_tail_link},
+    { "g_queue_peek_head_link",  cast(void**)& g_queue_peek_head_link},
+    { "g_queue_pop_nth_link",  cast(void**)& g_queue_pop_nth_link},
+    { "g_queue_pop_tail_link",  cast(void**)& g_queue_pop_tail_link},
+    { "g_queue_pop_head_link",  cast(void**)& g_queue_pop_head_link},
+    { "g_queue_push_nth_link",  cast(void**)& g_queue_push_nth_link},
+    { "g_queue_push_tail_link",  cast(void**)& g_queue_push_tail_link},
+    { "g_queue_push_head_link",  cast(void**)& g_queue_push_head_link},
+    { "g_queue_insert_sorted",  cast(void**)& g_queue_insert_sorted},
+    { "g_queue_insert_after",  cast(void**)& g_queue_insert_after},
+    { "g_queue_insert_before",  cast(void**)& g_queue_insert_before},
+    { "g_queue_remove_all",  cast(void**)& g_queue_remove_all},
+    { "g_queue_remove",  cast(void**)& g_queue_remove},
+    { "g_queue_index",  cast(void**)& g_queue_index},
+    { "g_queue_peek_nth",  cast(void**)& g_queue_peek_nth},
+    { "g_queue_peek_tail",  cast(void**)& g_queue_peek_tail},
+    { "g_queue_peek_head",  cast(void**)& g_queue_peek_head},
+    { "g_queue_pop_nth",  cast(void**)& g_queue_pop_nth},
+    { "g_queue_pop_tail",  cast(void**)& g_queue_pop_tail},
+    { "g_queue_pop_head",  cast(void**)& g_queue_pop_head},
+    { "g_queue_push_nth",  cast(void**)& g_queue_push_nth},
+    { "g_queue_push_tail",  cast(void**)& g_queue_push_tail},
+    { "g_queue_push_head",  cast(void**)& g_queue_push_head},
+    { "g_queue_sort",  cast(void**)& g_queue_sort},
+    { "g_queue_find_custom",  cast(void**)& g_queue_find_custom},
+    { "g_queue_find",  cast(void**)& g_queue_find},
+    { "g_queue_foreach",  cast(void**)& g_queue_foreach},
+    { "g_queue_copy",  cast(void**)& g_queue_copy},
+    { "g_queue_reverse",  cast(void**)& g_queue_reverse},
+    { "g_queue_get_length",  cast(void**)& g_queue_get_length},
+    { "g_queue_is_empty",  cast(void**)& g_queue_is_empty},
+    { "g_queue_clear",  cast(void**)& g_queue_clear},
+    { "g_queue_init",  cast(void**)& g_queue_init},
+    { "g_queue_free",  cast(void**)& g_queue_free},
+    { "g_queue_new",  cast(void**)& g_queue_new},
+    { "g_qsort_with_data",  cast(void**)& g_qsort_with_data},
+    { "g_spaced_primes_closest",  cast(void**)& g_spaced_primes_closest},
+    { "g_pattern_match_simple",  cast(void**)& g_pattern_match_simple},
+    { "g_pattern_match_string",  cast(void**)& g_pattern_match_string},
+    { "g_pattern_match",  cast(void**)& g_pattern_match},
+    { "g_pattern_spec_equal",  cast(void**)& g_pattern_spec_equal},
+    { "g_pattern_spec_free",  cast(void**)& g_pattern_spec_free},
+    { "g_pattern_spec_new",  cast(void**)& g_pattern_spec_new},
+    { "g_option_group_set_translation_domain",  cast(void**)& g_option_group_set_translation_domain},
+    { "g_option_group_set_translate_func",  cast(void**)& g_option_group_set_translate_func},
+    { "g_option_group_add_entries",  cast(void**)& g_option_group_add_entries},
+    { "g_option_group_free",  cast(void**)& g_option_group_free},
+    { "g_option_group_set_error_hook",  cast(void**)& g_option_group_set_error_hook},
+    { "g_option_group_set_parse_hooks",  cast(void**)& g_option_group_set_parse_hooks},
+    { "g_option_group_new",  cast(void**)& g_option_group_new},
+    { "g_option_context_get_help",  cast(void**)& g_option_context_get_help},
+    { "g_option_context_get_main_group",  cast(void**)& g_option_context_get_main_group},
+    { "g_option_context_set_main_group",  cast(void**)& g_option_context_set_main_group},
+    { "g_option_context_add_group",  cast(void**)& g_option_context_add_group},
+    { "g_option_context_set_translation_domain",  cast(void**)& g_option_context_set_translation_domain},
+    { "g_option_context_set_translate_func",  cast(void**)& g_option_context_set_translate_func},
+    { "g_option_context_parse",  cast(void**)& g_option_context_parse},
+    { "g_option_context_add_main_entries",  cast(void**)& g_option_context_add_main_entries},
+    { "g_option_context_get_ignore_unknown_options",  cast(void**)& g_option_context_get_ignore_unknown_options},
+    { "g_option_context_set_ignore_unknown_options",  cast(void**)& g_option_context_set_ignore_unknown_options},
+    { "g_option_context_get_help_enabled",  cast(void**)& g_option_context_get_help_enabled},
+    { "g_option_context_set_help_enabled",  cast(void**)& g_option_context_set_help_enabled},
+    { "g_option_context_free",  cast(void**)& g_option_context_free},
+    { "g_option_context_get_description",  cast(void**)& g_option_context_get_description},
+    { "g_option_context_set_description",  cast(void**)& g_option_context_set_description},
+    { "g_option_context_get_summary",  cast(void**)& g_option_context_get_summary},
+    { "g_option_context_set_summary",  cast(void**)& g_option_context_set_summary},
+    { "g_option_context_new",  cast(void**)& g_option_context_new},
+    { "g_option_error_quark",  cast(void**)& g_option_error_quark},
+    { "g_node_pop_allocator",  cast(void**)& g_node_pop_allocator},
+    { "g_node_push_allocator",  cast(void**)& g_node_push_allocator},
+    { "g_node_last_sibling",  cast(void**)& g_node_last_sibling},
+    { "g_node_first_sibling",  cast(void**)& g_node_first_sibling},
+    { "g_node_child_index",  cast(void**)& g_node_child_index},
+    { "g_node_child_position",  cast(void**)& g_node_child_position},
+    { "g_node_find_child",  cast(void**)& g_node_find_child},
+    { "g_node_last_child",  cast(void**)& g_node_last_child},
+    { "g_node_nth_child",  cast(void**)& g_node_nth_child},
+    { "g_node_n_children",  cast(void**)& g_node_n_children},
+    { "g_node_reverse_children",  cast(void**)& g_node_reverse_children},
+    { "g_node_children_foreach",  cast(void**)& g_node_children_foreach},
+    { "g_node_max_height",  cast(void**)& g_node_max_height},
+    { "g_node_traverse",  cast(void**)& g_node_traverse},
+    { "g_node_find",  cast(void**)& g_node_find},
+    { "g_node_depth",  cast(void**)& g_node_depth},
+    { "g_node_is_ancestor",  cast(void**)& g_node_is_ancestor},
+    { "g_node_get_root",  cast(void**)& g_node_get_root},
+    { "g_node_n_nodes",  cast(void**)& g_node_n_nodes},
+    { "g_node_prepend",  cast(void**)& g_node_prepend},
+    { "g_node_insert_after",  cast(void**)& g_node_insert_after},
+    { "g_node_insert_before",  cast(void**)& g_node_insert_before},
+    { "g_node_insert",  cast(void**)& g_node_insert},
+    { "g_node_copy",  cast(void**)& g_node_copy},
+    { "g_node_copy_deep",  cast(void**)& g_node_copy_deep},
+    { "g_node_unlink",  cast(void**)& g_node_unlink},
+    { "g_node_destroy",  cast(void**)& g_node_destroy},
+    { "g_node_new",  cast(void**)& g_node_new},
+    { "g_set_printerr_handler",  cast(void**)& g_set_printerr_handler},
+    { "g_printerr",  cast(void**)& g_printerr},
+    { "g_set_print_handler",  cast(void**)& g_set_print_handler},
+    { "g_print",  cast(void**)& g_print},
+    { "g_assert_warning",  cast(void**)& g_assert_warning},
+    { "g_return_if_fail_warning",  cast(void**)& g_return_if_fail_warning},
+    { "_g_log_fallback_handler",  cast(void**)& _g_log_fallback_handler},
+    { "g_log_set_always_fatal",  cast(void**)& g_log_set_always_fatal},
+    { "g_log_set_fatal_mask",  cast(void**)& g_log_set_fatal_mask},
+    { "g_logv",  cast(void**)& g_logv},
+    { "g_log",  cast(void**)& g_log},
+    { "g_log_set_default_handler",  cast(void**)& g_log_set_default_handler},
+    { "g_log_default_handler",  cast(void**)& g_log_default_handler},
+    { "g_log_remove_handler",  cast(void**)& g_log_remove_handler},
+    { "g_log_set_handler",  cast(void**)& g_log_set_handler},
+    { "g_printf_string_upper_bound",  cast(void**)& g_printf_string_upper_bound},
+    { "g_markup_vprintf_escaped",  cast(void**)& g_markup_vprintf_escaped},
+    { "g_markup_printf_escaped",  cast(void**)& g_markup_printf_escaped},
+    { "g_markup_escape_text",  cast(void**)& g_markup_escape_text},
+    { "g_markup_parse_context_get_position",  cast(void**)& g_markup_parse_context_get_position},
+    { "g_markup_parse_context_get_element",  cast(void**)& g_markup_parse_context_get_element},
+    { "g_markup_parse_context_end_parse",  cast(void**)& g_markup_parse_context_end_parse},
+    { "g_markup_parse_context_parse",  cast(void**)& g_markup_parse_context_parse},
+    { "g_markup_parse_context_free",  cast(void**)& g_markup_parse_context_free},
+    { "g_markup_parse_context_new",  cast(void**)& g_markup_parse_context_new},
+    { "g_markup_error_quark",  cast(void**)& g_markup_error_quark},
+    { "g_mapped_file_free",  cast(void**)& g_mapped_file_free},
+    { "g_mapped_file_get_contents",  cast(void**)& g_mapped_file_get_contents},
+    { "g_mapped_file_get_length",  cast(void**)& g_mapped_file_get_length},
+    { "g_mapped_file_new",  cast(void**)& g_mapped_file_new},
+    { "g_key_file_remove_group",  cast(void**)& g_key_file_remove_group},
+    { "g_key_file_remove_key",  cast(void**)& g_key_file_remove_key},
+    { "g_key_file_remove_comment",  cast(void**)& g_key_file_remove_comment},
+    { "g_key_file_get_comment",  cast(void**)& g_key_file_get_comment},
+    { "g_key_file_set_comment",  cast(void**)& g_key_file_set_comment},
+    { "g_key_file_set_integer_list",  cast(void**)& g_key_file_set_integer_list},
+    { "g_key_file_get_double_list",  cast(void**)& g_key_file_get_double_list},
+    { "g_key_file_set_double_list",  cast(void**)& g_key_file_set_double_list},
+    { "g_key_file_get_integer_list",  cast(void**)& g_key_file_get_integer_list},
+    { "g_key_file_set_boolean_list",  cast(void**)& g_key_file_set_boolean_list},
+    { "g_key_file_get_boolean_list",  cast(void**)& g_key_file_get_boolean_list},
+    { "g_key_file_set_locale_string_list",  cast(void**)& g_key_file_set_locale_string_list},
+    { "g_key_file_get_locale_string_list",  cast(void**)& g_key_file_get_locale_string_list},
+    { "g_key_file_set_string_list",  cast(void**)& g_key_file_set_string_list},
+    { "g_key_file_get_string_list",  cast(void**)& g_key_file_get_string_list},
+    { "g_key_file_set_double",  cast(void**)& g_key_file_set_double},
+    { "g_key_file_get_double",  cast(void**)& g_key_file_get_double},
+    { "g_key_file_set_integer",  cast(void**)& g_key_file_set_integer},
+    { "g_key_file_get_integer",  cast(void**)& g_key_file_get_integer},
+    { "g_key_file_set_boolean",  cast(void**)& g_key_file_set_boolean},
+    { "g_key_file_get_boolean",  cast(void**)& g_key_file_get_boolean},
+    { "g_key_file_set_locale_string",  cast(void**)& g_key_file_set_locale_string},
+    { "g_key_file_get_locale_string",  cast(void**)& g_key_file_get_locale_string},
+    { "g_key_file_set_string",  cast(void**)& g_key_file_set_string},
+    { "g_key_file_get_string",  cast(void**)& g_key_file_get_string},
+    { "g_key_file_set_value",  cast(void**)& g_key_file_set_value},
+    { "g_key_file_get_value",  cast(void**)& g_key_file_get_value},
+    { "g_key_file_has_key",  cast(void**)& g_key_file_has_key},
+    { "g_key_file_has_group",  cast(void**)& g_key_file_has_group},
+    { "g_key_file_get_keys",  cast(void**)& g_key_file_get_keys},
+    { "g_key_file_get_groups",  cast(void**)& g_key_file_get_groups},
+    { "g_key_file_get_start_group",  cast(void**)& g_key_file_get_start_group},
+    { "g_key_file_to_data",  cast(void**)& g_key_file_to_data},
+    { "g_key_file_load_from_data_dirs",  cast(void**)& g_key_file_load_from_data_dirs},
+    { "g_key_file_load_from_dirs",  cast(void**)& g_key_file_load_from_dirs},
+    { "g_key_file_load_from_data",  cast(void**)& g_key_file_load_from_data},
+    { "g_key_file_load_from_file",  cast(void**)& g_key_file_load_from_file},
+    { "g_key_file_set_list_separator",  cast(void**)& g_key_file_set_list_separator},
+    { "g_key_file_free",  cast(void**)& g_key_file_free},
+    { "g_key_file_new",  cast(void**)& g_key_file_new},
+    { "g_key_file_error_quark",  cast(void**)& g_key_file_error_quark},
+    { "g_io_watch_funcs",  cast(void**)& g_io_watch_funcs},
+    { "g_io_channel_unix_get_fd",  cast(void**)& g_io_channel_unix_get_fd},
+    { "g_io_channel_unix_new",  cast(void**)& g_io_channel_unix_new},
+    { "g_io_channel_error_from_errno",  cast(void**)& g_io_channel_error_from_errno},
+    { "g_io_channel_error_quark",  cast(void**)& g_io_channel_error_quark},
+    { "g_io_channel_new_file",  cast(void**)& g_io_channel_new_file},
+    { "g_io_channel_seek_position",  cast(void**)& g_io_channel_seek_position},
+    { "g_io_channel_write_unichar",  cast(void**)& g_io_channel_write_unichar},
+    { "g_io_channel_write_chars",  cast(void**)& g_io_channel_write_chars},
+    { "g_io_channel_read_unichar",  cast(void**)& g_io_channel_read_unichar},
+    { "g_io_channel_read_chars",  cast(void**)& g_io_channel_read_chars},
+    { "g_io_channel_read_to_end",  cast(void**)& g_io_channel_read_to_end},
+    { "g_io_channel_read_line_string",  cast(void**)& g_io_channel_read_line_string},
+    { "g_io_channel_read_line",  cast(void**)& g_io_channel_read_line},
+    { "g_io_channel_flush",  cast(void**)& g_io_channel_flush},
+    { "g_io_channel_get_close_on_unref",  cast(void**)& g_io_channel_get_close_on_unref},
+    { "g_io_channel_set_close_on_unref",  cast(void**)& g_io_channel_set_close_on_unref},
+    { "g_io_channel_get_encoding",  cast(void**)& g_io_channel_get_encoding},
+    { "g_io_channel_set_encoding",  cast(void**)& g_io_channel_set_encoding},
+    { "g_io_channel_get_buffered",  cast(void**)& g_io_channel_get_buffered},
+    { "g_io_channel_set_buffered",  cast(void**)& g_io_channel_set_buffered},
+    { "g_io_channel_get_line_term",  cast(void**)& g_io_channel_get_line_term},
+    { "g_io_channel_set_line_term",  cast(void**)& g_io_channel_set_line_term},
+    { "g_io_channel_get_flags",  cast(void**)& g_io_channel_get_flags},
+    { "g_io_channel_set_flags",  cast(void**)& g_io_channel_set_flags},
+    { "g_io_channel_get_buffer_condition",  cast(void**)& g_io_channel_get_buffer_condition},
+    { "g_io_channel_get_buffer_size",  cast(void**)& g_io_channel_get_buffer_size},
+    { "g_io_channel_set_buffer_size",  cast(void**)& g_io_channel_set_buffer_size},
+    { "g_io_add_watch",  cast(void**)& g_io_add_watch},
+    { "g_io_create_watch",  cast(void**)& g_io_create_watch},
+    { "g_io_add_watch_full",  cast(void**)& g_io_add_watch_full},
+    { "g_io_channel_shutdown",  cast(void**)& g_io_channel_shutdown},
+    { "g_io_channel_close",  cast(void**)& g_io_channel_close},
+    { "g_io_channel_seek",  cast(void**)& g_io_channel_seek},
+    { "g_io_channel_write",  cast(void**)& g_io_channel_write},
+    { "g_io_channel_read",  cast(void**)& g_io_channel_read},
+    { "g_io_channel_unref",  cast(void**)& g_io_channel_unref},
+    { "g_io_channel_ref",  cast(void**)& g_io_channel_ref},
+    { "g_io_channel_init",  cast(void**)& g_io_channel_init},
+    { "g_string_up",  cast(void**)& g_string_up},
+    { "g_string_down",  cast(void**)& g_string_down},
+    { "g_string_append_c_inline",  cast(void**)& g_string_append_c_inline},
+    { "g_string_append_printf",  cast(void**)& g_string_append_printf},
+    { "g_string_append_vprintf",  cast(void**)& g_string_append_vprintf},
+    { "g_string_printf",  cast(void**)& g_string_printf},
+    { "g_string_vprintf",  cast(void**)& g_string_vprintf},
+    { "g_string_ascii_up",  cast(void**)& g_string_ascii_up},
+    { "g_string_ascii_down",  cast(void**)& g_string_ascii_down},
+    { "g_string_erase",  cast(void**)& g_string_erase},
+    { "g_string_overwrite_len",  cast(void**)& g_string_overwrite_len},
+    { "g_string_overwrite",  cast(void**)& g_string_overwrite},
+    { "g_string_insert_unichar",  cast(void**)& g_string_insert_unichar},
+    { "g_string_insert_c",  cast(void**)& g_string_insert_c},
+    { "g_string_insert",  cast(void**)& g_string_insert},
+    { "g_string_prepend_len",  cast(void**)& g_string_prepend_len},
+    { "g_string_prepend_unichar",  cast(void**)& g_string_prepend_unichar},
+    { "g_string_prepend_c",  cast(void**)& g_string_prepend_c},
+    { "g_string_prepend",  cast(void**)& g_string_prepend},
+    { "g_string_append_unichar",  cast(void**)& g_string_append_unichar},
+    { "g_string_append_c",  cast(void**)& g_string_append_c},
+    { "g_string_append_len",  cast(void**)& g_string_append_len},
+    { "g_string_append",  cast(void**)& g_string_append},
+    { "g_string_insert_len",  cast(void**)& g_string_insert_len},
+    { "g_string_set_size",  cast(void**)& g_string_set_size},
+    { "g_string_truncate",  cast(void**)& g_string_truncate},
+    { "g_string_assign",  cast(void**)& g_string_assign},
+    { "g_string_hash",  cast(void**)& g_string_hash},
+    { "g_string_equal",  cast(void**)& g_string_equal},
+    { "g_string_free",  cast(void**)& g_string_free},
+    { "g_string_sized_new",  cast(void**)& g_string_sized_new},
+    { "g_string_new_len",  cast(void**)& g_string_new_len},
+    { "g_string_new",  cast(void**)& g_string_new},
+    { "g_string_chunk_insert_const",  cast(void**)& g_string_chunk_insert_const},
+    { "g_string_chunk_insert_len",  cast(void**)& g_string_chunk_insert_len},
+    { "g_string_chunk_insert",  cast(void**)& g_string_chunk_insert},
+    { "g_string_chunk_clear",  cast(void**)& g_string_chunk_clear},
+    { "g_string_chunk_free",  cast(void**)& g_string_chunk_free},
+    { "g_string_chunk_new",  cast(void**)& g_string_chunk_new},
+    { "_g_utf8_make_valid",  cast(void**)& _g_utf8_make_valid},
+    { "g_unichar_get_script",  cast(void**)& g_unichar_get_script},
+    { "g_unichar_get_mirror_char",  cast(void**)& g_unichar_get_mirror_char},
+    { "g_utf8_collate_key_for_filename",  cast(void**)& g_utf8_collate_key_for_filename},
+    { "g_utf8_collate_key",  cast(void**)& g_utf8_collate_key},
+    { "g_utf8_collate",  cast(void**)& g_utf8_collate},
+    { "g_utf8_normalize",  cast(void**)& g_utf8_normalize},
+    { "g_utf8_casefold",  cast(void**)& g_utf8_casefold},
+    { "g_utf8_strdown",  cast(void**)& g_utf8_strdown},
+    { "g_utf8_strup",  cast(void**)& g_utf8_strup},
+    { "g_unichar_validate",  cast(void**)& g_unichar_validate},
+    { "g_utf8_validate",  cast(void**)& g_utf8_validate},
+    { "g_unichar_to_utf8",  cast(void**)& g_unichar_to_utf8},
+    { "g_ucs4_to_utf8",  cast(void**)& g_ucs4_to_utf8},
+    { "g_ucs4_to_utf16",  cast(void**)& g_ucs4_to_utf16},
+    { "g_utf16_to_utf8",  cast(void**)& g_utf16_to_utf8},
+    { "g_utf16_to_ucs4",  cast(void**)& g_utf16_to_ucs4},
+    { "g_utf8_to_ucs4_fast",  cast(void**)& g_utf8_to_ucs4_fast},
+    { "g_utf8_to_ucs4",  cast(void**)& g_utf8_to_ucs4},
+    { "g_utf8_to_utf16",  cast(void**)& g_utf8_to_utf16},
+    { "g_utf8_strreverse",  cast(void**)& g_utf8_strreverse},
+    { "g_utf8_strrchr",  cast(void**)& g_utf8_strrchr},
+    { "g_utf8_strchr",  cast(void**)& g_utf8_strchr},
+    { "g_utf8_strncpy",  cast(void**)& g_utf8_strncpy},
+    { "g_utf8_strlen",  cast(void**)& g_utf8_strlen},
+    { "g_utf8_find_prev_char",  cast(void**)& g_utf8_find_prev_char},
+    { "g_utf8_find_next_char",  cast(void**)& g_utf8_find_next_char},
+    { "g_utf8_prev_char",  cast(void**)& g_utf8_prev_char},
+    { "g_utf8_pointer_to_offset",  cast(void**)& g_utf8_pointer_to_offset},
+    { "g_utf8_offset_to_pointer",  cast(void**)& g_utf8_offset_to_pointer},
+    { "g_utf8_get_char_validated",  cast(void**)& g_utf8_get_char_validated},
+    { "g_utf8_get_char",  cast(void**)& g_utf8_get_char},
+    { "g_utf8_skip",  cast(void**)& g_utf8_skip},
+    { "g_unicode_canonical_decomposition",  cast(void**)& g_unicode_canonical_decomposition},
+    { "g_unicode_canonical_ordering",  cast(void**)& g_unicode_canonical_ordering},
+    { "g_unichar_combining_class",  cast(void**)& g_unichar_combining_class},
+    { "g_unichar_break_type",  cast(void**)& g_unichar_break_type},
+    { "g_unichar_type",  cast(void**)& g_unichar_type},
+    { "g_unichar_xdigit_value",  cast(void**)& g_unichar_xdigit_value},
+    { "g_unichar_digit_value",  cast(void**)& g_unichar_digit_value},
+    { "g_unichar_totitle",  cast(void**)& g_unichar_totitle},
+    { "g_unichar_tolower",  cast(void**)& g_unichar_tolower},
+    { "g_unichar_toupper",  cast(void**)& g_unichar_toupper},
+    { "g_unichar_ismark",  cast(void**)& g_unichar_ismark},
+    { "g_unichar_iszerowidth",  cast(void**)& g_unichar_iszerowidth},
+    { "g_unichar_iswide_cjk",  cast(void**)& g_unichar_iswide_cjk},
+    { "g_unichar_iswide",  cast(void**)& g_unichar_iswide},
+    { "g_unichar_isdefined",  cast(void**)& g_unichar_isdefined},
+    { "g_unichar_istitle",  cast(void**)& g_unichar_istitle},
+    { "g_unichar_isxdigit",  cast(void**)& g_unichar_isxdigit},
+    { "g_unichar_isupper",  cast(void**)& g_unichar_isupper},
+    { "g_unichar_isspace",  cast(void**)& g_unichar_isspace},
+    { "g_unichar_ispunct",  cast(void**)& g_unichar_ispunct},
+    { "g_unichar_isprint",  cast(void**)& g_unichar_isprint},
+    { "g_unichar_islower",  cast(void**)& g_unichar_islower},
+    { "g_unichar_isgraph",  cast(void**)& g_unichar_isgraph},
+    { "g_unichar_isdigit",  cast(void**)& g_unichar_isdigit},
+    { "g_unichar_iscntrl",  cast(void**)& g_unichar_iscntrl},
+    { "g_unichar_isalpha",  cast(void**)& g_unichar_isalpha},
+    { "g_unichar_isalnum",  cast(void**)& g_unichar_isalnum},
+    { "g_get_charset",  cast(void**)& g_get_charset},
+    { "g_idle_funcs",  cast(void**)& g_idle_funcs},
+    { "g_child_watch_funcs",  cast(void**)& g_child_watch_funcs},
+    { "g_timeout_funcs",  cast(void**)& g_timeout_funcs},
+    { "g_idle_remove_by_data",  cast(void**)& g_idle_remove_by_data},
+    { "g_idle_add_full",  cast(void**)& g_idle_add_full},
+    { "g_idle_add",  cast(void**)& g_idle_add},
+    { "g_child_watch_add",  cast(void**)& g_child_watch_add},
+    { "g_child_watch_add_full",  cast(void**)& g_child_watch_add_full},
+    { "g_timeout_add_seconds",  cast(void**)& g_timeout_add_seconds},
+    { "g_timeout_add_seconds_full",  cast(void**)& g_timeout_add_seconds_full},
+    { "g_timeout_add",  cast(void**)& g_timeout_add},
+    { "g_timeout_add_full",  cast(void**)& g_timeout_add_full},
+    { "g_source_remove_by_funcs_user_data",  cast(void**)& g_source_remove_by_funcs_user_data},
+    { "g_source_remove_by_user_data",  cast(void**)& g_source_remove_by_user_data},
+    { "g_source_remove",  cast(void**)& g_source_remove},
+    { "g_get_current_time",  cast(void**)& g_get_current_time},
+    { "g_timeout_source_new_seconds",  cast(void**)& g_timeout_source_new_seconds},
+    { "g_timeout_source_new",  cast(void**)& g_timeout_source_new},
+    { "g_child_watch_source_new",  cast(void**)& g_child_watch_source_new},
+    { "g_idle_source_new",  cast(void**)& g_idle_source_new},
+    { "g_source_get_current_time",  cast(void**)& g_source_get_current_time},
+    { "g_source_remove_poll",  cast(void**)& g_source_remove_poll},
+    { "g_source_add_poll",  cast(void**)& g_source_add_poll},
+    { "g_source_set_callback_indirect",  cast(void**)& g_source_set_callback_indirect},
+    { "g_source_is_destroyed",  cast(void**)& g_source_is_destroyed},
+    { "g_source_set_funcs",  cast(void**)& g_source_set_funcs},
+    { "g_source_set_callback",  cast(void**)& g_source_set_callback},
+    { "g_source_get_context",  cast(void**)& g_source_get_context},
+    { "g_source_get_id",  cast(void**)& g_source_get_id},
+    { "g_source_get_can_recurse",  cast(void**)& g_source_get_can_recurse},
+    { "g_source_set_can_recurse",  cast(void**)& g_source_set_can_recurse},
+    { "g_source_get_priority",  cast(void**)& g_source_get_priority},
+    { "g_source_set_priority",  cast(void**)& g_source_set_priority},
+    { "g_source_destroy",  cast(void**)& g_source_destroy},
+    { "g_source_attach",  cast(void**)& g_source_attach},
+    { "g_source_unref",  cast(void**)& g_source_unref},
+    { "g_source_ref",  cast(void**)& g_source_ref},
+    { "g_source_new",  cast(void**)& g_source_new},
+    { "g_main_loop_get_context",  cast(void**)& g_main_loop_get_context},
+    { "g_main_loop_is_running",  cast(void**)& g_main_loop_is_running},
+    { "g_main_loop_unref",  cast(void**)& g_main_loop_unref},
+    { "g_main_loop_ref",  cast(void**)& g_main_loop_ref},
+    { "g_main_loop_quit",  cast(void**)& g_main_loop_quit},
+    { "g_main_loop_run",  cast(void**)& g_main_loop_run},
+    { "g_main_loop_new",  cast(void**)& g_main_loop_new},
+    { "g_main_current_source",  cast(void**)& g_main_current_source},
+    { "g_main_depth",  cast(void**)& g_main_depth},
+    { "g_main_context_remove_poll",  cast(void**)& g_main_context_remove_poll},
+    { "g_main_context_add_poll",  cast(void**)& g_main_context_add_poll},
+    { "g_main_context_get_poll_func",  cast(void**)& g_main_context_get_poll_func},
+    { "g_main_context_set_poll_func",  cast(void**)& g_main_context_set_poll_func},
+    { "g_main_context_dispatch",  cast(void**)& g_main_context_dispatch},
+    { "g_main_context_check",  cast(void**)& g_main_context_check},
+    { "g_main_context_query",  cast(void**)& g_main_context_query},
+    { "g_main_context_prepare",  cast(void**)& g_main_context_prepare},
+    { "g_main_context_wait",  cast(void**)& g_main_context_wait},
+    { "g_main_context_is_owner",  cast(void**)& g_main_context_is_owner},
+    { "g_main_context_release",  cast(void**)& g_main_context_release},
+    { "g_main_context_acquire",  cast(void**)& g_main_context_acquire},
+    { "g_main_context_wakeup",  cast(void**)& g_main_context_wakeup},
+    { "g_main_context_find_source_by_funcs_user_data",  cast(void**)& g_main_context_find_source_by_funcs_user_data},
+    { "g_main_context_find_source_by_user_data",  cast(void**)& g_main_context_find_source_by_user_data},
+    { "g_main_context_find_source_by_id",  cast(void**)& g_main_context_find_source_by_id},
+    { "g_main_context_pending",  cast(void**)& g_main_context_pending},
+    { "g_main_context_iteration",  cast(void**)& g_main_context_iteration},
+    { "g_main_context_default",  cast(void**)& g_main_context_default},
+    { "g_main_context_unref",  cast(void**)& g_main_context_unref},
+    { "g_main_context_ref",  cast(void**)& g_main_context_ref},
+    { "g_main_context_new",  cast(void**)& g_main_context_new},
+    { "g_slist_pop_allocator",  cast(void**)& g_slist_pop_allocator},
+    { "g_slist_push_allocator",  cast(void**)& g_slist_push_allocator},
+    { "g_slist_nth_data",  cast(void**)& g_slist_nth_data},
+    { "g_slist_sort_with_data",  cast(void**)& g_slist_sort_with_data},
+    { "g_slist_sort",  cast(void**)& g_slist_sort},
+    { "g_slist_foreach",  cast(void**)& g_slist_foreach},
+    { "g_slist_length",  cast(void**)& g_slist_length},
+    { "g_slist_last",  cast(void**)& g_slist_last},
+    { "g_slist_index",  cast(void**)& g_slist_index},
+    { "g_slist_position",  cast(void**)& g_slist_position},
+    { "g_slist_find_custom",  cast(void**)& g_slist_find_custom},
+    { "g_slist_find",  cast(void**)& g_slist_find},
+    { "g_slist_nth",  cast(void**)& g_slist_nth},
+    { "g_slist_copy",  cast(void**)& g_slist_copy},
+    { "g_slist_reverse",  cast(void**)& g_slist_reverse},
+    { "g_slist_delete_link",  cast(void**)& g_slist_delete_link},
+    { "g_slist_remove_link",  cast(void**)& g_slist_remove_link},
+    { "g_slist_remove_all",  cast(void**)& g_slist_remove_all},
+    { "g_slist_remove",  cast(void**)& g_slist_remove},
+    { "g_slist_concat",  cast(void**)& g_slist_concat},
+    { "g_slist_insert_before",  cast(void**)& g_slist_insert_before},
+    { "g_slist_insert_sorted_with_data",  cast(void**)& g_slist_insert_sorted_with_data},
+    { "g_slist_insert_sorted",  cast(void**)& g_slist_insert_sorted},
+    { "g_slist_insert",  cast(void**)& g_slist_insert},
+    { "g_slist_prepend",  cast(void**)& g_slist_prepend},
+    { "g_slist_append",  cast(void**)& g_slist_append},
+    { "g_slist_free_1",  cast(void**)& g_slist_free_1},
+    { "g_slist_free",  cast(void**)& g_slist_free},
+    { "g_slist_alloc",  cast(void**)& g_slist_alloc},
+    { "g_hook_list_marshal_check",  cast(void**)& g_hook_list_marshal_check},
+    { "g_hook_list_marshal",  cast(void**)& g_hook_list_marshal},
+    { "g_hook_list_invoke_check",  cast(void**)& g_hook_list_invoke_check},
+    { "g_hook_list_invoke",  cast(void**)& g_hook_list_invoke},
+    { "g_hook_compare_ids",  cast(void**)& g_hook_compare_ids},
+    { "g_hook_next_valid",  cast(void**)& g_hook_next_valid},
+    { "g_hook_first_valid",  cast(void**)& g_hook_first_valid},
+    { "g_hook_find_func_data",  cast(void**)& g_hook_find_func_data},
+    { "g_hook_find_func",  cast(void**)& g_hook_find_func},
+    { "g_hook_find_data",  cast(void**)& g_hook_find_data},
+    { "g_hook_find",  cast(void**)& g_hook_find},
+    { "g_hook_get",  cast(void**)& g_hook_get},
+    { "g_hook_insert_sorted",  cast(void**)& g_hook_insert_sorted},
+    { "g_hook_insert_before",  cast(void**)& g_hook_insert_before},
+    { "g_hook_prepend",  cast(void**)& g_hook_prepend},
+    { "g_hook_destroy_link",  cast(void**)& g_hook_destroy_link},
+    { "g_hook_destroy",  cast(void**)& g_hook_destroy},
+    { "g_hook_unref",  cast(void**)& g_hook_unref},
+    { "g_hook_ref",  cast(void**)& g_hook_ref},
+    { "g_hook_free",  cast(void**)& g_hook_free},
+    { "g_hook_alloc",  cast(void**)& g_hook_alloc},
+    { "g_hook_list_clear",  cast(void**)& g_hook_list_clear},
+    { "g_hook_list_init",  cast(void**)& g_hook_list_init},
+    { "g_direct_equal",  cast(void**)& g_direct_equal},
+    { "g_direct_hash",  cast(void**)& g_direct_hash},
+    { "g_int_hash",  cast(void**)& g_int_hash},
+    { "g_int_equal",  cast(void**)& g_int_equal},
+    { "g_str_hash",  cast(void**)& g_str_hash},
+    { "g_str_equal",  cast(void**)& g_str_equal},
+    { "g_hash_table_unref",  cast(void**)& g_hash_table_unref},
+    { "g_hash_table_ref",  cast(void**)& g_hash_table_ref},
+    { "g_hash_table_get_values",  cast(void**)& g_hash_table_get_values},
+    { "g_hash_table_get_keys",  cast(void**)& g_hash_table_get_keys},
+    { "g_hash_table_size",  cast(void**)& g_hash_table_size},
+    { "g_hash_table_foreach_steal",  cast(void**)& g_hash_table_foreach_steal},
+    { "g_hash_table_foreach_remove",  cast(void**)& g_hash_table_foreach_remove},
+    { "g_hash_table_find",  cast(void**)& g_hash_table_find},
+    { "g_hash_table_foreach",  cast(void**)& g_hash_table_foreach},
+    { "g_hash_table_lookup_extended",  cast(void**)& g_hash_table_lookup_extended},
+    { "g_hash_table_lookup",  cast(void**)& g_hash_table_lookup},
+    { "g_hash_table_steal_all",  cast(void**)& g_hash_table_steal_all},
+    { "g_hash_table_steal",  cast(void**)& g_hash_table_steal},
+    { "g_hash_table_remove_all",  cast(void**)& g_hash_table_remove_all},
+    { "g_hash_table_remove",  cast(void**)& g_hash_table_remove},
+    { "g_hash_table_replace",  cast(void**)& g_hash_table_replace},
+    { "g_hash_table_insert",  cast(void**)& g_hash_table_insert},
+    { "g_hash_table_destroy",  cast(void**)& g_hash_table_destroy},
+    { "g_hash_table_new_full",  cast(void**)& g_hash_table_new_full},
+    { "g_hash_table_new",  cast(void**)& g_hash_table_new},
+    { "g_mkdir_with_parents",  cast(void**)& g_mkdir_with_parents},
+    { "g_build_filenamev",  cast(void**)& g_build_filenamev},
+    { "g_build_filename",  cast(void**)& g_build_filename},
+    { "g_build_pathv",  cast(void**)& g_build_pathv},
+    { "g_build_path",  cast(void**)& g_build_path},
+    { "g_file_open_tmp",  cast(void**)& g_file_open_tmp},
+    { "g_mkstemp",  cast(void**)& g_mkstemp},
+    { "g_file_read_link",  cast(void**)& g_file_read_link},
+    { "g_file_set_contents",  cast(void**)& g_file_set_contents},
+    { "g_file_get_contents",  cast(void**)& g_file_get_contents},
+    { "g_file_test",  cast(void**)& g_file_test},
+    { "g_file_error_from_errno",  cast(void**)& g_file_error_from_errno},
+    { "g_file_error_quark",  cast(void**)& g_file_error_quark},
+    { "g_dir_close",  cast(void**)& g_dir_close},
+    { "g_dir_rewind",  cast(void**)& g_dir_rewind},
+    { "g_dir_read_name",  cast(void**)& g_dir_read_name},
+    { "g_dir_open",  cast(void**)& g_dir_open},
+    { "g_date_strftime",  cast(void**)& g_date_strftime},
+    { "g_date_order",  cast(void**)& g_date_order},
+    { "g_date_clamp",  cast(void**)& g_date_clamp},
+    { "g_date_to_struct_tm",  cast(void**)& g_date_to_struct_tm},
+    { "g_date_compare",  cast(void**)& g_date_compare},
+    { "g_date_days_between",  cast(void**)& g_date_days_between},
+    { "g_date_get_sunday_weeks_in_year",  cast(void**)& g_date_get_sunday_weeks_in_year},
+    { "g_date_get_monday_weeks_in_year",  cast(void**)& g_date_get_monday_weeks_in_year},
+    { "g_date_get_days_in_month",  cast(void**)& g_date_get_days_in_month},
+    { "g_date_is_leap_year",  cast(void**)& g_date_is_leap_year},
+    { "g_date_subtract_years",  cast(void**)& g_date_subtract_years},
+    { "g_date_add_years",  cast(void**)& g_date_add_years},
+    { "g_date_subtract_months",  cast(void**)& g_date_subtract_months},
+    { "g_date_add_months",  cast(void**)& g_date_add_months},
+    { "g_date_subtract_days",  cast(void**)& g_date_subtract_days},
+    { "g_date_add_days",  cast(void**)& g_date_add_days},
+    { "g_date_is_last_of_month",  cast(void**)& g_date_is_last_of_month},
+    { "g_date_is_first_of_month",  cast(void**)& g_date_is_first_of_month},
+    { "g_date_set_julian",  cast(void**)& g_date_set_julian},
+    { "g_date_set_dmy",  cast(void**)& g_date_set_dmy},
+    { "g_date_set_year",  cast(void**)& g_date_set_year},
+    { "g_date_set_day",  cast(void**)& g_date_set_day},
+    { "g_date_set_month",  cast(void**)& g_date_set_month},
+    { "g_date_set_time",  cast(void**)& g_date_set_time},
+    { "g_date_set_time_val",  cast(void**)& g_date_set_time_val},
+    { "g_date_set_time_t",  cast(void**)& g_date_set_time_t},
+    { "g_date_set_parse",  cast(void**)& g_date_set_parse},
+    { "g_date_clear",  cast(void**)& g_date_clear},
+    { "g_date_get_iso8601_week_of_year",  cast(void**)& g_date_get_iso8601_week_of_year},
+    { "g_date_get_sunday_week_of_year",  cast(void**)& g_date_get_sunday_week_of_year},
+    { "g_date_get_monday_week_of_year",  cast(void**)& g_date_get_monday_week_of_year},
+    { "g_date_get_day_of_year",  cast(void**)& g_date_get_day_of_year},
+    { "g_date_get_julian",  cast(void**)& g_date_get_julian},
+    { "g_date_get_day",  cast(void**)& g_date_get_day},
+    { "g_date_get_year",  cast(void**)& g_date_get_year},
+    { "g_date_get_month",  cast(void**)& g_date_get_month},
+    { "g_date_get_weekday",  cast(void**)& g_date_get_weekday},
+    { "g_date_valid_dmy",  cast(void**)& g_date_valid_dmy},
+    { "g_date_valid_julian",  cast(void**)& g_date_valid_julian},
+    { "g_date_valid_weekday",  cast(void**)& g_date_valid_weekday},
+    { "g_date_valid_year",  cast(void**)& g_date_valid_year},
+    { "g_date_valid_month",  cast(void**)& g_date_valid_month},
+    { "g_date_valid_day",  cast(void**)& g_date_valid_day},
+    { "g_date_valid",  cast(void**)& g_date_valid},
+    { "g_date_free",  cast(void**)& g_date_free},
+    { "g_date_new_julian",  cast(void**)& g_date_new_julian},
+    { "g_date_new_dmy",  cast(void**)& g_date_new_dmy},
+    { "g_date_new",  cast(void**)& g_date_new},
+    { "g_dataset_foreach",  cast(void**)& g_dataset_foreach},
+    { "g_dataset_id_remove_no_notify",  cast(void**)& g_dataset_id_remove_no_notify},
+    { "g_dataset_id_set_data_full",  cast(void**)& g_dataset_id_set_data_full},
+    { "g_dataset_id_get_data",  cast(void**)& g_dataset_id_get_data},
+    { "g_dataset_destroy",  cast(void**)& g_dataset_destroy},
+    { "g_datalist_get_flags",  cast(void**)& g_datalist_get_flags},
+    { "g_datalist_unset_flags",  cast(void**)& g_datalist_unset_flags},
+    { "g_datalist_set_flags",  cast(void**)& g_datalist_set_flags},
+    { "g_datalist_foreach",  cast(void**)& g_datalist_foreach},
+    { "g_datalist_id_remove_no_notify",  cast(void**)& g_datalist_id_remove_no_notify},
+    { "g_datalist_id_set_data_full",  cast(void**)& g_datalist_id_set_data_full},
+    { "g_datalist_id_get_data",  cast(void**)& g_datalist_id_get_data},
+    { "g_datalist_clear",  cast(void**)& g_datalist_clear},
+    { "g_datalist_init",  cast(void**)& g_datalist_init},
+    { "g_uri_list_extract_uris",  cast(void**)& g_uri_list_extract_uris},
+    { "g_filename_display_basename",  cast(void**)& g_filename_display_basename},
+    { "g_get_filename_charsets",  cast(void**)& g_get_filename_charsets},
+    { "g_filename_display_name",  cast(void**)& g_filename_display_name},
+    { "g_filename_to_uri",  cast(void**)& g_filename_to_uri},
+    { "g_filename_from_uri",  cast(void**)& g_filename_from_uri},
+    { "g_filename_from_utf8",  cast(void**)& g_filename_from_utf8},
+    { "g_filename_to_utf8",  cast(void**)& g_filename_to_utf8},
+    { "g_locale_from_utf8",  cast(void**)& g_locale_from_utf8},
+    { "g_locale_to_utf8",  cast(void**)& g_locale_to_utf8},
+    { "g_convert_with_fallback",  cast(void**)& g_convert_with_fallback},
+    { "g_convert_with_iconv",  cast(void**)& g_convert_with_iconv},
+    { "g_convert",  cast(void**)& g_convert},
+    { "g_iconv_close",  cast(void**)& g_iconv_close},
+    { "g_iconv",  cast(void**)& g_iconv},
+    { "g_iconv_open",  cast(void**)& g_iconv_open},
+    { "g_convert_error_quark",  cast(void**)& g_convert_error_quark},
+    { "g_completion_free",  cast(void**)& g_completion_free},
+    { "g_completion_set_compare",  cast(void**)& g_completion_set_compare},
+    { "g_completion_complete_utf8",  cast(void**)& g_completion_complete_utf8},
+    { "g_completion_complete",  cast(void**)& g_completion_complete},
+    { "g_completion_clear_items",  cast(void**)& g_completion_clear_items},
+    { "g_completion_remove_items",  cast(void**)& g_completion_remove_items},
+    { "g_completion_add_items",  cast(void**)& g_completion_add_items},
+    { "g_completion_new",  cast(void**)& g_completion_new},
+    { "g_cache_value_foreach",  cast(void**)& g_cache_value_foreach},
+    { "g_cache_key_foreach",  cast(void**)& g_cache_key_foreach},
+    { "g_cache_remove",  cast(void**)& g_cache_remove},
+    { "g_cache_insert",  cast(void**)& g_cache_insert},
+    { "g_cache_destroy",  cast(void**)& g_cache_destroy},
+    { "g_cache_new",  cast(void**)& g_cache_new},
+    { "g_list_pop_allocator",  cast(void**)& g_list_pop_allocator},
+    { "g_list_push_allocator",  cast(void**)& g_list_push_allocator},
+    { "g_list_nth_data",  cast(void**)& g_list_nth_data},
+    { "g_list_sort_with_data",  cast(void**)& g_list_sort_with_data},
+    { "g_list_sort",  cast(void**)& g_list_sort},
+    { "g_list_foreach",  cast(void**)& g_list_foreach},
+    { "g_list_length",  cast(void**)& g_list_length},
+    { "g_list_first",  cast(void**)& g_list_first},
+    { "g_list_last",  cast(void**)& g_list_last},
+    { "g_list_index",  cast(void**)& g_list_index},
+    { "g_list_position",  cast(void**)& g_list_position},
+    { "g_list_find_custom",  cast(void**)& g_list_find_custom},
+    { "g_list_find",  cast(void**)& g_list_find},
+    { "g_list_nth_prev",  cast(void**)& g_list_nth_prev},
+    { "g_list_nth",  cast(void**)& g_list_nth},
+    { "g_list_copy",  cast(void**)& g_list_copy},
+    { "g_list_reverse",  cast(void**)& g_list_reverse},
+    { "g_list_delete_link",  cast(void**)& g_list_delete_link},
+    { "g_list_remove_link",  cast(void**)& g_list_remove_link},
+    { "g_list_remove_all",  cast(void**)& g_list_remove_all},
+    { "g_list_remove",  cast(void**)& g_list_remove},
+    { "g_list_concat",  cast(void**)& g_list_concat},
+    { "g_list_insert_before",  cast(void**)& g_list_insert_before},
+    { "g_list_insert_sorted_with_data",  cast(void**)& g_list_insert_sorted_with_data},
+    { "g_list_insert_sorted",  cast(void**)& g_list_insert_sorted},
+    { "g_list_insert",  cast(void**)& g_list_insert},
+    { "g_list_prepend",  cast(void**)& g_list_prepend},
+    { "g_list_append",  cast(void**)& g_list_append},
+    { "g_list_free_1",  cast(void**)& g_list_free_1},
+    { "g_list_free",  cast(void**)& g_list_free},
+    { "g_list_alloc",  cast(void**)& g_list_alloc},
+    { "g_allocator_free",  cast(void**)& g_allocator_free},
+    { "g_allocator_new",  cast(void**)& g_allocator_new},
+    { "g_blow_chunks",  cast(void**)& g_blow_chunks},
+    { "g_mem_chunk_info",  cast(void**)& g_mem_chunk_info},
+    { "g_mem_chunk_print",  cast(void**)& g_mem_chunk_print},
+    { "g_mem_chunk_reset",  cast(void**)& g_mem_chunk_reset},
+    { "g_mem_chunk_clean",  cast(void**)& g_mem_chunk_clean},
+    { "g_mem_chunk_free",  cast(void**)& g_mem_chunk_free},
+    { "g_mem_chunk_alloc0",  cast(void**)& g_mem_chunk_alloc0},
+    { "g_mem_chunk_alloc",  cast(void**)& g_mem_chunk_alloc},
+    { "g_mem_chunk_destroy",  cast(void**)& g_mem_chunk_destroy},
+    { "g_mem_chunk_new",  cast(void**)& g_mem_chunk_new},
+    { "g_mem_profile",  cast(void**)& g_mem_profile},
+    { "glib_mem_profiler_table",  cast(void**)& glib_mem_profiler_table},
+    { "g_mem_gc_friendly",  cast(void**)& g_mem_gc_friendly},
+    { "g_mem_is_system_malloc",  cast(void**)& g_mem_is_system_malloc},
+    { "g_mem_set_vtable",  cast(void**)& g_mem_set_vtable},
+    { "g_try_realloc",  cast(void**)& g_try_realloc},
+    { "g_try_malloc0",  cast(void**)& g_try_malloc0},
+    { "g_try_malloc",  cast(void**)& g_try_malloc},
+    { "g_free",  cast(void**)& g_free},
+    { "g_realloc",  cast(void**)& g_realloc},
+    { "g_malloc0",  cast(void**)& g_malloc0},
+    { "g_malloc",  cast(void**)& g_malloc},
+    { "g_slice_get_config_state",  cast(void**)& g_slice_get_config_state},
+    { "g_slice_get_config",  cast(void**)& g_slice_get_config},
+    { "g_slice_set_config",  cast(void**)& g_slice_set_config},
+    { "g_slice_free_chain_with_offset",  cast(void**)& g_slice_free_chain_with_offset},
+    { "g_slice_free1",  cast(void**)& g_slice_free1},
+    { "g_slice_copy",  cast(void**)& g_slice_copy},
+    { "g_slice_alloc0",  cast(void**)& g_slice_alloc0},
+    { "g_slice_alloc",  cast(void**)& g_slice_alloc},
+    { "g_bookmark_file_move_item",  cast(void**)& g_bookmark_file_move_item},
+    { "g_bookmark_file_remove_item",  cast(void**)& g_bookmark_file_remove_item},
+    { "g_bookmark_file_remove_application",  cast(void**)& g_bookmark_file_remove_application},
+    { "g_bookmark_file_remove_group",  cast(void**)& g_bookmark_file_remove_group},
+    { "g_bookmark_file_get_uris",  cast(void**)& g_bookmark_file_get_uris},
+    { "g_bookmark_file_get_size",  cast(void**)& g_bookmark_file_get_size},
+    { "g_bookmark_file_has_item",  cast(void**)& g_bookmark_file_has_item},
+    { "g_bookmark_file_get_visited",  cast(void**)& g_bookmark_file_get_visited},
+    { "g_bookmark_file_set_visited",  cast(void**)& g_bookmark_file_set_visited},
+    { "g_bookmark_file_get_modified",  cast(void**)& g_bookmark_file_get_modified},
+    { "g_bookmark_file_set_modified",  cast(void**)& g_bookmark_file_set_modified},
+    { "g_bookmark_file_get_added",  cast(void**)& g_bookmark_file_get_added},
+    { "g_bookmark_file_set_added",  cast(void**)& g_bookmark_file_set_added},
+    { "g_bookmark_file_get_icon",  cast(void**)& g_bookmark_file_get_icon},
+    { "g_bookmark_file_set_icon",  cast(void**)& g_bookmark_file_set_icon},
+    { "g_bookmark_file_get_is_private",  cast(void**)& g_bookmark_file_get_is_private},
+    { "g_bookmark_file_set_is_private",  cast(void**)& g_bookmark_file_set_is_private},
+    { "g_bookmark_file_get_app_info",  cast(void**)& g_bookmark_file_get_app_info},
+    { "g_bookmark_file_set_app_info",  cast(void**)& g_bookmark_file_set_app_info},
+    { "g_bookmark_file_get_applications",  cast(void**)& g_bookmark_file_get_applications},
+    { "g_bookmark_file_has_application",  cast(void**)& g_bookmark_file_has_application},
+    { "g_bookmark_file_add_application",  cast(void**)& g_bookmark_file_add_application},
+    { "g_bookmark_file_get_groups",  cast(void**)& g_bookmark_file_get_groups},
+    { "g_bookmark_file_has_group",  cast(void**)& g_bookmark_file_has_group},
+    { "g_bookmark_file_add_group",  cast(void**)& g_bookmark_file_add_group},
+    { "g_bookmark_file_set_groups",  cast(void**)& g_bookmark_file_set_groups},
+    { "g_bookmark_file_get_mime_type",  cast(void**)& g_bookmark_file_get_mime_type},
+    { "g_bookmark_file_set_mime_type",  cast(void**)& g_bookmark_file_set_mime_type},
+    { "g_bookmark_file_get_description",  cast(void**)& g_bookmark_file_get_description},
+    { "g_bookmark_file_set_description",  cast(void**)& g_bookmark_file_set_description},
+    { "g_bookmark_file_get_title",  cast(void**)& g_bookmark_file_get_title},
+    { "g_bookmark_file_set_title",  cast(void**)& g_bookmark_file_set_title},
+    { "g_bookmark_file_to_file",  cast(void**)& g_bookmark_file_to_file},
+    { "g_bookmark_file_to_data",  cast(void**)& g_bookmark_file_to_data},
+    { "g_bookmark_file_load_from_data_dirs",  cast(void**)& g_bookmark_file_load_from_data_dirs},
+    { "g_bookmark_file_load_from_data",  cast(void**)& g_bookmark_file_load_from_data},
+    { "g_bookmark_file_load_from_file",  cast(void**)& g_bookmark_file_load_from_file},
+    { "g_bookmark_file_free",  cast(void**)& g_bookmark_file_free},
+    { "g_bookmark_file_new",  cast(void**)& g_bookmark_file_new},
+    { "g_bookmark_file_error_quark",  cast(void**)& g_bookmark_file_error_quark},
+    { "g_base64_decode",  cast(void**)& g_base64_decode},
+    { "g_base64_decode_step",  cast(void**)& g_base64_decode_step},
+    { "g_base64_encode",  cast(void**)& g_base64_encode},
+    { "g_base64_encode_close",  cast(void**)& g_base64_encode_close},
+    { "g_base64_encode_step",  cast(void**)& g_base64_encode_step},
+    { "g_on_error_stack_trace",  cast(void**)& g_on_error_stack_trace},
+    { "g_on_error_query",  cast(void**)& g_on_error_query},
+    { "_g_async_queue_get_mutex",  cast(void**)& _g_async_queue_get_mutex},
+    { "g_async_queue_sort_unlocked",  cast(void**)& g_async_queue_sort_unlocked},
+    { "g_async_queue_sort",  cast(void**)& g_async_queue_sort},
+    { "g_async_queue_length_unlocked",  cast(void**)& g_async_queue_length_unlocked},
+    { "g_async_queue_length",  cast(void**)& g_async_queue_length},
+    { "g_async_queue_timed_pop_unlocked",  cast(void**)& g_async_queue_timed_pop_unlocked},
+    { "g_async_queue_timed_pop",  cast(void**)& g_async_queue_timed_pop},
+    { "g_async_queue_try_pop_unlocked",  cast(void**)& g_async_queue_try_pop_unlocked},
+    { "g_async_queue_try_pop",  cast(void**)& g_async_queue_try_pop},
+    { "g_async_queue_pop_unlocked",  cast(void**)& g_async_queue_pop_unlocked},
+    { "g_async_queue_pop",  cast(void**)& g_async_queue_pop},
+    { "g_async_queue_push_sorted_unlocked",  cast(void**)& g_async_queue_push_sorted_unlocked},
+    { "g_async_queue_push_sorted",  cast(void**)& g_async_queue_push_sorted},
+    { "g_async_queue_push_unlocked",  cast(void**)& g_async_queue_push_unlocked},
+    { "g_async_queue_push",  cast(void**)& g_async_queue_push},
+    { "g_async_queue_unref_and_unlock",  cast(void**)& g_async_queue_unref_and_unlock},
+    { "g_async_queue_ref_unlocked",  cast(void**)& g_async_queue_ref_unlocked},
+    { "g_async_queue_unref",  cast(void**)& g_async_queue_unref},
+    { "g_async_queue_ref",  cast(void**)& g_async_queue_ref},
+    { "g_async_queue_unlock",  cast(void**)& g_async_queue_unlock},
+    { "g_async_queue_lock",  cast(void**)& g_async_queue_lock},
+    { "g_async_queue_new",  cast(void**)& g_async_queue_new},
+    { "glib_dummy_decl",  cast(void**)& glib_dummy_decl},
+    { "g_once_init_leave",  cast(void**)& g_once_init_leave},
+    { "g_once_init_enter_impl",  cast(void**)& g_once_init_enter_impl},
+    { "g_once_init_enter",  cast(void**)& g_once_init_enter},
+    { "g_once_impl",  cast(void**)& g_once_impl},
+    { "g_thread_foreach",  cast(void**)& g_thread_foreach},
+    { "g_static_rw_lock_free",  cast(void**)& g_static_rw_lock_free},
+    { "g_static_rw_lock_writer_unlock",  cast(void**)& g_static_rw_lock_writer_unlock},
+    { "g_static_rw_lock_writer_trylock",  cast(void**)& g_static_rw_lock_writer_trylock},
+    { "g_static_rw_lock_writer_lock",  cast(void**)& g_static_rw_lock_writer_lock},
+    { "g_static_rw_lock_reader_unlock",  cast(void**)& g_static_rw_lock_reader_unlock},
+    { "g_static_rw_lock_reader_trylock",  cast(void**)& g_static_rw_lock_reader_trylock},
+    { "g_static_rw_lock_reader_lock",  cast(void**)& g_static_rw_lock_reader_lock},
+    { "g_static_rw_lock_init",  cast(void**)& g_static_rw_lock_init},
+    { "g_static_rec_mutex_free",  cast(void**)& g_static_rec_mutex_free},
+    { "g_static_rec_mutex_unlock_full",  cast(void**)& g_static_rec_mutex_unlock_full},
+    { "g_static_rec_mutex_lock_full",  cast(void**)& g_static_rec_mutex_lock_full},
+    { "g_static_rec_mutex_unlock",  cast(void**)& g_static_rec_mutex_unlock},
+    { "g_static_rec_mutex_trylock",  cast(void**)& g_static_rec_mutex_trylock},
+    { "g_static_rec_mutex_lock",  cast(void**)& g_static_rec_mutex_lock},
+    { "g_static_rec_mutex_init",  cast(void**)& g_static_rec_mutex_init},
+    { "g_static_private_free",  cast(void**)& g_static_private_free},
+    { "g_static_private_set",  cast(void**)& g_static_private_set},
+    { "g_static_private_get",  cast(void**)& g_static_private_get},
+    { "g_static_private_init",  cast(void**)& g_static_private_init},
+    { "g_static_mutex_free",  cast(void**)& g_static_mutex_free},
+    { "g_static_mutex_init",  cast(void**)& g_static_mutex_init},
+    { "g_thread_set_priority",  cast(void**)& g_thread_set_priority},
+    { "g_thread_join",  cast(void**)& g_thread_join},
+    { "g_thread_exit",  cast(void**)& g_thread_exit},
+    { "g_thread_self",  cast(void**)& g_thread_self},
+    { "g_thread_create_full",  cast(void**)& g_thread_create_full},
+    { "g_static_mutex_get_mutex_impl",  cast(void**)& g_static_mutex_get_mutex_impl},
+    { "g_thread_init_with_errorcheck_mutexes",  cast(void**)& g_thread_init_with_errorcheck_mutexes},
+    { "g_thread_init",  cast(void**)& g_thread_init},
+    { "g_thread_gettime",  cast(void**)& g_thread_gettime},
+    { "g_threads_got_initialized",  cast(void**)& g_threads_got_initialized},
+    { "g_thread_use_default_impl",  cast(void**)& g_thread_use_default_impl},
+    { "g_thread_functions_for_glib_use",  cast(void**)& g_thread_functions_for_glib_use},
+    { "g_thread_error_quark",  cast(void**)& g_thread_error_quark},
+    { "g_atomic_pointer_set",  cast(void**)& g_atomic_pointer_set},
+    { "g_atomic_pointer_get",  cast(void**)& g_atomic_pointer_get},
+    { "g_atomic_int_set",  cast(void**)& g_atomic_int_set},
+    { "g_atomic_int_get",  cast(void**)& g_atomic_int_get},
+    { "g_atomic_pointer_compare_and_exchange",  cast(void**)& g_atomic_pointer_compare_and_exchange},
+    { "g_atomic_int_compare_and_exchange",  cast(void**)& g_atomic_int_compare_and_exchange},
+    { "g_atomic_int_add",  cast(void**)& g_atomic_int_add},
+    { "g_atomic_int_exchange_and_add",  cast(void**)& g_atomic_int_exchange_and_add},
+    { "glib_check_version",  cast(void**)& glib_check_version},
+    { "glib_binary_age",  cast(void**)& glib_binary_age},
+    { "glib_interface_age",  cast(void**)& glib_interface_age},
+    { "glib_micro_version",  cast(void**)& glib_micro_version},
+    { "glib_minor_version",  cast(void**)& glib_minor_version},
+    { "glib_major_version",  cast(void**)& glib_major_version},
+    { "g_trash_stack_height",  cast(void**)& g_trash_stack_height},
+    { "g_trash_stack_peek",  cast(void**)& g_trash_stack_peek},
+    { "g_trash_stack_pop",  cast(void**)& g_trash_stack_pop},
+    { "g_trash_stack_push",  cast(void**)& g_trash_stack_push},
+    { "g_bit_storage",  cast(void**)& g_bit_storage},
+    { "g_bit_nth_msf",  cast(void**)& g_bit_nth_msf},
+    { "g_bit_nth_lsf",  cast(void**)& g_bit_nth_lsf},
+    { "g_find_program_in_path",  cast(void**)& g_find_program_in_path},
+    { "g_atexit",  cast(void**)& g_atexit},
+    { "_g_getenv_nomalloc",  cast(void**)& _g_getenv_nomalloc},
+    { "g_listenv",  cast(void**)& g_listenv},
+    { "g_unsetenv",  cast(void**)& g_unsetenv},
+    { "g_setenv",  cast(void**)& g_setenv},
+    { "g_getenv",  cast(void**)& g_getenv},
+    { "g_nullify_pointer",  cast(void**)& g_nullify_pointer},
+    { "g_path_get_dirname",  cast(void**)& g_path_get_dirname},
+    { "g_path_get_basename",  cast(void**)& g_path_get_basename},
+    { "g_get_current_dir",  cast(void**)& g_get_current_dir},
+    { "g_basename",  cast(void**)& g_basename},
+    { "g_path_skip_root",  cast(void**)& g_path_skip_root},
+    { "g_path_is_absolute",  cast(void**)& g_path_is_absolute},
+    { "g_vsnprintf",  cast(void**)& g_vsnprintf},
+    { "g_snprintf",  cast(void**)& g_snprintf},
+    { "g_parse_debug_string",  cast(void**)& g_parse_debug_string},
+    { "g_get_user_special_dir",  cast(void**)& g_get_user_special_dir},
+    { "g_get_language_names",  cast(void**)& g_get_language_names},
+    { "g_get_system_config_dirs",  cast(void**)& g_get_system_config_dirs},
+    { "g_get_system_data_dirs",  cast(void**)& g_get_system_data_dirs},
+    { "g_get_user_cache_dir",  cast(void**)& g_get_user_cache_dir},
+    { "g_get_user_config_dir",  cast(void**)& g_get_user_config_dir},
+    { "g_get_user_data_dir",  cast(void**)& g_get_user_data_dir},
+    { "g_set_application_name",  cast(void**)& g_set_application_name},
+    { "g_get_application_name",  cast(void**)& g_get_application_name},
+    { "g_set_prgname",  cast(void**)& g_set_prgname},
+    { "g_get_prgname",  cast(void**)& g_get_prgname},
+    { "g_get_host_name",  cast(void**)& g_get_host_name},
+    { "g_get_tmp_dir",  cast(void**)& g_get_tmp_dir},
+    { "g_get_home_dir",  cast(void**)& g_get_home_dir},
+    { "g_get_real_name",  cast(void**)& g_get_real_name},
+    { "g_get_user_name",  cast(void**)& g_get_user_name},
+    { "g_clear_error",  cast(void**)& g_clear_error},
+    { "g_propagate_error",  cast(void**)& g_propagate_error},
+    { "g_set_error",  cast(void**)& g_set_error},
+    { "g_error_matches",  cast(void**)& g_error_matches},
+    { "g_error_copy",  cast(void**)& g_error_copy},
+    { "g_error_free",  cast(void**)& g_error_free},
+    { "g_error_new_literal",  cast(void**)& g_error_new_literal},
+    { "g_error_new",  cast(void**)& g_error_new},
+    { "g_intern_static_string",  cast(void**)& g_intern_static_string},
+    { "g_intern_string",  cast(void**)& g_intern_string},
+    { "g_quark_to_string",  cast(void**)& g_quark_to_string},
+    { "g_quark_from_string",  cast(void**)& g_quark_from_string},
+    { "g_quark_from_static_string",  cast(void**)& g_quark_from_static_string},
+    { "g_quark_try_string",  cast(void**)& g_quark_try_string},
+    { "g_byte_array_sort_with_data",  cast(void**)& g_byte_array_sort_with_data},
+    { "g_byte_array_sort",  cast(void**)& g_byte_array_sort},
+    { "g_byte_array_remove_range",  cast(void**)& g_byte_array_remove_range},
+    { "g_byte_array_remove_index_fast",  cast(void**)& g_byte_array_remove_index_fast},
+    { "g_byte_array_remove_index",  cast(void**)& g_byte_array_remove_index},
+    { "g_byte_array_set_size",  cast(void**)& g_byte_array_set_size},
+    { "g_byte_array_prepend",  cast(void**)& g_byte_array_prepend},
+    { "g_byte_array_append",  cast(void**)& g_byte_array_append},
+    { "g_byte_array_free",  cast(void**)& g_byte_array_free},
+    { "g_byte_array_sized_new",  cast(void**)& g_byte_array_sized_new},
+    { "g_byte_array_new",  cast(void**)& g_byte_array_new},
+    { "g_ptr_array_foreach",  cast(void**)& g_ptr_array_foreach},
+    { "g_ptr_array_sort_with_data",  cast(void**)& g_ptr_array_sort_with_data},
+    { "g_ptr_array_sort",  cast(void**)& g_ptr_array_sort},
+    { "g_ptr_array_add",  cast(void**)& g_ptr_array_add},
+    { "g_ptr_array_remove_range",  cast(void**)& g_ptr_array_remove_range},
+    { "g_ptr_array_remove_fast",  cast(void**)& g_ptr_array_remove_fast},
+    { "g_ptr_array_remove",  cast(void**)& g_ptr_array_remove},
+    { "g_ptr_array_remove_index_fast",  cast(void**)& g_ptr_array_remove_index_fast},
+    { "g_ptr_array_remove_index",  cast(void**)& g_ptr_array_remove_index},
+    { "g_ptr_array_set_size",  cast(void**)& g_ptr_array_set_size},
+    { "g_ptr_array_free",  cast(void**)& g_ptr_array_free},
+    { "g_ptr_array_sized_new",  cast(void**)& g_ptr_array_sized_new},
+    { "g_ptr_array_new",  cast(void**)& g_ptr_array_new},
+    { "g_array_sort_with_data",  cast(void**)& g_array_sort_with_data},
+    { "g_array_sort",  cast(void**)& g_array_sort},
+    { "g_array_remove_range",  cast(void**)& g_array_remove_range},
+    { "g_array_remove_index_fast",  cast(void**)& g_array_remove_index_fast},
+    { "g_array_remove_index",  cast(void**)& g_array_remove_index},
+    { "g_array_set_size",  cast(void**)& g_array_set_size},
+    { "g_array_insert_vals",  cast(void**)& g_array_insert_vals},
+    { "g_array_prepend_vals",  cast(void**)& g_array_prepend_vals},
+    { "g_array_append_vals",  cast(void**)& g_array_append_vals},
+    { "g_array_free",  cast(void**)& g_array_free},
+    { "g_array_sized_new",  cast(void**)& g_array_sized_new},
+    { "g_array_new",  cast(void**)& g_array_new},
+];
+
+} else { // version(DYNLINK)
+extern (C) void g_value_set_string_take_ownership(_GValue *, char *);
+extern (C) void g_value_take_string(_GValue *, char *);
+extern (C) char * g_strdup_value_contents(_GValue *);
+extern (C) uint g_pointer_type_register_static(char *);
+extern (C) uint g_value_get_gtype(_GValue *);
+extern (C) void g_value_set_gtype(_GValue *, uint);
+extern (C) uint g_gtype_get_type();
+extern (C) void * g_value_get_pointer(_GValue *);
+extern (C) void g_value_set_pointer(_GValue *, void *);
+extern (C) char * g_value_dup_string(_GValue *);
+extern (C) char * g_value_get_string(_GValue *);
+extern (C) void g_value_set_static_string(_GValue *, char *);
+extern (C) void g_value_set_string(_GValue *, char *);
+extern (C) double g_value_get_double(_GValue *);
+extern (C) void g_value_set_double(_GValue *, double);
+extern (C) float g_value_get_float(_GValue *);
+extern (C) void g_value_set_float(_GValue *, float);
+extern (C) ulong g_value_get_uint64(_GValue *);
+extern (C) void g_value_set_uint64(_GValue *, ulong);
+extern (C) long g_value_get_int64(_GValue *);
+extern (C) void g_value_set_int64(_GValue *, long);
+extern (C) uint g_value_get_ulong(_GValue *);
+extern (C) void g_value_set_ulong(_GValue *, uint);
+extern (C) int g_value_get_long(_GValue *);
+extern (C) void g_value_set_long(_GValue *, int);
+extern (C) uint g_value_get_uint(_GValue *);
+extern (C) void g_value_set_uint(_GValue *, uint);
+extern (C) int g_value_get_int(_GValue *);
+extern (C) void g_value_set_int(_GValue *, int);
+extern (C) int g_value_get_boolean(_GValue *);
+extern (C) void g_value_set_boolean(_GValue *, int);
+extern (C) char g_value_get_uchar(_GValue *);
+extern (C) void g_value_set_uchar(_GValue *, char);
+extern (C) char g_value_get_char(_GValue *);
+extern (C) void g_value_set_char(_GValue *, char);
+extern (C) _GValueArray * g_value_array_sort_with_data(_GValueArray *, _BCD_func__2968, void *);
+extern (C) _GValueArray * g_value_array_sort(_GValueArray *, _BCD_func__2969);
+extern (C) _GValueArray * g_value_array_remove(_GValueArray *, uint);
+extern (C) _GValueArray * g_value_array_insert(_GValueArray *, uint, _GValue *);
+extern (C) _GValueArray * g_value_array_append(_GValueArray *, _GValue *);
+extern (C) _GValueArray * g_value_array_prepend(_GValueArray *, _GValue *);
+extern (C) _GValueArray * g_value_array_copy(_GValueArray *);
+extern (C) void g_value_array_free(_GValueArray *);
+extern (C) _GValueArray * g_value_array_new(uint);
+extern (C) _GValue * g_value_array_get_nth(_GValueArray *, uint);
+extern (C) void g_type_plugin_complete_interface_info(void *, uint, uint, _GInterfaceInfo *);
+extern (C) void g_type_plugin_complete_type_info(void *, uint, _GTypeInfo *, _GTypeValueTable *);
+extern (C) void g_type_plugin_unuse(void *);
+extern (C) void g_type_plugin_use(void *);
+extern (C) uint g_type_plugin_get_type();
+extern (C) uint g_type_module_register_flags(_GTypeModule *, char *, _GFlagsValue *);
+extern (C) uint g_type_module_register_enum(_GTypeModule *, char *, _GEnumValue *);
+extern (C) void g_type_module_add_interface(_GTypeModule *, uint, uint, _GInterfaceInfo *);
+extern (C) uint g_type_module_register_type(_GTypeModule *, uint, char *, _GTypeInfo *, int);
+extern (C) void g_type_module_set_name(_GTypeModule *, char *);
+extern (C) void g_type_module_unuse(_GTypeModule *);
+extern (C) int g_type_module_use(_GTypeModule *);
+extern (C) uint g_type_module_get_type();
+extern (C) uint g_io_condition_get_type();
+extern (C) uint g_io_channel_get_type();
+extern (C) void g_source_set_closure(_GSource *, _GClosure *);
+extern (C) extern uint * g_param_spec_types;
+extern (C) _GParamSpec * g_param_spec_gtype(char *, char *, char *, uint, int);
+extern (C) _GParamSpec * g_param_spec_override(char *, _GParamSpec *);
+extern (C) _GParamSpec * g_param_spec_object(char *, char *, char *, uint, int);
+extern (C) _GParamSpec * g_param_spec_value_array(char *, char *, char *, _GParamSpec *, int);
+extern (C) _GParamSpec * g_param_spec_pointer(char *, char *, char *, int);
+extern (C) _GParamSpec * g_param_spec_boxed(char *, char *, char *, uint, int);
+extern (C) _GParamSpec * g_param_spec_param(char *, char *, char *, uint, int);
+extern (C) _GParamSpec * g_param_spec_string(char *, char *, char *, char *, int);
+extern (C) _GParamSpec * g_param_spec_double(char *, char *, char *, double, double, double, int);
+extern (C) _GParamSpec * g_param_spec_float(char *, char *, char *, float, float, float, int);
+extern (C) _GParamSpec * g_param_spec_flags(char *, char *, char *, uint, uint, int);
+extern (C) _GParamSpec * g_param_spec_enum(char *, char *, char *, uint, int, int);
+extern (C) _GParamSpec * g_param_spec_unichar(char *, char *, char *, uint, int);
+extern (C) _GParamSpec * g_param_spec_uint64(char *, char *, char *, ulong, ulong, ulong, int);
+extern (C) _GParamSpec * g_param_spec_int64(char *, char *, char *, long, long, long, int);
+extern (C) _GParamSpec * g_param_spec_ulong(char *, char *, char *, uint, uint, uint, int);
+extern (C) _GParamSpec * g_param_spec_long(char *, char *, char *, int, int, int, int);
+extern (C) _GParamSpec * g_param_spec_uint(char *, char *, char *, uint, uint, uint, int);
+extern (C) _GParamSpec * g_param_spec_int(char *, char *, char *, int, int, int, int);
+extern (C) _GParamSpec * g_param_spec_boolean(char *, char *, char *, int, int);
+extern (C) _GParamSpec * g_param_spec_uchar(char *, char *, char *, char, char, char, int);
+extern (C) _GParamSpec * g_param_spec_char(char *, char *, char *, char, char, char, int);
+extern (C) uint g_object_compat_control(uint, void *);
+extern (C) void g_value_set_object_take_ownership(_GValue *, void *);
+extern (C) void g_value_take_object(_GValue *, void *);
+extern (C) void g_object_run_dispose(_GObject *);
+extern (C) void g_object_force_floating(_GObject *);
+extern (C) uint g_signal_connect_object(void *, char *, _BCD_func__2331, void *, int);
+extern (C) void * g_value_dup_object(_GValue *);
+extern (C) void * g_value_get_object(_GValue *);
+extern (C) void g_value_set_object(_GValue *, void *);
+extern (C) _GClosure * g_closure_new_object(uint, _GObject *);
+extern (C) _GClosure * g_cclosure_new_object_swap(_BCD_func__2331, _GObject *);
+extern (C) _GClosure * g_cclosure_new_object(_BCD_func__2331, _GObject *);
+extern (C) void g_object_watch_closure(_GObject *, _GClosure *);
+extern (C) void * g_object_steal_data(_GObject *, char *);
+extern (C) void g_object_set_data_full(_GObject *, char *, void *, _BCD_func__2417);
+extern (C) void g_object_set_data(_GObject *, char *, void *);
+extern (C) void * g_object_get_data(_GObject *, char *);
+extern (C) void * g_object_steal_qdata(_GObject *, uint);
+extern (C) void g_object_set_qdata_full(_GObject *, uint, void *, _BCD_func__2417);
+extern (C) void g_object_set_qdata(_GObject *, uint, void *);
+extern (C) void * g_object_get_qdata(_GObject *, uint);
+extern (C) void g_object_remove_toggle_ref(_GObject *, _BCD_func__2274, void *);
+extern (C) void g_object_add_toggle_ref(_GObject *, _BCD_func__2274, void *);
+extern (C) void g_object_remove_weak_pointer(_GObject *, void * *);
+extern (C) void g_object_add_weak_pointer(_GObject *, void * *);
+extern (C) void g_object_weak_unref(_GObject *, _BCD_func__2280, void *);
+extern (C) void g_object_weak_ref(_GObject *, _BCD_func__2280, void *);
+extern (C) void g_object_unref(void *);
+extern (C) void * g_object_ref(void *);
+extern (C) void * g_object_ref_sink(void *);
+extern (C) int g_object_is_floating(void *);
+extern (C) void g_object_thaw_notify(_GObject *);
+extern (C) void g_object_notify(_GObject *, char *);
+extern (C) void g_object_freeze_notify(_GObject *);
+extern (C) void g_object_get_property(_GObject *, char *, _GValue *);
+extern (C) void g_object_set_property(_GObject *, char *, _GValue *);
+extern (C) void g_object_get_valist(_GObject *, char *, char *);
+extern (C) void g_object_set_valist(_GObject *, char *, char *);
+extern (C) void g_object_disconnect(void *, char *, ...);
+extern (C) void * g_object_connect(void *, char *, ...);
+extern (C) void g_object_get(void *, char *, ...);
+extern (C) void g_object_set(void *, char *, ...);
+extern (C) _GObject * g_object_new_valist(uint, char *, char *);
+extern (C) void * g_object_newv(uint, uint, _GParameter *);
+extern (C) void * g_object_new(uint, char *, ...);
+extern (C) _GParamSpec * * g_object_interface_list_properties(void *, uint *);
+extern (C) _GParamSpec * g_object_interface_find_property(void *, char *);
+extern (C) void g_object_interface_install_property(void *, _GParamSpec *);
+extern (C) void g_object_class_override_property(_GObjectClass *, uint, char *);
+extern (C) _GParamSpec * * g_object_class_list_properties(_GObjectClass *, uint *);
+extern (C) _GParamSpec * g_object_class_find_property(_GObjectClass *, char *);
+extern (C) void g_object_class_install_property(_GObjectClass *, uint, _GParamSpec *);
+extern (C) uint g_initially_unowned_get_type();
+extern (C) void _g_signals_destroy(uint);
+extern (C) void g_signal_handlers_destroy(void *);
+extern (C) int g_signal_accumulator_true_handled(_GSignalInvocationHint *, _GValue *, _GValue *, void *);
+extern (C) void g_signal_chain_from_overridden(_GValue *, _GValue *);
+extern (C) void g_signal_override_class_closure(uint, uint, _GClosure *);
+extern (C) uint g_signal_handlers_disconnect_matched(void *, int, uint, uint, _GClosure *, void *, void *);
+extern (C) uint g_signal_handlers_unblock_matched(void *, int, uint, uint, _GClosure *, void *, void *);
+extern (C) uint g_signal_handlers_block_matched(void *, int, uint, uint, _GClosure *, void *, void *);
+extern (C) uint g_signal_handler_find(void *, int, uint, uint, _GClosure *, void *, void *);
+extern (C) int g_signal_handler_is_connected(void *, uint);
+extern (C) void g_signal_handler_disconnect(void *, uint);
+extern (C) void g_signal_handler_unblock(void *, uint);
+extern (C) void g_signal_handler_block(void *, uint);
+extern (C) uint g_signal_connect_data(void *, char *, _BCD_func__2331, void *, _BCD_func__2330, int);
+extern (C) uint g_signal_connect_closure(void *, char *, _GClosure *, int);
+extern (C) uint g_signal_connect_closure_by_id(void *, uint, uint, _GClosure *, int);
+extern (C) int g_signal_has_handler_pending(void *, uint, uint, int);
+extern (C) void g_signal_remove_emission_hook(uint, uint);
+extern (C) uint g_signal_add_emission_hook(uint, uint, _BCD_func__2310, void *, _BCD_func__2417);
+extern (C) void g_signal_stop_emission_by_name(void *, char *);
+extern (C) void g_signal_stop_emission(void *, uint, uint);
+extern (C) _GSignalInvocationHint * g_signal_get_invocation_hint(void *);
+extern (C) int g_signal_parse_name(char *, uint, uint *, uint *, int);
+extern (C) uint * g_signal_list_ids(uint, uint *);
+extern (C) void g_signal_query(uint, _GSignalQuery *);
+extern (C) char * g_signal_name(uint);
+extern (C) uint g_signal_lookup(char *, uint);
+extern (C) void g_signal_emit_by_name(void *, char *, ...);
+extern (C) void g_signal_emit(void *, uint, uint, ...);
+extern (C) void g_signal_emit_valist(void *, uint, uint, char *);
+extern (C) void g_signal_emitv(_GValue *, uint, uint, _GValue *);
+extern (C) uint g_signal_new(char *, uint, int, uint, _BCD_func__2309, void *, _BCD_func__2311, uint, uint, ...);
+extern (C) uint g_signal_new_valist(char *, uint, int, _GClosure *, _BCD_func__2309, void *, _BCD_func__2311, uint, uint, char *);
+extern (C) uint g_signal_newv(char *, uint, int, _GClosure *, _BCD_func__2309, void *, _BCD_func__2311, uint, uint, uint *);
+extern (C) void g_cclosure_marshal_STRING__OBJECT_POINTER(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void g_cclosure_marshal_BOOLEAN__FLAGS(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void g_cclosure_marshal_VOID__UINT_POINTER(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void g_cclosure_marshal_VOID__OBJECT(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void g_cclosure_marshal_VOID__POINTER(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void g_cclosure_marshal_VOID__BOXED(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void g_cclosure_marshal_VOID__PARAM(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void g_cclosure_marshal_VOID__STRING(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void g_cclosure_marshal_VOID__DOUBLE(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void g_cclosure_marshal_VOID__FLOAT(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void g_cclosure_marshal_VOID__FLAGS(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void g_cclosure_marshal_VOID__ENUM(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void g_cclosure_marshal_VOID__ULONG(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void g_cclosure_marshal_VOID__LONG(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void g_cclosure_marshal_VOID__UINT(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void g_cclosure_marshal_VOID__INT(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void g_cclosure_marshal_VOID__UCHAR(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void g_cclosure_marshal_VOID__CHAR(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void g_cclosure_marshal_VOID__BOOLEAN(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void g_cclosure_marshal_VOID__VOID(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void g_closure_invoke(_GClosure *, _GValue *, uint, _GValue *, void *);
+extern (C) void g_closure_invalidate(_GClosure *);
+extern (C) void g_closure_set_meta_marshal(_GClosure *, void *, _BCD_func__2311);
+extern (C) void g_closure_set_marshal(_GClosure *, _BCD_func__2311);
+extern (C) void g_closure_add_marshal_guards(_GClosure *, void *, _BCD_func__2330, void *, _BCD_func__2330);
+extern (C) void g_closure_remove_invalidate_notifier(_GClosure *, void *, _BCD_func__2330);
+extern (C) void g_closure_add_invalidate_notifier(_GClosure *, void *, _BCD_func__2330);
+extern (C) void g_closure_remove_finalize_notifier(_GClosure *, void *, _BCD_func__2330);
+extern (C) void g_closure_add_finalize_notifier(_GClosure *, void *, _BCD_func__2330);
+extern (C) _GClosure * g_closure_new_simple(uint, void *);
+extern (C) void g_closure_unref(_GClosure *);
+extern (C) void g_closure_sink(_GClosure *);
+extern (C) _GClosure * g_closure_ref(_GClosure *);
+extern (C) _GClosure * g_signal_type_cclosure_new(uint, uint);
+extern (C) _GClosure * g_cclosure_new_swap(_BCD_func__2331, void *, _BCD_func__2330);
+extern (C) _GClosure * g_cclosure_new(_BCD_func__2331, void *, _BCD_func__2330);
+extern (C) _GParamSpec * * g_param_spec_pool_list(void *, uint, uint *);
+extern (C) _GList * g_param_spec_pool_list_owned(void *, uint);
+extern (C) _GParamSpec * g_param_spec_pool_lookup(void *, char *, uint, int);
+extern (C) void g_param_spec_pool_remove(void *, _GParamSpec *);
+extern (C) void g_param_spec_pool_insert(void *, _GParamSpec *, uint);
+extern (C) void * g_param_spec_pool_new(int);
+extern (C) void * g_param_spec_internal(uint, char *, char *, char *, int);
+extern (C) uint _g_param_type_register_static_constant(char *, _GParamSpecTypeInfo *, uint);
+extern (C) uint g_param_type_register_static(char *, _GParamSpecTypeInfo *);
+extern (C) void g_value_set_param_take_ownership(_GValue *, _GParamSpec *);
+extern (C) void g_value_take_param(_GValue *, _GParamSpec *);
+extern (C) _GParamSpec * g_value_dup_param(_GValue *);
+extern (C) _GParamSpec * g_value_get_param(_GValue *);
+extern (C) void g_value_set_param(_GValue *, _GParamSpec *);
+extern (C) char * g_param_spec_get_blurb(_GParamSpec *);
+extern (C) char * g_param_spec_get_nick(_GParamSpec *);
+extern (C) char * g_param_spec_get_name(_GParamSpec *);
+extern (C) int g_param_values_cmp(_GParamSpec *, _GValue *, _GValue *);
+extern (C) int g_param_value_convert(_GParamSpec *, _GValue *, _GValue *, int);
+extern (C) int g_param_value_validate(_GParamSpec *, _GValue *);
+extern (C) int g_param_value_defaults(_GParamSpec *, _GValue *);
+extern (C) void g_param_value_set_default(_GParamSpec *, _GValue *);
+extern (C) _GParamSpec * g_param_spec_get_redirect_target(_GParamSpec *);
+extern (C) void * g_param_spec_steal_qdata(_GParamSpec *, uint);
+extern (C) void g_param_spec_set_qdata_full(_GParamSpec *, uint, void *, _BCD_func__2417);
+extern (C) void g_param_spec_set_qdata(_GParamSpec *, uint, void *);
+extern (C) void * g_param_spec_get_qdata(_GParamSpec *, uint);
+extern (C) _GParamSpec * g_param_spec_ref_sink(_GParamSpec *);
+extern (C) void g_param_spec_sink(_GParamSpec *);
+extern (C) void g_param_spec_unref(_GParamSpec *);
+extern (C) _GParamSpec * g_param_spec_ref(_GParamSpec *);
+extern (C) void g_value_register_transform_func(uint, uint, _BCD_func__2389);
+extern (C) int g_value_transform(_GValue *, _GValue *);
+extern (C) int g_value_type_transformable(uint, uint);
+extern (C) int g_value_type_compatible(uint, uint);
+extern (C) void * g_value_peek_pointer(_GValue *);
+extern (C) int g_value_fits_pointer(_GValue *);
+extern (C) void g_value_set_instance(_GValue *, void *);
+extern (C) void g_value_unset(_GValue *);
+extern (C) _GValue * g_value_reset(_GValue *);
+extern (C) void g_value_copy(_GValue *, _GValue *);
+extern (C) _GValue * g_value_init(_GValue *, uint);
+extern (C) void g_flags_complete_type_info(uint, _GTypeInfo *, _GFlagsValue *);
+extern (C) void g_enum_complete_type_info(uint, _GTypeInfo *, _GEnumValue *);
+extern (C) uint g_flags_register_static(char *, _GFlagsValue *);
+extern (C) uint g_enum_register_static(char *, _GEnumValue *);
+extern (C) uint g_value_get_flags(_GValue *);
+extern (C) void g_value_set_flags(_GValue *, uint);
+extern (C) int g_value_get_enum(_GValue *);
+extern (C) void g_value_set_enum(_GValue *, int);
+extern (C) _GFlagsValue * g_flags_get_value_by_nick(_GFlagsClass *, char *);
+extern (C) _GFlagsValue * g_flags_get_value_by_name(_GFlagsClass *, char *);
+extern (C) _GFlagsValue * g_flags_get_first_value(_GFlagsClass *, uint);
+extern (C) _GEnumValue * g_enum_get_value_by_nick(_GEnumClass *, char *);
+extern (C) _GEnumValue * g_enum_get_value_by_name(_GEnumClass *, char *);
+extern (C) _GEnumValue * g_enum_get_value(_GEnumClass *, int);
+extern (C) uint g_regex_get_type();
+extern (C) uint g_hash_table_get_type();
+extern (C) uint g_gstring_get_type();
+extern (C) uint g_strv_get_type();
+extern (C) uint g_date_get_type();
+extern (C) uint g_value_array_get_type();
+extern (C) uint g_value_get_type();
+extern (C) uint g_closure_get_type();
+extern (C) void g_value_set_boxed_take_ownership(_GValue *, void *);
+extern (C) void g_value_take_boxed(_GValue *, void *);
+extern (C) uint g_boxed_type_register_static(char *, _BCD_func__2418, _BCD_func__2417);
+extern (C) void * g_value_dup_boxed(_GValue *);
+extern (C) void * g_value_get_boxed(_GValue *);
+extern (C) void g_value_set_static_boxed(_GValue *, void *);
+extern (C) void g_value_set_boxed(_GValue *, void *);
+extern (C) void g_boxed_free(uint, void *);
+extern (C) void * g_boxed_copy(uint, void *);
+extern (C) extern int _g_type_debug_flags;
+extern (C) void g_signal_init();
+extern (C) void g_value_transforms_init();
+extern (C) void g_param_spec_types_init();
+extern (C) void g_object_type_init();
+extern (C) void g_boxed_type_init();
+extern (C) void g_param_type_init();
+extern (C) void g_enum_types_init();
+extern (C) void g_value_types_init();
+extern (C) void g_value_c_init();
+extern (C) char * g_type_name_from_class(_GTypeClass *);
+extern (C) char * g_type_name_from_instance(_GTypeInstance *);
+extern (C) int g_type_test_flags(uint, uint);
+extern (C) int g_type_check_value_holds(_GValue *, uint);
+extern (C) int g_type_check_value(_GValue *);
+extern (C) int g_type_check_is_value_type(uint);
+extern (C) int g_type_check_class_is_a(_GTypeClass *, uint);
+extern (C) _GTypeClass * g_type_check_class_cast(_GTypeClass *, uint);
+extern (C) int g_type_check_instance_is_a(_GTypeInstance *, uint);
+extern (C) _GTypeInstance * g_type_check_instance_cast(_GTypeInstance *, uint);
+extern (C) int g_type_check_instance(_GTypeInstance *);
+extern (C) _GTypeValueTable * g_type_value_table_peek(uint);
+extern (C) void g_type_remove_interface_check(void *, _BCD_func__2422);
+extern (C) void g_type_add_interface_check(void *, _BCD_func__2422);
+extern (C) void g_type_class_unref_uncached(void *);
+extern (C) void g_type_remove_class_cache_func(void *, _BCD_func__2423);
+extern (C) void g_type_add_class_cache_func(void *, _BCD_func__2423);
+extern (C) void g_type_free_instance(_GTypeInstance *);
+extern (C) _GTypeInstance * g_type_create_instance(uint);
+extern (C) uint g_type_fundamental(uint);
+extern (C) uint g_type_fundamental_next();
+extern (C) void * g_type_interface_get_plugin(uint, uint);
+extern (C) void * g_type_get_plugin(uint);
+extern (C) void * g_type_instance_get_private(_GTypeInstance *, uint);
+extern (C) void g_type_class_add_private(void *, uint);
+extern (C) uint * g_type_interface_prerequisites(uint, uint *);
+extern (C) void g_type_interface_add_prerequisite(uint, uint);
+extern (C) void g_type_add_interface_dynamic(uint, uint, void *);
+extern (C) void g_type_add_interface_static(uint, uint, _GInterfaceInfo *);
+extern (C) uint g_type_register_fundamental(uint, char *, _GTypeInfo *, _GTypeFundamentalInfo *, int);
+extern (C) uint g_type_register_dynamic(uint, char *, void *, int);
+extern (C) uint g_type_register_static_simple(uint, char *, uint, _BCD_func__2422, uint, _BCD_func__2424, int);
+extern (C) uint g_type_register_static(uint, char *, _GTypeInfo *, int);
+extern (C) void g_type_query(uint, _GTypeQuery *);
+extern (C) void * g_type_get_qdata(uint, uint);
+extern (C) void g_type_set_qdata(uint, uint, void *);
+extern (C) uint * g_type_interfaces(uint, uint *);
+extern (C) uint * g_type_children(uint, uint *);
+extern (C) void g_type_default_interface_unref(void *);
+extern (C) void * g_type_default_interface_peek(uint);
+extern (C) void * g_type_default_interface_ref(uint);
+extern (C) void * g_type_interface_peek_parent(void *);
+extern (C) void * g_type_interface_peek(void *, uint);
+extern (C) void * g_type_class_peek_parent(void *);
+extern (C) void g_type_class_unref(void *);
+extern (C) void * g_type_class_peek_static(uint);
+extern (C) void * g_type_class_peek(uint);
+extern (C) void * g_type_class_ref(uint);
+extern (C) int g_type_is_a(uint, uint);
+extern (C) uint g_type_next_base(uint, uint);
+extern (C) uint g_type_depth(uint);
+extern (C) uint g_type_parent(uint);
+extern (C) uint g_type_from_name(char *);
+extern (C) uint g_type_qname(uint);
+extern (C) char * g_type_name(uint);
+extern (C) void g_type_init_with_debug_flags(int);
+extern (C) void g_type_init();
+extern (C) int g_tree_nnodes(void *);
+extern (C) int g_tree_height(void *);
+extern (C) void * g_tree_search(void *, _BCD_func__2969, void *);
+extern (C) void g_tree_traverse(void *, _BCD_func__2478, int, void *);
+extern (C) void g_tree_foreach(void *, _BCD_func__2478, void *);
+extern (C) int g_tree_lookup_extended(void *, void *, void * *, void * *);
+extern (C) void * g_tree_lookup(void *, void *);
+extern (C) int g_tree_steal(void *, void *);
+extern (C) int g_tree_remove(void *, void *);
+extern (C) void g_tree_replace(void *, void *, void *);
+extern (C) void g_tree_insert(void *, void *, void *);
+extern (C) void g_tree_destroy(void *);
+extern (C) void * g_tree_new_full(_BCD_func__2968, void *, _BCD_func__2417, _BCD_func__2417);
+extern (C) void * g_tree_new_with_data(_BCD_func__2968, void *);
+extern (C) void * g_tree_new(_BCD_func__2969);
+extern (C) char * g_time_val_to_iso8601(_GTimeVal *);
+extern (C) int g_time_val_from_iso8601(char *, _GTimeVal *);
+extern (C) void g_time_val_add(_GTimeVal *, int);
+extern (C) void g_usleep(uint);
+extern (C) double g_timer_elapsed(void *, uint *);
+extern (C) void g_timer_continue(void *);
+extern (C) void g_timer_reset(void *);
+extern (C) void g_timer_stop(void *);
+extern (C) void g_timer_start(void *);
+extern (C) void g_timer_destroy(void *);
+extern (C) void * g_timer_new();
+extern (C) uint g_thread_pool_get_max_idle_time();
+extern (C) void g_thread_pool_set_max_idle_time(uint);
+extern (C) void g_thread_pool_set_sort_function(_GThreadPool *, _BCD_func__2968, void *);
+extern (C) void g_thread_pool_stop_unused_threads();
+extern (C) uint g_thread_pool_get_num_unused_threads();
+extern (C) int g_thread_pool_get_max_unused_threads();
+extern (C) void g_thread_pool_set_max_unused_threads(int);
+extern (C) void g_thread_pool_free(_GThreadPool *, int, int);
+extern (C) uint g_thread_pool_unprocessed(_GThreadPool *);
+extern (C) uint g_thread_pool_get_num_threads(_GThreadPool *);
+extern (C) int g_thread_pool_get_max_threads(_GThreadPool *);
+extern (C) void g_thread_pool_set_max_threads(_GThreadPool *, int, _GError * *);
+extern (C) void g_thread_pool_push(_GThreadPool *, void *, _GError * *);
+extern (C) _GThreadPool * g_thread_pool_new(_BCD_func__2422, void *, int, int, _GError * *);
+extern (C) char * g_strip_context(char *, char *);
+extern (C) char * g_stpcpy(char *, char *);
+extern (C) uint g_strv_length(char * *);
+extern (C) char * * g_strdupv(char * *);
+extern (C) void g_strfreev(char * *);
+extern (C) char * g_strjoinv(char *, char * *);
+extern (C) char * * g_strsplit_set(char *, char *, int);
+extern (C) char * * g_strsplit(char *, char *, int);
+extern (C) void * g_memdup(void *, uint);
+extern (C) char * g_strescape(char *, char *);
+extern (C) char * g_strcompress(char *);
+extern (C) char * g_strjoin(char *, ...);
+extern (C) char * g_strconcat(char *, ...);
+extern (C) char * g_strnfill(uint, char);
+extern (C) char * g_strndup(char *, uint);
+extern (C) char * g_strdup_vprintf(char *, char *);
+extern (C) char * g_strdup_printf(char *, ...);
+extern (C) char * g_strdup(char *);
+extern (C) char * g_strup(char *);
+extern (C) char * g_strdown(char *);
+extern (C) int g_strncasecmp(char *, char *, uint);
+extern (C) int g_strcasecmp(char *, char *);
+extern (C) char * g_ascii_strup(char *, int);
+extern (C) char * g_ascii_strdown(char *, int);
+extern (C) int g_ascii_strncasecmp(char *, char *, uint);
+extern (C) int g_ascii_strcasecmp(char *, char *);
+extern (C) char * g_strchomp(char *);
+extern (C) char * g_strchug(char *);
+extern (C) char * g_ascii_formatd(char *, int, char *, double);
+extern (C) char * g_ascii_dtostr(char *, int, double);
+extern (C) long g_ascii_strtoll(char *, char * *, uint);
+extern (C) ulong g_ascii_strtoull(char *, char * *, uint);
+extern (C) double g_ascii_strtod(char *, char * *);
+extern (C) double g_strtod(char *, char * *);
+extern (C) int g_str_has_prefix(char *, char *);
+extern (C) int g_str_has_suffix(char *, char *);
+extern (C) char * g_strrstr_len(char *, int, char *);
+extern (C) char * g_strrstr(char *, char *);
+extern (C) char * g_strstr_len(char *, int, char *);
+extern (C) uint g_strlcat(char *, char *, uint);
+extern (C) uint g_strlcpy(char *, char *, uint);
+extern (C) char * g_strreverse(char *);
+extern (C) char * g_strsignal(int);
+extern (C) char * g_strerror(int);
+extern (C) char * g_strcanon(char *, char *, char);
+extern (C) char * g_strdelimit(char *, char *, char);
+extern (C) int g_ascii_xdigit_value(char);
+extern (C) int g_ascii_digit_value(char);
+extern (C) char g_ascii_toupper(char);
+extern (C) char g_ascii_tolower(char);
+extern (C) extern ushort * g_ascii_table;
+extern (C) void g_spawn_close_pid(int);
+extern (C) int g_spawn_command_line_async(char *, _GError * *);
+extern (C) int g_spawn_command_line_sync(char *, char * *, char * *, int *, _GError * *);
+extern (C) int g_spawn_sync(char *, char * *, char * *, int, _BCD_func__2417, void *, char * *, char * *, int *, _GError * *);
+extern (C) int g_spawn_async_with_pipes(char *, char * *, char * *, int, _BCD_func__2417, void *, int *, int *, int *, int *, _GError * *);
+extern (C) int g_spawn_async(char *, char * *, char * *, int, _BCD_func__2417, void *, int *, _GError * *);
+extern (C) uint g_spawn_error_quark();
+extern (C) int g_shell_parse_argv(char *, int *, char * * *, _GError * *);
+extern (C) char * g_shell_unquote(char *, _GError * *);
+extern (C) char * g_shell_quote(char *);
+extern (C) uint g_shell_error_quark();
+extern (C) void * g_sequence_range_get_midpoint(void *, void *);
+extern (C) int g_sequence_iter_compare(void *, void *);
+extern (C) void * g_sequence_iter_get_sequence(void *);
+extern (C) void * g_sequence_iter_move(void *, int);
+extern (C) int g_sequence_iter_get_position(void *);
+extern (C) void * g_sequence_iter_prev(void *);
+extern (C) void * g_sequence_iter_next(void *);
+extern (C) int g_sequence_iter_is_end(void *);
+extern (C) int g_sequence_iter_is_begin(void *);
+extern (C) void g_sequence_set(void *, void *);
+extern (C) void * g_sequence_get(void *);
+extern (C) void * g_sequence_search_iter(void *, void *, _BCD_func__2497, void *);
+extern (C) void * g_sequence_search(void *, void *, _BCD_func__2968, void *);
+extern (C) void g_sequence_move_range(void *, void *, void *);
+extern (C) void g_sequence_remove_range(void *, void *);
+extern (C) void g_sequence_remove(void *);
+extern (C) void g_sequence_sort_changed_iter(void *, _BCD_func__2497, void *);
+extern (C) void g_sequence_sort_changed(void *, _BCD_func__2968, void *);
+extern (C) void * g_sequence_insert_sorted_iter(void *, void *, _BCD_func__2497, void *);
+extern (C) void * g_sequence_insert_sorted(void *, void *, _BCD_func__2968, void *);
+extern (C) void g_sequence_swap(void *, void *);
+extern (C) void g_sequence_move(void *, void *);
+extern (C) void * g_sequence_insert_before(void *, void *);
+extern (C) void * g_sequence_prepend(void *, void *);
+extern (C) void * g_sequence_append(void *, void *);
+extern (C) void * g_sequence_get_iter_at_pos(void *, int);
+extern (C) void * g_sequence_get_end_iter(void *);
+extern (C) void * g_sequence_get_begin_iter(void *);
+extern (C) void g_sequence_sort_iter(void *, _BCD_func__2497, void *);
+extern (C) void g_sequence_sort(void *, _BCD_func__2968, void *);
+extern (C) void g_sequence_foreach_range(void *, void *, _BCD_func__2422, void *);
+extern (C) void g_sequence_foreach(void *, _BCD_func__2422, void *);
+extern (C) int g_sequence_get_length(void *);
+extern (C) void g_sequence_free(void *);
+extern (C) void * g_sequence_new(_BCD_func__2417);
+extern (C) void g_scanner_warn(_GScanner *, char *, ...);
+extern (C) void g_scanner_error(_GScanner *, char *, ...);
+extern (C) void g_scanner_unexp_token(_GScanner *, int, char *, char *, char *, char *, int);
+extern (C) void * g_scanner_lookup_symbol(_GScanner *, char *);
+extern (C) void g_scanner_scope_foreach_symbol(_GScanner *, uint, _BCD_func__2965, void *);
+extern (C) void * g_scanner_scope_lookup_symbol(_GScanner *, uint, char *);
+extern (C) void g_scanner_scope_remove_symbol(_GScanner *, uint, char *);
+extern (C) void g_scanner_scope_add_symbol(_GScanner *, uint, char *, void *);
+extern (C) uint g_scanner_set_scope(_GScanner *, uint);
+extern (C) int g_scanner_eof(_GScanner *);
+extern (C) uint g_scanner_cur_position(_GScanner *);
+extern (C) uint g_scanner_cur_line(_GScanner *);
+extern (C) _GTokenValue g_scanner_cur_value(_GScanner *);
+extern (C) int g_scanner_cur_token(_GScanner *);
+extern (C) int g_scanner_peek_next_token(_GScanner *);
+extern (C) int g_scanner_get_next_token(_GScanner *);
+extern (C) void g_scanner_input_text(_GScanner *, char *, uint);
+extern (C) void g_scanner_sync_file_offset(_GScanner *);
+extern (C) void g_scanner_input_file(_GScanner *, int);
+extern (C) void g_scanner_destroy(_GScanner *);
+extern (C) _GScanner * g_scanner_new(_GScannerConfig *);
+extern (C) char * * g_match_info_fetch_all(void *);
+extern (C) int g_match_info_fetch_named_pos(void *, char *, int *, int *);
+extern (C) char * g_match_info_fetch_named(void *, char *);
+extern (C) int g_match_info_fetch_pos(void *, int, int *, int *);
+extern (C) char * g_match_info_fetch(void *, int);
+extern (C) char * g_match_info_expand_references(void *, char *, _GError * *);
+extern (C) int g_match_info_is_partial_match(void *);
+extern (C) int g_match_info_get_match_count(void *);
+extern (C) int g_match_info_matches(void *);
+extern (C) int g_match_info_next(void *, _GError * *);
+extern (C) void g_match_info_free(void *);
+extern (C) char * g_match_info_get_string(void *);
+extern (C) void * g_match_info_get_regex(void *);
+extern (C) int g_regex_check_replacement(char *, int *, _GError * *);
+extern (C) char * g_regex_replace_eval(void *, char *, int, int, int, _BCD_func__2573, void *, _GError * *);
+extern (C) char * g_regex_replace_literal(void *, char *, int, int, char *, int, _GError * *);
+extern (C) char * g_regex_replace(void *, char *, int, int, char *, int, _GError * *);
+extern (C) char * * g_regex_split_full(void *, char *, int, int, int, int, _GError * *);
+extern (C) char * * g_regex_split(void *, char *, int);
+extern (C) char * * g_regex_split_simple(char *, char *, int, int);
+extern (C) int g_regex_match_all_full(void *, char *, int, int, int, void * *, _GError * *);
+extern (C) int g_regex_match_all(void *, char *, int, void * *);
+extern (C) int g_regex_match_full(void *, char *, int, int, int, void * *, _GError * *);
+extern (C) int g_regex_match(void *, char *, int, void * *);
+extern (C) int g_regex_match_simple(char *, char *, int, int);
+extern (C) char * g_regex_escape_string(char *, int);
+extern (C) int g_regex_get_string_number(void *, char *);
+extern (C) int g_regex_get_capture_count(void *);
+extern (C) int g_regex_get_max_backref(void *);
+extern (C) char * g_regex_get_pattern(void *);
+extern (C) void g_regex_unref(void *);
+extern (C) void * g_regex_ref(void *);
+extern (C) void * g_regex_new(char *, int, int, _GError * *);
+extern (C) uint g_regex_error_quark();
+extern (C) void * g_tuples_index(_GTuples *, int, int);
+extern (C) void g_tuples_destroy(_GTuples *);
+extern (C) void g_relation_print(void *);
+extern (C) int g_relation_exists(void *, ...);
+extern (C) int g_relation_count(void *, void *, int);
+extern (C) _GTuples * g_relation_select(void *, void *, int);
+extern (C) int g_relation_delete(void *, void *, int);
+extern (C) void g_relation_insert(void *, ...);
+extern (C) void g_relation_index(void *, int, _BCD_func__2966, _BCD_func__2967);
+extern (C) void g_relation_destroy(void *);
+extern (C) void * g_relation_new(int);
+extern (C) double g_random_double_range(double, double);
+extern (C) double g_random_double();
+extern (C) int g_random_int_range(int, int);
+extern (C) uint g_random_int();
+extern (C) void g_random_set_seed(uint);
+extern (C) double g_rand_double_range(void *, double, double);
+extern (C) double g_rand_double(void *);
+extern (C) int g_rand_int_range(void *, int, int);
+extern (C) uint g_rand_int(void *);
+extern (C) void g_rand_set_seed_array(void *, uint *, uint);
+extern (C) void g_rand_set_seed(void *, uint);
+extern (C) void * g_rand_copy(void *);
+extern (C) void g_rand_free(void *);
+extern (C) void * g_rand_new();
+extern (C) void * g_rand_new_with_seed_array(uint *, uint);
+extern (C) void * g_rand_new_with_seed(uint);
+extern (C) void g_queue_delete_link(_GQueue *, _GList *);
+extern (C) void g_queue_unlink(_GQueue *, _GList *);
+extern (C) int g_queue_link_index(_GQueue *, _GList *);
+extern (C) _GList * g_queue_peek_nth_link(_GQueue *, uint);
+extern (C) _GList * g_queue_peek_tail_link(_GQueue *);
+extern (C) _GList * g_queue_peek_head_link(_GQueue *);
+extern (C) _GList * g_queue_pop_nth_link(_GQueue *, uint);
+extern (C) _GList * g_queue_pop_tail_link(_GQueue *);
+extern (C) _GList * g_queue_pop_head_link(_GQueue *);
+extern (C) void g_queue_push_nth_link(_GQueue *, int, _GList *);
+extern (C) void g_queue_push_tail_link(_GQueue *, _GList *);
+extern (C) void g_queue_push_head_link(_GQueue *, _GList *);
+extern (C) void g_queue_insert_sorted(_GQueue *, void *, _BCD_func__2968, void *);
+extern (C) void g_queue_insert_after(_GQueue *, _GList *, void *);
+extern (C) void g_queue_insert_before(_GQueue *, _GList *, void *);
+extern (C) void g_queue_remove_all(_GQueue *, void *);
+extern (C) void g_queue_remove(_GQueue *, void *);
+extern (C) int g_queue_index(_GQueue *, void *);
+extern (C) void * g_queue_peek_nth(_GQueue *, uint);
+extern (C) void * g_queue_peek_tail(_GQueue *);
+extern (C) void * g_queue_peek_head(_GQueue *);
+extern (C) void * g_queue_pop_nth(_GQueue *, uint);
+extern (C) void * g_queue_pop_tail(_GQueue *);
+extern (C) void * g_queue_pop_head(_GQueue *);
+extern (C) void g_queue_push_nth(_GQueue *, void *, int);
+extern (C) void g_queue_push_tail(_GQueue *, void *);
+extern (C) void g_queue_push_head(_GQueue *, void *);
+extern (C) void g_queue_sort(_GQueue *, _BCD_func__2968, void *);
+extern (C) _GList * g_queue_find_custom(_GQueue *, void *, _BCD_func__2969);
+extern (C) _GList * g_queue_find(_GQueue *, void *);
+extern (C) void g_queue_foreach(_GQueue *, _BCD_func__2422, void *);
+extern (C) _GQueue * g_queue_copy(_GQueue *);
+extern (C) void g_queue_reverse(_GQueue *);
+extern (C) uint g_queue_get_length(_GQueue *);
+extern (C) int g_queue_is_empty(_GQueue *);
+extern (C) void g_queue_clear(_GQueue *);
+extern (C) void g_queue_init(_GQueue *);
+extern (C) void g_queue_free(_GQueue *);
+extern (C) _GQueue * g_queue_new();
+extern (C) void g_qsort_with_data(void *, int, uint, _BCD_func__2968, void *);
+extern (C) uint g_spaced_primes_closest(uint);
+extern (C) int g_pattern_match_simple(char *, char *);
+extern (C) int g_pattern_match_string(void *, char *);
+extern (C) int g_pattern_match(void *, uint, char *, char *);
+extern (C) int g_pattern_spec_equal(void *, void *);
+extern (C) void g_pattern_spec_free(void *);
+extern (C) void * g_pattern_spec_new(char *);
+extern (C) void g_option_group_set_translation_domain(void *, char *);
+extern (C) void g_option_group_set_translate_func(void *, _BCD_func__2964, void *, _BCD_func__2417);
+extern (C) void g_option_group_add_entries(void *, _GOptionEntry *);
+extern (C) void g_option_group_free(void *);
+extern (C) void g_option_group_set_error_hook(void *, _BCD_func__2591);
+extern (C) void g_option_group_set_parse_hooks(void *, _BCD_func__2592, _BCD_func__2592);
+extern (C) void * g_option_group_new(char *, char *, char *, void *, _BCD_func__2417);
+extern (C) char * g_option_context_get_help(void *, int, void *);
+extern (C) void * g_option_context_get_main_group(void *);
+extern (C) void g_option_context_set_main_group(void *, void *);
+extern (C) void g_option_context_add_group(void *, void *);
+extern (C) void g_option_context_set_translation_domain(void *, char *);
+extern (C) void g_option_context_set_translate_func(void *, _BCD_func__2964, void *, _BCD_func__2417);
+extern (C) int g_option_context_parse(void *, int *, char * * *, _GError * *);
+extern (C) void g_option_context_add_main_entries(void *, _GOptionEntry *, char *);
+extern (C) int g_option_context_get_ignore_unknown_options(void *);
+extern (C) void g_option_context_set_ignore_unknown_options(void *, int);
+extern (C) int g_option_context_get_help_enabled(void *);
+extern (C) void g_option_context_set_help_enabled(void *, int);
+extern (C) void g_option_context_free(void *);
+extern (C) char * g_option_context_get_description(void *);
+extern (C) void g_option_context_set_description(void *, char *);
+extern (C) char * g_option_context_get_summary(void *);
+extern (C) void g_option_context_set_summary(void *, char *);
+extern (C) void * g_option_context_new(char *);
+extern (C) uint g_option_error_quark();
+extern (C) void g_node_pop_allocator();
+extern (C) void g_node_push_allocator(void *);
+extern (C) _GNode * g_node_last_sibling(_GNode *);
+extern (C) _GNode * g_node_first_sibling(_GNode *);
+extern (C) int g_node_child_index(_GNode *, void *);
+extern (C) int g_node_child_position(_GNode *, _GNode *);
+extern (C) _GNode * g_node_find_child(_GNode *, int, void *);
+extern (C) _GNode * g_node_last_child(_GNode *);
+extern (C) _GNode * g_node_nth_child(_GNode *, uint);
+extern (C) uint g_node_n_children(_GNode *);
+extern (C) void g_node_reverse_children(_GNode *);
+extern (C) void g_node_children_foreach(_GNode *, int, _BCD_func__2605, void *);
+extern (C) uint g_node_max_height(_GNode *);
+extern (C) void g_node_traverse(_GNode *, int, int, int, _BCD_func__2606, void *);
+extern (C) _GNode * g_node_find(_GNode *, int, int, void *);
+extern (C) uint g_node_depth(_GNode *);
+extern (C) int g_node_is_ancestor(_GNode *, _GNode *);
+extern (C) _GNode * g_node_get_root(_GNode *);
+extern (C) uint g_node_n_nodes(_GNode *, int);
+extern (C) _GNode * g_node_prepend(_GNode *, _GNode *);
+extern (C) _GNode * g_node_insert_after(_GNode *, _GNode *, _GNode *);
+extern (C) _GNode * g_node_insert_before(_GNode *, _GNode *, _GNode *);
+extern (C) _GNode * g_node_insert(_GNode *, int, _GNode *);
+extern (C) _GNode * g_node_copy(_GNode *);
+extern (C) _GNode * g_node_copy_deep(_GNode *, _BCD_func__2604, void *);
+extern (C) void g_node_unlink(_GNode *);
+extern (C) void g_node_destroy(_GNode *);
+extern (C) _GNode * g_node_new(void *);
+extern (C) _BCD_func__2614 g_set_printerr_handler(_BCD_func__2614);
+extern (C) void g_printerr(char *, ...);
+extern (C) _BCD_func__2614 g_set_print_handler(_BCD_func__2614);
+extern (C) void g_print(char *, ...);
+extern (C) void g_assert_warning(char *, char *, int, char *, char *);
+extern (C) void g_return_if_fail_warning(char *, char *, char *);
+extern (C) void _g_log_fallback_handler(char *, int, char *, void *);
+extern (C) int g_log_set_always_fatal(int);
+extern (C) int g_log_set_fatal_mask(char *, int);
+extern (C) void g_logv(char *, int, char *, char *);
+extern (C) void g_log(char *, int, char *, ...);
+extern (C) _BCD_func__2616 g_log_set_default_handler(_BCD_func__2616, void *);
+extern (C) void g_log_default_handler(char *, int, char *, void *);
+extern (C) void g_log_remove_handler(char *, uint);
+extern (C) uint g_log_set_handler(char *, int, _BCD_func__2616, void *);
+extern (C) uint g_printf_string_upper_bound(char *, char *);
+extern (C) char * g_markup_vprintf_escaped(char *, char *);
+extern (C) char * g_markup_printf_escaped(char *, ...);
+extern (C) char * g_markup_escape_text(char *, int);
+extern (C) void g_markup_parse_context_get_position(void *, int *, int *);
+extern (C) char * g_markup_parse_context_get_element(void *);
+extern (C) int g_markup_parse_context_end_parse(void *, _GError * *);
+extern (C) int g_markup_parse_context_parse(void *, char *, int, _GError * *);
+extern (C) void g_markup_parse_context_free(void *);
+extern (C) void * g_markup_parse_context_new(_GMarkupParser *, int, void *, _BCD_func__2417);
+extern (C) uint g_markup_error_quark();
+extern (C) void g_mapped_file_free(void *);
+extern (C) char * g_mapped_file_get_contents(void *);
+extern (C) uint g_mapped_file_get_length(void *);
+extern (C) void * g_mapped_file_new(char *, int, _GError * *);
+extern (C) void g_key_file_remove_group(void *, char *, _GError * *);
+extern (C) void g_key_file_remove_key(void *, char *, char *, _GError * *);
+extern (C) void g_key_file_remove_comment(void *, char *, char *, _GError * *);
+extern (C) char * g_key_file_get_comment(void *, char *, char *, _GError * *);
+extern (C) void g_key_file_set_comment(void *, char *, char *, char *, _GError * *);
+extern (C) void g_key_file_set_integer_list(void *, char *, char *, int *, uint);
+extern (C) double * g_key_file_get_double_list(void *, char *, char *, uint *, _GError * *);
+extern (C) void g_key_file_set_double_list(void *, char *, char *, double *, uint);
+extern (C) int * g_key_file_get_integer_list(void *, char *, char *, uint *, _GError * *);
+extern (C) void g_key_file_set_boolean_list(void *, char *, char *, int *, uint);
+extern (C) int * g_key_file_get_boolean_list(void *, char *, char *, uint *, _GError * *);
+extern (C) void g_key_file_set_locale_string_list(void *, char *, char *, char *, char * *, uint);
+extern (C) char * * g_key_file_get_locale_string_list(void *, char *, char *, char *, uint *, _GError * *);
+extern (C) void g_key_file_set_string_list(void *, char *, char *, char * *, uint);
+extern (C) char * * g_key_file_get_string_list(void *, char *, char *, uint *, _GError * *);
+extern (C) void g_key_file_set_double(void *, char *, char *, double);
+extern (C) double g_key_file_get_double(void *, char *, char *, _GError * *);
+extern (C) void g_key_file_set_integer(void *, char *, char *, int);
+extern (C) int g_key_file_get_integer(void *, char *, char *, _GError * *);
+extern (C) void g_key_file_set_boolean(void *, char *, char *, int);
+extern (C) int g_key_file_get_boolean(void *, char *, char *, _GError * *);
+extern (C) void g_key_file_set_locale_string(void *, char *, char *, char *, char *);
+extern (C) char * g_key_file_get_locale_string(void *, char *, char *, char *, _GError * *);
+extern (C) void g_key_file_set_string(void *, char *, char *, char *);
+extern (C) char * g_key_file_get_string(void *, char *, char *, _GError * *);
+extern (C) void g_key_file_set_value(void *, char *, char *, char *);
+extern (C) char * g_key_file_get_value(void *, char *, char *, _GError * *);
+extern (C) int g_key_file_has_key(void *, char *, char *, _GError * *);
+extern (C) int g_key_file_has_group(void *, char *);
+extern (C) char * * g_key_file_get_keys(void *, char *, uint *, _GError * *);
+extern (C) char * * g_key_file_get_groups(void *, uint *);
+extern (C) char * g_key_file_get_start_group(void *);
+extern (C) char * g_key_file_to_data(void *, uint *, _GError * *);
+extern (C) int g_key_file_load_from_data_dirs(void *, char *, char * *, int, _GError * *);
+extern (C) int g_key_file_load_from_dirs(void *, char *, char * *, char * *, int, _GError * *);
+extern (C) int g_key_file_load_from_data(void *, char *, uint, int, _GError * *);
+extern (C) int g_key_file_load_from_file(void *, char *, int, _GError * *);
+extern (C) void g_key_file_set_list_separator(void *, char);
+extern (C) void g_key_file_free(void *);
+extern (C) void * g_key_file_new();
+extern (C) uint g_key_file_error_quark();
+extern (C) extern _GSourceFuncs g_io_watch_funcs;
+extern (C) int g_io_channel_unix_get_fd(_GIOChannel *);
+extern (C) _GIOChannel * g_io_channel_unix_new(int);
+extern (C) int g_io_channel_error_from_errno(int);
+extern (C) uint g_io_channel_error_quark();
+extern (C) _GIOChannel * g_io_channel_new_file(char *, char *, _GError * *);
+extern (C) int g_io_channel_seek_position(_GIOChannel *, long, int, _GError * *);
+extern (C) int g_io_channel_write_unichar(_GIOChannel *, uint, _GError * *);
+extern (C) int g_io_channel_write_chars(_GIOChannel *, char *, int, uint *, _GError * *);
+extern (C) int g_io_channel_read_unichar(_GIOChannel *, uint *, _GError * *);
+extern (C) int g_io_channel_read_chars(_GIOChannel *, char *, uint, uint *, _GError * *);
+extern (C) int g_io_channel_read_to_end(_GIOChannel *, char * *, uint *, _GError * *);
+extern (C) int g_io_channel_read_line_string(_GIOChannel *, _GString *, uint *, _GError * *);
+extern (C) int g_io_channel_read_line(_GIOChannel *, char * *, uint *, uint *, _GError * *);
+extern (C) int g_io_channel_flush(_GIOChannel *, _GError * *);
+extern (C) int g_io_channel_get_close_on_unref(_GIOChannel *);
+extern (C) void g_io_channel_set_close_on_unref(_GIOChannel *, int);
+extern (C) char * g_io_channel_get_encoding(_GIOChannel *);
+extern (C) int g_io_channel_set_encoding(_GIOChannel *, char *, _GError * *);
+extern (C) int g_io_channel_get_buffered(_GIOChannel *);
+extern (C) void g_io_channel_set_buffered(_GIOChannel *, int);
+extern (C) char * g_io_channel_get_line_term(_GIOChannel *, int *);
+extern (C) void g_io_channel_set_line_term(_GIOChannel *, char *, int);
+extern (C) int g_io_channel_get_flags(_GIOChannel *);
+extern (C) int g_io_channel_set_flags(_GIOChannel *, int, _GError * *);
+extern (C) int g_io_channel_get_buffer_condition(_GIOChannel *);
+extern (C) uint g_io_channel_get_buffer_size(_GIOChannel *);
+extern (C) void g_io_channel_set_buffer_size(_GIOChannel *, uint);
+extern (C) uint g_io_add_watch(_GIOChannel *, int, _BCD_func__2635, void *);
+extern (C) _GSource * g_io_create_watch(_GIOChannel *, int);
+extern (C) uint g_io_add_watch_full(_GIOChannel *, int, int, _BCD_func__2635, void *, _BCD_func__2417);
+extern (C) int g_io_channel_shutdown(_GIOChannel *, int, _GError * *);
+extern (C) void g_io_channel_close(_GIOChannel *);
+extern (C) int g_io_channel_seek(_GIOChannel *, long, int);
+extern (C) int g_io_channel_write(_GIOChannel *, char *, uint, uint *);
+extern (C) int g_io_channel_read(_GIOChannel *, char *, uint, uint *);
+extern (C) void g_io_channel_unref(_GIOChannel *);
+extern (C) _GIOChannel * g_io_channel_ref(_GIOChannel *);
+extern (C) void g_io_channel_init(_GIOChannel *);
+extern (C) _GString * g_string_up(_GString *);
+extern (C) _GString * g_string_down(_GString *);
+extern (C) _GString * g_string_append_c_inline(_GString *, char);
+extern (C) void g_string_append_printf(_GString *, char *, ...);
+extern (C) void g_string_append_vprintf(_GString *, char *, char *);
+extern (C) void g_string_printf(_GString *, char *, ...);
+extern (C) void g_string_vprintf(_GString *, char *, char *);
+extern (C) _GString * g_string_ascii_up(_GString *);
+extern (C) _GString * g_string_ascii_down(_GString *);
+extern (C) _GString * g_string_erase(_GString *, int, int);
+extern (C) _GString * g_string_overwrite_len(_GString *, uint, char *, int);
+extern (C) _GString * g_string_overwrite(_GString *, uint, char *);
+extern (C) _GString * g_string_insert_unichar(_GString *, int, uint);
+extern (C) _GString * g_string_insert_c(_GString *, int, char);
+extern (C) _GString * g_string_insert(_GString *, int, char *);
+extern (C) _GString * g_string_prepend_len(_GString *, char *, int);
+extern (C) _GString * g_string_prepend_unichar(_GString *, uint);
+extern (C) _GString * g_string_prepend_c(_GString *, char);
+extern (C) _GString * g_string_prepend(_GString *, char *);
+extern (C) _GString * g_string_append_unichar(_GString *, uint);
+extern (C) _GString * g_string_append_c(_GString *, char);
+extern (C) _GString * g_string_append_len(_GString *, char *, int);
+extern (C) _GString * g_string_append(_GString *, char *);
+extern (C) _GString * g_string_insert_len(_GString *, int, char *, int);
+extern (C) _GString * g_string_set_size(_GString *, uint);
+extern (C) _GString * g_string_truncate(_GString *, uint);
+extern (C) _GString * g_string_assign(_GString *, char *);
+extern (C) uint g_string_hash(_GString *);
+extern (C) int g_string_equal(_GString *, _GString *);
+extern (C) char * g_string_free(_GString *, int);
+extern (C) _GString * g_string_sized_new(uint);
+extern (C) _GString * g_string_new_len(char *, int);
+extern (C) _GString * g_string_new(char *);
+extern (C) char * g_string_chunk_insert_const(void *, char *);
+extern (C) char * g_string_chunk_insert_len(void *, char *, int);
+extern (C) char * g_string_chunk_insert(void *, char *);
+extern (C) void g_string_chunk_clear(void *);
+extern (C) void g_string_chunk_free(void *);
+extern (C) void * g_string_chunk_new(uint);
+extern (C) char * _g_utf8_make_valid(char *);
+extern (C) int g_unichar_get_script(uint);
+extern (C) int g_unichar_get_mirror_char(uint, uint *);
+extern (C) char * g_utf8_collate_key_for_filename(char *, int);
+extern (C) char * g_utf8_collate_key(char *, int);
+extern (C) int g_utf8_collate(char *, char *);
+extern (C) char * g_utf8_normalize(char *, int, int);
+extern (C) char * g_utf8_casefold(char *, int);
+extern (C) char * g_utf8_strdown(char *, int);
+extern (C) char * g_utf8_strup(char *, int);
+extern (C) int g_unichar_validate(uint);
+extern (C) int g_utf8_validate(char *, int, char * *);
+extern (C) int g_unichar_to_utf8(uint, char *);
+extern (C) char * g_ucs4_to_utf8(uint *, int, int *, int *, _GError * *);
+extern (C) ushort * g_ucs4_to_utf16(uint *, int, int *, int *, _GError * *);
+extern (C) char * g_utf16_to_utf8(ushort *, int, int *, int *, _GError * *);
+extern (C) uint * g_utf16_to_ucs4(ushort *, int, int *, int *, _GError * *);
+extern (C) uint * g_utf8_to_ucs4_fast(char *, int, int *);
+extern (C) uint * g_utf8_to_ucs4(char *, int, int *, int *, _GError * *);
+extern (C) ushort * g_utf8_to_utf16(char *, int, int *, int *, _GError * *);
+extern (C) char * g_utf8_strreverse(char *, int);
+extern (C) char * g_utf8_strrchr(char *, int, uint);
+extern (C) char * g_utf8_strchr(char *, int, uint);
+extern (C) char * g_utf8_strncpy(char *, char *, uint);
+extern (C) int g_utf8_strlen(char *, int);
+extern (C) char * g_utf8_find_prev_char(char *, char *);
+extern (C) char * g_utf8_find_next_char(char *, char *);
+extern (C) char * g_utf8_prev_char(char *);
+extern (C) int g_utf8_pointer_to_offset(char *, char *);
+extern (C) char * g_utf8_offset_to_pointer(char *, int);
+extern (C) uint g_utf8_get_char_validated(char *, int);
+extern (C) uint g_utf8_get_char(char *);
+extern (C) extern char * g_utf8_skip;
+extern (C) uint * g_unicode_canonical_decomposition(uint, uint *);
+extern (C) void g_unicode_canonical_ordering(uint *, uint);
+extern (C) int g_unichar_combining_class(uint);
+extern (C) int g_unichar_break_type(uint);
+extern (C) int g_unichar_type(uint);
+extern (C) int g_unichar_xdigit_value(uint);
+extern (C) int g_unichar_digit_value(uint);
+extern (C) uint g_unichar_totitle(uint);
+extern (C) uint g_unichar_tolower(uint);
+extern (C) uint g_unichar_toupper(uint);
+extern (C) int g_unichar_ismark(uint);
+extern (C) int g_unichar_iszerowidth(uint);
+extern (C) int g_unichar_iswide_cjk(uint);
+extern (C) int g_unichar_iswide(uint);
+extern (C) int g_unichar_isdefined(uint);
+extern (C) int g_unichar_istitle(uint);
+extern (C) int g_unichar_isxdigit(uint);
+extern (C) int g_unichar_isupper(uint);
+extern (C) int g_unichar_isspace(uint);
+extern (C) int g_unichar_ispunct(uint);
+extern (C) int g_unichar_isprint(uint);
+extern (C) int g_unichar_islower(uint);
+extern (C) int g_unichar_isgraph(uint);
+extern (C) int g_unichar_isdigit(uint);
+extern (C) int g_unichar_iscntrl(uint);
+extern (C) int g_unichar_isalpha(uint);
+extern (C) int g_unichar_isalnum(uint);
+extern (C) int g_get_charset(char * *);
+extern (C) extern _GSourceFuncs g_idle_funcs;
+extern (C) extern _GSourceFuncs g_child_watch_funcs;
+extern (C) extern _GSourceFuncs g_timeout_funcs;
+extern (C) int g_idle_remove_by_data(void *);
+extern (C) uint g_idle_add_full(int, _BCD_func__2695, void *, _BCD_func__2417);
+extern (C) uint g_idle_add(_BCD_func__2695, void *);
+extern (C) uint g_child_watch_add(int, _BCD_func__2694, void *);
+extern (C) uint g_child_watch_add_full(int, int, _BCD_func__2694, void *, _BCD_func__2417);
+extern (C) uint g_timeout_add_seconds(uint, _BCD_func__2695, void *);
+extern (C) uint g_timeout_add_seconds_full(int, uint, _BCD_func__2695, void *, _BCD_func__2417);
+extern (C) uint g_timeout_add(uint, _BCD_func__2695, void *);
+extern (C) uint g_timeout_add_full(int, uint, _BCD_func__2695, void *, _BCD_func__2417);
+extern (C) int g_source_remove_by_funcs_user_data(_GSourceFuncs *, void *);
+extern (C) int g_source_remove_by_user_data(void *);
+extern (C) int g_source_remove(uint);
+extern (C) void g_get_current_time(_GTimeVal *);
+extern (C) _GSource * g_timeout_source_new_seconds(uint);
+extern (C) _GSource * g_timeout_source_new(uint);
+extern (C) _GSource * g_child_watch_source_new(int);
+extern (C) _GSource * g_idle_source_new();
+extern (C) void g_source_get_current_time(_GSource *, _GTimeVal *);
+extern (C) void g_source_remove_poll(_GSource *, _GPollFD *);
+extern (C) void g_source_add_poll(_GSource *, _GPollFD *);
+extern (C) void g_source_set_callback_indirect(_GSource *, void *, _GSourceCallbackFuncs *);
+extern (C) int g_source_is_destroyed(_GSource *);
+extern (C) void g_source_set_funcs(_GSource *, _GSourceFuncs *);
+extern (C) void g_source_set_callback(_GSource *, _BCD_func__2695, void *, _BCD_func__2417);
+extern (C) void * g_source_get_context(_GSource *);
+extern (C) uint g_source_get_id(_GSource *);
+extern (C) int g_source_get_can_recurse(_GSource *);
+extern (C) void g_source_set_can_recurse(_GSource *, int);
+extern (C) int g_source_get_priority(_GSource *);
+extern (C) void g_source_set_priority(_GSource *, int);
+extern (C) void g_source_destroy(_GSource *);
+extern (C) uint g_source_attach(_GSource *, void *);
+extern (C) void g_source_unref(_GSource *);
+extern (C) _GSource * g_source_ref(_GSource *);
+extern (C) _GSource * g_source_new(_GSourceFuncs *, uint);
+extern (C) void * g_main_loop_get_context(void *);
+extern (C) int g_main_loop_is_running(void *);
+extern (C) void g_main_loop_unref(void *);
+extern (C) void * g_main_loop_ref(void *);
+extern (C) void g_main_loop_quit(void *);
+extern (C) void g_main_loop_run(void *);
+extern (C) void * g_main_loop_new(void *, int);
+extern (C) _GSource * g_main_current_source();
+extern (C) int g_main_depth();
+extern (C) void g_main_context_remove_poll(void *, _GPollFD *);
+extern (C) void g_main_context_add_poll(void *, _GPollFD *, int);
+extern (C) _BCD_func__2688 g_main_context_get_poll_func(void *);
+extern (C) void g_main_context_set_poll_func(void *, _BCD_func__2688);
+extern (C) void g_main_context_dispatch(void *);
+extern (C) int g_main_context_check(void *, int, _GPollFD *, int);
+extern (C) int g_main_context_query(void *, int, int *, _GPollFD *, int);
+extern (C) int g_main_context_prepare(void *, int *);
+extern (C) int g_main_context_wait(void *, void *, void *);
+extern (C) int g_main_context_is_owner(void *);
+extern (C) void g_main_context_release(void *);
+extern (C) int g_main_context_acquire(void *);
+extern (C) void g_main_context_wakeup(void *);
+extern (C) _GSource * g_main_context_find_source_by_funcs_user_data(void *, _GSourceFuncs *, void *);
+extern (C) _GSource * g_main_context_find_source_by_user_data(void *, void *);
+extern (C) _GSource * g_main_context_find_source_by_id(void *, uint);
+extern (C) int g_main_context_pending(void *);
+extern (C) int g_main_context_iteration(void *, int);
+extern (C) void * g_main_context_default();
+extern (C) void g_main_context_unref(void *);
+extern (C) void * g_main_context_ref(void *);
+extern (C) void * g_main_context_new();
+extern (C) void g_slist_pop_allocator();
+extern (C) void g_slist_push_allocator(void *);
+extern (C) void * g_slist_nth_data(_GSList *, uint);
+extern (C) _GSList * g_slist_sort_with_data(_GSList *, _BCD_func__2968, void *);
+extern (C) _GSList * g_slist_sort(_GSList *, _BCD_func__2969);
+extern (C) void g_slist_foreach(_GSList *, _BCD_func__2422, void *);
+extern (C) uint g_slist_length(_GSList *);
+extern (C) _GSList * g_slist_last(_GSList *);
+extern (C) int g_slist_index(_GSList *, void *);
+extern (C) int g_slist_position(_GSList *, _GSList *);
+extern (C) _GSList * g_slist_find_custom(_GSList *, void *, _BCD_func__2969);
+extern (C) _GSList * g_slist_find(_GSList *, void *);
+extern (C) _GSList * g_slist_nth(_GSList *, uint);
+extern (C) _GSList * g_slist_copy(_GSList *);
+extern (C) _GSList * g_slist_reverse(_GSList *);
+extern (C) _GSList * g_slist_delete_link(_GSList *, _GSList *);
+extern (C) _GSList * g_slist_remove_link(_GSList *, _GSList *);
+extern (C) _GSList * g_slist_remove_all(_GSList *, void *);
+extern (C) _GSList * g_slist_remove(_GSList *, void *);
+extern (C) _GSList * g_slist_concat(_GSList *, _GSList *);
+extern (C) _GSList * g_slist_insert_before(_GSList *, _GSList *, void *);
+extern (C) _GSList * g_slist_insert_sorted_with_data(_GSList *, void *, _BCD_func__2968, void *);
+extern (C) _GSList * g_slist_insert_sorted(_GSList *, void *, _BCD_func__2969);
+extern (C) _GSList * g_slist_insert(_GSList *, void *, int);
+extern (C) _GSList * g_slist_prepend(_GSList *, void *);
+extern (C) _GSList * g_slist_append(_GSList *, void *);
+extern (C) void g_slist_free_1(_GSList *);
+extern (C) void g_slist_free(_GSList *);
+extern (C) _GSList * g_slist_alloc();
+extern (C) void g_hook_list_marshal_check(_GHookList *, int, _BCD_func__2732, void *);
+extern (C) void g_hook_list_marshal(_GHookList *, int, _BCD_func__2733, void *);
+extern (C) void g_hook_list_invoke_check(_GHookList *, int);
+extern (C) void g_hook_list_invoke(_GHookList *, int);
+extern (C) int g_hook_compare_ids(_GHook *, _GHook *);
+extern (C) _GHook * g_hook_next_valid(_GHookList *, _GHook *, int);
+extern (C) _GHook * g_hook_first_valid(_GHookList *, int);
+extern (C) _GHook * g_hook_find_func_data(_GHookList *, int, void *, void *);
+extern (C) _GHook * g_hook_find_func(_GHookList *, int, void *);
+extern (C) _GHook * g_hook_find_data(_GHookList *, int, void *);
+extern (C) _GHook * g_hook_find(_GHookList *, int, _BCD_func__2732, void *);
+extern (C) _GHook * g_hook_get(_GHookList *, uint);
+extern (C) void g_hook_insert_sorted(_GHookList *, _GHook *, _BCD_func__2734);
+extern (C) void g_hook_insert_before(_GHookList *, _GHook *, _GHook *);
+extern (C) void g_hook_prepend(_GHookList *, _GHook *);
+extern (C) void g_hook_destroy_link(_GHookList *, _GHook *);
+extern (C) int g_hook_destroy(_GHookList *, uint);
+extern (C) void g_hook_unref(_GHookList *, _GHook *);
+extern (C) _GHook * g_hook_ref(_GHookList *, _GHook *);
+extern (C) void g_hook_free(_GHookList *, _GHook *);
+extern (C) _GHook * g_hook_alloc(_GHookList *);
+extern (C) void g_hook_list_clear(_GHookList *);
+extern (C) void g_hook_list_init(_GHookList *, uint);
+extern (C) int g_direct_equal(void *, void *);
+extern (C) uint g_direct_hash(void *);
+extern (C) uint g_int_hash(void *);
+extern (C) int g_int_equal(void *, void *);
+extern (C) uint g_str_hash(void *);
+extern (C) int g_str_equal(void *, void *);
+extern (C) void g_hash_table_unref(void *);
+extern (C) void * g_hash_table_ref(void *);
+extern (C) _GList * g_hash_table_get_values(void *);
+extern (C) _GList * g_hash_table_get_keys(void *);
+extern (C) uint g_hash_table_size(void *);
+extern (C) uint g_hash_table_foreach_steal(void *, _BCD_func__2478, void *);
+extern (C) uint g_hash_table_foreach_remove(void *, _BCD_func__2478, void *);
+extern (C) void * g_hash_table_find(void *, _BCD_func__2478, void *);
+extern (C) void g_hash_table_foreach(void *, _BCD_func__2965, void *);
+extern (C) int g_hash_table_lookup_extended(void *, void *, void * *, void * *);
+extern (C) void * g_hash_table_lookup(void *, void *);
+extern (C) void g_hash_table_steal_all(void *);
+extern (C) int g_hash_table_steal(void *, void *);
+extern (C) void g_hash_table_remove_all(void *);
+extern (C) int g_hash_table_remove(void *, void *);
+extern (C) void g_hash_table_replace(void *, void *, void *);
+extern (C) void g_hash_table_insert(void *, void *, void *);
+extern (C) void g_hash_table_destroy(void *);
+extern (C) void * g_hash_table_new_full(_BCD_func__2966, _BCD_func__2967, _BCD_func__2417, _BCD_func__2417);
+extern (C) void * g_hash_table_new(_BCD_func__2966, _BCD_func__2967);
+extern (C) int g_mkdir_with_parents(char *, int);
+extern (C) char * g_build_filenamev(char * *);
+extern (C) char * g_build_filename(char *, ...);
+extern (C) char * g_build_pathv(char *, char * *);
+extern (C) char * g_build_path(char *, char *, ...);
+extern (C) int g_file_open_tmp(char *, char * *, _GError * *);
+extern (C) int g_mkstemp(char *);
+extern (C) char * g_file_read_link(char *, _GError * *);
+extern (C) int g_file_set_contents(char *, char *, int, _GError * *);
+extern (C) int g_file_get_contents(char *, char * *, uint *, _GError * *);
+extern (C) int g_file_test(char *, int);
+extern (C) int g_file_error_from_errno(int);
+extern (C) uint g_file_error_quark();
+extern (C) void g_dir_close(void *);
+extern (C) void g_dir_rewind(void *);
+extern (C) char * g_dir_read_name(void *);
+extern (C) void * g_dir_open(char *, uint, _GError * *);
+extern (C) uint g_date_strftime(char *, uint, char *, _GDate *);
+extern (C) void g_date_order(_GDate *, _GDate *);
+extern (C) void g_date_clamp(_GDate *, _GDate *, _GDate *);
+extern (C) void g_date_to_struct_tm(_GDate *, void *);
+extern (C) int g_date_compare(_GDate *, _GDate *);
+extern (C) int g_date_days_between(_GDate *, _GDate *);
+extern (C) char g_date_get_sunday_weeks_in_year(ushort);
+extern (C) char g_date_get_monday_weeks_in_year(ushort);
+extern (C) char g_date_get_days_in_month(int, ushort);
+extern (C) int g_date_is_leap_year(ushort);
+extern (C) void g_date_subtract_years(_GDate *, uint);
+extern (C) void g_date_add_years(_GDate *, uint);
+extern (C) void g_date_subtract_months(_GDate *, uint);
+extern (C) void g_date_add_months(_GDate *, uint);
+extern (C) void g_date_subtract_days(_GDate *, uint);
+extern (C) void g_date_add_days(_GDate *, uint);
+extern (C) int g_date_is_last_of_month(_GDate *);
+extern (C) int g_date_is_first_of_month(_GDate *);
+extern (C) void g_date_set_julian(_GDate *, uint);
+extern (C) void g_date_set_dmy(_GDate *, char, int, ushort);
+extern (C) void g_date_set_year(_GDate *, ushort);
+extern (C) void g_date_set_day(_GDate *, char);
+extern (C) void g_date_set_month(_GDate *, int);
+extern (C) void g_date_set_time(_GDate *, int);
+extern (C) void g_date_set_time_val(_GDate *, _GTimeVal *);
+extern (C) void g_date_set_time_t(_GDate *, int);
+extern (C) void g_date_set_parse(_GDate *, char *);
+extern (C) void g_date_clear(_GDate *, uint);
+extern (C) uint g_date_get_iso8601_week_of_year(_GDate *);
+extern (C) uint g_date_get_sunday_week_of_year(_GDate *);
+extern (C) uint g_date_get_monday_week_of_year(_GDate *);
+extern (C) uint g_date_get_day_of_year(_GDate *);
+extern (C) uint g_date_get_julian(_GDate *);
+extern (C) char g_date_get_day(_GDate *);
+extern (C) ushort g_date_get_year(_GDate *);
+extern (C) int g_date_get_month(_GDate *);
+extern (C) int g_date_get_weekday(_GDate *);
+extern (C) int g_date_valid_dmy(char, int, ushort);
+extern (C) int g_date_valid_julian(uint);
+extern (C) int g_date_valid_weekday(int);
+extern (C) int g_date_valid_year(ushort);
+extern (C) int g_date_valid_month(int);
+extern (C) int g_date_valid_day(char);
+extern (C) int g_date_valid(_GDate *);
+extern (C) void g_date_free(_GDate *);
+extern (C) _GDate * g_date_new_julian(uint);
+extern (C) _GDate * g_date_new_dmy(char, int, ushort);
+extern (C) _GDate * g_date_new();
+extern (C) void g_dataset_foreach(void *, _BCD_func__2768, void *);
+extern (C) void * g_dataset_id_remove_no_notify(void *, uint);
+extern (C) void g_dataset_id_set_data_full(void *, uint, void *, _BCD_func__2417);
+extern (C) void * g_dataset_id_get_data(void *, uint);
+extern (C) void g_dataset_destroy(void *);
+extern (C) uint g_datalist_get_flags(void * *);
+extern (C) void g_datalist_unset_flags(void * *, uint);
+extern (C) void g_datalist_set_flags(void * *, uint);
+extern (C) void g_datalist_foreach(void * *, _BCD_func__2768, void *);
+extern (C) void * g_datalist_id_remove_no_notify(void * *, uint);
+extern (C) void g_datalist_id_set_data_full(void * *, uint, void *, _BCD_func__2417);
+extern (C) void * g_datalist_id_get_data(void * *, uint);
+extern (C) void g_datalist_clear(void * *);
+extern (C) void g_datalist_init(void * *);
+extern (C) char * * g_uri_list_extract_uris(char *);
+extern (C) char * g_filename_display_basename(char *);
+extern (C) int g_get_filename_charsets(char * * *);
+extern (C) char * g_filename_display_name(char *);
+extern (C) char * g_filename_to_uri(char *, char *, _GError * *);
+extern (C) char * g_filename_from_uri(char *, char * *, _GError * *);
+extern (C) char * g_filename_from_utf8(char *, int, uint *, uint *, _GError * *);
+extern (C) char * g_filename_to_utf8(char *, int, uint *, uint *, _GError * *);
+extern (C) char * g_locale_from_utf8(char *, int, uint *, uint *, _GError * *);
+extern (C) char * g_locale_to_utf8(char *, int, uint *, uint *, _GError * *);
+extern (C) char * g_convert_with_fallback(char *, int, char *, char *, char *, uint *, uint *, _GError * *);
+extern (C) char * g_convert_with_iconv(char *, int, void *, uint *, uint *, _GError * *);
+extern (C) char * g_convert(char *, int, char *, char *, uint *, uint *, _GError * *);
+extern (C) int g_iconv_close(void *);
+extern (C) uint g_iconv(void *, char * *, uint *, char * *, uint *);
+extern (C) void * g_iconv_open(char *, char *);
+extern (C) uint g_convert_error_quark();
+extern (C) void g_completion_free(_GCompletion *);
+extern (C) void g_completion_set_compare(_GCompletion *, _BCD_func__2771);
+extern (C) _GList * g_completion_complete_utf8(_GCompletion *, char *, char * *);
+extern (C) _GList * g_completion_complete(_GCompletion *, char *, char * *);
+extern (C) void g_completion_clear_items(_GCompletion *);
+extern (C) void g_completion_remove_items(_GCompletion *, _GList *);
+extern (C) void g_completion_add_items(_GCompletion *, _GList *);
+extern (C) _GCompletion * g_completion_new(_BCD_func__2772);
+extern (C) void g_cache_value_foreach(void *, _BCD_func__2965, void *);
+extern (C) void g_cache_key_foreach(void *, _BCD_func__2965, void *);
+extern (C) void g_cache_remove(void *, void *);
+extern (C) void * g_cache_insert(void *, void *);
+extern (C) void g_cache_destroy(void *);
+extern (C) void * g_cache_new(_BCD_func__2418, _BCD_func__2417, _BCD_func__2418, _BCD_func__2417, _BCD_func__2966, _BCD_func__2966, _BCD_func__2967);
+extern (C) void g_list_pop_allocator();
+extern (C) void g_list_push_allocator(void *);
+extern (C) void * g_list_nth_data(_GList *, uint);
+extern (C) _GList * g_list_sort_with_data(_GList *, _BCD_func__2968, void *);
+extern (C) _GList * g_list_sort(_GList *, _BCD_func__2969);
+extern (C) void g_list_foreach(_GList *, _BCD_func__2422, void *);
+extern (C) uint g_list_length(_GList *);
+extern (C) _GList * g_list_first(_GList *);
+extern (C) _GList * g_list_last(_GList *);
+extern (C) int g_list_index(_GList *, void *);
+extern (C) int g_list_position(_GList *, _GList *);
+extern (C) _GList * g_list_find_custom(_GList *, void *, _BCD_func__2969);
+extern (C) _GList * g_list_find(_GList *, void *);
+extern (C) _GList * g_list_nth_prev(_GList *, uint);
+extern (C) _GList * g_list_nth(_GList *, uint);
+extern (C) _GList * g_list_copy(_GList *);
+extern (C) _GList * g_list_reverse(_GList *);
+extern (C) _GList * g_list_delete_link(_GList *, _GList *);
+extern (C) _GList * g_list_remove_link(_GList *, _GList *);
+extern (C) _GList * g_list_remove_all(_GList *, void *);
+extern (C) _GList * g_list_remove(_GList *, void *);
+extern (C) _GList * g_list_concat(_GList *, _GList *);
+extern (C) _GList * g_list_insert_before(_GList *, _GList *, void *);
+extern (C) _GList * g_list_insert_sorted_with_data(_GList *, void *, _BCD_func__2968, void *);
+extern (C) _GList * g_list_insert_sorted(_GList *, void *, _BCD_func__2969);
+extern (C) _GList * g_list_insert(_GList *, void *, int);
+extern (C) _GList * g_list_prepend(_GList *, void *);
+extern (C) _GList * g_list_append(_GList *, void *);
+extern (C) void g_list_free_1(_GList *);
+extern (C) void g_list_free(_GList *);
+extern (C) _GList * g_list_alloc();
+extern (C) void g_allocator_free(void *);
+extern (C) void * g_allocator_new(char *, uint);
+extern (C) void g_blow_chunks();
+extern (C) void g_mem_chunk_info();
+extern (C) void g_mem_chunk_print(void *);
+extern (C) void g_mem_chunk_reset(void *);
+extern (C) void g_mem_chunk_clean(void *);
+extern (C) void g_mem_chunk_free(void *, void *);
+extern (C) void * g_mem_chunk_alloc0(void *);
+extern (C) void * g_mem_chunk_alloc(void *);
+extern (C) void g_mem_chunk_destroy(void *);
+extern (C) void * g_mem_chunk_new(char *, int, uint, int);
+extern (C) void g_mem_profile();
+extern (C) extern _GMemVTable * glib_mem_profiler_table;
+extern (C) extern int g_mem_gc_friendly;
+extern (C) int g_mem_is_system_malloc();
+extern (C) void g_mem_set_vtable(_GMemVTable *);
+extern (C) void * g_try_realloc(void *, uint);
+extern (C) void * g_try_malloc0(uint);
+extern (C) void * g_try_malloc(uint);
+extern (C) void g_free(void *);
+extern (C) void * g_realloc(void *, uint);
+extern (C) void * g_malloc0(uint);
+extern (C) void * g_malloc(uint);
+extern (C) long * g_slice_get_config_state(int, long, uint *);
+extern (C) long g_slice_get_config(int);
+extern (C) void g_slice_set_config(int, long);
+extern (C) void g_slice_free_chain_with_offset(uint, void *, uint);
+extern (C) void g_slice_free1(uint, void *);
+extern (C) void * g_slice_copy(uint, void *);
+extern (C) void * g_slice_alloc0(uint);
+extern (C) void * g_slice_alloc(uint);
+extern (C) int g_bookmark_file_move_item(void *, char *, char *, _GError * *);
+extern (C) int g_bookmark_file_remove_item(void *, char *, _GError * *);
+extern (C) int g_bookmark_file_remove_application(void *, char *, char *, _GError * *);
+extern (C) int g_bookmark_file_remove_group(void *, char *, char *, _GError * *);
+extern (C) char * * g_bookmark_file_get_uris(void *, uint *);
+extern (C) int g_bookmark_file_get_size(void *);
+extern (C) int g_bookmark_file_has_item(void *, char *);
+extern (C) int g_bookmark_file_get_visited(void *, char *, _GError * *);
+extern (C) void g_bookmark_file_set_visited(void *, char *, int);
+extern (C) int g_bookmark_file_get_modified(void *, char *, _GError * *);
+extern (C) void g_bookmark_file_set_modified(void *, char *, int);
+extern (C) int g_bookmark_file_get_added(void *, char *, _GError * *);
+extern (C) void g_bookmark_file_set_added(void *, char *, int);
+extern (C) int g_bookmark_file_get_icon(void *, char *, char * *, char * *, _GError * *);
+extern (C) void g_bookmark_file_set_icon(void *, char *, char *, char *);
+extern (C) int g_bookmark_file_get_is_private(void *, char *, _GError * *);
+extern (C) void g_bookmark_file_set_is_private(void *, char *, int);
+extern (C) int g_bookmark_file_get_app_info(void *, char *, char *, char * *, uint *, int *, _GError * *);
+extern (C) int g_bookmark_file_set_app_info(void *, char *, char *, char *, int, int, _GError * *);
+extern (C) char * * g_bookmark_file_get_applications(void *, char *, uint *, _GError * *);
+extern (C) int g_bookmark_file_has_application(void *, char *, char *, _GError * *);
+extern (C) void g_bookmark_file_add_application(void *, char *, char *, char *);
+extern (C) char * * g_bookmark_file_get_groups(void *, char *, uint *, _GError * *);
+extern (C) int g_bookmark_file_has_group(void *, char *, char *, _GError * *);
+extern (C) void g_bookmark_file_add_group(void *, char *, char *);
+extern (C) void g_bookmark_file_set_groups(void *, char *, char * *, uint);
+extern (C) char * g_bookmark_file_get_mime_type(void *, char *, _GError * *);
+extern (C) void g_bookmark_file_set_mime_type(void *, char *, char *);
+extern (C) char * g_bookmark_file_get_description(void *, char *, _GError * *);
+extern (C) void g_bookmark_file_set_description(void *, char *, char *);
+extern (C) char * g_bookmark_file_get_title(void *, char *, _GError * *);
+extern (C) void g_bookmark_file_set_title(void *, char *, char *);
+extern (C) int g_bookmark_file_to_file(void *, char *, _GError * *);
+extern (C) char * g_bookmark_file_to_data(void *, uint *, _GError * *);
+extern (C) int g_bookmark_file_load_from_data_dirs(void *, char *, char * *, _GError * *);
+extern (C) int g_bookmark_file_load_from_data(void *, char *, uint, _GError * *);
+extern (C) int g_bookmark_file_load_from_file(void *, char *, _GError * *);
+extern (C) void g_bookmark_file_free(void *);
+extern (C) void * g_bookmark_file_new();
+extern (C) uint g_bookmark_file_error_quark();
+extern (C) char * g_base64_decode(char *, uint *);
+extern (C) uint g_base64_decode_step(char *, uint, char *, int *, uint *);
+extern (C) char * g_base64_encode(char *, uint);
+extern (C) uint g_base64_encode_close(int, char *, int *, int *);
+extern (C) uint g_base64_encode_step(char *, uint, int, char *, int *, int *);
+extern (C) void g_on_error_stack_trace(char *);
+extern (C) void g_on_error_query(char *);
+extern (C) void * _g_async_queue_get_mutex(void *);
+extern (C) void g_async_queue_sort_unlocked(void *, _BCD_func__2968, void *);
+extern (C) void g_async_queue_sort(void *, _BCD_func__2968, void *);
+extern (C) int g_async_queue_length_unlocked(void *);
+extern (C) int g_async_queue_length(void *);
+extern (C) void * g_async_queue_timed_pop_unlocked(void *, _GTimeVal *);
+extern (C) void * g_async_queue_timed_pop(void *, _GTimeVal *);
+extern (C) void * g_async_queue_try_pop_unlocked(void *);
+extern (C) void * g_async_queue_try_pop(void *);
+extern (C) void * g_async_queue_pop_unlocked(void *);
+extern (C) void * g_async_queue_pop(void *);
+extern (C) void g_async_queue_push_sorted_unlocked(void *, void *, _BCD_func__2968, void *);
+extern (C) void g_async_queue_push_sorted(void *, void *, _BCD_func__2968, void *);
+extern (C) void g_async_queue_push_unlocked(void *, void *);
+extern (C) void g_async_queue_push(void *, void *);
+extern (C) void g_async_queue_unref_and_unlock(void *);
+extern (C) void g_async_queue_ref_unlocked(void *);
+extern (C) void g_async_queue_unref(void *);
+extern (C) void * g_async_queue_ref(void *);
+extern (C) void g_async_queue_unlock(void *);
+extern (C) void g_async_queue_lock(void *);
+extern (C) void * g_async_queue_new();
+extern (C) void glib_dummy_decl();
+extern (C) void g_once_init_leave(uint *, uint);
+extern (C) int g_once_init_enter_impl(uint *);
+extern (C) int g_once_init_enter(uint *);
+extern (C) void * g_once_impl(_GOnce *, _BCD_func__2418, void *);
+extern (C) void g_thread_foreach(_BCD_func__2422, void *);
+extern (C) void g_static_rw_lock_free(_GStaticRWLock *);
+extern (C) void g_static_rw_lock_writer_unlock(_GStaticRWLock *);
+extern (C) int g_static_rw_lock_writer_trylock(_GStaticRWLock *);
+extern (C) void g_static_rw_lock_writer_lock(_GStaticRWLock *);
+extern (C) void g_static_rw_lock_reader_unlock(_GStaticRWLock *);
+extern (C) int g_static_rw_lock_reader_trylock(_GStaticRWLock *);
+extern (C) void g_static_rw_lock_reader_lock(_GStaticRWLock *);
+extern (C) void g_static_rw_lock_init(_GStaticRWLock *);
+extern (C) void g_static_rec_mutex_free(_GStaticRecMutex *);
+extern (C) uint g_static_rec_mutex_unlock_full(_GStaticRecMutex *);
+extern (C) void g_static_rec_mutex_lock_full(_GStaticRecMutex *, uint);
+extern (C) void g_static_rec_mutex_unlock(_GStaticRecMutex *);
+extern (C) int g_static_rec_mutex_trylock(_GStaticRecMutex *);
+extern (C) void g_static_rec_mutex_lock(_GStaticRecMutex *);
+extern (C) void g_static_rec_mutex_init(_GStaticRecMutex *);
+extern (C) void g_static_private_free(_GStaticPrivate *);
+extern (C) void g_static_private_set(_GStaticPrivate *, void *, _BCD_func__2417);
+extern (C) void * g_static_private_get(_GStaticPrivate *);
+extern (C) void g_static_private_init(_GStaticPrivate *);
+extern (C) void g_static_mutex_free(_GStaticMutex *);
+extern (C) void g_static_mutex_init(_GStaticMutex *);
+extern (C) void g_thread_set_priority(_GThread *, int);
+extern (C) void * g_thread_join(_GThread *);
+extern (C) void g_thread_exit(void *);
+extern (C) _GThread * g_thread_self();
+extern (C) _GThread * g_thread_create_full(_BCD_func__2418, void *, uint, int, int, int, _GError * *);
+extern (C) void * g_static_mutex_get_mutex_impl(void * *);
+extern (C) void g_thread_init_with_errorcheck_mutexes(_GThreadFunctions *);
+extern (C) void g_thread_init(_GThreadFunctions *);
+extern (C) extern _BCD_func__3161 g_thread_gettime;
+extern (C) extern int g_threads_got_initialized;
+extern (C) extern int g_thread_use_default_impl;
+extern (C) extern _GThreadFunctions g_thread_functions_for_glib_use;
+extern (C) uint g_thread_error_quark();
+extern (C) void g_atomic_pointer_set(void * *, void *);
+extern (C) void * g_atomic_pointer_get(void * *);
+extern (C) void g_atomic_int_set(int *, int);
+extern (C) int g_atomic_int_get(int *);
+extern (C) int g_atomic_pointer_compare_and_exchange(void * *, void *, void *);
+extern (C) int g_atomic_int_compare_and_exchange(int *, int, int);
+extern (C) void g_atomic_int_add(int *, int);
+extern (C) int g_atomic_int_exchange_and_add(int *, int);
+extern (C) char * glib_check_version(uint, uint, uint);
+extern (C) extern uint glib_binary_age;
+extern (C) extern uint glib_interface_age;
+extern (C) extern uint glib_micro_version;
+extern (C) extern uint glib_minor_version;
+extern (C) extern uint glib_major_version;
+extern (C) uint g_trash_stack_height(_GTrashStack * *);
+extern (C) void * g_trash_stack_peek(_GTrashStack * *);
+extern (C) void * g_trash_stack_pop(_GTrashStack * *);
+extern (C) void g_trash_stack_push(_GTrashStack * *, void *);
+extern (C) uint g_bit_storage(uint);
+extern (C) int g_bit_nth_msf(uint, int);
+extern (C) int g_bit_nth_lsf(uint, int);
+extern (C) char * g_find_program_in_path(char *);
+extern (C) void g_atexit(_BCD_func__2331);
+extern (C) char * _g_getenv_nomalloc(char *, char *);
+extern (C) char * * g_listenv();
+extern (C) void g_unsetenv(char *);
+extern (C) int g_setenv(char *, char *, int);
+extern (C) char * g_getenv(char *);
+extern (C) void g_nullify_pointer(void * *);
+extern (C) char * g_path_get_dirname(char *);
+extern (C) char * g_path_get_basename(char *);
+extern (C) char * g_get_current_dir();
+extern (C) char * g_basename(char *);
+extern (C) char * g_path_skip_root(char *);
+extern (C) int g_path_is_absolute(char *);
+extern (C) int g_vsnprintf(char *, uint, char *, char *);
+extern (C) int g_snprintf(char *, uint, char *, ...);
+extern (C) uint g_parse_debug_string(char *, _GDebugKey *, uint);
+extern (C) char * g_get_user_special_dir(int);
+extern (C) char * * g_get_language_names();
+extern (C) char * * g_get_system_config_dirs();
+extern (C) char * * g_get_system_data_dirs();
+extern (C) char * g_get_user_cache_dir();
+extern (C) char * g_get_user_config_dir();
+extern (C) char * g_get_user_data_dir();
+extern (C) void g_set_application_name(char *);
+extern (C) char * g_get_application_name();
+extern (C) void g_set_prgname(char *);
+extern (C) char * g_get_prgname();
+extern (C) char * g_get_host_name();
+extern (C) char * g_get_tmp_dir();
+extern (C) char * g_get_home_dir();
+extern (C) char * g_get_real_name();
+extern (C) char * g_get_user_name();
+extern (C) void g_clear_error(_GError * *);
+extern (C) void g_propagate_error(_GError * *, _GError *);
+extern (C) void g_set_error(_GError * *, uint, int, char *, ...);
+extern (C) int g_error_matches(_GError *, uint, int);
+extern (C) _GError * g_error_copy(_GError *);
+extern (C) void g_error_free(_GError *);
+extern (C) _GError * g_error_new_literal(uint, int, char *);
+extern (C) _GError * g_error_new(uint, int, char *, ...);
+extern (C) char * g_intern_static_string(char *);
+extern (C) char * g_intern_string(char *);
+extern (C) char * g_quark_to_string(uint);
+extern (C) uint g_quark_from_string(char *);
+extern (C) uint g_quark_from_static_string(char *);
+extern (C) uint g_quark_try_string(char *);
+extern (C) void g_byte_array_sort_with_data(_GByteArray *, _BCD_func__2968, void *);
+extern (C) void g_byte_array_sort(_GByteArray *, _BCD_func__2969);
+extern (C) _GByteArray * g_byte_array_remove_range(_GByteArray *, uint, uint);
+extern (C) _GByteArray * g_byte_array_remove_index_fast(_GByteArray *, uint);
+extern (C) _GByteArray * g_byte_array_remove_index(_GByteArray *, uint);
+extern (C) _GByteArray * g_byte_array_set_size(_GByteArray *, uint);
+extern (C) _GByteArray * g_byte_array_prepend(_GByteArray *, char *, uint);
+extern (C) _GByteArray * g_byte_array_append(_GByteArray *, char *, uint);
+extern (C) char * g_byte_array_free(_GByteArray *, int);
+extern (C) _GByteArray * g_byte_array_sized_new(uint);
+extern (C) _GByteArray * g_byte_array_new();
+extern (C) void g_ptr_array_foreach(_GPtrArray *, _BCD_func__2422, void *);
+extern (C) void g_ptr_array_sort_with_data(_GPtrArray *, _BCD_func__2968, void *);
+extern (C) void g_ptr_array_sort(_GPtrArray *, _BCD_func__2969);
+extern (C) void g_ptr_array_add(_GPtrArray *, void *);
+extern (C) void g_ptr_array_remove_range(_GPtrArray *, uint, uint);
+extern (C) int g_ptr_array_remove_fast(_GPtrArray *, void *);
+extern (C) int g_ptr_array_remove(_GPtrArray *, void *);
+extern (C) void * g_ptr_array_remove_index_fast(_GPtrArray *, uint);
+extern (C) void * g_ptr_array_remove_index(_GPtrArray *, uint);
+extern (C) void g_ptr_array_set_size(_GPtrArray *, int);
+extern (C) void * * g_ptr_array_free(_GPtrArray *, int);
+extern (C) _GPtrArray * g_ptr_array_sized_new(uint);
+extern (C) _GPtrArray * g_ptr_array_new();
+extern (C) void g_array_sort_with_data(_GArray *, _BCD_func__2968, void *);
+extern (C) void g_array_sort(_GArray *, _BCD_func__2969);
+extern (C) _GArray * g_array_remove_range(_GArray *, uint, uint);
+extern (C) _GArray * g_array_remove_index_fast(_GArray *, uint);
+extern (C) _GArray * g_array_remove_index(_GArray *, uint);
+extern (C) _GArray * g_array_set_size(_GArray *, uint);
+extern (C) _GArray * g_array_insert_vals(_GArray *, uint, void *, uint);
+extern (C) _GArray * g_array_prepend_vals(_GArray *, void *, uint);
+extern (C) _GArray * g_array_append_vals(_GArray *, void *, uint);
+extern (C) char * g_array_free(_GArray *, int);
+extern (C) _GArray * g_array_sized_new(int, int, uint, uint);
+extern (C) _GArray * g_array_new(int, int, uint);
+} // version(DYNLINK)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/glx.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,362 @@
+/******************************************************************************
+    Based on the generated files from the BCD tool
+    modified by: Frank Benoit <keinfarbton@googlemail.com>
+******************************************************************************/
+module org.eclipse.swt.internal.c.glx;
+
+import java.lang.all;
+
+public import org.eclipse.swt.internal.c.Xutil;
+
+version=DYNLINK;
+
+version(DYNLINK){
+    import tango.sys.SharedLib : SharedLib;
+    struct Symbol{
+        String name;
+        void** symbol;
+    }
+}
+
+void loadLib(){
+    version(DYNLINK){
+        String libname = "libGL.so";
+
+        SharedLib lib = SharedLib.load( libname );
+        if( lib is null ){
+            lib = SharedLib.load( libname ~ ".0" );
+        }
+
+        if ( lib !is null ) {
+            foreach( inout s; symbols ){
+                try{
+                    *s.symbol = lib.getSymbol( s.name.ptr );
+                }
+                catch(Exception e){}
+                if( *s.symbol is null ){
+                    getDwtLogger().trace( __FILE__, __LINE__,  "{}: Symbol '{}' not found", libname, s.name );
+                }
+            }
+        } else {
+            getDwtLogger().trace( __FILE__, __LINE__,  "Could not load the library {}", libname );
+        }
+    }
+}
+
+extern(C):
+align(4):
+
+alias __GLXEvent GLXEvent;
+alias uint GLXDrawable;
+alias void * GLXFBConfig;
+alias void * GLXContext;
+alias uint GLXFBConfigID;
+alias uint GLXWindow;
+alias uint GLXPbuffer;
+alias uint GLXPixmap;
+alias uint GLXContextID;
+alias void function() _BCD_func__2197;
+alias void function(uint, float *) _BCD_func__2139;
+alias void function(uint, float) _BCD_func__2140;
+alias void function(uint, int, void *) _BCD_func__2141;
+alias void function(uint, int, int, int, uint, int, void *) _BCD_func__2142;
+alias void function(uint, int, int, int, int, int, uint, int, void *) _BCD_func__2143;
+alias void function(uint, int, int, int, int, int, int, int, uint, int, void *) _BCD_func__2144;
+alias void function(uint, int, int, int, int, int, void *) _BCD_func__2145;
+alias void function(uint, int, int, int, int, int, int, void *) _BCD_func__2146;
+alias void function(uint, int, int, int, int, int, int, int, void *) _BCD_func__2147;
+alias void function(uint, uint, uint *) _BCD_func__2148;
+alias void function(uint, uint, float *) _BCD_func__2149;
+alias void function(uint, short *) _BCD_func__2150;
+alias void function(uint, int *) _BCD_func__2151;
+alias void function(uint, double *) _BCD_func__2152;
+alias void function(uint, char *) _BCD_func__2153;
+alias void function(uint, uint, uint) _BCD_func__2154;
+alias void function(uint, uint, float *) _BCD_func__2155;
+alias void function(uint, uint, uint, uint, uint) _BCD_func__2156;
+alias void function(uint, uint, uint, uint) _BCD_func__2157;
+alias void function(uint, uint) _BCD_func__2158;
+alias void function(uint, short *) _BCD_func__2159;
+alias void function(uint, int *) _BCD_func__2160;
+alias void function(uint, float *) _BCD_func__2161;
+alias void function(uint, double *) _BCD_func__2162;
+alias void function(uint, char *) _BCD_func__2163;
+alias char function(uint) _BCD_func__2164;
+alias uint function(int) _BCD_func__2165;
+alias uint function(short *) _BCD_func__2166;
+alias uint function(int *) _BCD_func__2167;
+alias uint function(float *) _BCD_func__2168;
+alias uint function(double *) _BCD_func__2169;
+alias uint function(char *) _BCD_func__2170;
+alias void function() _BCD_func__2171;
+alias void function(int, uint *) _BCD_func__2172;
+alias void function(uint) _BCD_func__2173;
+alias void function(uint, uint, int *) _BCD_func__2174;
+alias void function(uint, uint, char *) _BCD_func__2175;
+alias void function(uint, uint, void * *) _BCD_func__2176;
+alias char function(uint, uint) _BCD_func__2177;
+alias uint function(uint) _BCD_func__2178;
+alias uint function(uint, uint) _BCD_func__2179;
+alias uint function(uint, uint, uint) _BCD_func__2180;
+alias void function(uint) _BCD_func__2181;
+alias void function(uint, uint, int, void *) _BCD_func__2182;
+alias void function(uint, uint *) _BCD_func__2183;
+alias void function(uint, ushort *) _BCD_func__2184;
+alias void function(uint, char *) _BCD_func__2185;
+alias void function(uint, double *) _BCD_func__2186;
+alias void function(uint, float *) _BCD_func__2187;
+alias void function(uint, int *) _BCD_func__2188;
+alias void function(uint, short *) _BCD_func__2189;
+alias void function(uint, char *) _BCD_func__2190;
+alias void function(uint, uint, void *) _BCD_func__2191;
+alias uint function(uint, uint, uint, uint) _BCD_func__2192;
+alias void function(uint, uint, uint) _BCD_func__2193;
+alias void function(uint, uint, uint, uint, uint, uint) _BCD_func__2194;
+alias void function(uint, uint, uint, uint, uint) _BCD_func__2195;
+alias void function(uint, uint, uint, uint) _BCD_func__2196;
+alias void function(uint, uint, uint, int) _BCD_func__2198;
+alias void function(uint, int) _BCD_func__2199;
+alias void function(uint, void *) _BCD_func__2200;
+alias void function(uint, uint, int, uint, uint) _BCD_func__2201;
+alias void function(uint, int, uint, int, uint, uint) _BCD_func__2202;
+alias void function(uint, uint, int, void *, uint) _BCD_func__2203;
+alias uint function(int, void *, uint) _BCD_func__2204;
+alias char function(int, int, int, int) _BCD_func__2205;
+alias char function() _BCD_func__2206;
+alias void function(uint, int *, uint, void * *, int) _BCD_func__2207;
+alias void function(uint, int *, int *, int) _BCD_func__2208;
+alias void function(int, uint, int, void *) _BCD_func__2209;
+alias void function(double *) _BCD_func__2210;
+alias void function(float *) _BCD_func__2211;
+alias void function(uint *) _BCD_func__2212;
+alias void function(int *) _BCD_func__2213;
+alias void function(ushort *) _BCD_func__2214;
+alias void function(short *) _BCD_func__2215;
+alias void function(char *) _BCD_func__2216;
+alias void function(char *) _BCD_func__2217;
+alias void function(double, double, double) _BCD_func__2218;
+alias void function(float, float, float) _BCD_func__2219;
+alias void function(int, int, int) _BCD_func__2220;
+alias void function(ushort, ushort, ushort) _BCD_func__2221;
+alias void function(short, short, short) _BCD_func__2222;
+alias void function(char, char, char) _BCD_func__2223;
+alias void function(char, char, char) _BCD_func__2224;
+alias void function(uint, int, void *) _BCD_func__2225;
+alias void function(double) _BCD_func__2226;
+alias void function(float) _BCD_func__2227;
+alias void function(int, int) _BCD_func__2228;
+alias void function(uint, uint, int *) _BCD_func__2229;
+alias void function(uint, uint, float *) _BCD_func__2230;
+alias void function(uint, uint, uint, void *) _BCD_func__2231;
+alias void function(uint, uint, int, int, int) _BCD_func__2232;
+alias void function(uint, uint, int, uint, uint, void *) _BCD_func__2233;
+alias void function(uint, int, int, uint, uint, void *) _BCD_func__2234;
+alias void function(int, uint, int, int, void *) _BCD_func__2236;
+alias void function(uint, int, int, void *) _BCD_func__2237;
+alias void function(uint, void * *) _BCD_func__2238;
+alias void function(int, int, char *) _BCD_func__2239;
+alias void function(uint, int, int) _BCD_func__2240;
+alias void function(int) _BCD_func__2241;
+alias void function(uint, short *) _BCD_func__2244;
+alias void function(uint, short, short, short, short) _BCD_func__2245;
+alias void function(uint, int *) _BCD_func__2246;
+alias void function(uint, int, int, int, int) _BCD_func__2247;
+alias void function(uint, float *) _BCD_func__2248;
+alias void function(uint, float, float, float, float) _BCD_func__2249;
+alias void function(uint, double *) _BCD_func__2250;
+alias void function(uint, double, double, double, double) _BCD_func__2251;
+alias void function(uint, short, short, short) _BCD_func__2252;
+alias void function(uint, int, int, int) _BCD_func__2253;
+alias void function(uint, float, float, float) _BCD_func__2254;
+alias void function(uint, double, double, double) _BCD_func__2255;
+alias void function(uint, short, short) _BCD_func__2256;
+alias void function(uint, float, float) _BCD_func__2257;
+alias void function(uint, double, double) _BCD_func__2258;
+alias void function(uint, short) _BCD_func__2259;
+alias void function(uint, int) _BCD_func__2260;
+alias void function(uint, float) _BCD_func__2261;
+alias void function(uint, double) _BCD_func__2262;
+alias void function(uint, int, void *) _BCD_func__2263;
+alias void function(uint, int, int, int, uint, int, void *) _BCD_func__2264;
+alias void function(uint, int, int, int, int, int, uint, int, void *) _BCD_func__2265;
+alias void function(uint, int, int, int, int, int, int, int, uint, int, void *) _BCD_func__2266;
+alias void function(uint, int, uint, int, int, int, void *) _BCD_func__2267;
+alias void function(uint, int, uint, int, int, int, int, void *) _BCD_func__2268;
+alias void function(uint, int, uint, int, int, int, int, int, void *) _BCD_func__2269;
+alias void function(float, char) _BCD_func__2270;
+alias void function(uint, uint, char) _BCD_func__2271;
+alias void function(uint, int, uint, char) _BCD_func__2272;
+alias void function(uint, char, uint, uint, void *) _BCD_func__2273;
+alias void function(uint, uint, int, int, uint, uint, void *, void *) _BCD_func__2274;
+alias void function(uint, uint, uint, void *, void *, void *) _BCD_func__2275;
+alias void function(uint, uint, int, int, int, int) _BCD_func__2276;
+alias void function(uint, uint, int *) _BCD_func__2277;
+alias void function(uint, uint, int) _BCD_func__2278;
+alias void function(uint, uint, float *) _BCD_func__2279;
+alias void function(uint, uint, float) _BCD_func__2280;
+alias void function(uint, uint, int, int, uint, uint, void *) _BCD_func__2281;
+alias void function(float, float, float, float) _BCD_func__2282;
+alias void function(uint, int, int, int, int, int, int, int, int) _BCD_func__2283;
+alias void function(uint, int, int, int, int, int, int, int, uint, uint, void *) _BCD_func__2284;
+alias void function(uint, int, int, int, int, int, int, uint, uint, void *) _BCD_func__2285;
+alias void function(uint, uint, uint, uint, void *) _BCD_func__2286;
+alias void function(void *, char *, int, int, char * *) _BCD_func__2388;
+alias int function(void *) _BCD_func__2428;
+alias int function(void *, XErrorEvent *) _BCD_func__2429;
+alias void function(void *, char *, char *) _BCD_func__2502;
+alias int function(void *, char *, char *) _BCD_func__2503;
+alias void function(void *, char *, char *) _BCD_func__2504;
+union __GLXEvent {
+GLXPbufferClobberEvent glxpbufferclobber;
+int [24] pad;
+}
+struct GLXPbufferClobberEvent {
+int event_type;
+int draw_type;
+uint serial;
+int send_event;
+void * display;
+uint drawable;
+uint buffer_mask;
+uint aux_buffer;
+int x;
+int y;
+int width;
+int height;
+int count;
+}
+
+version(DYNLINK){
+
+extern (C) void function(uint, int*) dwt_glGetIntegerv;
+extern (C) void function(int,int,int,int) dwt_glViewport;
+
+extern (C) int function(int)dwt_glXSwapIntervalSGI;
+extern (C) _BCD_func__2197 function(char *)dwt_glXGetProcAddressARB;
+extern (C) int function(void *, uint, void *)dwt_glXMakeCurrent;
+extern (C) void * function(void *, XVisualInfo *, void *, int)dwt_glXCreateContext;
+extern (C) void function(void *, uint)dwt_glXDestroyGLXPixmap;
+extern (C) uint function(void *, XVisualInfo *, uint)dwt_glXCreateGLXPixmap;
+extern (C) XVisualInfo * function(void *, int, int *)dwt_glXChooseVisual;
+extern (C) int function(void *, XVisualInfo *, int, int *)dwt_glXGetConfig;
+extern (C) void function(uint, int, int, int)dwt_glXUseXFont;
+extern (C) void function(void *, uint)dwt_glXSwapBuffers;
+extern (C) void function()dwt_glXWaitX;
+extern (C) void function()dwt_glXWaitGL;
+extern (C) void function(void *, uint, uint *)dwt_glXGetSelectedEvent;
+extern (C) void function(void *, uint, uint)dwt_glXSelectEvent;
+extern (C) int function(void *, void *, int, int *)dwt_glXQueryContext;
+extern (C) void * function()dwt_glXGetCurrentDisplay;
+extern (C) uint function()dwt_glXGetCurrentReadDrawable;
+extern (C) uint function()dwt_glXGetCurrentDrawable;
+extern (C) void * function()dwt_glXGetCurrentContext;
+extern (C) void function(void *, void *, void *, uint)dwt_glXCopyContext;
+extern (C) int function(void *, uint, uint, void *)dwt_glXMakeContextCurrent;
+extern (C) void function(void *, void *)dwt_glXDestroyContext;
+extern (C) int function(void *, void *)dwt_glXIsDirect;
+extern (C) void * function(void *, void *, int, void *, int)dwt_glXCreateNewContext;
+extern (C) void function(void *, uint, int, uint *)dwt_glXQueryDrawable;
+extern (C) void function(void *, uint)dwt_glXDestroyPbuffer;
+extern (C) uint function(void *, void *, int *)dwt_glXCreatePbuffer;
+extern (C) void function(void *, uint)dwt_glXDestroyPixmap;
+extern (C) uint function(void *, void *, uint, int *)dwt_glXCreatePixmap;
+extern (C) void function(void *, uint)dwt_glXDestroyWindow;
+extern (C) uint function(void *, void *, uint, int *)dwt_glXCreateWindow;
+extern (C) XVisualInfo * function(void *, void *)dwt_glXGetVisualFromFBConfig;
+extern (C) int function(void *, void *, int, int *)dwt_glXGetFBConfigAttrib;
+extern (C) void * * function(void *, int, int *, int *)dwt_glXChooseFBConfig;
+extern (C) void * * function(void *, int, int *)dwt_glXGetFBConfigs;
+extern (C) char * function(void *, int, int)dwt_glXQueryServerString;
+extern (C) char * function(void *, int)dwt_glXGetClientString;
+extern (C) char * function(void *, int)dwt_glXQueryExtensionsString;
+extern (C) int function(void *, int *, int *)dwt_glXQueryVersion;
+extern (C) int function(void *, int *, int *)dwt_glXQueryExtension;
+
+
+Symbol[] symbols = [
+    { "glGetIntegerv", cast(void**)& dwt_glGetIntegerv},
+    { "glViewport", cast(void**)& dwt_glViewport},
+    { "glXSwapIntervalSGI",  cast(void**)& dwt_glXSwapIntervalSGI},
+    { "glXGetProcAddressARB",  cast(void**)& dwt_glXGetProcAddressARB},
+    { "glXMakeCurrent",  cast(void**)& dwt_glXMakeCurrent},
+    { "glXCreateContext",  cast(void**)& dwt_glXCreateContext},
+    { "glXDestroyGLXPixmap",  cast(void**)& dwt_glXDestroyGLXPixmap},
+    { "glXCreateGLXPixmap",  cast(void**)& dwt_glXCreateGLXPixmap},
+    { "glXChooseVisual",  cast(void**)& dwt_glXChooseVisual},
+    { "glXGetConfig",  cast(void**)& dwt_glXGetConfig},
+    { "glXUseXFont",  cast(void**)& dwt_glXUseXFont},
+    { "glXSwapBuffers",  cast(void**)& dwt_glXSwapBuffers},
+    { "glXWaitX",  cast(void**)& dwt_glXWaitX},
+    { "glXWaitGL",  cast(void**)& dwt_glXWaitGL},
+    { "glXGetSelectedEvent",  cast(void**)& dwt_glXGetSelectedEvent},
+    { "glXSelectEvent",  cast(void**)& dwt_glXSelectEvent},
+    { "glXQueryContext",  cast(void**)& dwt_glXQueryContext},
+    { "glXGetCurrentDisplay",  cast(void**)& dwt_glXGetCurrentDisplay},
+    { "glXGetCurrentReadDrawable",  cast(void**)& dwt_glXGetCurrentReadDrawable},
+    { "glXGetCurrentDrawable",  cast(void**)& dwt_glXGetCurrentDrawable},
+    { "glXGetCurrentContext",  cast(void**)& dwt_glXGetCurrentContext},
+    { "glXCopyContext",  cast(void**)& dwt_glXCopyContext},
+    { "glXMakeContextCurrent",  cast(void**)& dwt_glXMakeContextCurrent},
+    { "glXDestroyContext",  cast(void**)& dwt_glXDestroyContext},
+    { "glXIsDirect",  cast(void**)& dwt_glXIsDirect},
+    { "glXCreateNewContext",  cast(void**)& dwt_glXCreateNewContext},
+    { "glXQueryDrawable",  cast(void**)& dwt_glXQueryDrawable},
+    { "glXDestroyPbuffer",  cast(void**)& dwt_glXDestroyPbuffer},
+    { "glXCreatePbuffer",  cast(void**)& dwt_glXCreatePbuffer},
+    { "glXDestroyPixmap",  cast(void**)& dwt_glXDestroyPixmap},
+    { "glXCreatePixmap",  cast(void**)& dwt_glXCreatePixmap},
+    { "glXDestroyWindow",  cast(void**)& dwt_glXDestroyWindow},
+    { "glXCreateWindow",  cast(void**)& dwt_glXCreateWindow},
+    { "glXGetVisualFromFBConfig",  cast(void**)& dwt_glXGetVisualFromFBConfig},
+    { "glXGetFBConfigAttrib",  cast(void**)& dwt_glXGetFBConfigAttrib},
+    { "glXChooseFBConfig",  cast(void**)& dwt_glXChooseFBConfig},
+    { "glXGetFBConfigs",  cast(void**)& dwt_glXGetFBConfigs},
+    { "glXQueryServerString",  cast(void**)& dwt_glXQueryServerString},
+    { "glXGetClientString",  cast(void**)& dwt_glXGetClientString},
+    { "glXQueryExtensionsString",  cast(void**)& dwt_glXQueryExtensionsString},
+    { "glXQueryVersion",  cast(void**)& dwt_glXQueryVersion},
+    { "glXQueryExtension",  cast(void**)& dwt_glXQueryExtension},
+];
+
+} else { // version(DYNLINK)
+extern (C) int glXSwapIntervalSGI(int);
+extern (C) _BCD_func__2197 glXGetProcAddressARB(char *);
+extern (C) int glXMakeCurrent(void *, uint, void *);
+extern (C) void * glXCreateContext(void *, XVisualInfo *, void *, int);
+extern (C) void glXDestroyGLXPixmap(void *, uint);
+extern (C) uint glXCreateGLXPixmap(void *, XVisualInfo *, uint);
+extern (C) XVisualInfo * glXChooseVisual(void *, int, int *);
+extern (C) int glXGetConfig(void *, XVisualInfo *, int, int *);
+extern (C) void glXUseXFont(uint, int, int, int);
+extern (C) void glXSwapBuffers(void *, uint);
+extern (C) void glXWaitX();
+extern (C) void glXWaitGL();
+extern (C) void glXGetSelectedEvent(void *, uint, uint *);
+extern (C) void glXSelectEvent(void *, uint, uint);
+extern (C) int glXQueryContext(void *, void *, int, int *);
+extern (C) void * glXGetCurrentDisplay();
+extern (C) uint glXGetCurrentReadDrawable();
+extern (C) uint glXGetCurrentDrawable();
+extern (C) void * glXGetCurrentContext();
+extern (C) void glXCopyContext(void *, void *, void *, uint);
+extern (C) int glXMakeContextCurrent(void *, uint, uint, void *);
+extern (C) void glXDestroyContext(void *, void *);
+extern (C) int glXIsDirect(void *, void *);
+extern (C) void * glXCreateNewContext(void *, void *, int, void *, int);
+extern (C) void glXQueryDrawable(void *, uint, int, uint *);
+extern (C) void glXDestroyPbuffer(void *, uint);
+extern (C) uint glXCreatePbuffer(void *, void *, int *);
+extern (C) void glXDestroyPixmap(void *, uint);
+extern (C) uint glXCreatePixmap(void *, void *, uint, int *);
+extern (C) void glXDestroyWindow(void *, uint);
+extern (C) uint glXCreateWindow(void *, void *, uint, int *);
+extern (C) XVisualInfo * glXGetVisualFromFBConfig(void *, void *);
+extern (C) int glXGetFBConfigAttrib(void *, void *, int, int *);
+extern (C) void * * glXChooseFBConfig(void *, int, int *, int *);
+extern (C) void * * glXGetFBConfigs(void *, int, int *);
+extern (C) char * glXQueryServerString(void *, int, int);
+extern (C) char * glXGetClientString(void *, int);
+extern (C) char * glXQueryExtensionsString(void *, int);
+extern (C) int glXQueryVersion(void *, int *, int *);
+extern (C) int glXQueryExtension(void *, int *, int *);
+} // version(DYNLINK)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/gmodule.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,88 @@
+/******************************************************************************
+    Based on the generated files from the BCD tool
+    modified by: Frank Benoit <keinfarbton@googlemail.com>
+******************************************************************************/
+module org.eclipse.swt.internal.c.gmodule;
+
+import java.lang.all;
+
+public import org.eclipse.swt.internal.c.glib_object;
+
+extern(C):
+align(4):
+
+alias void GModule;
+alias void function(void *) _BCD_func__1618;
+alias _BCD_func__1618 GModuleUnload;
+alias char * function(void *) _BCD_func__1619;
+alias _BCD_func__1619 GModuleCheckInit;
+enum GModuleFlags {
+G_MODULE_BIND_LAZY=1,
+G_MODULE_BIND_LOCAL=2,
+G_MODULE_BIND_MASK=3,
+}
+alias int function(void *, void *, void *) _BCD_func__1621;
+alias void function(void *) _BCD_func__1638;
+alias int function(void *, void *, void *) _BCD_func__1642;
+alias void function(_GScanner *, char *, int) _BCD_func__1645;
+alias int function(void *, _GString *, void *) _BCD_func__1718;
+alias void function(void *, void *, void *, _GError * *) _BCD_func__1737;
+alias int function(void *, void *, void *, _GError * *) _BCD_func__1738;
+alias int function(char *, char *, void *, _GError * *) _BCD_func__1739;
+alias void * function(void *, void *) _BCD_func__1750;
+alias void function(_GNode *, void *) _BCD_func__1751;
+alias int function(_GNode *, void *) _BCD_func__1752;
+alias void function(char *) _BCD_func__1760;
+alias void function(char *, int, char *, void *) _BCD_func__1762;
+alias int function(_GIOChannel *, int, void *) _BCD_func__1782;
+alias int function(_GPollFD *, uint, int) _BCD_func__1835;
+alias void function() _BCD_func__1841;
+alias void function(int, int, void *) _BCD_func__1842;
+alias int function(void *) _BCD_func__1843;
+alias void function(_GHookList *, _GHook *) _BCD_func__1879;
+alias int function(_GHook *, void *) _BCD_func__1880;
+alias void function(_GHook *, void *) _BCD_func__1881;
+alias int function(_GHook *, _GHook *) _BCD_func__1882;
+alias void function(uint, void *, void *) _BCD_func__1916;
+alias int function(char *, char *, uint) _BCD_func__1919;
+alias char * function(void *) _BCD_func__1920;
+alias void * function(void *) _BCD_func__1929;
+alias char * function(char *, void *) _BCD_func__2114;
+alias void function(void *, void *, void *) _BCD_func__2115;
+alias uint function(void *) _BCD_func__2116;
+alias void function(void *, void *) _BCD_func__2117;
+alias int function(void *, void *) _BCD_func__2118;
+alias int function(void *, void *, void *) _BCD_func__2119;
+alias int function(void *, void *) _BCD_func__2120;
+version(DYNLINK){
+extern (C) char * function(char *, char *)g_module_build_path;
+extern (C) char * function(void *)g_module_name;
+extern (C) int function(void *, char *, void * *)g_module_symbol;
+extern (C) char * function()g_module_error;
+extern (C) void function(void *)g_module_make_resident;
+extern (C) int function(void *)g_module_close;
+extern (C) void * function(char *, int)g_module_open;
+extern (C) int function()g_module_supported;
+
+
+Symbol[] symbols = [
+    { "g_module_build_path",  cast(void**)& g_module_build_path},
+    { "g_module_name",  cast(void**)& g_module_name},
+    { "g_module_symbol",  cast(void**)& g_module_symbol},
+    { "g_module_error",  cast(void**)& g_module_error},
+    { "g_module_make_resident",  cast(void**)& g_module_make_resident},
+    { "g_module_close",  cast(void**)& g_module_close},
+    { "g_module_open",  cast(void**)& g_module_open},
+    { "g_module_supported",  cast(void**)& g_module_supported},
+];
+
+} else { // version(DYNLINK)
+extern (C) char * g_module_build_path(char *, char *);
+extern (C) char * g_module_name(void *);
+extern (C) int g_module_symbol(void *, char *, void * *);
+extern (C) char * g_module_error();
+extern (C) void g_module_make_resident(void *);
+extern (C) int g_module_close(void *);
+extern (C) void * g_module_open(char *, int);
+extern (C) int g_module_supported();
+} // version(DYNLINK)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/gtk.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,16520 @@
+/******************************************************************************
+    Based on the generated files from the BCD tool
+    modified by: Frank Benoit <keinfarbton@googlemail.com>
+******************************************************************************/
+module org.eclipse.swt.internal.c.gtk;
+
+import java.lang.all;
+
+public import org.eclipse.swt.internal.c.atk;
+public import org.eclipse.swt.internal.c.cairo;
+public import org.eclipse.swt.internal.c.pango;
+public import org.eclipse.swt.internal.c.gdk;
+public import org.eclipse.swt.internal.c.glib_object;
+
+version=DYNLINK;
+
+version(DYNLINK){
+
+
+extern (C) int gtk_init_check(int *, char * * *);
+extern (C) char * gtk_set_locale();
+extern (C) extern uint gtk_interface_age;
+extern (C) extern uint gtk_binary_age;
+extern (C) extern uint gtk_micro_version;
+extern (C) extern uint gtk_minor_version;
+extern (C) extern uint gtk_major_version;
+
+
+    import tango.sys.SharedLib : SharedLib;
+    struct Symbol{
+        String name;
+        void** symbol;
+    }
+}
+
+void loadLib(){
+    version(DYNLINK){
+        String libname = "libgtk-x11-2.0.so";
+
+        SharedLib lib = SharedLib.load( libname );
+        if( lib is null ){
+            lib = SharedLib.load( libname ~ ".0" );
+        }
+        int loaded;
+        if ( lib !is null ) {
+            foreach( s; symbols ){
+                try{
+                    *s.symbol = lib.getSymbol( s.name.ptr );
+                }
+                catch(Exception e){}
+                if( *s.symbol is null ){
+                    //getDwtLogger().trace( __FILE__, __LINE__,  "{}: Symbol '{}' not found", libname, s.name );
+                }
+                else{
+                    loaded++;
+                }
+            }
+        } else {
+            getDwtLogger().trace( __FILE__, __LINE__,  "Could not load the library {}", libname );
+        }
+        assert( gtk_check_version !is null );
+    }
+}
+
+
+extern(C):
+align(4):
+
+version( ARGS_TYPED ){
+    alias _GtkVSeparatorClass aGtkVSeparatorClass;
+    alias _GtkVSeparator aGtkVSeparator;
+    alias _GtkVScaleClass aGtkVScaleClass;
+    alias _GtkVScale aGtkVScale;
+    alias _GtkVRulerClass aGtkVRulerClass;
+    alias _GtkVRuler aGtkVRuler;
+    alias _GtkVPanedClass aGtkVPanedClass;
+    alias _GtkVPaned aGtkVPaned;
+    alias _GtkVolumeButtonClass aGtkVolumeButtonClass;
+    alias _GtkVButtonBoxClass aGtkVButtonBoxClass;
+    alias _GtkVButtonBox aGtkVButtonBox;
+    alias _GtkUIManagerClass aGtkUIManagerClass;
+    alias _GtkUIManager aGtkUIManager;
+    alias _GtkTreeStoreClass aGtkTreeStoreClass;
+    alias _GtkTreeStore aGtkTreeStore;
+    alias _GtkTreeModelSortClass aGtkTreeModelSortClass;
+    alias _GtkTreeModelSort aGtkTreeModelSort;
+    alias _GtkTreeDragDestIface aGtkTreeDragDestIface;
+    alias _GtkTreeDragSourceIface aGtkTreeDragSourceIface;
+    alias _GtkToolbarClass aGtkToolbarClass;
+    alias _GtkToolbar aGtkToolbar;
+    alias _GtkToolbarChild aGtkToolbarChild;
+    alias _GtkTipsQueryClass aGtkTipsQueryClass;
+    alias _GtkTipsQuery aGtkTipsQuery;
+    alias _GtkTextViewClass aGtkTextViewClass;
+    alias _GtkTextView aGtkTextView;
+    alias _GtkTextBufferClass aGtkTextBufferClass;
+    alias _GtkTextMarkClass aGtkTextMarkClass;
+    alias _GtkTextMark aGtkTextMark;
+    alias _GtkTextTagTableClass aGtkTextTagTableClass;
+    alias _GtkTearoffMenuItemClass aGtkTearoffMenuItemClass;
+    alias _GtkTearoffMenuItem aGtkTearoffMenuItem;
+    alias _GtkTableRowCol aGtkTableRowCol;
+    alias _GtkTableChild aGtkTableChild;
+    alias _GtkTableClass aGtkTableClass;
+    alias _GtkTable aGtkTable;
+    alias _GtkStockItem aGtkStockItem;
+    alias _GtkStatusIconClass aGtkStatusIconClass;
+    alias _GtkStatusIcon aGtkStatusIcon;
+    alias _GtkStatusbarClass aGtkStatusbarClass;
+    alias _GtkStatusbar aGtkStatusbar;
+    alias _GtkSpinButtonClass aGtkSpinButtonClass;
+    alias _GtkSpinButton aGtkSpinButton;
+    alias _GtkSizeGroupClass aGtkSizeGroupClass;
+    alias _GtkSizeGroup aGtkSizeGroup;
+    alias _GtkSeparatorToolItemClass aGtkSeparatorToolItemClass;
+    alias _GtkSeparatorToolItem aGtkSeparatorToolItem;
+    alias _GtkSeparatorMenuItemClass aGtkSeparatorMenuItemClass;
+    alias _GtkSeparatorMenuItem aGtkSeparatorMenuItem;
+    alias _GtkScrolledWindowClass aGtkScrolledWindowClass;
+    alias _GtkScrolledWindow aGtkScrolledWindow;
+    alias _GtkViewportClass aGtkViewportClass;
+    alias _GtkViewport aGtkViewport;
+    alias _GtkScaleButtonClass aGtkScaleButtonClass;
+    alias _GtkScaleButton aGtkScaleButton;
+    alias _GtkRecentChooserWidgetClass aGtkRecentChooserWidgetClass;
+    alias _GtkRecentChooserWidget aGtkRecentChooserWidget;
+    alias _GtkRecentChooserMenuClass aGtkRecentChooserMenuClass;
+    alias _GtkRecentChooserMenu aGtkRecentChooserMenu;
+    alias _GtkRecentChooserDialogClass aGtkRecentChooserDialogClass;
+    alias _GtkRecentChooserDialog aGtkRecentChooserDialog;
+    alias _GtkRecentChooserIface aGtkRecentChooserIface;
+    alias _GtkRecentFilterInfo aGtkRecentFilterInfo;
+    alias _GtkRecentActionClass aGtkRecentActionClass;
+    alias _GtkRecentAction aGtkRecentAction;
+    alias _GtkRecentManagerClass aGtkRecentManagerClass;
+    alias _GtkRecentManager aGtkRecentManager;
+    alias _GtkRecentData aGtkRecentData;
+    alias _GtkRadioToolButtonClass aGtkRadioToolButtonClass;
+    alias _GtkRadioToolButton aGtkRadioToolButton;
+    alias _GtkToggleToolButtonClass aGtkToggleToolButtonClass;
+    alias _GtkToggleToolButton aGtkToggleToolButton;
+    alias _GtkRadioMenuItemClass aGtkRadioMenuItemClass;
+    alias _GtkRadioMenuItem aGtkRadioMenuItem;
+    alias _GtkRadioButtonClass aGtkRadioButtonClass;
+    alias _GtkRadioButton aGtkRadioButton;
+    alias _GtkRadioActionClass aGtkRadioActionClass;
+    alias _GtkRadioAction aGtkRadioAction;
+    alias _GtkToggleActionClass aGtkToggleActionClass;
+    alias _GtkToggleAction aGtkToggleAction;
+    alias _GtkProgressBarClass aGtkProgressBarClass;
+    alias _GtkProgressBar aGtkProgressBar;
+    alias _GtkProgressClass aGtkProgressClass;
+    alias _GtkProgress aGtkProgress;
+    alias _GtkPrintOperation aGtkPrintOperation;
+    alias _GtkPrintOperationClass aGtkPrintOperationClass;
+    alias _GtkPrintOperationPreviewIface aGtkPrintOperationPreviewIface;
+    alias _GtkPageRange aGtkPageRange;
+    alias _GtkPreviewClass aGtkPreviewClass;
+    alias _GtkPreviewInfo aGtkPreviewInfo;
+    alias _GtkPreview aGtkPreview;
+    alias _GtkPlugClass aGtkPlugClass;
+    alias _GtkPlug aGtkPlug;
+    alias _GtkSocketClass aGtkSocketClass;
+    alias _GtkSocket aGtkSocket;
+    alias _GtkPixmapClass aGtkPixmapClass;
+    alias _GtkPixmap aGtkPixmap;
+    alias _GtkOptionMenuClass aGtkOptionMenuClass;
+    alias _GtkOptionMenu aGtkOptionMenu;
+    alias _GtkOldEditableClass aGtkOldEditableClass;
+    alias _GtkOldEditable aGtkOldEditable;
+    alias _GtkNotebookClass aGtkNotebookClass;
+    alias _GtkNotebook aGtkNotebook;
+    alias _GtkMessageDialogClass aGtkMessageDialogClass;
+    alias _GtkMessageDialog aGtkMessageDialog;
+    alias _GtkMenuToolButton aGtkMenuToolButton;
+    alias _GtkMenuToolButtonClass aGtkMenuToolButtonClass;
+    alias _GtkToolButtonClass aGtkToolButtonClass;
+    alias _GtkToolButton aGtkToolButton;
+    alias _GtkToolItemClass aGtkToolItemClass;
+    alias _GtkToolItem aGtkToolItem;
+    alias _GtkTooltipsData aGtkTooltipsData;
+    alias _GtkTooltipsClass aGtkTooltipsClass;
+    alias _GtkTooltips aGtkTooltips;
+    alias _GtkMenuBarClass aGtkMenuBarClass;
+    alias _GtkMenuBar aGtkMenuBar;
+    alias _GtkListClass aGtkListClass;
+    alias _GtkList aGtkList;
+    alias _GtkListItemClass aGtkListItemClass;
+    alias _GtkListItem aGtkListItem;
+    alias _GtkLinkButtonClass aGtkLinkButtonClass;
+    alias _GtkLinkButton aGtkLinkButton;
+    alias _GtkLayoutClass aGtkLayoutClass;
+    alias _GtkLayout aGtkLayout;
+    alias _GtkInvisibleClass aGtkInvisibleClass;
+    alias _GtkInvisible aGtkInvisible;
+    alias _GtkInputDialogClass aGtkInputDialogClass;
+    alias _GtkInputDialog aGtkInputDialog;
+    alias _GtkIMMulticontextClass aGtkIMMulticontextClass;
+    alias _GtkIMMulticontext aGtkIMMulticontext;
+    alias _GtkIMContextSimpleClass aGtkIMContextSimpleClass;
+    alias _GtkIMContextSimple aGtkIMContextSimple;
+    alias _GtkImageMenuItemClass aGtkImageMenuItemClass;
+    alias _GtkImageMenuItem aGtkImageMenuItem;
+    alias _GtkIconViewClass aGtkIconViewClass;
+    alias _GtkIconView aGtkIconView;
+    alias _GtkIconThemeClass aGtkIconThemeClass;
+    alias _GtkIconTheme aGtkIconTheme;
+    alias _GtkIconFactoryClass aGtkIconFactoryClass;
+    alias _GtkHSeparatorClass aGtkHSeparatorClass;
+    alias _GtkHSeparator aGtkHSeparator;
+    alias _GtkSeparatorClass aGtkSeparatorClass;
+    alias _GtkSeparator aGtkSeparator;
+    alias _GtkHScaleClass aGtkHScaleClass;
+    alias _GtkHScale aGtkHScale;
+    alias _GtkScaleClass aGtkScaleClass;
+    alias _GtkScale aGtkScale;
+    alias _GtkHRulerClass aGtkHRulerClass;
+    alias _GtkHRuler aGtkHRuler;
+    alias _GtkRulerMetric aGtkRulerMetric;
+    alias _GtkRulerClass aGtkRulerClass;
+    alias _GtkRuler aGtkRuler;
+    alias _GtkHPanedClass aGtkHPanedClass;
+    alias _GtkHPaned aGtkHPaned;
+    alias _GtkPanedClass aGtkPanedClass;
+    alias _GtkPaned aGtkPaned;
+    alias _GtkHButtonBoxClass aGtkHButtonBoxClass;
+    alias _GtkHButtonBox aGtkHButtonBox;
+    alias _GtkHandleBoxClass aGtkHandleBoxClass;
+    alias _GtkHandleBox aGtkHandleBox;
+    alias _GtkGammaCurveClass aGtkGammaCurveClass;
+    alias _GtkGammaCurve aGtkGammaCurve;
+    alias _GtkFontSelectionDialogClass aGtkFontSelectionDialogClass;
+    alias _GtkFontSelectionDialog aGtkFontSelectionDialog;
+    alias _GtkFontSelectionClass aGtkFontSelectionClass;
+    alias _GtkFontSelection aGtkFontSelection;
+    alias _GtkFontButtonClass aGtkFontButtonClass;
+    alias _GtkFontButton aGtkFontButton;
+    alias _GtkFileChooserWidgetClass aGtkFileChooserWidgetClass;
+    alias _GtkFileChooserWidget aGtkFileChooserWidget;
+    alias _GtkFileChooserDialogClass aGtkFileChooserDialogClass;
+    alias _GtkFileChooserDialog aGtkFileChooserDialog;
+    alias _GtkFileChooserButtonClass aGtkFileChooserButtonClass;
+    alias _GtkFileChooserButton aGtkFileChooserButton;
+    alias _GtkFileFilterInfo aGtkFileFilterInfo;
+    alias _GtkFixedChild aGtkFixedChild;
+    alias _GtkFixedClass aGtkFixedClass;
+    alias _GtkFixed aGtkFixed;
+    alias _GtkFileSelectionClass aGtkFileSelectionClass;
+    alias _GtkFileSelection aGtkFileSelection;
+    alias _GtkExpanderClass aGtkExpanderClass;
+    alias _GtkExpander aGtkExpander;
+    alias _GtkEventBoxClass aGtkEventBoxClass;
+    alias _GtkEventBox aGtkEventBox;
+    alias _GtkCurveClass aGtkCurveClass;
+    alias _GtkCurve aGtkCurve;
+    alias _GtkDrawingAreaClass aGtkDrawingAreaClass;
+    alias _GtkDrawingArea aGtkDrawingArea;
+    alias _GtkCTreeNode aGtkCTreeNode;
+    alias _GtkCTreeRow aGtkCTreeRow;
+    alias _GtkCTreeClass aGtkCTreeClass;
+    alias _GtkCTree aGtkCTree;
+    alias _GtkComboBoxEntryClass aGtkComboBoxEntryClass;
+    alias _GtkComboBoxEntry aGtkComboBoxEntry;
+    alias _GtkComboBoxClass aGtkComboBoxClass;
+    alias _GtkComboBox aGtkComboBox;
+    alias _GtkTreeSelectionClass aGtkTreeSelectionClass;
+    alias _GtkTreeSelection aGtkTreeSelection;
+    alias _GtkTreeViewClass aGtkTreeViewClass;
+    alias _GtkTreeView aGtkTreeView;
+    alias _GtkEntryClass aGtkEntryClass;
+    alias _GtkEntry aGtkEntry;
+    alias _GtkEntryCompletionClass aGtkEntryCompletionClass;
+    alias _GtkEntryCompletion aGtkEntryCompletion;
+    alias _GtkTreeModelFilterClass aGtkTreeModelFilterClass;
+    alias _GtkTreeModelFilter aGtkTreeModelFilter;
+    alias _GtkListStoreClass aGtkListStoreClass;
+    alias _GtkListStore aGtkListStore;
+    alias _GtkIMContextClass aGtkIMContextClass;
+    alias _GtkIMContext aGtkIMContext;
+    alias _GtkEditableClass aGtkEditableClass;
+    alias _GtkComboClass aGtkComboClass;
+    alias _GtkCombo aGtkCombo;
+    alias _GtkHBoxClass aGtkHBoxClass;
+    alias _GtkHBox aGtkHBox;
+    alias _GtkColorSelectionDialogClass aGtkColorSelectionDialogClass;
+    alias _GtkColorSelectionDialog aGtkColorSelectionDialog;
+    alias _GtkColorSelectionClass aGtkColorSelectionClass;
+    alias _GtkColorSelection aGtkColorSelection;
+    alias _GtkVBoxClass aGtkVBoxClass;
+    alias _GtkVBox aGtkVBox;
+    alias _GtkColorButtonClass aGtkColorButtonClass;
+    alias _GtkColorButton aGtkColorButton;
+    alias _GtkCListDestInfo aGtkCListDestInfo;
+    alias _GtkCListCellInfo aGtkCListCellInfo;
+    alias _GtkCellWidget aGtkCellWidget;
+    alias _GtkCellPixText aGtkCellPixText;
+    alias _GtkCellPixmap aGtkCellPixmap;
+    alias _GtkCellText aGtkCellText;
+    alias _GtkCell aGtkCell;
+    alias _GtkCListRow aGtkCListRow;
+    alias _GtkCListColumn aGtkCListColumn;
+    alias _GtkCListClass aGtkCListClass;
+    alias _GtkCList aGtkCList;
+    alias _GtkVScrollbarClass aGtkVScrollbarClass;
+    alias _GtkVScrollbar aGtkVScrollbar;
+    alias _GtkHScrollbarClass aGtkHScrollbarClass;
+    alias _GtkHScrollbar aGtkHScrollbar;
+    alias _GtkScrollbarClass aGtkScrollbarClass;
+    alias _GtkScrollbar aGtkScrollbar;
+    alias _GtkRangeClass aGtkRangeClass;
+    alias _GtkRange aGtkRange;
+    alias _GtkTargetPair aGtkTargetPair;
+    alias _GtkTargetEntry aGtkTargetEntry;
+    alias _GtkTargetList aGtkTargetList;
+    alias _GtkTextBuffer aGtkTextBuffer;
+    alias _GtkTextChildAnchorClass aGtkTextChildAnchorClass;
+    alias _GtkTextChildAnchor aGtkTextChildAnchor;
+    alias _GtkTextAppearance aGtkTextAppearance;
+    alias _GtkTextTagClass aGtkTextTagClass;
+    alias _GtkTextTag aGtkTextTag;
+    alias _GtkTextAttributes aGtkTextAttributes;
+    alias _GtkTextTagTable aGtkTextTagTable;
+    alias _GtkTextIter aGtkTextIter;
+    alias _GtkCheckMenuItemClass aGtkCheckMenuItemClass;
+    alias _GtkCheckMenuItem aGtkCheckMenuItem;
+    alias _GtkMenuItemClass aGtkMenuItemClass;
+    alias _GtkMenuItem aGtkMenuItem;
+    alias _GtkItemClass aGtkItemClass;
+    alias _GtkItem aGtkItem;
+    alias _GtkCheckButtonClass aGtkCheckButtonClass;
+    alias _GtkCheckButton aGtkCheckButton;
+    alias _GtkToggleButtonClass aGtkToggleButtonClass;
+    alias _GtkToggleButton aGtkToggleButton;
+    alias _GtkCellViewClass aGtkCellViewClass;
+    alias _GtkCellView aGtkCellView;
+    alias _GtkCellRendererToggleClass aGtkCellRendererToggleClass;
+    alias _GtkCellRendererToggle aGtkCellRendererToggle;
+    alias _GtkCellRendererSpinClass aGtkCellRendererSpinClass;
+    alias _GtkCellRendererSpin aGtkCellRendererSpin;
+    alias _GtkCellRendererProgressClass aGtkCellRendererProgressClass;
+    alias _GtkCellRendererProgress aGtkCellRendererProgress;
+    alias _GtkCellRendererPixbufClass aGtkCellRendererPixbufClass;
+    alias _GtkCellRendererPixbuf aGtkCellRendererPixbuf;
+    alias _GtkCellRendererComboClass aGtkCellRendererComboClass;
+    alias _GtkCellRendererCombo aGtkCellRendererCombo;
+    alias _GtkCellRendererAccelClass aGtkCellRendererAccelClass;
+    alias _GtkCellRendererAccel aGtkCellRendererAccel;
+    alias _GtkCellRendererTextClass aGtkCellRendererTextClass;
+    alias _GtkCellRendererText aGtkCellRendererText;
+    alias _GtkCellLayoutIface aGtkCellLayoutIface;
+    alias _GtkTreeViewColumnClass aGtkTreeViewColumnClass;
+    alias _GtkTreeViewColumn aGtkTreeViewColumn;
+    alias _GtkTreeSortableIface aGtkTreeSortableIface;
+    alias _GtkTreeModelIface aGtkTreeModelIface;
+    alias _GtkTreeIter aGtkTreeIter;
+    alias _GtkCellRendererClass aGtkCellRendererClass;
+    alias _GtkCellRenderer aGtkCellRenderer;
+    alias _GtkCellEditableIface aGtkCellEditableIface;
+    alias _GtkCalendarClass aGtkCalendarClass;
+    alias _GtkCalendar aGtkCalendar;
+    alias _GtkButtonClass aGtkButtonClass;
+    alias _GtkButton aGtkButton;
+    alias _GtkImageIconNameData aGtkImageIconNameData;
+    alias _GtkImageAnimationData aGtkImageAnimationData;
+    alias _GtkImageIconSetData aGtkImageIconSetData;
+    alias _GtkImageStockData aGtkImageStockData;
+    alias _GtkImagePixbufData aGtkImagePixbufData;
+    alias _GtkImageImageData aGtkImageImageData;
+    alias _GtkImagePixmapData aGtkImagePixmapData;
+    alias _GtkImageClass aGtkImageClass;
+    alias _GtkImage aGtkImage;
+    alias _GtkBuildableIface aGtkBuildableIface;
+    alias _GtkBuilderClass aGtkBuilderClass;
+    alias _GtkBuilder aGtkBuilder;
+    alias _GtkBindingArg aGtkBindingArg;
+    alias _GtkBindingSignal aGtkBindingSignal;
+    alias _GtkBindingEntry aGtkBindingEntry;
+    alias _GtkBindingSet aGtkBindingSet;
+    alias _GtkButtonBoxClass aGtkButtonBoxClass;
+    alias _GtkButtonBox aGtkButtonBox;
+    alias _GtkBoxChild aGtkBoxChild;
+    alias _GtkBoxClass aGtkBoxClass;
+    alias _GtkBox aGtkBox;
+    alias _GtkAssistantClass aGtkAssistantClass;
+    alias _GtkAssistant aGtkAssistant;
+    alias _GtkAspectFrameClass aGtkAspectFrameClass;
+    alias _GtkAspectFrame aGtkAspectFrame;
+    alias _GtkFrameClass aGtkFrameClass;
+    alias _GtkFrame aGtkFrame;
+    alias _GtkArrowClass aGtkArrowClass;
+    alias _GtkArrow aGtkArrow;
+    alias _GtkAlignmentClass aGtkAlignmentClass;
+    alias _GtkAlignment aGtkAlignment;
+    alias _GtkRadioActionEntry aGtkRadioActionEntry;
+    alias _GtkToggleActionEntry aGtkToggleActionEntry;
+    alias _GtkActionEntry aGtkActionEntry;
+    alias _GtkActionGroupClass aGtkActionGroupClass;
+    alias _GtkActionGroup aGtkActionGroup;
+    alias _GtkItemFactoryItem aGtkItemFactoryItem;
+    alias _GtkItemFactoryEntry aGtkItemFactoryEntry;
+    alias _GtkItemFactoryClass aGtkItemFactoryClass;
+    alias _GtkItemFactory aGtkItemFactory;
+    alias _GtkActionClass aGtkActionClass;
+    alias _GtkAction aGtkAction;
+    alias _GtkAccessibleClass aGtkAccessibleClass;
+    alias _GtkAccessible aGtkAccessible;
+    alias _GtkAccelLabelClass aGtkAccelLabelClass;
+    alias _GtkAccelLabel aGtkAccelLabel;
+    alias _GtkLabelClass aGtkLabelClass;
+    alias _GtkLabel aGtkLabel;
+    alias _GtkMenuClass aGtkMenuClass;
+    alias _GtkMenu aGtkMenu;
+    alias _GtkMenuShellClass aGtkMenuShellClass;
+    alias _GtkMenuShell aGtkMenuShell;
+    alias _GtkMiscClass aGtkMiscClass;
+    alias _GtkMisc aGtkMisc;
+    alias _GtkAboutDialogClass aGtkAboutDialogClass;
+    alias _GtkAboutDialog aGtkAboutDialog;
+    alias _GtkDialogClass aGtkDialogClass;
+    alias _GtkDialog aGtkDialog;
+    alias _GtkWindowGroupClass aGtkWindowGroupClass;
+    alias _GtkWindowGroup aGtkWindowGroup;
+    alias _GtkWindowClass aGtkWindowClass;
+    alias _GtkBinClass aGtkBinClass;
+    alias _GtkBin aGtkBin;
+    alias _GtkContainerClass aGtkContainerClass;
+    alias _GtkContainer aGtkContainer;
+    alias _GtkWindow aGtkWindow;
+    alias _GtkWidgetShapeInfo aGtkWidgetShapeInfo;
+    alias _GtkWidgetAuxInfo aGtkWidgetAuxInfo;
+    alias _GtkWidgetClass aGtkWidgetClass;
+    alias _GtkSelectionData aGtkSelectionData;
+    alias _GtkRequisition aGtkRequisition;
+    alias _GtkSettingsValue aGtkSettingsValue;
+    alias _GtkSettingsClass aGtkSettingsClass;
+    alias _GtkRcStyleClass aGtkRcStyleClass;
+    alias _GtkIconFactory aGtkIconFactory;
+    alias _GtkWidget aGtkWidget;
+    alias _GtkSettings aGtkSettings;
+    alias _GtkRcProperty aGtkRcProperty;
+    alias _GtkRcStyle aGtkRcStyle;
+    alias _GtkStyleClass aGtkStyleClass;
+    alias _GtkStyle aGtkStyle;
+    alias _GtkBorder aGtkBorder;
+    alias _GtkAdjustmentClass aGtkAdjustmentClass;
+    alias _GtkAdjustment aGtkAdjustment;
+    alias _GtkObjectClass aGtkObjectClass;
+    alias _GtkTypeInfo aGtkTypeInfo;
+    alias _GtkObject aGtkObject;
+    alias _GtkArg aGtkArg;
+    alias _GtkAccelGroupEntry aGtkAccelGroupEntry;
+    alias _GtkAccelKey aGtkAccelKey;
+    alias _GtkAccelGroupClass aGtkAccelGroupClass;
+    alias _GtkAccelGroup aGtkAccelGroup;
+}
+else{
+    alias void aGtkVSeparatorClass;
+    alias void aGtkVSeparator;
+    alias void aGtkVScaleClass;
+    alias void aGtkVScale;
+    alias void aGtkVRulerClass;
+    alias void aGtkVRuler;
+    alias void aGtkVPanedClass;
+    alias void aGtkVPaned;
+    alias void aGtkVolumeButtonClass;
+    alias void aGtkVButtonBoxClass;
+    alias void aGtkVButtonBox;
+    alias void aGtkUIManagerClass;
+    alias void aGtkUIManager;
+    alias void aGtkTreeStoreClass;
+    alias void aGtkTreeStore;
+    alias void aGtkTreeModelSortClass;
+    alias void aGtkTreeModelSort;
+    alias void aGtkTreeDragDestIface;
+    alias void aGtkTreeDragSourceIface;
+    alias void aGtkToolbarClass;
+    alias void aGtkToolbar;
+    alias void aGtkToolbarChild;
+    alias void aGtkTipsQueryClass;
+    alias void aGtkTipsQuery;
+    alias void aGtkTextViewClass;
+    alias void aGtkTextView;
+    alias void aGtkTextBufferClass;
+    alias void aGtkTextMarkClass;
+    alias void aGtkTextMark;
+    alias void aGtkTextTagTableClass;
+    alias void aGtkTearoffMenuItemClass;
+    alias void aGtkTearoffMenuItem;
+    alias void aGtkTableRowCol;
+    alias void aGtkTableChild;
+    alias void aGtkTableClass;
+    alias void aGtkTable;
+    alias void aGtkStockItem;
+    alias void aGtkStatusIconClass;
+    alias void aGtkStatusIcon;
+    alias void aGtkStatusbarClass;
+    alias void aGtkStatusbar;
+    alias void aGtkSpinButtonClass;
+    alias void aGtkSpinButton;
+    alias void aGtkSizeGroupClass;
+    alias void aGtkSizeGroup;
+    alias void aGtkSeparatorToolItemClass;
+    alias void aGtkSeparatorToolItem;
+    alias void aGtkSeparatorMenuItemClass;
+    alias void aGtkSeparatorMenuItem;
+    alias void aGtkScrolledWindowClass;
+    alias void aGtkScrolledWindow;
+    alias void aGtkViewportClass;
+    alias void aGtkViewport;
+    alias void aGtkScaleButtonClass;
+    alias void aGtkScaleButton;
+    alias void aGtkRecentChooserWidgetClass;
+    alias void aGtkRecentChooserWidget;
+    alias void aGtkRecentChooserMenuClass;
+    alias void aGtkRecentChooserMenu;
+    alias void aGtkRecentChooserDialogClass;
+    alias void aGtkRecentChooserDialog;
+    alias void aGtkRecentChooserIface;
+    alias void aGtkRecentFilterInfo;
+    alias void aGtkRecentActionClass;
+    alias void aGtkRecentAction;
+    alias void aGtkRecentManagerClass;
+    alias void aGtkRecentManager;
+    alias void aGtkRecentData;
+    alias void aGtkRadioToolButtonClass;
+    alias void aGtkRadioToolButton;
+    alias void aGtkToggleToolButtonClass;
+    alias void aGtkToggleToolButton;
+    alias void aGtkRadioMenuItemClass;
+    alias void aGtkRadioMenuItem;
+    alias void aGtkRadioButtonClass;
+    alias void aGtkRadioButton;
+    alias void aGtkRadioActionClass;
+    alias void aGtkRadioAction;
+    alias void aGtkToggleActionClass;
+    alias void aGtkToggleAction;
+    alias void aGtkProgressBarClass;
+    alias void aGtkProgressBar;
+    alias void aGtkProgressClass;
+    alias void aGtkProgress;
+    alias void aGtkPrintOperation;
+    alias void aGtkPrintOperationClass;
+    alias void aGtkPrintOperationPreviewIface;
+    alias void aGtkPageRange;
+    alias void aGtkPreviewClass;
+    alias void aGtkPreviewInfo;
+    alias void aGtkPreview;
+    alias void aGtkPlugClass;
+    alias void aGtkPlug;
+    alias void aGtkSocketClass;
+    alias void aGtkSocket;
+    alias void aGtkPixmapClass;
+    alias void aGtkPixmap;
+    alias void aGtkOptionMenuClass;
+    alias void aGtkOptionMenu;
+    alias void aGtkOldEditableClass;
+    alias void aGtkOldEditable;
+    alias void aGtkNotebookClass;
+    alias void aGtkNotebook;
+    alias void aGtkMessageDialogClass;
+    alias void aGtkMessageDialog;
+    alias void aGtkMenuToolButton;
+    alias void aGtkMenuToolButtonClass;
+    alias void aGtkToolButtonClass;
+    alias void aGtkToolButton;
+    alias void aGtkToolItemClass;
+    alias void aGtkToolItem;
+    alias void aGtkTooltipsData;
+    alias void aGtkTooltipsClass;
+    alias void aGtkTooltips;
+    alias void aGtkMenuBarClass;
+    alias void aGtkMenuBar;
+    alias void aGtkListClass;
+    alias void aGtkList;
+    alias void aGtkListItemClass;
+    alias void aGtkListItem;
+    alias void aGtkLinkButtonClass;
+    alias void aGtkLinkButton;
+    alias void aGtkLayoutClass;
+    alias void aGtkLayout;
+    alias void aGtkInvisibleClass;
+    alias void aGtkInvisible;
+    alias void aGtkInputDialogClass;
+    alias void aGtkInputDialog;
+    alias void aGtkIMMulticontextClass;
+    alias void aGtkIMMulticontext;
+    alias void aGtkIMContextSimpleClass;
+    alias void aGtkIMContextSimple;
+    alias void aGtkImageMenuItemClass;
+    alias void aGtkImageMenuItem;
+    alias void aGtkIconViewClass;
+    alias void aGtkIconView;
+    alias void aGtkIconThemeClass;
+    alias void aGtkIconTheme;
+    alias void aGtkIconFactoryClass;
+    alias void aGtkHSeparatorClass;
+    alias void aGtkHSeparator;
+    alias void aGtkSeparatorClass;
+    alias void aGtkSeparator;
+    alias void aGtkHScaleClass;
+    alias void aGtkHScale;
+    alias void aGtkScaleClass;
+    alias void aGtkScale;
+    alias void aGtkHRulerClass;
+    alias void aGtkHRuler;
+    alias void aGtkRulerMetric;
+    alias void aGtkRulerClass;
+    alias void aGtkRuler;
+    alias void aGtkHPanedClass;
+    alias void aGtkHPaned;
+    alias void aGtkPanedClass;
+    alias void aGtkPaned;
+    alias void aGtkHButtonBoxClass;
+    alias void aGtkHButtonBox;
+    alias void aGtkHandleBoxClass;
+    alias void aGtkHandleBox;
+    alias void aGtkGammaCurveClass;
+    alias void aGtkGammaCurve;
+    alias void aGtkFontSelectionDialogClass;
+    alias void aGtkFontSelectionDialog;
+    alias void aGtkFontSelectionClass;
+    alias void aGtkFontSelection;
+    alias void aGtkFontButtonClass;
+    alias void aGtkFontButton;
+    alias void aGtkFileChooserWidgetClass;
+    alias void aGtkFileChooserWidget;
+    alias void aGtkFileChooserDialogClass;
+    alias void aGtkFileChooserDialog;
+    alias void aGtkFileChooserButtonClass;
+    alias void aGtkFileChooserButton;
+    alias void aGtkFileFilterInfo;
+    alias void aGtkFixedChild;
+    alias void aGtkFixedClass;
+    alias void aGtkFixed;
+    alias void aGtkFileSelectionClass;
+    alias void aGtkFileSelection;
+    alias void aGtkExpanderClass;
+    alias void aGtkExpander;
+    alias void aGtkEventBoxClass;
+    alias void aGtkEventBox;
+    alias void aGtkCurveClass;
+    alias void aGtkCurve;
+    alias void aGtkDrawingAreaClass;
+    alias void aGtkDrawingArea;
+    alias void aGtkCTreeNode;
+    alias void aGtkCTreeRow;
+    alias void aGtkCTreeClass;
+    alias void aGtkCTree;
+    alias void aGtkComboBoxEntryClass;
+    alias void aGtkComboBoxEntry;
+    alias void aGtkComboBoxClass;
+    alias void aGtkComboBox;
+    alias void aGtkTreeSelectionClass;
+    alias void aGtkTreeSelection;
+    alias void aGtkTreeViewClass;
+    alias void aGtkTreeView;
+    alias void aGtkEntryClass;
+    alias void aGtkEntry;
+    alias void aGtkEntryCompletionClass;
+    alias void aGtkEntryCompletion;
+    alias void aGtkTreeModelFilterClass;
+    alias void aGtkTreeModelFilter;
+    alias void aGtkListStoreClass;
+    alias void aGtkListStore;
+    alias void aGtkIMContextClass;
+    alias void aGtkIMContext;
+    alias void aGtkEditableClass;
+    alias void aGtkComboClass;
+    alias void aGtkCombo;
+    alias void aGtkHBoxClass;
+    alias void aGtkHBox;
+    alias void aGtkColorSelectionDialogClass;
+    alias void aGtkColorSelectionDialog;
+    alias void aGtkColorSelectionClass;
+    alias void aGtkColorSelection;
+    alias void aGtkVBoxClass;
+    alias void aGtkVBox;
+    alias void aGtkColorButtonClass;
+    alias void aGtkColorButton;
+    alias void aGtkCListDestInfo;
+    alias void aGtkCListCellInfo;
+    alias void aGtkCellWidget;
+    alias void aGtkCellPixText;
+    alias void aGtkCellPixmap;
+    alias void aGtkCellText;
+    alias void aGtkCell;
+    alias void aGtkCListRow;
+    alias void aGtkCListColumn;
+    alias void aGtkCListClass;
+    alias void aGtkCList;
+    alias void aGtkVScrollbarClass;
+    alias void aGtkVScrollbar;
+    alias void aGtkHScrollbarClass;
+    alias void aGtkHScrollbar;
+    alias void aGtkScrollbarClass;
+    alias void aGtkScrollbar;
+    alias void aGtkRangeClass;
+    alias void aGtkRange;
+    alias void aGtkTargetPair;
+    alias void aGtkTargetEntry;
+    alias void aGtkTargetList;
+    alias void aGtkTextBuffer;
+    alias void aGtkTextChildAnchorClass;
+    alias void aGtkTextChildAnchor;
+    alias void aGtkTextAppearance;
+    alias void aGtkTextTagClass;
+    alias void aGtkTextTag;
+    alias void aGtkTextAttributes;
+    alias void aGtkTextTagTable;
+    alias void aGtkTextIter;
+    alias void aGtkCheckMenuItemClass;
+    alias void aGtkCheckMenuItem;
+    alias void aGtkMenuItemClass;
+    alias void aGtkMenuItem;
+    alias void aGtkItemClass;
+    alias void aGtkItem;
+    alias void aGtkCheckButtonClass;
+    alias void aGtkCheckButton;
+    alias void aGtkToggleButtonClass;
+    alias void aGtkToggleButton;
+    alias void aGtkCellViewClass;
+    alias void aGtkCellView;
+    alias void aGtkCellRendererToggleClass;
+    alias void aGtkCellRendererToggle;
+    alias void aGtkCellRendererSpinClass;
+    alias void aGtkCellRendererSpin;
+    alias void aGtkCellRendererProgressClass;
+    alias void aGtkCellRendererProgress;
+    alias void aGtkCellRendererPixbufClass;
+    alias void aGtkCellRendererPixbuf;
+    alias void aGtkCellRendererComboClass;
+    alias void aGtkCellRendererCombo;
+    alias void aGtkCellRendererAccelClass;
+    alias void aGtkCellRendererAccel;
+    alias void aGtkCellRendererTextClass;
+    alias void aGtkCellRendererText;
+    alias void aGtkCellLayoutIface;
+    alias void aGtkTreeViewColumnClass;
+    alias void aGtkTreeViewColumn;
+    alias void aGtkTreeSortableIface;
+    alias void aGtkTreeModelIface;
+    alias void aGtkTreeIter;
+    alias void aGtkCellRendererClass;
+    alias void aGtkCellRenderer;
+    alias void aGtkCellEditableIface;
+    alias void aGtkCalendarClass;
+    alias void aGtkCalendar;
+    alias void aGtkButtonClass;
+    alias void aGtkButton;
+    alias void aGtkImageIconNameData;
+    alias void aGtkImageAnimationData;
+    alias void aGtkImageIconSetData;
+    alias void aGtkImageStockData;
+    alias void aGtkImagePixbufData;
+    alias void aGtkImageImageData;
+    alias void aGtkImagePixmapData;
+    alias void aGtkImageClass;
+    alias void aGtkImage;
+    alias void aGtkBuildableIface;
+    alias void aGtkBuilderClass;
+    alias void aGtkBuilder;
+    alias void aGtkBindingArg;
+    alias void aGtkBindingSignal;
+    alias void aGtkBindingEntry;
+    alias void aGtkBindingSet;
+    alias void aGtkButtonBoxClass;
+    alias void aGtkButtonBox;
+    alias void aGtkBoxChild;
+    alias void aGtkBoxClass;
+    alias void aGtkBox;
+    alias void aGtkAssistantClass;
+    alias void aGtkAssistant;
+    alias void aGtkAspectFrameClass;
+    alias void aGtkAspectFrame;
+    alias void aGtkFrameClass;
+    alias void aGtkFrame;
+    alias void aGtkArrowClass;
+    alias void aGtkArrow;
+    alias void aGtkAlignmentClass;
+    alias void aGtkAlignment;
+    alias void aGtkRadioActionEntry;
+    alias void aGtkToggleActionEntry;
+    alias void aGtkActionEntry;
+    alias void aGtkActionGroupClass;
+    alias void aGtkActionGroup;
+    alias void aGtkItemFactoryItem;
+    alias void aGtkItemFactoryEntry;
+    alias void aGtkItemFactoryClass;
+    alias void aGtkItemFactory;
+    alias void aGtkActionClass;
+    alias void aGtkAction;
+    alias void aGtkAccessibleClass;
+    alias void aGtkAccessible;
+    alias void aGtkAccelLabelClass;
+    alias void aGtkAccelLabel;
+    alias void aGtkLabelClass;
+    alias void aGtkLabel;
+    alias void aGtkMenuClass;
+    alias void aGtkMenu;
+    alias void aGtkMenuShellClass;
+    alias void aGtkMenuShell;
+    alias void aGtkMiscClass;
+    alias void aGtkMisc;
+    alias void aGtkAboutDialogClass;
+    alias void aGtkAboutDialog;
+    alias void aGtkDialogClass;
+    alias void aGtkDialog;
+    alias void aGtkWindowGroupClass;
+    alias void aGtkWindowGroup;
+    alias void aGtkWindowClass;
+    alias void aGtkBinClass;
+    alias void aGtkBin;
+    alias void aGtkContainerClass;
+    alias void aGtkContainer;
+    alias void aGtkWindow;
+    alias void aGtkWidgetShapeInfo;
+    alias void aGtkWidgetAuxInfo;
+    alias void aGtkWidgetClass;
+    alias void aGtkSelectionData;
+    alias void aGtkRequisition;
+    alias void aGtkSettingsValue;
+    alias void aGtkSettingsClass;
+    alias void aGtkRcStyleClass;
+    alias void aGtkIconFactory;
+    alias void aGtkWidget;
+    alias void aGtkSettings;
+    alias void aGtkRcProperty;
+    alias void aGtkRcStyle;
+    alias void aGtkStyleClass;
+    alias void aGtkStyle;
+    alias void aGtkBorder;
+    alias void aGtkAdjustmentClass;
+    alias void aGtkAdjustment;
+    alias void aGtkObjectClass;
+    alias void aGtkTypeInfo;
+    alias void aGtkObject;
+    alias void aGtkArg;
+    alias void aGtkAccelGroupEntry;
+    alias void aGtkAccelKey;
+    alias void aGtkAccelGroupClass;
+    alias void aGtkAccelGroup;
+}
+const int GTK_PATH_PRIO_MASK = 0x0f;
+const int GTK_BUTTONBOX_DEFAULT = -1;
+const int GTK_MAX_COMPOSE_LEN = 7;
+const String GTK_PAPER_NAME_A3 = "iso_a3";
+const String GTK_PAPER_NAME_A4 = "iso_a4";
+const String GTK_PAPER_NAME_A5 = "iso_a5";
+const String GTK_PAPER_NAME_B5 = "iso_b5";
+const String GTK_PAPER_NAME_LETTER = "na_letter";
+const String GTK_PAPER_NAME_EXECUTIVE = "na_executive";
+const String GTK_PAPER_NAME_LEGAL = "na_legal";
+const String GTK_PRINT_SETTINGS_PRINTER = "printer";
+const String GTK_PRINT_SETTINGS_ORIENTATION = "orientation";
+const String GTK_PRINT_SETTINGS_PAPER_FORMAT = "paper-format";
+const String GTK_PRINT_SETTINGS_PAPER_WIDTH = "paper-width";
+const String GTK_PRINT_SETTINGS_PAPER_HEIGHT = "paper-height";
+const String GTK_PRINT_SETTINGS_N_COPIES = "n-copies";
+const String GTK_PRINT_SETTINGS_DEFAULT_SOURCE = "default-source";
+const String GTK_PRINT_SETTINGS_QUALITY = "quality";
+const String GTK_PRINT_SETTINGS_RESOLUTION = "resolution";
+const String GTK_PRINT_SETTINGS_USE_COLOR = "use-color";
+const String GTK_PRINT_SETTINGS_DUPLEX = "duplex";
+const String GTK_PRINT_SETTINGS_COLLATE = "collate";
+const String GTK_PRINT_SETTINGS_REVERSE = "reverse";
+const String GTK_PRINT_SETTINGS_MEDIA_TYPE = "media-type";
+const String GTK_PRINT_SETTINGS_DITHER = "dither";
+const String GTK_PRINT_SETTINGS_SCALE = "scale";
+const String GTK_PRINT_SETTINGS_PRINT_PAGES = "print-pages";
+const String GTK_PRINT_SETTINGS_PAGE_RANGES = "page-ranges";
+const String GTK_PRINT_SETTINGS_PAGE_SET = "page-set";
+const String GTK_PRINT_SETTINGS_FINISHINGS = "finishings";
+const String GTK_PRINT_SETTINGS_NUMBER_UP = "number-up";
+const String GTK_PRINT_SETTINGS_OUTPUT_BIN = "output-bin";
+const String GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT = "output-file-format";
+const String GTK_PRINT_SETTINGS_OUTPUT_URI = "output-uri";
+const String GTK_PRINT_SETTINGS_WIN32_DRIVER_VERSION = "win32-driver-version";
+const String GTK_PRINT_SETTINGS_WIN32_DRIVER_EXTRA = "win32-driver-extra";
+const int GTK_INPUT_ERROR = -1;
+const String GTK_STOCK_DIALOG_AUTHENTICATION = "gtk-dialog-authentication";
+const String GTK_STOCK_DIALOG_INFO = "gtk-dialog-info";
+const String GTK_STOCK_DIALOG_WARNING = "gtk-dialog-warning";
+const String GTK_STOCK_DIALOG_ERROR = "gtk-dialog-error";
+const String GTK_STOCK_DIALOG_QUESTION = "gtk-dialog-question";
+const String GTK_STOCK_DND = "gtk-dnd";
+const String GTK_STOCK_DND_MULTIPLE = "gtk-dnd-multiple";
+const String GTK_STOCK_ABOUT = "gtk-about";
+const String GTK_STOCK_ADD = "gtk-add";
+const String GTK_STOCK_APPLY = "gtk-apply";
+const String GTK_STOCK_BOLD = "gtk-bold";
+const String GTK_STOCK_CANCEL = "gtk-cancel";
+const String GTK_STOCK_CDROM = "gtk-cdrom";
+const String GTK_STOCK_CLEAR = "gtk-clear";
+const String GTK_STOCK_CLOSE = "gtk-close";
+const String GTK_STOCK_COLOR_PICKER = "gtk-color-picker";
+const String GTK_STOCK_CONVERT = "gtk-convert";
+const String GTK_STOCK_CONNECT = "gtk-connect";
+const String GTK_STOCK_COPY = "gtk-copy";
+const String GTK_STOCK_CUT = "gtk-cut";
+const String GTK_STOCK_DELETE = "gtk-delete";
+const String GTK_STOCK_DIRECTORY = "gtk-directory";
+const String GTK_STOCK_DISCARD = "gtk-discard";
+const String GTK_STOCK_DISCONNECT = "gtk-disconnect";
+const String GTK_STOCK_EDIT = "gtk-edit";
+const String GTK_STOCK_EXECUTE = "gtk-execute";
+const String GTK_STOCK_FILE = "gtk-file";
+const String GTK_STOCK_FIND = "gtk-find";
+const String GTK_STOCK_FIND_AND_REPLACE = "gtk-find-and-replace";
+const String GTK_STOCK_FLOPPY = "gtk-floppy";
+const String GTK_STOCK_FULLSCREEN = "gtk-fullscreen";
+const String GTK_STOCK_GOTO_BOTTOM = "gtk-goto-bottom";
+const String GTK_STOCK_GOTO_FIRST = "gtk-goto-first";
+const String GTK_STOCK_GOTO_LAST = "gtk-goto-last";
+const String GTK_STOCK_GOTO_TOP = "gtk-goto-top";
+const String GTK_STOCK_GO_BACK = "gtk-go-back";
+const String GTK_STOCK_GO_DOWN = "gtk-go-down";
+const String GTK_STOCK_GO_FORWARD = "gtk-go-forward";
+const String GTK_STOCK_GO_UP = "gtk-go-up";
+const String GTK_STOCK_HARDDISK = "gtk-harddisk";
+const String GTK_STOCK_HELP = "gtk-help";
+const String GTK_STOCK_HOME = "gtk-home";
+const String GTK_STOCK_INDEX = "gtk-index";
+const String GTK_STOCK_INDENT = "gtk-indent";
+const String GTK_STOCK_INFO = "gtk-info";
+const String GTK_STOCK_UNINDENT = "gtk-unindent";
+const String GTK_STOCK_ITALIC = "gtk-italic";
+const String GTK_STOCK_JUMP_TO = "gtk-jump-to";
+const String GTK_STOCK_JUSTIFY_CENTER = "gtk-justify-center";
+const String GTK_STOCK_JUSTIFY_FILL = "gtk-justify-fill";
+const String GTK_STOCK_JUSTIFY_LEFT = "gtk-justify-left";
+const String GTK_STOCK_JUSTIFY_RIGHT = "gtk-justify-right";
+const String GTK_STOCK_LEAVE_FULLSCREEN = "gtk-leave-fullscreen";
+const String GTK_STOCK_MISSING_IMAGE = "gtk-missing-image";
+const String GTK_STOCK_MEDIA_FORWARD = "gtk-media-forward";
+const String GTK_STOCK_MEDIA_NEXT = "gtk-media-next";
+const String GTK_STOCK_MEDIA_PAUSE = "gtk-media-pause";
+const String GTK_STOCK_MEDIA_PLAY = "gtk-media-play";
+const String GTK_STOCK_MEDIA_PREVIOUS = "gtk-media-previous";
+const String GTK_STOCK_MEDIA_RECORD = "gtk-media-record";
+const String GTK_STOCK_MEDIA_REWIND = "gtk-media-rewind";
+const String GTK_STOCK_MEDIA_STOP = "gtk-media-stop";
+const String GTK_STOCK_NETWORK = "gtk-network";
+const String GTK_STOCK_NEW = "gtk-new";
+const String GTK_STOCK_NO = "gtk-no";
+const String GTK_STOCK_OK = "gtk-ok";
+const String GTK_STOCK_OPEN = "gtk-open";
+const String GTK_STOCK_ORIENTATION_PORTRAIT = "gtk-orientation-portrait";
+const String GTK_STOCK_ORIENTATION_LANDSCAPE = "gtk-orientation-landscape";
+const String GTK_STOCK_ORIENTATION_REVERSE_LANDSCAPE = "gtk-orientation-reverse-landscape";
+const String GTK_STOCK_ORIENTATION_REVERSE_PORTRAIT = "gtk-orientation-reverse-portrait";
+const String GTK_STOCK_PASTE = "gtk-paste";
+const String GTK_STOCK_PREFERENCES = "gtk-preferences";
+const String GTK_STOCK_PRINT = "gtk-print";
+const String GTK_STOCK_PRINT_PREVIEW = "gtk-print-preview";
+const String GTK_STOCK_PROPERTIES = "gtk-properties";
+const String GTK_STOCK_QUIT = "gtk-quit";
+const String GTK_STOCK_REDO = "gtk-redo";
+const String GTK_STOCK_REFRESH = "gtk-refresh";
+const String GTK_STOCK_REMOVE = "gtk-remove";
+const String GTK_STOCK_REVERT_TO_SAVED = "gtk-revert-to-saved";
+const String GTK_STOCK_SAVE = "gtk-save";
+const String GTK_STOCK_SAVE_AS = "gtk-save-as";
+const String GTK_STOCK_SELECT_ALL = "gtk-select-all";
+const String GTK_STOCK_SELECT_COLOR = "gtk-select-color";
+const String GTK_STOCK_SELECT_FONT = "gtk-select-font";
+const String GTK_STOCK_SORT_ASCENDING = "gtk-sort-ascending";
+const String GTK_STOCK_SORT_DESCENDING = "gtk-sort-descending";
+const String GTK_STOCK_SPELL_CHECK = "gtk-spell-check";
+const String GTK_STOCK_STOP = "gtk-stop";
+const String GTK_STOCK_STRIKETHROUGH = "gtk-strikethrough";
+const String GTK_STOCK_UNDELETE = "gtk-undelete";
+const String GTK_STOCK_UNDERLINE = "gtk-underline";
+const String GTK_STOCK_UNDO = "gtk-undo";
+const String GTK_STOCK_YES = "gtk-yes";
+const String GTK_STOCK_ZOOM_100 = "gtk-zoom-100";
+const String GTK_STOCK_ZOOM_FIT = "gtk-zoom-fit";
+const String GTK_STOCK_ZOOM_IN = "gtk-zoom-in";
+const String GTK_STOCK_ZOOM_OUT = "gtk-zoom-out";
+alias _GtkVSeparatorClass GtkVSeparatorClass;
+alias _GtkSeparatorClass GtkSeparatorClass;
+alias _GtkVSeparator GtkVSeparator;
+alias _GtkSeparator GtkSeparator;
+alias _GtkVScaleClass GtkVScaleClass;
+alias _GtkScaleClass GtkScaleClass;
+alias _GtkVScale GtkVScale;
+alias _GtkScale GtkScale;
+alias _GtkVRulerClass GtkVRulerClass;
+alias _GtkRulerClass GtkRulerClass;
+alias _GtkVRuler GtkVRuler;
+alias _GtkRuler GtkRuler;
+alias _GtkVPanedClass GtkVPanedClass;
+alias _GtkPanedClass GtkPanedClass;
+alias _GtkVPaned GtkVPaned;
+alias _GtkPaned GtkPaned;
+alias _GtkVolumeButtonClass GtkVolumeButtonClass;
+alias _GtkScaleButtonClass GtkScaleButtonClass;
+alias void function() _BCD_func__12122;
+alias void GtkVolumeButton;
+alias _GtkVButtonBoxClass GtkVButtonBoxClass;
+alias _GtkButtonBoxClass GtkButtonBoxClass;
+alias _GtkVButtonBox GtkVButtonBox;
+alias _GtkButtonBox GtkButtonBox;
+enum GtkUIManagerItemType {
+GTK_UI_MANAGER_AUTO=0,
+GTK_UI_MANAGER_MENUBAR=1,
+GTK_UI_MANAGER_MENU=2,
+GTK_UI_MANAGER_TOOLBAR=4,
+GTK_UI_MANAGER_PLACEHOLDER=8,
+GTK_UI_MANAGER_POPUP=16,
+GTK_UI_MANAGER_MENUITEM=32,
+GTK_UI_MANAGER_TOOLITEM=64,
+GTK_UI_MANAGER_SEPARATOR=128,
+GTK_UI_MANAGER_ACCELERATOR=256,
+}
+alias void GtkUIManagerPrivate;
+alias _GtkUIManagerClass GtkUIManagerClass;
+alias _GtkUIManager GtkUIManager;
+alias _GtkWidget GtkWidget;
+alias void function(_GtkUIManager *, _GtkWidget *) _BCD_func__16564;
+alias void function(_GtkUIManager *) _BCD_func__16565;
+alias _GtkAction GtkAction;
+alias void function(_GtkUIManager *, _GtkAction *, _GtkWidget *) _BCD_func__16566;
+alias void function(_GtkUIManager *, _GtkAction *) _BCD_func__16567;
+alias _GtkWidget * function(_GtkUIManager *, char *) _BCD_func__16568;
+alias _GtkAction * function(_GtkUIManager *, char *) _BCD_func__16569;
+alias _GtkTreeStoreClass GtkTreeStoreClass;
+alias _GtkTreeStore GtkTreeStore;
+enum GtkSortType {
+GTK_SORT_ASCENDING=0,
+GTK_SORT_DESCENDING=1,
+}
+alias void GtkTreeModel;
+alias _GtkTreeIter GtkTreeIter;
+alias int function(void *, _GtkTreeIter *, _GtkTreeIter *, void *) _BCD_func__11685;
+alias _BCD_func__11685 GtkTreeIterCompareFunc;
+alias void function(void *) _BCD_func__13158;
+alias _BCD_func__13158 GtkDestroyNotify;
+alias void GtkTreePath;
+alias void function(void *, void *, _GtkTreeIter *, void *) _BCD_func__9093;
+alias _BCD_func__9093 GtkTreeSelectionForeachFunc;
+alias _GtkTreeSelection GtkTreeSelection;
+alias int function(_GtkTreeSelection *, void *, void *, int, void *) _BCD_func__9094;
+alias _BCD_func__9094 GtkTreeSelectionFunc;
+alias _GtkTreeModelSortClass GtkTreeModelSortClass;
+alias _GtkTreeModelSort GtkTreeModelSort;
+alias _GtkTreeDragDestIface GtkTreeDragDestIface;
+alias void GtkTreeDragDest;
+alias _GtkSelectionData GtkSelectionData;
+alias int function(void *, void *, _GtkSelectionData *) _BCD_func__16576;
+alias _GtkTreeDragSourceIface GtkTreeDragSourceIface;
+alias void GtkTreeDragSource;
+alias int function(void *, void *) _BCD_func__16578;
+alias int function(void *, void *, _GtkSelectionData *) _BCD_func__16579;
+alias void GtkToolbarPrivate;
+alias _GtkToolbarClass GtkToolbarClass;
+alias _GtkContainerClass GtkContainerClass;
+alias _GtkToolbar GtkToolbar;
+enum GtkOrientation {
+GTK_ORIENTATION_HORIZONTAL=0,
+GTK_ORIENTATION_VERTICAL=1,
+}
+alias void function(_GtkToolbar *, int) _BCD_func__16581;
+enum GtkToolbarStyle {
+GTK_TOOLBAR_ICONS=0,
+GTK_TOOLBAR_TEXT=1,
+GTK_TOOLBAR_BOTH=2,
+GTK_TOOLBAR_BOTH_HORIZ=3,
+}
+alias void function(_GtkToolbar *, int) _BCD_func__16582;
+alias int function(_GtkToolbar *, int, int, int) _BCD_func__16583;
+alias _GtkContainer GtkContainer;
+enum GtkIconSize {
+GTK_ICON_SIZE_INVALID=0,
+GTK_ICON_SIZE_MENU=1,
+GTK_ICON_SIZE_SMALL_TOOLBAR=2,
+GTK_ICON_SIZE_LARGE_TOOLBAR=3,
+GTK_ICON_SIZE_BUTTON=4,
+GTK_ICON_SIZE_DND=5,
+GTK_ICON_SIZE_DIALOG=6,
+}
+alias _GtkTooltips GtkTooltips;
+enum GtkToolbarSpaceStyle {
+GTK_TOOLBAR_SPACE_EMPTY=0,
+GTK_TOOLBAR_SPACE_LINE=1,
+}
+alias _GtkToolbarChild GtkToolbarChild;
+enum GtkToolbarChildType {
+GTK_TOOLBAR_CHILD_SPACE=0,
+GTK_TOOLBAR_CHILD_BUTTON=1,
+GTK_TOOLBAR_CHILD_TOGGLEBUTTON=2,
+GTK_TOOLBAR_CHILD_RADIOBUTTON=3,
+GTK_TOOLBAR_CHILD_WIDGET=4,
+}
+alias _GtkTipsQueryClass GtkTipsQueryClass;
+alias _GtkLabelClass GtkLabelClass;
+alias _GtkTipsQuery GtkTipsQuery;
+alias void function(_GtkTipsQuery *) _BCD_func__16587;
+alias void function(_GtkTipsQuery *, _GtkWidget *, char *, char *) _BCD_func__16588;
+alias int function(_GtkTipsQuery *, _GtkWidget *, char *, char *, _GdkEventButton *) _BCD_func__16589;
+alias _GtkLabel GtkLabel;
+alias void GtkTextPendingScroll;
+alias void GtkTextWindow;
+alias _GtkTextViewClass GtkTextViewClass;
+alias _GtkTextView GtkTextView;
+alias _GtkAdjustment GtkAdjustment;
+alias void function(_GtkTextView *, _GtkAdjustment *, _GtkAdjustment *) _BCD_func__16592;
+alias _GtkMenu GtkMenu;
+alias void function(_GtkTextView *, _GtkMenu *) _BCD_func__16593;
+enum GtkMovementStep {
+GTK_MOVEMENT_LOGICAL_POSITIONS=0,
+GTK_MOVEMENT_VISUAL_POSITIONS=1,
+GTK_MOVEMENT_WORDS=2,
+GTK_MOVEMENT_DISPLAY_LINES=3,
+GTK_MOVEMENT_DISPLAY_LINE_ENDS=4,
+GTK_MOVEMENT_PARAGRAPHS=5,
+GTK_MOVEMENT_PARAGRAPH_ENDS=6,
+GTK_MOVEMENT_PAGES=7,
+GTK_MOVEMENT_BUFFER_ENDS=8,
+GTK_MOVEMENT_HORIZONTAL_PAGES=9,
+}
+alias void function(_GtkTextView *, int, int, int) _BCD_func__16594;
+alias void function(_GtkTextView *, int, int) _BCD_func__16595;
+alias void function(_GtkTextView *) _BCD_func__16596;
+alias void function(_GtkTextView *, char *) _BCD_func__16597;
+enum GtkDeleteType {
+GTK_DELETE_CHARS=0,
+GTK_DELETE_WORD_ENDS=1,
+GTK_DELETE_WORDS=2,
+GTK_DELETE_DISPLAY_LINES=3,
+GTK_DELETE_DISPLAY_LINE_ENDS=4,
+GTK_DELETE_PARAGRAPH_ENDS=5,
+GTK_DELETE_PARAGRAPHS=6,
+GTK_DELETE_WHITESPACE=7,
+}
+alias void function(_GtkTextView *, int, int) _BCD_func__16598;
+enum GtkDirectionType {
+GTK_DIR_TAB_FORWARD=0,
+GTK_DIR_TAB_BACKWARD=1,
+GTK_DIR_UP=2,
+GTK_DIR_DOWN=3,
+GTK_DIR_LEFT=4,
+GTK_DIR_RIGHT=5,
+}
+alias void function(_GtkTextView *, int) _BCD_func__16599;
+alias _GtkTextBuffer GtkTextBuffer;
+enum GtkWrapMode {
+GTK_WRAP_NONE=0,
+GTK_WRAP_CHAR=1,
+GTK_WRAP_WORD=2,
+GTK_WRAP_WORD_CHAR=3,
+}
+enum GtkJustification {
+GTK_JUSTIFY_LEFT=0,
+GTK_JUSTIFY_RIGHT=1,
+GTK_JUSTIFY_CENTER=2,
+GTK_JUSTIFY_FILL=3,
+}
+alias _GtkTextMark GtkTextMark;
+alias _GtkIMContext GtkIMContext;
+enum GtkTextWindowType {
+GTK_TEXT_WINDOW_PRIVATE=0,
+GTK_TEXT_WINDOW_WIDGET=1,
+GTK_TEXT_WINDOW_TEXT=2,
+GTK_TEXT_WINDOW_LEFT=3,
+GTK_TEXT_WINDOW_RIGHT=4,
+GTK_TEXT_WINDOW_TOP=5,
+GTK_TEXT_WINDOW_BOTTOM=6,
+}
+alias _GtkTextIter GtkTextIter;
+alias int function(_GtkTextBuffer *, _GtkTextBuffer *, _GtkTextIter *, char *, uint, int, void *, _GError * *) _BCD_func__9281;
+alias _BCD_func__9281 GtkTextBufferDeserializeFunc;
+alias char * function(_GtkTextBuffer *, _GtkTextBuffer *, _GtkTextIter *, _GtkTextIter *, uint *, void *) _BCD_func__9282;
+alias _BCD_func__9282 GtkTextBufferSerializeFunc;
+alias _GtkTextBufferClass GtkTextBufferClass;
+alias void function(_GtkTextBuffer *, _GtkTextIter *, char *, int) _BCD_func__16602;
+alias void function(_GtkTextBuffer *, _GtkTextIter *, void *) _BCD_func__16603;
+alias _GtkTextChildAnchor GtkTextChildAnchor;
+alias void function(_GtkTextBuffer *, _GtkTextIter *, _GtkTextChildAnchor *) _BCD_func__16604;
+alias void function(_GtkTextBuffer *, _GtkTextIter *, _GtkTextIter *) _BCD_func__16605;
+alias void function(_GtkTextBuffer *) _BCD_func__16606;
+alias void function(_GtkTextBuffer *, _GtkTextIter *, _GtkTextMark *) _BCD_func__16607;
+alias void function(_GtkTextBuffer *, _GtkTextMark *) _BCD_func__16608;
+alias _GtkTextTag GtkTextTag;
+alias void function(_GtkTextBuffer *, _GtkTextTag *, _GtkTextIter *, _GtkTextIter *) _BCD_func__16609;
+alias void GtkTextLogAttrCache;
+alias void GtkTextBTree;
+enum GtkTextBufferTargetInfo {
+GTK_TEXT_BUFFER_TARGET_INFO_BUFFER_CONTENTS=-1,
+GTK_TEXT_BUFFER_TARGET_INFO_RICH_TEXT=-2,
+GTK_TEXT_BUFFER_TARGET_INFO_TEXT=-3,
+}
+alias _GtkTextMarkClass GtkTextMarkClass;
+alias _GtkTextTagTableClass GtkTextTagTableClass;
+alias _GtkTextTagTable GtkTextTagTable;
+alias void function(_GtkTextTagTable *, _GtkTextTag *, int) _BCD_func__16613;
+alias void function(_GtkTextTagTable *, _GtkTextTag *) _BCD_func__16614;
+alias void function(_GtkTextTag *, void *) _BCD_func__9332;
+alias _BCD_func__9332 GtkTextTagTableForeach;
+alias _GtkTearoffMenuItemClass GtkTearoffMenuItemClass;
+alias _GtkMenuItemClass GtkMenuItemClass;
+alias _GtkTearoffMenuItem GtkTearoffMenuItem;
+alias _GtkMenuItem GtkMenuItem;
+alias _GtkTableRowCol GtkTableRowCol;
+alias _GtkTableChild GtkTableChild;
+alias _GtkTableClass GtkTableClass;
+alias _GtkTable GtkTable;
+alias _GtkStockItem GtkStockItem;
+alias void GtkStatusIconPrivate;
+alias _GtkStatusIconClass GtkStatusIconClass;
+alias _GtkStatusIcon GtkStatusIcon;
+alias void function(_GtkStatusIcon *) _BCD_func__16623;
+alias void function(_GtkStatusIcon *, uint, uint) _BCD_func__16624;
+alias int function(_GtkStatusIcon *, int) _BCD_func__16625;
+alias _GtkStatusbarClass GtkStatusbarClass;
+alias _GtkHBoxClass GtkHBoxClass;
+alias _GtkStatusbar GtkStatusbar;
+alias void function(_GtkStatusbar *, uint, char *) _BCD_func__16628;
+alias _GtkHBox GtkHBox;
+alias _GtkSpinButtonClass GtkSpinButtonClass;
+alias _GtkEntryClass GtkEntryClass;
+alias _GtkSpinButton GtkSpinButton;
+alias int function(_GtkSpinButton *, double *) _BCD_func__16631;
+alias int function(_GtkSpinButton *) _BCD_func__16632;
+alias void function(_GtkSpinButton *) _BCD_func__16633;
+enum GtkScrollType {
+GTK_SCROLL_NONE=0,
+GTK_SCROLL_JUMP=1,
+GTK_SCROLL_STEP_BACKWARD=2,
+GTK_SCROLL_STEP_FORWARD=3,
+GTK_SCROLL_PAGE_BACKWARD=4,
+GTK_SCROLL_PAGE_FORWARD=5,
+GTK_SCROLL_STEP_UP=6,
+GTK_SCROLL_STEP_DOWN=7,
+GTK_SCROLL_PAGE_UP=8,
+GTK_SCROLL_PAGE_DOWN=9,
+GTK_SCROLL_STEP_LEFT=10,
+GTK_SCROLL_STEP_RIGHT=11,
+GTK_SCROLL_PAGE_LEFT=12,
+GTK_SCROLL_PAGE_RIGHT=13,
+GTK_SCROLL_START=14,
+GTK_SCROLL_END=15,
+}
+alias void function(_GtkSpinButton *, int) _BCD_func__16634;
+alias _GtkEntry GtkEntry;
+enum GtkSpinButtonUpdatePolicy {
+GTK_UPDATE_ALWAYS=0,
+GTK_UPDATE_IF_VALID=1,
+}
+enum GtkSpinType {
+GTK_SPIN_STEP_FORWARD=0,
+GTK_SPIN_STEP_BACKWARD=1,
+GTK_SPIN_PAGE_FORWARD=2,
+GTK_SPIN_PAGE_BACKWARD=3,
+GTK_SPIN_HOME=4,
+GTK_SPIN_END=5,
+GTK_SPIN_USER_DEFINED=6,
+}
+enum GtkSizeGroupMode {
+GTK_SIZE_GROUP_NONE=0,
+GTK_SIZE_GROUP_HORIZONTAL=1,
+GTK_SIZE_GROUP_VERTICAL=2,
+GTK_SIZE_GROUP_BOTH=3,
+}
+alias _GtkSizeGroupClass GtkSizeGroupClass;
+alias _GtkSizeGroup GtkSizeGroup;
+alias _GtkRequisition GtkRequisition;
+alias void GtkSeparatorToolItemPrivate;
+alias _GtkSeparatorToolItemClass GtkSeparatorToolItemClass;
+alias _GtkToolItemClass GtkToolItemClass;
+alias _GtkSeparatorToolItem GtkSeparatorToolItem;
+alias _GtkToolItem GtkToolItem;
+alias _GtkSeparatorMenuItemClass GtkSeparatorMenuItemClass;
+alias _GtkSeparatorMenuItem GtkSeparatorMenuItem;
+alias _GtkScrolledWindowClass GtkScrolledWindowClass;
+alias _GtkBinClass GtkBinClass;
+alias _GtkScrolledWindow GtkScrolledWindow;
+alias int function(_GtkScrolledWindow *, int, int) _BCD_func__16643;
+alias void function(_GtkScrolledWindow *, int) _BCD_func__16644;
+alias _GtkBin GtkBin;
+alias _GtkViewportClass GtkViewportClass;
+alias _GtkViewport GtkViewport;
+alias void function(_GtkViewport *, _GtkAdjustment *, _GtkAdjustment *) _BCD_func__16647;
+enum GtkShadowType {
+GTK_SHADOW_NONE=0,
+GTK_SHADOW_IN=1,
+GTK_SHADOW_OUT=2,
+GTK_SHADOW_ETCHED_IN=3,
+GTK_SHADOW_ETCHED_OUT=4,
+}
+alias void GtkScaleButtonPrivate;
+alias _GtkButtonClass GtkButtonClass;
+alias _GtkScaleButton GtkScaleButton;
+alias void function(_GtkScaleButton *, double) _BCD_func__16650;
+alias _GtkButton GtkButton;
+alias void GtkRecentChooserWidgetPrivate;
+alias _GtkRecentChooserWidgetClass GtkRecentChooserWidgetClass;
+alias _GtkVBoxClass GtkVBoxClass;
+alias _GtkRecentChooserWidget GtkRecentChooserWidget;
+alias _GtkVBox GtkVBox;
+alias void GtkRecentChooserMenuPrivate;
+alias _GtkRecentChooserMenuClass GtkRecentChooserMenuClass;
+alias _GtkMenuClass GtkMenuClass;
+alias _GtkRecentChooserMenu GtkRecentChooserMenu;
+alias void GtkRecentChooserDialogPrivate;
+alias _GtkRecentChooserDialogClass GtkRecentChooserDialogClass;
+alias _GtkDialogClass GtkDialogClass;
+alias _GtkRecentChooserDialog GtkRecentChooserDialog;
+alias _GtkDialog GtkDialog;
+enum GtkRecentChooserError {
+GTK_RECENT_CHOOSER_ERROR_NOT_FOUND=0,
+GTK_RECENT_CHOOSER_ERROR_INVALID_URI=1,
+}
+alias _GtkRecentChooserIface GtkRecentChooserIface;
+alias void GtkRecentChooser;
+alias int function(void *, char *, _GError * *) _BCD_func__16659;
+alias char * function(void *) _BCD_func__16660;
+alias void function(void *, char *) _BCD_func__16661;
+alias void function(void *) _BCD_func__16662;
+alias _GList * function(void *) _BCD_func__16663;
+alias _GtkRecentManager GtkRecentManager;
+alias _GtkRecentManager * function(void *) _BCD_func__16664;
+alias void GtkRecentFilter;
+alias void function(void *, void *) _BCD_func__16665;
+alias _GSList * function(void *) _BCD_func__16666;
+alias void GtkRecentInfo;
+alias int function(void *, void *, void *) _BCD_func__9605;
+alias void function(void *, _BCD_func__9605, void *, _BCD_func__13158) _BCD_func__16667;
+alias _BCD_func__9605 GtkRecentSortFunc;
+enum GtkRecentSortType {
+GTK_RECENT_SORT_NONE=0,
+GTK_RECENT_SORT_MRU=1,
+GTK_RECENT_SORT_LRU=2,
+GTK_RECENT_SORT_CUSTOM=3,
+}
+alias _GtkRecentFilterInfo GtkRecentFilterInfo;
+alias int function(_GtkRecentFilterInfo *, void *) _BCD_func__9607;
+alias _BCD_func__9607 GtkRecentFilterFunc;
+enum GtkRecentFilterFlags {
+GTK_RECENT_FILTER_URI=1,
+GTK_RECENT_FILTER_DISPLAY_NAME=2,
+GTK_RECENT_FILTER_MIME_TYPE=4,
+GTK_RECENT_FILTER_APPLICATION=8,
+GTK_RECENT_FILTER_GROUP=16,
+GTK_RECENT_FILTER_AGE=32,
+}
+alias _GtkRecentActionClass GtkRecentActionClass;
+alias _GtkActionClass GtkActionClass;
+alias void GtkRecentActionPrivate;
+alias _GtkRecentAction GtkRecentAction;
+enum GtkRecentManagerError {
+GTK_RECENT_MANAGER_ERROR_NOT_FOUND=0,
+GTK_RECENT_MANAGER_ERROR_INVALID_URI=1,
+GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING=2,
+GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED=3,
+GTK_RECENT_MANAGER_ERROR_READ=4,
+GTK_RECENT_MANAGER_ERROR_WRITE=5,
+GTK_RECENT_MANAGER_ERROR_UNKNOWN=6,
+}
+alias void GtkRecentManagerPrivate;
+alias _GtkRecentManagerClass GtkRecentManagerClass;
+alias void function(_GtkRecentManager *) _BCD_func__16672;
+alias _GtkRecentData GtkRecentData;
+alias _GtkRadioToolButtonClass GtkRadioToolButtonClass;
+alias _GtkToggleToolButtonClass GtkToggleToolButtonClass;
+alias _GtkRadioToolButton GtkRadioToolButton;
+alias _GtkToggleToolButton GtkToggleToolButton;
+alias void GtkToggleToolButtonPrivate;
+alias _GtkToolButtonClass GtkToolButtonClass;
+alias void function(_GtkToggleToolButton *) _BCD_func__16678;
+alias _GtkToolButton GtkToolButton;
+alias _GtkRadioMenuItemClass GtkRadioMenuItemClass;
+alias _GtkCheckMenuItemClass GtkCheckMenuItemClass;
+alias _GtkRadioMenuItem GtkRadioMenuItem;
+alias void function(_GtkRadioMenuItem *) _BCD_func__16681;
+alias _GtkCheckMenuItem GtkCheckMenuItem;
+alias _GtkRadioButtonClass GtkRadioButtonClass;
+alias _GtkCheckButtonClass GtkCheckButtonClass;
+alias _GtkRadioButton GtkRadioButton;
+alias void function(_GtkRadioButton *) _BCD_func__16684;
+alias _GtkCheckButton GtkCheckButton;
+alias _GtkRadioActionClass GtkRadioActionClass;
+alias _GtkToggleActionClass GtkToggleActionClass;
+alias _GtkRadioAction GtkRadioAction;
+alias void function(_GtkRadioAction *, _GtkRadioAction *) _BCD_func__16687;
+alias void GtkRadioActionPrivate;
+alias _GtkToggleAction GtkToggleAction;
+alias void function(_GtkToggleAction *) _BCD_func__16690;
+alias void GtkToggleActionPrivate;
+enum GtkProgressBarOrientation {
+GTK_PROGRESS_LEFT_TO_RIGHT=0,
+GTK_PROGRESS_RIGHT_TO_LEFT=1,
+GTK_PROGRESS_BOTTOM_TO_TOP=2,
+GTK_PROGRESS_TOP_TO_BOTTOM=3,
+}
+enum GtkProgressBarStyle {
+GTK_PROGRESS_CONTINUOUS=0,
+GTK_PROGRESS_DISCRETE=1,
+}
+alias _GtkProgressBarClass GtkProgressBarClass;
+alias _GtkProgressClass GtkProgressClass;
+alias _GtkProgressBar GtkProgressBar;
+alias _GtkProgress GtkProgress;
+alias _GtkWidgetClass GtkWidgetClass;
+alias void function(_GtkProgress *) _BCD_func__16695;
+alias void GtkPageSetup;
+alias void function(void *, void *) _BCD_func__9769;
+alias _BCD_func__9769 GtkPageSetupDoneFunc;
+enum GtkPrintError {
+GTK_PRINT_ERROR_GENERAL=0,
+GTK_PRINT_ERROR_INTERNAL_ERROR=1,
+GTK_PRINT_ERROR_NOMEM=2,
+GTK_PRINT_ERROR_INVALID_FILE=3,
+}
+enum GtkPrintOperationAction {
+GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG=0,
+GTK_PRINT_OPERATION_ACTION_PRINT=1,
+GTK_PRINT_OPERATION_ACTION_PREVIEW=2,
+GTK_PRINT_OPERATION_ACTION_EXPORT=3,
+}
+enum GtkPrintOperationResult {
+GTK_PRINT_OPERATION_RESULT_ERROR=0,
+GTK_PRINT_OPERATION_RESULT_APPLY=1,
+GTK_PRINT_OPERATION_RESULT_CANCEL=2,
+GTK_PRINT_OPERATION_RESULT_IN_PROGRESS=3,
+}
+enum GtkPrintStatus {
+GTK_PRINT_STATUS_INITIAL=0,
+GTK_PRINT_STATUS_PREPARING=1,
+GTK_PRINT_STATUS_GENERATING_DATA=2,
+GTK_PRINT_STATUS_SENDING_DATA=3,
+GTK_PRINT_STATUS_PENDING=4,
+GTK_PRINT_STATUS_PENDING_ISSUE=5,
+GTK_PRINT_STATUS_PRINTING=6,
+GTK_PRINT_STATUS_FINISHED=7,
+GTK_PRINT_STATUS_FINISHED_ABORTED=8,
+}
+alias _GtkPrintOperation GtkPrintOperation;
+alias void GtkPrintOperationPrivate;
+alias _GtkPrintOperationClass GtkPrintOperationClass;
+alias void function(_GtkPrintOperation *, int) _BCD_func__16699;
+alias void GtkPrintContext;
+alias void function(_GtkPrintOperation *, void *) _BCD_func__16700;
+alias int function(_GtkPrintOperation *, void *) _BCD_func__16701;
+alias void function(_GtkPrintOperation *, void *, int, void *) _BCD_func__16702;
+alias void function(_GtkPrintOperation *, void *, int) _BCD_func__16703;
+alias void function(_GtkPrintOperation *) _BCD_func__16704;
+alias _GtkWidget * function(_GtkPrintOperation *) _BCD_func__16705;
+alias void function(_GtkPrintOperation *, _GtkWidget *) _BCD_func__16706;
+alias void GtkPrintOperationPreview;
+alias _GtkWindow GtkWindow;
+alias int function(_GtkPrintOperation *, void *, void *, _GtkWindow *) _BCD_func__16707;
+alias _GtkPrintOperationPreviewIface GtkPrintOperationPreviewIface;
+alias void function(void *, void *) _BCD_func__16709;
+alias void function(void *, void *, void *) _BCD_func__16710;
+alias void function(void *, int) _BCD_func__16711;
+alias int function(void *, int) _BCD_func__16712;
+alias void function(void *) _BCD_func__16713;
+alias _GtkPageRange GtkPageRange;
+alias void function(char *, char *, void *) _BCD_func__9823;
+alias _BCD_func__9823 GtkPrintSettingsFunc;
+alias void GtkPrintSettings;
+alias void GtkPaperSize;
+alias _GtkPreviewClass GtkPreviewClass;
+alias _GtkPreviewInfo GtkPreviewInfo;
+alias _GtkDitherInfo GtkDitherInfo;
+alias _GtkPreview GtkPreview;
+alias _GtkPlugClass GtkPlugClass;
+alias _GtkWindowClass GtkWindowClass;
+alias _GtkPlug GtkPlug;
+alias void function(_GtkPlug *) _BCD_func__16720;
+alias _GtkWindowGroup GtkWindowGroup;
+alias _GtkSocketClass GtkSocketClass;
+alias _GtkSocket GtkSocket;
+alias void function(_GtkSocket *) _BCD_func__16723;
+alias int function(_GtkSocket *) _BCD_func__16724;
+alias _GtkAccelGroup GtkAccelGroup;
+alias _GtkPixmapClass GtkPixmapClass;
+alias _GtkMiscClass GtkMiscClass;
+alias _GtkPixmap GtkPixmap;
+alias _GtkMisc GtkMisc;
+alias _GtkOptionMenuClass GtkOptionMenuClass;
+alias _GtkOptionMenu GtkOptionMenu;
+alias void function(_GtkOptionMenu *) _BCD_func__16729;
+alias _GtkOldEditable GtkOldEditable;
+alias void function(_GtkOldEditable *, uint) _BCD_func__9931;
+alias _BCD_func__9931 GtkTextFunction;
+alias _GtkOldEditableClass GtkOldEditableClass;
+alias void function(_GtkOldEditable *) _BCD_func__16732;
+alias void function(_GtkOldEditable *, int) _BCD_func__16733;
+alias void function(_GtkOldEditable *, int, int) _BCD_func__16734;
+alias char * function(_GtkOldEditable *, int, int) _BCD_func__16735;
+alias _GtkNotebook GtkNotebook;
+alias _GtkNotebook * function(_GtkNotebook *, _GtkWidget *, int, int, void *) _BCD_func__9964;
+alias _BCD_func__9964 GtkNotebookWindowCreationFunc;
+alias void GtkNotebookPage;
+alias _GtkNotebookClass GtkNotebookClass;
+alias void function(_GtkNotebook *, void *, uint) _BCD_func__16738;
+alias int function(_GtkNotebook *, int) _BCD_func__16739;
+enum GtkNotebookTab {
+GTK_NOTEBOOK_TAB_FIRST=0,
+GTK_NOTEBOOK_TAB_LAST=1,
+}
+alias int function(_GtkNotebook *, int) _BCD_func__16740;
+alias void function(_GtkNotebook *, int) _BCD_func__16741;
+alias int function(_GtkNotebook *, int, int) _BCD_func__16742;
+alias int function(_GtkNotebook *, _GtkWidget *, _GtkWidget *, _GtkWidget *, int) _BCD_func__16743;
+alias _GtkNotebook * function(_GtkNotebook *, _GtkWidget *, int, int) _BCD_func__16744;
+alias void function(_GdkDisplay *) _BCD_func__10005;
+alias _BCD_func__10005 GtkModuleDisplayInitFunc;
+alias void function(int *, char * * *) _BCD_func__10006;
+alias _BCD_func__10006 GtkModuleInitFunc;
+alias _GtkMessageDialogClass GtkMessageDialogClass;
+alias _GtkMessageDialog GtkMessageDialog;
+enum GtkButtonsType {
+GTK_BUTTONS_NONE=0,
+GTK_BUTTONS_OK=1,
+GTK_BUTTONS_CLOSE=2,
+GTK_BUTTONS_CANCEL=3,
+GTK_BUTTONS_YES_NO=4,
+GTK_BUTTONS_OK_CANCEL=5,
+}
+enum GtkMessageType {
+GTK_MESSAGE_INFO=0,
+GTK_MESSAGE_WARNING=1,
+GTK_MESSAGE_QUESTION=2,
+GTK_MESSAGE_ERROR=3,
+GTK_MESSAGE_OTHER=4,
+}
+alias void GtkMenuToolButtonPrivate;
+alias _GtkMenuToolButton GtkMenuToolButton;
+alias _GtkMenuToolButtonClass GtkMenuToolButtonClass;
+alias void function(_GtkMenuToolButton *) _BCD_func__16750;
+alias void GtkToolButtonPrivate;
+alias void function(_GtkToolButton *) _BCD_func__16752;
+alias void GtkToolItemPrivate;
+alias int function(_GtkToolItem *) _BCD_func__16755;
+alias void function(_GtkToolItem *) _BCD_func__16756;
+alias int function(_GtkToolItem *, _GtkTooltips *, char *, char *) _BCD_func__16757;
+alias _GtkTooltipsData GtkTooltipsData;
+alias _GtkTooltipsClass GtkTooltipsClass;
+alias _GtkObjectClass GtkObjectClass;
+alias _GtkObject GtkObject;
+alias _GtkMenuBarClass GtkMenuBarClass;
+alias _GtkMenuShellClass GtkMenuShellClass;
+alias _GtkMenuBar GtkMenuBar;
+alias _GtkMenuShell GtkMenuShell;
+alias int function(_GtkWidget *, _GdkEventKey *, void *) _BCD_func__10115;
+alias _BCD_func__10115 GtkKeySnoopFunc;
+alias _GtkListClass GtkListClass;
+alias _GtkList GtkList;
+alias void function(_GtkList *) _BCD_func__16765;
+alias void function(_GtkList *, _GtkWidget *) _BCD_func__16766;
+enum GtkStateType {
+GTK_STATE_NORMAL=0,
+GTK_STATE_ACTIVE=1,
+GTK_STATE_PRELIGHT=2,
+GTK_STATE_SELECTED=3,
+GTK_STATE_INSENSITIVE=4,
+}
+alias _GtkListItemClass GtkListItemClass;
+alias _GtkItemClass GtkItemClass;
+alias _GtkListItem GtkListItem;
+alias void function(_GtkListItem *) _BCD_func__16769;
+alias void function(_GtkListItem *, int, float, int) _BCD_func__16770;
+alias void function(_GtkListItem *, int, float) _BCD_func__16771;
+alias _GtkItem GtkItem;
+alias _GtkLinkButton GtkLinkButton;
+alias void function(_GtkLinkButton *, char *, void *) _BCD_func__10158;
+alias _BCD_func__10158 GtkLinkButtonUriFunc;
+alias void GtkLinkButtonPrivate;
+alias _GtkLinkButtonClass GtkLinkButtonClass;
+alias _GtkLayoutClass GtkLayoutClass;
+alias _GtkLayout GtkLayout;
+alias void function(_GtkLayout *, _GtkAdjustment *, _GtkAdjustment *) _BCD_func__16776;
+alias _GtkInvisibleClass GtkInvisibleClass;
+alias _GtkInvisible GtkInvisible;
+alias _GtkInputDialogClass GtkInputDialogClass;
+alias _GtkInputDialog GtkInputDialog;
+alias void function(_GtkInputDialog *, _GdkDevice *) _BCD_func__16781;
+alias void GtkIMMulticontextPrivate;
+alias _GtkIMMulticontextClass GtkIMMulticontextClass;
+alias _GtkIMContextClass GtkIMContextClass;
+alias _GtkIMMulticontext GtkIMMulticontext;
+alias _GtkIMContextSimpleClass GtkIMContextSimpleClass;
+alias _GtkIMContextSimple GtkIMContextSimple;
+alias _GtkImageMenuItemClass GtkImageMenuItemClass;
+alias _GtkImageMenuItem GtkImageMenuItem;
+enum GtkIconViewDropPosition {
+GTK_ICON_VIEW_NO_DROP=0,
+GTK_ICON_VIEW_DROP_INTO=1,
+GTK_ICON_VIEW_DROP_LEFT=2,
+GTK_ICON_VIEW_DROP_RIGHT=3,
+GTK_ICON_VIEW_DROP_ABOVE=4,
+GTK_ICON_VIEW_DROP_BELOW=5,
+}
+alias _GtkIconView GtkIconView;
+alias void function(_GtkIconView *, void *, void *) _BCD_func__10270;
+alias _BCD_func__10270 GtkIconViewForeachFunc;
+alias void GtkIconViewPrivate;
+alias _GtkIconViewClass GtkIconViewClass;
+alias void function(_GtkIconView *, _GtkAdjustment *, _GtkAdjustment *) _BCD_func__16790;
+alias void function(_GtkIconView *, void *) _BCD_func__16791;
+alias void function(_GtkIconView *) _BCD_func__16792;
+alias int function(_GtkIconView *, int, int) _BCD_func__16793;
+alias int function(_GtkIconView *) _BCD_func__16794;
+enum GtkIconThemeError {
+GTK_ICON_THEME_NOT_FOUND=0,
+GTK_ICON_THEME_FAILED=1,
+}
+enum GtkIconLookupFlags {
+GTK_ICON_LOOKUP_NO_SVG=1,
+GTK_ICON_LOOKUP_FORCE_SVG=2,
+GTK_ICON_LOOKUP_USE_BUILTIN=4,
+GTK_ICON_LOOKUP_GENERIC_FALLBACK=8,
+}
+alias void GtkIconThemePrivate;
+alias _GtkIconThemeClass GtkIconThemeClass;
+alias _GtkIconTheme GtkIconTheme;
+alias void function(_GtkIconTheme *) _BCD_func__16797;
+alias void GtkIconInfo;
+alias _GtkIconFactoryClass GtkIconFactoryClass;
+alias _GtkHSeparatorClass GtkHSeparatorClass;
+alias _GtkHSeparator GtkHSeparator;
+alias _GtkHScaleClass GtkHScaleClass;
+alias _GtkHScale GtkHScale;
+alias _GtkRangeClass GtkRangeClass;
+alias char * function(_GtkScale *, double) _BCD_func__16807;
+alias void function(_GtkScale *) _BCD_func__16808;
+alias void function(_GtkScale *, int *, int *) _BCD_func__16809;
+alias _GtkRange GtkRange;
+alias _GtkHRulerClass GtkHRulerClass;
+alias _GtkHRuler GtkHRuler;
+alias _GtkRulerMetric GtkRulerMetric;
+alias void function(_GtkRuler *) _BCD_func__16815;
+alias _GtkHPanedClass GtkHPanedClass;
+alias _GtkHPaned GtkHPaned;
+alias void GtkPanedPrivate;
+alias int function(_GtkPaned *, int) _BCD_func__16820;
+alias int function(_GtkPaned *) _BCD_func__16821;
+alias int function(_GtkPaned *, int) _BCD_func__16822;
+alias _GtkHButtonBoxClass GtkHButtonBoxClass;
+alias _GtkHButtonBox GtkHButtonBox;
+alias _GtkHandleBoxClass GtkHandleBoxClass;
+alias _GtkHandleBox GtkHandleBox;
+alias void function(_GtkHandleBox *, _GtkWidget *) _BCD_func__16827;
+alias _GdkRectangle GtkAllocation;
+alias _GtkGammaCurveClass GtkGammaCurveClass;
+alias _GtkGammaCurve GtkGammaCurve;
+alias _GtkFontSelectionDialogClass GtkFontSelectionDialogClass;
+alias _GtkFontSelectionDialog GtkFontSelectionDialog;
+alias _GtkFontSelectionClass GtkFontSelectionClass;
+alias _GtkFontSelection GtkFontSelection;
+alias void GtkFontButtonPrivate;
+alias _GtkFontButtonClass GtkFontButtonClass;
+alias _GtkFontButton GtkFontButton;
+alias void function(_GtkFontButton *) _BCD_func__16836;
+alias void GtkFileChooserWidgetPrivate;
+alias _GtkFileChooserWidgetClass GtkFileChooserWidgetClass;
+alias _GtkFileChooserWidget GtkFileChooserWidget;
+alias void GtkFileChooserDialogPrivate;
+alias _GtkFileChooserDialogClass GtkFileChooserDialogClass;
+alias _GtkFileChooserDialog GtkFileChooserDialog;
+alias _GtkFileChooserButtonClass GtkFileChooserButtonClass;
+alias _GtkFileChooserButton GtkFileChooserButton;
+alias void function(_GtkFileChooserButton *) _BCD_func__16843;
+alias void GtkFileChooserButtonPrivate;
+enum GtkFileChooserError {
+GTK_FILE_CHOOSER_ERROR_NONEXISTENT=0,
+GTK_FILE_CHOOSER_ERROR_BAD_FILENAME=1,
+GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS=2,
+}
+enum GtkFileChooserConfirmation {
+GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM=0,
+GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME=1,
+GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN=2,
+}
+enum GtkFileChooserAction {
+GTK_FILE_CHOOSER_ACTION_OPEN=0,
+GTK_FILE_CHOOSER_ACTION_SAVE=1,
+GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER=2,
+GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER=3,
+}
+alias void GtkFileChooser;
+alias _GtkFileFilterInfo GtkFileFilterInfo;
+alias int function(_GtkFileFilterInfo *, void *) _BCD_func__10568;
+alias _BCD_func__10568 GtkFileFilterFunc;
+enum GtkFileFilterFlags {
+GTK_FILE_FILTER_FILENAME=1,
+GTK_FILE_FILTER_URI=2,
+GTK_FILE_FILTER_DISPLAY_NAME=4,
+GTK_FILE_FILTER_MIME_TYPE=8,
+}
+alias void GtkFileFilter;
+alias _GtkFixedChild GtkFixedChild;
+alias _GtkFixedClass GtkFixedClass;
+alias _GtkFixed GtkFixed;
+alias _GtkFileSelectionClass GtkFileSelectionClass;
+alias _GtkFileSelection GtkFileSelection;
+alias void GtkExpanderPrivate;
+alias _GtkExpanderClass GtkExpanderClass;
+alias _GtkExpander GtkExpander;
+alias void function(_GtkExpander *) _BCD_func__16852;
+alias _GtkEventBoxClass GtkEventBoxClass;
+alias _GtkEventBox GtkEventBox;
+alias _GtkCurveClass GtkCurveClass;
+alias _GtkDrawingAreaClass GtkDrawingAreaClass;
+alias _GtkCurve GtkCurve;
+alias void function(_GtkCurve *) _BCD_func__16857;
+alias _GtkDrawingArea GtkDrawingArea;
+enum GtkCurveType {
+GTK_CURVE_TYPE_LINEAR=0,
+GTK_CURVE_TYPE_SPLINE=1,
+GTK_CURVE_TYPE_FREE=2,
+}
+alias _GtkCTree GtkCTree;
+alias _GtkCTreeNode GtkCTreeNode;
+alias int function(_GtkCTree *, _GtkCTreeNode *, _GtkCTreeNode *, _GtkCTreeNode *) _BCD_func__10682;
+alias _BCD_func__10682 GtkCTreeCompareDragFunc;
+alias int function(_GtkCTree *, uint, _GNode *, _GtkCTreeNode *, void *) _BCD_func__10683;
+alias _BCD_func__10683 GtkCTreeGNodeFunc;
+alias void function(_GtkCTree *, _GtkCTreeNode *, void *) _BCD_func__10684;
+alias _BCD_func__10684 GtkCTreeFunc;
+alias _GtkCTreeRow GtkCTreeRow;
+alias _GtkCListRow GtkCListRow;
+alias _GtkCTreeClass GtkCTreeClass;
+alias _GtkCListClass GtkCListClass;
+alias void function(_GtkCTree *, _GtkCTreeNode *, int) _BCD_func__16865;
+alias void function(_GtkCTree *, _GtkCTreeNode *) _BCD_func__16866;
+alias void function(_GtkCTree *, _GtkCTreeNode *, _GtkCTreeNode *, _GtkCTreeNode *) _BCD_func__16867;
+enum GtkCTreeExpansionType {
+GTK_CTREE_EXPANSION_EXPAND=0,
+GTK_CTREE_EXPANSION_EXPAND_RECURSIVE=1,
+GTK_CTREE_EXPANSION_COLLAPSE=2,
+GTK_CTREE_EXPANSION_COLLAPSE_RECURSIVE=3,
+GTK_CTREE_EXPANSION_TOGGLE=4,
+GTK_CTREE_EXPANSION_TOGGLE_RECURSIVE=5,
+}
+alias void function(_GtkCTree *, int) _BCD_func__16868;
+alias _GtkCList GtkCList;
+enum GtkCTreeExpanderStyle {
+GTK_CTREE_EXPANDER_NONE=0,
+GTK_CTREE_EXPANDER_SQUARE=1,
+GTK_CTREE_EXPANDER_TRIANGLE=2,
+GTK_CTREE_EXPANDER_CIRCULAR=3,
+}
+enum GtkCTreeLineStyle {
+GTK_CTREE_LINES_NONE=0,
+GTK_CTREE_LINES_SOLID=1,
+GTK_CTREE_LINES_DOTTED=2,
+GTK_CTREE_LINES_TABBED=3,
+}
+enum GtkCTreePos {
+GTK_CTREE_POS_BEFORE=0,
+GTK_CTREE_POS_AS_CHILD=1,
+GTK_CTREE_POS_AFTER=2,
+}
+alias void GtkComboBoxEntryPrivate;
+alias _GtkComboBoxEntryClass GtkComboBoxEntryClass;
+alias _GtkComboBoxClass GtkComboBoxClass;
+alias _GtkComboBoxEntry GtkComboBoxEntry;
+alias _GtkComboBox GtkComboBox;
+alias void GtkComboBoxPrivate;
+alias void function(_GtkComboBox *) _BCD_func__16873;
+alias char * function(_GtkComboBox *) _BCD_func__16874;
+alias _GtkTreeView GtkTreeView;
+alias void function(_GtkTreeView *, void *, int, void *) _BCD_func__10748;
+alias _BCD_func__10748 GtkTreeDestroyCountFunc;
+alias void function(_GtkTreeView *, _GtkWidget *, void *) _BCD_func__10752;
+alias _BCD_func__10752 GtkTreeViewSearchPositionFunc;
+alias int function(void *, _GtkTreeIter *, void *) _BCD_func__10753;
+alias _BCD_func__10753 GtkTreeViewRowSeparatorFunc;
+alias int function(void *, int, char *, _GtkTreeIter *, void *) _BCD_func__10754;
+alias _BCD_func__10754 GtkTreeViewSearchEqualFunc;
+alias void function(_GtkTreeView *, void *, void *) _BCD_func__10755;
+alias _BCD_func__10755 GtkTreeViewMappingFunc;
+alias _GtkTreeViewColumn GtkTreeViewColumn;
+alias int function(_GtkTreeView *, _GtkTreeViewColumn *, _GtkTreeViewColumn *, _GtkTreeViewColumn *, void *) _BCD_func__10756;
+alias _BCD_func__10756 GtkTreeViewColumnDropFunc;
+alias _GtkTreeSelectionClass GtkTreeSelectionClass;
+alias void function(_GtkTreeSelection *) _BCD_func__16877;
+enum GtkSelectionMode {
+GTK_SELECTION_NONE=0,
+GTK_SELECTION_SINGLE=1,
+GTK_SELECTION_BROWSE=2,
+GTK_SELECTION_MULTIPLE=3,
+GTK_SELECTION_EXTENDED=3,
+}
+alias void GtkTreeViewPrivate;
+alias _GtkTreeViewClass GtkTreeViewClass;
+alias void function(_GtkTreeView *, _GtkAdjustment *, _GtkAdjustment *) _BCD_func__16880;
+alias void function(_GtkTreeView *, void *, _GtkTreeViewColumn *) _BCD_func__16881;
+alias int function(_GtkTreeView *, _GtkTreeIter *, void *) _BCD_func__16882;
+alias void function(_GtkTreeView *, _GtkTreeIter *, void *) _BCD_func__16883;
+alias void function(_GtkTreeView *) _BCD_func__16884;
+alias int function(_GtkTreeView *, int, int) _BCD_func__16885;
+alias int function(_GtkTreeView *) _BCD_func__16886;
+alias int function(_GtkTreeView *, int) _BCD_func__16887;
+alias int function(_GtkTreeView *, int, int, int) _BCD_func__16888;
+enum GtkTreeViewDropPosition {
+GTK_TREE_VIEW_DROP_BEFORE=0,
+GTK_TREE_VIEW_DROP_AFTER=1,
+GTK_TREE_VIEW_DROP_INTO_OR_BEFORE=2,
+GTK_TREE_VIEW_DROP_INTO_OR_AFTER=3,
+}
+alias void function(_GtkEntry *, _GtkMenu *) _BCD_func__16891;
+alias void function(_GtkEntry *) _BCD_func__16892;
+alias void function(_GtkEntry *, int, int, int) _BCD_func__16893;
+alias void function(_GtkEntry *, char *) _BCD_func__16894;
+alias void function(_GtkEntry *, int, int) _BCD_func__16895;
+alias _GtkEntryCompletion GtkEntryCompletion;
+alias int function(_GtkEntryCompletion *, char *, _GtkTreeIter *, void *) _BCD_func__10863;
+alias _BCD_func__10863 GtkEntryCompletionMatchFunc;
+alias void GtkEntryCompletionPrivate;
+alias _GtkEntryCompletionClass GtkEntryCompletionClass;
+alias int function(_GtkEntryCompletion *, void *, _GtkTreeIter *) _BCD_func__16898;
+alias void function(_GtkEntryCompletion *, int) _BCD_func__16899;
+alias int function(_GtkEntryCompletion *, char *) _BCD_func__16900;
+alias void GtkTreeModelFilterPrivate;
+alias _GtkTreeModelFilterClass GtkTreeModelFilterClass;
+alias _GtkTreeModelFilter GtkTreeModelFilter;
+alias void function(void *, _GtkTreeIter *, _GValue *, int, void *) _BCD_func__10889;
+alias _BCD_func__10889 GtkTreeModelFilterModifyFunc;
+alias _BCD_func__10753 GtkTreeModelFilterVisibleFunc;
+alias _GtkListStoreClass GtkListStoreClass;
+alias _GtkListStore GtkListStore;
+alias void function(_GtkIMContext *) _BCD_func__16907;
+alias void function(_GtkIMContext *, char *) _BCD_func__16908;
+alias int function(_GtkIMContext *) _BCD_func__16909;
+alias int function(_GtkIMContext *, int, int) _BCD_func__16910;
+alias void function(_GtkIMContext *, _GdkDrawable *) _BCD_func__16911;
+alias void function(_GtkIMContext *, char * *, void * *, int *) _BCD_func__16912;
+alias int function(_GtkIMContext *, _GdkEventKey *) _BCD_func__16913;
+alias void function(_GtkIMContext *, _GdkRectangle *) _BCD_func__16914;
+alias void function(_GtkIMContext *, int) _BCD_func__16915;
+alias void function(_GtkIMContext *, char *, int, int) _BCD_func__16916;
+alias int function(_GtkIMContext *, char * *, int *) _BCD_func__16917;
+alias _GtkEditableClass GtkEditableClass;
+alias void GtkEditable;
+alias void function(void *, char *, int, int *) _BCD_func__16920;
+alias void function(void *, int, int) _BCD_func__16921;
+alias void function(void *) _BCD_func__16922;
+alias char * function(void *, int, int) _BCD_func__16923;
+alias int function(void *, int *, int *) _BCD_func__16924;
+alias void function(void *, int) _BCD_func__16925;
+alias int function(void *) _BCD_func__16926;
+enum GtkTargetFlags {
+GTK_TARGET_SAME_APP=1,
+GTK_TARGET_SAME_WIDGET=2,
+GTK_TARGET_OTHER_APP=4,
+GTK_TARGET_OTHER_WIDGET=8,
+}
+enum GtkDestDefaults {
+GTK_DEST_DEFAULT_MOTION=1,
+GTK_DEST_DEFAULT_HIGHLIGHT=2,
+GTK_DEST_DEFAULT_DROP=4,
+GTK_DEST_DEFAULT_ALL=7,
+}
+alias _GtkComboClass GtkComboClass;
+alias _GtkCombo GtkCombo;
+alias _GtkBoxClass GtkBoxClass;
+alias _GtkBox GtkBox;
+alias _GtkColorSelectionDialogClass GtkColorSelectionDialogClass;
+alias _GtkColorSelectionDialog GtkColorSelectionDialog;
+alias void function(_GdkScreen *, _GdkColor *, int) _BCD_func__11008;
+alias _BCD_func__11008 GtkColorSelectionChangePaletteWithScreenFunc;
+alias void function(_GdkColor *, int) _BCD_func__11009;
+alias _BCD_func__11009 GtkColorSelectionChangePaletteFunc;
+alias _GtkColorSelectionClass GtkColorSelectionClass;
+alias _GtkColorSelection GtkColorSelection;
+alias void function(_GtkColorSelection *) _BCD_func__16934;
+alias void GtkColorButtonPrivate;
+alias _GtkColorButtonClass GtkColorButtonClass;
+alias _GtkColorButton GtkColorButton;
+alias void function(_GtkColorButton *) _BCD_func__16939;
+alias _GtkCListDestInfo GtkCListDestInfo;
+alias _GtkCListCellInfo GtkCListCellInfo;
+enum GtkCListDragPos {
+GTK_CLIST_DRAG_NONE=0,
+GTK_CLIST_DRAG_BEFORE=1,
+GTK_CLIST_DRAG_INTO=2,
+GTK_CLIST_DRAG_AFTER=3,
+}
+alias int function(_GtkCList *, void *, void *) _BCD_func__11051;
+alias _BCD_func__11051 GtkCListCompareFunc;
+alias _GtkCellWidget GtkCellWidget;
+enum GtkCellType {
+GTK_CELL_EMPTY=0,
+GTK_CELL_TEXT=1,
+GTK_CELL_PIXMAP=2,
+GTK_CELL_PIXTEXT=3,
+GTK_CELL_WIDGET=4,
+}
+alias _GtkStyle GtkStyle;
+alias _GtkCellPixText GtkCellPixText;
+alias _GtkCellPixmap GtkCellPixmap;
+alias _GtkCellText GtkCellText;
+alias _GtkCell GtkCell;
+alias _GtkCListColumn GtkCListColumn;
+alias void function(_GtkCList *, _GtkAdjustment *, _GtkAdjustment *) _BCD_func__16962;
+alias void function(_GtkCList *) _BCD_func__16963;
+alias void function(_GtkCList *, int, int, _GdkEvent *) _BCD_func__16964;
+alias void function(_GtkCList *, int, int) _BCD_func__16965;
+alias void function(_GtkCList *, int) _BCD_func__16966;
+alias void function(_GtkCList *, int, float, int) _BCD_func__16967;
+alias void function(_GtkCList *, int, float) _BCD_func__16968;
+alias void function(_GtkCList *, _GdkEvent *) _BCD_func__16969;
+alias _GList * function(_GtkCList *, int, _GList *) _BCD_func__16970;
+alias void function(_GtkCList *, _GdkRectangle *, int, _GtkCListRow *) _BCD_func__16971;
+alias void function(_GtkCList *, _GtkCListRow *, int, int) _BCD_func__16972;
+alias int function(_GtkCList *, int, char * *) _BCD_func__16973;
+alias void function(_GtkCList *, _GtkCListRow *, int, int, char *, char, _GdkDrawable *, _GdkDrawable *) _BCD_func__16974;
+alias void function(_GtkCList *, _GtkCListRow *, int, _GtkRequisition *) _BCD_func__16975;
+enum GtkButtonAction {
+GTK_BUTTON_IGNORED=0,
+GTK_BUTTON_SELECTS=1,
+GTK_BUTTON_DRAGS=2,
+GTK_BUTTON_EXPANDS=4,
+}
+alias _GtkVScrollbarClass GtkVScrollbarClass;
+alias _GtkScrollbarClass GtkScrollbarClass;
+alias _GtkVScrollbar GtkVScrollbar;
+alias _GtkScrollbar GtkScrollbar;
+alias _GtkHScrollbarClass GtkHScrollbarClass;
+alias _GtkHScrollbar GtkHScrollbar;
+alias void function(_GtkRange *) _BCD_func__16984;
+alias void function(_GtkRange *, double) _BCD_func__16985;
+alias void function(_GtkRange *, int) _BCD_func__16986;
+alias _GtkBorder GtkBorder;
+alias void function(_GtkRange *, _GtkBorder *) _BCD_func__16987;
+alias int function(_GtkRange *, int, double) _BCD_func__16988;
+enum GtkUpdateType {
+GTK_UPDATE_CONTINUOUS=0,
+GTK_UPDATE_DISCONTINUOUS=1,
+GTK_UPDATE_DELAYED=2,
+}
+alias void GtkRangeLayout;
+alias void GtkRangeStepTimer;
+alias void GtkClipboard;
+alias void function(void *, void *) _BCD_func__11267;
+alias _BCD_func__11267 GtkClipboardClearFunc;
+alias void function(void *, _GtkSelectionData *, uint, void *) _BCD_func__11268;
+alias _BCD_func__11268 GtkClipboardGetFunc;
+alias void function(void *, void * *, int, void *) _BCD_func__11269;
+alias _BCD_func__11269 GtkClipboardTargetsReceivedFunc;
+alias void function(void *, void *, void *) _BCD_func__11270;
+alias _BCD_func__11270 GtkClipboardImageReceivedFunc;
+alias void function(void *, void *, char *, uint, void *) _BCD_func__11271;
+alias _BCD_func__11271 GtkClipboardRichTextReceivedFunc;
+alias void function(void *, char *, void *) _BCD_func__11272;
+alias _BCD_func__11272 GtkClipboardTextReceivedFunc;
+alias void function(void *, _GtkSelectionData *, void *) _BCD_func__11273;
+alias _BCD_func__11273 GtkClipboardReceivedFunc;
+alias _GtkTargetPair GtkTargetPair;
+alias _GtkTargetEntry GtkTargetEntry;
+alias _GtkTargetList GtkTargetList;
+alias int function(uint, void *) _BCD_func__11292;
+alias _BCD_func__11292 GtkTextCharPredicate;
+enum GtkTextSearchFlags {
+GTK_TEXT_SEARCH_VISIBLE_ONLY=1,
+GTK_TEXT_SEARCH_TEXT_ONLY=2,
+}
+alias _GtkTextChildAnchorClass GtkTextChildAnchorClass;
+alias _GtkTextAppearance GtkTextAppearance;
+alias _GtkTextTagClass GtkTextTagClass;
+alias int function(_GtkTextTag *, _GObject *, _GdkEvent *, _GtkTextIter *) _BCD_func__16998;
+alias _GtkTextAttributes GtkTextAttributes;
+enum GtkTextDirection {
+GTK_TEXT_DIR_NONE=0,
+GTK_TEXT_DIR_LTR=1,
+GTK_TEXT_DIR_RTL=2,
+}
+alias void function(_GtkCheckMenuItem *) _BCD_func__17004;
+alias void function(_GtkCheckMenuItem *, _GdkRectangle *) _BCD_func__17005;
+alias void function(_GtkMenuItem *) _BCD_func__17008;
+alias void function(_GtkMenuItem *, int *) _BCD_func__17009;
+alias void function(_GtkMenuItem *, int) _BCD_func__17010;
+alias void function(_GtkItem *) _BCD_func__17013;
+alias _GtkToggleButtonClass GtkToggleButtonClass;
+alias void function(_GtkCheckButton *, _GdkRectangle *) _BCD_func__17016;
+alias _GtkToggleButton GtkToggleButton;
+alias void function(_GtkToggleButton *) _BCD_func__17019;
+alias void GtkCellViewPrivate;
+alias _GtkCellViewClass GtkCellViewClass;
+alias _GtkCellView GtkCellView;
+alias _GtkCellRendererToggleClass GtkCellRendererToggleClass;
+alias _GtkCellRendererClass GtkCellRendererClass;
+alias _GtkCellRendererToggle GtkCellRendererToggle;
+alias void function(_GtkCellRendererToggle *, char *) _BCD_func__17024;
+alias _GtkCellRenderer GtkCellRenderer;
+alias void GtkCellRendererSpinPrivate;
+alias _GtkCellRendererSpinClass GtkCellRendererSpinClass;
+alias _GtkCellRendererTextClass GtkCellRendererTextClass;
+alias _GtkCellRendererSpin GtkCellRendererSpin;
+alias _GtkCellRendererText GtkCellRendererText;
+alias void GtkCellRendererProgressPrivate;
+alias _GtkCellRendererProgressClass GtkCellRendererProgressClass;
+alias _GtkCellRendererProgress GtkCellRendererProgress;
+alias _GtkCellRendererPixbufClass GtkCellRendererPixbufClass;
+alias _GtkCellRendererPixbuf GtkCellRendererPixbuf;
+alias _GtkCellRendererComboClass GtkCellRendererComboClass;
+alias _GtkCellRendererCombo GtkCellRendererCombo;
+enum GtkCellRendererAccelMode {
+GTK_CELL_RENDERER_ACCEL_MODE_GTK=0,
+GTK_CELL_RENDERER_ACCEL_MODE_OTHER=1,
+}
+alias _GtkCellRendererAccelClass GtkCellRendererAccelClass;
+alias _GtkCellRendererAccel GtkCellRendererAccel;
+alias void function(_GtkCellRendererAccel *, char *, uint, int, uint) _BCD_func__17035;
+alias void function(_GtkCellRendererAccel *, char *) _BCD_func__17036;
+alias void function(_GtkCellRendererText *, char *, char *) _BCD_func__17039;
+alias void GtkCellLayout;
+alias void function(void *, _GtkCellRenderer *, void *, _GtkTreeIter *, void *) _BCD_func__11624;
+alias _BCD_func__11624 GtkCellLayoutDataFunc;
+alias _GtkCellLayoutIface GtkCellLayoutIface;
+alias void function(void *, _GtkCellRenderer *, int) _BCD_func__17042;
+alias void function(void *) _BCD_func__17043;
+alias void function(void *, _GtkCellRenderer *, char *, int) _BCD_func__17044;
+alias void function(void *, _GtkCellRenderer *, _BCD_func__11624, void *, _BCD_func__13158) _BCD_func__17045;
+alias void function(void *, _GtkCellRenderer *) _BCD_func__17046;
+alias _GList * function(void *) _BCD_func__17047;
+alias void function(_GtkTreeViewColumn *, _GtkCellRenderer *, void *, _GtkTreeIter *, void *) _BCD_func__11636;
+alias _BCD_func__11636 GtkTreeCellDataFunc;
+alias _GtkTreeViewColumnClass GtkTreeViewColumnClass;
+alias void function(_GtkTreeViewColumn *) _BCD_func__17049;
+alias void GtkCellEditable;
+enum GtkTreeViewColumnSizing {
+GTK_TREE_VIEW_COLUMN_GROW_ONLY=0,
+GTK_TREE_VIEW_COLUMN_AUTOSIZE=1,
+GTK_TREE_VIEW_COLUMN_FIXED=2,
+}
+alias _GtkTreeSortableIface GtkTreeSortableIface;
+alias void GtkTreeSortable;
+alias void function(void *) _BCD_func__17052;
+alias int function(void *, int *, int *) _BCD_func__17053;
+alias void function(void *, int, int) _BCD_func__17054;
+alias void function(void *, int, _BCD_func__11685, void *, _BCD_func__13158) _BCD_func__17055;
+alias void function(void *, _BCD_func__11685, void *, _BCD_func__13158) _BCD_func__17056;
+alias int function(void *) _BCD_func__17057;
+enum GtkTreeModelFlags {
+GTK_TREE_MODEL_ITERS_PERSIST=1,
+GTK_TREE_MODEL_LIST_ONLY=2,
+}
+alias int function(void *, void *, _GtkTreeIter *, void *) _BCD_func__11697;
+alias _BCD_func__11697 GtkTreeModelForeachFunc;
+alias _GtkTreeModelIface GtkTreeModelIface;
+alias void function(void *, void *, _GtkTreeIter *) _BCD_func__17059;
+alias void function(void *, void *) _BCD_func__17060;
+alias void function(void *, void *, _GtkTreeIter *, int *) _BCD_func__17061;
+alias int function(void *) _BCD_func__17062;
+alias int function(void *) _BCD_func__17063;
+alias uint function(void *, int) _BCD_func__17064;
+alias int function(void *, _GtkTreeIter *, void *) _BCD_func__17065;
+alias void * function(void *, _GtkTreeIter *) _BCD_func__17066;
+alias void function(void *, _GtkTreeIter *, int, _GValue *) _BCD_func__17067;
+alias int function(void *, _GtkTreeIter *) _BCD_func__17068;
+alias int function(void *, _GtkTreeIter *, _GtkTreeIter *) _BCD_func__17069;
+alias int function(void *, _GtkTreeIter *) _BCD_func__17070;
+alias int function(void *, _GtkTreeIter *, _GtkTreeIter *, int) _BCD_func__17071;
+alias void function(void *, _GtkTreeIter *) _BCD_func__17072;
+alias void GtkTreeRowReference;
+alias void function(_GtkCellRenderer *, _GtkWidget *, _GdkRectangle *, int *, int *, int *, int *) _BCD_func__17075;
+enum GtkCellRendererState {
+GTK_CELL_RENDERER_SELECTED=1,
+GTK_CELL_RENDERER_PRELIT=2,
+GTK_CELL_RENDERER_INSENSITIVE=4,
+GTK_CELL_RENDERER_SORTED=8,
+GTK_CELL_RENDERER_FOCUSED=16,
+}
+alias void function(_GtkCellRenderer *, _GdkDrawable *, _GtkWidget *, _GdkRectangle *, _GdkRectangle *, _GdkRectangle *, int) _BCD_func__17076;
+alias int function(_GtkCellRenderer *, _GdkEvent *, _GtkWidget *, char *, _GdkRectangle *, _GdkRectangle *, int) _BCD_func__17077;
+alias void * function(_GtkCellRenderer *, _GdkEvent *, _GtkWidget *, char *, _GdkRectangle *, _GdkRectangle *, int) _BCD_func__17078;
+alias void function(_GtkCellRenderer *) _BCD_func__17079;
+alias void function(_GtkCellRenderer *, void *, char *) _BCD_func__17080;
+enum GtkCellRendererMode {
+GTK_CELL_RENDERER_MODE_INERT=0,
+GTK_CELL_RENDERER_MODE_ACTIVATABLE=1,
+GTK_CELL_RENDERER_MODE_EDITABLE=2,
+}
+alias _GtkCellEditableIface GtkCellEditableIface;
+alias void function(void *) _BCD_func__17083;
+alias void function(void *, _GdkEvent *) _BCD_func__17084;
+enum GtkCalendarDisplayOptions {
+GTK_CALENDAR_SHOW_HEADING=1,
+GTK_CALENDAR_SHOW_DAY_NAMES=2,
+GTK_CALENDAR_NO_MONTH_CHANGE=4,
+GTK_CALENDAR_SHOW_WEEK_NUMBERS=8,
+GTK_CALENDAR_WEEK_START_MONDAY=16,
+}
+alias void GtkCalendarPrivate;
+alias _GtkCalendarClass GtkCalendarClass;
+alias _GtkCalendar GtkCalendar;
+alias void function(_GtkCalendar *) _BCD_func__17086;
+alias void function(_GtkButton *) _BCD_func__17090;
+enum GtkImageType {
+GTK_IMAGE_EMPTY=0,
+GTK_IMAGE_PIXMAP=1,
+GTK_IMAGE_IMAGE=2,
+GTK_IMAGE_PIXBUF=3,
+GTK_IMAGE_STOCK=4,
+GTK_IMAGE_ICON_SET=5,
+GTK_IMAGE_ANIMATION=6,
+GTK_IMAGE_ICON_NAME=7,
+}
+alias _GtkImageIconNameData GtkImageIconNameData;
+alias _GtkImageAnimationData GtkImageAnimationData;
+alias _GtkImageIconSetData GtkImageIconSetData;
+alias void GtkIconSet;
+alias _GtkImageStockData GtkImageStockData;
+alias _GtkImagePixbufData GtkImagePixbufData;
+alias _GtkImageImageData GtkImageImageData;
+alias _GtkImagePixmapData GtkImagePixmapData;
+alias _GtkImageClass GtkImageClass;
+alias _GtkImage GtkImage;
+alias _GtkBuildableIface GtkBuildableIface;
+alias void GtkBuildable;
+alias void function(void *, char *) _BCD_func__17103;
+alias char * function(void *) _BCD_func__17104;
+alias _GtkBuilder GtkBuilder;
+alias void function(void *, _GtkBuilder *, _GObject *, char *) _BCD_func__17105;
+alias void function(void *, _GtkBuilder *, char *, _GValue *) _BCD_func__17106;
+alias _GObject * function(void *, _GtkBuilder *, char *) _BCD_func__17107;
+alias int function(void *, _GtkBuilder *, _GObject *, char *, _GMarkupParser *, void * *) _BCD_func__17108;
+alias void function(void *, _GtkBuilder *, _GObject *, char *, void * *) _BCD_func__17109;
+alias void function(void *, _GtkBuilder *, _GObject *, char *, void *) _BCD_func__17110;
+alias void function(void *, _GtkBuilder *) _BCD_func__17111;
+alias void function(_GtkBuilder *, _GObject *, char *, char *, _GObject *, int, void *) _BCD_func__11889;
+alias _BCD_func__11889 GtkBuilderConnectFunc;
+enum GtkBuilderError {
+GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION=0,
+GTK_BUILDER_ERROR_UNHANDLED_TAG=1,
+GTK_BUILDER_ERROR_MISSING_ATTRIBUTE=2,
+GTK_BUILDER_ERROR_INVALID_ATTRIBUTE=3,
+GTK_BUILDER_ERROR_INVALID_TAG=4,
+GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE=5,
+GTK_BUILDER_ERROR_INVALID_VALUE=6,
+}
+alias void GtkBuilderPrivate;
+alias _GtkBuilderClass GtkBuilderClass;
+alias uint function(_GtkBuilder *, char *) _BCD_func__17113;
+alias _GtkBindingArg GtkBindingArg;
+alias _GtkBindingSignal GtkBindingSignal;
+alias _GtkBindingEntry GtkBindingEntry;
+alias _GtkBindingSet GtkBindingSet;
+enum GtkButtonBoxStyle {
+GTK_BUTTONBOX_DEFAULT_STYLE=0,
+GTK_BUTTONBOX_SPREAD=1,
+GTK_BUTTONBOX_EDGE=2,
+GTK_BUTTONBOX_START=3,
+GTK_BUTTONBOX_END=4,
+GTK_BUTTONBOX_CENTER=5,
+}
+alias _GtkBoxChild GtkBoxChild;
+alias int function(int, void *) _BCD_func__11971;
+alias _BCD_func__11971 GtkAssistantPageFunc;
+alias _GtkAssistantClass GtkAssistantClass;
+alias _GtkAssistant GtkAssistant;
+alias void function(_GtkAssistant *, _GtkWidget *) _BCD_func__17126;
+alias void function(_GtkAssistant *) _BCD_func__17127;
+alias void GtkAssistantPrivate;
+enum GtkAssistantPageType {
+GTK_ASSISTANT_PAGE_CONTENT=0,
+GTK_ASSISTANT_PAGE_INTRO=1,
+GTK_ASSISTANT_PAGE_CONFIRM=2,
+GTK_ASSISTANT_PAGE_SUMMARY=3,
+GTK_ASSISTANT_PAGE_PROGRESS=4,
+}
+alias _GtkAspectFrameClass GtkAspectFrameClass;
+alias _GtkFrameClass GtkFrameClass;
+alias _GtkAspectFrame GtkAspectFrame;
+alias _GtkFrame GtkFrame;
+alias void function(_GtkFrame *, _GdkRectangle *) _BCD_func__17132;
+alias _GtkArrowClass GtkArrowClass;
+alias _GtkArrow GtkArrow;
+alias void GtkAlignmentPrivate;
+alias _GtkAlignmentClass GtkAlignmentClass;
+alias _GtkAlignment GtkAlignment;
+alias _GtkRadioActionEntry GtkRadioActionEntry;
+alias _GtkToggleActionEntry GtkToggleActionEntry;
+alias _GtkActionEntry GtkActionEntry;
+alias _GtkActionGroupClass GtkActionGroupClass;
+alias _GtkActionGroup GtkActionGroup;
+alias _GtkAction * function(_GtkActionGroup *, char *) _BCD_func__17142;
+alias void GtkActionGroupPrivate;
+alias void function(_GtkWidget *, void *, uint) _BCD_func__12082;
+alias _BCD_func__12082 GtkItemFactoryCallback2;
+alias void function(_GtkWidget *, void *) _BCD_func__12090;
+alias _BCD_func__12090 GtkMenuCallback;
+alias _GtkItemFactoryItem GtkItemFactoryItem;
+alias _GtkItemFactoryEntry GtkItemFactoryEntry;
+alias _BCD_func__12122 GtkItemFactoryCallback;
+alias _GtkItemFactoryClass GtkItemFactoryClass;
+alias _GtkItemFactory GtkItemFactory;
+alias char * function(char *, void *) _BCD_func__12124;
+alias _BCD_func__12124 GtkTranslateFunc;
+alias void function(void *, uint, _GtkWidget *) _BCD_func__12121;
+alias _BCD_func__12121 GtkItemFactoryCallback1;
+alias void function(void *, char *) _BCD_func__12123;
+alias _BCD_func__12123 GtkPrintFunc;
+alias void GtkActionPrivate;
+alias void function(_GtkAction *) _BCD_func__17150;
+alias _GtkWidget * function(_GtkAction *) _BCD_func__17151;
+alias void function(_GtkAction *, _GtkWidget *) _BCD_func__17152;
+alias _GtkAccessibleClass GtkAccessibleClass;
+alias _GtkAccessible GtkAccessible;
+alias void function(_GtkAccessible *) _BCD_func__17155;
+alias void function(void *, char *, uint, int, int) _BCD_func__12490;
+alias _BCD_func__12490 GtkAccelMapForeach;
+alias void GtkAccelMapClass;
+alias void GtkAccelMap;
+alias _GtkAccelLabelClass GtkAccelLabelClass;
+alias _GtkAccelLabel GtkAccelLabel;
+alias void GtkLabelSelectionInfo;
+alias void function(_GtkLabel *, int, int, int) _BCD_func__17291;
+alias void function(_GtkLabel *) _BCD_func__17292;
+alias void function(_GtkLabel *, _GtkMenu *) _BCD_func__17293;
+alias void function(_GtkWidget *, _GtkMenu *) _BCD_func__12552;
+alias _BCD_func__12552 GtkMenuDetachFunc;
+alias void function(_GtkMenu *, int *, int *, int *, void *) _BCD_func__12553;
+alias _BCD_func__12553 GtkMenuPositionFunc;
+alias void function(_GtkMenuShell *) _BCD_func__17298;
+enum GtkMenuDirectionType {
+GTK_MENU_DIR_PARENT=0,
+GTK_MENU_DIR_CHILD=1,
+GTK_MENU_DIR_NEXT=2,
+GTK_MENU_DIR_PREV=3,
+}
+alias void function(_GtkMenuShell *, int) _BCD_func__17299;
+alias void function(_GtkMenuShell *, int) _BCD_func__17300;
+alias void function(_GtkMenuShell *, _GtkWidget *) _BCD_func__17301;
+alias void function(_GtkMenuShell *, _GtkWidget *, int) _BCD_func__17302;
+alias int function(_GtkMenuShell *) _BCD_func__17303;
+alias int function(_GtkMenuShell *, int) _BCD_func__17304;
+alias _GtkAboutDialog GtkAboutDialog;
+alias void function(_GtkAboutDialog *, char *, void *) _BCD_func__12632;
+alias _BCD_func__12632 GtkAboutDialogActivateLinkFunc;
+alias _GtkAboutDialogClass GtkAboutDialogClass;
+alias void function(_GtkDialog *, int) _BCD_func__17311;
+alias void function(_GtkDialog *) _BCD_func__17312;
+enum GtkResponseType {
+GTK_RESPONSE_NONE=-1,
+GTK_RESPONSE_REJECT=-2,
+GTK_RESPONSE_ACCEPT=-3,
+GTK_RESPONSE_DELETE_EVENT=-4,
+GTK_RESPONSE_OK=-5,
+GTK_RESPONSE_CANCEL=-6,
+GTK_RESPONSE_CLOSE=-7,
+GTK_RESPONSE_YES=-8,
+GTK_RESPONSE_NO=-9,
+GTK_RESPONSE_APPLY=-10,
+GTK_RESPONSE_HELP=-11,
+}
+enum GtkDialogFlags {
+GTK_DIALOG_MODAL=1,
+GTK_DIALOG_DESTROY_WITH_PARENT=2,
+GTK_DIALOG_NO_SEPARATOR=4,
+}
+alias void function(_GtkWindow *, uint, int, int, void *) _BCD_func__12662;
+alias _BCD_func__12662 GtkWindowKeysForeachFunc;
+alias _GtkWindowGroupClass GtkWindowGroupClass;
+alias void GtkWindowGeometryInfo;
+alias void function(_GtkWindow *, _GtkWidget *) _BCD_func__17317;
+alias int function(_GtkWindow *, _GdkEvent *) _BCD_func__17318;
+alias void function(_GtkWindow *) _BCD_func__17319;
+alias void function(_GtkWindow *, int) _BCD_func__17320;
+alias void function(_GtkContainer *, _GtkWidget *) _BCD_func__17324;
+alias void function(_GtkContainer *) _BCD_func__17325;
+alias void function(_GtkContainer *, int, _BCD_func__12090, void *) _BCD_func__17326;
+alias uint function(_GtkContainer *) _BCD_func__17327;
+alias char * function(_GtkContainer *, _GtkWidget *) _BCD_func__17328;
+alias void function(_GtkContainer *, _GtkWidget *, uint, _GValue *, _GParamSpec *) _BCD_func__17329;
+alias void function(_GtkContainer *, _GtkWidget *, uint, _GValue *, _GParamSpec *) _BCD_func__17330;
+alias _BCD_func__12090 GtkCallback;
+alias void GtkTooltip;
+alias _GtkWidgetShapeInfo GtkWidgetShapeInfo;
+alias _GtkWidgetAuxInfo GtkWidgetAuxInfo;
+alias void function(_GtkWidget *, uint, _GParamSpec * *) _BCD_func__17336;
+alias void function(_GtkWidget *) _BCD_func__17337;
+alias void function(_GtkWidget *, _GtkRequisition *) _BCD_func__17338;
+alias void function(_GtkWidget *, _GdkRectangle *) _BCD_func__17339;
+alias void function(_GtkWidget *, int) _BCD_func__17340;
+alias void function(_GtkWidget *, _GtkWidget *) _BCD_func__17341;
+alias void function(_GtkWidget *, _GtkStyle *) _BCD_func__17342;
+alias void function(_GtkWidget *, int) _BCD_func__17343;
+alias void function(_GtkWidget *, int) _BCD_func__17344;
+alias void function(_GtkWidget *, _GParamSpec *) _BCD_func__17345;
+alias int function(_GtkWidget *, int) _BCD_func__17346;
+alias int function(_GtkWidget *, int) _BCD_func__17347;
+alias int function(_GtkWidget *, _GdkEvent *) _BCD_func__17348;
+alias int function(_GtkWidget *, _GdkEventButton *) _BCD_func__17349;
+alias int function(_GtkWidget *, _GdkEventScroll *) _BCD_func__17350;
+alias int function(_GtkWidget *, _GdkEventMotion *) _BCD_func__17351;
+alias int function(_GtkWidget *, _GdkEventAny *) _BCD_func__17352;
+alias int function(_GtkWidget *, _GdkEventExpose *) _BCD_func__17353;
+alias int function(_GtkWidget *, _GdkEventKey *) _BCD_func__17354;
+alias int function(_GtkWidget *, _GdkEventCrossing *) _BCD_func__17355;
+alias int function(_GtkWidget *, _GdkEventConfigure *) _BCD_func__17356;
+alias int function(_GtkWidget *, _GdkEventFocus *) _BCD_func__17357;
+alias int function(_GtkWidget *, _GdkEventProperty *) _BCD_func__17358;
+alias int function(_GtkWidget *, _GdkEventSelection *) _BCD_func__17359;
+alias int function(_GtkWidget *, _GdkEventProximity *) _BCD_func__17360;
+alias int function(_GtkWidget *, _GdkEventVisibility *) _BCD_func__17361;
+alias int function(_GtkWidget *, _GdkEventClient *) _BCD_func__17362;
+alias int function(_GtkWidget *, _GdkEventWindowState *) _BCD_func__17363;
+alias void function(_GtkWidget *, _GtkSelectionData *, uint, uint) _BCD_func__17364;
+alias void function(_GtkWidget *, _GtkSelectionData *, uint) _BCD_func__17365;
+alias void function(_GtkWidget *, _GdkDragContext *) _BCD_func__17366;
+alias void function(_GtkWidget *, _GdkDragContext *, _GtkSelectionData *, uint, uint) _BCD_func__17367;
+alias void function(_GtkWidget *, _GdkDragContext *, uint) _BCD_func__17368;
+alias int function(_GtkWidget *, _GdkDragContext *, int, int, uint) _BCD_func__17369;
+alias void function(_GtkWidget *, _GdkDragContext *, int, int, _GtkSelectionData *, uint, uint) _BCD_func__17370;
+alias int function(_GtkWidget *) _BCD_func__17371;
+enum GtkWidgetHelpType {
+GTK_WIDGET_HELP_TOOLTIP=0,
+GTK_WIDGET_HELP_WHATS_THIS=1,
+}
+alias int function(_GtkWidget *, int) _BCD_func__17372;
+alias _AtkObject * function(_GtkWidget *) _BCD_func__17373;
+alias void function(_GtkWidget *, _GdkScreen *) _BCD_func__17374;
+alias int function(_GtkWidget *, uint) _BCD_func__17375;
+alias int function(_GtkWidget *, _GdkEventGrabBroken *) _BCD_func__17376;
+alias int function(_GtkWidget *, int, int, int, void *) _BCD_func__17377;
+enum GtkWidgetFlags {
+GTK_TOPLEVEL=16,
+GTK_NO_WINDOW=32,
+GTK_REALIZED=64,
+GTK_MAPPED=128,
+GTK_VISIBLE=256,
+GTK_SENSITIVE=512,
+GTK_PARENT_SENSITIVE=1024,
+GTK_CAN_FOCUS=2048,
+GTK_HAS_FOCUS=4096,
+GTK_CAN_DEFAULT=8192,
+GTK_HAS_DEFAULT=16384,
+GTK_HAS_GRAB=32768,
+GTK_RC_STYLE=65536,
+GTK_COMPOSITE_CHILD=131072,
+GTK_NO_REPARENT=262144,
+GTK_APP_PAINTABLE=524288,
+GTK_RECEIVES_DEFAULT=1048576,
+GTK_DOUBLE_BUFFERED=2097152,
+GTK_NO_SHOW_ALL=4194304,
+}
+alias void GtkSettingsPropertyValue;
+alias _GtkSettingsValue GtkSettingsValue;
+alias _GtkSettingsClass GtkSettingsClass;
+enum GtkRcTokenType {
+GTK_RC_TOKEN_INVALID=270,
+GTK_RC_TOKEN_INCLUDE=271,
+GTK_RC_TOKEN_NORMAL=272,
+GTK_RC_TOKEN_ACTIVE=273,
+GTK_RC_TOKEN_PRELIGHT=274,
+GTK_RC_TOKEN_SELECTED=275,
+GTK_RC_TOKEN_INSENSITIVE=276,
+GTK_RC_TOKEN_FG=277,
+GTK_RC_TOKEN_BG=278,
+GTK_RC_TOKEN_TEXT=279,
+GTK_RC_TOKEN_BASE=280,
+GTK_RC_TOKEN_XTHICKNESS=281,
+GTK_RC_TOKEN_YTHICKNESS=282,
+GTK_RC_TOKEN_FONT=283,
+GTK_RC_TOKEN_FONTSET=284,
+GTK_RC_TOKEN_FONT_NAME=285,
+GTK_RC_TOKEN_BG_PIXMAP=286,
+GTK_RC_TOKEN_PIXMAP_PATH=287,
+GTK_RC_TOKEN_STYLE=288,
+GTK_RC_TOKEN_BINDING=289,
+GTK_RC_TOKEN_BIND=290,
+GTK_RC_TOKEN_WIDGET=291,
+GTK_RC_TOKEN_WIDGET_CLASS=292,
+GTK_RC_TOKEN_CLASS=293,
+GTK_RC_TOKEN_LOWEST=294,
+GTK_RC_TOKEN_GTK=295,
+GTK_RC_TOKEN_APPLICATION=296,
+GTK_RC_TOKEN_THEME=297,
+GTK_RC_TOKEN_RC=298,
+GTK_RC_TOKEN_HIGHEST=299,
+GTK_RC_TOKEN_ENGINE=300,
+GTK_RC_TOKEN_MODULE_PATH=301,
+GTK_RC_TOKEN_IM_MODULE_PATH=302,
+GTK_RC_TOKEN_IM_MODULE_FILE=303,
+GTK_RC_TOKEN_STOCK=304,
+GTK_RC_TOKEN_LTR=305,
+GTK_RC_TOKEN_RTL=306,
+GTK_RC_TOKEN_COLOR=307,
+GTK_RC_TOKEN_UNBIND=308,
+GTK_RC_TOKEN_LAST=309,
+}
+enum GtkRcFlags {
+GTK_RC_FG=1,
+GTK_RC_BG=2,
+GTK_RC_TEXT=4,
+GTK_RC_BASE=8,
+}
+alias _GtkRcStyleClass GtkRcStyleClass;
+alias _GtkRcStyle GtkRcStyle;
+alias _GtkRcStyle * function(_GtkRcStyle *) _BCD_func__17411;
+alias _GtkSettings GtkSettings;
+alias uint function(_GtkRcStyle *, _GtkSettings *, _GScanner *) _BCD_func__17412;
+alias void function(_GtkRcStyle *, _GtkRcStyle *) _BCD_func__17413;
+alias _GtkStyle * function(_GtkRcStyle *) _BCD_func__17414;
+alias void GtkRcContext;
+alias _GtkIconFactory GtkIconFactory;
+alias int function(_GParamSpec *, _GString *, _GValue *) _BCD_func__12993;
+alias _BCD_func__12993 GtkRcPropertyParser;
+alias _GtkRcProperty GtkRcProperty;
+alias void GtkIconSource;
+alias void GtkThemeEngine;
+alias _GtkStyleClass GtkStyleClass;
+alias void function(_GtkStyle *) _BCD_func__17421;
+alias void function(_GtkStyle *, _GtkStyle *) _BCD_func__17422;
+alias _GtkStyle * function(_GtkStyle *) _BCD_func__17423;
+alias void function(_GtkStyle *, _GtkRcStyle *) _BCD_func__17424;
+alias void function(_GtkStyle *, _GdkDrawable *, int) _BCD_func__17425;
+alias void * function(_GtkStyle *, void *, int, int, int, _GtkWidget *, char *) _BCD_func__17426;
+alias void function(_GtkStyle *, _GdkDrawable *, int, _GdkRectangle *, _GtkWidget *, char *, int, int, int) _BCD_func__17427;
+alias void function(_GtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, _GtkWidget *, char *, int, int, int, int) _BCD_func__17428;
+alias void function(_GtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, _GtkWidget *, char *, _GdkPoint *, int, int) _BCD_func__17429;
+enum GtkArrowType {
+GTK_ARROW_UP=0,
+GTK_ARROW_DOWN=1,
+GTK_ARROW_LEFT=2,
+GTK_ARROW_RIGHT=3,
+GTK_ARROW_NONE=4,
+}
+alias void function(_GtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, _GtkWidget *, char *, int, int, int, int, int, int) _BCD_func__17430;
+alias void function(_GtkStyle *, _GdkDrawable *, int, _GdkRectangle *, _GtkWidget *, char *, int, int, char *) _BCD_func__17431;
+enum GtkPositionType {
+GTK_POS_LEFT=0,
+GTK_POS_RIGHT=1,
+GTK_POS_TOP=2,
+GTK_POS_BOTTOM=3,
+}
+alias void function(_GtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, _GtkWidget *, char *, int, int, int, int, int, int, int) _BCD_func__17432;
+alias void function(_GtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, _GtkWidget *, char *, int, int, int, int, int) _BCD_func__17433;
+alias void function(_GtkStyle *, _GdkDrawable *, int, _GdkRectangle *, _GtkWidget *, char *, int, int, int, int) _BCD_func__17434;
+alias void function(_GtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, _GtkWidget *, char *, int, int, int, int, int) _BCD_func__17435;
+enum GtkExpanderStyle {
+GTK_EXPANDER_COLLAPSED=0,
+GTK_EXPANDER_SEMI_COLLAPSED=1,
+GTK_EXPANDER_SEMI_EXPANDED=2,
+GTK_EXPANDER_EXPANDED=3,
+}
+alias void function(_GtkStyle *, _GdkDrawable *, int, _GdkRectangle *, _GtkWidget *, char *, int, int, int) _BCD_func__17436;
+alias void function(_GtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, _GtkWidget *, char *, int, int, void *) _BCD_func__17437;
+alias void function(_GtkStyle *, _GdkDrawable *, int, _GdkRectangle *, _GtkWidget *, char *, int, int, int, int, int) _BCD_func__17438;
+alias _GtkAdjustmentClass GtkAdjustmentClass;
+alias void function(_GtkAdjustment *) _BCD_func__17442;
+enum GtkArgFlags {
+GTK_ARG_READABLE=1,
+GTK_ARG_WRITABLE=2,
+GTK_ARG_CONSTRUCT=4,
+GTK_ARG_CONSTRUCT_ONLY=8,
+GTK_ARG_CHILD_ARG=16,
+}
+alias _GtkArg GtkArg;
+alias void function(_GtkObject *, _GtkArg *, uint) _BCD_func__17445;
+alias void function(_GtkObject *) _BCD_func__17446;
+enum GtkObjectFlags {
+GTK_IN_DESTRUCTION=1,
+GTK_FLOATING=2,
+GTK_RESERVED_1=4,
+GTK_RESERVED_2=8,
+}
+enum GtkDebugFlag {
+GTK_DEBUG_MISC=1,
+GTK_DEBUG_PLUGSOCKET=2,
+GTK_DEBUG_TEXT=4,
+GTK_DEBUG_TREE=8,
+GTK_DEBUG_UPDATES=16,
+GTK_DEBUG_KEYBINDINGS=32,
+GTK_DEBUG_MULTIHEAD=64,
+GTK_DEBUG_MODULES=128,
+GTK_DEBUG_GEOMETRY=256,
+GTK_DEBUG_ICONTHEME=512,
+GTK_DEBUG_PRINTING=1024,
+GTK_DEBUG_BUILDER=2048,
+}
+alias _GFlagsValue GtkFlagValue;
+alias _GEnumValue GtkEnumValue;
+alias void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *) _BCD_func__13146;
+alias _BCD_func__13146 GtkSignalMarshaller;
+alias _GtkTypeInfo GtkTypeInfo;
+alias _BCD_func__13158 GtkClassInitFunc;
+alias void function(_GTypeInstance *, void *) _BCD_func__13169;
+alias _BCD_func__13169 GtkObjectInitFunc;
+alias _BCD_func__12122 GtkSignalFunc;
+alias void function(_GtkObject *, void *, uint, _GtkArg *) _BCD_func__13157;
+alias _BCD_func__13157 GtkCallbackMarshal;
+alias int function(void *) _BCD_func__12884;
+alias _BCD_func__12884 GtkFunction;
+alias uint GtkType;
+alias _GTypeClass GtkTypeClass;
+alias _GTypeInstance GtkTypeObject;
+alias uint GtkFundamentalType;
+alias _GtkAccelKey GtkAccelKey;
+alias int function(_GtkAccelKey *, _GClosure *, void *) _BCD_func__13177;
+alias _BCD_func__13177 GtkAccelGroupFindFunc;
+alias int function(_GtkAccelGroup *, _GObject *, uint, int) _BCD_func__13178;
+alias _BCD_func__13178 GtkAccelGroupActivate;
+alias _GtkAccelGroupEntry GtkAccelGroupEntry;
+alias _GtkAccelGroupClass GtkAccelGroupClass;
+alias void function(_GtkAccelGroup *, uint, int, _GClosure *) _BCD_func__17462;
+enum GtkAccelFlags {
+GTK_ACCEL_VISIBLE=1,
+GTK_ACCEL_LOCKED=2,
+GTK_ACCEL_MASK=7,
+}
+enum GtkDragResult {
+GTK_DRAG_RESULT_SUCCESS=0,
+GTK_DRAG_RESULT_NO_TARGET=1,
+GTK_DRAG_RESULT_USER_CANCELLED=2,
+GTK_DRAG_RESULT_TIMEOUT_EXPIRED=3,
+GTK_DRAG_RESULT_GRAB_BROKEN=4,
+GTK_DRAG_RESULT_ERROR=5,
+}
+enum GtkTreeViewGridLines {
+GTK_TREE_VIEW_GRID_LINES_NONE=0,
+GTK_TREE_VIEW_GRID_LINES_HORIZONTAL=1,
+GTK_TREE_VIEW_GRID_LINES_VERTICAL=2,
+GTK_TREE_VIEW_GRID_LINES_BOTH=3,
+}
+enum GtkUnit {
+GTK_UNIT_PIXEL=0,
+GTK_UNIT_POINTS=1,
+GTK_UNIT_INCH=2,
+GTK_UNIT_MM=3,
+}
+enum GtkPrintDuplex {
+GTK_PRINT_DUPLEX_SIMPLEX=0,
+GTK_PRINT_DUPLEX_HORIZONTAL=1,
+GTK_PRINT_DUPLEX_VERTICAL=2,
+}
+enum GtkPrintQuality {
+GTK_PRINT_QUALITY_LOW=0,
+GTK_PRINT_QUALITY_NORMAL=1,
+GTK_PRINT_QUALITY_HIGH=2,
+GTK_PRINT_QUALITY_DRAFT=3,
+}
+enum GtkPageOrientation {
+GTK_PAGE_ORIENTATION_PORTRAIT=0,
+GTK_PAGE_ORIENTATION_LANDSCAPE=1,
+GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT=2,
+GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE=3,
+}
+enum GtkPageSet {
+GTK_PAGE_SET_ALL=0,
+GTK_PAGE_SET_EVEN=1,
+GTK_PAGE_SET_ODD=2,
+}
+enum GtkPrintPages {
+GTK_PRINT_PAGES_ALL=0,
+GTK_PRINT_PAGES_CURRENT=1,
+GTK_PRINT_PAGES_RANGES=2,
+}
+enum GtkPackDirection {
+GTK_PACK_DIRECTION_LTR=0,
+GTK_PACK_DIRECTION_RTL=1,
+GTK_PACK_DIRECTION_TTB=2,
+GTK_PACK_DIRECTION_BTT=3,
+}
+enum GtkIMStatusStyle {
+GTK_IM_STATUS_NOTHING=0,
+GTK_IM_STATUS_CALLBACK=1,
+GTK_IM_STATUS_NONE=2,
+}
+enum GtkIMPreeditStyle {
+GTK_IM_PREEDIT_NOTHING=0,
+GTK_IM_PREEDIT_CALLBACK=1,
+GTK_IM_PREEDIT_NONE=2,
+}
+enum GtkWindowType {
+GTK_WINDOW_TOPLEVEL=0,
+GTK_WINDOW_POPUP=1,
+}
+enum GtkWindowPosition {
+GTK_WIN_POS_NONE=0,
+GTK_WIN_POS_CENTER=1,
+GTK_WIN_POS_MOUSE=2,
+GTK_WIN_POS_CENTER_ALWAYS=3,
+GTK_WIN_POS_CENTER_ON_PARENT=4,
+}
+enum GtkVisibility {
+GTK_VISIBILITY_NONE=0,
+GTK_VISIBILITY_PARTIAL=1,
+GTK_VISIBILITY_FULL=2,
+}
+enum GtkSubmenuPlacement {
+GTK_TOP_BOTTOM=0,
+GTK_LEFT_RIGHT=1,
+}
+enum GtkSubmenuDirection {
+GTK_DIRECTION_LEFT=0,
+GTK_DIRECTION_RIGHT=1,
+}
+enum GtkSignalRunType {
+GTK_RUN_FIRST=1,
+GTK_RUN_LAST=2,
+GTK_RUN_BOTH=3,
+GTK_RUN_NO_RECURSE=8,
+GTK_RUN_ACTION=32,
+GTK_RUN_NO_HOOKS=64,
+}
+enum GtkResizeMode {
+GTK_RESIZE_PARENT=0,
+GTK_RESIZE_QUEUE=1,
+GTK_RESIZE_IMMEDIATE=2,
+}
+enum GtkReliefStyle {
+GTK_RELIEF_NORMAL=0,
+GTK_RELIEF_HALF=1,
+GTK_RELIEF_NONE=2,
+}
+enum GtkPreviewType {
+GTK_PREVIEW_COLOR=0,
+GTK_PREVIEW_GRAYSCALE=1,
+}
+enum GtkPolicyType {
+GTK_POLICY_ALWAYS=0,
+GTK_POLICY_AUTOMATIC=1,
+GTK_POLICY_NEVER=2,
+}
+enum GtkPathType {
+GTK_PATH_WIDGET=0,
+GTK_PATH_WIDGET_CLASS=1,
+GTK_PATH_CLASS=2,
+}
+enum GtkPathPriorityType {
+GTK_PATH_PRIO_LOWEST=0,
+GTK_PATH_PRIO_GTK=4,
+GTK_PATH_PRIO_APPLICATION=8,
+GTK_PATH_PRIO_THEME=10,
+GTK_PATH_PRIO_RC=12,
+GTK_PATH_PRIO_HIGHEST=15,
+}
+enum GtkPackType {
+GTK_PACK_START=0,
+GTK_PACK_END=1,
+}
+enum GtkCornerType {
+GTK_CORNER_TOP_LEFT=0,
+GTK_CORNER_BOTTOM_LEFT=1,
+GTK_CORNER_TOP_RIGHT=2,
+GTK_CORNER_BOTTOM_RIGHT=3,
+}
+enum GtkScrollStep {
+GTK_SCROLL_STEPS=0,
+GTK_SCROLL_PAGES=1,
+GTK_SCROLL_ENDS=2,
+GTK_SCROLL_HORIZONTAL_STEPS=3,
+GTK_SCROLL_HORIZONTAL_PAGES=4,
+GTK_SCROLL_HORIZONTAL_ENDS=5,
+}
+enum GtkMetricType {
+GTK_PIXELS=0,
+GTK_INCHES=1,
+GTK_CENTIMETERS=2,
+}
+enum GtkMatchType {
+GTK_MATCH_ALL=0,
+GTK_MATCH_ALL_TAIL=1,
+GTK_MATCH_HEAD=2,
+GTK_MATCH_TAIL=3,
+GTK_MATCH_EXACT=4,
+GTK_MATCH_LAST=5,
+}
+enum GtkSideType {
+GTK_SIDE_TOP=0,
+GTK_SIDE_BOTTOM=1,
+GTK_SIDE_LEFT=2,
+GTK_SIDE_RIGHT=3,
+}
+enum GtkSensitivityType {
+GTK_SENSITIVITY_AUTO=0,
+GTK_SENSITIVITY_ON=1,
+GTK_SENSITIVITY_OFF=2,
+}
+enum GtkAttachOptions {
+GTK_EXPAND=1,
+GTK_SHRINK=2,
+GTK_FILL=4,
+}
+enum GtkAnchorType {
+GTK_ANCHOR_CENTER=0,
+GTK_ANCHOR_NORTH=1,
+GTK_ANCHOR_NORTH_WEST=2,
+GTK_ANCHOR_NORTH_EAST=3,
+GTK_ANCHOR_SOUTH=4,
+GTK_ANCHOR_SOUTH_WEST=5,
+GTK_ANCHOR_SOUTH_EAST=6,
+GTK_ANCHOR_WEST=7,
+GTK_ANCHOR_EAST=8,
+GTK_ANCHOR_N=1,
+GTK_ANCHOR_NW=2,
+GTK_ANCHOR_NE=3,
+GTK_ANCHOR_S=4,
+GTK_ANCHOR_SW=5,
+GTK_ANCHOR_SE=6,
+GTK_ANCHOR_W=7,
+GTK_ANCHOR_E=8,
+}
+alias void function(void *, int, int) _BCD_func__13745;
+alias int function(void *, void *) _BCD_func__14970;
+alias int function(_GSignalInvocationHint *, _GValue *, _GValue *, void *) _BCD_func__14366;
+alias void function(_AtkObject *, int) _BCD_func__12433;
+alias int function(_AtkKeyEventStruct *, void *) _BCD_func__12452;
+alias void function(_AtkObject *) _BCD_func__12453;
+alias void function(_AtkObject *, _AtkPropertyValues *) _BCD_func__12883;
+alias void function(_GdkSpan *, void *) _BCD_func__13293;
+alias int function(void *, _GdkEvent *, void *) _BCD_func__13455;
+alias void function(_GdkEvent *, void *) _BCD_func__13456;
+alias void function(void *, _PangoAttrShape *, int, void *) _BCD_func__13709;
+alias void function(void *) _BCD_func__13724;
+alias char * function(void *) _BCD_func__13725;
+alias int function(char *, uint, _GError * *, void *) _BCD_func__13731;
+alias void function(char *, void *) _BCD_func__13733;
+alias int function(void *) _BCD_func__6106;
+alias int function(void *, long *, int) _BCD_func__6108;
+alias int function(void *, char *, uint) _BCD_func__6110;
+alias int function(void *, char *, uint) _BCD_func__6112;
+alias int function(void * *, char *) _BCD_func__13910;
+alias int function(char *, char * * *, uint *) _BCD_func__13911;
+alias int function(void *, char *, char *, char *, char *) _BCD_func__13912;
+alias int function(__gconv_step *, __gconv_step_data *, void *, char *, char * *, char *, char * *, uint *) _BCD_func__13913;
+alias void function(__gconv_step *) _BCD_func__13914;
+alias int function(__gconv_step *) _BCD_func__13915;
+alias uint function(__gconv_step *, char) _BCD_func__13916;
+alias int function(__gconv_step *, __gconv_step_data *, char * *, char *, char * *, uint *, int, int) _BCD_func__13917;
+alias int function(void *, void *, void *) _BCD_func__14064;
+alias void * function(void *) _BCD_func__14087;
+alias int function(_PangoAttribute *, void *) _BCD_func__14088;
+alias void function(void *, uint, uint, _GInterfaceInfo *) _BCD_func__14190;
+alias void function(void *, uint, _GTypeInfo *, _GTypeValueTable *) _BCD_func__14191;
+alias void function(void *) _BCD_func__14192;
+alias void function(void *, _GObject *, int) _BCD_func__14336;
+alias void function(void *, _GObject *) _BCD_func__14338;
+alias void function(_GObject *) _BCD_func__14339;
+alias void function(_GObject *, uint, _GValue *, _GParamSpec *) _BCD_func__14340;
+alias void function(_GObject *, uint, _GValue *, _GParamSpec *) _BCD_func__14341;
+alias int function(_GSignalInvocationHint *, uint, _GValue *, void *) _BCD_func__14367;
+alias void function(void *, _GClosure *) _BCD_func__14386;
+alias void function(_GValue *, _GValue *) _BCD_func__14443;
+alias void * function(void *) _BCD_func__14461;
+alias void function(void *, void *) _BCD_func__14465;
+alias int function(void *, _GTypeClass *) _BCD_func__14466;
+alias int function(void *, void *, void *) _BCD_func__14514;
+alias int function(void *, void *, void *) _BCD_func__14528;
+alias void function(_GScanner *, char *, int) _BCD_func__14530;
+alias int function(void *, _GString *, void *) _BCD_func__14602;
+alias void function(void *, void *, void *, _GError * *) _BCD_func__14619;
+alias int function(void *, void *, void *, _GError * *) _BCD_func__14620;
+alias int function(char *, char *, void *, _GError * *) _BCD_func__14621;
+alias void * function(void *, void *) _BCD_func__14631;
+alias void function(_GNode *, void *) _BCD_func__14632;
+alias int function(_GNode *, void *) _BCD_func__14633;
+alias void function(char *) _BCD_func__14641;
+alias void function(char *, int, char *, void *) _BCD_func__14643;
+alias int function(_GIOChannel *, int, void *) _BCD_func__14654;
+alias int function(_GPollFD *, uint, int) _BCD_func__14704;
+alias void function(int, int, void *) _BCD_func__14710;
+alias void function(_GHookList *, _GHook *) _BCD_func__14741;
+alias int function(_GHook *, void *) _BCD_func__14742;
+alias void function(_GHook *, void *) _BCD_func__14743;
+alias int function(_GHook *, _GHook *) _BCD_func__14744;
+alias void function(uint, void *, void *) _BCD_func__14778;
+alias int function(char *, char *, uint) _BCD_func__14781;
+alias char * function(void *) _BCD_func__14782;
+alias char * function(char *, void *) _BCD_func__14965;
+alias void function(void *, void *, void *) _BCD_func__14966;
+alias uint function(void *) _BCD_func__14967;
+alias int function(void *, void *) _BCD_func__14968;
+alias int function(void *, void *, void *) _BCD_func__14969;
+alias int function(void *, char *, uint) _BCD_func__15042;
+alias int function(void *, char *, uint) _BCD_func__15043;
+struct _GtkVSeparatorClass {
+_GtkSeparatorClass parent_class;
+}
+struct _GtkVSeparator {
+_GtkSeparator separator;
+}
+struct _GtkVScaleClass {
+_GtkScaleClass parent_class;
+}
+struct _GtkVScale {
+_GtkScale scale;
+}
+struct _GtkVRulerClass {
+_GtkRulerClass parent_class;
+}
+struct _GtkVRuler {
+_GtkRuler ruler;
+}
+struct _GtkVPanedClass {
+_GtkPanedClass parent_class;
+}
+struct _GtkVPaned {
+_GtkPaned paned;
+}
+struct _GtkVolumeButtonClass {
+_GtkScaleButtonClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkVButtonBoxClass {
+_GtkButtonBoxClass parent_class;
+}
+struct _GtkVButtonBox {
+_GtkButtonBox button_box;
+}
+struct _GtkUIManagerClass {
+_GObjectClass parent_class;
+_BCD_func__16564 add_widget;
+_BCD_func__16565 actions_changed;
+_BCD_func__16566 connect_proxy;
+_BCD_func__16566 disconnect_proxy;
+_BCD_func__16567 pre_activate;
+_BCD_func__16567 post_activate;
+_BCD_func__16568 get_widget;
+_BCD_func__16569 get_action;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+}
+struct _GtkUIManager {
+_GObject parent;
+void * private_data;
+}
+struct _GtkTreeStoreClass {
+_GObjectClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkTreeStore {
+_GObject parent;
+int stamp;
+void * root;
+void * last;
+int n_columns;
+int sort_column_id;
+_GList * sort_list;
+int order;
+uint * column_headers;
+_BCD_func__11685 default_sort_func;
+void * default_sort_data;
+_BCD_func__13158 default_sort_destroy;
+uint bitfield0;
+// uint columns_dirty // bits 0 .. 1
+}
+struct _GtkTreeModelSortClass {
+_GObjectClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkTreeModelSort {
+_GObject parent;
+void * root;
+int stamp;
+uint child_flags;
+void * child_model;
+int zero_ref_count;
+_GList * sort_list;
+int sort_column_id;
+int order;
+_BCD_func__11685 default_sort_func;
+void * default_sort_data;
+_BCD_func__13158 default_sort_destroy;
+uint changed_id;
+uint inserted_id;
+uint has_child_toggled_id;
+uint deleted_id;
+uint reordered_id;
+}
+struct _GtkTreeDragDestIface {
+_GTypeInterface g_iface;
+_BCD_func__16576 drag_data_received;
+_BCD_func__16576 row_drop_possible;
+}
+struct _GtkTreeDragSourceIface {
+_GTypeInterface g_iface;
+_BCD_func__16578 row_draggable;
+_BCD_func__16579 drag_data_get;
+_BCD_func__16578 drag_data_delete;
+}
+struct _GtkToolbarClass {
+_GtkContainerClass parent_class;
+_BCD_func__16581 orientation_changed;
+_BCD_func__16582 style_changed;
+_BCD_func__16583 popup_context_menu;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+}
+struct _GtkToolbar {
+_GtkContainer container;
+int num_children;
+_GList * children;
+int orientation;
+int style;
+int icon_size;
+_GtkTooltips * tooltips;
+int button_maxw;
+int button_maxh;
+uint _gtk_reserved1;
+uint _gtk_reserved2;
+uint bitfield0;
+// uint style_set // bits 0 .. 1
+// uint icon_size_set // bits 1 .. 2
+}
+struct _GtkToolbarChild {
+int type;
+_GtkWidget * widget;
+_GtkWidget * icon;
+_GtkWidget * label;
+}
+struct _GtkTipsQueryClass {
+_GtkLabelClass parent_class;
+_BCD_func__16587 start_query;
+_BCD_func__16587 stop_query;
+_BCD_func__16588 widget_entered;
+_BCD_func__16589 widget_selected;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkTipsQuery {
+_GtkLabel label;
+uint bitfield0;
+// uint emit_always // bits 0 .. 1
+// uint in_query // bits 1 .. 2
+char * label_inactive;
+char * label_no_tip;
+_GtkWidget * caller;
+_GtkWidget * last_crossed;
+_GdkCursor * query_cursor;
+}
+struct _GtkTextViewClass {
+_GtkContainerClass parent_class;
+_BCD_func__16592 set_scroll_adjustments;
+_BCD_func__16593 populate_popup;
+_BCD_func__16594 move_cursor;
+_BCD_func__16595 page_horizontally;
+_BCD_func__16596 set_anchor;
+_BCD_func__16597 insert_at_cursor;
+_BCD_func__16598 delete_from_cursor;
+_BCD_func__16596 backspace;
+_BCD_func__16596 cut_clipboard;
+_BCD_func__16596 copy_clipboard;
+_BCD_func__16596 paste_clipboard;
+_BCD_func__16596 toggle_overwrite;
+_BCD_func__16599 move_focus;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+_BCD_func__12122 _gtk_reserved5;
+_BCD_func__12122 _gtk_reserved6;
+_BCD_func__12122 _gtk_reserved7;
+}
+struct _GtkTextView {
+_GtkContainer parent_instance;
+void * layout;
+_GtkTextBuffer * buffer;
+uint selection_drag_handler;
+uint scroll_timeout;
+int pixels_above_lines;
+int pixels_below_lines;
+int pixels_inside_wrap;
+int wrap_mode;
+int justify;
+int left_margin;
+int right_margin;
+int indent;
+void * tabs;
+uint bitfield0;
+// uint editable // bits 0 .. 1
+// uint overwrite_mode // bits 1 .. 2
+// uint cursor_visible // bits 2 .. 3
+// uint need_im_reset // bits 3 .. 4
+// uint accepts_tab // bits 4 .. 5
+// uint width_changed // bits 5 .. 6
+// uint onscreen_validated // bits 6 .. 7
+// uint mouse_cursor_obscured // bits 7 .. 8
+void * text_window;
+void * left_window;
+void * right_window;
+void * top_window;
+void * bottom_window;
+_GtkAdjustment * hadjustment;
+_GtkAdjustment * vadjustment;
+int xoffset;
+int yoffset;
+int width;
+int height;
+int virtual_cursor_x;
+int virtual_cursor_y;
+_GtkTextMark * first_para_mark;
+int first_para_pixels;
+_GtkTextMark * dnd_mark;
+uint blink_timeout;
+uint first_validate_idle;
+uint incremental_validate_idle;
+_GtkIMContext * im_context;
+_GtkWidget * popup_menu;
+int drag_start_x;
+int drag_start_y;
+_GSList * children;
+void * pending_scroll;
+int pending_place_cursor_button;
+}
+struct _GtkTextBufferClass {
+_GObjectClass parent_class;
+_BCD_func__16602 insert_text;
+_BCD_func__16603 insert_pixbuf;
+_BCD_func__16604 insert_child_anchor;
+_BCD_func__16605 delete_range;
+_BCD_func__16606 changed;
+_BCD_func__16606 modified_changed;
+_BCD_func__16607 mark_set;
+_BCD_func__16608 mark_deleted;
+_BCD_func__16609 apply_tag;
+_BCD_func__16609 remove_tag;
+_BCD_func__16606 begin_user_action;
+_BCD_func__16606 end_user_action;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+_BCD_func__12122 _gtk_reserved5;
+_BCD_func__12122 _gtk_reserved6;
+}
+struct _GtkTextMarkClass {
+_GObjectClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkTextMark {
+_GObject parent_instance;
+void * segment;
+}
+struct _GtkTextTagTableClass {
+_GObjectClass parent_class;
+_BCD_func__16613 tag_changed;
+_BCD_func__16614 tag_added;
+_BCD_func__16614 tag_removed;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkTearoffMenuItemClass {
+_GtkMenuItemClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkTearoffMenuItem {
+_GtkMenuItem menu_item;
+uint bitfield0;
+// uint torn_off // bits 0 .. 1
+}
+struct _GtkTableRowCol {
+ushort requisition;
+ushort allocation;
+ushort spacing;
+ubyte bitfield0;
+// uint need_expand // bits 0 .. 1
+// uint need_shrink // bits 1 .. 2
+// uint expand // bits 2 .. 3
+// uint shrink // bits 3 .. 4
+// uint empty // bits 4 .. 5
+}
+struct _GtkTableChild {
+_GtkWidget * widget;
+ushort left_attach;
+ushort right_attach;
+ushort top_attach;
+ushort bottom_attach;
+ushort xpadding;
+ushort ypadding;
+uint bitfield0;
+// uint xexpand // bits 0 .. 1
+// uint yexpand // bits 1 .. 2
+// uint xshrink // bits 2 .. 3
+// uint yshrink // bits 3 .. 4
+// uint xfill // bits 4 .. 5
+// uint yfill // bits 5 .. 6
+}
+struct _GtkTableClass {
+_GtkContainerClass parent_class;
+}
+struct _GtkTable {
+_GtkContainer container;
+_GList * children;
+_GtkTableRowCol * rows;
+_GtkTableRowCol * cols;
+ushort nrows;
+ushort ncols;
+ushort column_spacing;
+ushort row_spacing;
+uint bitfield0;
+// uint homogeneous // bits 0 .. 1
+}
+struct _GtkStockItem {
+char * stock_id;
+char * label;
+int modifier;
+uint keyval;
+char * translation_domain;
+}
+struct _GtkStatusIconClass {
+_GObjectClass parent_class;
+_BCD_func__16623 activate;
+_BCD_func__16624 popup_menu;
+_BCD_func__16625 size_changed;
+void * __gtk_reserved1;
+void * __gtk_reserved2;
+void * __gtk_reserved3;
+void * __gtk_reserved4;
+void * __gtk_reserved5;
+void * __gtk_reserved6;
+}
+struct _GtkStatusIcon {
+_GObject parent_instance;
+void * priv;
+}
+struct _GtkStatusbarClass {
+_GtkHBoxClass parent_class;
+void * reserved;
+_BCD_func__16628 text_pushed;
+_BCD_func__16628 text_popped;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkStatusbar {
+_GtkHBox parent_widget;
+_GtkWidget * frame;
+_GtkWidget * label;
+_GSList * messages;
+_GSList * keys;
+uint seq_context_id;
+uint seq_message_id;
+_GdkDrawable * grip_window;
+uint bitfield0;
+// uint has_resize_grip // bits 0 .. 1
+}
+struct _GtkSpinButtonClass {
+_GtkEntryClass parent_class;
+_BCD_func__16631 input;
+_BCD_func__16632 output;
+_BCD_func__16633 value_changed;
+_BCD_func__16634 change_value;
+_BCD_func__16633 wrapped;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+}
+struct _GtkSpinButton {
+_GtkEntry entry;
+_GtkAdjustment * adjustment;
+_GdkDrawable * panel;
+uint timer;
+double climb_rate;
+double timer_step;
+int update_policy;
+uint bitfield0;
+// uint in_child // bits 0 .. 2
+// uint click_child // bits 2 .. 4
+// uint button // bits 4 .. 6
+// uint need_timer // bits 6 .. 7
+// uint timer_calls // bits 7 .. 10
+// uint digits // bits 10 .. 20
+// uint numeric // bits 20 .. 21
+// uint wrap // bits 21 .. 22
+// uint snap_to_ticks // bits 22 .. 23
+}
+struct _GtkSizeGroupClass {
+_GObjectClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkSizeGroup {
+_GObject parent_instance;
+_GSList * widgets;
+char mode;
+ubyte bitfield0;
+// uint have_width // bits 0 .. 1
+// uint have_height // bits 1 .. 2
+// uint ignore_hidden // bits 2 .. 3
+_GtkRequisition requisition;
+}
+struct _GtkSeparatorToolItemClass {
+_GtkToolItemClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkSeparatorToolItem {
+_GtkToolItem parent;
+void * priv;
+}
+struct _GtkSeparatorMenuItemClass {
+_GtkMenuItemClass parent_class;
+}
+struct _GtkSeparatorMenuItem {
+_GtkMenuItem menu_item;
+}
+struct _GtkScrolledWindowClass {
+_GtkBinClass parent_class;
+int scrollbar_spacing;
+_BCD_func__16643 scroll_child;
+_BCD_func__16644 move_focus_out;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkScrolledWindow {
+_GtkBin container;
+_GtkWidget * hscrollbar;
+_GtkWidget * vscrollbar;
+ubyte bitfield0;
+// uint hscrollbar_policy // bits 0 .. 2
+// uint vscrollbar_policy // bits 2 .. 4
+// uint hscrollbar_visible // bits 4 .. 5
+// uint vscrollbar_visible // bits 5 .. 6
+// uint window_placement // bits 6 .. 8
+// uint focus_out // bits 8 .. 9
+ushort shadow_type;
+}
+struct _GtkViewportClass {
+_GtkBinClass parent_class;
+_BCD_func__16647 set_scroll_adjustments;
+}
+struct _GtkViewport {
+_GtkBin bin;
+int shadow_type;
+_GdkDrawable * view_window;
+_GdkDrawable * bin_window;
+_GtkAdjustment * hadjustment;
+_GtkAdjustment * vadjustment;
+}
+struct _GtkScaleButtonClass {
+_GtkButtonClass parent_class;
+_BCD_func__16650 value_changed;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkScaleButton {
+_GtkButton parent;
+_GtkWidget * plus_button;
+_GtkWidget * minus_button;
+void * priv;
+}
+struct _GtkRecentChooserWidgetClass {
+_GtkVBoxClass parent_class;
+}
+struct _GtkRecentChooserWidget {
+_GtkVBox parent_instance;
+void * priv;
+}
+struct _GtkRecentChooserMenuClass {
+_GtkMenuClass parent_class;
+_BCD_func__12122 gtk_recent1;
+_BCD_func__12122 gtk_recent2;
+_BCD_func__12122 gtk_recent3;
+_BCD_func__12122 gtk_recent4;
+}
+struct _GtkRecentChooserMenu {
+_GtkMenu parent_instance;
+void * priv;
+}
+struct _GtkRecentChooserDialogClass {
+_GtkDialogClass parent_class;
+}
+struct _GtkRecentChooserDialog {
+_GtkDialog parent_instance;
+void * priv;
+}
+struct _GtkRecentChooserIface {
+_GTypeInterface base_iface;
+_BCD_func__16659 set_current_uri;
+_BCD_func__16660 get_current_uri;
+_BCD_func__16659 select_uri;
+_BCD_func__16661 unselect_uri;
+_BCD_func__16662 select_all;
+_BCD_func__16662 unselect_all;
+_BCD_func__16663 get_items;
+_BCD_func__16664 get_recent_manager;
+_BCD_func__16665 add_filter;
+_BCD_func__16665 remove_filter;
+_BCD_func__16666 list_filters;
+_BCD_func__16667 set_sort_func;
+_BCD_func__16662 item_activated;
+_BCD_func__16662 selection_changed;
+}
+struct _GtkRecentFilterInfo {
+int contains;
+char * uri;
+char * display_name;
+char * mime_type;
+char * * applications;
+char * * groups;
+int age;
+}
+struct _GtkRecentActionClass {
+_GtkActionClass parent_class;
+}
+struct _GtkRecentAction {
+_GtkAction parent_instance;
+void * priv;
+}
+struct _GtkRecentManagerClass {
+_GObjectClass parent_class;
+_BCD_func__16672 changed;
+_BCD_func__12122 _gtk_recent1;
+_BCD_func__12122 _gtk_recent2;
+_BCD_func__12122 _gtk_recent3;
+_BCD_func__12122 _gtk_recent4;
+}
+struct _GtkRecentManager {
+_GObject parent_instance;
+void * priv;
+}
+struct _GtkRecentData {
+char * display_name;
+char * description;
+char * mime_type;
+char * app_name;
+char * app_exec;
+char * * groups;
+int is_private;
+}
+struct _GtkRadioToolButtonClass {
+_GtkToggleToolButtonClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkRadioToolButton {
+_GtkToggleToolButton parent;
+}
+struct _GtkToggleToolButtonClass {
+_GtkToolButtonClass parent_class;
+_BCD_func__16678 toggled;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkToggleToolButton {
+_GtkToolButton parent;
+void * priv;
+}
+struct _GtkRadioMenuItemClass {
+_GtkCheckMenuItemClass parent_class;
+_BCD_func__16681 group_changed;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkRadioMenuItem {
+_GtkCheckMenuItem check_menu_item;
+_GSList * group;
+}
+struct _GtkRadioButtonClass {
+_GtkCheckButtonClass parent_class;
+_BCD_func__16684 group_changed;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkRadioButton {
+_GtkCheckButton check_button;
+_GSList * group;
+}
+struct _GtkRadioActionClass {
+_GtkToggleActionClass parent_class;
+_BCD_func__16687 changed;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkRadioAction {
+_GtkToggleAction parent;
+void * private_data;
+}
+struct _GtkToggleActionClass {
+_GtkActionClass parent_class;
+_BCD_func__16690 toggled;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkToggleAction {
+_GtkAction parent;
+void * private_data;
+}
+struct _GtkProgressBarClass {
+_GtkProgressClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkProgressBar {
+_GtkProgress progress;
+int bar_style;
+int orientation;
+uint blocks;
+int in_block;
+int activity_pos;
+uint activity_step;
+uint activity_blocks;
+double pulse_fraction;
+uint bitfield0;
+// uint activity_dir // bits 0 .. 1
+// uint ellipsize // bits 1 .. 4
+// uint dirty // bits 4 .. 5
+}
+struct _GtkProgressClass {
+_GtkWidgetClass parent_class;
+_BCD_func__16695 paint;
+_BCD_func__16695 update;
+_BCD_func__16695 act_mode_enter;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkProgress {
+_GtkWidget widget;
+_GtkAdjustment * adjustment;
+_GdkDrawable * offscreen_pixmap;
+char * format;
+float x_align;
+float y_align;
+uint bitfield0;
+// uint show_text // bits 0 .. 1
+// uint activity_mode // bits 1 .. 2
+// uint use_text_format // bits 2 .. 3
+}
+struct _GtkPrintOperation {
+_GObject parent_instance;
+void * priv;
+}
+struct _GtkPrintOperationClass {
+_GObjectClass parent_class;
+_BCD_func__16699 done;
+_BCD_func__16700 begin_print;
+_BCD_func__16701 paginate;
+_BCD_func__16702 request_page_setup;
+_BCD_func__16703 draw_page;
+_BCD_func__16700 end_print;
+_BCD_func__16704 status_changed;
+_BCD_func__16705 create_custom_widget;
+_BCD_func__16706 custom_widget_apply;
+_BCD_func__16707 preview;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+_BCD_func__12122 _gtk_reserved5;
+_BCD_func__12122 _gtk_reserved6;
+_BCD_func__12122 _gtk_reserved7;
+}
+struct _GtkPrintOperationPreviewIface {
+_GTypeInterface g_iface;
+_BCD_func__16709 ready;
+_BCD_func__16710 got_page_size;
+_BCD_func__16711 render_page;
+_BCD_func__16712 is_selected;
+_BCD_func__16713 end_preview;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+_BCD_func__12122 _gtk_reserved5;
+_BCD_func__12122 _gtk_reserved6;
+_BCD_func__12122 _gtk_reserved7;
+}
+struct _GtkPageRange {
+int start;
+int end;
+}
+struct _GtkPreviewClass {
+_GtkWidgetClass parent_class;
+_GtkPreviewInfo info;
+}
+union _GtkDitherInfo {
+ushort [2] s;
+char [4] c;
+}
+struct _GtkPreviewInfo {
+char * lookup;
+double gamma;
+}
+struct _GtkPreview {
+_GtkWidget widget;
+char * buffer;
+ushort buffer_width;
+ushort buffer_height;
+ushort bpp;
+ushort rowstride;
+int dither;
+uint bitfield0;
+// uint type // bits 0 .. 1
+// uint expand // bits 1 .. 2
+}
+struct _GtkPlugClass {
+_GtkWindowClass parent_class;
+_BCD_func__16720 embedded;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkPlug {
+_GtkWindow window;
+_GdkDrawable * socket_window;
+_GtkWidget * modality_window;
+_GtkWindowGroup * modality_group;
+void * grabbed_keys;
+uint bitfield0;
+// uint same_app // bits 0 .. 1
+}
+struct _GtkSocketClass {
+_GtkContainerClass parent_class;
+_BCD_func__16723 plug_added;
+_BCD_func__16724 plug_removed;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkSocket {
+_GtkContainer container;
+ushort request_width;
+ushort request_height;
+ushort current_width;
+ushort current_height;
+_GdkDrawable * plug_window;
+_GtkWidget * plug_widget;
+short xembed_version;
+ubyte bitfield0;
+// uint same_app // bits 0 .. 1
+// uint focus_in // bits 1 .. 2
+// uint have_size // bits 2 .. 3
+// uint need_map // bits 3 .. 4
+// uint is_mapped // bits 4 .. 5
+// uint active // bits 5 .. 6
+_GtkAccelGroup * accel_group;
+_GtkWidget * toplevel;
+}
+struct _GtkPixmapClass {
+_GtkMiscClass parent_class;
+}
+struct _GtkPixmap {
+_GtkMisc misc;
+_GdkDrawable * pixmap;
+_GdkDrawable * mask;
+_GdkDrawable * pixmap_insensitive;
+uint bitfield0;
+// uint build_insensitive // bits 0 .. 1
+}
+struct _GtkOptionMenuClass {
+_GtkButtonClass parent_class;
+_BCD_func__16729 changed;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkOptionMenu {
+_GtkButton button;
+_GtkWidget * menu;
+_GtkWidget * menu_item;
+ushort width;
+ushort height;
+}
+struct _GtkOldEditableClass {
+_GtkWidgetClass parent_class;
+_BCD_func__16732 activate;
+_BCD_func__16733 set_editable;
+_BCD_func__16734 move_cursor;
+_BCD_func__16733 move_word;
+_BCD_func__16734 move_page;
+_BCD_func__16733 move_to_row;
+_BCD_func__16733 move_to_column;
+_BCD_func__16733 kill_char;
+_BCD_func__16733 kill_word;
+_BCD_func__16733 kill_line;
+_BCD_func__16732 cut_clipboard;
+_BCD_func__16732 copy_clipboard;
+_BCD_func__16732 paste_clipboard;
+_BCD_func__16734 update_text;
+_BCD_func__16735 get_chars;
+_BCD_func__16734 set_selection;
+_BCD_func__16733 set_position;
+}
+struct _GtkOldEditable {
+_GtkWidget widget;
+uint current_pos;
+uint selection_start_pos;
+uint selection_end_pos;
+uint bitfield0;
+// uint has_selection // bits 0 .. 1
+// uint editable // bits 1 .. 2
+// uint visible // bits 2 .. 3
+char * clipboard_text;
+}
+struct _GtkNotebookClass {
+_GtkContainerClass parent_class;
+_BCD_func__16738 switch_page;
+_BCD_func__16739 select_page;
+_BCD_func__16740 focus_tab;
+_BCD_func__16739 change_current_page;
+_BCD_func__16741 move_focus_out;
+_BCD_func__16742 reorder_tab;
+_BCD_func__16743 insert_page;
+_BCD_func__16744 create_window;
+_BCD_func__12122 _gtk_reserved1;
+}
+struct _GtkNotebook {
+_GtkContainer container;
+void * cur_page;
+_GList * children;
+_GList * first_tab;
+_GList * focus_tab;
+_GtkWidget * menu;
+_GdkDrawable * event_window;
+uint timer;
+ushort tab_hborder;
+ushort tab_vborder;
+uint bitfield0;
+// uint show_tabs // bits 0 .. 1
+// uint homogeneous // bits 1 .. 2
+// uint show_border // bits 2 .. 3
+// uint tab_pos // bits 3 .. 5
+// uint scrollable // bits 5 .. 6
+// uint in_child // bits 6 .. 9
+// uint click_child // bits 9 .. 12
+// uint button // bits 12 .. 14
+// uint need_timer // bits 14 .. 15
+// uint child_has_focus // bits 15 .. 16
+// uint have_visible_child // bits 16 .. 17
+// uint focus_out // bits 17 .. 18
+// uint has_before_previous // bits 18 .. 19
+// uint has_before_next // bits 19 .. 20
+// uint has_after_previous // bits 20 .. 21
+// uint has_after_next // bits 21 .. 22
+}
+struct _GtkMessageDialogClass {
+_GtkDialogClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkMessageDialog {
+_GtkDialog parent_instance;
+_GtkWidget * image;
+_GtkWidget * label;
+}
+struct _GtkMenuToolButton {
+_GtkToolButton parent;
+void * priv;
+}
+struct _GtkMenuToolButtonClass {
+_GtkToolButtonClass parent_class;
+_BCD_func__16750 show_menu;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkToolButtonClass {
+_GtkToolItemClass parent_class;
+uint button_type;
+_BCD_func__16752 clicked;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkToolButton {
+_GtkToolItem parent;
+void * priv;
+}
+struct _GtkToolItemClass {
+_GtkBinClass parent_class;
+_BCD_func__16755 create_menu_proxy;
+_BCD_func__16756 toolbar_reconfigured;
+_BCD_func__16757 set_tooltip;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkToolItem {
+_GtkBin parent;
+void * priv;
+}
+struct _GtkTooltipsData {
+_GtkTooltips * tooltips;
+_GtkWidget * widget;
+char * tip_text;
+char * tip_private;
+}
+struct _GtkTooltipsClass {
+_GtkObjectClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkTooltips {
+_GtkObject parent_instance;
+_GtkWidget * tip_window;
+_GtkWidget * tip_label;
+_GtkTooltipsData * active_tips_data;
+_GList * tips_data_list;
+uint bitfield0;
+// uint delay // bits 0 .. 30
+// uint enabled // bits 30 .. 31
+// uint have_grab // bits 31 .. 32
+uint bitfield1;
+// uint use_sticky_delay // bits 32 .. 33
+int timer_tag;
+_GTimeVal last_popdown;
+}
+struct _GtkMenuBarClass {
+_GtkMenuShellClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkMenuBar {
+_GtkMenuShell menu_shell;
+}
+struct _GtkListClass {
+_GtkContainerClass parent_class;
+_BCD_func__16765 selection_changed;
+_BCD_func__16766 select_child;
+_BCD_func__16766 unselect_child;
+}
+struct _GtkList {
+_GtkContainer container;
+_GList * children;
+_GList * selection;
+_GList * undo_selection;
+_GList * undo_unselection;
+_GtkWidget * last_focus_child;
+_GtkWidget * undo_focus_child;
+uint htimer;
+uint vtimer;
+int anchor;
+int drag_pos;
+int anchor_state;
+uint bitfield0;
+// uint selection_mode // bits 0 .. 2
+// uint drag_selection // bits 2 .. 3
+// uint add_mode // bits 3 .. 4
+}
+struct _GtkListItemClass {
+_GtkItemClass parent_class;
+_BCD_func__16769 toggle_focus_row;
+_BCD_func__16769 select_all;
+_BCD_func__16769 unselect_all;
+_BCD_func__16769 undo_selection;
+_BCD_func__16769 start_selection;
+_BCD_func__16769 end_selection;
+_BCD_func__16770 extend_selection;
+_BCD_func__16771 scroll_horizontal;
+_BCD_func__16771 scroll_vertical;
+_BCD_func__16769 toggle_add_mode;
+}
+struct _GtkListItem {
+_GtkItem item;
+}
+struct _GtkLinkButtonClass {
+_GtkButtonClass parent_class;
+_BCD_func__12122 _gtk_padding1;
+_BCD_func__12122 _gtk_padding2;
+_BCD_func__12122 _gtk_padding3;
+_BCD_func__12122 _gtk_padding4;
+}
+struct _GtkLinkButton {
+_GtkButton parent_instance;
+void * priv;
+}
+struct _GtkLayoutClass {
+_GtkContainerClass parent_class;
+_BCD_func__16776 set_scroll_adjustments;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkLayout {
+_GtkContainer container;
+_GList * children;
+uint width;
+uint height;
+_GtkAdjustment * hadjustment;
+_GtkAdjustment * vadjustment;
+_GdkDrawable * bin_window;
+int visibility;
+int scroll_x;
+int scroll_y;
+uint freeze_count;
+}
+struct _GtkInvisibleClass {
+_GtkWidgetClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkInvisible {
+_GtkWidget widget;
+int has_user_ref_count;
+_GdkScreen * screen;
+}
+struct _GtkInputDialogClass {
+_GtkDialogClass parent_class;
+_BCD_func__16781 enable_device;
+_BCD_func__16781 disable_device;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkInputDialog {
+_GtkDialog dialog;
+_GtkWidget * axis_list;
+_GtkWidget * axis_listbox;
+_GtkWidget * mode_optionmenu;
+_GtkWidget * close_button;
+_GtkWidget * save_button;
+_GtkWidget * [7] axis_items;
+_GdkDevice * current_device;
+_GtkWidget * keys_list;
+_GtkWidget * keys_listbox;
+}
+struct _GtkIMMulticontextClass {
+_GtkIMContextClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkIMMulticontext {
+_GtkIMContext object;
+_GtkIMContext * slave;
+void * priv;
+char * context_id;
+}
+struct _GtkIMContextSimpleClass {
+_GtkIMContextClass parent_class;
+}
+struct _GtkIMContextSimple {
+_GtkIMContext object;
+_GSList * tables;
+uint [8] compose_buffer;
+uint tentative_match;
+int tentative_match_len;
+uint bitfield0;
+// uint in_hex_sequence // bits 0 .. 1
+// uint modifiers_dropped // bits 1 .. 2
+}
+struct _GtkImageMenuItemClass {
+_GtkMenuItemClass parent_class;
+}
+struct _GtkImageMenuItem {
+_GtkMenuItem menu_item;
+_GtkWidget * image;
+}
+struct _GtkIconViewClass {
+_GtkContainerClass parent_class;
+_BCD_func__16790 set_scroll_adjustments;
+_BCD_func__16791 item_activated;
+_BCD_func__16792 selection_changed;
+_BCD_func__16792 select_all;
+_BCD_func__16792 unselect_all;
+_BCD_func__16792 select_cursor_item;
+_BCD_func__16792 toggle_cursor_item;
+_BCD_func__16793 move_cursor;
+_BCD_func__16794 activate_cursor_item;
+}
+struct _GtkIconView {
+_GtkContainer parent;
+void * priv;
+}
+struct _GtkIconThemeClass {
+_GObjectClass parent_class;
+_BCD_func__16797 changed;
+}
+struct _GtkIconTheme {
+_GObject parent_instance;
+void * priv;
+}
+struct _GtkIconFactoryClass {
+_GObjectClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkHSeparatorClass {
+_GtkSeparatorClass parent_class;
+}
+struct _GtkHSeparator {
+_GtkSeparator separator;
+}
+struct _GtkSeparatorClass {
+_GtkWidgetClass parent_class;
+}
+struct _GtkSeparator {
+_GtkWidget widget;
+}
+struct _GtkHScaleClass {
+_GtkScaleClass parent_class;
+}
+struct _GtkHScale {
+_GtkScale scale;
+}
+struct _GtkScaleClass {
+_GtkRangeClass parent_class;
+_BCD_func__16807 format_value;
+_BCD_func__16808 draw_value;
+_BCD_func__16809 get_layout_offsets;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkScale {
+_GtkRange range;
+int digits;
+uint bitfield0;
+// uint draw_value // bits 0 .. 1
+// uint value_pos // bits 1 .. 3
+}
+struct _GtkHRulerClass {
+_GtkRulerClass parent_class;
+}
+struct _GtkHRuler {
+_GtkRuler ruler;
+}
+struct _GtkRulerMetric {
+char * metric_name;
+char * abbrev;
+double pixels_per_unit;
+double [10] ruler_scale;
+int [5] subdivide;
+}
+struct _GtkRulerClass {
+_GtkWidgetClass parent_class;
+_BCD_func__16815 draw_ticks;
+_BCD_func__16815 draw_pos;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkRuler {
+_GtkWidget widget;
+_GdkDrawable * backing_store;
+_GdkGC * non_gr_exp_gc;
+_GtkRulerMetric * metric;
+int xsrc;
+int ysrc;
+int slider_size;
+double lower;
+double upper;
+double position;
+double max_size;
+}
+struct _GtkHPanedClass {
+_GtkPanedClass parent_class;
+}
+struct _GtkHPaned {
+_GtkPaned paned;
+}
+struct _GtkPanedClass {
+_GtkContainerClass parent_class;
+_BCD_func__16820 cycle_child_focus;
+_BCD_func__16821 toggle_handle_focus;
+_BCD_func__16822 move_handle;
+_BCD_func__16820 cycle_handle_focus;
+_BCD_func__16821 accept_position;
+_BCD_func__16821 cancel_position;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkPaned {
+_GtkContainer container;
+_GtkWidget * child1;
+_GtkWidget * child2;
+_GdkDrawable * handle;
+_GdkGC * xor_gc;
+int cursor_type;
+_GdkRectangle handle_pos;
+int child1_size;
+int last_allocation;
+int min_position;
+int max_position;
+uint bitfield0;
+// uint position_set // bits 0 .. 1
+// uint in_drag // bits 1 .. 2
+// uint child1_shrink // bits 2 .. 3
+// uint child1_resize // bits 3 .. 4
+// uint child2_shrink // bits 4 .. 5
+// uint child2_resize // bits 5 .. 6
+// uint orientation // bits 6 .. 7
+// uint in_recursion // bits 7 .. 8
+// uint handle_prelit // bits 8 .. 9
+_GtkWidget * last_child1_focus;
+_GtkWidget * last_child2_focus;
+void * priv;
+int drag_pos;
+int original_position;
+}
+struct _GtkHButtonBoxClass {
+_GtkButtonBoxClass parent_class;
+}
+struct _GtkHButtonBox {
+_GtkButtonBox button_box;
+}
+struct _GtkHandleBoxClass {
+_GtkBinClass parent_class;
+_BCD_func__16827 child_attached;
+_BCD_func__16827 child_detached;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkHandleBox {
+_GtkBin bin;
+_GdkDrawable * bin_window;
+_GdkDrawable * float_window;
+int shadow_type;
+uint bitfield0;
+// uint handle_position // bits 0 .. 2
+// uint float_window_mapped // bits 2 .. 3
+// uint child_detached // bits 3 .. 4
+// uint in_drag // bits 4 .. 5
+// uint shrink_on_detach // bits 5 .. 6
+// int snap_edge // bits 6 .. 9
+int deskoff_x;
+int deskoff_y;
+_GdkRectangle attach_allocation;
+_GdkRectangle float_allocation;
+}
+struct _GtkGammaCurveClass {
+_GtkVBoxClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkGammaCurve {
+_GtkVBox vbox;
+_GtkWidget * table;
+_GtkWidget * curve;
+_GtkWidget * [5] button;
+float gamma;
+_GtkWidget * gamma_dialog;
+_GtkWidget * gamma_text;
+}
+struct _GtkFontSelectionDialogClass {
+_GtkDialogClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkFontSelectionDialog {
+_GtkDialog parent_instance;
+_GtkWidget * fontsel;
+_GtkWidget * main_vbox;
+_GtkWidget * action_area;
+_GtkWidget * ok_button;
+_GtkWidget * apply_button;
+_GtkWidget * cancel_button;
+int dialog_width;
+int auto_resize;
+}
+struct _GtkFontSelectionClass {
+_GtkVBoxClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkFontSelection {
+_GtkVBox parent_instance;
+_GtkWidget * font_entry;
+_GtkWidget * family_list;
+_GtkWidget * font_style_entry;
+_GtkWidget * face_list;
+_GtkWidget * size_entry;
+_GtkWidget * size_list;
+_GtkWidget * pixels_button;
+_GtkWidget * points_button;
+_GtkWidget * filter_button;
+_GtkWidget * preview_entry;
+void * family;
+void * face;
+int size;
+_GdkFont * font;
+}
+struct _GtkFontButtonClass {
+_GtkButtonClass parent_class;
+_BCD_func__16836 font_set;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkFontButton {
+_GtkButton button;
+void * priv;
+}
+struct _GtkFileChooserWidgetClass {
+_GtkVBoxClass parent_class;
+}
+struct _GtkFileChooserWidget {
+_GtkVBox parent_instance;
+void * priv;
+}
+struct _GtkFileChooserDialogClass {
+_GtkDialogClass parent_class;
+}
+struct _GtkFileChooserDialog {
+_GtkDialog parent_instance;
+void * priv;
+}
+struct _GtkFileChooserButtonClass {
+_GtkHBoxClass parent_class;
+_BCD_func__16843 file_set;
+void * __gtk_reserved1;
+void * __gtk_reserved2;
+void * __gtk_reserved3;
+void * __gtk_reserved4;
+void * __gtk_reserved5;
+void * __gtk_reserved6;
+void * __gtk_reserved7;
+}
+struct _GtkFileChooserButton {
+_GtkHBox parent;
+void * priv;
+}
+struct _GtkFileFilterInfo {
+int contains;
+char * filename;
+char * uri;
+char * display_name;
+char * mime_type;
+}
+struct _GtkFixedChild {
+_GtkWidget * widget;
+int x;
+int y;
+}
+struct _GtkFixedClass {
+_GtkContainerClass parent_class;
+}
+struct _GtkFixed {
+_GtkContainer container;
+_GList * children;
+}
+struct _GtkFileSelectionClass {
+_GtkDialogClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkFileSelection {
+_GtkDialog parent_instance;
+_GtkWidget * dir_list;
+_GtkWidget * file_list;
+_GtkWidget * selection_entry;
+_GtkWidget * selection_text;
+_GtkWidget * main_vbox;
+_GtkWidget * ok_button;
+_GtkWidget * cancel_button;
+_GtkWidget * help_button;
+_GtkWidget * history_pulldown;
+_GtkWidget * history_menu;
+_GList * history_list;
+_GtkWidget * fileop_dialog;
+_GtkWidget * fileop_entry;
+char * fileop_file;
+void * cmpl_state;
+_GtkWidget * fileop_c_dir;
+_GtkWidget * fileop_del_file;
+_GtkWidget * fileop_ren_file;
+_GtkWidget * button_area;
+_GtkWidget * action_area;
+_GPtrArray * selected_names;
+char * last_selected;
+}
+struct _GtkExpanderClass {
+_GtkBinClass parent_class;
+_BCD_func__16852 activate;
+}
+struct _GtkExpander {
+_GtkBin bin;
+void * priv;
+}
+struct _GtkEventBoxClass {
+_GtkBinClass parent_class;
+}
+struct _GtkEventBox {
+_GtkBin bin;
+}
+struct _GtkCurveClass {
+_GtkDrawingAreaClass parent_class;
+_BCD_func__16857 curve_type_changed;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkCurve {
+_GtkDrawingArea graph;
+int cursor_type;
+float min_x;
+float max_x;
+float min_y;
+float max_y;
+_GdkDrawable * pixmap;
+int curve_type;
+int height;
+int grab_point;
+int last;
+int num_points;
+_GdkPoint * point;
+int num_ctlpoints;
+float [2] * ctlpoint;
+}
+struct _GtkDrawingAreaClass {
+_GtkWidgetClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkDrawingArea {
+_GtkWidget widget;
+void * draw_data;
+}
+struct _GtkCTreeNode {
+_GList list;
+}
+struct _GtkCTreeRow {
+_GtkCListRow row;
+_GtkCTreeNode * parent;
+_GtkCTreeNode * sibling;
+_GtkCTreeNode * children;
+_GdkDrawable * pixmap_closed;
+_GdkDrawable * mask_closed;
+_GdkDrawable * pixmap_opened;
+_GdkDrawable * mask_opened;
+ushort level;
+ubyte bitfield0;
+// uint is_leaf // bits 0 .. 1
+// uint expanded // bits 1 .. 2
+}
+struct _GtkCTreeClass {
+_GtkCListClass parent_class;
+_BCD_func__16865 tree_select_row;
+_BCD_func__16865 tree_unselect_row;
+_BCD_func__16866 tree_expand;
+_BCD_func__16866 tree_collapse;
+_BCD_func__16867 tree_move;
+_BCD_func__16868 change_focus_row_expansion;
+}
+struct _GtkCTree {
+_GtkCList clist;
+_GdkGC * lines_gc;
+int tree_indent;
+int tree_spacing;
+int tree_column;
+uint bitfield0;
+// uint line_style // bits 0 .. 2
+// uint expander_style // bits 2 .. 4
+// uint show_stub // bits 4 .. 5
+_BCD_func__10682 drag_compare;
+}
+struct _GtkComboBoxEntryClass {
+_GtkComboBoxClass parent_class;
+_BCD_func__12122 _gtk_reserved0;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+}
+struct _GtkComboBoxEntry {
+_GtkComboBox parent_instance;
+void * priv;
+}
+struct _GtkComboBoxClass {
+_GtkBinClass parent_class;
+_BCD_func__16873 changed;
+_BCD_func__16874 get_active_text;
+_BCD_func__12122 _gtk_reserved0;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+}
+struct _GtkComboBox {
+_GtkBin parent_instance;
+void * priv;
+}
+struct _GtkTreeSelectionClass {
+_GObjectClass parent_class;
+_BCD_func__16877 changed;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkTreeSelection {
+_GObject parent;
+_GtkTreeView * tree_view;
+int type;
+_BCD_func__9094 user_func;
+void * user_data;
+_BCD_func__13158 destroy;
+}
+struct _GtkTreeViewClass {
+_GtkContainerClass parent_class;
+_BCD_func__16880 set_scroll_adjustments;
+_BCD_func__16881 row_activated;
+_BCD_func__16882 test_expand_row;
+_BCD_func__16882 test_collapse_row;
+_BCD_func__16883 row_expanded;
+_BCD_func__16883 row_collapsed;
+_BCD_func__16884 columns_changed;
+_BCD_func__16884 cursor_changed;
+_BCD_func__16885 move_cursor;
+_BCD_func__16886 select_all;
+_BCD_func__16886 unselect_all;
+_BCD_func__16887 select_cursor_row;
+_BCD_func__16886 toggle_cursor_row;
+_BCD_func__16888 expand_collapse_cursor_row;
+_BCD_func__16886 select_cursor_parent;
+_BCD_func__16886 start_interactive_search;
+_BCD_func__12122 _gtk_reserved0;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkTreeView {
+_GtkContainer parent;
+void * priv;
+}
+struct _GtkEntryClass {
+_GtkWidgetClass parent_class;
+_BCD_func__16891 populate_popup;
+_BCD_func__16892 activate;
+_BCD_func__16893 move_cursor;
+_BCD_func__16894 insert_at_cursor;
+_BCD_func__16895 delete_from_cursor;
+_BCD_func__16892 backspace;
+_BCD_func__16892 cut_clipboard;
+_BCD_func__16892 copy_clipboard;
+_BCD_func__16892 paste_clipboard;
+_BCD_func__16892 toggle_overwrite;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+}
+struct _GtkEntry {
+_GtkWidget widget;
+char * text;
+uint bitfield0;
+// uint editable // bits 0 .. 1
+// uint visible // bits 1 .. 2
+// uint overwrite_mode // bits 2 .. 3
+// uint in_drag // bits 3 .. 4
+ushort text_length;
+ushort text_max_length;
+_GdkDrawable * text_area;
+_GtkIMContext * im_context;
+_GtkWidget * popup_menu;
+int current_pos;
+int selection_bound;
+void * cached_layout;
+uint bitfield1;
+// uint cache_includes_preedit // bits 32 .. 33
+// uint need_im_reset // bits 33 .. 34
+// uint has_frame // bits 34 .. 35
+// uint activates_default // bits 35 .. 36
+// uint cursor_visible // bits 36 .. 37
+// uint in_click // bits 37 .. 38
+// uint is_cell_renderer // bits 38 .. 39
+// uint editing_canceled // bits 39 .. 40
+// uint mouse_cursor_obscured // bits 40 .. 41
+// uint select_words // bits 41 .. 42
+// uint select_lines // bits 42 .. 43
+// uint resolved_dir // bits 43 .. 47
+// uint truncate_multiline // bits 47 .. 48
+uint button;
+uint blink_timeout;
+uint recompute_idle;
+int scroll_offset;
+int ascent;
+int descent;
+ushort text_size;
+ushort n_bytes;
+ushort preedit_length;
+ushort preedit_cursor;
+int dnd_position;
+int drag_start_x;
+int drag_start_y;
+uint invisible_char;
+int width_chars;
+}
+struct _GtkEntryCompletionClass {
+_GObjectClass parent_class;
+_BCD_func__16898 match_selected;
+_BCD_func__16899 action_activated;
+_BCD_func__16900 insert_prefix;
+_BCD_func__16898 cursor_on_match;
+_BCD_func__12122 _gtk_reserved0;
+_BCD_func__12122 _gtk_reserved1;
+}
+struct _GtkEntryCompletion {
+_GObject parent_instance;
+void * priv;
+}
+struct _GtkTreeModelFilterClass {
+_GObjectClass parent_class;
+_BCD_func__12122 _gtk_reserved0;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+}
+struct _GtkTreeModelFilter {
+_GObject parent;
+void * priv;
+}
+struct _GtkListStoreClass {
+_GObjectClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkListStore {
+_GObject parent;
+int stamp;
+void * seq;
+void * _gtk_reserved1;
+_GList * sort_list;
+int n_columns;
+int sort_column_id;
+int order;
+uint * column_headers;
+int length;
+_BCD_func__11685 default_sort_func;
+void * default_sort_data;
+_BCD_func__13158 default_sort_destroy;
+uint bitfield0;
+// uint columns_dirty // bits 0 .. 1
+}
+struct _GtkIMContextClass {
+_GtkObjectClass parent_class;
+_BCD_func__16907 preedit_start;
+_BCD_func__16907 preedit_end;
+_BCD_func__16907 preedit_changed;
+_BCD_func__16908 commit;
+_BCD_func__16909 retrieve_surrounding;
+_BCD_func__16910 delete_surrounding;
+_BCD_func__16911 set_client_window;
+_BCD_func__16912 get_preedit_string;
+_BCD_func__16913 filter_keypress;
+_BCD_func__16907 focus_in;
+_BCD_func__16907 focus_out;
+_BCD_func__16907 reset;
+_BCD_func__16914 set_cursor_location;
+_BCD_func__16915 set_use_preedit;
+_BCD_func__16916 set_surrounding;
+_BCD_func__16917 get_surrounding;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+_BCD_func__12122 _gtk_reserved5;
+_BCD_func__12122 _gtk_reserved6;
+}
+struct _GtkIMContext {
+_GObject parent_instance;
+}
+struct _GtkEditableClass {
+_GTypeInterface base_iface;
+_BCD_func__16920 insert_text;
+_BCD_func__16921 delete_text;
+_BCD_func__16922 changed;
+_BCD_func__16920 do_insert_text;
+_BCD_func__16921 do_delete_text;
+_BCD_func__16923 get_chars;
+_BCD_func__16921 set_selection_bounds;
+_BCD_func__16924 get_selection_bounds;
+_BCD_func__16925 set_position;
+_BCD_func__16926 get_position;
+}
+struct _GtkComboClass {
+_GtkHBoxClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkCombo {
+_GtkHBox hbox;
+_GtkWidget * entry;
+_GtkWidget * button;
+_GtkWidget * popup;
+_GtkWidget * popwin;
+_GtkWidget * list;
+uint entry_change_id;
+uint list_change_id;
+ubyte bitfield0;
+// uint value_in_list // bits 0 .. 1
+// uint ok_if_empty // bits 1 .. 2
+// uint case_sensitive // bits 2 .. 3
+// uint use_arrows // bits 3 .. 4
+// uint use_arrows_always // bits 4 .. 5
+ushort current_button;
+uint activate_id;
+}
+struct _GtkHBoxClass {
+_GtkBoxClass parent_class;
+}
+struct _GtkHBox {
+_GtkBox box;
+}
+struct _GtkColorSelectionDialogClass {
+_GtkDialogClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkColorSelectionDialog {
+_GtkDialog parent_instance;
+_GtkWidget * colorsel;
+_GtkWidget * ok_button;
+_GtkWidget * cancel_button;
+_GtkWidget * help_button;
+}
+struct _GtkColorSelectionClass {
+_GtkVBoxClass parent_class;
+_BCD_func__16934 color_changed;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkColorSelection {
+_GtkVBox parent_instance;
+void * private_data;
+}
+struct _GtkVBoxClass {
+_GtkBoxClass parent_class;
+}
+struct _GtkVBox {
+_GtkBox box;
+}
+struct _GtkColorButtonClass {
+_GtkButtonClass parent_class;
+_BCD_func__16939 color_set;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkColorButton {
+_GtkButton button;
+void * priv;
+}
+struct _GtkCListDestInfo {
+_GtkCListCellInfo cell;
+int insert_pos;
+}
+struct _GtkCListCellInfo {
+int row;
+int column;
+}
+struct _GtkCellWidget {
+int type;
+short vertical;
+short horizontal;
+_GtkStyle * style;
+_GtkWidget * widget;
+}
+struct _GtkCellPixText {
+int type;
+short vertical;
+short horizontal;
+_GtkStyle * style;
+char * text;
+char spacing;
+_GdkDrawable * pixmap;
+_GdkDrawable * mask;
+}
+struct _GtkCellPixmap {
+int type;
+short vertical;
+short horizontal;
+_GtkStyle * style;
+_GdkDrawable * pixmap;
+_GdkDrawable * mask;
+}
+struct _GtkCellText {
+int type;
+short vertical;
+short horizontal;
+_GtkStyle * style;
+char * text;
+}
+struct N8_GtkCell5__2315__232E {
+_GdkDrawable * pixmap;
+_GdkDrawable * mask;
+}
+struct N8_GtkCell5__2315__233E {
+char * text;
+char spacing;
+_GdkDrawable * pixmap;
+_GdkDrawable * mask;
+}
+union N8_GtkCell5__231E {
+char * text;
+N8_GtkCell5__2315__232E pm;
+N8_GtkCell5__2315__233E pt;
+_GtkWidget * widget;
+}
+struct _GtkCell {
+int type;
+short vertical;
+short horizontal;
+_GtkStyle * style;
+N8_GtkCell5__231E u;
+}
+struct _GtkCListRow {
+_GtkCell * cell;
+int state;
+_GdkColor foreground;
+_GdkColor background;
+_GtkStyle * style;
+void * data;
+_BCD_func__13158 destroy;
+uint bitfield0;
+// uint fg_set // bits 0 .. 1
+// uint bg_set // bits 1 .. 2
+// uint selectable // bits 2 .. 3
+}
+struct _GtkCListColumn {
+char * title;
+_GdkRectangle area;
+_GtkWidget * button;
+_GdkDrawable * window;
+int width;
+int min_width;
+int max_width;
+int justification;
+uint bitfield0;
+// uint visible // bits 0 .. 1
+// uint width_set // bits 1 .. 2
+// uint resizeable // bits 2 .. 3
+// uint auto_resize // bits 3 .. 4
+// uint button_passive // bits 4 .. 5
+}
+struct _GtkCListClass {
+_GtkContainerClass parent_class;
+_BCD_func__16962 set_scroll_adjustments;
+_BCD_func__16963 refresh;
+_BCD_func__16964 select_row;
+_BCD_func__16964 unselect_row;
+_BCD_func__16965 row_move;
+_BCD_func__16966 click_column;
+_BCD_func__16965 resize_column;
+_BCD_func__16963 toggle_focus_row;
+_BCD_func__16963 select_all;
+_BCD_func__16963 unselect_all;
+_BCD_func__16963 undo_selection;
+_BCD_func__16963 start_selection;
+_BCD_func__16963 end_selection;
+_BCD_func__16967 extend_selection;
+_BCD_func__16968 scroll_horizontal;
+_BCD_func__16968 scroll_vertical;
+_BCD_func__16963 toggle_add_mode;
+_BCD_func__16963 abort_column_resize;
+_BCD_func__16969 resync_selection;
+_BCD_func__16970 selection_find;
+_BCD_func__16971 draw_row;
+_BCD_func__16972 draw_drag_highlight;
+_BCD_func__16963 clear;
+_BCD_func__16966 fake_unselect_all;
+_BCD_func__16963 sort_list;
+_BCD_func__16973 insert_row;
+_BCD_func__16966 remove_row;
+_BCD_func__16974 set_cell_contents;
+_BCD_func__16975 cell_size_request;
+}
+struct _GtkCList {
+_GtkContainer container;
+ushort flags;
+void * reserved1;
+void * reserved2;
+uint freeze_count;
+_GdkRectangle internal_allocation;
+int rows;
+int row_height;
+_GList * row_list;
+_GList * row_list_end;
+int columns;
+_GdkRectangle column_title_area;
+_GdkDrawable * title_window;
+_GtkCListColumn * column;
+_GdkDrawable * clist_window;
+int clist_window_width;
+int clist_window_height;
+int hoffset;
+int voffset;
+int shadow_type;
+int selection_mode;
+_GList * selection;
+_GList * selection_end;
+_GList * undo_selection;
+_GList * undo_unselection;
+int undo_anchor;
+char [5] button_actions;
+char drag_button;
+_GtkCListCellInfo click_cell;
+_GtkAdjustment * hadjustment;
+_GtkAdjustment * vadjustment;
+_GdkGC * xor_gc;
+_GdkGC * fg_gc;
+_GdkGC * bg_gc;
+_GdkCursor * cursor_drag;
+int x_drag;
+int focus_row;
+int focus_header_column;
+int anchor;
+int anchor_state;
+int drag_pos;
+int htimer;
+int vtimer;
+int sort_type;
+_BCD_func__11051 compare;
+int sort_column;
+int drag_highlight_row;
+int drag_highlight_pos;
+}
+struct _GtkVScrollbarClass {
+_GtkScrollbarClass parent_class;
+}
+struct _GtkVScrollbar {
+_GtkScrollbar scrollbar;
+}
+struct _GtkHScrollbarClass {
+_GtkScrollbarClass parent_class;
+}
+struct _GtkHScrollbar {
+_GtkScrollbar scrollbar;
+}
+struct _GtkScrollbarClass {
+_GtkRangeClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkScrollbar {
+_GtkRange range;
+}
+struct _GtkRangeClass {
+_GtkWidgetClass parent_class;
+char * slider_detail;
+char * stepper_detail;
+_BCD_func__16984 value_changed;
+_BCD_func__16985 adjust_bounds;
+_BCD_func__16986 move_slider;
+_BCD_func__16987 get_range_border;
+_BCD_func__16988 change_value;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+}
+struct _GtkRange {
+_GtkWidget widget;
+_GtkAdjustment * adjustment;
+int update_policy;
+uint bitfield0;
+// uint inverted // bits 0 .. 1
+// uint flippable // bits 1 .. 2
+// uint has_stepper_a // bits 2 .. 3
+// uint has_stepper_b // bits 3 .. 4
+// uint has_stepper_c // bits 4 .. 5
+// uint has_stepper_d // bits 5 .. 6
+// uint need_recalc // bits 6 .. 7
+// uint slider_size_fixed // bits 7 .. 8
+int min_slider_size;
+int orientation;
+_GdkRectangle range_rect;
+int slider_start;
+int slider_end;
+int round_digits;
+uint bitfield1;
+// uint trough_click_forward // bits 32 .. 33
+// uint update_pending // bits 33 .. 34
+void * layout;
+void * timer;
+int slide_initial_slider_position;
+int slide_initial_coordinate;
+uint update_timeout_id;
+_GdkDrawable * event_window;
+}
+struct _GtkTargetPair {
+void * target;
+uint flags;
+uint info;
+}
+struct _GtkTargetEntry {
+char * target;
+uint flags;
+uint info;
+}
+struct _GtkTargetList {
+_GList * list;
+uint ref_count;
+}
+struct _GtkTextBuffer {
+_GObject parent_instance;
+_GtkTextTagTable * tag_table;
+void * btree;
+_GSList * clipboard_contents_buffers;
+_GSList * selection_clipboards;
+void * log_attr_cache;
+uint user_action_count;
+uint bitfield0;
+// uint modified // bits 0 .. 1
+// uint has_selection // bits 1 .. 2
+}
+struct _GtkTextChildAnchorClass {
+_GObjectClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkTextChildAnchor {
+_GObject parent_instance;
+void * segment;
+}
+struct _GtkTextAppearance {
+_GdkColor bg_color;
+_GdkColor fg_color;
+_GdkDrawable * bg_stipple;
+_GdkDrawable * fg_stipple;
+int rise;
+void * padding1;
+uint bitfield0;
+// uint underline // bits 0 .. 4
+// uint strikethrough // bits 4 .. 5
+// uint draw_bg // bits 5 .. 6
+// uint inside_selection // bits 6 .. 7
+// uint is_text // bits 7 .. 8
+// uint pad1 // bits 8 .. 9
+// uint pad2 // bits 9 .. 10
+// uint pad3 // bits 10 .. 11
+// uint pad4 // bits 11 .. 12
+}
+struct _GtkTextTagClass {
+_GObjectClass parent_class;
+_BCD_func__16998 event;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkTextTag {
+_GObject parent_instance;
+_GtkTextTagTable * table;
+char * name;
+int priority;
+_GtkTextAttributes * values;
+uint bitfield0;
+// uint bg_color_set // bits 0 .. 1
+// uint bg_stipple_set // bits 1 .. 2
+// uint fg_color_set // bits 2 .. 3
+// uint scale_set // bits 3 .. 4
+// uint fg_stipple_set // bits 4 .. 5
+// uint justification_set // bits 5 .. 6
+// uint left_margin_set // bits 6 .. 7
+// uint indent_set // bits 7 .. 8
+// uint rise_set // bits 8 .. 9
+// uint strikethrough_set // bits 9 .. 10
+// uint right_margin_set // bits 10 .. 11
+// uint pixels_above_lines_set // bits 11 .. 12
+// uint pixels_below_lines_set // bits 12 .. 13
+// uint pixels_inside_wrap_set // bits 13 .. 14
+// uint tabs_set // bits 14 .. 15
+// uint underline_set // bits 15 .. 16
+// uint wrap_mode_set // bits 16 .. 17
+// uint bg_full_height_set // bits 17 .. 18
+// uint invisible_set // bits 18 .. 19
+// uint editable_set // bits 19 .. 20
+// uint language_set // bits 20 .. 21
+// uint pg_bg_color_set // bits 21 .. 22
+// uint accumulative_margin // bits 22 .. 23
+// uint pad1 // bits 23 .. 24
+}
+struct _GtkTextAttributes {
+uint refcount;
+_GtkTextAppearance appearance;
+int justification;
+int direction;
+void * font;
+double font_scale;
+int left_margin;
+int indent;
+int right_margin;
+int pixels_above_lines;
+int pixels_below_lines;
+int pixels_inside_wrap;
+void * tabs;
+int wrap_mode;
+void * language;
+_GdkColor * pg_bg_color;
+uint bitfield0;
+// uint invisible // bits 0 .. 1
+// uint bg_full_height // bits 1 .. 2
+// uint editable // bits 2 .. 3
+// uint realized // bits 3 .. 4
+// uint pad1 // bits 4 .. 5
+// uint pad2 // bits 5 .. 6
+// uint pad3 // bits 6 .. 7
+// uint pad4 // bits 7 .. 8
+}
+struct _GtkTextTagTable {
+_GObject parent_instance;
+void * hash;
+_GSList * anonymous;
+int anon_count;
+_GSList * buffers;
+}
+struct _GtkTextIter {
+void * dummy1;
+void * dummy2;
+int dummy3;
+int dummy4;
+int dummy5;
+int dummy6;
+int dummy7;
+int dummy8;
+void * dummy9;
+void * dummy10;
+int dummy11;
+int dummy12;
+int dummy13;
+void * dummy14;
+}
+struct _GtkCheckMenuItemClass {
+_GtkMenuItemClass parent_class;
+_BCD_func__17004 toggled;
+_BCD_func__17005 draw_indicator;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkCheckMenuItem {
+_GtkMenuItem menu_item;
+uint bitfield0;
+// uint active // bits 0 .. 1
+// uint always_show_toggle // bits 1 .. 2
+// uint inconsistent // bits 2 .. 3
+// uint draw_as_radio // bits 3 .. 4
+}
+struct _GtkMenuItemClass {
+_GtkItemClass parent_class;
+uint bitfield0;
+// uint hide_on_activate // bits 0 .. 1
+_BCD_func__17008 activate;
+_BCD_func__17008 activate_item;
+_BCD_func__17009 toggle_size_request;
+_BCD_func__17010 toggle_size_allocate;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkMenuItem {
+_GtkItem item;
+_GtkWidget * submenu;
+_GdkDrawable * event_window;
+ushort toggle_size;
+ushort accelerator_width;
+char * accel_path;
+uint bitfield0;
+// uint show_submenu_indicator // bits 0 .. 1
+// uint submenu_placement // bits 1 .. 2
+// uint submenu_direction // bits 2 .. 3
+// uint right_justify // bits 3 .. 4
+// uint timer_from_keypress // bits 4 .. 5
+// uint from_menubar // bits 5 .. 6
+uint timer;
+}
+struct _GtkItemClass {
+_GtkBinClass parent_class;
+_BCD_func__17013 select;
+_BCD_func__17013 deselect;
+_BCD_func__17013 toggle;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkItem {
+_GtkBin bin;
+}
+struct _GtkCheckButtonClass {
+_GtkToggleButtonClass parent_class;
+_BCD_func__17016 draw_indicator;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkCheckButton {
+_GtkToggleButton toggle_button;
+}
+struct _GtkToggleButtonClass {
+_GtkButtonClass parent_class;
+_BCD_func__17019 toggled;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkToggleButton {
+_GtkButton button;
+uint bitfield0;
+// uint active // bits 0 .. 1
+// uint draw_indicator // bits 1 .. 2
+// uint inconsistent // bits 2 .. 3
+}
+struct _GtkCellViewClass {
+_GtkWidgetClass parent_class;
+}
+struct _GtkCellView {
+_GtkWidget parent_instance;
+void * priv;
+}
+struct _GtkCellRendererToggleClass {
+_GtkCellRendererClass parent_class;
+_BCD_func__17024 toggled;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkCellRendererToggle {
+_GtkCellRenderer parent;
+uint bitfield0;
+// uint active // bits 0 .. 1
+// uint activatable // bits 1 .. 2
+// uint radio // bits 2 .. 3
+}
+struct _GtkCellRendererSpinClass {
+_GtkCellRendererTextClass parent;
+}
+struct _GtkCellRendererSpin {
+_GtkCellRendererText parent;
+}
+struct _GtkCellRendererProgressClass {
+_GtkCellRendererClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkCellRendererProgress {
+_GtkCellRenderer parent_instance;
+void * priv;
+}
+struct _GtkCellRendererPixbufClass {
+_GtkCellRendererClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkCellRendererPixbuf {
+_GtkCellRenderer parent;
+void * pixbuf;
+void * pixbuf_expander_open;
+void * pixbuf_expander_closed;
+}
+struct _GtkCellRendererComboClass {
+_GtkCellRendererTextClass parent;
+}
+struct _GtkCellRendererCombo {
+_GtkCellRendererText parent;
+void * model;
+int text_column;
+int has_entry;
+uint focus_out_id;
+}
+struct _GtkCellRendererAccelClass {
+_GtkCellRendererTextClass parent_class;
+_BCD_func__17035 accel_edited;
+_BCD_func__17036 accel_cleared;
+_BCD_func__12122 _gtk_reserved0;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkCellRendererAccel {
+_GtkCellRendererText parent;
+uint accel_key;
+int accel_mods;
+uint keycode;
+int accel_mode;
+_GtkWidget * edit_widget;
+_GtkWidget * grab_widget;
+_GtkWidget * sizing_label;
+}
+struct _GtkCellRendererTextClass {
+_GtkCellRendererClass parent_class;
+_BCD_func__17039 edited;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkCellRendererText {
+_GtkCellRenderer parent;
+char * text;
+void * font;
+double font_scale;
+_PangoColor foreground;
+_PangoColor background;
+void * extra_attrs;
+int underline_style;
+int rise;
+int fixed_height_rows;
+uint bitfield0;
+// uint strikethrough // bits 0 .. 1
+// uint editable // bits 1 .. 2
+// uint scale_set // bits 2 .. 3
+// uint foreground_set // bits 3 .. 4
+// uint background_set // bits 4 .. 5
+// uint underline_set // bits 5 .. 6
+// uint rise_set // bits 6 .. 7
+// uint strikethrough_set // bits 7 .. 8
+// uint editable_set // bits 8 .. 9
+// uint calc_fixed_height // bits 9 .. 10
+}
+struct _GtkCellLayoutIface {
+_GTypeInterface g_iface;
+_BCD_func__17042 pack_start;
+_BCD_func__17042 pack_end;
+_BCD_func__17043 clear;
+_BCD_func__17044 add_attribute;
+_BCD_func__17045 set_cell_data_func;
+_BCD_func__17046 clear_attributes;
+_BCD_func__17042 reorder;
+_BCD_func__17047 get_cells;
+}
+struct _GtkTreeViewColumnClass {
+_GtkObjectClass parent_class;
+_BCD_func__17049 clicked;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkTreeViewColumn {
+_GtkObject parent;
+_GtkWidget * tree_view;
+_GtkWidget * button;
+_GtkWidget * child;
+_GtkWidget * arrow;
+_GtkWidget * alignment;
+_GdkDrawable * window;
+void * editable_widget;
+float xalign;
+uint property_changed_signal;
+int spacing;
+int column_type;
+int requested_width;
+int button_request;
+int resized_width;
+int width;
+int fixed_width;
+int min_width;
+int max_width;
+int drag_x;
+int drag_y;
+char * title;
+_GList * cell_list;
+uint sort_clicked_signal;
+uint sort_column_changed_signal;
+int sort_column_id;
+int sort_order;
+uint bitfield0;
+// uint visible // bits 0 .. 1
+// uint resizable // bits 1 .. 2
+// uint clickable // bits 2 .. 3
+// uint dirty // bits 3 .. 4
+// uint show_sort_indicator // bits 4 .. 5
+// uint maybe_reordered // bits 5 .. 6
+// uint reorderable // bits 6 .. 7
+// uint use_resized_width // bits 7 .. 8
+// uint expand // bits 8 .. 9
+}
+struct _GtkTreeSortableIface {
+_GTypeInterface g_iface;
+_BCD_func__17052 sort_column_changed;
+_BCD_func__17053 get_sort_column_id;
+_BCD_func__17054 set_sort_column_id;
+_BCD_func__17055 set_sort_func;
+_BCD_func__17056 set_default_sort_func;
+_BCD_func__17057 has_default_sort_func;
+}
+struct _GtkTreeModelIface {
+_GTypeInterface g_iface;
+_BCD_func__17059 row_changed;
+_BCD_func__17059 row_inserted;
+_BCD_func__17059 row_has_child_toggled;
+_BCD_func__17060 row_deleted;
+_BCD_func__17061 rows_reordered;
+_BCD_func__17062 get_flags;
+_BCD_func__17063 get_n_columns;
+_BCD_func__17064 get_column_type;
+_BCD_func__17065 get_iter;
+_BCD_func__17066 get_path;
+_BCD_func__17067 get_value;
+_BCD_func__17068 iter_next;
+_BCD_func__17069 iter_children;
+_BCD_func__17068 iter_has_child;
+_BCD_func__17070 iter_n_children;
+_BCD_func__17071 iter_nth_child;
+_BCD_func__17069 iter_parent;
+_BCD_func__17072 ref_node;
+_BCD_func__17072 unref_node;
+}
+struct _GtkTreeIter {
+int stamp;
+void * user_data;
+void * user_data2;
+void * user_data3;
+}
+struct _GtkCellRendererClass {
+_GtkObjectClass parent_class;
+_BCD_func__17075 get_size;
+_BCD_func__17076 render;
+_BCD_func__17077 activate;
+_BCD_func__17078 start_editing;
+_BCD_func__17079 editing_canceled;
+_BCD_func__17080 editing_started;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+}
+struct _GtkCellRenderer {
+_GtkObject parent;
+float xalign;
+float yalign;
+int width;
+int height;
+ushort xpad;
+ushort ypad;
+uint bitfield0;
+// uint mode // bits 0 .. 2
+// uint visible // bits 2 .. 3
+// uint is_expander // bits 3 .. 4
+// uint is_expanded // bits 4 .. 5
+// uint cell_background_set // bits 5 .. 6
+// uint sensitive // bits 6 .. 7
+// uint editing // bits 7 .. 8
+}
+struct _GtkCellEditableIface {
+_GTypeInterface g_iface;
+_BCD_func__17083 editing_done;
+_BCD_func__17083 remove_widget;
+_BCD_func__17084 start_editing;
+}
+struct _GtkCalendarClass {
+_GtkWidgetClass parent_class;
+_BCD_func__17086 month_changed;
+_BCD_func__17086 day_selected;
+_BCD_func__17086 day_selected_double_click;
+_BCD_func__17086 prev_month;
+_BCD_func__17086 next_month;
+_BCD_func__17086 prev_year;
+_BCD_func__17086 next_year;
+}
+struct _GtkCalendar {
+_GtkWidget widget;
+_GtkStyle * header_style;
+_GtkStyle * label_style;
+int month;
+int year;
+int selected_day;
+int [7] [6] day_month;
+int [7] [6] day;
+int num_marked_dates;
+int [31] marked_date;
+int display_flags;
+_GdkColor [31] marked_date_color;
+_GdkGC * gc;
+_GdkGC * xor_gc;
+int focus_row;
+int focus_col;
+int highlight_row;
+int highlight_col;
+void * priv;
+char [32] grow_space;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkButtonClass {
+_GtkBinClass parent_class;
+_BCD_func__17090 pressed;
+_BCD_func__17090 released;
+_BCD_func__17090 clicked;
+_BCD_func__17090 enter;
+_BCD_func__17090 leave;
+_BCD_func__17090 activate;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkButton {
+_GtkBin bin;
+_GdkDrawable * event_window;
+char * label_text;
+uint activate_timeout;
+uint bitfield0;
+// uint constructed // bits 0 .. 1
+// uint in_button // bits 1 .. 2
+// uint button_down // bits 2 .. 3
+// uint relief // bits 3 .. 5
+// uint use_underline // bits 5 .. 6
+// uint use_stock // bits 6 .. 7
+// uint depressed // bits 7 .. 8
+// uint depress_on_activate // bits 8 .. 9
+// uint focus_on_click // bits 9 .. 10
+}
+struct _GtkImageIconNameData {
+char * icon_name;
+void * pixbuf;
+uint theme_change_id;
+}
+struct _GtkImageAnimationData {
+void * anim;
+void * iter;
+uint frame_timeout;
+}
+struct _GtkImageIconSetData {
+void * icon_set;
+}
+struct _GtkImageStockData {
+char * stock_id;
+}
+struct _GtkImagePixbufData {
+void * pixbuf;
+}
+struct _GtkImageImageData {
+_GdkImage * image;
+}
+struct _GtkImagePixmapData {
+_GdkDrawable * pixmap;
+}
+struct _GtkImageClass {
+_GtkMiscClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+union N9_GtkImage5__218E {
+_GtkImagePixmapData pixmap;
+_GtkImageImageData image;
+_GtkImagePixbufData pixbuf;
+_GtkImageStockData stock;
+_GtkImageIconSetData icon_set;
+_GtkImageAnimationData anim;
+_GtkImageIconNameData name;
+}
+struct _GtkImage {
+_GtkMisc misc;
+int storage_type;
+N9_GtkImage5__218E data;
+_GdkDrawable * mask;
+int icon_size;
+}
+struct _GtkBuildableIface {
+_GTypeInterface g_iface;
+_BCD_func__17103 set_name;
+_BCD_func__17104 get_name;
+_BCD_func__17105 add_child;
+_BCD_func__17106 set_buildable_property;
+_BCD_func__17107 construct_child;
+_BCD_func__17108 custom_tag_start;
+_BCD_func__17109 custom_tag_end;
+_BCD_func__17110 custom_finished;
+_BCD_func__17111 parser_finished;
+_BCD_func__17107 get_internal_child;
+}
+struct _GtkBuilderClass {
+_GObjectClass parent_class;
+_BCD_func__17113 get_type_from_name;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+_BCD_func__12122 _gtk_reserved5;
+_BCD_func__12122 _gtk_reserved6;
+_BCD_func__12122 _gtk_reserved7;
+_BCD_func__12122 _gtk_reserved8;
+}
+struct _GtkBuilder {
+_GObject parent_instance;
+void * priv;
+}
+union N14_GtkBindingArg5__215E {
+int long_data;
+double double_data;
+char * string_data;
+}
+struct _GtkBindingArg {
+uint arg_type;
+N14_GtkBindingArg5__215E d;
+}
+struct _GtkBindingSignal {
+_GtkBindingSignal * next;
+char * signal_name;
+uint n_args;
+_GtkBindingArg * args;
+}
+struct _GtkBindingEntry {
+uint keyval;
+int modifiers;
+_GtkBindingSet * binding_set;
+uint bitfield0;
+// uint destroyed // bits 0 .. 1
+// uint in_emission // bits 1 .. 2
+// uint marks_unbound // bits 2 .. 3
+_GtkBindingEntry * set_next;
+_GtkBindingEntry * hash_next;
+_GtkBindingSignal * signals;
+}
+struct _GtkBindingSet {
+char * set_name;
+int priority;
+_GSList * widget_path_pspecs;
+_GSList * widget_class_pspecs;
+_GSList * class_branch_pspecs;
+_GtkBindingEntry * entries;
+_GtkBindingEntry * current;
+uint bitfield0;
+// uint parsed // bits 0 .. 1
+}
+struct _GtkButtonBoxClass {
+_GtkBoxClass parent_class;
+}
+struct _GtkButtonBox {
+_GtkBox box;
+int child_min_width;
+int child_min_height;
+int child_ipad_x;
+int child_ipad_y;
+int layout_style;
+}
+struct _GtkBoxChild {
+_GtkWidget * widget;
+ushort padding;
+ubyte bitfield0;
+// uint expand // bits 0 .. 1
+// uint fill // bits 1 .. 2
+// uint pack // bits 2 .. 3
+// uint is_secondary // bits 3 .. 4
+}
+struct _GtkBoxClass {
+_GtkContainerClass parent_class;
+}
+struct _GtkBox {
+_GtkContainer container;
+_GList * children;
+short spacing;
+ubyte bitfield0;
+// uint homogeneous // bits 0 .. 1
+}
+struct _GtkAssistantClass {
+_GtkWindowClass parent_class;
+_BCD_func__17126 prepare;
+_BCD_func__17127 apply;
+_BCD_func__17127 close;
+_BCD_func__17127 cancel;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+_BCD_func__12122 _gtk_reserved5;
+}
+struct _GtkAssistant {
+_GtkWindow parent;
+_GtkWidget * cancel;
+_GtkWidget * forward;
+_GtkWidget * back;
+_GtkWidget * apply;
+_GtkWidget * close;
+_GtkWidget * last;
+void * priv;
+}
+struct _GtkAspectFrameClass {
+_GtkFrameClass parent_class;
+}
+struct _GtkAspectFrame {
+_GtkFrame frame;
+float xalign;
+float yalign;
+float ratio;
+int obey_child;
+_GdkRectangle center_allocation;
+}
+struct _GtkFrameClass {
+_GtkBinClass parent_class;
+_BCD_func__17132 compute_child_allocation;
+}
+struct _GtkFrame {
+_GtkBin bin;
+_GtkWidget * label_widget;
+short shadow_type;
+float label_xalign;
+float label_yalign;
+_GdkRectangle child_allocation;
+}
+struct _GtkArrowClass {
+_GtkMiscClass parent_class;
+}
+struct _GtkArrow {
+_GtkMisc misc;
+short arrow_type;
+short shadow_type;
+}
+struct _GtkAlignmentClass {
+_GtkBinClass parent_class;
+}
+struct _GtkAlignment {
+_GtkBin bin;
+float xalign;
+float yalign;
+float xscale;
+float yscale;
+}
+struct _GtkRadioActionEntry {
+char * name;
+char * stock_id;
+char * label;
+char * accelerator;
+char * tooltip;
+int value;
+}
+struct _GtkToggleActionEntry {
+char * name;
+char * stock_id;
+char * label;
+char * accelerator;
+char * tooltip;
+_BCD_func__12122 callback;
+int is_active;
+}
+struct _GtkActionEntry {
+char * name;
+char * stock_id;
+char * label;
+char * accelerator;
+char * tooltip;
+_BCD_func__12122 callback;
+}
+struct _GtkActionGroupClass {
+_GObjectClass parent_class;
+_BCD_func__17142 get_action;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkActionGroup {
+_GObject parent;
+void * private_data;
+}
+struct GtkMenuEntry {
+char * path;
+char * accelerator;
+_BCD_func__12090 callback;
+void * callback_data;
+_GtkWidget * widget;
+}
+struct _GtkItemFactoryItem {
+char * path;
+_GSList * widgets;
+}
+struct _GtkItemFactoryEntry {
+char * path;
+char * accelerator;
+_BCD_func__12122 callback;
+uint callback_action;
+char * item_type;
+void * extra_data;
+}
+struct _GtkItemFactoryClass {
+_GtkObjectClass object_class;
+void * item_ht;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkItemFactory {
+_GtkObject object;
+char * path;
+_GtkAccelGroup * accel_group;
+_GtkWidget * widget;
+_GSList * items;
+_BCD_func__12124 translate_func;
+void * translate_data;
+_BCD_func__13158 translate_notify;
+}
+struct _GtkActionClass {
+_GObjectClass parent_class;
+_BCD_func__17150 activate;
+uint menu_item_type;
+uint toolbar_item_type;
+_BCD_func__17151 create_menu_item;
+_BCD_func__17151 create_tool_item;
+_BCD_func__17152 connect_proxy;
+_BCD_func__17152 disconnect_proxy;
+_BCD_func__17151 create_menu;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkAction {
+_GObject object;
+void * private_data;
+}
+struct _GtkAccessibleClass {
+_AtkObjectClass parent_class;
+_BCD_func__17155 connect_widget_destroyed;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkAccessible {
+_AtkObject parent;
+_GtkWidget * widget;
+}
+struct _GtkAccelLabelClass {
+_GtkLabelClass parent_class;
+char * signal_quote1;
+char * signal_quote2;
+char * mod_name_shift;
+char * mod_name_control;
+char * mod_name_alt;
+char * mod_separator;
+char * accel_seperator;
+uint bitfield0;
+// uint latin1_to_char // bits 0 .. 1
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkAccelLabel {
+_GtkLabel label;
+uint gtk_reserved;
+uint accel_padding;
+_GtkWidget * accel_widget;
+_GClosure * accel_closure;
+_GtkAccelGroup * accel_group;
+char * accel_string;
+ushort accel_string_width;
+}
+struct _GtkLabelClass {
+_GtkMiscClass parent_class;
+_BCD_func__17291 move_cursor;
+_BCD_func__17292 copy_clipboard;
+_BCD_func__17293 populate_popup;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkLabel {
+_GtkMisc misc;
+char * label;
+uint bitfield0;
+// uint jtype // bits 0 .. 2
+// uint wrap // bits 2 .. 3
+// uint use_underline // bits 3 .. 4
+// uint use_markup // bits 4 .. 5
+// uint ellipsize // bits 5 .. 8
+// uint single_line_mode // bits 8 .. 9
+// uint have_transform // bits 9 .. 10
+// uint in_click // bits 10 .. 11
+// uint wrap_mode // bits 11 .. 14
+// uint pattern_set // bits 14 .. 15
+uint mnemonic_keyval;
+char * text;
+void * attrs;
+void * effective_attrs;
+void * layout;
+_GtkWidget * mnemonic_widget;
+_GtkWindow * mnemonic_window;
+void * select_info;
+}
+struct _GtkMenuClass {
+_GtkMenuShellClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkMenu {
+_GtkMenuShell menu_shell;
+_GtkWidget * parent_menu_item;
+_GtkWidget * old_active_menu_item;
+_GtkAccelGroup * accel_group;
+char * accel_path;
+_BCD_func__12553 position_func;
+void * position_func_data;
+uint toggle_size;
+_GtkWidget * toplevel;
+_GtkWidget * tearoff_window;
+_GtkWidget * tearoff_hbox;
+_GtkWidget * tearoff_scrollbar;
+_GtkAdjustment * tearoff_adjustment;
+_GdkDrawable * view_window;
+_GdkDrawable * bin_window;
+int scroll_offset;
+int saved_scroll_offset;
+int scroll_step;
+uint timeout_id;
+void * navigation_region;
+uint navigation_timeout;
+uint bitfield0;
+// uint needs_destruction_ref_count // bits 0 .. 1
+// uint torn_off // bits 1 .. 2
+// uint tearoff_active // bits 2 .. 3
+// uint scroll_fast // bits 3 .. 4
+// uint upper_arrow_visible // bits 4 .. 5
+// uint lower_arrow_visible // bits 5 .. 6
+// uint upper_arrow_prelight // bits 6 .. 7
+// uint lower_arrow_prelight // bits 7 .. 8
+}
+struct _GtkMenuShellClass {
+_GtkContainerClass parent_class;
+uint bitfield0;
+// uint submenu_placement // bits 0 .. 1
+_BCD_func__17298 deactivate;
+_BCD_func__17298 selection_done;
+_BCD_func__17299 move_current;
+_BCD_func__17300 activate_current;
+_BCD_func__17298 cancel;
+_BCD_func__17301 select_item;
+_BCD_func__17302 insert;
+_BCD_func__17303 get_popup_delay;
+_BCD_func__17304 move_selected;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+}
+struct _GtkMenuShell {
+_GtkContainer container;
+_GList * children;
+_GtkWidget * active_menu_item;
+_GtkWidget * parent_menu_shell;
+uint button;
+uint activate_time;
+uint bitfield0;
+// uint active // bits 0 .. 1
+// uint have_grab // bits 1 .. 2
+// uint have_xgrab // bits 2 .. 3
+// uint ignore_leave // bits 3 .. 4
+// uint menu_flag // bits 4 .. 5
+// uint ignore_enter // bits 5 .. 6
+}
+struct _GtkMiscClass {
+_GtkWidgetClass parent_class;
+}
+struct _GtkMisc {
+_GtkWidget widget;
+float xalign;
+float yalign;
+ushort xpad;
+ushort ypad;
+}
+struct _GtkAboutDialogClass {
+_GtkDialogClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkAboutDialog {
+_GtkDialog parent_instance;
+void * private_data;
+}
+struct _GtkDialogClass {
+_GtkWindowClass parent_class;
+_BCD_func__17311 response;
+_BCD_func__17312 close;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkDialog {
+_GtkWindow window;
+_GtkWidget * vbox;
+_GtkWidget * action_area;
+_GtkWidget * separator;
+}
+struct _GtkWindowGroupClass {
+_GObjectClass parent_class;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkWindowGroup {
+_GObject parent_instance;
+_GSList * grabs;
+}
+struct _GtkWindowClass {
+_GtkBinClass parent_class;
+_BCD_func__17317 set_focus;
+_BCD_func__17318 frame_event;
+_BCD_func__17319 activate_focus;
+_BCD_func__17319 activate_default;
+_BCD_func__17320 move_focus;
+_BCD_func__17319 keys_changed;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkBinClass {
+_GtkContainerClass parent_class;
+}
+struct _GtkBin {
+_GtkContainer container;
+_GtkWidget * child;
+}
+struct _GtkContainerClass {
+_GtkWidgetClass parent_class;
+_BCD_func__17324 add;
+_BCD_func__17324 remove;
+_BCD_func__17325 check_resize;
+_BCD_func__17326 forall;
+_BCD_func__17324 set_focus_child;
+_BCD_func__17327 child_type;
+_BCD_func__17328 composite_name;
+_BCD_func__17329 set_child_property;
+_BCD_func__17330 get_child_property;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkContainer {
+_GtkWidget widget;
+_GtkWidget * focus_child;
+uint bitfield0;
+// uint border_width // bits 0 .. 16
+// uint need_resize // bits 16 .. 17
+// uint resize_mode // bits 17 .. 19
+// uint reallocate_redraws // bits 19 .. 20
+// uint has_focus_chain // bits 20 .. 21
+}
+struct _GtkWindow {
+_GtkBin bin;
+char * title;
+char * wmclass_name;
+char * wmclass_class;
+char * wm_role;
+_GtkWidget * focus_widget;
+_GtkWidget * default_widget;
+_GtkWindow * transient_parent;
+void * geometry_info;
+_GdkDrawable * frame;
+_GtkWindowGroup * group;
+ushort configure_request_count;
+uint bitfield0;
+// uint allow_shrink // bits 0 .. 1
+// uint allow_grow // bits 1 .. 2
+// uint configure_notify_received // bits 2 .. 3
+// uint need_default_position // bits 3 .. 4
+// uint need_default_size // bits 4 .. 5
+// uint position // bits 5 .. 8
+// uint type // bits 8 .. 12
+// uint has_user_ref_count // bits 12 .. 13
+// uint has_focus // bits 13 .. 14
+// uint modal // bits 14 .. 15
+// uint destroy_with_parent // bits 15 .. 16
+// uint has_frame // bits 16 .. 17
+// uint iconify_initially // bits 17 .. 18
+// uint stick_initially // bits 18 .. 19
+// uint maximize_initially // bits 19 .. 20
+// uint decorated // bits 20 .. 21
+// uint type_hint // bits 21 .. 24
+// uint gravity // bits 24 .. 29
+// uint is_active // bits 29 .. 30
+// uint has_toplevel_focus // bits 30 .. 31
+uint frame_left;
+uint frame_top;
+uint frame_right;
+uint frame_bottom;
+uint keys_changed_handler;
+int mnemonic_modifier;
+_GdkScreen * screen;
+}
+struct _GtkWidgetShapeInfo {
+short offset_x;
+short offset_y;
+_GdkDrawable * shape_mask;
+}
+struct _GtkWidgetAuxInfo {
+int x;
+int y;
+int width;
+int height;
+uint bitfield0;
+// uint x_set // bits 0 .. 1
+// uint y_set // bits 1 .. 2
+}
+struct _GtkWidgetClass {
+_GtkObjectClass parent_class;
+uint activate_signal;
+uint set_scroll_adjustments_signal;
+_BCD_func__17336 dispatch_child_properties_changed;
+_BCD_func__17337 show;
+_BCD_func__17337 show_all;
+_BCD_func__17337 hide;
+_BCD_func__17337 hide_all;
+_BCD_func__17337 map;
+_BCD_func__17337 unmap;
+_BCD_func__17337 realize;
+_BCD_func__17337 unrealize;
+_BCD_func__17338 size_request;
+_BCD_func__17339 size_allocate;
+_BCD_func__17340 state_changed;
+_BCD_func__17341 parent_set;
+_BCD_func__17341 hierarchy_changed;
+_BCD_func__17342 style_set;
+_BCD_func__17343 direction_changed;
+_BCD_func__17344 grab_notify;
+_BCD_func__17345 child_notify;
+_BCD_func__17346 mnemonic_activate;
+_BCD_func__17337 grab_focus;
+_BCD_func__17347 focus;
+_BCD_func__17348 event;
+_BCD_func__17349 button_press_event;
+_BCD_func__17349 button_release_event;
+_BCD_func__17350 scroll_event;
+_BCD_func__17351 motion_notify_event;
+_BCD_func__17352 delete_event;
+_BCD_func__17352 destroy_event;
+_BCD_func__17353 expose_event;
+_BCD_func__17354 key_press_event;
+_BCD_func__17354 key_release_event;
+_BCD_func__17355 enter_notify_event;
+_BCD_func__17355 leave_notify_event;
+_BCD_func__17356 configure_event;
+_BCD_func__17357 focus_in_event;
+_BCD_func__17357 focus_out_event;
+_BCD_func__17352 map_event;
+_BCD_func__17352 unmap_event;
+_BCD_func__17358 property_notify_event;
+_BCD_func__17359 selection_clear_event;
+_BCD_func__17359 selection_request_event;
+_BCD_func__17359 selection_notify_event;
+_BCD_func__17360 proximity_in_event;
+_BCD_func__17360 proximity_out_event;
+_BCD_func__17361 visibility_notify_event;
+_BCD_func__17362 client_event;
+_BCD_func__17352 no_expose_event;
+_BCD_func__17363 window_state_event;
+_BCD_func__17364 selection_get;
+_BCD_func__17365 selection_received;
+_BCD_func__17366 drag_begin;
+_BCD_func__17366 drag_end;
+_BCD_func__17367 drag_data_get;
+_BCD_func__17366 drag_data_delete;
+_BCD_func__17368 drag_leave;
+_BCD_func__17369 drag_motion;
+_BCD_func__17369 drag_drop;
+_BCD_func__17370 drag_data_received;
+_BCD_func__17371 popup_menu;
+_BCD_func__17372 show_help;
+_BCD_func__17373 get_accessible;
+_BCD_func__17374 screen_changed;
+_BCD_func__17375 can_activate_accel;
+_BCD_func__17376 grab_broken_event;
+_BCD_func__17337 composited_changed;
+_BCD_func__17377 query_tooltip;
+_BCD_func__12122 _gtk_reserved5;
+_BCD_func__12122 _gtk_reserved6;
+_BCD_func__12122 _gtk_reserved7;
+}
+struct _GtkSelectionData {
+void * selection;
+void * target;
+void * type;
+int format;
+char * data;
+int length;
+_GdkDisplay * display;
+}
+struct _GtkRequisition {
+int width;
+int height;
+}
+struct _GtkSettingsValue {
+char * origin;
+_GValue value;
+}
+struct _GtkSettingsClass {
+_GObjectClass parent_class;
+}
+struct _GtkRcStyleClass {
+_GObjectClass parent_class;
+_BCD_func__17411 create_rc_style;
+_BCD_func__17412 parse;
+_BCD_func__17413 merge;
+_BCD_func__17414 create_style;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkIconFactory {
+_GObject parent_instance;
+void * icons;
+}
+struct _GtkWidget {
+_GtkObject object;
+ushort private_flags;
+char state;
+char saved_state;
+char * name;
+_GtkStyle * style;
+_GtkRequisition requisition;
+_GdkRectangle allocation;
+_GdkDrawable * window;
+_GtkWidget * parent;
+}
+struct _GtkSettings {
+_GObject parent_instance;
+void * queued_settings;
+void * property_values;
+void * rc_context;
+_GdkScreen * screen;
+}
+struct _GtkRcProperty {
+uint type_name;
+uint property_name;
+char * origin;
+_GValue value;
+}
+struct _GtkRcStyle {
+_GObject parent_instance;
+char * name;
+char * [5] bg_pixmap_name;
+void * font_desc;
+int [5] color_flags;
+_GdkColor [5] fg;
+_GdkColor [5] bg;
+_GdkColor [5] text;
+_GdkColor [5] base;
+int xthickness;
+int ythickness;
+_GArray * rc_properties;
+_GSList * rc_style_lists;
+_GSList * icon_factories;
+uint bitfield0;
+// uint engine_specified // bits 0 .. 1
+}
+struct _GtkStyleClass {
+_GObjectClass parent_class;
+_BCD_func__17421 realize;
+_BCD_func__17421 unrealize;
+_BCD_func__17422 copy;
+_BCD_func__17423 clone;
+_BCD_func__17424 init_from_rc;
+_BCD_func__17425 set_background;
+_BCD_func__17426 render_icon;
+_BCD_func__17427 draw_hline;
+_BCD_func__17427 draw_vline;
+_BCD_func__17428 draw_shadow;
+_BCD_func__17429 draw_polygon;
+_BCD_func__17430 draw_arrow;
+_BCD_func__17428 draw_diamond;
+_BCD_func__17431 draw_string;
+_BCD_func__17428 draw_box;
+_BCD_func__17428 draw_flat_box;
+_BCD_func__17428 draw_check;
+_BCD_func__17428 draw_option;
+_BCD_func__17428 draw_tab;
+_BCD_func__17432 draw_shadow_gap;
+_BCD_func__17432 draw_box_gap;
+_BCD_func__17433 draw_extension;
+_BCD_func__17434 draw_focus;
+_BCD_func__17435 draw_slider;
+_BCD_func__17435 draw_handle;
+_BCD_func__17436 draw_expander;
+_BCD_func__17437 draw_layout;
+_BCD_func__17438 draw_resize_grip;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+_BCD_func__12122 _gtk_reserved5;
+_BCD_func__12122 _gtk_reserved6;
+_BCD_func__12122 _gtk_reserved7;
+_BCD_func__12122 _gtk_reserved8;
+_BCD_func__12122 _gtk_reserved9;
+_BCD_func__12122 _gtk_reserved10;
+_BCD_func__12122 _gtk_reserved11;
+_BCD_func__12122 _gtk_reserved12;
+}
+struct _GtkStyle {
+_GObject parent_instance;
+_GdkColor [5] fg;
+_GdkColor [5] bg;
+_GdkColor [5] light;
+_GdkColor [5] dark;
+_GdkColor [5] mid;
+_GdkColor [5] text;
+_GdkColor [5] base;
+_GdkColor [5] text_aa;
+_GdkColor black;
+_GdkColor white;
+void * font_desc;
+int xthickness;
+int ythickness;
+_GdkGC * [5] fg_gc;
+_GdkGC * [5] bg_gc;
+_GdkGC * [5] light_gc;
+_GdkGC * [5] dark_gc;
+_GdkGC * [5] mid_gc;
+_GdkGC * [5] text_gc;
+_GdkGC * [5] base_gc;
+_GdkGC * [5] text_aa_gc;
+_GdkGC * black_gc;
+_GdkGC * white_gc;
+_GdkDrawable * [5] bg_pixmap;
+int attach_count;
+int depth;
+_GdkColormap * colormap;
+_GdkFont * private_font;
+void * private_font_desc;
+_GtkRcStyle * rc_style;
+_GSList * styles;
+_GArray * property_cache;
+_GSList * icon_factories;
+}
+struct _GtkBorder {
+int left;
+int right;
+int top;
+int bottom;
+}
+struct _GtkAdjustmentClass {
+_GtkObjectClass parent_class;
+_BCD_func__17442 changed;
+_BCD_func__17442 value_changed;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkAdjustment {
+_GtkObject parent_instance;
+double lower;
+double upper;
+double value;
+double step_increment;
+double page_increment;
+double page_size;
+}
+struct _GtkObjectClass {
+_GObjectClass parent_class;
+_BCD_func__17445 set_arg;
+_BCD_func__17445 get_arg;
+_BCD_func__17446 destroy;
+}
+struct _GtkTypeInfo {
+char * type_name;
+uint object_size;
+uint class_size;
+_BCD_func__13158 class_init_func;
+_BCD_func__13169 object_init_func;
+void * reserved_1;
+void * reserved_2;
+_BCD_func__13158 base_class_init_func;
+}
+struct _GtkObject {
+_GObject parent_instance;
+uint flags;
+}
+struct N7_GtkArg5__1925__193E {
+_BCD_func__12122 f;
+void * d;
+}
+union N7_GtkArg5__192E {
+char char_data;
+char uchar_data;
+int bool_data;
+int int_data;
+uint uint_data;
+int long_data;
+uint ulong_data;
+float float_data;
+double double_data;
+char * string_data;
+_GtkObject * object_data;
+void * pointer_data;
+N7_GtkArg5__1925__193E signal_data;
+}
+struct _GtkArg {
+uint type;
+char * name;
+N7_GtkArg5__192E d;
+}
+struct _GtkAccelGroupEntry {
+_GtkAccelKey key;
+_GClosure * closure;
+uint accel_path_quark;
+}
+struct _GtkAccelKey {
+uint accel_key;
+int accel_mods;
+uint bitfield0;
+// uint accel_flags // bits 0 .. 16
+}
+struct _GtkAccelGroupClass {
+_GObjectClass parent_class;
+_BCD_func__17462 accel_changed;
+_BCD_func__12122 _gtk_reserved1;
+_BCD_func__12122 _gtk_reserved2;
+_BCD_func__12122 _gtk_reserved3;
+_BCD_func__12122 _gtk_reserved4;
+}
+struct _GtkAccelGroup {
+_GObject parent;
+uint lock_count;
+int modifier_mask;
+_GSList * acceleratables;
+uint n_accels;
+_GtkAccelGroupEntry * priv_accels;
+}
+version(DYNLINK){
+alias extern (C) _GtkWidget * function()TGTKgtk_vseparator_new; extern(D) TGTKgtk_vseparator_new gtk_vseparator_new;
+alias extern (C) uint function()TGTKgtk_vseparator_get_type; extern(D) TGTKgtk_vseparator_get_type gtk_vseparator_get_type;
+alias extern (C) _GtkWidget * function(double, double, double)TGTKgtk_vscale_new_with_range; extern(D) TGTKgtk_vscale_new_with_range gtk_vscale_new_with_range;
+alias extern (C) _GtkWidget * function(aGtkAdjustment *)TGTKgtk_vscale_new; extern(D) TGTKgtk_vscale_new gtk_vscale_new;
+alias extern (C) uint function()TGTKgtk_vscale_get_type; extern(D) TGTKgtk_vscale_get_type gtk_vscale_get_type;
+alias extern (C) _GtkWidget * function()TGTKgtk_vruler_new; extern(D) TGTKgtk_vruler_new gtk_vruler_new;
+alias extern (C) uint function()TGTKgtk_vruler_get_type; extern(D) TGTKgtk_vruler_get_type gtk_vruler_get_type;
+alias extern (C) _GtkWidget * function()TGTKgtk_vpaned_new; extern(D) TGTKgtk_vpaned_new gtk_vpaned_new;
+alias extern (C) uint function()TGTKgtk_vpaned_get_type; extern(D) TGTKgtk_vpaned_get_type gtk_vpaned_get_type;
+alias extern (C) _GtkWidget * function()TGTKgtk_volume_button_new; extern(D) TGTKgtk_volume_button_new gtk_volume_button_new;
+alias extern (C) uint function()TGTKgtk_volume_button_get_type; extern(D) TGTKgtk_volume_button_get_type gtk_volume_button_get_type;
+alias extern (C) void function(int)TGTKgtk_vbutton_box_set_layout_default; extern(D) TGTKgtk_vbutton_box_set_layout_default gtk_vbutton_box_set_layout_default;
+alias extern (C) int function()TGTKgtk_vbutton_box_get_layout_default; extern(D) TGTKgtk_vbutton_box_get_layout_default gtk_vbutton_box_get_layout_default;
+alias extern (C) void function(int)TGTKgtk_vbutton_box_set_spacing_default; extern(D) TGTKgtk_vbutton_box_set_spacing_default gtk_vbutton_box_set_spacing_default;
+alias extern (C) int function()TGTKgtk_vbutton_box_get_spacing_default; extern(D) TGTKgtk_vbutton_box_get_spacing_default gtk_vbutton_box_get_spacing_default;
+alias extern (C) _GtkWidget * function()TGTKgtk_vbutton_box_new; extern(D) TGTKgtk_vbutton_box_new gtk_vbutton_box_new;
+alias extern (C) uint function()TGTKgtk_vbutton_box_get_type; extern(D) TGTKgtk_vbutton_box_get_type gtk_vbutton_box_get_type;
+alias extern (C) uint function(aGtkUIManager *)TGTKgtk_ui_manager_new_merge_id; extern(D) TGTKgtk_ui_manager_new_merge_id gtk_ui_manager_new_merge_id;
+alias extern (C) void function(aGtkUIManager *)TGTKgtk_ui_manager_ensure_update; extern(D) TGTKgtk_ui_manager_ensure_update gtk_ui_manager_ensure_update;
+alias extern (C) char * function(aGtkUIManager *)TGTKgtk_ui_manager_get_ui; extern(D) TGTKgtk_ui_manager_get_ui gtk_ui_manager_get_ui;
+alias extern (C) void function(aGtkUIManager *, uint)TGTKgtk_ui_manager_remove_ui; extern(D) TGTKgtk_ui_manager_remove_ui gtk_ui_manager_remove_ui;
+alias extern (C) void function(aGtkUIManager *, uint, char *, char *, char *, int, int)TGTKgtk_ui_manager_add_ui; extern(D) TGTKgtk_ui_manager_add_ui gtk_ui_manager_add_ui;
+alias extern (C) uint function(aGtkUIManager *, char *, _GError * *)TGTKgtk_ui_manager_add_ui_from_file; extern(D) TGTKgtk_ui_manager_add_ui_from_file gtk_ui_manager_add_ui_from_file;
+alias extern (C) uint function(aGtkUIManager *, char *, int, _GError * *)TGTKgtk_ui_manager_add_ui_from_string; extern(D) TGTKgtk_ui_manager_add_ui_from_string gtk_ui_manager_add_ui_from_string;
+alias extern (C) _GtkAction * function(aGtkUIManager *, char *)TGTKgtk_ui_manager_get_action; extern(D) TGTKgtk_ui_manager_get_action gtk_ui_manager_get_action;
+alias extern (C) _GSList * function(aGtkUIManager *, int)TGTKgtk_ui_manager_get_toplevels; extern(D) TGTKgtk_ui_manager_get_toplevels gtk_ui_manager_get_toplevels;
+alias extern (C) _GtkWidget * function(aGtkUIManager *, char *)TGTKgtk_ui_manager_get_widget; extern(D) TGTKgtk_ui_manager_get_widget gtk_ui_manager_get_widget;
+alias extern (C) _GtkAccelGroup * function(aGtkUIManager *)TGTKgtk_ui_manager_get_accel_group; extern(D) TGTKgtk_ui_manager_get_accel_group gtk_ui_manager_get_accel_group;
+alias extern (C) _GList * function(aGtkUIManager *)TGTKgtk_ui_manager_get_action_groups; extern(D) TGTKgtk_ui_manager_get_action_groups gtk_ui_manager_get_action_groups;
+alias extern (C) void function(aGtkUIManager *, aGtkActionGroup *)TGTKgtk_ui_manager_remove_action_group; extern(D) TGTKgtk_ui_manager_remove_action_group gtk_ui_manager_remove_action_group;
+alias extern (C) void function(aGtkUIManager *, aGtkActionGroup *, int)TGTKgtk_ui_manager_insert_action_group; extern(D) TGTKgtk_ui_manager_insert_action_group gtk_ui_manager_insert_action_group;
+alias extern (C) int function(aGtkUIManager *)TGTKgtk_ui_manager_get_add_tearoffs; extern(D) TGTKgtk_ui_manager_get_add_tearoffs gtk_ui_manager_get_add_tearoffs;
+alias extern (C) void function(aGtkUIManager *, int)TGTKgtk_ui_manager_set_add_tearoffs; extern(D) TGTKgtk_ui_manager_set_add_tearoffs gtk_ui_manager_set_add_tearoffs;
+alias extern (C) _GtkUIManager * function()TGTKgtk_ui_manager_new; extern(D) TGTKgtk_ui_manager_new gtk_ui_manager_new;
+alias extern (C) uint function()TGTKgtk_ui_manager_get_type; extern(D) TGTKgtk_ui_manager_get_type gtk_ui_manager_get_type;
+alias extern (C) void function(aGtkTreeStore *, aGtkTreeIter *, aGtkTreeIter *)TGTKgtk_tree_store_move_after; extern(D) TGTKgtk_tree_store_move_after gtk_tree_store_move_after;
+alias extern (C) void function(aGtkTreeStore *, aGtkTreeIter *, aGtkTreeIter *)TGTKgtk_tree_store_move_before; extern(D) TGTKgtk_tree_store_move_before gtk_tree_store_move_before;
+alias extern (C) void function(aGtkTreeStore *, aGtkTreeIter *, aGtkTreeIter *)TGTKgtk_tree_store_swap; extern(D) TGTKgtk_tree_store_swap gtk_tree_store_swap;
+alias extern (C) void function(aGtkTreeStore *, aGtkTreeIter *, int *)TGTKgtk_tree_store_reorder; extern(D) TGTKgtk_tree_store_reorder gtk_tree_store_reorder;
+alias extern (C) int function(aGtkTreeStore *, aGtkTreeIter *)TGTKgtk_tree_store_iter_is_valid; extern(D) TGTKgtk_tree_store_iter_is_valid gtk_tree_store_iter_is_valid;
+alias extern (C) void function(aGtkTreeStore *)TGTKgtk_tree_store_clear; extern(D) TGTKgtk_tree_store_clear gtk_tree_store_clear;
+alias extern (C) int function(aGtkTreeStore *, aGtkTreeIter *)TGTKgtk_tree_store_iter_depth; extern(D) TGTKgtk_tree_store_iter_depth gtk_tree_store_iter_depth;
+alias extern (C) int function(aGtkTreeStore *, aGtkTreeIter *, aGtkTreeIter *)TGTKgtk_tree_store_is_ancestor; extern(D) TGTKgtk_tree_store_is_ancestor gtk_tree_store_is_ancestor;
+alias extern (C) void function(aGtkTreeStore *, aGtkTreeIter *, aGtkTreeIter *)TGTKgtk_tree_store_append; extern(D) TGTKgtk_tree_store_append gtk_tree_store_append;
+alias extern (C) void function(aGtkTreeStore *, aGtkTreeIter *, aGtkTreeIter *)TGTKgtk_tree_store_prepend; extern(D) TGTKgtk_tree_store_prepend gtk_tree_store_prepend;
+alias extern (C) void function(aGtkTreeStore *, aGtkTreeIter *, aGtkTreeIter *, int, int *, _GValue *, int)TGTKgtk_tree_store_insert_with_valuesv; extern(D) TGTKgtk_tree_store_insert_with_valuesv gtk_tree_store_insert_with_valuesv;
+alias extern (C) void function(aGtkTreeStore *, aGtkTreeIter *, aGtkTreeIter *, int, ...)TGTKgtk_tree_store_insert_with_values; extern(D) TGTKgtk_tree_store_insert_with_values gtk_tree_store_insert_with_values;
+alias extern (C) void function(aGtkTreeStore *, aGtkTreeIter *, aGtkTreeIter *, aGtkTreeIter *)TGTKgtk_tree_store_insert_after; extern(D) TGTKgtk_tree_store_insert_after gtk_tree_store_insert_after;
+alias extern (C) void function(aGtkTreeStore *, aGtkTreeIter *, aGtkTreeIter *, aGtkTreeIter *)TGTKgtk_tree_store_insert_before; extern(D) TGTKgtk_tree_store_insert_before gtk_tree_store_insert_before;
+alias extern (C) void function(aGtkTreeStore *, aGtkTreeIter *, aGtkTreeIter *, int)TGTKgtk_tree_store_insert; extern(D) TGTKgtk_tree_store_insert gtk_tree_store_insert;
+alias extern (C) int function(aGtkTreeStore *, aGtkTreeIter *)TGTKgtk_tree_store_remove; extern(D) TGTKgtk_tree_store_remove gtk_tree_store_remove;
+alias extern (C) void function(aGtkTreeStore *, aGtkTreeIter *, char *)TGTKgtk_tree_store_set_valist; extern(D) TGTKgtk_tree_store_set_valist gtk_tree_store_set_valist;
+alias extern (C) void function(aGtkTreeStore *, aGtkTreeIter *, int *, _GValue *, int)TGTKgtk_tree_store_set_valuesv; extern(D) TGTKgtk_tree_store_set_valuesv gtk_tree_store_set_valuesv;
+alias extern (C) void function(aGtkTreeStore *, aGtkTreeIter *, ...)TGTKgtk_tree_store_set; extern(D) TGTKgtk_tree_store_set gtk_tree_store_set;
+alias extern (C) void function(aGtkTreeStore *, aGtkTreeIter *, int, _GValue *)TGTKgtk_tree_store_set_value; extern(D) TGTKgtk_tree_store_set_value gtk_tree_store_set_value;
+alias extern (C) void function(aGtkTreeStore *, int, uint *)TGTKgtk_tree_store_set_column_types; extern(D) TGTKgtk_tree_store_set_column_types gtk_tree_store_set_column_types;
+alias extern (C) _GtkTreeStore * function(int, uint *)TGTKgtk_tree_store_newv; extern(D) TGTKgtk_tree_store_newv gtk_tree_store_newv;
+alias extern (C) _GtkTreeStore * function(int, ...)TGTKgtk_tree_store_new; extern(D) TGTKgtk_tree_store_new gtk_tree_store_new;
+alias extern (C) uint function()TGTKgtk_tree_store_get_type; extern(D) TGTKgtk_tree_store_get_type gtk_tree_store_get_type;
+alias extern (C) void function(aGtkTreeSelection *, void *, void *)TGTKgtk_tree_selection_unselect_range; extern(D) TGTKgtk_tree_selection_unselect_range gtk_tree_selection_unselect_range;
+alias extern (C) void function(aGtkTreeSelection *, void *, void *)TGTKgtk_tree_selection_select_range; extern(D) TGTKgtk_tree_selection_select_range gtk_tree_selection_select_range;
+alias extern (C) void function(aGtkTreeSelection *)TGTKgtk_tree_selection_unselect_all; extern(D) TGTKgtk_tree_selection_unselect_all gtk_tree_selection_unselect_all;
+alias extern (C) void function(aGtkTreeSelection *)TGTKgtk_tree_selection_select_all; extern(D) TGTKgtk_tree_selection_select_all gtk_tree_selection_select_all;
+alias extern (C) int function(aGtkTreeSelection *, aGtkTreeIter *)TGTKgtk_tree_selection_iter_is_selected; extern(D) TGTKgtk_tree_selection_iter_is_selected gtk_tree_selection_iter_is_selected;
+alias extern (C) int function(aGtkTreeSelection *, void *)TGTKgtk_tree_selection_path_is_selected; extern(D) TGTKgtk_tree_selection_path_is_selected gtk_tree_selection_path_is_selected;
+alias extern (C) void function(aGtkTreeSelection *, aGtkTreeIter *)TGTKgtk_tree_selection_unselect_iter; extern(D) TGTKgtk_tree_selection_unselect_iter gtk_tree_selection_unselect_iter;
+alias extern (C) void function(aGtkTreeSelection *, aGtkTreeIter *)TGTKgtk_tree_selection_select_iter; extern(D) TGTKgtk_tree_selection_select_iter gtk_tree_selection_select_iter;
+alias extern (C) void function(aGtkTreeSelection *, void *)TGTKgtk_tree_selection_unselect_path; extern(D) TGTKgtk_tree_selection_unselect_path gtk_tree_selection_unselect_path;
+alias extern (C) void function(aGtkTreeSelection *, void *)TGTKgtk_tree_selection_select_path; extern(D) TGTKgtk_tree_selection_select_path gtk_tree_selection_select_path;
+alias extern (C) void function(aGtkTreeSelection *, _BCD_func__9093, void *)TGTKgtk_tree_selection_selected_foreach; extern(D) TGTKgtk_tree_selection_selected_foreach gtk_tree_selection_selected_foreach;
+alias extern (C) int function(aGtkTreeSelection *)TGTKgtk_tree_selection_count_selected_rows; extern(D) TGTKgtk_tree_selection_count_selected_rows gtk_tree_selection_count_selected_rows;
+alias extern (C) _GList * function(aGtkTreeSelection *, void * *)TGTKgtk_tree_selection_get_selected_rows; extern(D) TGTKgtk_tree_selection_get_selected_rows gtk_tree_selection_get_selected_rows;
+alias extern (C) int function(aGtkTreeSelection *, void * *, aGtkTreeIter *)TGTKgtk_tree_selection_get_selected; extern(D) TGTKgtk_tree_selection_get_selected gtk_tree_selection_get_selected;
+alias extern (C) _GtkTreeView * function(aGtkTreeSelection *)TGTKgtk_tree_selection_get_tree_view; extern(D) TGTKgtk_tree_selection_get_tree_view gtk_tree_selection_get_tree_view;
+alias extern (C) void * function(aGtkTreeSelection *)TGTKgtk_tree_selection_get_user_data; extern(D) TGTKgtk_tree_selection_get_user_data gtk_tree_selection_get_user_data;
+alias extern (C) void function(aGtkTreeSelection *, _BCD_func__9094, void *, _BCD_func__13158)TGTKgtk_tree_selection_set_select_function; extern(D) TGTKgtk_tree_selection_set_select_function gtk_tree_selection_set_select_function;
+alias extern (C) int function(aGtkTreeSelection *)TGTKgtk_tree_selection_get_mode; extern(D) TGTKgtk_tree_selection_get_mode gtk_tree_selection_get_mode;
+alias extern (C) void function(aGtkTreeSelection *, int)TGTKgtk_tree_selection_set_mode; extern(D) TGTKgtk_tree_selection_set_mode gtk_tree_selection_set_mode;
+alias extern (C) uint function()TGTKgtk_tree_selection_get_type; extern(D) TGTKgtk_tree_selection_get_type gtk_tree_selection_get_type;
+alias extern (C) int function(aGtkTreeModelSort *, aGtkTreeIter *)TGTKgtk_tree_model_sort_iter_is_valid; extern(D) TGTKgtk_tree_model_sort_iter_is_valid gtk_tree_model_sort_iter_is_valid;
+alias extern (C) void function(aGtkTreeModelSort *)TGTKgtk_tree_model_sort_clear_cache; extern(D) TGTKgtk_tree_model_sort_clear_cache gtk_tree_model_sort_clear_cache;
+alias extern (C) void function(aGtkTreeModelSort *)TGTKgtk_tree_model_sort_reset_default_sort_func; extern(D) TGTKgtk_tree_model_sort_reset_default_sort_func gtk_tree_model_sort_reset_default_sort_func;
+alias extern (C) void function(aGtkTreeModelSort *, aGtkTreeIter *, aGtkTreeIter *)TGTKgtk_tree_model_sort_convert_iter_to_child_iter; extern(D) TGTKgtk_tree_model_sort_convert_iter_to_child_iter gtk_tree_model_sort_convert_iter_to_child_iter;
+alias extern (C) void * function(aGtkTreeModelSort *, void *)TGTKgtk_tree_model_sort_convert_path_to_child_path; extern(D) TGTKgtk_tree_model_sort_convert_path_to_child_path gtk_tree_model_sort_convert_path_to_child_path;
+alias extern (C) void function(aGtkTreeModelSort *, aGtkTreeIter *, aGtkTreeIter *)TGTKgtk_tree_model_sort_convert_child_iter_to_iter; extern(D) TGTKgtk_tree_model_sort_convert_child_iter_to_iter gtk_tree_model_sort_convert_child_iter_to_iter;
+alias extern (C) void * function(aGtkTreeModelSort *, void *)TGTKgtk_tree_model_sort_convert_child_path_to_path; extern(D) TGTKgtk_tree_model_sort_convert_child_path_to_path gtk_tree_model_sort_convert_child_path_to_path;
+alias extern (C) void * function(aGtkTreeModelSort *)TGTKgtk_tree_model_sort_get_model; extern(D) TGTKgtk_tree_model_sort_get_model gtk_tree_model_sort_get_model;
+alias extern (C) void * function(void *)TGTKgtk_tree_model_sort_new_with_model; extern(D) TGTKgtk_tree_model_sort_new_with_model gtk_tree_model_sort_new_with_model;
+alias extern (C) uint function()TGTKgtk_tree_model_sort_get_type; extern(D) TGTKgtk_tree_model_sort_get_type gtk_tree_model_sort_get_type;
+alias extern (C) int function(aGtkSelectionData *, void * *, void * *)TGTKgtk_tree_get_row_drag_data; extern(D) TGTKgtk_tree_get_row_drag_data gtk_tree_get_row_drag_data;
+alias extern (C) int function(aGtkSelectionData *, void *, void *)TGTKgtk_tree_set_row_drag_data; extern(D) TGTKgtk_tree_set_row_drag_data gtk_tree_set_row_drag_data;
+alias extern (C) int function(void *, void *, aGtkSelectionData *)TGTKgtk_tree_drag_dest_row_drop_possible; extern(D) TGTKgtk_tree_drag_dest_row_drop_possible gtk_tree_drag_dest_row_drop_possible;
+alias extern (C) int function(void *, void *, aGtkSelectionData *)TGTKgtk_tree_drag_dest_drag_data_received; extern(D) TGTKgtk_tree_drag_dest_drag_data_received gtk_tree_drag_dest_drag_data_received;
+alias extern (C) uint function()TGTKgtk_tree_drag_dest_get_type; extern(D) TGTKgtk_tree_drag_dest_get_type gtk_tree_drag_dest_get_type;
+alias extern (C) int function(void *, void *, aGtkSelectionData *)TGTKgtk_tree_drag_source_drag_data_get; extern(D) TGTKgtk_tree_drag_source_drag_data_get gtk_tree_drag_source_drag_data_get;
+alias extern (C) int function(void *, void *)TGTKgtk_tree_drag_source_drag_data_delete; extern(D) TGTKgtk_tree_drag_source_drag_data_delete gtk_tree_drag_source_drag_data_delete;
+alias extern (C) int function(void *, void *)TGTKgtk_tree_drag_source_row_draggable; extern(D) TGTKgtk_tree_drag_source_row_draggable gtk_tree_drag_source_row_draggable;
+alias extern (C) uint function()TGTKgtk_tree_drag_source_get_type; extern(D) TGTKgtk_tree_drag_source_get_type gtk_tree_drag_source_get_type;
+alias extern (C) void function(aGtkToolbar *, aGtkWidget *, char *, char *, int)TGTKgtk_toolbar_insert_widget; extern(D) TGTKgtk_toolbar_insert_widget gtk_toolbar_insert_widget;
+alias extern (C) void function(aGtkToolbar *, aGtkWidget *, char *, char *)TGTKgtk_toolbar_prepend_widget; extern(D) TGTKgtk_toolbar_prepend_widget gtk_toolbar_prepend_widget;
+alias extern (C) void function(aGtkToolbar *, aGtkWidget *, char *, char *)TGTKgtk_toolbar_append_widget; extern(D) TGTKgtk_toolbar_append_widget gtk_toolbar_append_widget;
+alias extern (C) _GtkWidget * function(aGtkToolbar *, int, aGtkWidget *, char *, char *, char *, aGtkWidget *, _BCD_func__12122, void *, int)TGTKgtk_toolbar_insert_element; extern(D) TGTKgtk_toolbar_insert_element gtk_toolbar_insert_element;
+alias extern (C) _GtkWidget * function(aGtkToolbar *, int, aGtkWidget *, char *, char *, char *, aGtkWidget *, _BCD_func__12122, void *)TGTKgtk_toolbar_prepend_element; extern(D) TGTKgtk_toolbar_prepend_element gtk_toolbar_prepend_element;
+alias extern (C) _GtkWidget * function(aGtkToolbar *, int, aGtkWidget *, char *, char *, char *, aGtkWidget *, _BCD_func__12122, void *)TGTKgtk_toolbar_append_element; extern(D) TGTKgtk_toolbar_append_element gtk_toolbar_append_element;
+alias extern (C) void function(aGtkToolbar *, int)TGTKgtk_toolbar_remove_space; extern(D) TGTKgtk_toolbar_remove_space gtk_toolbar_remove_space;
+alias extern (C) void function(aGtkToolbar *, int)TGTKgtk_toolbar_insert_space; extern(D) TGTKgtk_toolbar_insert_space gtk_toolbar_insert_space;
+alias extern (C) void function(aGtkToolbar *)TGTKgtk_toolbar_prepend_space; extern(D) TGTKgtk_toolbar_prepend_space gtk_toolbar_prepend_space;
+alias extern (C) void function(aGtkToolbar *)TGTKgtk_toolbar_append_space; extern(D) TGTKgtk_toolbar_append_space gtk_toolbar_append_space;
+alias extern (C) _GtkWidget * function(aGtkToolbar *, char *, char *, char *, _BCD_func__12122, void *, int)TGTKgtk_toolbar_insert_stock; extern(D) TGTKgtk_toolbar_insert_stock gtk_toolbar_insert_stock;
+alias extern (C) _GtkWidget * function(aGtkToolbar *, char *, char *, char *, aGtkWidget *, _BCD_func__12122, void *, int)TGTKgtk_toolbar_insert_item; extern(D) TGTKgtk_toolbar_insert_item gtk_toolbar_insert_item;
+alias extern (C) _GtkWidget * function(aGtkToolbar *, char *, char *, char *, aGtkWidget *, _BCD_func__12122, void *)TGTKgtk_toolbar_prepend_item; extern(D) TGTKgtk_toolbar_prepend_item gtk_toolbar_prepend_item;
+alias extern (C) _GtkWidget * function(aGtkToolbar *, char *, char *, char *, aGtkWidget *, _BCD_func__12122, void *)TGTKgtk_toolbar_append_item; extern(D) TGTKgtk_toolbar_append_item gtk_toolbar_append_item;
+alias extern (C) void function(aGtkToolbar *)TGTKgtk_toolbar_unset_icon_size; extern(D) TGTKgtk_toolbar_unset_icon_size gtk_toolbar_unset_icon_size;
+alias extern (C) void function(aGtkToolbar *, int)TGTKgtk_toolbar_set_icon_size; extern(D) TGTKgtk_toolbar_set_icon_size gtk_toolbar_set_icon_size;
+//alias extern (C) void function(aGtkToolbar *)TGTK_gtk_toolbar_rebuild_menu; extern(D) TGTK_gtk_toolbar_rebuild_menu _gtk_toolbar_rebuild_menu;
+//alias extern (C) int function()TGTK_gtk_toolbar_get_default_space_size; extern(D) TGTK_gtk_toolbar_get_default_space_size _gtk_toolbar_get_default_space_size;
+//alias extern (C) void function(aGtkWidget *, aGtkToolbar *, _GdkRectangle *, _GdkRectangle *)TGTK_gtk_toolbar_paint_space_line; extern(D) TGTK_gtk_toolbar_paint_space_line _gtk_toolbar_paint_space_line;
+//alias extern (C) char * function(char *)TGTK_gtk_toolbar_elide_underscores; extern(D) TGTK_gtk_toolbar_elide_underscores _gtk_toolbar_elide_underscores;
+alias extern (C) void function(aGtkToolbar *, aGtkToolItem *, int)TGTKgtk_toolbar_set_drop_highlight_item; extern(D) TGTKgtk_toolbar_set_drop_highlight_item gtk_toolbar_set_drop_highlight_item;
+alias extern (C) int function(aGtkToolbar *, int, int)TGTKgtk_toolbar_get_drop_index; extern(D) TGTKgtk_toolbar_get_drop_index gtk_toolbar_get_drop_index;
+alias extern (C) int function(aGtkToolbar *)TGTKgtk_toolbar_get_relief_style; extern(D) TGTKgtk_toolbar_get_relief_style gtk_toolbar_get_relief_style;
+alias extern (C) int function(aGtkToolbar *)TGTKgtk_toolbar_get_icon_size; extern(D) TGTKgtk_toolbar_get_icon_size gtk_toolbar_get_icon_size;
+alias extern (C) void function(aGtkToolbar *)TGTKgtk_toolbar_unset_style; extern(D) TGTKgtk_toolbar_unset_style gtk_toolbar_unset_style;
+alias extern (C) void function(aGtkToolbar *, int)TGTKgtk_toolbar_set_style; extern(D) TGTKgtk_toolbar_set_style gtk_toolbar_set_style;
+alias extern (C) int function(aGtkToolbar *)TGTKgtk_toolbar_get_style; extern(D) TGTKgtk_toolbar_get_style gtk_toolbar_get_style;
+alias extern (C) void function(aGtkToolbar *, int)TGTKgtk_toolbar_set_tooltips; extern(D) TGTKgtk_toolbar_set_tooltips gtk_toolbar_set_tooltips;
+alias extern (C) int function(aGtkToolbar *)TGTKgtk_toolbar_get_tooltips; extern(D) TGTKgtk_toolbar_get_tooltips gtk_toolbar_get_tooltips;
+alias extern (C) void function(aGtkToolbar *, int)TGTKgtk_toolbar_set_orientation; extern(D) TGTKgtk_toolbar_set_orientation gtk_toolbar_set_orientation;
+alias extern (C) int function(aGtkToolbar *)TGTKgtk_toolbar_get_orientation; extern(D) TGTKgtk_toolbar_get_orientation gtk_toolbar_get_orientation;
+alias extern (C) void function(aGtkToolbar *, int)TGTKgtk_toolbar_set_show_arrow; extern(D) TGTKgtk_toolbar_set_show_arrow gtk_toolbar_set_show_arrow;
+alias extern (C) int function(aGtkToolbar *)TGTKgtk_toolbar_get_show_arrow; extern(D) TGTKgtk_toolbar_get_show_arrow gtk_toolbar_get_show_arrow;
+alias extern (C) _GtkToolItem * function(aGtkToolbar *, int)TGTKgtk_toolbar_get_nth_item; extern(D) TGTKgtk_toolbar_get_nth_item gtk_toolbar_get_nth_item;
+alias extern (C) int function(aGtkToolbar *)TGTKgtk_toolbar_get_n_items; extern(D) TGTKgtk_toolbar_get_n_items gtk_toolbar_get_n_items;
+alias extern (C) int function(aGtkToolbar *, aGtkToolItem *)TGTKgtk_toolbar_get_item_index; extern(D) TGTKgtk_toolbar_get_item_index gtk_toolbar_get_item_index;
+alias extern (C) void function(aGtkToolbar *, aGtkToolItem *, int)TGTKgtk_toolbar_insert; extern(D) TGTKgtk_toolbar_insert gtk_toolbar_insert;
+alias extern (C) _GtkWidget * function()TGTKgtk_toolbar_new; extern(D) TGTKgtk_toolbar_new gtk_toolbar_new;
+alias extern (C) uint function()TGTKgtk_toolbar_get_type; extern(D) TGTKgtk_toolbar_get_type gtk_toolbar_get_type;
+alias extern (C) void function(aGtkTipsQuery *, char *, char *)TGTKgtk_tips_query_set_labels; extern(D) TGTKgtk_tips_query_set_labels gtk_tips_query_set_labels;
+alias extern (C) void function(aGtkTipsQuery *, aGtkWidget *)TGTKgtk_tips_query_set_caller; extern(D) TGTKgtk_tips_query_set_caller gtk_tips_query_set_caller;
+alias extern (C) void function(aGtkTipsQuery *)TGTKgtk_tips_query_stop_query; extern(D) TGTKgtk_tips_query_stop_query gtk_tips_query_stop_query;
+alias extern (C) void function(aGtkTipsQuery *)TGTKgtk_tips_query_start_query; extern(D) TGTKgtk_tips_query_start_query gtk_tips_query_start_query;
+alias extern (C) _GtkWidget * function()TGTKgtk_tips_query_new; extern(D) TGTKgtk_tips_query_new gtk_tips_query_new;
+alias extern (C) uint function()TGTKgtk_tips_query_get_type; extern(D) TGTKgtk_tips_query_get_type gtk_tips_query_get_type;
+alias extern (C) _GtkTextAttributes * function(aGtkTextView *)TGTKgtk_text_view_get_default_attributes; extern(D) TGTKgtk_text_view_get_default_attributes gtk_text_view_get_default_attributes;
+alias extern (C) void * function(aGtkTextView *)TGTKgtk_text_view_get_tabs; extern(D) TGTKgtk_text_view_get_tabs gtk_text_view_get_tabs;
+alias extern (C) void function(aGtkTextView *, void *)TGTKgtk_text_view_set_tabs; extern(D) TGTKgtk_text_view_set_tabs gtk_text_view_set_tabs;
+alias extern (C) int function(aGtkTextView *)TGTKgtk_text_view_get_indent; extern(D) TGTKgtk_text_view_get_indent gtk_text_view_get_indent;
+alias extern (C) void function(aGtkTextView *, int)TGTKgtk_text_view_set_indent; extern(D) TGTKgtk_text_view_set_indent gtk_text_view_set_indent;
+alias extern (C) int function(aGtkTextView *)TGTKgtk_text_view_get_right_margin; extern(D) TGTKgtk_text_view_get_right_margin gtk_text_view_get_right_margin;
+alias extern (C) void function(aGtkTextView *, int)TGTKgtk_text_view_set_right_margin; extern(D) TGTKgtk_text_view_set_right_margin gtk_text_view_set_right_margin;
+alias extern (C) int function(aGtkTextView *)TGTKgtk_text_view_get_left_margin; extern(D) TGTKgtk_text_view_get_left_margin gtk_text_view_get_left_margin;
+alias extern (C) void function(aGtkTextView *, int)TGTKgtk_text_view_set_left_margin; extern(D) TGTKgtk_text_view_set_left_margin gtk_text_view_set_left_margin;
+alias extern (C) int function(aGtkTextView *)TGTKgtk_text_view_get_justification; extern(D) TGTKgtk_text_view_get_justification gtk_text_view_get_justification;
+alias extern (C) void function(aGtkTextView *, int)TGTKgtk_text_view_set_justification; extern(D) TGTKgtk_text_view_set_justification gtk_text_view_set_justification;
+alias extern (C) int function(aGtkTextView *)TGTKgtk_text_view_get_pixels_inside_wrap; extern(D) TGTKgtk_text_view_get_pixels_inside_wrap gtk_text_view_get_pixels_inside_wrap;
+alias extern (C) void function(aGtkTextView *, int)TGTKgtk_text_view_set_pixels_inside_wrap; extern(D) TGTKgtk_text_view_set_pixels_inside_wrap gtk_text_view_set_pixels_inside_wrap;
+alias extern (C) int function(aGtkTextView *)TGTKgtk_text_view_get_pixels_below_lines; extern(D) TGTKgtk_text_view_get_pixels_below_lines gtk_text_view_get_pixels_below_lines;
+alias extern (C) void function(aGtkTextView *, int)TGTKgtk_text_view_set_pixels_below_lines; extern(D) TGTKgtk_text_view_set_pixels_below_lines gtk_text_view_set_pixels_below_lines;
+alias extern (C) int function(aGtkTextView *)TGTKgtk_text_view_get_pixels_above_lines; extern(D) TGTKgtk_text_view_get_pixels_above_lines gtk_text_view_get_pixels_above_lines;
+alias extern (C) void function(aGtkTextView *, int)TGTKgtk_text_view_set_pixels_above_lines; extern(D) TGTKgtk_text_view_set_pixels_above_lines gtk_text_view_set_pixels_above_lines;
+alias extern (C) int function(aGtkTextView *)TGTKgtk_text_view_get_accepts_tab; extern(D) TGTKgtk_text_view_get_accepts_tab gtk_text_view_get_accepts_tab;
+alias extern (C) void function(aGtkTextView *, int)TGTKgtk_text_view_set_accepts_tab; extern(D) TGTKgtk_text_view_set_accepts_tab gtk_text_view_set_accepts_tab;
+alias extern (C) int function(aGtkTextView *)TGTKgtk_text_view_get_overwrite; extern(D) TGTKgtk_text_view_get_overwrite gtk_text_view_get_overwrite;
+alias extern (C) void function(aGtkTextView *, int)TGTKgtk_text_view_set_overwrite; extern(D) TGTKgtk_text_view_set_overwrite gtk_text_view_set_overwrite;
+alias extern (C) int function(aGtkTextView *)TGTKgtk_text_view_get_editable; extern(D) TGTKgtk_text_view_get_editable gtk_text_view_get_editable;
+alias extern (C) void function(aGtkTextView *, int)TGTKgtk_text_view_set_editable; extern(D) TGTKgtk_text_view_set_editable gtk_text_view_set_editable;
+alias extern (C) int function(aGtkTextView *)TGTKgtk_text_view_get_wrap_mode; extern(D) TGTKgtk_text_view_get_wrap_mode gtk_text_view_get_wrap_mode;
+alias extern (C) void function(aGtkTextView *, int)TGTKgtk_text_view_set_wrap_mode; extern(D) TGTKgtk_text_view_set_wrap_mode gtk_text_view_set_wrap_mode;
+alias extern (C) void function(aGtkTextView *, aGtkWidget *, int, int)TGTKgtk_text_view_move_child; extern(D) TGTKgtk_text_view_move_child gtk_text_view_move_child;
+alias extern (C) void function(aGtkTextView *, aGtkWidget *, int, int, int)TGTKgtk_text_view_add_child_in_window; extern(D) TGTKgtk_text_view_add_child_in_window gtk_text_view_add_child_in_window;
+alias extern (C) void function(aGtkTextView *, aGtkWidget *, aGtkTextChildAnchor *)TGTKgtk_text_view_add_child_at_anchor; extern(D) TGTKgtk_text_view_add_child_at_anchor gtk_text_view_add_child_at_anchor;
+alias extern (C) int function(aGtkTextView *, aGtkTextIter *, int)TGTKgtk_text_view_move_visually; extern(D) TGTKgtk_text_view_move_visually gtk_text_view_move_visually;
+alias extern (C) int function(aGtkTextView *, aGtkTextIter *)TGTKgtk_text_view_starts_display_line; extern(D) TGTKgtk_text_view_starts_display_line gtk_text_view_starts_display_line;
+alias extern (C) int function(aGtkTextView *, aGtkTextIter *)TGTKgtk_text_view_backward_display_line_start; extern(D) TGTKgtk_text_view_backward_display_line_start gtk_text_view_backward_display_line_start;
+alias extern (C) int function(aGtkTextView *, aGtkTextIter *)TGTKgtk_text_view_forward_display_line_end; extern(D) TGTKgtk_text_view_forward_display_line_end gtk_text_view_forward_display_line_end;
+alias extern (C) int function(aGtkTextView *, aGtkTextIter *)TGTKgtk_text_view_backward_display_line; extern(D) TGTKgtk_text_view_backward_display_line gtk_text_view_backward_display_line;
+alias extern (C) int function(aGtkTextView *, aGtkTextIter *)TGTKgtk_text_view_forward_display_line; extern(D) TGTKgtk_text_view_forward_display_line gtk_text_view_forward_display_line;
+alias extern (C) int function(aGtkTextView *, int)TGTKgtk_text_view_get_border_window_size; extern(D) TGTKgtk_text_view_get_border_window_size gtk_text_view_get_border_window_size;
+alias extern (C) void function(aGtkTextView *, int, int)TGTKgtk_text_view_set_border_window_size; extern(D) TGTKgtk_text_view_set_border_window_size gtk_text_view_set_border_window_size;
+alias extern (C) int function(aGtkTextView *, _GdkDrawable *)TGTKgtk_text_view_get_window_type; extern(D) TGTKgtk_text_view_get_window_type gtk_text_view_get_window_type;
+alias extern (C) _GdkDrawable * function(aGtkTextView *, int)TGTKgtk_text_view_get_window; extern(D) TGTKgtk_text_view_get_window gtk_text_view_get_window;
+alias extern (C) void function(aGtkTextView *, int, int, int, int *, int *)TGTKgtk_text_view_window_to_buffer_coords; extern(D) TGTKgtk_text_view_window_to_buffer_coords gtk_text_view_window_to_buffer_coords;
+alias extern (C) void function(aGtkTextView *, int, int, int, int *, int *)TGTKgtk_text_view_buffer_to_window_coords; extern(D) TGTKgtk_text_view_buffer_to_window_coords gtk_text_view_buffer_to_window_coords;
+alias extern (C) void function(aGtkTextView *, aGtkTextIter *, int, int *)TGTKgtk_text_view_get_line_at_y; extern(D) TGTKgtk_text_view_get_line_at_y gtk_text_view_get_line_at_y;
+alias extern (C) void function(aGtkTextView *, aGtkTextIter *, int *, int *)TGTKgtk_text_view_get_line_yrange; extern(D) TGTKgtk_text_view_get_line_yrange gtk_text_view_get_line_yrange;
+alias extern (C) void function(aGtkTextView *, aGtkTextIter *, int *, int, int)TGTKgtk_text_view_get_iter_at_position; extern(D) TGTKgtk_text_view_get_iter_at_position gtk_text_view_get_iter_at_position;
+alias extern (C) void function(aGtkTextView *, aGtkTextIter *, int, int)TGTKgtk_text_view_get_iter_at_location; extern(D) TGTKgtk_text_view_get_iter_at_location gtk_text_view_get_iter_at_location;
+alias extern (C) void function(aGtkTextView *, aGtkTextIter *, _GdkRectangle *)TGTKgtk_text_view_get_iter_location; extern(D) TGTKgtk_text_view_get_iter_location gtk_text_view_get_iter_location;
+alias extern (C) int function(aGtkTextView *)TGTKgtk_text_view_get_cursor_visible; extern(D) TGTKgtk_text_view_get_cursor_visible gtk_text_view_get_cursor_visible;
+alias extern (C) void function(aGtkTextView *, int)TGTKgtk_text_view_set_cursor_visible; extern(D) TGTKgtk_text_view_set_cursor_visible gtk_text_view_set_cursor_visible;
+alias extern (C) void function(aGtkTextView *, _GdkRectangle *)TGTKgtk_text_view_get_visible_rect; extern(D) TGTKgtk_text_view_get_visible_rect gtk_text_view_get_visible_rect;
+alias extern (C) int function(aGtkTextView *)TGTKgtk_text_view_place_cursor_onscreen; extern(D) TGTKgtk_text_view_place_cursor_onscreen gtk_text_view_place_cursor_onscreen;
+alias extern (C) int function(aGtkTextView *, aGtkTextMark *)TGTKgtk_text_view_move_mark_onscreen; extern(D) TGTKgtk_text_view_move_mark_onscreen gtk_text_view_move_mark_onscreen;
+alias extern (C) void function(aGtkTextView *, aGtkTextMark *)TGTKgtk_text_view_scroll_mark_onscreen; extern(D) TGTKgtk_text_view_scroll_mark_onscreen gtk_text_view_scroll_mark_onscreen;
+alias extern (C) void function(aGtkTextView *, aGtkTextMark *, double, int, double, double)TGTKgtk_text_view_scroll_to_mark; extern(D) TGTKgtk_text_view_scroll_to_mark gtk_text_view_scroll_to_mark;
+alias extern (C) int function(aGtkTextView *, aGtkTextIter *, double, int, double, double)TGTKgtk_text_view_scroll_to_iter; extern(D) TGTKgtk_text_view_scroll_to_iter gtk_text_view_scroll_to_iter;
+alias extern (C) _GtkTextBuffer * function(aGtkTextView *)TGTKgtk_text_view_get_buffer; extern(D) TGTKgtk_text_view_get_buffer gtk_text_view_get_buffer;
+alias extern (C) void function(aGtkTextView *, aGtkTextBuffer *)TGTKgtk_text_view_set_buffer; extern(D) TGTKgtk_text_view_set_buffer gtk_text_view_set_buffer;
+alias extern (C) _GtkWidget * function(aGtkTextBuffer *)TGTKgtk_text_view_new_with_buffer; extern(D) TGTKgtk_text_view_new_with_buffer gtk_text_view_new_with_buffer;
+alias extern (C) _GtkWidget * function()TGTKgtk_text_view_new; extern(D) TGTKgtk_text_view_new gtk_text_view_new;
+alias extern (C) uint function()TGTKgtk_text_view_get_type; extern(D) TGTKgtk_text_view_get_type gtk_text_view_get_type;
+alias extern (C) int function(aGtkTextBuffer *, aGtkTextBuffer *, void *, aGtkTextIter *, char *, uint, _GError * *)TGTKgtk_text_buffer_deserialize; extern(D) TGTKgtk_text_buffer_deserialize gtk_text_buffer_deserialize;
+alias extern (C) char * function(aGtkTextBuffer *, aGtkTextBuffer *, void *, aGtkTextIter *, aGtkTextIter *, uint *)TGTKgtk_text_buffer_serialize; extern(D) TGTKgtk_text_buffer_serialize gtk_text_buffer_serialize;
+alias extern (C) void * * function(aGtkTextBuffer *, int *)TGTKgtk_text_buffer_get_deserialize_formats; extern(D) TGTKgtk_text_buffer_get_deserialize_formats gtk_text_buffer_get_deserialize_formats;
+alias extern (C) void * * function(aGtkTextBuffer *, int *)TGTKgtk_text_buffer_get_serialize_formats; extern(D) TGTKgtk_text_buffer_get_serialize_formats gtk_text_buffer_get_serialize_formats;
+alias extern (C) int function(aGtkTextBuffer *, void *)TGTKgtk_text_buffer_deserialize_get_can_create_tags; extern(D) TGTKgtk_text_buffer_deserialize_get_can_create_tags gtk_text_buffer_deserialize_get_can_create_tags;
+alias extern (C) void function(aGtkTextBuffer *, void *, int)TGTKgtk_text_buffer_deserialize_set_can_create_tags; extern(D) TGTKgtk_text_buffer_deserialize_set_can_create_tags gtk_text_buffer_deserialize_set_can_create_tags;
+alias extern (C) void function(aGtkTextBuffer *, void *)TGTKgtk_text_buffer_unregister_deserialize_format; extern(D) TGTKgtk_text_buffer_unregister_deserialize_format gtk_text_buffer_unregister_deserialize_format;
+alias extern (C) void function(aGtkTextBuffer *, void *)TGTKgtk_text_buffer_unregister_serialize_format; extern(D) TGTKgtk_text_buffer_unregister_serialize_format gtk_text_buffer_unregister_serialize_format;
+alias extern (C) void * function(aGtkTextBuffer *, char *)TGTKgtk_text_buffer_register_deserialize_tagset; extern(D) TGTKgtk_text_buffer_register_deserialize_tagset gtk_text_buffer_register_deserialize_tagset;
+alias extern (C) void * function(aGtkTextBuffer *, char *, _BCD_func__9281, void *, _BCD_func__13158)TGTKgtk_text_buffer_register_deserialize_format; extern(D) TGTKgtk_text_buffer_register_deserialize_format gtk_text_buffer_register_deserialize_format;
+alias extern (C) void * function(aGtkTextBuffer *, char *)TGTKgtk_text_buffer_register_serialize_tagset; extern(D) TGTKgtk_text_buffer_register_serialize_tagset gtk_text_buffer_register_serialize_tagset;
+alias extern (C) void * function(aGtkTextBuffer *, char *, _BCD_func__9282, void *, _BCD_func__13158)TGTKgtk_text_buffer_register_serialize_format; extern(D) TGTKgtk_text_buffer_register_serialize_format gtk_text_buffer_register_serialize_format;
+//alias extern (C) void function(aGtkTextBuffer *, aGtkTextTag *)TGTK_gtk_text_buffer_notify_will_remove_tag; extern(D) TGTK_gtk_text_buffer_notify_will_remove_tag _gtk_text_buffer_notify_will_remove_tag;
+//alias extern (C) _PangoLogAttr * function(aGtkTextBuffer *, aGtkTextIter *, int *)TGTK_gtk_text_buffer_get_line_log_attrs; extern(D) TGTK_gtk_text_buffer_get_line_log_attrs _gtk_text_buffer_get_line_log_attrs;
+//alias extern (C) void * function(aGtkTextBuffer *)TGTK_gtk_text_buffer_get_btree; extern(D) TGTK_gtk_text_buffer_get_btree _gtk_text_buffer_get_btree;
+//alias extern (C) void function(aGtkTextBuffer *)TGTK_gtk_text_buffer_spew; extern(D) TGTK_gtk_text_buffer_spew _gtk_text_buffer_spew;
+alias extern (C) _GtkTargetList * function(aGtkTextBuffer *)TGTKgtk_text_buffer_get_paste_target_list; extern(D) TGTKgtk_text_buffer_get_paste_target_list gtk_text_buffer_get_paste_target_list;
+alias extern (C) _GtkTargetList * function(aGtkTextBuffer *)TGTKgtk_text_buffer_get_copy_target_list; extern(D) TGTKgtk_text_buffer_get_copy_target_list gtk_text_buffer_get_copy_target_list;
+alias extern (C) void function(aGtkTextBuffer *)TGTKgtk_text_buffer_end_user_action; extern(D) TGTKgtk_text_buffer_end_user_action gtk_text_buffer_end_user_action;
+alias extern (C) void function(aGtkTextBuffer *)TGTKgtk_text_buffer_begin_user_action; extern(D) TGTKgtk_text_buffer_begin_user_action gtk_text_buffer_begin_user_action;
+alias extern (C) int function(aGtkTextBuffer *, int, int)TGTKgtk_text_buffer_delete_selection; extern(D) TGTKgtk_text_buffer_delete_selection gtk_text_buffer_delete_selection;
+alias extern (C) int function(aGtkTextBuffer *, aGtkTextIter *, aGtkTextIter *)TGTKgtk_text_buffer_get_selection_bounds; extern(D) TGTKgtk_text_buffer_get_selection_bounds gtk_text_buffer_get_selection_bounds;
+alias extern (C) void function(aGtkTextBuffer *, void *, aGtkTextIter *, int)TGTKgtk_text_buffer_paste_clipboard; extern(D) TGTKgtk_text_buffer_paste_clipboard gtk_text_buffer_paste_clipboard;
+alias extern (C) void function(aGtkTextBuffer *, void *)TGTKgtk_text_buffer_copy_clipboard; extern(D) TGTKgtk_text_buffer_copy_clipboard gtk_text_buffer_copy_clipboard;
+alias extern (C) void function(aGtkTextBuffer *, void *, int)TGTKgtk_text_buffer_cut_clipboard; extern(D) TGTKgtk_text_buffer_cut_clipboard gtk_text_buffer_cut_clipboard;
+alias extern (C) void function(aGtkTextBuffer *, void *)TGTKgtk_text_buffer_remove_selection_clipboard; extern(D) TGTKgtk_text_buffer_remove_selection_clipboard gtk_text_buffer_remove_selection_clipboard;
+alias extern (C) void function(aGtkTextBuffer *, void *)TGTKgtk_text_buffer_add_selection_clipboard; extern(D) TGTKgtk_text_buffer_add_selection_clipboard gtk_text_buffer_add_selection_clipboard;
+alias extern (C) int function(aGtkTextBuffer *)TGTKgtk_text_buffer_get_has_selection; extern(D) TGTKgtk_text_buffer_get_has_selection gtk_text_buffer_get_has_selection;
+alias extern (C) void function(aGtkTextBuffer *, int)TGTKgtk_text_buffer_set_modified; extern(D) TGTKgtk_text_buffer_set_modified gtk_text_buffer_set_modified;
+alias extern (C) int function(aGtkTextBuffer *)TGTKgtk_text_buffer_get_modified; extern(D) TGTKgtk_text_buffer_get_modified gtk_text_buffer_get_modified;
+alias extern (C) void function(aGtkTextBuffer *, aGtkTextIter *, aGtkTextChildAnchor *)TGTKgtk_text_buffer_get_iter_at_child_anchor; extern(D) TGTKgtk_text_buffer_get_iter_at_child_anchor gtk_text_buffer_get_iter_at_child_anchor;
+alias extern (C) void function(aGtkTextBuffer *, aGtkTextIter *, aGtkTextMark *)TGTKgtk_text_buffer_get_iter_at_mark; extern(D) TGTKgtk_text_buffer_get_iter_at_mark gtk_text_buffer_get_iter_at_mark;
+alias extern (C) void function(aGtkTextBuffer *, aGtkTextIter *, aGtkTextIter *)TGTKgtk_text_buffer_get_bounds; extern(D) TGTKgtk_text_buffer_get_bounds gtk_text_buffer_get_bounds;
+alias extern (C) void function(aGtkTextBuffer *, aGtkTextIter *)TGTKgtk_text_buffer_get_end_iter; extern(D) TGTKgtk_text_buffer_get_end_iter gtk_text_buffer_get_end_iter;
+alias extern (C) void function(aGtkTextBuffer *, aGtkTextIter *)TGTKgtk_text_buffer_get_start_iter; extern(D) TGTKgtk_text_buffer_get_start_iter gtk_text_buffer_get_start_iter;
+alias extern (C) void function(aGtkTextBuffer *, aGtkTextIter *, int)TGTKgtk_text_buffer_get_iter_at_line; extern(D) TGTKgtk_text_buffer_get_iter_at_line gtk_text_buffer_get_iter_at_line;
+alias extern (C) void function(aGtkTextBuffer *, aGtkTextIter *, int)TGTKgtk_text_buffer_get_iter_at_offset; extern(D) TGTKgtk_text_buffer_get_iter_at_offset gtk_text_buffer_get_iter_at_offset;
+alias extern (C) void function(aGtkTextBuffer *, aGtkTextIter *, int, int)TGTKgtk_text_buffer_get_iter_at_line_index; extern(D) TGTKgtk_text_buffer_get_iter_at_line_index gtk_text_buffer_get_iter_at_line_index;
+alias extern (C) void function(aGtkTextBuffer *, aGtkTextIter *, int, int)TGTKgtk_text_buffer_get_iter_at_line_offset; extern(D) TGTKgtk_text_buffer_get_iter_at_line_offset gtk_text_buffer_get_iter_at_line_offset;
+alias extern (C) _GtkTextTag * function(aGtkTextBuffer *, char *, char *, ...)TGTKgtk_text_buffer_create_tag; extern(D) TGTKgtk_text_buffer_create_tag gtk_text_buffer_create_tag;
+alias extern (C) void function(aGtkTextBuffer *, aGtkTextIter *, aGtkTextIter *)TGTKgtk_text_buffer_remove_all_tags; extern(D) TGTKgtk_text_buffer_remove_all_tags gtk_text_buffer_remove_all_tags;
+alias extern (C) void function(aGtkTextBuffer *, char *, aGtkTextIter *, aGtkTextIter *)TGTKgtk_text_buffer_remove_tag_by_name; extern(D) TGTKgtk_text_buffer_remove_tag_by_name gtk_text_buffer_remove_tag_by_name;
+alias extern (C) void function(aGtkTextBuffer *, char *, aGtkTextIter *, aGtkTextIter *)TGTKgtk_text_buffer_apply_tag_by_name; extern(D) TGTKgtk_text_buffer_apply_tag_by_name gtk_text_buffer_apply_tag_by_name;
+alias extern (C) void function(aGtkTextBuffer *, aGtkTextTag *, aGtkTextIter *, aGtkTextIter *)TGTKgtk_text_buffer_remove_tag; extern(D) TGTKgtk_text_buffer_remove_tag gtk_text_buffer_remove_tag;
+alias extern (C) void function(aGtkTextBuffer *, aGtkTextTag *, aGtkTextIter *, aGtkTextIter *)TGTKgtk_text_buffer_apply_tag; extern(D) TGTKgtk_text_buffer_apply_tag gtk_text_buffer_apply_tag;
+alias extern (C) void function(aGtkTextBuffer *, aGtkTextIter *, aGtkTextIter *)TGTKgtk_text_buffer_select_range; extern(D) TGTKgtk_text_buffer_select_range gtk_text_buffer_select_range;
+alias extern (C) void function(aGtkTextBuffer *, aGtkTextIter *)TGTKgtk_text_buffer_place_cursor; extern(D) TGTKgtk_text_buffer_place_cursor gtk_text_buffer_place_cursor;
+alias extern (C) _GtkTextMark * function(aGtkTextBuffer *)TGTKgtk_text_buffer_get_selection_bound; extern(D) TGTKgtk_text_buffer_get_selection_bound gtk_text_buffer_get_selection_bound;
+alias extern (C) _GtkTextMark * function(aGtkTextBuffer *)TGTKgtk_text_buffer_get_insert; extern(D) TGTKgtk_text_buffer_get_insert gtk_text_buffer_get_insert;
+alias extern (C) void function(aGtkTextBuffer *, char *)TGTKgtk_text_buffer_delete_mark_by_name; extern(D) TGTKgtk_text_buffer_delete_mark_by_name gtk_text_buffer_delete_mark_by_name;
+alias extern (C) void function(aGtkTextBuffer *, char *, aGtkTextIter *)TGTKgtk_text_buffer_move_mark_by_name; extern(D) TGTKgtk_text_buffer_move_mark_by_name gtk_text_buffer_move_mark_by_name;
+alias extern (C) _GtkTextMark * function(aGtkTextBuffer *, char *)TGTKgtk_text_buffer_get_mark; extern(D) TGTKgtk_text_buffer_get_mark gtk_text_buffer_get_mark;
+alias extern (C) void function(aGtkTextBuffer *, aGtkTextMark *)TGTKgtk_text_buffer_delete_mark; extern(D) TGTKgtk_text_buffer_delete_mark gtk_text_buffer_delete_mark;
+alias extern (C) void function(aGtkTextBuffer *, aGtkTextMark *, aGtkTextIter *)TGTKgtk_text_buffer_move_mark; extern(D) TGTKgtk_text_buffer_move_mark gtk_text_buffer_move_mark;
+alias extern (C) _GtkTextMark * function(aGtkTextBuffer *, char *, aGtkTextIter *, int)TGTKgtk_text_buffer_create_mark; extern(D) TGTKgtk_text_buffer_create_mark gtk_text_buffer_create_mark;
+alias extern (C) void function(aGtkTextBuffer *, aGtkTextMark *, aGtkTextIter *)TGTKgtk_text_buffer_add_mark; extern(D) TGTKgtk_text_buffer_add_mark gtk_text_buffer_add_mark;
+alias extern (C) _GtkTextChildAnchor * function(aGtkTextBuffer *, aGtkTextIter *)TGTKgtk_text_buffer_create_child_anchor; extern(D) TGTKgtk_text_buffer_create_child_anchor gtk_text_buffer_create_child_anchor;
+alias extern (C) void function(aGtkTextBuffer *, aGtkTextIter *, aGtkTextChildAnchor *)TGTKgtk_text_buffer_insert_child_anchor; extern(D) TGTKgtk_text_buffer_insert_child_anchor gtk_text_buffer_insert_child_anchor;
+alias extern (C) void function(aGtkTextBuffer *, aGtkTextIter *, void *)TGTKgtk_text_buffer_insert_pixbuf; extern(D) TGTKgtk_text_buffer_insert_pixbuf gtk_text_buffer_insert_pixbuf;
+alias extern (C) char * function(aGtkTextBuffer *, aGtkTextIter *, aGtkTextIter *, int)TGTKgtk_text_buffer_get_slice; extern(D) TGTKgtk_text_buffer_get_slice gtk_text_buffer_get_slice;
+alias extern (C) char * function(aGtkTextBuffer *, aGtkTextIter *, aGtkTextIter *, int)TGTKgtk_text_buffer_get_text; extern(D) TGTKgtk_text_buffer_get_text gtk_text_buffer_get_text;
+alias extern (C) int function(aGtkTextBuffer *, aGtkTextIter *, int, int)TGTKgtk_text_buffer_backspace; extern(D) TGTKgtk_text_buffer_backspace gtk_text_buffer_backspace;
+alias extern (C) int function(aGtkTextBuffer *, aGtkTextIter *, aGtkTextIter *, int)TGTKgtk_text_buffer_delete_interactive; extern(D) TGTKgtk_text_buffer_delete_interactive gtk_text_buffer_delete_interactive;
+alias extern (C) void function(aGtkTextBuffer *, aGtkTextIter *, aGtkTextIter *)TGTKgtk_text_buffer_delete; extern(D) TGTKgtk_text_buffer_delete gtk_text_buffer_delete;
+alias extern (C) void function(aGtkTextBuffer *, aGtkTextIter *, char *, int, char *, ...)TGTKgtk_text_buffer_insert_with_tags_by_name; extern(D) TGTKgtk_text_buffer_insert_with_tags_by_name gtk_text_buffer_insert_with_tags_by_name;
+alias extern (C) void function(aGtkTextBuffer *, aGtkTextIter *, char *, int, aGtkTextTag *, ...)TGTKgtk_text_buffer_insert_with_tags; extern(D) TGTKgtk_text_buffer_insert_with_tags gtk_text_buffer_insert_with_tags;
+alias extern (C) int function(aGtkTextBuffer *, aGtkTextIter *, aGtkTextIter *, aGtkTextIter *, int)TGTKgtk_text_buffer_insert_range_interactive; extern(D) TGTKgtk_text_buffer_insert_range_interactive gtk_text_buffer_insert_range_interactive;
+alias extern (C) void function(aGtkTextBuffer *, aGtkTextIter *, aGtkTextIter *, aGtkTextIter *)TGTKgtk_text_buffer_insert_range; extern(D) TGTKgtk_text_buffer_insert_range gtk_text_buffer_insert_range;
+alias extern (C) int function(aGtkTextBuffer *, char *, int, int)TGTKgtk_text_buffer_insert_interactive_at_cursor; extern(D) TGTKgtk_text_buffer_insert_interactive_at_cursor gtk_text_buffer_insert_interactive_at_cursor;
+alias extern (C) int function(aGtkTextBuffer *, aGtkTextIter *, char *, int, int)TGTKgtk_text_buffer_insert_interactive; extern(D) TGTKgtk_text_buffer_insert_interactive gtk_text_buffer_insert_interactive;
+alias extern (C) void function(aGtkTextBuffer *, char *, int)TGTKgtk_text_buffer_insert_at_cursor; extern(D) TGTKgtk_text_buffer_insert_at_cursor gtk_text_buffer_insert_at_cursor;
+alias extern (C) void function(aGtkTextBuffer *, aGtkTextIter *, char *, int)TGTKgtk_text_buffer_insert; extern(D) TGTKgtk_text_buffer_insert gtk_text_buffer_insert;
+alias extern (C) void function(aGtkTextBuffer *, char *, int)TGTKgtk_text_buffer_set_text; extern(D) TGTKgtk_text_buffer_set_text gtk_text_buffer_set_text;
+alias extern (C) _GtkTextTagTable * function(aGtkTextBuffer *)TGTKgtk_text_buffer_get_tag_table; extern(D) TGTKgtk_text_buffer_get_tag_table gtk_text_buffer_get_tag_table;
+alias extern (C) int function(aGtkTextBuffer *)TGTKgtk_text_buffer_get_char_count; extern(D) TGTKgtk_text_buffer_get_char_count gtk_text_buffer_get_char_count;
+alias extern (C) int function(aGtkTextBuffer *)TGTKgtk_text_buffer_get_line_count; extern(D) TGTKgtk_text_buffer_get_line_count gtk_text_buffer_get_line_count;
+alias extern (C) _GtkTextBuffer * function(aGtkTextTagTable *)TGTKgtk_text_buffer_new; extern(D) TGTKgtk_text_buffer_new gtk_text_buffer_new;
+alias extern (C) uint function()TGTKgtk_text_buffer_get_type; extern(D) TGTKgtk_text_buffer_get_type gtk_text_buffer_get_type;
+alias extern (C) int function(aGtkTextMark *)TGTKgtk_text_mark_get_left_gravity; extern(D) TGTKgtk_text_mark_get_left_gravity gtk_text_mark_get_left_gravity;
+alias extern (C) _GtkTextBuffer * function(aGtkTextMark *)TGTKgtk_text_mark_get_buffer; extern(D) TGTKgtk_text_mark_get_buffer gtk_text_mark_get_buffer;
+alias extern (C) int function(aGtkTextMark *)TGTKgtk_text_mark_get_deleted; extern(D) TGTKgtk_text_mark_get_deleted gtk_text_mark_get_deleted;
+alias extern (C) char * function(aGtkTextMark *)TGTKgtk_text_mark_get_name; extern(D) TGTKgtk_text_mark_get_name gtk_text_mark_get_name;
+alias extern (C) _GtkTextMark * function(char *, int)TGTKgtk_text_mark_new; extern(D) TGTKgtk_text_mark_new gtk_text_mark_new;
+alias extern (C) int function(aGtkTextMark *)TGTKgtk_text_mark_get_visible; extern(D) TGTKgtk_text_mark_get_visible gtk_text_mark_get_visible;
+alias extern (C) void function(aGtkTextMark *, int)TGTKgtk_text_mark_set_visible; extern(D) TGTKgtk_text_mark_set_visible gtk_text_mark_set_visible;
+alias extern (C) uint function()TGTKgtk_text_mark_get_type; extern(D) TGTKgtk_text_mark_get_type gtk_text_mark_get_type;
+//alias extern (C) void function(aGtkTextTagTable *, void *)TGTK_gtk_text_tag_table_remove_buffer; extern(D) TGTK_gtk_text_tag_table_remove_buffer _gtk_text_tag_table_remove_buffer;
+//alias extern (C) void function(aGtkTextTagTable *, void *)TGTK_gtk_text_tag_table_add_buffer; extern(D) TGTK_gtk_text_tag_table_add_buffer _gtk_text_tag_table_add_buffer;
+alias extern (C) int function(aGtkTextTagTable *)TGTKgtk_text_tag_table_get_size; extern(D) TGTKgtk_text_tag_table_get_size gtk_text_tag_table_get_size;
+alias extern (C) void function(aGtkTextTagTable *, _BCD_func__9332, void *)TGTKgtk_text_tag_table_foreach; extern(D) TGTKgtk_text_tag_table_foreach gtk_text_tag_table_foreach;
+alias extern (C) _GtkTextTag * function(aGtkTextTagTable *, char *)TGTKgtk_text_tag_table_lookup; extern(D) TGTKgtk_text_tag_table_lookup gtk_text_tag_table_lookup;
+alias extern (C) void function(aGtkTextTagTable *, aGtkTextTag *)TGTKgtk_text_tag_table_remove; extern(D) TGTKgtk_text_tag_table_remove gtk_text_tag_table_remove;
+alias extern (C) void function(aGtkTextTagTable *, aGtkTextTag *)TGTKgtk_text_tag_table_add; extern(D) TGTKgtk_text_tag_table_add gtk_text_tag_table_add;
+alias extern (C) _GtkTextTagTable * function()TGTKgtk_text_tag_table_new; extern(D) TGTKgtk_text_tag_table_new gtk_text_tag_table_new;
+alias extern (C) uint function()TGTKgtk_text_tag_table_get_type; extern(D) TGTKgtk_text_tag_table_get_type gtk_text_tag_table_get_type;
+alias extern (C) _GtkWidget * function()TGTKgtk_tearoff_menu_item_new; extern(D) TGTKgtk_tearoff_menu_item_new gtk_tearoff_menu_item_new;
+alias extern (C) uint function()TGTKgtk_tearoff_menu_item_get_type; extern(D) TGTKgtk_tearoff_menu_item_get_type gtk_tearoff_menu_item_get_type;
+alias extern (C) int function(aGtkTable *)TGTKgtk_table_get_homogeneous; extern(D) TGTKgtk_table_get_homogeneous gtk_table_get_homogeneous;
+alias extern (C) void function(aGtkTable *, int)TGTKgtk_table_set_homogeneous; extern(D) TGTKgtk_table_set_homogeneous gtk_table_set_homogeneous;
+alias extern (C) uint function(aGtkTable *)TGTKgtk_table_get_default_col_spacing; extern(D) TGTKgtk_table_get_default_col_spacing gtk_table_get_default_col_spacing;
+alias extern (C) void function(aGtkTable *, uint)TGTKgtk_table_set_col_spacings; extern(D) TGTKgtk_table_set_col_spacings gtk_table_set_col_spacings;
+alias extern (C) uint function(aGtkTable *)TGTKgtk_table_get_default_row_spacing; extern(D) TGTKgtk_table_get_default_row_spacing gtk_table_get_default_row_spacing;
+alias extern (C) void function(aGtkTable *, uint)TGTKgtk_table_set_row_spacings; extern(D) TGTKgtk_table_set_row_spacings gtk_table_set_row_spacings;
+alias extern (C) uint function(aGtkTable *, uint)TGTKgtk_table_get_col_spacing; extern(D) TGTKgtk_table_get_col_spacing gtk_table_get_col_spacing;
+alias extern (C) void function(aGtkTable *, uint, uint)TGTKgtk_table_set_col_spacing; extern(D) TGTKgtk_table_set_col_spacing gtk_table_set_col_spacing;
+alias extern (C) uint function(aGtkTable *, uint)TGTKgtk_table_get_row_spacing; extern(D) TGTKgtk_table_get_row_spacing gtk_table_get_row_spacing;
+alias extern (C) void function(aGtkTable *, uint, uint)TGTKgtk_table_set_row_spacing; extern(D) TGTKgtk_table_set_row_spacing gtk_table_set_row_spacing;
+alias extern (C) void function(aGtkTable *, aGtkWidget *, uint, uint, uint, uint)TGTKgtk_table_attach_defaults; extern(D) TGTKgtk_table_attach_defaults gtk_table_attach_defaults;
+alias extern (C) void function(aGtkTable *, aGtkWidget *, uint, uint, uint, uint, int, int, uint, uint)TGTKgtk_table_attach; extern(D) TGTKgtk_table_attach gtk_table_attach;
+alias extern (C) void function(aGtkTable *, uint, uint)TGTKgtk_table_resize; extern(D) TGTKgtk_table_resize gtk_table_resize;
+alias extern (C) _GtkWidget * function(uint, uint, int)TGTKgtk_table_new; extern(D) TGTKgtk_table_new gtk_table_new;
+alias extern (C) uint function()TGTKgtk_table_get_type; extern(D) TGTKgtk_table_get_type gtk_table_get_type;
+alias extern (C) void function(char *, _BCD_func__12124, void *, _BCD_func__13158)TGTKgtk_stock_set_translate_func; extern(D) TGTKgtk_stock_set_translate_func gtk_stock_set_translate_func;
+alias extern (C) void function(aGtkStockItem *)TGTKgtk_stock_item_free; extern(D) TGTKgtk_stock_item_free gtk_stock_item_free;
+alias extern (C) _GtkStockItem * function(aGtkStockItem *)TGTKgtk_stock_item_copy; extern(D) TGTKgtk_stock_item_copy gtk_stock_item_copy;
+alias extern (C) _GSList * function()TGTKgtk_stock_list_ids; extern(D) TGTKgtk_stock_list_ids gtk_stock_list_ids;
+alias extern (C) int function(char *, aGtkStockItem *)TGTKgtk_stock_lookup; extern(D) TGTKgtk_stock_lookup gtk_stock_lookup;
+alias extern (C) void function(aGtkStockItem *, uint)TGTKgtk_stock_add_static; extern(D) TGTKgtk_stock_add_static gtk_stock_add_static;
+alias extern (C) void function(aGtkStockItem *, uint)TGTKgtk_stock_add; extern(D) TGTKgtk_stock_add gtk_stock_add;
+alias extern (C) int function(aGtkStatusIcon *, _GdkScreen * *, _GdkRectangle *, int *)TGTKgtk_status_icon_get_geometry; extern(D) TGTKgtk_status_icon_get_geometry gtk_status_icon_get_geometry;
+alias extern (C) void function(aGtkMenu *, int *, int *, int *, void *)TGTKgtk_status_icon_position_menu; extern(D) TGTKgtk_status_icon_position_menu gtk_status_icon_position_menu;
+alias extern (C) int function(aGtkStatusIcon *)TGTKgtk_status_icon_is_embedded; extern(D) TGTKgtk_status_icon_is_embedded gtk_status_icon_is_embedded;
+alias extern (C) int function(aGtkStatusIcon *)TGTKgtk_status_icon_get_blinking; extern(D) TGTKgtk_status_icon_get_blinking gtk_status_icon_get_blinking;
+alias extern (C) void function(aGtkStatusIcon *, int)TGTKgtk_status_icon_set_blinking; extern(D) TGTKgtk_status_icon_set_blinking gtk_status_icon_set_blinking;
+alias extern (C) int function(aGtkStatusIcon *)TGTKgtk_status_icon_get_visible; extern(D) TGTKgtk_status_icon_get_visible gtk_status_icon_get_visible;
+alias extern (C) void function(aGtkStatusIcon *, int)TGTKgtk_status_icon_set_visible; extern(D) TGTKgtk_status_icon_set_visible gtk_status_icon_set_visible;
+alias extern (C) void function(aGtkStatusIcon *, char *)TGTKgtk_status_icon_set_tooltip; extern(D) TGTKgtk_status_icon_set_tooltip gtk_status_icon_set_tooltip;
+alias extern (C) _GdkScreen * function(aGtkStatusIcon *)TGTKgtk_status_icon_get_screen; extern(D) TGTKgtk_status_icon_get_screen gtk_status_icon_get_screen;
+alias extern (C) void function(aGtkStatusIcon *, _GdkScreen *)TGTKgtk_status_icon_set_screen; extern(D) TGTKgtk_status_icon_set_screen gtk_status_icon_set_screen;
+alias extern (C) int function(aGtkStatusIcon *)TGTKgtk_status_icon_get_size; extern(D) TGTKgtk_status_icon_get_size gtk_status_icon_get_size;
+alias extern (C) char * function(aGtkStatusIcon *)TGTKgtk_status_icon_get_icon_name; extern(D) TGTKgtk_status_icon_get_icon_name gtk_status_icon_get_icon_name;
+alias extern (C) char * function(aGtkStatusIcon *)TGTKgtk_status_icon_get_stock; extern(D) TGTKgtk_status_icon_get_stock gtk_status_icon_get_stock;
+alias extern (C) void * function(aGtkStatusIcon *)TGTKgtk_status_icon_get_pixbuf; extern(D) TGTKgtk_status_icon_get_pixbuf gtk_status_icon_get_pixbuf;
+alias extern (C) int function(aGtkStatusIcon *)TGTKgtk_status_icon_get_storage_type; extern(D) TGTKgtk_status_icon_get_storage_type gtk_status_icon_get_storage_type;
+alias extern (C) void function(aGtkStatusIcon *, char *)TGTKgtk_status_icon_set_from_icon_name; extern(D) TGTKgtk_status_icon_set_from_icon_name gtk_status_icon_set_from_icon_name;
+alias extern (C) void function(aGtkStatusIcon *, char *)TGTKgtk_status_icon_set_from_stock; extern(D) TGTKgtk_status_icon_set_from_stock gtk_status_icon_set_from_stock;
+alias extern (C) void function(aGtkStatusIcon *, char *)TGTKgtk_status_icon_set_from_file; extern(D) TGTKgtk_status_icon_set_from_file gtk_status_icon_set_from_file;
+alias extern (C) void function(aGtkStatusIcon *, void *)TGTKgtk_status_icon_set_from_pixbuf; extern(D) TGTKgtk_status_icon_set_from_pixbuf gtk_status_icon_set_from_pixbuf;
+alias extern (C) _GtkStatusIcon * function(char *)TGTKgtk_status_icon_new_from_icon_name; extern(D) TGTKgtk_status_icon_new_from_icon_name gtk_status_icon_new_from_icon_name;
+alias extern (C) _GtkStatusIcon * function(char *)TGTKgtk_status_icon_new_from_stock; extern(D) TGTKgtk_status_icon_new_from_stock gtk_status_icon_new_from_stock;
+alias extern (C) _GtkStatusIcon * function(char *)TGTKgtk_status_icon_new_from_file; extern(D) TGTKgtk_status_icon_new_from_file gtk_status_icon_new_from_file;
+alias extern (C) _GtkStatusIcon * function(void *)TGTKgtk_status_icon_new_from_pixbuf; extern(D) TGTKgtk_status_icon_new_from_pixbuf gtk_status_icon_new_from_pixbuf;
+alias extern (C) _GtkStatusIcon * function()TGTKgtk_status_icon_new; extern(D) TGTKgtk_status_icon_new gtk_status_icon_new;
+alias extern (C) uint function()TGTKgtk_status_icon_get_type; extern(D) TGTKgtk_status_icon_get_type gtk_status_icon_get_type;
+alias extern (C) int function(aGtkStatusbar *)TGTKgtk_statusbar_get_has_resize_grip; extern(D) TGTKgtk_statusbar_get_has_resize_grip gtk_statusbar_get_has_resize_grip;
+alias extern (C) void function(aGtkStatusbar *, int)TGTKgtk_statusbar_set_has_resize_grip; extern(D) TGTKgtk_statusbar_set_has_resize_grip gtk_statusbar_set_has_resize_grip;
+alias extern (C) void function(aGtkStatusbar *, uint, uint)TGTKgtk_statusbar_remove; extern(D) TGTKgtk_statusbar_remove gtk_statusbar_remove;
+alias extern (C) void function(aGtkStatusbar *, uint)TGTKgtk_statusbar_pop; extern(D) TGTKgtk_statusbar_pop gtk_statusbar_pop;
+alias extern (C) uint function(aGtkStatusbar *, uint, char *)TGTKgtk_statusbar_push; extern(D) TGTKgtk_statusbar_push gtk_statusbar_push;
+alias extern (C) uint function(aGtkStatusbar *, char *)TGTKgtk_statusbar_get_context_id; extern(D) TGTKgtk_statusbar_get_context_id gtk_statusbar_get_context_id;
+alias extern (C) _GtkWidget * function()TGTKgtk_statusbar_new; extern(D) TGTKgtk_statusbar_new gtk_statusbar_new;
+alias extern (C) uint function()TGTKgtk_statusbar_get_type; extern(D) TGTKgtk_statusbar_get_type gtk_statusbar_get_type;
+alias extern (C) void function(aGtkSpinButton *)TGTKgtk_spin_button_update; extern(D) TGTKgtk_spin_button_update gtk_spin_button_update;
+alias extern (C) int function(aGtkSpinButton *)TGTKgtk_spin_button_get_snap_to_ticks; extern(D) TGTKgtk_spin_button_get_snap_to_ticks gtk_spin_button_get_snap_to_ticks;
+alias extern (C) void function(aGtkSpinButton *, int)TGTKgtk_spin_button_set_snap_to_ticks; extern(D) TGTKgtk_spin_button_set_snap_to_ticks gtk_spin_button_set_snap_to_ticks;
+alias extern (C) int function(aGtkSpinButton *)TGTKgtk_spin_button_get_wrap; extern(D) TGTKgtk_spin_button_get_wrap gtk_spin_button_get_wrap;
+alias extern (C) void function(aGtkSpinButton *, int)TGTKgtk_spin_button_set_wrap; extern(D) TGTKgtk_spin_button_set_wrap gtk_spin_button_set_wrap;
+alias extern (C) void function(aGtkSpinButton *, int, double)TGTKgtk_spin_button_spin; extern(D) TGTKgtk_spin_button_spin gtk_spin_button_spin;
+alias extern (C) int function(aGtkSpinButton *)TGTKgtk_spin_button_get_numeric; extern(D) TGTKgtk_spin_button_get_numeric gtk_spin_button_get_numeric;
+alias extern (C) void function(aGtkSpinButton *, int)TGTKgtk_spin_button_set_numeric; extern(D) TGTKgtk_spin_button_set_numeric gtk_spin_button_set_numeric;
+alias extern (C) int function(aGtkSpinButton *)TGTKgtk_spin_button_get_update_policy; extern(D) TGTKgtk_spin_button_get_update_policy gtk_spin_button_get_update_policy;
+alias extern (C) void function(aGtkSpinButton *, int)TGTKgtk_spin_button_set_update_policy; extern(D) TGTKgtk_spin_button_set_update_policy gtk_spin_button_set_update_policy;
+alias extern (C) void function(aGtkSpinButton *, double)TGTKgtk_spin_button_set_value; extern(D) TGTKgtk_spin_button_set_value gtk_spin_button_set_value;
+alias extern (C) int function(aGtkSpinButton *)TGTKgtk_spin_button_get_value_as_int; extern(D) TGTKgtk_spin_button_get_value_as_int gtk_spin_button_get_value_as_int;
+alias extern (C) double function(aGtkSpinButton *)TGTKgtk_spin_button_get_value; extern(D) TGTKgtk_spin_button_get_value gtk_spin_button_get_value;
+alias extern (C) void function(aGtkSpinButton *, double *, double *)TGTKgtk_spin_button_get_range; extern(D) TGTKgtk_spin_button_get_range gtk_spin_button_get_range;
+alias extern (C) void function(aGtkSpinButton *, double, double)TGTKgtk_spin_button_set_range; extern(D) TGTKgtk_spin_button_set_range gtk_spin_button_set_range;
+alias extern (C) void function(aGtkSpinButton *, double *, double *)TGTKgtk_spin_button_get_increments; extern(D) TGTKgtk_spin_button_get_increments gtk_spin_button_get_increments;
+alias extern (C) void function(aGtkSpinButton *, double, double)TGTKgtk_spin_button_set_increments; extern(D) TGTKgtk_spin_button_set_increments gtk_spin_button_set_increments;
+alias extern (C) uint function(aGtkSpinButton *)TGTKgtk_spin_button_get_digits; extern(D) TGTKgtk_spin_button_get_digits gtk_spin_button_get_digits;
+alias extern (C) void function(aGtkSpinButton *, uint)TGTKgtk_spin_button_set_digits; extern(D) TGTKgtk_spin_button_set_digits gtk_spin_button_set_digits;
+alias extern (C) _GtkAdjustment * function(aGtkSpinButton *)TGTKgtk_spin_button_get_adjustment; extern(D) TGTKgtk_spin_button_get_adjustment gtk_spin_button_get_adjustment;
+alias extern (C) void function(aGtkSpinButton *, aGtkAdjustment *)TGTKgtk_spin_button_set_adjustment; extern(D) TGTKgtk_spin_button_set_adjustment gtk_spin_button_set_adjustment;
+alias extern (C) _GtkWidget * function(double, double, double)TGTKgtk_spin_button_new_with_range; extern(D) TGTKgtk_spin_button_new_with_range gtk_spin_button_new_with_range;
+alias extern (C) _GtkWidget * function(aGtkAdjustment *, double, uint)TGTKgtk_spin_button_new; extern(D) TGTKgtk_spin_button_new gtk_spin_button_new;
+alias extern (C) void function(aGtkSpinButton *, aGtkAdjustment *, double, uint)TGTKgtk_spin_button_configure; extern(D) TGTKgtk_spin_button_configure gtk_spin_button_configure;
+alias extern (C) uint function()TGTKgtk_spin_button_get_type; extern(D) TGTKgtk_spin_button_get_type gtk_spin_button_get_type;
+//alias extern (C) void function(aGtkWidget *)TGTK_gtk_size_group_queue_resize; extern(D) TGTK_gtk_size_group_queue_resize _gtk_size_group_queue_resize;
+//alias extern (C) void function(aGtkWidget *, aGtkRequisition *)TGTK_gtk_size_group_compute_requisition; extern(D) TGTK_gtk_size_group_compute_requisition _gtk_size_group_compute_requisition;
+//alias extern (C) void function(aGtkWidget *, aGtkRequisition *)TGTK_gtk_size_group_get_child_requisition; extern(D) TGTK_gtk_size_group_get_child_requisition _gtk_size_group_get_child_requisition;
+alias extern (C) _GSList * function(aGtkSizeGroup *)TGTKgtk_size_group_get_widgets; extern(D) TGTKgtk_size_group_get_widgets gtk_size_group_get_widgets;
+alias extern (C) void function(aGtkSizeGroup *, aGtkWidget *)TGTKgtk_size_group_remove_widget; extern(D) TGTKgtk_size_group_remove_widget gtk_size_group_remove_widget;
+alias extern (C) void function(aGtkSizeGroup *, aGtkWidget *)TGTKgtk_size_group_add_widget; extern(D) TGTKgtk_size_group_add_widget gtk_size_group_add_widget;
+alias extern (C) int function(aGtkSizeGroup *)TGTKgtk_size_group_get_ignore_hidden; extern(D) TGTKgtk_size_group_get_ignore_hidden gtk_size_group_get_ignore_hidden;
+alias extern (C) void function(aGtkSizeGroup *, int)TGTKgtk_size_group_set_ignore_hidden; extern(D) TGTKgtk_size_group_set_ignore_hidden gtk_size_group_set_ignore_hidden;
+alias extern (C) int function(aGtkSizeGroup *)TGTKgtk_size_group_get_mode; extern(D) TGTKgtk_size_group_get_mode gtk_size_group_get_mode;
+alias extern (C) void function(aGtkSizeGroup *, int)TGTKgtk_size_group_set_mode; extern(D) TGTKgtk_size_group_set_mode gtk_size_group_set_mode;
+alias extern (C) _GtkSizeGroup * function(int)TGTKgtk_size_group_new; extern(D) TGTKgtk_size_group_new gtk_size_group_new;
+alias extern (C) uint function()TGTKgtk_size_group_get_type; extern(D) TGTKgtk_size_group_get_type gtk_size_group_get_type;
+alias extern (C) void function(aGtkSeparatorToolItem *, int)TGTKgtk_separator_tool_item_set_draw; extern(D) TGTKgtk_separator_tool_item_set_draw gtk_separator_tool_item_set_draw;
+alias extern (C) int function(aGtkSeparatorToolItem *)TGTKgtk_separator_tool_item_get_draw; extern(D) TGTKgtk_separator_tool_item_get_draw gtk_separator_tool_item_get_draw;
+alias extern (C) _GtkToolItem * function()TGTKgtk_separator_tool_item_new; extern(D) TGTKgtk_separator_tool_item_new gtk_separator_tool_item_new;
+alias extern (C) uint function()TGTKgtk_separator_tool_item_get_type; extern(D) TGTKgtk_separator_tool_item_get_type gtk_separator_tool_item_get_type;
+alias extern (C) _GtkWidget * function()TGTKgtk_separator_menu_item_new; extern(D) TGTKgtk_separator_menu_item_new gtk_separator_menu_item_new;
+alias extern (C) uint function()TGTKgtk_separator_menu_item_get_type; extern(D) TGTKgtk_separator_menu_item_get_type gtk_separator_menu_item_get_type;
+//alias extern (C) int function(aGtkScrolledWindow *)TGTK_gtk_scrolled_window_get_scrollbar_spacing; extern(D) TGTK_gtk_scrolled_window_get_scrollbar_spacing _gtk_scrolled_window_get_scrollbar_spacing;
+alias extern (C) void function(aGtkScrolledWindow *, aGtkWidget *)TGTKgtk_scrolled_window_add_with_viewport; extern(D) TGTKgtk_scrolled_window_add_with_viewport gtk_scrolled_window_add_with_viewport;
+alias extern (C) int function(aGtkScrolledWindow *)TGTKgtk_scrolled_window_get_shadow_type; extern(D) TGTKgtk_scrolled_window_get_shadow_type gtk_scrolled_window_get_shadow_type;
+alias extern (C) void function(aGtkScrolledWindow *, int)TGTKgtk_scrolled_window_set_shadow_type; extern(D) TGTKgtk_scrolled_window_set_shadow_type gtk_scrolled_window_set_shadow_type;
+alias extern (C) int function(aGtkScrolledWindow *)TGTKgtk_scrolled_window_get_placement; extern(D) TGTKgtk_scrolled_window_get_placement gtk_scrolled_window_get_placement;
+alias extern (C) void function(aGtkScrolledWindow *)TGTKgtk_scrolled_window_unset_placement; extern(D) TGTKgtk_scrolled_window_unset_placement gtk_scrolled_window_unset_placement;
+alias extern (C) void function(aGtkScrolledWindow *, int)TGTKgtk_scrolled_window_set_placement; extern(D) TGTKgtk_scrolled_window_set_placement gtk_scrolled_window_set_placement;
+alias extern (C) void function(aGtkScrolledWindow *, int *, int *)TGTKgtk_scrolled_window_get_policy; extern(D) TGTKgtk_scrolled_window_get_policy gtk_scrolled_window_get_policy;
+alias extern (C) void function(aGtkScrolledWindow *, int, int)TGTKgtk_scrolled_window_set_policy; extern(D) TGTKgtk_scrolled_window_set_policy gtk_scrolled_window_set_policy;
+alias extern (C) _GtkWidget * function(aGtkScrolledWindow *)TGTKgtk_scrolled_window_get_vscrollbar; extern(D) TGTKgtk_scrolled_window_get_vscrollbar gtk_scrolled_window_get_vscrollbar;
+alias extern (C) _GtkWidget * function(aGtkScrolledWindow *)TGTKgtk_scrolled_window_get_hscrollbar; extern(D) TGTKgtk_scrolled_window_get_hscrollbar gtk_scrolled_window_get_hscrollbar;
+alias extern (C) _GtkAdjustment * function(aGtkScrolledWindow *)TGTKgtk_scrolled_window_get_vadjustment; extern(D) TGTKgtk_scrolled_window_get_vadjustment gtk_scrolled_window_get_vadjustment;
+alias extern (C) _GtkAdjustment * function(aGtkScrolledWindow *)TGTKgtk_scrolled_window_get_hadjustment; extern(D) TGTKgtk_scrolled_window_get_hadjustment gtk_scrolled_window_get_hadjustment;
+alias extern (C) void function(aGtkScrolledWindow *, aGtkAdjustment *)TGTKgtk_scrolled_window_set_vadjustment; extern(D) TGTKgtk_scrolled_window_set_vadjustment gtk_scrolled_window_set_vadjustment;
+alias extern (C) void function(aGtkScrolledWindow *, aGtkAdjustment *)TGTKgtk_scrolled_window_set_hadjustment; extern(D) TGTKgtk_scrolled_window_set_hadjustment gtk_scrolled_window_set_hadjustment;
+alias extern (C) _GtkWidget * function(aGtkAdjustment *, aGtkAdjustment *)TGTKgtk_scrolled_window_new; extern(D) TGTKgtk_scrolled_window_new gtk_scrolled_window_new;
+alias extern (C) uint function()TGTKgtk_scrolled_window_get_type; extern(D) TGTKgtk_scrolled_window_get_type gtk_scrolled_window_get_type;
+alias extern (C) int function(aGtkViewport *)TGTKgtk_viewport_get_shadow_type; extern(D) TGTKgtk_viewport_get_shadow_type gtk_viewport_get_shadow_type;
+alias extern (C) void function(aGtkViewport *, int)TGTKgtk_viewport_set_shadow_type; extern(D) TGTKgtk_viewport_set_shadow_type gtk_viewport_set_shadow_type;
+alias extern (C) void function(aGtkViewport *, aGtkAdjustment *)TGTKgtk_viewport_set_vadjustment; extern(D) TGTKgtk_viewport_set_vadjustment gtk_viewport_set_vadjustment;
+alias extern (C) void function(aGtkViewport *, aGtkAdjustment *)TGTKgtk_viewport_set_hadjustment; extern(D) TGTKgtk_viewport_set_hadjustment gtk_viewport_set_hadjustment;
+alias extern (C) _GtkAdjustment * function(aGtkViewport *)TGTKgtk_viewport_get_vadjustment; extern(D) TGTKgtk_viewport_get_vadjustment gtk_viewport_get_vadjustment;
+alias extern (C) _GtkAdjustment * function(aGtkViewport *)TGTKgtk_viewport_get_hadjustment; extern(D) TGTKgtk_viewport_get_hadjustment gtk_viewport_get_hadjustment;
+alias extern (C) _GtkWidget * function(aGtkAdjustment *, aGtkAdjustment *)TGTKgtk_viewport_new; extern(D) TGTKgtk_viewport_new gtk_viewport_new;
+alias extern (C) uint function()TGTKgtk_viewport_get_type; extern(D) TGTKgtk_viewport_get_type gtk_viewport_get_type;
+alias extern (C) void function(aGtkScaleButton *, aGtkAdjustment *)TGTKgtk_scale_button_set_adjustment; extern(D) TGTKgtk_scale_button_set_adjustment gtk_scale_button_set_adjustment;
+alias extern (C) _GtkAdjustment * function(aGtkScaleButton *)TGTKgtk_scale_button_get_adjustment; extern(D) TGTKgtk_scale_button_get_adjustment gtk_scale_button_get_adjustment;
+alias extern (C) void function(aGtkScaleButton *, double)TGTKgtk_scale_button_set_value; extern(D) TGTKgtk_scale_button_set_value gtk_scale_button_set_value;
+alias extern (C) double function(aGtkScaleButton *)TGTKgtk_scale_button_get_value; extern(D) TGTKgtk_scale_button_get_value gtk_scale_button_get_value;
+alias extern (C) void function(aGtkScaleButton *, char * *)TGTKgtk_scale_button_set_icons; extern(D) TGTKgtk_scale_button_set_icons gtk_scale_button_set_icons;
+alias extern (C) _GtkWidget * function(int, double, double, double, char * *)TGTKgtk_scale_button_new; extern(D) TGTKgtk_scale_button_new gtk_scale_button_new;
+alias extern (C) uint function()TGTKgtk_scale_button_get_type; extern(D) TGTKgtk_scale_button_get_type gtk_scale_button_get_type;
+alias extern (C) _GtkWidget * function(aGtkRecentManager *)TGTKgtk_recent_chooser_widget_new_for_manager; extern(D) TGTKgtk_recent_chooser_widget_new_for_manager gtk_recent_chooser_widget_new_for_manager;
+alias extern (C) _GtkWidget * function()TGTKgtk_recent_chooser_widget_new; extern(D) TGTKgtk_recent_chooser_widget_new gtk_recent_chooser_widget_new;
+alias extern (C) uint function()TGTKgtk_recent_chooser_widget_get_type; extern(D) TGTKgtk_recent_chooser_widget_get_type gtk_recent_chooser_widget_get_type;
+alias extern (C) void function(aGtkRecentChooserMenu *, int)TGTKgtk_recent_chooser_menu_set_show_numbers; extern(D) TGTKgtk_recent_chooser_menu_set_show_numbers gtk_recent_chooser_menu_set_show_numbers;
+alias extern (C) int function(aGtkRecentChooserMenu *)TGTKgtk_recent_chooser_menu_get_show_numbers; extern(D) TGTKgtk_recent_chooser_menu_get_show_numbers gtk_recent_chooser_menu_get_show_numbers;
+alias extern (C) _GtkWidget * function(aGtkRecentManager *)TGTKgtk_recent_chooser_menu_new_for_manager; extern(D) TGTKgtk_recent_chooser_menu_new_for_manager gtk_recent_chooser_menu_new_for_manager;
+alias extern (C) _GtkWidget * function()TGTKgtk_recent_chooser_menu_new; extern(D) TGTKgtk_recent_chooser_menu_new gtk_recent_chooser_menu_new;
+alias extern (C) uint function()TGTKgtk_recent_chooser_menu_get_type; extern(D) TGTKgtk_recent_chooser_menu_get_type gtk_recent_chooser_menu_get_type;
+alias extern (C) _GtkWidget * function(char *, aGtkWindow *, aGtkRecentManager *, char *, ...)TGTKgtk_recent_chooser_dialog_new_for_manager; extern(D) TGTKgtk_recent_chooser_dialog_new_for_manager gtk_recent_chooser_dialog_new_for_manager;
+alias extern (C) _GtkWidget * function(char *, aGtkWindow *, char *, ...)TGTKgtk_recent_chooser_dialog_new; extern(D) TGTKgtk_recent_chooser_dialog_new gtk_recent_chooser_dialog_new;
+alias extern (C) uint function()TGTKgtk_recent_chooser_dialog_get_type; extern(D) TGTKgtk_recent_chooser_dialog_get_type gtk_recent_chooser_dialog_get_type;
+alias extern (C) void * function(void *)TGTKgtk_recent_chooser_get_filter; extern(D) TGTKgtk_recent_chooser_get_filter gtk_recent_chooser_get_filter;
+alias extern (C) void function(void *, void *)TGTKgtk_recent_chooser_set_filter; extern(D) TGTKgtk_recent_chooser_set_filter gtk_recent_chooser_set_filter;
+alias extern (C) _GSList * function(void *)TGTKgtk_recent_chooser_list_filters; extern(D) TGTKgtk_recent_chooser_list_filters gtk_recent_chooser_list_filters;
+alias extern (C) void function(void *, void *)TGTKgtk_recent_chooser_remove_filter; extern(D) TGTKgtk_recent_chooser_remove_filter gtk_recent_chooser_remove_filter;
+alias extern (C) void function(void *, void *)TGTKgtk_recent_chooser_add_filter; extern(D) TGTKgtk_recent_chooser_add_filter gtk_recent_chooser_add_filter;
+alias extern (C) char * * function(void *, uint *)TGTKgtk_recent_chooser_get_uris; extern(D) TGTKgtk_recent_chooser_get_uris gtk_recent_chooser_get_uris;
+alias extern (C) _GList * function(void *)TGTKgtk_recent_chooser_get_items; extern(D) TGTKgtk_recent_chooser_get_items gtk_recent_chooser_get_items;
+alias extern (C) void function(void *)TGTKgtk_recent_chooser_unselect_all; extern(D) TGTKgtk_recent_chooser_unselect_all gtk_recent_chooser_unselect_all;
+alias extern (C) void function(void *)TGTKgtk_recent_chooser_select_all; extern(D) TGTKgtk_recent_chooser_select_all gtk_recent_chooser_select_all;
+alias extern (C) void function(void *, char *)TGTKgtk_recent_chooser_unselect_uri; extern(D) TGTKgtk_recent_chooser_unselect_uri gtk_recent_chooser_unselect_uri;
+alias extern (C) int function(void *, char *, _GError * *)TGTKgtk_recent_chooser_select_uri; extern(D) TGTKgtk_recent_chooser_select_uri gtk_recent_chooser_select_uri;
+alias extern (C) void * function(void *)TGTKgtk_recent_chooser_get_current_item; extern(D) TGTKgtk_recent_chooser_get_current_item gtk_recent_chooser_get_current_item;
+alias extern (C) char * function(void *)TGTKgtk_recent_chooser_get_current_uri; extern(D) TGTKgtk_recent_chooser_get_current_uri gtk_recent_chooser_get_current_uri;
+alias extern (C) int function(void *, char *, _GError * *)TGTKgtk_recent_chooser_set_current_uri; extern(D) TGTKgtk_recent_chooser_set_current_uri gtk_recent_chooser_set_current_uri;
+alias extern (C) void function(void *, _BCD_func__9605, void *, _BCD_func__13158)TGTKgtk_recent_chooser_set_sort_func; extern(D) TGTKgtk_recent_chooser_set_sort_func gtk_recent_chooser_set_sort_func;
+alias extern (C) int function(void *)TGTKgtk_recent_chooser_get_sort_type; extern(D) TGTKgtk_recent_chooser_get_sort_type gtk_recent_chooser_get_sort_type;
+alias extern (C) void function(void *, int)TGTKgtk_recent_chooser_set_sort_type; extern(D) TGTKgtk_recent_chooser_set_sort_type gtk_recent_chooser_set_sort_type;
+alias extern (C) int function(void *)TGTKgtk_recent_chooser_get_show_icons; extern(D) TGTKgtk_recent_chooser_get_show_icons gtk_recent_chooser_get_show_icons;
+alias extern (C) void function(void *, int)TGTKgtk_recent_chooser_set_show_icons; extern(D) TGTKgtk_recent_chooser_set_show_icons gtk_recent_chooser_set_show_icons;
+alias extern (C) int function(void *)TGTKgtk_recent_chooser_get_show_numbers; extern(D) TGTKgtk_recent_chooser_get_show_numbers gtk_recent_chooser_get_show_numbers;
+alias extern (C) void function(void *, int)TGTKgtk_recent_chooser_set_show_numbers; extern(D) TGTKgtk_recent_chooser_set_show_numbers gtk_recent_chooser_set_show_numbers;
+alias extern (C) int function(void *)TGTKgtk_recent_chooser_get_show_tips; extern(D) TGTKgtk_recent_chooser_get_show_tips gtk_recent_chooser_get_show_tips;
+alias extern (C) void function(void *, int)TGTKgtk_recent_chooser_set_show_tips; extern(D) TGTKgtk_recent_chooser_set_show_tips gtk_recent_chooser_set_show_tips;
+alias extern (C) int function(void *)TGTKgtk_recent_chooser_get_local_only; extern(D) TGTKgtk_recent_chooser_get_local_only gtk_recent_chooser_get_local_only;
+alias extern (C) void function(void *, int)TGTKgtk_recent_chooser_set_local_only; extern(D) TGTKgtk_recent_chooser_set_local_only gtk_recent_chooser_set_local_only;
+alias extern (C) int function(void *)TGTKgtk_recent_chooser_get_limit; extern(D) TGTKgtk_recent_chooser_get_limit gtk_recent_chooser_get_limit;
+alias extern (C) void function(void *, int)TGTKgtk_recent_chooser_set_limit; extern(D) TGTKgtk_recent_chooser_set_limit gtk_recent_chooser_set_limit;
+alias extern (C) int function(void *)TGTKgtk_recent_chooser_get_select_multiple; extern(D) TGTKgtk_recent_chooser_get_select_multiple gtk_recent_chooser_get_select_multiple;
+alias extern (C) void function(void *, int)TGTKgtk_recent_chooser_set_select_multiple; extern(D) TGTKgtk_recent_chooser_set_select_multiple gtk_recent_chooser_set_select_multiple;
+alias extern (C) int function(void *)TGTKgtk_recent_chooser_get_show_not_found; extern(D) TGTKgtk_recent_chooser_get_show_not_found gtk_recent_chooser_get_show_not_found;
+alias extern (C) void function(void *, int)TGTKgtk_recent_chooser_set_show_not_found; extern(D) TGTKgtk_recent_chooser_set_show_not_found gtk_recent_chooser_set_show_not_found;
+alias extern (C) int function(void *)TGTKgtk_recent_chooser_get_show_private; extern(D) TGTKgtk_recent_chooser_get_show_private gtk_recent_chooser_get_show_private;
+alias extern (C) void function(void *, int)TGTKgtk_recent_chooser_set_show_private; extern(D) TGTKgtk_recent_chooser_set_show_private gtk_recent_chooser_set_show_private;
+alias extern (C) uint function()TGTKgtk_recent_chooser_get_type; extern(D) TGTKgtk_recent_chooser_get_type gtk_recent_chooser_get_type;
+alias extern (C) uint function()TGTKgtk_recent_chooser_error_quark; extern(D) TGTKgtk_recent_chooser_error_quark gtk_recent_chooser_error_quark;
+alias extern (C) int function(void *, aGtkRecentFilterInfo *)TGTKgtk_recent_filter_filter; extern(D) TGTKgtk_recent_filter_filter gtk_recent_filter_filter;
+alias extern (C) int function(void *)TGTKgtk_recent_filter_get_needed; extern(D) TGTKgtk_recent_filter_get_needed gtk_recent_filter_get_needed;
+alias extern (C) void function(void *, int, _BCD_func__9607, void *, _BCD_func__13158)TGTKgtk_recent_filter_add_custom; extern(D) TGTKgtk_recent_filter_add_custom gtk_recent_filter_add_custom;
+alias extern (C) void function(void *, int)TGTKgtk_recent_filter_add_age; extern(D) TGTKgtk_recent_filter_add_age gtk_recent_filter_add_age;
+alias extern (C) void function(void *, char *)TGTKgtk_recent_filter_add_group; extern(D) TGTKgtk_recent_filter_add_group gtk_recent_filter_add_group;
+alias extern (C) void function(void *, char *)TGTKgtk_recent_filter_add_application; extern(D) TGTKgtk_recent_filter_add_application gtk_recent_filter_add_application;
+alias extern (C) void function(void *)TGTKgtk_recent_filter_add_pixbuf_formats; extern(D) TGTKgtk_recent_filter_add_pixbuf_formats gtk_recent_filter_add_pixbuf_formats;
+alias extern (C) void function(void *, char *)TGTKgtk_recent_filter_add_pattern; extern(D) TGTKgtk_recent_filter_add_pattern gtk_recent_filter_add_pattern;
+alias extern (C) void function(void *, char *)TGTKgtk_recent_filter_add_mime_type; extern(D) TGTKgtk_recent_filter_add_mime_type gtk_recent_filter_add_mime_type;
+alias extern (C) char * function(void *)TGTKgtk_recent_filter_get_name; extern(D) TGTKgtk_recent_filter_get_name gtk_recent_filter_get_name;
+alias extern (C) void function(void *, char *)TGTKgtk_recent_filter_set_name; extern(D) TGTKgtk_recent_filter_set_name gtk_recent_filter_set_name;
+alias extern (C) void * function()TGTKgtk_recent_filter_new; extern(D) TGTKgtk_recent_filter_new gtk_recent_filter_new;
+alias extern (C) uint function()TGTKgtk_recent_filter_get_type; extern(D) TGTKgtk_recent_filter_get_type gtk_recent_filter_get_type;
+alias extern (C) void function(aGtkRecentAction *, int)TGTKgtk_recent_action_set_show_numbers; extern(D) TGTKgtk_recent_action_set_show_numbers gtk_recent_action_set_show_numbers;
+alias extern (C) int function(aGtkRecentAction *)TGTKgtk_recent_action_get_show_numbers; extern(D) TGTKgtk_recent_action_get_show_numbers gtk_recent_action_get_show_numbers;
+alias extern (C) _GtkAction * function(char *, char *, char *, char *, aGtkRecentManager *)TGTKgtk_recent_action_new_for_manager; extern(D) TGTKgtk_recent_action_new_for_manager gtk_recent_action_new_for_manager;
+alias extern (C) _GtkAction * function(char *, char *, char *, char *)TGTKgtk_recent_action_new; extern(D) TGTKgtk_recent_action_new gtk_recent_action_new;
+alias extern (C) uint function()TGTKgtk_recent_action_get_type; extern(D) TGTKgtk_recent_action_get_type gtk_recent_action_get_type;
+//alias extern (C) void function()TGTK_gtk_recent_manager_sync; extern(D) TGTK_gtk_recent_manager_sync _gtk_recent_manager_sync;
+alias extern (C) int function(void *, void *)TGTKgtk_recent_info_match; extern(D) TGTKgtk_recent_info_match gtk_recent_info_match;
+alias extern (C) int function(void *)TGTKgtk_recent_info_exists; extern(D) TGTKgtk_recent_info_exists gtk_recent_info_exists;
+alias extern (C) int function(void *)TGTKgtk_recent_info_is_local; extern(D) TGTKgtk_recent_info_is_local gtk_recent_info_is_local;
+alias extern (C) int function(void *)TGTKgtk_recent_info_get_age; extern(D) TGTKgtk_recent_info_get_age gtk_recent_info_get_age;
+alias extern (C) char * function(void *)TGTKgtk_recent_info_get_uri_display; extern(D) TGTKgtk_recent_info_get_uri_display gtk_recent_info_get_uri_display;
+alias extern (C) char * function(void *)TGTKgtk_recent_info_get_short_name; extern(D) TGTKgtk_recent_info_get_short_name gtk_recent_info_get_short_name;
+alias extern (C) void * function(void *, int)TGTKgtk_recent_info_get_icon; extern(D) TGTKgtk_recent_info_get_icon gtk_recent_info_get_icon;
+alias extern (C) int function(void *, char *)TGTKgtk_recent_info_has_group; extern(D) TGTKgtk_recent_info_has_group gtk_recent_info_has_group;
+alias extern (C) char * * function(void *, uint *)TGTKgtk_recent_info_get_groups; extern(D) TGTKgtk_recent_info_get_groups gtk_recent_info_get_groups;
+alias extern (C) int function(void *, char *)TGTKgtk_recent_info_has_application; extern(D) TGTKgtk_recent_info_has_application gtk_recent_info_has_application;
+alias extern (C) char * function(void *)TGTKgtk_recent_info_last_application; extern(D) TGTKgtk_recent_info_last_application gtk_recent_info_last_application;
+alias extern (C) char * * function(void *, uint *)TGTKgtk_recent_info_get_applications; extern(D) TGTKgtk_recent_info_get_applications gtk_recent_info_get_applications;
+alias extern (C) int function(void *, char *, char * *, uint *, int *)TGTKgtk_recent_info_get_application_info; extern(D) TGTKgtk_recent_info_get_application_info gtk_recent_info_get_application_info;
+alias extern (C) int function(void *)TGTKgtk_recent_info_get_private_hint; extern(D) TGTKgtk_recent_info_get_private_hint gtk_recent_info_get_private_hint;
+alias extern (C) int function(void *)TGTKgtk_recent_info_get_visited; extern(D) TGTKgtk_recent_info_get_visited gtk_recent_info_get_visited;
+alias extern (C) int function(void *)TGTKgtk_recent_info_get_modified; extern(D) TGTKgtk_recent_info_get_modified gtk_recent_info_get_modified;
+alias extern (C) int function(void *)TGTKgtk_recent_info_get_added; extern(D) TGTKgtk_recent_info_get_added gtk_recent_info_get_added;
+alias extern (C) char * function(void *)TGTKgtk_recent_info_get_mime_type; extern(D) TGTKgtk_recent_info_get_mime_type gtk_recent_info_get_mime_type;
+alias extern (C) char * function(void *)TGTKgtk_recent_info_get_description; extern(D) TGTKgtk_recent_info_get_description gtk_recent_info_get_description;
+alias extern (C) char * function(void *)TGTKgtk_recent_info_get_display_name; extern(D) TGTKgtk_recent_info_get_display_name gtk_recent_info_get_display_name;
+alias extern (C) char * function(void *)TGTKgtk_recent_info_get_uri; extern(D) TGTKgtk_recent_info_get_uri gtk_recent_info_get_uri;
+alias extern (C) void function(void *)TGTKgtk_recent_info_unref; extern(D) TGTKgtk_recent_info_unref gtk_recent_info_unref;
+alias extern (C) void * function(void *)TGTKgtk_recent_info_ref; extern(D) TGTKgtk_recent_info_ref gtk_recent_info_ref;
+alias extern (C) uint function()TGTKgtk_recent_info_get_type; extern(D) TGTKgtk_recent_info_get_type gtk_recent_info_get_type;
+alias extern (C) int function(aGtkRecentManager *, _GError * *)TGTKgtk_recent_manager_purge_items; extern(D) TGTKgtk_recent_manager_purge_items gtk_recent_manager_purge_items;
+alias extern (C) _GList * function(aGtkRecentManager *)TGTKgtk_recent_manager_get_items; extern(D) TGTKgtk_recent_manager_get_items gtk_recent_manager_get_items;
+alias extern (C) int function(aGtkRecentManager *)TGTKgtk_recent_manager_get_limit; extern(D) TGTKgtk_recent_manager_get_limit gtk_recent_manager_get_limit;
+alias extern (C) void function(aGtkRecentManager *, int)TGTKgtk_recent_manager_set_limit; extern(D) TGTKgtk_recent_manager_set_limit gtk_recent_manager_set_limit;
+alias extern (C) int function(aGtkRecentManager *, char *, char *, _GError * *)TGTKgtk_recent_manager_move_item; extern(D) TGTKgtk_recent_manager_move_item gtk_recent_manager_move_item;
+alias extern (C) int function(aGtkRecentManager *, char *)TGTKgtk_recent_manager_has_item; extern(D) TGTKgtk_recent_manager_has_item gtk_recent_manager_has_item;
+alias extern (C) void * function(aGtkRecentManager *, char *, _GError * *)TGTKgtk_recent_manager_lookup_item; extern(D) TGTKgtk_recent_manager_lookup_item gtk_recent_manager_lookup_item;
+alias extern (C) int function(aGtkRecentManager *, char *, _GError * *)TGTKgtk_recent_manager_remove_item; extern(D) TGTKgtk_recent_manager_remove_item gtk_recent_manager_remove_item;
+alias extern (C) int function(aGtkRecentManager *, char *, aGtkRecentData *)TGTKgtk_recent_manager_add_full; extern(D) TGTKgtk_recent_manager_add_full gtk_recent_manager_add_full;
+alias extern (C) int function(aGtkRecentManager *, char *)TGTKgtk_recent_manager_add_item; extern(D) TGTKgtk_recent_manager_add_item gtk_recent_manager_add_item;
+alias extern (C) void function(aGtkRecentManager *, _GdkScreen *)TGTKgtk_recent_manager_set_screen; extern(D) TGTKgtk_recent_manager_set_screen gtk_recent_manager_set_screen;
+alias extern (C) _GtkRecentManager * function(_GdkScreen *)TGTKgtk_recent_manager_get_for_screen; extern(D) TGTKgtk_recent_manager_get_for_screen gtk_recent_manager_get_for_screen;
+alias extern (C) _GtkRecentManager * function()TGTKgtk_recent_manager_get_default; extern(D) TGTKgtk_recent_manager_get_default gtk_recent_manager_get_default;
+alias extern (C) _GtkRecentManager * function()TGTKgtk_recent_manager_new; extern(D) TGTKgtk_recent_manager_new gtk_recent_manager_new;
+alias extern (C) uint function()TGTKgtk_recent_manager_get_type; extern(D) TGTKgtk_recent_manager_get_type gtk_recent_manager_get_type;
+alias extern (C) uint function()TGTKgtk_recent_manager_error_quark; extern(D) TGTKgtk_recent_manager_error_quark gtk_recent_manager_error_quark;
+alias extern (C) void function(aGtkRadioToolButton *, _GSList *)TGTKgtk_radio_tool_button_set_group; extern(D) TGTKgtk_radio_tool_button_set_group gtk_radio_tool_button_set_group;
+alias extern (C) _GSList * function(aGtkRadioToolButton *)TGTKgtk_radio_tool_button_get_group; extern(D) TGTKgtk_radio_tool_button_get_group gtk_radio_tool_button_get_group;
+alias extern (C) _GtkToolItem * function(aGtkRadioToolButton *, char *)TGTKgtk_radio_tool_button_new_with_stock_from_widget; extern(D) TGTKgtk_radio_tool_button_new_with_stock_from_widget gtk_radio_tool_button_new_with_stock_from_widget;
+alias extern (C) _GtkToolItem * function(aGtkRadioToolButton *)TGTKgtk_radio_tool_button_new_from_widget; extern(D) TGTKgtk_radio_tool_button_new_from_widget gtk_radio_tool_button_new_from_widget;
+alias extern (C) _GtkToolItem * function(_GSList *, char *)TGTKgtk_radio_tool_button_new_from_stock; extern(D) TGTKgtk_radio_tool_button_new_from_stock gtk_radio_tool_button_new_from_stock;
+alias extern (C) _GtkToolItem * function(_GSList *)TGTKgtk_radio_tool_button_new; extern(D) TGTKgtk_radio_tool_button_new gtk_radio_tool_button_new;
+alias extern (C) uint function()TGTKgtk_radio_tool_button_get_type; extern(D) TGTKgtk_radio_tool_button_get_type gtk_radio_tool_button_get_type;
+alias extern (C) int function(aGtkToggleToolButton *)TGTKgtk_toggle_tool_button_get_active; extern(D) TGTKgtk_toggle_tool_button_get_active gtk_toggle_tool_button_get_active;
+alias extern (C) void function(aGtkToggleToolButton *, int)TGTKgtk_toggle_tool_button_set_active; extern(D) TGTKgtk_toggle_tool_button_set_active gtk_toggle_tool_button_set_active;
+alias extern (C) _GtkToolItem * function(char *)TGTKgtk_toggle_tool_button_new_from_stock; extern(D) TGTKgtk_toggle_tool_button_new_from_stock gtk_toggle_tool_button_new_from_stock;
+alias extern (C) _GtkToolItem * function()TGTKgtk_toggle_tool_button_new; extern(D) TGTKgtk_toggle_tool_button_new gtk_toggle_tool_button_new;
+alias extern (C) uint function()TGTKgtk_toggle_tool_button_get_type; extern(D) TGTKgtk_toggle_tool_button_get_type gtk_toggle_tool_button_get_type;
+alias extern (C) void function(aGtkRadioMenuItem *, _GSList *)TGTKgtk_radio_menu_item_set_group; extern(D) TGTKgtk_radio_menu_item_set_group gtk_radio_menu_item_set_group;
+alias extern (C) _GSList * function(aGtkRadioMenuItem *)TGTKgtk_radio_menu_item_get_group; extern(D) TGTKgtk_radio_menu_item_get_group gtk_radio_menu_item_get_group;
+alias extern (C) _GtkWidget * function(aGtkRadioMenuItem *, char *)TGTKgtk_radio_menu_item_new_with_label_from_widget; extern(D) TGTKgtk_radio_menu_item_new_with_label_from_widget gtk_radio_menu_item_new_with_label_from_widget;
+alias extern (C) _GtkWidget * function(aGtkRadioMenuItem *, char *)TGTKgtk_radio_menu_item_new_with_mnemonic_from_widget; extern(D) TGTKgtk_radio_menu_item_new_with_mnemonic_from_widget gtk_radio_menu_item_new_with_mnemonic_from_widget;
+alias extern (C) _GtkWidget * function(aGtkRadioMenuItem *)TGTKgtk_radio_menu_item_new_from_widget; extern(D) TGTKgtk_radio_menu_item_new_from_widget gtk_radio_menu_item_new_from_widget;
+alias extern (C) _GtkWidget * function(_GSList *, char *)TGTKgtk_radio_menu_item_new_with_mnemonic; extern(D) TGTKgtk_radio_menu_item_new_with_mnemonic gtk_radio_menu_item_new_with_mnemonic;
+alias extern (C) _GtkWidget * function(_GSList *, char *)TGTKgtk_radio_menu_item_new_with_label; extern(D) TGTKgtk_radio_menu_item_new_with_label gtk_radio_menu_item_new_with_label;
+alias extern (C) _GtkWidget * function(_GSList *)TGTKgtk_radio_menu_item_new; extern(D) TGTKgtk_radio_menu_item_new gtk_radio_menu_item_new;
+alias extern (C) uint function()TGTKgtk_radio_menu_item_get_type; extern(D) TGTKgtk_radio_menu_item_get_type gtk_radio_menu_item_get_type;
+alias extern (C) void function(aGtkRadioButton *, _GSList *)TGTKgtk_radio_button_set_group; extern(D) TGTKgtk_radio_button_set_group gtk_radio_button_set_group;
+alias extern (C) _GSList * function(aGtkRadioButton *)TGTKgtk_radio_button_get_group; extern(D) TGTKgtk_radio_button_get_group gtk_radio_button_get_group;
+alias extern (C) _GtkWidget * function(aGtkRadioButton *, char *)TGTKgtk_radio_button_new_with_mnemonic_from_widget; extern(D) TGTKgtk_radio_button_new_with_mnemonic_from_widget gtk_radio_button_new_with_mnemonic_from_widget;
+alias extern (C) _GtkWidget * function(_GSList *, char *)TGTKgtk_radio_button_new_with_mnemonic; extern(D) TGTKgtk_radio_button_new_with_mnemonic gtk_radio_button_new_with_mnemonic;
+alias extern (C) _GtkWidget * function(aGtkRadioButton *, char *)TGTKgtk_radio_button_new_with_label_from_widget; extern(D) TGTKgtk_radio_button_new_with_label_from_widget gtk_radio_button_new_with_label_from_widget;
+alias extern (C) _GtkWidget * function(_GSList *, char *)TGTKgtk_radio_button_new_with_label; extern(D) TGTKgtk_radio_button_new_with_label gtk_radio_button_new_with_label;
+alias extern (C) _GtkWidget * function(aGtkRadioButton *)TGTKgtk_radio_button_new_from_widget; extern(D) TGTKgtk_radio_button_new_from_widget gtk_radio_button_new_from_widget;
+alias extern (C) _GtkWidget * function(_GSList *)TGTKgtk_radio_button_new; extern(D) TGTKgtk_radio_button_new gtk_radio_button_new;
+alias extern (C) uint function()TGTKgtk_radio_button_get_type; extern(D) TGTKgtk_radio_button_get_type gtk_radio_button_get_type;
+alias extern (C) void function(aGtkRadioAction *, int)TGTKgtk_radio_action_set_current_value; extern(D) TGTKgtk_radio_action_set_current_value gtk_radio_action_set_current_value;
+alias extern (C) int function(aGtkRadioAction *)TGTKgtk_radio_action_get_current_value; extern(D) TGTKgtk_radio_action_get_current_value gtk_radio_action_get_current_value;
+alias extern (C) void function(aGtkRadioAction *, _GSList *)TGTKgtk_radio_action_set_group; extern(D) TGTKgtk_radio_action_set_group gtk_radio_action_set_group;
+alias extern (C) _GSList * function(aGtkRadioAction *)TGTKgtk_radio_action_get_group; extern(D) TGTKgtk_radio_action_get_group gtk_radio_action_get_group;
+alias extern (C) _GtkRadioAction * function(char *, char *, char *, char *, int)TGTKgtk_radio_action_new; extern(D) TGTKgtk_radio_action_new gtk_radio_action_new;
+alias extern (C) uint function()TGTKgtk_radio_action_get_type; extern(D) TGTKgtk_radio_action_get_type gtk_radio_action_get_type;
+alias extern (C) int function(aGtkToggleAction *)TGTKgtk_toggle_action_get_draw_as_radio; extern(D) TGTKgtk_toggle_action_get_draw_as_radio gtk_toggle_action_get_draw_as_radio;
+alias extern (C) void function(aGtkToggleAction *, int)TGTKgtk_toggle_action_set_draw_as_radio; extern(D) TGTKgtk_toggle_action_set_draw_as_radio gtk_toggle_action_set_draw_as_radio;
+alias extern (C) int function(aGtkToggleAction *)TGTKgtk_toggle_action_get_active; extern(D) TGTKgtk_toggle_action_get_active gtk_toggle_action_get_active;
+alias extern (C) void function(aGtkToggleAction *, int)TGTKgtk_toggle_action_set_active; extern(D) TGTKgtk_toggle_action_set_active gtk_toggle_action_set_active;
+alias extern (C) void function(aGtkToggleAction *)TGTKgtk_toggle_action_toggled; extern(D) TGTKgtk_toggle_action_toggled gtk_toggle_action_toggled;
+alias extern (C) _GtkToggleAction * function(char *, char *, char *, char *)TGTKgtk_toggle_action_new; extern(D) TGTKgtk_toggle_action_new gtk_toggle_action_new;
+alias extern (C) uint function()TGTKgtk_toggle_action_get_type; extern(D) TGTKgtk_toggle_action_get_type gtk_toggle_action_get_type;
+alias extern (C) void function(aGtkProgressBar *, double)TGTKgtk_progress_bar_update; extern(D) TGTKgtk_progress_bar_update gtk_progress_bar_update;
+alias extern (C) void function(aGtkProgressBar *, uint)TGTKgtk_progress_bar_set_activity_blocks; extern(D) TGTKgtk_progress_bar_set_activity_blocks gtk_progress_bar_set_activity_blocks;
+alias extern (C) void function(aGtkProgressBar *, uint)TGTKgtk_progress_bar_set_activity_step; extern(D) TGTKgtk_progress_bar_set_activity_step gtk_progress_bar_set_activity_step;
+alias extern (C) void function(aGtkProgressBar *, uint)TGTKgtk_progress_bar_set_discrete_blocks; extern(D) TGTKgtk_progress_bar_set_discrete_blocks gtk_progress_bar_set_discrete_blocks;
+alias extern (C) void function(aGtkProgressBar *, int)TGTKgtk_progress_bar_set_bar_style; extern(D) TGTKgtk_progress_bar_set_bar_style gtk_progress_bar_set_bar_style;
+alias extern (C) _GtkWidget * function(aGtkAdjustment *)TGTKgtk_progress_bar_new_with_adjustment; extern(D) TGTKgtk_progress_bar_new_with_adjustment gtk_progress_bar_new_with_adjustment;
+alias extern (C) int function(aGtkProgressBar *)TGTKgtk_progress_bar_get_ellipsize; extern(D) TGTKgtk_progress_bar_get_ellipsize gtk_progress_bar_get_ellipsize;
+alias extern (C) void function(aGtkProgressBar *, int)TGTKgtk_progress_bar_set_ellipsize; extern(D) TGTKgtk_progress_bar_set_ellipsize gtk_progress_bar_set_ellipsize;
+alias extern (C) int function(aGtkProgressBar *)TGTKgtk_progress_bar_get_orientation; extern(D) TGTKgtk_progress_bar_get_orientation gtk_progress_bar_get_orientation;
+alias extern (C) double function(aGtkProgressBar *)TGTKgtk_progress_bar_get_pulse_step; extern(D) TGTKgtk_progress_bar_get_pulse_step gtk_progress_bar_get_pulse_step;
+alias extern (C) double function(aGtkProgressBar *)TGTKgtk_progress_bar_get_fraction; extern(D) TGTKgtk_progress_bar_get_fraction gtk_progress_bar_get_fraction;
+alias extern (C) char * function(aGtkProgressBar *)TGTKgtk_progress_bar_get_text; extern(D) TGTKgtk_progress_bar_get_text gtk_progress_bar_get_text;
+alias extern (C) void function(aGtkProgressBar *, int)TGTKgtk_progress_bar_set_orientation; extern(D) TGTKgtk_progress_bar_set_orientation gtk_progress_bar_set_orientation;
+alias extern (C) void function(aGtkProgressBar *, double)TGTKgtk_progress_bar_set_pulse_step; extern(D) TGTKgtk_progress_bar_set_pulse_step gtk_progress_bar_set_pulse_step;
+alias extern (C) void function(aGtkProgressBar *, double)TGTKgtk_progress_bar_set_fraction; extern(D) TGTKgtk_progress_bar_set_fraction gtk_progress_bar_set_fraction;
+alias extern (C) void function(aGtkProgressBar *, char *)TGTKgtk_progress_bar_set_text; extern(D) TGTKgtk_progress_bar_set_text gtk_progress_bar_set_text;
+alias extern (C) void function(aGtkProgressBar *)TGTKgtk_progress_bar_pulse; extern(D) TGTKgtk_progress_bar_pulse gtk_progress_bar_pulse;
+alias extern (C) _GtkWidget * function()TGTKgtk_progress_bar_new; extern(D) TGTKgtk_progress_bar_new gtk_progress_bar_new;
+alias extern (C) uint function()TGTKgtk_progress_bar_get_type; extern(D) TGTKgtk_progress_bar_get_type gtk_progress_bar_get_type;
+alias extern (C) double function(aGtkProgress *, double)TGTKgtk_progress_get_percentage_from_value; extern(D) TGTKgtk_progress_get_percentage_from_value gtk_progress_get_percentage_from_value;
+alias extern (C) double function(aGtkProgress *)TGTKgtk_progress_get_current_percentage; extern(D) TGTKgtk_progress_get_current_percentage gtk_progress_get_current_percentage;
+alias extern (C) char * function(aGtkProgress *, double)TGTKgtk_progress_get_text_from_value; extern(D) TGTKgtk_progress_get_text_from_value gtk_progress_get_text_from_value;
+alias extern (C) char * function(aGtkProgress *)TGTKgtk_progress_get_current_text; extern(D) TGTKgtk_progress_get_current_text gtk_progress_get_current_text;
+alias extern (C) void function(aGtkProgress *, int)TGTKgtk_progress_set_activity_mode; extern(D) TGTKgtk_progress_set_activity_mode gtk_progress_set_activity_mode;
+alias extern (C) double function(aGtkProgress *)TGTKgtk_progress_get_value; extern(D) TGTKgtk_progress_get_value gtk_progress_get_value;
+alias extern (C) void function(aGtkProgress *, double)TGTKgtk_progress_set_value; extern(D) TGTKgtk_progress_set_value gtk_progress_set_value;
+alias extern (C) void function(aGtkProgress *, double)TGTKgtk_progress_set_percentage; extern(D) TGTKgtk_progress_set_percentage gtk_progress_set_percentage;
+alias extern (C) void function(aGtkProgress *, double, double, double)TGTKgtk_progress_configure; extern(D) TGTKgtk_progress_configure gtk_progress_configure;
+alias extern (C) void function(aGtkProgress *, aGtkAdjustment *)TGTKgtk_progress_set_adjustment; extern(D) TGTKgtk_progress_set_adjustment gtk_progress_set_adjustment;
+alias extern (C) void function(aGtkProgress *, char *)TGTKgtk_progress_set_format_string; extern(D) TGTKgtk_progress_set_format_string gtk_progress_set_format_string;
+alias extern (C) void function(aGtkProgress *, float, float)TGTKgtk_progress_set_text_alignment; extern(D) TGTKgtk_progress_set_text_alignment gtk_progress_set_text_alignment;
+alias extern (C) void function(aGtkProgress *, int)TGTKgtk_progress_set_show_text; extern(D) TGTKgtk_progress_set_show_text gtk_progress_set_show_text;
+alias extern (C) uint function()TGTKgtk_progress_get_type; extern(D) TGTKgtk_progress_get_type gtk_progress_get_type;
+alias extern (C) void function(aGtkWindow *, void *, void *, _BCD_func__9769, void *)TGTKgtk_print_run_page_setup_dialog_async; extern(D) TGTKgtk_print_run_page_setup_dialog_async gtk_print_run_page_setup_dialog_async;
+alias extern (C) void * function(aGtkWindow *, void *, void *)TGTKgtk_print_run_page_setup_dialog; extern(D) TGTKgtk_print_run_page_setup_dialog gtk_print_run_page_setup_dialog;
+alias extern (C) void function(aGtkPrintOperation *)TGTKgtk_print_operation_cancel; extern(D) TGTKgtk_print_operation_cancel gtk_print_operation_cancel;
+alias extern (C) int function(aGtkPrintOperation *)TGTKgtk_print_operation_is_finished; extern(D) TGTKgtk_print_operation_is_finished gtk_print_operation_is_finished;
+alias extern (C) char * function(aGtkPrintOperation *)TGTKgtk_print_operation_get_status_string; extern(D) TGTKgtk_print_operation_get_status_string gtk_print_operation_get_status_string;
+alias extern (C) int function(aGtkPrintOperation *)TGTKgtk_print_operation_get_status; extern(D) TGTKgtk_print_operation_get_status gtk_print_operation_get_status;
+alias extern (C) void function(aGtkPrintOperation *, _GError * *)TGTKgtk_print_operation_get_error; extern(D) TGTKgtk_print_operation_get_error gtk_print_operation_get_error;
+alias extern (C) int function(aGtkPrintOperation *, int, aGtkWindow *, _GError * *)TGTKgtk_print_operation_run; extern(D) TGTKgtk_print_operation_run gtk_print_operation_run;
+alias extern (C) void function(aGtkPrintOperation *, char *)TGTKgtk_print_operation_set_custom_tab_label; extern(D) TGTKgtk_print_operation_set_custom_tab_label gtk_print_operation_set_custom_tab_label;
+alias extern (C) void function(aGtkPrintOperation *, int)TGTKgtk_print_operation_set_allow_async; extern(D) TGTKgtk_print_operation_set_allow_async gtk_print_operation_set_allow_async;
+alias extern (C) void function(aGtkPrintOperation *, int)TGTKgtk_print_operation_set_show_progress; extern(D) TGTKgtk_print_operation_set_show_progress gtk_print_operation_set_show_progress;
+alias extern (C) void function(aGtkPrintOperation *, int)TGTKgtk_print_operation_set_track_print_status; extern(D) TGTKgtk_print_operation_set_track_print_status gtk_print_operation_set_track_print_status;
+alias extern (C) void function(aGtkPrintOperation *, char *)TGTKgtk_print_operation_set_export_filename; extern(D) TGTKgtk_print_operation_set_export_filename gtk_print_operation_set_export_filename;
+alias extern (C) void function(aGtkPrintOperation *, int)TGTKgtk_print_operation_set_unit; extern(D) TGTKgtk_print_operation_set_unit gtk_print_operation_set_unit;
+alias extern (C) void function(aGtkPrintOperation *, int)TGTKgtk_print_operation_set_use_full_page; extern(D) TGTKgtk_print_operation_set_use_full_page gtk_print_operation_set_use_full_page;
+alias extern (C) void function(aGtkPrintOperation *, int)TGTKgtk_print_operation_set_current_page; extern(D) TGTKgtk_print_operation_set_current_page gtk_print_operation_set_current_page;
+alias extern (C) void function(aGtkPrintOperation *, int)TGTKgtk_print_operation_set_n_pages; extern(D) TGTKgtk_print_operation_set_n_pages gtk_print_operation_set_n_pages;
+alias extern (C) void function(aGtkPrintOperation *, char *)TGTKgtk_print_operation_set_job_name; extern(D) TGTKgtk_print_operation_set_job_name gtk_print_operation_set_job_name;
+alias extern (C) void * function(aGtkPrintOperation *)TGTKgtk_print_operation_get_print_settings; extern(D) TGTKgtk_print_operation_get_print_settings gtk_print_operation_get_print_settings;
+alias extern (C) void function(aGtkPrintOperation *, void *)TGTKgtk_print_operation_set_print_settings; extern(D) TGTKgtk_print_operation_set_print_settings gtk_print_operation_set_print_settings;
+alias extern (C) void * function(aGtkPrintOperation *)TGTKgtk_print_operation_get_default_page_setup; extern(D) TGTKgtk_print_operation_get_default_page_setup gtk_print_operation_get_default_page_setup;
+alias extern (C) void function(aGtkPrintOperation *, void *)TGTKgtk_print_operation_set_default_page_setup; extern(D) TGTKgtk_print_operation_set_default_page_setup gtk_print_operation_set_default_page_setup;
+alias extern (C) _GtkPrintOperation * function()TGTKgtk_print_operation_new; extern(D) TGTKgtk_print_operation_new gtk_print_operation_new;
+alias extern (C) uint function()TGTKgtk_print_operation_get_type; extern(D) TGTKgtk_print_operation_get_type gtk_print_operation_get_type;
+alias extern (C) uint function()TGTKgtk_print_error_quark; extern(D) TGTKgtk_print_error_quark gtk_print_error_quark;
+alias extern (C) int function(void *, int)TGTKgtk_print_operation_preview_is_selected; extern(D) TGTKgtk_print_operation_preview_is_selected gtk_print_operation_preview_is_selected;
+alias extern (C) void function(void *)TGTKgtk_print_operation_preview_end_preview; extern(D) TGTKgtk_print_operation_preview_end_preview gtk_print_operation_preview_end_preview;
+alias extern (C) void function(void *, int)TGTKgtk_print_operation_preview_render_page; extern(D) TGTKgtk_print_operation_preview_render_page gtk_print_operation_preview_render_page;
+alias extern (C) uint function()TGTKgtk_print_operation_preview_get_type; extern(D) TGTKgtk_print_operation_preview_get_type gtk_print_operation_preview_get_type;
+alias extern (C) void function(void *, void *, double, double)TGTKgtk_print_context_set_cairo_context; extern(D) TGTKgtk_print_context_set_cairo_context gtk_print_context_set_cairo_context;
+alias extern (C) void * function(void *)TGTKgtk_print_context_create_pango_layout; extern(D) TGTKgtk_print_context_create_pango_layout gtk_print_context_create_pango_layout;
+alias extern (C) void * function(void *)TGTKgtk_print_context_create_pango_context; extern(D) TGTKgtk_print_context_create_pango_context gtk_print_context_create_pango_context;
+alias extern (C) void * function(void *)TGTKgtk_print_context_get_pango_fontmap; extern(D) TGTKgtk_print_context_get_pango_fontmap gtk_print_context_get_pango_fontmap;
+alias extern (C) double function(void *)TGTKgtk_print_context_get_dpi_y; extern(D) TGTKgtk_print_context_get_dpi_y gtk_print_context_get_dpi_y;
+alias extern (C) double function(void *)TGTKgtk_print_context_get_dpi_x; extern(D) TGTKgtk_print_context_get_dpi_x gtk_print_context_get_dpi_x;
+alias extern (C) double function(void *)TGTKgtk_print_context_get_height; extern(D) TGTKgtk_print_context_get_height gtk_print_context_get_height;
+alias extern (C) double function(void *)TGTKgtk_print_context_get_width; extern(D) TGTKgtk_print_context_get_width gtk_print_context_get_width;
+alias extern (C) void * function(void *)TGTKgtk_print_context_get_page_setup; extern(D) TGTKgtk_print_context_get_page_setup gtk_print_context_get_page_setup;
+alias extern (C) void * function(void *)TGTKgtk_print_context_get_cairo_context; extern(D) TGTKgtk_print_context_get_cairo_context gtk_print_context_get_cairo_context;
+alias extern (C) uint function()TGTKgtk_print_context_get_type; extern(D) TGTKgtk_print_context_get_type gtk_print_context_get_type;
+alias extern (C) void function(void *, char *)TGTKgtk_print_settings_set_output_bin; extern(D) TGTKgtk_print_settings_set_output_bin gtk_print_settings_set_output_bin;
+alias extern (C) char * function(void *)TGTKgtk_print_settings_get_output_bin; extern(D) TGTKgtk_print_settings_get_output_bin gtk_print_settings_get_output_bin;
+alias extern (C) void function(void *, char *)TGTKgtk_print_settings_set_finishings; extern(D) TGTKgtk_print_settings_set_finishings gtk_print_settings_set_finishings;
+alias extern (C) char * function(void *)TGTKgtk_print_settings_get_finishings; extern(D) TGTKgtk_print_settings_get_finishings gtk_print_settings_get_finishings;
+alias extern (C) void function(void *, char *)TGTKgtk_print_settings_set_dither; extern(D) TGTKgtk_print_settings_set_dither gtk_print_settings_set_dither;
+alias extern (C) char * function(void *)TGTKgtk_print_settings_get_dither; extern(D) TGTKgtk_print_settings_get_dither gtk_print_settings_get_dither;
+alias extern (C) void function(void *, char *)TGTKgtk_print_settings_set_media_type; extern(D) TGTKgtk_print_settings_set_media_type gtk_print_settings_set_media_type;
+alias extern (C) char * function(void *)TGTKgtk_print_settings_get_media_type; extern(D) TGTKgtk_print_settings_get_media_type gtk_print_settings_get_media_type;
+alias extern (C) void function(void *, char *)TGTKgtk_print_settings_set_default_source; extern(D) TGTKgtk_print_settings_set_default_source gtk_print_settings_set_default_source;
+alias extern (C) char * function(void *)TGTKgtk_print_settings_get_default_source; extern(D) TGTKgtk_print_settings_get_default_source gtk_print_settings_get_default_source;
+alias extern (C) void function(void *, int)TGTKgtk_print_settings_set_page_set; extern(D) TGTKgtk_print_settings_set_page_set gtk_print_settings_set_page_set;
+alias extern (C) int function(void *)TGTKgtk_print_settings_get_page_set; extern(D) TGTKgtk_print_settings_get_page_set gtk_print_settings_get_page_set;
+alias extern (C) void function(void *, aGtkPageRange *, int)TGTKgtk_print_settings_set_page_ranges; extern(D) TGTKgtk_print_settings_set_page_ranges gtk_print_settings_set_page_ranges;
+alias extern (C) _GtkPageRange * function(void *, int *)TGTKgtk_print_settings_get_page_ranges; extern(D) TGTKgtk_print_settings_get_page_ranges gtk_print_settings_get_page_ranges;
+alias extern (C) void function(void *, int)TGTKgtk_print_settings_set_print_pages; extern(D) TGTKgtk_print_settings_set_print_pages gtk_print_settings_set_print_pages;
+alias extern (C) int function(void *)TGTKgtk_print_settings_get_print_pages; extern(D) TGTKgtk_print_settings_get_print_pages gtk_print_settings_get_print_pages;
+alias extern (C) void function(void *, double)TGTKgtk_print_settings_set_scale; extern(D) TGTKgtk_print_settings_set_scale gtk_print_settings_set_scale;
+alias extern (C) double function(void *)TGTKgtk_print_settings_get_scale; extern(D) TGTKgtk_print_settings_get_scale gtk_print_settings_get_scale;
+alias extern (C) void function(void *, int)TGTKgtk_print_settings_set_resolution; extern(D) TGTKgtk_print_settings_set_resolution gtk_print_settings_set_resolution;
+alias extern (C) int function(void *)TGTKgtk_print_settings_get_resolution; extern(D) TGTKgtk_print_settings_get_resolution gtk_print_settings_get_resolution;
+alias extern (C) void function(void *, int)TGTKgtk_print_settings_set_number_up; extern(D) TGTKgtk_print_settings_set_number_up gtk_print_settings_set_number_up;
+alias extern (C) int function(void *)TGTKgtk_print_settings_get_number_up; extern(D) TGTKgtk_print_settings_get_number_up gtk_print_settings_get_number_up;
+alias extern (C) void function(void *, int)TGTKgtk_print_settings_set_n_copies; extern(D) TGTKgtk_print_settings_set_n_copies gtk_print_settings_set_n_copies;
+alias extern (C) int function(void *)TGTKgtk_print_settings_get_n_copies; extern(D) TGTKgtk_print_settings_get_n_copies gtk_print_settings_get_n_copies;
+alias extern (C) void function(void *, int)TGTKgtk_print_settings_set_quality; extern(D) TGTKgtk_print_settings_set_quality gtk_print_settings_set_quality;
+alias extern (C) int function(void *)TGTKgtk_print_settings_get_quality; extern(D) TGTKgtk_print_settings_get_quality gtk_print_settings_get_quality;
+alias extern (C) void function(void *, int)TGTKgtk_print_settings_set_duplex; extern(D) TGTKgtk_print_settings_set_duplex gtk_print_settings_set_duplex;
+alias extern (C) int function(void *)TGTKgtk_print_settings_get_duplex; extern(D) TGTKgtk_print_settings_get_duplex gtk_print_settings_get_duplex;
+alias extern (C) void function(void *, int)TGTKgtk_print_settings_set_reverse; extern(D) TGTKgtk_print_settings_set_reverse gtk_print_settings_set_reverse;
+alias extern (C) int function(void *)TGTKgtk_print_settings_get_reverse; extern(D) TGTKgtk_print_settings_get_reverse gtk_print_settings_get_reverse;
+alias extern (C) void function(void *, int)TGTKgtk_print_settings_set_collate; extern(D) TGTKgtk_print_settings_set_collate gtk_print_settings_set_collate;
+alias extern (C) int function(void *)TGTKgtk_print_settings_get_collate; extern(D) TGTKgtk_print_settings_get_collate gtk_print_settings_get_collate;
+alias extern (C) void function(void *, int)TGTKgtk_print_settings_set_use_color; extern(D) TGTKgtk_print_settings_set_use_color gtk_print_settings_set_use_color;
+alias extern (C) int function(void *)TGTKgtk_print_settings_get_use_color; extern(D) TGTKgtk_print_settings_get_use_color gtk_print_settings_get_use_color;
+alias extern (C) void function(void *, double, int)TGTKgtk_print_settings_set_paper_height; extern(D) TGTKgtk_print_settings_set_paper_height gtk_print_settings_set_paper_height;
+alias extern (C) double function(void *, int)TGTKgtk_print_settings_get_paper_height; extern(D) TGTKgtk_print_settings_get_paper_height gtk_print_settings_get_paper_height;
+alias extern (C) void function(void *, double, int)TGTKgtk_print_settings_set_paper_width; extern(D) TGTKgtk_print_settings_set_paper_width gtk_print_settings_set_paper_width;
+alias extern (C) double function(void *, int)TGTKgtk_print_settings_get_paper_width; extern(D) TGTKgtk_print_settings_get_paper_width gtk_print_settings_get_paper_width;
+alias extern (C) void function(void *, void *)TGTKgtk_print_settings_set_paper_size; extern(D) TGTKgtk_print_settings_set_paper_size gtk_print_settings_set_paper_size;
+alias extern (C) void * function(void *)TGTKgtk_print_settings_get_paper_size; extern(D) TGTKgtk_print_settings_get_paper_size gtk_print_settings_get_paper_size;
+alias extern (C) void function(void *, int)TGTKgtk_print_settings_set_orientation; extern(D) TGTKgtk_print_settings_set_orientation gtk_print_settings_set_orientation;
+alias extern (C) int function(void *)TGTKgtk_print_settings_get_orientation; extern(D) TGTKgtk_print_settings_get_orientation gtk_print_settings_get_orientation;
+alias extern (C) void function(void *, char *)TGTKgtk_print_settings_set_printer; extern(D) TGTKgtk_print_settings_set_printer gtk_print_settings_set_printer;
+alias extern (C) char * function(void *)TGTKgtk_print_settings_get_printer; extern(D) TGTKgtk_print_settings_get_printer gtk_print_settings_get_printer;
+alias extern (C) void function(void *, char *, int)TGTKgtk_print_settings_set_int; extern(D) TGTKgtk_print_settings_set_int gtk_print_settings_set_int;
+alias extern (C) int function(void *, char *, int)TGTKgtk_print_settings_get_int_with_default; extern(D) TGTKgtk_print_settings_get_int_with_default gtk_print_settings_get_int_with_default;
+alias extern (C) int function(void *, char *)TGTKgtk_print_settings_get_int; extern(D) TGTKgtk_print_settings_get_int gtk_print_settings_get_int;
+alias extern (C) void function(void *, char *, double, int)TGTKgtk_print_settings_set_length; extern(D) TGTKgtk_print_settings_set_length gtk_print_settings_set_length;
+alias extern (C) double function(void *, char *, int)TGTKgtk_print_settings_get_length; extern(D) TGTKgtk_print_settings_get_length gtk_print_settings_get_length;
+alias extern (C) void function(void *, char *, double)TGTKgtk_print_settings_set_double; extern(D) TGTKgtk_print_settings_set_double gtk_print_settings_set_double;
+alias extern (C) double function(void *, char *, double)TGTKgtk_print_settings_get_double_with_default; extern(D) TGTKgtk_print_settings_get_double_with_default gtk_print_settings_get_double_with_default;
+alias extern (C) double function(void *, char *)TGTKgtk_print_settings_get_double; extern(D) TGTKgtk_print_settings_get_double gtk_print_settings_get_double;
+alias extern (C) void function(void *, char *, int)TGTKgtk_print_settings_set_bool; extern(D) TGTKgtk_print_settings_set_bool gtk_print_settings_set_bool;
+alias extern (C) int function(void *, char *)TGTKgtk_print_settings_get_bool; extern(D) TGTKgtk_print_settings_get_bool gtk_print_settings_get_bool;
+alias extern (C) void function(void *, _BCD_func__9823, void *)TGTKgtk_print_settings_foreach; extern(D) TGTKgtk_print_settings_foreach gtk_print_settings_foreach;
+alias extern (C) void function(void *, char *)TGTKgtk_print_settings_unset; extern(D) TGTKgtk_print_settings_unset gtk_print_settings_unset;
+alias extern (C) void function(void *, char *, char *)TGTKgtk_print_settings_set; extern(D) TGTKgtk_print_settings_set gtk_print_settings_set;
+alias extern (C) char * function(void *, char *)TGTKgtk_print_settings_get; extern(D) TGTKgtk_print_settings_get gtk_print_settings_get;
+alias extern (C) int function(void *, char *)TGTKgtk_print_settings_has_key; extern(D) TGTKgtk_print_settings_has_key gtk_print_settings_has_key;
+alias extern (C) void function(void *, void *, char *)TGTKgtk_print_settings_to_key_file; extern(D) TGTKgtk_print_settings_to_key_file gtk_print_settings_to_key_file;
+alias extern (C) void * function(void *, char *, _GError * *)TGTKgtk_print_settings_new_from_key_file; extern(D) TGTKgtk_print_settings_new_from_key_file gtk_print_settings_new_from_key_file;
+alias extern (C) int function(void *, char *, _GError * *)TGTKgtk_print_settings_to_file; extern(D) TGTKgtk_print_settings_to_file gtk_print_settings_to_file;
+alias extern (C) void * function(char *, _GError * *)TGTKgtk_print_settings_new_from_file; extern(D) TGTKgtk_print_settings_new_from_file gtk_print_settings_new_from_file;
+alias extern (C) void * function(void *)TGTKgtk_print_settings_copy; extern(D) TGTKgtk_print_settings_copy gtk_print_settings_copy;
+alias extern (C) void * function()TGTKgtk_print_settings_new; extern(D) TGTKgtk_print_settings_new gtk_print_settings_new;
+alias extern (C) uint function()TGTKgtk_print_settings_get_type; extern(D) TGTKgtk_print_settings_get_type gtk_print_settings_get_type;
+alias extern (C) void function(void *, void *, char *)TGTKgtk_page_setup_to_key_file; extern(D) TGTKgtk_page_setup_to_key_file gtk_page_setup_to_key_file;
+alias extern (C) void * function(void *, char *, _GError * *)TGTKgtk_page_setup_new_from_key_file; extern(D) TGTKgtk_page_setup_new_from_key_file gtk_page_setup_new_from_key_file;
+alias extern (C) int function(void *, char *, _GError * *)TGTKgtk_page_setup_to_file; extern(D) TGTKgtk_page_setup_to_file gtk_page_setup_to_file;
+alias extern (C) void * function(char *, _GError * *)TGTKgtk_page_setup_new_from_file; extern(D) TGTKgtk_page_setup_new_from_file gtk_page_setup_new_from_file;
+alias extern (C) double function(void *, int)TGTKgtk_page_setup_get_page_height; extern(D) TGTKgtk_page_setup_get_page_height gtk_page_setup_get_page_height;
+alias extern (C) double function(void *, int)TGTKgtk_page_setup_get_page_width; extern(D) TGTKgtk_page_setup_get_page_width gtk_page_setup_get_page_width;
+alias extern (C) double function(void *, int)TGTKgtk_page_setup_get_paper_height; extern(D) TGTKgtk_page_setup_get_paper_height gtk_page_setup_get_paper_height;
+alias extern (C) double function(void *, int)TGTKgtk_page_setup_get_paper_width; extern(D) TGTKgtk_page_setup_get_paper_width gtk_page_setup_get_paper_width;
+alias extern (C) void function(void *, void *)TGTKgtk_page_setup_set_paper_size_and_default_margins; extern(D) TGTKgtk_page_setup_set_paper_size_and_default_margins gtk_page_setup_set_paper_size_and_default_margins;
+alias extern (C) void function(void *, double, int)TGTKgtk_page_setup_set_right_margin; extern(D) TGTKgtk_page_setup_set_right_margin gtk_page_setup_set_right_margin;
+alias extern (C) double function(void *, int)TGTKgtk_page_setup_get_right_margin; extern(D) TGTKgtk_page_setup_get_right_margin gtk_page_setup_get_right_margin;
+alias extern (C) void function(void *, double, int)TGTKgtk_page_setup_set_left_margin; extern(D) TGTKgtk_page_setup_set_left_margin gtk_page_setup_set_left_margin;
+alias extern (C) double function(void *, int)TGTKgtk_page_setup_get_left_margin; extern(D) TGTKgtk_page_setup_get_left_margin gtk_page_setup_get_left_margin;
+alias extern (C) void function(void *, double, int)TGTKgtk_page_setup_set_bottom_margin; extern(D) TGTKgtk_page_setup_set_bottom_margin gtk_page_setup_set_bottom_margin;
+alias extern (C) double function(void *, int)TGTKgtk_page_setup_get_bottom_margin; extern(D) TGTKgtk_page_setup_get_bottom_margin gtk_page_setup_get_bottom_margin;
+alias extern (C) void function(void *, double, int)TGTKgtk_page_setup_set_top_margin; extern(D) TGTKgtk_page_setup_set_top_margin gtk_page_setup_set_top_margin;
+alias extern (C) double function(void *, int)TGTKgtk_page_setup_get_top_margin; extern(D) TGTKgtk_page_setup_get_top_margin gtk_page_setup_get_top_margin;
+alias extern (C) void function(void *, void *)TGTKgtk_page_setup_set_paper_size; extern(D) TGTKgtk_page_setup_set_paper_size gtk_page_setup_set_paper_size;
+alias extern (C) void * function(void *)TGTKgtk_page_setup_get_paper_size; extern(D) TGTKgtk_page_setup_get_paper_size gtk_page_setup_get_paper_size;
+alias extern (C) void function(void *, int)TGTKgtk_page_setup_set_orientation; extern(D) TGTKgtk_page_setup_set_orientation gtk_page_setup_set_orientation;
+alias extern (C) int function(void *)TGTKgtk_page_setup_get_orientation; extern(D) TGTKgtk_page_setup_get_orientation gtk_page_setup_get_orientation;
+alias extern (C) void * function(void *)TGTKgtk_page_setup_copy; extern(D) TGTKgtk_page_setup_copy gtk_page_setup_copy;
+alias extern (C) void * function()TGTKgtk_page_setup_new; extern(D) TGTKgtk_page_setup_new gtk_page_setup_new;
+alias extern (C) uint function()TGTKgtk_page_setup_get_type; extern(D) TGTKgtk_page_setup_get_type gtk_page_setup_get_type;
+alias extern (C) void function(void *, void *, char *)TGTKgtk_paper_size_to_key_file; extern(D) TGTKgtk_paper_size_to_key_file gtk_paper_size_to_key_file;
+alias extern (C) void * function(void *, char *, _GError * *)TGTKgtk_paper_size_new_from_key_file; extern(D) TGTKgtk_paper_size_new_from_key_file gtk_paper_size_new_from_key_file;
+alias extern (C) char * function()TGTKgtk_paper_size_get_default; extern(D) TGTKgtk_paper_size_get_default gtk_paper_size_get_default;
+alias extern (C) double function(void *, int)TGTKgtk_paper_size_get_default_right_margin; extern(D) TGTKgtk_paper_size_get_default_right_margin gtk_paper_size_get_default_right_margin;
+alias extern (C) double function(void *, int)TGTKgtk_paper_size_get_default_left_margin; extern(D) TGTKgtk_paper_size_get_default_left_margin gtk_paper_size_get_default_left_margin;
+alias extern (C) double function(void *, int)TGTKgtk_paper_size_get_default_bottom_margin; extern(D) TGTKgtk_paper_size_get_default_bottom_margin gtk_paper_size_get_default_bottom_margin;
+alias extern (C) double function(void *, int)TGTKgtk_paper_size_get_default_top_margin; extern(D) TGTKgtk_paper_size_get_default_top_margin gtk_paper_size_get_default_top_margin;
+alias extern (C) void function(void *, double, double, int)TGTKgtk_paper_size_set_size; extern(D) TGTKgtk_paper_size_set_size gtk_paper_size_set_size;
+alias extern (C) int function(void *)TGTKgtk_paper_size_is_custom; extern(D) TGTKgtk_paper_size_is_custom gtk_paper_size_is_custom;
+alias extern (C) double function(void *, int)TGTKgtk_paper_size_get_height; extern(D) TGTKgtk_paper_size_get_height gtk_paper_size_get_height;
+alias extern (C) double function(void *, int)TGTKgtk_paper_size_get_width; extern(D) TGTKgtk_paper_size_get_width gtk_paper_size_get_width;
+alias extern (C) char * function(void *)TGTKgtk_paper_size_get_ppd_name; extern(D) TGTKgtk_paper_size_get_ppd_name gtk_paper_size_get_ppd_name;
+alias extern (C) char * function(void *)TGTKgtk_paper_size_get_display_name; extern(D) TGTKgtk_paper_size_get_display_name gtk_paper_size_get_display_name;
+alias extern (C) char * function(void *)TGTKgtk_paper_size_get_name; extern(D) TGTKgtk_paper_size_get_name gtk_paper_size_get_name;
+alias extern (C) _GList * function(int)TGTKgtk_paper_size_get_paper_sizes; extern(D) TGTKgtk_paper_size_get_paper_sizes gtk_paper_size_get_paper_sizes;
+alias extern (C) int function(void *, void *)TGTKgtk_paper_size_is_equal; extern(D) TGTKgtk_paper_size_is_equal gtk_paper_size_is_equal;
+alias extern (C) void function(void *)TGTKgtk_paper_size_free; extern(D) TGTKgtk_paper_size_free gtk_paper_size_free;
+alias extern (C) void * function(void *)TGTKgtk_paper_size_copy; extern(D) TGTKgtk_paper_size_copy gtk_paper_size_copy;
+alias extern (C) void * function(char *, char *, double, double, int)TGTKgtk_paper_size_new_custom; extern(D) TGTKgtk_paper_size_new_custom gtk_paper_size_new_custom;
+alias extern (C) void * function(char *, char *, double, double)TGTKgtk_paper_size_new_from_ppd; extern(D) TGTKgtk_paper_size_new_from_ppd gtk_paper_size_new_from_ppd;
+alias extern (C) void * function(char *)TGTKgtk_paper_size_new; extern(D) TGTKgtk_paper_size_new gtk_paper_size_new;
+alias extern (C) uint function()TGTKgtk_paper_size_get_type; extern(D) TGTKgtk_paper_size_get_type gtk_paper_size_get_type;
+alias extern (C) void function()TGTKgtk_preview_reset; extern(D) TGTKgtk_preview_reset gtk_preview_reset;
+alias extern (C) _GtkPreviewInfo * function()TGTKgtk_preview_get_info; extern(D) TGTKgtk_preview_get_info gtk_preview_get_info;
+alias extern (C) _GdkColormap * function()TGTKgtk_preview_get_cmap; extern(D) TGTKgtk_preview_get_cmap gtk_preview_get_cmap;
+alias extern (C) _GdkVisual * function()TGTKgtk_preview_get_visual; extern(D) TGTKgtk_preview_get_visual gtk_preview_get_visual;
+alias extern (C) void function(aGtkPreview *, int)TGTKgtk_preview_set_dither; extern(D) TGTKgtk_preview_set_dither gtk_preview_set_dither;
+alias extern (C) void function(int)TGTKgtk_preview_set_reserved; extern(D) TGTKgtk_preview_set_reserved gtk_preview_set_reserved;
+alias extern (C) void function(int)TGTKgtk_preview_set_install_cmap; extern(D) TGTKgtk_preview_set_install_cmap gtk_preview_set_install_cmap;
+alias extern (C) void function(uint, uint, uint, uint)TGTKgtk_preview_set_color_cube; extern(D) TGTKgtk_preview_set_color_cube gtk_preview_set_color_cube;
+alias extern (C) void function(double)TGTKgtk_preview_set_gamma; extern(D) TGTKgtk_preview_set_gamma gtk_preview_set_gamma;
+alias extern (C) void function(aGtkPreview *, int)TGTKgtk_preview_set_expand; extern(D) TGTKgtk_preview_set_expand gtk_preview_set_expand;
+alias extern (C) void function(aGtkPreview *, char *, int, int, int)TGTKgtk_preview_draw_row; extern(D) TGTKgtk_preview_draw_row gtk_preview_draw_row;
+alias extern (C) void function(aGtkPreview *, _GdkDrawable *, _GdkGC *, int, int, int, int, int, int)TGTKgtk_preview_put; extern(D) TGTKgtk_preview_put gtk_preview_put;
+alias extern (C) void function(aGtkPreview *, int, int)TGTKgtk_preview_size; extern(D) TGTKgtk_preview_size gtk_preview_size;
+alias extern (C) _GtkWidget * function(int)TGTKgtk_preview_new; extern(D) TGTKgtk_preview_new gtk_preview_new;
+alias extern (C) void function()TGTKgtk_preview_uninit; extern(D) TGTKgtk_preview_uninit gtk_preview_uninit;
+alias extern (C) uint function()TGTKgtk_preview_get_type; extern(D) TGTKgtk_preview_get_type gtk_preview_get_type;
+//alias extern (C) void function(aGtkPlug *, aGtkSocket *)TGTK_gtk_plug_remove_from_socket; extern(D) TGTK_gtk_plug_remove_from_socket _gtk_plug_remove_from_socket;
+//alias extern (C) void function(aGtkPlug *, aGtkSocket *)TGTK_gtk_plug_add_to_socket; extern(D) TGTK_gtk_plug_add_to_socket _gtk_plug_add_to_socket;
+alias extern (C) uint function(aGtkPlug *)TGTKgtk_plug_get_id; extern(D) TGTKgtk_plug_get_id gtk_plug_get_id;
+alias extern (C) _GtkWidget * function(_GdkDisplay *, uint)TGTKgtk_plug_new_for_display; extern(D) TGTKgtk_plug_new_for_display gtk_plug_new_for_display;
+alias extern (C) void function(aGtkPlug *, _GdkDisplay *, uint)TGTKgtk_plug_construct_for_display; extern(D) TGTKgtk_plug_construct_for_display gtk_plug_construct_for_display;
+alias extern (C) _GtkWidget * function(uint)TGTKgtk_plug_new; extern(D) TGTKgtk_plug_new gtk_plug_new;
+alias extern (C) void function(aGtkPlug *, uint)TGTKgtk_plug_construct; extern(D) TGTKgtk_plug_construct gtk_plug_construct;
+alias extern (C) uint function()TGTKgtk_plug_get_type; extern(D) TGTKgtk_plug_get_type gtk_plug_get_type;
+alias extern (C) void function(aGtkSocket *, uint)TGTKgtk_socket_steal; extern(D) TGTKgtk_socket_steal gtk_socket_steal;
+alias extern (C) uint function(aGtkSocket *)TGTKgtk_socket_get_id; extern(D) TGTKgtk_socket_get_id gtk_socket_get_id;
+alias extern (C) void function(aGtkSocket *, uint)TGTKgtk_socket_add_id; extern(D) TGTKgtk_socket_add_id gtk_socket_add_id;
+alias extern (C) _GtkWidget * function()TGTKgtk_socket_new; extern(D) TGTKgtk_socket_new gtk_socket_new;
+alias extern (C) uint function()TGTKgtk_socket_get_type; extern(D) TGTKgtk_socket_get_type gtk_socket_get_type;
+alias extern (C) void function(aGtkPixmap *, int)TGTKgtk_pixmap_set_build_insensitive; extern(D) TGTKgtk_pixmap_set_build_insensitive gtk_pixmap_set_build_insensitive;
+alias extern (C) void function(aGtkPixmap *, _GdkDrawable * *, _GdkDrawable * *)TGTKgtk_pixmap_get; extern(D) TGTKgtk_pixmap_get gtk_pixmap_get;
+alias extern (C) void function(aGtkPixmap *, _GdkDrawable *, _GdkDrawable *)TGTKgtk_pixmap_set; extern(D) TGTKgtk_pixmap_set gtk_pixmap_set;
+alias extern (C) _GtkWidget * function(_GdkDrawable *, _GdkDrawable *)TGTKgtk_pixmap_new; extern(D) TGTKgtk_pixmap_new gtk_pixmap_new;
+alias extern (C) uint function()TGTKgtk_pixmap_get_type; extern(D) TGTKgtk_pixmap_get_type gtk_pixmap_get_type;
+alias extern (C) void function(aGtkOptionMenu *, uint)TGTKgtk_option_menu_set_history; extern(D) TGTKgtk_option_menu_set_history gtk_option_menu_set_history;
+alias extern (C) int function(aGtkOptionMenu *)TGTKgtk_option_menu_get_history; extern(D) TGTKgtk_option_menu_get_history gtk_option_menu_get_history;
+alias extern (C) void function(aGtkOptionMenu *)TGTKgtk_option_menu_remove_menu; extern(D) TGTKgtk_option_menu_remove_menu gtk_option_menu_remove_menu;
+alias extern (C) void function(aGtkOptionMenu *, aGtkWidget *)TGTKgtk_option_menu_set_menu; extern(D) TGTKgtk_option_menu_set_menu gtk_option_menu_set_menu;
+alias extern (C) _GtkWidget * function(aGtkOptionMenu *)TGTKgtk_option_menu_get_menu; extern(D) TGTKgtk_option_menu_get_menu gtk_option_menu_get_menu;
+alias extern (C) _GtkWidget * function()TGTKgtk_option_menu_new; extern(D) TGTKgtk_option_menu_new gtk_option_menu_new;
+alias extern (C) uint function()TGTKgtk_option_menu_get_type; extern(D) TGTKgtk_option_menu_get_type gtk_option_menu_get_type;
+alias extern (C) void function(aGtkOldEditable *)TGTKgtk_old_editable_changed; extern(D) TGTKgtk_old_editable_changed gtk_old_editable_changed;
+alias extern (C) void function(aGtkOldEditable *, int, uint)TGTKgtk_old_editable_claim_selection; extern(D) TGTKgtk_old_editable_claim_selection gtk_old_editable_claim_selection;
+alias extern (C) uint function()TGTKgtk_old_editable_get_type; extern(D) TGTKgtk_old_editable_get_type gtk_old_editable_get_type;
+alias extern (C) void function(aGtkNotebook *, aGtkWidget *, int)TGTKgtk_notebook_set_tab_detachable; extern(D) TGTKgtk_notebook_set_tab_detachable gtk_notebook_set_tab_detachable;
+alias extern (C) int function(aGtkNotebook *, aGtkWidget *)TGTKgtk_notebook_get_tab_detachable; extern(D) TGTKgtk_notebook_get_tab_detachable gtk_notebook_get_tab_detachable;
+alias extern (C) void function(aGtkNotebook *, aGtkWidget *, int)TGTKgtk_notebook_set_tab_reorderable; extern(D) TGTKgtk_notebook_set_tab_reorderable gtk_notebook_set_tab_reorderable;
+alias extern (C) int function(aGtkNotebook *, aGtkWidget *)TGTKgtk_notebook_get_tab_reorderable; extern(D) TGTKgtk_notebook_get_tab_reorderable gtk_notebook_get_tab_reorderable;
+alias extern (C) void function(aGtkNotebook *, aGtkWidget *, int)TGTKgtk_notebook_reorder_child; extern(D) TGTKgtk_notebook_reorder_child gtk_notebook_reorder_child;
+alias extern (C) void function(aGtkNotebook *, aGtkWidget *, int, int, int)TGTKgtk_notebook_set_tab_label_packing; extern(D) TGTKgtk_notebook_set_tab_label_packing gtk_notebook_set_tab_label_packing;
+alias extern (C) void function(aGtkNotebook *, aGtkWidget *, int *, int *, int *)TGTKgtk_notebook_query_tab_label_packing; extern(D) TGTKgtk_notebook_query_tab_label_packing gtk_notebook_query_tab_label_packing;
+alias extern (C) char * function(aGtkNotebook *, aGtkWidget *)TGTKgtk_notebook_get_menu_label_text; extern(D) TGTKgtk_notebook_get_menu_label_text gtk_notebook_get_menu_label_text;
+alias extern (C) void function(aGtkNotebook *, aGtkWidget *, char *)TGTKgtk_notebook_set_menu_label_text; extern(D) TGTKgtk_notebook_set_menu_label_text gtk_notebook_set_menu_label_text;
+alias extern (C) void function(aGtkNotebook *, aGtkWidget *, aGtkWidget *)TGTKgtk_notebook_set_menu_label; extern(D) TGTKgtk_notebook_set_menu_label gtk_notebook_set_menu_label;
+alias extern (C) _GtkWidget * function(aGtkNotebook *, aGtkWidget *)TGTKgtk_notebook_get_menu_label; extern(D) TGTKgtk_notebook_get_menu_label gtk_notebook_get_menu_label;
+alias extern (C) char * function(aGtkNotebook *, aGtkWidget *)TGTKgtk_notebook_get_tab_label_text; extern(D) TGTKgtk_notebook_get_tab_label_text gtk_notebook_get_tab_label_text;
+alias extern (C) void function(aGtkNotebook *, aGtkWidget *, char *)TGTKgtk_notebook_set_tab_label_text; extern(D) TGTKgtk_notebook_set_tab_label_text gtk_notebook_set_tab_label_text;
+alias extern (C) void function(aGtkNotebook *, aGtkWidget *, aGtkWidget *)TGTKgtk_notebook_set_tab_label; extern(D) TGTKgtk_notebook_set_tab_label gtk_notebook_set_tab_label;
+alias extern (C) _GtkWidget * function(aGtkNotebook *, aGtkWidget *)TGTKgtk_notebook_get_tab_label; extern(D) TGTKgtk_notebook_get_tab_label gtk_notebook_get_tab_label;
+alias extern (C) void function(aGtkNotebook *)TGTKgtk_notebook_popup_disable; extern(D) TGTKgtk_notebook_popup_disable gtk_notebook_popup_disable;
+alias extern (C) void function(aGtkNotebook *)TGTKgtk_notebook_popup_enable; extern(D) TGTKgtk_notebook_popup_enable gtk_notebook_popup_enable;
+alias extern (C) int function(aGtkNotebook *)TGTKgtk_notebook_get_scrollable; extern(D) TGTKgtk_notebook_get_scrollable gtk_notebook_get_scrollable;
+alias extern (C) void function(aGtkNotebook *, int)TGTKgtk_notebook_set_scrollable; extern(D) TGTKgtk_notebook_set_scrollable gtk_notebook_set_scrollable;
+alias extern (C) void function(aGtkNotebook *, uint)TGTKgtk_notebook_set_tab_vborder; extern(D) TGTKgtk_notebook_set_tab_vborder gtk_notebook_set_tab_vborder;
+alias extern (C) void function(aGtkNotebook *, uint)TGTKgtk_notebook_set_tab_hborder; extern(D) TGTKgtk_notebook_set_tab_hborder gtk_notebook_set_tab_hborder;
+alias extern (C) void function(aGtkNotebook *, uint)TGTKgtk_notebook_set_tab_border; extern(D) TGTKgtk_notebook_set_tab_border gtk_notebook_set_tab_border;
+alias extern (C) void function(aGtkNotebook *, int)TGTKgtk_notebook_set_homogeneous_tabs; extern(D) TGTKgtk_notebook_set_homogeneous_tabs gtk_notebook_set_homogeneous_tabs;
+alias extern (C) int function(aGtkNotebook *)TGTKgtk_notebook_get_tab_pos; extern(D) TGTKgtk_notebook_get_tab_pos gtk_notebook_get_tab_pos;
+alias extern (C) void function(aGtkNotebook *, int)TGTKgtk_notebook_set_tab_pos; extern(D) TGTKgtk_notebook_set_tab_pos gtk_notebook_set_tab_pos;
+alias extern (C) int function(aGtkNotebook *)TGTKgtk_notebook_get_show_tabs; extern(D) TGTKgtk_notebook_get_show_tabs gtk_notebook_get_show_tabs;
+alias extern (C) void function(aGtkNotebook *, int)TGTKgtk_notebook_set_show_tabs; extern(D) TGTKgtk_notebook_set_show_tabs gtk_notebook_set_show_tabs;
+alias extern (C) int function(aGtkNotebook *)TGTKgtk_notebook_get_show_border; extern(D) TGTKgtk_notebook_get_show_border gtk_notebook_get_show_border;
+alias extern (C) void function(aGtkNotebook *, int)TGTKgtk_notebook_set_show_border; extern(D) TGTKgtk_notebook_set_show_border gtk_notebook_set_show_border;
+alias extern (C) void function(aGtkNotebook *)TGTKgtk_notebook_prev_page; extern(D) TGTKgtk_notebook_prev_page gtk_notebook_prev_page;
+alias extern (C) void function(aGtkNotebook *)TGTKgtk_notebook_next_page; extern(D) TGTKgtk_notebook_next_page gtk_notebook_next_page;
+alias extern (C) void function(aGtkNotebook *, int)TGTKgtk_notebook_set_current_page; extern(D) TGTKgtk_notebook_set_current_page gtk_notebook_set_current_page;
+alias extern (C) int function(aGtkNotebook *, aGtkWidget *)TGTKgtk_notebook_page_num; extern(D) TGTKgtk_notebook_page_num gtk_notebook_page_num;
+alias extern (C) int function(aGtkNotebook *)TGTKgtk_notebook_get_n_pages; extern(D) TGTKgtk_notebook_get_n_pages gtk_notebook_get_n_pages;
+alias extern (C) _GtkWidget * function(aGtkNotebook *, int)TGTKgtk_notebook_get_nth_page; extern(D) TGTKgtk_notebook_get_nth_page gtk_notebook_get_nth_page;
+alias extern (C) int function(aGtkNotebook *)TGTKgtk_notebook_get_current_page; extern(D) TGTKgtk_notebook_get_current_page gtk_notebook_get_current_page;
+alias extern (C) void * function(aGtkNotebook *)TGTKgtk_notebook_get_group; extern(D) TGTKgtk_notebook_get_group gtk_notebook_get_group;
+alias extern (C) void function(aGtkNotebook *, void *)TGTKgtk_notebook_set_group; extern(D) TGTKgtk_notebook_set_group gtk_notebook_set_group;
+alias extern (C) int function(aGtkNotebook *)TGTKgtk_notebook_get_group_id; extern(D) TGTKgtk_notebook_get_group_id gtk_notebook_get_group_id;
+alias extern (C) void function(aGtkNotebook *, int)TGTKgtk_notebook_set_group_id; extern(D) TGTKgtk_notebook_set_group_id gtk_notebook_set_group_id;
+alias extern (C) void function(_BCD_func__9964, void *, _BCD_func__13158)TGTKgtk_notebook_set_window_creation_hook; extern(D) TGTKgtk_notebook_set_window_creation_hook gtk_notebook_set_window_creation_hook;
+alias extern (C) void function(aGtkNotebook *, int)TGTKgtk_notebook_remove_page; extern(D) TGTKgtk_notebook_remove_page gtk_notebook_remove_page;
+alias extern (C) int function(aGtkNotebook *, aGtkWidget *, aGtkWidget *, aGtkWidget *, int)TGTKgtk_notebook_insert_page_menu; extern(D) TGTKgtk_notebook_insert_page_menu gtk_notebook_insert_page_menu;
+alias extern (C) int function(aGtkNotebook *, aGtkWidget *, aGtkWidget *, int)TGTKgtk_notebook_insert_page; extern(D) TGTKgtk_notebook_insert_page gtk_notebook_insert_page;
+alias extern (C) int function(aGtkNotebook *, aGtkWidget *, aGtkWidget *, aGtkWidget *)TGTKgtk_notebook_prepend_page_menu; extern(D) TGTKgtk_notebook_prepend_page_menu gtk_notebook_prepend_page_menu;
+alias extern (C) int function(aGtkNotebook *, aGtkWidget *, aGtkWidget *)TGTKgtk_notebook_prepend_page; extern(D) TGTKgtk_notebook_prepend_page gtk_notebook_prepend_page;
+alias extern (C) int function(aGtkNotebook *, aGtkWidget *, aGtkWidget *, aGtkWidget *)TGTKgtk_notebook_append_page_menu; extern(D) TGTKgtk_notebook_append_page_menu gtk_notebook_append_page_menu;
+alias extern (C) int function(aGtkNotebook *, aGtkWidget *, aGtkWidget *)TGTKgtk_notebook_append_page; extern(D) TGTKgtk_notebook_append_page gtk_notebook_append_page;
+alias extern (C) _GtkWidget * function()TGTKgtk_notebook_new; extern(D) TGTKgtk_notebook_new gtk_notebook_new;
+alias extern (C) uint function()TGTKgtk_notebook_get_type; extern(D) TGTKgtk_notebook_get_type gtk_notebook_get_type;
+//alias extern (C) void function(aGtkSettings *, char *)TGTK_gtk_modules_settings_changed; extern(D) TGTK_gtk_modules_settings_changed _gtk_modules_settings_changed;
+//alias extern (C) void function(int *, char * * *, char *)TGTK_gtk_modules_init; extern(D) TGTK_gtk_modules_init _gtk_modules_init;
+//alias extern (C) char * * function(char *)TGTK_gtk_get_module_path; extern(D) TGTK_gtk_get_module_path _gtk_get_module_path;
+//alias extern (C) char * function(char *, char *)TGTK_gtk_find_module; extern(D) TGTK_gtk_find_module _gtk_find_module;
+alias extern (C) void function(aGtkMessageDialog *, char *, ...)TGTKgtk_message_dialog_format_secondary_markup; extern(D) TGTKgtk_message_dialog_format_secondary_markup gtk_message_dialog_format_secondary_markup;
+alias extern (C) void function(aGtkMessageDialog *, char *, ...)TGTKgtk_message_dialog_format_secondary_text; extern(D) TGTKgtk_message_dialog_format_secondary_text gtk_message_dialog_format_secondary_text;
+alias extern (C) void function(aGtkMessageDialog *, char *)TGTKgtk_message_dialog_set_markup; extern(D) TGTKgtk_message_dialog_set_markup gtk_message_dialog_set_markup;
+alias extern (C) void function(aGtkMessageDialog *, aGtkWidget *)TGTKgtk_message_dialog_set_image; extern(D) TGTKgtk_message_dialog_set_image gtk_message_dialog_set_image;
+alias extern (C) _GtkWidget * function(aGtkWindow *, int, int, int, char *, ...)TGTKgtk_message_dialog_new_with_markup; extern(D) TGTKgtk_message_dialog_new_with_markup gtk_message_dialog_new_with_markup;
+alias extern (C) _GtkWidget * function(aGtkWindow *, int, int, int, char *, ...)TGTKgtk_message_dialog_new; extern(D) TGTKgtk_message_dialog_new gtk_message_dialog_new;
+alias extern (C) uint function()TGTKgtk_message_dialog_get_type; extern(D) TGTKgtk_message_dialog_get_type gtk_message_dialog_get_type;
+alias extern (C) void function(aGtkMenuToolButton *, char *)TGTKgtk_menu_tool_button_set_arrow_tooltip_markup; extern(D) TGTKgtk_menu_tool_button_set_arrow_tooltip_markup gtk_menu_tool_button_set_arrow_tooltip_markup;
+alias extern (C) void function(aGtkMenuToolButton *, char *)TGTKgtk_menu_tool_button_set_arrow_tooltip_text; extern(D) TGTKgtk_menu_tool_button_set_arrow_tooltip_text gtk_menu_tool_button_set_arrow_tooltip_text;
+alias extern (C) void function(aGtkMenuToolButton *, aGtkTooltips *, char *, char *)TGTKgtk_menu_tool_button_set_arrow_tooltip; extern(D) TGTKgtk_menu_tool_button_set_arrow_tooltip gtk_menu_tool_button_set_arrow_tooltip;
+alias extern (C) _GtkWidget * function(aGtkMenuToolButton *)TGTKgtk_menu_tool_button_get_menu; extern(D) TGTKgtk_menu_tool_button_get_menu gtk_menu_tool_button_get_menu;
+alias extern (C) void function(aGtkMenuToolButton *, aGtkWidget *)TGTKgtk_menu_tool_button_set_menu; extern(D) TGTKgtk_menu_tool_button_set_menu gtk_menu_tool_button_set_menu;
+alias extern (C) _GtkToolItem * function(char *)TGTKgtk_menu_tool_button_new_from_stock; extern(D) TGTKgtk_menu_tool_button_new_from_stock gtk_menu_tool_button_new_from_stock;
+alias extern (C) _GtkToolItem * function(aGtkWidget *, char *)TGTKgtk_menu_tool_button_new; extern(D) TGTKgtk_menu_tool_button_new gtk_menu_tool_button_new;
+alias extern (C) uint function()TGTKgtk_menu_tool_button_get_type; extern(D) TGTKgtk_menu_tool_button_get_type gtk_menu_tool_button_get_type;
+//alias extern (C) _GtkWidget * function(aGtkToolButton *)TGTK_gtk_tool_button_get_button; extern(D) TGTK_gtk_tool_button_get_button _gtk_tool_button_get_button;
+alias extern (C) _GtkWidget * function(aGtkToolButton *)TGTKgtk_tool_button_get_label_widget; extern(D) TGTKgtk_tool_button_get_label_widget gtk_tool_button_get_label_widget;
+alias extern (C) void function(aGtkToolButton *, aGtkWidget *)TGTKgtk_tool_button_set_label_widget; extern(D) TGTKgtk_tool_button_set_label_widget gtk_tool_button_set_label_widget;
+alias extern (C) _GtkWidget * function(aGtkToolButton *)TGTKgtk_tool_button_get_icon_widget; extern(D) TGTKgtk_tool_button_get_icon_widget gtk_tool_button_get_icon_widget;
+alias extern (C) void function(aGtkToolButton *, aGtkWidget *)TGTKgtk_tool_button_set_icon_widget; extern(D) TGTKgtk_tool_button_set_icon_widget gtk_tool_button_set_icon_widget;
+alias extern (C) char * function(aGtkToolButton *)TGTKgtk_tool_button_get_icon_name; extern(D) TGTKgtk_tool_button_get_icon_name gtk_tool_button_get_icon_name;
+alias extern (C) void function(aGtkToolButton *, char *)TGTKgtk_tool_button_set_icon_name; extern(D) TGTKgtk_tool_button_set_icon_name gtk_tool_button_set_icon_name;
+alias extern (C) char * function(aGtkToolButton *)TGTKgtk_tool_button_get_stock_id; extern(D) TGTKgtk_tool_button_get_stock_id gtk_tool_button_get_stock_id;
+alias extern (C) void function(aGtkToolButton *, char *)TGTKgtk_tool_button_set_stock_id; extern(D) TGTKgtk_tool_button_set_stock_id gtk_tool_button_set_stock_id;
+alias extern (C) int function(aGtkToolButton *)TGTKgtk_tool_button_get_use_underline; extern(D) TGTKgtk_tool_button_get_use_underline gtk_tool_button_get_use_underline;
+alias extern (C) void function(aGtkToolButton *, int)TGTKgtk_tool_button_set_use_underline; extern(D) TGTKgtk_tool_button_set_use_underline gtk_tool_button_set_use_underline;
+alias extern (C) char * function(aGtkToolButton *)TGTKgtk_tool_button_get_label; extern(D) TGTKgtk_tool_button_get_label gtk_tool_button_get_label;
+alias extern (C) void function(aGtkToolButton *, char *)TGTKgtk_tool_button_set_label; extern(D) TGTKgtk_tool_button_set_label gtk_tool_button_set_label;
+alias extern (C) _GtkToolItem * function(char *)TGTKgtk_tool_button_new_from_stock; extern(D) TGTKgtk_tool_button_new_from_stock gtk_tool_button_new_from_stock;
+alias extern (C) _GtkToolItem * function(aGtkWidget *, char *)TGTKgtk_tool_button_new; extern(D) TGTKgtk_tool_button_new gtk_tool_button_new;
+alias extern (C) uint function()TGTKgtk_tool_button_get_type; extern(D) TGTKgtk_tool_button_get_type gtk_tool_button_get_type;
+//alias extern (C) void function(aGtkToolItem *)TGTK_gtk_tool_item_toolbar_reconfigured; extern(D) TGTK_gtk_tool_item_toolbar_reconfigured _gtk_tool_item_toolbar_reconfigured;
+alias extern (C) void function(aGtkToolItem *)TGTKgtk_tool_item_rebuild_menu; extern(D) TGTKgtk_tool_item_rebuild_menu gtk_tool_item_rebuild_menu;
+alias extern (C) void function(aGtkToolItem *, char *, aGtkWidget *)TGTKgtk_tool_item_set_proxy_menu_item; extern(D) TGTKgtk_tool_item_set_proxy_menu_item gtk_tool_item_set_proxy_menu_item;
+alias extern (C) _GtkWidget * function(aGtkToolItem *, char *)TGTKgtk_tool_item_get_proxy_menu_item; extern(D) TGTKgtk_tool_item_get_proxy_menu_item gtk_tool_item_get_proxy_menu_item;
+alias extern (C) _GtkWidget * function(aGtkToolItem *)TGTKgtk_tool_item_retrieve_proxy_menu_item; extern(D) TGTKgtk_tool_item_retrieve_proxy_menu_item gtk_tool_item_retrieve_proxy_menu_item;
+alias extern (C) int function(aGtkToolItem *)TGTKgtk_tool_item_get_relief_style; extern(D) TGTKgtk_tool_item_get_relief_style gtk_tool_item_get_relief_style;
+alias extern (C) int function(aGtkToolItem *)TGTKgtk_tool_item_get_toolbar_style; extern(D) TGTKgtk_tool_item_get_toolbar_style gtk_tool_item_get_toolbar_style;
+alias extern (C) int function(aGtkToolItem *)TGTKgtk_tool_item_get_orientation; extern(D) TGTKgtk_tool_item_get_orientation gtk_tool_item_get_orientation;
+alias extern (C) int function(aGtkToolItem *)TGTKgtk_tool_item_get_icon_size; extern(D) TGTKgtk_tool_item_get_icon_size gtk_tool_item_get_icon_size;
+alias extern (C) void function(aGtkToolItem *, int)TGTKgtk_tool_item_set_is_important; extern(D) TGTKgtk_tool_item_set_is_important gtk_tool_item_set_is_important;
+alias extern (C) int function(aGtkToolItem *)TGTKgtk_tool_item_get_is_important; extern(D) TGTKgtk_tool_item_get_is_important gtk_tool_item_get_is_important;
+alias extern (C) int function(aGtkToolItem *)TGTKgtk_tool_item_get_visible_vertical; extern(D) TGTKgtk_tool_item_get_visible_vertical gtk_tool_item_get_visible_vertical;
+alias extern (C) void function(aGtkToolItem *, int)TGTKgtk_tool_item_set_visible_vertical; extern(D) TGTKgtk_tool_item_set_visible_vertical gtk_tool_item_set_visible_vertical;
+alias extern (C) int function(aGtkToolItem *)TGTKgtk_tool_item_get_visible_horizontal; extern(D) TGTKgtk_tool_item_get_visible_horizontal gtk_tool_item_get_visible_horizontal;
+alias extern (C) void function(aGtkToolItem *, int)TGTKgtk_tool_item_set_visible_horizontal; extern(D) TGTKgtk_tool_item_set_visible_horizontal gtk_tool_item_set_visible_horizontal;
+alias extern (C) int function(aGtkToolItem *)TGTKgtk_tool_item_get_use_drag_window; extern(D) TGTKgtk_tool_item_get_use_drag_window gtk_tool_item_get_use_drag_window;
+alias extern (C) void function(aGtkToolItem *, int)TGTKgtk_tool_item_set_use_drag_window; extern(D) TGTKgtk_tool_item_set_use_drag_window gtk_tool_item_set_use_drag_window;
+alias extern (C) void function(aGtkToolItem *, char *)TGTKgtk_tool_item_set_tooltip_markup; extern(D) TGTKgtk_tool_item_set_tooltip_markup gtk_tool_item_set_tooltip_markup;
+alias extern (C) void function(aGtkToolItem *, char *)TGTKgtk_tool_item_set_tooltip_text; extern(D) TGTKgtk_tool_item_set_tooltip_text gtk_tool_item_set_tooltip_text;
+alias extern (C) void function(aGtkToolItem *, aGtkTooltips *, char *, char *)TGTKgtk_tool_item_set_tooltip; extern(D) TGTKgtk_tool_item_set_tooltip gtk_tool_item_set_tooltip;
+alias extern (C) int function(aGtkToolItem *)TGTKgtk_tool_item_get_expand; extern(D) TGTKgtk_tool_item_get_expand gtk_tool_item_get_expand;
+alias extern (C) void function(aGtkToolItem *, int)TGTKgtk_tool_item_set_expand; extern(D) TGTKgtk_tool_item_set_expand gtk_tool_item_set_expand;
+alias extern (C) int function(aGtkToolItem *)TGTKgtk_tool_item_get_homogeneous; extern(D) TGTKgtk_tool_item_get_homogeneous gtk_tool_item_get_homogeneous;
+alias extern (C) void function(aGtkToolItem *, int)TGTKgtk_tool_item_set_homogeneous; extern(D) TGTKgtk_tool_item_set_homogeneous gtk_tool_item_set_homogeneous;
+alias extern (C) _GtkToolItem * function()TGTKgtk_tool_item_new; extern(D) TGTKgtk_tool_item_new gtk_tool_item_new;
+alias extern (C) uint function()TGTKgtk_tool_item_get_type; extern(D) TGTKgtk_tool_item_get_type gtk_tool_item_get_type;
+alias extern (C) int function(aGtkWindow *, _GtkTooltips * *, _GtkWidget * *)TGTKgtk_tooltips_get_info_from_tip_window; extern(D) TGTKgtk_tooltips_get_info_from_tip_window gtk_tooltips_get_info_from_tip_window;
+alias extern (C) void function(aGtkTooltips *)TGTKgtk_tooltips_force_window; extern(D) TGTKgtk_tooltips_force_window gtk_tooltips_force_window;
+alias extern (C) _GtkTooltipsData * function(aGtkWidget *)TGTKgtk_tooltips_data_get; extern(D) TGTKgtk_tooltips_data_get gtk_tooltips_data_get;
+alias extern (C) void function(aGtkTooltips *, aGtkWidget *, char *, char *)TGTKgtk_tooltips_set_tip; extern(D) TGTKgtk_tooltips_set_tip gtk_tooltips_set_tip;
+alias extern (C) void function(aGtkTooltips *, uint)TGTKgtk_tooltips_set_delay; extern(D) TGTKgtk_tooltips_set_delay gtk_tooltips_set_delay;
+alias extern (C) void function(aGtkTooltips *)TGTKgtk_tooltips_disable; extern(D) TGTKgtk_tooltips_disable gtk_tooltips_disable;
+alias extern (C) void function(aGtkTooltips *)TGTKgtk_tooltips_enable; extern(D) TGTKgtk_tooltips_enable gtk_tooltips_enable;
+alias extern (C) _GtkTooltips * function()TGTKgtk_tooltips_new; extern(D) TGTKgtk_tooltips_new gtk_tooltips_new;
+alias extern (C) uint function()TGTKgtk_tooltips_get_type; extern(D) TGTKgtk_tooltips_get_type gtk_tooltips_get_type;
+//alias extern (C) void function(aGtkMenuBar *, int)TGTK_gtk_menu_bar_cycle_focus; extern(D) TGTK_gtk_menu_bar_cycle_focus _gtk_menu_bar_cycle_focus;
+alias extern (C) void function(aGtkMenuBar *, int)TGTKgtk_menu_bar_set_child_pack_direction; extern(D) TGTKgtk_menu_bar_set_child_pack_direction gtk_menu_bar_set_child_pack_direction;
+alias extern (C) int function(aGtkMenuBar *)TGTKgtk_menu_bar_get_child_pack_direction; extern(D) TGTKgtk_menu_bar_get_child_pack_direction gtk_menu_bar_get_child_pack_direction;
+alias extern (C) void function(aGtkMenuBar *, int)TGTKgtk_menu_bar_set_pack_direction; extern(D) TGTKgtk_menu_bar_set_pack_direction gtk_menu_bar_set_pack_direction;
+alias extern (C) int function(aGtkMenuBar *)TGTKgtk_menu_bar_get_pack_direction; extern(D) TGTKgtk_menu_bar_get_pack_direction gtk_menu_bar_get_pack_direction;
+alias extern (C) _GtkWidget * function()TGTKgtk_menu_bar_new; extern(D) TGTKgtk_menu_bar_new gtk_menu_bar_new;
+alias extern (C) uint function()TGTKgtk_menu_bar_get_type; extern(D) TGTKgtk_menu_bar_get_type gtk_menu_bar_get_type;
+//alias extern (C) char * function()TGTK_gtk_get_lc_ctype; extern(D) TGTK_gtk_get_lc_ctype _gtk_get_lc_ctype;
+//alias extern (C) int function(_GSignalInvocationHint *, _GValue *, _GValue *, void *)TGTK_gtk_boolean_handled_accumulator; extern(D) TGTK_gtk_boolean_handled_accumulator _gtk_boolean_handled_accumulator;
+alias extern (C) void function(aGtkWidget *, _GdkEvent *)TGTKgtk_propagate_event; extern(D) TGTKgtk_propagate_event gtk_propagate_event;
+alias extern (C) _GtkWidget * function(_GdkEvent *)TGTKgtk_get_event_widget; extern(D) TGTKgtk_get_event_widget gtk_get_event_widget;
+alias extern (C) int function(int *)TGTKgtk_get_current_event_state; extern(D) TGTKgtk_get_current_event_state gtk_get_current_event_state;
+alias extern (C) uint function()TGTKgtk_get_current_event_time; extern(D) TGTKgtk_get_current_event_time gtk_get_current_event_time;
+alias extern (C) _GdkEvent * function()TGTKgtk_get_current_event; extern(D) TGTKgtk_get_current_event gtk_get_current_event;
+alias extern (C) void function(uint)TGTKgtk_key_snooper_remove; extern(D) TGTKgtk_key_snooper_remove gtk_key_snooper_remove;
+alias extern (C) uint function(_BCD_func__10115, void *)TGTKgtk_key_snooper_install; extern(D) TGTKgtk_key_snooper_install gtk_key_snooper_install;
+alias extern (C) void function(uint)TGTKgtk_input_remove; extern(D) TGTKgtk_input_remove gtk_input_remove;
+alias extern (C) uint function(int, int, _BCD_func__13745, _BCD_func__13157, void *, _BCD_func__13158)TGTKgtk_input_add_full; extern(D) TGTKgtk_input_add_full gtk_input_add_full;
+alias extern (C) void function(void *)TGTKgtk_idle_remove_by_data; extern(D) TGTKgtk_idle_remove_by_data gtk_idle_remove_by_data;
+alias extern (C) void function(uint)TGTKgtk_idle_remove; extern(D) TGTKgtk_idle_remove gtk_idle_remove;
+alias extern (C) uint function(int, _BCD_func__12884, _BCD_func__13157, void *, _BCD_func__13158)TGTKgtk_idle_add_full; extern(D) TGTKgtk_idle_add_full gtk_idle_add_full;
+alias extern (C) uint function(int, _BCD_func__12884, void *)TGTKgtk_idle_add_priority; extern(D) TGTKgtk_idle_add_priority gtk_idle_add_priority;
+alias extern (C) uint function(_BCD_func__12884, void *)TGTKgtk_idle_add; extern(D) TGTKgtk_idle_add gtk_idle_add;
+alias extern (C) void function(uint)TGTKgtk_timeout_remove; extern(D) TGTKgtk_timeout_remove gtk_timeout_remove;
+alias extern (C) uint function(uint, _BCD_func__12884, _BCD_func__13157, void *, _BCD_func__13158)TGTKgtk_timeout_add_full; extern(D) TGTKgtk_timeout_add_full gtk_timeout_add_full;
+alias extern (C) uint function(uint, _BCD_func__12884, void *)TGTKgtk_timeout_add; extern(D) TGTKgtk_timeout_add gtk_timeout_add;
+alias extern (C) void function(void *)TGTKgtk_quit_remove_by_data; extern(D) TGTKgtk_quit_remove_by_data gtk_quit_remove_by_data;
+alias extern (C) void function(uint)TGTKgtk_quit_remove; extern(D) TGTKgtk_quit_remove gtk_quit_remove;
+alias extern (C) uint function(uint, _BCD_func__12884, _BCD_func__13157, void *, _BCD_func__13158)TGTKgtk_quit_add_full; extern(D) TGTKgtk_quit_add_full gtk_quit_add_full;
+alias extern (C) uint function(uint, _BCD_func__12884, void *)TGTKgtk_quit_add; extern(D) TGTKgtk_quit_add gtk_quit_add;
+alias extern (C) void function(uint, aGtkObject *)TGTKgtk_quit_add_destroy; extern(D) TGTKgtk_quit_add_destroy gtk_quit_add_destroy;
+alias extern (C) void function(_BCD_func__12884, void *)TGTKgtk_init_add; extern(D) TGTKgtk_init_add gtk_init_add;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_grab_remove; extern(D) TGTKgtk_grab_remove gtk_grab_remove;
+alias extern (C) _GtkWidget * function()TGTKgtk_grab_get_current; extern(D) TGTKgtk_grab_get_current gtk_grab_get_current;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_grab_add; extern(D) TGTKgtk_grab_add gtk_grab_add;
+alias extern (C) int function()TGTKgtk_false; extern(D) TGTKgtk_false gtk_false;
+alias extern (C) int function()TGTKgtk_true; extern(D) TGTKgtk_true gtk_true;
+alias extern (C) int function(int)TGTKgtk_main_iteration_do; extern(D) TGTKgtk_main_iteration_do gtk_main_iteration_do;
+alias extern (C) int function()TGTKgtk_main_iteration; extern(D) TGTKgtk_main_iteration gtk_main_iteration;
+alias extern (C) void function()TGTKgtk_main_quit; extern(D) TGTKgtk_main_quit gtk_main_quit;
+alias extern (C) uint function()TGTKgtk_main_level; extern(D) TGTKgtk_main_level gtk_main_level;
+alias extern (C) void function()TGTKgtk_main; extern(D) TGTKgtk_main gtk_main;
+alias extern (C) void function(_GdkEvent *)TGTKgtk_main_do_event; extern(D) TGTKgtk_main_do_event gtk_main_do_event;
+alias extern (C) int function()TGTKgtk_events_pending; extern(D) TGTKgtk_events_pending gtk_events_pending;
+alias extern (C) void * function()TGTKgtk_get_default_language; extern(D) TGTKgtk_get_default_language gtk_get_default_language;
+//alias extern (C) char * function()TGTKgtk_set_locale; extern(D) TGTKgtk_set_locale gtk_set_locale;
+alias extern (C) void function()TGTKgtk_disable_setlocale; extern(D) TGTKgtk_disable_setlocale gtk_disable_setlocale;
+alias extern (C) void function(int)TGTKgtk_exit; extern(D) TGTKgtk_exit gtk_exit;
+alias extern (C) void * function(int)TGTKgtk_get_option_group; extern(D) TGTKgtk_get_option_group gtk_get_option_group;
+alias extern (C) int function(int *, char * * *, char *, _GOptionEntry *, char *, _GError * *)TGTKgtk_init_with_args; extern(D) TGTKgtk_init_with_args gtk_init_with_args;
+//alias extern (C) int function(int *, char * * *)TGTKgtk_init_check; extern(D) TGTKgtk_init_check gtk_init_check;
+alias extern (C) void function(int *, char * * *)TGTKgtk_init; extern(D) TGTKgtk_init gtk_init;
+alias extern (C) int function(int *, char * * *)TGTKgtk_parse_args; extern(D) TGTKgtk_parse_args gtk_parse_args;
+alias extern (C) char * function(uint, uint, uint)TGTKgtk_check_version; extern(D) TGTKgtk_check_version gtk_check_version;
+// alias extern (C) uint* TGTKgtk_interface_age; extern(D) TGTKgtk_interface_age gtk_interface_age;
+// alias extern (C) uint* TGTKgtk_binary_age; extern(D) TGTKgtk_binary_age gtk_binary_age;
+// alias extern (C) uint* TGTKgtk_micro_version; extern(D) TGTKgtk_micro_version gtk_micro_version;
+// alias extern (C) uint* TGTKgtk_minor_version; extern(D) TGTKgtk_minor_version gtk_minor_version;
+// alias extern (C) uint* TGTKgtk_major_version; extern(D) TGTKgtk_major_version gtk_major_version;
+alias extern (C) void function(aGtkList *)TGTKgtk_list_end_drag_selection; extern(D) TGTKgtk_list_end_drag_selection gtk_list_end_drag_selection;
+alias extern (C) void function(aGtkList *)TGTKgtk_list_undo_selection; extern(D) TGTKgtk_list_undo_selection gtk_list_undo_selection;
+alias extern (C) void function(aGtkList *, aGtkWidget *)TGTKgtk_list_toggle_row; extern(D) TGTKgtk_list_toggle_row gtk_list_toggle_row;
+alias extern (C) void function(aGtkList *)TGTKgtk_list_toggle_focus_row; extern(D) TGTKgtk_list_toggle_focus_row gtk_list_toggle_focus_row;
+alias extern (C) void function(aGtkList *)TGTKgtk_list_toggle_add_mode; extern(D) TGTKgtk_list_toggle_add_mode gtk_list_toggle_add_mode;
+alias extern (C) void function(aGtkList *, int, float)TGTKgtk_list_scroll_vertical; extern(D) TGTKgtk_list_scroll_vertical gtk_list_scroll_vertical;
+alias extern (C) void function(aGtkList *, int, float)TGTKgtk_list_scroll_horizontal; extern(D) TGTKgtk_list_scroll_horizontal gtk_list_scroll_horizontal;
+alias extern (C) void function(aGtkList *)TGTKgtk_list_unselect_all; extern(D) TGTKgtk_list_unselect_all gtk_list_unselect_all;
+alias extern (C) void function(aGtkList *)TGTKgtk_list_select_all; extern(D) TGTKgtk_list_select_all gtk_list_select_all;
+alias extern (C) void function(aGtkList *)TGTKgtk_list_end_selection; extern(D) TGTKgtk_list_end_selection gtk_list_end_selection;
+alias extern (C) void function(aGtkList *)TGTKgtk_list_start_selection; extern(D) TGTKgtk_list_start_selection gtk_list_start_selection;
+alias extern (C) void function(aGtkList *, int, float, int)TGTKgtk_list_extend_selection; extern(D) TGTKgtk_list_extend_selection gtk_list_extend_selection;
+alias extern (C) void function(aGtkList *, int)TGTKgtk_list_set_selection_mode; extern(D) TGTKgtk_list_set_selection_mode gtk_list_set_selection_mode;
+alias extern (C) int function(aGtkList *, aGtkWidget *)TGTKgtk_list_child_position; extern(D) TGTKgtk_list_child_position gtk_list_child_position;
+alias extern (C) void function(aGtkList *, aGtkWidget *)TGTKgtk_list_unselect_child; extern(D) TGTKgtk_list_unselect_child gtk_list_unselect_child;
+alias extern (C) void function(aGtkList *, aGtkWidget *)TGTKgtk_list_select_child; extern(D) TGTKgtk_list_select_child gtk_list_select_child;
+alias extern (C) void function(aGtkList *, int)TGTKgtk_list_unselect_item; extern(D) TGTKgtk_list_unselect_item gtk_list_unselect_item;
+alias extern (C) void function(aGtkList *, int)TGTKgtk_list_select_item; extern(D) TGTKgtk_list_select_item gtk_list_select_item;
+alias extern (C) void function(aGtkList *, int, int)TGTKgtk_list_clear_items; extern(D) TGTKgtk_list_clear_items gtk_list_clear_items;
+alias extern (C) void function(aGtkList *, _GList *)TGTKgtk_list_remove_items_no_unref; extern(D) TGTKgtk_list_remove_items_no_unref gtk_list_remove_items_no_unref;
+alias extern (C) void function(aGtkList *, _GList *)TGTKgtk_list_remove_items; extern(D) TGTKgtk_list_remove_items gtk_list_remove_items;
+alias extern (C) void function(aGtkList *, _GList *)TGTKgtk_list_prepend_items; extern(D) TGTKgtk_list_prepend_items gtk_list_prepend_items;
+alias extern (C) void function(aGtkList *, _GList *)TGTKgtk_list_append_items; extern(D) TGTKgtk_list_append_items gtk_list_append_items;
+alias extern (C) void function(aGtkList *, _GList *, int)TGTKgtk_list_insert_items; extern(D) TGTKgtk_list_insert_items gtk_list_insert_items;
+alias extern (C) _GtkWidget * function()TGTKgtk_list_new; extern(D) TGTKgtk_list_new gtk_list_new;
+alias extern (C) uint function()TGTKgtk_list_get_type; extern(D) TGTKgtk_list_get_type gtk_list_get_type;
+alias extern (C) void function(aGtkListItem *)TGTKgtk_list_item_deselect; extern(D) TGTKgtk_list_item_deselect gtk_list_item_deselect;
+alias extern (C) void function(aGtkListItem *)TGTKgtk_list_item_select; extern(D) TGTKgtk_list_item_select gtk_list_item_select;
+alias extern (C) _GtkWidget * function(char *)TGTKgtk_list_item_new_with_label; extern(D) TGTKgtk_list_item_new_with_label gtk_list_item_new_with_label;
+alias extern (C) _GtkWidget * function()TGTKgtk_list_item_new; extern(D) TGTKgtk_list_item_new gtk_list_item_new;
+alias extern (C) uint function()TGTKgtk_list_item_get_type; extern(D) TGTKgtk_list_item_get_type gtk_list_item_get_type;
+alias extern (C) _BCD_func__10158 function(_BCD_func__10158, void *, _BCD_func__13158)TGTKgtk_link_button_set_uri_hook; extern(D) TGTKgtk_link_button_set_uri_hook gtk_link_button_set_uri_hook;
+alias extern (C) void function(aGtkLinkButton *, char *)TGTKgtk_link_button_set_uri; extern(D) TGTKgtk_link_button_set_uri gtk_link_button_set_uri;
+alias extern (C) char * function(aGtkLinkButton *)TGTKgtk_link_button_get_uri; extern(D) TGTKgtk_link_button_get_uri gtk_link_button_get_uri;
+alias extern (C) _GtkWidget * function(char *, char *)TGTKgtk_link_button_new_with_label; extern(D) TGTKgtk_link_button_new_with_label gtk_link_button_new_with_label;
+alias extern (C) _GtkWidget * function(char *)TGTKgtk_link_button_new; extern(D) TGTKgtk_link_button_new gtk_link_button_new;
+alias extern (C) uint function()TGTKgtk_link_button_get_type; extern(D) TGTKgtk_link_button_get_type gtk_link_button_get_type;
+alias extern (C) void function(aGtkLayout *)TGTKgtk_layout_thaw; extern(D) TGTKgtk_layout_thaw gtk_layout_thaw;
+alias extern (C) void function(aGtkLayout *)TGTKgtk_layout_freeze; extern(D) TGTKgtk_layout_freeze gtk_layout_freeze;
+alias extern (C) void function(aGtkLayout *, aGtkAdjustment *)TGTKgtk_layout_set_vadjustment; extern(D) TGTKgtk_layout_set_vadjustment gtk_layout_set_vadjustment;
+alias extern (C) void function(aGtkLayout *, aGtkAdjustment *)TGTKgtk_layout_set_hadjustment; extern(D) TGTKgtk_layout_set_hadjustment gtk_layout_set_hadjustment;
+alias extern (C) _GtkAdjustment * function(aGtkLayout *)TGTKgtk_layout_get_vadjustment; extern(D) TGTKgtk_layout_get_vadjustment gtk_layout_get_vadjustment;
+alias extern (C) _GtkAdjustment * function(aGtkLayout *)TGTKgtk_layout_get_hadjustment; extern(D) TGTKgtk_layout_get_hadjustment gtk_layout_get_hadjustment;
+alias extern (C) void function(aGtkLayout *, uint *, uint *)TGTKgtk_layout_get_size; extern(D) TGTKgtk_layout_get_size gtk_layout_get_size;
+alias extern (C) void function(aGtkLayout *, uint, uint)TGTKgtk_layout_set_size; extern(D) TGTKgtk_layout_set_size gtk_layout_set_size;
+alias extern (C) void function(aGtkLayout *, aGtkWidget *, int, int)TGTKgtk_layout_move; extern(D) TGTKgtk_layout_move gtk_layout_move;
+alias extern (C) void function(aGtkLayout *, aGtkWidget *, int, int)TGTKgtk_layout_put; extern(D) TGTKgtk_layout_put gtk_layout_put;
+alias extern (C) _GtkWidget * function(aGtkAdjustment *, aGtkAdjustment *)TGTKgtk_layout_new; extern(D) TGTKgtk_layout_new gtk_layout_new;
+alias extern (C) uint function()TGTKgtk_layout_get_type; extern(D) TGTKgtk_layout_get_type gtk_layout_get_type;
+alias extern (C) _GdkScreen * function(aGtkInvisible *)TGTKgtk_invisible_get_screen; extern(D) TGTKgtk_invisible_get_screen gtk_invisible_get_screen;
+alias extern (C) void function(aGtkInvisible *, _GdkScreen *)TGTKgtk_invisible_set_screen; extern(D) TGTKgtk_invisible_set_screen gtk_invisible_set_screen;
+alias extern (C) _GtkWidget * function(_GdkScreen *)TGTKgtk_invisible_new_for_screen; extern(D) TGTKgtk_invisible_new_for_screen gtk_invisible_new_for_screen;
+alias extern (C) _GtkWidget * function()TGTKgtk_invisible_new; extern(D) TGTKgtk_invisible_new gtk_invisible_new;
+alias extern (C) uint function()TGTKgtk_invisible_get_type; extern(D) TGTKgtk_invisible_get_type gtk_invisible_get_type;
+alias extern (C) _GtkWidget * function()TGTKgtk_input_dialog_new; extern(D) TGTKgtk_input_dialog_new gtk_input_dialog_new;
+alias extern (C) uint function()TGTKgtk_input_dialog_get_type; extern(D) TGTKgtk_input_dialog_get_type gtk_input_dialog_get_type;
+alias extern (C) void function(aGtkIMMulticontext *, aGtkMenuShell *)TGTKgtk_im_multicontext_append_menuitems; extern(D) TGTKgtk_im_multicontext_append_menuitems gtk_im_multicontext_append_menuitems;
+alias extern (C) _GtkIMContext * function()TGTKgtk_im_multicontext_new; extern(D) TGTKgtk_im_multicontext_new gtk_im_multicontext_new;
+alias extern (C) uint function()TGTKgtk_im_multicontext_get_type; extern(D) TGTKgtk_im_multicontext_get_type gtk_im_multicontext_get_type;
+alias extern (C) void function(aGtkIMContextSimple *, ushort *, int, int)TGTKgtk_im_context_simple_add_table; extern(D) TGTKgtk_im_context_simple_add_table gtk_im_context_simple_add_table;
+alias extern (C) _GtkIMContext * function()TGTKgtk_im_context_simple_new; extern(D) TGTKgtk_im_context_simple_new gtk_im_context_simple_new;
+alias extern (C) uint function()TGTKgtk_im_context_simple_get_type; extern(D) TGTKgtk_im_context_simple_get_type gtk_im_context_simple_get_type;
+alias extern (C) _GtkWidget * function(aGtkImageMenuItem *)TGTKgtk_image_menu_item_get_image; extern(D) TGTKgtk_image_menu_item_get_image gtk_image_menu_item_get_image;
+alias extern (C) void function(aGtkImageMenuItem *, aGtkWidget *)TGTKgtk_image_menu_item_set_image; extern(D) TGTKgtk_image_menu_item_set_image gtk_image_menu_item_set_image;
+alias extern (C) _GtkWidget * function(char *, aGtkAccelGroup *)TGTKgtk_image_menu_item_new_from_stock; extern(D) TGTKgtk_image_menu_item_new_from_stock gtk_image_menu_item_new_from_stock;
+alias extern (C) _GtkWidget * function(char *)TGTKgtk_image_menu_item_new_with_mnemonic; extern(D) TGTKgtk_image_menu_item_new_with_mnemonic gtk_image_menu_item_new_with_mnemonic;
+alias extern (C) _GtkWidget * function(char *)TGTKgtk_image_menu_item_new_with_label; extern(D) TGTKgtk_image_menu_item_new_with_label gtk_image_menu_item_new_with_label;
+alias extern (C) _GtkWidget * function()TGTKgtk_image_menu_item_new; extern(D) TGTKgtk_image_menu_item_new gtk_image_menu_item_new;
+alias extern (C) uint function()TGTKgtk_image_menu_item_get_type; extern(D) TGTKgtk_image_menu_item_get_type gtk_image_menu_item_get_type;
+alias extern (C) int function(aGtkIconView *)TGTKgtk_icon_view_get_tooltip_column; extern(D) TGTKgtk_icon_view_get_tooltip_column gtk_icon_view_get_tooltip_column;
+alias extern (C) void function(aGtkIconView *, int)TGTKgtk_icon_view_set_tooltip_column; extern(D) TGTKgtk_icon_view_set_tooltip_column gtk_icon_view_set_tooltip_column;
+alias extern (C) int function(aGtkIconView *, int *, int *, int, void * *, void * *, aGtkTreeIter *)TGTKgtk_icon_view_get_tooltip_context; extern(D) TGTKgtk_icon_view_get_tooltip_context gtk_icon_view_get_tooltip_context;
+alias extern (C) void function(aGtkIconView *, void *, void *, aGtkCellRenderer *)TGTKgtk_icon_view_set_tooltip_cell; extern(D) TGTKgtk_icon_view_set_tooltip_cell gtk_icon_view_set_tooltip_cell;
+alias extern (C) void function(aGtkIconView *, void *, void *)TGTKgtk_icon_view_set_tooltip_item; extern(D) TGTKgtk_icon_view_set_tooltip_item gtk_icon_view_set_tooltip_item;
+alias extern (C) void function(aGtkIconView *, int, int, int *, int *)TGTKgtk_icon_view_convert_widget_to_bin_window_coords; extern(D) TGTKgtk_icon_view_convert_widget_to_bin_window_coords gtk_icon_view_convert_widget_to_bin_window_coords;
+alias extern (C) _GdkDrawable * function(aGtkIconView *, void *)TGTKgtk_icon_view_create_drag_icon; extern(D) TGTKgtk_icon_view_create_drag_icon gtk_icon_view_create_drag_icon;
+alias extern (C) int function(aGtkIconView *, int, int, void * *, int *)TGTKgtk_icon_view_get_dest_item_at_pos; extern(D) TGTKgtk_icon_view_get_dest_item_at_pos gtk_icon_view_get_dest_item_at_pos;
+alias extern (C) void function(aGtkIconView *, void * *, int *)TGTKgtk_icon_view_get_drag_dest_item; extern(D) TGTKgtk_icon_view_get_drag_dest_item gtk_icon_view_get_drag_dest_item;
+alias extern (C) void function(aGtkIconView *, void *, int)TGTKgtk_icon_view_set_drag_dest_item; extern(D) TGTKgtk_icon_view_set_drag_dest_item gtk_icon_view_set_drag_dest_item;
+alias extern (C) int function(aGtkIconView *)TGTKgtk_icon_view_get_reorderable; extern(D) TGTKgtk_icon_view_get_reorderable gtk_icon_view_get_reorderable;
+alias extern (C) void function(aGtkIconView *, int)TGTKgtk_icon_view_set_reorderable; extern(D) TGTKgtk_icon_view_set_reorderable gtk_icon_view_set_reorderable;
+alias extern (C) void function(aGtkIconView *)TGTKgtk_icon_view_unset_model_drag_dest; extern(D) TGTKgtk_icon_view_unset_model_drag_dest gtk_icon_view_unset_model_drag_dest;
+alias extern (C) void function(aGtkIconView *)TGTKgtk_icon_view_unset_model_drag_source; extern(D) TGTKgtk_icon_view_unset_model_drag_source gtk_icon_view_unset_model_drag_source;
+alias extern (C) void function(aGtkIconView *, aGtkTargetEntry *, int, int)TGTKgtk_icon_view_enable_model_drag_dest; extern(D) TGTKgtk_icon_view_enable_model_drag_dest gtk_icon_view_enable_model_drag_dest;
+alias extern (C) void function(aGtkIconView *, int, aGtkTargetEntry *, int, int)TGTKgtk_icon_view_enable_model_drag_source; extern(D) TGTKgtk_icon_view_enable_model_drag_source gtk_icon_view_enable_model_drag_source;
+alias extern (C) void function(aGtkIconView *, void *, int, float, float)TGTKgtk_icon_view_scroll_to_path; extern(D) TGTKgtk_icon_view_scroll_to_path gtk_icon_view_scroll_to_path;
+alias extern (C) int function(aGtkIconView *, void * *, _GtkCellRenderer * *)TGTKgtk_icon_view_get_cursor; extern(D) TGTKgtk_icon_view_get_cursor gtk_icon_view_get_cursor;
+alias extern (C) void function(aGtkIconView *, void *, aGtkCellRenderer *, int)TGTKgtk_icon_view_set_cursor; extern(D) TGTKgtk_icon_view_set_cursor gtk_icon_view_set_cursor;
+alias extern (C) void function(aGtkIconView *, void *)TGTKgtk_icon_view_item_activated; extern(D) TGTKgtk_icon_view_item_activated gtk_icon_view_item_activated;
+alias extern (C) void function(aGtkIconView *)TGTKgtk_icon_view_unselect_all; extern(D) TGTKgtk_icon_view_unselect_all gtk_icon_view_unselect_all;
+alias extern (C) void function(aGtkIconView *)TGTKgtk_icon_view_select_all; extern(D) TGTKgtk_icon_view_select_all gtk_icon_view_select_all;
+alias extern (C) _GList * function(aGtkIconView *)TGTKgtk_icon_view_get_selected_items; extern(D) TGTKgtk_icon_view_get_selected_items gtk_icon_view_get_selected_items;
+alias extern (C) int function(aGtkIconView *, void *)TGTKgtk_icon_view_path_is_selected; extern(D) TGTKgtk_icon_view_path_is_selected gtk_icon_view_path_is_selected;
+alias extern (C) void function(aGtkIconView *, void *)TGTKgtk_icon_view_unselect_path; extern(D) TGTKgtk_icon_view_unselect_path gtk_icon_view_unselect_path;
+alias extern (C) void function(aGtkIconView *, void *)TGTKgtk_icon_view_select_path; extern(D) TGTKgtk_icon_view_select_path gtk_icon_view_select_path;
+alias extern (C) int function(aGtkIconView *)TGTKgtk_icon_view_get_selection_mode; extern(D) TGTKgtk_icon_view_get_selection_mode gtk_icon_view_get_selection_mode;
+alias extern (C) void function(aGtkIconView *, int)TGTKgtk_icon_view_set_selection_mode; extern(D) TGTKgtk_icon_view_set_selection_mode gtk_icon_view_set_selection_mode;
+alias extern (C) void function(aGtkIconView *, _BCD_func__10270, void *)TGTKgtk_icon_view_selected_foreach; extern(D) TGTKgtk_icon_view_selected_foreach gtk_icon_view_selected_foreach;
+alias extern (C) int function(aGtkIconView *, void * *, void * *)TGTKgtk_icon_view_get_visible_range; extern(D) TGTKgtk_icon_view_get_visible_range gtk_icon_view_get_visible_range;
+alias extern (C) int function(aGtkIconView *, int, int, void * *, _GtkCellRenderer * *)TGTKgtk_icon_view_get_item_at_pos; extern(D) TGTKgtk_icon_view_get_item_at_pos gtk_icon_view_get_item_at_pos;
+alias extern (C) void * function(aGtkIconView *, int, int)TGTKgtk_icon_view_get_path_at_pos; extern(D) TGTKgtk_icon_view_get_path_at_pos gtk_icon_view_get_path_at_pos;
+alias extern (C) int function(aGtkIconView *)TGTKgtk_icon_view_get_margin; extern(D) TGTKgtk_icon_view_get_margin gtk_icon_view_get_margin;
+alias extern (C) void function(aGtkIconView *, int)TGTKgtk_icon_view_set_margin; extern(D) TGTKgtk_icon_view_set_margin gtk_icon_view_set_margin;
+alias extern (C) int function(aGtkIconView *)TGTKgtk_icon_view_get_column_spacing; extern(D) TGTKgtk_icon_view_get_column_spacing gtk_icon_view_get_column_spacing;
+alias extern (C) void function(aGtkIconView *, int)TGTKgtk_icon_view_set_column_spacing; extern(D) TGTKgtk_icon_view_set_column_spacing gtk_icon_view_set_column_spacing;
+alias extern (C) int function(aGtkIconView *)TGTKgtk_icon_view_get_row_spacing; extern(D) TGTKgtk_icon_view_get_row_spacing gtk_icon_view_get_row_spacing;
+alias extern (C) void function(aGtkIconView *, int)TGTKgtk_icon_view_set_row_spacing; extern(D) TGTKgtk_icon_view_set_row_spacing gtk_icon_view_set_row_spacing;
+alias extern (C) int function(aGtkIconView *)TGTKgtk_icon_view_get_spacing; extern(D) TGTKgtk_icon_view_get_spacing gtk_icon_view_get_spacing;
+alias extern (C) void function(aGtkIconView *, int)TGTKgtk_icon_view_set_spacing; extern(D) TGTKgtk_icon_view_set_spacing gtk_icon_view_set_spacing;
+alias extern (C) int function(aGtkIconView *)TGTKgtk_icon_view_get_item_width; extern(D) TGTKgtk_icon_view_get_item_width gtk_icon_view_get_item_width;
+alias extern (C) void function(aGtkIconView *, int)TGTKgtk_icon_view_set_item_width; extern(D) TGTKgtk_icon_view_set_item_width gtk_icon_view_set_item_width;
+alias extern (C) int function(aGtkIconView *)TGTKgtk_icon_view_get_columns; extern(D) TGTKgtk_icon_view_get_columns gtk_icon_view_get_columns;
+alias extern (C) void function(aGtkIconView *, int)TGTKgtk_icon_view_set_columns; extern(D) TGTKgtk_icon_view_set_columns gtk_icon_view_set_columns;
+alias extern (C) int function(aGtkIconView *)TGTKgtk_icon_view_get_orientation; extern(D) TGTKgtk_icon_view_get_orientation gtk_icon_view_get_orientation;
+alias extern (C) void function(aGtkIconView *, int)TGTKgtk_icon_view_set_orientation; extern(D) TGTKgtk_icon_view_set_orientation gtk_icon_view_set_orientation;
+alias extern (C) int function(aGtkIconView *)TGTKgtk_icon_view_get_pixbuf_column; extern(D) TGTKgtk_icon_view_get_pixbuf_column gtk_icon_view_get_pixbuf_column;
+alias extern (C) void function(aGtkIconView *, int)TGTKgtk_icon_view_set_pixbuf_column; extern(D) TGTKgtk_icon_view_set_pixbuf_column gtk_icon_view_set_pixbuf_column;
+alias extern (C) int function(aGtkIconView *)TGTKgtk_icon_view_get_markup_column; extern(D) TGTKgtk_icon_view_get_markup_column gtk_icon_view_get_markup_column;
+alias extern (C) void function(aGtkIconView *, int)TGTKgtk_icon_view_set_markup_column; extern(D) TGTKgtk_icon_view_set_markup_column gtk_icon_view_set_markup_column;
+alias extern (C) int function(aGtkIconView *)TGTKgtk_icon_view_get_text_column; extern(D) TGTKgtk_icon_view_get_text_column gtk_icon_view_get_text_column;
+alias extern (C) void function(aGtkIconView *, int)TGTKgtk_icon_view_set_text_column; extern(D) TGTKgtk_icon_view_set_text_column gtk_icon_view_set_text_column;
+alias extern (C) void * function(aGtkIconView *)TGTKgtk_icon_view_get_model; extern(D) TGTKgtk_icon_view_get_model gtk_icon_view_get_model;
+alias extern (C) void function(aGtkIconView *, void *)TGTKgtk_icon_view_set_model; extern(D) TGTKgtk_icon_view_set_model gtk_icon_view_set_model;
+alias extern (C) _GtkWidget * function(void *)TGTKgtk_icon_view_new_with_model; extern(D) TGTKgtk_icon_view_new_with_model gtk_icon_view_new_with_model;
+alias extern (C) _GtkWidget * function()TGTKgtk_icon_view_new; extern(D) TGTKgtk_icon_view_new gtk_icon_view_new;
+alias extern (C) uint function()TGTKgtk_icon_view_get_type; extern(D) TGTKgtk_icon_view_get_type gtk_icon_view_get_type;
+//alias extern (C) void function(aGtkWidget *)TGTK_gtk_tooltip_hide; extern(D) TGTK_gtk_tooltip_hide _gtk_tooltip_hide;
+//alias extern (C) void function(_GdkEvent *)TGTK_gtk_tooltip_handle_event; extern(D) TGTK_gtk_tooltip_handle_event _gtk_tooltip_handle_event;
+//alias extern (C) void function(aGtkWidget *)TGTK_gtk_tooltip_toggle_keyboard_mode; extern(D) TGTK_gtk_tooltip_toggle_keyboard_mode _gtk_tooltip_toggle_keyboard_mode;
+//alias extern (C) void function(aGtkWidget *)TGTK_gtk_tooltip_focus_out; extern(D) TGTK_gtk_tooltip_focus_out _gtk_tooltip_focus_out;
+//alias extern (C) void function(aGtkWidget *)TGTK_gtk_tooltip_focus_in; extern(D) TGTK_gtk_tooltip_focus_in _gtk_tooltip_focus_in;
+alias extern (C) void function(_GdkDisplay *)TGTKgtk_tooltip_trigger_tooltip_query; extern(D) TGTKgtk_tooltip_trigger_tooltip_query gtk_tooltip_trigger_tooltip_query;
+alias extern (C) void function(void *, _GdkRectangle *)TGTKgtk_tooltip_set_tip_area; extern(D) TGTKgtk_tooltip_set_tip_area gtk_tooltip_set_tip_area;
+alias extern (C) void function(void *, aGtkWidget *)TGTKgtk_tooltip_set_custom; extern(D) TGTKgtk_tooltip_set_custom gtk_tooltip_set_custom;
+alias extern (C) void function(void *, char *, int)TGTKgtk_tooltip_set_icon_from_stock; extern(D) TGTKgtk_tooltip_set_icon_from_stock gtk_tooltip_set_icon_from_stock;
+alias extern (C) void function(void *, void *)TGTKgtk_tooltip_set_icon; extern(D) TGTKgtk_tooltip_set_icon gtk_tooltip_set_icon;
+alias extern (C) void function(void *, char *)TGTKgtk_tooltip_set_text; extern(D) TGTKgtk_tooltip_set_text gtk_tooltip_set_text;
+alias extern (C) void function(void *, char *)TGTKgtk_tooltip_set_markup; extern(D) TGTKgtk_tooltip_set_markup gtk_tooltip_set_markup;
+alias extern (C) uint function()TGTKgtk_tooltip_get_type; extern(D) TGTKgtk_tooltip_get_type gtk_tooltip_get_type;
+//alias extern (C) void function()TGTK_gtk_icon_theme_ensure_builtin_cache; extern(D) TGTK_gtk_icon_theme_ensure_builtin_cache _gtk_icon_theme_ensure_builtin_cache;
+//alias extern (C) void function(_GdkDisplay *)TGTK_gtk_icon_theme_check_reload; extern(D) TGTK_gtk_icon_theme_check_reload _gtk_icon_theme_check_reload;
+alias extern (C) char * function(void *)TGTKgtk_icon_info_get_display_name; extern(D) TGTKgtk_icon_info_get_display_name gtk_icon_info_get_display_name;
+alias extern (C) int function(void *, _GdkPoint * *, int *)TGTKgtk_icon_info_get_attach_points; extern(D) TGTKgtk_icon_info_get_attach_points gtk_icon_info_get_attach_points;
+alias extern (C) int function(void *, _GdkRectangle *)TGTKgtk_icon_info_get_embedded_rect; extern(D) TGTKgtk_icon_info_get_embedded_rect gtk_icon_info_get_embedded_rect;
+alias extern (C) void function(void *, int)TGTKgtk_icon_info_set_raw_coordinates; extern(D) TGTKgtk_icon_info_set_raw_coordinates gtk_icon_info_set_raw_coordinates;
+alias extern (C) void * function(void *, _GError * *)TGTKgtk_icon_info_load_icon; extern(D) TGTKgtk_icon_info_load_icon gtk_icon_info_load_icon;
+alias extern (C) void * function(void *)TGTKgtk_icon_info_get_builtin_pixbuf; extern(D) TGTKgtk_icon_info_get_builtin_pixbuf gtk_icon_info_get_builtin_pixbuf;
+alias extern (C) char * function(void *)TGTKgtk_icon_info_get_filename; extern(D) TGTKgtk_icon_info_get_filename gtk_icon_info_get_filename;
+alias extern (C) int function(void *)TGTKgtk_icon_info_get_base_size; extern(D) TGTKgtk_icon_info_get_base_size gtk_icon_info_get_base_size;
+alias extern (C) void function(void *)TGTKgtk_icon_info_free; extern(D) TGTKgtk_icon_info_free gtk_icon_info_free;
+alias extern (C) void * function(void *)TGTKgtk_icon_info_copy; extern(D) TGTKgtk_icon_info_copy gtk_icon_info_copy;
+alias extern (C) uint function()TGTKgtk_icon_info_get_type; extern(D) TGTKgtk_icon_info_get_type gtk_icon_info_get_type;
+alias extern (C) void function(char *, int, void *)TGTKgtk_icon_theme_add_builtin_icon; extern(D) TGTKgtk_icon_theme_add_builtin_icon gtk_icon_theme_add_builtin_icon;
+alias extern (C) int function(aGtkIconTheme *)TGTKgtk_icon_theme_rescan_if_needed; extern(D) TGTKgtk_icon_theme_rescan_if_needed gtk_icon_theme_rescan_if_needed;
+alias extern (C) char * function(aGtkIconTheme *)TGTKgtk_icon_theme_get_example_icon_name; extern(D) TGTKgtk_icon_theme_get_example_icon_name gtk_icon_theme_get_example_icon_name;
+alias extern (C) _GList * function(aGtkIconTheme *)TGTKgtk_icon_theme_list_contexts; extern(D) TGTKgtk_icon_theme_list_contexts gtk_icon_theme_list_contexts;
+alias extern (C) _GList * function(aGtkIconTheme *, char *)TGTKgtk_icon_theme_list_icons; extern(D) TGTKgtk_icon_theme_list_icons gtk_icon_theme_list_icons;
+alias extern (C) void * function(aGtkIconTheme *, char *, int, int, _GError * *)TGTKgtk_icon_theme_load_icon; extern(D) TGTKgtk_icon_theme_load_icon gtk_icon_theme_load_icon;
+alias extern (C) void * function(aGtkIconTheme *, char * *, int, int)TGTKgtk_icon_theme_choose_icon; extern(D) TGTKgtk_icon_theme_choose_icon gtk_icon_theme_choose_icon;
+alias extern (C) void * function(aGtkIconTheme *, char *, int, int)TGTKgtk_icon_theme_lookup_icon; extern(D) TGTKgtk_icon_theme_lookup_icon gtk_icon_theme_lookup_icon;
+alias extern (C) int * function(aGtkIconTheme *, char *)TGTKgtk_icon_theme_get_icon_sizes; extern(D) TGTKgtk_icon_theme_get_icon_sizes gtk_icon_theme_get_icon_sizes;
+alias extern (C) int function(aGtkIconTheme *, char *)TGTKgtk_icon_theme_has_icon; extern(D) TGTKgtk_icon_theme_has_icon gtk_icon_theme_has_icon;
+alias extern (C) void function(aGtkIconTheme *, char *)TGTKgtk_icon_theme_set_custom_theme; extern(D) TGTKgtk_icon_theme_set_custom_theme gtk_icon_theme_set_custom_theme;
+alias extern (C) void function(aGtkIconTheme *, char *)TGTKgtk_icon_theme_prepend_search_path; extern(D) TGTKgtk_icon_theme_prepend_search_path gtk_icon_theme_prepend_search_path;
+alias extern (C) void function(aGtkIconTheme *, char *)TGTKgtk_icon_theme_append_search_path; extern(D) TGTKgtk_icon_theme_append_search_path gtk_icon_theme_append_search_path;
+alias extern (C) void function(aGtkIconTheme *, char * * *, int *)TGTKgtk_icon_theme_get_search_path; extern(D) TGTKgtk_icon_theme_get_search_path gtk_icon_theme_get_search_path;
+alias extern (C) void function(aGtkIconTheme *, char * *, int)TGTKgtk_icon_theme_set_search_path; extern(D) TGTKgtk_icon_theme_set_search_path gtk_icon_theme_set_search_path;
+alias extern (C) void function(aGtkIconTheme *, _GdkScreen *)TGTKgtk_icon_theme_set_screen; extern(D) TGTKgtk_icon_theme_set_screen gtk_icon_theme_set_screen;
+alias extern (C) _GtkIconTheme * function(_GdkScreen *)TGTKgtk_icon_theme_get_for_screen; extern(D) TGTKgtk_icon_theme_get_for_screen gtk_icon_theme_get_for_screen;
+alias extern (C) _GtkIconTheme * function()TGTKgtk_icon_theme_get_default; extern(D) TGTKgtk_icon_theme_get_default gtk_icon_theme_get_default;
+alias extern (C) _GtkIconTheme * function()TGTKgtk_icon_theme_new; extern(D) TGTKgtk_icon_theme_new gtk_icon_theme_new;
+alias extern (C) uint function()TGTKgtk_icon_theme_get_type; extern(D) TGTKgtk_icon_theme_get_type gtk_icon_theme_get_type;
+alias extern (C) uint function()TGTKgtk_icon_theme_error_quark; extern(D) TGTKgtk_icon_theme_error_quark gtk_icon_theme_error_quark;
+//alias extern (C) void function()TGTK_gtk_icon_factory_ensure_default_icons; extern(D) TGTK_gtk_icon_factory_ensure_default_icons _gtk_icon_factory_ensure_default_icons;
+//alias extern (C) _GList * function()TGTK_gtk_icon_factory_list_ids; extern(D) TGTK_gtk_icon_factory_list_ids _gtk_icon_factory_list_ids;
+//alias extern (C) void function()TGTK_gtk_icon_set_invalidate_caches; extern(D) TGTK_gtk_icon_set_invalidate_caches _gtk_icon_set_invalidate_caches;
+alias extern (C) int function(void *)TGTKgtk_icon_source_get_size; extern(D) TGTKgtk_icon_source_get_size gtk_icon_source_get_size;
+alias extern (C) int function(void *)TGTKgtk_icon_source_get_state; extern(D) TGTKgtk_icon_source_get_state gtk_icon_source_get_state;
+alias extern (C) int function(void *)TGTKgtk_icon_source_get_direction; extern(D) TGTKgtk_icon_source_get_direction gtk_icon_source_get_direction;
+alias extern (C) void function(void *, int)TGTKgtk_icon_source_set_size; extern(D) TGTKgtk_icon_source_set_size gtk_icon_source_set_size;
+alias extern (C) void function(void *, int)TGTKgtk_icon_source_set_state; extern(D) TGTKgtk_icon_source_set_state gtk_icon_source_set_state;
+alias extern (C) void function(void *, int)TGTKgtk_icon_source_set_direction; extern(D) TGTKgtk_icon_source_set_direction gtk_icon_source_set_direction;
+alias extern (C) int function(void *)TGTKgtk_icon_source_get_direction_wildcarded; extern(D) TGTKgtk_icon_source_get_direction_wildcarded gtk_icon_source_get_direction_wildcarded;
+alias extern (C) int function(void *)TGTKgtk_icon_source_get_state_wildcarded; extern(D) TGTKgtk_icon_source_get_state_wildcarded gtk_icon_source_get_state_wildcarded;
+alias extern (C) int function(void *)TGTKgtk_icon_source_get_size_wildcarded; extern(D) TGTKgtk_icon_source_get_size_wildcarded gtk_icon_source_get_size_wildcarded;
+alias extern (C) void function(void *, int)TGTKgtk_icon_source_set_size_wildcarded; extern(D) TGTKgtk_icon_source_set_size_wildcarded gtk_icon_source_set_size_wildcarded;
+alias extern (C) void function(void *, int)TGTKgtk_icon_source_set_state_wildcarded; extern(D) TGTKgtk_icon_source_set_state_wildcarded gtk_icon_source_set_state_wildcarded;
+alias extern (C) void function(void *, int)TGTKgtk_icon_source_set_direction_wildcarded; extern(D) TGTKgtk_icon_source_set_direction_wildcarded gtk_icon_source_set_direction_wildcarded;
+alias extern (C) void * function(void *)TGTKgtk_icon_source_get_pixbuf; extern(D) TGTKgtk_icon_source_get_pixbuf gtk_icon_source_get_pixbuf;
+alias extern (C) char * function(void *)TGTKgtk_icon_source_get_icon_name; extern(D) TGTKgtk_icon_source_get_icon_name gtk_icon_source_get_icon_name;
+alias extern (C) char * function(void *)TGTKgtk_icon_source_get_filename; extern(D) TGTKgtk_icon_source_get_filename gtk_icon_source_get_filename;
+alias extern (C) void function(void *, void *)TGTKgtk_icon_source_set_pixbuf; extern(D) TGTKgtk_icon_source_set_pixbuf gtk_icon_source_set_pixbuf;
+alias extern (C) void function(void *, char *)TGTKgtk_icon_source_set_icon_name; extern(D) TGTKgtk_icon_source_set_icon_name gtk_icon_source_set_icon_name;
+alias extern (C) void function(void *, char *)TGTKgtk_icon_source_set_filename; extern(D) TGTKgtk_icon_source_set_filename gtk_icon_source_set_filename;
+alias extern (C) void function(void *)TGTKgtk_icon_source_free; extern(D) TGTKgtk_icon_source_free gtk_icon_source_free;
+alias extern (C) void * function(void *)TGTKgtk_icon_source_copy; extern(D) TGTKgtk_icon_source_copy gtk_icon_source_copy;
+alias extern (C) void * function()TGTKgtk_icon_source_new; extern(D) TGTKgtk_icon_source_new gtk_icon_source_new;
+alias extern (C) uint function()TGTKgtk_icon_source_get_type; extern(D) TGTKgtk_icon_source_get_type gtk_icon_source_get_type;
+alias extern (C) void function(void *, int * *, int *)TGTKgtk_icon_set_get_sizes; extern(D) TGTKgtk_icon_set_get_sizes gtk_icon_set_get_sizes;
+alias extern (C) void function(void *, void *)TGTKgtk_icon_set_add_source; extern(D) TGTKgtk_icon_set_add_source gtk_icon_set_add_source;
+alias extern (C) void * function(void *, aGtkStyle *, int, int, int, aGtkWidget *, char *)TGTKgtk_icon_set_render_icon; extern(D) TGTKgtk_icon_set_render_icon gtk_icon_set_render_icon;
+alias extern (C) void * function(void *)TGTKgtk_icon_set_copy; extern(D) TGTKgtk_icon_set_copy gtk_icon_set_copy;
+alias extern (C) void function(void *)TGTKgtk_icon_set_unref; extern(D) TGTKgtk_icon_set_unref gtk_icon_set_unref;
+alias extern (C) void * function(void *)TGTKgtk_icon_set_ref; extern(D) TGTKgtk_icon_set_ref gtk_icon_set_ref;
+alias extern (C) void * function(void *)TGTKgtk_icon_set_new_from_pixbuf; extern(D) TGTKgtk_icon_set_new_from_pixbuf gtk_icon_set_new_from_pixbuf;
+alias extern (C) void * function()TGTKgtk_icon_set_new; extern(D) TGTKgtk_icon_set_new gtk_icon_set_new;
+alias extern (C) uint function()TGTKgtk_icon_set_get_type; extern(D) TGTKgtk_icon_set_get_type gtk_icon_set_get_type;
+alias extern (C) char * function(int)TGTKgtk_icon_size_get_name; extern(D) TGTKgtk_icon_size_get_name gtk_icon_size_get_name;
+alias extern (C) int function(char *)TGTKgtk_icon_size_from_name; extern(D) TGTKgtk_icon_size_from_name gtk_icon_size_from_name;
+alias extern (C) void function(char *, int)TGTKgtk_icon_size_register_alias; extern(D) TGTKgtk_icon_size_register_alias gtk_icon_size_register_alias;
+alias extern (C) int function(char *, int, int)TGTKgtk_icon_size_register; extern(D) TGTKgtk_icon_size_register gtk_icon_size_register;
+alias extern (C) int function(aGtkSettings *, int, int *, int *)TGTKgtk_icon_size_lookup_for_settings; extern(D) TGTKgtk_icon_size_lookup_for_settings gtk_icon_size_lookup_for_settings;
+alias extern (C) int function(int, int *, int *)TGTKgtk_icon_size_lookup; extern(D) TGTKgtk_icon_size_lookup gtk_icon_size_lookup;
+alias extern (C) void * function(char *)TGTKgtk_icon_factory_lookup_default; extern(D) TGTKgtk_icon_factory_lookup_default gtk_icon_factory_lookup_default;
+alias extern (C) void function(aGtkIconFactory *)TGTKgtk_icon_factory_remove_default; extern(D) TGTKgtk_icon_factory_remove_default gtk_icon_factory_remove_default;
+alias extern (C) void function(aGtkIconFactory *)TGTKgtk_icon_factory_add_default; extern(D) TGTKgtk_icon_factory_add_default gtk_icon_factory_add_default;
+alias extern (C) void * function(aGtkIconFactory *, char *)TGTKgtk_icon_factory_lookup; extern(D) TGTKgtk_icon_factory_lookup gtk_icon_factory_lookup;
+alias extern (C) void function(aGtkIconFactory *, char *, void *)TGTKgtk_icon_factory_add; extern(D) TGTKgtk_icon_factory_add gtk_icon_factory_add;
+alias extern (C) _GtkIconFactory * function()TGTKgtk_icon_factory_new; extern(D) TGTKgtk_icon_factory_new gtk_icon_factory_new;
+alias extern (C) uint function()TGTKgtk_icon_factory_get_type; extern(D) TGTKgtk_icon_factory_get_type gtk_icon_factory_get_type;
+alias extern (C) _GtkWidget * function()TGTKgtk_hseparator_new; extern(D) TGTKgtk_hseparator_new gtk_hseparator_new;
+alias extern (C) uint function()TGTKgtk_hseparator_get_type; extern(D) TGTKgtk_hseparator_get_type gtk_hseparator_get_type;
+alias extern (C) uint function()TGTKgtk_separator_get_type; extern(D) TGTKgtk_separator_get_type gtk_separator_get_type;
+alias extern (C) _GtkWidget * function(double, double, double)TGTKgtk_hscale_new_with_range; extern(D) TGTKgtk_hscale_new_with_range gtk_hscale_new_with_range;
+alias extern (C) _GtkWidget * function(aGtkAdjustment *)TGTKgtk_hscale_new; extern(D) TGTKgtk_hscale_new gtk_hscale_new;
+alias extern (C) uint function()TGTKgtk_hscale_get_type; extern(D) TGTKgtk_hscale_get_type gtk_hscale_get_type;
+//alias extern (C) char * function(aGtkScale *, double)TGTK_gtk_scale_format_value; extern(D) TGTK_gtk_scale_format_value _gtk_scale_format_value;
+//alias extern (C) void function(aGtkScale *, int *, int *)TGTK_gtk_scale_get_value_size; extern(D) TGTK_gtk_scale_get_value_size _gtk_scale_get_value_size;
+//alias extern (C) void function(aGtkScale *)TGTK_gtk_scale_clear_layout; extern(D) TGTK_gtk_scale_clear_layout _gtk_scale_clear_layout;
+alias extern (C) void function(aGtkScale *, int *, int *)TGTKgtk_scale_get_layout_offsets; extern(D) TGTKgtk_scale_get_layout_offsets gtk_scale_get_layout_offsets;
+alias extern (C) void * function(aGtkScale *)TGTKgtk_scale_get_layout; extern(D) TGTKgtk_scale_get_layout gtk_scale_get_layout;
+alias extern (C) int function(aGtkScale *)TGTKgtk_scale_get_value_pos; extern(D) TGTKgtk_scale_get_value_pos gtk_scale_get_value_pos;
+alias extern (C) void function(aGtkScale *, int)TGTKgtk_scale_set_value_pos; extern(D) TGTKgtk_scale_set_value_pos gtk_scale_set_value_pos;
+alias extern (C) int function(aGtkScale *)TGTKgtk_scale_get_draw_value; extern(D) TGTKgtk_scale_get_draw_value gtk_scale_get_draw_value;
+alias extern (C) void function(aGtkScale *, int)TGTKgtk_scale_set_draw_value; extern(D) TGTKgtk_scale_set_draw_value gtk_scale_set_draw_value;
+alias extern (C) int function(aGtkScale *)TGTKgtk_scale_get_digits; extern(D) TGTKgtk_scale_get_digits gtk_scale_get_digits;
+alias extern (C) void function(aGtkScale *, int)TGTKgtk_scale_set_digits; extern(D) TGTKgtk_scale_set_digits gtk_scale_set_digits;
+alias extern (C) uint function()TGTKgtk_scale_get_type; extern(D) TGTKgtk_scale_get_type gtk_scale_get_type;
+alias extern (C) _GtkWidget * function()TGTKgtk_hruler_new; extern(D) TGTKgtk_hruler_new gtk_hruler_new;
+alias extern (C) uint function()TGTKgtk_hruler_get_type; extern(D) TGTKgtk_hruler_get_type gtk_hruler_get_type;
+alias extern (C) void function(aGtkRuler *, double *, double *, double *, double *)TGTKgtk_ruler_get_range; extern(D) TGTKgtk_ruler_get_range gtk_ruler_get_range;
+alias extern (C) int function(aGtkRuler *)TGTKgtk_ruler_get_metric; extern(D) TGTKgtk_ruler_get_metric gtk_ruler_get_metric;
+alias extern (C) void function(aGtkRuler *)TGTKgtk_ruler_draw_pos; extern(D) TGTKgtk_ruler_draw_pos gtk_ruler_draw_pos;
+alias extern (C) void function(aGtkRuler *)TGTKgtk_ruler_draw_ticks; extern(D) TGTKgtk_ruler_draw_ticks gtk_ruler_draw_ticks;
+alias extern (C) void function(aGtkRuler *, double, double, double, double)TGTKgtk_ruler_set_range; extern(D) TGTKgtk_ruler_set_range gtk_ruler_set_range;
+alias extern (C) void function(aGtkRuler *, int)TGTKgtk_ruler_set_metric; extern(D) TGTKgtk_ruler_set_metric gtk_ruler_set_metric;
+alias extern (C) uint function()TGTKgtk_ruler_get_type; extern(D) TGTKgtk_ruler_get_type gtk_ruler_get_type;
+alias extern (C) _GtkWidget * function()TGTKgtk_hpaned_new; extern(D) TGTKgtk_hpaned_new gtk_hpaned_new;
+alias extern (C) uint function()TGTKgtk_hpaned_get_type; extern(D) TGTKgtk_hpaned_get_type gtk_hpaned_get_type;
+alias extern (C) void function(aGtkPaned *, int, int, int)TGTKgtk_paned_compute_position; extern(D) TGTKgtk_paned_compute_position gtk_paned_compute_position;
+alias extern (C) _GtkWidget * function(aGtkPaned *)TGTKgtk_paned_get_child2; extern(D) TGTKgtk_paned_get_child2 gtk_paned_get_child2;
+alias extern (C) _GtkWidget * function(aGtkPaned *)TGTKgtk_paned_get_child1; extern(D) TGTKgtk_paned_get_child1 gtk_paned_get_child1;
+alias extern (C) void function(aGtkPaned *, int)TGTKgtk_paned_set_position; extern(D) TGTKgtk_paned_set_position gtk_paned_set_position;
+alias extern (C) int function(aGtkPaned *)TGTKgtk_paned_get_position; extern(D) TGTKgtk_paned_get_position gtk_paned_get_position;
+alias extern (C) void function(aGtkPaned *, aGtkWidget *, int, int)TGTKgtk_paned_pack2; extern(D) TGTKgtk_paned_pack2 gtk_paned_pack2;
+alias extern (C) void function(aGtkPaned *, aGtkWidget *, int, int)TGTKgtk_paned_pack1; extern(D) TGTKgtk_paned_pack1 gtk_paned_pack1;
+alias extern (C) void function(aGtkPaned *, aGtkWidget *)TGTKgtk_paned_add2; extern(D) TGTKgtk_paned_add2 gtk_paned_add2;
+alias extern (C) void function(aGtkPaned *, aGtkWidget *)TGTKgtk_paned_add1; extern(D) TGTKgtk_paned_add1 gtk_paned_add1;
+alias extern (C) uint function()TGTKgtk_paned_get_type; extern(D) TGTKgtk_paned_get_type gtk_paned_get_type;
+alias extern (C) void function(int)TGTKgtk_hbutton_box_set_layout_default; extern(D) TGTKgtk_hbutton_box_set_layout_default gtk_hbutton_box_set_layout_default;
+alias extern (C) void function(int)TGTKgtk_hbutton_box_set_spacing_default; extern(D) TGTKgtk_hbutton_box_set_spacing_default gtk_hbutton_box_set_spacing_default;
+alias extern (C) int function()TGTKgtk_hbutton_box_get_layout_default; extern(D) TGTKgtk_hbutton_box_get_layout_default gtk_hbutton_box_get_layout_default;
+alias extern (C) int function()TGTKgtk_hbutton_box_get_spacing_default; extern(D) TGTKgtk_hbutton_box_get_spacing_default gtk_hbutton_box_get_spacing_default;
+alias extern (C) _GtkWidget * function()TGTKgtk_hbutton_box_new; extern(D) TGTKgtk_hbutton_box_new gtk_hbutton_box_new;
+alias extern (C) uint function()TGTKgtk_hbutton_box_get_type; extern(D) TGTKgtk_hbutton_box_get_type gtk_hbutton_box_get_type;
+alias extern (C) int function(aGtkHandleBox *)TGTKgtk_handle_box_get_snap_edge; extern(D) TGTKgtk_handle_box_get_snap_edge gtk_handle_box_get_snap_edge;
+alias extern (C) void function(aGtkHandleBox *, int)TGTKgtk_handle_box_set_snap_edge; extern(D) TGTKgtk_handle_box_set_snap_edge gtk_handle_box_set_snap_edge;
+alias extern (C) int function(aGtkHandleBox *)TGTKgtk_handle_box_get_handle_position; extern(D) TGTKgtk_handle_box_get_handle_position gtk_handle_box_get_handle_position;
+alias extern (C) void function(aGtkHandleBox *, int)TGTKgtk_handle_box_set_handle_position; extern(D) TGTKgtk_handle_box_set_handle_position gtk_handle_box_set_handle_position;
+alias extern (C) int function(aGtkHandleBox *)TGTKgtk_handle_box_get_shadow_type; extern(D) TGTKgtk_handle_box_get_shadow_type gtk_handle_box_get_shadow_type;
+alias extern (C) void function(aGtkHandleBox *, int)TGTKgtk_handle_box_set_shadow_type; extern(D) TGTKgtk_handle_box_set_shadow_type gtk_handle_box_set_shadow_type;
+alias extern (C) _GtkWidget * function()TGTKgtk_handle_box_new; extern(D) TGTKgtk_handle_box_new gtk_handle_box_new;
+alias extern (C) uint function()TGTKgtk_handle_box_get_type; extern(D) TGTKgtk_handle_box_get_type gtk_handle_box_get_type;
+alias extern (C) void function(_GdkGC *)TGTKgtk_gc_release; extern(D) TGTKgtk_gc_release gtk_gc_release;
+alias extern (C) _GdkGC * function(int, _GdkColormap *, _GdkGCValues *, int)TGTKgtk_gc_get; extern(D) TGTKgtk_gc_get gtk_gc_get;
+alias extern (C) _GtkWidget * function()TGTKgtk_gamma_curve_new; extern(D) TGTKgtk_gamma_curve_new gtk_gamma_curve_new;
+alias extern (C) uint function()TGTKgtk_gamma_curve_get_type; extern(D) TGTKgtk_gamma_curve_get_type gtk_gamma_curve_get_type;
+alias extern (C) void function(aGtkFontSelectionDialog *, char *)TGTKgtk_font_selection_dialog_set_preview_text; extern(D) TGTKgtk_font_selection_dialog_set_preview_text gtk_font_selection_dialog_set_preview_text;
+alias extern (C) char * function(aGtkFontSelectionDialog *)TGTKgtk_font_selection_dialog_get_preview_text; extern(D) TGTKgtk_font_selection_dialog_get_preview_text gtk_font_selection_dialog_get_preview_text;
+alias extern (C) int function(aGtkFontSelectionDialog *, char *)TGTKgtk_font_selection_dialog_set_font_name; extern(D) TGTKgtk_font_selection_dialog_set_font_name gtk_font_selection_dialog_set_font_name;
+alias extern (C) _GdkFont * function(aGtkFontSelectionDialog *)TGTKgtk_font_selection_dialog_get_font; extern(D) TGTKgtk_font_selection_dialog_get_font gtk_font_selection_dialog_get_font;
+alias extern (C) char * function(aGtkFontSelectionDialog *)TGTKgtk_font_selection_dialog_get_font_name; extern(D) TGTKgtk_font_selection_dialog_get_font_name gtk_font_selection_dialog_get_font_name;
+alias extern (C) _GtkWidget * function(char *)TGTKgtk_font_selection_dialog_new; extern(D) TGTKgtk_font_selection_dialog_new gtk_font_selection_dialog_new;
+alias extern (C) uint function()TGTKgtk_font_selection_dialog_get_type; extern(D) TGTKgtk_font_selection_dialog_get_type gtk_font_selection_dialog_get_type;
+alias extern (C) void function(aGtkFontSelection *, char *)TGTKgtk_font_selection_set_preview_text; extern(D) TGTKgtk_font_selection_set_preview_text gtk_font_selection_set_preview_text;
+alias extern (C) char * function(aGtkFontSelection *)TGTKgtk_font_selection_get_preview_text; extern(D) TGTKgtk_font_selection_get_preview_text gtk_font_selection_get_preview_text;
+alias extern (C) int function(aGtkFontSelection *, char *)TGTKgtk_font_selection_set_font_name; extern(D) TGTKgtk_font_selection_set_font_name gtk_font_selection_set_font_name;
+alias extern (C) _GdkFont * function(aGtkFontSelection *)TGTKgtk_font_selection_get_font; extern(D) TGTKgtk_font_selection_get_font gtk_font_selection_get_font;
+alias extern (C) char * function(aGtkFontSelection *)TGTKgtk_font_selection_get_font_name; extern(D) TGTKgtk_font_selection_get_font_name gtk_font_selection_get_font_name;
+alias extern (C) _GtkWidget * function()TGTKgtk_font_selection_new; extern(D) TGTKgtk_font_selection_new gtk_font_selection_new;
+alias extern (C) uint function()TGTKgtk_font_selection_get_type; extern(D) TGTKgtk_font_selection_get_type gtk_font_selection_get_type;
+alias extern (C) void function(aGtkFontButton *, int)TGTKgtk_font_button_set_show_size; extern(D) TGTKgtk_font_button_set_show_size gtk_font_button_set_show_size;
+alias extern (C) int function(aGtkFontButton *)TGTKgtk_font_button_get_show_size; extern(D) TGTKgtk_font_button_get_show_size gtk_font_button_get_show_size;
+alias extern (C) void function(aGtkFontButton *, int)TGTKgtk_font_button_set_show_style; extern(D) TGTKgtk_font_button_set_show_style gtk_font_button_set_show_style;
+alias extern (C) int function(aGtkFontButton *)TGTKgtk_font_button_get_show_style; extern(D) TGTKgtk_font_button_get_show_style gtk_font_button_get_show_style;
+alias extern (C) int function(aGtkFontButton *, char *)TGTKgtk_font_button_set_font_name; extern(D) TGTKgtk_font_button_set_font_name gtk_font_button_set_font_name;
+alias extern (C) char * function(aGtkFontButton *)TGTKgtk_font_button_get_font_name; extern(D) TGTKgtk_font_button_get_font_name gtk_font_button_get_font_name;
+alias extern (C) void function(aGtkFontButton *, int)TGTKgtk_font_button_set_use_size; extern(D) TGTKgtk_font_button_set_use_size gtk_font_button_set_use_size;
+alias extern (C) int function(aGtkFontButton *)TGTKgtk_font_button_get_use_size; extern(D) TGTKgtk_font_button_get_use_size gtk_font_button_get_use_size;
+alias extern (C) void function(aGtkFontButton *, int)TGTKgtk_font_button_set_use_font; extern(D) TGTKgtk_font_button_set_use_font gtk_font_button_set_use_font;
+alias extern (C) int function(aGtkFontButton *)TGTKgtk_font_button_get_use_font; extern(D) TGTKgtk_font_button_get_use_font gtk_font_button_get_use_font;
+alias extern (C) void function(aGtkFontButton *, char *)TGTKgtk_font_button_set_title; extern(D) TGTKgtk_font_button_set_title gtk_font_button_set_title;
+alias extern (C) char * function(aGtkFontButton *)TGTKgtk_font_button_get_title; extern(D) TGTKgtk_font_button_get_title gtk_font_button_get_title;
+alias extern (C) _GtkWidget * function(char *)TGTKgtk_font_button_new_with_font; extern(D) TGTKgtk_font_button_new_with_font gtk_font_button_new_with_font;
+alias extern (C) _GtkWidget * function()TGTKgtk_font_button_new; extern(D) TGTKgtk_font_button_new gtk_font_button_new;
+alias extern (C) uint function()TGTKgtk_font_button_get_type; extern(D) TGTKgtk_font_button_get_type gtk_font_button_get_type;
+alias extern (C) _GtkWidget * function(int, char *)TGTKgtk_file_chooser_widget_new_with_backend; extern(D) TGTKgtk_file_chooser_widget_new_with_backend gtk_file_chooser_widget_new_with_backend;
+alias extern (C) _GtkWidget * function(int)TGTKgtk_file_chooser_widget_new; extern(D) TGTKgtk_file_chooser_widget_new gtk_file_chooser_widget_new;
+alias extern (C) uint function()TGTKgtk_file_chooser_widget_get_type; extern(D) TGTKgtk_file_chooser_widget_get_type gtk_file_chooser_widget_get_type;
+alias extern (C) _GtkWidget * function(char *, aGtkWindow *, int, char *, char *, ...)TGTKgtk_file_chooser_dialog_new_with_backend; extern(D) TGTKgtk_file_chooser_dialog_new_with_backend gtk_file_chooser_dialog_new_with_backend;
+alias extern (C) _GtkWidget * function(char *, aGtkWindow *, int, char *, ...)TGTKgtk_file_chooser_dialog_new; extern(D) TGTKgtk_file_chooser_dialog_new gtk_file_chooser_dialog_new;
+alias extern (C) uint function()TGTKgtk_file_chooser_dialog_get_type; extern(D) TGTKgtk_file_chooser_dialog_get_type gtk_file_chooser_dialog_get_type;
+alias extern (C) void function(aGtkFileChooserButton *, int)TGTKgtk_file_chooser_button_set_focus_on_click; extern(D) TGTKgtk_file_chooser_button_set_focus_on_click gtk_file_chooser_button_set_focus_on_click;
+alias extern (C) int function(aGtkFileChooserButton *)TGTKgtk_file_chooser_button_get_focus_on_click; extern(D) TGTKgtk_file_chooser_button_get_focus_on_click gtk_file_chooser_button_get_focus_on_click;
+alias extern (C) void function(aGtkFileChooserButton *, int)TGTKgtk_file_chooser_button_set_width_chars; extern(D) TGTKgtk_file_chooser_button_set_width_chars gtk_file_chooser_button_set_width_chars;
+alias extern (C) int function(aGtkFileChooserButton *)TGTKgtk_file_chooser_button_get_width_chars; extern(D) TGTKgtk_file_chooser_button_get_width_chars gtk_file_chooser_button_get_width_chars;
+alias extern (C) void function(aGtkFileChooserButton *, char *)TGTKgtk_file_chooser_button_set_title; extern(D) TGTKgtk_file_chooser_button_set_title gtk_file_chooser_button_set_title;
+alias extern (C) char * function(aGtkFileChooserButton *)TGTKgtk_file_chooser_button_get_title; extern(D) TGTKgtk_file_chooser_button_get_title gtk_file_chooser_button_get_title;
+alias extern (C) _GtkWidget * function(aGtkWidget *)TGTKgtk_file_chooser_button_new_with_dialog; extern(D) TGTKgtk_file_chooser_button_new_with_dialog gtk_file_chooser_button_new_with_dialog;
+alias extern (C) _GtkWidget * function(char *, int, char *)TGTKgtk_file_chooser_button_new_with_backend; extern(D) TGTKgtk_file_chooser_button_new_with_backend gtk_file_chooser_button_new_with_backend;
+alias extern (C) _GtkWidget * function(char *, int)TGTKgtk_file_chooser_button_new; extern(D) TGTKgtk_file_chooser_button_new gtk_file_chooser_button_new;
+alias extern (C) uint function()TGTKgtk_file_chooser_button_get_type; extern(D) TGTKgtk_file_chooser_button_get_type gtk_file_chooser_button_get_type;
+alias extern (C) _GSList * function(void *)TGTKgtk_file_chooser_list_shortcut_folder_uris; extern(D) TGTKgtk_file_chooser_list_shortcut_folder_uris gtk_file_chooser_list_shortcut_folder_uris;
+alias extern (C) int function(void *, char *, _GError * *)TGTKgtk_file_chooser_remove_shortcut_folder_uri; extern(D) TGTKgtk_file_chooser_remove_shortcut_folder_uri gtk_file_chooser_remove_shortcut_folder_uri;
+alias extern (C) int function(void *, char *, _GError * *)TGTKgtk_file_chooser_add_shortcut_folder_uri; extern(D) TGTKgtk_file_chooser_add_shortcut_folder_uri gtk_file_chooser_add_shortcut_folder_uri;
+alias extern (C) _GSList * function(void *)TGTKgtk_file_chooser_list_shortcut_folders; extern(D) TGTKgtk_file_chooser_list_shortcut_folders gtk_file_chooser_list_shortcut_folders;
+alias extern (C) int function(void *, char *, _GError * *)TGTKgtk_file_chooser_remove_shortcut_folder; extern(D) TGTKgtk_file_chooser_remove_shortcut_folder gtk_file_chooser_remove_shortcut_folder;
+alias extern (C) int function(void *, char *, _GError * *)TGTKgtk_file_chooser_add_shortcut_folder; extern(D) TGTKgtk_file_chooser_add_shortcut_folder gtk_file_chooser_add_shortcut_folder;
+alias extern (C) void * function(void *)TGTKgtk_file_chooser_get_filter; extern(D) TGTKgtk_file_chooser_get_filter gtk_file_chooser_get_filter;
+alias extern (C) void function(void *, void *)TGTKgtk_file_chooser_set_filter; extern(D) TGTKgtk_file_chooser_set_filter gtk_file_chooser_set_filter;
+alias extern (C) _GSList * function(void *)TGTKgtk_file_chooser_list_filters; extern(D) TGTKgtk_file_chooser_list_filters gtk_file_chooser_list_filters;
+alias extern (C) void function(void *, void *)TGTKgtk_file_chooser_remove_filter; extern(D) TGTKgtk_file_chooser_remove_filter gtk_file_chooser_remove_filter;
+alias extern (C) void function(void *, void *)TGTKgtk_file_chooser_add_filter; extern(D) TGTKgtk_file_chooser_add_filter gtk_file_chooser_add_filter;
+alias extern (C) _GtkWidget * function(void *)TGTKgtk_file_chooser_get_extra_widget; extern(D) TGTKgtk_file_chooser_get_extra_widget gtk_file_chooser_get_extra_widget;
+alias extern (C) void function(void *, aGtkWidget *)TGTKgtk_file_chooser_set_extra_widget; extern(D) TGTKgtk_file_chooser_set_extra_widget gtk_file_chooser_set_extra_widget;
+alias extern (C) char * function(void *)TGTKgtk_file_chooser_get_preview_uri; extern(D) TGTKgtk_file_chooser_get_preview_uri gtk_file_chooser_get_preview_uri;
+alias extern (C) char * function(void *)TGTKgtk_file_chooser_get_preview_filename; extern(D) TGTKgtk_file_chooser_get_preview_filename gtk_file_chooser_get_preview_filename;
+alias extern (C) int function(void *)TGTKgtk_file_chooser_get_use_preview_label; extern(D) TGTKgtk_file_chooser_get_use_preview_label gtk_file_chooser_get_use_preview_label;
+alias extern (C) void function(void *, int)TGTKgtk_file_chooser_set_use_preview_label; extern(D) TGTKgtk_file_chooser_set_use_preview_label gtk_file_chooser_set_use_preview_label;
+alias extern (C) int function(void *)TGTKgtk_file_chooser_get_preview_widget_active; extern(D) TGTKgtk_file_chooser_get_preview_widget_active gtk_file_chooser_get_preview_widget_active;
+alias extern (C) void function(void *, int)TGTKgtk_file_chooser_set_preview_widget_active; extern(D) TGTKgtk_file_chooser_set_preview_widget_active gtk_file_chooser_set_preview_widget_active;
+alias extern (C) _GtkWidget * function(void *)TGTKgtk_file_chooser_get_preview_widget; extern(D) TGTKgtk_file_chooser_get_preview_widget gtk_file_chooser_get_preview_widget;
+alias extern (C) void function(void *, aGtkWidget *)TGTKgtk_file_chooser_set_preview_widget; extern(D) TGTKgtk_file_chooser_set_preview_widget gtk_file_chooser_set_preview_widget;
+alias extern (C) char * function(void *)TGTKgtk_file_chooser_get_current_folder_uri; extern(D) TGTKgtk_file_chooser_get_current_folder_uri gtk_file_chooser_get_current_folder_uri;
+alias extern (C) int function(void *, char *)TGTKgtk_file_chooser_set_current_folder_uri; extern(D) TGTKgtk_file_chooser_set_current_folder_uri gtk_file_chooser_set_current_folder_uri;
+alias extern (C) _GSList * function(void *)TGTKgtk_file_chooser_get_uris; extern(D) TGTKgtk_file_chooser_get_uris gtk_file_chooser_get_uris;
+alias extern (C) void function(void *, char *)TGTKgtk_file_chooser_unselect_uri; extern(D) TGTKgtk_file_chooser_unselect_uri gtk_file_chooser_unselect_uri;
+alias extern (C) int function(void *, char *)TGTKgtk_file_chooser_select_uri; extern(D) TGTKgtk_file_chooser_select_uri gtk_file_chooser_select_uri;
+alias extern (C) int function(void *, char *)TGTKgtk_file_chooser_set_uri; extern(D) TGTKgtk_file_chooser_set_uri gtk_file_chooser_set_uri;
+alias extern (C) char * function(void *)TGTKgtk_file_chooser_get_uri; extern(D) TGTKgtk_file_chooser_get_uri gtk_file_chooser_get_uri;
+alias extern (C) char * function(void *)TGTKgtk_file_chooser_get_current_folder; extern(D) TGTKgtk_file_chooser_get_current_folder gtk_file_chooser_get_current_folder;
+alias extern (C) int function(void *, char *)TGTKgtk_file_chooser_set_current_folder; extern(D) TGTKgtk_file_chooser_set_current_folder gtk_file_chooser_set_current_folder;
+alias extern (C) _GSList * function(void *)TGTKgtk_file_chooser_get_filenames; extern(D) TGTKgtk_file_chooser_get_filenames gtk_file_chooser_get_filenames;
+alias extern (C) void function(void *)TGTKgtk_file_chooser_unselect_all; extern(D) TGTKgtk_file_chooser_unselect_all gtk_file_chooser_unselect_all;
+alias extern (C) void function(void *)TGTKgtk_file_chooser_select_all; extern(D) TGTKgtk_file_chooser_select_all gtk_file_chooser_select_all;
+alias extern (C) void function(void *, char *)TGTKgtk_file_chooser_unselect_filename; extern(D) TGTKgtk_file_chooser_unselect_filename gtk_file_chooser_unselect_filename;
+alias extern (C) int function(void *, char *)TGTKgtk_file_chooser_select_filename; extern(D) TGTKgtk_file_chooser_select_filename gtk_file_chooser_select_filename;
+alias extern (C) int function(void *, char *)TGTKgtk_file_chooser_set_filename; extern(D) TGTKgtk_file_chooser_set_filename gtk_file_chooser_set_filename;
+alias extern (C) char * function(void *)TGTKgtk_file_chooser_get_filename; extern(D) TGTKgtk_file_chooser_get_filename gtk_file_chooser_get_filename;
+alias extern (C) void function(void *, char *)TGTKgtk_file_chooser_set_current_name; extern(D) TGTKgtk_file_chooser_set_current_name gtk_file_chooser_set_current_name;
+alias extern (C) int function(void *)TGTKgtk_file_chooser_get_do_overwrite_confirmation; extern(D) TGTKgtk_file_chooser_get_do_overwrite_confirmation gtk_file_chooser_get_do_overwrite_confirmation;
+alias extern (C) void function(void *, int)TGTKgtk_file_chooser_set_do_overwrite_confirmation; extern(D) TGTKgtk_file_chooser_set_do_overwrite_confirmation gtk_file_chooser_set_do_overwrite_confirmation;
+alias extern (C) int function(void *)TGTKgtk_file_chooser_get_show_hidden; extern(D) TGTKgtk_file_chooser_get_show_hidden gtk_file_chooser_get_show_hidden;
+alias extern (C) void function(void *, int)TGTKgtk_file_chooser_set_show_hidden; extern(D) TGTKgtk_file_chooser_set_show_hidden gtk_file_chooser_set_show_hidden;
+alias extern (C) int function(void *)TGTKgtk_file_chooser_get_select_multiple; extern(D) TGTKgtk_file_chooser_get_select_multiple gtk_file_chooser_get_select_multiple;
+alias extern (C) void function(void *, int)TGTKgtk_file_chooser_set_select_multiple; extern(D) TGTKgtk_file_chooser_set_select_multiple gtk_file_chooser_set_select_multiple;
+alias extern (C) int function(void *)TGTKgtk_file_chooser_get_local_only; extern(D) TGTKgtk_file_chooser_get_local_only gtk_file_chooser_get_local_only;
+alias extern (C) void function(void *, int)TGTKgtk_file_chooser_set_local_only; extern(D) TGTKgtk_file_chooser_set_local_only gtk_file_chooser_set_local_only;
+alias extern (C) int function(void *)TGTKgtk_file_chooser_get_action; extern(D) TGTKgtk_file_chooser_get_action gtk_file_chooser_get_action;
+alias extern (C) void function(void *, int)TGTKgtk_file_chooser_set_action; extern(D) TGTKgtk_file_chooser_set_action gtk_file_chooser_set_action;
+alias extern (C) uint function()TGTKgtk_file_chooser_error_quark; extern(D) TGTKgtk_file_chooser_error_quark gtk_file_chooser_error_quark;
+alias extern (C) uint function()TGTKgtk_file_chooser_get_type; extern(D) TGTKgtk_file_chooser_get_type gtk_file_chooser_get_type;
+alias extern (C) int function(void *, aGtkFileFilterInfo *)TGTKgtk_file_filter_filter; extern(D) TGTKgtk_file_filter_filter gtk_file_filter_filter;
+alias extern (C) int function(void *)TGTKgtk_file_filter_get_needed; extern(D) TGTKgtk_file_filter_get_needed gtk_file_filter_get_needed;
+alias extern (C) void function(void *, int, _BCD_func__10568, void *, _BCD_func__13158)TGTKgtk_file_filter_add_custom; extern(D) TGTKgtk_file_filter_add_custom gtk_file_filter_add_custom;
+alias extern (C) void function(void *)TGTKgtk_file_filter_add_pixbuf_formats; extern(D) TGTKgtk_file_filter_add_pixbuf_formats gtk_file_filter_add_pixbuf_formats;
+alias extern (C) void function(void *, char *)TGTKgtk_file_filter_add_pattern; extern(D) TGTKgtk_file_filter_add_pattern gtk_file_filter_add_pattern;
+alias extern (C) void function(void *, char *)TGTKgtk_file_filter_add_mime_type; extern(D) TGTKgtk_file_filter_add_mime_type gtk_file_filter_add_mime_type;
+alias extern (C) char * function(void *)TGTKgtk_file_filter_get_name; extern(D) TGTKgtk_file_filter_get_name gtk_file_filter_get_name;
+alias extern (C) void function(void *, char *)TGTKgtk_file_filter_set_name; extern(D) TGTKgtk_file_filter_set_name gtk_file_filter_set_name;
+alias extern (C) void * function()TGTKgtk_file_filter_new; extern(D) TGTKgtk_file_filter_new gtk_file_filter_new;
+alias extern (C) uint function()TGTKgtk_file_filter_get_type; extern(D) TGTKgtk_file_filter_get_type gtk_file_filter_get_type;
+alias extern (C) int function(aGtkFixed *)TGTKgtk_fixed_get_has_window; extern(D) TGTKgtk_fixed_get_has_window gtk_fixed_get_has_window;
+alias extern (C) void function(aGtkFixed *, int)TGTKgtk_fixed_set_has_window; extern(D) TGTKgtk_fixed_set_has_window gtk_fixed_set_has_window;
+alias extern (C) void function(aGtkFixed *, aGtkWidget *, int, int)TGTKgtk_fixed_move; extern(D) TGTKgtk_fixed_move gtk_fixed_move;
+alias extern (C) void function(aGtkFixed *, aGtkWidget *, int, int)TGTKgtk_fixed_put; extern(D) TGTKgtk_fixed_put gtk_fixed_put;
+alias extern (C) _GtkWidget * function()TGTKgtk_fixed_new; extern(D) TGTKgtk_fixed_new gtk_fixed_new;
+alias extern (C) uint function()TGTKgtk_fixed_get_type; extern(D) TGTKgtk_fixed_get_type gtk_fixed_get_type;
+alias extern (C) int function(aGtkFileSelection *)TGTKgtk_file_selection_get_select_multiple; extern(D) TGTKgtk_file_selection_get_select_multiple gtk_file_selection_get_select_multiple;
+alias extern (C) void function(aGtkFileSelection *, int)TGTKgtk_file_selection_set_select_multiple; extern(D) TGTKgtk_file_selection_set_select_multiple gtk_file_selection_set_select_multiple;
+alias extern (C) char * * function(aGtkFileSelection *)TGTKgtk_file_selection_get_selections; extern(D) TGTKgtk_file_selection_get_selections gtk_file_selection_get_selections;
+alias extern (C) void function(aGtkFileSelection *)TGTKgtk_file_selection_hide_fileop_buttons; extern(D) TGTKgtk_file_selection_hide_fileop_buttons gtk_file_selection_hide_fileop_buttons;
+alias extern (C) void function(aGtkFileSelection *)TGTKgtk_file_selection_show_fileop_buttons; extern(D) TGTKgtk_file_selection_show_fileop_buttons gtk_file_selection_show_fileop_buttons;
+alias extern (C) void function(aGtkFileSelection *, char *)TGTKgtk_file_selection_complete; extern(D) TGTKgtk_file_selection_complete gtk_file_selection_complete;
+alias extern (C) char * function(aGtkFileSelection *)TGTKgtk_file_selection_get_filename; extern(D) TGTKgtk_file_selection_get_filename gtk_file_selection_get_filename;
+alias extern (C) void function(aGtkFileSelection *, char *)TGTKgtk_file_selection_set_filename; extern(D) TGTKgtk_file_selection_set_filename gtk_file_selection_set_filename;
+alias extern (C) _GtkWidget * function(char *)TGTKgtk_file_selection_new; extern(D) TGTKgtk_file_selection_new gtk_file_selection_new;
+alias extern (C) uint function()TGTKgtk_file_selection_get_type; extern(D) TGTKgtk_file_selection_get_type gtk_file_selection_get_type;
+alias extern (C) _GtkWidget * function(aGtkExpander *)TGTKgtk_expander_get_label_widget; extern(D) TGTKgtk_expander_get_label_widget gtk_expander_get_label_widget;
+alias extern (C) void function(aGtkExpander *, aGtkWidget *)TGTKgtk_expander_set_label_widget; extern(D) TGTKgtk_expander_set_label_widget gtk_expander_set_label_widget;
+alias extern (C) int function(aGtkExpander *)TGTKgtk_expander_get_use_markup; extern(D) TGTKgtk_expander_get_use_markup gtk_expander_get_use_markup;
+alias extern (C) void function(aGtkExpander *, int)TGTKgtk_expander_set_use_markup; extern(D) TGTKgtk_expander_set_use_markup gtk_expander_set_use_markup;
+alias extern (C) int function(aGtkExpander *)TGTKgtk_expander_get_use_underline; extern(D) TGTKgtk_expander_get_use_underline gtk_expander_get_use_underline;
+alias extern (C) void function(aGtkExpander *, int)TGTKgtk_expander_set_use_underline; extern(D) TGTKgtk_expander_set_use_underline gtk_expander_set_use_underline;
+alias extern (C) char * function(aGtkExpander *)TGTKgtk_expander_get_label; extern(D) TGTKgtk_expander_get_label gtk_expander_get_label;
+alias extern (C) void function(aGtkExpander *, char *)TGTKgtk_expander_set_label; extern(D) TGTKgtk_expander_set_label gtk_expander_set_label;
+alias extern (C) int function(aGtkExpander *)TGTKgtk_expander_get_spacing; extern(D) TGTKgtk_expander_get_spacing gtk_expander_get_spacing;
+alias extern (C) void function(aGtkExpander *, int)TGTKgtk_expander_set_spacing; extern(D) TGTKgtk_expander_set_spacing gtk_expander_set_spacing;
+alias extern (C) int function(aGtkExpander *)TGTKgtk_expander_get_expanded; extern(D) TGTKgtk_expander_get_expanded gtk_expander_get_expanded;
+alias extern (C) void function(aGtkExpander *, int)TGTKgtk_expander_set_expanded; extern(D) TGTKgtk_expander_set_expanded gtk_expander_set_expanded;
+alias extern (C) _GtkWidget * function(char *)TGTKgtk_expander_new_with_mnemonic; extern(D) TGTKgtk_expander_new_with_mnemonic gtk_expander_new_with_mnemonic;
+alias extern (C) _GtkWidget * function(char *)TGTKgtk_expander_new; extern(D) TGTKgtk_expander_new gtk_expander_new;
+alias extern (C) uint function()TGTKgtk_expander_get_type; extern(D) TGTKgtk_expander_get_type gtk_expander_get_type;
+alias extern (C) void function(aGtkEventBox *, int)TGTKgtk_event_box_set_above_child; extern(D) TGTKgtk_event_box_set_above_child gtk_event_box_set_above_child;
+alias extern (C) int function(aGtkEventBox *)TGTKgtk_event_box_get_above_child; extern(D) TGTKgtk_event_box_get_above_child gtk_event_box_get_above_child;
+alias extern (C) void function(aGtkEventBox *, int)TGTKgtk_event_box_set_visible_window; extern(D) TGTKgtk_event_box_set_visible_window gtk_event_box_set_visible_window;
+alias extern (C) int function(aGtkEventBox *)TGTKgtk_event_box_get_visible_window; extern(D) TGTKgtk_event_box_get_visible_window gtk_event_box_get_visible_window;
+alias extern (C) _GtkWidget * function()TGTKgtk_event_box_new; extern(D) TGTKgtk_event_box_new gtk_event_box_new;
+alias extern (C) uint function()TGTKgtk_event_box_get_type; extern(D) TGTKgtk_event_box_get_type gtk_event_box_get_type;
+alias extern (C) void function(aGtkCurve *, int)TGTKgtk_curve_set_curve_type; extern(D) TGTKgtk_curve_set_curve_type gtk_curve_set_curve_type;
+alias extern (C) void function(aGtkCurve *, int, float *)TGTKgtk_curve_set_vector; extern(D) TGTKgtk_curve_set_vector gtk_curve_set_vector;
+alias extern (C) void function(aGtkCurve *, int, float *)TGTKgtk_curve_get_vector; extern(D) TGTKgtk_curve_get_vector gtk_curve_get_vector;
+alias extern (C) void function(aGtkCurve *, float, float, float, float)TGTKgtk_curve_set_range; extern(D) TGTKgtk_curve_set_range gtk_curve_set_range;
+alias extern (C) void function(aGtkCurve *, float)TGTKgtk_curve_set_gamma; extern(D) TGTKgtk_curve_set_gamma gtk_curve_set_gamma;
+alias extern (C) void function(aGtkCurve *)TGTKgtk_curve_reset; extern(D) TGTKgtk_curve_reset gtk_curve_reset;
+alias extern (C) _GtkWidget * function()TGTKgtk_curve_new; extern(D) TGTKgtk_curve_new gtk_curve_new;
+alias extern (C) uint function()TGTKgtk_curve_get_type; extern(D) TGTKgtk_curve_get_type gtk_curve_get_type;
+alias extern (C) void function(aGtkDrawingArea *, int, int)TGTKgtk_drawing_area_size; extern(D) TGTKgtk_drawing_area_size gtk_drawing_area_size;
+alias extern (C) _GtkWidget * function()TGTKgtk_drawing_area_new; extern(D) TGTKgtk_drawing_area_new gtk_drawing_area_new;
+alias extern (C) uint function()TGTKgtk_drawing_area_get_type; extern(D) TGTKgtk_drawing_area_get_type gtk_drawing_area_get_type;
+alias extern (C) uint function()TGTKgtk_ctree_node_get_type; extern(D) TGTKgtk_ctree_node_get_type gtk_ctree_node_get_type;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *)TGTKgtk_ctree_sort_recursive; extern(D) TGTKgtk_ctree_sort_recursive gtk_ctree_sort_recursive;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *)TGTKgtk_ctree_sort_node; extern(D) TGTKgtk_ctree_sort_node gtk_ctree_sort_node;
+alias extern (C) void function(aGtkCTree *, _BCD_func__10682)TGTKgtk_ctree_set_drag_compare_func; extern(D) TGTKgtk_ctree_set_drag_compare_func gtk_ctree_set_drag_compare_func;
+alias extern (C) void function(aGtkCTree *, int)TGTKgtk_ctree_set_expander_style; extern(D) TGTKgtk_ctree_set_expander_style gtk_ctree_set_expander_style;
+alias extern (C) void function(aGtkCTree *, int)TGTKgtk_ctree_set_line_style; extern(D) TGTKgtk_ctree_set_line_style gtk_ctree_set_line_style;
+alias extern (C) void function(aGtkCTree *, int)TGTKgtk_ctree_set_show_stub; extern(D) TGTKgtk_ctree_set_show_stub gtk_ctree_set_show_stub;
+alias extern (C) void function(aGtkCTree *, int)TGTKgtk_ctree_set_spacing; extern(D) TGTKgtk_ctree_set_spacing gtk_ctree_set_spacing;
+alias extern (C) void function(aGtkCTree *, int)TGTKgtk_ctree_set_indent; extern(D) TGTKgtk_ctree_set_indent gtk_ctree_set_indent;
+alias extern (C) int function(aGtkCTree *, aGtkCTreeNode *)TGTKgtk_ctree_node_is_visible; extern(D) TGTKgtk_ctree_node_is_visible gtk_ctree_node_is_visible;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *, int, float, float)TGTKgtk_ctree_node_moveto; extern(D) TGTKgtk_ctree_node_moveto gtk_ctree_node_moveto;
+alias extern (C) void * function(aGtkCTree *, aGtkCTreeNode *)TGTKgtk_ctree_node_get_row_data; extern(D) TGTKgtk_ctree_node_get_row_data gtk_ctree_node_get_row_data;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *, void *, _BCD_func__13158)TGTKgtk_ctree_node_set_row_data_full; extern(D) TGTKgtk_ctree_node_set_row_data_full gtk_ctree_node_set_row_data_full;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *, void *)TGTKgtk_ctree_node_set_row_data; extern(D) TGTKgtk_ctree_node_set_row_data gtk_ctree_node_set_row_data;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *, _GdkColor *)TGTKgtk_ctree_node_set_background; extern(D) TGTKgtk_ctree_node_set_background gtk_ctree_node_set_background;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *, _GdkColor *)TGTKgtk_ctree_node_set_foreground; extern(D) TGTKgtk_ctree_node_set_foreground gtk_ctree_node_set_foreground;
+alias extern (C) _GtkStyle * function(aGtkCTree *, aGtkCTreeNode *, int)TGTKgtk_ctree_node_get_cell_style; extern(D) TGTKgtk_ctree_node_get_cell_style gtk_ctree_node_get_cell_style;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *, int, aGtkStyle *)TGTKgtk_ctree_node_set_cell_style; extern(D) TGTKgtk_ctree_node_set_cell_style gtk_ctree_node_set_cell_style;
+alias extern (C) _GtkStyle * function(aGtkCTree *, aGtkCTreeNode *)TGTKgtk_ctree_node_get_row_style; extern(D) TGTKgtk_ctree_node_get_row_style gtk_ctree_node_get_row_style;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *, aGtkStyle *)TGTKgtk_ctree_node_set_row_style; extern(D) TGTKgtk_ctree_node_set_row_style gtk_ctree_node_set_row_style;
+alias extern (C) int function(aGtkCTree *, aGtkCTreeNode *, char * *, char *, _GdkDrawable * *, _GdkDrawable * *, _GdkDrawable * *, _GdkDrawable * *, int *, int *)TGTKgtk_ctree_get_node_info; extern(D) TGTKgtk_ctree_get_node_info gtk_ctree_get_node_info;
+alias extern (C) int function(aGtkCTree *, aGtkCTreeNode *, int, char * *, char *, _GdkDrawable * *, _GdkDrawable * *)TGTKgtk_ctree_node_get_pixtext; extern(D) TGTKgtk_ctree_node_get_pixtext gtk_ctree_node_get_pixtext;
+alias extern (C) int function(aGtkCTree *, aGtkCTreeNode *, int, _GdkDrawable * *, _GdkDrawable * *)TGTKgtk_ctree_node_get_pixmap; extern(D) TGTKgtk_ctree_node_get_pixmap gtk_ctree_node_get_pixmap;
+alias extern (C) int function(aGtkCTree *, aGtkCTreeNode *, int, char * *)TGTKgtk_ctree_node_get_text; extern(D) TGTKgtk_ctree_node_get_text gtk_ctree_node_get_text;
+alias extern (C) int function(aGtkCTree *, aGtkCTreeNode *, int)TGTKgtk_ctree_node_get_cell_type; extern(D) TGTKgtk_ctree_node_get_cell_type gtk_ctree_node_get_cell_type;
+alias extern (C) int function(aGtkCTree *, aGtkCTreeNode *)TGTKgtk_ctree_node_get_selectable; extern(D) TGTKgtk_ctree_node_get_selectable gtk_ctree_node_get_selectable;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *, int)TGTKgtk_ctree_node_set_selectable; extern(D) TGTKgtk_ctree_node_set_selectable gtk_ctree_node_set_selectable;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *, int, int, int)TGTKgtk_ctree_node_set_shift; extern(D) TGTKgtk_ctree_node_set_shift gtk_ctree_node_set_shift;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *, char *, char, _GdkDrawable *, _GdkDrawable *, _GdkDrawable *, _GdkDrawable *, int, int)TGTKgtk_ctree_set_node_info; extern(D) TGTKgtk_ctree_set_node_info gtk_ctree_set_node_info;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *, int, char *, char, _GdkDrawable *, _GdkDrawable *)TGTKgtk_ctree_node_set_pixtext; extern(D) TGTKgtk_ctree_node_set_pixtext gtk_ctree_node_set_pixtext;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *, int, _GdkDrawable *, _GdkDrawable *)TGTKgtk_ctree_node_set_pixmap; extern(D) TGTKgtk_ctree_node_set_pixmap gtk_ctree_node_set_pixmap;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *, int, char *)TGTKgtk_ctree_node_set_text; extern(D) TGTKgtk_ctree_node_set_text gtk_ctree_node_set_text;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *, int)TGTKgtk_ctree_real_select_recursive; extern(D) TGTKgtk_ctree_real_select_recursive gtk_ctree_real_select_recursive;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *)TGTKgtk_ctree_unselect_recursive; extern(D) TGTKgtk_ctree_unselect_recursive gtk_ctree_unselect_recursive;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *)TGTKgtk_ctree_unselect; extern(D) TGTKgtk_ctree_unselect gtk_ctree_unselect;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *)TGTKgtk_ctree_select_recursive; extern(D) TGTKgtk_ctree_select_recursive gtk_ctree_select_recursive;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *)TGTKgtk_ctree_select; extern(D) TGTKgtk_ctree_select gtk_ctree_select;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *)TGTKgtk_ctree_toggle_expansion_recursive; extern(D) TGTKgtk_ctree_toggle_expansion_recursive gtk_ctree_toggle_expansion_recursive;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *)TGTKgtk_ctree_toggle_expansion; extern(D) TGTKgtk_ctree_toggle_expansion gtk_ctree_toggle_expansion;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *, int)TGTKgtk_ctree_collapse_to_depth; extern(D) TGTKgtk_ctree_collapse_to_depth gtk_ctree_collapse_to_depth;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *)TGTKgtk_ctree_collapse_recursive; extern(D) TGTKgtk_ctree_collapse_recursive gtk_ctree_collapse_recursive;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *)TGTKgtk_ctree_collapse; extern(D) TGTKgtk_ctree_collapse gtk_ctree_collapse;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *, int)TGTKgtk_ctree_expand_to_depth; extern(D) TGTKgtk_ctree_expand_to_depth gtk_ctree_expand_to_depth;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *)TGTKgtk_ctree_expand_recursive; extern(D) TGTKgtk_ctree_expand_recursive gtk_ctree_expand_recursive;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *)TGTKgtk_ctree_expand; extern(D) TGTKgtk_ctree_expand gtk_ctree_expand;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *, aGtkCTreeNode *, aGtkCTreeNode *)TGTKgtk_ctree_move; extern(D) TGTKgtk_ctree_move gtk_ctree_move;
+alias extern (C) int function(aGtkCTree *, int, int)TGTKgtk_ctree_is_hot_spot; extern(D) TGTKgtk_ctree_is_hot_spot gtk_ctree_is_hot_spot;
+alias extern (C) _GList * function(aGtkCTree *, aGtkCTreeNode *, void *, _BCD_func__14970)TGTKgtk_ctree_find_all_by_row_data_custom; extern(D) TGTKgtk_ctree_find_all_by_row_data_custom gtk_ctree_find_all_by_row_data_custom;
+alias extern (C) _GtkCTreeNode * function(aGtkCTree *, aGtkCTreeNode *, void *, _BCD_func__14970)TGTKgtk_ctree_find_by_row_data_custom; extern(D) TGTKgtk_ctree_find_by_row_data_custom gtk_ctree_find_by_row_data_custom;
+alias extern (C) _GList * function(aGtkCTree *, aGtkCTreeNode *, void *)TGTKgtk_ctree_find_all_by_row_data; extern(D) TGTKgtk_ctree_find_all_by_row_data gtk_ctree_find_all_by_row_data;
+alias extern (C) _GtkCTreeNode * function(aGtkCTree *, aGtkCTreeNode *, void *)TGTKgtk_ctree_find_by_row_data; extern(D) TGTKgtk_ctree_find_by_row_data gtk_ctree_find_by_row_data;
+alias extern (C) int function(aGtkCTree *, aGtkCTreeNode *, aGtkCTreeNode *)TGTKgtk_ctree_is_ancestor; extern(D) TGTKgtk_ctree_is_ancestor gtk_ctree_is_ancestor;
+alias extern (C) int function(aGtkCTree *, aGtkCTreeNode *, aGtkCTreeNode *)TGTKgtk_ctree_find; extern(D) TGTKgtk_ctree_find gtk_ctree_find;
+alias extern (C) _GtkCTreeNode * function(aGtkCTree *, uint)TGTKgtk_ctree_node_nth; extern(D) TGTKgtk_ctree_node_nth gtk_ctree_node_nth;
+alias extern (C) _GtkCTreeNode * function(aGtkCTree *, aGtkCTreeRow *)TGTKgtk_ctree_find_node_ptr; extern(D) TGTKgtk_ctree_find_node_ptr gtk_ctree_find_node_ptr;
+alias extern (C) _GtkCTreeNode * function(aGtkCTree *, aGtkCTreeNode *)TGTKgtk_ctree_last; extern(D) TGTKgtk_ctree_last gtk_ctree_last;
+alias extern (C) int function(aGtkCTree *, aGtkCTreeNode *)TGTKgtk_ctree_is_viewable; extern(D) TGTKgtk_ctree_is_viewable gtk_ctree_is_viewable;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *, int, _BCD_func__10684, void *)TGTKgtk_ctree_pre_recursive_to_depth; extern(D) TGTKgtk_ctree_pre_recursive_to_depth gtk_ctree_pre_recursive_to_depth;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *, _BCD_func__10684, void *)TGTKgtk_ctree_pre_recursive; extern(D) TGTKgtk_ctree_pre_recursive gtk_ctree_pre_recursive;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *, int, _BCD_func__10684, void *)TGTKgtk_ctree_post_recursive_to_depth; extern(D) TGTKgtk_ctree_post_recursive_to_depth gtk_ctree_post_recursive_to_depth;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *, _BCD_func__10684, void *)TGTKgtk_ctree_post_recursive; extern(D) TGTKgtk_ctree_post_recursive gtk_ctree_post_recursive;
+alias extern (C) _GNode * function(aGtkCTree *, _GNode *, _GNode *, aGtkCTreeNode *, _BCD_func__10683, void *)TGTKgtk_ctree_export_to_gnode; extern(D) TGTKgtk_ctree_export_to_gnode gtk_ctree_export_to_gnode;
+alias extern (C) _GtkCTreeNode * function(aGtkCTree *, aGtkCTreeNode *, aGtkCTreeNode *, _GNode *, _BCD_func__10683, void *)TGTKgtk_ctree_insert_gnode; extern(D) TGTKgtk_ctree_insert_gnode gtk_ctree_insert_gnode;
+alias extern (C) void function(aGtkCTree *, aGtkCTreeNode *)TGTKgtk_ctree_remove_node; extern(D) TGTKgtk_ctree_remove_node gtk_ctree_remove_node;
+alias extern (C) _GtkCTreeNode * function(aGtkCTree *, aGtkCTreeNode *, aGtkCTreeNode *, char * *, char, _GdkDrawable *, _GdkDrawable *, _GdkDrawable *, _GdkDrawable *, int, int)TGTKgtk_ctree_insert_node; extern(D) TGTKgtk_ctree_insert_node gtk_ctree_insert_node;
+alias extern (C) _GtkWidget * function(int, int)TGTKgtk_ctree_new; extern(D) TGTKgtk_ctree_new gtk_ctree_new;
+alias extern (C) _GtkWidget * function(int, int, char * *)TGTKgtk_ctree_new_with_titles; extern(D) TGTKgtk_ctree_new_with_titles gtk_ctree_new_with_titles;
+alias extern (C) uint function()TGTKgtk_ctree_get_type; extern(D) TGTKgtk_ctree_get_type gtk_ctree_get_type;
+alias extern (C) _GtkWidget * function()TGTKgtk_combo_box_entry_new_text; extern(D) TGTKgtk_combo_box_entry_new_text gtk_combo_box_entry_new_text;
+alias extern (C) int function(aGtkComboBoxEntry *)TGTKgtk_combo_box_entry_get_text_column; extern(D) TGTKgtk_combo_box_entry_get_text_column gtk_combo_box_entry_get_text_column;
+alias extern (C) void function(aGtkComboBoxEntry *, int)TGTKgtk_combo_box_entry_set_text_column; extern(D) TGTKgtk_combo_box_entry_set_text_column gtk_combo_box_entry_set_text_column;
+alias extern (C) _GtkWidget * function(void *, int)TGTKgtk_combo_box_entry_new_with_model; extern(D) TGTKgtk_combo_box_entry_new_with_model gtk_combo_box_entry_new_with_model;
+alias extern (C) _GtkWidget * function()TGTKgtk_combo_box_entry_new; extern(D) TGTKgtk_combo_box_entry_new gtk_combo_box_entry_new;
+alias extern (C) uint function()TGTKgtk_combo_box_entry_get_type; extern(D) TGTKgtk_combo_box_entry_get_type gtk_combo_box_entry_get_type;
+//alias extern (C) int function(aGtkComboBox *)TGTK_gtk_combo_box_editing_canceled; extern(D) TGTK_gtk_combo_box_editing_canceled _gtk_combo_box_editing_canceled;
+alias extern (C) _AtkObject * function(aGtkComboBox *)TGTKgtk_combo_box_get_popup_accessible; extern(D) TGTKgtk_combo_box_get_popup_accessible gtk_combo_box_get_popup_accessible;
+alias extern (C) void function(aGtkComboBox *)TGTKgtk_combo_box_popdown; extern(D) TGTKgtk_combo_box_popdown gtk_combo_box_popdown;
+alias extern (C) void function(aGtkComboBox *)TGTKgtk_combo_box_popup; extern(D) TGTKgtk_combo_box_popup gtk_combo_box_popup;
+alias extern (C) char * function(aGtkComboBox *)TGTKgtk_combo_box_get_active_text; extern(D) TGTKgtk_combo_box_get_active_text gtk_combo_box_get_active_text;
+alias extern (C) void function(aGtkComboBox *, int)TGTKgtk_combo_box_remove_text; extern(D) TGTKgtk_combo_box_remove_text gtk_combo_box_remove_text;
+alias extern (C) void function(aGtkComboBox *, char *)TGTKgtk_combo_box_prepend_text; extern(D) TGTKgtk_combo_box_prepend_text gtk_combo_box_prepend_text;
+alias extern (C) void function(aGtkComboBox *, int, char *)TGTKgtk_combo_box_insert_text; extern(D) TGTKgtk_combo_box_insert_text gtk_combo_box_insert_text;
+alias extern (C) void function(aGtkComboBox *, char *)TGTKgtk_combo_box_append_text; extern(D) TGTKgtk_combo_box_append_text gtk_combo_box_append_text;
+alias extern (C) _GtkWidget * function()TGTKgtk_combo_box_new_text; extern(D) TGTKgtk_combo_box_new_text gtk_combo_box_new_text;
+alias extern (C) void function(aGtkComboBox *, _BCD_func__10753, void *, _BCD_func__13158)TGTKgtk_combo_box_set_row_separator_func; extern(D) TGTKgtk_combo_box_set_row_separator_func gtk_combo_box_set_row_separator_func;
+alias extern (C) _BCD_func__10753 function(aGtkComboBox *)TGTKgtk_combo_box_get_row_separator_func; extern(D) TGTKgtk_combo_box_get_row_separator_func gtk_combo_box_get_row_separator_func;
+alias extern (C) void * function(aGtkComboBox *)TGTKgtk_combo_box_get_model; extern(D) TGTKgtk_combo_box_get_model gtk_combo_box_get_model;
+alias extern (C) void function(aGtkComboBox *, void *)TGTKgtk_combo_box_set_model; extern(D) TGTKgtk_combo_box_set_model gtk_combo_box_set_model;
+alias extern (C) void function(aGtkComboBox *, aGtkTreeIter *)TGTKgtk_combo_box_set_active_iter; extern(D) TGTKgtk_combo_box_set_active_iter gtk_combo_box_set_active_iter;
+alias extern (C) int function(aGtkComboBox *, aGtkTreeIter *)TGTKgtk_combo_box_get_active_iter; extern(D) TGTKgtk_combo_box_get_active_iter gtk_combo_box_get_active_iter;
+alias extern (C) void function(aGtkComboBox *, int)TGTKgtk_combo_box_set_active; extern(D) TGTKgtk_combo_box_set_active gtk_combo_box_set_active;
+alias extern (C) int function(aGtkComboBox *)TGTKgtk_combo_box_get_active; extern(D) TGTKgtk_combo_box_get_active gtk_combo_box_get_active;
+alias extern (C) void function(aGtkComboBox *, int)TGTKgtk_combo_box_set_focus_on_click; extern(D) TGTKgtk_combo_box_set_focus_on_click gtk_combo_box_set_focus_on_click;
+alias extern (C) int function(aGtkComboBox *)TGTKgtk_combo_box_get_focus_on_click; extern(D) TGTKgtk_combo_box_get_focus_on_click gtk_combo_box_get_focus_on_click;
+alias extern (C) void function(aGtkComboBox *, char *)TGTKgtk_combo_box_set_title; extern(D) TGTKgtk_combo_box_set_title gtk_combo_box_set_title;
+alias extern (C) char * function(aGtkComboBox *)TGTKgtk_combo_box_get_title; extern(D) TGTKgtk_combo_box_get_title gtk_combo_box_get_title;
+alias extern (C) void function(aGtkComboBox *, int)TGTKgtk_combo_box_set_add_tearoffs; extern(D) TGTKgtk_combo_box_set_add_tearoffs gtk_combo_box_set_add_tearoffs;
+alias extern (C) int function(aGtkComboBox *)TGTKgtk_combo_box_get_add_tearoffs; extern(D) TGTKgtk_combo_box_get_add_tearoffs gtk_combo_box_get_add_tearoffs;
+alias extern (C) void function(aGtkComboBox *, int)TGTKgtk_combo_box_set_column_span_column; extern(D) TGTKgtk_combo_box_set_column_span_column gtk_combo_box_set_column_span_column;
+alias extern (C) int function(aGtkComboBox *)TGTKgtk_combo_box_get_column_span_column; extern(D) TGTKgtk_combo_box_get_column_span_column gtk_combo_box_get_column_span_column;
+alias extern (C) void function(aGtkComboBox *, int)TGTKgtk_combo_box_set_row_span_column; extern(D) TGTKgtk_combo_box_set_row_span_column gtk_combo_box_set_row_span_column;
+alias extern (C) int function(aGtkComboBox *)TGTKgtk_combo_box_get_row_span_column; extern(D) TGTKgtk_combo_box_get_row_span_column gtk_combo_box_get_row_span_column;
+alias extern (C) void function(aGtkComboBox *, int)TGTKgtk_combo_box_set_wrap_width; extern(D) TGTKgtk_combo_box_set_wrap_width gtk_combo_box_set_wrap_width;
+alias extern (C) int function(aGtkComboBox *)TGTKgtk_combo_box_get_wrap_width; extern(D) TGTKgtk_combo_box_get_wrap_width gtk_combo_box_get_wrap_width;
+alias extern (C) _GtkWidget * function(void *)TGTKgtk_combo_box_new_with_model; extern(D) TGTKgtk_combo_box_new_with_model gtk_combo_box_new_with_model;
+alias extern (C) _GtkWidget * function()TGTKgtk_combo_box_new; extern(D) TGTKgtk_combo_box_new gtk_combo_box_new;
+alias extern (C) uint function()TGTKgtk_combo_box_get_type; extern(D) TGTKgtk_combo_box_get_type gtk_combo_box_get_type;
+alias extern (C) int function(aGtkTreeView *)TGTKgtk_tree_view_get_tooltip_column; extern(D) TGTKgtk_tree_view_get_tooltip_column gtk_tree_view_get_tooltip_column;
+alias extern (C) void function(aGtkTreeView *, int)TGTKgtk_tree_view_set_tooltip_column; extern(D) TGTKgtk_tree_view_set_tooltip_column gtk_tree_view_set_tooltip_column;
+alias extern (C) int function(aGtkTreeView *, int *, int *, int, void * *, void * *, aGtkTreeIter *)TGTKgtk_tree_view_get_tooltip_context; extern(D) TGTKgtk_tree_view_get_tooltip_context gtk_tree_view_get_tooltip_context;
+alias extern (C) void function(aGtkTreeView *, void *, void *, aGtkTreeViewColumn *, aGtkCellRenderer *)TGTKgtk_tree_view_set_tooltip_cell; extern(D) TGTKgtk_tree_view_set_tooltip_cell gtk_tree_view_set_tooltip_cell;
+alias extern (C) void function(aGtkTreeView *, void *, void *)TGTKgtk_tree_view_set_tooltip_row; extern(D) TGTKgtk_tree_view_set_tooltip_row gtk_tree_view_set_tooltip_row;
+alias extern (C) int function(aGtkTreeView *)TGTKgtk_tree_view_get_level_indentation; extern(D) TGTKgtk_tree_view_get_level_indentation gtk_tree_view_get_level_indentation;
+alias extern (C) void function(aGtkTreeView *, int)TGTKgtk_tree_view_set_level_indentation; extern(D) TGTKgtk_tree_view_set_level_indentation gtk_tree_view_set_level_indentation;
+alias extern (C) int function(aGtkTreeView *)TGTKgtk_tree_view_get_show_expanders; extern(D) TGTKgtk_tree_view_get_show_expanders gtk_tree_view_get_show_expanders;
+alias extern (C) void function(aGtkTreeView *, int)TGTKgtk_tree_view_set_show_expanders; extern(D) TGTKgtk_tree_view_set_show_expanders gtk_tree_view_set_show_expanders;
+alias extern (C) void function(aGtkTreeView *, int)TGTKgtk_tree_view_set_enable_tree_lines; extern(D) TGTKgtk_tree_view_set_enable_tree_lines gtk_tree_view_set_enable_tree_lines;
+alias extern (C) int function(aGtkTreeView *)TGTKgtk_tree_view_get_enable_tree_lines; extern(D) TGTKgtk_tree_view_get_enable_tree_lines gtk_tree_view_get_enable_tree_lines;
+alias extern (C) void function(aGtkTreeView *, int)TGTKgtk_tree_view_set_grid_lines; extern(D) TGTKgtk_tree_view_set_grid_lines gtk_tree_view_set_grid_lines;
+alias extern (C) int function(aGtkTreeView *)TGTKgtk_tree_view_get_grid_lines; extern(D) TGTKgtk_tree_view_get_grid_lines gtk_tree_view_get_grid_lines;
+alias extern (C) void function(aGtkTreeView *, _BCD_func__10753, void *, _BCD_func__13158)TGTKgtk_tree_view_set_row_separator_func; extern(D) TGTKgtk_tree_view_set_row_separator_func gtk_tree_view_set_row_separator_func;
+alias extern (C) _BCD_func__10753 function(aGtkTreeView *)TGTKgtk_tree_view_get_row_separator_func; extern(D) TGTKgtk_tree_view_get_row_separator_func gtk_tree_view_get_row_separator_func;
+alias extern (C) int function(aGtkTreeView *)TGTKgtk_tree_view_is_rubber_banding_active; extern(D) TGTKgtk_tree_view_is_rubber_banding_active gtk_tree_view_is_rubber_banding_active;
+alias extern (C) int function(aGtkTreeView *)TGTKgtk_tree_view_get_rubber_banding; extern(D) TGTKgtk_tree_view_get_rubber_banding gtk_tree_view_get_rubber_banding;
+alias extern (C) void function(aGtkTreeView *, int)TGTKgtk_tree_view_set_rubber_banding; extern(D) TGTKgtk_tree_view_set_rubber_banding gtk_tree_view_set_rubber_banding;
+alias extern (C) int function(aGtkTreeView *)TGTKgtk_tree_view_get_hover_expand; extern(D) TGTKgtk_tree_view_get_hover_expand gtk_tree_view_get_hover_expand;
+alias extern (C) void function(aGtkTreeView *, int)TGTKgtk_tree_view_set_hover_expand; extern(D) TGTKgtk_tree_view_set_hover_expand gtk_tree_view_set_hover_expand;
+alias extern (C) int function(aGtkTreeView *)TGTKgtk_tree_view_get_hover_selection; extern(D) TGTKgtk_tree_view_get_hover_selection gtk_tree_view_get_hover_selection;
+alias extern (C) void function(aGtkTreeView *, int)TGTKgtk_tree_view_set_hover_selection; extern(D) TGTKgtk_tree_view_set_hover_selection gtk_tree_view_set_hover_selection;
+alias extern (C) int function(aGtkTreeView *)TGTKgtk_tree_view_get_fixed_height_mode; extern(D) TGTKgtk_tree_view_get_fixed_height_mode gtk_tree_view_get_fixed_height_mode;
+alias extern (C) void function(aGtkTreeView *, int)TGTKgtk_tree_view_set_fixed_height_mode; extern(D) TGTKgtk_tree_view_set_fixed_height_mode gtk_tree_view_set_fixed_height_mode;
+alias extern (C) void function(aGtkTreeView *, _BCD_func__10748, void *, _BCD_func__13158)TGTKgtk_tree_view_set_destroy_count_func; extern(D) TGTKgtk_tree_view_set_destroy_count_func gtk_tree_view_set_destroy_count_func;
+alias extern (C) void function(aGtkTreeView *, int, int, int *, int *)TGTKgtk_tree_view_convert_bin_window_to_tree_coords; extern(D) TGTKgtk_tree_view_convert_bin_window_to_tree_coords gtk_tree_view_convert_bin_window_to_tree_coords;
+alias extern (C) void function(aGtkTreeView *, int, int, int *, int *)TGTKgtk_tree_view_convert_tree_to_bin_window_coords; extern(D) TGTKgtk_tree_view_convert_tree_to_bin_window_coords gtk_tree_view_convert_tree_to_bin_window_coords;
+alias extern (C) void function(aGtkTreeView *, int, int, int *, int *)TGTKgtk_tree_view_convert_bin_window_to_widget_coords; extern(D) TGTKgtk_tree_view_convert_bin_window_to_widget_coords gtk_tree_view_convert_bin_window_to_widget_coords;
+alias extern (C) void function(aGtkTreeView *, int, int, int *, int *)TGTKgtk_tree_view_convert_widget_to_bin_window_coords; extern(D) TGTKgtk_tree_view_convert_widget_to_bin_window_coords gtk_tree_view_convert_widget_to_bin_window_coords;
+alias extern (C) void function(aGtkTreeView *, int, int, int *, int *)TGTKgtk_tree_view_convert_tree_to_widget_coords; extern(D) TGTKgtk_tree_view_convert_tree_to_widget_coords gtk_tree_view_convert_tree_to_widget_coords;
+alias extern (C) void function(aGtkTreeView *, int, int, int *, int *)TGTKgtk_tree_view_convert_widget_to_tree_coords; extern(D) TGTKgtk_tree_view_convert_widget_to_tree_coords gtk_tree_view_convert_widget_to_tree_coords;
+alias extern (C) void function(aGtkTreeView *, _BCD_func__10752, void *, _BCD_func__13158)TGTKgtk_tree_view_set_search_position_func; extern(D) TGTKgtk_tree_view_set_search_position_func gtk_tree_view_set_search_position_func;
+alias extern (C) _BCD_func__10752 function(aGtkTreeView *)TGTKgtk_tree_view_get_search_position_func; extern(D) TGTKgtk_tree_view_get_search_position_func gtk_tree_view_get_search_position_func;
+alias extern (C) void function(aGtkTreeView *, aGtkEntry *)TGTKgtk_tree_view_set_search_entry; extern(D) TGTKgtk_tree_view_set_search_entry gtk_tree_view_set_search_entry;
+alias extern (C) _GtkEntry * function(aGtkTreeView *)TGTKgtk_tree_view_get_search_entry; extern(D) TGTKgtk_tree_view_get_search_entry gtk_tree_view_get_search_entry;
+alias extern (C) void function(aGtkTreeView *, _BCD_func__10754, void *, _BCD_func__13158)TGTKgtk_tree_view_set_search_equal_func; extern(D) TGTKgtk_tree_view_set_search_equal_func gtk_tree_view_set_search_equal_func;
+alias extern (C) _BCD_func__10754 function(aGtkTreeView *)TGTKgtk_tree_view_get_search_equal_func; extern(D) TGTKgtk_tree_view_get_search_equal_func gtk_tree_view_get_search_equal_func;
+alias extern (C) void function(aGtkTreeView *, int)TGTKgtk_tree_view_set_search_column; extern(D) TGTKgtk_tree_view_set_search_column gtk_tree_view_set_search_column;
+alias extern (C) int function(aGtkTreeView *)TGTKgtk_tree_view_get_search_column; extern(D) TGTKgtk_tree_view_get_search_column gtk_tree_view_get_search_column;
+alias extern (C) int function(aGtkTreeView *)TGTKgtk_tree_view_get_enable_search; extern(D) TGTKgtk_tree_view_get_enable_search gtk_tree_view_get_enable_search;
+alias extern (C) void function(aGtkTreeView *, int)TGTKgtk_tree_view_set_enable_search; extern(D) TGTKgtk_tree_view_set_enable_search gtk_tree_view_set_enable_search;
+alias extern (C) _GdkDrawable * function(aGtkTreeView *, void *)TGTKgtk_tree_view_create_row_drag_icon; extern(D) TGTKgtk_tree_view_create_row_drag_icon gtk_tree_view_create_row_drag_icon;
+alias extern (C) int function(aGtkTreeView *, int, int, void * *, int *)TGTKgtk_tree_view_get_dest_row_at_pos; extern(D) TGTKgtk_tree_view_get_dest_row_at_pos gtk_tree_view_get_dest_row_at_pos;
+alias extern (C) void function(aGtkTreeView *, void * *, int *)TGTKgtk_tree_view_get_drag_dest_row; extern(D) TGTKgtk_tree_view_get_drag_dest_row gtk_tree_view_get_drag_dest_row;
+alias extern (C) void function(aGtkTreeView *, void *, int)TGTKgtk_tree_view_set_drag_dest_row; extern(D) TGTKgtk_tree_view_set_drag_dest_row gtk_tree_view_set_drag_dest_row;
+alias extern (C) void function(aGtkTreeView *)TGTKgtk_tree_view_unset_rows_drag_dest; extern(D) TGTKgtk_tree_view_unset_rows_drag_dest gtk_tree_view_unset_rows_drag_dest;
+alias extern (C) void function(aGtkTreeView *)TGTKgtk_tree_view_unset_rows_drag_source; extern(D) TGTKgtk_tree_view_unset_rows_drag_source gtk_tree_view_unset_rows_drag_source;
+alias extern (C) void function(aGtkTreeView *, aGtkTargetEntry *, int, int)TGTKgtk_tree_view_enable_model_drag_dest; extern(D) TGTKgtk_tree_view_enable_model_drag_dest gtk_tree_view_enable_model_drag_dest;
+alias extern (C) void function(aGtkTreeView *, int, aGtkTargetEntry *, int, int)TGTKgtk_tree_view_enable_model_drag_source; extern(D) TGTKgtk_tree_view_enable_model_drag_source gtk_tree_view_enable_model_drag_source;
+alias extern (C) int function(aGtkTreeView *, void * *, void * *)TGTKgtk_tree_view_get_visible_range; extern(D) TGTKgtk_tree_view_get_visible_range gtk_tree_view_get_visible_range;
+alias extern (C) void function(aGtkTreeView *, int, int, int *, int *)TGTKgtk_tree_view_tree_to_widget_coords; extern(D) TGTKgtk_tree_view_tree_to_widget_coords gtk_tree_view_tree_to_widget_coords;
+alias extern (C) void function(aGtkTreeView *, int, int, int *, int *)TGTKgtk_tree_view_widget_to_tree_coords; extern(D) TGTKgtk_tree_view_widget_to_tree_coords gtk_tree_view_widget_to_tree_coords;
+alias extern (C) void function(aGtkTreeView *, _GdkRectangle *)TGTKgtk_tree_view_get_visible_rect; extern(D) TGTKgtk_tree_view_get_visible_rect gtk_tree_view_get_visible_rect;
+alias extern (C) void function(aGtkTreeView *, void *, aGtkTreeViewColumn *, _GdkRectangle *)TGTKgtk_tree_view_get_background_area; extern(D) TGTKgtk_tree_view_get_background_area gtk_tree_view_get_background_area;
+alias extern (C) void function(aGtkTreeView *, void *, aGtkTreeViewColumn *, _GdkRectangle *)TGTKgtk_tree_view_get_cell_area; extern(D) TGTKgtk_tree_view_get_cell_area gtk_tree_view_get_cell_area;
+alias extern (C) int function(aGtkTreeView *, int, int, void * *, _GtkTreeViewColumn * *, int *, int *)TGTKgtk_tree_view_get_path_at_pos; extern(D) TGTKgtk_tree_view_get_path_at_pos gtk_tree_view_get_path_at_pos;
+alias extern (C) _GdkDrawable * function(aGtkTreeView *)TGTKgtk_tree_view_get_bin_window; extern(D) TGTKgtk_tree_view_get_bin_window gtk_tree_view_get_bin_window;
+alias extern (C) void function(aGtkTreeView *, void * *, _GtkTreeViewColumn * *)TGTKgtk_tree_view_get_cursor; extern(D) TGTKgtk_tree_view_get_cursor gtk_tree_view_get_cursor;
+alias extern (C) void function(aGtkTreeView *, void *, aGtkTreeViewColumn *, aGtkCellRenderer *, int)TGTKgtk_tree_view_set_cursor_on_cell; extern(D) TGTKgtk_tree_view_set_cursor_on_cell gtk_tree_view_set_cursor_on_cell;
+alias extern (C) void function(aGtkTreeView *, void *, aGtkTreeViewColumn *, int)TGTKgtk_tree_view_set_cursor; extern(D) TGTKgtk_tree_view_set_cursor gtk_tree_view_set_cursor;
+alias extern (C) int function(aGtkTreeView *)TGTKgtk_tree_view_get_reorderable; extern(D) TGTKgtk_tree_view_get_reorderable gtk_tree_view_get_reorderable;
+alias extern (C) void function(aGtkTreeView *, int)TGTKgtk_tree_view_set_reorderable; extern(D) TGTKgtk_tree_view_set_reorderable gtk_tree_view_set_reorderable;
+alias extern (C) int function(aGtkTreeView *, void *)TGTKgtk_tree_view_row_expanded; extern(D) TGTKgtk_tree_view_row_expanded gtk_tree_view_row_expanded;
+alias extern (C) void function(aGtkTreeView *, _BCD_func__10755, void *)TGTKgtk_tree_view_map_expanded_rows; extern(D) TGTKgtk_tree_view_map_expanded_rows gtk_tree_view_map_expanded_rows;
+alias extern (C) int function(aGtkTreeView *, void *)TGTKgtk_tree_view_collapse_row; extern(D) TGTKgtk_tree_view_collapse_row gtk_tree_view_collapse_row;
+alias extern (C) int function(aGtkTreeView *, void *, int)TGTKgtk_tree_view_expand_row; extern(D) TGTKgtk_tree_view_expand_row gtk_tree_view_expand_row;
+alias extern (C) void function(aGtkTreeView *, void *)TGTKgtk_tree_view_expand_to_path; extern(D) TGTKgtk_tree_view_expand_to_path gtk_tree_view_expand_to_path;
+alias extern (C) void function(aGtkTreeView *)TGTKgtk_tree_view_collapse_all; extern(D) TGTKgtk_tree_view_collapse_all gtk_tree_view_collapse_all;
+alias extern (C) void function(aGtkTreeView *)TGTKgtk_tree_view_expand_all; extern(D) TGTKgtk_tree_view_expand_all gtk_tree_view_expand_all;
+alias extern (C) void function(aGtkTreeView *, void *, aGtkTreeViewColumn *)TGTKgtk_tree_view_row_activated; extern(D) TGTKgtk_tree_view_row_activated gtk_tree_view_row_activated;
+alias extern (C) void function(aGtkTreeView *, void *, aGtkTreeViewColumn *, int, float, float)TGTKgtk_tree_view_scroll_to_cell; extern(D) TGTKgtk_tree_view_scroll_to_cell gtk_tree_view_scroll_to_cell;
+alias extern (C) void function(aGtkTreeView *, int, int)TGTKgtk_tree_view_scroll_to_point; extern(D) TGTKgtk_tree_view_scroll_to_point gtk_tree_view_scroll_to_point;
+alias extern (C) void function(aGtkTreeView *, _BCD_func__10756, void *, _BCD_func__13158)TGTKgtk_tree_view_set_column_drag_function; extern(D) TGTKgtk_tree_view_set_column_drag_function gtk_tree_view_set_column_drag_function;
+alias extern (C) _GtkTreeViewColumn * function(aGtkTreeView *)TGTKgtk_tree_view_get_expander_column; extern(D) TGTKgtk_tree_view_get_expander_column gtk_tree_view_get_expander_column;
+alias extern (C) void function(aGtkTreeView *, aGtkTreeViewColumn *)TGTKgtk_tree_view_set_expander_column; extern(D) TGTKgtk_tree_view_set_expander_column gtk_tree_view_set_expander_column;
+alias extern (C) void function(aGtkTreeView *, aGtkTreeViewColumn *, aGtkTreeViewColumn *)TGTKgtk_tree_view_move_column_after; extern(D) TGTKgtk_tree_view_move_column_after gtk_tree_view_move_column_after;
+alias extern (C) _GList * function(aGtkTreeView *)TGTKgtk_tree_view_get_columns; extern(D) TGTKgtk_tree_view_get_columns gtk_tree_view_get_columns;
+alias extern (C) _GtkTreeViewColumn * function(aGtkTreeView *, int)TGTKgtk_tree_view_get_column; extern(D) TGTKgtk_tree_view_get_column gtk_tree_view_get_column;
+alias extern (C) int function(aGtkTreeView *, int, char *, aGtkCellRenderer *, _BCD_func__11636, void *, _BCD_func__13158)TGTKgtk_tree_view_insert_column_with_data_func; extern(D) TGTKgtk_tree_view_insert_column_with_data_func gtk_tree_view_insert_column_with_data_func;
+alias extern (C) int function(aGtkTreeView *, int, char *, aGtkCellRenderer *, ...)TGTKgtk_tree_view_insert_column_with_attributes; extern(D) TGTKgtk_tree_view_insert_column_with_attributes gtk_tree_view_insert_column_with_attributes;
+alias extern (C) int function(aGtkTreeView *, aGtkTreeViewColumn *, int)TGTKgtk_tree_view_insert_column; extern(D) TGTKgtk_tree_view_insert_column gtk_tree_view_insert_column;
+alias extern (C) int function(aGtkTreeView *, aGtkTreeViewColumn *)TGTKgtk_tree_view_remove_column; extern(D) TGTKgtk_tree_view_remove_column gtk_tree_view_remove_column;
+alias extern (C) int function(aGtkTreeView *, aGtkTreeViewColumn *)TGTKgtk_tree_view_append_column; extern(D) TGTKgtk_tree_view_append_column gtk_tree_view_append_column;
+alias extern (C) int function(aGtkTreeView *)TGTKgtk_tree_view_get_rules_hint; extern(D) TGTKgtk_tree_view_get_rules_hint gtk_tree_view_get_rules_hint;
+alias extern (C) void function(aGtkTreeView *, int)TGTKgtk_tree_view_set_rules_hint; extern(D) TGTKgtk_tree_view_set_rules_hint gtk_tree_view_set_rules_hint;
+alias extern (C) void function(aGtkTreeView *, int)TGTKgtk_tree_view_set_headers_clickable; extern(D) TGTKgtk_tree_view_set_headers_clickable gtk_tree_view_set_headers_clickable;
+alias extern (C) int function(aGtkTreeView *)TGTKgtk_tree_view_get_headers_clickable; extern(D) TGTKgtk_tree_view_get_headers_clickable gtk_tree_view_get_headers_clickable;
+alias extern (C) void function(aGtkTreeView *)TGTKgtk_tree_view_columns_autosize; extern(D) TGTKgtk_tree_view_columns_autosize gtk_tree_view_columns_autosize;
+alias extern (C) void function(aGtkTreeView *, int)TGTKgtk_tree_view_set_headers_visible; extern(D) TGTKgtk_tree_view_set_headers_visible gtk_tree_view_set_headers_visible;
+alias extern (C) int function(aGtkTreeView *)TGTKgtk_tree_view_get_headers_visible; extern(D) TGTKgtk_tree_view_get_headers_visible gtk_tree_view_get_headers_visible;
+alias extern (C) void function(aGtkTreeView *, aGtkAdjustment *)TGTKgtk_tree_view_set_vadjustment; extern(D) TGTKgtk_tree_view_set_vadjustment gtk_tree_view_set_vadjustment;
+alias extern (C) _GtkAdjustment * function(aGtkTreeView *)TGTKgtk_tree_view_get_vadjustment; extern(D) TGTKgtk_tree_view_get_vadjustment gtk_tree_view_get_vadjustment;
+alias extern (C) void function(aGtkTreeView *, aGtkAdjustment *)TGTKgtk_tree_view_set_hadjustment; extern(D) TGTKgtk_tree_view_set_hadjustment gtk_tree_view_set_hadjustment;
+alias extern (C) _GtkAdjustment * function(aGtkTreeView *)TGTKgtk_tree_view_get_hadjustment; extern(D) TGTKgtk_tree_view_get_hadjustment gtk_tree_view_get_hadjustment;
+alias extern (C) _GtkTreeSelection * function(aGtkTreeView *)TGTKgtk_tree_view_get_selection; extern(D) TGTKgtk_tree_view_get_selection gtk_tree_view_get_selection;
+alias extern (C) void function(aGtkTreeView *, void *)TGTKgtk_tree_view_set_model; extern(D) TGTKgtk_tree_view_set_model gtk_tree_view_set_model;
+alias extern (C) void * function(aGtkTreeView *)TGTKgtk_tree_view_get_model; extern(D) TGTKgtk_tree_view_get_model gtk_tree_view_get_model;
+alias extern (C) _GtkWidget * function(void *)TGTKgtk_tree_view_new_with_model; extern(D) TGTKgtk_tree_view_new_with_model gtk_tree_view_new_with_model;
+alias extern (C) _GtkWidget * function()TGTKgtk_tree_view_new; extern(D) TGTKgtk_tree_view_new gtk_tree_view_new;
+alias extern (C) uint function()TGTKgtk_tree_view_get_type; extern(D) TGTKgtk_tree_view_get_type gtk_tree_view_get_type;
+alias extern (C) void function(aGtkEntry *, int)TGTKgtk_entry_set_editable; extern(D) TGTKgtk_entry_set_editable gtk_entry_set_editable;
+alias extern (C) void function(aGtkEntry *, int, int)TGTKgtk_entry_select_region; extern(D) TGTKgtk_entry_select_region gtk_entry_select_region;
+alias extern (C) void function(aGtkEntry *, int)TGTKgtk_entry_set_position; extern(D) TGTKgtk_entry_set_position gtk_entry_set_position;
+alias extern (C) void function(aGtkEntry *, char *)TGTKgtk_entry_prepend_text; extern(D) TGTKgtk_entry_prepend_text gtk_entry_prepend_text;
+alias extern (C) void function(aGtkEntry *, char *)TGTKgtk_entry_append_text; extern(D) TGTKgtk_entry_append_text gtk_entry_append_text;
+alias extern (C) _GtkWidget * function(int)TGTKgtk_entry_new_with_max_length; extern(D) TGTKgtk_entry_new_with_max_length gtk_entry_new_with_max_length;
+alias extern (C) _GtkAdjustment * function(aGtkEntry *)TGTKgtk_entry_get_cursor_hadjustment; extern(D) TGTKgtk_entry_get_cursor_hadjustment gtk_entry_get_cursor_hadjustment;
+alias extern (C) void function(aGtkEntry *, aGtkAdjustment *)TGTKgtk_entry_set_cursor_hadjustment; extern(D) TGTKgtk_entry_set_cursor_hadjustment gtk_entry_set_cursor_hadjustment;
+alias extern (C) int function(aGtkEntry *, int)TGTKgtk_entry_text_index_to_layout_index; extern(D) TGTKgtk_entry_text_index_to_layout_index gtk_entry_text_index_to_layout_index;
+alias extern (C) int function(aGtkEntry *, int)TGTKgtk_entry_layout_index_to_text_index; extern(D) TGTKgtk_entry_layout_index_to_text_index gtk_entry_layout_index_to_text_index;
+alias extern (C) _GtkEntryCompletion * function(aGtkEntry *)TGTKgtk_entry_get_completion; extern(D) TGTKgtk_entry_get_completion gtk_entry_get_completion;
+alias extern (C) void function(aGtkEntry *, aGtkEntryCompletion *)TGTKgtk_entry_set_completion; extern(D) TGTKgtk_entry_set_completion gtk_entry_set_completion;
+alias extern (C) float function(aGtkEntry *)TGTKgtk_entry_get_alignment; extern(D) TGTKgtk_entry_get_alignment gtk_entry_get_alignment;
+alias extern (C) void function(aGtkEntry *, float)TGTKgtk_entry_set_alignment; extern(D) TGTKgtk_entry_set_alignment gtk_entry_set_alignment;
+alias extern (C) void function(aGtkEntry *, int *, int *)TGTKgtk_entry_get_layout_offsets; extern(D) TGTKgtk_entry_get_layout_offsets gtk_entry_get_layout_offsets;
+alias extern (C) void * function(aGtkEntry *)TGTKgtk_entry_get_layout; extern(D) TGTKgtk_entry_get_layout gtk_entry_get_layout;
+alias extern (C) char * function(aGtkEntry *)TGTKgtk_entry_get_text; extern(D) TGTKgtk_entry_get_text gtk_entry_get_text;
+alias extern (C) void function(aGtkEntry *, char *)TGTKgtk_entry_set_text; extern(D) TGTKgtk_entry_set_text gtk_entry_set_text;
+alias extern (C) int function(aGtkEntry *)TGTKgtk_entry_get_width_chars; extern(D) TGTKgtk_entry_get_width_chars gtk_entry_get_width_chars;
+alias extern (C) void function(aGtkEntry *, int)TGTKgtk_entry_set_width_chars; extern(D) TGTKgtk_entry_set_width_chars gtk_entry_set_width_chars;
+alias extern (C) int function(aGtkEntry *)TGTKgtk_entry_get_activates_default; extern(D) TGTKgtk_entry_get_activates_default gtk_entry_get_activates_default;
+alias extern (C) void function(aGtkEntry *, int)TGTKgtk_entry_set_activates_default; extern(D) TGTKgtk_entry_set_activates_default gtk_entry_set_activates_default;
+alias extern (C) int function(aGtkEntry *)TGTKgtk_entry_get_max_length; extern(D) TGTKgtk_entry_get_max_length gtk_entry_get_max_length;
+alias extern (C) void function(aGtkEntry *, int)TGTKgtk_entry_set_max_length; extern(D) TGTKgtk_entry_set_max_length gtk_entry_set_max_length;
+alias extern (C) _GtkBorder * function(aGtkEntry *)TGTKgtk_entry_get_inner_border; extern(D) TGTKgtk_entry_get_inner_border gtk_entry_get_inner_border;
+alias extern (C) void function(aGtkEntry *, aGtkBorder *)TGTKgtk_entry_set_inner_border; extern(D) TGTKgtk_entry_set_inner_border gtk_entry_set_inner_border;
+alias extern (C) int function(aGtkEntry *)TGTKgtk_entry_get_has_frame; extern(D) TGTKgtk_entry_get_has_frame gtk_entry_get_has_frame;
+alias extern (C) void function(aGtkEntry *, int)TGTKgtk_entry_set_has_frame; extern(D) TGTKgtk_entry_set_has_frame gtk_entry_set_has_frame;
+alias extern (C) uint function(aGtkEntry *)TGTKgtk_entry_get_invisible_char; extern(D) TGTKgtk_entry_get_invisible_char gtk_entry_get_invisible_char;
+alias extern (C) void function(aGtkEntry *, uint)TGTKgtk_entry_set_invisible_char; extern(D) TGTKgtk_entry_set_invisible_char gtk_entry_set_invisible_char;
+alias extern (C) int function(aGtkEntry *)TGTKgtk_entry_get_visibility; extern(D) TGTKgtk_entry_get_visibility gtk_entry_get_visibility;
+alias extern (C) void function(aGtkEntry *, int)TGTKgtk_entry_set_visibility; extern(D) TGTKgtk_entry_set_visibility gtk_entry_set_visibility;
+alias extern (C) _GtkWidget * function()TGTKgtk_entry_new; extern(D) TGTKgtk_entry_new gtk_entry_new;
+alias extern (C) uint function()TGTKgtk_entry_get_type; extern(D) TGTKgtk_entry_get_type gtk_entry_get_type;
+alias extern (C) int function(aGtkEntryCompletion *)TGTKgtk_entry_completion_get_text_column; extern(D) TGTKgtk_entry_completion_get_text_column gtk_entry_completion_get_text_column;
+alias extern (C) void function(aGtkEntryCompletion *, int)TGTKgtk_entry_completion_set_text_column; extern(D) TGTKgtk_entry_completion_set_text_column gtk_entry_completion_set_text_column;
+alias extern (C) char * function(aGtkEntryCompletion *)TGTKgtk_entry_completion_get_completion_prefix; extern(D) TGTKgtk_entry_completion_get_completion_prefix gtk_entry_completion_get_completion_prefix;
+alias extern (C) int function(aGtkEntryCompletion *)TGTKgtk_entry_completion_get_popup_single_match; extern(D) TGTKgtk_entry_completion_get_popup_single_match gtk_entry_completion_get_popup_single_match;
+alias extern (C) void function(aGtkEntryCompletion *, int)TGTKgtk_entry_completion_set_popup_single_match; extern(D) TGTKgtk_entry_completion_set_popup_single_match gtk_entry_completion_set_popup_single_match;
+alias extern (C) int function(aGtkEntryCompletion *)TGTKgtk_entry_completion_get_popup_set_width; extern(D) TGTKgtk_entry_completion_get_popup_set_width gtk_entry_completion_get_popup_set_width;
+alias extern (C) void function(aGtkEntryCompletion *, int)TGTKgtk_entry_completion_set_popup_set_width; extern(D) TGTKgtk_entry_completion_set_popup_set_width gtk_entry_completion_set_popup_set_width;
+alias extern (C) int function(aGtkEntryCompletion *)TGTKgtk_entry_completion_get_popup_completion; extern(D) TGTKgtk_entry_completion_get_popup_completion gtk_entry_completion_get_popup_completion;
+alias extern (C) void function(aGtkEntryCompletion *, int)TGTKgtk_entry_completion_set_popup_completion; extern(D) TGTKgtk_entry_completion_set_popup_completion gtk_entry_completion_set_popup_completion;
+alias extern (C) int function(aGtkEntryCompletion *)TGTKgtk_entry_completion_get_inline_selection; extern(D) TGTKgtk_entry_completion_get_inline_selection gtk_entry_completion_get_inline_selection;
+alias extern (C) void function(aGtkEntryCompletion *, int)TGTKgtk_entry_completion_set_inline_selection; extern(D) TGTKgtk_entry_completion_set_inline_selection gtk_entry_completion_set_inline_selection;
+alias extern (C) int function(aGtkEntryCompletion *)TGTKgtk_entry_completion_get_inline_completion; extern(D) TGTKgtk_entry_completion_get_inline_completion gtk_entry_completion_get_inline_completion;
+alias extern (C) void function(aGtkEntryCompletion *, int)TGTKgtk_entry_completion_set_inline_completion; extern(D) TGTKgtk_entry_completion_set_inline_completion gtk_entry_completion_set_inline_completion;
+alias extern (C) void function(aGtkEntryCompletion *, int)TGTKgtk_entry_completion_delete_action; extern(D) TGTKgtk_entry_completion_delete_action gtk_entry_completion_delete_action;
+alias extern (C) void function(aGtkEntryCompletion *, int, char *)TGTKgtk_entry_completion_insert_action_markup; extern(D) TGTKgtk_entry_completion_insert_action_markup gtk_entry_completion_insert_action_markup;
+alias extern (C) void function(aGtkEntryCompletion *, int, char *)TGTKgtk_entry_completion_insert_action_text; extern(D) TGTKgtk_entry_completion_insert_action_text gtk_entry_completion_insert_action_text;
+alias extern (C) void function(aGtkEntryCompletion *)TGTKgtk_entry_completion_insert_prefix; extern(D) TGTKgtk_entry_completion_insert_prefix gtk_entry_completion_insert_prefix;
+alias extern (C) void function(aGtkEntryCompletion *)TGTKgtk_entry_completion_complete; extern(D) TGTKgtk_entry_completion_complete gtk_entry_completion_complete;
+alias extern (C) int function(aGtkEntryCompletion *)TGTKgtk_entry_completion_get_minimum_key_length; extern(D) TGTKgtk_entry_completion_get_minimum_key_length gtk_entry_completion_get_minimum_key_length;
+alias extern (C) void function(aGtkEntryCompletion *, int)TGTKgtk_entry_completion_set_minimum_key_length; extern(D) TGTKgtk_entry_completion_set_minimum_key_length gtk_entry_completion_set_minimum_key_length;
+alias extern (C) void function(aGtkEntryCompletion *, _BCD_func__10863, void *, _BCD_func__13158)TGTKgtk_entry_completion_set_match_func; extern(D) TGTKgtk_entry_completion_set_match_func gtk_entry_completion_set_match_func;
+alias extern (C) void * function(aGtkEntryCompletion *)TGTKgtk_entry_completion_get_model; extern(D) TGTKgtk_entry_completion_get_model gtk_entry_completion_get_model;
+alias extern (C) void function(aGtkEntryCompletion *, void *)TGTKgtk_entry_completion_set_model; extern(D) TGTKgtk_entry_completion_set_model gtk_entry_completion_set_model;
+alias extern (C) _GtkWidget * function(aGtkEntryCompletion *)TGTKgtk_entry_completion_get_entry; extern(D) TGTKgtk_entry_completion_get_entry gtk_entry_completion_get_entry;
+alias extern (C) _GtkEntryCompletion * function()TGTKgtk_entry_completion_new; extern(D) TGTKgtk_entry_completion_new gtk_entry_completion_new;
+alias extern (C) uint function()TGTKgtk_entry_completion_get_type; extern(D) TGTKgtk_entry_completion_get_type gtk_entry_completion_get_type;
+alias extern (C) void function(aGtkTreeModelFilter *)TGTKgtk_tree_model_filter_clear_cache; extern(D) TGTKgtk_tree_model_filter_clear_cache gtk_tree_model_filter_clear_cache;
+alias extern (C) void function(aGtkTreeModelFilter *)TGTKgtk_tree_model_filter_refilter; extern(D) TGTKgtk_tree_model_filter_refilter gtk_tree_model_filter_refilter;
+alias extern (C) void * function(aGtkTreeModelFilter *, void *)TGTKgtk_tree_model_filter_convert_path_to_child_path; extern(D) TGTKgtk_tree_model_filter_convert_path_to_child_path gtk_tree_model_filter_convert_path_to_child_path;
+alias extern (C) void * function(aGtkTreeModelFilter *, void *)TGTKgtk_tree_model_filter_convert_child_path_to_path; extern(D) TGTKgtk_tree_model_filter_convert_child_path_to_path gtk_tree_model_filter_convert_child_path_to_path;
+alias extern (C) void function(aGtkTreeModelFilter *, aGtkTreeIter *, aGtkTreeIter *)TGTKgtk_tree_model_filter_convert_iter_to_child_iter; extern(D) TGTKgtk_tree_model_filter_convert_iter_to_child_iter gtk_tree_model_filter_convert_iter_to_child_iter;
+alias extern (C) int function(aGtkTreeModelFilter *, aGtkTreeIter *, aGtkTreeIter *)TGTKgtk_tree_model_filter_convert_child_iter_to_iter; extern(D) TGTKgtk_tree_model_filter_convert_child_iter_to_iter gtk_tree_model_filter_convert_child_iter_to_iter;
+alias extern (C) void * function(aGtkTreeModelFilter *)TGTKgtk_tree_model_filter_get_model; extern(D) TGTKgtk_tree_model_filter_get_model gtk_tree_model_filter_get_model;
+alias extern (C) void function(aGtkTreeModelFilter *, int)TGTKgtk_tree_model_filter_set_visible_column; extern(D) TGTKgtk_tree_model_filter_set_visible_column gtk_tree_model_filter_set_visible_column;
+alias extern (C) void function(aGtkTreeModelFilter *, int, uint *, _BCD_func__10889, void *, _BCD_func__13158)TGTKgtk_tree_model_filter_set_modify_func; extern(D) TGTKgtk_tree_model_filter_set_modify_func gtk_tree_model_filter_set_modify_func;
+alias extern (C) void function(aGtkTreeModelFilter *, _BCD_func__10753, void *, _BCD_func__13158)TGTKgtk_tree_model_filter_set_visible_func; extern(D) TGTKgtk_tree_model_filter_set_visible_func gtk_tree_model_filter_set_visible_func;
+alias extern (C) void * function(void *, void *)TGTKgtk_tree_model_filter_new; extern(D) TGTKgtk_tree_model_filter_new gtk_tree_model_filter_new;
+alias extern (C) uint function()TGTKgtk_tree_model_filter_get_type; extern(D) TGTKgtk_tree_model_filter_get_type gtk_tree_model_filter_get_type;
+alias extern (C) void function(aGtkListStore *, aGtkTreeIter *, aGtkTreeIter *)TGTKgtk_list_store_move_before; extern(D) TGTKgtk_list_store_move_before gtk_list_store_move_before;
+alias extern (C) void function(aGtkListStore *, aGtkTreeIter *, aGtkTreeIter *)TGTKgtk_list_store_move_after; extern(D) TGTKgtk_list_store_move_after gtk_list_store_move_after;
+alias extern (C) void function(aGtkListStore *, aGtkTreeIter *, aGtkTreeIter *)TGTKgtk_list_store_swap; extern(D) TGTKgtk_list_store_swap gtk_list_store_swap;
+alias extern (C) void function(aGtkListStore *, int *)TGTKgtk_list_store_reorder; extern(D) TGTKgtk_list_store_reorder gtk_list_store_reorder;
+alias extern (C) int function(aGtkListStore *, aGtkTreeIter *)TGTKgtk_list_store_iter_is_valid; extern(D) TGTKgtk_list_store_iter_is_valid gtk_list_store_iter_is_valid;
+alias extern (C) void function(aGtkListStore *)TGTKgtk_list_store_clear; extern(D) TGTKgtk_list_store_clear gtk_list_store_clear;
+alias extern (C) void function(aGtkListStore *, aGtkTreeIter *)TGTKgtk_list_store_append; extern(D) TGTKgtk_list_store_append gtk_list_store_append;
+alias extern (C) void function(aGtkListStore *, aGtkTreeIter *)TGTKgtk_list_store_prepend; extern(D) TGTKgtk_list_store_prepend gtk_list_store_prepend;
+alias extern (C) void function(aGtkListStore *, aGtkTreeIter *, int, int *, _GValue *, int)TGTKgtk_list_store_insert_with_valuesv; extern(D) TGTKgtk_list_store_insert_with_valuesv gtk_list_store_insert_with_valuesv;
+alias extern (C) void function(aGtkListStore *, aGtkTreeIter *, int, ...)TGTKgtk_list_store_insert_with_values; extern(D) TGTKgtk_list_store_insert_with_values gtk_list_store_insert_with_values;
+alias extern (C) void function(aGtkListStore *, aGtkTreeIter *, aGtkTreeIter *)TGTKgtk_list_store_insert_after; extern(D) TGTKgtk_list_store_insert_after gtk_list_store_insert_after;
+alias extern (C) void function(aGtkListStore *, aGtkTreeIter *, aGtkTreeIter *)TGTKgtk_list_store_insert_before; extern(D) TGTKgtk_list_store_insert_before gtk_list_store_insert_before;
+alias extern (C) void function(aGtkListStore *, aGtkTreeIter *, int)TGTKgtk_list_store_insert; extern(D) TGTKgtk_list_store_insert gtk_list_store_insert;
+alias extern (C) int function(aGtkListStore *, aGtkTreeIter *)TGTKgtk_list_store_remove; extern(D) TGTKgtk_list_store_remove gtk_list_store_remove;
+alias extern (C) void function(aGtkListStore *, aGtkTreeIter *, char *)TGTKgtk_list_store_set_valist; extern(D) TGTKgtk_list_store_set_valist gtk_list_store_set_valist;
+alias extern (C) void function(aGtkListStore *, aGtkTreeIter *, int *, _GValue *, int)TGTKgtk_list_store_set_valuesv; extern(D) TGTKgtk_list_store_set_valuesv gtk_list_store_set_valuesv;
+alias extern (C) void function(aGtkListStore *, aGtkTreeIter *, ...)TGTKgtk_list_store_set; extern(D) TGTKgtk_list_store_set gtk_list_store_set;
+alias extern (C) void function(aGtkListStore *, aGtkTreeIter *, int, _GValue *)TGTKgtk_list_store_set_value; extern(D) TGTKgtk_list_store_set_value gtk_list_store_set_value;
+alias extern (C) void function(aGtkListStore *, int, uint *)TGTKgtk_list_store_set_column_types; extern(D) TGTKgtk_list_store_set_column_types gtk_list_store_set_column_types;
+alias extern (C) _GtkListStore * function(int, uint *)TGTKgtk_list_store_newv; extern(D) TGTKgtk_list_store_newv gtk_list_store_newv;
+alias extern (C) _GtkListStore * function(int, ...)TGTKgtk_list_store_new; extern(D) TGTKgtk_list_store_new gtk_list_store_new;
+alias extern (C) uint function()TGTKgtk_list_store_get_type; extern(D) TGTKgtk_list_store_get_type gtk_list_store_get_type;
+alias extern (C) int function(aGtkIMContext *, int, int)TGTKgtk_im_context_delete_surrounding; extern(D) TGTKgtk_im_context_delete_surrounding gtk_im_context_delete_surrounding;
+alias extern (C) int function(aGtkIMContext *, char * *, int *)TGTKgtk_im_context_get_surrounding; extern(D) TGTKgtk_im_context_get_surrounding gtk_im_context_get_surrounding;
+alias extern (C) void function(aGtkIMContext *, char *, int, int)TGTKgtk_im_context_set_surrounding; extern(D) TGTKgtk_im_context_set_surrounding gtk_im_context_set_surrounding;
+alias extern (C) void function(aGtkIMContext *, int)TGTKgtk_im_context_set_use_preedit; extern(D) TGTKgtk_im_context_set_use_preedit gtk_im_context_set_use_preedit;
+alias extern (C) void function(aGtkIMContext *, _GdkRectangle *)TGTKgtk_im_context_set_cursor_location; extern(D) TGTKgtk_im_context_set_cursor_location gtk_im_context_set_cursor_location;
+alias extern (C) void function(aGtkIMContext *)TGTKgtk_im_context_reset; extern(D) TGTKgtk_im_context_reset gtk_im_context_reset;
+alias extern (C) void function(aGtkIMContext *)TGTKgtk_im_context_focus_out; extern(D) TGTKgtk_im_context_focus_out gtk_im_context_focus_out;
+alias extern (C) void function(aGtkIMContext *)TGTKgtk_im_context_focus_in; extern(D) TGTKgtk_im_context_focus_in gtk_im_context_focus_in;
+alias extern (C) int function(aGtkIMContext *, _GdkEventKey *)TGTKgtk_im_context_filter_keypress; extern(D) TGTKgtk_im_context_filter_keypress gtk_im_context_filter_keypress;
+alias extern (C) void function(aGtkIMContext *, char * *, void * *, int *)TGTKgtk_im_context_get_preedit_string; extern(D) TGTKgtk_im_context_get_preedit_string gtk_im_context_get_preedit_string;
+alias extern (C) void function(aGtkIMContext *, _GdkDrawable *)TGTKgtk_im_context_set_client_window; extern(D) TGTKgtk_im_context_set_client_window gtk_im_context_set_client_window;
+alias extern (C) uint function()TGTKgtk_im_context_get_type; extern(D) TGTKgtk_im_context_get_type gtk_im_context_get_type;
+alias extern (C) int function(void *)TGTKgtk_editable_get_editable; extern(D) TGTKgtk_editable_get_editable gtk_editable_get_editable;
+alias extern (C) void function(void *, int)TGTKgtk_editable_set_editable; extern(D) TGTKgtk_editable_set_editable gtk_editable_set_editable;
+alias extern (C) int function(void *)TGTKgtk_editable_get_position; extern(D) TGTKgtk_editable_get_position gtk_editable_get_position;
+alias extern (C) void function(void *, int)TGTKgtk_editable_set_position; extern(D) TGTKgtk_editable_set_position gtk_editable_set_position;
+alias extern (C) void function(void *)TGTKgtk_editable_delete_selection; extern(D) TGTKgtk_editable_delete_selection gtk_editable_delete_selection;
+alias extern (C) void function(void *)TGTKgtk_editable_paste_clipboard; extern(D) TGTKgtk_editable_paste_clipboard gtk_editable_paste_clipboard;
+alias extern (C) void function(void *)TGTKgtk_editable_copy_clipboard; extern(D) TGTKgtk_editable_copy_clipboard gtk_editable_copy_clipboard;
+alias extern (C) void function(void *)TGTKgtk_editable_cut_clipboard; extern(D) TGTKgtk_editable_cut_clipboard gtk_editable_cut_clipboard;
+alias extern (C) char * function(void *, int, int)TGTKgtk_editable_get_chars; extern(D) TGTKgtk_editable_get_chars gtk_editable_get_chars;
+alias extern (C) void function(void *, int, int)TGTKgtk_editable_delete_text; extern(D) TGTKgtk_editable_delete_text gtk_editable_delete_text;
+alias extern (C) void function(void *, char *, int, int *)TGTKgtk_editable_insert_text; extern(D) TGTKgtk_editable_insert_text gtk_editable_insert_text;
+alias extern (C) int function(void *, int *, int *)TGTKgtk_editable_get_selection_bounds; extern(D) TGTKgtk_editable_get_selection_bounds gtk_editable_get_selection_bounds;
+alias extern (C) void function(void *, int, int)TGTKgtk_editable_select_region; extern(D) TGTKgtk_editable_select_region gtk_editable_select_region;
+alias extern (C) uint function()TGTKgtk_editable_get_type; extern(D) TGTKgtk_editable_get_type gtk_editable_get_type;
+alias extern (C) void function(_GdkColormap *, _GdkDrawable *, _GdkDrawable *, int, int)TGTKgtk_drag_set_default_icon; extern(D) TGTKgtk_drag_set_default_icon gtk_drag_set_default_icon;
+//alias extern (C) void function(aGtkWidget *, _GdkEvent *)TGTK_gtk_drag_dest_handle_event; extern(D) TGTK_gtk_drag_dest_handle_event _gtk_drag_dest_handle_event;
+//alias extern (C) void function(aGtkWidget *, _GdkEvent *)TGTK_gtk_drag_source_handle_event; extern(D) TGTK_gtk_drag_source_handle_event _gtk_drag_source_handle_event;
+alias extern (C) int function(aGtkWidget *, int, int, int, int)TGTKgtk_drag_check_threshold; extern(D) TGTKgtk_drag_check_threshold gtk_drag_check_threshold;
+alias extern (C) void function(_GdkDragContext *)TGTKgtk_drag_set_icon_default; extern(D) TGTKgtk_drag_set_icon_default gtk_drag_set_icon_default;
+alias extern (C) void function(_GdkDragContext *, char *, int, int)TGTKgtk_drag_set_icon_name; extern(D) TGTKgtk_drag_set_icon_name gtk_drag_set_icon_name;
+alias extern (C) void function(_GdkDragContext *, char *, int, int)TGTKgtk_drag_set_icon_stock; extern(D) TGTKgtk_drag_set_icon_stock gtk_drag_set_icon_stock;
+alias extern (C) void function(_GdkDragContext *, void *, int, int)TGTKgtk_drag_set_icon_pixbuf; extern(D) TGTKgtk_drag_set_icon_pixbuf gtk_drag_set_icon_pixbuf;
+alias extern (C) void function(_GdkDragContext *, _GdkColormap *, _GdkDrawable *, _GdkDrawable *, int, int)TGTKgtk_drag_set_icon_pixmap; extern(D) TGTKgtk_drag_set_icon_pixmap gtk_drag_set_icon_pixmap;
+alias extern (C) void function(_GdkDragContext *, aGtkWidget *, int, int)TGTKgtk_drag_set_icon_widget; extern(D) TGTKgtk_drag_set_icon_widget gtk_drag_set_icon_widget;
+alias extern (C) _GdkDragContext * function(aGtkWidget *, aGtkTargetList *, int, int, _GdkEvent *)TGTKgtk_drag_begin; extern(D) TGTKgtk_drag_begin gtk_drag_begin;
+alias extern (C) void function(aGtkWidget *, char *)TGTKgtk_drag_source_set_icon_name; extern(D) TGTKgtk_drag_source_set_icon_name gtk_drag_source_set_icon_name;
+alias extern (C) void function(aGtkWidget *, char *)TGTKgtk_drag_source_set_icon_stock; extern(D) TGTKgtk_drag_source_set_icon_stock gtk_drag_source_set_icon_stock;
+alias extern (C) void function(aGtkWidget *, void *)TGTKgtk_drag_source_set_icon_pixbuf; extern(D) TGTKgtk_drag_source_set_icon_pixbuf gtk_drag_source_set_icon_pixbuf;
+alias extern (C) void function(aGtkWidget *, _GdkColormap *, _GdkDrawable *, _GdkDrawable *)TGTKgtk_drag_source_set_icon; extern(D) TGTKgtk_drag_source_set_icon gtk_drag_source_set_icon;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_drag_source_add_uri_targets; extern(D) TGTKgtk_drag_source_add_uri_targets gtk_drag_source_add_uri_targets;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_drag_source_add_image_targets; extern(D) TGTKgtk_drag_source_add_image_targets gtk_drag_source_add_image_targets;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_drag_source_add_text_targets; extern(D) TGTKgtk_drag_source_add_text_targets gtk_drag_source_add_text_targets;
+alias extern (C) void function(aGtkWidget *, aGtkTargetList *)TGTKgtk_drag_source_set_target_list; extern(D) TGTKgtk_drag_source_set_target_list gtk_drag_source_set_target_list;
+alias extern (C) _GtkTargetList * function(aGtkWidget *)TGTKgtk_drag_source_get_target_list; extern(D) TGTKgtk_drag_source_get_target_list gtk_drag_source_get_target_list;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_drag_source_unset; extern(D) TGTKgtk_drag_source_unset gtk_drag_source_unset;
+alias extern (C) void function(aGtkWidget *, int, aGtkTargetEntry *, int, int)TGTKgtk_drag_source_set; extern(D) TGTKgtk_drag_source_set gtk_drag_source_set;
+alias extern (C) int function(aGtkWidget *)TGTKgtk_drag_dest_get_track_motion; extern(D) TGTKgtk_drag_dest_get_track_motion gtk_drag_dest_get_track_motion;
+alias extern (C) void function(aGtkWidget *, int)TGTKgtk_drag_dest_set_track_motion; extern(D) TGTKgtk_drag_dest_set_track_motion gtk_drag_dest_set_track_motion;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_drag_dest_add_uri_targets; extern(D) TGTKgtk_drag_dest_add_uri_targets gtk_drag_dest_add_uri_targets;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_drag_dest_add_image_targets; extern(D) TGTKgtk_drag_dest_add_image_targets gtk_drag_dest_add_image_targets;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_drag_dest_add_text_targets; extern(D) TGTKgtk_drag_dest_add_text_targets gtk_drag_dest_add_text_targets;
+alias extern (C) void function(aGtkWidget *, aGtkTargetList *)TGTKgtk_drag_dest_set_target_list; extern(D) TGTKgtk_drag_dest_set_target_list gtk_drag_dest_set_target_list;
+alias extern (C) _GtkTargetList * function(aGtkWidget *)TGTKgtk_drag_dest_get_target_list; extern(D) TGTKgtk_drag_dest_get_target_list gtk_drag_dest_get_target_list;
+alias extern (C) void * function(aGtkWidget *, _GdkDragContext *, aGtkTargetList *)TGTKgtk_drag_dest_find_target; extern(D) TGTKgtk_drag_dest_find_target gtk_drag_dest_find_target;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_drag_dest_unset; extern(D) TGTKgtk_drag_dest_unset gtk_drag_dest_unset;
+alias extern (C) void function(aGtkWidget *, _GdkDrawable *, int, int)TGTKgtk_drag_dest_set_proxy; extern(D) TGTKgtk_drag_dest_set_proxy gtk_drag_dest_set_proxy;
+alias extern (C) void function(aGtkWidget *, int, aGtkTargetEntry *, int, int)TGTKgtk_drag_dest_set; extern(D) TGTKgtk_drag_dest_set gtk_drag_dest_set;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_drag_unhighlight; extern(D) TGTKgtk_drag_unhighlight gtk_drag_unhighlight;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_drag_highlight; extern(D) TGTKgtk_drag_highlight gtk_drag_highlight;
+alias extern (C) _GtkWidget * function(_GdkDragContext *)TGTKgtk_drag_get_source_widget; extern(D) TGTKgtk_drag_get_source_widget gtk_drag_get_source_widget;
+alias extern (C) void function(_GdkDragContext *, int, int, uint)TGTKgtk_drag_finish; extern(D) TGTKgtk_drag_finish gtk_drag_finish;
+alias extern (C) void function(aGtkWidget *, _GdkDragContext *, void *, uint)TGTKgtk_drag_get_data; extern(D) TGTKgtk_drag_get_data gtk_drag_get_data;
+alias extern (C) void function(aGtkCombo *)TGTKgtk_combo_disable_activate; extern(D) TGTKgtk_combo_disable_activate gtk_combo_disable_activate;
+alias extern (C) void function(aGtkCombo *, _GList *)TGTKgtk_combo_set_popdown_strings; extern(D) TGTKgtk_combo_set_popdown_strings gtk_combo_set_popdown_strings;
+alias extern (C) void function(aGtkCombo *, aGtkItem *, char *)TGTKgtk_combo_set_item_string; extern(D) TGTKgtk_combo_set_item_string gtk_combo_set_item_string;
+alias extern (C) void function(aGtkCombo *, int)TGTKgtk_combo_set_case_sensitive; extern(D) TGTKgtk_combo_set_case_sensitive gtk_combo_set_case_sensitive;
+alias extern (C) void function(aGtkCombo *, int)TGTKgtk_combo_set_use_arrows_always; extern(D) TGTKgtk_combo_set_use_arrows_always gtk_combo_set_use_arrows_always;
+alias extern (C) void function(aGtkCombo *, int)TGTKgtk_combo_set_use_arrows; extern(D) TGTKgtk_combo_set_use_arrows gtk_combo_set_use_arrows;
+alias extern (C) void function(aGtkCombo *, int, int)TGTKgtk_combo_set_value_in_list; extern(D) TGTKgtk_combo_set_value_in_list gtk_combo_set_value_in_list;
+alias extern (C) _GtkWidget * function()TGTKgtk_combo_new; extern(D) TGTKgtk_combo_new gtk_combo_new;
+alias extern (C) uint function()TGTKgtk_combo_get_type; extern(D) TGTKgtk_combo_get_type gtk_combo_get_type;
+alias extern (C) _GtkWidget * function(int, int)TGTKgtk_hbox_new; extern(D) TGTKgtk_hbox_new gtk_hbox_new;
+alias extern (C) uint function()TGTKgtk_hbox_get_type; extern(D) TGTKgtk_hbox_get_type gtk_hbox_get_type;
+alias extern (C) _GtkWidget * function(char *)TGTKgtk_color_selection_dialog_new; extern(D) TGTKgtk_color_selection_dialog_new gtk_color_selection_dialog_new;
+alias extern (C) uint function()TGTKgtk_color_selection_dialog_get_type; extern(D) TGTKgtk_color_selection_dialog_get_type gtk_color_selection_dialog_get_type;
+alias extern (C) void function(aGtkColorSelection *, int)TGTKgtk_color_selection_set_update_policy; extern(D) TGTKgtk_color_selection_set_update_policy gtk_color_selection_set_update_policy;
+alias extern (C) void function(aGtkColorSelection *, double *)TGTKgtk_color_selection_get_color; extern(D) TGTKgtk_color_selection_get_color gtk_color_selection_get_color;
+alias extern (C) void function(aGtkColorSelection *, double *)TGTKgtk_color_selection_set_color; extern(D) TGTKgtk_color_selection_set_color gtk_color_selection_set_color;
+alias extern (C) _BCD_func__11008 function(_BCD_func__11008)TGTKgtk_color_selection_set_change_palette_with_screen_hook; extern(D) TGTKgtk_color_selection_set_change_palette_with_screen_hook gtk_color_selection_set_change_palette_with_screen_hook;
+alias extern (C) _BCD_func__11009 function(_BCD_func__11009)TGTKgtk_color_selection_set_change_palette_hook; extern(D) TGTKgtk_color_selection_set_change_palette_hook gtk_color_selection_set_change_palette_hook;
+alias extern (C) char * function(_GdkColor *, int)TGTKgtk_color_selection_palette_to_string; extern(D) TGTKgtk_color_selection_palette_to_string gtk_color_selection_palette_to_string;
+alias extern (C) int function(char *, _GdkColor * *, int *)TGTKgtk_color_selection_palette_from_string; extern(D) TGTKgtk_color_selection_palette_from_string gtk_color_selection_palette_from_string;
+alias extern (C) int function(aGtkColorSelection *)TGTKgtk_color_selection_is_adjusting; extern(D) TGTKgtk_color_selection_is_adjusting gtk_color_selection_is_adjusting;
+alias extern (C) ushort function(aGtkColorSelection *)TGTKgtk_color_selection_get_previous_alpha; extern(D) TGTKgtk_color_selection_get_previous_alpha gtk_color_selection_get_previous_alpha;
+alias extern (C) void function(aGtkColorSelection *, _GdkColor *)TGTKgtk_color_selection_get_previous_color; extern(D) TGTKgtk_color_selection_get_previous_color gtk_color_selection_get_previous_color;
+alias extern (C) void function(aGtkColorSelection *, ushort)TGTKgtk_color_selection_set_previous_alpha; extern(D) TGTKgtk_color_selection_set_previous_alpha gtk_color_selection_set_previous_alpha;
+alias extern (C) void function(aGtkColorSelection *, _GdkColor *)TGTKgtk_color_selection_set_previous_color; extern(D) TGTKgtk_color_selection_set_previous_color gtk_color_selection_set_previous_color;
+alias extern (C) ushort function(aGtkColorSelection *)TGTKgtk_color_selection_get_current_alpha; extern(D) TGTKgtk_color_selection_get_current_alpha gtk_color_selection_get_current_alpha;
+alias extern (C) void function(aGtkColorSelection *, _GdkColor *)TGTKgtk_color_selection_get_current_color; extern(D) TGTKgtk_color_selection_get_current_color gtk_color_selection_get_current_color;
+alias extern (C) void function(aGtkColorSelection *, ushort)TGTKgtk_color_selection_set_current_alpha; extern(D) TGTKgtk_color_selection_set_current_alpha gtk_color_selection_set_current_alpha;
+alias extern (C) void function(aGtkColorSelection *, _GdkColor *)TGTKgtk_color_selection_set_current_color; extern(D) TGTKgtk_color_selection_set_current_color gtk_color_selection_set_current_color;
+alias extern (C) void function(aGtkColorSelection *, int)TGTKgtk_color_selection_set_has_palette; extern(D) TGTKgtk_color_selection_set_has_palette gtk_color_selection_set_has_palette;
+alias extern (C) int function(aGtkColorSelection *)TGTKgtk_color_selection_get_has_palette; extern(D) TGTKgtk_color_selection_get_has_palette gtk_color_selection_get_has_palette;
+alias extern (C) void function(aGtkColorSelection *, int)TGTKgtk_color_selection_set_has_opacity_control; extern(D) TGTKgtk_color_selection_set_has_opacity_control gtk_color_selection_set_has_opacity_control;
+alias extern (C) int function(aGtkColorSelection *)TGTKgtk_color_selection_get_has_opacity_control; extern(D) TGTKgtk_color_selection_get_has_opacity_control gtk_color_selection_get_has_opacity_control;
+alias extern (C) _GtkWidget * function()TGTKgtk_color_selection_new; extern(D) TGTKgtk_color_selection_new gtk_color_selection_new;
+alias extern (C) uint function()TGTKgtk_color_selection_get_type; extern(D) TGTKgtk_color_selection_get_type gtk_color_selection_get_type;
+alias extern (C) _GtkWidget * function(int, int)TGTKgtk_vbox_new; extern(D) TGTKgtk_vbox_new gtk_vbox_new;
+alias extern (C) uint function()TGTKgtk_vbox_get_type; extern(D) TGTKgtk_vbox_get_type gtk_vbox_get_type;
+alias extern (C) char * function(aGtkColorButton *)TGTKgtk_color_button_get_title; extern(D) TGTKgtk_color_button_get_title gtk_color_button_get_title;
+alias extern (C) void function(aGtkColorButton *, char *)TGTKgtk_color_button_set_title; extern(D) TGTKgtk_color_button_set_title gtk_color_button_set_title;
+alias extern (C) int function(aGtkColorButton *)TGTKgtk_color_button_get_use_alpha; extern(D) TGTKgtk_color_button_get_use_alpha gtk_color_button_get_use_alpha;
+alias extern (C) void function(aGtkColorButton *, int)TGTKgtk_color_button_set_use_alpha; extern(D) TGTKgtk_color_button_set_use_alpha gtk_color_button_set_use_alpha;
+alias extern (C) ushort function(aGtkColorButton *)TGTKgtk_color_button_get_alpha; extern(D) TGTKgtk_color_button_get_alpha gtk_color_button_get_alpha;
+alias extern (C) void function(aGtkColorButton *, _GdkColor *)TGTKgtk_color_button_get_color; extern(D) TGTKgtk_color_button_get_color gtk_color_button_get_color;
+alias extern (C) void function(aGtkColorButton *, ushort)TGTKgtk_color_button_set_alpha; extern(D) TGTKgtk_color_button_set_alpha gtk_color_button_set_alpha;
+alias extern (C) void function(aGtkColorButton *, _GdkColor *)TGTKgtk_color_button_set_color; extern(D) TGTKgtk_color_button_set_color gtk_color_button_set_color;
+alias extern (C) _GtkWidget * function(_GdkColor *)TGTKgtk_color_button_new_with_color; extern(D) TGTKgtk_color_button_new_with_color gtk_color_button_new_with_color;
+alias extern (C) _GtkWidget * function()TGTKgtk_color_button_new; extern(D) TGTKgtk_color_button_new gtk_color_button_new;
+alias extern (C) uint function()TGTKgtk_color_button_get_type; extern(D) TGTKgtk_color_button_get_type gtk_color_button_get_type;
+//alias extern (C) void * function(aGtkCList *, aGtkCListRow *, int)TGTK_gtk_clist_create_cell_layout; extern(D) TGTK_gtk_clist_create_cell_layout _gtk_clist_create_cell_layout;
+alias extern (C) void function(aGtkCList *, int)TGTKgtk_clist_set_auto_sort; extern(D) TGTKgtk_clist_set_auto_sort gtk_clist_set_auto_sort;
+alias extern (C) void function(aGtkCList *)TGTKgtk_clist_sort; extern(D) TGTKgtk_clist_sort gtk_clist_sort;
+alias extern (C) void function(aGtkCList *, int)TGTKgtk_clist_set_sort_type; extern(D) TGTKgtk_clist_set_sort_type gtk_clist_set_sort_type;
+alias extern (C) void function(aGtkCList *, int)TGTKgtk_clist_set_sort_column; extern(D) TGTKgtk_clist_set_sort_column gtk_clist_set_sort_column;
+alias extern (C) void function(aGtkCList *, _BCD_func__11051)TGTKgtk_clist_set_compare_func; extern(D) TGTKgtk_clist_set_compare_func gtk_clist_set_compare_func;
+alias extern (C) void function(aGtkCList *, int, int)TGTKgtk_clist_row_move; extern(D) TGTKgtk_clist_row_move gtk_clist_row_move;
+alias extern (C) void function(aGtkCList *, int, int)TGTKgtk_clist_swap_rows; extern(D) TGTKgtk_clist_swap_rows gtk_clist_swap_rows;
+alias extern (C) void function(aGtkCList *)TGTKgtk_clist_unselect_all; extern(D) TGTKgtk_clist_unselect_all gtk_clist_unselect_all;
+alias extern (C) void function(aGtkCList *)TGTKgtk_clist_select_all; extern(D) TGTKgtk_clist_select_all gtk_clist_select_all;
+alias extern (C) int function(aGtkCList *, int, int, int *, int *)TGTKgtk_clist_get_selection_info; extern(D) TGTKgtk_clist_get_selection_info gtk_clist_get_selection_info;
+alias extern (C) void function(aGtkCList *)TGTKgtk_clist_clear; extern(D) TGTKgtk_clist_clear gtk_clist_clear;
+alias extern (C) void function(aGtkCList *)TGTKgtk_clist_undo_selection; extern(D) TGTKgtk_clist_undo_selection gtk_clist_undo_selection;
+alias extern (C) void function(aGtkCList *, int, int)TGTKgtk_clist_unselect_row; extern(D) TGTKgtk_clist_unselect_row gtk_clist_unselect_row;
+alias extern (C) void function(aGtkCList *, int, int)TGTKgtk_clist_select_row; extern(D) TGTKgtk_clist_select_row gtk_clist_select_row;
+alias extern (C) int function(aGtkCList *, void *)TGTKgtk_clist_find_row_from_data; extern(D) TGTKgtk_clist_find_row_from_data gtk_clist_find_row_from_data;
+alias extern (C) void * function(aGtkCList *, int)TGTKgtk_clist_get_row_data; extern(D) TGTKgtk_clist_get_row_data gtk_clist_get_row_data;
+alias extern (C) void function(aGtkCList *, int, void *, _BCD_func__13158)TGTKgtk_clist_set_row_data_full; extern(D) TGTKgtk_clist_set_row_data_full gtk_clist_set_row_data_full;
+alias extern (C) void function(aGtkCList *, int, void *)TGTKgtk_clist_set_row_data; extern(D) TGTKgtk_clist_set_row_data gtk_clist_set_row_data;
+alias extern (C) void function(aGtkCList *, int)TGTKgtk_clist_remove; extern(D) TGTKgtk_clist_remove gtk_clist_remove;
+alias extern (C) int function(aGtkCList *, int, char * *)TGTKgtk_clist_insert; extern(D) TGTKgtk_clist_insert gtk_clist_insert;
+alias extern (C) int function(aGtkCList *, char * *)TGTKgtk_clist_append; extern(D) TGTKgtk_clist_append gtk_clist_append;
+alias extern (C) int function(aGtkCList *, char * *)TGTKgtk_clist_prepend; extern(D) TGTKgtk_clist_prepend gtk_clist_prepend;
+alias extern (C) int function(aGtkCList *, int)TGTKgtk_clist_get_selectable; extern(D) TGTKgtk_clist_get_selectable gtk_clist_get_selectable;
+alias extern (C) void function(aGtkCList *, int, int)TGTKgtk_clist_set_selectable; extern(D) TGTKgtk_clist_set_selectable gtk_clist_set_selectable;
+alias extern (C) void function(aGtkCList *, int, int, int, int)TGTKgtk_clist_set_shift; extern(D) TGTKgtk_clist_set_shift gtk_clist_set_shift;
+alias extern (C) _GtkStyle * function(aGtkCList *, int)TGTKgtk_clist_get_row_style; extern(D) TGTKgtk_clist_get_row_style gtk_clist_get_row_style;
+alias extern (C) void function(aGtkCList *, int, aGtkStyle *)TGTKgtk_clist_set_row_style; extern(D) TGTKgtk_clist_set_row_style gtk_clist_set_row_style;
+alias extern (C) _GtkStyle * function(aGtkCList *, int, int)TGTKgtk_clist_get_cell_style; extern(D) TGTKgtk_clist_get_cell_style gtk_clist_get_cell_style;
+alias extern (C) void function(aGtkCList *, int, int, aGtkStyle *)TGTKgtk_clist_set_cell_style; extern(D) TGTKgtk_clist_set_cell_style gtk_clist_set_cell_style;
+alias extern (C) void function(aGtkCList *, int, _GdkColor *)TGTKgtk_clist_set_background; extern(D) TGTKgtk_clist_set_background gtk_clist_set_background;
+alias extern (C) void function(aGtkCList *, int, _GdkColor *)TGTKgtk_clist_set_foreground; extern(D) TGTKgtk_clist_set_foreground gtk_clist_set_foreground;
+alias extern (C) int function(aGtkCList *, int, int, char * *, char *, _GdkDrawable * *, _GdkDrawable * *)TGTKgtk_clist_get_pixtext; extern(D) TGTKgtk_clist_get_pixtext gtk_clist_get_pixtext;
+alias extern (C) void function(aGtkCList *, int, int, char *, char, _GdkDrawable *, _GdkDrawable *)TGTKgtk_clist_set_pixtext; extern(D) TGTKgtk_clist_set_pixtext gtk_clist_set_pixtext;
+alias extern (C) int function(aGtkCList *, int, int, _GdkDrawable * *, _GdkDrawable * *)TGTKgtk_clist_get_pixmap; extern(D) TGTKgtk_clist_get_pixmap gtk_clist_get_pixmap;
+alias extern (C) void function(aGtkCList *, int, int, _GdkDrawable *, _GdkDrawable *)TGTKgtk_clist_set_pixmap; extern(D) TGTKgtk_clist_set_pixmap gtk_clist_set_pixmap;
+alias extern (C) int function(aGtkCList *, int, int, char * *)TGTKgtk_clist_get_text; extern(D) TGTKgtk_clist_get_text gtk_clist_get_text;
+alias extern (C) void function(aGtkCList *, int, int, char *)TGTKgtk_clist_set_text; extern(D) TGTKgtk_clist_set_text gtk_clist_set_text;
+alias extern (C) int function(aGtkCList *, int, int)TGTKgtk_clist_get_cell_type; extern(D) TGTKgtk_clist_get_cell_type gtk_clist_get_cell_type;
+alias extern (C) int function(aGtkCList *, int)TGTKgtk_clist_row_is_visible; extern(D) TGTKgtk_clist_row_is_visible gtk_clist_row_is_visible;
+alias extern (C) void function(aGtkCList *, int, int, float, float)TGTKgtk_clist_moveto; extern(D) TGTKgtk_clist_moveto gtk_clist_moveto;
+alias extern (C) void function(aGtkCList *, uint)TGTKgtk_clist_set_row_height; extern(D) TGTKgtk_clist_set_row_height gtk_clist_set_row_height;
+alias extern (C) void function(aGtkCList *, int, int)TGTKgtk_clist_set_column_max_width; extern(D) TGTKgtk_clist_set_column_max_width gtk_clist_set_column_max_width;
+alias extern (C) void function(aGtkCList *, int, int)TGTKgtk_clist_set_column_min_width; extern(D) TGTKgtk_clist_set_column_min_width gtk_clist_set_column_min_width;
+alias extern (C) void function(aGtkCList *, int, int)TGTKgtk_clist_set_column_width; extern(D) TGTKgtk_clist_set_column_width gtk_clist_set_column_width;
+alias extern (C) int function(aGtkCList *, int)TGTKgtk_clist_optimal_column_width; extern(D) TGTKgtk_clist_optimal_column_width gtk_clist_optimal_column_width;
+alias extern (C) int function(aGtkCList *)TGTKgtk_clist_columns_autosize; extern(D) TGTKgtk_clist_columns_autosize gtk_clist_columns_autosize;
+alias extern (C) void function(aGtkCList *, int, int)TGTKgtk_clist_set_column_auto_resize; extern(D) TGTKgtk_clist_set_column_auto_resize gtk_clist_set_column_auto_resize;
+alias extern (C) void function(aGtkCList *, int, int)TGTKgtk_clist_set_column_resizeable; extern(D) TGTKgtk_clist_set_column_resizeable gtk_clist_set_column_resizeable;
+alias extern (C) void function(aGtkCList *, int, int)TGTKgtk_clist_set_column_visibility; extern(D) TGTKgtk_clist_set_column_visibility gtk_clist_set_column_visibility;
+alias extern (C) void function(aGtkCList *, int, int)TGTKgtk_clist_set_column_justification; extern(D) TGTKgtk_clist_set_column_justification gtk_clist_set_column_justification;
+alias extern (C) _GtkWidget * function(aGtkCList *, int)TGTKgtk_clist_get_column_widget; extern(D) TGTKgtk_clist_get_column_widget gtk_clist_get_column_widget;
+alias extern (C) void function(aGtkCList *, int, aGtkWidget *)TGTKgtk_clist_set_column_widget; extern(D) TGTKgtk_clist_set_column_widget gtk_clist_set_column_widget;
+alias extern (C) char * function(aGtkCList *, int)TGTKgtk_clist_get_column_title; extern(D) TGTKgtk_clist_get_column_title gtk_clist_get_column_title;
+alias extern (C) void function(aGtkCList *, int, char *)TGTKgtk_clist_set_column_title; extern(D) TGTKgtk_clist_set_column_title gtk_clist_set_column_title;
+alias extern (C) void function(aGtkCList *)TGTKgtk_clist_column_titles_passive; extern(D) TGTKgtk_clist_column_titles_passive gtk_clist_column_titles_passive;
+alias extern (C) void function(aGtkCList *)TGTKgtk_clist_column_titles_active; extern(D) TGTKgtk_clist_column_titles_active gtk_clist_column_titles_active;
+alias extern (C) void function(aGtkCList *, int)TGTKgtk_clist_column_title_passive; extern(D) TGTKgtk_clist_column_title_passive gtk_clist_column_title_passive;
+alias extern (C) void function(aGtkCList *, int)TGTKgtk_clist_column_title_active; extern(D) TGTKgtk_clist_column_title_active gtk_clist_column_title_active;
+alias extern (C) void function(aGtkCList *)TGTKgtk_clist_column_titles_hide; extern(D) TGTKgtk_clist_column_titles_hide gtk_clist_column_titles_hide;
+alias extern (C) void function(aGtkCList *)TGTKgtk_clist_column_titles_show; extern(D) TGTKgtk_clist_column_titles_show gtk_clist_column_titles_show;
+alias extern (C) void function(aGtkCList *)TGTKgtk_clist_thaw; extern(D) TGTKgtk_clist_thaw gtk_clist_thaw;
+alias extern (C) void function(aGtkCList *)TGTKgtk_clist_freeze; extern(D) TGTKgtk_clist_freeze gtk_clist_freeze;
+alias extern (C) void function(aGtkCList *, uint, char)TGTKgtk_clist_set_button_actions; extern(D) TGTKgtk_clist_set_button_actions gtk_clist_set_button_actions;
+alias extern (C) void function(aGtkCList *, int)TGTKgtk_clist_set_use_drag_icons; extern(D) TGTKgtk_clist_set_use_drag_icons gtk_clist_set_use_drag_icons;
+alias extern (C) void function(aGtkCList *, int)TGTKgtk_clist_set_reorderable; extern(D) TGTKgtk_clist_set_reorderable gtk_clist_set_reorderable;
+alias extern (C) void function(aGtkCList *, int)TGTKgtk_clist_set_selection_mode; extern(D) TGTKgtk_clist_set_selection_mode gtk_clist_set_selection_mode;
+alias extern (C) void function(aGtkCList *, int)TGTKgtk_clist_set_shadow_type; extern(D) TGTKgtk_clist_set_shadow_type gtk_clist_set_shadow_type;
+alias extern (C) _GtkAdjustment * function(aGtkCList *)TGTKgtk_clist_get_vadjustment; extern(D) TGTKgtk_clist_get_vadjustment gtk_clist_get_vadjustment;
+alias extern (C) _GtkAdjustment * function(aGtkCList *)TGTKgtk_clist_get_hadjustment; extern(D) TGTKgtk_clist_get_hadjustment gtk_clist_get_hadjustment;
+alias extern (C) void function(aGtkCList *, aGtkAdjustment *)TGTKgtk_clist_set_vadjustment; extern(D) TGTKgtk_clist_set_vadjustment gtk_clist_set_vadjustment;
+alias extern (C) void function(aGtkCList *, aGtkAdjustment *)TGTKgtk_clist_set_hadjustment; extern(D) TGTKgtk_clist_set_hadjustment gtk_clist_set_hadjustment;
+alias extern (C) _GtkWidget * function(int, char * *)TGTKgtk_clist_new_with_titles; extern(D) TGTKgtk_clist_new_with_titles gtk_clist_new_with_titles;
+alias extern (C) _GtkWidget * function(int)TGTKgtk_clist_new; extern(D) TGTKgtk_clist_new gtk_clist_new;
+alias extern (C) uint function()TGTKgtk_clist_get_type; extern(D) TGTKgtk_clist_get_type gtk_clist_get_type;
+alias extern (C) _GtkWidget * function(aGtkAdjustment *)TGTKgtk_vscrollbar_new; extern(D) TGTKgtk_vscrollbar_new gtk_vscrollbar_new;
+alias extern (C) uint function()TGTKgtk_vscrollbar_get_type; extern(D) TGTKgtk_vscrollbar_get_type gtk_vscrollbar_get_type;
+alias extern (C) _GtkWidget * function(aGtkAdjustment *)TGTKgtk_hscrollbar_new; extern(D) TGTKgtk_hscrollbar_new gtk_hscrollbar_new;
+alias extern (C) uint function()TGTKgtk_hscrollbar_get_type; extern(D) TGTKgtk_hscrollbar_get_type gtk_hscrollbar_get_type;
+alias extern (C) uint function()TGTKgtk_scrollbar_get_type; extern(D) TGTKgtk_scrollbar_get_type gtk_scrollbar_get_type;
+//alias extern (C) double function(aGtkRange *, int)TGTK_gtk_range_get_wheel_delta; extern(D) TGTK_gtk_range_get_wheel_delta _gtk_range_get_wheel_delta;
+alias extern (C) double function(aGtkRange *)TGTKgtk_range_get_fill_level; extern(D) TGTKgtk_range_get_fill_level gtk_range_get_fill_level;
+alias extern (C) void function(aGtkRange *, double)TGTKgtk_range_set_fill_level; extern(D) TGTKgtk_range_set_fill_level gtk_range_set_fill_level;
+alias extern (C) int function(aGtkRange *)TGTKgtk_range_get_restrict_to_fill_level; extern(D) TGTKgtk_range_get_restrict_to_fill_level gtk_range_get_restrict_to_fill_level;
+alias extern (C) void function(aGtkRange *, int)TGTKgtk_range_set_restrict_to_fill_level; extern(D) TGTKgtk_range_set_restrict_to_fill_level gtk_range_set_restrict_to_fill_level;
+alias extern (C) int function(aGtkRange *)TGTKgtk_range_get_show_fill_level; extern(D) TGTKgtk_range_get_show_fill_level gtk_range_get_show_fill_level;
+alias extern (C) void function(aGtkRange *, int)TGTKgtk_range_set_show_fill_level; extern(D) TGTKgtk_range_set_show_fill_level gtk_range_set_show_fill_level;
+alias extern (C) double function(aGtkRange *)TGTKgtk_range_get_value; extern(D) TGTKgtk_range_get_value gtk_range_get_value;
+alias extern (C) void function(aGtkRange *, double)TGTKgtk_range_set_value; extern(D) TGTKgtk_range_set_value gtk_range_set_value;
+alias extern (C) void function(aGtkRange *, double, double)TGTKgtk_range_set_range; extern(D) TGTKgtk_range_set_range gtk_range_set_range;
+alias extern (C) void function(aGtkRange *, double, double)TGTKgtk_range_set_increments; extern(D) TGTKgtk_range_set_increments gtk_range_set_increments;
+alias extern (C) int function(aGtkRange *)TGTKgtk_range_get_upper_stepper_sensitivity; extern(D) TGTKgtk_range_get_upper_stepper_sensitivity gtk_range_get_upper_stepper_sensitivity;
+alias extern (C) void function(aGtkRange *, int)TGTKgtk_range_set_upper_stepper_sensitivity; extern(D) TGTKgtk_range_set_upper_stepper_sensitivity gtk_range_set_upper_stepper_sensitivity;
+alias extern (C) int function(aGtkRange *)TGTKgtk_range_get_lower_stepper_sensitivity; extern(D) TGTKgtk_range_get_lower_stepper_sensitivity gtk_range_get_lower_stepper_sensitivity;
+alias extern (C) void function(aGtkRange *, int)TGTKgtk_range_set_lower_stepper_sensitivity; extern(D) TGTKgtk_range_set_lower_stepper_sensitivity gtk_range_set_lower_stepper_sensitivity;
+alias extern (C) int function(aGtkRange *)TGTKgtk_range_get_inverted; extern(D) TGTKgtk_range_get_inverted gtk_range_get_inverted;
+alias extern (C) void function(aGtkRange *, int)TGTKgtk_range_set_inverted; extern(D) TGTKgtk_range_set_inverted gtk_range_set_inverted;
+alias extern (C) _GtkAdjustment * function(aGtkRange *)TGTKgtk_range_get_adjustment; extern(D) TGTKgtk_range_get_adjustment gtk_range_get_adjustment;
+alias extern (C) void function(aGtkRange *, aGtkAdjustment *)TGTKgtk_range_set_adjustment; extern(D) TGTKgtk_range_set_adjustment gtk_range_set_adjustment;
+alias extern (C) int function(aGtkRange *)TGTKgtk_range_get_update_policy; extern(D) TGTKgtk_range_get_update_policy gtk_range_get_update_policy;
+alias extern (C) void function(aGtkRange *, int)TGTKgtk_range_set_update_policy; extern(D) TGTKgtk_range_set_update_policy gtk_range_set_update_policy;
+alias extern (C) uint function()TGTKgtk_range_get_type; extern(D) TGTKgtk_range_get_type gtk_range_get_type;
+//alias extern (C) void function()TGTK_gtk_clipboard_store_all; extern(D) TGTK_gtk_clipboard_store_all _gtk_clipboard_store_all;
+//alias extern (C) void function(_GdkEventOwnerChange *)TGTK_gtk_clipboard_handle_event; extern(D) TGTK_gtk_clipboard_handle_event _gtk_clipboard_handle_event;
+alias extern (C) void function(void *)TGTKgtk_clipboard_store; extern(D) TGTKgtk_clipboard_store gtk_clipboard_store;
+alias extern (C) void function(void *, aGtkTargetEntry *, int)TGTKgtk_clipboard_set_can_store; extern(D) TGTKgtk_clipboard_set_can_store gtk_clipboard_set_can_store;
+alias extern (C) int function(void *, void *)TGTKgtk_clipboard_wait_is_target_available; extern(D) TGTKgtk_clipboard_wait_is_target_available gtk_clipboard_wait_is_target_available;
+alias extern (C) int function(void *)TGTKgtk_clipboard_wait_is_image_available; extern(D) TGTKgtk_clipboard_wait_is_image_available gtk_clipboard_wait_is_image_available;
+alias extern (C) int function(void *, aGtkTextBuffer *)TGTKgtk_clipboard_wait_is_rich_text_available; extern(D) TGTKgtk_clipboard_wait_is_rich_text_available gtk_clipboard_wait_is_rich_text_available;
+alias extern (C) int function(void *)TGTKgtk_clipboard_wait_is_text_available; extern(D) TGTKgtk_clipboard_wait_is_text_available gtk_clipboard_wait_is_text_available;
+alias extern (C) int function(void *, void * * *, int *)TGTKgtk_clipboard_wait_for_targets; extern(D) TGTKgtk_clipboard_wait_for_targets gtk_clipboard_wait_for_targets;
+alias extern (C) void * function(void *)TGTKgtk_clipboard_wait_for_image; extern(D) TGTKgtk_clipboard_wait_for_image gtk_clipboard_wait_for_image;
+alias extern (C) char * function(void *, aGtkTextBuffer *, void * *, uint *)TGTKgtk_clipboard_wait_for_rich_text; extern(D) TGTKgtk_clipboard_wait_for_rich_text gtk_clipboard_wait_for_rich_text;
+alias extern (C) char * function(void *)TGTKgtk_clipboard_wait_for_text; extern(D) TGTKgtk_clipboard_wait_for_text gtk_clipboard_wait_for_text;
+alias extern (C) _GtkSelectionData * function(void *, void *)TGTKgtk_clipboard_wait_for_contents; extern(D) TGTKgtk_clipboard_wait_for_contents gtk_clipboard_wait_for_contents;
+alias extern (C) void function(void *, _BCD_func__11269, void *)TGTKgtk_clipboard_request_targets; extern(D) TGTKgtk_clipboard_request_targets gtk_clipboard_request_targets;
+alias extern (C) void function(void *, _BCD_func__11270, void *)TGTKgtk_clipboard_request_image; extern(D) TGTKgtk_clipboard_request_image gtk_clipboard_request_image;
+alias extern (C) void function(void *, aGtkTextBuffer *, _BCD_func__11271, void *)TGTKgtk_clipboard_request_rich_text; extern(D) TGTKgtk_clipboard_request_rich_text gtk_clipboard_request_rich_text;
+alias extern (C) void function(void *, _BCD_func__11272, void *)TGTKgtk_clipboard_request_text; extern(D) TGTKgtk_clipboard_request_text gtk_clipboard_request_text;
+alias extern (C) void function(void *, void *, _BCD_func__11273, void *)TGTKgtk_clipboard_request_contents; extern(D) TGTKgtk_clipboard_request_contents gtk_clipboard_request_contents;
+alias extern (C) void function(void *, void *)TGTKgtk_clipboard_set_image; extern(D) TGTKgtk_clipboard_set_image gtk_clipboard_set_image;
+alias extern (C) void function(void *, char *, int)TGTKgtk_clipboard_set_text; extern(D) TGTKgtk_clipboard_set_text gtk_clipboard_set_text;
+alias extern (C) void function(void *)TGTKgtk_clipboard_clear; extern(D) TGTKgtk_clipboard_clear gtk_clipboard_clear;
+alias extern (C) _GObject * function(void *)TGTKgtk_clipboard_get_owner; extern(D) TGTKgtk_clipboard_get_owner gtk_clipboard_get_owner;
+alias extern (C) int function(void *, aGtkTargetEntry *, uint, _BCD_func__11268, _BCD_func__11267, _GObject *)TGTKgtk_clipboard_set_with_owner; extern(D) TGTKgtk_clipboard_set_with_owner gtk_clipboard_set_with_owner;
+alias extern (C) int function(void *, aGtkTargetEntry *, uint, _BCD_func__11268, _BCD_func__11267, void *)TGTKgtk_clipboard_set_with_data; extern(D) TGTKgtk_clipboard_set_with_data gtk_clipboard_set_with_data;
+alias extern (C) _GdkDisplay * function(void *)TGTKgtk_clipboard_get_display; extern(D) TGTKgtk_clipboard_get_display gtk_clipboard_get_display;
+alias extern (C) void * function(void *)TGTKgtk_clipboard_get; extern(D) TGTKgtk_clipboard_get gtk_clipboard_get;
+alias extern (C) void * function(_GdkDisplay *, void *)TGTKgtk_clipboard_get_for_display; extern(D) TGTKgtk_clipboard_get_for_display gtk_clipboard_get_for_display;
+alias extern (C) uint function()TGTKgtk_clipboard_get_type; extern(D) TGTKgtk_clipboard_get_type gtk_clipboard_get_type;
+alias extern (C) uint function()TGTKgtk_target_list_get_type; extern(D) TGTKgtk_target_list_get_type gtk_target_list_get_type;
+alias extern (C) void function(aGtkSelectionData *)TGTKgtk_selection_data_free; extern(D) TGTKgtk_selection_data_free gtk_selection_data_free;
+alias extern (C) _GtkSelectionData * function(aGtkSelectionData *)TGTKgtk_selection_data_copy; extern(D) TGTKgtk_selection_data_copy gtk_selection_data_copy;
+alias extern (C) uint function()TGTKgtk_selection_data_get_type; extern(D) TGTKgtk_selection_data_get_type gtk_selection_data_get_type;
+//alias extern (C) int function(aGtkWidget *, _GdkEventProperty *)TGTK_gtk_selection_property_notify; extern(D) TGTK_gtk_selection_property_notify _gtk_selection_property_notify;
+//alias extern (C) int function(aGtkWidget *, _GdkEventSelection *)TGTK_gtk_selection_notify; extern(D) TGTK_gtk_selection_notify _gtk_selection_notify;
+//alias extern (C) int function(_GdkDrawable *, _GdkEventProperty *)TGTK_gtk_selection_incr_event; extern(D) TGTK_gtk_selection_incr_event _gtk_selection_incr_event;
+//alias extern (C) int function(aGtkWidget *, _GdkEventSelection *)TGTK_gtk_selection_request; extern(D) TGTK_gtk_selection_request _gtk_selection_request;
+alias extern (C) int function(aGtkWidget *, _GdkEventSelection *)TGTKgtk_selection_clear; extern(D) TGTKgtk_selection_clear gtk_selection_clear;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_selection_remove_all; extern(D) TGTKgtk_selection_remove_all gtk_selection_remove_all;
+alias extern (C) int function(void * *, int)TGTKgtk_targets_include_uri; extern(D) TGTKgtk_targets_include_uri gtk_targets_include_uri;
+alias extern (C) int function(void * *, int, int)TGTKgtk_targets_include_image; extern(D) TGTKgtk_targets_include_image gtk_targets_include_image;
+alias extern (C) int function(void * *, int, aGtkTextBuffer *)TGTKgtk_targets_include_rich_text; extern(D) TGTKgtk_targets_include_rich_text gtk_targets_include_rich_text;
+alias extern (C) int function(void * *, int)TGTKgtk_targets_include_text; extern(D) TGTKgtk_targets_include_text gtk_targets_include_text;
+alias extern (C) int function(aGtkSelectionData *)TGTKgtk_selection_data_targets_include_uri; extern(D) TGTKgtk_selection_data_targets_include_uri gtk_selection_data_targets_include_uri;
+alias extern (C) int function(aGtkSelectionData *, int)TGTKgtk_selection_data_targets_include_image; extern(D) TGTKgtk_selection_data_targets_include_image gtk_selection_data_targets_include_image;
+alias extern (C) int function(aGtkSelectionData *, aGtkTextBuffer *)TGTKgtk_selection_data_targets_include_rich_text; extern(D) TGTKgtk_selection_data_targets_include_rich_text gtk_selection_data_targets_include_rich_text;
+alias extern (C) int function(aGtkSelectionData *)TGTKgtk_selection_data_targets_include_text; extern(D) TGTKgtk_selection_data_targets_include_text gtk_selection_data_targets_include_text;
+alias extern (C) int function(aGtkSelectionData *, void * * *, int *)TGTKgtk_selection_data_get_targets; extern(D) TGTKgtk_selection_data_get_targets gtk_selection_data_get_targets;
+alias extern (C) char * * function(aGtkSelectionData *)TGTKgtk_selection_data_get_uris; extern(D) TGTKgtk_selection_data_get_uris gtk_selection_data_get_uris;
+alias extern (C) int function(aGtkSelectionData *, char * *)TGTKgtk_selection_data_set_uris; extern(D) TGTKgtk_selection_data_set_uris gtk_selection_data_set_uris;
+alias extern (C) void * function(aGtkSelectionData *)TGTKgtk_selection_data_get_pixbuf; extern(D) TGTKgtk_selection_data_get_pixbuf gtk_selection_data_get_pixbuf;
+alias extern (C) int function(aGtkSelectionData *, void *)TGTKgtk_selection_data_set_pixbuf; extern(D) TGTKgtk_selection_data_set_pixbuf gtk_selection_data_set_pixbuf;
+alias extern (C) char * function(aGtkSelectionData *)TGTKgtk_selection_data_get_text; extern(D) TGTKgtk_selection_data_get_text gtk_selection_data_get_text;
+alias extern (C) int function(aGtkSelectionData *, char *, int)TGTKgtk_selection_data_set_text; extern(D) TGTKgtk_selection_data_set_text gtk_selection_data_set_text;
+alias extern (C) void function(aGtkSelectionData *, void *, int, char *, int)TGTKgtk_selection_data_set; extern(D) TGTKgtk_selection_data_set gtk_selection_data_set;
+alias extern (C) int function(aGtkWidget *, void *, void *, uint)TGTKgtk_selection_convert; extern(D) TGTKgtk_selection_convert gtk_selection_convert;
+alias extern (C) void function(aGtkWidget *, void *)TGTKgtk_selection_clear_targets; extern(D) TGTKgtk_selection_clear_targets gtk_selection_clear_targets;
+alias extern (C) void function(aGtkWidget *, void *, aGtkTargetEntry *, uint)TGTKgtk_selection_add_targets; extern(D) TGTKgtk_selection_add_targets gtk_selection_add_targets;
+alias extern (C) void function(aGtkWidget *, void *, void *, uint)TGTKgtk_selection_add_target; extern(D) TGTKgtk_selection_add_target gtk_selection_add_target;
+alias extern (C) int function(_GdkDisplay *, aGtkWidget *, void *, uint)TGTKgtk_selection_owner_set_for_display; extern(D) TGTKgtk_selection_owner_set_for_display gtk_selection_owner_set_for_display;
+alias extern (C) int function(aGtkWidget *, void *, uint)TGTKgtk_selection_owner_set; extern(D) TGTKgtk_selection_owner_set gtk_selection_owner_set;
+alias extern (C) void function(aGtkTargetEntry *, int)TGTKgtk_target_table_free; extern(D) TGTKgtk_target_table_free gtk_target_table_free;
+alias extern (C) _GtkTargetEntry * function(aGtkTargetList *, int *)TGTKgtk_target_table_new_from_list; extern(D) TGTKgtk_target_table_new_from_list gtk_target_table_new_from_list;
+alias extern (C) int function(aGtkTargetList *, void *, uint *)TGTKgtk_target_list_find; extern(D) TGTKgtk_target_list_find gtk_target_list_find;
+alias extern (C) void function(aGtkTargetList *, void *)TGTKgtk_target_list_remove; extern(D) TGTKgtk_target_list_remove gtk_target_list_remove;
+alias extern (C) void function(aGtkTargetList *, aGtkTargetEntry *, uint)TGTKgtk_target_list_add_table; extern(D) TGTKgtk_target_list_add_table gtk_target_list_add_table;
+alias extern (C) void function(aGtkTargetList *, uint)TGTKgtk_target_list_add_uri_targets; extern(D) TGTKgtk_target_list_add_uri_targets gtk_target_list_add_uri_targets;
+alias extern (C) void function(aGtkTargetList *, uint, int)TGTKgtk_target_list_add_image_targets; extern(D) TGTKgtk_target_list_add_image_targets gtk_target_list_add_image_targets;
+alias extern (C) void function(aGtkTargetList *, uint, int, aGtkTextBuffer *)TGTKgtk_target_list_add_rich_text_targets; extern(D) TGTKgtk_target_list_add_rich_text_targets gtk_target_list_add_rich_text_targets;
+alias extern (C) void function(aGtkTargetList *, uint)TGTKgtk_target_list_add_text_targets; extern(D) TGTKgtk_target_list_add_text_targets gtk_target_list_add_text_targets;
+alias extern (C) void function(aGtkTargetList *, void *, uint, uint)TGTKgtk_target_list_add; extern(D) TGTKgtk_target_list_add gtk_target_list_add;
+alias extern (C) void function(aGtkTargetList *)TGTKgtk_target_list_unref; extern(D) TGTKgtk_target_list_unref gtk_target_list_unref;
+alias extern (C) _GtkTargetList * function(aGtkTargetList *)TGTKgtk_target_list_ref; extern(D) TGTKgtk_target_list_ref gtk_target_list_ref;
+alias extern (C) _GtkTargetList * function(aGtkTargetEntry *, uint)TGTKgtk_target_list_new; extern(D) TGTKgtk_target_list_new gtk_target_list_new;
+alias extern (C) void function(aGtkTextIter *, aGtkTextIter *)TGTKgtk_text_iter_order; extern(D) TGTKgtk_text_iter_order gtk_text_iter_order;
+alias extern (C) int function(aGtkTextIter *, aGtkTextIter *, aGtkTextIter *)TGTKgtk_text_iter_in_range; extern(D) TGTKgtk_text_iter_in_range gtk_text_iter_in_range;
+alias extern (C) int function(aGtkTextIter *, aGtkTextIter *)TGTKgtk_text_iter_compare; extern(D) TGTKgtk_text_iter_compare gtk_text_iter_compare;
+alias extern (C) int function(aGtkTextIter *, aGtkTextIter *)TGTKgtk_text_iter_equal; extern(D) TGTKgtk_text_iter_equal gtk_text_iter_equal;
+alias extern (C) int function(aGtkTextIter *, char *, int, aGtkTextIter *, aGtkTextIter *, aGtkTextIter *)TGTKgtk_text_iter_backward_search; extern(D) TGTKgtk_text_iter_backward_search gtk_text_iter_backward_search;
+alias extern (C) int function(aGtkTextIter *, char *, int, aGtkTextIter *, aGtkTextIter *, aGtkTextIter *)TGTKgtk_text_iter_forward_search; extern(D) TGTKgtk_text_iter_forward_search gtk_text_iter_forward_search;
+alias extern (C) int function(aGtkTextIter *, _BCD_func__11292, void *, aGtkTextIter *)TGTKgtk_text_iter_backward_find_char; extern(D) TGTKgtk_text_iter_backward_find_char gtk_text_iter_backward_find_char;
+alias extern (C) int function(aGtkTextIter *, _BCD_func__11292, void *, aGtkTextIter *)TGTKgtk_text_iter_forward_find_char; extern(D) TGTKgtk_text_iter_forward_find_char gtk_text_iter_forward_find_char;
+alias extern (C) int function(aGtkTextIter *, aGtkTextTag *)TGTKgtk_text_iter_backward_to_tag_toggle; extern(D) TGTKgtk_text_iter_backward_to_tag_toggle gtk_text_iter_backward_to_tag_toggle;
+alias extern (C) int function(aGtkTextIter *, aGtkTextTag *)TGTKgtk_text_iter_forward_to_tag_toggle; extern(D) TGTKgtk_text_iter_forward_to_tag_toggle gtk_text_iter_forward_to_tag_toggle;
+alias extern (C) void function(aGtkTextIter *, int)TGTKgtk_text_iter_set_visible_line_index; extern(D) TGTKgtk_text_iter_set_visible_line_index gtk_text_iter_set_visible_line_index;
+alias extern (C) void function(aGtkTextIter *, int)TGTKgtk_text_iter_set_visible_line_offset; extern(D) TGTKgtk_text_iter_set_visible_line_offset gtk_text_iter_set_visible_line_offset;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_forward_to_line_end; extern(D) TGTKgtk_text_iter_forward_to_line_end gtk_text_iter_forward_to_line_end;
+alias extern (C) void function(aGtkTextIter *)TGTKgtk_text_iter_forward_to_end; extern(D) TGTKgtk_text_iter_forward_to_end gtk_text_iter_forward_to_end;
+alias extern (C) void function(aGtkTextIter *, int)TGTKgtk_text_iter_set_line_index; extern(D) TGTKgtk_text_iter_set_line_index gtk_text_iter_set_line_index;
+alias extern (C) void function(aGtkTextIter *, int)TGTKgtk_text_iter_set_line_offset; extern(D) TGTKgtk_text_iter_set_line_offset gtk_text_iter_set_line_offset;
+alias extern (C) void function(aGtkTextIter *, int)TGTKgtk_text_iter_set_line; extern(D) TGTKgtk_text_iter_set_line gtk_text_iter_set_line;
+alias extern (C) void function(aGtkTextIter *, int)TGTKgtk_text_iter_set_offset; extern(D) TGTKgtk_text_iter_set_offset gtk_text_iter_set_offset;
+alias extern (C) int function(aGtkTextIter *, int)TGTKgtk_text_iter_backward_visible_cursor_positions; extern(D) TGTKgtk_text_iter_backward_visible_cursor_positions gtk_text_iter_backward_visible_cursor_positions;
+alias extern (C) int function(aGtkTextIter *, int)TGTKgtk_text_iter_forward_visible_cursor_positions; extern(D) TGTKgtk_text_iter_forward_visible_cursor_positions gtk_text_iter_forward_visible_cursor_positions;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_backward_visible_cursor_position; extern(D) TGTKgtk_text_iter_backward_visible_cursor_position gtk_text_iter_backward_visible_cursor_position;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_forward_visible_cursor_position; extern(D) TGTKgtk_text_iter_forward_visible_cursor_position gtk_text_iter_forward_visible_cursor_position;
+alias extern (C) int function(aGtkTextIter *, int)TGTKgtk_text_iter_backward_cursor_positions; extern(D) TGTKgtk_text_iter_backward_cursor_positions gtk_text_iter_backward_cursor_positions;
+alias extern (C) int function(aGtkTextIter *, int)TGTKgtk_text_iter_forward_cursor_positions; extern(D) TGTKgtk_text_iter_forward_cursor_positions gtk_text_iter_forward_cursor_positions;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_backward_cursor_position; extern(D) TGTKgtk_text_iter_backward_cursor_position gtk_text_iter_backward_cursor_position;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_forward_cursor_position; extern(D) TGTKgtk_text_iter_forward_cursor_position gtk_text_iter_forward_cursor_position;
+alias extern (C) int function(aGtkTextIter *, int)TGTKgtk_text_iter_backward_sentence_starts; extern(D) TGTKgtk_text_iter_backward_sentence_starts gtk_text_iter_backward_sentence_starts;
+alias extern (C) int function(aGtkTextIter *, int)TGTKgtk_text_iter_forward_sentence_ends; extern(D) TGTKgtk_text_iter_forward_sentence_ends gtk_text_iter_forward_sentence_ends;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_backward_sentence_start; extern(D) TGTKgtk_text_iter_backward_sentence_start gtk_text_iter_backward_sentence_start;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_forward_sentence_end; extern(D) TGTKgtk_text_iter_forward_sentence_end gtk_text_iter_forward_sentence_end;
+alias extern (C) int function(aGtkTextIter *, int)TGTKgtk_text_iter_backward_visible_word_starts; extern(D) TGTKgtk_text_iter_backward_visible_word_starts gtk_text_iter_backward_visible_word_starts;
+alias extern (C) int function(aGtkTextIter *, int)TGTKgtk_text_iter_forward_visible_word_ends; extern(D) TGTKgtk_text_iter_forward_visible_word_ends gtk_text_iter_forward_visible_word_ends;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_backward_visible_word_start; extern(D) TGTKgtk_text_iter_backward_visible_word_start gtk_text_iter_backward_visible_word_start;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_forward_visible_word_end; extern(D) TGTKgtk_text_iter_forward_visible_word_end gtk_text_iter_forward_visible_word_end;
+alias extern (C) int function(aGtkTextIter *, int)TGTKgtk_text_iter_backward_visible_lines; extern(D) TGTKgtk_text_iter_backward_visible_lines gtk_text_iter_backward_visible_lines;
+alias extern (C) int function(aGtkTextIter *, int)TGTKgtk_text_iter_forward_visible_lines; extern(D) TGTKgtk_text_iter_forward_visible_lines gtk_text_iter_forward_visible_lines;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_backward_visible_line; extern(D) TGTKgtk_text_iter_backward_visible_line gtk_text_iter_backward_visible_line;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_forward_visible_line; extern(D) TGTKgtk_text_iter_forward_visible_line gtk_text_iter_forward_visible_line;
+alias extern (C) int function(aGtkTextIter *, int)TGTKgtk_text_iter_backward_word_starts; extern(D) TGTKgtk_text_iter_backward_word_starts gtk_text_iter_backward_word_starts;
+alias extern (C) int function(aGtkTextIter *, int)TGTKgtk_text_iter_forward_word_ends; extern(D) TGTKgtk_text_iter_forward_word_ends gtk_text_iter_forward_word_ends;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_backward_word_start; extern(D) TGTKgtk_text_iter_backward_word_start gtk_text_iter_backward_word_start;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_forward_word_end; extern(D) TGTKgtk_text_iter_forward_word_end gtk_text_iter_forward_word_end;
+alias extern (C) int function(aGtkTextIter *, int)TGTKgtk_text_iter_backward_lines; extern(D) TGTKgtk_text_iter_backward_lines gtk_text_iter_backward_lines;
+alias extern (C) int function(aGtkTextIter *, int)TGTKgtk_text_iter_forward_lines; extern(D) TGTKgtk_text_iter_forward_lines gtk_text_iter_forward_lines;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_backward_line; extern(D) TGTKgtk_text_iter_backward_line gtk_text_iter_backward_line;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_forward_line; extern(D) TGTKgtk_text_iter_forward_line gtk_text_iter_forward_line;
+alias extern (C) int function(aGtkTextIter *, int)TGTKgtk_text_iter_backward_chars; extern(D) TGTKgtk_text_iter_backward_chars gtk_text_iter_backward_chars;
+alias extern (C) int function(aGtkTextIter *, int)TGTKgtk_text_iter_forward_chars; extern(D) TGTKgtk_text_iter_forward_chars gtk_text_iter_forward_chars;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_backward_char; extern(D) TGTKgtk_text_iter_backward_char gtk_text_iter_backward_char;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_forward_char; extern(D) TGTKgtk_text_iter_forward_char gtk_text_iter_forward_char;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_is_start; extern(D) TGTKgtk_text_iter_is_start gtk_text_iter_is_start;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_is_end; extern(D) TGTKgtk_text_iter_is_end gtk_text_iter_is_end;
+alias extern (C) void * function(aGtkTextIter *)TGTKgtk_text_iter_get_language; extern(D) TGTKgtk_text_iter_get_language gtk_text_iter_get_language;
+alias extern (C) int function(aGtkTextIter *, aGtkTextAttributes *)TGTKgtk_text_iter_get_attributes; extern(D) TGTKgtk_text_iter_get_attributes gtk_text_iter_get_attributes;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_get_bytes_in_line; extern(D) TGTKgtk_text_iter_get_bytes_in_line gtk_text_iter_get_bytes_in_line;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_get_chars_in_line; extern(D) TGTKgtk_text_iter_get_chars_in_line gtk_text_iter_get_chars_in_line;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_is_cursor_position; extern(D) TGTKgtk_text_iter_is_cursor_position gtk_text_iter_is_cursor_position;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_ends_line; extern(D) TGTKgtk_text_iter_ends_line gtk_text_iter_ends_line;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_starts_line; extern(D) TGTKgtk_text_iter_starts_line gtk_text_iter_starts_line;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_inside_sentence; extern(D) TGTKgtk_text_iter_inside_sentence gtk_text_iter_inside_sentence;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_ends_sentence; extern(D) TGTKgtk_text_iter_ends_sentence gtk_text_iter_ends_sentence;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_starts_sentence; extern(D) TGTKgtk_text_iter_starts_sentence gtk_text_iter_starts_sentence;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_inside_word; extern(D) TGTKgtk_text_iter_inside_word gtk_text_iter_inside_word;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_ends_word; extern(D) TGTKgtk_text_iter_ends_word gtk_text_iter_ends_word;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_starts_word; extern(D) TGTKgtk_text_iter_starts_word gtk_text_iter_starts_word;
+alias extern (C) int function(aGtkTextIter *, int)TGTKgtk_text_iter_can_insert; extern(D) TGTKgtk_text_iter_can_insert gtk_text_iter_can_insert;
+alias extern (C) int function(aGtkTextIter *, int)TGTKgtk_text_iter_editable; extern(D) TGTKgtk_text_iter_editable gtk_text_iter_editable;
+alias extern (C) _GSList * function(aGtkTextIter *)TGTKgtk_text_iter_get_tags; extern(D) TGTKgtk_text_iter_get_tags gtk_text_iter_get_tags;
+alias extern (C) int function(aGtkTextIter *, aGtkTextTag *)TGTKgtk_text_iter_has_tag; extern(D) TGTKgtk_text_iter_has_tag gtk_text_iter_has_tag;
+alias extern (C) int function(aGtkTextIter *, aGtkTextTag *)TGTKgtk_text_iter_toggles_tag; extern(D) TGTKgtk_text_iter_toggles_tag gtk_text_iter_toggles_tag;
+alias extern (C) int function(aGtkTextIter *, aGtkTextTag *)TGTKgtk_text_iter_ends_tag; extern(D) TGTKgtk_text_iter_ends_tag gtk_text_iter_ends_tag;
+alias extern (C) int function(aGtkTextIter *, aGtkTextTag *)TGTKgtk_text_iter_begins_tag; extern(D) TGTKgtk_text_iter_begins_tag gtk_text_iter_begins_tag;
+alias extern (C) _GSList * function(aGtkTextIter *, int)TGTKgtk_text_iter_get_toggled_tags; extern(D) TGTKgtk_text_iter_get_toggled_tags gtk_text_iter_get_toggled_tags;
+alias extern (C) _GtkTextChildAnchor * function(aGtkTextIter *)TGTKgtk_text_iter_get_child_anchor; extern(D) TGTKgtk_text_iter_get_child_anchor gtk_text_iter_get_child_anchor;
+alias extern (C) _GSList * function(aGtkTextIter *)TGTKgtk_text_iter_get_marks; extern(D) TGTKgtk_text_iter_get_marks gtk_text_iter_get_marks;
+alias extern (C) void * function(aGtkTextIter *)TGTKgtk_text_iter_get_pixbuf; extern(D) TGTKgtk_text_iter_get_pixbuf gtk_text_iter_get_pixbuf;
+alias extern (C) char * function(aGtkTextIter *, aGtkTextIter *)TGTKgtk_text_iter_get_visible_text; extern(D) TGTKgtk_text_iter_get_visible_text gtk_text_iter_get_visible_text;
+alias extern (C) char * function(aGtkTextIter *, aGtkTextIter *)TGTKgtk_text_iter_get_visible_slice; extern(D) TGTKgtk_text_iter_get_visible_slice gtk_text_iter_get_visible_slice;
+alias extern (C) char * function(aGtkTextIter *, aGtkTextIter *)TGTKgtk_text_iter_get_text; extern(D) TGTKgtk_text_iter_get_text gtk_text_iter_get_text;
+alias extern (C) char * function(aGtkTextIter *, aGtkTextIter *)TGTKgtk_text_iter_get_slice; extern(D) TGTKgtk_text_iter_get_slice gtk_text_iter_get_slice;
+alias extern (C) uint function(aGtkTextIter *)TGTKgtk_text_iter_get_char; extern(D) TGTKgtk_text_iter_get_char gtk_text_iter_get_char;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_get_visible_line_index; extern(D) TGTKgtk_text_iter_get_visible_line_index gtk_text_iter_get_visible_line_index;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_get_visible_line_offset; extern(D) TGTKgtk_text_iter_get_visible_line_offset gtk_text_iter_get_visible_line_offset;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_get_line_index; extern(D) TGTKgtk_text_iter_get_line_index gtk_text_iter_get_line_index;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_get_line_offset; extern(D) TGTKgtk_text_iter_get_line_offset gtk_text_iter_get_line_offset;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_get_line; extern(D) TGTKgtk_text_iter_get_line gtk_text_iter_get_line;
+alias extern (C) int function(aGtkTextIter *)TGTKgtk_text_iter_get_offset; extern(D) TGTKgtk_text_iter_get_offset gtk_text_iter_get_offset;
+alias extern (C) uint function()TGTKgtk_text_iter_get_type; extern(D) TGTKgtk_text_iter_get_type gtk_text_iter_get_type;
+alias extern (C) void function(aGtkTextIter *)TGTKgtk_text_iter_free; extern(D) TGTKgtk_text_iter_free gtk_text_iter_free;
+alias extern (C) _GtkTextIter * function(aGtkTextIter *)TGTKgtk_text_iter_copy; extern(D) TGTKgtk_text_iter_copy gtk_text_iter_copy;
+alias extern (C) _GtkTextBuffer * function(aGtkTextIter *)TGTKgtk_text_iter_get_buffer; extern(D) TGTKgtk_text_iter_get_buffer gtk_text_iter_get_buffer;
+alias extern (C) int function(aGtkTextChildAnchor *)TGTKgtk_text_child_anchor_get_deleted; extern(D) TGTKgtk_text_child_anchor_get_deleted gtk_text_child_anchor_get_deleted;
+alias extern (C) _GList * function(aGtkTextChildAnchor *)TGTKgtk_text_child_anchor_get_widgets; extern(D) TGTKgtk_text_child_anchor_get_widgets gtk_text_child_anchor_get_widgets;
+alias extern (C) _GtkTextChildAnchor * function()TGTKgtk_text_child_anchor_new; extern(D) TGTKgtk_text_child_anchor_new gtk_text_child_anchor_new;
+alias extern (C) uint function()TGTKgtk_text_child_anchor_get_type; extern(D) TGTKgtk_text_child_anchor_get_type gtk_text_child_anchor_get_type;
+alias extern (C) uint function()TGTKgtk_text_attributes_get_type; extern(D) TGTKgtk_text_attributes_get_type gtk_text_attributes_get_type;
+alias extern (C) _GtkTextAttributes * function(aGtkTextAttributes *)TGTKgtk_text_attributes_ref; extern(D) TGTKgtk_text_attributes_ref gtk_text_attributes_ref;
+alias extern (C) void function(aGtkTextAttributes *)TGTKgtk_text_attributes_unref; extern(D) TGTKgtk_text_attributes_unref gtk_text_attributes_unref;
+alias extern (C) void function(aGtkTextAttributes *, aGtkTextAttributes *)TGTKgtk_text_attributes_copy_values; extern(D) TGTKgtk_text_attributes_copy_values gtk_text_attributes_copy_values;
+alias extern (C) _GtkTextAttributes * function(aGtkTextAttributes *)TGTKgtk_text_attributes_copy; extern(D) TGTKgtk_text_attributes_copy gtk_text_attributes_copy;
+alias extern (C) _GtkTextAttributes * function()TGTKgtk_text_attributes_new; extern(D) TGTKgtk_text_attributes_new gtk_text_attributes_new;
+alias extern (C) int function(aGtkTextTag *, _GObject *, _GdkEvent *, aGtkTextIter *)TGTKgtk_text_tag_event; extern(D) TGTKgtk_text_tag_event gtk_text_tag_event;
+alias extern (C) void function(aGtkTextTag *, int)TGTKgtk_text_tag_set_priority; extern(D) TGTKgtk_text_tag_set_priority gtk_text_tag_set_priority;
+alias extern (C) int function(aGtkTextTag *)TGTKgtk_text_tag_get_priority; extern(D) TGTKgtk_text_tag_get_priority gtk_text_tag_get_priority;
+alias extern (C) _GtkTextTag * function(char *)TGTKgtk_text_tag_new; extern(D) TGTKgtk_text_tag_new gtk_text_tag_new;
+alias extern (C) uint function()TGTKgtk_text_tag_get_type; extern(D) TGTKgtk_text_tag_get_type gtk_text_tag_get_type;
+alias extern (C) void function(aGtkCheckMenuItem *, int)TGTKgtk_check_menu_item_set_show_toggle; extern(D) TGTKgtk_check_menu_item_set_show_toggle gtk_check_menu_item_set_show_toggle;
+alias extern (C) int function(aGtkCheckMenuItem *)TGTKgtk_check_menu_item_get_draw_as_radio; extern(D) TGTKgtk_check_menu_item_get_draw_as_radio gtk_check_menu_item_get_draw_as_radio;
+alias extern (C) void function(aGtkCheckMenuItem *, int)TGTKgtk_check_menu_item_set_draw_as_radio; extern(D) TGTKgtk_check_menu_item_set_draw_as_radio gtk_check_menu_item_set_draw_as_radio;
+alias extern (C) int function(aGtkCheckMenuItem *)TGTKgtk_check_menu_item_get_inconsistent; extern(D) TGTKgtk_check_menu_item_get_inconsistent gtk_check_menu_item_get_inconsistent;
+alias extern (C) void function(aGtkCheckMenuItem *, int)TGTKgtk_check_menu_item_set_inconsistent; extern(D) TGTKgtk_check_menu_item_set_inconsistent gtk_check_menu_item_set_inconsistent;
+alias extern (C) void function(aGtkCheckMenuItem *)TGTKgtk_check_menu_item_toggled; extern(D) TGTKgtk_check_menu_item_toggled gtk_check_menu_item_toggled;
+alias extern (C) int function(aGtkCheckMenuItem *)TGTKgtk_check_menu_item_get_active; extern(D) TGTKgtk_check_menu_item_get_active gtk_check_menu_item_get_active;
+alias extern (C) void function(aGtkCheckMenuItem *, int)TGTKgtk_check_menu_item_set_active; extern(D) TGTKgtk_check_menu_item_set_active gtk_check_menu_item_set_active;
+alias extern (C) _GtkWidget * function(char *)TGTKgtk_check_menu_item_new_with_mnemonic; extern(D) TGTKgtk_check_menu_item_new_with_mnemonic gtk_check_menu_item_new_with_mnemonic;
+alias extern (C) _GtkWidget * function(char *)TGTKgtk_check_menu_item_new_with_label; extern(D) TGTKgtk_check_menu_item_new_with_label gtk_check_menu_item_new_with_label;
+alias extern (C) _GtkWidget * function()TGTKgtk_check_menu_item_new; extern(D) TGTKgtk_check_menu_item_new gtk_check_menu_item_new;
+alias extern (C) uint function()TGTKgtk_check_menu_item_get_type; extern(D) TGTKgtk_check_menu_item_get_type gtk_check_menu_item_get_type;
+alias extern (C) void function(aGtkMenuItem *)TGTKgtk_menu_item_remove_submenu; extern(D) TGTKgtk_menu_item_remove_submenu gtk_menu_item_remove_submenu;
+//alias extern (C) void function(aGtkWidget *)TGTK_gtk_menu_item_popdown_submenu; extern(D) TGTK_gtk_menu_item_popdown_submenu _gtk_menu_item_popdown_submenu;
+//alias extern (C) void function(aGtkWidget *, int)TGTK_gtk_menu_item_popup_submenu; extern(D) TGTK_gtk_menu_item_popup_submenu _gtk_menu_item_popup_submenu;
+//alias extern (C) int function(aGtkWidget *)TGTK_gtk_menu_item_is_selectable; extern(D) TGTK_gtk_menu_item_is_selectable _gtk_menu_item_is_selectable;
+//alias extern (C) void function(aGtkMenuItem *, char *, aGtkAccelGroup *, int)TGTK_gtk_menu_item_refresh_accel_path; extern(D) TGTK_gtk_menu_item_refresh_accel_path _gtk_menu_item_refresh_accel_path;
+alias extern (C) void function(aGtkMenuItem *, char *)TGTKgtk_menu_item_set_accel_path; extern(D) TGTKgtk_menu_item_set_accel_path gtk_menu_item_set_accel_path;
+alias extern (C) int function(aGtkMenuItem *)TGTKgtk_menu_item_get_right_justified; extern(D) TGTKgtk_menu_item_get_right_justified gtk_menu_item_get_right_justified;
+alias extern (C) void function(aGtkMenuItem *, int)TGTKgtk_menu_item_set_right_justified; extern(D) TGTKgtk_menu_item_set_right_justified gtk_menu_item_set_right_justified;
+alias extern (C) void function(aGtkMenuItem *, int)TGTKgtk_menu_item_toggle_size_allocate; extern(D) TGTKgtk_menu_item_toggle_size_allocate gtk_menu_item_toggle_size_allocate;
+alias extern (C) void function(aGtkMenuItem *, int *)TGTKgtk_menu_item_toggle_size_request; extern(D) TGTKgtk_menu_item_toggle_size_request gtk_menu_item_toggle_size_request;
+alias extern (C) void function(aGtkMenuItem *)TGTKgtk_menu_item_activate; extern(D) TGTKgtk_menu_item_activate gtk_menu_item_activate;
+alias extern (C) void function(aGtkMenuItem *)TGTKgtk_menu_item_deselect; extern(D) TGTKgtk_menu_item_deselect gtk_menu_item_deselect;
+alias extern (C) void function(aGtkMenuItem *)TGTKgtk_menu_item_select; extern(D) TGTKgtk_menu_item_select gtk_menu_item_select;
+alias extern (C) _GtkWidget * function(aGtkMenuItem *)TGTKgtk_menu_item_get_submenu; extern(D) TGTKgtk_menu_item_get_submenu gtk_menu_item_get_submenu;
+alias extern (C) void function(aGtkMenuItem *, aGtkWidget *)TGTKgtk_menu_item_set_submenu; extern(D) TGTKgtk_menu_item_set_submenu gtk_menu_item_set_submenu;
+alias extern (C) _GtkWidget * function(char *)TGTKgtk_menu_item_new_with_mnemonic; extern(D) TGTKgtk_menu_item_new_with_mnemonic gtk_menu_item_new_with_mnemonic;
+alias extern (C) _GtkWidget * function(char *)TGTKgtk_menu_item_new_with_label; extern(D) TGTKgtk_menu_item_new_with_label gtk_menu_item_new_with_label;
+alias extern (C) _GtkWidget * function()TGTKgtk_menu_item_new; extern(D) TGTKgtk_menu_item_new gtk_menu_item_new;
+alias extern (C) uint function()TGTKgtk_menu_item_get_type; extern(D) TGTKgtk_menu_item_get_type gtk_menu_item_get_type;
+alias extern (C) void function(aGtkItem *)TGTKgtk_item_toggle; extern(D) TGTKgtk_item_toggle gtk_item_toggle;
+alias extern (C) void function(aGtkItem *)TGTKgtk_item_deselect; extern(D) TGTKgtk_item_deselect gtk_item_deselect;
+alias extern (C) void function(aGtkItem *)TGTKgtk_item_select; extern(D) TGTKgtk_item_select gtk_item_select;
+alias extern (C) uint function()TGTKgtk_item_get_type; extern(D) TGTKgtk_item_get_type gtk_item_get_type;
+//alias extern (C) void function(aGtkCheckButton *, int *, int *)TGTK_gtk_check_button_get_props; extern(D) TGTK_gtk_check_button_get_props _gtk_check_button_get_props;
+alias extern (C) _GtkWidget * function(char *)TGTKgtk_check_button_new_with_mnemonic; extern(D) TGTKgtk_check_button_new_with_mnemonic gtk_check_button_new_with_mnemonic;
+alias extern (C) _GtkWidget * function(char *)TGTKgtk_check_button_new_with_label; extern(D) TGTKgtk_check_button_new_with_label gtk_check_button_new_with_label;
+alias extern (C) _GtkWidget * function()TGTKgtk_check_button_new; extern(D) TGTKgtk_check_button_new gtk_check_button_new;
+alias extern (C) uint function()TGTKgtk_check_button_get_type; extern(D) TGTKgtk_check_button_get_type gtk_check_button_get_type;
+alias extern (C) int function(aGtkToggleButton *)TGTKgtk_toggle_button_get_inconsistent; extern(D) TGTKgtk_toggle_button_get_inconsistent gtk_toggle_button_get_inconsistent;
+alias extern (C) void function(aGtkToggleButton *, int)TGTKgtk_toggle_button_set_inconsistent; extern(D) TGTKgtk_toggle_button_set_inconsistent gtk_toggle_button_set_inconsistent;
+alias extern (C) void function(aGtkToggleButton *)TGTKgtk_toggle_button_toggled; extern(D) TGTKgtk_toggle_button_toggled gtk_toggle_button_toggled;
+alias extern (C) int function(aGtkToggleButton *)TGTKgtk_toggle_button_get_active; extern(D) TGTKgtk_toggle_button_get_active gtk_toggle_button_get_active;
+alias extern (C) void function(aGtkToggleButton *, int)TGTKgtk_toggle_button_set_active; extern(D) TGTKgtk_toggle_button_set_active gtk_toggle_button_set_active;
+alias extern (C) int function(aGtkToggleButton *)TGTKgtk_toggle_button_get_mode; extern(D) TGTKgtk_toggle_button_get_mode gtk_toggle_button_get_mode;
+alias extern (C) void function(aGtkToggleButton *, int)TGTKgtk_toggle_button_set_mode; extern(D) TGTKgtk_toggle_button_set_mode gtk_toggle_button_set_mode;
+alias extern (C) _GtkWidget * function(char *)TGTKgtk_toggle_button_new_with_mnemonic; extern(D) TGTKgtk_toggle_button_new_with_mnemonic gtk_toggle_button_new_with_mnemonic;
+alias extern (C) _GtkWidget * function(char *)TGTKgtk_toggle_button_new_with_label; extern(D) TGTKgtk_toggle_button_new_with_label gtk_toggle_button_new_with_label;
+alias extern (C) _GtkWidget * function()TGTKgtk_toggle_button_new; extern(D) TGTKgtk_toggle_button_new gtk_toggle_button_new;
+alias extern (C) uint function()TGTKgtk_toggle_button_get_type; extern(D) TGTKgtk_toggle_button_get_type gtk_toggle_button_get_type;
+alias extern (C) _GList * function(aGtkCellView *)TGTKgtk_cell_view_get_cell_renderers; extern(D) TGTKgtk_cell_view_get_cell_renderers gtk_cell_view_get_cell_renderers;
+alias extern (C) void function(aGtkCellView *, _GdkColor *)TGTKgtk_cell_view_set_background_color; extern(D) TGTKgtk_cell_view_set_background_color gtk_cell_view_set_background_color;
+alias extern (C) int function(aGtkCellView *, void *, aGtkRequisition *)TGTKgtk_cell_view_get_size_of_row; extern(D) TGTKgtk_cell_view_get_size_of_row gtk_cell_view_get_size_of_row;
+alias extern (C) void * function(aGtkCellView *)TGTKgtk_cell_view_get_displayed_row; extern(D) TGTKgtk_cell_view_get_displayed_row gtk_cell_view_get_displayed_row;
+alias extern (C) void function(aGtkCellView *, void *)TGTKgtk_cell_view_set_displayed_row; extern(D) TGTKgtk_cell_view_set_displayed_row gtk_cell_view_set_displayed_row;
+alias extern (C) void function(aGtkCellView *, void *)TGTKgtk_cell_view_set_model; extern(D) TGTKgtk_cell_view_set_model gtk_cell_view_set_model;
+alias extern (C) _GtkWidget * function(void *)TGTKgtk_cell_view_new_with_pixbuf; extern(D) TGTKgtk_cell_view_new_with_pixbuf gtk_cell_view_new_with_pixbuf;
+alias extern (C) _GtkWidget * function(char *)TGTKgtk_cell_view_new_with_markup; extern(D) TGTKgtk_cell_view_new_with_markup gtk_cell_view_new_with_markup;
+alias extern (C) _GtkWidget * function(char *)TGTKgtk_cell_view_new_with_text; extern(D) TGTKgtk_cell_view_new_with_text gtk_cell_view_new_with_text;
+alias extern (C) _GtkWidget * function()TGTKgtk_cell_view_new; extern(D) TGTKgtk_cell_view_new gtk_cell_view_new;
+alias extern (C) uint function()TGTKgtk_cell_view_get_type; extern(D) TGTKgtk_cell_view_get_type gtk_cell_view_get_type;
+alias extern (C) void function(aGtkCellRendererToggle *, int)TGTKgtk_cell_renderer_toggle_set_active; extern(D) TGTKgtk_cell_renderer_toggle_set_active gtk_cell_renderer_toggle_set_active;
+alias extern (C) int function(aGtkCellRendererToggle *)TGTKgtk_cell_renderer_toggle_get_active; extern(D) TGTKgtk_cell_renderer_toggle_get_active gtk_cell_renderer_toggle_get_active;
+alias extern (C) void function(aGtkCellRendererToggle *, int)TGTKgtk_cell_renderer_toggle_set_radio; extern(D) TGTKgtk_cell_renderer_toggle_set_radio gtk_cell_renderer_toggle_set_radio;
+alias extern (C) int function(aGtkCellRendererToggle *)TGTKgtk_cell_renderer_toggle_get_radio; extern(D) TGTKgtk_cell_renderer_toggle_get_radio gtk_cell_renderer_toggle_get_radio;
+alias extern (C) _GtkCellRenderer * function()TGTKgtk_cell_renderer_toggle_new; extern(D) TGTKgtk_cell_renderer_toggle_new gtk_cell_renderer_toggle_new;
+alias extern (C) uint function()TGTKgtk_cell_renderer_toggle_get_type; extern(D) TGTKgtk_cell_renderer_toggle_get_type gtk_cell_renderer_toggle_get_type;
+alias extern (C) _GtkCellRenderer * function()TGTKgtk_cell_renderer_spin_new; extern(D) TGTKgtk_cell_renderer_spin_new gtk_cell_renderer_spin_new;
+alias extern (C) uint function()TGTKgtk_cell_renderer_spin_get_type; extern(D) TGTKgtk_cell_renderer_spin_get_type gtk_cell_renderer_spin_get_type;
+alias extern (C) _GtkCellRenderer * function()TGTKgtk_cell_renderer_progress_new; extern(D) TGTKgtk_cell_renderer_progress_new gtk_cell_renderer_progress_new;
+alias extern (C) uint function()TGTKgtk_cell_renderer_progress_get_type; extern(D) TGTKgtk_cell_renderer_progress_get_type gtk_cell_renderer_progress_get_type;
+alias extern (C) _GtkCellRenderer * function()TGTKgtk_cell_renderer_pixbuf_new; extern(D) TGTKgtk_cell_renderer_pixbuf_new gtk_cell_renderer_pixbuf_new;
+alias extern (C) uint function()TGTKgtk_cell_renderer_pixbuf_get_type; extern(D) TGTKgtk_cell_renderer_pixbuf_get_type gtk_cell_renderer_pixbuf_get_type;
+alias extern (C) _GtkCellRenderer * function()TGTKgtk_cell_renderer_combo_new; extern(D) TGTKgtk_cell_renderer_combo_new gtk_cell_renderer_combo_new;
+alias extern (C) uint function()TGTKgtk_cell_renderer_combo_get_type; extern(D) TGTKgtk_cell_renderer_combo_get_type gtk_cell_renderer_combo_get_type;
+alias extern (C) _GtkCellRenderer * function()TGTKgtk_cell_renderer_accel_new; extern(D) TGTKgtk_cell_renderer_accel_new gtk_cell_renderer_accel_new;
+alias extern (C) uint function()TGTKgtk_cell_renderer_accel_get_type; extern(D) TGTKgtk_cell_renderer_accel_get_type gtk_cell_renderer_accel_get_type;
+alias extern (C) void function(aGtkCellRendererText *, int)TGTKgtk_cell_renderer_text_set_fixed_height_from_font; extern(D) TGTKgtk_cell_renderer_text_set_fixed_height_from_font gtk_cell_renderer_text_set_fixed_height_from_font;
+alias extern (C) _GtkCellRenderer * function()TGTKgtk_cell_renderer_text_new; extern(D) TGTKgtk_cell_renderer_text_new gtk_cell_renderer_text_new;
+alias extern (C) uint function()TGTKgtk_cell_renderer_text_get_type; extern(D) TGTKgtk_cell_renderer_text_get_type gtk_cell_renderer_text_get_type;
+//alias extern (C) void function(void *, aGtkBuilder *, _GObject *, char *)TGTK_gtk_cell_layout_buildable_add_child; extern(D) TGTK_gtk_cell_layout_buildable_add_child _gtk_cell_layout_buildable_add_child;
+//alias extern (C) void function(void *, aGtkBuilder *, _GObject *, char *, void * *)TGTK_gtk_cell_layout_buildable_custom_tag_end; extern(D) TGTK_gtk_cell_layout_buildable_custom_tag_end _gtk_cell_layout_buildable_custom_tag_end;
+//alias extern (C) int function(void *, aGtkBuilder *, _GObject *, char *, _GMarkupParser *, void * *)TGTK_gtk_cell_layout_buildable_custom_tag_start; extern(D) TGTK_gtk_cell_layout_buildable_custom_tag_start _gtk_cell_layout_buildable_custom_tag_start;
+alias extern (C) void function(void *, aGtkCellRenderer *, int)TGTKgtk_cell_layout_reorder; extern(D) TGTKgtk_cell_layout_reorder gtk_cell_layout_reorder;
+alias extern (C) void function(void *, aGtkCellRenderer *)TGTKgtk_cell_layout_clear_attributes; extern(D) TGTKgtk_cell_layout_clear_attributes gtk_cell_layout_clear_attributes;
+alias extern (C) void function(void *, aGtkCellRenderer *, _BCD_func__11624, void *, _BCD_func__13158)TGTKgtk_cell_layout_set_cell_data_func; extern(D) TGTKgtk_cell_layout_set_cell_data_func gtk_cell_layout_set_cell_data_func;
+alias extern (C) void function(void *, aGtkCellRenderer *, char *, int)TGTKgtk_cell_layout_add_attribute; extern(D) TGTKgtk_cell_layout_add_attribute gtk_cell_layout_add_attribute;
+alias extern (C) void function(void *, aGtkCellRenderer *, ...)TGTKgtk_cell_layout_set_attributes; extern(D) TGTKgtk_cell_layout_set_attributes gtk_cell_layout_set_attributes;
+alias extern (C) void function(void *)TGTKgtk_cell_layout_clear; extern(D) TGTKgtk_cell_layout_clear gtk_cell_layout_clear;
+alias extern (C) _GList * function(void *)TGTKgtk_cell_layout_get_cells; extern(D) TGTKgtk_cell_layout_get_cells gtk_cell_layout_get_cells;
+alias extern (C) void function(void *, aGtkCellRenderer *, int)TGTKgtk_cell_layout_pack_end; extern(D) TGTKgtk_cell_layout_pack_end gtk_cell_layout_pack_end;
+alias extern (C) void function(void *, aGtkCellRenderer *, int)TGTKgtk_cell_layout_pack_start; extern(D) TGTKgtk_cell_layout_pack_start gtk_cell_layout_pack_start;
+alias extern (C) uint function()TGTKgtk_cell_layout_get_type; extern(D) TGTKgtk_cell_layout_get_type gtk_cell_layout_get_type;
+alias extern (C) _GtkWidget * function(aGtkTreeViewColumn *)TGTKgtk_tree_view_column_get_tree_view; extern(D) TGTKgtk_tree_view_column_get_tree_view gtk_tree_view_column_get_tree_view;
+alias extern (C) void function(aGtkTreeViewColumn *)TGTKgtk_tree_view_column_queue_resize; extern(D) TGTKgtk_tree_view_column_queue_resize gtk_tree_view_column_queue_resize;
+alias extern (C) int function(aGtkTreeViewColumn *, aGtkCellRenderer *, int *, int *)TGTKgtk_tree_view_column_cell_get_position; extern(D) TGTKgtk_tree_view_column_cell_get_position gtk_tree_view_column_cell_get_position;
+alias extern (C) void function(aGtkTreeViewColumn *, aGtkCellRenderer *)TGTKgtk_tree_view_column_focus_cell; extern(D) TGTKgtk_tree_view_column_focus_cell gtk_tree_view_column_focus_cell;
+alias extern (C) int function(aGtkTreeViewColumn *)TGTKgtk_tree_view_column_cell_is_visible; extern(D) TGTKgtk_tree_view_column_cell_is_visible gtk_tree_view_column_cell_is_visible;
+alias extern (C) void function(aGtkTreeViewColumn *, _GdkRectangle *, int *, int *, int *, int *)TGTKgtk_tree_view_column_cell_get_size; extern(D) TGTKgtk_tree_view_column_cell_get_size gtk_tree_view_column_cell_get_size;
+alias extern (C) void function(aGtkTreeViewColumn *, void *, aGtkTreeIter *, int, int)TGTKgtk_tree_view_column_cell_set_cell_data; extern(D) TGTKgtk_tree_view_column_cell_set_cell_data gtk_tree_view_column_cell_set_cell_data;
+alias extern (C) int function(aGtkTreeViewColumn *)TGTKgtk_tree_view_column_get_sort_order; extern(D) TGTKgtk_tree_view_column_get_sort_order gtk_tree_view_column_get_sort_order;
+alias extern (C) void function(aGtkTreeViewColumn *, int)TGTKgtk_tree_view_column_set_sort_order; extern(D) TGTKgtk_tree_view_column_set_sort_order gtk_tree_view_column_set_sort_order;
+alias extern (C) int function(aGtkTreeViewColumn *)TGTKgtk_tree_view_column_get_sort_indicator; extern(D) TGTKgtk_tree_view_column_get_sort_indicator gtk_tree_view_column_get_sort_indicator;
+alias extern (C) void function(aGtkTreeViewColumn *, int)TGTKgtk_tree_view_column_set_sort_indicator; extern(D) TGTKgtk_tree_view_column_set_sort_indicator gtk_tree_view_column_set_sort_indicator;
+alias extern (C) int function(aGtkTreeViewColumn *)TGTKgtk_tree_view_column_get_sort_column_id; extern(D) TGTKgtk_tree_view_column_get_sort_column_id gtk_tree_view_column_get_sort_column_id;
+alias extern (C) void function(aGtkTreeViewColumn *, int)TGTKgtk_tree_view_column_set_sort_column_id; extern(D) TGTKgtk_tree_view_column_set_sort_column_id gtk_tree_view_column_set_sort_column_id;
+alias extern (C) int function(aGtkTreeViewColumn *)TGTKgtk_tree_view_column_get_reorderable; extern(D) TGTKgtk_tree_view_column_get_reorderable gtk_tree_view_column_get_reorderable;
+alias extern (C) void function(aGtkTreeViewColumn *, int)TGTKgtk_tree_view_column_set_reorderable; extern(D) TGTKgtk_tree_view_column_set_reorderable gtk_tree_view_column_set_reorderable;
+alias extern (C) float function(aGtkTreeViewColumn *)TGTKgtk_tree_view_column_get_alignment; extern(D) TGTKgtk_tree_view_column_get_alignment gtk_tree_view_column_get_alignment;
+alias extern (C) void function(aGtkTreeViewColumn *, float)TGTKgtk_tree_view_column_set_alignment; extern(D) TGTKgtk_tree_view_column_set_alignment gtk_tree_view_column_set_alignment;
+alias extern (C) _GtkWidget * function(aGtkTreeViewColumn *)TGTKgtk_tree_view_column_get_widget; extern(D) TGTKgtk_tree_view_column_get_widget gtk_tree_view_column_get_widget;
+alias extern (C) void function(aGtkTreeViewColumn *, aGtkWidget *)TGTKgtk_tree_view_column_set_widget; extern(D) TGTKgtk_tree_view_column_set_widget gtk_tree_view_column_set_widget;
+alias extern (C) int function(aGtkTreeViewColumn *)TGTKgtk_tree_view_column_get_clickable; extern(D) TGTKgtk_tree_view_column_get_clickable gtk_tree_view_column_get_clickable;
+alias extern (C) void function(aGtkTreeViewColumn *, int)TGTKgtk_tree_view_column_set_clickable; extern(D) TGTKgtk_tree_view_column_set_clickable gtk_tree_view_column_set_clickable;
+alias extern (C) int function(aGtkTreeViewColumn *)TGTKgtk_tree_view_column_get_expand; extern(D) TGTKgtk_tree_view_column_get_expand gtk_tree_view_column_get_expand;
+alias extern (C) void function(aGtkTreeViewColumn *, int)TGTKgtk_tree_view_column_set_expand; extern(D) TGTKgtk_tree_view_column_set_expand gtk_tree_view_column_set_expand;
+alias extern (C) char * function(aGtkTreeViewColumn *)TGTKgtk_tree_view_column_get_title; extern(D) TGTKgtk_tree_view_column_get_title gtk_tree_view_column_get_title;
+alias extern (C) void function(aGtkTreeViewColumn *, char *)TGTKgtk_tree_view_column_set_title; extern(D) TGTKgtk_tree_view_column_set_title gtk_tree_view_column_set_title;
+alias extern (C) void function(aGtkTreeViewColumn *)TGTKgtk_tree_view_column_clicked; extern(D) TGTKgtk_tree_view_column_clicked gtk_tree_view_column_clicked;
+alias extern (C) int function(aGtkTreeViewColumn *)TGTKgtk_tree_view_column_get_max_width; extern(D) TGTKgtk_tree_view_column_get_max_width gtk_tree_view_column_get_max_width;
+alias extern (C) void function(aGtkTreeViewColumn *, int)TGTKgtk_tree_view_column_set_max_width; extern(D) TGTKgtk_tree_view_column_set_max_width gtk_tree_view_column_set_max_width;
+alias extern (C) int function(aGtkTreeViewColumn *)TGTKgtk_tree_view_column_get_min_width; extern(D) TGTKgtk_tree_view_column_get_min_width gtk_tree_view_column_get_min_width;
+alias extern (C) void function(aGtkTreeViewColumn *, int)TGTKgtk_tree_view_column_set_min_width; extern(D) TGTKgtk_tree_view_column_set_min_width gtk_tree_view_column_set_min_width;
+alias extern (C) void function(aGtkTreeViewColumn *, int)TGTKgtk_tree_view_column_set_fixed_width; extern(D) TGTKgtk_tree_view_column_set_fixed_width gtk_tree_view_column_set_fixed_width;
+alias extern (C) int function(aGtkTreeViewColumn *)TGTKgtk_tree_view_column_get_fixed_width; extern(D) TGTKgtk_tree_view_column_get_fixed_width gtk_tree_view_column_get_fixed_width;
+alias extern (C) int function(aGtkTreeViewColumn *)TGTKgtk_tree_view_column_get_width; extern(D) TGTKgtk_tree_view_column_get_width gtk_tree_view_column_get_width;
+alias extern (C) int function(aGtkTreeViewColumn *)TGTKgtk_tree_view_column_get_sizing; extern(D) TGTKgtk_tree_view_column_get_sizing gtk_tree_view_column_get_sizing;
+alias extern (C) void function(aGtkTreeViewColumn *, int)TGTKgtk_tree_view_column_set_sizing; extern(D) TGTKgtk_tree_view_column_set_sizing gtk_tree_view_column_set_sizing;
+alias extern (C) int function(aGtkTreeViewColumn *)TGTKgtk_tree_view_column_get_resizable; extern(D) TGTKgtk_tree_view_column_get_resizable gtk_tree_view_column_get_resizable;
+alias extern (C) void function(aGtkTreeViewColumn *, int)TGTKgtk_tree_view_column_set_resizable; extern(D) TGTKgtk_tree_view_column_set_resizable gtk_tree_view_column_set_resizable;
+alias extern (C) int function(aGtkTreeViewColumn *)TGTKgtk_tree_view_column_get_visible; extern(D) TGTKgtk_tree_view_column_get_visible gtk_tree_view_column_get_visible;
+alias extern (C) void function(aGtkTreeViewColumn *, int)TGTKgtk_tree_view_column_set_visible; extern(D) TGTKgtk_tree_view_column_set_visible gtk_tree_view_column_set_visible;
+alias extern (C) int function(aGtkTreeViewColumn *)TGTKgtk_tree_view_column_get_spacing; extern(D) TGTKgtk_tree_view_column_get_spacing gtk_tree_view_column_get_spacing;
+alias extern (C) void function(aGtkTreeViewColumn *, int)TGTKgtk_tree_view_column_set_spacing; extern(D) TGTKgtk_tree_view_column_set_spacing gtk_tree_view_column_set_spacing;
+alias extern (C) void function(aGtkTreeViewColumn *, aGtkCellRenderer *)TGTKgtk_tree_view_column_clear_attributes; extern(D) TGTKgtk_tree_view_column_clear_attributes gtk_tree_view_column_clear_attributes;
+alias extern (C) void function(aGtkTreeViewColumn *, aGtkCellRenderer *, _BCD_func__11636, void *, _BCD_func__13158)TGTKgtk_tree_view_column_set_cell_data_func; extern(D) TGTKgtk_tree_view_column_set_cell_data_func gtk_tree_view_column_set_cell_data_func;
+alias extern (C) void function(aGtkTreeViewColumn *, aGtkCellRenderer *, ...)TGTKgtk_tree_view_column_set_attributes; extern(D) TGTKgtk_tree_view_column_set_attributes gtk_tree_view_column_set_attributes;
+alias extern (C) void function(aGtkTreeViewColumn *, aGtkCellRenderer *, char *, int)TGTKgtk_tree_view_column_add_attribute; extern(D) TGTKgtk_tree_view_column_add_attribute gtk_tree_view_column_add_attribute;
+alias extern (C) _GList * function(aGtkTreeViewColumn *)TGTKgtk_tree_view_column_get_cell_renderers; extern(D) TGTKgtk_tree_view_column_get_cell_renderers gtk_tree_view_column_get_cell_renderers;
+alias extern (C) void function(aGtkTreeViewColumn *)TGTKgtk_tree_view_column_clear; extern(D) TGTKgtk_tree_view_column_clear gtk_tree_view_column_clear;
+alias extern (C) void function(aGtkTreeViewColumn *, aGtkCellRenderer *, int)TGTKgtk_tree_view_column_pack_end; extern(D) TGTKgtk_tree_view_column_pack_end gtk_tree_view_column_pack_end;
+alias extern (C) void function(aGtkTreeViewColumn *, aGtkCellRenderer *, int)TGTKgtk_tree_view_column_pack_start; extern(D) TGTKgtk_tree_view_column_pack_start gtk_tree_view_column_pack_start;
+alias extern (C) _GtkTreeViewColumn * function(char *, aGtkCellRenderer *, ...)TGTKgtk_tree_view_column_new_with_attributes; extern(D) TGTKgtk_tree_view_column_new_with_attributes gtk_tree_view_column_new_with_attributes;
+alias extern (C) _GtkTreeViewColumn * function()TGTKgtk_tree_view_column_new; extern(D) TGTKgtk_tree_view_column_new gtk_tree_view_column_new;
+alias extern (C) uint function()TGTKgtk_tree_view_column_get_type; extern(D) TGTKgtk_tree_view_column_get_type gtk_tree_view_column_get_type;
+alias extern (C) int function(void *)TGTKgtk_tree_sortable_has_default_sort_func; extern(D) TGTKgtk_tree_sortable_has_default_sort_func gtk_tree_sortable_has_default_sort_func;
+alias extern (C) void function(void *, _BCD_func__11685, void *, _BCD_func__13158)TGTKgtk_tree_sortable_set_default_sort_func; extern(D) TGTKgtk_tree_sortable_set_default_sort_func gtk_tree_sortable_set_default_sort_func;
+alias extern (C) void function(void *, int, _BCD_func__11685, void *, _BCD_func__13158)TGTKgtk_tree_sortable_set_sort_func; extern(D) TGTKgtk_tree_sortable_set_sort_func gtk_tree_sortable_set_sort_func;
+alias extern (C) void function(void *, int, int)TGTKgtk_tree_sortable_set_sort_column_id; extern(D) TGTKgtk_tree_sortable_set_sort_column_id gtk_tree_sortable_set_sort_column_id;
+alias extern (C) int function(void *, int *, int *)TGTKgtk_tree_sortable_get_sort_column_id; extern(D) TGTKgtk_tree_sortable_get_sort_column_id gtk_tree_sortable_get_sort_column_id;
+alias extern (C) void function(void *)TGTKgtk_tree_sortable_sort_column_changed; extern(D) TGTKgtk_tree_sortable_sort_column_changed gtk_tree_sortable_sort_column_changed;
+alias extern (C) uint function()TGTKgtk_tree_sortable_get_type; extern(D) TGTKgtk_tree_sortable_get_type gtk_tree_sortable_get_type;
+alias extern (C) void function(void *, void *, aGtkTreeIter *, int *)TGTKgtk_tree_model_rows_reordered; extern(D) TGTKgtk_tree_model_rows_reordered gtk_tree_model_rows_reordered;
+alias extern (C) void function(void *, void *)TGTKgtk_tree_model_row_deleted; extern(D) TGTKgtk_tree_model_row_deleted gtk_tree_model_row_deleted;
+alias extern (C) void function(void *, void *, aGtkTreeIter *)TGTKgtk_tree_model_row_has_child_toggled; extern(D) TGTKgtk_tree_model_row_has_child_toggled gtk_tree_model_row_has_child_toggled;
+alias extern (C) void function(void *, void *, aGtkTreeIter *)TGTKgtk_tree_model_row_inserted; extern(D) TGTKgtk_tree_model_row_inserted gtk_tree_model_row_inserted;
+alias extern (C) void function(void *, void *, aGtkTreeIter *)TGTKgtk_tree_model_row_changed; extern(D) TGTKgtk_tree_model_row_changed gtk_tree_model_row_changed;
+alias extern (C) void function(void *, _BCD_func__11697, void *)TGTKgtk_tree_model_foreach; extern(D) TGTKgtk_tree_model_foreach gtk_tree_model_foreach;
+alias extern (C) void function(void *, aGtkTreeIter *, char *)TGTKgtk_tree_model_get_valist; extern(D) TGTKgtk_tree_model_get_valist gtk_tree_model_get_valist;
+alias extern (C) void function(void *, aGtkTreeIter *, ...)TGTKgtk_tree_model_get; extern(D) TGTKgtk_tree_model_get gtk_tree_model_get;
+alias extern (C) void function(void *, aGtkTreeIter *)TGTKgtk_tree_model_unref_node; extern(D) TGTKgtk_tree_model_unref_node gtk_tree_model_unref_node;
+alias extern (C) void function(void *, aGtkTreeIter *)TGTKgtk_tree_model_ref_node; extern(D) TGTKgtk_tree_model_ref_node gtk_tree_model_ref_node;
+alias extern (C) int function(void *, aGtkTreeIter *, aGtkTreeIter *)TGTKgtk_tree_model_iter_parent; extern(D) TGTKgtk_tree_model_iter_parent gtk_tree_model_iter_parent;
+alias extern (C) int function(void *, aGtkTreeIter *, aGtkTreeIter *, int)TGTKgtk_tree_model_iter_nth_child; extern(D) TGTKgtk_tree_model_iter_nth_child gtk_tree_model_iter_nth_child;
+alias extern (C) int function(void *, aGtkTreeIter *)TGTKgtk_tree_model_iter_n_children; extern(D) TGTKgtk_tree_model_iter_n_children gtk_tree_model_iter_n_children;
+alias extern (C) int function(void *, aGtkTreeIter *)TGTKgtk_tree_model_iter_has_child; extern(D) TGTKgtk_tree_model_iter_has_child gtk_tree_model_iter_has_child;
+alias extern (C) int function(void *, aGtkTreeIter *, aGtkTreeIter *)TGTKgtk_tree_model_iter_children; extern(D) TGTKgtk_tree_model_iter_children gtk_tree_model_iter_children;
+alias extern (C) int function(void *, aGtkTreeIter *)TGTKgtk_tree_model_iter_next; extern(D) TGTKgtk_tree_model_iter_next gtk_tree_model_iter_next;
+alias extern (C) void function(void *, aGtkTreeIter *, int, _GValue *)TGTKgtk_tree_model_get_value; extern(D) TGTKgtk_tree_model_get_value gtk_tree_model_get_value;
+alias extern (C) void * function(void *, aGtkTreeIter *)TGTKgtk_tree_model_get_path; extern(D) TGTKgtk_tree_model_get_path gtk_tree_model_get_path;
+alias extern (C) int function(void *, aGtkTreeIter *)TGTKgtk_tree_model_get_iter_first; extern(D) TGTKgtk_tree_model_get_iter_first gtk_tree_model_get_iter_first;
+alias extern (C) char * function(void *, aGtkTreeIter *)TGTKgtk_tree_model_get_string_from_iter; extern(D) TGTKgtk_tree_model_get_string_from_iter gtk_tree_model_get_string_from_iter;
+alias extern (C) int function(void *, aGtkTreeIter *, char *)TGTKgtk_tree_model_get_iter_from_string; extern(D) TGTKgtk_tree_model_get_iter_from_string gtk_tree_model_get_iter_from_string;
+alias extern (C) int function(void *, aGtkTreeIter *, void *)TGTKgtk_tree_model_get_iter; extern(D) TGTKgtk_tree_model_get_iter gtk_tree_model_get_iter;
+alias extern (C) uint function(void *, int)TGTKgtk_tree_model_get_column_type; extern(D) TGTKgtk_tree_model_get_column_type gtk_tree_model_get_column_type;
+alias extern (C) int function(void *)TGTKgtk_tree_model_get_n_columns; extern(D) TGTKgtk_tree_model_get_n_columns gtk_tree_model_get_n_columns;
+alias extern (C) int function(void *)TGTKgtk_tree_model_get_flags; extern(D) TGTKgtk_tree_model_get_flags gtk_tree_model_get_flags;
+alias extern (C) uint function()TGTKgtk_tree_model_get_type; extern(D) TGTKgtk_tree_model_get_type gtk_tree_model_get_type;
+alias extern (C) uint function()TGTKgtk_tree_iter_get_type; extern(D) TGTKgtk_tree_iter_get_type gtk_tree_iter_get_type;
+alias extern (C) void function(aGtkTreeIter *)TGTKgtk_tree_iter_free; extern(D) TGTKgtk_tree_iter_free gtk_tree_iter_free;
+alias extern (C) _GtkTreeIter * function(aGtkTreeIter *)TGTKgtk_tree_iter_copy; extern(D) TGTKgtk_tree_iter_copy gtk_tree_iter_copy;
+alias extern (C) void function(_GObject *, void *, aGtkTreeIter *, int *)TGTKgtk_tree_row_reference_reordered; extern(D) TGTKgtk_tree_row_reference_reordered gtk_tree_row_reference_reordered;
+alias extern (C) void function(_GObject *, void *)TGTKgtk_tree_row_reference_deleted; extern(D) TGTKgtk_tree_row_reference_deleted gtk_tree_row_reference_deleted;
+alias extern (C) void function(_GObject *, void *)TGTKgtk_tree_row_reference_inserted; extern(D) TGTKgtk_tree_row_reference_inserted gtk_tree_row_reference_inserted;
+alias extern (C) void function(void *)TGTKgtk_tree_row_reference_free; extern(D) TGTKgtk_tree_row_reference_free gtk_tree_row_reference_free;
+alias extern (C) void * function(void *)TGTKgtk_tree_row_reference_copy; extern(D) TGTKgtk_tree_row_reference_copy gtk_tree_row_reference_copy;
+alias extern (C) int function(void *)TGTKgtk_tree_row_reference_valid; extern(D) TGTKgtk_tree_row_reference_valid gtk_tree_row_reference_valid;
+alias extern (C) void * function(void *)TGTKgtk_tree_row_reference_get_model; extern(D) TGTKgtk_tree_row_reference_get_model gtk_tree_row_reference_get_model;
+alias extern (C) void * function(void *)TGTKgtk_tree_row_reference_get_path; extern(D) TGTKgtk_tree_row_reference_get_path gtk_tree_row_reference_get_path;
+alias extern (C) void * function(_GObject *, void *, void *)TGTKgtk_tree_row_reference_new_proxy; extern(D) TGTKgtk_tree_row_reference_new_proxy gtk_tree_row_reference_new_proxy;
+alias extern (C) void * function(void *, void *)TGTKgtk_tree_row_reference_new; extern(D) TGTKgtk_tree_row_reference_new gtk_tree_row_reference_new;
+alias extern (C) uint function()TGTKgtk_tree_row_reference_get_type; extern(D) TGTKgtk_tree_row_reference_get_type gtk_tree_row_reference_get_type;
+alias extern (C) int function(void *, void *)TGTKgtk_tree_path_is_descendant; extern(D) TGTKgtk_tree_path_is_descendant gtk_tree_path_is_descendant;
+alias extern (C) int function(void *, void *)TGTKgtk_tree_path_is_ancestor; extern(D) TGTKgtk_tree_path_is_ancestor gtk_tree_path_is_ancestor;
+alias extern (C) void function(void *)TGTKgtk_tree_path_down; extern(D) TGTKgtk_tree_path_down gtk_tree_path_down;
+alias extern (C) int function(void *)TGTKgtk_tree_path_up; extern(D) TGTKgtk_tree_path_up gtk_tree_path_up;
+alias extern (C) int function(void *)TGTKgtk_tree_path_prev; extern(D) TGTKgtk_tree_path_prev gtk_tree_path_prev;
+alias extern (C) void function(void *)TGTKgtk_tree_path_next; extern(D) TGTKgtk_tree_path_next gtk_tree_path_next;
+alias extern (C) int function(void *, void *)TGTKgtk_tree_path_compare; extern(D) TGTKgtk_tree_path_compare gtk_tree_path_compare;
+alias extern (C) uint function()TGTKgtk_tree_path_get_type; extern(D) TGTKgtk_tree_path_get_type gtk_tree_path_get_type;
+alias extern (C) void * function(void *)TGTKgtk_tree_path_copy; extern(D) TGTKgtk_tree_path_copy gtk_tree_path_copy;
+alias extern (C) void function(void *)TGTKgtk_tree_path_free; extern(D) TGTKgtk_tree_path_free gtk_tree_path_free;
+alias extern (C) int * function(void *)TGTKgtk_tree_path_get_indices; extern(D) TGTKgtk_tree_path_get_indices gtk_tree_path_get_indices;
+alias extern (C) int function(void *)TGTKgtk_tree_path_get_depth; extern(D) TGTKgtk_tree_path_get_depth gtk_tree_path_get_depth;
+alias extern (C) void function(void *, int)TGTKgtk_tree_path_prepend_index; extern(D) TGTKgtk_tree_path_prepend_index gtk_tree_path_prepend_index;
+alias extern (C) void function(void *, int)TGTKgtk_tree_path_append_index; extern(D) TGTKgtk_tree_path_append_index gtk_tree_path_append_index;
+alias extern (C) void * function()TGTKgtk_tree_path_new_first; extern(D) TGTKgtk_tree_path_new_first gtk_tree_path_new_first;
+alias extern (C) char * function(void *)TGTKgtk_tree_path_to_string; extern(D) TGTKgtk_tree_path_to_string gtk_tree_path_to_string;
+alias extern (C) void * function(int, ...)TGTKgtk_tree_path_new_from_indices; extern(D) TGTKgtk_tree_path_new_from_indices gtk_tree_path_new_from_indices;
+alias extern (C) void * function(char *)TGTKgtk_tree_path_new_from_string; extern(D) TGTKgtk_tree_path_new_from_string gtk_tree_path_new_from_string;
+alias extern (C) void * function()TGTKgtk_tree_path_new; extern(D) TGTKgtk_tree_path_new gtk_tree_path_new;
+alias extern (C) void function(aGtkCellRenderer *, int)TGTKgtk_cell_renderer_stop_editing; extern(D) TGTKgtk_cell_renderer_stop_editing gtk_cell_renderer_stop_editing;
+alias extern (C) void function(aGtkCellRenderer *)TGTKgtk_cell_renderer_editing_canceled; extern(D) TGTKgtk_cell_renderer_editing_canceled gtk_cell_renderer_editing_canceled;
+alias extern (C) void function(aGtkCellRenderer *, int *, int *)TGTKgtk_cell_renderer_get_fixed_size; extern(D) TGTKgtk_cell_renderer_get_fixed_size gtk_cell_renderer_get_fixed_size;
+alias extern (C) void function(aGtkCellRenderer *, int, int)TGTKgtk_cell_renderer_set_fixed_size; extern(D) TGTKgtk_cell_renderer_set_fixed_size gtk_cell_renderer_set_fixed_size;
+alias extern (C) void * function(aGtkCellRenderer *, _GdkEvent *, aGtkWidget *, char *, _GdkRectangle *, _GdkRectangle *, int)TGTKgtk_cell_renderer_start_editing; extern(D) TGTKgtk_cell_renderer_start_editing gtk_cell_renderer_start_editing;
+alias extern (C) int function(aGtkCellRenderer *, _GdkEvent *, aGtkWidget *, char *, _GdkRectangle *, _GdkRectangle *, int)TGTKgtk_cell_renderer_activate; extern(D) TGTKgtk_cell_renderer_activate gtk_cell_renderer_activate;
+alias extern (C) void function(aGtkCellRenderer *, _GdkDrawable *, aGtkWidget *, _GdkRectangle *, _GdkRectangle *, _GdkRectangle *, int)TGTKgtk_cell_renderer_render; extern(D) TGTKgtk_cell_renderer_render gtk_cell_renderer_render;
+alias extern (C) void function(aGtkCellRenderer *, aGtkWidget *, _GdkRectangle *, int *, int *, int *, int *)TGTKgtk_cell_renderer_get_size; extern(D) TGTKgtk_cell_renderer_get_size gtk_cell_renderer_get_size;
+alias extern (C) uint function()TGTKgtk_cell_renderer_get_type; extern(D) TGTKgtk_cell_renderer_get_type gtk_cell_renderer_get_type;
+alias extern (C) void function(void *)TGTKgtk_cell_editable_remove_widget; extern(D) TGTKgtk_cell_editable_remove_widget gtk_cell_editable_remove_widget;
+alias extern (C) void function(void *)TGTKgtk_cell_editable_editing_done; extern(D) TGTKgtk_cell_editable_editing_done gtk_cell_editable_editing_done;
+alias extern (C) void function(void *, _GdkEvent *)TGTKgtk_cell_editable_start_editing; extern(D) TGTKgtk_cell_editable_start_editing gtk_cell_editable_start_editing;
+alias extern (C) uint function()TGTKgtk_cell_editable_get_type; extern(D) TGTKgtk_cell_editable_get_type gtk_cell_editable_get_type;
+alias extern (C) void function(aGtkCalendar *)TGTKgtk_calendar_thaw; extern(D) TGTKgtk_calendar_thaw gtk_calendar_thaw;
+alias extern (C) void function(aGtkCalendar *)TGTKgtk_calendar_freeze; extern(D) TGTKgtk_calendar_freeze gtk_calendar_freeze;
+alias extern (C) void function(aGtkCalendar *, uint *, uint *, uint *)TGTKgtk_calendar_get_date; extern(D) TGTKgtk_calendar_get_date gtk_calendar_get_date;
+alias extern (C) void function(aGtkCalendar *, int)TGTKgtk_calendar_display_options; extern(D) TGTKgtk_calendar_display_options gtk_calendar_display_options;
+alias extern (C) int function(aGtkCalendar *)TGTKgtk_calendar_get_display_options; extern(D) TGTKgtk_calendar_get_display_options gtk_calendar_get_display_options;
+alias extern (C) void function(aGtkCalendar *, int)TGTKgtk_calendar_set_display_options; extern(D) TGTKgtk_calendar_set_display_options gtk_calendar_set_display_options;
+alias extern (C) void function(aGtkCalendar *)TGTKgtk_calendar_clear_marks; extern(D) TGTKgtk_calendar_clear_marks gtk_calendar_clear_marks;
+alias extern (C) int function(aGtkCalendar *, uint)TGTKgtk_calendar_unmark_day; extern(D) TGTKgtk_calendar_unmark_day gtk_calendar_unmark_day;
+alias extern (C) int function(aGtkCalendar *, uint)TGTKgtk_calendar_mark_day; extern(D) TGTKgtk_calendar_mark_day gtk_calendar_mark_day;
+alias extern (C) void function(aGtkCalendar *, uint)TGTKgtk_calendar_select_day; extern(D) TGTKgtk_calendar_select_day gtk_calendar_select_day;
+alias extern (C) int function(aGtkCalendar *, uint, uint)TGTKgtk_calendar_select_month; extern(D) TGTKgtk_calendar_select_month gtk_calendar_select_month;
+alias extern (C) _GtkWidget * function()TGTKgtk_calendar_new; extern(D) TGTKgtk_calendar_new gtk_calendar_new;
+alias extern (C) uint function()TGTKgtk_calendar_get_type; extern(D) TGTKgtk_calendar_get_type gtk_calendar_get_type;
+alias extern (C) void function(aGtkObject *, _BCD_func__12122, void *, int, uint)TGTKgtk_signal_compat_matched; extern(D) TGTKgtk_signal_compat_matched gtk_signal_compat_matched;
+alias extern (C) void function(aGtkObject *, char *, aGtkArg *)TGTKgtk_signal_emitv_by_name; extern(D) TGTKgtk_signal_emitv_by_name gtk_signal_emitv_by_name;
+alias extern (C) void function(aGtkObject *, char *, ...)TGTKgtk_signal_emit_by_name; extern(D) TGTKgtk_signal_emit_by_name gtk_signal_emit_by_name;
+alias extern (C) void function(aGtkObject *, uint, ...)TGTKgtk_signal_emit; extern(D) TGTKgtk_signal_emit gtk_signal_emit;
+alias extern (C) void function(aGtkObject *, uint, aGtkArg *)TGTKgtk_signal_emitv; extern(D) TGTKgtk_signal_emitv gtk_signal_emitv;
+alias extern (C) uint function(aGtkObject *, char *, _BCD_func__12122, _BCD_func__13157, void *, _BCD_func__13158, int, int)TGTKgtk_signal_connect_full; extern(D) TGTKgtk_signal_connect_full gtk_signal_connect_full;
+alias extern (C) void function(aGtkObject *, char *, _BCD_func__12122, void *, aGtkObject *)TGTKgtk_signal_connect_while_alive; extern(D) TGTKgtk_signal_connect_while_alive gtk_signal_connect_while_alive;
+alias extern (C) void function(aGtkObject *, char *, _BCD_func__12122, aGtkObject *)TGTKgtk_signal_connect_object_while_alive; extern(D) TGTKgtk_signal_connect_object_while_alive gtk_signal_connect_object_while_alive;
+alias extern (C) void function(aGtkObject *, char *)TGTKgtk_signal_emit_stop_by_name; extern(D) TGTKgtk_signal_emit_stop_by_name gtk_signal_emit_stop_by_name;
+alias extern (C) uint function(char *, int, uint, uint, _BCD_func__13146, uint, uint, ...)TGTKgtk_signal_new; extern(D) TGTKgtk_signal_new gtk_signal_new;
+alias extern (C) uint function(char *, int, uint, uint, _BCD_func__13146, uint, uint, uint *)TGTKgtk_signal_newv; extern(D) TGTKgtk_signal_newv gtk_signal_newv;
+alias extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)TGTKgtk_marshal_VOID__UINT_STRING; extern(D) TGTKgtk_marshal_VOID__UINT_STRING gtk_marshal_VOID__UINT_STRING;
+alias extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)TGTKgtk_marshal_VOID__UINT_POINTER_UINT_UINT_ENUM; extern(D) TGTKgtk_marshal_VOID__UINT_POINTER_UINT_UINT_ENUM gtk_marshal_VOID__UINT_POINTER_UINT_UINT_ENUM;
+alias extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)TGTKgtk_marshal_VOID__UINT_POINTER_UINT_ENUM_ENUM_POINTER; extern(D) TGTKgtk_marshal_VOID__UINT_POINTER_UINT_ENUM_ENUM_POINTER gtk_marshal_VOID__UINT_POINTER_UINT_ENUM_ENUM_POINTER;
+alias extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)TGTKgtk_marshal_VOID__STRING_INT_POINTER; extern(D) TGTKgtk_marshal_VOID__STRING_INT_POINTER gtk_marshal_VOID__STRING_INT_POINTER;
+alias extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)TGTKgtk_marshal_VOID__POINTER_UINT_UINT; extern(D) TGTKgtk_marshal_VOID__POINTER_UINT_UINT gtk_marshal_VOID__POINTER_UINT_UINT;
+alias extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)TGTKgtk_marshal_VOID__POINTER_INT_INT_POINTER_UINT_UINT; extern(D) TGTKgtk_marshal_VOID__POINTER_INT_INT_POINTER_UINT_UINT gtk_marshal_VOID__POINTER_INT_INT_POINTER_UINT_UINT;
+alias extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)TGTKgtk_marshal_VOID__POINTER_POINTER_UINT_UINT; extern(D) TGTKgtk_marshal_VOID__POINTER_POINTER_UINT_UINT gtk_marshal_VOID__POINTER_POINTER_UINT_UINT;
+alias extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)TGTKgtk_marshal_VOID__POINTER_UINT_ENUM; extern(D) TGTKgtk_marshal_VOID__POINTER_UINT_ENUM gtk_marshal_VOID__POINTER_UINT_ENUM;
+alias extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)TGTKgtk_marshal_VOID__POINTER_UINT; extern(D) TGTKgtk_marshal_VOID__POINTER_UINT gtk_marshal_VOID__POINTER_UINT;
+alias extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)TGTKgtk_marshal_VOID__POINTER_STRING_STRING; extern(D) TGTKgtk_marshal_VOID__POINTER_STRING_STRING gtk_marshal_VOID__POINTER_STRING_STRING;
+alias extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)TGTKgtk_marshal_VOID__POINTER_POINTER_POINTER; extern(D) TGTKgtk_marshal_VOID__POINTER_POINTER_POINTER gtk_marshal_VOID__POINTER_POINTER_POINTER;
+alias extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)TGTKgtk_marshal_VOID__POINTER_POINTER; extern(D) TGTKgtk_marshal_VOID__POINTER_POINTER gtk_marshal_VOID__POINTER_POINTER;
+alias extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)TGTKgtk_marshal_VOID__POINTER_INT; extern(D) TGTKgtk_marshal_VOID__POINTER_INT gtk_marshal_VOID__POINTER_INT;
+alias extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)TGTKgtk_marshal_VOID__INT_INT_POINTER; extern(D) TGTKgtk_marshal_VOID__INT_INT_POINTER gtk_marshal_VOID__INT_INT_POINTER;
+alias extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)TGTKgtk_marshal_VOID__INT_INT; extern(D) TGTKgtk_marshal_VOID__INT_INT gtk_marshal_VOID__INT_INT;
+alias extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)TGTKgtk_marshal_VOID__ENUM_FLOAT_BOOLEAN; extern(D) TGTKgtk_marshal_VOID__ENUM_FLOAT_BOOLEAN gtk_marshal_VOID__ENUM_FLOAT_BOOLEAN;
+alias extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)TGTKgtk_marshal_VOID__ENUM_FLOAT; extern(D) TGTKgtk_marshal_VOID__ENUM_FLOAT gtk_marshal_VOID__ENUM_FLOAT;
+alias extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)TGTKgtk_marshal_INT__POINTER_CHAR_CHAR; extern(D) TGTKgtk_marshal_INT__POINTER_CHAR_CHAR gtk_marshal_INT__POINTER_CHAR_CHAR;
+alias extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)TGTKgtk_marshal_INT__POINTER; extern(D) TGTKgtk_marshal_INT__POINTER gtk_marshal_INT__POINTER;
+alias extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)TGTKgtk_marshal_ENUM__ENUM; extern(D) TGTKgtk_marshal_ENUM__ENUM gtk_marshal_ENUM__ENUM;
+alias extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)TGTKgtk_marshal_BOOLEAN__POINTER_STRING_STRING_POINTER; extern(D) TGTKgtk_marshal_BOOLEAN__POINTER_STRING_STRING_POINTER gtk_marshal_BOOLEAN__POINTER_STRING_STRING_POINTER;
+alias extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)TGTKgtk_marshal_BOOLEAN__POINTER_INT_INT_UINT; extern(D) TGTKgtk_marshal_BOOLEAN__POINTER_INT_INT_UINT gtk_marshal_BOOLEAN__POINTER_INT_INT_UINT;
+alias extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)TGTKgtk_marshal_BOOLEAN__POINTER_INT_INT; extern(D) TGTKgtk_marshal_BOOLEAN__POINTER_INT_INT gtk_marshal_BOOLEAN__POINTER_INT_INT;
+alias extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)TGTKgtk_marshal_BOOLEAN__POINTER_POINTER_INT_INT; extern(D) TGTKgtk_marshal_BOOLEAN__POINTER_POINTER_INT_INT gtk_marshal_BOOLEAN__POINTER_POINTER_INT_INT;
+alias extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)TGTKgtk_marshal_BOOLEAN__POINTER; extern(D) TGTKgtk_marshal_BOOLEAN__POINTER gtk_marshal_BOOLEAN__POINTER;
+alias extern (C) void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *)TGTKgtk_marshal_BOOLEAN__VOID; extern(D) TGTKgtk_marshal_BOOLEAN__VOID gtk_marshal_BOOLEAN__VOID;
+//alias extern (C) void function(aGtkButton *, _GdkRectangle *, int, int, char *, char *)TGTK_gtk_button_paint; extern(D) TGTK_gtk_button_paint _gtk_button_paint;
+//alias extern (C) void function(aGtkButton *, int)TGTK_gtk_button_set_depressed; extern(D) TGTK_gtk_button_set_depressed _gtk_button_set_depressed;
+alias extern (C) int function(aGtkButton *)TGTKgtk_button_get_image_position; extern(D) TGTKgtk_button_get_image_position gtk_button_get_image_position;
+alias extern (C) void function(aGtkButton *, int)TGTKgtk_button_set_image_position; extern(D) TGTKgtk_button_set_image_position gtk_button_set_image_position;
+alias extern (C) _GtkWidget * function(aGtkButton *)TGTKgtk_button_get_image; extern(D) TGTKgtk_button_get_image gtk_button_get_image;
+alias extern (C) void function(aGtkButton *, aGtkWidget *)TGTKgtk_button_set_image; extern(D) TGTKgtk_button_set_image gtk_button_set_image;
+alias extern (C) void function(aGtkButton *, float *, float *)TGTKgtk_button_get_alignment; extern(D) TGTKgtk_button_get_alignment gtk_button_get_alignment;
+alias extern (C) void function(aGtkButton *, float, float)TGTKgtk_button_set_alignment; extern(D) TGTKgtk_button_set_alignment gtk_button_set_alignment;
+alias extern (C) int function(aGtkButton *)TGTKgtk_button_get_focus_on_click; extern(D) TGTKgtk_button_get_focus_on_click gtk_button_get_focus_on_click;
+alias extern (C) void function(aGtkButton *, int)TGTKgtk_button_set_focus_on_click; extern(D) TGTKgtk_button_set_focus_on_click gtk_button_set_focus_on_click;
+alias extern (C) int function(aGtkButton *)TGTKgtk_button_get_use_stock; extern(D) TGTKgtk_button_get_use_stock gtk_button_get_use_stock;
+alias extern (C) void function(aGtkButton *, int)TGTKgtk_button_set_use_stock; extern(D) TGTKgtk_button_set_use_stock gtk_button_set_use_stock;
+alias extern (C) int function(aGtkButton *)TGTKgtk_button_get_use_underline; extern(D) TGTKgtk_button_get_use_underline gtk_button_get_use_underline;
+alias extern (C) void function(aGtkButton *, int)TGTKgtk_button_set_use_underline; extern(D) TGTKgtk_button_set_use_underline gtk_button_set_use_underline;
+alias extern (C) char * function(aGtkButton *)TGTKgtk_button_get_label; extern(D) TGTKgtk_button_get_label gtk_button_get_label;
+alias extern (C) void function(aGtkButton *, char *)TGTKgtk_button_set_label; extern(D) TGTKgtk_button_set_label gtk_button_set_label;
+alias extern (C) int function(aGtkButton *)TGTKgtk_button_get_relief; extern(D) TGTKgtk_button_get_relief gtk_button_get_relief;
+alias extern (C) void function(aGtkButton *, int)TGTKgtk_button_set_relief; extern(D) TGTKgtk_button_set_relief gtk_button_set_relief;
+alias extern (C) void function(aGtkButton *)TGTKgtk_button_leave; extern(D) TGTKgtk_button_leave gtk_button_leave;
+alias extern (C) void function(aGtkButton *)TGTKgtk_button_enter; extern(D) TGTKgtk_button_enter gtk_button_enter;
+alias extern (C) void function(aGtkButton *)TGTKgtk_button_clicked; extern(D) TGTKgtk_button_clicked gtk_button_clicked;
+alias extern (C) void function(aGtkButton *)TGTKgtk_button_released; extern(D) TGTKgtk_button_released gtk_button_released;
+alias extern (C) void function(aGtkButton *)TGTKgtk_button_pressed; extern(D) TGTKgtk_button_pressed gtk_button_pressed;
+alias extern (C) _GtkWidget * function(char *)TGTKgtk_button_new_with_mnemonic; extern(D) TGTKgtk_button_new_with_mnemonic gtk_button_new_with_mnemonic;
+alias extern (C) _GtkWidget * function(char *)TGTKgtk_button_new_from_stock; extern(D) TGTKgtk_button_new_from_stock gtk_button_new_from_stock;
+alias extern (C) _GtkWidget * function(char *)TGTKgtk_button_new_with_label; extern(D) TGTKgtk_button_new_with_label gtk_button_new_with_label;
+alias extern (C) _GtkWidget * function()TGTKgtk_button_new; extern(D) TGTKgtk_button_new gtk_button_new;
+alias extern (C) uint function()TGTKgtk_button_get_type; extern(D) TGTKgtk_button_get_type gtk_button_get_type;
+alias extern (C) void function(aGtkImage *, _GdkImage * *, _GdkDrawable * *)TGTKgtk_image_get; extern(D) TGTKgtk_image_get gtk_image_get;
+alias extern (C) void function(aGtkImage *, _GdkImage *, _GdkDrawable *)TGTKgtk_image_set; extern(D) TGTKgtk_image_set gtk_image_set;
+alias extern (C) int function(aGtkImage *)TGTKgtk_image_get_pixel_size; extern(D) TGTKgtk_image_get_pixel_size gtk_image_get_pixel_size;
+alias extern (C) void function(aGtkImage *, char * *, int *)TGTKgtk_image_get_icon_name; extern(D) TGTKgtk_image_get_icon_name gtk_image_get_icon_name;
+alias extern (C) void * function(aGtkImage *)TGTKgtk_image_get_animation; extern(D) TGTKgtk_image_get_animation gtk_image_get_animation;
+alias extern (C) void function(aGtkImage *, void * *, int *)TGTKgtk_image_get_icon_set; extern(D) TGTKgtk_image_get_icon_set gtk_image_get_icon_set;
+alias extern (C) void function(aGtkImage *, char * *, int *)TGTKgtk_image_get_stock; extern(D) TGTKgtk_image_get_stock gtk_image_get_stock;
+alias extern (C) void * function(aGtkImage *)TGTKgtk_image_get_pixbuf; extern(D) TGTKgtk_image_get_pixbuf gtk_image_get_pixbuf;
+alias extern (C) void function(aGtkImage *, _GdkImage * *, _GdkDrawable * *)TGTKgtk_image_get_image; extern(D) TGTKgtk_image_get_image gtk_image_get_image;
+alias extern (C) void function(aGtkImage *, _GdkDrawable * *, _GdkDrawable * *)TGTKgtk_image_get_pixmap; extern(D) TGTKgtk_image_get_pixmap gtk_image_get_pixmap;
+alias extern (C) int function(aGtkImage *)TGTKgtk_image_get_storage_type; extern(D) TGTKgtk_image_get_storage_type gtk_image_get_storage_type;
+alias extern (C) void function(aGtkImage *, int)TGTKgtk_image_set_pixel_size; extern(D) TGTKgtk_image_set_pixel_size gtk_image_set_pixel_size;
+alias extern (C) void function(aGtkImage *, char *, int)TGTKgtk_image_set_from_icon_name; extern(D) TGTKgtk_image_set_from_icon_name gtk_image_set_from_icon_name;
+alias extern (C) void function(aGtkImage *, void *)TGTKgtk_image_set_from_animation; extern(D) TGTKgtk_image_set_from_animation gtk_image_set_from_animation;
+alias extern (C) void function(aGtkImage *, void *, int)TGTKgtk_image_set_from_icon_set; extern(D) TGTKgtk_image_set_from_icon_set gtk_image_set_from_icon_set;
+alias extern (C) void function(aGtkImage *, char *, int)TGTKgtk_image_set_from_stock; extern(D) TGTKgtk_image_set_from_stock gtk_image_set_from_stock;
+alias extern (C) void function(aGtkImage *, void *)TGTKgtk_image_set_from_pixbuf; extern(D) TGTKgtk_image_set_from_pixbuf gtk_image_set_from_pixbuf;
+alias extern (C) void function(aGtkImage *, char *)TGTKgtk_image_set_from_file; extern(D) TGTKgtk_image_set_from_file gtk_image_set_from_file;
+alias extern (C) void function(aGtkImage *, _GdkImage *, _GdkDrawable *)TGTKgtk_image_set_from_image; extern(D) TGTKgtk_image_set_from_image gtk_image_set_from_image;
+alias extern (C) void function(aGtkImage *, _GdkDrawable *, _GdkDrawable *)TGTKgtk_image_set_from_pixmap; extern(D) TGTKgtk_image_set_from_pixmap gtk_image_set_from_pixmap;
+alias extern (C) void function(aGtkImage *)TGTKgtk_image_clear; extern(D) TGTKgtk_image_clear gtk_image_clear;
+alias extern (C) _GtkWidget * function(char *, int)TGTKgtk_image_new_from_icon_name; extern(D) TGTKgtk_image_new_from_icon_name gtk_image_new_from_icon_name;
+alias extern (C) _GtkWidget * function(void *)TGTKgtk_image_new_from_animation; extern(D) TGTKgtk_image_new_from_animation gtk_image_new_from_animation;
+alias extern (C) _GtkWidget * function(void *, int)TGTKgtk_image_new_from_icon_set; extern(D) TGTKgtk_image_new_from_icon_set gtk_image_new_from_icon_set;
+alias extern (C) _GtkWidget * function(char *, int)TGTKgtk_image_new_from_stock; extern(D) TGTKgtk_image_new_from_stock gtk_image_new_from_stock;
+alias extern (C) _GtkWidget * function(void *)TGTKgtk_image_new_from_pixbuf; extern(D) TGTKgtk_image_new_from_pixbuf gtk_image_new_from_pixbuf;
+alias extern (C) _GtkWidget * function(char *)TGTKgtk_image_new_from_file; extern(D) TGTKgtk_image_new_from_file gtk_image_new_from_file;
+alias extern (C) _GtkWidget * function(_GdkImage *, _GdkDrawable *)TGTKgtk_image_new_from_image; extern(D) TGTKgtk_image_new_from_image gtk_image_new_from_image;
+alias extern (C) _GtkWidget * function(_GdkDrawable *, _GdkDrawable *)TGTKgtk_image_new_from_pixmap; extern(D) TGTKgtk_image_new_from_pixmap gtk_image_new_from_pixmap;
+alias extern (C) _GtkWidget * function()TGTKgtk_image_new; extern(D) TGTKgtk_image_new gtk_image_new;
+alias extern (C) uint function()TGTKgtk_image_get_type; extern(D) TGTKgtk_image_get_type gtk_image_get_type;
+alias extern (C) _GObject * function(void *, aGtkBuilder *, char *)TGTKgtk_buildable_get_internal_child; extern(D) TGTKgtk_buildable_get_internal_child gtk_buildable_get_internal_child;
+alias extern (C) void function(void *, aGtkBuilder *)TGTKgtk_buildable_parser_finished; extern(D) TGTKgtk_buildable_parser_finished gtk_buildable_parser_finished;
+alias extern (C) void function(void *, aGtkBuilder *, _GObject *, char *, void *)TGTKgtk_buildable_custom_finished; extern(D) TGTKgtk_buildable_custom_finished gtk_buildable_custom_finished;
+alias extern (C) void function(void *, aGtkBuilder *, _GObject *, char *, void * *)TGTKgtk_buildable_custom_tag_end; extern(D) TGTKgtk_buildable_custom_tag_end gtk_buildable_custom_tag_end;
+alias extern (C) int function(void *, aGtkBuilder *, _GObject *, char *, _GMarkupParser *, void * *)TGTKgtk_buildable_custom_tag_start; extern(D) TGTKgtk_buildable_custom_tag_start gtk_buildable_custom_tag_start;
+alias extern (C) _GObject * function(void *, aGtkBuilder *, char *)TGTKgtk_buildable_construct_child; extern(D) TGTKgtk_buildable_construct_child gtk_buildable_construct_child;
+alias extern (C) void function(void *, aGtkBuilder *, char *, _GValue *)TGTKgtk_buildable_set_buildable_property; extern(D) TGTKgtk_buildable_set_buildable_property gtk_buildable_set_buildable_property;
+alias extern (C) void function(void *, aGtkBuilder *, _GObject *, char *)TGTKgtk_buildable_add_child; extern(D) TGTKgtk_buildable_add_child gtk_buildable_add_child;
+alias extern (C) char * function(void *)TGTKgtk_buildable_get_name; extern(D) TGTKgtk_buildable_get_name gtk_buildable_get_name;
+alias extern (C) void function(void *, char *)TGTKgtk_buildable_set_name; extern(D) TGTKgtk_buildable_set_name gtk_buildable_set_name;
+alias extern (C) uint function()TGTKgtk_buildable_get_type; extern(D) TGTKgtk_buildable_get_type gtk_buildable_get_type;
+alias extern (C) int function(aGtkBuilder *, uint, char *, _GValue *, _GError * *)TGTKgtk_builder_value_from_string_type; extern(D) TGTKgtk_builder_value_from_string_type gtk_builder_value_from_string_type;
+alias extern (C) int function(aGtkBuilder *, _GParamSpec *, char *, _GValue *, _GError * *)TGTKgtk_builder_value_from_string; extern(D) TGTKgtk_builder_value_from_string gtk_builder_value_from_string;
+alias extern (C) uint function(aGtkBuilder *, char *)TGTKgtk_builder_get_type_from_name; extern(D) TGTKgtk_builder_get_type_from_name gtk_builder_get_type_from_name;
+alias extern (C) char * function(aGtkBuilder *)TGTKgtk_builder_get_translation_domain; extern(D) TGTKgtk_builder_get_translation_domain gtk_builder_get_translation_domain;
+alias extern (C) void function(aGtkBuilder *, char *)TGTKgtk_builder_set_translation_domain; extern(D) TGTKgtk_builder_set_translation_domain gtk_builder_set_translation_domain;
+alias extern (C) void function(aGtkBuilder *, _BCD_func__11889, void *)TGTKgtk_builder_connect_signals_full; extern(D) TGTKgtk_builder_connect_signals_full gtk_builder_connect_signals_full;
+alias extern (C) void function(aGtkBuilder *, void *)TGTKgtk_builder_connect_signals; extern(D) TGTKgtk_builder_connect_signals gtk_builder_connect_signals;
+alias extern (C) _GSList * function(aGtkBuilder *)TGTKgtk_builder_get_objects; extern(D) TGTKgtk_builder_get_objects gtk_builder_get_objects;
+alias extern (C) _GObject * function(aGtkBuilder *, char *)TGTKgtk_builder_get_object; extern(D) TGTKgtk_builder_get_object gtk_builder_get_object;
+alias extern (C) uint function(aGtkBuilder *, char *, uint, _GError * *)TGTKgtk_builder_add_from_string; extern(D) TGTKgtk_builder_add_from_string gtk_builder_add_from_string;
+alias extern (C) uint function(aGtkBuilder *, char *, _GError * *)TGTKgtk_builder_add_from_file; extern(D) TGTKgtk_builder_add_from_file gtk_builder_add_from_file;
+alias extern (C) _GtkBuilder * function()TGTKgtk_builder_new; extern(D) TGTKgtk_builder_new gtk_builder_new;
+alias extern (C) uint function()TGTKgtk_builder_get_type; extern(D) TGTKgtk_builder_get_type gtk_builder_get_type;
+alias extern (C) uint function()TGTKgtk_builder_error_quark; extern(D) TGTKgtk_builder_error_quark gtk_builder_error_quark;
+//alias extern (C) uint function(char *, uint, int, _BCD_func__12122, _BCD_func__14366, void *, _BCD_func__13146, uint, uint, ...)TGTK_gtk_binding_signal_new; extern(D) TGTK_gtk_binding_signal_new _gtk_binding_signal_new;
+//alias extern (C) void function(aGtkBindingSet *, uint, int, char *, _GSList *)TGTK_gtk_binding_entry_add_signall; extern(D) TGTK_gtk_binding_entry_add_signall _gtk_binding_entry_add_signall;
+//alias extern (C) void function()TGTK_gtk_binding_reset_parsed; extern(D) TGTK_gtk_binding_reset_parsed _gtk_binding_reset_parsed;
+//alias extern (C) uint function(_GScanner *)TGTK/binding_parse_binding; extern(D) TGTK_gtk_binding_parse_binding _gtk_binding_parse_binding;
+alias extern (C) void function(aGtkBindingSet *, int, char *, int)TGTKgtk_binding_set_add_path; extern(D) TGTKgtk_binding_set_add_path gtk_binding_set_add_path;
+alias extern (C) void function(aGtkBindingSet *, uint, int)TGTKgtk_binding_entry_remove; extern(D) TGTKgtk_binding_entry_remove gtk_binding_entry_remove;
+alias extern (C) void function(aGtkBindingSet *, uint, int, char *, uint, ...)TGTKgtk_binding_entry_add_signal; extern(D) TGTKgtk_binding_entry_add_signal gtk_binding_entry_add_signal;
+alias extern (C) void function(aGtkBindingSet *, uint, int)TGTKgtk_binding_entry_skip; extern(D) TGTKgtk_binding_entry_skip gtk_binding_entry_skip;
+alias extern (C) uint function(_GScanner *)TGTKgtk_binding_parse_binding; extern(D) TGTKgtk_binding_parse_binding gtk_binding_parse_binding;
+alias extern (C) void function(aGtkBindingSet *, uint, int, char *, _GSList *)TGTKgtk_binding_entry_add_signall; extern(D) TGTKgtk_binding_entry_add_signall gtk_binding_entry_add_signall;
+alias extern (C) void function(aGtkBindingSet *, uint, int)TGTKgtk_binding_entry_clear; extern(D) TGTKgtk_binding_entry_clear gtk_binding_entry_clear;
+alias extern (C) int function(aGtkBindingSet *, uint, int, aGtkObject *)TGTKgtk_binding_set_activate; extern(D) TGTKgtk_binding_set_activate gtk_binding_set_activate;
+alias extern (C) int function(aGtkObject *, _GdkEventKey *)TGTKgtk_bindings_activate_event; extern(D) TGTKgtk_bindings_activate_event gtk_bindings_activate_event;
+alias extern (C) int function(aGtkObject *, uint, int)TGTKgtk_bindings_activate; extern(D) TGTKgtk_bindings_activate gtk_bindings_activate;
+alias extern (C) _GtkBindingSet * function(char *)TGTKgtk_binding_set_find; extern(D) TGTKgtk_binding_set_find gtk_binding_set_find;
+alias extern (C) _GtkBindingSet * function(void *)TGTKgtk_binding_set_by_class; extern(D) TGTKgtk_binding_set_by_class gtk_binding_set_by_class;
+alias extern (C) _GtkBindingSet * function(char *)TGTKgtk_binding_set_new; extern(D) TGTKgtk_binding_set_new gtk_binding_set_new;
+//alias extern (C) void function(aGtkWidget *, int *, int *, int *, int *)TGTK_gtk_button_box_child_requisition; extern(D) TGTK_gtk_button_box_child_requisition _gtk_button_box_child_requisition;
+alias extern (C) void function(aGtkButtonBox *, int *, int *)TGTKgtk_button_box_get_child_ipadding; extern(D) TGTKgtk_button_box_get_child_ipadding gtk_button_box_get_child_ipadding;
+alias extern (C) void function(aGtkButtonBox *, int *, int *)TGTKgtk_button_box_get_child_size; extern(D) TGTKgtk_button_box_get_child_size gtk_button_box_get_child_size;
+alias extern (C) void function(aGtkButtonBox *, int, int)TGTKgtk_button_box_set_child_ipadding; extern(D) TGTKgtk_button_box_set_child_ipadding gtk_button_box_set_child_ipadding;
+alias extern (C) void function(aGtkButtonBox *, int, int)TGTKgtk_button_box_set_child_size; extern(D) TGTKgtk_button_box_set_child_size gtk_button_box_set_child_size;
+alias extern (C) void function(aGtkButtonBox *, aGtkWidget *, int)TGTKgtk_button_box_set_child_secondary; extern(D) TGTKgtk_button_box_set_child_secondary gtk_button_box_set_child_secondary;
+alias extern (C) int function(aGtkButtonBox *, aGtkWidget *)TGTKgtk_button_box_get_child_secondary; extern(D) TGTKgtk_button_box_get_child_secondary gtk_button_box_get_child_secondary;
+alias extern (C) void function(aGtkButtonBox *, int)TGTKgtk_button_box_set_layout; extern(D) TGTKgtk_button_box_set_layout gtk_button_box_set_layout;
+alias extern (C) int function(aGtkButtonBox *)TGTKgtk_button_box_get_layout; extern(D) TGTKgtk_button_box_get_layout gtk_button_box_get_layout;
+alias extern (C) uint function()TGTKgtk_button_box_get_type; extern(D) TGTKgtk_button_box_get_type gtk_button_box_get_type;
+alias extern (C) void function(aGtkBox *, aGtkWidget *, int, int, uint, int)TGTKgtk_box_set_child_packing; extern(D) TGTKgtk_box_set_child_packing gtk_box_set_child_packing;
+alias extern (C) void function(aGtkBox *, aGtkWidget *, int *, int *, uint *, int *)TGTKgtk_box_query_child_packing; extern(D) TGTKgtk_box_query_child_packing gtk_box_query_child_packing;
+alias extern (C) void function(aGtkBox *, aGtkWidget *, int)TGTKgtk_box_reorder_child; extern(D) TGTKgtk_box_reorder_child gtk_box_reorder_child;
+alias extern (C) int function(aGtkBox *)TGTKgtk_box_get_spacing; extern(D) TGTKgtk_box_get_spacing gtk_box_get_spacing;
+alias extern (C) void function(aGtkBox *, int)TGTKgtk_box_set_spacing; extern(D) TGTKgtk_box_set_spacing gtk_box_set_spacing;
+alias extern (C) int function(aGtkBox *)TGTKgtk_box_get_homogeneous; extern(D) TGTKgtk_box_get_homogeneous gtk_box_get_homogeneous;
+alias extern (C) void function(aGtkBox *, int)TGTKgtk_box_set_homogeneous; extern(D) TGTKgtk_box_set_homogeneous gtk_box_set_homogeneous;
+alias extern (C) void function(aGtkBox *, aGtkWidget *)TGTKgtk_box_pack_end_defaults; extern(D) TGTKgtk_box_pack_end_defaults gtk_box_pack_end_defaults;
+alias extern (C) void function(aGtkBox *, aGtkWidget *)TGTKgtk_box_pack_start_defaults; extern(D) TGTKgtk_box_pack_start_defaults gtk_box_pack_start_defaults;
+alias extern (C) void function(aGtkBox *, aGtkWidget *, int, int, uint)TGTKgtk_box_pack_end; extern(D) TGTKgtk_box_pack_end gtk_box_pack_end;
+alias extern (C) void function(aGtkBox *, aGtkWidget *, int, int, uint)TGTKgtk_box_pack_start; extern(D) TGTKgtk_box_pack_start gtk_box_pack_start;
+alias extern (C) uint function()TGTKgtk_box_get_type; extern(D) TGTKgtk_box_get_type gtk_box_get_type;
+alias extern (C) void function(aGtkAssistant *)TGTKgtk_assistant_update_buttons_state; extern(D) TGTKgtk_assistant_update_buttons_state gtk_assistant_update_buttons_state;
+alias extern (C) void function(aGtkAssistant *, aGtkWidget *)TGTKgtk_assistant_remove_action_widget; extern(D) TGTKgtk_assistant_remove_action_widget gtk_assistant_remove_action_widget;
+alias extern (C) void function(aGtkAssistant *, aGtkWidget *)TGTKgtk_assistant_add_action_widget; extern(D) TGTKgtk_assistant_add_action_widget gtk_assistant_add_action_widget;
+alias extern (C) int function(aGtkAssistant *, aGtkWidget *)TGTKgtk_assistant_get_page_complete; extern(D) TGTKgtk_assistant_get_page_complete gtk_assistant_get_page_complete;
+alias extern (C) void function(aGtkAssistant *, aGtkWidget *, int)TGTKgtk_assistant_set_page_complete; extern(D) TGTKgtk_assistant_set_page_complete gtk_assistant_set_page_complete;
+alias extern (C) void * function(aGtkAssistant *, aGtkWidget *)TGTKgtk_assistant_get_page_side_image; extern(D) TGTKgtk_assistant_get_page_side_image gtk_assistant_get_page_side_image;
+alias extern (C) void function(aGtkAssistant *, aGtkWidget *, void *)TGTKgtk_assistant_set_page_side_image; extern(D) TGTKgtk_assistant_set_page_side_image gtk_assistant_set_page_side_image;
+alias extern (C) void * function(aGtkAssistant *, aGtkWidget *)TGTKgtk_assistant_get_page_header_image; extern(D) TGTKgtk_assistant_get_page_header_image gtk_assistant_get_page_header_image;
+alias extern (C) void function(aGtkAssistant *, aGtkWidget *, void *)TGTKgtk_assistant_set_page_header_image; extern(D) TGTKgtk_assistant_set_page_header_image gtk_assistant_set_page_header_image;
+alias extern (C) char * function(aGtkAssistant *, aGtkWidget *)TGTKgtk_assistant_get_page_title; extern(D) TGTKgtk_assistant_get_page_title gtk_assistant_get_page_title;
+alias extern (C) void function(aGtkAssistant *, aGtkWidget *, char *)TGTKgtk_assistant_set_page_title; extern(D) TGTKgtk_assistant_set_page_title gtk_assistant_set_page_title;
+alias extern (C) int function(aGtkAssistant *, aGtkWidget *)TGTKgtk_assistant_get_page_type; extern(D) TGTKgtk_assistant_get_page_type gtk_assistant_get_page_type;
+alias extern (C) void function(aGtkAssistant *, aGtkWidget *, int)TGTKgtk_assistant_set_page_type; extern(D) TGTKgtk_assistant_set_page_type gtk_assistant_set_page_type;
+alias extern (C) void function(aGtkAssistant *, _BCD_func__11971, void *, _BCD_func__13158)TGTKgtk_assistant_set_forward_page_func; extern(D) TGTKgtk_assistant_set_forward_page_func gtk_assistant_set_forward_page_func;
+alias extern (C) int function(aGtkAssistant *, aGtkWidget *, int)TGTKgtk_assistant_insert_page; extern(D) TGTKgtk_assistant_insert_page gtk_assistant_insert_page;
+alias extern (C) int function(aGtkAssistant *, aGtkWidget *)TGTKgtk_assistant_append_page; extern(D) TGTKgtk_assistant_append_page gtk_assistant_append_page;
+alias extern (C) int function(aGtkAssistant *, aGtkWidget *)TGTKgtk_assistant_prepend_page; extern(D) TGTKgtk_assistant_prepend_page gtk_assistant_prepend_page;
+alias extern (C) _GtkWidget * function(aGtkAssistant *, int)TGTKgtk_assistant_get_nth_page; extern(D) TGTKgtk_assistant_get_nth_page gtk_assistant_get_nth_page;
+alias extern (C) int function(aGtkAssistant *)TGTKgtk_assistant_get_n_pages; extern(D) TGTKgtk_assistant_get_n_pages gtk_assistant_get_n_pages;
+alias extern (C) void function(aGtkAssistant *, int)TGTKgtk_assistant_set_current_page; extern(D) TGTKgtk_assistant_set_current_page gtk_assistant_set_current_page;
+alias extern (C) int function(aGtkAssistant *)TGTKgtk_assistant_get_current_page; extern(D) TGTKgtk_assistant_get_current_page gtk_assistant_get_current_page;
+alias extern (C) _GtkWidget * function()TGTKgtk_assistant_new; extern(D) TGTKgtk_assistant_new gtk_assistant_new;
+alias extern (C) uint function()TGTKgtk_assistant_get_type; extern(D) TGTKgtk_assistant_get_type gtk_assistant_get_type;
+alias extern (C) void function(aGtkAspectFrame *, float, float, float, int)TGTKgtk_aspect_frame_set; extern(D) TGTKgtk_aspect_frame_set gtk_aspect_frame_set;
+alias extern (C) _GtkWidget * function(char *, float, float, float, int)TGTKgtk_aspect_frame_new; extern(D) TGTKgtk_aspect_frame_new gtk_aspect_frame_new;
+alias extern (C) uint function()TGTKgtk_aspect_frame_get_type; extern(D) TGTKgtk_aspect_frame_get_type gtk_aspect_frame_get_type;
+alias extern (C) int function(aGtkFrame *)TGTKgtk_frame_get_shadow_type; extern(D) TGTKgtk_frame_get_shadow_type gtk_frame_get_shadow_type;
+alias extern (C) void function(aGtkFrame *, int)TGTKgtk_frame_set_shadow_type; extern(D) TGTKgtk_frame_set_shadow_type gtk_frame_set_shadow_type;
+alias extern (C) void function(aGtkFrame *, float *, float *)TGTKgtk_frame_get_label_align; extern(D) TGTKgtk_frame_get_label_align gtk_frame_get_label_align;
+alias extern (C) void function(aGtkFrame *, float, float)TGTKgtk_frame_set_label_align; extern(D) TGTKgtk_frame_set_label_align gtk_frame_set_label_align;
+alias extern (C) _GtkWidget * function(aGtkFrame *)TGTKgtk_frame_get_label_widget; extern(D) TGTKgtk_frame_get_label_widget gtk_frame_get_label_widget;
+alias extern (C) void function(aGtkFrame *, aGtkWidget *)TGTKgtk_frame_set_label_widget; extern(D) TGTKgtk_frame_set_label_widget gtk_frame_set_label_widget;
+alias extern (C) char * function(aGtkFrame *)TGTKgtk_frame_get_label; extern(D) TGTKgtk_frame_get_label gtk_frame_get_label;
+alias extern (C) void function(aGtkFrame *, char *)TGTKgtk_frame_set_label; extern(D) TGTKgtk_frame_set_label gtk_frame_set_label;
+alias extern (C) _GtkWidget * function(char *)TGTKgtk_frame_new; extern(D) TGTKgtk_frame_new gtk_frame_new;
+alias extern (C) uint function()TGTKgtk_frame_get_type; extern(D) TGTKgtk_frame_get_type gtk_frame_get_type;
+alias extern (C) void function(aGtkArrow *, int, int)TGTKgtk_arrow_set; extern(D) TGTKgtk_arrow_set gtk_arrow_set;
+alias extern (C) _GtkWidget * function(int, int)TGTKgtk_arrow_new; extern(D) TGTKgtk_arrow_new gtk_arrow_new;
+alias extern (C) uint function()TGTKgtk_arrow_get_type; extern(D) TGTKgtk_arrow_get_type gtk_arrow_get_type;
+alias extern (C) void function(aGtkAlignment *, uint *, uint *, uint *, uint *)TGTKgtk_alignment_get_padding; extern(D) TGTKgtk_alignment_get_padding gtk_alignment_get_padding;
+alias extern (C) void function(aGtkAlignment *, uint, uint, uint, uint)TGTKgtk_alignment_set_padding; extern(D) TGTKgtk_alignment_set_padding gtk_alignment_set_padding;
+alias extern (C) void function(aGtkAlignment *, float, float, float, float)TGTKgtk_alignment_set; extern(D) TGTKgtk_alignment_set gtk_alignment_set;
+alias extern (C) _GtkWidget * function(float, float, float, float)TGTKgtk_alignment_new; extern(D) TGTKgtk_alignment_new gtk_alignment_new;
+alias extern (C) uint function()TGTKgtk_alignment_get_type; extern(D) TGTKgtk_alignment_get_type gtk_alignment_get_type;
+//alias extern (C) void function(aGtkActionGroup *, aGtkAction *)TGTK_gtk_action_group_emit_post_activate; extern(D) TGTK_gtk_action_group_emit_post_activate _gtk_action_group_emit_post_activate;
+//alias extern (C) void function(aGtkActionGroup *, aGtkAction *)TGTK_gtk_action_group_emit_pre_activate; extern(D) TGTK_gtk_action_group_emit_pre_activate _gtk_action_group_emit_pre_activate;
+//alias extern (C) void function(aGtkActionGroup *, aGtkAction *, aGtkWidget *)TGTK_gtk_action_group_emit_disconnect_proxy; extern(D) TGTK_gtk_action_group_emit_disconnect_proxy _gtk_action_group_emit_disconnect_proxy;
+//alias extern (C) void function(aGtkActionGroup *, aGtkAction *, aGtkWidget *)TGTK_gtk_action_group_emit_connect_proxy; extern(D) TGTK_gtk_action_group_emit_connect_proxy _gtk_action_group_emit_connect_proxy;
+alias extern (C) char * function(aGtkActionGroup *, char *)TGTKgtk_action_group_translate_string; extern(D) TGTKgtk_action_group_translate_string gtk_action_group_translate_string;
+alias extern (C) void function(aGtkActionGroup *, char *)TGTKgtk_action_group_set_translation_domain; extern(D) TGTKgtk_action_group_set_translation_domain gtk_action_group_set_translation_domain;
+alias extern (C) void function(aGtkActionGroup *, _BCD_func__12124, void *, _BCD_func__13158)TGTKgtk_action_group_set_translate_func; extern(D) TGTKgtk_action_group_set_translate_func gtk_action_group_set_translate_func;
+alias extern (C) void function(aGtkActionGroup *, aGtkRadioActionEntry *, uint, int, _BCD_func__12122, void *, _BCD_func__13158)TGTKgtk_action_group_add_radio_actions_full; extern(D) TGTKgtk_action_group_add_radio_actions_full gtk_action_group_add_radio_actions_full;
+alias extern (C) void function(aGtkActionGroup *, aGtkToggleActionEntry *, uint, void *, _BCD_func__13158)TGTKgtk_action_group_add_toggle_actions_full; extern(D) TGTKgtk_action_group_add_toggle_actions_full gtk_action_group_add_toggle_actions_full;
+alias extern (C) void function(aGtkActionGroup *, aGtkActionEntry *, uint, void *, _BCD_func__13158)TGTKgtk_action_group_add_actions_full; extern(D) TGTKgtk_action_group_add_actions_full gtk_action_group_add_actions_full;
+alias extern (C) void function(aGtkActionGroup *, aGtkRadioActionEntry *, uint, int, _BCD_func__12122, void *)TGTKgtk_action_group_add_radio_actions; extern(D) TGTKgtk_action_group_add_radio_actions gtk_action_group_add_radio_actions;
+alias extern (C) void function(aGtkActionGroup *, aGtkToggleActionEntry *, uint, void *)TGTKgtk_action_group_add_toggle_actions; extern(D) TGTKgtk_action_group_add_toggle_actions gtk_action_group_add_toggle_actions;
+alias extern (C) void function(aGtkActionGroup *, aGtkActionEntry *, uint, void *)TGTKgtk_action_group_add_actions; extern(D) TGTKgtk_action_group_add_actions gtk_action_group_add_actions;
+alias extern (C) void function(aGtkActionGroup *, aGtkAction *)TGTKgtk_action_group_remove_action; extern(D) TGTKgtk_action_group_remove_action gtk_action_group_remove_action;
+alias extern (C) void function(aGtkActionGroup *, aGtkAction *, char *)TGTKgtk_action_group_add_action_with_accel; extern(D) TGTKgtk_action_group_add_action_with_accel gtk_action_group_add_action_with_accel;
+alias extern (C) void function(aGtkActionGroup *, aGtkAction *)TGTKgtk_action_group_add_action; extern(D) TGTKgtk_action_group_add_action gtk_action_group_add_action;
+alias extern (C) _GList * function(aGtkActionGroup *)TGTKgtk_action_group_list_actions; extern(D) TGTKgtk_action_group_list_actions gtk_action_group_list_actions;
+alias extern (C) _GtkAction * function(aGtkActionGroup *, char *)TGTKgtk_action_group_get_action; extern(D) TGTKgtk_action_group_get_action gtk_action_group_get_action;
+alias extern (C) void function(aGtkActionGroup *, int)TGTKgtk_action_group_set_visible; extern(D) TGTKgtk_action_group_set_visible gtk_action_group_set_visible;
+alias extern (C) int function(aGtkActionGroup *)TGTKgtk_action_group_get_visible; extern(D) TGTKgtk_action_group_get_visible gtk_action_group_get_visible;
+alias extern (C) void function(aGtkActionGroup *, int)TGTKgtk_action_group_set_sensitive; extern(D) TGTKgtk_action_group_set_sensitive gtk_action_group_set_sensitive;
+alias extern (C) int function(aGtkActionGroup *)TGTKgtk_action_group_get_sensitive; extern(D) TGTKgtk_action_group_get_sensitive gtk_action_group_get_sensitive;
+alias extern (C) char * function(aGtkActionGroup *)TGTKgtk_action_group_get_name; extern(D) TGTKgtk_action_group_get_name gtk_action_group_get_name;
+alias extern (C) _GtkActionGroup * function(char *)TGTKgtk_action_group_new; extern(D) TGTKgtk_action_group_new gtk_action_group_new;
+alias extern (C) uint function()TGTKgtk_action_group_get_type; extern(D) TGTKgtk_action_group_get_type gtk_action_group_get_type;
+alias extern (C) void function(char *, char *)TGTKgtk_item_factories_path_delete; extern(D) TGTKgtk_item_factories_path_delete gtk_item_factories_path_delete;
+alias extern (C) void function(uint, GtkMenuEntry *)TGTKgtk_item_factory_create_menu_entries; extern(D) TGTKgtk_item_factory_create_menu_entries gtk_item_factory_create_menu_entries;
+alias extern (C) _GtkItemFactory * function(char *)TGTKgtk_item_factory_from_path; extern(D) TGTKgtk_item_factory_from_path gtk_item_factory_from_path;
+alias extern (C) void function(aGtkItemFactory *, uint, aGtkItemFactoryEntry *, void *, uint)TGTKgtk_item_factory_create_items_ac; extern(D) TGTKgtk_item_factory_create_items_ac gtk_item_factory_create_items_ac;
+alias extern (C) void function(aGtkItemFactory *, _BCD_func__12124, void *, _BCD_func__13158)TGTKgtk_item_factory_set_translate_func; extern(D) TGTKgtk_item_factory_set_translate_func gtk_item_factory_set_translate_func;
+alias extern (C) void * function(aGtkWidget *)TGTKgtk_item_factory_popup_data_from_widget; extern(D) TGTKgtk_item_factory_popup_data_from_widget gtk_item_factory_popup_data_from_widget;
+alias extern (C) void * function(aGtkItemFactory *)TGTKgtk_item_factory_popup_data; extern(D) TGTKgtk_item_factory_popup_data gtk_item_factory_popup_data;
+alias extern (C) void function(aGtkItemFactory *, void *, _BCD_func__13158, uint, uint, uint, uint)TGTKgtk_item_factory_popup_with_data; extern(D) TGTKgtk_item_factory_popup_with_data gtk_item_factory_popup_with_data;
+alias extern (C) void function(aGtkItemFactory *, uint, uint, uint, uint)TGTKgtk_item_factory_popup; extern(D) TGTKgtk_item_factory_popup gtk_item_factory_popup;
+alias extern (C) void function(aGtkItemFactory *, uint, aGtkItemFactoryEntry *)TGTKgtk_item_factory_delete_entries; extern(D) TGTKgtk_item_factory_delete_entries gtk_item_factory_delete_entries;
+alias extern (C) void function(aGtkItemFactory *, aGtkItemFactoryEntry *)TGTKgtk_item_factory_delete_entry; extern(D) TGTKgtk_item_factory_delete_entry gtk_item_factory_delete_entry;
+alias extern (C) void function(aGtkItemFactory *, char *)TGTKgtk_item_factory_delete_item; extern(D) TGTKgtk_item_factory_delete_item gtk_item_factory_delete_item;
+alias extern (C) void function(aGtkItemFactory *, uint, aGtkItemFactoryEntry *, void *)TGTKgtk_item_factory_create_items; extern(D) TGTKgtk_item_factory_create_items gtk_item_factory_create_items;
+alias extern (C) void function(aGtkItemFactory *, aGtkItemFactoryEntry *, void *, uint)TGTKgtk_item_factory_create_item; extern(D) TGTKgtk_item_factory_create_item gtk_item_factory_create_item;
+alias extern (C) _GtkWidget * function(aGtkItemFactory *, uint)TGTKgtk_item_factory_get_item_by_action; extern(D) TGTKgtk_item_factory_get_item_by_action gtk_item_factory_get_item_by_action;
+alias extern (C) _GtkWidget * function(aGtkItemFactory *, uint)TGTKgtk_item_factory_get_widget_by_action; extern(D) TGTKgtk_item_factory_get_widget_by_action gtk_item_factory_get_widget_by_action;
+alias extern (C) _GtkWidget * function(aGtkItemFactory *, char *)TGTKgtk_item_factory_get_widget; extern(D) TGTKgtk_item_factory_get_widget gtk_item_factory_get_widget;
+alias extern (C) _GtkWidget * function(aGtkItemFactory *, char *)TGTKgtk_item_factory_get_item; extern(D) TGTKgtk_item_factory_get_item gtk_item_factory_get_item;
+alias extern (C) char * function(aGtkWidget *)TGTKgtk_item_factory_path_from_widget; extern(D) TGTKgtk_item_factory_path_from_widget gtk_item_factory_path_from_widget;
+alias extern (C) _GtkItemFactory * function(aGtkWidget *)TGTKgtk_item_factory_from_widget; extern(D) TGTKgtk_item_factory_from_widget gtk_item_factory_from_widget;
+alias extern (C) void function(aGtkWidget *, char *, aGtkAccelGroup *, uint, int)TGTKgtk_item_factory_add_foreign; extern(D) TGTKgtk_item_factory_add_foreign gtk_item_factory_add_foreign;
+alias extern (C) void function(aGtkItemFactory *, uint, char *, aGtkAccelGroup *)TGTKgtk_item_factory_construct; extern(D) TGTKgtk_item_factory_construct gtk_item_factory_construct;
+alias extern (C) _GtkItemFactory * function(uint, char *, aGtkAccelGroup *)TGTKgtk_item_factory_new; extern(D) TGTKgtk_item_factory_new gtk_item_factory_new;
+alias extern (C) uint function()TGTKgtk_item_factory_get_type; extern(D) TGTKgtk_item_factory_get_type gtk_item_factory_get_type;
+//alias extern (C) void function(aGtkAction *, aGtkWidget *, int)TGTK_gtk_action_sync_menu_visible; extern(D) TGTK_gtk_action_sync_menu_visible _gtk_action_sync_menu_visible;
+//alias extern (C) void function(aGtkAction *)TGTK_gtk_action_sync_visible; extern(D) TGTK_gtk_action_sync_visible _gtk_action_sync_visible;
+//alias extern (C) void function(aGtkAction *)TGTK_gtk_action_sync_sensitive; extern(D) TGTK_gtk_action_sync_sensitive _gtk_action_sync_sensitive;
+alias extern (C) void function(aGtkAction *, aGtkAccelGroup *)TGTKgtk_action_set_accel_group; extern(D) TGTKgtk_action_set_accel_group gtk_action_set_accel_group;
+alias extern (C) void function(aGtkAction *, char *)TGTKgtk_action_set_accel_path; extern(D) TGTKgtk_action_set_accel_path gtk_action_set_accel_path;
+//alias extern (C) void function(aGtkAction *)TGTK_gtk_action_emit_activate; extern(D) TGTK_gtk_action_emit_activate _gtk_action_emit_activate;
+alias extern (C) void function(aGtkAction *, aGtkWidget *)TGTKgtk_action_unblock_activate_from; extern(D) TGTKgtk_action_unblock_activate_from gtk_action_unblock_activate_from;
+alias extern (C) void function(aGtkAction *, aGtkWidget *)TGTKgtk_action_block_activate_from; extern(D) TGTKgtk_action_block_activate_from gtk_action_block_activate_from;
+alias extern (C) _GClosure * function(aGtkAction *)TGTKgtk_action_get_accel_closure; extern(D) TGTKgtk_action_get_accel_closure gtk_action_get_accel_closure;
+alias extern (C) char * function(aGtkAction *)TGTKgtk_action_get_accel_path; extern(D) TGTKgtk_action_get_accel_path gtk_action_get_accel_path;
+alias extern (C) void function(aGtkAction *)TGTKgtk_action_disconnect_accelerator; extern(D) TGTKgtk_action_disconnect_accelerator gtk_action_disconnect_accelerator;
+alias extern (C) void function(aGtkAction *)TGTKgtk_action_connect_accelerator; extern(D) TGTKgtk_action_connect_accelerator gtk_action_connect_accelerator;
+alias extern (C) _GtkAction * function(aGtkWidget *)TGTKgtk_widget_get_action; extern(D) TGTKgtk_widget_get_action gtk_widget_get_action;
+alias extern (C) _GSList * function(aGtkAction *)TGTKgtk_action_get_proxies; extern(D) TGTKgtk_action_get_proxies gtk_action_get_proxies;
+alias extern (C) void function(aGtkAction *, aGtkWidget *)TGTKgtk_action_disconnect_proxy; extern(D) TGTKgtk_action_disconnect_proxy gtk_action_disconnect_proxy;
+alias extern (C) void function(aGtkAction *, aGtkWidget *)TGTKgtk_action_connect_proxy; extern(D) TGTKgtk_action_connect_proxy gtk_action_connect_proxy;
+alias extern (C) _GtkWidget * function(aGtkAction *)TGTKgtk_action_create_menu; extern(D) TGTKgtk_action_create_menu gtk_action_create_menu;
+alias extern (C) _GtkWidget * function(aGtkAction *)TGTKgtk_action_create_tool_item; extern(D) TGTKgtk_action_create_tool_item gtk_action_create_tool_item;
+alias extern (C) _GtkWidget * function(aGtkAction *)TGTKgtk_action_create_menu_item; extern(D) TGTKgtk_action_create_menu_item gtk_action_create_menu_item;
+alias extern (C) _GtkWidget * function(aGtkAction *, int)TGTKgtk_action_create_icon; extern(D) TGTKgtk_action_create_icon gtk_action_create_icon;
+alias extern (C) void function(aGtkAction *)TGTKgtk_action_activate; extern(D) TGTKgtk_action_activate gtk_action_activate;
+alias extern (C) void function(aGtkAction *, int)TGTKgtk_action_set_visible; extern(D) TGTKgtk_action_set_visible gtk_action_set_visible;
+alias extern (C) int function(aGtkAction *)TGTKgtk_action_get_visible; extern(D) TGTKgtk_action_get_visible gtk_action_get_visible;
+alias extern (C) int function(aGtkAction *)TGTKgtk_action_is_visible; extern(D) TGTKgtk_action_is_visible gtk_action_is_visible;
+alias extern (C) void function(aGtkAction *, int)TGTKgtk_action_set_sensitive; extern(D) TGTKgtk_action_set_sensitive gtk_action_set_sensitive;
+alias extern (C) int function(aGtkAction *)TGTKgtk_action_get_sensitive; extern(D) TGTKgtk_action_get_sensitive gtk_action_get_sensitive;
+alias extern (C) int function(aGtkAction *)TGTKgtk_action_is_sensitive; extern(D) TGTKgtk_action_is_sensitive gtk_action_is_sensitive;
+alias extern (C) char * function(aGtkAction *)TGTKgtk_action_get_name; extern(D) TGTKgtk_action_get_name gtk_action_get_name;
+alias extern (C) _GtkAction * function(char *, char *, char *, char *)TGTKgtk_action_new; extern(D) TGTKgtk_action_new gtk_action_new;
+alias extern (C) uint function()TGTKgtk_action_get_type; extern(D) TGTKgtk_action_get_type gtk_action_get_type;
+alias extern (C) void function(aGtkAccessible *)TGTKgtk_accessible_connect_widget_destroyed; extern(D) TGTKgtk_accessible_connect_widget_destroyed gtk_accessible_connect_widget_destroyed;
+alias extern (C) uint function()TGTKgtk_accessible_get_type; extern(D) TGTKgtk_accessible_get_type gtk_accessible_get_type;
+//alias extern (C) int function(char *)TGTK_gtk_accel_path_is_valid; extern(D) TGTK_gtk_accel_path_is_valid _gtk_accel_path_is_valid;
+//alias extern (C) void function(char *, aGtkAccelGroup *)TGTK_gtk_accel_map_remove_group; extern(D) TGTK_gtk_accel_map_remove_group _gtk_accel_map_remove_group;
+//alias extern (C) void function(char *, aGtkAccelGroup *)TGTK_gtk_accel_map_add_group; extern(D) TGTK_gtk_accel_map_add_group _gtk_accel_map_add_group;
+//alias extern (C) void function()TGTK_gtk_accel_map_init; extern(D) TGTK_gtk_accel_map_init _gtk_accel_map_init;
+alias extern (C) void * function()TGTKgtk_accel_map_get; extern(D) TGTKgtk_accel_map_get gtk_accel_map_get;
+alias extern (C) uint function()TGTKgtk_accel_map_get_type; extern(D) TGTKgtk_accel_map_get_type gtk_accel_map_get_type;
+alias extern (C) void function(void *, _BCD_func__12490)TGTKgtk_accel_map_foreach_unfiltered; extern(D) TGTKgtk_accel_map_foreach_unfiltered gtk_accel_map_foreach_unfiltered;
+alias extern (C) void function(char *)TGTKgtk_accel_map_add_filter; extern(D) TGTKgtk_accel_map_add_filter gtk_accel_map_add_filter;
+alias extern (C) void function(char *)TGTKgtk_accel_map_unlock_path; extern(D) TGTKgtk_accel_map_unlock_path gtk_accel_map_unlock_path;
+alias extern (C) void function(char *)TGTKgtk_accel_map_lock_path; extern(D) TGTKgtk_accel_map_lock_path gtk_accel_map_lock_path;
+alias extern (C) void function(int)TGTKgtk_accel_map_save_fd; extern(D) TGTKgtk_accel_map_save_fd gtk_accel_map_save_fd;
+alias extern (C) void function(_GScanner *)TGTKgtk_accel_map_load_scanner; extern(D) TGTKgtk_accel_map_load_scanner gtk_accel_map_load_scanner;
+alias extern (C) void function(int)TGTKgtk_accel_map_load_fd; extern(D) TGTKgtk_accel_map_load_fd gtk_accel_map_load_fd;
+alias extern (C) void function(void *, _BCD_func__12490)TGTKgtk_accel_map_foreach; extern(D) TGTKgtk_accel_map_foreach gtk_accel_map_foreach;
+alias extern (C) void function(char *)TGTKgtk_accel_map_save; extern(D) TGTKgtk_accel_map_save gtk_accel_map_save;
+alias extern (C) void function(char *)TGTKgtk_accel_map_load; extern(D) TGTKgtk_accel_map_load gtk_accel_map_load;
+alias extern (C) int function(char *, uint, int, int)TGTKgtk_accel_map_change_entry; extern(D) TGTKgtk_accel_map_change_entry gtk_accel_map_change_entry;
+alias extern (C) int function(char *, aGtkAccelKey *)TGTKgtk_accel_map_lookup_entry; extern(D) TGTKgtk_accel_map_lookup_entry gtk_accel_map_lookup_entry;
+alias extern (C) void function(char *, uint, int)TGTKgtk_accel_map_add_entry; extern(D) TGTKgtk_accel_map_add_entry gtk_accel_map_add_entry;
+//alias extern (C) char * function(aGtkAccelLabelClass *, uint, int)TGTK_gtk_accel_label_class_get_accelerator_label; extern(D) TGTK_gtk_accel_label_class_get_accelerator_label _gtk_accel_label_class_get_accelerator_label;
+alias extern (C) int function(aGtkAccelLabel *)TGTKgtk_accel_label_refetch; extern(D) TGTKgtk_accel_label_refetch gtk_accel_label_refetch;
+alias extern (C) void function(aGtkAccelLabel *, _GClosure *)TGTKgtk_accel_label_set_accel_closure; extern(D) TGTKgtk_accel_label_set_accel_closure gtk_accel_label_set_accel_closure;
+alias extern (C) void function(aGtkAccelLabel *, aGtkWidget *)TGTKgtk_accel_label_set_accel_widget; extern(D) TGTKgtk_accel_label_set_accel_widget gtk_accel_label_set_accel_widget;
+alias extern (C) uint function(aGtkAccelLabel *)TGTKgtk_accel_label_get_accel_width; extern(D) TGTKgtk_accel_label_get_accel_width gtk_accel_label_get_accel_width;
+alias extern (C) _GtkWidget * function(aGtkAccelLabel *)TGTKgtk_accel_label_get_accel_widget; extern(D) TGTKgtk_accel_label_get_accel_widget gtk_accel_label_get_accel_widget;
+alias extern (C) _GtkWidget * function(char *)TGTKgtk_accel_label_new; extern(D) TGTKgtk_accel_label_new gtk_accel_label_new;
+alias extern (C) uint function()TGTKgtk_accel_label_get_type; extern(D) TGTKgtk_accel_label_get_type gtk_accel_label_get_type;
+alias extern (C) uint function(aGtkLabel *, char *)TGTKgtk_label_parse_uline; extern(D) TGTKgtk_label_parse_uline gtk_label_parse_uline;
+alias extern (C) void function(aGtkLabel *, char * *)TGTKgtk_label_get; extern(D) TGTKgtk_label_get gtk_label_get;
+alias extern (C) int function(aGtkLabel *)TGTKgtk_label_get_single_line_mode; extern(D) TGTKgtk_label_get_single_line_mode gtk_label_get_single_line_mode;
+alias extern (C) void function(aGtkLabel *, int)TGTKgtk_label_set_single_line_mode; extern(D) TGTKgtk_label_set_single_line_mode gtk_label_set_single_line_mode;
+alias extern (C) void function(aGtkLabel *, int *, int *)TGTKgtk_label_get_layout_offsets; extern(D) TGTKgtk_label_get_layout_offsets gtk_label_get_layout_offsets;
+alias extern (C) void * function(aGtkLabel *)TGTKgtk_label_get_layout; extern(D) TGTKgtk_label_get_layout gtk_label_get_layout;
+alias extern (C) int function(aGtkLabel *, int *, int *)TGTKgtk_label_get_selection_bounds; extern(D) TGTKgtk_label_get_selection_bounds gtk_label_get_selection_bounds;
+alias extern (C) void function(aGtkLabel *, int, int)TGTKgtk_label_select_region; extern(D) TGTKgtk_label_select_region gtk_label_select_region;
+alias extern (C) double function(aGtkLabel *)TGTKgtk_label_get_angle; extern(D) TGTKgtk_label_get_angle gtk_label_get_angle;
+alias extern (C) void function(aGtkLabel *, double)TGTKgtk_label_set_angle; extern(D) TGTKgtk_label_set_angle gtk_label_set_angle;
+alias extern (C) int function(aGtkLabel *)TGTKgtk_label_get_selectable; extern(D) TGTKgtk_label_get_selectable gtk_label_get_selectable;
+alias extern (C) void function(aGtkLabel *, int)TGTKgtk_label_set_selectable; extern(D) TGTKgtk_label_set_selectable gtk_label_set_selectable;
+alias extern (C) int function(aGtkLabel *)TGTKgtk_label_get_line_wrap_mode; extern(D) TGTKgtk_label_get_line_wrap_mode gtk_label_get_line_wrap_mode;
+alias extern (C) void function(aGtkLabel *, int)TGTKgtk_label_set_line_wrap_mode; extern(D) TGTKgtk_label_set_line_wrap_mode gtk_label_set_line_wrap_mode;
+alias extern (C) int function(aGtkLabel *)TGTKgtk_label_get_line_wrap; extern(D) TGTKgtk_label_get_line_wrap gtk_label_get_line_wrap;
+alias extern (C) void function(aGtkLabel *, int)TGTKgtk_label_set_line_wrap; extern(D) TGTKgtk_label_set_line_wrap gtk_label_set_line_wrap;
+alias extern (C) void function(aGtkLabel *, char *)TGTKgtk_label_set_pattern; extern(D) TGTKgtk_label_set_pattern gtk_label_set_pattern;
+alias extern (C) int function(aGtkLabel *)TGTKgtk_label_get_max_width_chars; extern(D) TGTKgtk_label_get_max_width_chars gtk_label_get_max_width_chars;
+alias extern (C) void function(aGtkLabel *, int)TGTKgtk_label_set_max_width_chars; extern(D) TGTKgtk_label_set_max_width_chars gtk_label_set_max_width_chars;
+alias extern (C) int function(aGtkLabel *)TGTKgtk_label_get_width_chars; extern(D) TGTKgtk_label_get_width_chars gtk_label_get_width_chars;
+alias extern (C) void function(aGtkLabel *, int)TGTKgtk_label_set_width_chars; extern(D) TGTKgtk_label_set_width_chars gtk_label_set_width_chars;
+alias extern (C) int function(aGtkLabel *)TGTKgtk_label_get_ellipsize; extern(D) TGTKgtk_label_get_ellipsize gtk_label_get_ellipsize;
+alias extern (C) void function(aGtkLabel *, int)TGTKgtk_label_set_ellipsize; extern(D) TGTKgtk_label_set_ellipsize gtk_label_set_ellipsize;
+alias extern (C) int function(aGtkLabel *)TGTKgtk_label_get_justify; extern(D) TGTKgtk_label_get_justify gtk_label_get_justify;
+alias extern (C) void function(aGtkLabel *, int)TGTKgtk_label_set_justify; extern(D) TGTKgtk_label_set_justify gtk_label_set_justify;
+alias extern (C) void function(aGtkLabel *, char *)TGTKgtk_label_set_text_with_mnemonic; extern(D) TGTKgtk_label_set_text_with_mnemonic gtk_label_set_text_with_mnemonic;
+alias extern (C) _GtkWidget * function(aGtkLabel *)TGTKgtk_label_get_mnemonic_widget; extern(D) TGTKgtk_label_get_mnemonic_widget gtk_label_get_mnemonic_widget;
+alias extern (C) void function(aGtkLabel *, aGtkWidget *)TGTKgtk_label_set_mnemonic_widget; extern(D) TGTKgtk_label_set_mnemonic_widget gtk_label_set_mnemonic_widget;
+alias extern (C) uint function(aGtkLabel *)TGTKgtk_label_get_mnemonic_keyval; extern(D) TGTKgtk_label_get_mnemonic_keyval gtk_label_get_mnemonic_keyval;
+alias extern (C) void function(aGtkLabel *, char *)TGTKgtk_label_set_markup_with_mnemonic; extern(D) TGTKgtk_label_set_markup_with_mnemonic gtk_label_set_markup_with_mnemonic;
+alias extern (C) int function(aGtkLabel *)TGTKgtk_label_get_use_underline; extern(D) TGTKgtk_label_get_use_underline gtk_label_get_use_underline;
+alias extern (C) void function(aGtkLabel *, int)TGTKgtk_label_set_use_underline; extern(D) TGTKgtk_label_set_use_underline gtk_label_set_use_underline;
+alias extern (C) int function(aGtkLabel *)TGTKgtk_label_get_use_markup; extern(D) TGTKgtk_label_get_use_markup gtk_label_get_use_markup;
+alias extern (C) void function(aGtkLabel *, int)TGTKgtk_label_set_use_markup; extern(D) TGTKgtk_label_set_use_markup gtk_label_set_use_markup;
+alias extern (C) void function(aGtkLabel *, char *)TGTKgtk_label_set_markup; extern(D) TGTKgtk_label_set_markup gtk_label_set_markup;
+alias extern (C) char * function(aGtkLabel *)TGTKgtk_label_get_label; extern(D) TGTKgtk_label_get_label gtk_label_get_label;
+alias extern (C) void function(aGtkLabel *, char *)TGTKgtk_label_set_label; extern(D) TGTKgtk_label_set_label gtk_label_set_label;
+alias extern (C) void * function(aGtkLabel *)TGTKgtk_label_get_attributes; extern(D) TGTKgtk_label_get_attributes gtk_label_get_attributes;
+alias extern (C) void function(aGtkLabel *, void *)TGTKgtk_label_set_attributes; extern(D) TGTKgtk_label_set_attributes gtk_label_set_attributes;
+alias extern (C) char * function(aGtkLabel *)TGTKgtk_label_get_text; extern(D) TGTKgtk_label_get_text gtk_label_get_text;
+alias extern (C) void function(aGtkLabel *, char *)TGTKgtk_label_set_text; extern(D) TGTKgtk_label_set_text gtk_label_set_text;
+alias extern (C) _GtkWidget * function(char *)TGTKgtk_label_new_with_mnemonic; extern(D) TGTKgtk_label_new_with_mnemonic gtk_label_new_with_mnemonic;
+alias extern (C) _GtkWidget * function(char *)TGTKgtk_label_new; extern(D) TGTKgtk_label_new gtk_label_new;
+alias extern (C) uint function()TGTKgtk_label_get_type; extern(D) TGTKgtk_label_get_type gtk_label_get_type;
+alias extern (C) _GList * function(aGtkWidget *)TGTKgtk_menu_get_for_attach_widget; extern(D) TGTKgtk_menu_get_for_attach_widget gtk_menu_get_for_attach_widget;
+alias extern (C) void function(aGtkMenu *, int)TGTKgtk_menu_set_monitor; extern(D) TGTKgtk_menu_set_monitor gtk_menu_set_monitor;
+alias extern (C) void function(aGtkMenu *, aGtkWidget *, uint, uint, uint, uint)TGTKgtk_menu_attach; extern(D) TGTKgtk_menu_attach gtk_menu_attach;
+alias extern (C) void function(aGtkMenu *, _GdkScreen *)TGTKgtk_menu_set_screen; extern(D) TGTKgtk_menu_set_screen gtk_menu_set_screen;
+alias extern (C) void function(aGtkMenu *, aGtkWidget *, int)TGTKgtk_menu_reorder_child; extern(D) TGTKgtk_menu_reorder_child gtk_menu_reorder_child;
+alias extern (C) char * function(aGtkMenu *)TGTKgtk_menu_get_title; extern(D) TGTKgtk_menu_get_title gtk_menu_get_title;
+alias extern (C) void function(aGtkMenu *, char *)TGTKgtk_menu_set_title; extern(D) TGTKgtk_menu_set_title gtk_menu_set_title;
+alias extern (C) int function(aGtkMenu *)TGTKgtk_menu_get_tearoff_state; extern(D) TGTKgtk_menu_get_tearoff_state gtk_menu_get_tearoff_state;
+alias extern (C) void function(aGtkMenu *, int)TGTKgtk_menu_set_tearoff_state; extern(D) TGTKgtk_menu_set_tearoff_state gtk_menu_set_tearoff_state;
+alias extern (C) _GtkWidget * function(aGtkMenu *)TGTKgtk_menu_get_attach_widget; extern(D) TGTKgtk_menu_get_attach_widget gtk_menu_get_attach_widget;
+alias extern (C) void function(aGtkMenu *)TGTKgtk_menu_detach; extern(D) TGTKgtk_menu_detach gtk_menu_detach;
+alias extern (C) void function(aGtkMenu *, aGtkWidget *, _BCD_func__12552)TGTKgtk_menu_attach_to_widget; extern(D) TGTKgtk_menu_attach_to_widget gtk_menu_attach_to_widget;
+alias extern (C) void function(aGtkMenu *, char *)TGTKgtk_menu_set_accel_path; extern(D) TGTKgtk_menu_set_accel_path gtk_menu_set_accel_path;
+alias extern (C) _GtkAccelGroup * function(aGtkMenu *)TGTKgtk_menu_get_accel_group; extern(D) TGTKgtk_menu_get_accel_group gtk_menu_get_accel_group;
+alias extern (C) void function(aGtkMenu *, aGtkAccelGroup *)TGTKgtk_menu_set_accel_group; extern(D) TGTKgtk_menu_set_accel_group gtk_menu_set_accel_group;
+alias extern (C) void function(aGtkMenu *, uint)TGTKgtk_menu_set_active; extern(D) TGTKgtk_menu_set_active gtk_menu_set_active;
+alias extern (C) _GtkWidget * function(aGtkMenu *)TGTKgtk_menu_get_active; extern(D) TGTKgtk_menu_get_active gtk_menu_get_active;
+alias extern (C) void function(aGtkMenu *)TGTKgtk_menu_popdown; extern(D) TGTKgtk_menu_popdown gtk_menu_popdown;
+alias extern (C) void function(aGtkMenu *)TGTKgtk_menu_reposition; extern(D) TGTKgtk_menu_reposition gtk_menu_reposition;
+alias extern (C) void function(aGtkMenu *, aGtkWidget *, aGtkWidget *, _BCD_func__12553, void *, uint, uint)TGTKgtk_menu_popup; extern(D) TGTKgtk_menu_popup gtk_menu_popup;
+alias extern (C) _GtkWidget * function()TGTKgtk_menu_new; extern(D) TGTKgtk_menu_new gtk_menu_new;
+alias extern (C) uint function()TGTKgtk_menu_get_type; extern(D) TGTKgtk_menu_get_type gtk_menu_get_type;
+alias extern (C) void function(aGtkMenuShell *, int)TGTKgtk_menu_shell_set_take_focus; extern(D) TGTKgtk_menu_shell_set_take_focus gtk_menu_shell_set_take_focus;
+alias extern (C) int function(aGtkMenuShell *)TGTKgtk_menu_shell_get_take_focus; extern(D) TGTKgtk_menu_shell_get_take_focus gtk_menu_shell_get_take_focus;
+//alias extern (C) void function(aGtkMenuShell *, uint, aGtkWidget *)TGTK_gtk_menu_shell_remove_mnemonic; extern(D) TGTK_gtk_menu_shell_remove_mnemonic _gtk_menu_shell_remove_mnemonic;
+//alias extern (C) void function(aGtkMenuShell *, uint, aGtkWidget *)TGTK_gtk_menu_shell_add_mnemonic; extern(D) TGTK_gtk_menu_shell_add_mnemonic _gtk_menu_shell_add_mnemonic;
+alias extern (C) void function(aGtkMenuShell *)TGTKgtk_menu_shell_cancel; extern(D) TGTKgtk_menu_shell_cancel gtk_menu_shell_cancel;
+//alias extern (C) int function(aGtkMenuShell *)TGTK_gtk_menu_shell_get_popup_delay; extern(D) TGTK_gtk_menu_shell_get_popup_delay _gtk_menu_shell_get_popup_delay;
+//alias extern (C) void function(aGtkMenuShell *)TGTK_gtk_menu_shell_activate; extern(D) TGTK_gtk_menu_shell_activate _gtk_menu_shell_activate;
+//alias extern (C) void function(aGtkMenuShell *, int)TGTK_gtk_menu_shell_select_last; extern(D) TGTK_gtk_menu_shell_select_last _gtk_menu_shell_select_last;
+alias extern (C) void function(aGtkMenuShell *, int)TGTKgtk_menu_shell_select_first; extern(D) TGTKgtk_menu_shell_select_first gtk_menu_shell_select_first;
+alias extern (C) void function(aGtkMenuShell *, aGtkWidget *, int)TGTKgtk_menu_shell_activate_item; extern(D) TGTKgtk_menu_shell_activate_item gtk_menu_shell_activate_item;
+alias extern (C) void function(aGtkMenuShell *)TGTKgtk_menu_shell_deselect; extern(D) TGTKgtk_menu_shell_deselect gtk_menu_shell_deselect;
+alias extern (C) void function(aGtkMenuShell *, aGtkWidget *)TGTKgtk_menu_shell_select_item; extern(D) TGTKgtk_menu_shell_select_item gtk_menu_shell_select_item;
+alias extern (C) void function(aGtkMenuShell *)TGTKgtk_menu_shell_deactivate; extern(D) TGTKgtk_menu_shell_deactivate gtk_menu_shell_deactivate;
+alias extern (C) void function(aGtkMenuShell *, aGtkWidget *, int)TGTKgtk_menu_shell_insert; extern(D) TGTKgtk_menu_shell_insert gtk_menu_shell_insert;
+alias extern (C) void function(aGtkMenuShell *, aGtkWidget *)TGTKgtk_menu_shell_prepend; extern(D) TGTKgtk_menu_shell_prepend gtk_menu_shell_prepend;
+alias extern (C) void function(aGtkMenuShell *, aGtkWidget *)TGTKgtk_menu_shell_append; extern(D) TGTKgtk_menu_shell_append gtk_menu_shell_append;
+alias extern (C) uint function()TGTKgtk_menu_shell_get_type; extern(D) TGTKgtk_menu_shell_get_type gtk_menu_shell_get_type;
+alias extern (C) void function(aGtkMisc *, int *, int *)TGTKgtk_misc_get_padding; extern(D) TGTKgtk_misc_get_padding gtk_misc_get_padding;
+alias extern (C) void function(aGtkMisc *, int, int)TGTKgtk_misc_set_padding; extern(D) TGTKgtk_misc_set_padding gtk_misc_set_padding;
+alias extern (C) void function(aGtkMisc *, float *, float *)TGTKgtk_misc_get_alignment; extern(D) TGTKgtk_misc_get_alignment gtk_misc_get_alignment;
+alias extern (C) void function(aGtkMisc *, float, float)TGTKgtk_misc_set_alignment; extern(D) TGTKgtk_misc_set_alignment gtk_misc_set_alignment;
+alias extern (C) uint function()TGTKgtk_misc_get_type; extern(D) TGTKgtk_misc_get_type gtk_misc_get_type;
+alias extern (C) _BCD_func__12632 function(_BCD_func__12632, void *, _BCD_func__13158)TGTKgtk_about_dialog_set_url_hook; extern(D) TGTKgtk_about_dialog_set_url_hook gtk_about_dialog_set_url_hook;
+alias extern (C) _BCD_func__12632 function(_BCD_func__12632, void *, _BCD_func__13158)TGTKgtk_about_dialog_set_email_hook; extern(D) TGTKgtk_about_dialog_set_email_hook gtk_about_dialog_set_email_hook;
+alias extern (C) void function(aGtkAboutDialog *, char *)TGTKgtk_about_dialog_set_logo_icon_name; extern(D) TGTKgtk_about_dialog_set_logo_icon_name gtk_about_dialog_set_logo_icon_name;
+alias extern (C) char * function(aGtkAboutDialog *)TGTKgtk_about_dialog_get_logo_icon_name; extern(D) TGTKgtk_about_dialog_get_logo_icon_name gtk_about_dialog_get_logo_icon_name;
+alias extern (C) void function(aGtkAboutDialog *, void *)TGTKgtk_about_dialog_set_logo; extern(D) TGTKgtk_about_dialog_set_logo gtk_about_dialog_set_logo;
+alias extern (C) void * function(aGtkAboutDialog *)TGTKgtk_about_dialog_get_logo; extern(D) TGTKgtk_about_dialog_get_logo gtk_about_dialog_get_logo;
+alias extern (C) void function(aGtkAboutDialog *, char *)TGTKgtk_about_dialog_set_translator_credits; extern(D) TGTKgtk_about_dialog_set_translator_credits gtk_about_dialog_set_translator_credits;
+alias extern (C) char * function(aGtkAboutDialog *)TGTKgtk_about_dialog_get_translator_credits; extern(D) TGTKgtk_about_dialog_get_translator_credits gtk_about_dialog_get_translator_credits;
+alias extern (C) void function(aGtkAboutDialog *, char * *)TGTKgtk_about_dialog_set_artists; extern(D) TGTKgtk_about_dialog_set_artists gtk_about_dialog_set_artists;
+alias extern (C) char * * function(aGtkAboutDialog *)TGTKgtk_about_dialog_get_artists; extern(D) TGTKgtk_about_dialog_get_artists gtk_about_dialog_get_artists;
+alias extern (C) void function(aGtkAboutDialog *, char * *)TGTKgtk_about_dialog_set_documenters; extern(D) TGTKgtk_about_dialog_set_documenters gtk_about_dialog_set_documenters;
+alias extern (C) char * * function(aGtkAboutDialog *)TGTKgtk_about_dialog_get_documenters; extern(D) TGTKgtk_about_dialog_get_documenters gtk_about_dialog_get_documenters;
+alias extern (C) void function(aGtkAboutDialog *, char * *)TGTKgtk_about_dialog_set_authors; extern(D) TGTKgtk_about_dialog_set_authors gtk_about_dialog_set_authors;
+alias extern (C) char * * function(aGtkAboutDialog *)TGTKgtk_about_dialog_get_authors; extern(D) TGTKgtk_about_dialog_get_authors gtk_about_dialog_get_authors;
+alias extern (C) void function(aGtkAboutDialog *, char *)TGTKgtk_about_dialog_set_website_label; extern(D) TGTKgtk_about_dialog_set_website_label gtk_about_dialog_set_website_label;
+alias extern (C) char * function(aGtkAboutDialog *)TGTKgtk_about_dialog_get_website_label; extern(D) TGTKgtk_about_dialog_get_website_label gtk_about_dialog_get_website_label;
+alias extern (C) void function(aGtkAboutDialog *, char *)TGTKgtk_about_dialog_set_website; extern(D) TGTKgtk_about_dialog_set_website gtk_about_dialog_set_website;
+alias extern (C) char * function(aGtkAboutDialog *)TGTKgtk_about_dialog_get_website; extern(D) TGTKgtk_about_dialog_get_website gtk_about_dialog_get_website;
+alias extern (C) void function(aGtkAboutDialog *, int)TGTKgtk_about_dialog_set_wrap_license; extern(D) TGTKgtk_about_dialog_set_wrap_license gtk_about_dialog_set_wrap_license;
+alias extern (C) int function(aGtkAboutDialog *)TGTKgtk_about_dialog_get_wrap_license; extern(D) TGTKgtk_about_dialog_get_wrap_license gtk_about_dialog_get_wrap_license;
+alias extern (C) void function(aGtkAboutDialog *, char *)TGTKgtk_about_dialog_set_license; extern(D) TGTKgtk_about_dialog_set_license gtk_about_dialog_set_license;
+alias extern (C) char * function(aGtkAboutDialog *)TGTKgtk_about_dialog_get_license; extern(D) TGTKgtk_about_dialog_get_license gtk_about_dialog_get_license;
+alias extern (C) void function(aGtkAboutDialog *, char *)TGTKgtk_about_dialog_set_comments; extern(D) TGTKgtk_about_dialog_set_comments gtk_about_dialog_set_comments;
+alias extern (C) char * function(aGtkAboutDialog *)TGTKgtk_about_dialog_get_comments; extern(D) TGTKgtk_about_dialog_get_comments gtk_about_dialog_get_comments;
+alias extern (C) void function(aGtkAboutDialog *, char *)TGTKgtk_about_dialog_set_copyright; extern(D) TGTKgtk_about_dialog_set_copyright gtk_about_dialog_set_copyright;
+alias extern (C) char * function(aGtkAboutDialog *)TGTKgtk_about_dialog_get_copyright; extern(D) TGTKgtk_about_dialog_get_copyright gtk_about_dialog_get_copyright;
+alias extern (C) void function(aGtkAboutDialog *, char *)TGTKgtk_about_dialog_set_version; extern(D) TGTKgtk_about_dialog_set_version gtk_about_dialog_set_version;
+alias extern (C) char * function(aGtkAboutDialog *)TGTKgtk_about_dialog_get_version; extern(D) TGTKgtk_about_dialog_get_version gtk_about_dialog_get_version;
+alias extern (C) void function(aGtkAboutDialog *, char *)TGTKgtk_about_dialog_set_program_name; extern(D) TGTKgtk_about_dialog_set_program_name gtk_about_dialog_set_program_name;
+alias extern (C) char * function(aGtkAboutDialog *)TGTKgtk_about_dialog_get_program_name; extern(D) TGTKgtk_about_dialog_get_program_name gtk_about_dialog_get_program_name;
+alias extern (C) void function(aGtkAboutDialog *, char *)TGTKgtk_about_dialog_set_name; extern(D) TGTKgtk_about_dialog_set_name gtk_about_dialog_set_name;
+alias extern (C) char * function(aGtkAboutDialog *)TGTKgtk_about_dialog_get_name; extern(D) TGTKgtk_about_dialog_get_name gtk_about_dialog_get_name;
+alias extern (C) void function(aGtkWindow *, char *, ...)TGTKgtk_show_about_dialog; extern(D) TGTKgtk_show_about_dialog gtk_show_about_dialog;
+alias extern (C) _GtkWidget * function()TGTKgtk_about_dialog_new; extern(D) TGTKgtk_about_dialog_new gtk_about_dialog_new;
+alias extern (C) uint function()TGTKgtk_about_dialog_get_type; extern(D) TGTKgtk_about_dialog_get_type gtk_about_dialog_get_type;
+//alias extern (C) void function(aGtkDialog *, int)TGTK_gtk_dialog_set_ignore_separator; extern(D) TGTK_gtk_dialog_set_ignore_separator _gtk_dialog_set_ignore_separator;
+alias extern (C) int function(aGtkDialog *)TGTKgtk_dialog_run; extern(D) TGTKgtk_dialog_run gtk_dialog_run;
+alias extern (C) void function(aGtkDialog *, int)TGTKgtk_dialog_response; extern(D) TGTKgtk_dialog_response gtk_dialog_response;
+alias extern (C) void function(aGtkDialog *, int, int *)TGTKgtk_dialog_set_alternative_button_order_from_array; extern(D) TGTKgtk_dialog_set_alternative_button_order_from_array gtk_dialog_set_alternative_button_order_from_array;
+alias extern (C) void function(aGtkDialog *, int, ...)TGTKgtk_dialog_set_alternative_button_order; extern(D) TGTKgtk_dialog_set_alternative_button_order gtk_dialog_set_alternative_button_order;
+alias extern (C) int function(_GdkScreen *)TGTKgtk_alternative_dialog_button_order; extern(D) TGTKgtk_alternative_dialog_button_order gtk_alternative_dialog_button_order;
+alias extern (C) int function(aGtkDialog *)TGTKgtk_dialog_get_has_separator; extern(D) TGTKgtk_dialog_get_has_separator gtk_dialog_get_has_separator;
+alias extern (C) void function(aGtkDialog *, int)TGTKgtk_dialog_set_has_separator; extern(D) TGTKgtk_dialog_set_has_separator gtk_dialog_set_has_separator;
+alias extern (C) int function(aGtkDialog *, aGtkWidget *)TGTKgtk_dialog_get_response_for_widget; extern(D) TGTKgtk_dialog_get_response_for_widget gtk_dialog_get_response_for_widget;
+alias extern (C) void function(aGtkDialog *, int)TGTKgtk_dialog_set_default_response; extern(D) TGTKgtk_dialog_set_default_response gtk_dialog_set_default_response;
+alias extern (C) void function(aGtkDialog *, int, int)TGTKgtk_dialog_set_response_sensitive; extern(D) TGTKgtk_dialog_set_response_sensitive gtk_dialog_set_response_sensitive;
+alias extern (C) void function(aGtkDialog *, char *, ...)TGTKgtk_dialog_add_buttons; extern(D) TGTKgtk_dialog_add_buttons gtk_dialog_add_buttons;
+alias extern (C) _GtkWidget * function(aGtkDialog *, char *, int)TGTKgtk_dialog_add_button; extern(D) TGTKgtk_dialog_add_button gtk_dialog_add_button;
+alias extern (C) void function(aGtkDialog *, aGtkWidget *, int)TGTKgtk_dialog_add_action_widget; extern(D) TGTKgtk_dialog_add_action_widget gtk_dialog_add_action_widget;
+alias extern (C) _GtkWidget * function(char *, aGtkWindow *, int, char *, ...)TGTKgtk_dialog_new_with_buttons; extern(D) TGTKgtk_dialog_new_with_buttons gtk_dialog_new_with_buttons;
+alias extern (C) _GtkWidget * function()TGTKgtk_dialog_new; extern(D) TGTKgtk_dialog_new gtk_dialog_new;
+alias extern (C) uint function()TGTKgtk_dialog_get_type; extern(D) TGTKgtk_dialog_get_type gtk_dialog_get_type;
+//alias extern (C) int function(aGtkWindow *, uint, int)TGTK_gtk_window_query_nonaccels; extern(D) TGTK_gtk_window_query_nonaccels _gtk_window_query_nonaccels;
+//alias extern (C) void function(aGtkWindow *, _BCD_func__12662, void *)TGTK_gtk_window_keys_foreach; extern(D) TGTK_gtk_window_keys_foreach _gtk_window_keys_foreach;
+//alias extern (C) void function(aGtkWindow *, int)TGTK_gtk_window_set_is_active; extern(D) TGTK_gtk_window_set_is_active _gtk_window_set_is_active;
+//alias extern (C) void function(aGtkWindow *, aGtkWidget *)TGTK_gtk_window_unset_focus_and_default; extern(D) TGTK_gtk_window_unset_focus_and_default _gtk_window_unset_focus_and_default;
+//alias extern (C) void function(aGtkWindow *, int)TGTK_gtk_window_set_has_toplevel_focus; extern(D) TGTK_gtk_window_set_has_toplevel_focus _gtk_window_set_has_toplevel_focus;
+//alias extern (C) _GtkWidget * function(aGtkWindowGroup *)TGTK_gtk_window_group_get_current_grab; extern(D) TGTK_gtk_window_group_get_current_grab _gtk_window_group_get_current_grab;
+//alias extern (C) void function(aGtkWindow *, int, int, int *, int *)TGTK_gtk_window_constrain_size; extern(D) TGTK_gtk_window_constrain_size _gtk_window_constrain_size;
+//alias extern (C) void function(aGtkWindow *, int, int)TGTK_gtk_window_reposition; extern(D) TGTK_gtk_window_reposition _gtk_window_reposition;
+alias extern (C) void function(aGtkWindow *, uint)TGTKgtk_window_add_embedded_xid; extern(D) TGTKgtk_window_add_embedded_xid gtk_window_add_embedded_xid;
+alias extern (C) void function(aGtkWindow *, uint)TGTKgtk_window_remove_embedded_xid; extern(D) TGTKgtk_window_remove_embedded_xid gtk_window_remove_embedded_xid;
+//alias extern (C) void function(aGtkWindow *, aGtkWidget *)TGTK_gtk_window_internal_set_focus; extern(D) TGTK_gtk_window_internal_set_focus _gtk_window_internal_set_focus;
+alias extern (C) void function(aGtkWindowGroup *, aGtkWindow *)TGTKgtk_window_group_remove_window; extern(D) TGTKgtk_window_group_remove_window gtk_window_group_remove_window;
+alias extern (C) void function(aGtkWindowGroup *, aGtkWindow *)TGTKgtk_window_group_add_window; extern(D) TGTKgtk_window_group_add_window gtk_window_group_add_window;
+alias extern (C) _GtkWindowGroup * function()TGTKgtk_window_group_new; extern(D) TGTKgtk_window_group_new gtk_window_group_new;
+alias extern (C) uint function()TGTKgtk_window_group_get_type; extern(D) TGTKgtk_window_group_get_type gtk_window_group_get_type;
+alias extern (C) void function(aGtkWindow *)TGTKgtk_window_reshow_with_initial_size; extern(D) TGTKgtk_window_reshow_with_initial_size gtk_window_reshow_with_initial_size;
+alias extern (C) _GtkWindowGroup * function(aGtkWindow *)TGTKgtk_window_get_group; extern(D) TGTKgtk_window_get_group gtk_window_get_group;
+alias extern (C) int function(aGtkWindow *, char *)TGTKgtk_window_parse_geometry; extern(D) TGTKgtk_window_parse_geometry gtk_window_parse_geometry;
+alias extern (C) void function(aGtkWindow *, int *, int *)TGTKgtk_window_get_position; extern(D) TGTKgtk_window_get_position gtk_window_get_position;
+alias extern (C) void function(aGtkWindow *, int, int)TGTKgtk_window_move; extern(D) TGTKgtk_window_move gtk_window_move;
+alias extern (C) void function(aGtkWindow *, int *, int *)TGTKgtk_window_get_size; extern(D) TGTKgtk_window_get_size gtk_window_get_size;
+alias extern (C) void function(aGtkWindow *, int, int)TGTKgtk_window_resize; extern(D) TGTKgtk_window_resize gtk_window_resize;
+alias extern (C) void function(aGtkWindow *, int *, int *)TGTKgtk_window_get_default_size; extern(D) TGTKgtk_window_get_default_size gtk_window_get_default_size;
+alias extern (C) void function(aGtkWindow *, int, int)TGTKgtk_window_set_default_size; extern(D) TGTKgtk_window_set_default_size gtk_window_set_default_size;
+alias extern (C) void function(aGtkWindow *, int, int, int)TGTKgtk_window_set_policy; extern(D) TGTKgtk_window_set_policy gtk_window_set_policy;
+alias extern (C) void function(aGtkWindow *, int, int, int, uint)TGTKgtk_window_begin_move_drag; extern(D) TGTKgtk_window_begin_move_drag gtk_window_begin_move_drag;
+alias extern (C) void function(aGtkWindow *, int, int, int, int, uint)TGTKgtk_window_begin_resize_drag; extern(D) TGTKgtk_window_begin_resize_drag gtk_window_begin_resize_drag;
+alias extern (C) void function(aGtkWindow *, int)TGTKgtk_window_set_keep_below; extern(D) TGTKgtk_window_set_keep_below gtk_window_set_keep_below;
+alias extern (C) void function(aGtkWindow *, int)TGTKgtk_window_set_keep_above; extern(D) TGTKgtk_window_set_keep_above gtk_window_set_keep_above;
+alias extern (C) void function(aGtkWindow *)TGTKgtk_window_unfullscreen; extern(D) TGTKgtk_window_unfullscreen gtk_window_unfullscreen;
+alias extern (C) void function(aGtkWindow *)TGTKgtk_window_fullscreen; extern(D) TGTKgtk_window_fullscreen gtk_window_fullscreen;
+alias extern (C) void function(aGtkWindow *)TGTKgtk_window_unmaximize; extern(D) TGTKgtk_window_unmaximize gtk_window_unmaximize;
+alias extern (C) void function(aGtkWindow *)TGTKgtk_window_maximize; extern(D) TGTKgtk_window_maximize gtk_window_maximize;
+alias extern (C) void function(aGtkWindow *)TGTKgtk_window_unstick; extern(D) TGTKgtk_window_unstick gtk_window_unstick;
+alias extern (C) void function(aGtkWindow *)TGTKgtk_window_stick; extern(D) TGTKgtk_window_stick gtk_window_stick;
+alias extern (C) void function(aGtkWindow *)TGTKgtk_window_deiconify; extern(D) TGTKgtk_window_deiconify gtk_window_deiconify;
+alias extern (C) void function(aGtkWindow *)TGTKgtk_window_iconify; extern(D) TGTKgtk_window_iconify gtk_window_iconify;
+alias extern (C) void function(aGtkWindow *, uint)TGTKgtk_window_present_with_time; extern(D) TGTKgtk_window_present_with_time gtk_window_present_with_time;
+alias extern (C) void function(aGtkWindow *)TGTKgtk_window_present; extern(D) TGTKgtk_window_present gtk_window_present;
+alias extern (C) int function(aGtkWindow *, _GdkEventKey *)TGTKgtk_window_propagate_key_event; extern(D) TGTKgtk_window_propagate_key_event gtk_window_propagate_key_event;
+alias extern (C) int function(aGtkWindow *, _GdkEventKey *)TGTKgtk_window_activate_key; extern(D) TGTKgtk_window_activate_key gtk_window_activate_key;
+alias extern (C) int function(aGtkWindow *)TGTKgtk_window_get_mnemonic_modifier; extern(D) TGTKgtk_window_get_mnemonic_modifier gtk_window_get_mnemonic_modifier;
+alias extern (C) void function(aGtkWindow *, int)TGTKgtk_window_set_mnemonic_modifier; extern(D) TGTKgtk_window_set_mnemonic_modifier gtk_window_set_mnemonic_modifier;
+alias extern (C) int function(aGtkWindow *, uint, int)TGTKgtk_window_mnemonic_activate; extern(D) TGTKgtk_window_mnemonic_activate gtk_window_mnemonic_activate;
+alias extern (C) void function(aGtkWindow *, uint, aGtkWidget *)TGTKgtk_window_remove_mnemonic; extern(D) TGTKgtk_window_remove_mnemonic gtk_window_remove_mnemonic;
+alias extern (C) void function(aGtkWindow *, uint, aGtkWidget *)TGTKgtk_window_add_mnemonic; extern(D) TGTKgtk_window_add_mnemonic gtk_window_add_mnemonic;
+alias extern (C) _GList * function()TGTKgtk_window_list_toplevels; extern(D) TGTKgtk_window_list_toplevels gtk_window_list_toplevels;
+alias extern (C) int function(aGtkWindow *)TGTKgtk_window_get_modal; extern(D) TGTKgtk_window_get_modal gtk_window_get_modal;
+alias extern (C) void function(aGtkWindow *, int)TGTKgtk_window_set_modal; extern(D) TGTKgtk_window_set_modal gtk_window_set_modal;
+alias extern (C) void function(int)TGTKgtk_window_set_auto_startup_notification; extern(D) TGTKgtk_window_set_auto_startup_notification gtk_window_set_auto_startup_notification;
+alias extern (C) int function(char *, _GError * *)TGTKgtk_window_set_default_icon_from_file; extern(D) TGTKgtk_window_set_default_icon_from_file gtk_window_set_default_icon_from_file;
+alias extern (C) void function(char *)TGTKgtk_window_set_default_icon_name; extern(D) TGTKgtk_window_set_default_icon_name gtk_window_set_default_icon_name;
+alias extern (C) void function(void *)TGTKgtk_window_set_default_icon; extern(D) TGTKgtk_window_set_default_icon gtk_window_set_default_icon;
+alias extern (C) _GList * function()TGTKgtk_window_get_default_icon_list; extern(D) TGTKgtk_window_get_default_icon_list gtk_window_get_default_icon_list;
+alias extern (C) void function(_GList *)TGTKgtk_window_set_default_icon_list; extern(D) TGTKgtk_window_set_default_icon_list gtk_window_set_default_icon_list;
+alias extern (C) char * function(aGtkWindow *)TGTKgtk_window_get_icon_name; extern(D) TGTKgtk_window_get_icon_name gtk_window_get_icon_name;
+alias extern (C) void * function(aGtkWindow *)TGTKgtk_window_get_icon; extern(D) TGTKgtk_window_get_icon gtk_window_get_icon;
+alias extern (C) int function(aGtkWindow *, char *, _GError * *)TGTKgtk_window_set_icon_from_file; extern(D) TGTKgtk_window_set_icon_from_file gtk_window_set_icon_from_file;
+alias extern (C) void function(aGtkWindow *, char *)TGTKgtk_window_set_icon_name; extern(D) TGTKgtk_window_set_icon_name gtk_window_set_icon_name;
+alias extern (C) void function(aGtkWindow *, void *)TGTKgtk_window_set_icon; extern(D) TGTKgtk_window_set_icon gtk_window_set_icon;
+alias extern (C) _GList * function(aGtkWindow *)TGTKgtk_window_get_icon_list; extern(D) TGTKgtk_window_get_icon_list gtk_window_get_icon_list;
+alias extern (C) void function(aGtkWindow *, _GList *)TGTKgtk_window_set_icon_list; extern(D) TGTKgtk_window_set_icon_list gtk_window_set_icon_list;
+alias extern (C) int function(aGtkWindow *)TGTKgtk_window_get_deletable; extern(D) TGTKgtk_window_get_deletable gtk_window_get_deletable;
+alias extern (C) void function(aGtkWindow *, int)TGTKgtk_window_set_deletable; extern(D) TGTKgtk_window_set_deletable gtk_window_set_deletable;
+alias extern (C) int function(aGtkWindow *)TGTKgtk_window_get_decorated; extern(D) TGTKgtk_window_get_decorated gtk_window_get_decorated;
+alias extern (C) void function(aGtkWindow *, int)TGTKgtk_window_set_decorated; extern(D) TGTKgtk_window_set_decorated gtk_window_set_decorated;
+alias extern (C) void function(aGtkWindow *, int *, int *, int *, int *)TGTKgtk_window_get_frame_dimensions; extern(D) TGTKgtk_window_get_frame_dimensions gtk_window_get_frame_dimensions;
+alias extern (C) void function(aGtkWindow *, int, int, int, int)TGTKgtk_window_set_frame_dimensions; extern(D) TGTKgtk_window_set_frame_dimensions gtk_window_set_frame_dimensions;
+alias extern (C) int function(aGtkWindow *)TGTKgtk_window_get_has_frame; extern(D) TGTKgtk_window_get_has_frame gtk_window_get_has_frame;
+alias extern (C) void function(aGtkWindow *, int)TGTKgtk_window_set_has_frame; extern(D) TGTKgtk_window_set_has_frame gtk_window_set_has_frame;
+alias extern (C) int function(aGtkWindow *)TGTKgtk_window_has_toplevel_focus; extern(D) TGTKgtk_window_has_toplevel_focus gtk_window_has_toplevel_focus;
+alias extern (C) int function(aGtkWindow *)TGTKgtk_window_is_active; extern(D) TGTKgtk_window_is_active gtk_window_is_active;
+alias extern (C) _GdkScreen * function(aGtkWindow *)TGTKgtk_window_get_screen; extern(D) TGTKgtk_window_get_screen gtk_window_get_screen;
+alias extern (C) void function(aGtkWindow *, _GdkScreen *)TGTKgtk_window_set_screen; extern(D) TGTKgtk_window_set_screen gtk_window_set_screen;
+alias extern (C) void function(aGtkWindow *, aGtkWidget *, _GdkGeometry *, int)TGTKgtk_window_set_geometry_hints; extern(D) TGTKgtk_window_set_geometry_hints gtk_window_set_geometry_hints;
+alias extern (C) int function(aGtkWindow *)TGTKgtk_window_get_gravity; extern(D) TGTKgtk_window_get_gravity gtk_window_get_gravity;
+alias extern (C) void function(aGtkWindow *, int)TGTKgtk_window_set_gravity; extern(D) TGTKgtk_window_set_gravity gtk_window_set_gravity;
+alias extern (C) int function(aGtkWindow *)TGTKgtk_window_get_resizable; extern(D) TGTKgtk_window_get_resizable gtk_window_get_resizable;
+alias extern (C) void function(aGtkWindow *, int)TGTKgtk_window_set_resizable; extern(D) TGTKgtk_window_set_resizable gtk_window_set_resizable;
+alias extern (C) int function(aGtkWindow *)TGTKgtk_window_get_destroy_with_parent; extern(D) TGTKgtk_window_get_destroy_with_parent gtk_window_get_destroy_with_parent;
+alias extern (C) void function(aGtkWindow *, int)TGTKgtk_window_set_destroy_with_parent; extern(D) TGTKgtk_window_set_destroy_with_parent gtk_window_set_destroy_with_parent;
+alias extern (C) int function(aGtkWindow *)TGTKgtk_window_get_focus_on_map; extern(D) TGTKgtk_window_get_focus_on_map gtk_window_get_focus_on_map;
+alias extern (C) void function(aGtkWindow *, int)TGTKgtk_window_set_focus_on_map; extern(D) TGTKgtk_window_set_focus_on_map gtk_window_set_focus_on_map;
+alias extern (C) int function(aGtkWindow *)TGTKgtk_window_get_accept_focus; extern(D) TGTKgtk_window_get_accept_focus gtk_window_get_accept_focus;
+alias extern (C) void function(aGtkWindow *, int)TGTKgtk_window_set_accept_focus; extern(D) TGTKgtk_window_set_accept_focus gtk_window_set_accept_focus;
+alias extern (C) int function(aGtkWindow *)TGTKgtk_window_get_urgency_hint; extern(D) TGTKgtk_window_get_urgency_hint gtk_window_get_urgency_hint;
+alias extern (C) void function(aGtkWindow *, int)TGTKgtk_window_set_urgency_hint; extern(D) TGTKgtk_window_set_urgency_hint gtk_window_set_urgency_hint;
+alias extern (C) int function(aGtkWindow *)TGTKgtk_window_get_skip_pager_hint; extern(D) TGTKgtk_window_get_skip_pager_hint gtk_window_get_skip_pager_hint;
+alias extern (C) void function(aGtkWindow *, int)TGTKgtk_window_set_skip_pager_hint; extern(D) TGTKgtk_window_set_skip_pager_hint gtk_window_set_skip_pager_hint;
+alias extern (C) int function(aGtkWindow *)TGTKgtk_window_get_skip_taskbar_hint; extern(D) TGTKgtk_window_get_skip_taskbar_hint gtk_window_get_skip_taskbar_hint;
+alias extern (C) void function(aGtkWindow *, int)TGTKgtk_window_set_skip_taskbar_hint; extern(D) TGTKgtk_window_set_skip_taskbar_hint gtk_window_set_skip_taskbar_hint;
+alias extern (C) int function(aGtkWindow *)TGTKgtk_window_get_type_hint; extern(D) TGTKgtk_window_get_type_hint gtk_window_get_type_hint;
+alias extern (C) void function(aGtkWindow *, int)TGTKgtk_window_set_type_hint; extern(D) TGTKgtk_window_set_type_hint gtk_window_set_type_hint;
+alias extern (C) double function(aGtkWindow *)TGTKgtk_window_get_opacity; extern(D) TGTKgtk_window_get_opacity gtk_window_get_opacity;
+alias extern (C) void function(aGtkWindow *, double)TGTKgtk_window_set_opacity; extern(D) TGTKgtk_window_set_opacity gtk_window_set_opacity;
+alias extern (C) _GtkWindow * function(aGtkWindow *)TGTKgtk_window_get_transient_for; extern(D) TGTKgtk_window_get_transient_for gtk_window_get_transient_for;
+alias extern (C) void function(aGtkWindow *, aGtkWindow *)TGTKgtk_window_set_transient_for; extern(D) TGTKgtk_window_set_transient_for gtk_window_set_transient_for;
+alias extern (C) int function(aGtkWindow *)TGTKgtk_window_activate_default; extern(D) TGTKgtk_window_activate_default gtk_window_activate_default;
+alias extern (C) void function(aGtkWindow *, aGtkWidget *)TGTKgtk_window_set_default; extern(D) TGTKgtk_window_set_default gtk_window_set_default;
+alias extern (C) _GtkWidget * function(aGtkWindow *)TGTKgtk_window_get_focus; extern(D) TGTKgtk_window_get_focus gtk_window_get_focus;
+alias extern (C) void function(aGtkWindow *, aGtkWidget *)TGTKgtk_window_set_focus; extern(D) TGTKgtk_window_set_focus gtk_window_set_focus;
+alias extern (C) int function(aGtkWindow *)TGTKgtk_window_activate_focus; extern(D) TGTKgtk_window_activate_focus gtk_window_activate_focus;
+alias extern (C) void function(aGtkWindow *, int)TGTKgtk_window_set_position; extern(D) TGTKgtk_window_set_position gtk_window_set_position;
+alias extern (C) void function(aGtkWindow *, aGtkAccelGroup *)TGTKgtk_window_remove_accel_group; extern(D) TGTKgtk_window_remove_accel_group gtk_window_remove_accel_group;
+alias extern (C) void function(aGtkWindow *, aGtkAccelGroup *)TGTKgtk_window_add_accel_group; extern(D) TGTKgtk_window_add_accel_group gtk_window_add_accel_group;
+alias extern (C) char * function(aGtkWindow *)TGTKgtk_window_get_role; extern(D) TGTKgtk_window_get_role gtk_window_get_role;
+alias extern (C) void function(aGtkWindow *, char *)TGTKgtk_window_set_startup_id; extern(D) TGTKgtk_window_set_startup_id gtk_window_set_startup_id;
+alias extern (C) void function(aGtkWindow *, char *)TGTKgtk_window_set_role; extern(D) TGTKgtk_window_set_role gtk_window_set_role;
+alias extern (C) void function(aGtkWindow *, char *, char *)TGTKgtk_window_set_wmclass; extern(D) TGTKgtk_window_set_wmclass gtk_window_set_wmclass;
+alias extern (C) char * function(aGtkWindow *)TGTKgtk_window_get_title; extern(D) TGTKgtk_window_get_title gtk_window_get_title;
+alias extern (C) void function(aGtkWindow *, char *)TGTKgtk_window_set_title; extern(D) TGTKgtk_window_set_title gtk_window_set_title;
+alias extern (C) _GtkWidget * function(int)TGTKgtk_window_new; extern(D) TGTKgtk_window_new gtk_window_new;
+alias extern (C) uint function()TGTKgtk_window_get_type; extern(D) TGTKgtk_window_get_type gtk_window_get_type;
+alias extern (C) _GtkWidget * function(aGtkBin *)TGTKgtk_bin_get_child; extern(D) TGTKgtk_bin_get_child gtk_bin_get_child;
+alias extern (C) uint function()TGTKgtk_bin_get_type; extern(D) TGTKgtk_bin_get_type gtk_bin_get_type;
+//alias extern (C) _GList * function(aGtkContainer *, _GList *, int, aGtkWidget *)TGTK_gtk_container_focus_sort; extern(D) TGTK_gtk_container_focus_sort _gtk_container_focus_sort;
+//alias extern (C) void function(aGtkContainer *)TGTK_gtk_container_dequeue_resize_handler; extern(D) TGTK_gtk_container_dequeue_resize_handler _gtk_container_dequeue_resize_handler;
+//alias extern (C) char * function(aGtkContainer *, aGtkWidget *)TGTK_gtk_container_child_composite_name; extern(D) TGTK_gtk_container_child_composite_name _gtk_container_child_composite_name;
+//alias extern (C) void function(aGtkContainer *)TGTK_gtk_container_clear_resize_widgets; extern(D) TGTK_gtk_container_clear_resize_widgets _gtk_container_clear_resize_widgets;
+//alias extern (C) void function(aGtkContainer *)TGTK_gtk_container_queue_resize; extern(D) TGTK_gtk_container_queue_resize _gtk_container_queue_resize;
+alias extern (C) void function(aGtkContainer *, _BCD_func__12090, void *)TGTKgtk_container_forall; extern(D) TGTKgtk_container_forall gtk_container_forall;
+alias extern (C) void function(aGtkContainer *, aGtkWidget *, char *, _GValue *)TGTKgtk_container_child_get_property; extern(D) TGTKgtk_container_child_get_property gtk_container_child_get_property;
+alias extern (C) void function(aGtkContainer *, aGtkWidget *, char *, _GValue *)TGTKgtk_container_child_set_property; extern(D) TGTKgtk_container_child_set_property gtk_container_child_set_property;
+alias extern (C) void function(aGtkContainer *, aGtkWidget *, char *, char *)TGTKgtk_container_child_get_valist; extern(D) TGTKgtk_container_child_get_valist gtk_container_child_get_valist;
+alias extern (C) void function(aGtkContainer *, aGtkWidget *, char *, char *)TGTKgtk_container_child_set_valist; extern(D) TGTKgtk_container_child_set_valist gtk_container_child_set_valist;
+alias extern (C) void function(aGtkContainer *, aGtkWidget *, char *, ...)TGTKgtk_container_child_get; extern(D) TGTKgtk_container_child_get gtk_container_child_get;
+alias extern (C) void function(aGtkContainer *, aGtkWidget *, char *, ...)TGTKgtk_container_child_set; extern(D) TGTKgtk_container_child_set gtk_container_child_set;
+alias extern (C) void function(aGtkContainer *, aGtkWidget *, char *, ...)TGTKgtk_container_add_with_properties; extern(D) TGTKgtk_container_add_with_properties gtk_container_add_with_properties;
+alias extern (C) _GParamSpec * * function(_GObjectClass *, uint *)TGTKgtk_container_class_list_child_properties; extern(D) TGTKgtk_container_class_list_child_properties gtk_container_class_list_child_properties;
+alias extern (C) _GParamSpec * function(_GObjectClass *, char *)TGTKgtk_container_class_find_child_property; extern(D) TGTKgtk_container_class_find_child_property gtk_container_class_find_child_property;
+alias extern (C) void function(aGtkContainerClass *, uint, _GParamSpec *)TGTKgtk_container_class_install_child_property; extern(D) TGTKgtk_container_class_install_child_property gtk_container_class_install_child_property;
+alias extern (C) uint function(aGtkContainer *)TGTKgtk_container_child_type; extern(D) TGTKgtk_container_child_type gtk_container_child_type;
+alias extern (C) void function(aGtkContainer *)TGTKgtk_container_resize_children; extern(D) TGTKgtk_container_resize_children gtk_container_resize_children;
+alias extern (C) _GtkAdjustment * function(aGtkContainer *)TGTKgtk_container_get_focus_hadjustment; extern(D) TGTKgtk_container_get_focus_hadjustment gtk_container_get_focus_hadjustment;
+alias extern (C) void function(aGtkContainer *, aGtkAdjustment *)TGTKgtk_container_set_focus_hadjustment; extern(D) TGTKgtk_container_set_focus_hadjustment gtk_container_set_focus_hadjustment;
+alias extern (C) _GtkAdjustment * function(aGtkContainer *)TGTKgtk_container_get_focus_vadjustment; extern(D) TGTKgtk_container_get_focus_vadjustment gtk_container_get_focus_vadjustment;
+alias extern (C) void function(aGtkContainer *, aGtkAdjustment *)TGTKgtk_container_set_focus_vadjustment; extern(D) TGTKgtk_container_set_focus_vadjustment gtk_container_set_focus_vadjustment;
+alias extern (C) void function(aGtkContainer *, aGtkWidget *)TGTKgtk_container_set_focus_child; extern(D) TGTKgtk_container_set_focus_child gtk_container_set_focus_child;
+alias extern (C) void function(aGtkContainer *, int)TGTKgtk_container_set_reallocate_redraws; extern(D) TGTKgtk_container_set_reallocate_redraws gtk_container_set_reallocate_redraws;
+alias extern (C) void function(aGtkContainer *)TGTKgtk_container_unset_focus_chain; extern(D) TGTKgtk_container_unset_focus_chain gtk_container_unset_focus_chain;
+alias extern (C) int function(aGtkContainer *, _GList * *)TGTKgtk_container_get_focus_chain; extern(D) TGTKgtk_container_get_focus_chain gtk_container_get_focus_chain;
+alias extern (C) void function(aGtkContainer *, _GList *)TGTKgtk_container_set_focus_chain; extern(D) TGTKgtk_container_set_focus_chain gtk_container_set_focus_chain;
+alias extern (C) void function(aGtkContainer *, aGtkWidget *, _GdkEventExpose *)TGTKgtk_container_propagate_expose; extern(D) TGTKgtk_container_propagate_expose gtk_container_propagate_expose;
+alias extern (C) _GList * function(aGtkContainer *)TGTKgtk_container_get_children; extern(D) TGTKgtk_container_get_children gtk_container_get_children;
+alias extern (C) void function(aGtkContainer *, _BCD_func__12090, _BCD_func__13157, void *, _BCD_func__13158)TGTKgtk_container_foreach_full; extern(D) TGTKgtk_container_foreach_full gtk_container_foreach_full;
+alias extern (C) void function(aGtkContainer *, _BCD_func__12090, void *)TGTKgtk_container_foreach; extern(D) TGTKgtk_container_foreach gtk_container_foreach;
+alias extern (C) void function(aGtkContainer *)TGTKgtk_container_check_resize; extern(D) TGTKgtk_container_check_resize gtk_container_check_resize;
+alias extern (C) int function(aGtkContainer *)TGTKgtk_container_get_resize_mode; extern(D) TGTKgtk_container_get_resize_mode gtk_container_get_resize_mode;
+alias extern (C) void function(aGtkContainer *, int)TGTKgtk_container_set_resize_mode; extern(D) TGTKgtk_container_set_resize_mode gtk_container_set_resize_mode;
+alias extern (C) void function(aGtkContainer *, aGtkWidget *)TGTKgtk_container_remove; extern(D) TGTKgtk_container_remove gtk_container_remove;
+alias extern (C) void function(aGtkContainer *, aGtkWidget *)TGTKgtk_container_add; extern(D) TGTKgtk_container_add gtk_container_add;
+alias extern (C) uint function(aGtkContainer *)TGTKgtk_container_get_border_width; extern(D) TGTKgtk_container_get_border_width gtk_container_get_border_width;
+alias extern (C) void function(aGtkContainer *, uint)TGTKgtk_container_set_border_width; extern(D) TGTKgtk_container_set_border_width gtk_container_set_border_width;
+alias extern (C) uint function()TGTKgtk_container_get_type; extern(D) TGTKgtk_container_get_type gtk_container_get_type;
+//alias extern (C) _GdkColormap * function()TGTK_gtk_widget_peek_colormap; extern(D) TGTK_gtk_widget_peek_colormap _gtk_widget_peek_colormap;
+//alias extern (C) void function(aGtkWidget *)TGTK_gtk_widget_propagate_composited_changed; extern(D) TGTK_gtk_widget_propagate_composited_changed _gtk_widget_propagate_composited_changed;
+//alias extern (C) void function(aGtkWidget *, _GdkScreen *)TGTK_gtk_widget_propagate_screen_changed; extern(D) TGTK_gtk_widget_propagate_screen_changed _gtk_widget_propagate_screen_changed;
+//alias extern (C) void function(aGtkWidget *, aGtkWidget *)TGTK_gtk_widget_propagate_hierarchy_changed; extern(D) TGTK_gtk_widget_propagate_hierarchy_changed _gtk_widget_propagate_hierarchy_changed;
+//alias extern (C) _GtkWidgetAuxInfo * function(aGtkWidget *, int)TGTK_gtk_widget_get_aux_info; extern(D) TGTK_gtk_widget_get_aux_info _gtk_widget_get_aux_info;
+//alias extern (C) void function(aGtkWidget *, int)TGTK_gtk_widget_grab_notify; extern(D) TGTK_gtk_widget_grab_notify _gtk_widget_grab_notify;
+alias extern (C) void function(aGtkRequisition *)TGTKgtk_requisition_free; extern(D) TGTKgtk_requisition_free gtk_requisition_free;
+alias extern (C) _GtkRequisition * function(aGtkRequisition *)TGTKgtk_requisition_copy; extern(D) TGTKgtk_requisition_copy gtk_requisition_copy;
+alias extern (C) uint function()TGTKgtk_requisition_get_type; extern(D) TGTKgtk_requisition_get_type gtk_requisition_get_type;
+alias extern (C) int function(aGtkWidget *)TGTKgtk_widget_get_has_tooltip; extern(D) TGTKgtk_widget_get_has_tooltip gtk_widget_get_has_tooltip;
+alias extern (C) void function(aGtkWidget *, int)TGTKgtk_widget_set_has_tooltip; extern(D) TGTKgtk_widget_set_has_tooltip gtk_widget_set_has_tooltip;
+alias extern (C) char * function(aGtkWidget *)TGTKgtk_widget_get_tooltip_markup; extern(D) TGTKgtk_widget_get_tooltip_markup gtk_widget_get_tooltip_markup;
+alias extern (C) void function(aGtkWidget *, char *)TGTKgtk_widget_set_tooltip_markup; extern(D) TGTKgtk_widget_set_tooltip_markup gtk_widget_set_tooltip_markup;
+alias extern (C) char * function(aGtkWidget *)TGTKgtk_widget_get_tooltip_text; extern(D) TGTKgtk_widget_get_tooltip_text gtk_widget_get_tooltip_text;
+alias extern (C) void function(aGtkWidget *, char *)TGTKgtk_widget_set_tooltip_text; extern(D) TGTKgtk_widget_set_tooltip_text gtk_widget_set_tooltip_text;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_widget_trigger_tooltip_query; extern(D) TGTKgtk_widget_trigger_tooltip_query gtk_widget_trigger_tooltip_query;
+alias extern (C) _GtkWindow * function(aGtkWidget *)TGTKgtk_widget_get_tooltip_window; extern(D) TGTKgtk_widget_get_tooltip_window gtk_widget_get_tooltip_window;
+alias extern (C) void function(aGtkWidget *, aGtkWindow *)TGTKgtk_widget_set_tooltip_window; extern(D) TGTKgtk_widget_set_tooltip_window gtk_widget_set_tooltip_window;
+alias extern (C) void function(aGtkWidget *, aGtkWidget *)TGTKgtk_widget_remove_mnemonic_label; extern(D) TGTKgtk_widget_remove_mnemonic_label gtk_widget_remove_mnemonic_label;
+alias extern (C) void function(aGtkWidget *, aGtkWidget *)TGTKgtk_widget_add_mnemonic_label; extern(D) TGTKgtk_widget_add_mnemonic_label gtk_widget_add_mnemonic_label;
+alias extern (C) _GList * function(aGtkWidget *)TGTKgtk_widget_list_mnemonic_labels; extern(D) TGTKgtk_widget_list_mnemonic_labels gtk_widget_list_mnemonic_labels;
+alias extern (C) void function(aGtkWidget *, uint *, char * *, char * *)TGTKgtk_widget_class_path; extern(D) TGTKgtk_widget_class_path gtk_widget_class_path;
+alias extern (C) void function(aGtkWidget *, uint *, char * *, char * *)TGTKgtk_widget_path; extern(D) TGTKgtk_widget_path gtk_widget_path;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_widget_reset_shapes; extern(D) TGTKgtk_widget_reset_shapes gtk_widget_reset_shapes;
+alias extern (C) void function(aGtkWidget *, _GdkDrawable *, int, int)TGTKgtk_widget_input_shape_combine_mask; extern(D) TGTKgtk_widget_input_shape_combine_mask gtk_widget_input_shape_combine_mask;
+alias extern (C) void function(aGtkWidget *, _GdkDrawable *, int, int)TGTKgtk_widget_shape_combine_mask; extern(D) TGTKgtk_widget_shape_combine_mask gtk_widget_shape_combine_mask;
+alias extern (C) int function(aGtkWidget *)TGTKgtk_widget_is_composited; extern(D) TGTKgtk_widget_is_composited gtk_widget_is_composited;
+alias extern (C) int function()TGTKgtk_widget_get_default_direction; extern(D) TGTKgtk_widget_get_default_direction gtk_widget_get_default_direction;
+alias extern (C) void function(int)TGTKgtk_widget_set_default_direction; extern(D) TGTKgtk_widget_set_default_direction gtk_widget_set_default_direction;
+alias extern (C) int function(aGtkWidget *)TGTKgtk_widget_get_direction; extern(D) TGTKgtk_widget_get_direction gtk_widget_get_direction;
+alias extern (C) void function(aGtkWidget *, int)TGTKgtk_widget_set_direction; extern(D) TGTKgtk_widget_set_direction gtk_widget_set_direction;
+alias extern (C) _GdkVisual * function()TGTKgtk_widget_get_default_visual; extern(D) TGTKgtk_widget_get_default_visual gtk_widget_get_default_visual;
+alias extern (C) _GdkColormap * function()TGTKgtk_widget_get_default_colormap; extern(D) TGTKgtk_widget_get_default_colormap gtk_widget_get_default_colormap;
+alias extern (C) _GtkStyle * function()TGTKgtk_widget_get_default_style; extern(D) TGTKgtk_widget_get_default_style gtk_widget_get_default_style;
+alias extern (C) void function(_GdkColormap *)TGTKgtk_widget_set_default_colormap; extern(D) TGTKgtk_widget_set_default_colormap gtk_widget_set_default_colormap;
+alias extern (C) void function(aGtkWidget *, char *, ...)TGTKgtk_widget_style_get; extern(D) TGTKgtk_widget_style_get gtk_widget_style_get;
+alias extern (C) void function(aGtkWidget *, char *, char *)TGTKgtk_widget_style_get_valist; extern(D) TGTKgtk_widget_style_get_valist gtk_widget_style_get_valist;
+alias extern (C) void function(aGtkWidget *, char *, _GValue *)TGTKgtk_widget_style_get_property; extern(D) TGTKgtk_widget_style_get_property gtk_widget_style_get_property;
+alias extern (C) _GParamSpec * * function(aGtkWidgetClass *, uint *)TGTKgtk_widget_class_list_style_properties; extern(D) TGTKgtk_widget_class_list_style_properties gtk_widget_class_list_style_properties;
+alias extern (C) _GParamSpec * function(aGtkWidgetClass *, char *)TGTKgtk_widget_class_find_style_property; extern(D) TGTKgtk_widget_class_find_style_property gtk_widget_class_find_style_property;
+alias extern (C) void function(aGtkWidgetClass *, _GParamSpec *, _BCD_func__12993)TGTKgtk_widget_class_install_style_property_parser; extern(D) TGTKgtk_widget_class_install_style_property_parser gtk_widget_class_install_style_property_parser;
+alias extern (C) void function(aGtkWidgetClass *, _GParamSpec *)TGTKgtk_widget_class_install_style_property; extern(D) TGTKgtk_widget_class_install_style_property gtk_widget_class_install_style_property;
+alias extern (C) void function()TGTKgtk_widget_pop_colormap; extern(D) TGTKgtk_widget_pop_colormap gtk_widget_pop_colormap;
+alias extern (C) void function()TGTKgtk_widget_pop_composite_child; extern(D) TGTKgtk_widget_pop_composite_child gtk_widget_pop_composite_child;
+alias extern (C) void function()TGTKgtk_widget_push_composite_child; extern(D) TGTKgtk_widget_push_composite_child gtk_widget_push_composite_child;
+alias extern (C) void function(_GdkColormap *)TGTKgtk_widget_push_colormap; extern(D) TGTKgtk_widget_push_colormap gtk_widget_push_colormap;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_widget_reset_rc_styles; extern(D) TGTKgtk_widget_reset_rc_styles gtk_widget_reset_rc_styles;
+alias extern (C) char * function(aGtkWidget *)TGTKgtk_widget_get_composite_name; extern(D) TGTKgtk_widget_get_composite_name gtk_widget_get_composite_name;
+alias extern (C) void function(aGtkWidget *, char *)TGTKgtk_widget_set_composite_name; extern(D) TGTKgtk_widget_set_composite_name gtk_widget_set_composite_name;
+alias extern (C) void * function(aGtkWidget *, char *, int, char *)TGTKgtk_widget_render_icon; extern(D) TGTKgtk_widget_render_icon gtk_widget_render_icon;
+alias extern (C) void * function(aGtkWidget *, char *)TGTKgtk_widget_create_pango_layout; extern(D) TGTKgtk_widget_create_pango_layout gtk_widget_create_pango_layout;
+alias extern (C) void * function(aGtkWidget *)TGTKgtk_widget_get_pango_context; extern(D) TGTKgtk_widget_get_pango_context gtk_widget_get_pango_context;
+alias extern (C) void * function(aGtkWidget *)TGTKgtk_widget_create_pango_context; extern(D) TGTKgtk_widget_create_pango_context gtk_widget_create_pango_context;
+alias extern (C) void function(aGtkWidget *, void *)TGTKgtk_widget_modify_font; extern(D) TGTKgtk_widget_modify_font gtk_widget_modify_font;
+alias extern (C) void function(aGtkWidget *, _GdkColor *, _GdkColor *)TGTKgtk_widget_modify_cursor; extern(D) TGTKgtk_widget_modify_cursor gtk_widget_modify_cursor;
+alias extern (C) void function(aGtkWidget *, int, _GdkColor *)TGTKgtk_widget_modify_base; extern(D) TGTKgtk_widget_modify_base gtk_widget_modify_base;
+alias extern (C) void function(aGtkWidget *, int, _GdkColor *)TGTKgtk_widget_modify_text; extern(D) TGTKgtk_widget_modify_text gtk_widget_modify_text;
+alias extern (C) void function(aGtkWidget *, int, _GdkColor *)TGTKgtk_widget_modify_bg; extern(D) TGTKgtk_widget_modify_bg gtk_widget_modify_bg;
+alias extern (C) void function(aGtkWidget *, int, _GdkColor *)TGTKgtk_widget_modify_fg; extern(D) TGTKgtk_widget_modify_fg gtk_widget_modify_fg;
+alias extern (C) _GtkRcStyle * function(aGtkWidget *)TGTKgtk_widget_get_modifier_style; extern(D) TGTKgtk_widget_get_modifier_style gtk_widget_get_modifier_style;
+alias extern (C) void function(aGtkWidget *, aGtkRcStyle *)TGTKgtk_widget_modify_style; extern(D) TGTKgtk_widget_modify_style gtk_widget_modify_style;
+alias extern (C) _GtkStyle * function(aGtkWidget *)TGTKgtk_widget_get_style; extern(D) TGTKgtk_widget_get_style gtk_widget_get_style;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_widget_ensure_style; extern(D) TGTKgtk_widget_ensure_style gtk_widget_ensure_style;
+alias extern (C) void function(aGtkWidget *, aGtkStyle *)TGTKgtk_widget_set_style; extern(D) TGTKgtk_widget_set_style gtk_widget_set_style;
+alias extern (C) int function(aGtkWidget *)TGTKgtk_widget_hide_on_delete; extern(D) TGTKgtk_widget_hide_on_delete gtk_widget_hide_on_delete;
+alias extern (C) int function(aGtkWidget *, aGtkWidget *, int, int, int *, int *)TGTKgtk_widget_translate_coordinates; extern(D) TGTKgtk_widget_translate_coordinates gtk_widget_translate_coordinates;
+alias extern (C) int function(aGtkWidget *, aGtkWidget *)TGTKgtk_widget_is_ancestor; extern(D) TGTKgtk_widget_is_ancestor gtk_widget_is_ancestor;
+alias extern (C) void function(aGtkWidget *, int *, int *)TGTKgtk_widget_get_pointer; extern(D) TGTKgtk_widget_get_pointer gtk_widget_get_pointer;
+alias extern (C) int function(aGtkWidget *)TGTKgtk_widget_get_events; extern(D) TGTKgtk_widget_get_events gtk_widget_get_events;
+alias extern (C) void function(aGtkWidget *, _GdkColormap *)TGTKgtk_widget_set_colormap; extern(D) TGTKgtk_widget_set_colormap gtk_widget_set_colormap;
+alias extern (C) _AtkObject * function(aGtkWidget *)TGTKgtk_widget_get_accessible; extern(D) TGTKgtk_widget_get_accessible gtk_widget_get_accessible;
+alias extern (C) void * function(aGtkWidget *, void *)TGTKgtk_widget_get_clipboard; extern(D) TGTKgtk_widget_get_clipboard gtk_widget_get_clipboard;
+alias extern (C) _GtkSettings * function(aGtkWidget *)TGTKgtk_widget_get_settings; extern(D) TGTKgtk_widget_get_settings gtk_widget_get_settings;
+alias extern (C) _GdkDrawable * function(aGtkWidget *)TGTKgtk_widget_get_root_window; extern(D) TGTKgtk_widget_get_root_window gtk_widget_get_root_window;
+alias extern (C) _GdkDisplay * function(aGtkWidget *)TGTKgtk_widget_get_display; extern(D) TGTKgtk_widget_get_display gtk_widget_get_display;
+alias extern (C) int function(aGtkWidget *)TGTKgtk_widget_has_screen; extern(D) TGTKgtk_widget_has_screen gtk_widget_has_screen;
+alias extern (C) _GdkScreen * function(aGtkWidget *)TGTKgtk_widget_get_screen; extern(D) TGTKgtk_widget_get_screen gtk_widget_get_screen;
+alias extern (C) _GdkVisual * function(aGtkWidget *)TGTKgtk_widget_get_visual; extern(D) TGTKgtk_widget_get_visual gtk_widget_get_visual;
+alias extern (C) _GdkColormap * function(aGtkWidget *)TGTKgtk_widget_get_colormap; extern(D) TGTKgtk_widget_get_colormap gtk_widget_get_colormap;
+alias extern (C) _GtkWidget * function(aGtkWidget *, uint)TGTKgtk_widget_get_ancestor; extern(D) TGTKgtk_widget_get_ancestor gtk_widget_get_ancestor;
+alias extern (C) _GtkWidget * function(aGtkWidget *)TGTKgtk_widget_get_toplevel; extern(D) TGTKgtk_widget_get_toplevel gtk_widget_get_toplevel;
+alias extern (C) int function(aGtkWidget *)TGTKgtk_widget_get_extension_events; extern(D) TGTKgtk_widget_get_extension_events gtk_widget_get_extension_events;
+alias extern (C) void function(aGtkWidget *, int)TGTKgtk_widget_set_extension_events; extern(D) TGTKgtk_widget_set_extension_events gtk_widget_set_extension_events;
+alias extern (C) void function(aGtkWidget *, int)TGTKgtk_widget_add_events; extern(D) TGTKgtk_widget_add_events gtk_widget_add_events;
+alias extern (C) void function(aGtkWidget *, int)TGTKgtk_widget_set_events; extern(D) TGTKgtk_widget_set_events gtk_widget_set_events;
+alias extern (C) void function(aGtkWidget *, int, int)TGTKgtk_widget_set_usize; extern(D) TGTKgtk_widget_set_usize gtk_widget_set_usize;
+alias extern (C) void function(aGtkWidget *, int, int)TGTKgtk_widget_set_uposition; extern(D) TGTKgtk_widget_set_uposition gtk_widget_set_uposition;
+alias extern (C) void function(aGtkWidget *, int *, int *)TGTKgtk_widget_get_size_request; extern(D) TGTKgtk_widget_get_size_request gtk_widget_get_size_request;
+alias extern (C) void function(aGtkWidget *, int, int)TGTKgtk_widget_set_size_request; extern(D) TGTKgtk_widget_set_size_request gtk_widget_set_size_request;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_widget_error_bell; extern(D) TGTKgtk_widget_error_bell gtk_widget_error_bell;
+alias extern (C) int function(aGtkWidget *, int)TGTKgtk_widget_keynav_failed; extern(D) TGTKgtk_widget_keynav_failed gtk_widget_keynav_failed;
+alias extern (C) int function(aGtkWidget *, int)TGTKgtk_widget_child_focus; extern(D) TGTKgtk_widget_child_focus gtk_widget_child_focus;
+alias extern (C) _GdkDrawable * function(aGtkWidget *)TGTKgtk_widget_get_parent_window; extern(D) TGTKgtk_widget_get_parent_window gtk_widget_get_parent_window;
+alias extern (C) _GtkWidget * function(aGtkWidget *)TGTKgtk_widget_get_parent; extern(D) TGTKgtk_widget_get_parent gtk_widget_get_parent;
+alias extern (C) int function(aGtkWidget *)TGTKgtk_widget_get_child_visible; extern(D) TGTKgtk_widget_get_child_visible gtk_widget_get_child_visible;
+alias extern (C) void function(aGtkWidget *, int)TGTKgtk_widget_set_child_visible; extern(D) TGTKgtk_widget_set_child_visible gtk_widget_set_child_visible;
+alias extern (C) void function(aGtkWidget *, _GdkDrawable *)TGTKgtk_widget_set_parent_window; extern(D) TGTKgtk_widget_set_parent_window gtk_widget_set_parent_window;
+alias extern (C) void function(aGtkWidget *, aGtkWidget *)TGTKgtk_widget_set_parent; extern(D) TGTKgtk_widget_set_parent gtk_widget_set_parent;
+alias extern (C) void function(aGtkWidget *, int)TGTKgtk_widget_set_redraw_on_allocate; extern(D) TGTKgtk_widget_set_redraw_on_allocate gtk_widget_set_redraw_on_allocate;
+alias extern (C) void function(aGtkWidget *, int)TGTKgtk_widget_set_double_buffered; extern(D) TGTKgtk_widget_set_double_buffered gtk_widget_set_double_buffered;
+alias extern (C) void function(aGtkWidget *, int)TGTKgtk_widget_set_app_paintable; extern(D) TGTKgtk_widget_set_app_paintable gtk_widget_set_app_paintable;
+alias extern (C) void function(aGtkWidget *, int)TGTKgtk_widget_set_sensitive; extern(D) TGTKgtk_widget_set_sensitive gtk_widget_set_sensitive;
+alias extern (C) void function(aGtkWidget *, int)TGTKgtk_widget_set_state; extern(D) TGTKgtk_widget_set_state gtk_widget_set_state;
+alias extern (C) char * function(aGtkWidget *)TGTKgtk_widget_get_name; extern(D) TGTKgtk_widget_get_name gtk_widget_get_name;
+alias extern (C) void function(aGtkWidget *, char *)TGTKgtk_widget_set_name; extern(D) TGTKgtk_widget_set_name gtk_widget_set_name;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_widget_grab_default; extern(D) TGTKgtk_widget_grab_default gtk_widget_grab_default;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_widget_grab_focus; extern(D) TGTKgtk_widget_grab_focus gtk_widget_grab_focus;
+alias extern (C) int function(aGtkWidget *)TGTKgtk_widget_is_focus; extern(D) TGTKgtk_widget_is_focus gtk_widget_is_focus;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_widget_thaw_child_notify; extern(D) TGTKgtk_widget_thaw_child_notify gtk_widget_thaw_child_notify;
+alias extern (C) void function(aGtkWidget *, char *)TGTKgtk_widget_child_notify; extern(D) TGTKgtk_widget_child_notify gtk_widget_child_notify;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_widget_freeze_child_notify; extern(D) TGTKgtk_widget_freeze_child_notify gtk_widget_freeze_child_notify;
+alias extern (C) void * function(aGtkWidget *, void *)TGTKgtk_widget_region_intersect; extern(D) TGTKgtk_widget_region_intersect gtk_widget_region_intersect;
+alias extern (C) int function(aGtkWidget *, _GdkRectangle *, _GdkRectangle *)TGTKgtk_widget_intersect; extern(D) TGTKgtk_widget_intersect gtk_widget_intersect;
+alias extern (C) void function(aGtkWidget *, aGtkWidget *)TGTKgtk_widget_reparent; extern(D) TGTKgtk_widget_reparent gtk_widget_reparent;
+alias extern (C) int function(aGtkWidget *, aGtkAdjustment *, aGtkAdjustment *)TGTKgtk_widget_set_scroll_adjustments; extern(D) TGTKgtk_widget_set_scroll_adjustments gtk_widget_set_scroll_adjustments;
+alias extern (C) int function(aGtkWidget *)TGTKgtk_widget_activate; extern(D) TGTKgtk_widget_activate gtk_widget_activate;
+alias extern (C) int function(aGtkWidget *, _GdkEvent *)TGTKgtk_widget_send_expose; extern(D) TGTKgtk_widget_send_expose gtk_widget_send_expose;
+alias extern (C) int function(aGtkWidget *, _GdkEvent *)TGTKgtk_widget_event; extern(D) TGTKgtk_widget_event gtk_widget_event;
+alias extern (C) int function(aGtkWidget *, int)TGTKgtk_widget_mnemonic_activate; extern(D) TGTKgtk_widget_mnemonic_activate gtk_widget_mnemonic_activate;
+alias extern (C) int function(aGtkWidget *, uint)TGTKgtk_widget_can_activate_accel; extern(D) TGTKgtk_widget_can_activate_accel gtk_widget_can_activate_accel;
+alias extern (C) _GList * function(aGtkWidget *)TGTKgtk_widget_list_accel_closures; extern(D) TGTKgtk_widget_list_accel_closures gtk_widget_list_accel_closures;
+//alias extern (C) char * function(aGtkWidget *, int *)TGTK_gtk_widget_get_accel_path; extern(D) TGTK_gtk_widget_get_accel_path _gtk_widget_get_accel_path;
+alias extern (C) void function(aGtkWidget *, char *, aGtkAccelGroup *)TGTKgtk_widget_set_accel_path; extern(D) TGTKgtk_widget_set_accel_path gtk_widget_set_accel_path;
+alias extern (C) int function(aGtkWidget *, aGtkAccelGroup *, uint, int)TGTKgtk_widget_remove_accelerator; extern(D) TGTKgtk_widget_remove_accelerator gtk_widget_remove_accelerator;
+alias extern (C) void function(aGtkWidget *, char *, aGtkAccelGroup *, uint, int, int)TGTKgtk_widget_add_accelerator; extern(D) TGTKgtk_widget_add_accelerator gtk_widget_add_accelerator;
+alias extern (C) void function(aGtkWidget *, aGtkRequisition *)TGTKgtk_widget_get_child_requisition; extern(D) TGTKgtk_widget_get_child_requisition gtk_widget_get_child_requisition;
+alias extern (C) void function(aGtkWidget *, _GdkRectangle *)TGTKgtk_widget_size_allocate; extern(D) TGTKgtk_widget_size_allocate gtk_widget_size_allocate;
+alias extern (C) void function(aGtkWidget *, aGtkRequisition *)TGTKgtk_widget_size_request; extern(D) TGTKgtk_widget_size_request gtk_widget_size_request;
+alias extern (C) void function(aGtkWidget *, _GdkRectangle *)TGTKgtk_widget_draw; extern(D) TGTKgtk_widget_draw gtk_widget_draw;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_widget_queue_resize_no_redraw; extern(D) TGTKgtk_widget_queue_resize_no_redraw gtk_widget_queue_resize_no_redraw;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_widget_queue_resize; extern(D) TGTKgtk_widget_queue_resize gtk_widget_queue_resize;
+alias extern (C) void function(aGtkWidget *, int, int, int, int)TGTKgtk_widget_queue_clear_area; extern(D) TGTKgtk_widget_queue_clear_area gtk_widget_queue_clear_area;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_widget_queue_clear; extern(D) TGTKgtk_widget_queue_clear gtk_widget_queue_clear;
+alias extern (C) void function(aGtkWidget *, int, int, int, int)TGTKgtk_widget_queue_draw_area; extern(D) TGTKgtk_widget_queue_draw_area gtk_widget_queue_draw_area;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_widget_queue_draw; extern(D) TGTKgtk_widget_queue_draw gtk_widget_queue_draw;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_widget_unrealize; extern(D) TGTKgtk_widget_unrealize gtk_widget_unrealize;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_widget_realize; extern(D) TGTKgtk_widget_realize gtk_widget_realize;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_widget_unmap; extern(D) TGTKgtk_widget_unmap gtk_widget_unmap;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_widget_map; extern(D) TGTKgtk_widget_map gtk_widget_map;
+alias extern (C) int function(aGtkWidget *)TGTKgtk_widget_get_no_show_all; extern(D) TGTKgtk_widget_get_no_show_all gtk_widget_get_no_show_all;
+alias extern (C) void function(aGtkWidget *, int)TGTKgtk_widget_set_no_show_all; extern(D) TGTKgtk_widget_set_no_show_all gtk_widget_set_no_show_all;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_widget_hide_all; extern(D) TGTKgtk_widget_hide_all gtk_widget_hide_all;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_widget_show_all; extern(D) TGTKgtk_widget_show_all gtk_widget_show_all;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_widget_hide; extern(D) TGTKgtk_widget_hide gtk_widget_hide;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_widget_show_now; extern(D) TGTKgtk_widget_show_now gtk_widget_show_now;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_widget_show; extern(D) TGTKgtk_widget_show gtk_widget_show;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_widget_unparent; extern(D) TGTKgtk_widget_unparent gtk_widget_unparent;
+alias extern (C) void function(aGtkWidget *, char *, ...)TGTKgtk_widget_set; extern(D) TGTKgtk_widget_set gtk_widget_set;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_widget_unref; extern(D) TGTKgtk_widget_unref gtk_widget_unref;
+alias extern (C) _GtkWidget * function(aGtkWidget *)TGTKgtk_widget_ref; extern(D) TGTKgtk_widget_ref gtk_widget_ref;
+alias extern (C) void function(aGtkWidget *, _GtkWidget * *)TGTKgtk_widget_destroyed; extern(D) TGTKgtk_widget_destroyed gtk_widget_destroyed;
+alias extern (C) void function(aGtkWidget *)TGTKgtk_widget_destroy; extern(D) TGTKgtk_widget_destroy gtk_widget_destroy;
+alias extern (C) _GtkWidget * function(uint, char *, ...)TGTKgtk_widget_new; extern(D) TGTKgtk_widget_new gtk_widget_new;
+alias extern (C) uint function()TGTKgtk_widget_get_type; extern(D) TGTKgtk_widget_get_type gtk_widget_get_type;
+//alias extern (C) int function(_BCD_func__12993, _GValue *, _GParamSpec *, _GValue *)TGTK_gtk_settings_parse_convert; extern(D) TGTK_gtk_settings_parse_convert _gtk_settings_parse_convert;
+//alias extern (C) _BCD_func__12993 function(uint)TGTK_gtk_rc_property_parser_from_type; extern(D) TGTK_gtk_rc_property_parser_from_type _gtk_rc_property_parser_from_type;
+//alias extern (C) void function(_GdkEventSetting *)TGTK_gtk_settings_handle_event; extern(D) TGTK_gtk_settings_handle_event _gtk_settings_handle_event;
+//alias extern (C) void function(aGtkSettings *)TGTK_gtk_settings_reset_rc_values; extern(D) TGTK_gtk_settings_reset_rc_values _gtk_settings_reset_rc_values;
+//alias extern (C) void function(aGtkSettings *, char *, aGtkSettingsValue *)TGTK_gtk_settings_set_property_value_from_rc; extern(D) TGTK_gtk_settings_set_property_value_from_rc _gtk_settings_set_property_value_from_rc;
+alias extern (C) void function(aGtkSettings *, char *, double, char *)TGTKgtk_settings_set_double_property; extern(D) TGTKgtk_settings_set_double_property gtk_settings_set_double_property;
+alias extern (C) void function(aGtkSettings *, char *, int, char *)TGTKgtk_settings_set_long_property; extern(D) TGTKgtk_settings_set_long_property gtk_settings_set_long_property;
+alias extern (C) void function(aGtkSettings *, char *, char *, char *)TGTKgtk_settings_set_string_property; extern(D) TGTKgtk_settings_set_string_property gtk_settings_set_string_property;
+alias extern (C) void function(aGtkSettings *, char *, aGtkSettingsValue *)TGTKgtk_settings_set_property_value; extern(D) TGTKgtk_settings_set_property_value gtk_settings_set_property_value;
+alias extern (C) int function(_GParamSpec *, _GString *, _GValue *)TGTKgtk_rc_property_parse_border; extern(D) TGTKgtk_rc_property_parse_border gtk_rc_property_parse_border;
+alias extern (C) int function(_GParamSpec *, _GString *, _GValue *)TGTKgtk_rc_property_parse_requisition; extern(D) TGTKgtk_rc_property_parse_requisition gtk_rc_property_parse_requisition;
+alias extern (C) int function(_GParamSpec *, _GString *, _GValue *)TGTKgtk_rc_property_parse_flags; extern(D) TGTKgtk_rc_property_parse_flags gtk_rc_property_parse_flags;
+alias extern (C) int function(_GParamSpec *, _GString *, _GValue *)TGTKgtk_rc_property_parse_enum; extern(D) TGTKgtk_rc_property_parse_enum gtk_rc_property_parse_enum;
+alias extern (C) int function(_GParamSpec *, _GString *, _GValue *)TGTKgtk_rc_property_parse_color; extern(D) TGTKgtk_rc_property_parse_color gtk_rc_property_parse_color;
+alias extern (C) void function(_GParamSpec *, _BCD_func__12993)TGTKgtk_settings_install_property_parser; extern(D) TGTKgtk_settings_install_property_parser gtk_settings_install_property_parser;
+alias extern (C) void function(_GParamSpec *)TGTKgtk_settings_install_property; extern(D) TGTKgtk_settings_install_property gtk_settings_install_property;
+alias extern (C) _GtkSettings * function(_GdkScreen *)TGTKgtk_settings_get_for_screen; extern(D) TGTKgtk_settings_get_for_screen gtk_settings_get_for_screen;
+alias extern (C) _GtkSettings * function()TGTKgtk_settings_get_default; extern(D) TGTKgtk_settings_get_default gtk_settings_get_default;
+alias extern (C) uint function()TGTKgtk_settings_get_type; extern(D) TGTKgtk_settings_get_type gtk_settings_get_type;
+//alias extern (C) void function(aGtkSettings *)TGTK_gtk_rc_context_destroy; extern(D) TGTK_gtk_rc_context_destroy _gtk_rc_context_destroy;
+//alias extern (C) char * function(aGtkSettings *)TGTK_gtk_rc_context_get_default_font_name; extern(D) TGTK_gtk_rc_context_get_default_font_name _gtk_rc_context_get_default_font_name;
+//alias extern (C) _GSList * function(aGtkRcStyle *)TGTK_gtk_rc_style_get_color_hashes; extern(D) TGTK_gtk_rc_style_get_color_hashes _gtk_rc_style_get_color_hashes;
+//alias extern (C) void function(aGtkRcStyle *, uint, uint)TGTK_gtk_rc_style_unset_rc_property; extern(D) TGTK_gtk_rc_style_unset_rc_property _gtk_rc_style_unset_rc_property;
+//alias extern (C) void function(aGtkRcStyle *, aGtkRcProperty *)TGTK_gtk_rc_style_set_rc_property; extern(D) TGTK_gtk_rc_style_set_rc_property _gtk_rc_style_set_rc_property;
+//alias extern (C) _GtkRcProperty * function(aGtkRcStyle *, uint, uint)TGTK_gtk_rc_style_lookup_rc_property; extern(D) TGTK_gtk_rc_style_lookup_rc_property _gtk_rc_style_lookup_rc_property;
+alias extern (C) uint function(_GScanner *, int *)TGTKgtk_rc_parse_priority; extern(D) TGTKgtk_rc_parse_priority gtk_rc_parse_priority;
+alias extern (C) uint function(_GScanner *, int *)TGTKgtk_rc_parse_state; extern(D) TGTKgtk_rc_parse_state gtk_rc_parse_state;
+alias extern (C) uint function(_GScanner *, aGtkRcStyle *, _GdkColor *)TGTKgtk_rc_parse_color_full; extern(D) TGTKgtk_rc_parse_color_full gtk_rc_parse_color_full;
+alias extern (C) uint function(_GScanner *, _GdkColor *)TGTKgtk_rc_parse_color; extern(D) TGTKgtk_rc_parse_color gtk_rc_parse_color;
+alias extern (C) _GScanner * function()TGTKgtk_rc_scanner_new; extern(D) TGTKgtk_rc_scanner_new gtk_rc_scanner_new;
+alias extern (C) char * function()TGTKgtk_rc_get_im_module_file; extern(D) TGTKgtk_rc_get_im_module_file gtk_rc_get_im_module_file;
+alias extern (C) char * function()TGTKgtk_rc_get_im_module_path; extern(D) TGTKgtk_rc_get_im_module_path gtk_rc_get_im_module_path;
+alias extern (C) char * function()TGTKgtk_rc_get_module_dir; extern(D) TGTKgtk_rc_get_module_dir gtk_rc_get_module_dir;
+alias extern (C) char * function()TGTKgtk_rc_get_theme_dir; extern(D) TGTKgtk_rc_get_theme_dir gtk_rc_get_theme_dir;
+alias extern (C) char * function(char *)TGTKgtk_rc_find_module_in_path; extern(D) TGTKgtk_rc_find_module_in_path gtk_rc_find_module_in_path;
+alias extern (C) void function(aGtkRcStyle *)TGTKgtk_rc_style_unref; extern(D) TGTKgtk_rc_style_unref gtk_rc_style_unref;
+alias extern (C) void function(aGtkRcStyle *)TGTKgtk_rc_style_ref; extern(D) TGTKgtk_rc_style_ref gtk_rc_style_ref;
+alias extern (C) _GtkRcStyle * function(aGtkRcStyle *)TGTKgtk_rc_style_copy; extern(D) TGTKgtk_rc_style_copy gtk_rc_style_copy;
+alias extern (C) _GtkRcStyle * function()TGTKgtk_rc_style_new; extern(D) TGTKgtk_rc_style_new gtk_rc_style_new;
+alias extern (C) uint function()TGTKgtk_rc_style_get_type; extern(D) TGTKgtk_rc_style_get_type gtk_rc_style_get_type;
+alias extern (C) void function(aGtkRcStyle *, char *)TGTKgtk_rc_add_class_style; extern(D) TGTKgtk_rc_add_class_style gtk_rc_add_class_style;
+alias extern (C) void function(aGtkRcStyle *, char *)TGTKgtk_rc_add_widget_class_style; extern(D) TGTKgtk_rc_add_widget_class_style gtk_rc_add_widget_class_style;
+alias extern (C) void function(aGtkRcStyle *, char *)TGTKgtk_rc_add_widget_name_style; extern(D) TGTKgtk_rc_add_widget_name_style gtk_rc_add_widget_name_style;
+alias extern (C) int function()TGTKgtk_rc_reparse_all; extern(D) TGTKgtk_rc_reparse_all gtk_rc_reparse_all;
+alias extern (C) void function(char *)TGTKgtk_rc_parse_string; extern(D) TGTKgtk_rc_parse_string gtk_rc_parse_string;
+alias extern (C) void function(char *)TGTKgtk_rc_parse; extern(D) TGTKgtk_rc_parse gtk_rc_parse;
+alias extern (C) char * function(aGtkSettings *, _GScanner *, char *)TGTKgtk_rc_find_pixmap_in_path; extern(D) TGTKgtk_rc_find_pixmap_in_path gtk_rc_find_pixmap_in_path;
+alias extern (C) void function(aGtkSettings *)TGTKgtk_rc_reset_styles; extern(D) TGTKgtk_rc_reset_styles gtk_rc_reset_styles;
+alias extern (C) int function(aGtkSettings *, int)TGTKgtk_rc_reparse_all_for_settings; extern(D) TGTKgtk_rc_reparse_all_for_settings gtk_rc_reparse_all_for_settings;
+alias extern (C) _GtkStyle * function(aGtkSettings *, char *, char *, uint)TGTKgtk_rc_get_style_by_paths; extern(D) TGTKgtk_rc_get_style_by_paths gtk_rc_get_style_by_paths;
+alias extern (C) _GtkStyle * function(aGtkWidget *)TGTKgtk_rc_get_style; extern(D) TGTKgtk_rc_get_style gtk_rc_get_style;
+alias extern (C) char * * function()TGTKgtk_rc_get_default_files; extern(D) TGTKgtk_rc_get_default_files gtk_rc_get_default_files;
+alias extern (C) void function(char * *)TGTKgtk_rc_set_default_files; extern(D) TGTKgtk_rc_set_default_files gtk_rc_set_default_files;
+alias extern (C) void function(char *)TGTKgtk_rc_add_default_file; extern(D) TGTKgtk_rc_add_default_file gtk_rc_add_default_file;
+//alias extern (C) int function(_GSList *, int, char *, char *)TGTK_gtk_rc_match_widget_class; extern(D) TGTK_gtk_rc_match_widget_class _gtk_rc_match_widget_class;
+//alias extern (C) void function(_GSList *)TGTK_gtk_rc_free_widget_class_path; extern(D) TGTK_gtk_rc_free_widget_class_path _gtk_rc_free_widget_class_path;
+//alias extern (C) _GSList * function(char *)TGTK_gtk_rc_parse_widget_class_path; extern(D) TGTK_gtk_rc_parse_widget_class_path _gtk_rc_parse_widget_class_path;
+//alias extern (C) void function()TGTK_gtk_rc_init; extern(D) TGTK_gtk_rc_init _gtk_rc_init;
+//alias extern (C) void function(aGtkWidget *, _GdkColor *)TGTK_gtk_widget_get_cursor_color; extern(D) TGTK_gtk_widget_get_cursor_color _gtk_widget_get_cursor_color;
+//alias extern (C) _GdkGC * function(aGtkWidget *)TGTK_gtk_widget_get_cursor_gc; extern(D) TGTK_gtk_widget_get_cursor_gc _gtk_widget_get_cursor_gc;
+alias extern (C) void function(aGtkWidget *, _GdkDrawable *, _GdkRectangle *, _GdkRectangle *, int, int, int)TGTKgtk_draw_insertion_cursor; extern(D) TGTKgtk_draw_insertion_cursor gtk_draw_insertion_cursor;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, _GdkRectangle *, aGtkWidget *, char *, int, int, char *)TGTKgtk_paint_string; extern(D) TGTKgtk_paint_string gtk_paint_string;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, int, char *)TGTKgtk_draw_string; extern(D) TGTKgtk_draw_string gtk_draw_string;
+//alias extern (C) void function(_GdkColor *, _GdkColor *, double)TGTK_gtk_style_shade; extern(D) TGTK_gtk_style_shade _gtk_style_shade;
+//alias extern (C) void function(aGtkStyle *, aGtkSettings *)TGTK_gtk_style_init_for_settings; extern(D) TGTK_gtk_style_init_for_settings _gtk_style_init_for_settings;
+//alias extern (C) _GValue * function(aGtkStyle *, uint, _GParamSpec *, _BCD_func__12993)TGTK_gtk_style_peek_property_value; extern(D) TGTK_gtk_style_peek_property_value _gtk_style_peek_property_value;
+alias extern (C) void function(aGtkBorder *)TGTKgtk_border_free; extern(D) TGTKgtk_border_free gtk_border_free;
+alias extern (C) _GtkBorder * function(aGtkBorder *)TGTKgtk_border_copy; extern(D) TGTKgtk_border_copy gtk_border_copy;
+alias extern (C) uint function()TGTKgtk_border_get_type; extern(D) TGTKgtk_border_get_type gtk_border_get_type;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int, int)TGTKgtk_paint_resize_grip; extern(D) TGTKgtk_paint_resize_grip gtk_paint_resize_grip;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, int, int, void *)TGTKgtk_paint_layout; extern(D) TGTKgtk_paint_layout gtk_paint_layout;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int)TGTKgtk_paint_expander; extern(D) TGTKgtk_paint_expander gtk_paint_expander;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int, int)TGTKgtk_paint_handle; extern(D) TGTKgtk_paint_handle gtk_paint_handle;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int, int)TGTKgtk_paint_slider; extern(D) TGTKgtk_paint_slider gtk_paint_slider;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int)TGTKgtk_paint_focus; extern(D) TGTKgtk_paint_focus gtk_paint_focus;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int, int)TGTKgtk_paint_extension; extern(D) TGTKgtk_paint_extension gtk_paint_extension;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int, int, int, int)TGTKgtk_paint_box_gap; extern(D) TGTKgtk_paint_box_gap gtk_paint_box_gap;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int, int, int, int)TGTKgtk_paint_shadow_gap; extern(D) TGTKgtk_paint_shadow_gap gtk_paint_shadow_gap;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int)TGTKgtk_paint_tab; extern(D) TGTKgtk_paint_tab gtk_paint_tab;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int)TGTKgtk_paint_option; extern(D) TGTKgtk_paint_option gtk_paint_option;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int)TGTKgtk_paint_check; extern(D) TGTKgtk_paint_check gtk_paint_check;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int)TGTKgtk_paint_flat_box; extern(D) TGTKgtk_paint_flat_box gtk_paint_flat_box;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int)TGTKgtk_paint_box; extern(D) TGTKgtk_paint_box gtk_paint_box;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int)TGTKgtk_paint_diamond; extern(D) TGTKgtk_paint_diamond gtk_paint_diamond;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int, int, int)TGTKgtk_paint_arrow; extern(D) TGTKgtk_paint_arrow gtk_paint_arrow;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, _GdkPoint *, int, int)TGTKgtk_paint_polygon; extern(D) TGTKgtk_paint_polygon gtk_paint_polygon;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int)TGTKgtk_paint_shadow; extern(D) TGTKgtk_paint_shadow gtk_paint_shadow;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int)TGTKgtk_paint_vline; extern(D) TGTKgtk_paint_vline gtk_paint_vline;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int)TGTKgtk_paint_hline; extern(D) TGTKgtk_paint_hline gtk_paint_hline;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, int, int, int, int)TGTKgtk_draw_resize_grip; extern(D) TGTKgtk_draw_resize_grip gtk_draw_resize_grip;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, int, int, void *)TGTKgtk_draw_layout; extern(D) TGTKgtk_draw_layout gtk_draw_layout;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, int, int)TGTKgtk_draw_expander; extern(D) TGTKgtk_draw_expander gtk_draw_expander;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, int, int, int, int, int)TGTKgtk_draw_handle; extern(D) TGTKgtk_draw_handle gtk_draw_handle;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, int, int, int, int, int)TGTKgtk_draw_slider; extern(D) TGTKgtk_draw_slider gtk_draw_slider;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, int, int)TGTKgtk_draw_focus; extern(D) TGTKgtk_draw_focus gtk_draw_focus;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, int, int, int, int, int)TGTKgtk_draw_extension; extern(D) TGTKgtk_draw_extension gtk_draw_extension;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, int, int, int, int, int, int, int)TGTKgtk_draw_box_gap; extern(D) TGTKgtk_draw_box_gap gtk_draw_box_gap;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, int, int, int, int, int, int, int)TGTKgtk_draw_shadow_gap; extern(D) TGTKgtk_draw_shadow_gap gtk_draw_shadow_gap;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, int, int, int, int)TGTKgtk_draw_tab; extern(D) TGTKgtk_draw_tab gtk_draw_tab;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, int, int, int, int)TGTKgtk_draw_option; extern(D) TGTKgtk_draw_option gtk_draw_option;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, int, int, int, int)TGTKgtk_draw_check; extern(D) TGTKgtk_draw_check gtk_draw_check;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, int, int, int, int)TGTKgtk_draw_flat_box; extern(D) TGTKgtk_draw_flat_box gtk_draw_flat_box;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, int, int, int, int)TGTKgtk_draw_box; extern(D) TGTKgtk_draw_box gtk_draw_box;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, int, int, int, int)TGTKgtk_draw_diamond; extern(D) TGTKgtk_draw_diamond gtk_draw_diamond;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, int, int, int, int, int, int)TGTKgtk_draw_arrow; extern(D) TGTKgtk_draw_arrow gtk_draw_arrow;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, _GdkPoint *, int, int)TGTKgtk_draw_polygon; extern(D) TGTKgtk_draw_polygon gtk_draw_polygon;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, int, int, int, int)TGTKgtk_draw_shadow; extern(D) TGTKgtk_draw_shadow gtk_draw_shadow;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, int, int)TGTKgtk_draw_vline; extern(D) TGTKgtk_draw_vline gtk_draw_vline;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, int, int)TGTKgtk_draw_hline; extern(D) TGTKgtk_draw_hline gtk_draw_hline;
+alias extern (C) void * function(aGtkStyle *, void *, int, int, int, aGtkWidget *, char *)TGTKgtk_style_render_icon; extern(D) TGTKgtk_style_render_icon gtk_style_render_icon;
+alias extern (C) int function(aGtkStyle *, char *, _GdkColor *)TGTKgtk_style_lookup_color; extern(D) TGTKgtk_style_lookup_color gtk_style_lookup_color;
+alias extern (C) void * function(aGtkStyle *, char *)TGTKgtk_style_lookup_icon_set; extern(D) TGTKgtk_style_lookup_icon_set gtk_style_lookup_icon_set;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, int, int, int, int)TGTKgtk_style_apply_default_background; extern(D) TGTKgtk_style_apply_default_background gtk_style_apply_default_background;
+alias extern (C) void function(aGtkStyle *, _GdkDrawable *, int)TGTKgtk_style_set_background; extern(D) TGTKgtk_style_set_background gtk_style_set_background;
+alias extern (C) void function(aGtkStyle *, _GdkFont *)TGTKgtk_style_set_font; extern(D) TGTKgtk_style_set_font gtk_style_set_font;
+alias extern (C) _GdkFont * function(aGtkStyle *)TGTKgtk_style_get_font; extern(D) TGTKgtk_style_get_font gtk_style_get_font;
+alias extern (C) void function(aGtkStyle *)TGTKgtk_style_unref; extern(D) TGTKgtk_style_unref gtk_style_unref;
+alias extern (C) _GtkStyle * function(aGtkStyle *)TGTKgtk_style_ref; extern(D) TGTKgtk_style_ref gtk_style_ref;
+alias extern (C) void function(aGtkStyle *)TGTKgtk_style_detach; extern(D) TGTKgtk_style_detach gtk_style_detach;
+alias extern (C) _GtkStyle * function(aGtkStyle *, _GdkDrawable *)TGTKgtk_style_attach; extern(D) TGTKgtk_style_attach gtk_style_attach;
+alias extern (C) _GtkStyle * function(aGtkStyle *)TGTKgtk_style_copy; extern(D) TGTKgtk_style_copy gtk_style_copy;
+alias extern (C) _GtkStyle * function()TGTKgtk_style_new; extern(D) TGTKgtk_style_new gtk_style_new;
+alias extern (C) uint function()TGTKgtk_style_get_type; extern(D) TGTKgtk_style_get_type gtk_style_get_type;
+alias extern (C) void function(aGtkAdjustment *, double)TGTKgtk_adjustment_set_value; extern(D) TGTKgtk_adjustment_set_value gtk_adjustment_set_value;
+alias extern (C) double function(aGtkAdjustment *)TGTKgtk_adjustment_get_value; extern(D) TGTKgtk_adjustment_get_value gtk_adjustment_get_value;
+alias extern (C) void function(aGtkAdjustment *, double, double)TGTKgtk_adjustment_clamp_page; extern(D) TGTKgtk_adjustment_clamp_page gtk_adjustment_clamp_page;
+alias extern (C) void function(aGtkAdjustment *)TGTKgtk_adjustment_value_changed; extern(D) TGTKgtk_adjustment_value_changed gtk_adjustment_value_changed;
+alias extern (C) void function(aGtkAdjustment *)TGTKgtk_adjustment_changed; extern(D) TGTKgtk_adjustment_changed gtk_adjustment_changed;
+alias extern (C) _GtkObject * function(double, double, double, double, double, double)TGTKgtk_adjustment_new; extern(D) TGTKgtk_adjustment_new gtk_adjustment_new;
+alias extern (C) uint function()TGTKgtk_adjustment_get_type; extern(D) TGTKgtk_adjustment_get_type gtk_adjustment_get_type;
+alias extern (C) void function(char *, uint, uint, uint)TGTKgtk_object_add_arg_type; extern(D) TGTKgtk_object_add_arg_type gtk_object_add_arg_type;
+alias extern (C) void function(aGtkObject *, char *, ...)TGTKgtk_object_set; extern(D) TGTKgtk_object_set gtk_object_set;
+alias extern (C) void function(aGtkObject *, char *, ...)TGTKgtk_object_get; extern(D) TGTKgtk_object_get gtk_object_get;
+alias extern (C) void function(aGtkObject *, uint)TGTKgtk_object_remove_no_notify_by_id; extern(D) TGTKgtk_object_remove_no_notify_by_id gtk_object_remove_no_notify_by_id;
+alias extern (C) void function(aGtkObject *, uint)TGTKgtk_object_remove_data_by_id; extern(D) TGTKgtk_object_remove_data_by_id gtk_object_remove_data_by_id;
+alias extern (C) void * function(aGtkObject *, uint)TGTKgtk_object_get_data_by_id; extern(D) TGTKgtk_object_get_data_by_id gtk_object_get_data_by_id;
+alias extern (C) void function(aGtkObject *, uint, void *, _BCD_func__13158)TGTKgtk_object_set_data_by_id_full; extern(D) TGTKgtk_object_set_data_by_id_full gtk_object_set_data_by_id_full;
+alias extern (C) void function(aGtkObject *, uint, void *)TGTKgtk_object_set_data_by_id; extern(D) TGTKgtk_object_set_data_by_id gtk_object_set_data_by_id;
+alias extern (C) void * function(aGtkObject *)TGTKgtk_object_get_user_data; extern(D) TGTKgtk_object_get_user_data gtk_object_get_user_data;
+alias extern (C) void function(aGtkObject *, void *)TGTKgtk_object_set_user_data; extern(D) TGTKgtk_object_set_user_data gtk_object_set_user_data;
+alias extern (C) void function(aGtkObject *, char *)TGTKgtk_object_remove_no_notify; extern(D) TGTKgtk_object_remove_no_notify gtk_object_remove_no_notify;
+alias extern (C) void * function(aGtkObject *, char *)TGTKgtk_object_get_data; extern(D) TGTKgtk_object_get_data gtk_object_get_data;
+alias extern (C) void function(aGtkObject *, char *)TGTKgtk_object_remove_data; extern(D) TGTKgtk_object_remove_data gtk_object_remove_data;
+alias extern (C) void function(aGtkObject *, char *, void *, _BCD_func__13158)TGTKgtk_object_set_data_full; extern(D) TGTKgtk_object_set_data_full gtk_object_set_data_full;
+alias extern (C) void function(aGtkObject *, char *, void *)TGTKgtk_object_set_data; extern(D) TGTKgtk_object_set_data gtk_object_set_data;
+alias extern (C) void function(aGtkObject *, _BCD_func__13158, void *)TGTKgtk_object_weakunref; extern(D) TGTKgtk_object_weakunref gtk_object_weakunref;
+alias extern (C) void function(aGtkObject *, _BCD_func__13158, void *)TGTKgtk_object_weakref; extern(D) TGTKgtk_object_weakref gtk_object_weakref;
+alias extern (C) void function(aGtkObject *)TGTKgtk_object_unref; extern(D) TGTKgtk_object_unref gtk_object_unref;
+alias extern (C) _GtkObject * function(aGtkObject *)TGTKgtk_object_ref; extern(D) TGTKgtk_object_ref gtk_object_ref;
+alias extern (C) _GtkObject * function(uint, char *, ...)TGTKgtk_object_new; extern(D) TGTKgtk_object_new gtk_object_new;
+alias extern (C) void function(aGtkObject *)TGTKgtk_object_destroy; extern(D) TGTKgtk_object_destroy gtk_object_destroy;
+alias extern (C) void function(aGtkObject *)TGTKgtk_object_sink; extern(D) TGTKgtk_object_sink gtk_object_sink;
+alias extern (C) uint function()TGTKgtk_object_get_type; extern(D) TGTKgtk_object_get_type gtk_object_get_type;
+alias extern (C) extern uint* TGTKgtk_debug_flags; extern(D) TGTKgtk_debug_flags gtk_debug_flags;
+alias extern (C) void function(int)TGTKgtk_type_init; extern(D) TGTKgtk_type_init gtk_type_init;
+alias extern (C) _GFlagsValue * function(uint, char *)TGTKgtk_type_flags_find_value; extern(D) TGTKgtk_type_flags_find_value gtk_type_flags_find_value;
+alias extern (C) _GEnumValue * function(uint, char *)TGTKgtk_type_enum_find_value; extern(D) TGTKgtk_type_enum_find_value gtk_type_enum_find_value;
+alias extern (C) _GFlagsValue * function(uint)TGTKgtk_type_flags_get_values; extern(D) TGTKgtk_type_flags_get_values gtk_type_flags_get_values;
+alias extern (C) _GEnumValue * function(uint)TGTKgtk_type_enum_get_values; extern(D) TGTKgtk_type_enum_get_values gtk_type_enum_get_values;
+alias extern (C) void * function(uint)TGTKgtk_type_new; extern(D) TGTKgtk_type_new gtk_type_new;
+alias extern (C) uint function(uint, aGtkTypeInfo *)TGTKgtk_type_unique; extern(D) TGTKgtk_type_unique gtk_type_unique;
+alias extern (C) void * function(uint)TGTKgtk_type_class; extern(D) TGTKgtk_type_class gtk_type_class;
+alias extern (C) uint function()TGTKgtk_identifier_get_type; extern(D) TGTKgtk_identifier_get_type gtk_identifier_get_type;
+alias extern (C) uint function()TGTKgtk_widget_help_type_get_type; extern(D) TGTKgtk_widget_help_type_get_type gtk_widget_help_type_get_type;
+alias extern (C) uint function()TGTKgtk_widget_flags_get_type; extern(D) TGTKgtk_widget_flags_get_type gtk_widget_flags_get_type;
+alias extern (C) uint function()TGTKgtk_ui_manager_item_type_get_type; extern(D) TGTKgtk_ui_manager_item_type_get_type gtk_ui_manager_item_type_get_type;
+alias extern (C) uint function()TGTKgtk_tree_view_column_sizing_get_type; extern(D) TGTKgtk_tree_view_column_sizing_get_type gtk_tree_view_column_sizing_get_type;
+alias extern (C) uint function()TGTKgtk_tree_view_drop_position_get_type; extern(D) TGTKgtk_tree_view_drop_position_get_type gtk_tree_view_drop_position_get_type;
+alias extern (C) uint function()TGTKgtk_tree_model_flags_get_type; extern(D) TGTKgtk_tree_model_flags_get_type gtk_tree_model_flags_get_type;
+alias extern (C) uint function()TGTKgtk_tree_view_mode_get_type; extern(D) TGTKgtk_tree_view_mode_get_type gtk_tree_view_mode_get_type;
+alias extern (C) uint function()TGTKgtk_toolbar_space_style_get_type; extern(D) TGTKgtk_toolbar_space_style_get_type gtk_toolbar_space_style_get_type;
+alias extern (C) uint function()TGTKgtk_toolbar_child_type_get_type; extern(D) TGTKgtk_toolbar_child_type_get_type gtk_toolbar_child_type_get_type;
+alias extern (C) uint function()TGTKgtk_text_window_type_get_type; extern(D) TGTKgtk_text_window_type_get_type gtk_text_window_type_get_type;
+alias extern (C) uint function()TGTKgtk_text_search_flags_get_type; extern(D) TGTKgtk_text_search_flags_get_type gtk_text_search_flags_get_type;
+alias extern (C) uint function()TGTKgtk_text_buffer_target_info_get_type; extern(D) TGTKgtk_text_buffer_target_info_get_type gtk_text_buffer_target_info_get_type;
+alias extern (C) uint function()TGTKgtk_spin_type_get_type; extern(D) TGTKgtk_spin_type_get_type gtk_spin_type_get_type;
+alias extern (C) uint function()TGTKgtk_spin_button_update_policy_get_type; extern(D) TGTKgtk_spin_button_update_policy_get_type gtk_spin_button_update_policy_get_type;
+alias extern (C) uint function()TGTKgtk_size_group_mode_get_type; extern(D) TGTKgtk_size_group_mode_get_type gtk_size_group_mode_get_type;
+alias extern (C) uint function()TGTKgtk_recent_manager_error_get_type; extern(D) TGTKgtk_recent_manager_error_get_type gtk_recent_manager_error_get_type;
+alias extern (C) uint function()TGTKgtk_recent_filter_flags_get_type; extern(D) TGTKgtk_recent_filter_flags_get_type gtk_recent_filter_flags_get_type;
+alias extern (C) uint function()TGTKgtk_recent_chooser_error_get_type; extern(D) TGTKgtk_recent_chooser_error_get_type gtk_recent_chooser_error_get_type;
+alias extern (C) uint function()TGTKgtk_recent_sort_type_get_type; extern(D) TGTKgtk_recent_sort_type_get_type gtk_recent_sort_type_get_type;
+alias extern (C) uint function()TGTKgtk_rc_token_type_get_type; extern(D) TGTKgtk_rc_token_type_get_type gtk_rc_token_type_get_type;
+alias extern (C) uint function()TGTKgtk_rc_flags_get_type; extern(D) TGTKgtk_rc_flags_get_type gtk_rc_flags_get_type;
+alias extern (C) uint function()TGTKgtk_progress_bar_orientation_get_type; extern(D) TGTKgtk_progress_bar_orientation_get_type gtk_progress_bar_orientation_get_type;
+alias extern (C) uint function()TGTKgtk_progress_bar_style_get_type; extern(D) TGTKgtk_progress_bar_style_get_type gtk_progress_bar_style_get_type;
+alias extern (C) uint function()TGTKgtk_private_flags_get_type; extern(D) TGTKgtk_private_flags_get_type gtk_private_flags_get_type;
+alias extern (C) uint function()TGTKgtk_print_error_get_type; extern(D) TGTKgtk_print_error_get_type gtk_print_error_get_type;
+alias extern (C) uint function()TGTKgtk_print_operation_action_get_type; extern(D) TGTKgtk_print_operation_action_get_type gtk_print_operation_action_get_type;
+alias extern (C) uint function()TGTKgtk_print_operation_result_get_type; extern(D) TGTKgtk_print_operation_result_get_type gtk_print_operation_result_get_type;
+alias extern (C) uint function()TGTKgtk_print_status_get_type; extern(D) TGTKgtk_print_status_get_type gtk_print_status_get_type;
+alias extern (C) uint function()TGTKgtk_arg_flags_get_type; extern(D) TGTKgtk_arg_flags_get_type gtk_arg_flags_get_type;
+alias extern (C) uint function()TGTKgtk_object_flags_get_type; extern(D) TGTKgtk_object_flags_get_type gtk_object_flags_get_type;
+alias extern (C) uint function()TGTKgtk_notebook_tab_get_type; extern(D) TGTKgtk_notebook_tab_get_type gtk_notebook_tab_get_type;
+alias extern (C) uint function()TGTKgtk_buttons_type_get_type; extern(D) TGTKgtk_buttons_type_get_type gtk_buttons_type_get_type;
+alias extern (C) uint function()TGTKgtk_message_type_get_type; extern(D) TGTKgtk_message_type_get_type gtk_message_type_get_type;
+alias extern (C) uint function()TGTKgtk_image_type_get_type; extern(D) TGTKgtk_image_type_get_type gtk_image_type_get_type;
+alias extern (C) uint function()TGTKgtk_icon_view_drop_position_get_type; extern(D) TGTKgtk_icon_view_drop_position_get_type gtk_icon_view_drop_position_get_type;
+alias extern (C) uint function()TGTKgtk_icon_theme_error_get_type; extern(D) TGTKgtk_icon_theme_error_get_type gtk_icon_theme_error_get_type;
+alias extern (C) uint function()TGTKgtk_icon_lookup_flags_get_type; extern(D) TGTKgtk_icon_lookup_flags_get_type gtk_icon_lookup_flags_get_type;
+alias extern (C) uint function()TGTKgtk_file_filter_flags_get_type; extern(D) TGTKgtk_file_filter_flags_get_type gtk_file_filter_flags_get_type;
+alias extern (C) uint function()TGTKgtk_file_chooser_error_get_type; extern(D) TGTKgtk_file_chooser_error_get_type gtk_file_chooser_error_get_type;
+alias extern (C) uint function()TGTKgtk_file_chooser_confirmation_get_type; extern(D) TGTKgtk_file_chooser_confirmation_get_type gtk_file_chooser_confirmation_get_type;
+alias extern (C) uint function()TGTKgtk_file_chooser_action_get_type; extern(D) TGTKgtk_file_chooser_action_get_type gtk_file_chooser_action_get_type;
+alias extern (C) uint function()TGTKgtk_drag_result_get_type; extern(D) TGTKgtk_drag_result_get_type gtk_drag_result_get_type;
+alias extern (C) uint function()TGTKgtk_tree_view_grid_lines_get_type; extern(D) TGTKgtk_tree_view_grid_lines_get_type gtk_tree_view_grid_lines_get_type;
+alias extern (C) uint function()TGTKgtk_unit_get_type; extern(D) TGTKgtk_unit_get_type gtk_unit_get_type;
+alias extern (C) uint function()TGTKgtk_print_duplex_get_type; extern(D) TGTKgtk_print_duplex_get_type gtk_print_duplex_get_type;
+alias extern (C) uint function()TGTKgtk_print_quality_get_type; extern(D) TGTKgtk_print_quality_get_type gtk_print_quality_get_type;
+alias extern (C) uint function()TGTKgtk_page_orientation_get_type; extern(D) TGTKgtk_page_orientation_get_type gtk_page_orientation_get_type;
+alias extern (C) uint function()TGTKgtk_page_set_get_type; extern(D) TGTKgtk_page_set_get_type gtk_page_set_get_type;
+alias extern (C) uint function()TGTKgtk_print_pages_get_type; extern(D) TGTKgtk_print_pages_get_type gtk_print_pages_get_type;
+alias extern (C) uint function()TGTKgtk_pack_direction_get_type; extern(D) TGTKgtk_pack_direction_get_type gtk_pack_direction_get_type;
+alias extern (C) uint function()TGTKgtk_im_status_style_get_type; extern(D) TGTKgtk_im_status_style_get_type gtk_im_status_style_get_type;
+alias extern (C) uint function()TGTKgtk_im_preedit_style_get_type; extern(D) TGTKgtk_im_preedit_style_get_type gtk_im_preedit_style_get_type;
+alias extern (C) uint function()TGTKgtk_sort_type_get_type; extern(D) TGTKgtk_sort_type_get_type gtk_sort_type_get_type;
+alias extern (C) uint function()TGTKgtk_wrap_mode_get_type; extern(D) TGTKgtk_wrap_mode_get_type gtk_wrap_mode_get_type;
+alias extern (C) uint function()TGTKgtk_window_type_get_type; extern(D) TGTKgtk_window_type_get_type gtk_window_type_get_type;
+alias extern (C) uint function()TGTKgtk_window_position_get_type; extern(D) TGTKgtk_window_position_get_type gtk_window_position_get_type;
+alias extern (C) uint function()TGTKgtk_visibility_get_type; extern(D) TGTKgtk_visibility_get_type gtk_visibility_get_type;
+alias extern (C) uint function()TGTKgtk_update_type_get_type; extern(D) TGTKgtk_update_type_get_type gtk_update_type_get_type;
+alias extern (C) uint function()TGTKgtk_toolbar_style_get_type; extern(D) TGTKgtk_toolbar_style_get_type gtk_toolbar_style_get_type;
+alias extern (C) uint function()TGTKgtk_submenu_placement_get_type; extern(D) TGTKgtk_submenu_placement_get_type gtk_submenu_placement_get_type;
+alias extern (C) uint function()TGTKgtk_submenu_direction_get_type; extern(D) TGTKgtk_submenu_direction_get_type gtk_submenu_direction_get_type;
+alias extern (C) uint function()TGTKgtk_state_type_get_type; extern(D) TGTKgtk_state_type_get_type gtk_state_type_get_type;
+alias extern (C) uint function()TGTKgtk_shadow_type_get_type; extern(D) TGTKgtk_shadow_type_get_type gtk_shadow_type_get_type;
+alias extern (C) uint function()TGTKgtk_selection_mode_get_type; extern(D) TGTKgtk_selection_mode_get_type gtk_selection_mode_get_type;
+alias extern (C) uint function()TGTKgtk_scroll_type_get_type; extern(D) TGTKgtk_scroll_type_get_type gtk_scroll_type_get_type;
+alias extern (C) uint function()TGTKgtk_signal_run_type_get_type; extern(D) TGTKgtk_signal_run_type_get_type gtk_signal_run_type_get_type;
+alias extern (C) uint function()TGTKgtk_resize_mode_get_type; extern(D) TGTKgtk_resize_mode_get_type gtk_resize_mode_get_type;
+alias extern (C) uint function()TGTKgtk_relief_style_get_type; extern(D) TGTKgtk_relief_style_get_type gtk_relief_style_get_type;
+alias extern (C) uint function()TGTKgtk_preview_type_get_type; extern(D) TGTKgtk_preview_type_get_type gtk_preview_type_get_type;
+alias extern (C) uint function()TGTKgtk_position_type_get_type; extern(D) TGTKgtk_position_type_get_type gtk_position_type_get_type;
+alias extern (C) uint function()TGTKgtk_policy_type_get_type; extern(D) TGTKgtk_policy_type_get_type gtk_policy_type_get_type;
+alias extern (C) uint function()TGTKgtk_path_type_get_type; extern(D) TGTKgtk_path_type_get_type gtk_path_type_get_type;
+alias extern (C) uint function()TGTKgtk_path_priority_type_get_type; extern(D) TGTKgtk_path_priority_type_get_type gtk_path_priority_type_get_type;
+alias extern (C) uint function()TGTKgtk_pack_type_get_type; extern(D) TGTKgtk_pack_type_get_type gtk_pack_type_get_type;
+alias extern (C) uint function()TGTKgtk_corner_type_get_type; extern(D) TGTKgtk_corner_type_get_type gtk_corner_type_get_type;
+alias extern (C) uint function()TGTKgtk_orientation_get_type; extern(D) TGTKgtk_orientation_get_type gtk_orientation_get_type;
+alias extern (C) uint function()TGTKgtk_scroll_step_get_type; extern(D) TGTKgtk_scroll_step_get_type gtk_scroll_step_get_type;
+alias extern (C) uint function()TGTKgtk_movement_step_get_type; extern(D) TGTKgtk_movement_step_get_type gtk_movement_step_get_type;
+alias extern (C) uint function()TGTKgtk_metric_type_get_type; extern(D) TGTKgtk_metric_type_get_type gtk_metric_type_get_type;
+alias extern (C) uint function()TGTKgtk_menu_direction_type_get_type; extern(D) TGTKgtk_menu_direction_type_get_type gtk_menu_direction_type_get_type;
+alias extern (C) uint function()TGTKgtk_match_type_get_type; extern(D) TGTKgtk_match_type_get_type gtk_match_type_get_type;
+alias extern (C) uint function()TGTKgtk_justification_get_type; extern(D) TGTKgtk_justification_get_type gtk_justification_get_type;
+alias extern (C) uint function()TGTKgtk_text_direction_get_type; extern(D) TGTKgtk_text_direction_get_type gtk_text_direction_get_type;
+alias extern (C) uint function()TGTKgtk_side_type_get_type; extern(D) TGTKgtk_side_type_get_type gtk_side_type_get_type;
+alias extern (C) uint function()TGTKgtk_sensitivity_type_get_type; extern(D) TGTKgtk_sensitivity_type_get_type gtk_sensitivity_type_get_type;
+alias extern (C) uint function()TGTKgtk_icon_size_get_type; extern(D) TGTKgtk_icon_size_get_type gtk_icon_size_get_type;
+alias extern (C) uint function()TGTKgtk_expander_style_get_type; extern(D) TGTKgtk_expander_style_get_type gtk_expander_style_get_type;
+alias extern (C) uint function()TGTKgtk_direction_type_get_type; extern(D) TGTKgtk_direction_type_get_type gtk_direction_type_get_type;
+alias extern (C) uint function()TGTKgtk_delete_type_get_type; extern(D) TGTKgtk_delete_type_get_type gtk_delete_type_get_type;
+alias extern (C) uint function()TGTKgtk_curve_type_get_type; extern(D) TGTKgtk_curve_type_get_type gtk_curve_type_get_type;
+alias extern (C) uint function()TGTKgtk_button_box_style_get_type; extern(D) TGTKgtk_button_box_style_get_type gtk_button_box_style_get_type;
+alias extern (C) uint function()TGTKgtk_attach_options_get_type; extern(D) TGTKgtk_attach_options_get_type gtk_attach_options_get_type;
+alias extern (C) uint function()TGTKgtk_arrow_type_get_type; extern(D) TGTKgtk_arrow_type_get_type gtk_arrow_type_get_type;
+alias extern (C) uint function()TGTKgtk_anchor_type_get_type; extern(D) TGTKgtk_anchor_type_get_type gtk_anchor_type_get_type;
+alias extern (C) uint function()TGTKgtk_target_flags_get_type; extern(D) TGTKgtk_target_flags_get_type gtk_target_flags_get_type;
+alias extern (C) uint function()TGTKgtk_dest_defaults_get_type; extern(D) TGTKgtk_dest_defaults_get_type gtk_dest_defaults_get_type;
+alias extern (C) uint function()TGTKgtk_response_type_get_type; extern(D) TGTKgtk_response_type_get_type gtk_response_type_get_type;
+alias extern (C) uint function()TGTKgtk_dialog_flags_get_type; extern(D) TGTKgtk_dialog_flags_get_type gtk_dialog_flags_get_type;
+alias extern (C) uint function()TGTKgtk_debug_flag_get_type; extern(D) TGTKgtk_debug_flag_get_type gtk_debug_flag_get_type;
+alias extern (C) uint function()TGTKgtk_ctree_expansion_type_get_type; extern(D) TGTKgtk_ctree_expansion_type_get_type gtk_ctree_expansion_type_get_type;
+alias extern (C) uint function()TGTKgtk_ctree_expander_style_get_type; extern(D) TGTKgtk_ctree_expander_style_get_type gtk_ctree_expander_style_get_type;
+alias extern (C) uint function()TGTKgtk_ctree_line_style_get_type; extern(D) TGTKgtk_ctree_line_style_get_type gtk_ctree_line_style_get_type;
+alias extern (C) uint function()TGTKgtk_ctree_pos_get_type; extern(D) TGTKgtk_ctree_pos_get_type gtk_ctree_pos_get_type;
+alias extern (C) uint function()TGTKgtk_button_action_get_type; extern(D) TGTKgtk_button_action_get_type gtk_button_action_get_type;
+alias extern (C) uint function()TGTKgtk_clist_drag_pos_get_type; extern(D) TGTKgtk_clist_drag_pos_get_type gtk_clist_drag_pos_get_type;
+alias extern (C) uint function()TGTKgtk_cell_type_get_type; extern(D) TGTKgtk_cell_type_get_type gtk_cell_type_get_type;
+alias extern (C) uint function()TGTKgtk_cell_renderer_accel_mode_get_type; extern(D) TGTKgtk_cell_renderer_accel_mode_get_type gtk_cell_renderer_accel_mode_get_type;
+alias extern (C) uint function()TGTKgtk_cell_renderer_mode_get_type; extern(D) TGTKgtk_cell_renderer_mode_get_type gtk_cell_renderer_mode_get_type;
+alias extern (C) uint function()TGTKgtk_cell_renderer_state_get_type; extern(D) TGTKgtk_cell_renderer_state_get_type gtk_cell_renderer_state_get_type;
+alias extern (C) uint function()TGTKgtk_calendar_display_options_get_type; extern(D) TGTKgtk_calendar_display_options_get_type gtk_calendar_display_options_get_type;
+alias extern (C) uint function()TGTKgtk_builder_error_get_type; extern(D) TGTKgtk_builder_error_get_type gtk_builder_error_get_type;
+alias extern (C) uint function()TGTKgtk_assistant_page_type_get_type; extern(D) TGTKgtk_assistant_page_type_get_type gtk_assistant_page_type_get_type;
+alias extern (C) uint function()TGTKgtk_accel_flags_get_type; extern(D) TGTKgtk_accel_flags_get_type gtk_accel_flags_get_type;
+//alias extern (C) void function(aGtkAccelGroup *, uint)TGTK_gtk_accel_group_reconnect; extern(D) TGTK_gtk_accel_group_reconnect _gtk_accel_group_reconnect;
+alias extern (C) _GtkAccelGroupEntry * function(aGtkAccelGroup *, uint, int, uint *)TGTKgtk_accel_group_query; extern(D) TGTKgtk_accel_group_query gtk_accel_group_query;
+alias extern (C) uint function()TGTKgtk_accelerator_get_default_mod_mask; extern(D) TGTKgtk_accelerator_get_default_mod_mask gtk_accelerator_get_default_mod_mask;
+alias extern (C) void function(int)TGTKgtk_accelerator_set_default_mod_mask; extern(D) TGTKgtk_accelerator_set_default_mod_mask gtk_accelerator_set_default_mod_mask;
+alias extern (C) char * function(uint, int)TGTKgtk_accelerator_get_label; extern(D) TGTKgtk_accelerator_get_label gtk_accelerator_get_label;
+alias extern (C) char * function(uint, int)TGTKgtk_accelerator_name; extern(D) TGTKgtk_accelerator_name gtk_accelerator_name;
+alias extern (C) void function(char *, uint *, int *)TGTKgtk_accelerator_parse; extern(D) TGTKgtk_accelerator_parse gtk_accelerator_parse;
+alias extern (C) int function(uint, int)TGTKgtk_accelerator_valid; extern(D) TGTKgtk_accelerator_valid gtk_accelerator_valid;
+alias extern (C) _GtkAccelGroup * function(_GClosure *)TGTKgtk_accel_group_from_accel_closure; extern(D) TGTKgtk_accel_group_from_accel_closure gtk_accel_group_from_accel_closure;
+alias extern (C) _GtkAccelKey * function(aGtkAccelGroup *, _BCD_func__13177, void *)TGTKgtk_accel_group_find; extern(D) TGTKgtk_accel_group_find gtk_accel_group_find;
+alias extern (C) _GSList * function(_GObject *)TGTKgtk_accel_groups_from_object; extern(D) TGTKgtk_accel_groups_from_object gtk_accel_groups_from_object;
+alias extern (C) int function(_GObject *, uint, int)TGTKgtk_accel_groups_activate; extern(D) TGTKgtk_accel_groups_activate gtk_accel_groups_activate;
+//alias extern (C) void function(aGtkAccelGroup *, _GObject *)TGTK_gtk_accel_group_detach; extern(D) TGTK_gtk_accel_group_detach _gtk_accel_group_detach;
+//alias extern (C) void function(aGtkAccelGroup *, _GObject *)TGTK_gtk_accel_group_attach; extern(D) TGTK_gtk_accel_group_attach _gtk_accel_group_attach;
+alias extern (C) int function(aGtkAccelGroup *, uint, _GObject *, uint, int)TGTKgtk_accel_group_activate; extern(D) TGTKgtk_accel_group_activate gtk_accel_group_activate;
+alias extern (C) int function(aGtkAccelGroup *, uint, int)TGTKgtk_accel_group_disconnect_key; extern(D) TGTKgtk_accel_group_disconnect_key gtk_accel_group_disconnect_key;
+alias extern (C) int function(aGtkAccelGroup *, _GClosure *)TGTKgtk_accel_group_disconnect; extern(D) TGTKgtk_accel_group_disconnect gtk_accel_group_disconnect;
+alias extern (C) void function(aGtkAccelGroup *, char *, _GClosure *)TGTKgtk_accel_group_connect_by_path; extern(D) TGTKgtk_accel_group_connect_by_path gtk_accel_group_connect_by_path;
+alias extern (C) void function(aGtkAccelGroup *, uint, int, int, _GClosure *)TGTKgtk_accel_group_connect; extern(D) TGTKgtk_accel_group_connect gtk_accel_group_connect;
+alias extern (C) void function(aGtkAccelGroup *)TGTKgtk_accel_group_unlock; extern(D) TGTKgtk_accel_group_unlock gtk_accel_group_unlock;
+alias extern (C) void function(aGtkAccelGroup *)TGTKgtk_accel_group_lock; extern(D) TGTKgtk_accel_group_lock gtk_accel_group_lock;
+alias extern (C) _GtkAccelGroup * function()TGTKgtk_accel_group_new; extern(D) TGTKgtk_accel_group_new gtk_accel_group_new;
+alias extern (C) uint function()TGTKgtk_accel_group_get_type; extern(D) TGTKgtk_accel_group_get_type gtk_accel_group_get_type;
+
+
+extern(D) Symbol[] symbols = [
+    { "gtk_vseparator_new",  cast(void**)& gtk_vseparator_new},
+    { "gtk_vseparator_get_type",  cast(void**)& gtk_vseparator_get_type},
+    { "gtk_vscale_new_with_range",  cast(void**)& gtk_vscale_new_with_range},
+    { "gtk_vscale_new",  cast(void**)& gtk_vscale_new},
+    { "gtk_vscale_get_type",  cast(void**)& gtk_vscale_get_type},
+    { "gtk_vruler_new",  cast(void**)& gtk_vruler_new},
+    { "gtk_vruler_get_type",  cast(void**)& gtk_vruler_get_type},
+    { "gtk_vpaned_new",  cast(void**)& gtk_vpaned_new},
+    { "gtk_vpaned_get_type",  cast(void**)& gtk_vpaned_get_type},
+    { "gtk_volume_button_new",  cast(void**)& gtk_volume_button_new},
+    { "gtk_volume_button_get_type",  cast(void**)& gtk_volume_button_get_type},
+    { "gtk_vbutton_box_set_layout_default",  cast(void**)& gtk_vbutton_box_set_layout_default},
+    { "gtk_vbutton_box_get_layout_default",  cast(void**)& gtk_vbutton_box_get_layout_default},
+    { "gtk_vbutton_box_set_spacing_default",  cast(void**)& gtk_vbutton_box_set_spacing_default},
+    { "gtk_vbutton_box_get_spacing_default",  cast(void**)& gtk_vbutton_box_get_spacing_default},
+    { "gtk_vbutton_box_new",  cast(void**)& gtk_vbutton_box_new},
+    { "gtk_vbutton_box_get_type",  cast(void**)& gtk_vbutton_box_get_type},
+    { "gtk_ui_manager_new_merge_id",  cast(void**)& gtk_ui_manager_new_merge_id},
+    { "gtk_ui_manager_ensure_update",  cast(void**)& gtk_ui_manager_ensure_update},
+    { "gtk_ui_manager_get_ui",  cast(void**)& gtk_ui_manager_get_ui},
+    { "gtk_ui_manager_remove_ui",  cast(void**)& gtk_ui_manager_remove_ui},
+    { "gtk_ui_manager_add_ui",  cast(void**)& gtk_ui_manager_add_ui},
+    { "gtk_ui_manager_add_ui_from_file",  cast(void**)& gtk_ui_manager_add_ui_from_file},
+    { "gtk_ui_manager_add_ui_from_string",  cast(void**)& gtk_ui_manager_add_ui_from_string},
+    { "gtk_ui_manager_get_action",  cast(void**)& gtk_ui_manager_get_action},
+    { "gtk_ui_manager_get_toplevels",  cast(void**)& gtk_ui_manager_get_toplevels},
+    { "gtk_ui_manager_get_widget",  cast(void**)& gtk_ui_manager_get_widget},
+    { "gtk_ui_manager_get_accel_group",  cast(void**)& gtk_ui_manager_get_accel_group},
+    { "gtk_ui_manager_get_action_groups",  cast(void**)& gtk_ui_manager_get_action_groups},
+    { "gtk_ui_manager_remove_action_group",  cast(void**)& gtk_ui_manager_remove_action_group},
+    { "gtk_ui_manager_insert_action_group",  cast(void**)& gtk_ui_manager_insert_action_group},
+    { "gtk_ui_manager_get_add_tearoffs",  cast(void**)& gtk_ui_manager_get_add_tearoffs},
+    { "gtk_ui_manager_set_add_tearoffs",  cast(void**)& gtk_ui_manager_set_add_tearoffs},
+    { "gtk_ui_manager_new",  cast(void**)& gtk_ui_manager_new},
+    { "gtk_ui_manager_get_type",  cast(void**)& gtk_ui_manager_get_type},
+    { "gtk_tree_store_move_after",  cast(void**)& gtk_tree_store_move_after},
+    { "gtk_tree_store_move_before",  cast(void**)& gtk_tree_store_move_before},
+    { "gtk_tree_store_swap",  cast(void**)& gtk_tree_store_swap},
+    { "gtk_tree_store_reorder",  cast(void**)& gtk_tree_store_reorder},
+    { "gtk_tree_store_iter_is_valid",  cast(void**)& gtk_tree_store_iter_is_valid},
+    { "gtk_tree_store_clear",  cast(void**)& gtk_tree_store_clear},
+    { "gtk_tree_store_iter_depth",  cast(void**)& gtk_tree_store_iter_depth},
+    { "gtk_tree_store_is_ancestor",  cast(void**)& gtk_tree_store_is_ancestor},
+    { "gtk_tree_store_append",  cast(void**)& gtk_tree_store_append},
+    { "gtk_tree_store_prepend",  cast(void**)& gtk_tree_store_prepend},
+    { "gtk_tree_store_insert_with_valuesv",  cast(void**)& gtk_tree_store_insert_with_valuesv},
+    { "gtk_tree_store_insert_with_values",  cast(void**)& gtk_tree_store_insert_with_values},
+    { "gtk_tree_store_insert_after",  cast(void**)& gtk_tree_store_insert_after},
+    { "gtk_tree_store_insert_before",  cast(void**)& gtk_tree_store_insert_before},
+    { "gtk_tree_store_insert",  cast(void**)& gtk_tree_store_insert},
+    { "gtk_tree_store_remove",  cast(void**)& gtk_tree_store_remove},
+    { "gtk_tree_store_set_valist",  cast(void**)& gtk_tree_store_set_valist},
+    { "gtk_tree_store_set_valuesv",  cast(void**)& gtk_tree_store_set_valuesv},
+    { "gtk_tree_store_set",  cast(void**)& gtk_tree_store_set},
+    { "gtk_tree_store_set_value",  cast(void**)& gtk_tree_store_set_value},
+    { "gtk_tree_store_set_column_types",  cast(void**)& gtk_tree_store_set_column_types},
+    { "gtk_tree_store_newv",  cast(void**)& gtk_tree_store_newv},
+    { "gtk_tree_store_new",  cast(void**)& gtk_tree_store_new},
+    { "gtk_tree_store_get_type",  cast(void**)& gtk_tree_store_get_type},
+    { "gtk_tree_selection_unselect_range",  cast(void**)& gtk_tree_selection_unselect_range},
+    { "gtk_tree_selection_select_range",  cast(void**)& gtk_tree_selection_select_range},
+    { "gtk_tree_selection_unselect_all",  cast(void**)& gtk_tree_selection_unselect_all},
+    { "gtk_tree_selection_select_all",  cast(void**)& gtk_tree_selection_select_all},
+    { "gtk_tree_selection_iter_is_selected",  cast(void**)& gtk_tree_selection_iter_is_selected},
+    { "gtk_tree_selection_path_is_selected",  cast(void**)& gtk_tree_selection_path_is_selected},
+    { "gtk_tree_selection_unselect_iter",  cast(void**)& gtk_tree_selection_unselect_iter},
+    { "gtk_tree_selection_select_iter",  cast(void**)& gtk_tree_selection_select_iter},
+    { "gtk_tree_selection_unselect_path",  cast(void**)& gtk_tree_selection_unselect_path},
+    { "gtk_tree_selection_select_path",  cast(void**)& gtk_tree_selection_select_path},
+    { "gtk_tree_selection_selected_foreach",  cast(void**)& gtk_tree_selection_selected_foreach},
+    { "gtk_tree_selection_count_selected_rows",  cast(void**)& gtk_tree_selection_count_selected_rows},
+    { "gtk_tree_selection_get_selected_rows",  cast(void**)& gtk_tree_selection_get_selected_rows},
+    { "gtk_tree_selection_get_selected",  cast(void**)& gtk_tree_selection_get_selected},
+    { "gtk_tree_selection_get_tree_view",  cast(void**)& gtk_tree_selection_get_tree_view},
+    { "gtk_tree_selection_get_user_data",  cast(void**)& gtk_tree_selection_get_user_data},
+    { "gtk_tree_selection_set_select_function",  cast(void**)& gtk_tree_selection_set_select_function},
+    { "gtk_tree_selection_get_mode",  cast(void**)& gtk_tree_selection_get_mode},
+    { "gtk_tree_selection_set_mode",  cast(void**)& gtk_tree_selection_set_mode},
+    { "gtk_tree_selection_get_type",  cast(void**)& gtk_tree_selection_get_type},
+    { "gtk_tree_model_sort_iter_is_valid",  cast(void**)& gtk_tree_model_sort_iter_is_valid},
+    { "gtk_tree_model_sort_clear_cache",  cast(void**)& gtk_tree_model_sort_clear_cache},
+    { "gtk_tree_model_sort_reset_default_sort_func",  cast(void**)& gtk_tree_model_sort_reset_default_sort_func},
+    { "gtk_tree_model_sort_convert_iter_to_child_iter",  cast(void**)& gtk_tree_model_sort_convert_iter_to_child_iter},
+    { "gtk_tree_model_sort_convert_path_to_child_path",  cast(void**)& gtk_tree_model_sort_convert_path_to_child_path},
+    { "gtk_tree_model_sort_convert_child_iter_to_iter",  cast(void**)& gtk_tree_model_sort_convert_child_iter_to_iter},
+    { "gtk_tree_model_sort_convert_child_path_to_path",  cast(void**)& gtk_tree_model_sort_convert_child_path_to_path},
+    { "gtk_tree_model_sort_get_model",  cast(void**)& gtk_tree_model_sort_get_model},
+    { "gtk_tree_model_sort_new_with_model",  cast(void**)& gtk_tree_model_sort_new_with_model},
+    { "gtk_tree_model_sort_get_type",  cast(void**)& gtk_tree_model_sort_get_type},
+    { "gtk_tree_get_row_drag_data",  cast(void**)& gtk_tree_get_row_drag_data},
+    { "gtk_tree_set_row_drag_data",  cast(void**)& gtk_tree_set_row_drag_data},
+    { "gtk_tree_drag_dest_row_drop_possible",  cast(void**)& gtk_tree_drag_dest_row_drop_possible},
+    { "gtk_tree_drag_dest_drag_data_received",  cast(void**)& gtk_tree_drag_dest_drag_data_received},
+    { "gtk_tree_drag_dest_get_type",  cast(void**)& gtk_tree_drag_dest_get_type},
+    { "gtk_tree_drag_source_drag_data_get",  cast(void**)& gtk_tree_drag_source_drag_data_get},
+    { "gtk_tree_drag_source_drag_data_delete",  cast(void**)& gtk_tree_drag_source_drag_data_delete},
+    { "gtk_tree_drag_source_row_draggable",  cast(void**)& gtk_tree_drag_source_row_draggable},
+    { "gtk_tree_drag_source_get_type",  cast(void**)& gtk_tree_drag_source_get_type},
+    { "gtk_toolbar_insert_widget",  cast(void**)& gtk_toolbar_insert_widget},
+    { "gtk_toolbar_prepend_widget",  cast(void**)& gtk_toolbar_prepend_widget},
+    { "gtk_toolbar_append_widget",  cast(void**)& gtk_toolbar_append_widget},
+    { "gtk_toolbar_insert_element",  cast(void**)& gtk_toolbar_insert_element},
+    { "gtk_toolbar_prepend_element",  cast(void**)& gtk_toolbar_prepend_element},
+    { "gtk_toolbar_append_element",  cast(void**)& gtk_toolbar_append_element},
+    { "gtk_toolbar_remove_space",  cast(void**)& gtk_toolbar_remove_space},
+    { "gtk_toolbar_insert_space",  cast(void**)& gtk_toolbar_insert_space},
+    { "gtk_toolbar_prepend_space",  cast(void**)& gtk_toolbar_prepend_space},
+    { "gtk_toolbar_append_space",  cast(void**)& gtk_toolbar_append_space},
+    { "gtk_toolbar_insert_stock",  cast(void**)& gtk_toolbar_insert_stock},
+    { "gtk_toolbar_insert_item",  cast(void**)& gtk_toolbar_insert_item},
+    { "gtk_toolbar_prepend_item",  cast(void**)& gtk_toolbar_prepend_item},
+    { "gtk_toolbar_append_item",  cast(void**)& gtk_toolbar_append_item},
+    { "gtk_toolbar_unset_icon_size",  cast(void**)& gtk_toolbar_unset_icon_size},
+    { "gtk_toolbar_set_icon_size",  cast(void**)& gtk_toolbar_set_icon_size},
+//     { "_gtk_toolbar_rebuild_menu",  cast(void**)& _gtk_toolbar_rebuild_menu},
+//     { "_gtk_toolbar_get_default_space_size",  cast(void**)& _gtk_toolbar_get_default_space_size},
+//     { "_gtk_toolbar_paint_space_line",  cast(void**)& _gtk_toolbar_paint_space_line},
+//     { "_gtk_toolbar_elide_underscores",  cast(void**)& _gtk_toolbar_elide_underscores},
+    { "gtk_toolbar_set_drop_highlight_item",  cast(void**)& gtk_toolbar_set_drop_highlight_item},
+    { "gtk_toolbar_get_drop_index",  cast(void**)& gtk_toolbar_get_drop_index},
+    { "gtk_toolbar_get_relief_style",  cast(void**)& gtk_toolbar_get_relief_style},
+    { "gtk_toolbar_get_icon_size",  cast(void**)& gtk_toolbar_get_icon_size},
+    { "gtk_toolbar_unset_style",  cast(void**)& gtk_toolbar_unset_style},
+    { "gtk_toolbar_set_style",  cast(void**)& gtk_toolbar_set_style},
+    { "gtk_toolbar_get_style",  cast(void**)& gtk_toolbar_get_style},
+    { "gtk_toolbar_set_tooltips",  cast(void**)& gtk_toolbar_set_tooltips},
+    { "gtk_toolbar_get_tooltips",  cast(void**)& gtk_toolbar_get_tooltips},
+    { "gtk_toolbar_set_orientation",  cast(void**)& gtk_toolbar_set_orientation},
+    { "gtk_toolbar_get_orientation",  cast(void**)& gtk_toolbar_get_orientation},
+    { "gtk_toolbar_set_show_arrow",  cast(void**)& gtk_toolbar_set_show_arrow},
+    { "gtk_toolbar_get_show_arrow",  cast(void**)& gtk_toolbar_get_show_arrow},
+    { "gtk_toolbar_get_nth_item",  cast(void**)& gtk_toolbar_get_nth_item},
+    { "gtk_toolbar_get_n_items",  cast(void**)& gtk_toolbar_get_n_items},
+    { "gtk_toolbar_get_item_index",  cast(void**)& gtk_toolbar_get_item_index},
+    { "gtk_toolbar_insert",  cast(void**)& gtk_toolbar_insert},
+    { "gtk_toolbar_new",  cast(void**)& gtk_toolbar_new},
+    { "gtk_toolbar_get_type",  cast(void**)& gtk_toolbar_get_type},
+    { "gtk_tips_query_set_labels",  cast(void**)& gtk_tips_query_set_labels},
+    { "gtk_tips_query_set_caller",  cast(void**)& gtk_tips_query_set_caller},
+    { "gtk_tips_query_stop_query",  cast(void**)& gtk_tips_query_stop_query},
+    { "gtk_tips_query_start_query",  cast(void**)& gtk_tips_query_start_query},
+    { "gtk_tips_query_new",  cast(void**)& gtk_tips_query_new},
+    { "gtk_tips_query_get_type",  cast(void**)& gtk_tips_query_get_type},
+    { "gtk_text_view_get_default_attributes",  cast(void**)& gtk_text_view_get_default_attributes},
+    { "gtk_text_view_get_tabs",  cast(void**)& gtk_text_view_get_tabs},
+    { "gtk_text_view_set_tabs",  cast(void**)& gtk_text_view_set_tabs},
+    { "gtk_text_view_get_indent",  cast(void**)& gtk_text_view_get_indent},
+    { "gtk_text_view_set_indent",  cast(void**)& gtk_text_view_set_indent},
+    { "gtk_text_view_get_right_margin",  cast(void**)& gtk_text_view_get_right_margin},
+    { "gtk_text_view_set_right_margin",  cast(void**)& gtk_text_view_set_right_margin},
+    { "gtk_text_view_get_left_margin",  cast(void**)& gtk_text_view_get_left_margin},
+    { "gtk_text_view_set_left_margin",  cast(void**)& gtk_text_view_set_left_margin},
+    { "gtk_text_view_get_justification",  cast(void**)& gtk_text_view_get_justification},
+    { "gtk_text_view_set_justification",  cast(void**)& gtk_text_view_set_justification},
+    { "gtk_text_view_get_pixels_inside_wrap",  cast(void**)& gtk_text_view_get_pixels_inside_wrap},
+    { "gtk_text_view_set_pixels_inside_wrap",  cast(void**)& gtk_text_view_set_pixels_inside_wrap},
+    { "gtk_text_view_get_pixels_below_lines",  cast(void**)& gtk_text_view_get_pixels_below_lines},
+    { "gtk_text_view_set_pixels_below_lines",  cast(void**)& gtk_text_view_set_pixels_below_lines},
+    { "gtk_text_view_get_pixels_above_lines",  cast(void**)& gtk_text_view_get_pixels_above_lines},
+    { "gtk_text_view_set_pixels_above_lines",  cast(void**)& gtk_text_view_set_pixels_above_lines},
+    { "gtk_text_view_get_accepts_tab",  cast(void**)& gtk_text_view_get_accepts_tab},
+    { "gtk_text_view_set_accepts_tab",  cast(void**)& gtk_text_view_set_accepts_tab},
+    { "gtk_text_view_get_overwrite",  cast(void**)& gtk_text_view_get_overwrite},
+    { "gtk_text_view_set_overwrite",  cast(void**)& gtk_text_view_set_overwrite},
+    { "gtk_text_view_get_editable",  cast(void**)& gtk_text_view_get_editable},
+    { "gtk_text_view_set_editable",  cast(void**)& gtk_text_view_set_editable},
+    { "gtk_text_view_get_wrap_mode",  cast(void**)& gtk_text_view_get_wrap_mode},
+    { "gtk_text_view_set_wrap_mode",  cast(void**)& gtk_text_view_set_wrap_mode},
+    { "gtk_text_view_move_child",  cast(void**)& gtk_text_view_move_child},
+    { "gtk_text_view_add_child_in_window",  cast(void**)& gtk_text_view_add_child_in_window},
+    { "gtk_text_view_add_child_at_anchor",  cast(void**)& gtk_text_view_add_child_at_anchor},
+    { "gtk_text_view_move_visually",  cast(void**)& gtk_text_view_move_visually},
+    { "gtk_text_view_starts_display_line",  cast(void**)& gtk_text_view_starts_display_line},
+    { "gtk_text_view_backward_display_line_start",  cast(void**)& gtk_text_view_backward_display_line_start},
+    { "gtk_text_view_forward_display_line_end",  cast(void**)& gtk_text_view_forward_display_line_end},
+    { "gtk_text_view_backward_display_line",  cast(void**)& gtk_text_view_backward_display_line},
+    { "gtk_text_view_forward_display_line",  cast(void**)& gtk_text_view_forward_display_line},
+    { "gtk_text_view_get_border_window_size",  cast(void**)& gtk_text_view_get_border_window_size},
+    { "gtk_text_view_set_border_window_size",  cast(void**)& gtk_text_view_set_border_window_size},
+    { "gtk_text_view_get_window_type",  cast(void**)& gtk_text_view_get_window_type},
+    { "gtk_text_view_get_window",  cast(void**)& gtk_text_view_get_window},
+    { "gtk_text_view_window_to_buffer_coords",  cast(void**)& gtk_text_view_window_to_buffer_coords},
+    { "gtk_text_view_buffer_to_window_coords",  cast(void**)& gtk_text_view_buffer_to_window_coords},
+    { "gtk_text_view_get_line_at_y",  cast(void**)& gtk_text_view_get_line_at_y},
+    { "gtk_text_view_get_line_yrange",  cast(void**)& gtk_text_view_get_line_yrange},
+    { "gtk_text_view_get_iter_at_position",  cast(void**)& gtk_text_view_get_iter_at_position},
+    { "gtk_text_view_get_iter_at_location",  cast(void**)& gtk_text_view_get_iter_at_location},
+    { "gtk_text_view_get_iter_location",  cast(void**)& gtk_text_view_get_iter_location},
+    { "gtk_text_view_get_cursor_visible",  cast(void**)& gtk_text_view_get_cursor_visible},
+    { "gtk_text_view_set_cursor_visible",  cast(void**)& gtk_text_view_set_cursor_visible},
+    { "gtk_text_view_get_visible_rect",  cast(void**)& gtk_text_view_get_visible_rect},
+    { "gtk_text_view_place_cursor_onscreen",  cast(void**)& gtk_text_view_place_cursor_onscreen},
+    { "gtk_text_view_move_mark_onscreen",  cast(void**)& gtk_text_view_move_mark_onscreen},
+    { "gtk_text_view_scroll_mark_onscreen",  cast(void**)& gtk_text_view_scroll_mark_onscreen},
+    { "gtk_text_view_scroll_to_mark",  cast(void**)& gtk_text_view_scroll_to_mark},
+    { "gtk_text_view_scroll_to_iter",  cast(void**)& gtk_text_view_scroll_to_iter},
+    { "gtk_text_view_get_buffer",  cast(void**)& gtk_text_view_get_buffer},
+    { "gtk_text_view_set_buffer",  cast(void**)& gtk_text_view_set_buffer},
+    { "gtk_text_view_new_with_buffer",  cast(void**)& gtk_text_view_new_with_buffer},
+    { "gtk_text_view_new",  cast(void**)& gtk_text_view_new},
+    { "gtk_text_view_get_type",  cast(void**)& gtk_text_view_get_type},
+    { "gtk_text_buffer_deserialize",  cast(void**)& gtk_text_buffer_deserialize},
+    { "gtk_text_buffer_serialize",  cast(void**)& gtk_text_buffer_serialize},
+    { "gtk_text_buffer_get_deserialize_formats",  cast(void**)& gtk_text_buffer_get_deserialize_formats},
+    { "gtk_text_buffer_get_serialize_formats",  cast(void**)& gtk_text_buffer_get_serialize_formats},
+    { "gtk_text_buffer_deserialize_get_can_create_tags",  cast(void**)& gtk_text_buffer_deserialize_get_can_create_tags},
+    { "gtk_text_buffer_deserialize_set_can_create_tags",  cast(void**)& gtk_text_buffer_deserialize_set_can_create_tags},
+    { "gtk_text_buffer_unregister_deserialize_format",  cast(void**)& gtk_text_buffer_unregister_deserialize_format},
+    { "gtk_text_buffer_unregister_serialize_format",  cast(void**)& gtk_text_buffer_unregister_serialize_format},
+    { "gtk_text_buffer_register_deserialize_tagset",  cast(void**)& gtk_text_buffer_register_deserialize_tagset},
+    { "gtk_text_buffer_register_deserialize_format",  cast(void**)& gtk_text_buffer_register_deserialize_format},
+    { "gtk_text_buffer_register_serialize_tagset",  cast(void**)& gtk_text_buffer_register_serialize_tagset},
+    { "gtk_text_buffer_register_serialize_format",  cast(void**)& gtk_text_buffer_register_serialize_format},
+//     { "_gtk_text_buffer_notify_will_remove_tag",  cast(void**)& _gtk_text_buffer_notify_will_remove_tag},
+//     { "_gtk_text_buffer_get_line_log_attrs",  cast(void**)& _gtk_text_buffer_get_line_log_attrs},
+//     { "_gtk_text_buffer_get_btree",  cast(void**)& _gtk_text_buffer_get_btree},
+//     { "_gtk_text_buffer_spew",  cast(void**)& _gtk_text_buffer_spew},
+    { "gtk_text_buffer_get_paste_target_list",  cast(void**)& gtk_text_buffer_get_paste_target_list},
+    { "gtk_text_buffer_get_copy_target_list",  cast(void**)& gtk_text_buffer_get_copy_target_list},
+    { "gtk_text_buffer_end_user_action",  cast(void**)& gtk_text_buffer_end_user_action},
+    { "gtk_text_buffer_begin_user_action",  cast(void**)& gtk_text_buffer_begin_user_action},
+    { "gtk_text_buffer_delete_selection",  cast(void**)& gtk_text_buffer_delete_selection},
+    { "gtk_text_buffer_get_selection_bounds",  cast(void**)& gtk_text_buffer_get_selection_bounds},
+    { "gtk_text_buffer_paste_clipboard",  cast(void**)& gtk_text_buffer_paste_clipboard},
+    { "gtk_text_buffer_copy_clipboard",  cast(void**)& gtk_text_buffer_copy_clipboard},
+    { "gtk_text_buffer_cut_clipboard",  cast(void**)& gtk_text_buffer_cut_clipboard},
+    { "gtk_text_buffer_remove_selection_clipboard",  cast(void**)& gtk_text_buffer_remove_selection_clipboard},
+    { "gtk_text_buffer_add_selection_clipboard",  cast(void**)& gtk_text_buffer_add_selection_clipboard},
+    { "gtk_text_buffer_get_has_selection",  cast(void**)& gtk_text_buffer_get_has_selection},
+    { "gtk_text_buffer_set_modified",  cast(void**)& gtk_text_buffer_set_modified},
+    { "gtk_text_buffer_get_modified",  cast(void**)& gtk_text_buffer_get_modified},
+    { "gtk_text_buffer_get_iter_at_child_anchor",  cast(void**)& gtk_text_buffer_get_iter_at_child_anchor},
+    { "gtk_text_buffer_get_iter_at_mark",  cast(void**)& gtk_text_buffer_get_iter_at_mark},
+    { "gtk_text_buffer_get_bounds",  cast(void**)& gtk_text_buffer_get_bounds},
+    { "gtk_text_buffer_get_end_iter",  cast(void**)& gtk_text_buffer_get_end_iter},
+    { "gtk_text_buffer_get_start_iter",  cast(void**)& gtk_text_buffer_get_start_iter},
+    { "gtk_text_buffer_get_iter_at_line",  cast(void**)& gtk_text_buffer_get_iter_at_line},
+    { "gtk_text_buffer_get_iter_at_offset",  cast(void**)& gtk_text_buffer_get_iter_at_offset},
+    { "gtk_text_buffer_get_iter_at_line_index",  cast(void**)& gtk_text_buffer_get_iter_at_line_index},
+    { "gtk_text_buffer_get_iter_at_line_offset",  cast(void**)& gtk_text_buffer_get_iter_at_line_offset},
+    { "gtk_text_buffer_create_tag",  cast(void**)& gtk_text_buffer_create_tag},
+    { "gtk_text_buffer_remove_all_tags",  cast(void**)& gtk_text_buffer_remove_all_tags},
+    { "gtk_text_buffer_remove_tag_by_name",  cast(void**)& gtk_text_buffer_remove_tag_by_name},
+    { "gtk_text_buffer_apply_tag_by_name",  cast(void**)& gtk_text_buffer_apply_tag_by_name},
+    { "gtk_text_buffer_remove_tag",  cast(void**)& gtk_text_buffer_remove_tag},
+    { "gtk_text_buffer_apply_tag",  cast(void**)& gtk_text_buffer_apply_tag},
+    { "gtk_text_buffer_select_range",  cast(void**)& gtk_text_buffer_select_range},
+    { "gtk_text_buffer_place_cursor",  cast(void**)& gtk_text_buffer_place_cursor},
+    { "gtk_text_buffer_get_selection_bound",  cast(void**)& gtk_text_buffer_get_selection_bound},
+    { "gtk_text_buffer_get_insert",  cast(void**)& gtk_text_buffer_get_insert},
+    { "gtk_text_buffer_delete_mark_by_name",  cast(void**)& gtk_text_buffer_delete_mark_by_name},
+    { "gtk_text_buffer_move_mark_by_name",  cast(void**)& gtk_text_buffer_move_mark_by_name},
+    { "gtk_text_buffer_get_mark",  cast(void**)& gtk_text_buffer_get_mark},
+    { "gtk_text_buffer_delete_mark",  cast(void**)& gtk_text_buffer_delete_mark},
+    { "gtk_text_buffer_move_mark",  cast(void**)& gtk_text_buffer_move_mark},
+    { "gtk_text_buffer_create_mark",  cast(void**)& gtk_text_buffer_create_mark},
+    { "gtk_text_buffer_add_mark",  cast(void**)& gtk_text_buffer_add_mark},
+    { "gtk_text_buffer_create_child_anchor",  cast(void**)& gtk_text_buffer_create_child_anchor},
+    { "gtk_text_buffer_insert_child_anchor",  cast(void**)& gtk_text_buffer_insert_child_anchor},
+    { "gtk_text_buffer_insert_pixbuf",  cast(void**)& gtk_text_buffer_insert_pixbuf},
+    { "gtk_text_buffer_get_slice",  cast(void**)& gtk_text_buffer_get_slice},
+    { "gtk_text_buffer_get_text",  cast(void**)& gtk_text_buffer_get_text},
+    { "gtk_text_buffer_backspace",  cast(void**)& gtk_text_buffer_backspace},
+    { "gtk_text_buffer_delete_interactive",  cast(void**)& gtk_text_buffer_delete_interactive},
+    { "gtk_text_buffer_delete",  cast(void**)& gtk_text_buffer_delete},
+    { "gtk_text_buffer_insert_with_tags_by_name",  cast(void**)& gtk_text_buffer_insert_with_tags_by_name},
+    { "gtk_text_buffer_insert_with_tags",  cast(void**)& gtk_text_buffer_insert_with_tags},
+    { "gtk_text_buffer_insert_range_interactive",  cast(void**)& gtk_text_buffer_insert_range_interactive},
+    { "gtk_text_buffer_insert_range",  cast(void**)& gtk_text_buffer_insert_range},
+    { "gtk_text_buffer_insert_interactive_at_cursor",  cast(void**)& gtk_text_buffer_insert_interactive_at_cursor},
+    { "gtk_text_buffer_insert_interactive",  cast(void**)& gtk_text_buffer_insert_interactive},
+    { "gtk_text_buffer_insert_at_cursor",  cast(void**)& gtk_text_buffer_insert_at_cursor},
+    { "gtk_text_buffer_insert",  cast(void**)& gtk_text_buffer_insert},
+    { "gtk_text_buffer_set_text",  cast(void**)& gtk_text_buffer_set_text},
+    { "gtk_text_buffer_get_tag_table",  cast(void**)& gtk_text_buffer_get_tag_table},
+    { "gtk_text_buffer_get_char_count",  cast(void**)& gtk_text_buffer_get_char_count},
+    { "gtk_text_buffer_get_line_count",  cast(void**)& gtk_text_buffer_get_line_count},
+    { "gtk_text_buffer_new",  cast(void**)& gtk_text_buffer_new},
+    { "gtk_text_buffer_get_type",  cast(void**)& gtk_text_buffer_get_type},
+    { "gtk_text_mark_get_left_gravity",  cast(void**)& gtk_text_mark_get_left_gravity},
+    { "gtk_text_mark_get_buffer",  cast(void**)& gtk_text_mark_get_buffer},
+    { "gtk_text_mark_get_deleted",  cast(void**)& gtk_text_mark_get_deleted},
+    { "gtk_text_mark_get_name",  cast(void**)& gtk_text_mark_get_name},
+    { "gtk_text_mark_new",  cast(void**)& gtk_text_mark_new},
+    { "gtk_text_mark_get_visible",  cast(void**)& gtk_text_mark_get_visible},
+    { "gtk_text_mark_set_visible",  cast(void**)& gtk_text_mark_set_visible},
+    { "gtk_text_mark_get_type",  cast(void**)& gtk_text_mark_get_type},
+//     { "_gtk_text_tag_table_remove_buffer",  cast(void**)& _gtk_text_tag_table_remove_buffer},
+//     { "_gtk_text_tag_table_add_buffer",  cast(void**)& _gtk_text_tag_table_add_buffer},
+    { "gtk_text_tag_table_get_size",  cast(void**)& gtk_text_tag_table_get_size},
+    { "gtk_text_tag_table_foreach",  cast(void**)& gtk_text_tag_table_foreach},
+    { "gtk_text_tag_table_lookup",  cast(void**)& gtk_text_tag_table_lookup},
+    { "gtk_text_tag_table_remove",  cast(void**)& gtk_text_tag_table_remove},
+    { "gtk_text_tag_table_add",  cast(void**)& gtk_text_tag_table_add},
+    { "gtk_text_tag_table_new",  cast(void**)& gtk_text_tag_table_new},
+    { "gtk_text_tag_table_get_type",  cast(void**)& gtk_text_tag_table_get_type},
+    { "gtk_tearoff_menu_item_new",  cast(void**)& gtk_tearoff_menu_item_new},
+    { "gtk_tearoff_menu_item_get_type",  cast(void**)& gtk_tearoff_menu_item_get_type},
+    { "gtk_table_get_homogeneous",  cast(void**)& gtk_table_get_homogeneous},
+    { "gtk_table_set_homogeneous",  cast(void**)& gtk_table_set_homogeneous},
+    { "gtk_table_get_default_col_spacing",  cast(void**)& gtk_table_get_default_col_spacing},
+    { "gtk_table_set_col_spacings",  cast(void**)& gtk_table_set_col_spacings},
+    { "gtk_table_get_default_row_spacing",  cast(void**)& gtk_table_get_default_row_spacing},
+    { "gtk_table_set_row_spacings",  cast(void**)& gtk_table_set_row_spacings},
+    { "gtk_table_get_col_spacing",  cast(void**)& gtk_table_get_col_spacing},
+    { "gtk_table_set_col_spacing",  cast(void**)& gtk_table_set_col_spacing},
+    { "gtk_table_get_row_spacing",  cast(void**)& gtk_table_get_row_spacing},
+    { "gtk_table_set_row_spacing",  cast(void**)& gtk_table_set_row_spacing},
+    { "gtk_table_attach_defaults",  cast(void**)& gtk_table_attach_defaults},
+    { "gtk_table_attach",  cast(void**)& gtk_table_attach},
+    { "gtk_table_resize",  cast(void**)& gtk_table_resize},
+    { "gtk_table_new",  cast(void**)& gtk_table_new},
+    { "gtk_table_get_type",  cast(void**)& gtk_table_get_type},
+    { "gtk_stock_set_translate_func",  cast(void**)& gtk_stock_set_translate_func},
+    { "gtk_stock_item_free",  cast(void**)& gtk_stock_item_free},
+    { "gtk_stock_item_copy",  cast(void**)& gtk_stock_item_copy},
+    { "gtk_stock_list_ids",  cast(void**)& gtk_stock_list_ids},
+    { "gtk_stock_lookup",  cast(void**)& gtk_stock_lookup},
+    { "gtk_stock_add_static",  cast(void**)& gtk_stock_add_static},
+    { "gtk_stock_add",  cast(void**)& gtk_stock_add},
+    { "gtk_status_icon_get_geometry",  cast(void**)& gtk_status_icon_get_geometry},
+    { "gtk_status_icon_position_menu",  cast(void**)& gtk_status_icon_position_menu},
+    { "gtk_status_icon_is_embedded",  cast(void**)& gtk_status_icon_is_embedded},
+    { "gtk_status_icon_get_blinking",  cast(void**)& gtk_status_icon_get_blinking},
+    { "gtk_status_icon_set_blinking",  cast(void**)& gtk_status_icon_set_blinking},
+    { "gtk_status_icon_get_visible",  cast(void**)& gtk_status_icon_get_visible},
+    { "gtk_status_icon_set_visible",  cast(void**)& gtk_status_icon_set_visible},
+    { "gtk_status_icon_set_tooltip",  cast(void**)& gtk_status_icon_set_tooltip},
+    { "gtk_status_icon_get_screen",  cast(void**)& gtk_status_icon_get_screen},
+    { "gtk_status_icon_set_screen",  cast(void**)& gtk_status_icon_set_screen},
+    { "gtk_status_icon_get_size",  cast(void**)& gtk_status_icon_get_size},
+    { "gtk_status_icon_get_icon_name",  cast(void**)& gtk_status_icon_get_icon_name},
+    { "gtk_status_icon_get_stock",  cast(void**)& gtk_status_icon_get_stock},
+    { "gtk_status_icon_get_pixbuf",  cast(void**)& gtk_status_icon_get_pixbuf},
+    { "gtk_status_icon_get_storage_type",  cast(void**)& gtk_status_icon_get_storage_type},
+    { "gtk_status_icon_set_from_icon_name",  cast(void**)& gtk_status_icon_set_from_icon_name},
+    { "gtk_status_icon_set_from_stock",  cast(void**)& gtk_status_icon_set_from_stock},
+    { "gtk_status_icon_set_from_file",  cast(void**)& gtk_status_icon_set_from_file},
+    { "gtk_status_icon_set_from_pixbuf",  cast(void**)& gtk_status_icon_set_from_pixbuf},
+    { "gtk_status_icon_new_from_icon_name",  cast(void**)& gtk_status_icon_new_from_icon_name},
+    { "gtk_status_icon_new_from_stock",  cast(void**)& gtk_status_icon_new_from_stock},
+    { "gtk_status_icon_new_from_file",  cast(void**)& gtk_status_icon_new_from_file},
+    { "gtk_status_icon_new_from_pixbuf",  cast(void**)& gtk_status_icon_new_from_pixbuf},
+    { "gtk_status_icon_new",  cast(void**)& gtk_status_icon_new},
+    { "gtk_status_icon_get_type",  cast(void**)& gtk_status_icon_get_type},
+    { "gtk_statusbar_get_has_resize_grip",  cast(void**)& gtk_statusbar_get_has_resize_grip},
+    { "gtk_statusbar_set_has_resize_grip",  cast(void**)& gtk_statusbar_set_has_resize_grip},
+    { "gtk_statusbar_remove",  cast(void**)& gtk_statusbar_remove},
+    { "gtk_statusbar_pop",  cast(void**)& gtk_statusbar_pop},
+    { "gtk_statusbar_push",  cast(void**)& gtk_statusbar_push},
+    { "gtk_statusbar_get_context_id",  cast(void**)& gtk_statusbar_get_context_id},
+    { "gtk_statusbar_new",  cast(void**)& gtk_statusbar_new},
+    { "gtk_statusbar_get_type",  cast(void**)& gtk_statusbar_get_type},
+    { "gtk_spin_button_update",  cast(void**)& gtk_spin_button_update},
+    { "gtk_spin_button_get_snap_to_ticks",  cast(void**)& gtk_spin_button_get_snap_to_ticks},
+    { "gtk_spin_button_set_snap_to_ticks",  cast(void**)& gtk_spin_button_set_snap_to_ticks},
+    { "gtk_spin_button_get_wrap",  cast(void**)& gtk_spin_button_get_wrap},
+    { "gtk_spin_button_set_wrap",  cast(void**)& gtk_spin_button_set_wrap},
+    { "gtk_spin_button_spin",  cast(void**)& gtk_spin_button_spin},
+    { "gtk_spin_button_get_numeric",  cast(void**)& gtk_spin_button_get_numeric},
+    { "gtk_spin_button_set_numeric",  cast(void**)& gtk_spin_button_set_numeric},
+    { "gtk_spin_button_get_update_policy",  cast(void**)& gtk_spin_button_get_update_policy},
+    { "gtk_spin_button_set_update_policy",  cast(void**)& gtk_spin_button_set_update_policy},
+    { "gtk_spin_button_set_value",  cast(void**)& gtk_spin_button_set_value},
+    { "gtk_spin_button_get_value_as_int",  cast(void**)& gtk_spin_button_get_value_as_int},
+    { "gtk_spin_button_get_value",  cast(void**)& gtk_spin_button_get_value},
+    { "gtk_spin_button_get_range",  cast(void**)& gtk_spin_button_get_range},
+    { "gtk_spin_button_set_range",  cast(void**)& gtk_spin_button_set_range},
+    { "gtk_spin_button_get_increments",  cast(void**)& gtk_spin_button_get_increments},
+    { "gtk_spin_button_set_increments",  cast(void**)& gtk_spin_button_set_increments},
+    { "gtk_spin_button_get_digits",  cast(void**)& gtk_spin_button_get_digits},
+    { "gtk_spin_button_set_digits",  cast(void**)& gtk_spin_button_set_digits},
+    { "gtk_spin_button_get_adjustment",  cast(void**)& gtk_spin_button_get_adjustment},
+    { "gtk_spin_button_set_adjustment",  cast(void**)& gtk_spin_button_set_adjustment},
+    { "gtk_spin_button_new_with_range",  cast(void**)& gtk_spin_button_new_with_range},
+    { "gtk_spin_button_new",  cast(void**)& gtk_spin_button_new},
+    { "gtk_spin_button_configure",  cast(void**)& gtk_spin_button_configure},
+    { "gtk_spin_button_get_type",  cast(void**)& gtk_spin_button_get_type},
+//     { "_gtk_size_group_queue_resize",  cast(void**)& _gtk_size_group_queue_resize},
+//     { "_gtk_size_group_compute_requisition",  cast(void**)& _gtk_size_group_compute_requisition},
+//     { "_gtk_size_group_get_child_requisition",  cast(void**)& _gtk_size_group_get_child_requisition},
+    { "gtk_size_group_get_widgets",  cast(void**)& gtk_size_group_get_widgets},
+    { "gtk_size_group_remove_widget",  cast(void**)& gtk_size_group_remove_widget},
+    { "gtk_size_group_add_widget",  cast(void**)& gtk_size_group_add_widget},
+    { "gtk_size_group_get_ignore_hidden",  cast(void**)& gtk_size_group_get_ignore_hidden},
+    { "gtk_size_group_set_ignore_hidden",  cast(void**)& gtk_size_group_set_ignore_hidden},
+    { "gtk_size_group_get_mode",  cast(void**)& gtk_size_group_get_mode},
+    { "gtk_size_group_set_mode",  cast(void**)& gtk_size_group_set_mode},
+    { "gtk_size_group_new",  cast(void**)& gtk_size_group_new},
+    { "gtk_size_group_get_type",  cast(void**)& gtk_size_group_get_type},
+    { "gtk_separator_tool_item_set_draw",  cast(void**)& gtk_separator_tool_item_set_draw},
+    { "gtk_separator_tool_item_get_draw",  cast(void**)& gtk_separator_tool_item_get_draw},
+    { "gtk_separator_tool_item_new",  cast(void**)& gtk_separator_tool_item_new},
+    { "gtk_separator_tool_item_get_type",  cast(void**)& gtk_separator_tool_item_get_type},
+    { "gtk_separator_menu_item_new",  cast(void**)& gtk_separator_menu_item_new},
+    { "gtk_separator_menu_item_get_type",  cast(void**)& gtk_separator_menu_item_get_type},
+//     { "_gtk_scrolled_window_get_scrollbar_spacing",  cast(void**)& _gtk_scrolled_window_get_scrollbar_spacing},
+    { "gtk_scrolled_window_add_with_viewport",  cast(void**)& gtk_scrolled_window_add_with_viewport},
+    { "gtk_scrolled_window_get_shadow_type",  cast(void**)& gtk_scrolled_window_get_shadow_type},
+    { "gtk_scrolled_window_set_shadow_type",  cast(void**)& gtk_scrolled_window_set_shadow_type},
+    { "gtk_scrolled_window_get_placement",  cast(void**)& gtk_scrolled_window_get_placement},
+    { "gtk_scrolled_window_unset_placement",  cast(void**)& gtk_scrolled_window_unset_placement},
+    { "gtk_scrolled_window_set_placement",  cast(void**)& gtk_scrolled_window_set_placement},
+    { "gtk_scrolled_window_get_policy",  cast(void**)& gtk_scrolled_window_get_policy},
+    { "gtk_scrolled_window_set_policy",  cast(void**)& gtk_scrolled_window_set_policy},
+    { "gtk_scrolled_window_get_vscrollbar",  cast(void**)& gtk_scrolled_window_get_vscrollbar},
+    { "gtk_scrolled_window_get_hscrollbar",  cast(void**)& gtk_scrolled_window_get_hscrollbar},
+    { "gtk_scrolled_window_get_vadjustment",  cast(void**)& gtk_scrolled_window_get_vadjustment},
+    { "gtk_scrolled_window_get_hadjustment",  cast(void**)& gtk_scrolled_window_get_hadjustment},
+    { "gtk_scrolled_window_set_vadjustment",  cast(void**)& gtk_scrolled_window_set_vadjustment},
+    { "gtk_scrolled_window_set_hadjustment",  cast(void**)& gtk_scrolled_window_set_hadjustment},
+    { "gtk_scrolled_window_new",  cast(void**)& gtk_scrolled_window_new},
+    { "gtk_scrolled_window_get_type",  cast(void**)& gtk_scrolled_window_get_type},
+    { "gtk_viewport_get_shadow_type",  cast(void**)& gtk_viewport_get_shadow_type},
+    { "gtk_viewport_set_shadow_type",  cast(void**)& gtk_viewport_set_shadow_type},
+    { "gtk_viewport_set_vadjustment",  cast(void**)& gtk_viewport_set_vadjustment},
+    { "gtk_viewport_set_hadjustment",  cast(void**)& gtk_viewport_set_hadjustment},
+    { "gtk_viewport_get_vadjustment",  cast(void**)& gtk_viewport_get_vadjustment},
+    { "gtk_viewport_get_hadjustment",  cast(void**)& gtk_viewport_get_hadjustment},
+    { "gtk_viewport_new",  cast(void**)& gtk_viewport_new},
+    { "gtk_viewport_get_type",  cast(void**)& gtk_viewport_get_type},
+    { "gtk_scale_button_set_adjustment",  cast(void**)& gtk_scale_button_set_adjustment},
+    { "gtk_scale_button_get_adjustment",  cast(void**)& gtk_scale_button_get_adjustment},
+    { "gtk_scale_button_set_value",  cast(void**)& gtk_scale_button_set_value},
+    { "gtk_scale_button_get_value",  cast(void**)& gtk_scale_button_get_value},
+    { "gtk_scale_button_set_icons",  cast(void**)& gtk_scale_button_set_icons},
+    { "gtk_scale_button_new",  cast(void**)& gtk_scale_button_new},
+    { "gtk_scale_button_get_type",  cast(void**)& gtk_scale_button_get_type},
+    { "gtk_recent_chooser_widget_new_for_manager",  cast(void**)& gtk_recent_chooser_widget_new_for_manager},
+    { "gtk_recent_chooser_widget_new",  cast(void**)& gtk_recent_chooser_widget_new},
+    { "gtk_recent_chooser_widget_get_type",  cast(void**)& gtk_recent_chooser_widget_get_type},
+    { "gtk_recent_chooser_menu_set_show_numbers",  cast(void**)& gtk_recent_chooser_menu_set_show_numbers},
+    { "gtk_recent_chooser_menu_get_show_numbers",  cast(void**)& gtk_recent_chooser_menu_get_show_numbers},
+    { "gtk_recent_chooser_menu_new_for_manager",  cast(void**)& gtk_recent_chooser_menu_new_for_manager},
+    { "gtk_recent_chooser_menu_new",  cast(void**)& gtk_recent_chooser_menu_new},
+    { "gtk_recent_chooser_menu_get_type",  cast(void**)& gtk_recent_chooser_menu_get_type},
+    { "gtk_recent_chooser_dialog_new_for_manager",  cast(void**)& gtk_recent_chooser_dialog_new_for_manager},
+    { "gtk_recent_chooser_dialog_new",  cast(void**)& gtk_recent_chooser_dialog_new},
+    { "gtk_recent_chooser_dialog_get_type",  cast(void**)& gtk_recent_chooser_dialog_get_type},
+    { "gtk_recent_chooser_get_filter",  cast(void**)& gtk_recent_chooser_get_filter},
+    { "gtk_recent_chooser_set_filter",  cast(void**)& gtk_recent_chooser_set_filter},
+    { "gtk_recent_chooser_list_filters",  cast(void**)& gtk_recent_chooser_list_filters},
+    { "gtk_recent_chooser_remove_filter",  cast(void**)& gtk_recent_chooser_remove_filter},
+    { "gtk_recent_chooser_add_filter",  cast(void**)& gtk_recent_chooser_add_filter},
+    { "gtk_recent_chooser_get_uris",  cast(void**)& gtk_recent_chooser_get_uris},
+    { "gtk_recent_chooser_get_items",  cast(void**)& gtk_recent_chooser_get_items},
+    { "gtk_recent_chooser_unselect_all",  cast(void**)& gtk_recent_chooser_unselect_all},
+    { "gtk_recent_chooser_select_all",  cast(void**)& gtk_recent_chooser_select_all},
+    { "gtk_recent_chooser_unselect_uri",  cast(void**)& gtk_recent_chooser_unselect_uri},
+    { "gtk_recent_chooser_select_uri",  cast(void**)& gtk_recent_chooser_select_uri},
+    { "gtk_recent_chooser_get_current_item",  cast(void**)& gtk_recent_chooser_get_current_item},
+    { "gtk_recent_chooser_get_current_uri",  cast(void**)& gtk_recent_chooser_get_current_uri},
+    { "gtk_recent_chooser_set_current_uri",  cast(void**)& gtk_recent_chooser_set_current_uri},
+    { "gtk_recent_chooser_set_sort_func",  cast(void**)& gtk_recent_chooser_set_sort_func},
+    { "gtk_recent_chooser_get_sort_type",  cast(void**)& gtk_recent_chooser_get_sort_type},
+    { "gtk_recent_chooser_set_sort_type",  cast(void**)& gtk_recent_chooser_set_sort_type},
+    { "gtk_recent_chooser_get_show_icons",  cast(void**)& gtk_recent_chooser_get_show_icons},
+    { "gtk_recent_chooser_set_show_icons",  cast(void**)& gtk_recent_chooser_set_show_icons},
+    { "gtk_recent_chooser_get_show_numbers",  cast(void**)& gtk_recent_chooser_get_show_numbers},
+    { "gtk_recent_chooser_set_show_numbers",  cast(void**)& gtk_recent_chooser_set_show_numbers},
+    { "gtk_recent_chooser_get_show_tips",  cast(void**)& gtk_recent_chooser_get_show_tips},
+    { "gtk_recent_chooser_set_show_tips",  cast(void**)& gtk_recent_chooser_set_show_tips},
+    { "gtk_recent_chooser_get_local_only",  cast(void**)& gtk_recent_chooser_get_local_only},
+    { "gtk_recent_chooser_set_local_only",  cast(void**)& gtk_recent_chooser_set_local_only},
+    { "gtk_recent_chooser_get_limit",  cast(void**)& gtk_recent_chooser_get_limit},
+    { "gtk_recent_chooser_set_limit",  cast(void**)& gtk_recent_chooser_set_limit},
+    { "gtk_recent_chooser_get_select_multiple",  cast(void**)& gtk_recent_chooser_get_select_multiple},
+    { "gtk_recent_chooser_set_select_multiple",  cast(void**)& gtk_recent_chooser_set_select_multiple},
+    { "gtk_recent_chooser_get_show_not_found",  cast(void**)& gtk_recent_chooser_get_show_not_found},
+    { "gtk_recent_chooser_set_show_not_found",  cast(void**)& gtk_recent_chooser_set_show_not_found},
+    { "gtk_recent_chooser_get_show_private",  cast(void**)& gtk_recent_chooser_get_show_private},
+    { "gtk_recent_chooser_set_show_private",  cast(void**)& gtk_recent_chooser_set_show_private},
+    { "gtk_recent_chooser_get_type",  cast(void**)& gtk_recent_chooser_get_type},
+    { "gtk_recent_chooser_error_quark",  cast(void**)& gtk_recent_chooser_error_quark},
+    { "gtk_recent_filter_filter",  cast(void**)& gtk_recent_filter_filter},
+    { "gtk_recent_filter_get_needed",  cast(void**)& gtk_recent_filter_get_needed},
+    { "gtk_recent_filter_add_custom",  cast(void**)& gtk_recent_filter_add_custom},
+    { "gtk_recent_filter_add_age",  cast(void**)& gtk_recent_filter_add_age},
+    { "gtk_recent_filter_add_group",  cast(void**)& gtk_recent_filter_add_group},
+    { "gtk_recent_filter_add_application",  cast(void**)& gtk_recent_filter_add_application},
+    { "gtk_recent_filter_add_pixbuf_formats",  cast(void**)& gtk_recent_filter_add_pixbuf_formats},
+    { "gtk_recent_filter_add_pattern",  cast(void**)& gtk_recent_filter_add_pattern},
+    { "gtk_recent_filter_add_mime_type",  cast(void**)& gtk_recent_filter_add_mime_type},
+    { "gtk_recent_filter_get_name",  cast(void**)& gtk_recent_filter_get_name},
+    { "gtk_recent_filter_set_name",  cast(void**)& gtk_recent_filter_set_name},
+    { "gtk_recent_filter_new",  cast(void**)& gtk_recent_filter_new},
+    { "gtk_recent_filter_get_type",  cast(void**)& gtk_recent_filter_get_type},
+    { "gtk_recent_action_set_show_numbers",  cast(void**)& gtk_recent_action_set_show_numbers},
+    { "gtk_recent_action_get_show_numbers",  cast(void**)& gtk_recent_action_get_show_numbers},
+    { "gtk_recent_action_new_for_manager",  cast(void**)& gtk_recent_action_new_for_manager},
+    { "gtk_recent_action_new",  cast(void**)& gtk_recent_action_new},
+    { "gtk_recent_action_get_type",  cast(void**)& gtk_recent_action_get_type},
+//     { "_gtk_recent_manager_sync",  cast(void**)& _gtk_recent_manager_sync},
+    { "gtk_recent_info_match",  cast(void**)& gtk_recent_info_match},
+    { "gtk_recent_info_exists",  cast(void**)& gtk_recent_info_exists},
+    { "gtk_recent_info_is_local",  cast(void**)& gtk_recent_info_is_local},
+    { "gtk_recent_info_get_age",  cast(void**)& gtk_recent_info_get_age},
+    { "gtk_recent_info_get_uri_display",  cast(void**)& gtk_recent_info_get_uri_display},
+    { "gtk_recent_info_get_short_name",  cast(void**)& gtk_recent_info_get_short_name},
+    { "gtk_recent_info_get_icon",  cast(void**)& gtk_recent_info_get_icon},
+    { "gtk_recent_info_has_group",  cast(void**)& gtk_recent_info_has_group},
+    { "gtk_recent_info_get_groups",  cast(void**)& gtk_recent_info_get_groups},
+    { "gtk_recent_info_has_application",  cast(void**)& gtk_recent_info_has_application},
+    { "gtk_recent_info_last_application",  cast(void**)& gtk_recent_info_last_application},
+    { "gtk_recent_info_get_applications",  cast(void**)& gtk_recent_info_get_applications},
+    { "gtk_recent_info_get_application_info",  cast(void**)& gtk_recent_info_get_application_info},
+    { "gtk_recent_info_get_private_hint",  cast(void**)& gtk_recent_info_get_private_hint},
+    { "gtk_recent_info_get_visited",  cast(void**)& gtk_recent_info_get_visited},
+    { "gtk_recent_info_get_modified",  cast(void**)& gtk_recent_info_get_modified},
+    { "gtk_recent_info_get_added",  cast(void**)& gtk_recent_info_get_added},
+    { "gtk_recent_info_get_mime_type",  cast(void**)& gtk_recent_info_get_mime_type},
+    { "gtk_recent_info_get_description",  cast(void**)& gtk_recent_info_get_description},
+    { "gtk_recent_info_get_display_name",  cast(void**)& gtk_recent_info_get_display_name},
+    { "gtk_recent_info_get_uri",  cast(void**)& gtk_recent_info_get_uri},
+    { "gtk_recent_info_unref",  cast(void**)& gtk_recent_info_unref},
+    { "gtk_recent_info_ref",  cast(void**)& gtk_recent_info_ref},
+    { "gtk_recent_info_get_type",  cast(void**)& gtk_recent_info_get_type},
+    { "gtk_recent_manager_purge_items",  cast(void**)& gtk_recent_manager_purge_items},
+    { "gtk_recent_manager_get_items",  cast(void**)& gtk_recent_manager_get_items},
+    { "gtk_recent_manager_get_limit",  cast(void**)& gtk_recent_manager_get_limit},
+    { "gtk_recent_manager_set_limit",  cast(void**)& gtk_recent_manager_set_limit},
+    { "gtk_recent_manager_move_item",  cast(void**)& gtk_recent_manager_move_item},
+    { "gtk_recent_manager_has_item",  cast(void**)& gtk_recent_manager_has_item},
+    { "gtk_recent_manager_lookup_item",  cast(void**)& gtk_recent_manager_lookup_item},
+    { "gtk_recent_manager_remove_item",  cast(void**)& gtk_recent_manager_remove_item},
+    { "gtk_recent_manager_add_full",  cast(void**)& gtk_recent_manager_add_full},
+    { "gtk_recent_manager_add_item",  cast(void**)& gtk_recent_manager_add_item},
+    { "gtk_recent_manager_set_screen",  cast(void**)& gtk_recent_manager_set_screen},
+    { "gtk_recent_manager_get_for_screen",  cast(void**)& gtk_recent_manager_get_for_screen},
+    { "gtk_recent_manager_get_default",  cast(void**)& gtk_recent_manager_get_default},
+    { "gtk_recent_manager_new",  cast(void**)& gtk_recent_manager_new},
+    { "gtk_recent_manager_get_type",  cast(void**)& gtk_recent_manager_get_type},
+    { "gtk_recent_manager_error_quark",  cast(void**)& gtk_recent_manager_error_quark},
+    { "gtk_radio_tool_button_set_group",  cast(void**)& gtk_radio_tool_button_set_group},
+    { "gtk_radio_tool_button_get_group",  cast(void**)& gtk_radio_tool_button_get_group},
+    { "gtk_radio_tool_button_new_with_stock_from_widget",  cast(void**)& gtk_radio_tool_button_new_with_stock_from_widget},
+    { "gtk_radio_tool_button_new_from_widget",  cast(void**)& gtk_radio_tool_button_new_from_widget},
+    { "gtk_radio_tool_button_new_from_stock",  cast(void**)& gtk_radio_tool_button_new_from_stock},
+    { "gtk_radio_tool_button_new",  cast(void**)& gtk_radio_tool_button_new},
+    { "gtk_radio_tool_button_get_type",  cast(void**)& gtk_radio_tool_button_get_type},
+    { "gtk_toggle_tool_button_get_active",  cast(void**)& gtk_toggle_tool_button_get_active},
+    { "gtk_toggle_tool_button_set_active",  cast(void**)& gtk_toggle_tool_button_set_active},
+    { "gtk_toggle_tool_button_new_from_stock",  cast(void**)& gtk_toggle_tool_button_new_from_stock},
+    { "gtk_toggle_tool_button_new",  cast(void**)& gtk_toggle_tool_button_new},
+    { "gtk_toggle_tool_button_get_type",  cast(void**)& gtk_toggle_tool_button_get_type},
+    { "gtk_radio_menu_item_set_group",  cast(void**)& gtk_radio_menu_item_set_group},
+    { "gtk_radio_menu_item_get_group",  cast(void**)& gtk_radio_menu_item_get_group},
+    { "gtk_radio_menu_item_new_with_label_from_widget",  cast(void**)& gtk_radio_menu_item_new_with_label_from_widget},
+    { "gtk_radio_menu_item_new_with_mnemonic_from_widget",  cast(void**)& gtk_radio_menu_item_new_with_mnemonic_from_widget},
+    { "gtk_radio_menu_item_new_from_widget",  cast(void**)& gtk_radio_menu_item_new_from_widget},
+    { "gtk_radio_menu_item_new_with_mnemonic",  cast(void**)& gtk_radio_menu_item_new_with_mnemonic},
+    { "gtk_radio_menu_item_new_with_label",  cast(void**)& gtk_radio_menu_item_new_with_label},
+    { "gtk_radio_menu_item_new",  cast(void**)& gtk_radio_menu_item_new},
+    { "gtk_radio_menu_item_get_type",  cast(void**)& gtk_radio_menu_item_get_type},
+    { "gtk_radio_button_set_group",  cast(void**)& gtk_radio_button_set_group},
+    { "gtk_radio_button_get_group",  cast(void**)& gtk_radio_button_get_group},
+    { "gtk_radio_button_new_with_mnemonic_from_widget",  cast(void**)& gtk_radio_button_new_with_mnemonic_from_widget},
+    { "gtk_radio_button_new_with_mnemonic",  cast(void**)& gtk_radio_button_new_with_mnemonic},
+    { "gtk_radio_button_new_with_label_from_widget",  cast(void**)& gtk_radio_button_new_with_label_from_widget},
+    { "gtk_radio_button_new_with_label",  cast(void**)& gtk_radio_button_new_with_label},
+    { "gtk_radio_button_new_from_widget",  cast(void**)& gtk_radio_button_new_from_widget},
+    { "gtk_radio_button_new",  cast(void**)& gtk_radio_button_new},
+    { "gtk_radio_button_get_type",  cast(void**)& gtk_radio_button_get_type},
+    { "gtk_radio_action_set_current_value",  cast(void**)& gtk_radio_action_set_current_value},
+    { "gtk_radio_action_get_current_value",  cast(void**)& gtk_radio_action_get_current_value},
+    { "gtk_radio_action_set_group",  cast(void**)& gtk_radio_action_set_group},
+    { "gtk_radio_action_get_group",  cast(void**)& gtk_radio_action_get_group},
+    { "gtk_radio_action_new",  cast(void**)& gtk_radio_action_new},
+    { "gtk_radio_action_get_type",  cast(void**)& gtk_radio_action_get_type},
+    { "gtk_toggle_action_get_draw_as_radio",  cast(void**)& gtk_toggle_action_get_draw_as_radio},
+    { "gtk_toggle_action_set_draw_as_radio",  cast(void**)& gtk_toggle_action_set_draw_as_radio},
+    { "gtk_toggle_action_get_active",  cast(void**)& gtk_toggle_action_get_active},
+    { "gtk_toggle_action_set_active",  cast(void**)& gtk_toggle_action_set_active},
+    { "gtk_toggle_action_toggled",  cast(void**)& gtk_toggle_action_toggled},
+    { "gtk_toggle_action_new",  cast(void**)& gtk_toggle_action_new},
+    { "gtk_toggle_action_get_type",  cast(void**)& gtk_toggle_action_get_type},
+    { "gtk_progress_bar_update",  cast(void**)& gtk_progress_bar_update},
+    { "gtk_progress_bar_set_activity_blocks",  cast(void**)& gtk_progress_bar_set_activity_blocks},
+    { "gtk_progress_bar_set_activity_step",  cast(void**)& gtk_progress_bar_set_activity_step},
+    { "gtk_progress_bar_set_discrete_blocks",  cast(void**)& gtk_progress_bar_set_discrete_blocks},
+    { "gtk_progress_bar_set_bar_style",  cast(void**)& gtk_progress_bar_set_bar_style},
+    { "gtk_progress_bar_new_with_adjustment",  cast(void**)& gtk_progress_bar_new_with_adjustment},
+    { "gtk_progress_bar_get_ellipsize",  cast(void**)& gtk_progress_bar_get_ellipsize},
+    { "gtk_progress_bar_set_ellipsize",  cast(void**)& gtk_progress_bar_set_ellipsize},
+    { "gtk_progress_bar_get_orientation",  cast(void**)& gtk_progress_bar_get_orientation},
+    { "gtk_progress_bar_get_pulse_step",  cast(void**)& gtk_progress_bar_get_pulse_step},
+    { "gtk_progress_bar_get_fraction",  cast(void**)& gtk_progress_bar_get_fraction},
+    { "gtk_progress_bar_get_text",  cast(void**)& gtk_progress_bar_get_text},
+    { "gtk_progress_bar_set_orientation",  cast(void**)& gtk_progress_bar_set_orientation},
+    { "gtk_progress_bar_set_pulse_step",  cast(void**)& gtk_progress_bar_set_pulse_step},
+    { "gtk_progress_bar_set_fraction",  cast(void**)& gtk_progress_bar_set_fraction},
+    { "gtk_progress_bar_set_text",  cast(void**)& gtk_progress_bar_set_text},
+    { "gtk_progress_bar_pulse",  cast(void**)& gtk_progress_bar_pulse},
+    { "gtk_progress_bar_new",  cast(void**)& gtk_progress_bar_new},
+    { "gtk_progress_bar_get_type",  cast(void**)& gtk_progress_bar_get_type},
+    { "gtk_progress_get_percentage_from_value",  cast(void**)& gtk_progress_get_percentage_from_value},
+    { "gtk_progress_get_current_percentage",  cast(void**)& gtk_progress_get_current_percentage},
+    { "gtk_progress_get_text_from_value",  cast(void**)& gtk_progress_get_text_from_value},
+    { "gtk_progress_get_current_text",  cast(void**)& gtk_progress_get_current_text},
+    { "gtk_progress_set_activity_mode",  cast(void**)& gtk_progress_set_activity_mode},
+    { "gtk_progress_get_value",  cast(void**)& gtk_progress_get_value},
+    { "gtk_progress_set_value",  cast(void**)& gtk_progress_set_value},
+    { "gtk_progress_set_percentage",  cast(void**)& gtk_progress_set_percentage},
+    { "gtk_progress_configure",  cast(void**)& gtk_progress_configure},
+    { "gtk_progress_set_adjustment",  cast(void**)& gtk_progress_set_adjustment},
+    { "gtk_progress_set_format_string",  cast(void**)& gtk_progress_set_format_string},
+    { "gtk_progress_set_text_alignment",  cast(void**)& gtk_progress_set_text_alignment},
+    { "gtk_progress_set_show_text",  cast(void**)& gtk_progress_set_show_text},
+    { "gtk_progress_get_type",  cast(void**)& gtk_progress_get_type},
+    { "gtk_print_run_page_setup_dialog_async",  cast(void**)& gtk_print_run_page_setup_dialog_async},
+    { "gtk_print_run_page_setup_dialog",  cast(void**)& gtk_print_run_page_setup_dialog},
+    { "gtk_print_operation_cancel",  cast(void**)& gtk_print_operation_cancel},
+    { "gtk_print_operation_is_finished",  cast(void**)& gtk_print_operation_is_finished},
+    { "gtk_print_operation_get_status_string",  cast(void**)& gtk_print_operation_get_status_string},
+    { "gtk_print_operation_get_status",  cast(void**)& gtk_print_operation_get_status},
+    { "gtk_print_operation_get_error",  cast(void**)& gtk_print_operation_get_error},
+    { "gtk_print_operation_run",  cast(void**)& gtk_print_operation_run},
+    { "gtk_print_operation_set_custom_tab_label",  cast(void**)& gtk_print_operation_set_custom_tab_label},
+    { "gtk_print_operation_set_allow_async",  cast(void**)& gtk_print_operation_set_allow_async},
+    { "gtk_print_operation_set_show_progress",  cast(void**)& gtk_print_operation_set_show_progress},
+    { "gtk_print_operation_set_track_print_status",  cast(void**)& gtk_print_operation_set_track_print_status},
+    { "gtk_print_operation_set_export_filename",  cast(void**)& gtk_print_operation_set_export_filename},
+    { "gtk_print_operation_set_unit",  cast(void**)& gtk_print_operation_set_unit},
+    { "gtk_print_operation_set_use_full_page",  cast(void**)& gtk_print_operation_set_use_full_page},
+    { "gtk_print_operation_set_current_page",  cast(void**)& gtk_print_operation_set_current_page},
+    { "gtk_print_operation_set_n_pages",  cast(void**)& gtk_print_operation_set_n_pages},
+    { "gtk_print_operation_set_job_name",  cast(void**)& gtk_print_operation_set_job_name},
+    { "gtk_print_operation_get_print_settings",  cast(void**)& gtk_print_operation_get_print_settings},
+    { "gtk_print_operation_set_print_settings",  cast(void**)& gtk_print_operation_set_print_settings},
+    { "gtk_print_operation_get_default_page_setup",  cast(void**)& gtk_print_operation_get_default_page_setup},
+    { "gtk_print_operation_set_default_page_setup",  cast(void**)& gtk_print_operation_set_default_page_setup},
+    { "gtk_print_operation_new",  cast(void**)& gtk_print_operation_new},
+    { "gtk_print_operation_get_type",  cast(void**)& gtk_print_operation_get_type},
+    { "gtk_print_error_quark",  cast(void**)& gtk_print_error_quark},
+    { "gtk_print_operation_preview_is_selected",  cast(void**)& gtk_print_operation_preview_is_selected},
+    { "gtk_print_operation_preview_end_preview",  cast(void**)& gtk_print_operation_preview_end_preview},
+    { "gtk_print_operation_preview_render_page",  cast(void**)& gtk_print_operation_preview_render_page},
+    { "gtk_print_operation_preview_get_type",  cast(void**)& gtk_print_operation_preview_get_type},
+    { "gtk_print_context_set_cairo_context",  cast(void**)& gtk_print_context_set_cairo_context},
+    { "gtk_print_context_create_pango_layout",  cast(void**)& gtk_print_context_create_pango_layout},
+    { "gtk_print_context_create_pango_context",  cast(void**)& gtk_print_context_create_pango_context},
+    { "gtk_print_context_get_pango_fontmap",  cast(void**)& gtk_print_context_get_pango_fontmap},
+    { "gtk_print_context_get_dpi_y",  cast(void**)& gtk_print_context_get_dpi_y},
+    { "gtk_print_context_get_dpi_x",  cast(void**)& gtk_print_context_get_dpi_x},
+    { "gtk_print_context_get_height",  cast(void**)& gtk_print_context_get_height},
+    { "gtk_print_context_get_width",  cast(void**)& gtk_print_context_get_width},
+    { "gtk_print_context_get_page_setup",  cast(void**)& gtk_print_context_get_page_setup},
+    { "gtk_print_context_get_cairo_context",  cast(void**)& gtk_print_context_get_cairo_context},
+    { "gtk_print_context_get_type",  cast(void**)& gtk_print_context_get_type},
+    { "gtk_print_settings_set_output_bin",  cast(void**)& gtk_print_settings_set_output_bin},
+    { "gtk_print_settings_get_output_bin",  cast(void**)& gtk_print_settings_get_output_bin},
+    { "gtk_print_settings_set_finishings",  cast(void**)& gtk_print_settings_set_finishings},
+    { "gtk_print_settings_get_finishings",  cast(void**)& gtk_print_settings_get_finishings},
+    { "gtk_print_settings_set_dither",  cast(void**)& gtk_print_settings_set_dither},
+    { "gtk_print_settings_get_dither",  cast(void**)& gtk_print_settings_get_dither},
+    { "gtk_print_settings_set_media_type",  cast(void**)& gtk_print_settings_set_media_type},
+    { "gtk_print_settings_get_media_type",  cast(void**)& gtk_print_settings_get_media_type},
+    { "gtk_print_settings_set_default_source",  cast(void**)& gtk_print_settings_set_default_source},
+    { "gtk_print_settings_get_default_source",  cast(void**)& gtk_print_settings_get_default_source},
+    { "gtk_print_settings_set_page_set",  cast(void**)& gtk_print_settings_set_page_set},
+    { "gtk_print_settings_get_page_set",  cast(void**)& gtk_print_settings_get_page_set},
+    { "gtk_print_settings_set_page_ranges",  cast(void**)& gtk_print_settings_set_page_ranges},
+    { "gtk_print_settings_get_page_ranges",  cast(void**)& gtk_print_settings_get_page_ranges},
+    { "gtk_print_settings_set_print_pages",  cast(void**)& gtk_print_settings_set_print_pages},
+    { "gtk_print_settings_get_print_pages",  cast(void**)& gtk_print_settings_get_print_pages},
+    { "gtk_print_settings_set_scale",  cast(void**)& gtk_print_settings_set_scale},
+    { "gtk_print_settings_get_scale",  cast(void**)& gtk_print_settings_get_scale},
+    { "gtk_print_settings_set_resolution",  cast(void**)& gtk_print_settings_set_resolution},
+    { "gtk_print_settings_get_resolution",  cast(void**)& gtk_print_settings_get_resolution},
+    { "gtk_print_settings_set_number_up",  cast(void**)& gtk_print_settings_set_number_up},
+    { "gtk_print_settings_get_number_up",  cast(void**)& gtk_print_settings_get_number_up},
+    { "gtk_print_settings_set_n_copies",  cast(void**)& gtk_print_settings_set_n_copies},
+    { "gtk_print_settings_get_n_copies",  cast(void**)& gtk_print_settings_get_n_copies},
+    { "gtk_print_settings_set_quality",  cast(void**)& gtk_print_settings_set_quality},
+    { "gtk_print_settings_get_quality",  cast(void**)& gtk_print_settings_get_quality},
+    { "gtk_print_settings_set_duplex",  cast(void**)& gtk_print_settings_set_duplex},
+    { "gtk_print_settings_get_duplex",  cast(void**)& gtk_print_settings_get_duplex},
+    { "gtk_print_settings_set_reverse",  cast(void**)& gtk_print_settings_set_reverse},
+    { "gtk_print_settings_get_reverse",  cast(void**)& gtk_print_settings_get_reverse},
+    { "gtk_print_settings_set_collate",  cast(void**)& gtk_print_settings_set_collate},
+    { "gtk_print_settings_get_collate",  cast(void**)& gtk_print_settings_get_collate},
+    { "gtk_print_settings_set_use_color",  cast(void**)& gtk_print_settings_set_use_color},
+    { "gtk_print_settings_get_use_color",  cast(void**)& gtk_print_settings_get_use_color},
+    { "gtk_print_settings_set_paper_height",  cast(void**)& gtk_print_settings_set_paper_height},
+    { "gtk_print_settings_get_paper_height",  cast(void**)& gtk_print_settings_get_paper_height},
+    { "gtk_print_settings_set_paper_width",  cast(void**)& gtk_print_settings_set_paper_width},
+    { "gtk_print_settings_get_paper_width",  cast(void**)& gtk_print_settings_get_paper_width},
+    { "gtk_print_settings_set_paper_size",  cast(void**)& gtk_print_settings_set_paper_size},
+    { "gtk_print_settings_get_paper_size",  cast(void**)& gtk_print_settings_get_paper_size},
+    { "gtk_print_settings_set_orientation",  cast(void**)& gtk_print_settings_set_orientation},
+    { "gtk_print_settings_get_orientation",  cast(void**)& gtk_print_settings_get_orientation},
+    { "gtk_print_settings_set_printer",  cast(void**)& gtk_print_settings_set_printer},
+    { "gtk_print_settings_get_printer",  cast(void**)& gtk_print_settings_get_printer},
+    { "gtk_print_settings_set_int",  cast(void**)& gtk_print_settings_set_int},
+    { "gtk_print_settings_get_int_with_default",  cast(void**)& gtk_print_settings_get_int_with_default},
+    { "gtk_print_settings_get_int",  cast(void**)& gtk_print_settings_get_int},
+    { "gtk_print_settings_set_length",  cast(void**)& gtk_print_settings_set_length},
+    { "gtk_print_settings_get_length",  cast(void**)& gtk_print_settings_get_length},
+    { "gtk_print_settings_set_double",  cast(void**)& gtk_print_settings_set_double},
+    { "gtk_print_settings_get_double_with_default",  cast(void**)& gtk_print_settings_get_double_with_default},
+    { "gtk_print_settings_get_double",  cast(void**)& gtk_print_settings_get_double},
+    { "gtk_print_settings_set_bool",  cast(void**)& gtk_print_settings_set_bool},
+    { "gtk_print_settings_get_bool",  cast(void**)& gtk_print_settings_get_bool},
+    { "gtk_print_settings_foreach",  cast(void**)& gtk_print_settings_foreach},
+    { "gtk_print_settings_unset",  cast(void**)& gtk_print_settings_unset},
+    { "gtk_print_settings_set",  cast(void**)& gtk_print_settings_set},
+    { "gtk_print_settings_get",  cast(void**)& gtk_print_settings_get},
+    { "gtk_print_settings_has_key",  cast(void**)& gtk_print_settings_has_key},
+    { "gtk_print_settings_to_key_file",  cast(void**)& gtk_print_settings_to_key_file},
+    { "gtk_print_settings_new_from_key_file",  cast(void**)& gtk_print_settings_new_from_key_file},
+    { "gtk_print_settings_to_file",  cast(void**)& gtk_print_settings_to_file},
+    { "gtk_print_settings_new_from_file",  cast(void**)& gtk_print_settings_new_from_file},
+    { "gtk_print_settings_copy",  cast(void**)& gtk_print_settings_copy},
+    { "gtk_print_settings_new",  cast(void**)& gtk_print_settings_new},
+    { "gtk_print_settings_get_type",  cast(void**)& gtk_print_settings_get_type},
+    { "gtk_page_setup_to_key_file",  cast(void**)& gtk_page_setup_to_key_file},
+    { "gtk_page_setup_new_from_key_file",  cast(void**)& gtk_page_setup_new_from_key_file},
+    { "gtk_page_setup_to_file",  cast(void**)& gtk_page_setup_to_file},
+    { "gtk_page_setup_new_from_file",  cast(void**)& gtk_page_setup_new_from_file},
+    { "gtk_page_setup_get_page_height",  cast(void**)& gtk_page_setup_get_page_height},
+    { "gtk_page_setup_get_page_width",  cast(void**)& gtk_page_setup_get_page_width},
+    { "gtk_page_setup_get_paper_height",  cast(void**)& gtk_page_setup_get_paper_height},
+    { "gtk_page_setup_get_paper_width",  cast(void**)& gtk_page_setup_get_paper_width},
+    { "gtk_page_setup_set_paper_size_and_default_margins",  cast(void**)& gtk_page_setup_set_paper_size_and_default_margins},
+    { "gtk_page_setup_set_right_margin",  cast(void**)& gtk_page_setup_set_right_margin},
+    { "gtk_page_setup_get_right_margin",  cast(void**)& gtk_page_setup_get_right_margin},
+    { "gtk_page_setup_set_left_margin",  cast(void**)& gtk_page_setup_set_left_margin},
+    { "gtk_page_setup_get_left_margin",  cast(void**)& gtk_page_setup_get_left_margin},
+    { "gtk_page_setup_set_bottom_margin",  cast(void**)& gtk_page_setup_set_bottom_margin},
+    { "gtk_page_setup_get_bottom_margin",  cast(void**)& gtk_page_setup_get_bottom_margin},
+    { "gtk_page_setup_set_top_margin",  cast(void**)& gtk_page_setup_set_top_margin},
+    { "gtk_page_setup_get_top_margin",  cast(void**)& gtk_page_setup_get_top_margin},
+    { "gtk_page_setup_set_paper_size",  cast(void**)& gtk_page_setup_set_paper_size},
+    { "gtk_page_setup_get_paper_size",  cast(void**)& gtk_page_setup_get_paper_size},
+    { "gtk_page_setup_set_orientation",  cast(void**)& gtk_page_setup_set_orientation},
+    { "gtk_page_setup_get_orientation",  cast(void**)& gtk_page_setup_get_orientation},
+    { "gtk_page_setup_copy",  cast(void**)& gtk_page_setup_copy},
+    { "gtk_page_setup_new",  cast(void**)& gtk_page_setup_new},
+    { "gtk_page_setup_get_type",  cast(void**)& gtk_page_setup_get_type},
+    { "gtk_paper_size_to_key_file",  cast(void**)& gtk_paper_size_to_key_file},
+    { "gtk_paper_size_new_from_key_file",  cast(void**)& gtk_paper_size_new_from_key_file},
+    { "gtk_paper_size_get_default",  cast(void**)& gtk_paper_size_get_default},
+    { "gtk_paper_size_get_default_right_margin",  cast(void**)& gtk_paper_size_get_default_right_margin},
+    { "gtk_paper_size_get_default_left_margin",  cast(void**)& gtk_paper_size_get_default_left_margin},
+    { "gtk_paper_size_get_default_bottom_margin",  cast(void**)& gtk_paper_size_get_default_bottom_margin},
+    { "gtk_paper_size_get_default_top_margin",  cast(void**)& gtk_paper_size_get_default_top_margin},
+    { "gtk_paper_size_set_size",  cast(void**)& gtk_paper_size_set_size},
+    { "gtk_paper_size_is_custom",  cast(void**)& gtk_paper_size_is_custom},
+    { "gtk_paper_size_get_height",  cast(void**)& gtk_paper_size_get_height},
+    { "gtk_paper_size_get_width",  cast(void**)& gtk_paper_size_get_width},
+    { "gtk_paper_size_get_ppd_name",  cast(void**)& gtk_paper_size_get_ppd_name},
+    { "gtk_paper_size_get_display_name",  cast(void**)& gtk_paper_size_get_display_name},
+    { "gtk_paper_size_get_name",  cast(void**)& gtk_paper_size_get_name},
+    { "gtk_paper_size_get_paper_sizes",  cast(void**)& gtk_paper_size_get_paper_sizes},
+    { "gtk_paper_size_is_equal",  cast(void**)& gtk_paper_size_is_equal},
+    { "gtk_paper_size_free",  cast(void**)& gtk_paper_size_free},
+    { "gtk_paper_size_copy",  cast(void**)& gtk_paper_size_copy},
+    { "gtk_paper_size_new_custom",  cast(void**)& gtk_paper_size_new_custom},
+    { "gtk_paper_size_new_from_ppd",  cast(void**)& gtk_paper_size_new_from_ppd},
+    { "gtk_paper_size_new",  cast(void**)& gtk_paper_size_new},
+    { "gtk_paper_size_get_type",  cast(void**)& gtk_paper_size_get_type},
+    { "gtk_preview_reset",  cast(void**)& gtk_preview_reset},
+    { "gtk_preview_get_info",  cast(void**)& gtk_preview_get_info},
+    { "gtk_preview_get_cmap",  cast(void**)& gtk_preview_get_cmap},
+    { "gtk_preview_get_visual",  cast(void**)& gtk_preview_get_visual},
+    { "gtk_preview_set_dither",  cast(void**)& gtk_preview_set_dither},
+    { "gtk_preview_set_reserved",  cast(void**)& gtk_preview_set_reserved},
+    { "gtk_preview_set_install_cmap",  cast(void**)& gtk_preview_set_install_cmap},
+    { "gtk_preview_set_color_cube",  cast(void**)& gtk_preview_set_color_cube},
+    { "gtk_preview_set_gamma",  cast(void**)& gtk_preview_set_gamma},
+    { "gtk_preview_set_expand",  cast(void**)& gtk_preview_set_expand},
+    { "gtk_preview_draw_row",  cast(void**)& gtk_preview_draw_row},
+    { "gtk_preview_put",  cast(void**)& gtk_preview_put},
+    { "gtk_preview_size",  cast(void**)& gtk_preview_size},
+    { "gtk_preview_new",  cast(void**)& gtk_preview_new},
+    { "gtk_preview_uninit",  cast(void**)& gtk_preview_uninit},
+    { "gtk_preview_get_type",  cast(void**)& gtk_preview_get_type},
+//     { "_gtk_plug_remove_from_socket",  cast(void**)& _gtk_plug_remove_from_socket},
+//     { "_gtk_plug_add_to_socket",  cast(void**)& _gtk_plug_add_to_socket},
+    { "gtk_plug_get_id",  cast(void**)& gtk_plug_get_id},
+    { "gtk_plug_new_for_display",  cast(void**)& gtk_plug_new_for_display},
+    { "gtk_plug_construct_for_display",  cast(void**)& gtk_plug_construct_for_display},
+    { "gtk_plug_new",  cast(void**)& gtk_plug_new},
+    { "gtk_plug_construct",  cast(void**)& gtk_plug_construct},
+    { "gtk_plug_get_type",  cast(void**)& gtk_plug_get_type},
+    { "gtk_socket_steal",  cast(void**)& gtk_socket_steal},
+    { "gtk_socket_get_id",  cast(void**)& gtk_socket_get_id},
+    { "gtk_socket_add_id",  cast(void**)& gtk_socket_add_id},
+    { "gtk_socket_new",  cast(void**)& gtk_socket_new},
+    { "gtk_socket_get_type",  cast(void**)& gtk_socket_get_type},
+    { "gtk_pixmap_set_build_insensitive",  cast(void**)& gtk_pixmap_set_build_insensitive},
+    { "gtk_pixmap_get",  cast(void**)& gtk_pixmap_get},
+    { "gtk_pixmap_set",  cast(void**)& gtk_pixmap_set},
+    { "gtk_pixmap_new",  cast(void**)& gtk_pixmap_new},
+    { "gtk_pixmap_get_type",  cast(void**)& gtk_pixmap_get_type},
+    { "gtk_option_menu_set_history",  cast(void**)& gtk_option_menu_set_history},
+    { "gtk_option_menu_get_history",  cast(void**)& gtk_option_menu_get_history},
+    { "gtk_option_menu_remove_menu",  cast(void**)& gtk_option_menu_remove_menu},
+    { "gtk_option_menu_set_menu",  cast(void**)& gtk_option_menu_set_menu},
+    { "gtk_option_menu_get_menu",  cast(void**)& gtk_option_menu_get_menu},
+    { "gtk_option_menu_new",  cast(void**)& gtk_option_menu_new},
+    { "gtk_option_menu_get_type",  cast(void**)& gtk_option_menu_get_type},
+    { "gtk_old_editable_changed",  cast(void**)& gtk_old_editable_changed},
+    { "gtk_old_editable_claim_selection",  cast(void**)& gtk_old_editable_claim_selection},
+    { "gtk_old_editable_get_type",  cast(void**)& gtk_old_editable_get_type},
+    { "gtk_notebook_set_tab_detachable",  cast(void**)& gtk_notebook_set_tab_detachable},
+    { "gtk_notebook_get_tab_detachable",  cast(void**)& gtk_notebook_get_tab_detachable},
+    { "gtk_notebook_set_tab_reorderable",  cast(void**)& gtk_notebook_set_tab_reorderable},
+    { "gtk_notebook_get_tab_reorderable",  cast(void**)& gtk_notebook_get_tab_reorderable},
+    { "gtk_notebook_reorder_child",  cast(void**)& gtk_notebook_reorder_child},
+    { "gtk_notebook_set_tab_label_packing",  cast(void**)& gtk_notebook_set_tab_label_packing},
+    { "gtk_notebook_query_tab_label_packing",  cast(void**)& gtk_notebook_query_tab_label_packing},
+    { "gtk_notebook_get_menu_label_text",  cast(void**)& gtk_notebook_get_menu_label_text},
+    { "gtk_notebook_set_menu_label_text",  cast(void**)& gtk_notebook_set_menu_label_text},
+    { "gtk_notebook_set_menu_label",  cast(void**)& gtk_notebook_set_menu_label},
+    { "gtk_notebook_get_menu_label",  cast(void**)& gtk_notebook_get_menu_label},
+    { "gtk_notebook_get_tab_label_text",  cast(void**)& gtk_notebook_get_tab_label_text},
+    { "gtk_notebook_set_tab_label_text",  cast(void**)& gtk_notebook_set_tab_label_text},
+    { "gtk_notebook_set_tab_label",  cast(void**)& gtk_notebook_set_tab_label},
+    { "gtk_notebook_get_tab_label",  cast(void**)& gtk_notebook_get_tab_label},
+    { "gtk_notebook_popup_disable",  cast(void**)& gtk_notebook_popup_disable},
+    { "gtk_notebook_popup_enable",  cast(void**)& gtk_notebook_popup_enable},
+    { "gtk_notebook_get_scrollable",  cast(void**)& gtk_notebook_get_scrollable},
+    { "gtk_notebook_set_scrollable",  cast(void**)& gtk_notebook_set_scrollable},
+    { "gtk_notebook_set_tab_vborder",  cast(void**)& gtk_notebook_set_tab_vborder},
+    { "gtk_notebook_set_tab_hborder",  cast(void**)& gtk_notebook_set_tab_hborder},
+    { "gtk_notebook_set_tab_border",  cast(void**)& gtk_notebook_set_tab_border},
+    { "gtk_notebook_set_homogeneous_tabs",  cast(void**)& gtk_notebook_set_homogeneous_tabs},
+    { "gtk_notebook_get_tab_pos",  cast(void**)& gtk_notebook_get_tab_pos},
+    { "gtk_notebook_set_tab_pos",  cast(void**)& gtk_notebook_set_tab_pos},
+    { "gtk_notebook_get_show_tabs",  cast(void**)& gtk_notebook_get_show_tabs},
+    { "gtk_notebook_set_show_tabs",  cast(void**)& gtk_notebook_set_show_tabs},
+    { "gtk_notebook_get_show_border",  cast(void**)& gtk_notebook_get_show_border},
+    { "gtk_notebook_set_show_border",  cast(void**)& gtk_notebook_set_show_border},
+    { "gtk_notebook_prev_page",  cast(void**)& gtk_notebook_prev_page},
+    { "gtk_notebook_next_page",  cast(void**)& gtk_notebook_next_page},
+    { "gtk_notebook_set_current_page",  cast(void**)& gtk_notebook_set_current_page},
+    { "gtk_notebook_page_num",  cast(void**)& gtk_notebook_page_num},
+    { "gtk_notebook_get_n_pages",  cast(void**)& gtk_notebook_get_n_pages},
+    { "gtk_notebook_get_nth_page",  cast(void**)& gtk_notebook_get_nth_page},
+    { "gtk_notebook_get_current_page",  cast(void**)& gtk_notebook_get_current_page},
+    { "gtk_notebook_get_group",  cast(void**)& gtk_notebook_get_group},
+    { "gtk_notebook_set_group",  cast(void**)& gtk_notebook_set_group},
+    { "gtk_notebook_get_group_id",  cast(void**)& gtk_notebook_get_group_id},
+    { "gtk_notebook_set_group_id",  cast(void**)& gtk_notebook_set_group_id},
+    { "gtk_notebook_set_window_creation_hook",  cast(void**)& gtk_notebook_set_window_creation_hook},
+    { "gtk_notebook_remove_page",  cast(void**)& gtk_notebook_remove_page},
+    { "gtk_notebook_insert_page_menu",  cast(void**)& gtk_notebook_insert_page_menu},
+    { "gtk_notebook_insert_page",  cast(void**)& gtk_notebook_insert_page},
+    { "gtk_notebook_prepend_page_menu",  cast(void**)& gtk_notebook_prepend_page_menu},
+    { "gtk_notebook_prepend_page",  cast(void**)& gtk_notebook_prepend_page},
+    { "gtk_notebook_append_page_menu",  cast(void**)& gtk_notebook_append_page_menu},
+    { "gtk_notebook_append_page",  cast(void**)& gtk_notebook_append_page},
+    { "gtk_notebook_new",  cast(void**)& gtk_notebook_new},
+    { "gtk_notebook_get_type",  cast(void**)& gtk_notebook_get_type},
+//     { "_gtk_modules_settings_changed",  cast(void**)& _gtk_modules_settings_changed},
+//     { "_gtk_modules_init",  cast(void**)& _gtk_modules_init},
+//     { "_gtk_get_module_path",  cast(void**)& _gtk_get_module_path},
+//     { "_gtk_find_module",  cast(void**)& _gtk_find_module},
+    { "gtk_message_dialog_format_secondary_markup",  cast(void**)& gtk_message_dialog_format_secondary_markup},
+    { "gtk_message_dialog_format_secondary_text",  cast(void**)& gtk_message_dialog_format_secondary_text},
+    { "gtk_message_dialog_set_markup",  cast(void**)& gtk_message_dialog_set_markup},
+    { "gtk_message_dialog_set_image",  cast(void**)& gtk_message_dialog_set_image},
+    { "gtk_message_dialog_new_with_markup",  cast(void**)& gtk_message_dialog_new_with_markup},
+    { "gtk_message_dialog_new",  cast(void**)& gtk_message_dialog_new},
+    { "gtk_message_dialog_get_type",  cast(void**)& gtk_message_dialog_get_type},
+    { "gtk_menu_tool_button_set_arrow_tooltip_markup",  cast(void**)& gtk_menu_tool_button_set_arrow_tooltip_markup},
+    { "gtk_menu_tool_button_set_arrow_tooltip_text",  cast(void**)& gtk_menu_tool_button_set_arrow_tooltip_text},
+    { "gtk_menu_tool_button_set_arrow_tooltip",  cast(void**)& gtk_menu_tool_button_set_arrow_tooltip},
+    { "gtk_menu_tool_button_get_menu",  cast(void**)& gtk_menu_tool_button_get_menu},
+    { "gtk_menu_tool_button_set_menu",  cast(void**)& gtk_menu_tool_button_set_menu},
+    { "gtk_menu_tool_button_new_from_stock",  cast(void**)& gtk_menu_tool_button_new_from_stock},
+    { "gtk_menu_tool_button_new",  cast(void**)& gtk_menu_tool_button_new},
+    { "gtk_menu_tool_button_get_type",  cast(void**)& gtk_menu_tool_button_get_type},
+//     { "_gtk_tool_button_get_button",  cast(void**)& _gtk_tool_button_get_button},
+    { "gtk_tool_button_get_label_widget",  cast(void**)& gtk_tool_button_get_label_widget},
+    { "gtk_tool_button_set_label_widget",  cast(void**)& gtk_tool_button_set_label_widget},
+    { "gtk_tool_button_get_icon_widget",  cast(void**)& gtk_tool_button_get_icon_widget},
+    { "gtk_tool_button_set_icon_widget",  cast(void**)& gtk_tool_button_set_icon_widget},
+    { "gtk_tool_button_get_icon_name",  cast(void**)& gtk_tool_button_get_icon_name},
+    { "gtk_tool_button_set_icon_name",  cast(void**)& gtk_tool_button_set_icon_name},
+    { "gtk_tool_button_get_stock_id",  cast(void**)& gtk_tool_button_get_stock_id},
+    { "gtk_tool_button_set_stock_id",  cast(void**)& gtk_tool_button_set_stock_id},
+    { "gtk_tool_button_get_use_underline",  cast(void**)& gtk_tool_button_get_use_underline},
+    { "gtk_tool_button_set_use_underline",  cast(void**)& gtk_tool_button_set_use_underline},
+    { "gtk_tool_button_get_label",  cast(void**)& gtk_tool_button_get_label},
+    { "gtk_tool_button_set_label",  cast(void**)& gtk_tool_button_set_label},
+    { "gtk_tool_button_new_from_stock",  cast(void**)& gtk_tool_button_new_from_stock},
+    { "gtk_tool_button_new",  cast(void**)& gtk_tool_button_new},
+    { "gtk_tool_button_get_type",  cast(void**)& gtk_tool_button_get_type},
+//     { "_gtk_tool_item_toolbar_reconfigured",  cast(void**)& _gtk_tool_item_toolbar_reconfigured},
+    { "gtk_tool_item_rebuild_menu",  cast(void**)& gtk_tool_item_rebuild_menu},
+    { "gtk_tool_item_set_proxy_menu_item",  cast(void**)& gtk_tool_item_set_proxy_menu_item},
+    { "gtk_tool_item_get_proxy_menu_item",  cast(void**)& gtk_tool_item_get_proxy_menu_item},
+    { "gtk_tool_item_retrieve_proxy_menu_item",  cast(void**)& gtk_tool_item_retrieve_proxy_menu_item},
+    { "gtk_tool_item_get_relief_style",  cast(void**)& gtk_tool_item_get_relief_style},
+    { "gtk_tool_item_get_toolbar_style",  cast(void**)& gtk_tool_item_get_toolbar_style},
+    { "gtk_tool_item_get_orientation",  cast(void**)& gtk_tool_item_get_orientation},
+    { "gtk_tool_item_get_icon_size",  cast(void**)& gtk_tool_item_get_icon_size},
+    { "gtk_tool_item_set_is_important",  cast(void**)& gtk_tool_item_set_is_important},
+    { "gtk_tool_item_get_is_important",  cast(void**)& gtk_tool_item_get_is_important},
+    { "gtk_tool_item_get_visible_vertical",  cast(void**)& gtk_tool_item_get_visible_vertical},
+    { "gtk_tool_item_set_visible_vertical",  cast(void**)& gtk_tool_item_set_visible_vertical},
+    { "gtk_tool_item_get_visible_horizontal",  cast(void**)& gtk_tool_item_get_visible_horizontal},
+    { "gtk_tool_item_set_visible_horizontal",  cast(void**)& gtk_tool_item_set_visible_horizontal},
+    { "gtk_tool_item_get_use_drag_window",  cast(void**)& gtk_tool_item_get_use_drag_window},
+    { "gtk_tool_item_set_use_drag_window",  cast(void**)& gtk_tool_item_set_use_drag_window},
+    { "gtk_tool_item_set_tooltip_markup",  cast(void**)& gtk_tool_item_set_tooltip_markup},
+    { "gtk_tool_item_set_tooltip_text",  cast(void**)& gtk_tool_item_set_tooltip_text},
+    { "gtk_tool_item_set_tooltip",  cast(void**)& gtk_tool_item_set_tooltip},
+    { "gtk_tool_item_get_expand",  cast(void**)& gtk_tool_item_get_expand},
+    { "gtk_tool_item_set_expand",  cast(void**)& gtk_tool_item_set_expand},
+    { "gtk_tool_item_get_homogeneous",  cast(void**)& gtk_tool_item_get_homogeneous},
+    { "gtk_tool_item_set_homogeneous",  cast(void**)& gtk_tool_item_set_homogeneous},
+    { "gtk_tool_item_new",  cast(void**)& gtk_tool_item_new},
+    { "gtk_tool_item_get_type",  cast(void**)& gtk_tool_item_get_type},
+    { "gtk_tooltips_get_info_from_tip_window",  cast(void**)& gtk_tooltips_get_info_from_tip_window},
+    { "gtk_tooltips_force_window",  cast(void**)& gtk_tooltips_force_window},
+    { "gtk_tooltips_data_get",  cast(void**)& gtk_tooltips_data_get},
+    { "gtk_tooltips_set_tip",  cast(void**)& gtk_tooltips_set_tip},
+    { "gtk_tooltips_set_delay",  cast(void**)& gtk_tooltips_set_delay},
+    { "gtk_tooltips_disable",  cast(void**)& gtk_tooltips_disable},
+    { "gtk_tooltips_enable",  cast(void**)& gtk_tooltips_enable},
+    { "gtk_tooltips_new",  cast(void**)& gtk_tooltips_new},
+    { "gtk_tooltips_get_type",  cast(void**)& gtk_tooltips_get_type},
+//     { "_gtk_menu_bar_cycle_focus",  cast(void**)& _gtk_menu_bar_cycle_focus},
+    { "gtk_menu_bar_set_child_pack_direction",  cast(void**)& gtk_menu_bar_set_child_pack_direction},
+    { "gtk_menu_bar_get_child_pack_direction",  cast(void**)& gtk_menu_bar_get_child_pack_direction},
+    { "gtk_menu_bar_set_pack_direction",  cast(void**)& gtk_menu_bar_set_pack_direction},
+    { "gtk_menu_bar_get_pack_direction",  cast(void**)& gtk_menu_bar_get_pack_direction},
+    { "gtk_menu_bar_new",  cast(void**)& gtk_menu_bar_new},
+    { "gtk_menu_bar_get_type",  cast(void**)& gtk_menu_bar_get_type},
+//     { "_gtk_get_lc_ctype",  cast(void**)& _gtk_get_lc_ctype},
+//     { "_gtk_boolean_handled_accumulator",  cast(void**)& _gtk_boolean_handled_accumulator},
+    { "gtk_propagate_event",  cast(void**)& gtk_propagate_event},
+    { "gtk_get_event_widget",  cast(void**)& gtk_get_event_widget},
+    { "gtk_get_current_event_state",  cast(void**)& gtk_get_current_event_state},
+    { "gtk_get_current_event_time",  cast(void**)& gtk_get_current_event_time},
+    { "gtk_get_current_event",  cast(void**)& gtk_get_current_event},
+    { "gtk_key_snooper_remove",  cast(void**)& gtk_key_snooper_remove},
+    { "gtk_key_snooper_install",  cast(void**)& gtk_key_snooper_install},
+    { "gtk_input_remove",  cast(void**)& gtk_input_remove},
+    { "gtk_input_add_full",  cast(void**)& gtk_input_add_full},
+    { "gtk_idle_remove_by_data",  cast(void**)& gtk_idle_remove_by_data},
+    { "gtk_idle_remove",  cast(void**)& gtk_idle_remove},
+    { "gtk_idle_add_full",  cast(void**)& gtk_idle_add_full},
+    { "gtk_idle_add_priority",  cast(void**)& gtk_idle_add_priority},
+    { "gtk_idle_add",  cast(void**)& gtk_idle_add},
+    { "gtk_timeout_remove",  cast(void**)& gtk_timeout_remove},
+    { "gtk_timeout_add_full",  cast(void**)& gtk_timeout_add_full},
+    { "gtk_timeout_add",  cast(void**)& gtk_timeout_add},
+    { "gtk_quit_remove_by_data",  cast(void**)& gtk_quit_remove_by_data},
+    { "gtk_quit_remove",  cast(void**)& gtk_quit_remove},
+    { "gtk_quit_add_full",  cast(void**)& gtk_quit_add_full},
+    { "gtk_quit_add",  cast(void**)& gtk_quit_add},
+    { "gtk_quit_add_destroy",  cast(void**)& gtk_quit_add_destroy},
+    { "gtk_init_add",  cast(void**)& gtk_init_add},
+    { "gtk_grab_remove",  cast(void**)& gtk_grab_remove},
+    { "gtk_grab_get_current",  cast(void**)& gtk_grab_get_current},
+    { "gtk_grab_add",  cast(void**)& gtk_grab_add},
+    { "gtk_false",  cast(void**)& gtk_false},
+    { "gtk_true",  cast(void**)& gtk_true},
+    { "gtk_main_iteration_do",  cast(void**)& gtk_main_iteration_do},
+    { "gtk_main_iteration",  cast(void**)& gtk_main_iteration},
+    { "gtk_main_quit",  cast(void**)& gtk_main_quit},
+    { "gtk_main_level",  cast(void**)& gtk_main_level},
+    { "gtk_main",  cast(void**)& gtk_main},
+    { "gtk_main_do_event",  cast(void**)& gtk_main_do_event},
+    { "gtk_events_pending",  cast(void**)& gtk_events_pending},
+    { "gtk_get_default_language",  cast(void**)& gtk_get_default_language},
+    //{ "gtk_set_locale",  cast(void**)& gtk_set_locale},
+    { "gtk_disable_setlocale",  cast(void**)& gtk_disable_setlocale},
+    { "gtk_exit",  cast(void**)& gtk_exit},
+    { "gtk_get_option_group",  cast(void**)& gtk_get_option_group},
+    { "gtk_init_with_args",  cast(void**)& gtk_init_with_args},
+    //{ "gtk_init_check",  cast(void**)& gtk_init_check},
+    { "gtk_init",  cast(void**)& gtk_init},
+    { "gtk_parse_args",  cast(void**)& gtk_parse_args},
+    { "gtk_check_version",  cast(void**)& gtk_check_version},
+//     { "gtk_interface_age",  cast(void**)& gtk_interface_age},
+//     { "gtk_binary_age",  cast(void**)& gtk_binary_age},
+//     { "gtk_micro_version",  cast(void**)& gtk_micro_version},
+//     { "gtk_minor_version",  cast(void**)& gtk_minor_version},
+//     { "gtk_major_version",  cast(void**)& gtk_major_version},
+    { "gtk_list_end_drag_selection",  cast(void**)& gtk_list_end_drag_selection},
+    { "gtk_list_undo_selection",  cast(void**)& gtk_list_undo_selection},
+    { "gtk_list_toggle_row",  cast(void**)& gtk_list_toggle_row},
+    { "gtk_list_toggle_focus_row",  cast(void**)& gtk_list_toggle_focus_row},
+    { "gtk_list_toggle_add_mode",  cast(void**)& gtk_list_toggle_add_mode},
+    { "gtk_list_scroll_vertical",  cast(void**)& gtk_list_scroll_vertical},
+    { "gtk_list_scroll_horizontal",  cast(void**)& gtk_list_scroll_horizontal},
+    { "gtk_list_unselect_all",  cast(void**)& gtk_list_unselect_all},
+    { "gtk_list_select_all",  cast(void**)& gtk_list_select_all},
+    { "gtk_list_end_selection",  cast(void**)& gtk_list_end_selection},
+    { "gtk_list_start_selection",  cast(void**)& gtk_list_start_selection},
+    { "gtk_list_extend_selection",  cast(void**)& gtk_list_extend_selection},
+    { "gtk_list_set_selection_mode",  cast(void**)& gtk_list_set_selection_mode},
+    { "gtk_list_child_position",  cast(void**)& gtk_list_child_position},
+    { "gtk_list_unselect_child",  cast(void**)& gtk_list_unselect_child},
+    { "gtk_list_select_child",  cast(void**)& gtk_list_select_child},
+    { "gtk_list_unselect_item",  cast(void**)& gtk_list_unselect_item},
+    { "gtk_list_select_item",  cast(void**)& gtk_list_select_item},
+    { "gtk_list_clear_items",  cast(void**)& gtk_list_clear_items},
+    { "gtk_list_remove_items_no_unref",  cast(void**)& gtk_list_remove_items_no_unref},
+    { "gtk_list_remove_items",  cast(void**)& gtk_list_remove_items},
+    { "gtk_list_prepend_items",  cast(void**)& gtk_list_prepend_items},
+    { "gtk_list_append_items",  cast(void**)& gtk_list_append_items},
+    { "gtk_list_insert_items",  cast(void**)& gtk_list_insert_items},
+    { "gtk_list_new",  cast(void**)& gtk_list_new},
+    { "gtk_list_get_type",  cast(void**)& gtk_list_get_type},
+    { "gtk_list_item_deselect",  cast(void**)& gtk_list_item_deselect},
+    { "gtk_list_item_select",  cast(void**)& gtk_list_item_select},
+    { "gtk_list_item_new_with_label",  cast(void**)& gtk_list_item_new_with_label},
+    { "gtk_list_item_new",  cast(void**)& gtk_list_item_new},
+    { "gtk_list_item_get_type",  cast(void**)& gtk_list_item_get_type},
+    { "gtk_link_button_set_uri_hook",  cast(void**)& gtk_link_button_set_uri_hook},
+    { "gtk_link_button_set_uri",  cast(void**)& gtk_link_button_set_uri},
+    { "gtk_link_button_get_uri",  cast(void**)& gtk_link_button_get_uri},
+    { "gtk_link_button_new_with_label",  cast(void**)& gtk_link_button_new_with_label},
+    { "gtk_link_button_new",  cast(void**)& gtk_link_button_new},
+    { "gtk_link_button_get_type",  cast(void**)& gtk_link_button_get_type},
+    { "gtk_layout_thaw",  cast(void**)& gtk_layout_thaw},
+    { "gtk_layout_freeze",  cast(void**)& gtk_layout_freeze},
+    { "gtk_layout_set_vadjustment",  cast(void**)& gtk_layout_set_vadjustment},
+    { "gtk_layout_set_hadjustment",  cast(void**)& gtk_layout_set_hadjustment},
+    { "gtk_layout_get_vadjustment",  cast(void**)& gtk_layout_get_vadjustment},
+    { "gtk_layout_get_hadjustment",  cast(void**)& gtk_layout_get_hadjustment},
+    { "gtk_layout_get_size",  cast(void**)& gtk_layout_get_size},
+    { "gtk_layout_set_size",  cast(void**)& gtk_layout_set_size},
+    { "gtk_layout_move",  cast(void**)& gtk_layout_move},
+    { "gtk_layout_put",  cast(void**)& gtk_layout_put},
+    { "gtk_layout_new",  cast(void**)& gtk_layout_new},
+    { "gtk_layout_get_type",  cast(void**)& gtk_layout_get_type},
+    { "gtk_invisible_get_screen",  cast(void**)& gtk_invisible_get_screen},
+    { "gtk_invisible_set_screen",  cast(void**)& gtk_invisible_set_screen},
+    { "gtk_invisible_new_for_screen",  cast(void**)& gtk_invisible_new_for_screen},
+    { "gtk_invisible_new",  cast(void**)& gtk_invisible_new},
+    { "gtk_invisible_get_type",  cast(void**)& gtk_invisible_get_type},
+    { "gtk_input_dialog_new",  cast(void**)& gtk_input_dialog_new},
+    { "gtk_input_dialog_get_type",  cast(void**)& gtk_input_dialog_get_type},
+    { "gtk_im_multicontext_append_menuitems",  cast(void**)& gtk_im_multicontext_append_menuitems},
+    { "gtk_im_multicontext_new",  cast(void**)& gtk_im_multicontext_new},
+    { "gtk_im_multicontext_get_type",  cast(void**)& gtk_im_multicontext_get_type},
+    { "gtk_im_context_simple_add_table",  cast(void**)& gtk_im_context_simple_add_table},
+    { "gtk_im_context_simple_new",  cast(void**)& gtk_im_context_simple_new},
+    { "gtk_im_context_simple_get_type",  cast(void**)& gtk_im_context_simple_get_type},
+    { "gtk_image_menu_item_get_image",  cast(void**)& gtk_image_menu_item_get_image},
+    { "gtk_image_menu_item_set_image",  cast(void**)& gtk_image_menu_item_set_image},
+    { "gtk_image_menu_item_new_from_stock",  cast(void**)& gtk_image_menu_item_new_from_stock},
+    { "gtk_image_menu_item_new_with_mnemonic",  cast(void**)& gtk_image_menu_item_new_with_mnemonic},
+    { "gtk_image_menu_item_new_with_label",  cast(void**)& gtk_image_menu_item_new_with_label},
+    { "gtk_image_menu_item_new",  cast(void**)& gtk_image_menu_item_new},
+    { "gtk_image_menu_item_get_type",  cast(void**)& gtk_image_menu_item_get_type},
+    { "gtk_icon_view_get_tooltip_column",  cast(void**)& gtk_icon_view_get_tooltip_column},
+    { "gtk_icon_view_set_tooltip_column",  cast(void**)& gtk_icon_view_set_tooltip_column},
+    { "gtk_icon_view_get_tooltip_context",  cast(void**)& gtk_icon_view_get_tooltip_context},
+    { "gtk_icon_view_set_tooltip_cell",  cast(void**)& gtk_icon_view_set_tooltip_cell},
+    { "gtk_icon_view_set_tooltip_item",  cast(void**)& gtk_icon_view_set_tooltip_item},
+    { "gtk_icon_view_convert_widget_to_bin_window_coords",  cast(void**)& gtk_icon_view_convert_widget_to_bin_window_coords},
+    { "gtk_icon_view_create_drag_icon",  cast(void**)& gtk_icon_view_create_drag_icon},
+    { "gtk_icon_view_get_dest_item_at_pos",  cast(void**)& gtk_icon_view_get_dest_item_at_pos},
+    { "gtk_icon_view_get_drag_dest_item",  cast(void**)& gtk_icon_view_get_drag_dest_item},
+    { "gtk_icon_view_set_drag_dest_item",  cast(void**)& gtk_icon_view_set_drag_dest_item},
+    { "gtk_icon_view_get_reorderable",  cast(void**)& gtk_icon_view_get_reorderable},
+    { "gtk_icon_view_set_reorderable",  cast(void**)& gtk_icon_view_set_reorderable},
+    { "gtk_icon_view_unset_model_drag_dest",  cast(void**)& gtk_icon_view_unset_model_drag_dest},
+    { "gtk_icon_view_unset_model_drag_source",  cast(void**)& gtk_icon_view_unset_model_drag_source},
+    { "gtk_icon_view_enable_model_drag_dest",  cast(void**)& gtk_icon_view_enable_model_drag_dest},
+    { "gtk_icon_view_enable_model_drag_source",  cast(void**)& gtk_icon_view_enable_model_drag_source},
+    { "gtk_icon_view_scroll_to_path",  cast(void**)& gtk_icon_view_scroll_to_path},
+    { "gtk_icon_view_get_cursor",  cast(void**)& gtk_icon_view_get_cursor},
+    { "gtk_icon_view_set_cursor",  cast(void**)& gtk_icon_view_set_cursor},
+    { "gtk_icon_view_item_activated",  cast(void**)& gtk_icon_view_item_activated},
+    { "gtk_icon_view_unselect_all",  cast(void**)& gtk_icon_view_unselect_all},
+    { "gtk_icon_view_select_all",  cast(void**)& gtk_icon_view_select_all},
+    { "gtk_icon_view_get_selected_items",  cast(void**)& gtk_icon_view_get_selected_items},
+    { "gtk_icon_view_path_is_selected",  cast(void**)& gtk_icon_view_path_is_selected},
+    { "gtk_icon_view_unselect_path",  cast(void**)& gtk_icon_view_unselect_path},
+    { "gtk_icon_view_select_path",  cast(void**)& gtk_icon_view_select_path},
+    { "gtk_icon_view_get_selection_mode",  cast(void**)& gtk_icon_view_get_selection_mode},
+    { "gtk_icon_view_set_selection_mode",  cast(void**)& gtk_icon_view_set_selection_mode},
+    { "gtk_icon_view_selected_foreach",  cast(void**)& gtk_icon_view_selected_foreach},
+    { "gtk_icon_view_get_visible_range",  cast(void**)& gtk_icon_view_get_visible_range},
+    { "gtk_icon_view_get_item_at_pos",  cast(void**)& gtk_icon_view_get_item_at_pos},
+    { "gtk_icon_view_get_path_at_pos",  cast(void**)& gtk_icon_view_get_path_at_pos},
+    { "gtk_icon_view_get_margin",  cast(void**)& gtk_icon_view_get_margin},
+    { "gtk_icon_view_set_margin",  cast(void**)& gtk_icon_view_set_margin},
+    { "gtk_icon_view_get_column_spacing",  cast(void**)& gtk_icon_view_get_column_spacing},
+    { "gtk_icon_view_set_column_spacing",  cast(void**)& gtk_icon_view_set_column_spacing},
+    { "gtk_icon_view_get_row_spacing",  cast(void**)& gtk_icon_view_get_row_spacing},
+    { "gtk_icon_view_set_row_spacing",  cast(void**)& gtk_icon_view_set_row_spacing},
+    { "gtk_icon_view_get_spacing",  cast(void**)& gtk_icon_view_get_spacing},
+    { "gtk_icon_view_set_spacing",  cast(void**)& gtk_icon_view_set_spacing},
+    { "gtk_icon_view_get_item_width",  cast(void**)& gtk_icon_view_get_item_width},
+    { "gtk_icon_view_set_item_width",  cast(void**)& gtk_icon_view_set_item_width},
+    { "gtk_icon_view_get_columns",  cast(void**)& gtk_icon_view_get_columns},
+    { "gtk_icon_view_set_columns",  cast(void**)& gtk_icon_view_set_columns},
+    { "gtk_icon_view_get_orientation",  cast(void**)& gtk_icon_view_get_orientation},
+    { "gtk_icon_view_set_orientation",  cast(void**)& gtk_icon_view_set_orientation},
+    { "gtk_icon_view_get_pixbuf_column",  cast(void**)& gtk_icon_view_get_pixbuf_column},
+    { "gtk_icon_view_set_pixbuf_column",  cast(void**)& gtk_icon_view_set_pixbuf_column},
+    { "gtk_icon_view_get_markup_column",  cast(void**)& gtk_icon_view_get_markup_column},
+    { "gtk_icon_view_set_markup_column",  cast(void**)& gtk_icon_view_set_markup_column},
+    { "gtk_icon_view_get_text_column",  cast(void**)& gtk_icon_view_get_text_column},
+    { "gtk_icon_view_set_text_column",  cast(void**)& gtk_icon_view_set_text_column},
+    { "gtk_icon_view_get_model",  cast(void**)& gtk_icon_view_get_model},
+    { "gtk_icon_view_set_model",  cast(void**)& gtk_icon_view_set_model},
+    { "gtk_icon_view_new_with_model",  cast(void**)& gtk_icon_view_new_with_model},
+    { "gtk_icon_view_new",  cast(void**)& gtk_icon_view_new},
+    { "gtk_icon_view_get_type",  cast(void**)& gtk_icon_view_get_type},
+//     { "_gtk_tooltip_hide",  cast(void**)& _gtk_tooltip_hide},
+//     { "_gtk_tooltip_handle_event",  cast(void**)& _gtk_tooltip_handle_event},
+//     { "_gtk_tooltip_toggle_keyboard_mode",  cast(void**)& _gtk_tooltip_toggle_keyboard_mode},
+//     { "_gtk_tooltip_focus_out",  cast(void**)& _gtk_tooltip_focus_out},
+//     { "_gtk_tooltip_focus_in",  cast(void**)& _gtk_tooltip_focus_in},
+    { "gtk_tooltip_trigger_tooltip_query",  cast(void**)& gtk_tooltip_trigger_tooltip_query},
+    { "gtk_tooltip_set_tip_area",  cast(void**)& gtk_tooltip_set_tip_area},
+    { "gtk_tooltip_set_custom",  cast(void**)& gtk_tooltip_set_custom},
+    { "gtk_tooltip_set_icon_from_stock",  cast(void**)& gtk_tooltip_set_icon_from_stock},
+    { "gtk_tooltip_set_icon",  cast(void**)& gtk_tooltip_set_icon},
+    { "gtk_tooltip_set_text",  cast(void**)& gtk_tooltip_set_text},
+    { "gtk_tooltip_set_markup",  cast(void**)& gtk_tooltip_set_markup},
+    { "gtk_tooltip_get_type",  cast(void**)& gtk_tooltip_get_type},
+//     { "_gtk_icon_theme_ensure_builtin_cache",  cast(void**)& _gtk_icon_theme_ensure_builtin_cache},
+//     { "_gtk_icon_theme_check_reload",  cast(void**)& _gtk_icon_theme_check_reload},
+    { "gtk_icon_info_get_display_name",  cast(void**)& gtk_icon_info_get_display_name},
+    { "gtk_icon_info_get_attach_points",  cast(void**)& gtk_icon_info_get_attach_points},
+    { "gtk_icon_info_get_embedded_rect",  cast(void**)& gtk_icon_info_get_embedded_rect},
+    { "gtk_icon_info_set_raw_coordinates",  cast(void**)& gtk_icon_info_set_raw_coordinates},
+    { "gtk_icon_info_load_icon",  cast(void**)& gtk_icon_info_load_icon},
+    { "gtk_icon_info_get_builtin_pixbuf",  cast(void**)& gtk_icon_info_get_builtin_pixbuf},
+    { "gtk_icon_info_get_filename",  cast(void**)& gtk_icon_info_get_filename},
+    { "gtk_icon_info_get_base_size",  cast(void**)& gtk_icon_info_get_base_size},
+    { "gtk_icon_info_free",  cast(void**)& gtk_icon_info_free},
+    { "gtk_icon_info_copy",  cast(void**)& gtk_icon_info_copy},
+    { "gtk_icon_info_get_type",  cast(void**)& gtk_icon_info_get_type},
+    { "gtk_icon_theme_add_builtin_icon",  cast(void**)& gtk_icon_theme_add_builtin_icon},
+    { "gtk_icon_theme_rescan_if_needed",  cast(void**)& gtk_icon_theme_rescan_if_needed},
+    { "gtk_icon_theme_get_example_icon_name",  cast(void**)& gtk_icon_theme_get_example_icon_name},
+    { "gtk_icon_theme_list_contexts",  cast(void**)& gtk_icon_theme_list_contexts},
+    { "gtk_icon_theme_list_icons",  cast(void**)& gtk_icon_theme_list_icons},
+    { "gtk_icon_theme_load_icon",  cast(void**)& gtk_icon_theme_load_icon},
+    { "gtk_icon_theme_choose_icon",  cast(void**)& gtk_icon_theme_choose_icon},
+    { "gtk_icon_theme_lookup_icon",  cast(void**)& gtk_icon_theme_lookup_icon},
+    { "gtk_icon_theme_get_icon_sizes",  cast(void**)& gtk_icon_theme_get_icon_sizes},
+    { "gtk_icon_theme_has_icon",  cast(void**)& gtk_icon_theme_has_icon},
+    { "gtk_icon_theme_set_custom_theme",  cast(void**)& gtk_icon_theme_set_custom_theme},
+    { "gtk_icon_theme_prepend_search_path",  cast(void**)& gtk_icon_theme_prepend_search_path},
+    { "gtk_icon_theme_append_search_path",  cast(void**)& gtk_icon_theme_append_search_path},
+    { "gtk_icon_theme_get_search_path",  cast(void**)& gtk_icon_theme_get_search_path},
+    { "gtk_icon_theme_set_search_path",  cast(void**)& gtk_icon_theme_set_search_path},
+    { "gtk_icon_theme_set_screen",  cast(void**)& gtk_icon_theme_set_screen},
+    { "gtk_icon_theme_get_for_screen",  cast(void**)& gtk_icon_theme_get_for_screen},
+    { "gtk_icon_theme_get_default",  cast(void**)& gtk_icon_theme_get_default},
+    { "gtk_icon_theme_new",  cast(void**)& gtk_icon_theme_new},
+    { "gtk_icon_theme_get_type",  cast(void**)& gtk_icon_theme_get_type},
+    { "gtk_icon_theme_error_quark",  cast(void**)& gtk_icon_theme_error_quark},
+//     { "_gtk_icon_factory_ensure_default_icons",  cast(void**)& _gtk_icon_factory_ensure_default_icons},
+//     { "_gtk_icon_factory_list_ids",  cast(void**)& _gtk_icon_factory_list_ids},
+//     { "_gtk_icon_set_invalidate_caches",  cast(void**)& _gtk_icon_set_invalidate_caches},
+    { "gtk_icon_source_get_size",  cast(void**)& gtk_icon_source_get_size},
+    { "gtk_icon_source_get_state",  cast(void**)& gtk_icon_source_get_state},
+    { "gtk_icon_source_get_direction",  cast(void**)& gtk_icon_source_get_direction},
+    { "gtk_icon_source_set_size",  cast(void**)& gtk_icon_source_set_size},
+    { "gtk_icon_source_set_state",  cast(void**)& gtk_icon_source_set_state},
+    { "gtk_icon_source_set_direction",  cast(void**)& gtk_icon_source_set_direction},
+    { "gtk_icon_source_get_direction_wildcarded",  cast(void**)& gtk_icon_source_get_direction_wildcarded},
+    { "gtk_icon_source_get_state_wildcarded",  cast(void**)& gtk_icon_source_get_state_wildcarded},
+    { "gtk_icon_source_get_size_wildcarded",  cast(void**)& gtk_icon_source_get_size_wildcarded},
+    { "gtk_icon_source_set_size_wildcarded",  cast(void**)& gtk_icon_source_set_size_wildcarded},
+    { "gtk_icon_source_set_state_wildcarded",  cast(void**)& gtk_icon_source_set_state_wildcarded},
+    { "gtk_icon_source_set_direction_wildcarded",  cast(void**)& gtk_icon_source_set_direction_wildcarded},
+    { "gtk_icon_source_get_pixbuf",  cast(void**)& gtk_icon_source_get_pixbuf},
+    { "gtk_icon_source_get_icon_name",  cast(void**)& gtk_icon_source_get_icon_name},
+    { "gtk_icon_source_get_filename",  cast(void**)& gtk_icon_source_get_filename},
+    { "gtk_icon_source_set_pixbuf",  cast(void**)& gtk_icon_source_set_pixbuf},
+    { "gtk_icon_source_set_icon_name",  cast(void**)& gtk_icon_source_set_icon_name},
+    { "gtk_icon_source_set_filename",  cast(void**)& gtk_icon_source_set_filename},
+    { "gtk_icon_source_free",  cast(void**)& gtk_icon_source_free},
+    { "gtk_icon_source_copy",  cast(void**)& gtk_icon_source_copy},
+    { "gtk_icon_source_new",  cast(void**)& gtk_icon_source_new},
+    { "gtk_icon_source_get_type",  cast(void**)& gtk_icon_source_get_type},
+    { "gtk_icon_set_get_sizes",  cast(void**)& gtk_icon_set_get_sizes},
+    { "gtk_icon_set_add_source",  cast(void**)& gtk_icon_set_add_source},
+    { "gtk_icon_set_render_icon",  cast(void**)& gtk_icon_set_render_icon},
+    { "gtk_icon_set_copy",  cast(void**)& gtk_icon_set_copy},
+    { "gtk_icon_set_unref",  cast(void**)& gtk_icon_set_unref},
+    { "gtk_icon_set_ref",  cast(void**)& gtk_icon_set_ref},
+    { "gtk_icon_set_new_from_pixbuf",  cast(void**)& gtk_icon_set_new_from_pixbuf},
+    { "gtk_icon_set_new",  cast(void**)& gtk_icon_set_new},
+    { "gtk_icon_set_get_type",  cast(void**)& gtk_icon_set_get_type},
+    { "gtk_icon_size_get_name",  cast(void**)& gtk_icon_size_get_name},
+    { "gtk_icon_size_from_name",  cast(void**)& gtk_icon_size_from_name},
+    { "gtk_icon_size_register_alias",  cast(void**)& gtk_icon_size_register_alias},
+    { "gtk_icon_size_register",  cast(void**)& gtk_icon_size_register},
+    { "gtk_icon_size_lookup_for_settings",  cast(void**)& gtk_icon_size_lookup_for_settings},
+    { "gtk_icon_size_lookup",  cast(void**)& gtk_icon_size_lookup},
+    { "gtk_icon_factory_lookup_default",  cast(void**)& gtk_icon_factory_lookup_default},
+    { "gtk_icon_factory_remove_default",  cast(void**)& gtk_icon_factory_remove_default},
+    { "gtk_icon_factory_add_default",  cast(void**)& gtk_icon_factory_add_default},
+    { "gtk_icon_factory_lookup",  cast(void**)& gtk_icon_factory_lookup},
+    { "gtk_icon_factory_add",  cast(void**)& gtk_icon_factory_add},
+    { "gtk_icon_factory_new",  cast(void**)& gtk_icon_factory_new},
+    { "gtk_icon_factory_get_type",  cast(void**)& gtk_icon_factory_get_type},
+    { "gtk_hseparator_new",  cast(void**)& gtk_hseparator_new},
+    { "gtk_hseparator_get_type",  cast(void**)& gtk_hseparator_get_type},
+    { "gtk_separator_get_type",  cast(void**)& gtk_separator_get_type},
+    { "gtk_hscale_new_with_range",  cast(void**)& gtk_hscale_new_with_range},
+    { "gtk_hscale_new",  cast(void**)& gtk_hscale_new},
+    { "gtk_hscale_get_type",  cast(void**)& gtk_hscale_get_type},
+//     { "_gtk_scale_format_value",  cast(void**)& _gtk_scale_format_value},
+//     { "_gtk_scale_get_value_size",  cast(void**)& _gtk_scale_get_value_size},
+//     { "_gtk_scale_clear_layout",  cast(void**)& _gtk_scale_clear_layout},
+    { "gtk_scale_get_layout_offsets",  cast(void**)& gtk_scale_get_layout_offsets},
+    { "gtk_scale_get_layout",  cast(void**)& gtk_scale_get_layout},
+    { "gtk_scale_get_value_pos",  cast(void**)& gtk_scale_get_value_pos},
+    { "gtk_scale_set_value_pos",  cast(void**)& gtk_scale_set_value_pos},
+    { "gtk_scale_get_draw_value",  cast(void**)& gtk_scale_get_draw_value},
+    { "gtk_scale_set_draw_value",  cast(void**)& gtk_scale_set_draw_value},
+    { "gtk_scale_get_digits",  cast(void**)& gtk_scale_get_digits},
+    { "gtk_scale_set_digits",  cast(void**)& gtk_scale_set_digits},
+    { "gtk_scale_get_type",  cast(void**)& gtk_scale_get_type},
+    { "gtk_hruler_new",  cast(void**)& gtk_hruler_new},
+    { "gtk_hruler_get_type",  cast(void**)& gtk_hruler_get_type},
+    { "gtk_ruler_get_range",  cast(void**)& gtk_ruler_get_range},
+    { "gtk_ruler_get_metric",  cast(void**)& gtk_ruler_get_metric},
+    { "gtk_ruler_draw_pos",  cast(void**)& gtk_ruler_draw_pos},
+    { "gtk_ruler_draw_ticks",  cast(void**)& gtk_ruler_draw_ticks},
+    { "gtk_ruler_set_range",  cast(void**)& gtk_ruler_set_range},
+    { "gtk_ruler_set_metric",  cast(void**)& gtk_ruler_set_metric},
+    { "gtk_ruler_get_type",  cast(void**)& gtk_ruler_get_type},
+    { "gtk_hpaned_new",  cast(void**)& gtk_hpaned_new},
+    { "gtk_hpaned_get_type",  cast(void**)& gtk_hpaned_get_type},
+    { "gtk_paned_compute_position",  cast(void**)& gtk_paned_compute_position},
+    { "gtk_paned_get_child2",  cast(void**)& gtk_paned_get_child2},
+    { "gtk_paned_get_child1",  cast(void**)& gtk_paned_get_child1},
+    { "gtk_paned_set_position",  cast(void**)& gtk_paned_set_position},
+    { "gtk_paned_get_position",  cast(void**)& gtk_paned_get_position},
+    { "gtk_paned_pack2",  cast(void**)& gtk_paned_pack2},
+    { "gtk_paned_pack1",  cast(void**)& gtk_paned_pack1},
+    { "gtk_paned_add2",  cast(void**)& gtk_paned_add2},
+    { "gtk_paned_add1",  cast(void**)& gtk_paned_add1},
+    { "gtk_paned_get_type",  cast(void**)& gtk_paned_get_type},
+    { "gtk_hbutton_box_set_layout_default",  cast(void**)& gtk_hbutton_box_set_layout_default},
+    { "gtk_hbutton_box_set_spacing_default",  cast(void**)& gtk_hbutton_box_set_spacing_default},
+    { "gtk_hbutton_box_get_layout_default",  cast(void**)& gtk_hbutton_box_get_layout_default},
+    { "gtk_hbutton_box_get_spacing_default",  cast(void**)& gtk_hbutton_box_get_spacing_default},
+    { "gtk_hbutton_box_new",  cast(void**)& gtk_hbutton_box_new},
+    { "gtk_hbutton_box_get_type",  cast(void**)& gtk_hbutton_box_get_type},
+    { "gtk_handle_box_get_snap_edge",  cast(void**)& gtk_handle_box_get_snap_edge},
+    { "gtk_handle_box_set_snap_edge",  cast(void**)& gtk_handle_box_set_snap_edge},
+    { "gtk_handle_box_get_handle_position",  cast(void**)& gtk_handle_box_get_handle_position},
+    { "gtk_handle_box_set_handle_position",  cast(void**)& gtk_handle_box_set_handle_position},
+    { "gtk_handle_box_get_shadow_type",  cast(void**)& gtk_handle_box_get_shadow_type},
+    { "gtk_handle_box_set_shadow_type",  cast(void**)& gtk_handle_box_set_shadow_type},
+    { "gtk_handle_box_new",  cast(void**)& gtk_handle_box_new},
+    { "gtk_handle_box_get_type",  cast(void**)& gtk_handle_box_get_type},
+    { "gtk_gc_release",  cast(void**)& gtk_gc_release},
+    { "gtk_gc_get",  cast(void**)& gtk_gc_get},
+    { "gtk_gamma_curve_new",  cast(void**)& gtk_gamma_curve_new},
+    { "gtk_gamma_curve_get_type",  cast(void**)& gtk_gamma_curve_get_type},
+    { "gtk_font_selection_dialog_set_preview_text",  cast(void**)& gtk_font_selection_dialog_set_preview_text},
+    { "gtk_font_selection_dialog_get_preview_text",  cast(void**)& gtk_font_selection_dialog_get_preview_text},
+    { "gtk_font_selection_dialog_set_font_name",  cast(void**)& gtk_font_selection_dialog_set_font_name},
+    { "gtk_font_selection_dialog_get_font",  cast(void**)& gtk_font_selection_dialog_get_font},
+    { "gtk_font_selection_dialog_get_font_name",  cast(void**)& gtk_font_selection_dialog_get_font_name},
+    { "gtk_font_selection_dialog_new",  cast(void**)& gtk_font_selection_dialog_new},
+    { "gtk_font_selection_dialog_get_type",  cast(void**)& gtk_font_selection_dialog_get_type},
+    { "gtk_font_selection_set_preview_text",  cast(void**)& gtk_font_selection_set_preview_text},
+    { "gtk_font_selection_get_preview_text",  cast(void**)& gtk_font_selection_get_preview_text},
+    { "gtk_font_selection_set_font_name",  cast(void**)& gtk_font_selection_set_font_name},
+    { "gtk_font_selection_get_font",  cast(void**)& gtk_font_selection_get_font},
+    { "gtk_font_selection_get_font_name",  cast(void**)& gtk_font_selection_get_font_name},
+    { "gtk_font_selection_new",  cast(void**)& gtk_font_selection_new},
+    { "gtk_font_selection_get_type",  cast(void**)& gtk_font_selection_get_type},
+    { "gtk_font_button_set_show_size",  cast(void**)& gtk_font_button_set_show_size},
+    { "gtk_font_button_get_show_size",  cast(void**)& gtk_font_button_get_show_size},
+    { "gtk_font_button_set_show_style",  cast(void**)& gtk_font_button_set_show_style},
+    { "gtk_font_button_get_show_style",  cast(void**)& gtk_font_button_get_show_style},
+    { "gtk_font_button_set_font_name",  cast(void**)& gtk_font_button_set_font_name},
+    { "gtk_font_button_get_font_name",  cast(void**)& gtk_font_button_get_font_name},
+    { "gtk_font_button_set_use_size",  cast(void**)& gtk_font_button_set_use_size},
+    { "gtk_font_button_get_use_size",  cast(void**)& gtk_font_button_get_use_size},
+    { "gtk_font_button_set_use_font",  cast(void**)& gtk_font_button_set_use_font},
+    { "gtk_font_button_get_use_font",  cast(void**)& gtk_font_button_get_use_font},
+    { "gtk_font_button_set_title",  cast(void**)& gtk_font_button_set_title},
+    { "gtk_font_button_get_title",  cast(void**)& gtk_font_button_get_title},
+    { "gtk_font_button_new_with_font",  cast(void**)& gtk_font_button_new_with_font},
+    { "gtk_font_button_new",  cast(void**)& gtk_font_button_new},
+    { "gtk_font_button_get_type",  cast(void**)& gtk_font_button_get_type},
+    { "gtk_file_chooser_widget_new_with_backend",  cast(void**)& gtk_file_chooser_widget_new_with_backend},
+    { "gtk_file_chooser_widget_new",  cast(void**)& gtk_file_chooser_widget_new},
+    { "gtk_file_chooser_widget_get_type",  cast(void**)& gtk_file_chooser_widget_get_type},
+    { "gtk_file_chooser_dialog_new_with_backend",  cast(void**)& gtk_file_chooser_dialog_new_with_backend},
+    { "gtk_file_chooser_dialog_new",  cast(void**)& gtk_file_chooser_dialog_new},
+    { "gtk_file_chooser_dialog_get_type",  cast(void**)& gtk_file_chooser_dialog_get_type},
+    { "gtk_file_chooser_button_set_focus_on_click",  cast(void**)& gtk_file_chooser_button_set_focus_on_click},
+    { "gtk_file_chooser_button_get_focus_on_click",  cast(void**)& gtk_file_chooser_button_get_focus_on_click},
+    { "gtk_file_chooser_button_set_width_chars",  cast(void**)& gtk_file_chooser_button_set_width_chars},
+    { "gtk_file_chooser_button_get_width_chars",  cast(void**)& gtk_file_chooser_button_get_width_chars},
+    { "gtk_file_chooser_button_set_title",  cast(void**)& gtk_file_chooser_button_set_title},
+    { "gtk_file_chooser_button_get_title",  cast(void**)& gtk_file_chooser_button_get_title},
+    { "gtk_file_chooser_button_new_with_dialog",  cast(void**)& gtk_file_chooser_button_new_with_dialog},
+    { "gtk_file_chooser_button_new_with_backend",  cast(void**)& gtk_file_chooser_button_new_with_backend},
+    { "gtk_file_chooser_button_new",  cast(void**)& gtk_file_chooser_button_new},
+    { "gtk_file_chooser_button_get_type",  cast(void**)& gtk_file_chooser_button_get_type},
+    { "gtk_file_chooser_list_shortcut_folder_uris",  cast(void**)& gtk_file_chooser_list_shortcut_folder_uris},
+    { "gtk_file_chooser_remove_shortcut_folder_uri",  cast(void**)& gtk_file_chooser_remove_shortcut_folder_uri},
+    { "gtk_file_chooser_add_shortcut_folder_uri",  cast(void**)& gtk_file_chooser_add_shortcut_folder_uri},
+    { "gtk_file_chooser_list_shortcut_folders",  cast(void**)& gtk_file_chooser_list_shortcut_folders},
+    { "gtk_file_chooser_remove_shortcut_folder",  cast(void**)& gtk_file_chooser_remove_shortcut_folder},
+    { "gtk_file_chooser_add_shortcut_folder",  cast(void**)& gtk_file_chooser_add_shortcut_folder},
+    { "gtk_file_chooser_get_filter",  cast(void**)& gtk_file_chooser_get_filter},
+    { "gtk_file_chooser_set_filter",  cast(void**)& gtk_file_chooser_set_filter},
+    { "gtk_file_chooser_list_filters",  cast(void**)& gtk_file_chooser_list_filters},
+    { "gtk_file_chooser_remove_filter",  cast(void**)& gtk_file_chooser_remove_filter},
+    { "gtk_file_chooser_add_filter",  cast(void**)& gtk_file_chooser_add_filter},
+    { "gtk_file_chooser_get_extra_widget",  cast(void**)& gtk_file_chooser_get_extra_widget},
+    { "gtk_file_chooser_set_extra_widget",  cast(void**)& gtk_file_chooser_set_extra_widget},
+    { "gtk_file_chooser_get_preview_uri",  cast(void**)& gtk_file_chooser_get_preview_uri},
+    { "gtk_file_chooser_get_preview_filename",  cast(void**)& gtk_file_chooser_get_preview_filename},
+    { "gtk_file_chooser_get_use_preview_label",  cast(void**)& gtk_file_chooser_get_use_preview_label},
+    { "gtk_file_chooser_set_use_preview_label",  cast(void**)& gtk_file_chooser_set_use_preview_label},
+    { "gtk_file_chooser_get_preview_widget_active",  cast(void**)& gtk_file_chooser_get_preview_widget_active},
+    { "gtk_file_chooser_set_preview_widget_active",  cast(void**)& gtk_file_chooser_set_preview_widget_active},
+    { "gtk_file_chooser_get_preview_widget",  cast(void**)& gtk_file_chooser_get_preview_widget},
+    { "gtk_file_chooser_set_preview_widget",  cast(void**)& gtk_file_chooser_set_preview_widget},
+    { "gtk_file_chooser_get_current_folder_uri",  cast(void**)& gtk_file_chooser_get_current_folder_uri},
+    { "gtk_file_chooser_set_current_folder_uri",  cast(void**)& gtk_file_chooser_set_current_folder_uri},
+    { "gtk_file_chooser_get_uris",  cast(void**)& gtk_file_chooser_get_uris},
+    { "gtk_file_chooser_unselect_uri",  cast(void**)& gtk_file_chooser_unselect_uri},
+    { "gtk_file_chooser_select_uri",  cast(void**)& gtk_file_chooser_select_uri},
+    { "gtk_file_chooser_set_uri",  cast(void**)& gtk_file_chooser_set_uri},
+    { "gtk_file_chooser_get_uri",  cast(void**)& gtk_file_chooser_get_uri},
+    { "gtk_file_chooser_get_current_folder",  cast(void**)& gtk_file_chooser_get_current_folder},
+    { "gtk_file_chooser_set_current_folder",  cast(void**)& gtk_file_chooser_set_current_folder},
+    { "gtk_file_chooser_get_filenames",  cast(void**)& gtk_file_chooser_get_filenames},
+    { "gtk_file_chooser_unselect_all",  cast(void**)& gtk_file_chooser_unselect_all},
+    { "gtk_file_chooser_select_all",  cast(void**)& gtk_file_chooser_select_all},
+    { "gtk_file_chooser_unselect_filename",  cast(void**)& gtk_file_chooser_unselect_filename},
+    { "gtk_file_chooser_select_filename",  cast(void**)& gtk_file_chooser_select_filename},
+    { "gtk_file_chooser_set_filename",  cast(void**)& gtk_file_chooser_set_filename},
+    { "gtk_file_chooser_get_filename",  cast(void**)& gtk_file_chooser_get_filename},
+    { "gtk_file_chooser_set_current_name",  cast(void**)& gtk_file_chooser_set_current_name},
+    { "gtk_file_chooser_get_do_overwrite_confirmation",  cast(void**)& gtk_file_chooser_get_do_overwrite_confirmation},
+    { "gtk_file_chooser_set_do_overwrite_confirmation",  cast(void**)& gtk_file_chooser_set_do_overwrite_confirmation},
+    { "gtk_file_chooser_get_show_hidden",  cast(void**)& gtk_file_chooser_get_show_hidden},
+    { "gtk_file_chooser_set_show_hidden",  cast(void**)& gtk_file_chooser_set_show_hidden},
+    { "gtk_file_chooser_get_select_multiple",  cast(void**)& gtk_file_chooser_get_select_multiple},
+    { "gtk_file_chooser_set_select_multiple",  cast(void**)& gtk_file_chooser_set_select_multiple},
+    { "gtk_file_chooser_get_local_only",  cast(void**)& gtk_file_chooser_get_local_only},
+    { "gtk_file_chooser_set_local_only",  cast(void**)& gtk_file_chooser_set_local_only},
+    { "gtk_file_chooser_get_action",  cast(void**)& gtk_file_chooser_get_action},
+    { "gtk_file_chooser_set_action",  cast(void**)& gtk_file_chooser_set_action},
+    { "gtk_file_chooser_error_quark",  cast(void**)& gtk_file_chooser_error_quark},
+    { "gtk_file_chooser_get_type",  cast(void**)& gtk_file_chooser_get_type},
+    { "gtk_file_filter_filter",  cast(void**)& gtk_file_filter_filter},
+    { "gtk_file_filter_get_needed",  cast(void**)& gtk_file_filter_get_needed},
+    { "gtk_file_filter_add_custom",  cast(void**)& gtk_file_filter_add_custom},
+    { "gtk_file_filter_add_pixbuf_formats",  cast(void**)& gtk_file_filter_add_pixbuf_formats},
+    { "gtk_file_filter_add_pattern",  cast(void**)& gtk_file_filter_add_pattern},
+    { "gtk_file_filter_add_mime_type",  cast(void**)& gtk_file_filter_add_mime_type},
+    { "gtk_file_filter_get_name",  cast(void**)& gtk_file_filter_get_name},
+    { "gtk_file_filter_set_name",  cast(void**)& gtk_file_filter_set_name},
+    { "gtk_file_filter_new",  cast(void**)& gtk_file_filter_new},
+    { "gtk_file_filter_get_type",  cast(void**)& gtk_file_filter_get_type},
+    { "gtk_fixed_get_has_window",  cast(void**)& gtk_fixed_get_has_window},
+    { "gtk_fixed_set_has_window",  cast(void**)& gtk_fixed_set_has_window},
+    { "gtk_fixed_move",  cast(void**)& gtk_fixed_move},
+    { "gtk_fixed_put",  cast(void**)& gtk_fixed_put},
+    { "gtk_fixed_new",  cast(void**)& gtk_fixed_new},
+    { "gtk_fixed_get_type",  cast(void**)& gtk_fixed_get_type},
+    { "gtk_file_selection_get_select_multiple",  cast(void**)& gtk_file_selection_get_select_multiple},
+    { "gtk_file_selection_set_select_multiple",  cast(void**)& gtk_file_selection_set_select_multiple},
+    { "gtk_file_selection_get_selections",  cast(void**)& gtk_file_selection_get_selections},
+    { "gtk_file_selection_hide_fileop_buttons",  cast(void**)& gtk_file_selection_hide_fileop_buttons},
+    { "gtk_file_selection_show_fileop_buttons",  cast(void**)& gtk_file_selection_show_fileop_buttons},
+    { "gtk_file_selection_complete",  cast(void**)& gtk_file_selection_complete},
+    { "gtk_file_selection_get_filename",  cast(void**)& gtk_file_selection_get_filename},
+    { "gtk_file_selection_set_filename",  cast(void**)& gtk_file_selection_set_filename},
+    { "gtk_file_selection_new",  cast(void**)& gtk_file_selection_new},
+    { "gtk_file_selection_get_type",  cast(void**)& gtk_file_selection_get_type},
+    { "gtk_expander_get_label_widget",  cast(void**)& gtk_expander_get_label_widget},
+    { "gtk_expander_set_label_widget",  cast(void**)& gtk_expander_set_label_widget},
+    { "gtk_expander_get_use_markup",  cast(void**)& gtk_expander_get_use_markup},
+    { "gtk_expander_set_use_markup",  cast(void**)& gtk_expander_set_use_markup},
+    { "gtk_expander_get_use_underline",  cast(void**)& gtk_expander_get_use_underline},
+    { "gtk_expander_set_use_underline",  cast(void**)& gtk_expander_set_use_underline},
+    { "gtk_expander_get_label",  cast(void**)& gtk_expander_get_label},
+    { "gtk_expander_set_label",  cast(void**)& gtk_expander_set_label},
+    { "gtk_expander_get_spacing",  cast(void**)& gtk_expander_get_spacing},
+    { "gtk_expander_set_spacing",  cast(void**)& gtk_expander_set_spacing},
+    { "gtk_expander_get_expanded",  cast(void**)& gtk_expander_get_expanded},
+    { "gtk_expander_set_expanded",  cast(void**)& gtk_expander_set_expanded},
+    { "gtk_expander_new_with_mnemonic",  cast(void**)& gtk_expander_new_with_mnemonic},
+    { "gtk_expander_new",  cast(void**)& gtk_expander_new},
+    { "gtk_expander_get_type",  cast(void**)& gtk_expander_get_type},
+    { "gtk_event_box_set_above_child",  cast(void**)& gtk_event_box_set_above_child},
+    { "gtk_event_box_get_above_child",  cast(void**)& gtk_event_box_get_above_child},
+    { "gtk_event_box_set_visible_window",  cast(void**)& gtk_event_box_set_visible_window},
+    { "gtk_event_box_get_visible_window",  cast(void**)& gtk_event_box_get_visible_window},
+    { "gtk_event_box_new",  cast(void**)& gtk_event_box_new},
+    { "gtk_event_box_get_type",  cast(void**)& gtk_event_box_get_type},
+    { "gtk_curve_set_curve_type",  cast(void**)& gtk_curve_set_curve_type},
+    { "gtk_curve_set_vector",  cast(void**)& gtk_curve_set_vector},
+    { "gtk_curve_get_vector",  cast(void**)& gtk_curve_get_vector},
+    { "gtk_curve_set_range",  cast(void**)& gtk_curve_set_range},
+    { "gtk_curve_set_gamma",  cast(void**)& gtk_curve_set_gamma},
+    { "gtk_curve_reset",  cast(void**)& gtk_curve_reset},
+    { "gtk_curve_new",  cast(void**)& gtk_curve_new},
+    { "gtk_curve_get_type",  cast(void**)& gtk_curve_get_type},
+    { "gtk_drawing_area_size",  cast(void**)& gtk_drawing_area_size},
+    { "gtk_drawing_area_new",  cast(void**)& gtk_drawing_area_new},
+    { "gtk_drawing_area_get_type",  cast(void**)& gtk_drawing_area_get_type},
+    { "gtk_ctree_node_get_type",  cast(void**)& gtk_ctree_node_get_type},
+    { "gtk_ctree_sort_recursive",  cast(void**)& gtk_ctree_sort_recursive},
+    { "gtk_ctree_sort_node",  cast(void**)& gtk_ctree_sort_node},
+    { "gtk_ctree_set_drag_compare_func",  cast(void**)& gtk_ctree_set_drag_compare_func},
+    { "gtk_ctree_set_expander_style",  cast(void**)& gtk_ctree_set_expander_style},
+    { "gtk_ctree_set_line_style",  cast(void**)& gtk_ctree_set_line_style},
+    { "gtk_ctree_set_show_stub",  cast(void**)& gtk_ctree_set_show_stub},
+    { "gtk_ctree_set_spacing",  cast(void**)& gtk_ctree_set_spacing},
+    { "gtk_ctree_set_indent",  cast(void**)& gtk_ctree_set_indent},
+    { "gtk_ctree_node_is_visible",  cast(void**)& gtk_ctree_node_is_visible},
+    { "gtk_ctree_node_moveto",  cast(void**)& gtk_ctree_node_moveto},
+    { "gtk_ctree_node_get_row_data",  cast(void**)& gtk_ctree_node_get_row_data},
+    { "gtk_ctree_node_set_row_data_full",  cast(void**)& gtk_ctree_node_set_row_data_full},
+    { "gtk_ctree_node_set_row_data",  cast(void**)& gtk_ctree_node_set_row_data},
+    { "gtk_ctree_node_set_background",  cast(void**)& gtk_ctree_node_set_background},
+    { "gtk_ctree_node_set_foreground",  cast(void**)& gtk_ctree_node_set_foreground},
+    { "gtk_ctree_node_get_cell_style",  cast(void**)& gtk_ctree_node_get_cell_style},
+    { "gtk_ctree_node_set_cell_style",  cast(void**)& gtk_ctree_node_set_cell_style},
+    { "gtk_ctree_node_get_row_style",  cast(void**)& gtk_ctree_node_get_row_style},
+    { "gtk_ctree_node_set_row_style",  cast(void**)& gtk_ctree_node_set_row_style},
+    { "gtk_ctree_get_node_info",  cast(void**)& gtk_ctree_get_node_info},
+    { "gtk_ctree_node_get_pixtext",  cast(void**)& gtk_ctree_node_get_pixtext},
+    { "gtk_ctree_node_get_pixmap",  cast(void**)& gtk_ctree_node_get_pixmap},
+    { "gtk_ctree_node_get_text",  cast(void**)& gtk_ctree_node_get_text},
+    { "gtk_ctree_node_get_cell_type",  cast(void**)& gtk_ctree_node_get_cell_type},
+    { "gtk_ctree_node_get_selectable",  cast(void**)& gtk_ctree_node_get_selectable},
+    { "gtk_ctree_node_set_selectable",  cast(void**)& gtk_ctree_node_set_selectable},
+    { "gtk_ctree_node_set_shift",  cast(void**)& gtk_ctree_node_set_shift},
+    { "gtk_ctree_set_node_info",  cast(void**)& gtk_ctree_set_node_info},
+    { "gtk_ctree_node_set_pixtext",  cast(void**)& gtk_ctree_node_set_pixtext},
+    { "gtk_ctree_node_set_pixmap",  cast(void**)& gtk_ctree_node_set_pixmap},
+    { "gtk_ctree_node_set_text",  cast(void**)& gtk_ctree_node_set_text},
+    { "gtk_ctree_real_select_recursive",  cast(void**)& gtk_ctree_real_select_recursive},
+    { "gtk_ctree_unselect_recursive",  cast(void**)& gtk_ctree_unselect_recursive},
+    { "gtk_ctree_unselect",  cast(void**)& gtk_ctree_unselect},
+    { "gtk_ctree_select_recursive",  cast(void**)& gtk_ctree_select_recursive},
+    { "gtk_ctree_select",  cast(void**)& gtk_ctree_select},
+    { "gtk_ctree_toggle_expansion_recursive",  cast(void**)& gtk_ctree_toggle_expansion_recursive},
+    { "gtk_ctree_toggle_expansion",  cast(void**)& gtk_ctree_toggle_expansion},
+    { "gtk_ctree_collapse_to_depth",  cast(void**)& gtk_ctree_collapse_to_depth},
+    { "gtk_ctree_collapse_recursive",  cast(void**)& gtk_ctree_collapse_recursive},
+    { "gtk_ctree_collapse",  cast(void**)& gtk_ctree_collapse},
+    { "gtk_ctree_expand_to_depth",  cast(void**)& gtk_ctree_expand_to_depth},
+    { "gtk_ctree_expand_recursive",  cast(void**)& gtk_ctree_expand_recursive},
+    { "gtk_ctree_expand",  cast(void**)& gtk_ctree_expand},
+    { "gtk_ctree_move",  cast(void**)& gtk_ctree_move},
+    { "gtk_ctree_is_hot_spot",  cast(void**)& gtk_ctree_is_hot_spot},
+    { "gtk_ctree_find_all_by_row_data_custom",  cast(void**)& gtk_ctree_find_all_by_row_data_custom},
+    { "gtk_ctree_find_by_row_data_custom",  cast(void**)& gtk_ctree_find_by_row_data_custom},
+    { "gtk_ctree_find_all_by_row_data",  cast(void**)& gtk_ctree_find_all_by_row_data},
+    { "gtk_ctree_find_by_row_data",  cast(void**)& gtk_ctree_find_by_row_data},
+    { "gtk_ctree_is_ancestor",  cast(void**)& gtk_ctree_is_ancestor},
+    { "gtk_ctree_find",  cast(void**)& gtk_ctree_find},
+    { "gtk_ctree_node_nth",  cast(void**)& gtk_ctree_node_nth},
+    { "gtk_ctree_find_node_ptr",  cast(void**)& gtk_ctree_find_node_ptr},
+    { "gtk_ctree_last",  cast(void**)& gtk_ctree_last},
+    { "gtk_ctree_is_viewable",  cast(void**)& gtk_ctree_is_viewable},
+    { "gtk_ctree_pre_recursive_to_depth",  cast(void**)& gtk_ctree_pre_recursive_to_depth},
+    { "gtk_ctree_pre_recursive",  cast(void**)& gtk_ctree_pre_recursive},
+    { "gtk_ctree_post_recursive_to_depth",  cast(void**)& gtk_ctree_post_recursive_to_depth},
+    { "gtk_ctree_post_recursive",  cast(void**)& gtk_ctree_post_recursive},
+    { "gtk_ctree_export_to_gnode",  cast(void**)& gtk_ctree_export_to_gnode},
+    { "gtk_ctree_insert_gnode",  cast(void**)& gtk_ctree_insert_gnode},
+    { "gtk_ctree_remove_node",  cast(void**)& gtk_ctree_remove_node},
+    { "gtk_ctree_insert_node",  cast(void**)& gtk_ctree_insert_node},
+    { "gtk_ctree_new",  cast(void**)& gtk_ctree_new},
+    { "gtk_ctree_new_with_titles",  cast(void**)& gtk_ctree_new_with_titles},
+    { "gtk_ctree_get_type",  cast(void**)& gtk_ctree_get_type},
+    { "gtk_combo_box_entry_new_text",  cast(void**)& gtk_combo_box_entry_new_text},
+    { "gtk_combo_box_entry_get_text_column",  cast(void**)& gtk_combo_box_entry_get_text_column},
+    { "gtk_combo_box_entry_set_text_column",  cast(void**)& gtk_combo_box_entry_set_text_column},
+    { "gtk_combo_box_entry_new_with_model",  cast(void**)& gtk_combo_box_entry_new_with_model},
+    { "gtk_combo_box_entry_new",  cast(void**)& gtk_combo_box_entry_new},
+    { "gtk_combo_box_entry_get_type",  cast(void**)& gtk_combo_box_entry_get_type},
+//     { "_gtk_combo_box_editing_canceled",  cast(void**)& _gtk_combo_box_editing_canceled},
+    { "gtk_combo_box_get_popup_accessible",  cast(void**)& gtk_combo_box_get_popup_accessible},
+    { "gtk_combo_box_popdown",  cast(void**)& gtk_combo_box_popdown},
+    { "gtk_combo_box_popup",  cast(void**)& gtk_combo_box_popup},
+    { "gtk_combo_box_get_active_text",  cast(void**)& gtk_combo_box_get_active_text},
+    { "gtk_combo_box_remove_text",  cast(void**)& gtk_combo_box_remove_text},
+    { "gtk_combo_box_prepend_text",  cast(void**)& gtk_combo_box_prepend_text},
+    { "gtk_combo_box_insert_text",  cast(void**)& gtk_combo_box_insert_text},
+    { "gtk_combo_box_append_text",  cast(void**)& gtk_combo_box_append_text},
+    { "gtk_combo_box_new_text",  cast(void**)& gtk_combo_box_new_text},
+    { "gtk_combo_box_set_row_separator_func",  cast(void**)& gtk_combo_box_set_row_separator_func},
+    { "gtk_combo_box_get_row_separator_func",  cast(void**)& gtk_combo_box_get_row_separator_func},
+    { "gtk_combo_box_get_model",  cast(void**)& gtk_combo_box_get_model},
+    { "gtk_combo_box_set_model",  cast(void**)& gtk_combo_box_set_model},
+    { "gtk_combo_box_set_active_iter",  cast(void**)& gtk_combo_box_set_active_iter},
+    { "gtk_combo_box_get_active_iter",  cast(void**)& gtk_combo_box_get_active_iter},
+    { "gtk_combo_box_set_active",  cast(void**)& gtk_combo_box_set_active},
+    { "gtk_combo_box_get_active",  cast(void**)& gtk_combo_box_get_active},
+    { "gtk_combo_box_set_focus_on_click",  cast(void**)& gtk_combo_box_set_focus_on_click},
+    { "gtk_combo_box_get_focus_on_click",  cast(void**)& gtk_combo_box_get_focus_on_click},
+    { "gtk_combo_box_set_title",  cast(void**)& gtk_combo_box_set_title},
+    { "gtk_combo_box_get_title",  cast(void**)& gtk_combo_box_get_title},
+    { "gtk_combo_box_set_add_tearoffs",  cast(void**)& gtk_combo_box_set_add_tearoffs},
+    { "gtk_combo_box_get_add_tearoffs",  cast(void**)& gtk_combo_box_get_add_tearoffs},
+    { "gtk_combo_box_set_column_span_column",  cast(void**)& gtk_combo_box_set_column_span_column},
+    { "gtk_combo_box_get_column_span_column",  cast(void**)& gtk_combo_box_get_column_span_column},
+    { "gtk_combo_box_set_row_span_column",  cast(void**)& gtk_combo_box_set_row_span_column},
+    { "gtk_combo_box_get_row_span_column",  cast(void**)& gtk_combo_box_get_row_span_column},
+    { "gtk_combo_box_set_wrap_width",  cast(void**)& gtk_combo_box_set_wrap_width},
+    { "gtk_combo_box_get_wrap_width",  cast(void**)& gtk_combo_box_get_wrap_width},
+    { "gtk_combo_box_new_with_model",  cast(void**)& gtk_combo_box_new_with_model},
+    { "gtk_combo_box_new",  cast(void**)& gtk_combo_box_new},
+    { "gtk_combo_box_get_type",  cast(void**)& gtk_combo_box_get_type},
+    { "gtk_tree_view_get_tooltip_column",  cast(void**)& gtk_tree_view_get_tooltip_column},
+    { "gtk_tree_view_set_tooltip_column",  cast(void**)& gtk_tree_view_set_tooltip_column},
+    { "gtk_tree_view_get_tooltip_context",  cast(void**)& gtk_tree_view_get_tooltip_context},
+    { "gtk_tree_view_set_tooltip_cell",  cast(void**)& gtk_tree_view_set_tooltip_cell},
+    { "gtk_tree_view_set_tooltip_row",  cast(void**)& gtk_tree_view_set_tooltip_row},
+    { "gtk_tree_view_get_level_indentation",  cast(void**)& gtk_tree_view_get_level_indentation},
+    { "gtk_tree_view_set_level_indentation",  cast(void**)& gtk_tree_view_set_level_indentation},
+    { "gtk_tree_view_get_show_expanders",  cast(void**)& gtk_tree_view_get_show_expanders},
+    { "gtk_tree_view_set_show_expanders",  cast(void**)& gtk_tree_view_set_show_expanders},
+    { "gtk_tree_view_set_enable_tree_lines",  cast(void**)& gtk_tree_view_set_enable_tree_lines},
+    { "gtk_tree_view_get_enable_tree_lines",  cast(void**)& gtk_tree_view_get_enable_tree_lines},
+    { "gtk_tree_view_set_grid_lines",  cast(void**)& gtk_tree_view_set_grid_lines},
+    { "gtk_tree_view_get_grid_lines",  cast(void**)& gtk_tree_view_get_grid_lines},
+    { "gtk_tree_view_set_row_separator_func",  cast(void**)& gtk_tree_view_set_row_separator_func},
+    { "gtk_tree_view_get_row_separator_func",  cast(void**)& gtk_tree_view_get_row_separator_func},
+    { "gtk_tree_view_is_rubber_banding_active",  cast(void**)& gtk_tree_view_is_rubber_banding_active},
+    { "gtk_tree_view_get_rubber_banding",  cast(void**)& gtk_tree_view_get_rubber_banding},
+    { "gtk_tree_view_set_rubber_banding",  cast(void**)& gtk_tree_view_set_rubber_banding},
+    { "gtk_tree_view_get_hover_expand",  cast(void**)& gtk_tree_view_get_hover_expand},
+    { "gtk_tree_view_set_hover_expand",  cast(void**)& gtk_tree_view_set_hover_expand},
+    { "gtk_tree_view_get_hover_selection",  cast(void**)& gtk_tree_view_get_hover_selection},
+    { "gtk_tree_view_set_hover_selection",  cast(void**)& gtk_tree_view_set_hover_selection},
+    { "gtk_tree_view_get_fixed_height_mode",  cast(void**)& gtk_tree_view_get_fixed_height_mode},
+    { "gtk_tree_view_set_fixed_height_mode",  cast(void**)& gtk_tree_view_set_fixed_height_mode},
+    { "gtk_tree_view_set_destroy_count_func",  cast(void**)& gtk_tree_view_set_destroy_count_func},
+    { "gtk_tree_view_convert_bin_window_to_tree_coords",  cast(void**)& gtk_tree_view_convert_bin_window_to_tree_coords},
+    { "gtk_tree_view_convert_tree_to_bin_window_coords",  cast(void**)& gtk_tree_view_convert_tree_to_bin_window_coords},
+    { "gtk_tree_view_convert_bin_window_to_widget_coords",  cast(void**)& gtk_tree_view_convert_bin_window_to_widget_coords},
+    { "gtk_tree_view_convert_widget_to_bin_window_coords",  cast(void**)& gtk_tree_view_convert_widget_to_bin_window_coords},
+    { "gtk_tree_view_convert_tree_to_widget_coords",  cast(void**)& gtk_tree_view_convert_tree_to_widget_coords},
+    { "gtk_tree_view_convert_widget_to_tree_coords",  cast(void**)& gtk_tree_view_convert_widget_to_tree_coords},
+    { "gtk_tree_view_set_search_position_func",  cast(void**)& gtk_tree_view_set_search_position_func},
+    { "gtk_tree_view_get_search_position_func",  cast(void**)& gtk_tree_view_get_search_position_func},
+    { "gtk_tree_view_set_search_entry",  cast(void**)& gtk_tree_view_set_search_entry},
+    { "gtk_tree_view_get_search_entry",  cast(void**)& gtk_tree_view_get_search_entry},
+    { "gtk_tree_view_set_search_equal_func",  cast(void**)& gtk_tree_view_set_search_equal_func},
+    { "gtk_tree_view_get_search_equal_func",  cast(void**)& gtk_tree_view_get_search_equal_func},
+    { "gtk_tree_view_set_search_column",  cast(void**)& gtk_tree_view_set_search_column},
+    { "gtk_tree_view_get_search_column",  cast(void**)& gtk_tree_view_get_search_column},
+    { "gtk_tree_view_get_enable_search",  cast(void**)& gtk_tree_view_get_enable_search},
+    { "gtk_tree_view_set_enable_search",  cast(void**)& gtk_tree_view_set_enable_search},
+    { "gtk_tree_view_create_row_drag_icon",  cast(void**)& gtk_tree_view_create_row_drag_icon},
+    { "gtk_tree_view_get_dest_row_at_pos",  cast(void**)& gtk_tree_view_get_dest_row_at_pos},
+    { "gtk_tree_view_get_drag_dest_row",  cast(void**)& gtk_tree_view_get_drag_dest_row},
+    { "gtk_tree_view_set_drag_dest_row",  cast(void**)& gtk_tree_view_set_drag_dest_row},
+    { "gtk_tree_view_unset_rows_drag_dest",  cast(void**)& gtk_tree_view_unset_rows_drag_dest},
+    { "gtk_tree_view_unset_rows_drag_source",  cast(void**)& gtk_tree_view_unset_rows_drag_source},
+    { "gtk_tree_view_enable_model_drag_dest",  cast(void**)& gtk_tree_view_enable_model_drag_dest},
+    { "gtk_tree_view_enable_model_drag_source",  cast(void**)& gtk_tree_view_enable_model_drag_source},
+    { "gtk_tree_view_get_visible_range",  cast(void**)& gtk_tree_view_get_visible_range},
+    { "gtk_tree_view_tree_to_widget_coords",  cast(void**)& gtk_tree_view_tree_to_widget_coords},
+    { "gtk_tree_view_widget_to_tree_coords",  cast(void**)& gtk_tree_view_widget_to_tree_coords},
+    { "gtk_tree_view_get_visible_rect",  cast(void**)& gtk_tree_view_get_visible_rect},
+    { "gtk_tree_view_get_background_area",  cast(void**)& gtk_tree_view_get_background_area},
+    { "gtk_tree_view_get_cell_area",  cast(void**)& gtk_tree_view_get_cell_area},
+    { "gtk_tree_view_get_path_at_pos",  cast(void**)& gtk_tree_view_get_path_at_pos},
+    { "gtk_tree_view_get_bin_window",  cast(void**)& gtk_tree_view_get_bin_window},
+    { "gtk_tree_view_get_cursor",  cast(void**)& gtk_tree_view_get_cursor},
+    { "gtk_tree_view_set_cursor_on_cell",  cast(void**)& gtk_tree_view_set_cursor_on_cell},
+    { "gtk_tree_view_set_cursor",  cast(void**)& gtk_tree_view_set_cursor},
+    { "gtk_tree_view_get_reorderable",  cast(void**)& gtk_tree_view_get_reorderable},
+    { "gtk_tree_view_set_reorderable",  cast(void**)& gtk_tree_view_set_reorderable},
+    { "gtk_tree_view_row_expanded",  cast(void**)& gtk_tree_view_row_expanded},
+    { "gtk_tree_view_map_expanded_rows",  cast(void**)& gtk_tree_view_map_expanded_rows},
+    { "gtk_tree_view_collapse_row",  cast(void**)& gtk_tree_view_collapse_row},
+    { "gtk_tree_view_expand_row",  cast(void**)& gtk_tree_view_expand_row},
+    { "gtk_tree_view_expand_to_path",  cast(void**)& gtk_tree_view_expand_to_path},
+    { "gtk_tree_view_collapse_all",  cast(void**)& gtk_tree_view_collapse_all},
+    { "gtk_tree_view_expand_all",  cast(void**)& gtk_tree_view_expand_all},
+    { "gtk_tree_view_row_activated",  cast(void**)& gtk_tree_view_row_activated},
+    { "gtk_tree_view_scroll_to_cell",  cast(void**)& gtk_tree_view_scroll_to_cell},
+    { "gtk_tree_view_scroll_to_point",  cast(void**)& gtk_tree_view_scroll_to_point},
+    { "gtk_tree_view_set_column_drag_function",  cast(void**)& gtk_tree_view_set_column_drag_function},
+    { "gtk_tree_view_get_expander_column",  cast(void**)& gtk_tree_view_get_expander_column},
+    { "gtk_tree_view_set_expander_column",  cast(void**)& gtk_tree_view_set_expander_column},
+    { "gtk_tree_view_move_column_after",  cast(void**)& gtk_tree_view_move_column_after},
+    { "gtk_tree_view_get_columns",  cast(void**)& gtk_tree_view_get_columns},
+    { "gtk_tree_view_get_column",  cast(void**)& gtk_tree_view_get_column},
+    { "gtk_tree_view_insert_column_with_data_func",  cast(void**)& gtk_tree_view_insert_column_with_data_func},
+    { "gtk_tree_view_insert_column_with_attributes",  cast(void**)& gtk_tree_view_insert_column_with_attributes},
+    { "gtk_tree_view_insert_column",  cast(void**)& gtk_tree_view_insert_column},
+    { "gtk_tree_view_remove_column",  cast(void**)& gtk_tree_view_remove_column},
+    { "gtk_tree_view_append_column",  cast(void**)& gtk_tree_view_append_column},
+    { "gtk_tree_view_get_rules_hint",  cast(void**)& gtk_tree_view_get_rules_hint},
+    { "gtk_tree_view_set_rules_hint",  cast(void**)& gtk_tree_view_set_rules_hint},
+    { "gtk_tree_view_set_headers_clickable",  cast(void**)& gtk_tree_view_set_headers_clickable},
+    { "gtk_tree_view_get_headers_clickable",  cast(void**)& gtk_tree_view_get_headers_clickable},
+    { "gtk_tree_view_columns_autosize",  cast(void**)& gtk_tree_view_columns_autosize},
+    { "gtk_tree_view_set_headers_visible",  cast(void**)& gtk_tree_view_set_headers_visible},
+    { "gtk_tree_view_get_headers_visible",  cast(void**)& gtk_tree_view_get_headers_visible},
+    { "gtk_tree_view_set_vadjustment",  cast(void**)& gtk_tree_view_set_vadjustment},
+    { "gtk_tree_view_get_vadjustment",  cast(void**)& gtk_tree_view_get_vadjustment},
+    { "gtk_tree_view_set_hadjustment",  cast(void**)& gtk_tree_view_set_hadjustment},
+    { "gtk_tree_view_get_hadjustment",  cast(void**)& gtk_tree_view_get_hadjustment},
+    { "gtk_tree_view_get_selection",  cast(void**)& gtk_tree_view_get_selection},
+    { "gtk_tree_view_set_model",  cast(void**)& gtk_tree_view_set_model},
+    { "gtk_tree_view_get_model",  cast(void**)& gtk_tree_view_get_model},
+    { "gtk_tree_view_new_with_model",  cast(void**)& gtk_tree_view_new_with_model},
+    { "gtk_tree_view_new",  cast(void**)& gtk_tree_view_new},
+    { "gtk_tree_view_get_type",  cast(void**)& gtk_tree_view_get_type},
+    { "gtk_entry_set_editable",  cast(void**)& gtk_entry_set_editable},
+    { "gtk_entry_select_region",  cast(void**)& gtk_entry_select_region},
+    { "gtk_entry_set_position",  cast(void**)& gtk_entry_set_position},
+    { "gtk_entry_prepend_text",  cast(void**)& gtk_entry_prepend_text},
+    { "gtk_entry_append_text",  cast(void**)& gtk_entry_append_text},
+    { "gtk_entry_new_with_max_length",  cast(void**)& gtk_entry_new_with_max_length},
+    { "gtk_entry_get_cursor_hadjustment",  cast(void**)& gtk_entry_get_cursor_hadjustment},
+    { "gtk_entry_set_cursor_hadjustment",  cast(void**)& gtk_entry_set_cursor_hadjustment},
+    { "gtk_entry_text_index_to_layout_index",  cast(void**)& gtk_entry_text_index_to_layout_index},
+    { "gtk_entry_layout_index_to_text_index",  cast(void**)& gtk_entry_layout_index_to_text_index},
+    { "gtk_entry_get_completion",  cast(void**)& gtk_entry_get_completion},
+    { "gtk_entry_set_completion",  cast(void**)& gtk_entry_set_completion},
+    { "gtk_entry_get_alignment",  cast(void**)& gtk_entry_get_alignment},
+    { "gtk_entry_set_alignment",  cast(void**)& gtk_entry_set_alignment},
+    { "gtk_entry_get_layout_offsets",  cast(void**)& gtk_entry_get_layout_offsets},
+    { "gtk_entry_get_layout",  cast(void**)& gtk_entry_get_layout},
+    { "gtk_entry_get_text",  cast(void**)& gtk_entry_get_text},
+    { "gtk_entry_set_text",  cast(void**)& gtk_entry_set_text},
+    { "gtk_entry_get_width_chars",  cast(void**)& gtk_entry_get_width_chars},
+    { "gtk_entry_set_width_chars",  cast(void**)& gtk_entry_set_width_chars},
+    { "gtk_entry_get_activates_default",  cast(void**)& gtk_entry_get_activates_default},
+    { "gtk_entry_set_activates_default",  cast(void**)& gtk_entry_set_activates_default},
+    { "gtk_entry_get_max_length",  cast(void**)& gtk_entry_get_max_length},
+    { "gtk_entry_set_max_length",  cast(void**)& gtk_entry_set_max_length},
+    { "gtk_entry_get_inner_border",  cast(void**)& gtk_entry_get_inner_border},
+    { "gtk_entry_set_inner_border",  cast(void**)& gtk_entry_set_inner_border},
+    { "gtk_entry_get_has_frame",  cast(void**)& gtk_entry_get_has_frame},
+    { "gtk_entry_set_has_frame",  cast(void**)& gtk_entry_set_has_frame},
+    { "gtk_entry_get_invisible_char",  cast(void**)& gtk_entry_get_invisible_char},
+    { "gtk_entry_set_invisible_char",  cast(void**)& gtk_entry_set_invisible_char},
+    { "gtk_entry_get_visibility",  cast(void**)& gtk_entry_get_visibility},
+    { "gtk_entry_set_visibility",  cast(void**)& gtk_entry_set_visibility},
+    { "gtk_entry_new",  cast(void**)& gtk_entry_new},
+    { "gtk_entry_get_type",  cast(void**)& gtk_entry_get_type},
+    { "gtk_entry_completion_get_text_column",  cast(void**)& gtk_entry_completion_get_text_column},
+    { "gtk_entry_completion_set_text_column",  cast(void**)& gtk_entry_completion_set_text_column},
+    { "gtk_entry_completion_get_completion_prefix",  cast(void**)& gtk_entry_completion_get_completion_prefix},
+    { "gtk_entry_completion_get_popup_single_match",  cast(void**)& gtk_entry_completion_get_popup_single_match},
+    { "gtk_entry_completion_set_popup_single_match",  cast(void**)& gtk_entry_completion_set_popup_single_match},
+    { "gtk_entry_completion_get_popup_set_width",  cast(void**)& gtk_entry_completion_get_popup_set_width},
+    { "gtk_entry_completion_set_popup_set_width",  cast(void**)& gtk_entry_completion_set_popup_set_width},
+    { "gtk_entry_completion_get_popup_completion",  cast(void**)& gtk_entry_completion_get_popup_completion},
+    { "gtk_entry_completion_set_popup_completion",  cast(void**)& gtk_entry_completion_set_popup_completion},
+    { "gtk_entry_completion_get_inline_selection",  cast(void**)& gtk_entry_completion_get_inline_selection},
+    { "gtk_entry_completion_set_inline_selection",  cast(void**)& gtk_entry_completion_set_inline_selection},
+    { "gtk_entry_completion_get_inline_completion",  cast(void**)& gtk_entry_completion_get_inline_completion},
+    { "gtk_entry_completion_set_inline_completion",  cast(void**)& gtk_entry_completion_set_inline_completion},
+    { "gtk_entry_completion_delete_action",  cast(void**)& gtk_entry_completion_delete_action},
+    { "gtk_entry_completion_insert_action_markup",  cast(void**)& gtk_entry_completion_insert_action_markup},
+    { "gtk_entry_completion_insert_action_text",  cast(void**)& gtk_entry_completion_insert_action_text},
+    { "gtk_entry_completion_insert_prefix",  cast(void**)& gtk_entry_completion_insert_prefix},
+    { "gtk_entry_completion_complete",  cast(void**)& gtk_entry_completion_complete},
+    { "gtk_entry_completion_get_minimum_key_length",  cast(void**)& gtk_entry_completion_get_minimum_key_length},
+    { "gtk_entry_completion_set_minimum_key_length",  cast(void**)& gtk_entry_completion_set_minimum_key_length},
+    { "gtk_entry_completion_set_match_func",  cast(void**)& gtk_entry_completion_set_match_func},
+    { "gtk_entry_completion_get_model",  cast(void**)& gtk_entry_completion_get_model},
+    { "gtk_entry_completion_set_model",  cast(void**)& gtk_entry_completion_set_model},
+    { "gtk_entry_completion_get_entry",  cast(void**)& gtk_entry_completion_get_entry},
+    { "gtk_entry_completion_new",  cast(void**)& gtk_entry_completion_new},
+    { "gtk_entry_completion_get_type",  cast(void**)& gtk_entry_completion_get_type},
+    { "gtk_tree_model_filter_clear_cache",  cast(void**)& gtk_tree_model_filter_clear_cache},
+    { "gtk_tree_model_filter_refilter",  cast(void**)& gtk_tree_model_filter_refilter},
+    { "gtk_tree_model_filter_convert_path_to_child_path",  cast(void**)& gtk_tree_model_filter_convert_path_to_child_path},
+    { "gtk_tree_model_filter_convert_child_path_to_path",  cast(void**)& gtk_tree_model_filter_convert_child_path_to_path},
+    { "gtk_tree_model_filter_convert_iter_to_child_iter",  cast(void**)& gtk_tree_model_filter_convert_iter_to_child_iter},
+    { "gtk_tree_model_filter_convert_child_iter_to_iter",  cast(void**)& gtk_tree_model_filter_convert_child_iter_to_iter},
+    { "gtk_tree_model_filter_get_model",  cast(void**)& gtk_tree_model_filter_get_model},
+    { "gtk_tree_model_filter_set_visible_column",  cast(void**)& gtk_tree_model_filter_set_visible_column},
+    { "gtk_tree_model_filter_set_modify_func",  cast(void**)& gtk_tree_model_filter_set_modify_func},
+    { "gtk_tree_model_filter_set_visible_func",  cast(void**)& gtk_tree_model_filter_set_visible_func},
+    { "gtk_tree_model_filter_new",  cast(void**)& gtk_tree_model_filter_new},
+    { "gtk_tree_model_filter_get_type",  cast(void**)& gtk_tree_model_filter_get_type},
+    { "gtk_list_store_move_before",  cast(void**)& gtk_list_store_move_before},
+    { "gtk_list_store_move_after",  cast(void**)& gtk_list_store_move_after},
+    { "gtk_list_store_swap",  cast(void**)& gtk_list_store_swap},
+    { "gtk_list_store_reorder",  cast(void**)& gtk_list_store_reorder},
+    { "gtk_list_store_iter_is_valid",  cast(void**)& gtk_list_store_iter_is_valid},
+    { "gtk_list_store_clear",  cast(void**)& gtk_list_store_clear},
+    { "gtk_list_store_append",  cast(void**)& gtk_list_store_append},
+    { "gtk_list_store_prepend",  cast(void**)& gtk_list_store_prepend},
+    { "gtk_list_store_insert_with_valuesv",  cast(void**)& gtk_list_store_insert_with_valuesv},
+    { "gtk_list_store_insert_with_values",  cast(void**)& gtk_list_store_insert_with_values},
+    { "gtk_list_store_insert_after",  cast(void**)& gtk_list_store_insert_after},
+    { "gtk_list_store_insert_before",  cast(void**)& gtk_list_store_insert_before},
+    { "gtk_list_store_insert",  cast(void**)& gtk_list_store_insert},
+    { "gtk_list_store_remove",  cast(void**)& gtk_list_store_remove},
+    { "gtk_list_store_set_valist",  cast(void**)& gtk_list_store_set_valist},
+    { "gtk_list_store_set_valuesv",  cast(void**)& gtk_list_store_set_valuesv},
+    { "gtk_list_store_set",  cast(void**)& gtk_list_store_set},
+    { "gtk_list_store_set_value",  cast(void**)& gtk_list_store_set_value},
+    { "gtk_list_store_set_column_types",  cast(void**)& gtk_list_store_set_column_types},
+    { "gtk_list_store_newv",  cast(void**)& gtk_list_store_newv},
+    { "gtk_list_store_new",  cast(void**)& gtk_list_store_new},
+    { "gtk_list_store_get_type",  cast(void**)& gtk_list_store_get_type},
+    { "gtk_im_context_delete_surrounding",  cast(void**)& gtk_im_context_delete_surrounding},
+    { "gtk_im_context_get_surrounding",  cast(void**)& gtk_im_context_get_surrounding},
+    { "gtk_im_context_set_surrounding",  cast(void**)& gtk_im_context_set_surrounding},
+    { "gtk_im_context_set_use_preedit",  cast(void**)& gtk_im_context_set_use_preedit},
+    { "gtk_im_context_set_cursor_location",  cast(void**)& gtk_im_context_set_cursor_location},
+    { "gtk_im_context_reset",  cast(void**)& gtk_im_context_reset},
+    { "gtk_im_context_focus_out",  cast(void**)& gtk_im_context_focus_out},
+    { "gtk_im_context_focus_in",  cast(void**)& gtk_im_context_focus_in},
+    { "gtk_im_context_filter_keypress",  cast(void**)& gtk_im_context_filter_keypress},
+    { "gtk_im_context_get_preedit_string",  cast(void**)& gtk_im_context_get_preedit_string},
+    { "gtk_im_context_set_client_window",  cast(void**)& gtk_im_context_set_client_window},
+    { "gtk_im_context_get_type",  cast(void**)& gtk_im_context_get_type},
+    { "gtk_editable_get_editable",  cast(void**)& gtk_editable_get_editable},
+    { "gtk_editable_set_editable",  cast(void**)& gtk_editable_set_editable},
+    { "gtk_editable_get_position",  cast(void**)& gtk_editable_get_position},
+    { "gtk_editable_set_position",  cast(void**)& gtk_editable_set_position},
+    { "gtk_editable_delete_selection",  cast(void**)& gtk_editable_delete_selection},
+    { "gtk_editable_paste_clipboard",  cast(void**)& gtk_editable_paste_clipboard},
+    { "gtk_editable_copy_clipboard",  cast(void**)& gtk_editable_copy_clipboard},
+    { "gtk_editable_cut_clipboard",  cast(void**)& gtk_editable_cut_clipboard},
+    { "gtk_editable_get_chars",  cast(void**)& gtk_editable_get_chars},
+    { "gtk_editable_delete_text",  cast(void**)& gtk_editable_delete_text},
+    { "gtk_editable_insert_text",  cast(void**)& gtk_editable_insert_text},
+    { "gtk_editable_get_selection_bounds",  cast(void**)& gtk_editable_get_selection_bounds},
+    { "gtk_editable_select_region",  cast(void**)& gtk_editable_select_region},
+    { "gtk_editable_get_type",  cast(void**)& gtk_editable_get_type},
+    { "gtk_drag_set_default_icon",  cast(void**)& gtk_drag_set_default_icon},
+//     { "_gtk_drag_dest_handle_event",  cast(void**)& _gtk_drag_dest_handle_event},
+//     { "_gtk_drag_source_handle_event",  cast(void**)& _gtk_drag_source_handle_event},
+    { "gtk_drag_check_threshold",  cast(void**)& gtk_drag_check_threshold},
+    { "gtk_drag_set_icon_default",  cast(void**)& gtk_drag_set_icon_default},
+    { "gtk_drag_set_icon_name",  cast(void**)& gtk_drag_set_icon_name},
+    { "gtk_drag_set_icon_stock",  cast(void**)& gtk_drag_set_icon_stock},
+    { "gtk_drag_set_icon_pixbuf",  cast(void**)& gtk_drag_set_icon_pixbuf},
+    { "gtk_drag_set_icon_pixmap",  cast(void**)& gtk_drag_set_icon_pixmap},
+    { "gtk_drag_set_icon_widget",  cast(void**)& gtk_drag_set_icon_widget},
+    { "gtk_drag_begin",  cast(void**)& gtk_drag_begin},
+    { "gtk_drag_source_set_icon_name",  cast(void**)& gtk_drag_source_set_icon_name},
+    { "gtk_drag_source_set_icon_stock",  cast(void**)& gtk_drag_source_set_icon_stock},
+    { "gtk_drag_source_set_icon_pixbuf",  cast(void**)& gtk_drag_source_set_icon_pixbuf},
+    { "gtk_drag_source_set_icon",  cast(void**)& gtk_drag_source_set_icon},
+    { "gtk_drag_source_add_uri_targets",  cast(void**)& gtk_drag_source_add_uri_targets},
+    { "gtk_drag_source_add_image_targets",  cast(void**)& gtk_drag_source_add_image_targets},
+    { "gtk_drag_source_add_text_targets",  cast(void**)& gtk_drag_source_add_text_targets},
+    { "gtk_drag_source_set_target_list",  cast(void**)& gtk_drag_source_set_target_list},
+    { "gtk_drag_source_get_target_list",  cast(void**)& gtk_drag_source_get_target_list},
+    { "gtk_drag_source_unset",  cast(void**)& gtk_drag_source_unset},
+    { "gtk_drag_source_set",  cast(void**)& gtk_drag_source_set},
+    { "gtk_drag_dest_get_track_motion",  cast(void**)& gtk_drag_dest_get_track_motion},
+    { "gtk_drag_dest_set_track_motion",  cast(void**)& gtk_drag_dest_set_track_motion},
+    { "gtk_drag_dest_add_uri_targets",  cast(void**)& gtk_drag_dest_add_uri_targets},
+    { "gtk_drag_dest_add_image_targets",  cast(void**)& gtk_drag_dest_add_image_targets},
+    { "gtk_drag_dest_add_text_targets",  cast(void**)& gtk_drag_dest_add_text_targets},
+    { "gtk_drag_dest_set_target_list",  cast(void**)& gtk_drag_dest_set_target_list},
+    { "gtk_drag_dest_get_target_list",  cast(void**)& gtk_drag_dest_get_target_list},
+    { "gtk_drag_dest_find_target",  cast(void**)& gtk_drag_dest_find_target},
+    { "gtk_drag_dest_unset",  cast(void**)& gtk_drag_dest_unset},
+    { "gtk_drag_dest_set_proxy",  cast(void**)& gtk_drag_dest_set_proxy},
+    { "gtk_drag_dest_set",  cast(void**)& gtk_drag_dest_set},
+    { "gtk_drag_unhighlight",  cast(void**)& gtk_drag_unhighlight},
+    { "gtk_drag_highlight",  cast(void**)& gtk_drag_highlight},
+    { "gtk_drag_get_source_widget",  cast(void**)& gtk_drag_get_source_widget},
+    { "gtk_drag_finish",  cast(void**)& gtk_drag_finish},
+    { "gtk_drag_get_data",  cast(void**)& gtk_drag_get_data},
+    { "gtk_combo_disable_activate",  cast(void**)& gtk_combo_disable_activate},
+    { "gtk_combo_set_popdown_strings",  cast(void**)& gtk_combo_set_popdown_strings},
+    { "gtk_combo_set_item_string",  cast(void**)& gtk_combo_set_item_string},
+    { "gtk_combo_set_case_sensitive",  cast(void**)& gtk_combo_set_case_sensitive},
+    { "gtk_combo_set_use_arrows_always",  cast(void**)& gtk_combo_set_use_arrows_always},
+    { "gtk_combo_set_use_arrows",  cast(void**)& gtk_combo_set_use_arrows},
+    { "gtk_combo_set_value_in_list",  cast(void**)& gtk_combo_set_value_in_list},
+    { "gtk_combo_new",  cast(void**)& gtk_combo_new},
+    { "gtk_combo_get_type",  cast(void**)& gtk_combo_get_type},
+    { "gtk_hbox_new",  cast(void**)& gtk_hbox_new},
+    { "gtk_hbox_get_type",  cast(void**)& gtk_hbox_get_type},
+    { "gtk_color_selection_dialog_new",  cast(void**)& gtk_color_selection_dialog_new},
+    { "gtk_color_selection_dialog_get_type",  cast(void**)& gtk_color_selection_dialog_get_type},
+    { "gtk_color_selection_set_update_policy",  cast(void**)& gtk_color_selection_set_update_policy},
+    { "gtk_color_selection_get_color",  cast(void**)& gtk_color_selection_get_color},
+    { "gtk_color_selection_set_color",  cast(void**)& gtk_color_selection_set_color},
+    { "gtk_color_selection_set_change_palette_with_screen_hook",  cast(void**)& gtk_color_selection_set_change_palette_with_screen_hook},
+    { "gtk_color_selection_set_change_palette_hook",  cast(void**)& gtk_color_selection_set_change_palette_hook},
+    { "gtk_color_selection_palette_to_string",  cast(void**)& gtk_color_selection_palette_to_string},
+    { "gtk_color_selection_palette_from_string",  cast(void**)& gtk_color_selection_palette_from_string},
+    { "gtk_color_selection_is_adjusting",  cast(void**)& gtk_color_selection_is_adjusting},
+    { "gtk_color_selection_get_previous_alpha",  cast(void**)& gtk_color_selection_get_previous_alpha},
+    { "gtk_color_selection_get_previous_color",  cast(void**)& gtk_color_selection_get_previous_color},
+    { "gtk_color_selection_set_previous_alpha",  cast(void**)& gtk_color_selection_set_previous_alpha},
+    { "gtk_color_selection_set_previous_color",  cast(void**)& gtk_color_selection_set_previous_color},
+    { "gtk_color_selection_get_current_alpha",  cast(void**)& gtk_color_selection_get_current_alpha},
+    { "gtk_color_selection_get_current_color",  cast(void**)& gtk_color_selection_get_current_color},
+    { "gtk_color_selection_set_current_alpha",  cast(void**)& gtk_color_selection_set_current_alpha},
+    { "gtk_color_selection_set_current_color",  cast(void**)& gtk_color_selection_set_current_color},
+    { "gtk_color_selection_set_has_palette",  cast(void**)& gtk_color_selection_set_has_palette},
+    { "gtk_color_selection_get_has_palette",  cast(void**)& gtk_color_selection_get_has_palette},
+    { "gtk_color_selection_set_has_opacity_control",  cast(void**)& gtk_color_selection_set_has_opacity_control},
+    { "gtk_color_selection_get_has_opacity_control",  cast(void**)& gtk_color_selection_get_has_opacity_control},
+    { "gtk_color_selection_new",  cast(void**)& gtk_color_selection_new},
+    { "gtk_color_selection_get_type",  cast(void**)& gtk_color_selection_get_type},
+    { "gtk_vbox_new",  cast(void**)& gtk_vbox_new},
+    { "gtk_vbox_get_type",  cast(void**)& gtk_vbox_get_type},
+    { "gtk_color_button_get_title",  cast(void**)& gtk_color_button_get_title},
+    { "gtk_color_button_set_title",  cast(void**)& gtk_color_button_set_title},
+    { "gtk_color_button_get_use_alpha",  cast(void**)& gtk_color_button_get_use_alpha},
+    { "gtk_color_button_set_use_alpha",  cast(void**)& gtk_color_button_set_use_alpha},
+    { "gtk_color_button_get_alpha",  cast(void**)& gtk_color_button_get_alpha},
+    { "gtk_color_button_get_color",  cast(void**)& gtk_color_button_get_color},
+    { "gtk_color_button_set_alpha",  cast(void**)& gtk_color_button_set_alpha},
+    { "gtk_color_button_set_color",  cast(void**)& gtk_color_button_set_color},
+    { "gtk_color_button_new_with_color",  cast(void**)& gtk_color_button_new_with_color},
+    { "gtk_color_button_new",  cast(void**)& gtk_color_button_new},
+    { "gtk_color_button_get_type",  cast(void**)& gtk_color_button_get_type},
+//     { "_gtk_clist_create_cell_layout",  cast(void**)& _gtk_clist_create_cell_layout},
+    { "gtk_clist_set_auto_sort",  cast(void**)& gtk_clist_set_auto_sort},
+    { "gtk_clist_sort",  cast(void**)& gtk_clist_sort},
+    { "gtk_clist_set_sort_type",  cast(void**)& gtk_clist_set_sort_type},
+    { "gtk_clist_set_sort_column",  cast(void**)& gtk_clist_set_sort_column},
+    { "gtk_clist_set_compare_func",  cast(void**)& gtk_clist_set_compare_func},
+    { "gtk_clist_row_move",  cast(void**)& gtk_clist_row_move},
+    { "gtk_clist_swap_rows",  cast(void**)& gtk_clist_swap_rows},
+    { "gtk_clist_unselect_all",  cast(void**)& gtk_clist_unselect_all},
+    { "gtk_clist_select_all",  cast(void**)& gtk_clist_select_all},
+    { "gtk_clist_get_selection_info",  cast(void**)& gtk_clist_get_selection_info},
+    { "gtk_clist_clear",  cast(void**)& gtk_clist_clear},
+    { "gtk_clist_undo_selection",  cast(void**)& gtk_clist_undo_selection},
+    { "gtk_clist_unselect_row",  cast(void**)& gtk_clist_unselect_row},
+    { "gtk_clist_select_row",  cast(void**)& gtk_clist_select_row},
+    { "gtk_clist_find_row_from_data",  cast(void**)& gtk_clist_find_row_from_data},
+    { "gtk_clist_get_row_data",  cast(void**)& gtk_clist_get_row_data},
+    { "gtk_clist_set_row_data_full",  cast(void**)& gtk_clist_set_row_data_full},
+    { "gtk_clist_set_row_data",  cast(void**)& gtk_clist_set_row_data},
+    { "gtk_clist_remove",  cast(void**)& gtk_clist_remove},
+    { "gtk_clist_insert",  cast(void**)& gtk_clist_insert},
+    { "gtk_clist_append",  cast(void**)& gtk_clist_append},
+    { "gtk_clist_prepend",  cast(void**)& gtk_clist_prepend},
+    { "gtk_clist_get_selectable",  cast(void**)& gtk_clist_get_selectable},
+    { "gtk_clist_set_selectable",  cast(void**)& gtk_clist_set_selectable},
+    { "gtk_clist_set_shift",  cast(void**)& gtk_clist_set_shift},
+    { "gtk_clist_get_row_style",  cast(void**)& gtk_clist_get_row_style},
+    { "gtk_clist_set_row_style",  cast(void**)& gtk_clist_set_row_style},
+    { "gtk_clist_get_cell_style",  cast(void**)& gtk_clist_get_cell_style},
+    { "gtk_clist_set_cell_style",  cast(void**)& gtk_clist_set_cell_style},
+    { "gtk_clist_set_background",  cast(void**)& gtk_clist_set_background},
+    { "gtk_clist_set_foreground",  cast(void**)& gtk_clist_set_foreground},
+    { "gtk_clist_get_pixtext",  cast(void**)& gtk_clist_get_pixtext},
+    { "gtk_clist_set_pixtext",  cast(void**)& gtk_clist_set_pixtext},
+    { "gtk_clist_get_pixmap",  cast(void**)& gtk_clist_get_pixmap},
+    { "gtk_clist_set_pixmap",  cast(void**)& gtk_clist_set_pixmap},
+    { "gtk_clist_get_text",  cast(void**)& gtk_clist_get_text},
+    { "gtk_clist_set_text",  cast(void**)& gtk_clist_set_text},
+    { "gtk_clist_get_cell_type",  cast(void**)& gtk_clist_get_cell_type},
+    { "gtk_clist_row_is_visible",  cast(void**)& gtk_clist_row_is_visible},
+    { "gtk_clist_moveto",  cast(void**)& gtk_clist_moveto},
+    { "gtk_clist_set_row_height",  cast(void**)& gtk_clist_set_row_height},
+    { "gtk_clist_set_column_max_width",  cast(void**)& gtk_clist_set_column_max_width},
+    { "gtk_clist_set_column_min_width",  cast(void**)& gtk_clist_set_column_min_width},
+    { "gtk_clist_set_column_width",  cast(void**)& gtk_clist_set_column_width},
+    { "gtk_clist_optimal_column_width",  cast(void**)& gtk_clist_optimal_column_width},
+    { "gtk_clist_columns_autosize",  cast(void**)& gtk_clist_columns_autosize},
+    { "gtk_clist_set_column_auto_resize",  cast(void**)& gtk_clist_set_column_auto_resize},
+    { "gtk_clist_set_column_resizeable",  cast(void**)& gtk_clist_set_column_resizeable},
+    { "gtk_clist_set_column_visibility",  cast(void**)& gtk_clist_set_column_visibility},
+    { "gtk_clist_set_column_justification",  cast(void**)& gtk_clist_set_column_justification},
+    { "gtk_clist_get_column_widget",  cast(void**)& gtk_clist_get_column_widget},
+    { "gtk_clist_set_column_widget",  cast(void**)& gtk_clist_set_column_widget},
+    { "gtk_clist_get_column_title",  cast(void**)& gtk_clist_get_column_title},
+    { "gtk_clist_set_column_title",  cast(void**)& gtk_clist_set_column_title},
+    { "gtk_clist_column_titles_passive",  cast(void**)& gtk_clist_column_titles_passive},
+    { "gtk_clist_column_titles_active",  cast(void**)& gtk_clist_column_titles_active},
+    { "gtk_clist_column_title_passive",  cast(void**)& gtk_clist_column_title_passive},
+    { "gtk_clist_column_title_active",  cast(void**)& gtk_clist_column_title_active},
+    { "gtk_clist_column_titles_hide",  cast(void**)& gtk_clist_column_titles_hide},
+    { "gtk_clist_column_titles_show",  cast(void**)& gtk_clist_column_titles_show},
+    { "gtk_clist_thaw",  cast(void**)& gtk_clist_thaw},
+    { "gtk_clist_freeze",  cast(void**)& gtk_clist_freeze},
+    { "gtk_clist_set_button_actions",  cast(void**)& gtk_clist_set_button_actions},
+    { "gtk_clist_set_use_drag_icons",  cast(void**)& gtk_clist_set_use_drag_icons},
+    { "gtk_clist_set_reorderable",  cast(void**)& gtk_clist_set_reorderable},
+    { "gtk_clist_set_selection_mode",  cast(void**)& gtk_clist_set_selection_mode},
+    { "gtk_clist_set_shadow_type",  cast(void**)& gtk_clist_set_shadow_type},
+    { "gtk_clist_get_vadjustment",  cast(void**)& gtk_clist_get_vadjustment},
+    { "gtk_clist_get_hadjustment",  cast(void**)& gtk_clist_get_hadjustment},
+    { "gtk_clist_set_vadjustment",  cast(void**)& gtk_clist_set_vadjustment},
+    { "gtk_clist_set_hadjustment",  cast(void**)& gtk_clist_set_hadjustment},
+    { "gtk_clist_new_with_titles",  cast(void**)& gtk_clist_new_with_titles},
+    { "gtk_clist_new",  cast(void**)& gtk_clist_new},
+    { "gtk_clist_get_type",  cast(void**)& gtk_clist_get_type},
+    { "gtk_vscrollbar_new",  cast(void**)& gtk_vscrollbar_new},
+    { "gtk_vscrollbar_get_type",  cast(void**)& gtk_vscrollbar_get_type},
+    { "gtk_hscrollbar_new",  cast(void**)& gtk_hscrollbar_new},
+    { "gtk_hscrollbar_get_type",  cast(void**)& gtk_hscrollbar_get_type},
+    { "gtk_scrollbar_get_type",  cast(void**)& gtk_scrollbar_get_type},
+//     { "_gtk_range_get_wheel_delta",  cast(void**)& _gtk_range_get_wheel_delta},
+    { "gtk_range_get_fill_level",  cast(void**)& gtk_range_get_fill_level},
+    { "gtk_range_set_fill_level",  cast(void**)& gtk_range_set_fill_level},
+    { "gtk_range_get_restrict_to_fill_level",  cast(void**)& gtk_range_get_restrict_to_fill_level},
+    { "gtk_range_set_restrict_to_fill_level",  cast(void**)& gtk_range_set_restrict_to_fill_level},
+    { "gtk_range_get_show_fill_level",  cast(void**)& gtk_range_get_show_fill_level},
+    { "gtk_range_set_show_fill_level",  cast(void**)& gtk_range_set_show_fill_level},
+    { "gtk_range_get_value",  cast(void**)& gtk_range_get_value},
+    { "gtk_range_set_value",  cast(void**)& gtk_range_set_value},
+    { "gtk_range_set_range",  cast(void**)& gtk_range_set_range},
+    { "gtk_range_set_increments",  cast(void**)& gtk_range_set_increments},
+    { "gtk_range_get_upper_stepper_sensitivity",  cast(void**)& gtk_range_get_upper_stepper_sensitivity},
+    { "gtk_range_set_upper_stepper_sensitivity",  cast(void**)& gtk_range_set_upper_stepper_sensitivity},
+    { "gtk_range_get_lower_stepper_sensitivity",  cast(void**)& gtk_range_get_lower_stepper_sensitivity},
+    { "gtk_range_set_lower_stepper_sensitivity",  cast(void**)& gtk_range_set_lower_stepper_sensitivity},
+    { "gtk_range_get_inverted",  cast(void**)& gtk_range_get_inverted},
+    { "gtk_range_set_inverted",  cast(void**)& gtk_range_set_inverted},
+    { "gtk_range_get_adjustment",  cast(void**)& gtk_range_get_adjustment},
+    { "gtk_range_set_adjustment",  cast(void**)& gtk_range_set_adjustment},
+    { "gtk_range_get_update_policy",  cast(void**)& gtk_range_get_update_policy},
+    { "gtk_range_set_update_policy",  cast(void**)& gtk_range_set_update_policy},
+    { "gtk_range_get_type",  cast(void**)& gtk_range_get_type},
+//     { "_gtk_clipboard_store_all",  cast(void**)& _gtk_clipboard_store_all},
+//     { "_gtk_clipboard_handle_event",  cast(void**)& _gtk_clipboard_handle_event},
+    { "gtk_clipboard_store",  cast(void**)& gtk_clipboard_store},
+    { "gtk_clipboard_set_can_store",  cast(void**)& gtk_clipboard_set_can_store},
+    { "gtk_clipboard_wait_is_target_available",  cast(void**)& gtk_clipboard_wait_is_target_available},
+    { "gtk_clipboard_wait_is_image_available",  cast(void**)& gtk_clipboard_wait_is_image_available},
+    { "gtk_clipboard_wait_is_rich_text_available",  cast(void**)& gtk_clipboard_wait_is_rich_text_available},
+    { "gtk_clipboard_wait_is_text_available",  cast(void**)& gtk_clipboard_wait_is_text_available},
+    { "gtk_clipboard_wait_for_targets",  cast(void**)& gtk_clipboard_wait_for_targets},
+    { "gtk_clipboard_wait_for_image",  cast(void**)& gtk_clipboard_wait_for_image},
+    { "gtk_clipboard_wait_for_rich_text",  cast(void**)& gtk_clipboard_wait_for_rich_text},
+    { "gtk_clipboard_wait_for_text",  cast(void**)& gtk_clipboard_wait_for_text},
+    { "gtk_clipboard_wait_for_contents",  cast(void**)& gtk_clipboard_wait_for_contents},
+    { "gtk_clipboard_request_targets",  cast(void**)& gtk_clipboard_request_targets},
+    { "gtk_clipboard_request_image",  cast(void**)& gtk_clipboard_request_image},
+    { "gtk_clipboard_request_rich_text",  cast(void**)& gtk_clipboard_request_rich_text},
+    { "gtk_clipboard_request_text",  cast(void**)& gtk_clipboard_request_text},
+    { "gtk_clipboard_request_contents",  cast(void**)& gtk_clipboard_request_contents},
+    { "gtk_clipboard_set_image",  cast(void**)& gtk_clipboard_set_image},
+    { "gtk_clipboard_set_text",  cast(void**)& gtk_clipboard_set_text},
+    { "gtk_clipboard_clear",  cast(void**)& gtk_clipboard_clear},
+    { "gtk_clipboard_get_owner",  cast(void**)& gtk_clipboard_get_owner},
+    { "gtk_clipboard_set_with_owner",  cast(void**)& gtk_clipboard_set_with_owner},
+    { "gtk_clipboard_set_with_data",  cast(void**)& gtk_clipboard_set_with_data},
+    { "gtk_clipboard_get_display",  cast(void**)& gtk_clipboard_get_display},
+    { "gtk_clipboard_get",  cast(void**)& gtk_clipboard_get},
+    { "gtk_clipboard_get_for_display",  cast(void**)& gtk_clipboard_get_for_display},
+    { "gtk_clipboard_get_type",  cast(void**)& gtk_clipboard_get_type},
+    { "gtk_target_list_get_type",  cast(void**)& gtk_target_list_get_type},
+    { "gtk_selection_data_free",  cast(void**)& gtk_selection_data_free},
+    { "gtk_selection_data_copy",  cast(void**)& gtk_selection_data_copy},
+    { "gtk_selection_data_get_type",  cast(void**)& gtk_selection_data_get_type},
+//     { "_gtk_selection_property_notify",  cast(void**)& _gtk_selection_property_notify},
+//     { "_gtk_selection_notify",  cast(void**)& _gtk_selection_notify},
+//     { "_gtk_selection_incr_event",  cast(void**)& _gtk_selection_incr_event},
+//     { "_gtk_selection_request",  cast(void**)& _gtk_selection_request},
+    { "gtk_selection_clear",  cast(void**)& gtk_selection_clear},
+    { "gtk_selection_remove_all",  cast(void**)& gtk_selection_remove_all},
+    { "gtk_targets_include_uri",  cast(void**)& gtk_targets_include_uri},
+    { "gtk_targets_include_image",  cast(void**)& gtk_targets_include_image},
+    { "gtk_targets_include_rich_text",  cast(void**)& gtk_targets_include_rich_text},
+    { "gtk_targets_include_text",  cast(void**)& gtk_targets_include_text},
+    { "gtk_selection_data_targets_include_uri",  cast(void**)& gtk_selection_data_targets_include_uri},
+    { "gtk_selection_data_targets_include_image",  cast(void**)& gtk_selection_data_targets_include_image},
+    { "gtk_selection_data_targets_include_rich_text",  cast(void**)& gtk_selection_data_targets_include_rich_text},
+    { "gtk_selection_data_targets_include_text",  cast(void**)& gtk_selection_data_targets_include_text},
+    { "gtk_selection_data_get_targets",  cast(void**)& gtk_selection_data_get_targets},
+    { "gtk_selection_data_get_uris",  cast(void**)& gtk_selection_data_get_uris},
+    { "gtk_selection_data_set_uris",  cast(void**)& gtk_selection_data_set_uris},
+    { "gtk_selection_data_get_pixbuf",  cast(void**)& gtk_selection_data_get_pixbuf},
+    { "gtk_selection_data_set_pixbuf",  cast(void**)& gtk_selection_data_set_pixbuf},
+    { "gtk_selection_data_get_text",  cast(void**)& gtk_selection_data_get_text},
+    { "gtk_selection_data_set_text",  cast(void**)& gtk_selection_data_set_text},
+    { "gtk_selection_data_set",  cast(void**)& gtk_selection_data_set},
+    { "gtk_selection_convert",  cast(void**)& gtk_selection_convert},
+    { "gtk_selection_clear_targets",  cast(void**)& gtk_selection_clear_targets},
+    { "gtk_selection_add_targets",  cast(void**)& gtk_selection_add_targets},
+    { "gtk_selection_add_target",  cast(void**)& gtk_selection_add_target},
+    { "gtk_selection_owner_set_for_display",  cast(void**)& gtk_selection_owner_set_for_display},
+    { "gtk_selection_owner_set",  cast(void**)& gtk_selection_owner_set},
+    { "gtk_target_table_free",  cast(void**)& gtk_target_table_free},
+    { "gtk_target_table_new_from_list",  cast(void**)& gtk_target_table_new_from_list},
+    { "gtk_target_list_find",  cast(void**)& gtk_target_list_find},
+    { "gtk_target_list_remove",  cast(void**)& gtk_target_list_remove},
+    { "gtk_target_list_add_table",  cast(void**)& gtk_target_list_add_table},
+    { "gtk_target_list_add_uri_targets",  cast(void**)& gtk_target_list_add_uri_targets},
+    { "gtk_target_list_add_image_targets",  cast(void**)& gtk_target_list_add_image_targets},
+    { "gtk_target_list_add_rich_text_targets",  cast(void**)& gtk_target_list_add_rich_text_targets},
+    { "gtk_target_list_add_text_targets",  cast(void**)& gtk_target_list_add_text_targets},
+    { "gtk_target_list_add",  cast(void**)& gtk_target_list_add},
+    { "gtk_target_list_unref",  cast(void**)& gtk_target_list_unref},
+    { "gtk_target_list_ref",  cast(void**)& gtk_target_list_ref},
+    { "gtk_target_list_new",  cast(void**)& gtk_target_list_new},
+    { "gtk_text_iter_order",  cast(void**)& gtk_text_iter_order},
+    { "gtk_text_iter_in_range",  cast(void**)& gtk_text_iter_in_range},
+    { "gtk_text_iter_compare",  cast(void**)& gtk_text_iter_compare},
+    { "gtk_text_iter_equal",  cast(void**)& gtk_text_iter_equal},
+    { "gtk_text_iter_backward_search",  cast(void**)& gtk_text_iter_backward_search},
+    { "gtk_text_iter_forward_search",  cast(void**)& gtk_text_iter_forward_search},
+    { "gtk_text_iter_backward_find_char",  cast(void**)& gtk_text_iter_backward_find_char},
+    { "gtk_text_iter_forward_find_char",  cast(void**)& gtk_text_iter_forward_find_char},
+    { "gtk_text_iter_backward_to_tag_toggle",  cast(void**)& gtk_text_iter_backward_to_tag_toggle},
+    { "gtk_text_iter_forward_to_tag_toggle",  cast(void**)& gtk_text_iter_forward_to_tag_toggle},
+    { "gtk_text_iter_set_visible_line_index",  cast(void**)& gtk_text_iter_set_visible_line_index},
+    { "gtk_text_iter_set_visible_line_offset",  cast(void**)& gtk_text_iter_set_visible_line_offset},
+    { "gtk_text_iter_forward_to_line_end",  cast(void**)& gtk_text_iter_forward_to_line_end},
+    { "gtk_text_iter_forward_to_end",  cast(void**)& gtk_text_iter_forward_to_end},
+    { "gtk_text_iter_set_line_index",  cast(void**)& gtk_text_iter_set_line_index},
+    { "gtk_text_iter_set_line_offset",  cast(void**)& gtk_text_iter_set_line_offset},
+    { "gtk_text_iter_set_line",  cast(void**)& gtk_text_iter_set_line},
+    { "gtk_text_iter_set_offset",  cast(void**)& gtk_text_iter_set_offset},
+    { "gtk_text_iter_backward_visible_cursor_positions",  cast(void**)& gtk_text_iter_backward_visible_cursor_positions},
+    { "gtk_text_iter_forward_visible_cursor_positions",  cast(void**)& gtk_text_iter_forward_visible_cursor_positions},
+    { "gtk_text_iter_backward_visible_cursor_position",  cast(void**)& gtk_text_iter_backward_visible_cursor_position},
+    { "gtk_text_iter_forward_visible_cursor_position",  cast(void**)& gtk_text_iter_forward_visible_cursor_position},
+    { "gtk_text_iter_backward_cursor_positions",  cast(void**)& gtk_text_iter_backward_cursor_positions},
+    { "gtk_text_iter_forward_cursor_positions",  cast(void**)& gtk_text_iter_forward_cursor_positions},
+    { "gtk_text_iter_backward_cursor_position",  cast(void**)& gtk_text_iter_backward_cursor_position},
+    { "gtk_text_iter_forward_cursor_position",  cast(void**)& gtk_text_iter_forward_cursor_position},
+    { "gtk_text_iter_backward_sentence_starts",  cast(void**)& gtk_text_iter_backward_sentence_starts},
+    { "gtk_text_iter_forward_sentence_ends",  cast(void**)& gtk_text_iter_forward_sentence_ends},
+    { "gtk_text_iter_backward_sentence_start",  cast(void**)& gtk_text_iter_backward_sentence_start},
+    { "gtk_text_iter_forward_sentence_end",  cast(void**)& gtk_text_iter_forward_sentence_end},
+    { "gtk_text_iter_backward_visible_word_starts",  cast(void**)& gtk_text_iter_backward_visible_word_starts},
+    { "gtk_text_iter_forward_visible_word_ends",  cast(void**)& gtk_text_iter_forward_visible_word_ends},
+    { "gtk_text_iter_backward_visible_word_start",  cast(void**)& gtk_text_iter_backward_visible_word_start},
+    { "gtk_text_iter_forward_visible_word_end",  cast(void**)& gtk_text_iter_forward_visible_word_end},
+    { "gtk_text_iter_backward_visible_lines",  cast(void**)& gtk_text_iter_backward_visible_lines},
+    { "gtk_text_iter_forward_visible_lines",  cast(void**)& gtk_text_iter_forward_visible_lines},
+    { "gtk_text_iter_backward_visible_line",  cast(void**)& gtk_text_iter_backward_visible_line},
+    { "gtk_text_iter_forward_visible_line",  cast(void**)& gtk_text_iter_forward_visible_line},
+    { "gtk_text_iter_backward_word_starts",  cast(void**)& gtk_text_iter_backward_word_starts},
+    { "gtk_text_iter_forward_word_ends",  cast(void**)& gtk_text_iter_forward_word_ends},
+    { "gtk_text_iter_backward_word_start",  cast(void**)& gtk_text_iter_backward_word_start},
+    { "gtk_text_iter_forward_word_end",  cast(void**)& gtk_text_iter_forward_word_end},
+    { "gtk_text_iter_backward_lines",  cast(void**)& gtk_text_iter_backward_lines},
+    { "gtk_text_iter_forward_lines",  cast(void**)& gtk_text_iter_forward_lines},
+    { "gtk_text_iter_backward_line",  cast(void**)& gtk_text_iter_backward_line},
+    { "gtk_text_iter_forward_line",  cast(void**)& gtk_text_iter_forward_line},
+    { "gtk_text_iter_backward_chars",  cast(void**)& gtk_text_iter_backward_chars},
+    { "gtk_text_iter_forward_chars",  cast(void**)& gtk_text_iter_forward_chars},
+    { "gtk_text_iter_backward_char",  cast(void**)& gtk_text_iter_backward_char},
+    { "gtk_text_iter_forward_char",  cast(void**)& gtk_text_iter_forward_char},
+    { "gtk_text_iter_is_start",  cast(void**)& gtk_text_iter_is_start},
+    { "gtk_text_iter_is_end",  cast(void**)& gtk_text_iter_is_end},
+    { "gtk_text_iter_get_language",  cast(void**)& gtk_text_iter_get_language},
+    { "gtk_text_iter_get_attributes",  cast(void**)& gtk_text_iter_get_attributes},
+    { "gtk_text_iter_get_bytes_in_line",  cast(void**)& gtk_text_iter_get_bytes_in_line},
+    { "gtk_text_iter_get_chars_in_line",  cast(void**)& gtk_text_iter_get_chars_in_line},
+    { "gtk_text_iter_is_cursor_position",  cast(void**)& gtk_text_iter_is_cursor_position},
+    { "gtk_text_iter_ends_line",  cast(void**)& gtk_text_iter_ends_line},
+    { "gtk_text_iter_starts_line",  cast(void**)& gtk_text_iter_starts_line},
+    { "gtk_text_iter_inside_sentence",  cast(void**)& gtk_text_iter_inside_sentence},
+    { "gtk_text_iter_ends_sentence",  cast(void**)& gtk_text_iter_ends_sentence},
+    { "gtk_text_iter_starts_sentence",  cast(void**)& gtk_text_iter_starts_sentence},
+    { "gtk_text_iter_inside_word",  cast(void**)& gtk_text_iter_inside_word},
+    { "gtk_text_iter_ends_word",  cast(void**)& gtk_text_iter_ends_word},
+    { "gtk_text_iter_starts_word",  cast(void**)& gtk_text_iter_starts_word},
+    { "gtk_text_iter_can_insert",  cast(void**)& gtk_text_iter_can_insert},
+    { "gtk_text_iter_editable",  cast(void**)& gtk_text_iter_editable},
+    { "gtk_text_iter_get_tags",  cast(void**)& gtk_text_iter_get_tags},
+    { "gtk_text_iter_has_tag",  cast(void**)& gtk_text_iter_has_tag},
+    { "gtk_text_iter_toggles_tag",  cast(void**)& gtk_text_iter_toggles_tag},
+    { "gtk_text_iter_ends_tag",  cast(void**)& gtk_text_iter_ends_tag},
+    { "gtk_text_iter_begins_tag",  cast(void**)& gtk_text_iter_begins_tag},
+    { "gtk_text_iter_get_toggled_tags",  cast(void**)& gtk_text_iter_get_toggled_tags},
+    { "gtk_text_iter_get_child_anchor",  cast(void**)& gtk_text_iter_get_child_anchor},
+    { "gtk_text_iter_get_marks",  cast(void**)& gtk_text_iter_get_marks},
+    { "gtk_text_iter_get_pixbuf",  cast(void**)& gtk_text_iter_get_pixbuf},
+    { "gtk_text_iter_get_visible_text",  cast(void**)& gtk_text_iter_get_visible_text},
+    { "gtk_text_iter_get_visible_slice",  cast(void**)& gtk_text_iter_get_visible_slice},
+    { "gtk_text_iter_get_text",  cast(void**)& gtk_text_iter_get_text},
+    { "gtk_text_iter_get_slice",  cast(void**)& gtk_text_iter_get_slice},
+    { "gtk_text_iter_get_char",  cast(void**)& gtk_text_iter_get_char},
+    { "gtk_text_iter_get_visible_line_index",  cast(void**)& gtk_text_iter_get_visible_line_index},
+    { "gtk_text_iter_get_visible_line_offset",  cast(void**)& gtk_text_iter_get_visible_line_offset},
+    { "gtk_text_iter_get_line_index",  cast(void**)& gtk_text_iter_get_line_index},
+    { "gtk_text_iter_get_line_offset",  cast(void**)& gtk_text_iter_get_line_offset},
+    { "gtk_text_iter_get_line",  cast(void**)& gtk_text_iter_get_line},
+    { "gtk_text_iter_get_offset",  cast(void**)& gtk_text_iter_get_offset},
+    { "gtk_text_iter_get_type",  cast(void**)& gtk_text_iter_get_type},
+    { "gtk_text_iter_free",  cast(void**)& gtk_text_iter_free},
+    { "gtk_text_iter_copy",  cast(void**)& gtk_text_iter_copy},
+    { "gtk_text_iter_get_buffer",  cast(void**)& gtk_text_iter_get_buffer},
+    { "gtk_text_child_anchor_get_deleted",  cast(void**)& gtk_text_child_anchor_get_deleted},
+    { "gtk_text_child_anchor_get_widgets",  cast(void**)& gtk_text_child_anchor_get_widgets},
+    { "gtk_text_child_anchor_new",  cast(void**)& gtk_text_child_anchor_new},
+    { "gtk_text_child_anchor_get_type",  cast(void**)& gtk_text_child_anchor_get_type},
+    { "gtk_text_attributes_get_type",  cast(void**)& gtk_text_attributes_get_type},
+    { "gtk_text_attributes_ref",  cast(void**)& gtk_text_attributes_ref},
+    { "gtk_text_attributes_unref",  cast(void**)& gtk_text_attributes_unref},
+    { "gtk_text_attributes_copy_values",  cast(void**)& gtk_text_attributes_copy_values},
+    { "gtk_text_attributes_copy",  cast(void**)& gtk_text_attributes_copy},
+    { "gtk_text_attributes_new",  cast(void**)& gtk_text_attributes_new},
+    { "gtk_text_tag_event",  cast(void**)& gtk_text_tag_event},
+    { "gtk_text_tag_set_priority",  cast(void**)& gtk_text_tag_set_priority},
+    { "gtk_text_tag_get_priority",  cast(void**)& gtk_text_tag_get_priority},
+    { "gtk_text_tag_new",  cast(void**)& gtk_text_tag_new},
+    { "gtk_text_tag_get_type",  cast(void**)& gtk_text_tag_get_type},
+    { "gtk_check_menu_item_set_show_toggle",  cast(void**)& gtk_check_menu_item_set_show_toggle},
+    { "gtk_check_menu_item_get_draw_as_radio",  cast(void**)& gtk_check_menu_item_get_draw_as_radio},
+    { "gtk_check_menu_item_set_draw_as_radio",  cast(void**)& gtk_check_menu_item_set_draw_as_radio},
+    { "gtk_check_menu_item_get_inconsistent",  cast(void**)& gtk_check_menu_item_get_inconsistent},
+    { "gtk_check_menu_item_set_inconsistent",  cast(void**)& gtk_check_menu_item_set_inconsistent},
+    { "gtk_check_menu_item_toggled",  cast(void**)& gtk_check_menu_item_toggled},
+    { "gtk_check_menu_item_get_active",  cast(void**)& gtk_check_menu_item_get_active},
+    { "gtk_check_menu_item_set_active",  cast(void**)& gtk_check_menu_item_set_active},
+    { "gtk_check_menu_item_new_with_mnemonic",  cast(void**)& gtk_check_menu_item_new_with_mnemonic},
+    { "gtk_check_menu_item_new_with_label",  cast(void**)& gtk_check_menu_item_new_with_label},
+    { "gtk_check_menu_item_new",  cast(void**)& gtk_check_menu_item_new},
+    { "gtk_check_menu_item_get_type",  cast(void**)& gtk_check_menu_item_get_type},
+    { "gtk_menu_item_remove_submenu",  cast(void**)& gtk_menu_item_remove_submenu},
+//     { "_gtk_menu_item_popdown_submenu",  cast(void**)& _gtk_menu_item_popdown_submenu},
+//     { "_gtk_menu_item_popup_submenu",  cast(void**)& _gtk_menu_item_popup_submenu},
+//     { "_gtk_menu_item_is_selectable",  cast(void**)& _gtk_menu_item_is_selectable},
+//     { "_gtk_menu_item_refresh_accel_path",  cast(void**)& _gtk_menu_item_refresh_accel_path},
+    { "gtk_menu_item_set_accel_path",  cast(void**)& gtk_menu_item_set_accel_path},
+    { "gtk_menu_item_get_right_justified",  cast(void**)& gtk_menu_item_get_right_justified},
+    { "gtk_menu_item_set_right_justified",  cast(void**)& gtk_menu_item_set_right_justified},
+    { "gtk_menu_item_toggle_size_allocate",  cast(void**)& gtk_menu_item_toggle_size_allocate},
+    { "gtk_menu_item_toggle_size_request",  cast(void**)& gtk_menu_item_toggle_size_request},
+    { "gtk_menu_item_activate",  cast(void**)& gtk_menu_item_activate},
+    { "gtk_menu_item_deselect",  cast(void**)& gtk_menu_item_deselect},
+    { "gtk_menu_item_select",  cast(void**)& gtk_menu_item_select},
+    { "gtk_menu_item_get_submenu",  cast(void**)& gtk_menu_item_get_submenu},
+    { "gtk_menu_item_set_submenu",  cast(void**)& gtk_menu_item_set_submenu},
+    { "gtk_menu_item_new_with_mnemonic",  cast(void**)& gtk_menu_item_new_with_mnemonic},
+    { "gtk_menu_item_new_with_label",  cast(void**)& gtk_menu_item_new_with_label},
+    { "gtk_menu_item_new",  cast(void**)& gtk_menu_item_new},
+    { "gtk_menu_item_get_type",  cast(void**)& gtk_menu_item_get_type},
+    { "gtk_item_toggle",  cast(void**)& gtk_item_toggle},
+    { "gtk_item_deselect",  cast(void**)& gtk_item_deselect},
+    { "gtk_item_select",  cast(void**)& gtk_item_select},
+    { "gtk_item_get_type",  cast(void**)& gtk_item_get_type},
+//     { "_gtk_check_button_get_props",  cast(void**)& _gtk_check_button_get_props},
+    { "gtk_check_button_new_with_mnemonic",  cast(void**)& gtk_check_button_new_with_mnemonic},
+    { "gtk_check_button_new_with_label",  cast(void**)& gtk_check_button_new_with_label},
+    { "gtk_check_button_new",  cast(void**)& gtk_check_button_new},
+    { "gtk_check_button_get_type",  cast(void**)& gtk_check_button_get_type},
+    { "gtk_toggle_button_get_inconsistent",  cast(void**)& gtk_toggle_button_get_inconsistent},
+    { "gtk_toggle_button_set_inconsistent",  cast(void**)& gtk_toggle_button_set_inconsistent},
+    { "gtk_toggle_button_toggled",  cast(void**)& gtk_toggle_button_toggled},
+    { "gtk_toggle_button_get_active",  cast(void**)& gtk_toggle_button_get_active},
+    { "gtk_toggle_button_set_active",  cast(void**)& gtk_toggle_button_set_active},
+    { "gtk_toggle_button_get_mode",  cast(void**)& gtk_toggle_button_get_mode},
+    { "gtk_toggle_button_set_mode",  cast(void**)& gtk_toggle_button_set_mode},
+    { "gtk_toggle_button_new_with_mnemonic",  cast(void**)& gtk_toggle_button_new_with_mnemonic},
+    { "gtk_toggle_button_new_with_label",  cast(void**)& gtk_toggle_button_new_with_label},
+    { "gtk_toggle_button_new",  cast(void**)& gtk_toggle_button_new},
+    { "gtk_toggle_button_get_type",  cast(void**)& gtk_toggle_button_get_type},
+    { "gtk_cell_view_get_cell_renderers",  cast(void**)& gtk_cell_view_get_cell_renderers},
+    { "gtk_cell_view_set_background_color",  cast(void**)& gtk_cell_view_set_background_color},
+    { "gtk_cell_view_get_size_of_row",  cast(void**)& gtk_cell_view_get_size_of_row},
+    { "gtk_cell_view_get_displayed_row",  cast(void**)& gtk_cell_view_get_displayed_row},
+    { "gtk_cell_view_set_displayed_row",  cast(void**)& gtk_cell_view_set_displayed_row},
+    { "gtk_cell_view_set_model",  cast(void**)& gtk_cell_view_set_model},
+    { "gtk_cell_view_new_with_pixbuf",  cast(void**)& gtk_cell_view_new_with_pixbuf},
+    { "gtk_cell_view_new_with_markup",  cast(void**)& gtk_cell_view_new_with_markup},
+    { "gtk_cell_view_new_with_text",  cast(void**)& gtk_cell_view_new_with_text},
+    { "gtk_cell_view_new",  cast(void**)& gtk_cell_view_new},
+    { "gtk_cell_view_get_type",  cast(void**)& gtk_cell_view_get_type},
+    { "gtk_cell_renderer_toggle_set_active",  cast(void**)& gtk_cell_renderer_toggle_set_active},
+    { "gtk_cell_renderer_toggle_get_active",  cast(void**)& gtk_cell_renderer_toggle_get_active},
+    { "gtk_cell_renderer_toggle_set_radio",  cast(void**)& gtk_cell_renderer_toggle_set_radio},
+    { "gtk_cell_renderer_toggle_get_radio",  cast(void**)& gtk_cell_renderer_toggle_get_radio},
+    { "gtk_cell_renderer_toggle_new",  cast(void**)& gtk_cell_renderer_toggle_new},
+    { "gtk_cell_renderer_toggle_get_type",  cast(void**)& gtk_cell_renderer_toggle_get_type},
+    { "gtk_cell_renderer_spin_new",  cast(void**)& gtk_cell_renderer_spin_new},
+    { "gtk_cell_renderer_spin_get_type",  cast(void**)& gtk_cell_renderer_spin_get_type},
+    { "gtk_cell_renderer_progress_new",  cast(void**)& gtk_cell_renderer_progress_new},
+    { "gtk_cell_renderer_progress_get_type",  cast(void**)& gtk_cell_renderer_progress_get_type},
+    { "gtk_cell_renderer_pixbuf_new",  cast(void**)& gtk_cell_renderer_pixbuf_new},
+    { "gtk_cell_renderer_pixbuf_get_type",  cast(void**)& gtk_cell_renderer_pixbuf_get_type},
+    { "gtk_cell_renderer_combo_new",  cast(void**)& gtk_cell_renderer_combo_new},
+    { "gtk_cell_renderer_combo_get_type",  cast(void**)& gtk_cell_renderer_combo_get_type},
+    { "gtk_cell_renderer_accel_new",  cast(void**)& gtk_cell_renderer_accel_new},
+    { "gtk_cell_renderer_accel_get_type",  cast(void**)& gtk_cell_renderer_accel_get_type},
+    { "gtk_cell_renderer_text_set_fixed_height_from_font",  cast(void**)& gtk_cell_renderer_text_set_fixed_height_from_font},
+    { "gtk_cell_renderer_text_new",  cast(void**)& gtk_cell_renderer_text_new},
+    { "gtk_cell_renderer_text_get_type",  cast(void**)& gtk_cell_renderer_text_get_type},
+//     { "_gtk_cell_layout_buildable_add_child",  cast(void**)& _gtk_cell_layout_buildable_add_child},
+//     { "_gtk_cell_layout_buildable_custom_tag_end",  cast(void**)& _gtk_cell_layout_buildable_custom_tag_end},
+//     { "_gtk_cell_layout_buildable_custom_tag_start",  cast(void**)& _gtk_cell_layout_buildable_custom_tag_start},
+    { "gtk_cell_layout_reorder",  cast(void**)& gtk_cell_layout_reorder},
+    { "gtk_cell_layout_clear_attributes",  cast(void**)& gtk_cell_layout_clear_attributes},
+    { "gtk_cell_layout_set_cell_data_func",  cast(void**)& gtk_cell_layout_set_cell_data_func},
+    { "gtk_cell_layout_add_attribute",  cast(void**)& gtk_cell_layout_add_attribute},
+    { "gtk_cell_layout_set_attributes",  cast(void**)& gtk_cell_layout_set_attributes},
+    { "gtk_cell_layout_clear",  cast(void**)& gtk_cell_layout_clear},
+    { "gtk_cell_layout_get_cells",  cast(void**)& gtk_cell_layout_get_cells},
+    { "gtk_cell_layout_pack_end",  cast(void**)& gtk_cell_layout_pack_end},
+    { "gtk_cell_layout_pack_start",  cast(void**)& gtk_cell_layout_pack_start},
+    { "gtk_cell_layout_get_type",  cast(void**)& gtk_cell_layout_get_type},
+    { "gtk_tree_view_column_get_tree_view",  cast(void**)& gtk_tree_view_column_get_tree_view},
+    { "gtk_tree_view_column_queue_resize",  cast(void**)& gtk_tree_view_column_queue_resize},
+    { "gtk_tree_view_column_cell_get_position",  cast(void**)& gtk_tree_view_column_cell_get_position},
+    { "gtk_tree_view_column_focus_cell",  cast(void**)& gtk_tree_view_column_focus_cell},
+    { "gtk_tree_view_column_cell_is_visible",  cast(void**)& gtk_tree_view_column_cell_is_visible},
+    { "gtk_tree_view_column_cell_get_size",  cast(void**)& gtk_tree_view_column_cell_get_size},
+    { "gtk_tree_view_column_cell_set_cell_data",  cast(void**)& gtk_tree_view_column_cell_set_cell_data},
+    { "gtk_tree_view_column_get_sort_order",  cast(void**)& gtk_tree_view_column_get_sort_order},
+    { "gtk_tree_view_column_set_sort_order",  cast(void**)& gtk_tree_view_column_set_sort_order},
+    { "gtk_tree_view_column_get_sort_indicator",  cast(void**)& gtk_tree_view_column_get_sort_indicator},
+    { "gtk_tree_view_column_set_sort_indicator",  cast(void**)& gtk_tree_view_column_set_sort_indicator},
+    { "gtk_tree_view_column_get_sort_column_id",  cast(void**)& gtk_tree_view_column_get_sort_column_id},
+    { "gtk_tree_view_column_set_sort_column_id",  cast(void**)& gtk_tree_view_column_set_sort_column_id},
+    { "gtk_tree_view_column_get_reorderable",  cast(void**)& gtk_tree_view_column_get_reorderable},
+    { "gtk_tree_view_column_set_reorderable",  cast(void**)& gtk_tree_view_column_set_reorderable},
+    { "gtk_tree_view_column_get_alignment",  cast(void**)& gtk_tree_view_column_get_alignment},
+    { "gtk_tree_view_column_set_alignment",  cast(void**)& gtk_tree_view_column_set_alignment},
+    { "gtk_tree_view_column_get_widget",  cast(void**)& gtk_tree_view_column_get_widget},
+    { "gtk_tree_view_column_set_widget",  cast(void**)& gtk_tree_view_column_set_widget},
+    { "gtk_tree_view_column_get_clickable",  cast(void**)& gtk_tree_view_column_get_clickable},
+    { "gtk_tree_view_column_set_clickable",  cast(void**)& gtk_tree_view_column_set_clickable},
+    { "gtk_tree_view_column_get_expand",  cast(void**)& gtk_tree_view_column_get_expand},
+    { "gtk_tree_view_column_set_expand",  cast(void**)& gtk_tree_view_column_set_expand},
+    { "gtk_tree_view_column_get_title",  cast(void**)& gtk_tree_view_column_get_title},
+    { "gtk_tree_view_column_set_title",  cast(void**)& gtk_tree_view_column_set_title},
+    { "gtk_tree_view_column_clicked",  cast(void**)& gtk_tree_view_column_clicked},
+    { "gtk_tree_view_column_get_max_width",  cast(void**)& gtk_tree_view_column_get_max_width},
+    { "gtk_tree_view_column_set_max_width",  cast(void**)& gtk_tree_view_column_set_max_width},
+    { "gtk_tree_view_column_get_min_width",  cast(void**)& gtk_tree_view_column_get_min_width},
+    { "gtk_tree_view_column_set_min_width",  cast(void**)& gtk_tree_view_column_set_min_width},
+    { "gtk_tree_view_column_set_fixed_width",  cast(void**)& gtk_tree_view_column_set_fixed_width},
+    { "gtk_tree_view_column_get_fixed_width",  cast(void**)& gtk_tree_view_column_get_fixed_width},
+    { "gtk_tree_view_column_get_width",  cast(void**)& gtk_tree_view_column_get_width},
+    { "gtk_tree_view_column_get_sizing",  cast(void**)& gtk_tree_view_column_get_sizing},
+    { "gtk_tree_view_column_set_sizing",  cast(void**)& gtk_tree_view_column_set_sizing},
+    { "gtk_tree_view_column_get_resizable",  cast(void**)& gtk_tree_view_column_get_resizable},
+    { "gtk_tree_view_column_set_resizable",  cast(void**)& gtk_tree_view_column_set_resizable},
+    { "gtk_tree_view_column_get_visible",  cast(void**)& gtk_tree_view_column_get_visible},
+    { "gtk_tree_view_column_set_visible",  cast(void**)& gtk_tree_view_column_set_visible},
+    { "gtk_tree_view_column_get_spacing",  cast(void**)& gtk_tree_view_column_get_spacing},
+    { "gtk_tree_view_column_set_spacing",  cast(void**)& gtk_tree_view_column_set_spacing},
+    { "gtk_tree_view_column_clear_attributes",  cast(void**)& gtk_tree_view_column_clear_attributes},
+    { "gtk_tree_view_column_set_cell_data_func",  cast(void**)& gtk_tree_view_column_set_cell_data_func},
+    { "gtk_tree_view_column_set_attributes",  cast(void**)& gtk_tree_view_column_set_attributes},
+    { "gtk_tree_view_column_add_attribute",  cast(void**)& gtk_tree_view_column_add_attribute},
+    { "gtk_tree_view_column_get_cell_renderers",  cast(void**)& gtk_tree_view_column_get_cell_renderers},
+    { "gtk_tree_view_column_clear",  cast(void**)& gtk_tree_view_column_clear},
+    { "gtk_tree_view_column_pack_end",  cast(void**)& gtk_tree_view_column_pack_end},
+    { "gtk_tree_view_column_pack_start",  cast(void**)& gtk_tree_view_column_pack_start},
+    { "gtk_tree_view_column_new_with_attributes",  cast(void**)& gtk_tree_view_column_new_with_attributes},
+    { "gtk_tree_view_column_new",  cast(void**)& gtk_tree_view_column_new},
+    { "gtk_tree_view_column_get_type",  cast(void**)& gtk_tree_view_column_get_type},
+    { "gtk_tree_sortable_has_default_sort_func",  cast(void**)& gtk_tree_sortable_has_default_sort_func},
+    { "gtk_tree_sortable_set_default_sort_func",  cast(void**)& gtk_tree_sortable_set_default_sort_func},
+    { "gtk_tree_sortable_set_sort_func",  cast(void**)& gtk_tree_sortable_set_sort_func},
+    { "gtk_tree_sortable_set_sort_column_id",  cast(void**)& gtk_tree_sortable_set_sort_column_id},
+    { "gtk_tree_sortable_get_sort_column_id",  cast(void**)& gtk_tree_sortable_get_sort_column_id},
+    { "gtk_tree_sortable_sort_column_changed",  cast(void**)& gtk_tree_sortable_sort_column_changed},
+    { "gtk_tree_sortable_get_type",  cast(void**)& gtk_tree_sortable_get_type},
+    { "gtk_tree_model_rows_reordered",  cast(void**)& gtk_tree_model_rows_reordered},
+    { "gtk_tree_model_row_deleted",  cast(void**)& gtk_tree_model_row_deleted},
+    { "gtk_tree_model_row_has_child_toggled",  cast(void**)& gtk_tree_model_row_has_child_toggled},
+    { "gtk_tree_model_row_inserted",  cast(void**)& gtk_tree_model_row_inserted},
+    { "gtk_tree_model_row_changed",  cast(void**)& gtk_tree_model_row_changed},
+    { "gtk_tree_model_foreach",  cast(void**)& gtk_tree_model_foreach},
+    { "gtk_tree_model_get_valist",  cast(void**)& gtk_tree_model_get_valist},
+    { "gtk_tree_model_get",  cast(void**)& gtk_tree_model_get},
+    { "gtk_tree_model_unref_node",  cast(void**)& gtk_tree_model_unref_node},
+    { "gtk_tree_model_ref_node",  cast(void**)& gtk_tree_model_ref_node},
+    { "gtk_tree_model_iter_parent",  cast(void**)& gtk_tree_model_iter_parent},
+    { "gtk_tree_model_iter_nth_child",  cast(void**)& gtk_tree_model_iter_nth_child},
+    { "gtk_tree_model_iter_n_children",  cast(void**)& gtk_tree_model_iter_n_children},
+    { "gtk_tree_model_iter_has_child",  cast(void**)& gtk_tree_model_iter_has_child},
+    { "gtk_tree_model_iter_children",  cast(void**)& gtk_tree_model_iter_children},
+    { "gtk_tree_model_iter_next",  cast(void**)& gtk_tree_model_iter_next},
+    { "gtk_tree_model_get_value",  cast(void**)& gtk_tree_model_get_value},
+    { "gtk_tree_model_get_path",  cast(void**)& gtk_tree_model_get_path},
+    { "gtk_tree_model_get_iter_first",  cast(void**)& gtk_tree_model_get_iter_first},
+    { "gtk_tree_model_get_string_from_iter",  cast(void**)& gtk_tree_model_get_string_from_iter},
+    { "gtk_tree_model_get_iter_from_string",  cast(void**)& gtk_tree_model_get_iter_from_string},
+    { "gtk_tree_model_get_iter",  cast(void**)& gtk_tree_model_get_iter},
+    { "gtk_tree_model_get_column_type",  cast(void**)& gtk_tree_model_get_column_type},
+    { "gtk_tree_model_get_n_columns",  cast(void**)& gtk_tree_model_get_n_columns},
+    { "gtk_tree_model_get_flags",  cast(void**)& gtk_tree_model_get_flags},
+    { "gtk_tree_model_get_type",  cast(void**)& gtk_tree_model_get_type},
+    { "gtk_tree_iter_get_type",  cast(void**)& gtk_tree_iter_get_type},
+    { "gtk_tree_iter_free",  cast(void**)& gtk_tree_iter_free},
+    { "gtk_tree_iter_copy",  cast(void**)& gtk_tree_iter_copy},
+    { "gtk_tree_row_reference_reordered",  cast(void**)& gtk_tree_row_reference_reordered},
+    { "gtk_tree_row_reference_deleted",  cast(void**)& gtk_tree_row_reference_deleted},
+    { "gtk_tree_row_reference_inserted",  cast(void**)& gtk_tree_row_reference_inserted},
+    { "gtk_tree_row_reference_free",  cast(void**)& gtk_tree_row_reference_free},
+    { "gtk_tree_row_reference_copy",  cast(void**)& gtk_tree_row_reference_copy},
+    { "gtk_tree_row_reference_valid",  cast(void**)& gtk_tree_row_reference_valid},
+    { "gtk_tree_row_reference_get_model",  cast(void**)& gtk_tree_row_reference_get_model},
+    { "gtk_tree_row_reference_get_path",  cast(void**)& gtk_tree_row_reference_get_path},
+    { "gtk_tree_row_reference_new_proxy",  cast(void**)& gtk_tree_row_reference_new_proxy},
+    { "gtk_tree_row_reference_new",  cast(void**)& gtk_tree_row_reference_new},
+    { "gtk_tree_row_reference_get_type",  cast(void**)& gtk_tree_row_reference_get_type},
+    { "gtk_tree_path_is_descendant",  cast(void**)& gtk_tree_path_is_descendant},
+    { "gtk_tree_path_is_ancestor",  cast(void**)& gtk_tree_path_is_ancestor},
+    { "gtk_tree_path_down",  cast(void**)& gtk_tree_path_down},
+    { "gtk_tree_path_up",  cast(void**)& gtk_tree_path_up},
+    { "gtk_tree_path_prev",  cast(void**)& gtk_tree_path_prev},
+    { "gtk_tree_path_next",  cast(void**)& gtk_tree_path_next},
+    { "gtk_tree_path_compare",  cast(void**)& gtk_tree_path_compare},
+    { "gtk_tree_path_get_type",  cast(void**)& gtk_tree_path_get_type},
+    { "gtk_tree_path_copy",  cast(void**)& gtk_tree_path_copy},
+    { "gtk_tree_path_free",  cast(void**)& gtk_tree_path_free},
+    { "gtk_tree_path_get_indices",  cast(void**)& gtk_tree_path_get_indices},
+    { "gtk_tree_path_get_depth",  cast(void**)& gtk_tree_path_get_depth},
+    { "gtk_tree_path_prepend_index",  cast(void**)& gtk_tree_path_prepend_index},
+    { "gtk_tree_path_append_index",  cast(void**)& gtk_tree_path_append_index},
+    { "gtk_tree_path_new_first",  cast(void**)& gtk_tree_path_new_first},
+    { "gtk_tree_path_to_string",  cast(void**)& gtk_tree_path_to_string},
+    { "gtk_tree_path_new_from_indices",  cast(void**)& gtk_tree_path_new_from_indices},
+    { "gtk_tree_path_new_from_string",  cast(void**)& gtk_tree_path_new_from_string},
+    { "gtk_tree_path_new",  cast(void**)& gtk_tree_path_new},
+    { "gtk_cell_renderer_stop_editing",  cast(void**)& gtk_cell_renderer_stop_editing},
+    { "gtk_cell_renderer_editing_canceled",  cast(void**)& gtk_cell_renderer_editing_canceled},
+    { "gtk_cell_renderer_get_fixed_size",  cast(void**)& gtk_cell_renderer_get_fixed_size},
+    { "gtk_cell_renderer_set_fixed_size",  cast(void**)& gtk_cell_renderer_set_fixed_size},
+    { "gtk_cell_renderer_start_editing",  cast(void**)& gtk_cell_renderer_start_editing},
+    { "gtk_cell_renderer_activate",  cast(void**)& gtk_cell_renderer_activate},
+    { "gtk_cell_renderer_render",  cast(void**)& gtk_cell_renderer_render},
+    { "gtk_cell_renderer_get_size",  cast(void**)& gtk_cell_renderer_get_size},
+    { "gtk_cell_renderer_get_type",  cast(void**)& gtk_cell_renderer_get_type},
+    { "gtk_cell_editable_remove_widget",  cast(void**)& gtk_cell_editable_remove_widget},
+    { "gtk_cell_editable_editing_done",  cast(void**)& gtk_cell_editable_editing_done},
+    { "gtk_cell_editable_start_editing",  cast(void**)& gtk_cell_editable_start_editing},
+    { "gtk_cell_editable_get_type",  cast(void**)& gtk_cell_editable_get_type},
+    { "gtk_calendar_thaw",  cast(void**)& gtk_calendar_thaw},
+    { "gtk_calendar_freeze",  cast(void**)& gtk_calendar_freeze},
+    { "gtk_calendar_get_date",  cast(void**)& gtk_calendar_get_date},
+    { "gtk_calendar_display_options",  cast(void**)& gtk_calendar_display_options},
+    { "gtk_calendar_get_display_options",  cast(void**)& gtk_calendar_get_display_options},
+    { "gtk_calendar_set_display_options",  cast(void**)& gtk_calendar_set_display_options},
+    { "gtk_calendar_clear_marks",  cast(void**)& gtk_calendar_clear_marks},
+    { "gtk_calendar_unmark_day",  cast(void**)& gtk_calendar_unmark_day},
+    { "gtk_calendar_mark_day",  cast(void**)& gtk_calendar_mark_day},
+    { "gtk_calendar_select_day",  cast(void**)& gtk_calendar_select_day},
+    { "gtk_calendar_select_month",  cast(void**)& gtk_calendar_select_month},
+    { "gtk_calendar_new",  cast(void**)& gtk_calendar_new},
+    { "gtk_calendar_get_type",  cast(void**)& gtk_calendar_get_type},
+    { "gtk_signal_compat_matched",  cast(void**)& gtk_signal_compat_matched},
+    { "gtk_signal_emitv_by_name",  cast(void**)& gtk_signal_emitv_by_name},
+    { "gtk_signal_emit_by_name",  cast(void**)& gtk_signal_emit_by_name},
+    { "gtk_signal_emit",  cast(void**)& gtk_signal_emit},
+    { "gtk_signal_emitv",  cast(void**)& gtk_signal_emitv},
+    { "gtk_signal_connect_full",  cast(void**)& gtk_signal_connect_full},
+    { "gtk_signal_connect_while_alive",  cast(void**)& gtk_signal_connect_while_alive},
+    { "gtk_signal_connect_object_while_alive",  cast(void**)& gtk_signal_connect_object_while_alive},
+    { "gtk_signal_emit_stop_by_name",  cast(void**)& gtk_signal_emit_stop_by_name},
+    { "gtk_signal_new",  cast(void**)& gtk_signal_new},
+    { "gtk_signal_newv",  cast(void**)& gtk_signal_newv},
+    { "gtk_marshal_VOID__UINT_STRING",  cast(void**)& gtk_marshal_VOID__UINT_STRING},
+    { "gtk_marshal_VOID__UINT_POINTER_UINT_UINT_ENUM",  cast(void**)& gtk_marshal_VOID__UINT_POINTER_UINT_UINT_ENUM},
+    { "gtk_marshal_VOID__UINT_POINTER_UINT_ENUM_ENUM_POINTER",  cast(void**)& gtk_marshal_VOID__UINT_POINTER_UINT_ENUM_ENUM_POINTER},
+    { "gtk_marshal_VOID__STRING_INT_POINTER",  cast(void**)& gtk_marshal_VOID__STRING_INT_POINTER},
+    { "gtk_marshal_VOID__POINTER_UINT_UINT",  cast(void**)& gtk_marshal_VOID__POINTER_UINT_UINT},
+    { "gtk_marshal_VOID__POINTER_INT_INT_POINTER_UINT_UINT",  cast(void**)& gtk_marshal_VOID__POINTER_INT_INT_POINTER_UINT_UINT},
+    { "gtk_marshal_VOID__POINTER_POINTER_UINT_UINT",  cast(void**)& gtk_marshal_VOID__POINTER_POINTER_UINT_UINT},
+    { "gtk_marshal_VOID__POINTER_UINT_ENUM",  cast(void**)& gtk_marshal_VOID__POINTER_UINT_ENUM},
+    { "gtk_marshal_VOID__POINTER_UINT",  cast(void**)& gtk_marshal_VOID__POINTER_UINT},
+    { "gtk_marshal_VOID__POINTER_STRING_STRING",  cast(void**)& gtk_marshal_VOID__POINTER_STRING_STRING},
+    { "gtk_marshal_VOID__POINTER_POINTER_POINTER",  cast(void**)& gtk_marshal_VOID__POINTER_POINTER_POINTER},
+    { "gtk_marshal_VOID__POINTER_POINTER",  cast(void**)& gtk_marshal_VOID__POINTER_POINTER},
+    { "gtk_marshal_VOID__POINTER_INT",  cast(void**)& gtk_marshal_VOID__POINTER_INT},
+    { "gtk_marshal_VOID__INT_INT_POINTER",  cast(void**)& gtk_marshal_VOID__INT_INT_POINTER},
+    { "gtk_marshal_VOID__INT_INT",  cast(void**)& gtk_marshal_VOID__INT_INT},
+    { "gtk_marshal_VOID__ENUM_FLOAT_BOOLEAN",  cast(void**)& gtk_marshal_VOID__ENUM_FLOAT_BOOLEAN},
+    { "gtk_marshal_VOID__ENUM_FLOAT",  cast(void**)& gtk_marshal_VOID__ENUM_FLOAT},
+    { "gtk_marshal_INT__POINTER_CHAR_CHAR",  cast(void**)& gtk_marshal_INT__POINTER_CHAR_CHAR},
+    { "gtk_marshal_INT__POINTER",  cast(void**)& gtk_marshal_INT__POINTER},
+    { "gtk_marshal_ENUM__ENUM",  cast(void**)& gtk_marshal_ENUM__ENUM},
+    { "gtk_marshal_BOOLEAN__POINTER_STRING_STRING_POINTER",  cast(void**)& gtk_marshal_BOOLEAN__POINTER_STRING_STRING_POINTER},
+    { "gtk_marshal_BOOLEAN__POINTER_INT_INT_UINT",  cast(void**)& gtk_marshal_BOOLEAN__POINTER_INT_INT_UINT},
+    { "gtk_marshal_BOOLEAN__POINTER_INT_INT",  cast(void**)& gtk_marshal_BOOLEAN__POINTER_INT_INT},
+    { "gtk_marshal_BOOLEAN__POINTER_POINTER_INT_INT",  cast(void**)& gtk_marshal_BOOLEAN__POINTER_POINTER_INT_INT},
+    { "gtk_marshal_BOOLEAN__POINTER",  cast(void**)& gtk_marshal_BOOLEAN__POINTER},
+    { "gtk_marshal_BOOLEAN__VOID",  cast(void**)& gtk_marshal_BOOLEAN__VOID},
+//     { "_gtk_button_paint",  cast(void**)& _gtk_button_paint},
+//     { "_gtk_button_set_depressed",  cast(void**)& _gtk_button_set_depressed},
+    { "gtk_button_get_image_position",  cast(void**)& gtk_button_get_image_position},
+    { "gtk_button_set_image_position",  cast(void**)& gtk_button_set_image_position},
+    { "gtk_button_get_image",  cast(void**)& gtk_button_get_image},
+    { "gtk_button_set_image",  cast(void**)& gtk_button_set_image},
+    { "gtk_button_get_alignment",  cast(void**)& gtk_button_get_alignment},
+    { "gtk_button_set_alignment",  cast(void**)& gtk_button_set_alignment},
+    { "gtk_button_get_focus_on_click",  cast(void**)& gtk_button_get_focus_on_click},
+    { "gtk_button_set_focus_on_click",  cast(void**)& gtk_button_set_focus_on_click},
+    { "gtk_button_get_use_stock",  cast(void**)& gtk_button_get_use_stock},
+    { "gtk_button_set_use_stock",  cast(void**)& gtk_button_set_use_stock},
+    { "gtk_button_get_use_underline",  cast(void**)& gtk_button_get_use_underline},
+    { "gtk_button_set_use_underline",  cast(void**)& gtk_button_set_use_underline},
+    { "gtk_button_get_label",  cast(void**)& gtk_button_get_label},
+    { "gtk_button_set_label",  cast(void**)& gtk_button_set_label},
+    { "gtk_button_get_relief",  cast(void**)& gtk_button_get_relief},
+    { "gtk_button_set_relief",  cast(void**)& gtk_button_set_relief},
+    { "gtk_button_leave",  cast(void**)& gtk_button_leave},
+    { "gtk_button_enter",  cast(void**)& gtk_button_enter},
+    { "gtk_button_clicked",  cast(void**)& gtk_button_clicked},
+    { "gtk_button_released",  cast(void**)& gtk_button_released},
+    { "gtk_button_pressed",  cast(void**)& gtk_button_pressed},
+    { "gtk_button_new_with_mnemonic",  cast(void**)& gtk_button_new_with_mnemonic},
+    { "gtk_button_new_from_stock",  cast(void**)& gtk_button_new_from_stock},
+    { "gtk_button_new_with_label",  cast(void**)& gtk_button_new_with_label},
+    { "gtk_button_new",  cast(void**)& gtk_button_new},
+    { "gtk_button_get_type",  cast(void**)& gtk_button_get_type},
+    { "gtk_image_get",  cast(void**)& gtk_image_get},
+    { "gtk_image_set",  cast(void**)& gtk_image_set},
+    { "gtk_image_get_pixel_size",  cast(void**)& gtk_image_get_pixel_size},
+    { "gtk_image_get_icon_name",  cast(void**)& gtk_image_get_icon_name},
+    { "gtk_image_get_animation",  cast(void**)& gtk_image_get_animation},
+    { "gtk_image_get_icon_set",  cast(void**)& gtk_image_get_icon_set},
+    { "gtk_image_get_stock",  cast(void**)& gtk_image_get_stock},
+    { "gtk_image_get_pixbuf",  cast(void**)& gtk_image_get_pixbuf},
+    { "gtk_image_get_image",  cast(void**)& gtk_image_get_image},
+    { "gtk_image_get_pixmap",  cast(void**)& gtk_image_get_pixmap},
+    { "gtk_image_get_storage_type",  cast(void**)& gtk_image_get_storage_type},
+    { "gtk_image_set_pixel_size",  cast(void**)& gtk_image_set_pixel_size},
+    { "gtk_image_set_from_icon_name",  cast(void**)& gtk_image_set_from_icon_name},
+    { "gtk_image_set_from_animation",  cast(void**)& gtk_image_set_from_animation},
+    { "gtk_image_set_from_icon_set",  cast(void**)& gtk_image_set_from_icon_set},
+    { "gtk_image_set_from_stock",  cast(void**)& gtk_image_set_from_stock},
+    { "gtk_image_set_from_pixbuf",  cast(void**)& gtk_image_set_from_pixbuf},
+    { "gtk_image_set_from_file",  cast(void**)& gtk_image_set_from_file},
+    { "gtk_image_set_from_image",  cast(void**)& gtk_image_set_from_image},
+    { "gtk_image_set_from_pixmap",  cast(void**)& gtk_image_set_from_pixmap},
+    { "gtk_image_clear",  cast(void**)& gtk_image_clear},
+    { "gtk_image_new_from_icon_name",  cast(void**)& gtk_image_new_from_icon_name},
+    { "gtk_image_new_from_animation",  cast(void**)& gtk_image_new_from_animation},
+    { "gtk_image_new_from_icon_set",  cast(void**)& gtk_image_new_from_icon_set},
+    { "gtk_image_new_from_stock",  cast(void**)& gtk_image_new_from_stock},
+    { "gtk_image_new_from_pixbuf",  cast(void**)& gtk_image_new_from_pixbuf},
+    { "gtk_image_new_from_file",  cast(void**)& gtk_image_new_from_file},
+    { "gtk_image_new_from_image",  cast(void**)& gtk_image_new_from_image},
+    { "gtk_image_new_from_pixmap",  cast(void**)& gtk_image_new_from_pixmap},
+    { "gtk_image_new",  cast(void**)& gtk_image_new},
+    { "gtk_image_get_type",  cast(void**)& gtk_image_get_type},
+    { "gtk_buildable_get_internal_child",  cast(void**)& gtk_buildable_get_internal_child},
+    { "gtk_buildable_parser_finished",  cast(void**)& gtk_buildable_parser_finished},
+    { "gtk_buildable_custom_finished",  cast(void**)& gtk_buildable_custom_finished},
+    { "gtk_buildable_custom_tag_end",  cast(void**)& gtk_buildable_custom_tag_end},
+    { "gtk_buildable_custom_tag_start",  cast(void**)& gtk_buildable_custom_tag_start},
+    { "gtk_buildable_construct_child",  cast(void**)& gtk_buildable_construct_child},
+    { "gtk_buildable_set_buildable_property",  cast(void**)& gtk_buildable_set_buildable_property},
+    { "gtk_buildable_add_child",  cast(void**)& gtk_buildable_add_child},
+    { "gtk_buildable_get_name",  cast(void**)& gtk_buildable_get_name},
+    { "gtk_buildable_set_name",  cast(void**)& gtk_buildable_set_name},
+    { "gtk_buildable_get_type",  cast(void**)& gtk_buildable_get_type},
+    { "gtk_builder_value_from_string_type",  cast(void**)& gtk_builder_value_from_string_type},
+    { "gtk_builder_value_from_string",  cast(void**)& gtk_builder_value_from_string},
+    { "gtk_builder_get_type_from_name",  cast(void**)& gtk_builder_get_type_from_name},
+    { "gtk_builder_get_translation_domain",  cast(void**)& gtk_builder_get_translation_domain},
+    { "gtk_builder_set_translation_domain",  cast(void**)& gtk_builder_set_translation_domain},
+    { "gtk_builder_connect_signals_full",  cast(void**)& gtk_builder_connect_signals_full},
+    { "gtk_builder_connect_signals",  cast(void**)& gtk_builder_connect_signals},
+    { "gtk_builder_get_objects",  cast(void**)& gtk_builder_get_objects},
+    { "gtk_builder_get_object",  cast(void**)& gtk_builder_get_object},
+    { "gtk_builder_add_from_string",  cast(void**)& gtk_builder_add_from_string},
+    { "gtk_builder_add_from_file",  cast(void**)& gtk_builder_add_from_file},
+    { "gtk_builder_new",  cast(void**)& gtk_builder_new},
+    { "gtk_builder_get_type",  cast(void**)& gtk_builder_get_type},
+    { "gtk_builder_error_quark",  cast(void**)& gtk_builder_error_quark},
+//     { "_gtk_binding_signal_new",  cast(void**)& _gtk_binding_signal_new},
+//     { "_gtk_binding_entry_add_signall",  cast(void**)& _gtk_binding_entry_add_signall},
+//     { "_gtk_binding_reset_parsed",  cast(void**)& _gtk_binding_reset_parsed},
+//     { "_gtk_binding_parse_binding",  cast(void**)& _gtk_binding_parse_binding},
+    { "gtk_binding_set_add_path",  cast(void**)& gtk_binding_set_add_path},
+    { "gtk_binding_entry_remove",  cast(void**)& gtk_binding_entry_remove},
+    { "gtk_binding_entry_add_signal",  cast(void**)& gtk_binding_entry_add_signal},
+    { "gtk_binding_entry_skip",  cast(void**)& gtk_binding_entry_skip},
+    { "gtk_binding_parse_binding",  cast(void**)& gtk_binding_parse_binding},
+    { "gtk_binding_entry_add_signall",  cast(void**)& gtk_binding_entry_add_signall},
+    { "gtk_binding_entry_clear",  cast(void**)& gtk_binding_entry_clear},
+    { "gtk_binding_set_activate",  cast(void**)& gtk_binding_set_activate},
+    { "gtk_bindings_activate_event",  cast(void**)& gtk_bindings_activate_event},
+    { "gtk_bindings_activate",  cast(void**)& gtk_bindings_activate},
+    { "gtk_binding_set_find",  cast(void**)& gtk_binding_set_find},
+    { "gtk_binding_set_by_class",  cast(void**)& gtk_binding_set_by_class},
+    { "gtk_binding_set_new",  cast(void**)& gtk_binding_set_new},
+//     { "_gtk_button_box_child_requisition",  cast(void**)& _gtk_button_box_child_requisition},
+    { "gtk_button_box_get_child_ipadding",  cast(void**)& gtk_button_box_get_child_ipadding},
+    { "gtk_button_box_get_child_size",  cast(void**)& gtk_button_box_get_child_size},
+    { "gtk_button_box_set_child_ipadding",  cast(void**)& gtk_button_box_set_child_ipadding},
+    { "gtk_button_box_set_child_size",  cast(void**)& gtk_button_box_set_child_size},
+    { "gtk_button_box_set_child_secondary",  cast(void**)& gtk_button_box_set_child_secondary},
+    { "gtk_button_box_get_child_secondary",  cast(void**)& gtk_button_box_get_child_secondary},
+    { "gtk_button_box_set_layout",  cast(void**)& gtk_button_box_set_layout},
+    { "gtk_button_box_get_layout",  cast(void**)& gtk_button_box_get_layout},
+    { "gtk_button_box_get_type",  cast(void**)& gtk_button_box_get_type},
+    { "gtk_box_set_child_packing",  cast(void**)& gtk_box_set_child_packing},
+    { "gtk_box_query_child_packing",  cast(void**)& gtk_box_query_child_packing},
+    { "gtk_box_reorder_child",  cast(void**)& gtk_box_reorder_child},
+    { "gtk_box_get_spacing",  cast(void**)& gtk_box_get_spacing},
+    { "gtk_box_set_spacing",  cast(void**)& gtk_box_set_spacing},
+    { "gtk_box_get_homogeneous",  cast(void**)& gtk_box_get_homogeneous},
+    { "gtk_box_set_homogeneous",  cast(void**)& gtk_box_set_homogeneous},
+    { "gtk_box_pack_end_defaults",  cast(void**)& gtk_box_pack_end_defaults},
+    { "gtk_box_pack_start_defaults",  cast(void**)& gtk_box_pack_start_defaults},
+    { "gtk_box_pack_end",  cast(void**)& gtk_box_pack_end},
+    { "gtk_box_pack_start",  cast(void**)& gtk_box_pack_start},
+    { "gtk_box_get_type",  cast(void**)& gtk_box_get_type},
+    { "gtk_assistant_update_buttons_state",  cast(void**)& gtk_assistant_update_buttons_state},
+    { "gtk_assistant_remove_action_widget",  cast(void**)& gtk_assistant_remove_action_widget},
+    { "gtk_assistant_add_action_widget",  cast(void**)& gtk_assistant_add_action_widget},
+    { "gtk_assistant_get_page_complete",  cast(void**)& gtk_assistant_get_page_complete},
+    { "gtk_assistant_set_page_complete",  cast(void**)& gtk_assistant_set_page_complete},
+    { "gtk_assistant_get_page_side_image",  cast(void**)& gtk_assistant_get_page_side_image},
+    { "gtk_assistant_set_page_side_image",  cast(void**)& gtk_assistant_set_page_side_image},
+    { "gtk_assistant_get_page_header_image",  cast(void**)& gtk_assistant_get_page_header_image},
+    { "gtk_assistant_set_page_header_image",  cast(void**)& gtk_assistant_set_page_header_image},
+    { "gtk_assistant_get_page_title",  cast(void**)& gtk_assistant_get_page_title},
+    { "gtk_assistant_set_page_title",  cast(void**)& gtk_assistant_set_page_title},
+    { "gtk_assistant_get_page_type",  cast(void**)& gtk_assistant_get_page_type},
+    { "gtk_assistant_set_page_type",  cast(void**)& gtk_assistant_set_page_type},
+    { "gtk_assistant_set_forward_page_func",  cast(void**)& gtk_assistant_set_forward_page_func},
+    { "gtk_assistant_insert_page",  cast(void**)& gtk_assistant_insert_page},
+    { "gtk_assistant_append_page",  cast(void**)& gtk_assistant_append_page},
+    { "gtk_assistant_prepend_page",  cast(void**)& gtk_assistant_prepend_page},
+    { "gtk_assistant_get_nth_page",  cast(void**)& gtk_assistant_get_nth_page},
+    { "gtk_assistant_get_n_pages",  cast(void**)& gtk_assistant_get_n_pages},
+    { "gtk_assistant_set_current_page",  cast(void**)& gtk_assistant_set_current_page},
+    { "gtk_assistant_get_current_page",  cast(void**)& gtk_assistant_get_current_page},
+    { "gtk_assistant_new",  cast(void**)& gtk_assistant_new},
+    { "gtk_assistant_get_type",  cast(void**)& gtk_assistant_get_type},
+    { "gtk_aspect_frame_set",  cast(void**)& gtk_aspect_frame_set},
+    { "gtk_aspect_frame_new",  cast(void**)& gtk_aspect_frame_new},
+    { "gtk_aspect_frame_get_type",  cast(void**)& gtk_aspect_frame_get_type},
+    { "gtk_frame_get_shadow_type",  cast(void**)& gtk_frame_get_shadow_type},
+    { "gtk_frame_set_shadow_type",  cast(void**)& gtk_frame_set_shadow_type},
+    { "gtk_frame_get_label_align",  cast(void**)& gtk_frame_get_label_align},
+    { "gtk_frame_set_label_align",  cast(void**)& gtk_frame_set_label_align},
+    { "gtk_frame_get_label_widget",  cast(void**)& gtk_frame_get_label_widget},
+    { "gtk_frame_set_label_widget",  cast(void**)& gtk_frame_set_label_widget},
+    { "gtk_frame_get_label",  cast(void**)& gtk_frame_get_label},
+    { "gtk_frame_set_label",  cast(void**)& gtk_frame_set_label},
+    { "gtk_frame_new",  cast(void**)& gtk_frame_new},
+    { "gtk_frame_get_type",  cast(void**)& gtk_frame_get_type},
+    { "gtk_arrow_set",  cast(void**)& gtk_arrow_set},
+    { "gtk_arrow_new",  cast(void**)& gtk_arrow_new},
+    { "gtk_arrow_get_type",  cast(void**)& gtk_arrow_get_type},
+    { "gtk_alignment_get_padding",  cast(void**)& gtk_alignment_get_padding},
+    { "gtk_alignment_set_padding",  cast(void**)& gtk_alignment_set_padding},
+    { "gtk_alignment_set",  cast(void**)& gtk_alignment_set},
+    { "gtk_alignment_new",  cast(void**)& gtk_alignment_new},
+    { "gtk_alignment_get_type",  cast(void**)& gtk_alignment_get_type},
+//     { "_gtk_action_group_emit_post_activate",  cast(void**)& _gtk_action_group_emit_post_activate},
+//     { "_gtk_action_group_emit_pre_activate",  cast(void**)& _gtk_action_group_emit_pre_activate},
+//     { "_gtk_action_group_emit_disconnect_proxy",  cast(void**)& _gtk_action_group_emit_disconnect_proxy},
+//     { "_gtk_action_group_emit_connect_proxy",  cast(void**)& _gtk_action_group_emit_connect_proxy},
+    { "gtk_action_group_translate_string",  cast(void**)& gtk_action_group_translate_string},
+    { "gtk_action_group_set_translation_domain",  cast(void**)& gtk_action_group_set_translation_domain},
+    { "gtk_action_group_set_translate_func",  cast(void**)& gtk_action_group_set_translate_func},
+    { "gtk_action_group_add_radio_actions_full",  cast(void**)& gtk_action_group_add_radio_actions_full},
+    { "gtk_action_group_add_toggle_actions_full",  cast(void**)& gtk_action_group_add_toggle_actions_full},
+    { "gtk_action_group_add_actions_full",  cast(void**)& gtk_action_group_add_actions_full},
+    { "gtk_action_group_add_radio_actions",  cast(void**)& gtk_action_group_add_radio_actions},
+    { "gtk_action_group_add_toggle_actions",  cast(void**)& gtk_action_group_add_toggle_actions},
+    { "gtk_action_group_add_actions",  cast(void**)& gtk_action_group_add_actions},
+    { "gtk_action_group_remove_action",  cast(void**)& gtk_action_group_remove_action},
+    { "gtk_action_group_add_action_with_accel",  cast(void**)& gtk_action_group_add_action_with_accel},
+    { "gtk_action_group_add_action",  cast(void**)& gtk_action_group_add_action},
+    { "gtk_action_group_list_actions",  cast(void**)& gtk_action_group_list_actions},
+    { "gtk_action_group_get_action",  cast(void**)& gtk_action_group_get_action},
+    { "gtk_action_group_set_visible",  cast(void**)& gtk_action_group_set_visible},
+    { "gtk_action_group_get_visible",  cast(void**)& gtk_action_group_get_visible},
+    { "gtk_action_group_set_sensitive",  cast(void**)& gtk_action_group_set_sensitive},
+    { "gtk_action_group_get_sensitive",  cast(void**)& gtk_action_group_get_sensitive},
+    { "gtk_action_group_get_name",  cast(void**)& gtk_action_group_get_name},
+    { "gtk_action_group_new",  cast(void**)& gtk_action_group_new},
+    { "gtk_action_group_get_type",  cast(void**)& gtk_action_group_get_type},
+    { "gtk_item_factories_path_delete",  cast(void**)& gtk_item_factories_path_delete},
+    { "gtk_item_factory_create_menu_entries",  cast(void**)& gtk_item_factory_create_menu_entries},
+    { "gtk_item_factory_from_path",  cast(void**)& gtk_item_factory_from_path},
+    { "gtk_item_factory_create_items_ac",  cast(void**)& gtk_item_factory_create_items_ac},
+    { "gtk_item_factory_set_translate_func",  cast(void**)& gtk_item_factory_set_translate_func},
+    { "gtk_item_factory_popup_data_from_widget",  cast(void**)& gtk_item_factory_popup_data_from_widget},
+    { "gtk_item_factory_popup_data",  cast(void**)& gtk_item_factory_popup_data},
+    { "gtk_item_factory_popup_with_data",  cast(void**)& gtk_item_factory_popup_with_data},
+    { "gtk_item_factory_popup",  cast(void**)& gtk_item_factory_popup},
+    { "gtk_item_factory_delete_entries",  cast(void**)& gtk_item_factory_delete_entries},
+    { "gtk_item_factory_delete_entry",  cast(void**)& gtk_item_factory_delete_entry},
+    { "gtk_item_factory_delete_item",  cast(void**)& gtk_item_factory_delete_item},
+    { "gtk_item_factory_create_items",  cast(void**)& gtk_item_factory_create_items},
+    { "gtk_item_factory_create_item",  cast(void**)& gtk_item_factory_create_item},
+    { "gtk_item_factory_get_item_by_action",  cast(void**)& gtk_item_factory_get_item_by_action},
+    { "gtk_item_factory_get_widget_by_action",  cast(void**)& gtk_item_factory_get_widget_by_action},
+    { "gtk_item_factory_get_widget",  cast(void**)& gtk_item_factory_get_widget},
+    { "gtk_item_factory_get_item",  cast(void**)& gtk_item_factory_get_item},
+    { "gtk_item_factory_path_from_widget",  cast(void**)& gtk_item_factory_path_from_widget},
+    { "gtk_item_factory_from_widget",  cast(void**)& gtk_item_factory_from_widget},
+    { "gtk_item_factory_add_foreign",  cast(void**)& gtk_item_factory_add_foreign},
+    { "gtk_item_factory_construct",  cast(void**)& gtk_item_factory_construct},
+    { "gtk_item_factory_new",  cast(void**)& gtk_item_factory_new},
+    { "gtk_item_factory_get_type",  cast(void**)& gtk_item_factory_get_type},
+//     { "_gtk_action_sync_menu_visible",  cast(void**)& _gtk_action_sync_menu_visible},
+//     { "_gtk_action_sync_visible",  cast(void**)& _gtk_action_sync_visible},
+//     { "_gtk_action_sync_sensitive",  cast(void**)& _gtk_action_sync_sensitive},
+    { "gtk_action_set_accel_group",  cast(void**)& gtk_action_set_accel_group},
+    { "gtk_action_set_accel_path",  cast(void**)& gtk_action_set_accel_path},
+//     { "_gtk_action_emit_activate",  cast(void**)& _gtk_action_emit_activate},
+    { "gtk_action_unblock_activate_from",  cast(void**)& gtk_action_unblock_activate_from},
+    { "gtk_action_block_activate_from",  cast(void**)& gtk_action_block_activate_from},
+    { "gtk_action_get_accel_closure",  cast(void**)& gtk_action_get_accel_closure},
+    { "gtk_action_get_accel_path",  cast(void**)& gtk_action_get_accel_path},
+    { "gtk_action_disconnect_accelerator",  cast(void**)& gtk_action_disconnect_accelerator},
+    { "gtk_action_connect_accelerator",  cast(void**)& gtk_action_connect_accelerator},
+    { "gtk_widget_get_action",  cast(void**)& gtk_widget_get_action},
+    { "gtk_action_get_proxies",  cast(void**)& gtk_action_get_proxies},
+    { "gtk_action_disconnect_proxy",  cast(void**)& gtk_action_disconnect_proxy},
+    { "gtk_action_connect_proxy",  cast(void**)& gtk_action_connect_proxy},
+    { "gtk_action_create_menu",  cast(void**)& gtk_action_create_menu},
+    { "gtk_action_create_tool_item",  cast(void**)& gtk_action_create_tool_item},
+    { "gtk_action_create_menu_item",  cast(void**)& gtk_action_create_menu_item},
+    { "gtk_action_create_icon",  cast(void**)& gtk_action_create_icon},
+    { "gtk_action_activate",  cast(void**)& gtk_action_activate},
+    { "gtk_action_set_visible",  cast(void**)& gtk_action_set_visible},
+    { "gtk_action_get_visible",  cast(void**)& gtk_action_get_visible},
+    { "gtk_action_is_visible",  cast(void**)& gtk_action_is_visible},
+    { "gtk_action_set_sensitive",  cast(void**)& gtk_action_set_sensitive},
+    { "gtk_action_get_sensitive",  cast(void**)& gtk_action_get_sensitive},
+    { "gtk_action_is_sensitive",  cast(void**)& gtk_action_is_sensitive},
+    { "gtk_action_get_name",  cast(void**)& gtk_action_get_name},
+    { "gtk_action_new",  cast(void**)& gtk_action_new},
+    { "gtk_action_get_type",  cast(void**)& gtk_action_get_type},
+    { "gtk_accessible_connect_widget_destroyed",  cast(void**)& gtk_accessible_connect_widget_destroyed},
+    { "gtk_accessible_get_type",  cast(void**)& gtk_accessible_get_type},
+//     { "_gtk_accel_path_is_valid",  cast(void**)& _gtk_accel_path_is_valid},
+//     { "_gtk_accel_map_remove_group",  cast(void**)& _gtk_accel_map_remove_group},
+//     { "_gtk_accel_map_add_group",  cast(void**)& _gtk_accel_map_add_group},
+//     { "_gtk_accel_map_init",  cast(void**)& _gtk_accel_map_init},
+    { "gtk_accel_map_get",  cast(void**)& gtk_accel_map_get},
+    { "gtk_accel_map_get_type",  cast(void**)& gtk_accel_map_get_type},
+    { "gtk_accel_map_foreach_unfiltered",  cast(void**)& gtk_accel_map_foreach_unfiltered},
+    { "gtk_accel_map_add_filter",  cast(void**)& gtk_accel_map_add_filter},
+    { "gtk_accel_map_unlock_path",  cast(void**)& gtk_accel_map_unlock_path},
+    { "gtk_accel_map_lock_path",  cast(void**)& gtk_accel_map_lock_path},
+    { "gtk_accel_map_save_fd",  cast(void**)& gtk_accel_map_save_fd},
+    { "gtk_accel_map_load_scanner",  cast(void**)& gtk_accel_map_load_scanner},
+    { "gtk_accel_map_load_fd",  cast(void**)& gtk_accel_map_load_fd},
+    { "gtk_accel_map_foreach",  cast(void**)& gtk_accel_map_foreach},
+    { "gtk_accel_map_save",  cast(void**)& gtk_accel_map_save},
+    { "gtk_accel_map_load",  cast(void**)& gtk_accel_map_load},
+    { "gtk_accel_map_change_entry",  cast(void**)& gtk_accel_map_change_entry},
+    { "gtk_accel_map_lookup_entry",  cast(void**)& gtk_accel_map_lookup_entry},
+    { "gtk_accel_map_add_entry",  cast(void**)& gtk_accel_map_add_entry},
+//     { "_gtk_accel_label_class_get_accelerator_label",  cast(void**)& _gtk_accel_label_class_get_accelerator_label},
+    { "gtk_accel_label_refetch",  cast(void**)& gtk_accel_label_refetch},
+    { "gtk_accel_label_set_accel_closure",  cast(void**)& gtk_accel_label_set_accel_closure},
+    { "gtk_accel_label_set_accel_widget",  cast(void**)& gtk_accel_label_set_accel_widget},
+    { "gtk_accel_label_get_accel_width",  cast(void**)& gtk_accel_label_get_accel_width},
+    { "gtk_accel_label_get_accel_widget",  cast(void**)& gtk_accel_label_get_accel_widget},
+    { "gtk_accel_label_new",  cast(void**)& gtk_accel_label_new},
+    { "gtk_accel_label_get_type",  cast(void**)& gtk_accel_label_get_type},
+    { "gtk_label_parse_uline",  cast(void**)& gtk_label_parse_uline},
+    { "gtk_label_get",  cast(void**)& gtk_label_get},
+    { "gtk_label_get_single_line_mode",  cast(void**)& gtk_label_get_single_line_mode},
+    { "gtk_label_set_single_line_mode",  cast(void**)& gtk_label_set_single_line_mode},
+    { "gtk_label_get_layout_offsets",  cast(void**)& gtk_label_get_layout_offsets},
+    { "gtk_label_get_layout",  cast(void**)& gtk_label_get_layout},
+    { "gtk_label_get_selection_bounds",  cast(void**)& gtk_label_get_selection_bounds},
+    { "gtk_label_select_region",  cast(void**)& gtk_label_select_region},
+    { "gtk_label_get_angle",  cast(void**)& gtk_label_get_angle},
+    { "gtk_label_set_angle",  cast(void**)& gtk_label_set_angle},
+    { "gtk_label_get_selectable",  cast(void**)& gtk_label_get_selectable},
+    { "gtk_label_set_selectable",  cast(void**)& gtk_label_set_selectable},
+    { "gtk_label_get_line_wrap_mode",  cast(void**)& gtk_label_get_line_wrap_mode},
+    { "gtk_label_set_line_wrap_mode",  cast(void**)& gtk_label_set_line_wrap_mode},
+    { "gtk_label_get_line_wrap",  cast(void**)& gtk_label_get_line_wrap},
+    { "gtk_label_set_line_wrap",  cast(void**)& gtk_label_set_line_wrap},
+    { "gtk_label_set_pattern",  cast(void**)& gtk_label_set_pattern},
+    { "gtk_label_get_max_width_chars",  cast(void**)& gtk_label_get_max_width_chars},
+    { "gtk_label_set_max_width_chars",  cast(void**)& gtk_label_set_max_width_chars},
+    { "gtk_label_get_width_chars",  cast(void**)& gtk_label_get_width_chars},
+    { "gtk_label_set_width_chars",  cast(void**)& gtk_label_set_width_chars},
+    { "gtk_label_get_ellipsize",  cast(void**)& gtk_label_get_ellipsize},
+    { "gtk_label_set_ellipsize",  cast(void**)& gtk_label_set_ellipsize},
+    { "gtk_label_get_justify",  cast(void**)& gtk_label_get_justify},
+    { "gtk_label_set_justify",  cast(void**)& gtk_label_set_justify},
+    { "gtk_label_set_text_with_mnemonic",  cast(void**)& gtk_label_set_text_with_mnemonic},
+    { "gtk_label_get_mnemonic_widget",  cast(void**)& gtk_label_get_mnemonic_widget},
+    { "gtk_label_set_mnemonic_widget",  cast(void**)& gtk_label_set_mnemonic_widget},
+    { "gtk_label_get_mnemonic_keyval",  cast(void**)& gtk_label_get_mnemonic_keyval},
+    { "gtk_label_set_markup_with_mnemonic",  cast(void**)& gtk_label_set_markup_with_mnemonic},
+    { "gtk_label_get_use_underline",  cast(void**)& gtk_label_get_use_underline},
+    { "gtk_label_set_use_underline",  cast(void**)& gtk_label_set_use_underline},
+    { "gtk_label_get_use_markup",  cast(void**)& gtk_label_get_use_markup},
+    { "gtk_label_set_use_markup",  cast(void**)& gtk_label_set_use_markup},
+    { "gtk_label_set_markup",  cast(void**)& gtk_label_set_markup},
+    { "gtk_label_get_label",  cast(void**)& gtk_label_get_label},
+    { "gtk_label_set_label",  cast(void**)& gtk_label_set_label},
+    { "gtk_label_get_attributes",  cast(void**)& gtk_label_get_attributes},
+    { "gtk_label_set_attributes",  cast(void**)& gtk_label_set_attributes},
+    { "gtk_label_get_text",  cast(void**)& gtk_label_get_text},
+    { "gtk_label_set_text",  cast(void**)& gtk_label_set_text},
+    { "gtk_label_new_with_mnemonic",  cast(void**)& gtk_label_new_with_mnemonic},
+    { "gtk_label_new",  cast(void**)& gtk_label_new},
+    { "gtk_label_get_type",  cast(void**)& gtk_label_get_type},
+    { "gtk_menu_get_for_attach_widget",  cast(void**)& gtk_menu_get_for_attach_widget},
+    { "gtk_menu_set_monitor",  cast(void**)& gtk_menu_set_monitor},
+    { "gtk_menu_attach",  cast(void**)& gtk_menu_attach},
+    { "gtk_menu_set_screen",  cast(void**)& gtk_menu_set_screen},
+    { "gtk_menu_reorder_child",  cast(void**)& gtk_menu_reorder_child},
+    { "gtk_menu_get_title",  cast(void**)& gtk_menu_get_title},
+    { "gtk_menu_set_title",  cast(void**)& gtk_menu_set_title},
+    { "gtk_menu_get_tearoff_state",  cast(void**)& gtk_menu_get_tearoff_state},
+    { "gtk_menu_set_tearoff_state",  cast(void**)& gtk_menu_set_tearoff_state},
+    { "gtk_menu_get_attach_widget",  cast(void**)& gtk_menu_get_attach_widget},
+    { "gtk_menu_detach",  cast(void**)& gtk_menu_detach},
+    { "gtk_menu_attach_to_widget",  cast(void**)& gtk_menu_attach_to_widget},
+    { "gtk_menu_set_accel_path",  cast(void**)& gtk_menu_set_accel_path},
+    { "gtk_menu_get_accel_group",  cast(void**)& gtk_menu_get_accel_group},
+    { "gtk_menu_set_accel_group",  cast(void**)& gtk_menu_set_accel_group},
+    { "gtk_menu_set_active",  cast(void**)& gtk_menu_set_active},
+    { "gtk_menu_get_active",  cast(void**)& gtk_menu_get_active},
+    { "gtk_menu_popdown",  cast(void**)& gtk_menu_popdown},
+    { "gtk_menu_reposition",  cast(void**)& gtk_menu_reposition},
+    { "gtk_menu_popup",  cast(void**)& gtk_menu_popup},
+    { "gtk_menu_new",  cast(void**)& gtk_menu_new},
+    { "gtk_menu_get_type",  cast(void**)& gtk_menu_get_type},
+    { "gtk_menu_shell_set_take_focus",  cast(void**)& gtk_menu_shell_set_take_focus},
+    { "gtk_menu_shell_get_take_focus",  cast(void**)& gtk_menu_shell_get_take_focus},
+//     { "_gtk_menu_shell_remove_mnemonic",  cast(void**)& _gtk_menu_shell_remove_mnemonic},
+//     { "_gtk_menu_shell_add_mnemonic",  cast(void**)& _gtk_menu_shell_add_mnemonic},
+    { "gtk_menu_shell_cancel",  cast(void**)& gtk_menu_shell_cancel},
+//     { "_gtk_menu_shell_get_popup_delay",  cast(void**)& _gtk_menu_shell_get_popup_delay},
+//     { "_gtk_menu_shell_activate",  cast(void**)& _gtk_menu_shell_activate},
+//     { "_gtk_menu_shell_select_last",  cast(void**)& _gtk_menu_shell_select_last},
+    { "gtk_menu_shell_select_first",  cast(void**)& gtk_menu_shell_select_first},
+    { "gtk_menu_shell_activate_item",  cast(void**)& gtk_menu_shell_activate_item},
+    { "gtk_menu_shell_deselect",  cast(void**)& gtk_menu_shell_deselect},
+    { "gtk_menu_shell_select_item",  cast(void**)& gtk_menu_shell_select_item},
+    { "gtk_menu_shell_deactivate",  cast(void**)& gtk_menu_shell_deactivate},
+    { "gtk_menu_shell_insert",  cast(void**)& gtk_menu_shell_insert},
+    { "gtk_menu_shell_prepend",  cast(void**)& gtk_menu_shell_prepend},
+    { "gtk_menu_shell_append",  cast(void**)& gtk_menu_shell_append},
+    { "gtk_menu_shell_get_type",  cast(void**)& gtk_menu_shell_get_type},
+    { "gtk_misc_get_padding",  cast(void**)& gtk_misc_get_padding},
+    { "gtk_misc_set_padding",  cast(void**)& gtk_misc_set_padding},
+    { "gtk_misc_get_alignment",  cast(void**)& gtk_misc_get_alignment},
+    { "gtk_misc_set_alignment",  cast(void**)& gtk_misc_set_alignment},
+    { "gtk_misc_get_type",  cast(void**)& gtk_misc_get_type},
+    { "gtk_about_dialog_set_url_hook",  cast(void**)& gtk_about_dialog_set_url_hook},
+    { "gtk_about_dialog_set_email_hook",  cast(void**)& gtk_about_dialog_set_email_hook},
+    { "gtk_about_dialog_set_logo_icon_name",  cast(void**)& gtk_about_dialog_set_logo_icon_name},
+    { "gtk_about_dialog_get_logo_icon_name",  cast(void**)& gtk_about_dialog_get_logo_icon_name},
+    { "gtk_about_dialog_set_logo",  cast(void**)& gtk_about_dialog_set_logo},
+    { "gtk_about_dialog_get_logo",  cast(void**)& gtk_about_dialog_get_logo},
+    { "gtk_about_dialog_set_translator_credits",  cast(void**)& gtk_about_dialog_set_translator_credits},
+    { "gtk_about_dialog_get_translator_credits",  cast(void**)& gtk_about_dialog_get_translator_credits},
+    { "gtk_about_dialog_set_artists",  cast(void**)& gtk_about_dialog_set_artists},
+    { "gtk_about_dialog_get_artists",  cast(void**)& gtk_about_dialog_get_artists},
+    { "gtk_about_dialog_set_documenters",  cast(void**)& gtk_about_dialog_set_documenters},
+    { "gtk_about_dialog_get_documenters",  cast(void**)& gtk_about_dialog_get_documenters},
+    { "gtk_about_dialog_set_authors",  cast(void**)& gtk_about_dialog_set_authors},
+    { "gtk_about_dialog_get_authors",  cast(void**)& gtk_about_dialog_get_authors},
+    { "gtk_about_dialog_set_website_label",  cast(void**)& gtk_about_dialog_set_website_label},
+    { "gtk_about_dialog_get_website_label",  cast(void**)& gtk_about_dialog_get_website_label},
+    { "gtk_about_dialog_set_website",  cast(void**)& gtk_about_dialog_set_website},
+    { "gtk_about_dialog_get_website",  cast(void**)& gtk_about_dialog_get_website},
+    { "gtk_about_dialog_set_wrap_license",  cast(void**)& gtk_about_dialog_set_wrap_license},
+    { "gtk_about_dialog_get_wrap_license",  cast(void**)& gtk_about_dialog_get_wrap_license},
+    { "gtk_about_dialog_set_license",  cast(void**)& gtk_about_dialog_set_license},
+    { "gtk_about_dialog_get_license",  cast(void**)& gtk_about_dialog_get_license},
+    { "gtk_about_dialog_set_comments",  cast(void**)& gtk_about_dialog_set_comments},
+    { "gtk_about_dialog_get_comments",  cast(void**)& gtk_about_dialog_get_comments},
+    { "gtk_about_dialog_set_copyright",  cast(void**)& gtk_about_dialog_set_copyright},
+    { "gtk_about_dialog_get_copyright",  cast(void**)& gtk_about_dialog_get_copyright},
+    { "gtk_about_dialog_set_version",  cast(void**)& gtk_about_dialog_set_version},
+    { "gtk_about_dialog_get_version",  cast(void**)& gtk_about_dialog_get_version},
+    { "gtk_about_dialog_set_program_name",  cast(void**)& gtk_about_dialog_set_program_name},
+    { "gtk_about_dialog_get_program_name",  cast(void**)& gtk_about_dialog_get_program_name},
+    { "gtk_about_dialog_set_name",  cast(void**)& gtk_about_dialog_set_name},
+    { "gtk_about_dialog_get_name",  cast(void**)& gtk_about_dialog_get_name},
+    { "gtk_show_about_dialog",  cast(void**)& gtk_show_about_dialog},
+    { "gtk_about_dialog_new",  cast(void**)& gtk_about_dialog_new},
+    { "gtk_about_dialog_get_type",  cast(void**)& gtk_about_dialog_get_type},
+//     { "_gtk_dialog_set_ignore_separator",  cast(void**)& _gtk_dialog_set_ignore_separator},
+    { "gtk_dialog_run",  cast(void**)& gtk_dialog_run},
+    { "gtk_dialog_response",  cast(void**)& gtk_dialog_response},
+    { "gtk_dialog_set_alternative_button_order_from_array",  cast(void**)& gtk_dialog_set_alternative_button_order_from_array},
+    { "gtk_dialog_set_alternative_button_order",  cast(void**)& gtk_dialog_set_alternative_button_order},
+    { "gtk_alternative_dialog_button_order",  cast(void**)& gtk_alternative_dialog_button_order},
+    { "gtk_dialog_get_has_separator",  cast(void**)& gtk_dialog_get_has_separator},
+    { "gtk_dialog_set_has_separator",  cast(void**)& gtk_dialog_set_has_separator},
+    { "gtk_dialog_get_response_for_widget",  cast(void**)& gtk_dialog_get_response_for_widget},
+    { "gtk_dialog_set_default_response",  cast(void**)& gtk_dialog_set_default_response},
+    { "gtk_dialog_set_response_sensitive",  cast(void**)& gtk_dialog_set_response_sensitive},
+    { "gtk_dialog_add_buttons",  cast(void**)& gtk_dialog_add_buttons},
+    { "gtk_dialog_add_button",  cast(void**)& gtk_dialog_add_button},
+    { "gtk_dialog_add_action_widget",  cast(void**)& gtk_dialog_add_action_widget},
+    { "gtk_dialog_new_with_buttons",  cast(void**)& gtk_dialog_new_with_buttons},
+    { "gtk_dialog_new",  cast(void**)& gtk_dialog_new},
+    { "gtk_dialog_get_type",  cast(void**)& gtk_dialog_get_type},
+//     { "_gtk_window_query_nonaccels",  cast(void**)& _gtk_window_query_nonaccels},
+//     { "_gtk_window_keys_foreach",  cast(void**)& _gtk_window_keys_foreach},
+//     { "_gtk_window_set_is_active",  cast(void**)& _gtk_window_set_is_active},
+//     { "_gtk_window_unset_focus_and_default",  cast(void**)& _gtk_window_unset_focus_and_default},
+//     { "_gtk_window_set_has_toplevel_focus",  cast(void**)& _gtk_window_set_has_toplevel_focus},
+//     { "_gtk_window_group_get_current_grab",  cast(void**)& _gtk_window_group_get_current_grab},
+//     { "_gtk_window_constrain_size",  cast(void**)& _gtk_window_constrain_size},
+//     { "_gtk_window_reposition",  cast(void**)& _gtk_window_reposition},
+    { "gtk_window_add_embedded_xid",  cast(void**)& gtk_window_add_embedded_xid},
+    { "gtk_window_remove_embedded_xid",  cast(void**)& gtk_window_remove_embedded_xid},
+//     { "_gtk_window_internal_set_focus",  cast(void**)& _gtk_window_internal_set_focus},
+    { "gtk_window_group_remove_window",  cast(void**)& gtk_window_group_remove_window},
+    { "gtk_window_group_add_window",  cast(void**)& gtk_window_group_add_window},
+    { "gtk_window_group_new",  cast(void**)& gtk_window_group_new},
+    { "gtk_window_group_get_type",  cast(void**)& gtk_window_group_get_type},
+    { "gtk_window_reshow_with_initial_size",  cast(void**)& gtk_window_reshow_with_initial_size},
+    { "gtk_window_get_group",  cast(void**)& gtk_window_get_group},
+    { "gtk_window_parse_geometry",  cast(void**)& gtk_window_parse_geometry},
+    { "gtk_window_get_position",  cast(void**)& gtk_window_get_position},
+    { "gtk_window_move",  cast(void**)& gtk_window_move},
+    { "gtk_window_get_size",  cast(void**)& gtk_window_get_size},
+    { "gtk_window_resize",  cast(void**)& gtk_window_resize},
+    { "gtk_window_get_default_size",  cast(void**)& gtk_window_get_default_size},
+    { "gtk_window_set_default_size",  cast(void**)& gtk_window_set_default_size},
+    { "gtk_window_set_policy",  cast(void**)& gtk_window_set_policy},
+    { "gtk_window_begin_move_drag",  cast(void**)& gtk_window_begin_move_drag},
+    { "gtk_window_begin_resize_drag",  cast(void**)& gtk_window_begin_resize_drag},
+    { "gtk_window_set_keep_below",  cast(void**)& gtk_window_set_keep_below},
+    { "gtk_window_set_keep_above",  cast(void**)& gtk_window_set_keep_above},
+    { "gtk_window_unfullscreen",  cast(void**)& gtk_window_unfullscreen},
+    { "gtk_window_fullscreen",  cast(void**)& gtk_window_fullscreen},
+    { "gtk_window_unmaximize",  cast(void**)& gtk_window_unmaximize},
+    { "gtk_window_maximize",  cast(void**)& gtk_window_maximize},
+    { "gtk_window_unstick",  cast(void**)& gtk_window_unstick},
+    { "gtk_window_stick",  cast(void**)& gtk_window_stick},
+    { "gtk_window_deiconify",  cast(void**)& gtk_window_deiconify},
+    { "gtk_window_iconify",  cast(void**)& gtk_window_iconify},
+    { "gtk_window_present_with_time",  cast(void**)& gtk_window_present_with_time},
+    { "gtk_window_present",  cast(void**)& gtk_window_present},
+    { "gtk_window_propagate_key_event",  cast(void**)& gtk_window_propagate_key_event},
+    { "gtk_window_activate_key",  cast(void**)& gtk_window_activate_key},
+    { "gtk_window_get_mnemonic_modifier",  cast(void**)& gtk_window_get_mnemonic_modifier},
+    { "gtk_window_set_mnemonic_modifier",  cast(void**)& gtk_window_set_mnemonic_modifier},
+    { "gtk_window_mnemonic_activate",  cast(void**)& gtk_window_mnemonic_activate},
+    { "gtk_window_remove_mnemonic",  cast(void**)& gtk_window_remove_mnemonic},
+    { "gtk_window_add_mnemonic",  cast(void**)& gtk_window_add_mnemonic},
+    { "gtk_window_list_toplevels",  cast(void**)& gtk_window_list_toplevels},
+    { "gtk_window_get_modal",  cast(void**)& gtk_window_get_modal},
+    { "gtk_window_set_modal",  cast(void**)& gtk_window_set_modal},
+    { "gtk_window_set_auto_startup_notification",  cast(void**)& gtk_window_set_auto_startup_notification},
+    { "gtk_window_set_default_icon_from_file",  cast(void**)& gtk_window_set_default_icon_from_file},
+    { "gtk_window_set_default_icon_name",  cast(void**)& gtk_window_set_default_icon_name},
+    { "gtk_window_set_default_icon",  cast(void**)& gtk_window_set_default_icon},
+    { "gtk_window_get_default_icon_list",  cast(void**)& gtk_window_get_default_icon_list},
+    { "gtk_window_set_default_icon_list",  cast(void**)& gtk_window_set_default_icon_list},
+    { "gtk_window_get_icon_name",  cast(void**)& gtk_window_get_icon_name},
+    { "gtk_window_get_icon",  cast(void**)& gtk_window_get_icon},
+    { "gtk_window_set_icon_from_file",  cast(void**)& gtk_window_set_icon_from_file},
+    { "gtk_window_set_icon_name",  cast(void**)& gtk_window_set_icon_name},
+    { "gtk_window_set_icon",  cast(void**)& gtk_window_set_icon},
+    { "gtk_window_get_icon_list",  cast(void**)& gtk_window_get_icon_list},
+    { "gtk_window_set_icon_list",  cast(void**)& gtk_window_set_icon_list},
+    { "gtk_window_get_deletable",  cast(void**)& gtk_window_get_deletable},
+    { "gtk_window_set_deletable",  cast(void**)& gtk_window_set_deletable},
+    { "gtk_window_get_decorated",  cast(void**)& gtk_window_get_decorated},
+    { "gtk_window_set_decorated",  cast(void**)& gtk_window_set_decorated},
+    { "gtk_window_get_frame_dimensions",  cast(void**)& gtk_window_get_frame_dimensions},
+    { "gtk_window_set_frame_dimensions",  cast(void**)& gtk_window_set_frame_dimensions},
+    { "gtk_window_get_has_frame",  cast(void**)& gtk_window_get_has_frame},
+    { "gtk_window_set_has_frame",  cast(void**)& gtk_window_set_has_frame},
+    { "gtk_window_has_toplevel_focus",  cast(void**)& gtk_window_has_toplevel_focus},
+    { "gtk_window_is_active",  cast(void**)& gtk_window_is_active},
+    { "gtk_window_get_screen",  cast(void**)& gtk_window_get_screen},
+    { "gtk_window_set_screen",  cast(void**)& gtk_window_set_screen},
+    { "gtk_window_set_geometry_hints",  cast(void**)& gtk_window_set_geometry_hints},
+    { "gtk_window_get_gravity",  cast(void**)& gtk_window_get_gravity},
+    { "gtk_window_set_gravity",  cast(void**)& gtk_window_set_gravity},
+    { "gtk_window_get_resizable",  cast(void**)& gtk_window_get_resizable},
+    { "gtk_window_set_resizable",  cast(void**)& gtk_window_set_resizable},
+    { "gtk_window_get_destroy_with_parent",  cast(void**)& gtk_window_get_destroy_with_parent},
+    { "gtk_window_set_destroy_with_parent",  cast(void**)& gtk_window_set_destroy_with_parent},
+    { "gtk_window_get_focus_on_map",  cast(void**)& gtk_window_get_focus_on_map},
+    { "gtk_window_set_focus_on_map",  cast(void**)& gtk_window_set_focus_on_map},
+    { "gtk_window_get_accept_focus",  cast(void**)& gtk_window_get_accept_focus},
+    { "gtk_window_set_accept_focus",  cast(void**)& gtk_window_set_accept_focus},
+    { "gtk_window_get_urgency_hint",  cast(void**)& gtk_window_get_urgency_hint},
+    { "gtk_window_set_urgency_hint",  cast(void**)& gtk_window_set_urgency_hint},
+    { "gtk_window_get_skip_pager_hint",  cast(void**)& gtk_window_get_skip_pager_hint},
+    { "gtk_window_set_skip_pager_hint",  cast(void**)& gtk_window_set_skip_pager_hint},
+    { "gtk_window_get_skip_taskbar_hint",  cast(void**)& gtk_window_get_skip_taskbar_hint},
+    { "gtk_window_set_skip_taskbar_hint",  cast(void**)& gtk_window_set_skip_taskbar_hint},
+    { "gtk_window_get_type_hint",  cast(void**)& gtk_window_get_type_hint},
+    { "gtk_window_set_type_hint",  cast(void**)& gtk_window_set_type_hint},
+    { "gtk_window_get_opacity",  cast(void**)& gtk_window_get_opacity},
+    { "gtk_window_set_opacity",  cast(void**)& gtk_window_set_opacity},
+    { "gtk_window_get_transient_for",  cast(void**)& gtk_window_get_transient_for},
+    { "gtk_window_set_transient_for",  cast(void**)& gtk_window_set_transient_for},
+    { "gtk_window_activate_default",  cast(void**)& gtk_window_activate_default},
+    { "gtk_window_set_default",  cast(void**)& gtk_window_set_default},
+    { "gtk_window_get_focus",  cast(void**)& gtk_window_get_focus},
+    { "gtk_window_set_focus",  cast(void**)& gtk_window_set_focus},
+    { "gtk_window_activate_focus",  cast(void**)& gtk_window_activate_focus},
+    { "gtk_window_set_position",  cast(void**)& gtk_window_set_position},
+    { "gtk_window_remove_accel_group",  cast(void**)& gtk_window_remove_accel_group},
+    { "gtk_window_add_accel_group",  cast(void**)& gtk_window_add_accel_group},
+    { "gtk_window_get_role",  cast(void**)& gtk_window_get_role},
+    { "gtk_window_set_startup_id",  cast(void**)& gtk_window_set_startup_id},
+    { "gtk_window_set_role",  cast(void**)& gtk_window_set_role},
+    { "gtk_window_set_wmclass",  cast(void**)& gtk_window_set_wmclass},
+    { "gtk_window_get_title",  cast(void**)& gtk_window_get_title},
+    { "gtk_window_set_title",  cast(void**)& gtk_window_set_title},
+    { "gtk_window_new",  cast(void**)& gtk_window_new},
+    { "gtk_window_get_type",  cast(void**)& gtk_window_get_type},
+    { "gtk_bin_get_child",  cast(void**)& gtk_bin_get_child},
+    { "gtk_bin_get_type",  cast(void**)& gtk_bin_get_type},
+//     { "_gtk_container_focus_sort",  cast(void**)& _gtk_container_focus_sort},
+//     { "_gtk_container_dequeue_resize_handler",  cast(void**)& _gtk_container_dequeue_resize_handler},
+//     { "_gtk_container_child_composite_name",  cast(void**)& _gtk_container_child_composite_name},
+//     { "_gtk_container_clear_resize_widgets",  cast(void**)& _gtk_container_clear_resize_widgets},
+//     { "_gtk_container_queue_resize",  cast(void**)& _gtk_container_queue_resize},
+    { "gtk_container_forall",  cast(void**)& gtk_container_forall},
+    { "gtk_container_child_get_property",  cast(void**)& gtk_container_child_get_property},
+    { "gtk_container_child_set_property",  cast(void**)& gtk_container_child_set_property},
+    { "gtk_container_child_get_valist",  cast(void**)& gtk_container_child_get_valist},
+    { "gtk_container_child_set_valist",  cast(void**)& gtk_container_child_set_valist},
+    { "gtk_container_child_get",  cast(void**)& gtk_container_child_get},
+    { "gtk_container_child_set",  cast(void**)& gtk_container_child_set},
+    { "gtk_container_add_with_properties",  cast(void**)& gtk_container_add_with_properties},
+    { "gtk_container_class_list_child_properties",  cast(void**)& gtk_container_class_list_child_properties},
+    { "gtk_container_class_find_child_property",  cast(void**)& gtk_container_class_find_child_property},
+    { "gtk_container_class_install_child_property",  cast(void**)& gtk_container_class_install_child_property},
+    { "gtk_container_child_type",  cast(void**)& gtk_container_child_type},
+    { "gtk_container_resize_children",  cast(void**)& gtk_container_resize_children},
+    { "gtk_container_get_focus_hadjustment",  cast(void**)& gtk_container_get_focus_hadjustment},
+    { "gtk_container_set_focus_hadjustment",  cast(void**)& gtk_container_set_focus_hadjustment},
+    { "gtk_container_get_focus_vadjustment",  cast(void**)& gtk_container_get_focus_vadjustment},
+    { "gtk_container_set_focus_vadjustment",  cast(void**)& gtk_container_set_focus_vadjustment},
+    { "gtk_container_set_focus_child",  cast(void**)& gtk_container_set_focus_child},
+    { "gtk_container_set_reallocate_redraws",  cast(void**)& gtk_container_set_reallocate_redraws},
+    { "gtk_container_unset_focus_chain",  cast(void**)& gtk_container_unset_focus_chain},
+    { "gtk_container_get_focus_chain",  cast(void**)& gtk_container_get_focus_chain},
+    { "gtk_container_set_focus_chain",  cast(void**)& gtk_container_set_focus_chain},
+    { "gtk_container_propagate_expose",  cast(void**)& gtk_container_propagate_expose},
+    { "gtk_container_get_children",  cast(void**)& gtk_container_get_children},
+    { "gtk_container_foreach_full",  cast(void**)& gtk_container_foreach_full},
+    { "gtk_container_foreach",  cast(void**)& gtk_container_foreach},
+    { "gtk_container_check_resize",  cast(void**)& gtk_container_check_resize},
+    { "gtk_container_get_resize_mode",  cast(void**)& gtk_container_get_resize_mode},
+    { "gtk_container_set_resize_mode",  cast(void**)& gtk_container_set_resize_mode},
+    { "gtk_container_remove",  cast(void**)& gtk_container_remove},
+    { "gtk_container_add",  cast(void**)& gtk_container_add},
+    { "gtk_container_get_border_width",  cast(void**)& gtk_container_get_border_width},
+    { "gtk_container_set_border_width",  cast(void**)& gtk_container_set_border_width},
+    { "gtk_container_get_type",  cast(void**)& gtk_container_get_type},
+//     { "_gtk_widget_peek_colormap",  cast(void**)& _gtk_widget_peek_colormap},
+//     { "_gtk_widget_propagate_composited_changed",  cast(void**)& _gtk_widget_propagate_composited_changed},
+//     { "_gtk_widget_propagate_screen_changed",  cast(void**)& _gtk_widget_propagate_screen_changed},
+//     { "_gtk_widget_propagate_hierarchy_changed",  cast(void**)& _gtk_widget_propagate_hierarchy_changed},
+//     { "_gtk_widget_get_aux_info",  cast(void**)& _gtk_widget_get_aux_info},
+//     { "_gtk_widget_grab_notify",  cast(void**)& _gtk_widget_grab_notify},
+    { "gtk_requisition_free",  cast(void**)& gtk_requisition_free},
+    { "gtk_requisition_copy",  cast(void**)& gtk_requisition_copy},
+    { "gtk_requisition_get_type",  cast(void**)& gtk_requisition_get_type},
+    { "gtk_widget_get_has_tooltip",  cast(void**)& gtk_widget_get_has_tooltip},
+    { "gtk_widget_set_has_tooltip",  cast(void**)& gtk_widget_set_has_tooltip},
+    { "gtk_widget_get_tooltip_markup",  cast(void**)& gtk_widget_get_tooltip_markup},
+    { "gtk_widget_set_tooltip_markup",  cast(void**)& gtk_widget_set_tooltip_markup},
+    { "gtk_widget_get_tooltip_text",  cast(void**)& gtk_widget_get_tooltip_text},
+    { "gtk_widget_set_tooltip_text",  cast(void**)& gtk_widget_set_tooltip_text},
+    { "gtk_widget_trigger_tooltip_query",  cast(void**)& gtk_widget_trigger_tooltip_query},
+    { "gtk_widget_get_tooltip_window",  cast(void**)& gtk_widget_get_tooltip_window},
+    { "gtk_widget_set_tooltip_window",  cast(void**)& gtk_widget_set_tooltip_window},
+    { "gtk_widget_remove_mnemonic_label",  cast(void**)& gtk_widget_remove_mnemonic_label},
+    { "gtk_widget_add_mnemonic_label",  cast(void**)& gtk_widget_add_mnemonic_label},
+    { "gtk_widget_list_mnemonic_labels",  cast(void**)& gtk_widget_list_mnemonic_labels},
+    { "gtk_widget_class_path",  cast(void**)& gtk_widget_class_path},
+    { "gtk_widget_path",  cast(void**)& gtk_widget_path},
+    { "gtk_widget_reset_shapes",  cast(void**)& gtk_widget_reset_shapes},
+    { "gtk_widget_input_shape_combine_mask",  cast(void**)& gtk_widget_input_shape_combine_mask},
+    { "gtk_widget_shape_combine_mask",  cast(void**)& gtk_widget_shape_combine_mask},
+    { "gtk_widget_is_composited",  cast(void**)& gtk_widget_is_composited},
+    { "gtk_widget_get_default_direction",  cast(void**)& gtk_widget_get_default_direction},
+    { "gtk_widget_set_default_direction",  cast(void**)& gtk_widget_set_default_direction},
+    { "gtk_widget_get_direction",  cast(void**)& gtk_widget_get_direction},
+    { "gtk_widget_set_direction",  cast(void**)& gtk_widget_set_direction},
+    { "gtk_widget_get_default_visual",  cast(void**)& gtk_widget_get_default_visual},
+    { "gtk_widget_get_default_colormap",  cast(void**)& gtk_widget_get_default_colormap},
+    { "gtk_widget_get_default_style",  cast(void**)& gtk_widget_get_default_style},
+    { "gtk_widget_set_default_colormap",  cast(void**)& gtk_widget_set_default_colormap},
+    { "gtk_widget_style_get",  cast(void**)& gtk_widget_style_get},
+    { "gtk_widget_style_get_valist",  cast(void**)& gtk_widget_style_get_valist},
+    { "gtk_widget_style_get_property",  cast(void**)& gtk_widget_style_get_property},
+    { "gtk_widget_class_list_style_properties",  cast(void**)& gtk_widget_class_list_style_properties},
+    { "gtk_widget_class_find_style_property",  cast(void**)& gtk_widget_class_find_style_property},
+    { "gtk_widget_class_install_style_property_parser",  cast(void**)& gtk_widget_class_install_style_property_parser},
+    { "gtk_widget_class_install_style_property",  cast(void**)& gtk_widget_class_install_style_property},
+    { "gtk_widget_pop_colormap",  cast(void**)& gtk_widget_pop_colormap},
+    { "gtk_widget_pop_composite_child",  cast(void**)& gtk_widget_pop_composite_child},
+    { "gtk_widget_push_composite_child",  cast(void**)& gtk_widget_push_composite_child},
+    { "gtk_widget_push_colormap",  cast(void**)& gtk_widget_push_colormap},
+    { "gtk_widget_reset_rc_styles",  cast(void**)& gtk_widget_reset_rc_styles},
+    { "gtk_widget_get_composite_name",  cast(void**)& gtk_widget_get_composite_name},
+    { "gtk_widget_set_composite_name",  cast(void**)& gtk_widget_set_composite_name},
+    { "gtk_widget_render_icon",  cast(void**)& gtk_widget_render_icon},
+    { "gtk_widget_create_pango_layout",  cast(void**)& gtk_widget_create_pango_layout},
+    { "gtk_widget_get_pango_context",  cast(void**)& gtk_widget_get_pango_context},
+    { "gtk_widget_create_pango_context",  cast(void**)& gtk_widget_create_pango_context},
+    { "gtk_widget_modify_font",  cast(void**)& gtk_widget_modify_font},
+    { "gtk_widget_modify_cursor",  cast(void**)& gtk_widget_modify_cursor},
+    { "gtk_widget_modify_base",  cast(void**)& gtk_widget_modify_base},
+    { "gtk_widget_modify_text",  cast(void**)& gtk_widget_modify_text},
+    { "gtk_widget_modify_bg",  cast(void**)& gtk_widget_modify_bg},
+    { "gtk_widget_modify_fg",  cast(void**)& gtk_widget_modify_fg},
+    { "gtk_widget_get_modifier_style",  cast(void**)& gtk_widget_get_modifier_style},
+    { "gtk_widget_modify_style",  cast(void**)& gtk_widget_modify_style},
+    { "gtk_widget_get_style",  cast(void**)& gtk_widget_get_style},
+    { "gtk_widget_ensure_style",  cast(void**)& gtk_widget_ensure_style},
+    { "gtk_widget_set_style",  cast(void**)& gtk_widget_set_style},
+    { "gtk_widget_hide_on_delete",  cast(void**)& gtk_widget_hide_on_delete},
+    { "gtk_widget_translate_coordinates",  cast(void**)& gtk_widget_translate_coordinates},
+    { "gtk_widget_is_ancestor",  cast(void**)& gtk_widget_is_ancestor},
+    { "gtk_widget_get_pointer",  cast(void**)& gtk_widget_get_pointer},
+    { "gtk_widget_get_events",  cast(void**)& gtk_widget_get_events},
+    { "gtk_widget_set_colormap",  cast(void**)& gtk_widget_set_colormap},
+    { "gtk_widget_get_accessible",  cast(void**)& gtk_widget_get_accessible},
+    { "gtk_widget_get_clipboard",  cast(void**)& gtk_widget_get_clipboard},
+    { "gtk_widget_get_settings",  cast(void**)& gtk_widget_get_settings},
+    { "gtk_widget_get_root_window",  cast(void**)& gtk_widget_get_root_window},
+    { "gtk_widget_get_display",  cast(void**)& gtk_widget_get_display},
+    { "gtk_widget_has_screen",  cast(void**)& gtk_widget_has_screen},
+    { "gtk_widget_get_screen",  cast(void**)& gtk_widget_get_screen},
+    { "gtk_widget_get_visual",  cast(void**)& gtk_widget_get_visual},
+    { "gtk_widget_get_colormap",  cast(void**)& gtk_widget_get_colormap},
+    { "gtk_widget_get_ancestor",  cast(void**)& gtk_widget_get_ancestor},
+    { "gtk_widget_get_toplevel",  cast(void**)& gtk_widget_get_toplevel},
+    { "gtk_widget_get_extension_events",  cast(void**)& gtk_widget_get_extension_events},
+    { "gtk_widget_set_extension_events",  cast(void**)& gtk_widget_set_extension_events},
+    { "gtk_widget_add_events",  cast(void**)& gtk_widget_add_events},
+    { "gtk_widget_set_events",  cast(void**)& gtk_widget_set_events},
+    { "gtk_widget_set_usize",  cast(void**)& gtk_widget_set_usize},
+    { "gtk_widget_set_uposition",  cast(void**)& gtk_widget_set_uposition},
+    { "gtk_widget_get_size_request",  cast(void**)& gtk_widget_get_size_request},
+    { "gtk_widget_set_size_request",  cast(void**)& gtk_widget_set_size_request},
+    { "gtk_widget_error_bell",  cast(void**)& gtk_widget_error_bell},
+    { "gtk_widget_keynav_failed",  cast(void**)& gtk_widget_keynav_failed},
+    { "gtk_widget_child_focus",  cast(void**)& gtk_widget_child_focus},
+    { "gtk_widget_get_parent_window",  cast(void**)& gtk_widget_get_parent_window},
+    { "gtk_widget_get_parent",  cast(void**)& gtk_widget_get_parent},
+    { "gtk_widget_get_child_visible",  cast(void**)& gtk_widget_get_child_visible},
+    { "gtk_widget_set_child_visible",  cast(void**)& gtk_widget_set_child_visible},
+    { "gtk_widget_set_parent_window",  cast(void**)& gtk_widget_set_parent_window},
+    { "gtk_widget_set_parent",  cast(void**)& gtk_widget_set_parent},
+    { "gtk_widget_set_redraw_on_allocate",  cast(void**)& gtk_widget_set_redraw_on_allocate},
+    { "gtk_widget_set_double_buffered",  cast(void**)& gtk_widget_set_double_buffered},
+    { "gtk_widget_set_app_paintable",  cast(void**)& gtk_widget_set_app_paintable},
+    { "gtk_widget_set_sensitive",  cast(void**)& gtk_widget_set_sensitive},
+    { "gtk_widget_set_state",  cast(void**)& gtk_widget_set_state},
+    { "gtk_widget_get_name",  cast(void**)& gtk_widget_get_name},
+    { "gtk_widget_set_name",  cast(void**)& gtk_widget_set_name},
+    { "gtk_widget_grab_default",  cast(void**)& gtk_widget_grab_default},
+    { "gtk_widget_grab_focus",  cast(void**)& gtk_widget_grab_focus},
+    { "gtk_widget_is_focus",  cast(void**)& gtk_widget_is_focus},
+    { "gtk_widget_thaw_child_notify",  cast(void**)& gtk_widget_thaw_child_notify},
+    { "gtk_widget_child_notify",  cast(void**)& gtk_widget_child_notify},
+    { "gtk_widget_freeze_child_notify",  cast(void**)& gtk_widget_freeze_child_notify},
+    { "gtk_widget_region_intersect",  cast(void**)& gtk_widget_region_intersect},
+    { "gtk_widget_intersect",  cast(void**)& gtk_widget_intersect},
+    { "gtk_widget_reparent",  cast(void**)& gtk_widget_reparent},
+    { "gtk_widget_set_scroll_adjustments",  cast(void**)& gtk_widget_set_scroll_adjustments},
+    { "gtk_widget_activate",  cast(void**)& gtk_widget_activate},
+    { "gtk_widget_send_expose",  cast(void**)& gtk_widget_send_expose},
+    { "gtk_widget_event",  cast(void**)& gtk_widget_event},
+    { "gtk_widget_mnemonic_activate",  cast(void**)& gtk_widget_mnemonic_activate},
+    { "gtk_widget_can_activate_accel",  cast(void**)& gtk_widget_can_activate_accel},
+    { "gtk_widget_list_accel_closures",  cast(void**)& gtk_widget_list_accel_closures},
+//     { "_gtk_widget_get_accel_path",  cast(void**)& _gtk_widget_get_accel_path},
+    { "gtk_widget_set_accel_path",  cast(void**)& gtk_widget_set_accel_path},
+    { "gtk_widget_remove_accelerator",  cast(void**)& gtk_widget_remove_accelerator},
+    { "gtk_widget_add_accelerator",  cast(void**)& gtk_widget_add_accelerator},
+    { "gtk_widget_get_child_requisition",  cast(void**)& gtk_widget_get_child_requisition},
+    { "gtk_widget_size_allocate",  cast(void**)& gtk_widget_size_allocate},
+    { "gtk_widget_size_request",  cast(void**)& gtk_widget_size_request},
+    { "gtk_widget_draw",  cast(void**)& gtk_widget_draw},
+    { "gtk_widget_queue_resize_no_redraw",  cast(void**)& gtk_widget_queue_resize_no_redraw},
+    { "gtk_widget_queue_resize",  cast(void**)& gtk_widget_queue_resize},
+    { "gtk_widget_queue_clear_area",  cast(void**)& gtk_widget_queue_clear_area},
+    { "gtk_widget_queue_clear",  cast(void**)& gtk_widget_queue_clear},
+    { "gtk_widget_queue_draw_area",  cast(void**)& gtk_widget_queue_draw_area},
+    { "gtk_widget_queue_draw",  cast(void**)& gtk_widget_queue_draw},
+    { "gtk_widget_unrealize",  cast(void**)& gtk_widget_unrealize},
+    { "gtk_widget_realize",  cast(void**)& gtk_widget_realize},
+    { "gtk_widget_unmap",  cast(void**)& gtk_widget_unmap},
+    { "gtk_widget_map",  cast(void**)& gtk_widget_map},
+    { "gtk_widget_get_no_show_all",  cast(void**)& gtk_widget_get_no_show_all},
+    { "gtk_widget_set_no_show_all",  cast(void**)& gtk_widget_set_no_show_all},
+    { "gtk_widget_hide_all",  cast(void**)& gtk_widget_hide_all},
+    { "gtk_widget_show_all",  cast(void**)& gtk_widget_show_all},
+    { "gtk_widget_hide",  cast(void**)& gtk_widget_hide},
+    { "gtk_widget_show_now",  cast(void**)& gtk_widget_show_now},
+    { "gtk_widget_show",  cast(void**)& gtk_widget_show},
+    { "gtk_widget_unparent",  cast(void**)& gtk_widget_unparent},
+    { "gtk_widget_set",  cast(void**)& gtk_widget_set},
+    { "gtk_widget_unref",  cast(void**)& gtk_widget_unref},
+    { "gtk_widget_ref",  cast(void**)& gtk_widget_ref},
+    { "gtk_widget_destroyed",  cast(void**)& gtk_widget_destroyed},
+    { "gtk_widget_destroy",  cast(void**)& gtk_widget_destroy},
+    { "gtk_widget_new",  cast(void**)& gtk_widget_new},
+    { "gtk_widget_get_type",  cast(void**)& gtk_widget_get_type},
+//     { "_gtk_settings_parse_convert",  cast(void**)& _gtk_settings_parse_convert},
+//     { "_gtk_rc_property_parser_from_type",  cast(void**)& _gtk_rc_property_parser_from_type},
+//     { "_gtk_settings_handle_event",  cast(void**)& _gtk_settings_handle_event},
+//     { "_gtk_settings_reset_rc_values",  cast(void**)& _gtk_settings_reset_rc_values},
+//     { "_gtk_settings_set_property_value_from_rc",  cast(void**)& _gtk_settings_set_property_value_from_rc},
+    { "gtk_settings_set_double_property",  cast(void**)& gtk_settings_set_double_property},
+    { "gtk_settings_set_long_property",  cast(void**)& gtk_settings_set_long_property},
+    { "gtk_settings_set_string_property",  cast(void**)& gtk_settings_set_string_property},
+    { "gtk_settings_set_property_value",  cast(void**)& gtk_settings_set_property_value},
+    { "gtk_rc_property_parse_border",  cast(void**)& gtk_rc_property_parse_border},
+    { "gtk_rc_property_parse_requisition",  cast(void**)& gtk_rc_property_parse_requisition},
+    { "gtk_rc_property_parse_flags",  cast(void**)& gtk_rc_property_parse_flags},
+    { "gtk_rc_property_parse_enum",  cast(void**)& gtk_rc_property_parse_enum},
+    { "gtk_rc_property_parse_color",  cast(void**)& gtk_rc_property_parse_color},
+    { "gtk_settings_install_property_parser",  cast(void**)& gtk_settings_install_property_parser},
+    { "gtk_settings_install_property",  cast(void**)& gtk_settings_install_property},
+    { "gtk_settings_get_for_screen",  cast(void**)& gtk_settings_get_for_screen},
+    { "gtk_settings_get_default",  cast(void**)& gtk_settings_get_default},
+    { "gtk_settings_get_type",  cast(void**)& gtk_settings_get_type},
+//     { "_gtk_rc_context_destroy",  cast(void**)& _gtk_rc_context_destroy},
+//     { "_gtk_rc_context_get_default_font_name",  cast(void**)& _gtk_rc_context_get_default_font_name},
+//     { "_gtk_rc_style_get_color_hashes",  cast(void**)& _gtk_rc_style_get_color_hashes},
+//     { "_gtk_rc_style_unset_rc_property",  cast(void**)& _gtk_rc_style_unset_rc_property},
+//     { "_gtk_rc_style_set_rc_property",  cast(void**)& _gtk_rc_style_set_rc_property},
+//     { "_gtk_rc_style_lookup_rc_property",  cast(void**)& _gtk_rc_style_lookup_rc_property},
+    { "gtk_rc_parse_priority",  cast(void**)& gtk_rc_parse_priority},
+    { "gtk_rc_parse_state",  cast(void**)& gtk_rc_parse_state},
+    { "gtk_rc_parse_color_full",  cast(void**)& gtk_rc_parse_color_full},
+    { "gtk_rc_parse_color",  cast(void**)& gtk_rc_parse_color},
+    { "gtk_rc_scanner_new",  cast(void**)& gtk_rc_scanner_new},
+    { "gtk_rc_get_im_module_file",  cast(void**)& gtk_rc_get_im_module_file},
+    { "gtk_rc_get_im_module_path",  cast(void**)& gtk_rc_get_im_module_path},
+    { "gtk_rc_get_module_dir",  cast(void**)& gtk_rc_get_module_dir},
+    { "gtk_rc_get_theme_dir",  cast(void**)& gtk_rc_get_theme_dir},
+    { "gtk_rc_find_module_in_path",  cast(void**)& gtk_rc_find_module_in_path},
+    { "gtk_rc_style_unref",  cast(void**)& gtk_rc_style_unref},
+    { "gtk_rc_style_ref",  cast(void**)& gtk_rc_style_ref},
+    { "gtk_rc_style_copy",  cast(void**)& gtk_rc_style_copy},
+    { "gtk_rc_style_new",  cast(void**)& gtk_rc_style_new},
+    { "gtk_rc_style_get_type",  cast(void**)& gtk_rc_style_get_type},
+    { "gtk_rc_add_class_style",  cast(void**)& gtk_rc_add_class_style},
+    { "gtk_rc_add_widget_class_style",  cast(void**)& gtk_rc_add_widget_class_style},
+    { "gtk_rc_add_widget_name_style",  cast(void**)& gtk_rc_add_widget_name_style},
+    { "gtk_rc_reparse_all",  cast(void**)& gtk_rc_reparse_all},
+    { "gtk_rc_parse_string",  cast(void**)& gtk_rc_parse_string},
+    { "gtk_rc_parse",  cast(void**)& gtk_rc_parse},
+    { "gtk_rc_find_pixmap_in_path",  cast(void**)& gtk_rc_find_pixmap_in_path},
+    { "gtk_rc_reset_styles",  cast(void**)& gtk_rc_reset_styles},
+    { "gtk_rc_reparse_all_for_settings",  cast(void**)& gtk_rc_reparse_all_for_settings},
+    { "gtk_rc_get_style_by_paths",  cast(void**)& gtk_rc_get_style_by_paths},
+    { "gtk_rc_get_style",  cast(void**)& gtk_rc_get_style},
+    { "gtk_rc_get_default_files",  cast(void**)& gtk_rc_get_default_files},
+    { "gtk_rc_set_default_files",  cast(void**)& gtk_rc_set_default_files},
+    { "gtk_rc_add_default_file",  cast(void**)& gtk_rc_add_default_file},
+//     { "_gtk_rc_match_widget_class",  cast(void**)& _gtk_rc_match_widget_class},
+//     { "_gtk_rc_free_widget_class_path",  cast(void**)& _gtk_rc_free_widget_class_path},
+//     { "_gtk_rc_parse_widget_class_path",  cast(void**)& _gtk_rc_parse_widget_class_path},
+//     { "_gtk_rc_init",  cast(void**)& _gtk_rc_init},
+//     { "_gtk_widget_get_cursor_color",  cast(void**)& _gtk_widget_get_cursor_color},
+//     { "_gtk_widget_get_cursor_gc",  cast(void**)& _gtk_widget_get_cursor_gc},
+    { "gtk_draw_insertion_cursor",  cast(void**)& gtk_draw_insertion_cursor},
+    { "gtk_paint_string",  cast(void**)& gtk_paint_string},
+    { "gtk_draw_string",  cast(void**)& gtk_draw_string},
+//     { "_gtk_style_shade",  cast(void**)& _gtk_style_shade},
+//     { "_gtk_style_init_for_settings",  cast(void**)& _gtk_style_init_for_settings},
+//     { "_gtk_style_peek_property_value",  cast(void**)& _gtk_style_peek_property_value},
+    { "gtk_border_free",  cast(void**)& gtk_border_free},
+    { "gtk_border_copy",  cast(void**)& gtk_border_copy},
+    { "gtk_border_get_type",  cast(void**)& gtk_border_get_type},
+    { "gtk_paint_resize_grip",  cast(void**)& gtk_paint_resize_grip},
+    { "gtk_paint_layout",  cast(void**)& gtk_paint_layout},
+    { "gtk_paint_expander",  cast(void**)& gtk_paint_expander},
+    { "gtk_paint_handle",  cast(void**)& gtk_paint_handle},
+    { "gtk_paint_slider",  cast(void**)& gtk_paint_slider},
+    { "gtk_paint_focus",  cast(void**)& gtk_paint_focus},
+    { "gtk_paint_extension",  cast(void**)& gtk_paint_extension},
+    { "gtk_paint_box_gap",  cast(void**)& gtk_paint_box_gap},
+    { "gtk_paint_shadow_gap",  cast(void**)& gtk_paint_shadow_gap},
+    { "gtk_paint_tab",  cast(void**)& gtk_paint_tab},
+    { "gtk_paint_option",  cast(void**)& gtk_paint_option},
+    { "gtk_paint_check",  cast(void**)& gtk_paint_check},
+    { "gtk_paint_flat_box",  cast(void**)& gtk_paint_flat_box},
+    { "gtk_paint_box",  cast(void**)& gtk_paint_box},
+    { "gtk_paint_diamond",  cast(void**)& gtk_paint_diamond},
+    { "gtk_paint_arrow",  cast(void**)& gtk_paint_arrow},
+    { "gtk_paint_polygon",  cast(void**)& gtk_paint_polygon},
+    { "gtk_paint_shadow",  cast(void**)& gtk_paint_shadow},
+    { "gtk_paint_vline",  cast(void**)& gtk_paint_vline},
+    { "gtk_paint_hline",  cast(void**)& gtk_paint_hline},
+    { "gtk_draw_resize_grip",  cast(void**)& gtk_draw_resize_grip},
+    { "gtk_draw_layout",  cast(void**)& gtk_draw_layout},
+    { "gtk_draw_expander",  cast(void**)& gtk_draw_expander},
+    { "gtk_draw_handle",  cast(void**)& gtk_draw_handle},
+    { "gtk_draw_slider",  cast(void**)& gtk_draw_slider},
+    { "gtk_draw_focus",  cast(void**)& gtk_draw_focus},
+    { "gtk_draw_extension",  cast(void**)& gtk_draw_extension},
+    { "gtk_draw_box_gap",  cast(void**)& gtk_draw_box_gap},
+    { "gtk_draw_shadow_gap",  cast(void**)& gtk_draw_shadow_gap},
+    { "gtk_draw_tab",  cast(void**)& gtk_draw_tab},
+    { "gtk_draw_option",  cast(void**)& gtk_draw_option},
+    { "gtk_draw_check",  cast(void**)& gtk_draw_check},
+    { "gtk_draw_flat_box",  cast(void**)& gtk_draw_flat_box},
+    { "gtk_draw_box",  cast(void**)& gtk_draw_box},
+    { "gtk_draw_diamond",  cast(void**)& gtk_draw_diamond},
+    { "gtk_draw_arrow",  cast(void**)& gtk_draw_arrow},
+    { "gtk_draw_polygon",  cast(void**)& gtk_draw_polygon},
+    { "gtk_draw_shadow",  cast(void**)& gtk_draw_shadow},
+    { "gtk_draw_vline",  cast(void**)& gtk_draw_vline},
+    { "gtk_draw_hline",  cast(void**)& gtk_draw_hline},
+    { "gtk_style_render_icon",  cast(void**)& gtk_style_render_icon},
+    { "gtk_style_lookup_color",  cast(void**)& gtk_style_lookup_color},
+    { "gtk_style_lookup_icon_set",  cast(void**)& gtk_style_lookup_icon_set},
+    { "gtk_style_apply_default_background",  cast(void**)& gtk_style_apply_default_background},
+    { "gtk_style_set_background",  cast(void**)& gtk_style_set_background},
+    { "gtk_style_set_font",  cast(void**)& gtk_style_set_font},
+    { "gtk_style_get_font",  cast(void**)& gtk_style_get_font},
+    { "gtk_style_unref",  cast(void**)& gtk_style_unref},
+    { "gtk_style_ref",  cast(void**)& gtk_style_ref},
+    { "gtk_style_detach",  cast(void**)& gtk_style_detach},
+    { "gtk_style_attach",  cast(void**)& gtk_style_attach},
+    { "gtk_style_copy",  cast(void**)& gtk_style_copy},
+    { "gtk_style_new",  cast(void**)& gtk_style_new},
+    { "gtk_style_get_type",  cast(void**)& gtk_style_get_type},
+    { "gtk_adjustment_set_value",  cast(void**)& gtk_adjustment_set_value},
+    { "gtk_adjustment_get_value",  cast(void**)& gtk_adjustment_get_value},
+    { "gtk_adjustment_clamp_page",  cast(void**)& gtk_adjustment_clamp_page},
+    { "gtk_adjustment_value_changed",  cast(void**)& gtk_adjustment_value_changed},
+    { "gtk_adjustment_changed",  cast(void**)& gtk_adjustment_changed},
+    { "gtk_adjustment_new",  cast(void**)& gtk_adjustment_new},
+    { "gtk_adjustment_get_type",  cast(void**)& gtk_adjustment_get_type},
+    { "gtk_object_add_arg_type",  cast(void**)& gtk_object_add_arg_type},
+    { "gtk_object_set",  cast(void**)& gtk_object_set},
+    { "gtk_object_get",  cast(void**)& gtk_object_get},
+    { "gtk_object_remove_no_notify_by_id",  cast(void**)& gtk_object_remove_no_notify_by_id},
+    { "gtk_object_remove_data_by_id",  cast(void**)& gtk_object_remove_data_by_id},
+    { "gtk_object_get_data_by_id",  cast(void**)& gtk_object_get_data_by_id},
+    { "gtk_object_set_data_by_id_full",  cast(void**)& gtk_object_set_data_by_id_full},
+    { "gtk_object_set_data_by_id",  cast(void**)& gtk_object_set_data_by_id},
+    { "gtk_object_get_user_data",  cast(void**)& gtk_object_get_user_data},
+    { "gtk_object_set_user_data",  cast(void**)& gtk_object_set_user_data},
+    { "gtk_object_remove_no_notify",  cast(void**)& gtk_object_remove_no_notify},
+    { "gtk_object_get_data",  cast(void**)& gtk_object_get_data},
+    { "gtk_object_remove_data",  cast(void**)& gtk_object_remove_data},
+    { "gtk_object_set_data_full",  cast(void**)& gtk_object_set_data_full},
+    { "gtk_object_set_data",  cast(void**)& gtk_object_set_data},
+    { "gtk_object_weakunref",  cast(void**)& gtk_object_weakunref},
+    { "gtk_object_weakref",  cast(void**)& gtk_object_weakref},
+    { "gtk_object_unref",  cast(void**)& gtk_object_unref},
+    { "gtk_object_ref",  cast(void**)& gtk_object_ref},
+    { "gtk_object_new",  cast(void**)& gtk_object_new},
+    { "gtk_object_destroy",  cast(void**)& gtk_object_destroy},
+    { "gtk_object_sink",  cast(void**)& gtk_object_sink},
+    { "gtk_object_get_type",  cast(void**)& gtk_object_get_type},
+    { "gtk_debug_flags",  cast(void**)& gtk_debug_flags},
+    { "gtk_type_init",  cast(void**)& gtk_type_init},
+    { "gtk_type_flags_find_value",  cast(void**)& gtk_type_flags_find_value},
+    { "gtk_type_enum_find_value",  cast(void**)& gtk_type_enum_find_value},
+    { "gtk_type_flags_get_values",  cast(void**)& gtk_type_flags_get_values},
+    { "gtk_type_enum_get_values",  cast(void**)& gtk_type_enum_get_values},
+    { "gtk_type_new",  cast(void**)& gtk_type_new},
+    { "gtk_type_unique",  cast(void**)& gtk_type_unique},
+    { "gtk_type_class",  cast(void**)& gtk_type_class},
+    { "gtk_identifier_get_type",  cast(void**)& gtk_identifier_get_type},
+    { "gtk_widget_help_type_get_type",  cast(void**)& gtk_widget_help_type_get_type},
+    { "gtk_widget_flags_get_type",  cast(void**)& gtk_widget_flags_get_type},
+    { "gtk_ui_manager_item_type_get_type",  cast(void**)& gtk_ui_manager_item_type_get_type},
+    { "gtk_tree_view_column_sizing_get_type",  cast(void**)& gtk_tree_view_column_sizing_get_type},
+    { "gtk_tree_view_drop_position_get_type",  cast(void**)& gtk_tree_view_drop_position_get_type},
+    { "gtk_tree_model_flags_get_type",  cast(void**)& gtk_tree_model_flags_get_type},
+    { "gtk_tree_view_mode_get_type",  cast(void**)& gtk_tree_view_mode_get_type},
+    { "gtk_toolbar_space_style_get_type",  cast(void**)& gtk_toolbar_space_style_get_type},
+    { "gtk_toolbar_child_type_get_type",  cast(void**)& gtk_toolbar_child_type_get_type},
+    { "gtk_text_window_type_get_type",  cast(void**)& gtk_text_window_type_get_type},
+    { "gtk_text_search_flags_get_type",  cast(void**)& gtk_text_search_flags_get_type},
+    { "gtk_text_buffer_target_info_get_type",  cast(void**)& gtk_text_buffer_target_info_get_type},
+    { "gtk_spin_type_get_type",  cast(void**)& gtk_spin_type_get_type},
+    { "gtk_spin_button_update_policy_get_type",  cast(void**)& gtk_spin_button_update_policy_get_type},
+    { "gtk_size_group_mode_get_type",  cast(void**)& gtk_size_group_mode_get_type},
+    { "gtk_recent_manager_error_get_type",  cast(void**)& gtk_recent_manager_error_get_type},
+    { "gtk_recent_filter_flags_get_type",  cast(void**)& gtk_recent_filter_flags_get_type},
+    { "gtk_recent_chooser_error_get_type",  cast(void**)& gtk_recent_chooser_error_get_type},
+    { "gtk_recent_sort_type_get_type",  cast(void**)& gtk_recent_sort_type_get_type},
+    { "gtk_rc_token_type_get_type",  cast(void**)& gtk_rc_token_type_get_type},
+    { "gtk_rc_flags_get_type",  cast(void**)& gtk_rc_flags_get_type},
+    { "gtk_progress_bar_orientation_get_type",  cast(void**)& gtk_progress_bar_orientation_get_type},
+    { "gtk_progress_bar_style_get_type",  cast(void**)& gtk_progress_bar_style_get_type},
+    { "gtk_private_flags_get_type",  cast(void**)& gtk_private_flags_get_type},
+    { "gtk_print_error_get_type",  cast(void**)& gtk_print_error_get_type},
+    { "gtk_print_operation_action_get_type",  cast(void**)& gtk_print_operation_action_get_type},
+    { "gtk_print_operation_result_get_type",  cast(void**)& gtk_print_operation_result_get_type},
+    { "gtk_print_status_get_type",  cast(void**)& gtk_print_status_get_type},
+    { "gtk_arg_flags_get_type",  cast(void**)& gtk_arg_flags_get_type},
+    { "gtk_object_flags_get_type",  cast(void**)& gtk_object_flags_get_type},
+    { "gtk_notebook_tab_get_type",  cast(void**)& gtk_notebook_tab_get_type},
+    { "gtk_buttons_type_get_type",  cast(void**)& gtk_buttons_type_get_type},
+    { "gtk_message_type_get_type",  cast(void**)& gtk_message_type_get_type},
+    { "gtk_image_type_get_type",  cast(void**)& gtk_image_type_get_type},
+    { "gtk_icon_view_drop_position_get_type",  cast(void**)& gtk_icon_view_drop_position_get_type},
+    { "gtk_icon_theme_error_get_type",  cast(void**)& gtk_icon_theme_error_get_type},
+    { "gtk_icon_lookup_flags_get_type",  cast(void**)& gtk_icon_lookup_flags_get_type},
+    { "gtk_file_filter_flags_get_type",  cast(void**)& gtk_file_filter_flags_get_type},
+    { "gtk_file_chooser_error_get_type",  cast(void**)& gtk_file_chooser_error_get_type},
+    { "gtk_file_chooser_confirmation_get_type",  cast(void**)& gtk_file_chooser_confirmation_get_type},
+    { "gtk_file_chooser_action_get_type",  cast(void**)& gtk_file_chooser_action_get_type},
+    { "gtk_drag_result_get_type",  cast(void**)& gtk_drag_result_get_type},
+    { "gtk_tree_view_grid_lines_get_type",  cast(void**)& gtk_tree_view_grid_lines_get_type},
+    { "gtk_unit_get_type",  cast(void**)& gtk_unit_get_type},
+    { "gtk_print_duplex_get_type",  cast(void**)& gtk_print_duplex_get_type},
+    { "gtk_print_quality_get_type",  cast(void**)& gtk_print_quality_get_type},
+    { "gtk_page_orientation_get_type",  cast(void**)& gtk_page_orientation_get_type},
+    { "gtk_page_set_get_type",  cast(void**)& gtk_page_set_get_type},
+    { "gtk_print_pages_get_type",  cast(void**)& gtk_print_pages_get_type},
+    { "gtk_pack_direction_get_type",  cast(void**)& gtk_pack_direction_get_type},
+    { "gtk_im_status_style_get_type",  cast(void**)& gtk_im_status_style_get_type},
+    { "gtk_im_preedit_style_get_type",  cast(void**)& gtk_im_preedit_style_get_type},
+    { "gtk_sort_type_get_type",  cast(void**)& gtk_sort_type_get_type},
+    { "gtk_wrap_mode_get_type",  cast(void**)& gtk_wrap_mode_get_type},
+    { "gtk_window_type_get_type",  cast(void**)& gtk_window_type_get_type},
+    { "gtk_window_position_get_type",  cast(void**)& gtk_window_position_get_type},
+    { "gtk_visibility_get_type",  cast(void**)& gtk_visibility_get_type},
+    { "gtk_update_type_get_type",  cast(void**)& gtk_update_type_get_type},
+    { "gtk_toolbar_style_get_type",  cast(void**)& gtk_toolbar_style_get_type},
+    { "gtk_submenu_placement_get_type",  cast(void**)& gtk_submenu_placement_get_type},
+    { "gtk_submenu_direction_get_type",  cast(void**)& gtk_submenu_direction_get_type},
+    { "gtk_state_type_get_type",  cast(void**)& gtk_state_type_get_type},
+    { "gtk_shadow_type_get_type",  cast(void**)& gtk_shadow_type_get_type},
+    { "gtk_selection_mode_get_type",  cast(void**)& gtk_selection_mode_get_type},
+    { "gtk_scroll_type_get_type",  cast(void**)& gtk_scroll_type_get_type},
+    { "gtk_signal_run_type_get_type",  cast(void**)& gtk_signal_run_type_get_type},
+    { "gtk_resize_mode_get_type",  cast(void**)& gtk_resize_mode_get_type},
+    { "gtk_relief_style_get_type",  cast(void**)& gtk_relief_style_get_type},
+    { "gtk_preview_type_get_type",  cast(void**)& gtk_preview_type_get_type},
+    { "gtk_position_type_get_type",  cast(void**)& gtk_position_type_get_type},
+    { "gtk_policy_type_get_type",  cast(void**)& gtk_policy_type_get_type},
+    { "gtk_path_type_get_type",  cast(void**)& gtk_path_type_get_type},
+    { "gtk_path_priority_type_get_type",  cast(void**)& gtk_path_priority_type_get_type},
+    { "gtk_pack_type_get_type",  cast(void**)& gtk_pack_type_get_type},
+    { "gtk_corner_type_get_type",  cast(void**)& gtk_corner_type_get_type},
+    { "gtk_orientation_get_type",  cast(void**)& gtk_orientation_get_type},
+    { "gtk_scroll_step_get_type",  cast(void**)& gtk_scroll_step_get_type},
+    { "gtk_movement_step_get_type",  cast(void**)& gtk_movement_step_get_type},
+    { "gtk_metric_type_get_type",  cast(void**)& gtk_metric_type_get_type},
+    { "gtk_menu_direction_type_get_type",  cast(void**)& gtk_menu_direction_type_get_type},
+    { "gtk_match_type_get_type",  cast(void**)& gtk_match_type_get_type},
+    { "gtk_justification_get_type",  cast(void**)& gtk_justification_get_type},
+    { "gtk_text_direction_get_type",  cast(void**)& gtk_text_direction_get_type},
+    { "gtk_side_type_get_type",  cast(void**)& gtk_side_type_get_type},
+    { "gtk_sensitivity_type_get_type",  cast(void**)& gtk_sensitivity_type_get_type},
+    { "gtk_icon_size_get_type",  cast(void**)& gtk_icon_size_get_type},
+    { "gtk_expander_style_get_type",  cast(void**)& gtk_expander_style_get_type},
+    { "gtk_direction_type_get_type",  cast(void**)& gtk_direction_type_get_type},
+    { "gtk_delete_type_get_type",  cast(void**)& gtk_delete_type_get_type},
+    { "gtk_curve_type_get_type",  cast(void**)& gtk_curve_type_get_type},
+    { "gtk_button_box_style_get_type",  cast(void**)& gtk_button_box_style_get_type},
+    { "gtk_attach_options_get_type",  cast(void**)& gtk_attach_options_get_type},
+    { "gtk_arrow_type_get_type",  cast(void**)& gtk_arrow_type_get_type},
+    { "gtk_anchor_type_get_type",  cast(void**)& gtk_anchor_type_get_type},
+    { "gtk_target_flags_get_type",  cast(void**)& gtk_target_flags_get_type},
+    { "gtk_dest_defaults_get_type",  cast(void**)& gtk_dest_defaults_get_type},
+    { "gtk_response_type_get_type",  cast(void**)& gtk_response_type_get_type},
+    { "gtk_dialog_flags_get_type",  cast(void**)& gtk_dialog_flags_get_type},
+    { "gtk_debug_flag_get_type",  cast(void**)& gtk_debug_flag_get_type},
+    { "gtk_ctree_expansion_type_get_type",  cast(void**)& gtk_ctree_expansion_type_get_type},
+    { "gtk_ctree_expander_style_get_type",  cast(void**)& gtk_ctree_expander_style_get_type},
+    { "gtk_ctree_line_style_get_type",  cast(void**)& gtk_ctree_line_style_get_type},
+    { "gtk_ctree_pos_get_type",  cast(void**)& gtk_ctree_pos_get_type},
+    { "gtk_button_action_get_type",  cast(void**)& gtk_button_action_get_type},
+    { "gtk_clist_drag_pos_get_type",  cast(void**)& gtk_clist_drag_pos_get_type},
+    { "gtk_cell_type_get_type",  cast(void**)& gtk_cell_type_get_type},
+    { "gtk_cell_renderer_accel_mode_get_type",  cast(void**)& gtk_cell_renderer_accel_mode_get_type},
+    { "gtk_cell_renderer_mode_get_type",  cast(void**)& gtk_cell_renderer_mode_get_type},
+    { "gtk_cell_renderer_state_get_type",  cast(void**)& gtk_cell_renderer_state_get_type},
+    { "gtk_calendar_display_options_get_type",  cast(void**)& gtk_calendar_display_options_get_type},
+    { "gtk_builder_error_get_type",  cast(void**)& gtk_builder_error_get_type},
+    { "gtk_assistant_page_type_get_type",  cast(void**)& gtk_assistant_page_type_get_type},
+    { "gtk_accel_flags_get_type",  cast(void**)& gtk_accel_flags_get_type},
+//     { "_gtk_accel_group_reconnect",  cast(void**)& _gtk_accel_group_reconnect},
+    { "gtk_accel_group_query",  cast(void**)& gtk_accel_group_query},
+    { "gtk_accelerator_get_default_mod_mask",  cast(void**)& gtk_accelerator_get_default_mod_mask},
+    { "gtk_accelerator_set_default_mod_mask",  cast(void**)& gtk_accelerator_set_default_mod_mask},
+    { "gtk_accelerator_get_label",  cast(void**)& gtk_accelerator_get_label},
+    { "gtk_accelerator_name",  cast(void**)& gtk_accelerator_name},
+    { "gtk_accelerator_parse",  cast(void**)& gtk_accelerator_parse},
+    { "gtk_accelerator_valid",  cast(void**)& gtk_accelerator_valid},
+    { "gtk_accel_group_from_accel_closure",  cast(void**)& gtk_accel_group_from_accel_closure},
+    { "gtk_accel_group_find",  cast(void**)& gtk_accel_group_find},
+    { "gtk_accel_groups_from_object",  cast(void**)& gtk_accel_groups_from_object},
+    { "gtk_accel_groups_activate",  cast(void**)& gtk_accel_groups_activate},
+//     { "_gtk_accel_group_detach",  cast(void**)& _gtk_accel_group_detach},
+//     { "_gtk_accel_group_attach",  cast(void**)& _gtk_accel_group_attach},
+    { "gtk_accel_group_activate",  cast(void**)& gtk_accel_group_activate},
+    { "gtk_accel_group_disconnect_key",  cast(void**)& gtk_accel_group_disconnect_key},
+    { "gtk_accel_group_disconnect",  cast(void**)& gtk_accel_group_disconnect},
+    { "gtk_accel_group_connect_by_path",  cast(void**)& gtk_accel_group_connect_by_path},
+    { "gtk_accel_group_connect",  cast(void**)& gtk_accel_group_connect},
+    { "gtk_accel_group_unlock",  cast(void**)& gtk_accel_group_unlock},
+    { "gtk_accel_group_lock",  cast(void**)& gtk_accel_group_lock},
+    { "gtk_accel_group_new",  cast(void**)& gtk_accel_group_new},
+    { "gtk_accel_group_get_type",  cast(void**)& gtk_accel_group_get_type},
+];
+
+} else { // version(DYNLINK)
+extern (C) _GtkWidget * gtk_vseparator_new();
+extern (C) uint gtk_vseparator_get_type();
+extern (C) _GtkWidget * gtk_vscale_new_with_range(double, double, double);
+extern (C) _GtkWidget * gtk_vscale_new(aGtkAdjustment *);
+extern (C) uint gtk_vscale_get_type();
+extern (C) _GtkWidget * gtk_vruler_new();
+extern (C) uint gtk_vruler_get_type();
+extern (C) _GtkWidget * gtk_vpaned_new();
+extern (C) uint gtk_vpaned_get_type();
+extern (C) _GtkWidget * gtk_volume_button_new();
+extern (C) uint gtk_volume_button_get_type();
+extern (C) void gtk_vbutton_box_set_layout_default(int);
+extern (C) int gtk_vbutton_box_get_layout_default();
+extern (C) void gtk_vbutton_box_set_spacing_default(int);
+extern (C) int gtk_vbutton_box_get_spacing_default();
+extern (C) _GtkWidget * gtk_vbutton_box_new();
+extern (C) uint gtk_vbutton_box_get_type();
+extern (C) uint gtk_ui_manager_new_merge_id(aGtkUIManager *);
+extern (C) void gtk_ui_manager_ensure_update(aGtkUIManager *);
+extern (C) char * gtk_ui_manager_get_ui(aGtkUIManager *);
+extern (C) void gtk_ui_manager_remove_ui(aGtkUIManager *, uint);
+extern (C) void gtk_ui_manager_add_ui(aGtkUIManager *, uint, char *, char *, char *, int, int);
+extern (C) uint gtk_ui_manager_add_ui_from_file(aGtkUIManager *, char *, _GError * *);
+extern (C) uint gtk_ui_manager_add_ui_from_string(aGtkUIManager *, char *, int, _GError * *);
+extern (C) _GtkAction * gtk_ui_manager_get_action(aGtkUIManager *, char *);
+extern (C) _GSList * gtk_ui_manager_get_toplevels(aGtkUIManager *, int);
+extern (C) _GtkWidget * gtk_ui_manager_get_widget(aGtkUIManager *, char *);
+extern (C) _GtkAccelGroup * gtk_ui_manager_get_accel_group(aGtkUIManager *);
+extern (C) _GList * gtk_ui_manager_get_action_groups(aGtkUIManager *);
+extern (C) void gtk_ui_manager_remove_action_group(aGtkUIManager *, aGtkActionGroup *);
+extern (C) void gtk_ui_manager_insert_action_group(aGtkUIManager *, aGtkActionGroup *, int);
+extern (C) int gtk_ui_manager_get_add_tearoffs(aGtkUIManager *);
+extern (C) void gtk_ui_manager_set_add_tearoffs(aGtkUIManager *, int);
+extern (C) _GtkUIManager * gtk_ui_manager_new();
+extern (C) uint gtk_ui_manager_get_type();
+extern (C) void gtk_tree_store_move_after(aGtkTreeStore *, aGtkTreeIter *, aGtkTreeIter *);
+extern (C) void gtk_tree_store_move_before(aGtkTreeStore *, aGtkTreeIter *, aGtkTreeIter *);
+extern (C) void gtk_tree_store_swap(aGtkTreeStore *, aGtkTreeIter *, aGtkTreeIter *);
+extern (C) void gtk_tree_store_reorder(aGtkTreeStore *, aGtkTreeIter *, int *);
+extern (C) int gtk_tree_store_iter_is_valid(aGtkTreeStore *, aGtkTreeIter *);
+extern (C) void gtk_tree_store_clear(aGtkTreeStore *);
+extern (C) int gtk_tree_store_iter_depth(aGtkTreeStore *, aGtkTreeIter *);
+extern (C) int gtk_tree_store_is_ancestor(aGtkTreeStore *, aGtkTreeIter *, aGtkTreeIter *);
+extern (C) void gtk_tree_store_append(aGtkTreeStore *, aGtkTreeIter *, aGtkTreeIter *);
+extern (C) void gtk_tree_store_prepend(aGtkTreeStore *, aGtkTreeIter *, aGtkTreeIter *);
+extern (C) void gtk_tree_store_insert_with_valuesv(aGtkTreeStore *, aGtkTreeIter *, aGtkTreeIter *, int, int *, _GValue *, int);
+extern (C) void gtk_tree_store_insert_with_values(aGtkTreeStore *, aGtkTreeIter *, aGtkTreeIter *, int, ...);
+extern (C) void gtk_tree_store_insert_after(aGtkTreeStore *, aGtkTreeIter *, aGtkTreeIter *, aGtkTreeIter *);
+extern (C) void gtk_tree_store_insert_before(aGtkTreeStore *, aGtkTreeIter *, aGtkTreeIter *, aGtkTreeIter *);
+extern (C) void gtk_tree_store_insert(aGtkTreeStore *, aGtkTreeIter *, aGtkTreeIter *, int);
+extern (C) int gtk_tree_store_remove(aGtkTreeStore *, aGtkTreeIter *);
+extern (C) void gtk_tree_store_set_valist(aGtkTreeStore *, aGtkTreeIter *, char *);
+extern (C) void gtk_tree_store_set_valuesv(aGtkTreeStore *, aGtkTreeIter *, int *, _GValue *, int);
+extern (C) void gtk_tree_store_set(aGtkTreeStore *, aGtkTreeIter *, ...);
+extern (C) void gtk_tree_store_set_value(aGtkTreeStore *, aGtkTreeIter *, int, _GValue *);
+extern (C) void gtk_tree_store_set_column_types(aGtkTreeStore *, int, uint *);
+extern (C) _GtkTreeStore * gtk_tree_store_newv(int, uint *);
+extern (C) _GtkTreeStore * gtk_tree_store_new(int, ...);
+extern (C) uint gtk_tree_store_get_type();
+extern (C) void gtk_tree_selection_unselect_range(aGtkTreeSelection *, void *, void *);
+extern (C) void gtk_tree_selection_select_range(aGtkTreeSelection *, void *, void *);
+extern (C) void gtk_tree_selection_unselect_all(aGtkTreeSelection *);
+extern (C) void gtk_tree_selection_select_all(aGtkTreeSelection *);
+extern (C) int gtk_tree_selection_iter_is_selected(aGtkTreeSelection *, aGtkTreeIter *);
+extern (C) int gtk_tree_selection_path_is_selected(aGtkTreeSelection *, void *);
+extern (C) void gtk_tree_selection_unselect_iter(aGtkTreeSelection *, aGtkTreeIter *);
+extern (C) void gtk_tree_selection_select_iter(aGtkTreeSelection *, aGtkTreeIter *);
+extern (C) void gtk_tree_selection_unselect_path(aGtkTreeSelection *, void *);
+extern (C) void gtk_tree_selection_select_path(aGtkTreeSelection *, void *);
+extern (C) void gtk_tree_selection_selected_foreach(aGtkTreeSelection *, _BCD_func__9093, void *);
+extern (C) int gtk_tree_selection_count_selected_rows(aGtkTreeSelection *);
+extern (C) _GList * gtk_tree_selection_get_selected_rows(aGtkTreeSelection *, void * *);
+extern (C) int gtk_tree_selection_get_selected(aGtkTreeSelection *, void * *, aGtkTreeIter *);
+extern (C) _GtkTreeView * gtk_tree_selection_get_tree_view(aGtkTreeSelection *);
+extern (C) void * gtk_tree_selection_get_user_data(aGtkTreeSelection *);
+extern (C) void gtk_tree_selection_set_select_function(aGtkTreeSelection *, _BCD_func__9094, void *, _BCD_func__13158);
+extern (C) int gtk_tree_selection_get_mode(aGtkTreeSelection *);
+extern (C) void gtk_tree_selection_set_mode(aGtkTreeSelection *, int);
+extern (C) uint gtk_tree_selection_get_type();
+extern (C) int gtk_tree_model_sort_iter_is_valid(aGtkTreeModelSort *, aGtkTreeIter *);
+extern (C) void gtk_tree_model_sort_clear_cache(aGtkTreeModelSort *);
+extern (C) void gtk_tree_model_sort_reset_default_sort_func(aGtkTreeModelSort *);
+extern (C) void gtk_tree_model_sort_convert_iter_to_child_iter(aGtkTreeModelSort *, aGtkTreeIter *, aGtkTreeIter *);
+extern (C) void * gtk_tree_model_sort_convert_path_to_child_path(aGtkTreeModelSort *, void *);
+extern (C) void gtk_tree_model_sort_convert_child_iter_to_iter(aGtkTreeModelSort *, aGtkTreeIter *, aGtkTreeIter *);
+extern (C) void * gtk_tree_model_sort_convert_child_path_to_path(aGtkTreeModelSort *, void *);
+extern (C) void * gtk_tree_model_sort_get_model(aGtkTreeModelSort *);
+extern (C) void * gtk_tree_model_sort_new_with_model(void *);
+extern (C) uint gtk_tree_model_sort_get_type();
+extern (C) int gtk_tree_get_row_drag_data(aGtkSelectionData *, void * *, void * *);
+extern (C) int gtk_tree_set_row_drag_data(aGtkSelectionData *, void *, void *);
+extern (C) int gtk_tree_drag_dest_row_drop_possible(void *, void *, aGtkSelectionData *);
+extern (C) int gtk_tree_drag_dest_drag_data_received(void *, void *, aGtkSelectionData *);
+extern (C) uint gtk_tree_drag_dest_get_type();
+extern (C) int gtk_tree_drag_source_drag_data_get(void *, void *, aGtkSelectionData *);
+extern (C) int gtk_tree_drag_source_drag_data_delete(void *, void *);
+extern (C) int gtk_tree_drag_source_row_draggable(void *, void *);
+extern (C) uint gtk_tree_drag_source_get_type();
+extern (C) void gtk_toolbar_insert_widget(aGtkToolbar *, aGtkWidget *, char *, char *, int);
+extern (C) void gtk_toolbar_prepend_widget(aGtkToolbar *, aGtkWidget *, char *, char *);
+extern (C) void gtk_toolbar_append_widget(aGtkToolbar *, aGtkWidget *, char *, char *);
+extern (C) _GtkWidget * gtk_toolbar_insert_element(aGtkToolbar *, int, aGtkWidget *, char *, char *, char *, aGtkWidget *, _BCD_func__12122, void *, int);
+extern (C) _GtkWidget * gtk_toolbar_prepend_element(aGtkToolbar *, int, aGtkWidget *, char *, char *, char *, aGtkWidget *, _BCD_func__12122, void *);
+extern (C) _GtkWidget * gtk_toolbar_append_element(aGtkToolbar *, int, aGtkWidget *, char *, char *, char *, aGtkWidget *, _BCD_func__12122, void *);
+extern (C) void gtk_toolbar_remove_space(aGtkToolbar *, int);
+extern (C) void gtk_toolbar_insert_space(aGtkToolbar *, int);
+extern (C) void gtk_toolbar_prepend_space(aGtkToolbar *);
+extern (C) void gtk_toolbar_append_space(aGtkToolbar *);
+extern (C) _GtkWidget * gtk_toolbar_insert_stock(aGtkToolbar *, char *, char *, char *, _BCD_func__12122, void *, int);
+extern (C) _GtkWidget * gtk_toolbar_insert_item(aGtkToolbar *, char *, char *, char *, aGtkWidget *, _BCD_func__12122, void *, int);
+extern (C) _GtkWidget * gtk_toolbar_prepend_item(aGtkToolbar *, char *, char *, char *, aGtkWidget *, _BCD_func__12122, void *);
+extern (C) _GtkWidget * gtk_toolbar_append_item(aGtkToolbar *, char *, char *, char *, aGtkWidget *, _BCD_func__12122, void *);
+extern (C) void gtk_toolbar_unset_icon_size(aGtkToolbar *);
+extern (C) void gtk_toolbar_set_icon_size(aGtkToolbar *, int);
+extern (C) void _gtk_toolbar_rebuild_menu(aGtkToolbar *);
+extern (C) int _gtk_toolbar_get_default_space_size();
+extern (C) void _gtk_toolbar_paint_space_line(aGtkWidget *, aGtkToolbar *, _GdkRectangle *, _GdkRectangle *);
+extern (C) char * _gtk_toolbar_elide_underscores(char *);
+extern (C) void gtk_toolbar_set_drop_highlight_item(aGtkToolbar *, aGtkToolItem *, int);
+extern (C) int gtk_toolbar_get_drop_index(aGtkToolbar *, int, int);
+extern (C) int gtk_toolbar_get_relief_style(aGtkToolbar *);
+extern (C) int gtk_toolbar_get_icon_size(aGtkToolbar *);
+extern (C) void gtk_toolbar_unset_style(aGtkToolbar *);
+extern (C) void gtk_toolbar_set_style(aGtkToolbar *, int);
+extern (C) int gtk_toolbar_get_style(aGtkToolbar *);
+extern (C) void gtk_toolbar_set_tooltips(aGtkToolbar *, int);
+extern (C) int gtk_toolbar_get_tooltips(aGtkToolbar *);
+extern (C) void gtk_toolbar_set_orientation(aGtkToolbar *, int);
+extern (C) int gtk_toolbar_get_orientation(aGtkToolbar *);
+extern (C) void gtk_toolbar_set_show_arrow(aGtkToolbar *, int);
+extern (C) int gtk_toolbar_get_show_arrow(aGtkToolbar *);
+extern (C) _GtkToolItem * gtk_toolbar_get_nth_item(aGtkToolbar *, int);
+extern (C) int gtk_toolbar_get_n_items(aGtkToolbar *);
+extern (C) int gtk_toolbar_get_item_index(aGtkToolbar *, aGtkToolItem *);
+extern (C) void gtk_toolbar_insert(aGtkToolbar *, aGtkToolItem *, int);
+extern (C) _GtkWidget * gtk_toolbar_new();
+extern (C) uint gtk_toolbar_get_type();
+extern (C) void gtk_tips_query_set_labels(aGtkTipsQuery *, char *, char *);
+extern (C) void gtk_tips_query_set_caller(aGtkTipsQuery *, aGtkWidget *);
+extern (C) void gtk_tips_query_stop_query(aGtkTipsQuery *);
+extern (C) void gtk_tips_query_start_query(aGtkTipsQuery *);
+extern (C) _GtkWidget * gtk_tips_query_new();
+extern (C) uint gtk_tips_query_get_type();
+extern (C) _GtkTextAttributes * gtk_text_view_get_default_attributes(aGtkTextView *);
+extern (C) void * gtk_text_view_get_tabs(aGtkTextView *);
+extern (C) void gtk_text_view_set_tabs(aGtkTextView *, void *);
+extern (C) int gtk_text_view_get_indent(aGtkTextView *);
+extern (C) void gtk_text_view_set_indent(aGtkTextView *, int);
+extern (C) int gtk_text_view_get_right_margin(aGtkTextView *);
+extern (C) void gtk_text_view_set_right_margin(aGtkTextView *, int);
+extern (C) int gtk_text_view_get_left_margin(aGtkTextView *);
+extern (C) void gtk_text_view_set_left_margin(aGtkTextView *, int);
+extern (C) int gtk_text_view_get_justification(aGtkTextView *);
+extern (C) void gtk_text_view_set_justification(aGtkTextView *, int);
+extern (C) int gtk_text_view_get_pixels_inside_wrap(aGtkTextView *);
+extern (C) void gtk_text_view_set_pixels_inside_wrap(aGtkTextView *, int);
+extern (C) int gtk_text_view_get_pixels_below_lines(aGtkTextView *);
+extern (C) void gtk_text_view_set_pixels_below_lines(aGtkTextView *, int);
+extern (C) int gtk_text_view_get_pixels_above_lines(aGtkTextView *);
+extern (C) void gtk_text_view_set_pixels_above_lines(aGtkTextView *, int);
+extern (C) int gtk_text_view_get_accepts_tab(aGtkTextView *);
+extern (C) void gtk_text_view_set_accepts_tab(aGtkTextView *, int);
+extern (C) int gtk_text_view_get_overwrite(aGtkTextView *);
+extern (C) void gtk_text_view_set_overwrite(aGtkTextView *, int);
+extern (C) int gtk_text_view_get_editable(aGtkTextView *);
+extern (C) void gtk_text_view_set_editable(aGtkTextView *, int);
+extern (C) int gtk_text_view_get_wrap_mode(aGtkTextView *);
+extern (C) void gtk_text_view_set_wrap_mode(aGtkTextView *, int);
+extern (C) void gtk_text_view_move_child(aGtkTextView *, aGtkWidget *, int, int);
+extern (C) void gtk_text_view_add_child_in_window(aGtkTextView *, aGtkWidget *, int, int, int);
+extern (C) void gtk_text_view_add_child_at_anchor(aGtkTextView *, aGtkWidget *, aGtkTextChildAnchor *);
+extern (C) int gtk_text_view_move_visually(aGtkTextView *, aGtkTextIter *, int);
+extern (C) int gtk_text_view_starts_display_line(aGtkTextView *, aGtkTextIter *);
+extern (C) int gtk_text_view_backward_display_line_start(aGtkTextView *, aGtkTextIter *);
+extern (C) int gtk_text_view_forward_display_line_end(aGtkTextView *, aGtkTextIter *);
+extern (C) int gtk_text_view_backward_display_line(aGtkTextView *, aGtkTextIter *);
+extern (C) int gtk_text_view_forward_display_line(aGtkTextView *, aGtkTextIter *);
+extern (C) int gtk_text_view_get_border_window_size(aGtkTextView *, int);
+extern (C) void gtk_text_view_set_border_window_size(aGtkTextView *, int, int);
+extern (C) int gtk_text_view_get_window_type(aGtkTextView *, _GdkDrawable *);
+extern (C) _GdkDrawable * gtk_text_view_get_window(aGtkTextView *, int);
+extern (C) void gtk_text_view_window_to_buffer_coords(aGtkTextView *, int, int, int, int *, int *);
+extern (C) void gtk_text_view_buffer_to_window_coords(aGtkTextView *, int, int, int, int *, int *);
+extern (C) void gtk_text_view_get_line_at_y(aGtkTextView *, aGtkTextIter *, int, int *);
+extern (C) void gtk_text_view_get_line_yrange(aGtkTextView *, aGtkTextIter *, int *, int *);
+extern (C) void gtk_text_view_get_iter_at_position(aGtkTextView *, aGtkTextIter *, int *, int, int);
+extern (C) void gtk_text_view_get_iter_at_location(aGtkTextView *, aGtkTextIter *, int, int);
+extern (C) void gtk_text_view_get_iter_location(aGtkTextView *, aGtkTextIter *, _GdkRectangle *);
+extern (C) int gtk_text_view_get_cursor_visible(aGtkTextView *);
+extern (C) void gtk_text_view_set_cursor_visible(aGtkTextView *, int);
+extern (C) void gtk_text_view_get_visible_rect(aGtkTextView *, _GdkRectangle *);
+extern (C) int gtk_text_view_place_cursor_onscreen(aGtkTextView *);
+extern (C) int gtk_text_view_move_mark_onscreen(aGtkTextView *, aGtkTextMark *);
+extern (C) void gtk_text_view_scroll_mark_onscreen(aGtkTextView *, aGtkTextMark *);
+extern (C) void gtk_text_view_scroll_to_mark(aGtkTextView *, aGtkTextMark *, double, int, double, double);
+extern (C) int gtk_text_view_scroll_to_iter(aGtkTextView *, aGtkTextIter *, double, int, double, double);
+extern (C) _GtkTextBuffer * gtk_text_view_get_buffer(aGtkTextView *);
+extern (C) void gtk_text_view_set_buffer(aGtkTextView *, aGtkTextBuffer *);
+extern (C) _GtkWidget * gtk_text_view_new_with_buffer(aGtkTextBuffer *);
+extern (C) _GtkWidget * gtk_text_view_new();
+extern (C) uint gtk_text_view_get_type();
+extern (C) int gtk_text_buffer_deserialize(aGtkTextBuffer *, aGtkTextBuffer *, void *, aGtkTextIter *, char *, uint, _GError * *);
+extern (C) char * gtk_text_buffer_serialize(aGtkTextBuffer *, aGtkTextBuffer *, void *, aGtkTextIter *, aGtkTextIter *, uint *);
+extern (C) void * * gtk_text_buffer_get_deserialize_formats(aGtkTextBuffer *, int *);
+extern (C) void * * gtk_text_buffer_get_serialize_formats(aGtkTextBuffer *, int *);
+extern (C) int gtk_text_buffer_deserialize_get_can_create_tags(aGtkTextBuffer *, void *);
+extern (C) void gtk_text_buffer_deserialize_set_can_create_tags(aGtkTextBuffer *, void *, int);
+extern (C) void gtk_text_buffer_unregister_deserialize_format(aGtkTextBuffer *, void *);
+extern (C) void gtk_text_buffer_unregister_serialize_format(aGtkTextBuffer *, void *);
+extern (C) void * gtk_text_buffer_register_deserialize_tagset(aGtkTextBuffer *, char *);
+extern (C) void * gtk_text_buffer_register_deserialize_format(aGtkTextBuffer *, char *, _BCD_func__9281, void *, _BCD_func__13158);
+extern (C) void * gtk_text_buffer_register_serialize_tagset(aGtkTextBuffer *, char *);
+extern (C) void * gtk_text_buffer_register_serialize_format(aGtkTextBuffer *, char *, _BCD_func__9282, void *, _BCD_func__13158);
+extern (C) void _gtk_text_buffer_notify_will_remove_tag(aGtkTextBuffer *, aGtkTextTag *);
+extern (C) _PangoLogAttr * _gtk_text_buffer_get_line_log_attrs(aGtkTextBuffer *, aGtkTextIter *, int *);
+extern (C) void * _gtk_text_buffer_get_btree(aGtkTextBuffer *);
+extern (C) void _gtk_text_buffer_spew(aGtkTextBuffer *);
+extern (C) _GtkTargetList * gtk_text_buffer_get_paste_target_list(aGtkTextBuffer *);
+extern (C) _GtkTargetList * gtk_text_buffer_get_copy_target_list(aGtkTextBuffer *);
+extern (C) void gtk_text_buffer_end_user_action(aGtkTextBuffer *);
+extern (C) void gtk_text_buffer_begin_user_action(aGtkTextBuffer *);
+extern (C) int gtk_text_buffer_delete_selection(aGtkTextBuffer *, int, int);
+extern (C) int gtk_text_buffer_get_selection_bounds(aGtkTextBuffer *, aGtkTextIter *, aGtkTextIter *);
+extern (C) void gtk_text_buffer_paste_clipboard(aGtkTextBuffer *, void *, aGtkTextIter *, int);
+extern (C) void gtk_text_buffer_copy_clipboard(aGtkTextBuffer *, void *);
+extern (C) void gtk_text_buffer_cut_clipboard(aGtkTextBuffer *, void *, int);
+extern (C) void gtk_text_buffer_remove_selection_clipboard(aGtkTextBuffer *, void *);
+extern (C) void gtk_text_buffer_add_selection_clipboard(aGtkTextBuffer *, void *);
+extern (C) int gtk_text_buffer_get_has_selection(aGtkTextBuffer *);
+extern (C) void gtk_text_buffer_set_modified(aGtkTextBuffer *, int);
+extern (C) int gtk_text_buffer_get_modified(aGtkTextBuffer *);
+extern (C) void gtk_text_buffer_get_iter_at_child_anchor(aGtkTextBuffer *, aGtkTextIter *, aGtkTextChildAnchor *);
+extern (C) void gtk_text_buffer_get_iter_at_mark(aGtkTextBuffer *, aGtkTextIter *, aGtkTextMark *);
+extern (C) void gtk_text_buffer_get_bounds(aGtkTextBuffer *, aGtkTextIter *, aGtkTextIter *);
+extern (C) void gtk_text_buffer_get_end_iter(aGtkTextBuffer *, aGtkTextIter *);
+extern (C) void gtk_text_buffer_get_start_iter(aGtkTextBuffer *, aGtkTextIter *);
+extern (C) void gtk_text_buffer_get_iter_at_line(aGtkTextBuffer *, aGtkTextIter *, int);
+extern (C) void gtk_text_buffer_get_iter_at_offset(aGtkTextBuffer *, aGtkTextIter *, int);
+extern (C) void gtk_text_buffer_get_iter_at_line_index(aGtkTextBuffer *, aGtkTextIter *, int, int);
+extern (C) void gtk_text_buffer_get_iter_at_line_offset(aGtkTextBuffer *, aGtkTextIter *, int, int);
+extern (C) _GtkTextTag * gtk_text_buffer_create_tag(aGtkTextBuffer *, char *, char *, ...);
+extern (C) void gtk_text_buffer_remove_all_tags(aGtkTextBuffer *, aGtkTextIter *, aGtkTextIter *);
+extern (C) void gtk_text_buffer_remove_tag_by_name(aGtkTextBuffer *, char *, aGtkTextIter *, aGtkTextIter *);
+extern (C) void gtk_text_buffer_apply_tag_by_name(aGtkTextBuffer *, char *, aGtkTextIter *, aGtkTextIter *);
+extern (C) void gtk_text_buffer_remove_tag(aGtkTextBuffer *, aGtkTextTag *, aGtkTextIter *, aGtkTextIter *);
+extern (C) void gtk_text_buffer_apply_tag(aGtkTextBuffer *, aGtkTextTag *, aGtkTextIter *, aGtkTextIter *);
+extern (C) void gtk_text_buffer_select_range(aGtkTextBuffer *, aGtkTextIter *, aGtkTextIter *);
+extern (C) void gtk_text_buffer_place_cursor(aGtkTextBuffer *, aGtkTextIter *);
+extern (C) _GtkTextMark * gtk_text_buffer_get_selection_bound(aGtkTextBuffer *);
+extern (C) _GtkTextMark * gtk_text_buffer_get_insert(aGtkTextBuffer *);
+extern (C) void gtk_text_buffer_delete_mark_by_name(aGtkTextBuffer *, char *);
+extern (C) void gtk_text_buffer_move_mark_by_name(aGtkTextBuffer *, char *, aGtkTextIter *);
+extern (C) _GtkTextMark * gtk_text_buffer_get_mark(aGtkTextBuffer *, char *);
+extern (C) void gtk_text_buffer_delete_mark(aGtkTextBuffer *, aGtkTextMark *);
+extern (C) void gtk_text_buffer_move_mark(aGtkTextBuffer *, aGtkTextMark *, aGtkTextIter *);
+extern (C) _GtkTextMark * gtk_text_buffer_create_mark(aGtkTextBuffer *, char *, aGtkTextIter *, int);
+extern (C) void gtk_text_buffer_add_mark(aGtkTextBuffer *, aGtkTextMark *, aGtkTextIter *);
+extern (C) _GtkTextChildAnchor * gtk_text_buffer_create_child_anchor(aGtkTextBuffer *, aGtkTextIter *);
+extern (C) void gtk_text_buffer_insert_child_anchor(aGtkTextBuffer *, aGtkTextIter *, aGtkTextChildAnchor *);
+extern (C) void gtk_text_buffer_insert_pixbuf(aGtkTextBuffer *, aGtkTextIter *, void *);
+extern (C) char * gtk_text_buffer_get_slice(aGtkTextBuffer *, aGtkTextIter *, aGtkTextIter *, int);
+extern (C) char * gtk_text_buffer_get_text(aGtkTextBuffer *, aGtkTextIter *, aGtkTextIter *, int);
+extern (C) int gtk_text_buffer_backspace(aGtkTextBuffer *, aGtkTextIter *, int, int);
+extern (C) int gtk_text_buffer_delete_interactive(aGtkTextBuffer *, aGtkTextIter *, aGtkTextIter *, int);
+extern (C) void gtk_text_buffer_delete(aGtkTextBuffer *, aGtkTextIter *, aGtkTextIter *);
+extern (C) void gtk_text_buffer_insert_with_tags_by_name(aGtkTextBuffer *, aGtkTextIter *, char *, int, char *, ...);
+extern (C) void gtk_text_buffer_insert_with_tags(aGtkTextBuffer *, aGtkTextIter *, char *, int, aGtkTextTag *, ...);
+extern (C) int gtk_text_buffer_insert_range_interactive(aGtkTextBuffer *, aGtkTextIter *, aGtkTextIter *, aGtkTextIter *, int);
+extern (C) void gtk_text_buffer_insert_range(aGtkTextBuffer *, aGtkTextIter *, aGtkTextIter *, aGtkTextIter *);
+extern (C) int gtk_text_buffer_insert_interactive_at_cursor(aGtkTextBuffer *, char *, int, int);
+extern (C) int gtk_text_buffer_insert_interactive(aGtkTextBuffer *, aGtkTextIter *, char *, int, int);
+extern (C) void gtk_text_buffer_insert_at_cursor(aGtkTextBuffer *, char *, int);
+extern (C) void gtk_text_buffer_insert(aGtkTextBuffer *, aGtkTextIter *, char *, int);
+extern (C) void gtk_text_buffer_set_text(aGtkTextBuffer *, char *, int);
+extern (C) _GtkTextTagTable * gtk_text_buffer_get_tag_table(aGtkTextBuffer *);
+extern (C) int gtk_text_buffer_get_char_count(aGtkTextBuffer *);
+extern (C) int gtk_text_buffer_get_line_count(aGtkTextBuffer *);
+extern (C) _GtkTextBuffer * gtk_text_buffer_new(aGtkTextTagTable *);
+extern (C) uint gtk_text_buffer_get_type();
+extern (C) int gtk_text_mark_get_left_gravity(aGtkTextMark *);
+extern (C) _GtkTextBuffer * gtk_text_mark_get_buffer(aGtkTextMark *);
+extern (C) int gtk_text_mark_get_deleted(aGtkTextMark *);
+extern (C) char * gtk_text_mark_get_name(aGtkTextMark *);
+extern (C) _GtkTextMark * gtk_text_mark_new(char *, int);
+extern (C) int gtk_text_mark_get_visible(aGtkTextMark *);
+extern (C) void gtk_text_mark_set_visible(aGtkTextMark *, int);
+extern (C) uint gtk_text_mark_get_type();
+extern (C) void _gtk_text_tag_table_remove_buffer(aGtkTextTagTable *, void *);
+extern (C) void _gtk_text_tag_table_add_buffer(aGtkTextTagTable *, void *);
+extern (C) int gtk_text_tag_table_get_size(aGtkTextTagTable *);
+extern (C) void gtk_text_tag_table_foreach(aGtkTextTagTable *, _BCD_func__9332, void *);
+extern (C) _GtkTextTag * gtk_text_tag_table_lookup(aGtkTextTagTable *, char *);
+extern (C) void gtk_text_tag_table_remove(aGtkTextTagTable *, aGtkTextTag *);
+extern (C) void gtk_text_tag_table_add(aGtkTextTagTable *, aGtkTextTag *);
+extern (C) _GtkTextTagTable * gtk_text_tag_table_new();
+extern (C) uint gtk_text_tag_table_get_type();
+extern (C) _GtkWidget * gtk_tearoff_menu_item_new();
+extern (C) uint gtk_tearoff_menu_item_get_type();
+extern (C) int gtk_table_get_homogeneous(aGtkTable *);
+extern (C) void gtk_table_set_homogeneous(aGtkTable *, int);
+extern (C) uint gtk_table_get_default_col_spacing(aGtkTable *);
+extern (C) void gtk_table_set_col_spacings(aGtkTable *, uint);
+extern (C) uint gtk_table_get_default_row_spacing(aGtkTable *);
+extern (C) void gtk_table_set_row_spacings(aGtkTable *, uint);
+extern (C) uint gtk_table_get_col_spacing(aGtkTable *, uint);
+extern (C) void gtk_table_set_col_spacing(aGtkTable *, uint, uint);
+extern (C) uint gtk_table_get_row_spacing(aGtkTable *, uint);
+extern (C) void gtk_table_set_row_spacing(aGtkTable *, uint, uint);
+extern (C) void gtk_table_attach_defaults(aGtkTable *, aGtkWidget *, uint, uint, uint, uint);
+extern (C) void gtk_table_attach(aGtkTable *, aGtkWidget *, uint, uint, uint, uint, int, int, uint, uint);
+extern (C) void gtk_table_resize(aGtkTable *, uint, uint);
+extern (C) _GtkWidget * gtk_table_new(uint, uint, int);
+extern (C) uint gtk_table_get_type();
+extern (C) void gtk_stock_set_translate_func(char *, _BCD_func__12124, void *, _BCD_func__13158);
+extern (C) void gtk_stock_item_free(aGtkStockItem *);
+extern (C) _GtkStockItem * gtk_stock_item_copy(aGtkStockItem *);
+extern (C) _GSList * gtk_stock_list_ids();
+extern (C) int gtk_stock_lookup(char *, aGtkStockItem *);
+extern (C) void gtk_stock_add_static(aGtkStockItem *, uint);
+extern (C) void gtk_stock_add(aGtkStockItem *, uint);
+extern (C) int gtk_status_icon_get_geometry(aGtkStatusIcon *, _GdkScreen * *, _GdkRectangle *, int *);
+extern (C) void gtk_status_icon_position_menu(aGtkMenu *, int *, int *, int *, void *);
+extern (C) int gtk_status_icon_is_embedded(aGtkStatusIcon *);
+extern (C) int gtk_status_icon_get_blinking(aGtkStatusIcon *);
+extern (C) void gtk_status_icon_set_blinking(aGtkStatusIcon *, int);
+extern (C) int gtk_status_icon_get_visible(aGtkStatusIcon *);
+extern (C) void gtk_status_icon_set_visible(aGtkStatusIcon *, int);
+extern (C) void gtk_status_icon_set_tooltip(aGtkStatusIcon *, char *);
+extern (C) _GdkScreen * gtk_status_icon_get_screen(aGtkStatusIcon *);
+extern (C) void gtk_status_icon_set_screen(aGtkStatusIcon *, _GdkScreen *);
+extern (C) int gtk_status_icon_get_size(aGtkStatusIcon *);
+extern (C) char * gtk_status_icon_get_icon_name(aGtkStatusIcon *);
+extern (C) char * gtk_status_icon_get_stock(aGtkStatusIcon *);
+extern (C) void * gtk_status_icon_get_pixbuf(aGtkStatusIcon *);
+extern (C) int gtk_status_icon_get_storage_type(aGtkStatusIcon *);
+extern (C) void gtk_status_icon_set_from_icon_name(aGtkStatusIcon *, char *);
+extern (C) void gtk_status_icon_set_from_stock(aGtkStatusIcon *, char *);
+extern (C) void gtk_status_icon_set_from_file(aGtkStatusIcon *, char *);
+extern (C) void gtk_status_icon_set_from_pixbuf(aGtkStatusIcon *, void *);
+extern (C) _GtkStatusIcon * gtk_status_icon_new_from_icon_name(char *);
+extern (C) _GtkStatusIcon * gtk_status_icon_new_from_stock(char *);
+extern (C) _GtkStatusIcon * gtk_status_icon_new_from_file(char *);
+extern (C) _GtkStatusIcon * gtk_status_icon_new_from_pixbuf(void *);
+extern (C) _GtkStatusIcon * gtk_status_icon_new();
+extern (C) uint gtk_status_icon_get_type();
+extern (C) int gtk_statusbar_get_has_resize_grip(aGtkStatusbar *);
+extern (C) void gtk_statusbar_set_has_resize_grip(aGtkStatusbar *, int);
+extern (C) void gtk_statusbar_remove(aGtkStatusbar *, uint, uint);
+extern (C) void gtk_statusbar_pop(aGtkStatusbar *, uint);
+extern (C) uint gtk_statusbar_push(aGtkStatusbar *, uint, char *);
+extern (C) uint gtk_statusbar_get_context_id(aGtkStatusbar *, char *);
+extern (C) _GtkWidget * gtk_statusbar_new();
+extern (C) uint gtk_statusbar_get_type();
+extern (C) void gtk_spin_button_update(aGtkSpinButton *);
+extern (C) int gtk_spin_button_get_snap_to_ticks(aGtkSpinButton *);
+extern (C) void gtk_spin_button_set_snap_to_ticks(aGtkSpinButton *, int);
+extern (C) int gtk_spin_button_get_wrap(aGtkSpinButton *);
+extern (C) void gtk_spin_button_set_wrap(aGtkSpinButton *, int);
+extern (C) void gtk_spin_button_spin(aGtkSpinButton *, int, double);
+extern (C) int gtk_spin_button_get_numeric(aGtkSpinButton *);
+extern (C) void gtk_spin_button_set_numeric(aGtkSpinButton *, int);
+extern (C) int gtk_spin_button_get_update_policy(aGtkSpinButton *);
+extern (C) void gtk_spin_button_set_update_policy(aGtkSpinButton *, int);
+extern (C) void gtk_spin_button_set_value(aGtkSpinButton *, double);
+extern (C) int gtk_spin_button_get_value_as_int(aGtkSpinButton *);
+extern (C) double gtk_spin_button_get_value(aGtkSpinButton *);
+extern (C) void gtk_spin_button_get_range(aGtkSpinButton *, double *, double *);
+extern (C) void gtk_spin_button_set_range(aGtkSpinButton *, double, double);
+extern (C) void gtk_spin_button_get_increments(aGtkSpinButton *, double *, double *);
+extern (C) void gtk_spin_button_set_increments(aGtkSpinButton *, double, double);
+extern (C) uint gtk_spin_button_get_digits(aGtkSpinButton *);
+extern (C) void gtk_spin_button_set_digits(aGtkSpinButton *, uint);
+extern (C) _GtkAdjustment * gtk_spin_button_get_adjustment(aGtkSpinButton *);
+extern (C) void gtk_spin_button_set_adjustment(aGtkSpinButton *, aGtkAdjustment *);
+extern (C) _GtkWidget * gtk_spin_button_new_with_range(double, double, double);
+extern (C) _GtkWidget * gtk_spin_button_new(aGtkAdjustment *, double, uint);
+extern (C) void gtk_spin_button_configure(aGtkSpinButton *, aGtkAdjustment *, double, uint);
+extern (C) uint gtk_spin_button_get_type();
+extern (C) void _gtk_size_group_queue_resize(aGtkWidget *);
+extern (C) void _gtk_size_group_compute_requisition(aGtkWidget *, aGtkRequisition *);
+extern (C) void _gtk_size_group_get_child_requisition(aGtkWidget *, aGtkRequisition *);
+extern (C) _GSList * gtk_size_group_get_widgets(aGtkSizeGroup *);
+extern (C) void gtk_size_group_remove_widget(aGtkSizeGroup *, aGtkWidget *);
+extern (C) void gtk_size_group_add_widget(aGtkSizeGroup *, aGtkWidget *);
+extern (C) int gtk_size_group_get_ignore_hidden(aGtkSizeGroup *);
+extern (C) void gtk_size_group_set_ignore_hidden(aGtkSizeGroup *, int);
+extern (C) int gtk_size_group_get_mode(aGtkSizeGroup *);
+extern (C) void gtk_size_group_set_mode(aGtkSizeGroup *, int);
+extern (C) _GtkSizeGroup * gtk_size_group_new(int);
+extern (C) uint gtk_size_group_get_type();
+extern (C) void gtk_separator_tool_item_set_draw(aGtkSeparatorToolItem *, int);
+extern (C) int gtk_separator_tool_item_get_draw(aGtkSeparatorToolItem *);
+extern (C) _GtkToolItem * gtk_separator_tool_item_new();
+extern (C) uint gtk_separator_tool_item_get_type();
+extern (C) _GtkWidget * gtk_separator_menu_item_new();
+extern (C) uint gtk_separator_menu_item_get_type();
+extern (C) int _gtk_scrolled_window_get_scrollbar_spacing(aGtkScrolledWindow *);
+extern (C) void gtk_scrolled_window_add_with_viewport(aGtkScrolledWindow *, aGtkWidget *);
+extern (C) int gtk_scrolled_window_get_shadow_type(aGtkScrolledWindow *);
+extern (C) void gtk_scrolled_window_set_shadow_type(aGtkScrolledWindow *, int);
+extern (C) int gtk_scrolled_window_get_placement(aGtkScrolledWindow *);
+extern (C) void gtk_scrolled_window_unset_placement(aGtkScrolledWindow *);
+extern (C) void gtk_scrolled_window_set_placement(aGtkScrolledWindow *, int);
+extern (C) void gtk_scrolled_window_get_policy(aGtkScrolledWindow *, int *, int *);
+extern (C) void gtk_scrolled_window_set_policy(aGtkScrolledWindow *, int, int);
+extern (C) _GtkWidget * gtk_scrolled_window_get_vscrollbar(aGtkScrolledWindow *);
+extern (C) _GtkWidget * gtk_scrolled_window_get_hscrollbar(aGtkScrolledWindow *);
+extern (C) _GtkAdjustment * gtk_scrolled_window_get_vadjustment(aGtkScrolledWindow *);
+extern (C) _GtkAdjustment * gtk_scrolled_window_get_hadjustment(aGtkScrolledWindow *);
+extern (C) void gtk_scrolled_window_set_vadjustment(aGtkScrolledWindow *, aGtkAdjustment *);
+extern (C) void gtk_scrolled_window_set_hadjustment(aGtkScrolledWindow *, aGtkAdjustment *);
+extern (C) _GtkWidget * gtk_scrolled_window_new(aGtkAdjustment *, aGtkAdjustment *);
+extern (C) uint gtk_scrolled_window_get_type();
+extern (C) int gtk_viewport_get_shadow_type(aGtkViewport *);
+extern (C) void gtk_viewport_set_shadow_type(aGtkViewport *, int);
+extern (C) void gtk_viewport_set_vadjustment(aGtkViewport *, aGtkAdjustment *);
+extern (C) void gtk_viewport_set_hadjustment(aGtkViewport *, aGtkAdjustment *);
+extern (C) _GtkAdjustment * gtk_viewport_get_vadjustment(aGtkViewport *);
+extern (C) _GtkAdjustment * gtk_viewport_get_hadjustment(aGtkViewport *);
+extern (C) _GtkWidget * gtk_viewport_new(aGtkAdjustment *, aGtkAdjustment *);
+extern (C) uint gtk_viewport_get_type();
+extern (C) void gtk_scale_button_set_adjustment(aGtkScaleButton *, aGtkAdjustment *);
+extern (C) _GtkAdjustment * gtk_scale_button_get_adjustment(aGtkScaleButton *);
+extern (C) void gtk_scale_button_set_value(aGtkScaleButton *, double);
+extern (C) double gtk_scale_button_get_value(aGtkScaleButton *);
+extern (C) void gtk_scale_button_set_icons(aGtkScaleButton *, char * *);
+extern (C) _GtkWidget * gtk_scale_button_new(int, double, double, double, char * *);
+extern (C) uint gtk_scale_button_get_type();
+extern (C) _GtkWidget * gtk_recent_chooser_widget_new_for_manager(aGtkRecentManager *);
+extern (C) _GtkWidget * gtk_recent_chooser_widget_new();
+extern (C) uint gtk_recent_chooser_widget_get_type();
+extern (C) void gtk_recent_chooser_menu_set_show_numbers(aGtkRecentChooserMenu *, int);
+extern (C) int gtk_recent_chooser_menu_get_show_numbers(aGtkRecentChooserMenu *);
+extern (C) _GtkWidget * gtk_recent_chooser_menu_new_for_manager(aGtkRecentManager *);
+extern (C) _GtkWidget * gtk_recent_chooser_menu_new();
+extern (C) uint gtk_recent_chooser_menu_get_type();
+extern (C) _GtkWidget * gtk_recent_chooser_dialog_new_for_manager(char *, aGtkWindow *, aGtkRecentManager *, char *, ...);
+extern (C) _GtkWidget * gtk_recent_chooser_dialog_new(char *, aGtkWindow *, char *, ...);
+extern (C) uint gtk_recent_chooser_dialog_get_type();
+extern (C) void * gtk_recent_chooser_get_filter(void *);
+extern (C) void gtk_recent_chooser_set_filter(void *, void *);
+extern (C) _GSList * gtk_recent_chooser_list_filters(void *);
+extern (C) void gtk_recent_chooser_remove_filter(void *, void *);
+extern (C) void gtk_recent_chooser_add_filter(void *, void *);
+extern (C) char * * gtk_recent_chooser_get_uris(void *, uint *);
+extern (C) _GList * gtk_recent_chooser_get_items(void *);
+extern (C) void gtk_recent_chooser_unselect_all(void *);
+extern (C) void gtk_recent_chooser_select_all(void *);
+extern (C) void gtk_recent_chooser_unselect_uri(void *, char *);
+extern (C) int gtk_recent_chooser_select_uri(void *, char *, _GError * *);
+extern (C) void * gtk_recent_chooser_get_current_item(void *);
+extern (C) char * gtk_recent_chooser_get_current_uri(void *);
+extern (C) int gtk_recent_chooser_set_current_uri(void *, char *, _GError * *);
+extern (C) void gtk_recent_chooser_set_sort_func(void *, _BCD_func__9605, void *, _BCD_func__13158);
+extern (C) int gtk_recent_chooser_get_sort_type(void *);
+extern (C) void gtk_recent_chooser_set_sort_type(void *, int);
+extern (C) int gtk_recent_chooser_get_show_icons(void *);
+extern (C) void gtk_recent_chooser_set_show_icons(void *, int);
+extern (C) int gtk_recent_chooser_get_show_numbers(void *);
+extern (C) void gtk_recent_chooser_set_show_numbers(void *, int);
+extern (C) int gtk_recent_chooser_get_show_tips(void *);
+extern (C) void gtk_recent_chooser_set_show_tips(void *, int);
+extern (C) int gtk_recent_chooser_get_local_only(void *);
+extern (C) void gtk_recent_chooser_set_local_only(void *, int);
+extern (C) int gtk_recent_chooser_get_limit(void *);
+extern (C) void gtk_recent_chooser_set_limit(void *, int);
+extern (C) int gtk_recent_chooser_get_select_multiple(void *);
+extern (C) void gtk_recent_chooser_set_select_multiple(void *, int);
+extern (C) int gtk_recent_chooser_get_show_not_found(void *);
+extern (C) void gtk_recent_chooser_set_show_not_found(void *, int);
+extern (C) int gtk_recent_chooser_get_show_private(void *);
+extern (C) void gtk_recent_chooser_set_show_private(void *, int);
+extern (C) uint gtk_recent_chooser_get_type();
+extern (C) uint gtk_recent_chooser_error_quark();
+extern (C) int gtk_recent_filter_filter(void *, aGtkRecentFilterInfo *);
+extern (C) int gtk_recent_filter_get_needed(void *);
+extern (C) void gtk_recent_filter_add_custom(void *, int, _BCD_func__9607, void *, _BCD_func__13158);
+extern (C) void gtk_recent_filter_add_age(void *, int);
+extern (C) void gtk_recent_filter_add_group(void *, char *);
+extern (C) void gtk_recent_filter_add_application(void *, char *);
+extern (C) void gtk_recent_filter_add_pixbuf_formats(void *);
+extern (C) void gtk_recent_filter_add_pattern(void *, char *);
+extern (C) void gtk_recent_filter_add_mime_type(void *, char *);
+extern (C) char * gtk_recent_filter_get_name(void *);
+extern (C) void gtk_recent_filter_set_name(void *, char *);
+extern (C) void * gtk_recent_filter_new();
+extern (C) uint gtk_recent_filter_get_type();
+extern (C) void gtk_recent_action_set_show_numbers(aGtkRecentAction *, int);
+extern (C) int gtk_recent_action_get_show_numbers(aGtkRecentAction *);
+extern (C) _GtkAction * gtk_recent_action_new_for_manager(char *, char *, char *, char *, aGtkRecentManager *);
+extern (C) _GtkAction * gtk_recent_action_new(char *, char *, char *, char *);
+extern (C) uint gtk_recent_action_get_type();
+extern (C) void _gtk_recent_manager_sync();
+extern (C) int gtk_recent_info_match(void *, void *);
+extern (C) int gtk_recent_info_exists(void *);
+extern (C) int gtk_recent_info_is_local(void *);
+extern (C) int gtk_recent_info_get_age(void *);
+extern (C) char * gtk_recent_info_get_uri_display(void *);
+extern (C) char * gtk_recent_info_get_short_name(void *);
+extern (C) void * gtk_recent_info_get_icon(void *, int);
+extern (C) int gtk_recent_info_has_group(void *, char *);
+extern (C) char * * gtk_recent_info_get_groups(void *, uint *);
+extern (C) int gtk_recent_info_has_application(void *, char *);
+extern (C) char * gtk_recent_info_last_application(void *);
+extern (C) char * * gtk_recent_info_get_applications(void *, uint *);
+extern (C) int gtk_recent_info_get_application_info(void *, char *, char * *, uint *, int *);
+extern (C) int gtk_recent_info_get_private_hint(void *);
+extern (C) int gtk_recent_info_get_visited(void *);
+extern (C) int gtk_recent_info_get_modified(void *);
+extern (C) int gtk_recent_info_get_added(void *);
+extern (C) char * gtk_recent_info_get_mime_type(void *);
+extern (C) char * gtk_recent_info_get_description(void *);
+extern (C) char * gtk_recent_info_get_display_name(void *);
+extern (C) char * gtk_recent_info_get_uri(void *);
+extern (C) void gtk_recent_info_unref(void *);
+extern (C) void * gtk_recent_info_ref(void *);
+extern (C) uint gtk_recent_info_get_type();
+extern (C) int gtk_recent_manager_purge_items(aGtkRecentManager *, _GError * *);
+extern (C) _GList * gtk_recent_manager_get_items(aGtkRecentManager *);
+extern (C) int gtk_recent_manager_get_limit(aGtkRecentManager *);
+extern (C) void gtk_recent_manager_set_limit(aGtkRecentManager *, int);
+extern (C) int gtk_recent_manager_move_item(aGtkRecentManager *, char *, char *, _GError * *);
+extern (C) int gtk_recent_manager_has_item(aGtkRecentManager *, char *);
+extern (C) void * gtk_recent_manager_lookup_item(aGtkRecentManager *, char *, _GError * *);
+extern (C) int gtk_recent_manager_remove_item(aGtkRecentManager *, char *, _GError * *);
+extern (C) int gtk_recent_manager_add_full(aGtkRecentManager *, char *, aGtkRecentData *);
+extern (C) int gtk_recent_manager_add_item(aGtkRecentManager *, char *);
+extern (C) void gtk_recent_manager_set_screen(aGtkRecentManager *, _GdkScreen *);
+extern (C) _GtkRecentManager * gtk_recent_manager_get_for_screen(_GdkScreen *);
+extern (C) _GtkRecentManager * gtk_recent_manager_get_default();
+extern (C) _GtkRecentManager * gtk_recent_manager_new();
+extern (C) uint gtk_recent_manager_get_type();
+extern (C) uint gtk_recent_manager_error_quark();
+extern (C) void gtk_radio_tool_button_set_group(aGtkRadioToolButton *, _GSList *);
+extern (C) _GSList * gtk_radio_tool_button_get_group(aGtkRadioToolButton *);
+extern (C) _GtkToolItem * gtk_radio_tool_button_new_with_stock_from_widget(aGtkRadioToolButton *, char *);
+extern (C) _GtkToolItem * gtk_radio_tool_button_new_from_widget(aGtkRadioToolButton *);
+extern (C) _GtkToolItem * gtk_radio_tool_button_new_from_stock(_GSList *, char *);
+extern (C) _GtkToolItem * gtk_radio_tool_button_new(_GSList *);
+extern (C) uint gtk_radio_tool_button_get_type();
+extern (C) int gtk_toggle_tool_button_get_active(aGtkToggleToolButton *);
+extern (C) void gtk_toggle_tool_button_set_active(aGtkToggleToolButton *, int);
+extern (C) _GtkToolItem * gtk_toggle_tool_button_new_from_stock(char *);
+extern (C) _GtkToolItem * gtk_toggle_tool_button_new();
+extern (C) uint gtk_toggle_tool_button_get_type();
+extern (C) void gtk_radio_menu_item_set_group(aGtkRadioMenuItem *, _GSList *);
+extern (C) _GSList * gtk_radio_menu_item_get_group(aGtkRadioMenuItem *);
+extern (C) _GtkWidget * gtk_radio_menu_item_new_with_label_from_widget(aGtkRadioMenuItem *, char *);
+extern (C) _GtkWidget * gtk_radio_menu_item_new_with_mnemonic_from_widget(aGtkRadioMenuItem *, char *);
+extern (C) _GtkWidget * gtk_radio_menu_item_new_from_widget(aGtkRadioMenuItem *);
+extern (C) _GtkWidget * gtk_radio_menu_item_new_with_mnemonic(_GSList *, char *);
+extern (C) _GtkWidget * gtk_radio_menu_item_new_with_label(_GSList *, char *);
+extern (C) _GtkWidget * gtk_radio_menu_item_new(_GSList *);
+extern (C) uint gtk_radio_menu_item_get_type();
+extern (C) void gtk_radio_button_set_group(aGtkRadioButton *, _GSList *);
+extern (C) _GSList * gtk_radio_button_get_group(aGtkRadioButton *);
+extern (C) _GtkWidget * gtk_radio_button_new_with_mnemonic_from_widget(aGtkRadioButton *, char *);
+extern (C) _GtkWidget * gtk_radio_button_new_with_mnemonic(_GSList *, char *);
+extern (C) _GtkWidget * gtk_radio_button_new_with_label_from_widget(aGtkRadioButton *, char *);
+extern (C) _GtkWidget * gtk_radio_button_new_with_label(_GSList *, char *);
+extern (C) _GtkWidget * gtk_radio_button_new_from_widget(aGtkRadioButton *);
+extern (C) _GtkWidget * gtk_radio_button_new(_GSList *);
+extern (C) uint gtk_radio_button_get_type();
+extern (C) void gtk_radio_action_set_current_value(aGtkRadioAction *, int);
+extern (C) int gtk_radio_action_get_current_value(aGtkRadioAction *);
+extern (C) void gtk_radio_action_set_group(aGtkRadioAction *, _GSList *);
+extern (C) _GSList * gtk_radio_action_get_group(aGtkRadioAction *);
+extern (C) _GtkRadioAction * gtk_radio_action_new(char *, char *, char *, char *, int);
+extern (C) uint gtk_radio_action_get_type();
+extern (C) int gtk_toggle_action_get_draw_as_radio(aGtkToggleAction *);
+extern (C) void gtk_toggle_action_set_draw_as_radio(aGtkToggleAction *, int);
+extern (C) int gtk_toggle_action_get_active(aGtkToggleAction *);
+extern (C) void gtk_toggle_action_set_active(aGtkToggleAction *, int);
+extern (C) void gtk_toggle_action_toggled(aGtkToggleAction *);
+extern (C) _GtkToggleAction * gtk_toggle_action_new(char *, char *, char *, char *);
+extern (C) uint gtk_toggle_action_get_type();
+extern (C) void gtk_progress_bar_update(aGtkProgressBar *, double);
+extern (C) void gtk_progress_bar_set_activity_blocks(aGtkProgressBar *, uint);
+extern (C) void gtk_progress_bar_set_activity_step(aGtkProgressBar *, uint);
+extern (C) void gtk_progress_bar_set_discrete_blocks(aGtkProgressBar *, uint);
+extern (C) void gtk_progress_bar_set_bar_style(aGtkProgressBar *, int);
+extern (C) _GtkWidget * gtk_progress_bar_new_with_adjustment(aGtkAdjustment *);
+extern (C) int gtk_progress_bar_get_ellipsize(aGtkProgressBar *);
+extern (C) void gtk_progress_bar_set_ellipsize(aGtkProgressBar *, int);
+extern (C) int gtk_progress_bar_get_orientation(aGtkProgressBar *);
+extern (C) double gtk_progress_bar_get_pulse_step(aGtkProgressBar *);
+extern (C) double gtk_progress_bar_get_fraction(aGtkProgressBar *);
+extern (C) char * gtk_progress_bar_get_text(aGtkProgressBar *);
+extern (C) void gtk_progress_bar_set_orientation(aGtkProgressBar *, int);
+extern (C) void gtk_progress_bar_set_pulse_step(aGtkProgressBar *, double);
+extern (C) void gtk_progress_bar_set_fraction(aGtkProgressBar *, double);
+extern (C) void gtk_progress_bar_set_text(aGtkProgressBar *, char *);
+extern (C) void gtk_progress_bar_pulse(aGtkProgressBar *);
+extern (C) _GtkWidget * gtk_progress_bar_new();
+extern (C) uint gtk_progress_bar_get_type();
+extern (C) double gtk_progress_get_percentage_from_value(aGtkProgress *, double);
+extern (C) double gtk_progress_get_current_percentage(aGtkProgress *);
+extern (C) char * gtk_progress_get_text_from_value(aGtkProgress *, double);
+extern (C) char * gtk_progress_get_current_text(aGtkProgress *);
+extern (C) void gtk_progress_set_activity_mode(aGtkProgress *, int);
+extern (C) double gtk_progress_get_value(aGtkProgress *);
+extern (C) void gtk_progress_set_value(aGtkProgress *, double);
+extern (C) void gtk_progress_set_percentage(aGtkProgress *, double);
+extern (C) void gtk_progress_configure(aGtkProgress *, double, double, double);
+extern (C) void gtk_progress_set_adjustment(aGtkProgress *, aGtkAdjustment *);
+extern (C) void gtk_progress_set_format_string(aGtkProgress *, char *);
+extern (C) void gtk_progress_set_text_alignment(aGtkProgress *, float, float);
+extern (C) void gtk_progress_set_show_text(aGtkProgress *, int);
+extern (C) uint gtk_progress_get_type();
+extern (C) void gtk_print_run_page_setup_dialog_async(aGtkWindow *, void *, void *, _BCD_func__9769, void *);
+extern (C) void * gtk_print_run_page_setup_dialog(aGtkWindow *, void *, void *);
+extern (C) void gtk_print_operation_cancel(aGtkPrintOperation *);
+extern (C) int gtk_print_operation_is_finished(aGtkPrintOperation *);
+extern (C) char * gtk_print_operation_get_status_string(aGtkPrintOperation *);
+extern (C) int gtk_print_operation_get_status(aGtkPrintOperation *);
+extern (C) void gtk_print_operation_get_error(aGtkPrintOperation *, _GError * *);
+extern (C) int gtk_print_operation_run(aGtkPrintOperation *, int, aGtkWindow *, _GError * *);
+extern (C) void gtk_print_operation_set_custom_tab_label(aGtkPrintOperation *, char *);
+extern (C) void gtk_print_operation_set_allow_async(aGtkPrintOperation *, int);
+extern (C) void gtk_print_operation_set_show_progress(aGtkPrintOperation *, int);
+extern (C) void gtk_print_operation_set_track_print_status(aGtkPrintOperation *, int);
+extern (C) void gtk_print_operation_set_export_filename(aGtkPrintOperation *, char *);
+extern (C) void gtk_print_operation_set_unit(aGtkPrintOperation *, int);
+extern (C) void gtk_print_operation_set_use_full_page(aGtkPrintOperation *, int);
+extern (C) void gtk_print_operation_set_current_page(aGtkPrintOperation *, int);
+extern (C) void gtk_print_operation_set_n_pages(aGtkPrintOperation *, int);
+extern (C) void gtk_print_operation_set_job_name(aGtkPrintOperation *, char *);
+extern (C) void * gtk_print_operation_get_print_settings(aGtkPrintOperation *);
+extern (C) void gtk_print_operation_set_print_settings(aGtkPrintOperation *, void *);
+extern (C) void * gtk_print_operation_get_default_page_setup(aGtkPrintOperation *);
+extern (C) void gtk_print_operation_set_default_page_setup(aGtkPrintOperation *, void *);
+extern (C) _GtkPrintOperation * gtk_print_operation_new();
+extern (C) uint gtk_print_operation_get_type();
+extern (C) uint gtk_print_error_quark();
+extern (C) int gtk_print_operation_preview_is_selected(void *, int);
+extern (C) void gtk_print_operation_preview_end_preview(void *);
+extern (C) void gtk_print_operation_preview_render_page(void *, int);
+extern (C) uint gtk_print_operation_preview_get_type();
+extern (C) void gtk_print_context_set_cairo_context(void *, void *, double, double);
+extern (C) void * gtk_print_context_create_pango_layout(void *);
+extern (C) void * gtk_print_context_create_pango_context(void *);
+extern (C) void * gtk_print_context_get_pango_fontmap(void *);
+extern (C) double gtk_print_context_get_dpi_y(void *);
+extern (C) double gtk_print_context_get_dpi_x(void *);
+extern (C) double gtk_print_context_get_height(void *);
+extern (C) double gtk_print_context_get_width(void *);
+extern (C) void * gtk_print_context_get_page_setup(void *);
+extern (C) void * gtk_print_context_get_cairo_context(void *);
+extern (C) uint gtk_print_context_get_type();
+extern (C) void gtk_print_settings_set_output_bin(void *, char *);
+extern (C) char * gtk_print_settings_get_output_bin(void *);
+extern (C) void gtk_print_settings_set_finishings(void *, char *);
+extern (C) char * gtk_print_settings_get_finishings(void *);
+extern (C) void gtk_print_settings_set_dither(void *, char *);
+extern (C) char * gtk_print_settings_get_dither(void *);
+extern (C) void gtk_print_settings_set_media_type(void *, char *);
+extern (C) char * gtk_print_settings_get_media_type(void *);
+extern (C) void gtk_print_settings_set_default_source(void *, char *);
+extern (C) char * gtk_print_settings_get_default_source(void *);
+extern (C) void gtk_print_settings_set_page_set(void *, int);
+extern (C) int gtk_print_settings_get_page_set(void *);
+extern (C) void gtk_print_settings_set_page_ranges(void *, aGtkPageRange *, int);
+extern (C) _GtkPageRange * gtk_print_settings_get_page_ranges(void *, int *);
+extern (C) void gtk_print_settings_set_print_pages(void *, int);
+extern (C) int gtk_print_settings_get_print_pages(void *);
+extern (C) void gtk_print_settings_set_scale(void *, double);
+extern (C) double gtk_print_settings_get_scale(void *);
+extern (C) void gtk_print_settings_set_resolution(void *, int);
+extern (C) int gtk_print_settings_get_resolution(void *);
+extern (C) void gtk_print_settings_set_number_up(void *, int);
+extern (C) int gtk_print_settings_get_number_up(void *);
+extern (C) void gtk_print_settings_set_n_copies(void *, int);
+extern (C) int gtk_print_settings_get_n_copies(void *);
+extern (C) void gtk_print_settings_set_quality(void *, int);
+extern (C) int gtk_print_settings_get_quality(void *);
+extern (C) void gtk_print_settings_set_duplex(void *, int);
+extern (C) int gtk_print_settings_get_duplex(void *);
+extern (C) void gtk_print_settings_set_reverse(void *, int);
+extern (C) int gtk_print_settings_get_reverse(void *);
+extern (C) void gtk_print_settings_set_collate(void *, int);
+extern (C) int gtk_print_settings_get_collate(void *);
+extern (C) void gtk_print_settings_set_use_color(void *, int);
+extern (C) int gtk_print_settings_get_use_color(void *);
+extern (C) void gtk_print_settings_set_paper_height(void *, double, int);
+extern (C) double gtk_print_settings_get_paper_height(void *, int);
+extern (C) void gtk_print_settings_set_paper_width(void *, double, int);
+extern (C) double gtk_print_settings_get_paper_width(void *, int);
+extern (C) void gtk_print_settings_set_paper_size(void *, void *);
+extern (C) void * gtk_print_settings_get_paper_size(void *);
+extern (C) void gtk_print_settings_set_orientation(void *, int);
+extern (C) int gtk_print_settings_get_orientation(void *);
+extern (C) void gtk_print_settings_set_printer(void *, char *);
+extern (C) char * gtk_print_settings_get_printer(void *);
+extern (C) void gtk_print_settings_set_int(void *, char *, int);
+extern (C) int gtk_print_settings_get_int_with_default(void *, char *, int);
+extern (C) int gtk_print_settings_get_int(void *, char *);
+extern (C) void gtk_print_settings_set_length(void *, char *, double, int);
+extern (C) double gtk_print_settings_get_length(void *, char *, int);
+extern (C) void gtk_print_settings_set_double(void *, char *, double);
+extern (C) double gtk_print_settings_get_double_with_default(void *, char *, double);
+extern (C) double gtk_print_settings_get_double(void *, char *);
+extern (C) void gtk_print_settings_set_bool(void *, char *, int);
+extern (C) int gtk_print_settings_get_bool(void *, char *);
+extern (C) void gtk_print_settings_foreach(void *, _BCD_func__9823, void *);
+extern (C) void gtk_print_settings_unset(void *, char *);
+extern (C) void gtk_print_settings_set(void *, char *, char *);
+extern (C) char * gtk_print_settings_get(void *, char *);
+extern (C) int gtk_print_settings_has_key(void *, char *);
+extern (C) void gtk_print_settings_to_key_file(void *, void *, char *);
+extern (C) void * gtk_print_settings_new_from_key_file(void *, char *, _GError * *);
+extern (C) int gtk_print_settings_to_file(void *, char *, _GError * *);
+extern (C) void * gtk_print_settings_new_from_file(char *, _GError * *);
+extern (C) void * gtk_print_settings_copy(void *);
+extern (C) void * gtk_print_settings_new();
+extern (C) uint gtk_print_settings_get_type();
+extern (C) void gtk_page_setup_to_key_file(void *, void *, char *);
+extern (C) void * gtk_page_setup_new_from_key_file(void *, char *, _GError * *);
+extern (C) int gtk_page_setup_to_file(void *, char *, _GError * *);
+extern (C) void * gtk_page_setup_new_from_file(char *, _GError * *);
+extern (C) double gtk_page_setup_get_page_height(void *, int);
+extern (C) double gtk_page_setup_get_page_width(void *, int);
+extern (C) double gtk_page_setup_get_paper_height(void *, int);
+extern (C) double gtk_page_setup_get_paper_width(void *, int);
+extern (C) void gtk_page_setup_set_paper_size_and_default_margins(void *, void *);
+extern (C) void gtk_page_setup_set_right_margin(void *, double, int);
+extern (C) double gtk_page_setup_get_right_margin(void *, int);
+extern (C) void gtk_page_setup_set_left_margin(void *, double, int);
+extern (C) double gtk_page_setup_get_left_margin(void *, int);
+extern (C) void gtk_page_setup_set_bottom_margin(void *, double, int);
+extern (C) double gtk_page_setup_get_bottom_margin(void *, int);
+extern (C) void gtk_page_setup_set_top_margin(void *, double, int);
+extern (C) double gtk_page_setup_get_top_margin(void *, int);
+extern (C) void gtk_page_setup_set_paper_size(void *, void *);
+extern (C) void * gtk_page_setup_get_paper_size(void *);
+extern (C) void gtk_page_setup_set_orientation(void *, int);
+extern (C) int gtk_page_setup_get_orientation(void *);
+extern (C) void * gtk_page_setup_copy(void *);
+extern (C) void * gtk_page_setup_new();
+extern (C) uint gtk_page_setup_get_type();
+extern (C) void gtk_paper_size_to_key_file(void *, void *, char *);
+extern (C) void * gtk_paper_size_new_from_key_file(void *, char *, _GError * *);
+extern (C) char * gtk_paper_size_get_default();
+extern (C) double gtk_paper_size_get_default_right_margin(void *, int);
+extern (C) double gtk_paper_size_get_default_left_margin(void *, int);
+extern (C) double gtk_paper_size_get_default_bottom_margin(void *, int);
+extern (C) double gtk_paper_size_get_default_top_margin(void *, int);
+extern (C) void gtk_paper_size_set_size(void *, double, double, int);
+extern (C) int gtk_paper_size_is_custom(void *);
+extern (C) double gtk_paper_size_get_height(void *, int);
+extern (C) double gtk_paper_size_get_width(void *, int);
+extern (C) char * gtk_paper_size_get_ppd_name(void *);
+extern (C) char * gtk_paper_size_get_display_name(void *);
+extern (C) char * gtk_paper_size_get_name(void *);
+extern (C) _GList * gtk_paper_size_get_paper_sizes(int);
+extern (C) int gtk_paper_size_is_equal(void *, void *);
+extern (C) void gtk_paper_size_free(void *);
+extern (C) void * gtk_paper_size_copy(void *);
+extern (C) void * gtk_paper_size_new_custom(char *, char *, double, double, int);
+extern (C) void * gtk_paper_size_new_from_ppd(char *, char *, double, double);
+extern (C) void * gtk_paper_size_new(char *);
+extern (C) uint gtk_paper_size_get_type();
+extern (C) void gtk_preview_reset();
+extern (C) _GtkPreviewInfo * gtk_preview_get_info();
+extern (C) _GdkColormap * gtk_preview_get_cmap();
+extern (C) _GdkVisual * gtk_preview_get_visual();
+extern (C) void gtk_preview_set_dither(aGtkPreview *, int);
+extern (C) void gtk_preview_set_reserved(int);
+extern (C) void gtk_preview_set_install_cmap(int);
+extern (C) void gtk_preview_set_color_cube(uint, uint, uint, uint);
+extern (C) void gtk_preview_set_gamma(double);
+extern (C) void gtk_preview_set_expand(aGtkPreview *, int);
+extern (C) void gtk_preview_draw_row(aGtkPreview *, char *, int, int, int);
+extern (C) void gtk_preview_put(aGtkPreview *, _GdkDrawable *, _GdkGC *, int, int, int, int, int, int);
+extern (C) void gtk_preview_size(aGtkPreview *, int, int);
+extern (C) _GtkWidget * gtk_preview_new(int);
+extern (C) void gtk_preview_uninit();
+extern (C) uint gtk_preview_get_type();
+extern (C) void _gtk_plug_remove_from_socket(aGtkPlug *, aGtkSocket *);
+extern (C) void _gtk_plug_add_to_socket(aGtkPlug *, aGtkSocket *);
+extern (C) uint gtk_plug_get_id(aGtkPlug *);
+extern (C) _GtkWidget * gtk_plug_new_for_display(_GdkDisplay *, uint);
+extern (C) void gtk_plug_construct_for_display(aGtkPlug *, _GdkDisplay *, uint);
+extern (C) _GtkWidget * gtk_plug_new(uint);
+extern (C) void gtk_plug_construct(aGtkPlug *, uint);
+extern (C) uint gtk_plug_get_type();
+extern (C) void gtk_socket_steal(aGtkSocket *, uint);
+extern (C) uint gtk_socket_get_id(aGtkSocket *);
+extern (C) void gtk_socket_add_id(aGtkSocket *, uint);
+extern (C) _GtkWidget * gtk_socket_new();
+extern (C) uint gtk_socket_get_type();
+extern (C) void gtk_pixmap_set_build_insensitive(aGtkPixmap *, int);
+extern (C) void gtk_pixmap_get(aGtkPixmap *, _GdkDrawable * *, _GdkDrawable * *);
+extern (C) void gtk_pixmap_set(aGtkPixmap *, _GdkDrawable *, _GdkDrawable *);
+extern (C) _GtkWidget * gtk_pixmap_new(_GdkDrawable *, _GdkDrawable *);
+extern (C) uint gtk_pixmap_get_type();
+extern (C) void gtk_option_menu_set_history(aGtkOptionMenu *, uint);
+extern (C) int gtk_option_menu_get_history(aGtkOptionMenu *);
+extern (C) void gtk_option_menu_remove_menu(aGtkOptionMenu *);
+extern (C) void gtk_option_menu_set_menu(aGtkOptionMenu *, aGtkWidget *);
+extern (C) _GtkWidget * gtk_option_menu_get_menu(aGtkOptionMenu *);
+extern (C) _GtkWidget * gtk_option_menu_new();
+extern (C) uint gtk_option_menu_get_type();
+extern (C) void gtk_old_editable_changed(aGtkOldEditable *);
+extern (C) void gtk_old_editable_claim_selection(aGtkOldEditable *, int, uint);
+extern (C) uint gtk_old_editable_get_type();
+extern (C) void gtk_notebook_set_tab_detachable(aGtkNotebook *, aGtkWidget *, int);
+extern (C) int gtk_notebook_get_tab_detachable(aGtkNotebook *, aGtkWidget *);
+extern (C) void gtk_notebook_set_tab_reorderable(aGtkNotebook *, aGtkWidget *, int);
+extern (C) int gtk_notebook_get_tab_reorderable(aGtkNotebook *, aGtkWidget *);
+extern (C) void gtk_notebook_reorder_child(aGtkNotebook *, aGtkWidget *, int);
+extern (C) void gtk_notebook_set_tab_label_packing(aGtkNotebook *, aGtkWidget *, int, int, int);
+extern (C) void gtk_notebook_query_tab_label_packing(aGtkNotebook *, aGtkWidget *, int *, int *, int *);
+extern (C) char * gtk_notebook_get_menu_label_text(aGtkNotebook *, aGtkWidget *);
+extern (C) void gtk_notebook_set_menu_label_text(aGtkNotebook *, aGtkWidget *, char *);
+extern (C) void gtk_notebook_set_menu_label(aGtkNotebook *, aGtkWidget *, aGtkWidget *);
+extern (C) _GtkWidget * gtk_notebook_get_menu_label(aGtkNotebook *, aGtkWidget *);
+extern (C) char * gtk_notebook_get_tab_label_text(aGtkNotebook *, aGtkWidget *);
+extern (C) void gtk_notebook_set_tab_label_text(aGtkNotebook *, aGtkWidget *, char *);
+extern (C) void gtk_notebook_set_tab_label(aGtkNotebook *, aGtkWidget *, aGtkWidget *);
+extern (C) _GtkWidget * gtk_notebook_get_tab_label(aGtkNotebook *, aGtkWidget *);
+extern (C) void gtk_notebook_popup_disable(aGtkNotebook *);
+extern (C) void gtk_notebook_popup_enable(aGtkNotebook *);
+extern (C) int gtk_notebook_get_scrollable(aGtkNotebook *);
+extern (C) void gtk_notebook_set_scrollable(aGtkNotebook *, int);
+extern (C) void gtk_notebook_set_tab_vborder(aGtkNotebook *, uint);
+extern (C) void gtk_notebook_set_tab_hborder(aGtkNotebook *, uint);
+extern (C) void gtk_notebook_set_tab_border(aGtkNotebook *, uint);
+extern (C) void gtk_notebook_set_homogeneous_tabs(aGtkNotebook *, int);
+extern (C) int gtk_notebook_get_tab_pos(aGtkNotebook *);
+extern (C) void gtk_notebook_set_tab_pos(aGtkNotebook *, int);
+extern (C) int gtk_notebook_get_show_tabs(aGtkNotebook *);
+extern (C) void gtk_notebook_set_show_tabs(aGtkNotebook *, int);
+extern (C) int gtk_notebook_get_show_border(aGtkNotebook *);
+extern (C) void gtk_notebook_set_show_border(aGtkNotebook *, int);
+extern (C) void gtk_notebook_prev_page(aGtkNotebook *);
+extern (C) void gtk_notebook_next_page(aGtkNotebook *);
+extern (C) void gtk_notebook_set_current_page(aGtkNotebook *, int);
+extern (C) int gtk_notebook_page_num(aGtkNotebook *, aGtkWidget *);
+extern (C) int gtk_notebook_get_n_pages(aGtkNotebook *);
+extern (C) _GtkWidget * gtk_notebook_get_nth_page(aGtkNotebook *, int);
+extern (C) int gtk_notebook_get_current_page(aGtkNotebook *);
+extern (C) void * gtk_notebook_get_group(aGtkNotebook *);
+extern (C) void gtk_notebook_set_group(aGtkNotebook *, void *);
+extern (C) int gtk_notebook_get_group_id(aGtkNotebook *);
+extern (C) void gtk_notebook_set_group_id(aGtkNotebook *, int);
+extern (C) void gtk_notebook_set_window_creation_hook(_BCD_func__9964, void *, _BCD_func__13158);
+extern (C) void gtk_notebook_remove_page(aGtkNotebook *, int);
+extern (C) int gtk_notebook_insert_page_menu(aGtkNotebook *, aGtkWidget *, aGtkWidget *, aGtkWidget *, int);
+extern (C) int gtk_notebook_insert_page(aGtkNotebook *, aGtkWidget *, aGtkWidget *, int);
+extern (C) int gtk_notebook_prepend_page_menu(aGtkNotebook *, aGtkWidget *, aGtkWidget *, aGtkWidget *);
+extern (C) int gtk_notebook_prepend_page(aGtkNotebook *, aGtkWidget *, aGtkWidget *);
+extern (C) int gtk_notebook_append_page_menu(aGtkNotebook *, aGtkWidget *, aGtkWidget *, aGtkWidget *);
+extern (C) int gtk_notebook_append_page(aGtkNotebook *, aGtkWidget *, aGtkWidget *);
+extern (C) _GtkWidget * gtk_notebook_new();
+extern (C) uint gtk_notebook_get_type();
+extern (C) void _gtk_modules_settings_changed(aGtkSettings *, char *);
+extern (C) void _gtk_modules_init(int *, char * * *, char *);
+extern (C) char * * _gtk_get_module_path(char *);
+extern (C) char * _gtk_find_module(char *, char *);
+extern (C) void gtk_message_dialog_format_secondary_markup(aGtkMessageDialog *, char *, ...);
+extern (C) void gtk_message_dialog_format_secondary_text(aGtkMessageDialog *, char *, ...);
+extern (C) void gtk_message_dialog_set_markup(aGtkMessageDialog *, char *);
+extern (C) void gtk_message_dialog_set_image(aGtkMessageDialog *, aGtkWidget *);
+extern (C) _GtkWidget * gtk_message_dialog_new_with_markup(aGtkWindow *, int, int, int, char *, ...);
+extern (C) _GtkWidget * gtk_message_dialog_new(aGtkWindow *, int, int, int, char *, ...);
+extern (C) uint gtk_message_dialog_get_type();
+extern (C) void gtk_menu_tool_button_set_arrow_tooltip_markup(aGtkMenuToolButton *, char *);
+extern (C) void gtk_menu_tool_button_set_arrow_tooltip_text(aGtkMenuToolButton *, char *);
+extern (C) void gtk_menu_tool_button_set_arrow_tooltip(aGtkMenuToolButton *, aGtkTooltips *, char *, char *);
+extern (C) _GtkWidget * gtk_menu_tool_button_get_menu(aGtkMenuToolButton *);
+extern (C) void gtk_menu_tool_button_set_menu(aGtkMenuToolButton *, aGtkWidget *);
+extern (C) _GtkToolItem * gtk_menu_tool_button_new_from_stock(char *);
+extern (C) _GtkToolItem * gtk_menu_tool_button_new(aGtkWidget *, char *);
+extern (C) uint gtk_menu_tool_button_get_type();
+extern (C) _GtkWidget * _gtk_tool_button_get_button(aGtkToolButton *);
+extern (C) _GtkWidget * gtk_tool_button_get_label_widget(aGtkToolButton *);
+extern (C) void gtk_tool_button_set_label_widget(aGtkToolButton *, aGtkWidget *);
+extern (C) _GtkWidget * gtk_tool_button_get_icon_widget(aGtkToolButton *);
+extern (C) void gtk_tool_button_set_icon_widget(aGtkToolButton *, aGtkWidget *);
+extern (C) char * gtk_tool_button_get_icon_name(aGtkToolButton *);
+extern (C) void gtk_tool_button_set_icon_name(aGtkToolButton *, char *);
+extern (C) char * gtk_tool_button_get_stock_id(aGtkToolButton *);
+extern (C) void gtk_tool_button_set_stock_id(aGtkToolButton *, char *);
+extern (C) int gtk_tool_button_get_use_underline(aGtkToolButton *);
+extern (C) void gtk_tool_button_set_use_underline(aGtkToolButton *, int);
+extern (C) char * gtk_tool_button_get_label(aGtkToolButton *);
+extern (C) void gtk_tool_button_set_label(aGtkToolButton *, char *);
+extern (C) _GtkToolItem * gtk_tool_button_new_from_stock(char *);
+extern (C) _GtkToolItem * gtk_tool_button_new(aGtkWidget *, char *);
+extern (C) uint gtk_tool_button_get_type();
+extern (C) void _gtk_tool_item_toolbar_reconfigured(aGtkToolItem *);
+extern (C) void gtk_tool_item_rebuild_menu(aGtkToolItem *);
+extern (C) void gtk_tool_item_set_proxy_menu_item(aGtkToolItem *, char *, aGtkWidget *);
+extern (C) _GtkWidget * gtk_tool_item_get_proxy_menu_item(aGtkToolItem *, char *);
+extern (C) _GtkWidget * gtk_tool_item_retrieve_proxy_menu_item(aGtkToolItem *);
+extern (C) int gtk_tool_item_get_relief_style(aGtkToolItem *);
+extern (C) int gtk_tool_item_get_toolbar_style(aGtkToolItem *);
+extern (C) int gtk_tool_item_get_orientation(aGtkToolItem *);
+extern (C) int gtk_tool_item_get_icon_size(aGtkToolItem *);
+extern (C) void gtk_tool_item_set_is_important(aGtkToolItem *, int);
+extern (C) int gtk_tool_item_get_is_important(aGtkToolItem *);
+extern (C) int gtk_tool_item_get_visible_vertical(aGtkToolItem *);
+extern (C) void gtk_tool_item_set_visible_vertical(aGtkToolItem *, int);
+extern (C) int gtk_tool_item_get_visible_horizontal(aGtkToolItem *);
+extern (C) void gtk_tool_item_set_visible_horizontal(aGtkToolItem *, int);
+extern (C) int gtk_tool_item_get_use_drag_window(aGtkToolItem *);
+extern (C) void gtk_tool_item_set_use_drag_window(aGtkToolItem *, int);
+extern (C) void gtk_tool_item_set_tooltip_markup(aGtkToolItem *, char *);
+extern (C) void gtk_tool_item_set_tooltip_text(aGtkToolItem *, char *);
+extern (C) void gtk_tool_item_set_tooltip(aGtkToolItem *, aGtkTooltips *, char *, char *);
+extern (C) int gtk_tool_item_get_expand(aGtkToolItem *);
+extern (C) void gtk_tool_item_set_expand(aGtkToolItem *, int);
+extern (C) int gtk_tool_item_get_homogeneous(aGtkToolItem *);
+extern (C) void gtk_tool_item_set_homogeneous(aGtkToolItem *, int);
+extern (C) _GtkToolItem * gtk_tool_item_new();
+extern (C) uint gtk_tool_item_get_type();
+extern (C) int gtk_tooltips_get_info_from_tip_window(aGtkWindow *, _GtkTooltips * *, _GtkWidget * *);
+extern (C) void gtk_tooltips_force_window(aGtkTooltips *);
+extern (C) _GtkTooltipsData * gtk_tooltips_data_get(aGtkWidget *);
+extern (C) void gtk_tooltips_set_tip(aGtkTooltips *, aGtkWidget *, char *, char *);
+extern (C) void gtk_tooltips_set_delay(aGtkTooltips *, uint);
+extern (C) void gtk_tooltips_disable(aGtkTooltips *);
+extern (C) void gtk_tooltips_enable(aGtkTooltips *);
+extern (C) _GtkTooltips * gtk_tooltips_new();
+extern (C) uint gtk_tooltips_get_type();
+extern (C) void _gtk_menu_bar_cycle_focus(aGtkMenuBar *, int);
+extern (C) void gtk_menu_bar_set_child_pack_direction(aGtkMenuBar *, int);
+extern (C) int gtk_menu_bar_get_child_pack_direction(aGtkMenuBar *);
+extern (C) void gtk_menu_bar_set_pack_direction(aGtkMenuBar *, int);
+extern (C) int gtk_menu_bar_get_pack_direction(aGtkMenuBar *);
+extern (C) _GtkWidget * gtk_menu_bar_new();
+extern (C) uint gtk_menu_bar_get_type();
+extern (C) char * _gtk_get_lc_ctype();
+extern (C) int _gtk_boolean_handled_accumulator(_GSignalInvocationHint *, _GValue *, _GValue *, void *);
+extern (C) void gtk_propagate_event(aGtkWidget *, _GdkEvent *);
+extern (C) _GtkWidget * gtk_get_event_widget(_GdkEvent *);
+extern (C) int gtk_get_current_event_state(int *);
+extern (C) uint gtk_get_current_event_time();
+extern (C) _GdkEvent * gtk_get_current_event();
+extern (C) void gtk_key_snooper_remove(uint);
+extern (C) uint gtk_key_snooper_install(_BCD_func__10115, void *);
+extern (C) void gtk_input_remove(uint);
+extern (C) uint gtk_input_add_full(int, int, _BCD_func__13745, _BCD_func__13157, void *, _BCD_func__13158);
+extern (C) void gtk_idle_remove_by_data(void *);
+extern (C) void gtk_idle_remove(uint);
+extern (C) uint gtk_idle_add_full(int, _BCD_func__12884, _BCD_func__13157, void *, _BCD_func__13158);
+extern (C) uint gtk_idle_add_priority(int, _BCD_func__12884, void *);
+extern (C) uint gtk_idle_add(_BCD_func__12884, void *);
+extern (C) void gtk_timeout_remove(uint);
+extern (C) uint gtk_timeout_add_full(uint, _BCD_func__12884, _BCD_func__13157, void *, _BCD_func__13158);
+extern (C) uint gtk_timeout_add(uint, _BCD_func__12884, void *);
+extern (C) void gtk_quit_remove_by_data(void *);
+extern (C) void gtk_quit_remove(uint);
+extern (C) uint gtk_quit_add_full(uint, _BCD_func__12884, _BCD_func__13157, void *, _BCD_func__13158);
+extern (C) uint gtk_quit_add(uint, _BCD_func__12884, void *);
+extern (C) void gtk_quit_add_destroy(uint, aGtkObject *);
+extern (C) void gtk_init_add(_BCD_func__12884, void *);
+extern (C) void gtk_grab_remove(aGtkWidget *);
+extern (C) _GtkWidget * gtk_grab_get_current();
+extern (C) void gtk_grab_add(aGtkWidget *);
+extern (C) int gtk_false();
+extern (C) int gtk_true();
+extern (C) int gtk_main_iteration_do(int);
+extern (C) int gtk_main_iteration();
+extern (C) void gtk_main_quit();
+extern (C) uint gtk_main_level();
+extern (C) void gtk_main();
+extern (C) void gtk_main_do_event(_GdkEvent *);
+extern (C) int gtk_events_pending();
+extern (C) void * gtk_get_default_language();
+extern (C) char * gtk_set_locale();
+extern (C) void gtk_disable_setlocale();
+extern (C) void gtk_exit(int);
+extern (C) void * gtk_get_option_group(int);
+extern (C) int gtk_init_with_args(int *, char * * *, char *, _GOptionEntry *, char *, _GError * *);
+extern (C) int gtk_init_check(int *, char * * *);
+extern (C) void gtk_init(int *, char * * *);
+extern (C) int gtk_parse_args(int *, char * * *);
+extern (C) char * gtk_check_version(uint, uint, uint);
+extern (C) extern uint gtk_interface_age;
+extern (C) extern uint gtk_binary_age;
+extern (C) extern uint gtk_micro_version;
+extern (C) extern uint gtk_minor_version;
+extern (C) extern uint gtk_major_version;
+extern (C) void gtk_list_end_drag_selection(aGtkList *);
+extern (C) void gtk_list_undo_selection(aGtkList *);
+extern (C) void gtk_list_toggle_row(aGtkList *, aGtkWidget *);
+extern (C) void gtk_list_toggle_focus_row(aGtkList *);
+extern (C) void gtk_list_toggle_add_mode(aGtkList *);
+extern (C) void gtk_list_scroll_vertical(aGtkList *, int, float);
+extern (C) void gtk_list_scroll_horizontal(aGtkList *, int, float);
+extern (C) void gtk_list_unselect_all(aGtkList *);
+extern (C) void gtk_list_select_all(aGtkList *);
+extern (C) void gtk_list_end_selection(aGtkList *);
+extern (C) void gtk_list_start_selection(aGtkList *);
+extern (C) void gtk_list_extend_selection(aGtkList *, int, float, int);
+extern (C) void gtk_list_set_selection_mode(aGtkList *, int);
+extern (C) int gtk_list_child_position(aGtkList *, aGtkWidget *);
+extern (C) void gtk_list_unselect_child(aGtkList *, aGtkWidget *);
+extern (C) void gtk_list_select_child(aGtkList *, aGtkWidget *);
+extern (C) void gtk_list_unselect_item(aGtkList *, int);
+extern (C) void gtk_list_select_item(aGtkList *, int);
+extern (C) void gtk_list_clear_items(aGtkList *, int, int);
+extern (C) void gtk_list_remove_items_no_unref(aGtkList *, _GList *);
+extern (C) void gtk_list_remove_items(aGtkList *, _GList *);
+extern (C) void gtk_list_prepend_items(aGtkList *, _GList *);
+extern (C) void gtk_list_append_items(aGtkList *, _GList *);
+extern (C) void gtk_list_insert_items(aGtkList *, _GList *, int);
+extern (C) _GtkWidget * gtk_list_new();
+extern (C) uint gtk_list_get_type();
+extern (C) void gtk_list_item_deselect(aGtkListItem *);
+extern (C) void gtk_list_item_select(aGtkListItem *);
+extern (C) _GtkWidget * gtk_list_item_new_with_label(char *);
+extern (C) _GtkWidget * gtk_list_item_new();
+extern (C) uint gtk_list_item_get_type();
+extern (C) _BCD_func__10158 gtk_link_button_set_uri_hook(_BCD_func__10158, void *, _BCD_func__13158);
+extern (C) void gtk_link_button_set_uri(aGtkLinkButton *, char *);
+extern (C) char * gtk_link_button_get_uri(aGtkLinkButton *);
+extern (C) _GtkWidget * gtk_link_button_new_with_label(char *, char *);
+extern (C) _GtkWidget * gtk_link_button_new(char *);
+extern (C) uint gtk_link_button_get_type();
+extern (C) void gtk_layout_thaw(aGtkLayout *);
+extern (C) void gtk_layout_freeze(aGtkLayout *);
+extern (C) void gtk_layout_set_vadjustment(aGtkLayout *, aGtkAdjustment *);
+extern (C) void gtk_layout_set_hadjustment(aGtkLayout *, aGtkAdjustment *);
+extern (C) _GtkAdjustment * gtk_layout_get_vadjustment(aGtkLayout *);
+extern (C) _GtkAdjustment * gtk_layout_get_hadjustment(aGtkLayout *);
+extern (C) void gtk_layout_get_size(aGtkLayout *, uint *, uint *);
+extern (C) void gtk_layout_set_size(aGtkLayout *, uint, uint);
+extern (C) void gtk_layout_move(aGtkLayout *, aGtkWidget *, int, int);
+extern (C) void gtk_layout_put(aGtkLayout *, aGtkWidget *, int, int);
+extern (C) _GtkWidget * gtk_layout_new(aGtkAdjustment *, aGtkAdjustment *);
+extern (C) uint gtk_layout_get_type();
+extern (C) _GdkScreen * gtk_invisible_get_screen(aGtkInvisible *);
+extern (C) void gtk_invisible_set_screen(aGtkInvisible *, _GdkScreen *);
+extern (C) _GtkWidget * gtk_invisible_new_for_screen(_GdkScreen *);
+extern (C) _GtkWidget * gtk_invisible_new();
+extern (C) uint gtk_invisible_get_type();
+extern (C) _GtkWidget * gtk_input_dialog_new();
+extern (C) uint gtk_input_dialog_get_type();
+extern (C) void gtk_im_multicontext_append_menuitems(aGtkIMMulticontext *, aGtkMenuShell *);
+extern (C) _GtkIMContext * gtk_im_multicontext_new();
+extern (C) uint gtk_im_multicontext_get_type();
+extern (C) void gtk_im_context_simple_add_table(aGtkIMContextSimple *, ushort *, int, int);
+extern (C) _GtkIMContext * gtk_im_context_simple_new();
+extern (C) uint gtk_im_context_simple_get_type();
+extern (C) _GtkWidget * gtk_image_menu_item_get_image(aGtkImageMenuItem *);
+extern (C) void gtk_image_menu_item_set_image(aGtkImageMenuItem *, aGtkWidget *);
+extern (C) _GtkWidget * gtk_image_menu_item_new_from_stock(char *, aGtkAccelGroup *);
+extern (C) _GtkWidget * gtk_image_menu_item_new_with_mnemonic(char *);
+extern (C) _GtkWidget * gtk_image_menu_item_new_with_label(char *);
+extern (C) _GtkWidget * gtk_image_menu_item_new();
+extern (C) uint gtk_image_menu_item_get_type();
+extern (C) int gtk_icon_view_get_tooltip_column(aGtkIconView *);
+extern (C) void gtk_icon_view_set_tooltip_column(aGtkIconView *, int);
+extern (C) int gtk_icon_view_get_tooltip_context(aGtkIconView *, int *, int *, int, void * *, void * *, aGtkTreeIter *);
+extern (C) void gtk_icon_view_set_tooltip_cell(aGtkIconView *, void *, void *, aGtkCellRenderer *);
+extern (C) void gtk_icon_view_set_tooltip_item(aGtkIconView *, void *, void *);
+extern (C) void gtk_icon_view_convert_widget_to_bin_window_coords(aGtkIconView *, int, int, int *, int *);
+extern (C) _GdkDrawable * gtk_icon_view_create_drag_icon(aGtkIconView *, void *);
+extern (C) int gtk_icon_view_get_dest_item_at_pos(aGtkIconView *, int, int, void * *, int *);
+extern (C) void gtk_icon_view_get_drag_dest_item(aGtkIconView *, void * *, int *);
+extern (C) void gtk_icon_view_set_drag_dest_item(aGtkIconView *, void *, int);
+extern (C) int gtk_icon_view_get_reorderable(aGtkIconView *);
+extern (C) void gtk_icon_view_set_reorderable(aGtkIconView *, int);
+extern (C) void gtk_icon_view_unset_model_drag_dest(aGtkIconView *);
+extern (C) void gtk_icon_view_unset_model_drag_source(aGtkIconView *);
+extern (C) void gtk_icon_view_enable_model_drag_dest(aGtkIconView *, aGtkTargetEntry *, int, int);
+extern (C) void gtk_icon_view_enable_model_drag_source(aGtkIconView *, int, aGtkTargetEntry *, int, int);
+extern (C) void gtk_icon_view_scroll_to_path(aGtkIconView *, void *, int, float, float);
+extern (C) int gtk_icon_view_get_cursor(aGtkIconView *, void * *, _GtkCellRenderer * *);
+extern (C) void gtk_icon_view_set_cursor(aGtkIconView *, void *, aGtkCellRenderer *, int);
+extern (C) void gtk_icon_view_item_activated(aGtkIconView *, void *);
+extern (C) void gtk_icon_view_unselect_all(aGtkIconView *);
+extern (C) void gtk_icon_view_select_all(aGtkIconView *);
+extern (C) _GList * gtk_icon_view_get_selected_items(aGtkIconView *);
+extern (C) int gtk_icon_view_path_is_selected(aGtkIconView *, void *);
+extern (C) void gtk_icon_view_unselect_path(aGtkIconView *, void *);
+extern (C) void gtk_icon_view_select_path(aGtkIconView *, void *);
+extern (C) int gtk_icon_view_get_selection_mode(aGtkIconView *);
+extern (C) void gtk_icon_view_set_selection_mode(aGtkIconView *, int);
+extern (C) void gtk_icon_view_selected_foreach(aGtkIconView *, _BCD_func__10270, void *);
+extern (C) int gtk_icon_view_get_visible_range(aGtkIconView *, void * *, void * *);
+extern (C) int gtk_icon_view_get_item_at_pos(aGtkIconView *, int, int, void * *, _GtkCellRenderer * *);
+extern (C) void * gtk_icon_view_get_path_at_pos(aGtkIconView *, int, int);
+extern (C) int gtk_icon_view_get_margin(aGtkIconView *);
+extern (C) void gtk_icon_view_set_margin(aGtkIconView *, int);
+extern (C) int gtk_icon_view_get_column_spacing(aGtkIconView *);
+extern (C) void gtk_icon_view_set_column_spacing(aGtkIconView *, int);
+extern (C) int gtk_icon_view_get_row_spacing(aGtkIconView *);
+extern (C) void gtk_icon_view_set_row_spacing(aGtkIconView *, int);
+extern (C) int gtk_icon_view_get_spacing(aGtkIconView *);
+extern (C) void gtk_icon_view_set_spacing(aGtkIconView *, int);
+extern (C) int gtk_icon_view_get_item_width(aGtkIconView *);
+extern (C) void gtk_icon_view_set_item_width(aGtkIconView *, int);
+extern (C) int gtk_icon_view_get_columns(aGtkIconView *);
+extern (C) void gtk_icon_view_set_columns(aGtkIconView *, int);
+extern (C) int gtk_icon_view_get_orientation(aGtkIconView *);
+extern (C) void gtk_icon_view_set_orientation(aGtkIconView *, int);
+extern (C) int gtk_icon_view_get_pixbuf_column(aGtkIconView *);
+extern (C) void gtk_icon_view_set_pixbuf_column(aGtkIconView *, int);
+extern (C) int gtk_icon_view_get_markup_column(aGtkIconView *);
+extern (C) void gtk_icon_view_set_markup_column(aGtkIconView *, int);
+extern (C) int gtk_icon_view_get_text_column(aGtkIconView *);
+extern (C) void gtk_icon_view_set_text_column(aGtkIconView *, int);
+extern (C) void * gtk_icon_view_get_model(aGtkIconView *);
+extern (C) void gtk_icon_view_set_model(aGtkIconView *, void *);
+extern (C) _GtkWidget * gtk_icon_view_new_with_model(void *);
+extern (C) _GtkWidget * gtk_icon_view_new();
+extern (C) uint gtk_icon_view_get_type();
+extern (C) void _gtk_tooltip_hide(aGtkWidget *);
+extern (C) void _gtk_tooltip_handle_event(_GdkEvent *);
+extern (C) void _gtk_tooltip_toggle_keyboard_mode(aGtkWidget *);
+extern (C) void _gtk_tooltip_focus_out(aGtkWidget *);
+extern (C) void _gtk_tooltip_focus_in(aGtkWidget *);
+extern (C) void gtk_tooltip_trigger_tooltip_query(_GdkDisplay *);
+extern (C) void gtk_tooltip_set_tip_area(void *, _GdkRectangle *);
+extern (C) void gtk_tooltip_set_custom(void *, aGtkWidget *);
+extern (C) void gtk_tooltip_set_icon_from_stock(void *, char *, int);
+extern (C) void gtk_tooltip_set_icon(void *, void *);
+extern (C) void gtk_tooltip_set_text(void *, char *);
+extern (C) void gtk_tooltip_set_markup(void *, char *);
+extern (C) uint gtk_tooltip_get_type();
+extern (C) void _gtk_icon_theme_ensure_builtin_cache();
+extern (C) void _gtk_icon_theme_check_reload(_GdkDisplay *);
+extern (C) char * gtk_icon_info_get_display_name(void *);
+extern (C) int gtk_icon_info_get_attach_points(void *, _GdkPoint * *, int *);
+extern (C) int gtk_icon_info_get_embedded_rect(void *, _GdkRectangle *);
+extern (C) void gtk_icon_info_set_raw_coordinates(void *, int);
+extern (C) void * gtk_icon_info_load_icon(void *, _GError * *);
+extern (C) void * gtk_icon_info_get_builtin_pixbuf(void *);
+extern (C) char * gtk_icon_info_get_filename(void *);
+extern (C) int gtk_icon_info_get_base_size(void *);
+extern (C) void gtk_icon_info_free(void *);
+extern (C) void * gtk_icon_info_copy(void *);
+extern (C) uint gtk_icon_info_get_type();
+extern (C) void gtk_icon_theme_add_builtin_icon(char *, int, void *);
+extern (C) int gtk_icon_theme_rescan_if_needed(aGtkIconTheme *);
+extern (C) char * gtk_icon_theme_get_example_icon_name(aGtkIconTheme *);
+extern (C) _GList * gtk_icon_theme_list_contexts(aGtkIconTheme *);
+extern (C) _GList * gtk_icon_theme_list_icons(aGtkIconTheme *, char *);
+extern (C) void * gtk_icon_theme_load_icon(aGtkIconTheme *, char *, int, int, _GError * *);
+extern (C) void * gtk_icon_theme_choose_icon(aGtkIconTheme *, char * *, int, int);
+extern (C) void * gtk_icon_theme_lookup_icon(aGtkIconTheme *, char *, int, int);
+extern (C) int * gtk_icon_theme_get_icon_sizes(aGtkIconTheme *, char *);
+extern (C) int gtk_icon_theme_has_icon(aGtkIconTheme *, char *);
+extern (C) void gtk_icon_theme_set_custom_theme(aGtkIconTheme *, char *);
+extern (C) void gtk_icon_theme_prepend_search_path(aGtkIconTheme *, char *);
+extern (C) void gtk_icon_theme_append_search_path(aGtkIconTheme *, char *);
+extern (C) void gtk_icon_theme_get_search_path(aGtkIconTheme *, char * * *, int *);
+extern (C) void gtk_icon_theme_set_search_path(aGtkIconTheme *, char * *, int);
+extern (C) void gtk_icon_theme_set_screen(aGtkIconTheme *, _GdkScreen *);
+extern (C) _GtkIconTheme * gtk_icon_theme_get_for_screen(_GdkScreen *);
+extern (C) _GtkIconTheme * gtk_icon_theme_get_default();
+extern (C) _GtkIconTheme * gtk_icon_theme_new();
+extern (C) uint gtk_icon_theme_get_type();
+extern (C) uint gtk_icon_theme_error_quark();
+extern (C) void _gtk_icon_factory_ensure_default_icons();
+extern (C) _GList * _gtk_icon_factory_list_ids();
+extern (C) void _gtk_icon_set_invalidate_caches();
+extern (C) int gtk_icon_source_get_size(void *);
+extern (C) int gtk_icon_source_get_state(void *);
+extern (C) int gtk_icon_source_get_direction(void *);
+extern (C) void gtk_icon_source_set_size(void *, int);
+extern (C) void gtk_icon_source_set_state(void *, int);
+extern (C) void gtk_icon_source_set_direction(void *, int);
+extern (C) int gtk_icon_source_get_direction_wildcarded(void *);
+extern (C) int gtk_icon_source_get_state_wildcarded(void *);
+extern (C) int gtk_icon_source_get_size_wildcarded(void *);
+extern (C) void gtk_icon_source_set_size_wildcarded(void *, int);
+extern (C) void gtk_icon_source_set_state_wildcarded(void *, int);
+extern (C) void gtk_icon_source_set_direction_wildcarded(void *, int);
+extern (C) void * gtk_icon_source_get_pixbuf(void *);
+extern (C) char * gtk_icon_source_get_icon_name(void *);
+extern (C) char * gtk_icon_source_get_filename(void *);
+extern (C) void gtk_icon_source_set_pixbuf(void *, void *);
+extern (C) void gtk_icon_source_set_icon_name(void *, char *);
+extern (C) void gtk_icon_source_set_filename(void *, char *);
+extern (C) void gtk_icon_source_free(void *);
+extern (C) void * gtk_icon_source_copy(void *);
+extern (C) void * gtk_icon_source_new();
+extern (C) uint gtk_icon_source_get_type();
+extern (C) void gtk_icon_set_get_sizes(void *, int * *, int *);
+extern (C) void gtk_icon_set_add_source(void *, void *);
+extern (C) void * gtk_icon_set_render_icon(void *, aGtkStyle *, int, int, int, aGtkWidget *, char *);
+extern (C) void * gtk_icon_set_copy(void *);
+extern (C) void gtk_icon_set_unref(void *);
+extern (C) void * gtk_icon_set_ref(void *);
+extern (C) void * gtk_icon_set_new_from_pixbuf(void *);
+extern (C) void * gtk_icon_set_new();
+extern (C) uint gtk_icon_set_get_type();
+extern (C) char * gtk_icon_size_get_name(int);
+extern (C) int gtk_icon_size_from_name(char *);
+extern (C) void gtk_icon_size_register_alias(char *, int);
+extern (C) int gtk_icon_size_register(char *, int, int);
+extern (C) int gtk_icon_size_lookup_for_settings(aGtkSettings *, int, int *, int *);
+extern (C) int gtk_icon_size_lookup(int, int *, int *);
+extern (C) void * gtk_icon_factory_lookup_default(char *);
+extern (C) void gtk_icon_factory_remove_default(aGtkIconFactory *);
+extern (C) void gtk_icon_factory_add_default(aGtkIconFactory *);
+extern (C) void * gtk_icon_factory_lookup(aGtkIconFactory *, char *);
+extern (C) void gtk_icon_factory_add(aGtkIconFactory *, char *, void *);
+extern (C) _GtkIconFactory * gtk_icon_factory_new();
+extern (C) uint gtk_icon_factory_get_type();
+extern (C) _GtkWidget * gtk_hseparator_new();
+extern (C) uint gtk_hseparator_get_type();
+extern (C) uint gtk_separator_get_type();
+extern (C) _GtkWidget * gtk_hscale_new_with_range(double, double, double);
+extern (C) _GtkWidget * gtk_hscale_new(aGtkAdjustment *);
+extern (C) uint gtk_hscale_get_type();
+extern (C) char * _gtk_scale_format_value(aGtkScale *, double);
+extern (C) void _gtk_scale_get_value_size(aGtkScale *, int *, int *);
+extern (C) void _gtk_scale_clear_layout(aGtkScale *);
+extern (C) void gtk_scale_get_layout_offsets(aGtkScale *, int *, int *);
+extern (C) void * gtk_scale_get_layout(aGtkScale *);
+extern (C) int gtk_scale_get_value_pos(aGtkScale *);
+extern (C) void gtk_scale_set_value_pos(aGtkScale *, int);
+extern (C) int gtk_scale_get_draw_value(aGtkScale *);
+extern (C) void gtk_scale_set_draw_value(aGtkScale *, int);
+extern (C) int gtk_scale_get_digits(aGtkScale *);
+extern (C) void gtk_scale_set_digits(aGtkScale *, int);
+extern (C) uint gtk_scale_get_type();
+extern (C) _GtkWidget * gtk_hruler_new();
+extern (C) uint gtk_hruler_get_type();
+extern (C) void gtk_ruler_get_range(aGtkRuler *, double *, double *, double *, double *);
+extern (C) int gtk_ruler_get_metric(aGtkRuler *);
+extern (C) void gtk_ruler_draw_pos(aGtkRuler *);
+extern (C) void gtk_ruler_draw_ticks(aGtkRuler *);
+extern (C) void gtk_ruler_set_range(aGtkRuler *, double, double, double, double);
+extern (C) void gtk_ruler_set_metric(aGtkRuler *, int);
+extern (C) uint gtk_ruler_get_type();
+extern (C) _GtkWidget * gtk_hpaned_new();
+extern (C) uint gtk_hpaned_get_type();
+extern (C) void gtk_paned_compute_position(aGtkPaned *, int, int, int);
+extern (C) _GtkWidget * gtk_paned_get_child2(aGtkPaned *);
+extern (C) _GtkWidget * gtk_paned_get_child1(aGtkPaned *);
+extern (C) void gtk_paned_set_position(aGtkPaned *, int);
+extern (C) int gtk_paned_get_position(aGtkPaned *);
+extern (C) void gtk_paned_pack2(aGtkPaned *, aGtkWidget *, int, int);
+extern (C) void gtk_paned_pack1(aGtkPaned *, aGtkWidget *, int, int);
+extern (C) void gtk_paned_add2(aGtkPaned *, aGtkWidget *);
+extern (C) void gtk_paned_add1(aGtkPaned *, aGtkWidget *);
+extern (C) uint gtk_paned_get_type();
+extern (C) void gtk_hbutton_box_set_layout_default(int);
+extern (C) void gtk_hbutton_box_set_spacing_default(int);
+extern (C) int gtk_hbutton_box_get_layout_default();
+extern (C) int gtk_hbutton_box_get_spacing_default();
+extern (C) _GtkWidget * gtk_hbutton_box_new();
+extern (C) uint gtk_hbutton_box_get_type();
+extern (C) int gtk_handle_box_get_snap_edge(aGtkHandleBox *);
+extern (C) void gtk_handle_box_set_snap_edge(aGtkHandleBox *, int);
+extern (C) int gtk_handle_box_get_handle_position(aGtkHandleBox *);
+extern (C) void gtk_handle_box_set_handle_position(aGtkHandleBox *, int);
+extern (C) int gtk_handle_box_get_shadow_type(aGtkHandleBox *);
+extern (C) void gtk_handle_box_set_shadow_type(aGtkHandleBox *, int);
+extern (C) _GtkWidget * gtk_handle_box_new();
+extern (C) uint gtk_handle_box_get_type();
+extern (C) void gtk_gc_release(_GdkGC *);
+extern (C) _GdkGC * gtk_gc_get(int, _GdkColormap *, _GdkGCValues *, int);
+extern (C) _GtkWidget * gtk_gamma_curve_new();
+extern (C) uint gtk_gamma_curve_get_type();
+extern (C) void gtk_font_selection_dialog_set_preview_text(aGtkFontSelectionDialog *, char *);
+extern (C) char * gtk_font_selection_dialog_get_preview_text(aGtkFontSelectionDialog *);
+extern (C) int gtk_font_selection_dialog_set_font_name(aGtkFontSelectionDialog *, char *);
+extern (C) _GdkFont * gtk_font_selection_dialog_get_font(aGtkFontSelectionDialog *);
+extern (C) char * gtk_font_selection_dialog_get_font_name(aGtkFontSelectionDialog *);
+extern (C) _GtkWidget * gtk_font_selection_dialog_new(char *);
+extern (C) uint gtk_font_selection_dialog_get_type();
+extern (C) void gtk_font_selection_set_preview_text(aGtkFontSelection *, char *);
+extern (C) char * gtk_font_selection_get_preview_text(aGtkFontSelection *);
+extern (C) int gtk_font_selection_set_font_name(aGtkFontSelection *, char *);
+extern (C) _GdkFont * gtk_font_selection_get_font(aGtkFontSelection *);
+extern (C) char * gtk_font_selection_get_font_name(aGtkFontSelection *);
+extern (C) _GtkWidget * gtk_font_selection_new();
+extern (C) uint gtk_font_selection_get_type();
+extern (C) void gtk_font_button_set_show_size(aGtkFontButton *, int);
+extern (C) int gtk_font_button_get_show_size(aGtkFontButton *);
+extern (C) void gtk_font_button_set_show_style(aGtkFontButton *, int);
+extern (C) int gtk_font_button_get_show_style(aGtkFontButton *);
+extern (C) int gtk_font_button_set_font_name(aGtkFontButton *, char *);
+extern (C) char * gtk_font_button_get_font_name(aGtkFontButton *);
+extern (C) void gtk_font_button_set_use_size(aGtkFontButton *, int);
+extern (C) int gtk_font_button_get_use_size(aGtkFontButton *);
+extern (C) void gtk_font_button_set_use_font(aGtkFontButton *, int);
+extern (C) int gtk_font_button_get_use_font(aGtkFontButton *);
+extern (C) void gtk_font_button_set_title(aGtkFontButton *, char *);
+extern (C) char * gtk_font_button_get_title(aGtkFontButton *);
+extern (C) _GtkWidget * gtk_font_button_new_with_font(char *);
+extern (C) _GtkWidget * gtk_font_button_new();
+extern (C) uint gtk_font_button_get_type();
+extern (C) _GtkWidget * gtk_file_chooser_widget_new_with_backend(int, char *);
+extern (C) _GtkWidget * gtk_file_chooser_widget_new(int);
+extern (C) uint gtk_file_chooser_widget_get_type();
+extern (C) _GtkWidget * gtk_file_chooser_dialog_new_with_backend(char *, aGtkWindow *, int, char *, char *, ...);
+extern (C) _GtkWidget * gtk_file_chooser_dialog_new(char *, aGtkWindow *, int, char *, ...);
+extern (C) uint gtk_file_chooser_dialog_get_type();
+extern (C) void gtk_file_chooser_button_set_focus_on_click(aGtkFileChooserButton *, int);
+extern (C) int gtk_file_chooser_button_get_focus_on_click(aGtkFileChooserButton *);
+extern (C) void gtk_file_chooser_button_set_width_chars(aGtkFileChooserButton *, int);
+extern (C) int gtk_file_chooser_button_get_width_chars(aGtkFileChooserButton *);
+extern (C) void gtk_file_chooser_button_set_title(aGtkFileChooserButton *, char *);
+extern (C) char * gtk_file_chooser_button_get_title(aGtkFileChooserButton *);
+extern (C) _GtkWidget * gtk_file_chooser_button_new_with_dialog(aGtkWidget *);
+extern (C) _GtkWidget * gtk_file_chooser_button_new_with_backend(char *, int, char *);
+extern (C) _GtkWidget * gtk_file_chooser_button_new(char *, int);
+extern (C) uint gtk_file_chooser_button_get_type();
+extern (C) _GSList * gtk_file_chooser_list_shortcut_folder_uris(void *);
+extern (C) int gtk_file_chooser_remove_shortcut_folder_uri(void *, char *, _GError * *);
+extern (C) int gtk_file_chooser_add_shortcut_folder_uri(void *, char *, _GError * *);
+extern (C) _GSList * gtk_file_chooser_list_shortcut_folders(void *);
+extern (C) int gtk_file_chooser_remove_shortcut_folder(void *, char *, _GError * *);
+extern (C) int gtk_file_chooser_add_shortcut_folder(void *, char *, _GError * *);
+extern (C) void * gtk_file_chooser_get_filter(void *);
+extern (C) void gtk_file_chooser_set_filter(void *, void *);
+extern (C) _GSList * gtk_file_chooser_list_filters(void *);
+extern (C) void gtk_file_chooser_remove_filter(void *, void *);
+extern (C) void gtk_file_chooser_add_filter(void *, void *);
+extern (C) _GtkWidget * gtk_file_chooser_get_extra_widget(void *);
+extern (C) void gtk_file_chooser_set_extra_widget(void *, aGtkWidget *);
+extern (C) char * gtk_file_chooser_get_preview_uri(void *);
+extern (C) char * gtk_file_chooser_get_preview_filename(void *);
+extern (C) int gtk_file_chooser_get_use_preview_label(void *);
+extern (C) void gtk_file_chooser_set_use_preview_label(void *, int);
+extern (C) int gtk_file_chooser_get_preview_widget_active(void *);
+extern (C) void gtk_file_chooser_set_preview_widget_active(void *, int);
+extern (C) _GtkWidget * gtk_file_chooser_get_preview_widget(void *);
+extern (C) void gtk_file_chooser_set_preview_widget(void *, aGtkWidget *);
+extern (C) char * gtk_file_chooser_get_current_folder_uri(void *);
+extern (C) int gtk_file_chooser_set_current_folder_uri(void *, char *);
+extern (C) _GSList * gtk_file_chooser_get_uris(void *);
+extern (C) void gtk_file_chooser_unselect_uri(void *, char *);
+extern (C) int gtk_file_chooser_select_uri(void *, char *);
+extern (C) int gtk_file_chooser_set_uri(void *, char *);
+extern (C) char * gtk_file_chooser_get_uri(void *);
+extern (C) char * gtk_file_chooser_get_current_folder(void *);
+extern (C) int gtk_file_chooser_set_current_folder(void *, char *);
+extern (C) _GSList * gtk_file_chooser_get_filenames(void *);
+extern (C) void gtk_file_chooser_unselect_all(void *);
+extern (C) void gtk_file_chooser_select_all(void *);
+extern (C) void gtk_file_chooser_unselect_filename(void *, char *);
+extern (C) int gtk_file_chooser_select_filename(void *, char *);
+extern (C) int gtk_file_chooser_set_filename(void *, char *);
+extern (C) char * gtk_file_chooser_get_filename(void *);
+extern (C) void gtk_file_chooser_set_current_name(void *, char *);
+extern (C) int gtk_file_chooser_get_do_overwrite_confirmation(void *);
+extern (C) void gtk_file_chooser_set_do_overwrite_confirmation(void *, int);
+extern (C) int gtk_file_chooser_get_show_hidden(void *);
+extern (C) void gtk_file_chooser_set_show_hidden(void *, int);
+extern (C) int gtk_file_chooser_get_select_multiple(void *);
+extern (C) void gtk_file_chooser_set_select_multiple(void *, int);
+extern (C) int gtk_file_chooser_get_local_only(void *);
+extern (C) void gtk_file_chooser_set_local_only(void *, int);
+extern (C) int gtk_file_chooser_get_action(void *);
+extern (C) void gtk_file_chooser_set_action(void *, int);
+extern (C) uint gtk_file_chooser_error_quark();
+extern (C) uint gtk_file_chooser_get_type();
+extern (C) int gtk_file_filter_filter(void *, aGtkFileFilterInfo *);
+extern (C) int gtk_file_filter_get_needed(void *);
+extern (C) void gtk_file_filter_add_custom(void *, int, _BCD_func__10568, void *, _BCD_func__13158);
+extern (C) void gtk_file_filter_add_pixbuf_formats(void *);
+extern (C) void gtk_file_filter_add_pattern(void *, char *);
+extern (C) void gtk_file_filter_add_mime_type(void *, char *);
+extern (C) char * gtk_file_filter_get_name(void *);
+extern (C) void gtk_file_filter_set_name(void *, char *);
+extern (C) void * gtk_file_filter_new();
+extern (C) uint gtk_file_filter_get_type();
+extern (C) int gtk_fixed_get_has_window(aGtkFixed *);
+extern (C) void gtk_fixed_set_has_window(aGtkFixed *, int);
+extern (C) void gtk_fixed_move(aGtkFixed *, aGtkWidget *, int, int);
+extern (C) void gtk_fixed_put(aGtkFixed *, aGtkWidget *, int, int);
+extern (C) _GtkWidget * gtk_fixed_new();
+extern (C) uint gtk_fixed_get_type();
+extern (C) int gtk_file_selection_get_select_multiple(aGtkFileSelection *);
+extern (C) void gtk_file_selection_set_select_multiple(aGtkFileSelection *, int);
+extern (C) char * * gtk_file_selection_get_selections(aGtkFileSelection *);
+extern (C) void gtk_file_selection_hide_fileop_buttons(aGtkFileSelection *);
+extern (C) void gtk_file_selection_show_fileop_buttons(aGtkFileSelection *);
+extern (C) void gtk_file_selection_complete(aGtkFileSelection *, char *);
+extern (C) char * gtk_file_selection_get_filename(aGtkFileSelection *);
+extern (C) void gtk_file_selection_set_filename(aGtkFileSelection *, char *);
+extern (C) _GtkWidget * gtk_file_selection_new(char *);
+extern (C) uint gtk_file_selection_get_type();
+extern (C) _GtkWidget * gtk_expander_get_label_widget(aGtkExpander *);
+extern (C) void gtk_expander_set_label_widget(aGtkExpander *, aGtkWidget *);
+extern (C) int gtk_expander_get_use_markup(aGtkExpander *);
+extern (C) void gtk_expander_set_use_markup(aGtkExpander *, int);
+extern (C) int gtk_expander_get_use_underline(aGtkExpander *);
+extern (C) void gtk_expander_set_use_underline(aGtkExpander *, int);
+extern (C) char * gtk_expander_get_label(aGtkExpander *);
+extern (C) void gtk_expander_set_label(aGtkExpander *, char *);
+extern (C) int gtk_expander_get_spacing(aGtkExpander *);
+extern (C) void gtk_expander_set_spacing(aGtkExpander *, int);
+extern (C) int gtk_expander_get_expanded(aGtkExpander *);
+extern (C) void gtk_expander_set_expanded(aGtkExpander *, int);
+extern (C) _GtkWidget * gtk_expander_new_with_mnemonic(char *);
+extern (C) _GtkWidget * gtk_expander_new(char *);
+extern (C) uint gtk_expander_get_type();
+extern (C) void gtk_event_box_set_above_child(aGtkEventBox *, int);
+extern (C) int gtk_event_box_get_above_child(aGtkEventBox *);
+extern (C) void gtk_event_box_set_visible_window(aGtkEventBox *, int);
+extern (C) int gtk_event_box_get_visible_window(aGtkEventBox *);
+extern (C) _GtkWidget * gtk_event_box_new();
+extern (C) uint gtk_event_box_get_type();
+extern (C) void gtk_curve_set_curve_type(aGtkCurve *, int);
+extern (C) void gtk_curve_set_vector(aGtkCurve *, int, float *);
+extern (C) void gtk_curve_get_vector(aGtkCurve *, int, float *);
+extern (C) void gtk_curve_set_range(aGtkCurve *, float, float, float, float);
+extern (C) void gtk_curve_set_gamma(aGtkCurve *, float);
+extern (C) void gtk_curve_reset(aGtkCurve *);
+extern (C) _GtkWidget * gtk_curve_new();
+extern (C) uint gtk_curve_get_type();
+extern (C) void gtk_drawing_area_size(aGtkDrawingArea *, int, int);
+extern (C) _GtkWidget * gtk_drawing_area_new();
+extern (C) uint gtk_drawing_area_get_type();
+extern (C) uint gtk_ctree_node_get_type();
+extern (C) void gtk_ctree_sort_recursive(aGtkCTree *, aGtkCTreeNode *);
+extern (C) void gtk_ctree_sort_node(aGtkCTree *, aGtkCTreeNode *);
+extern (C) void gtk_ctree_set_drag_compare_func(aGtkCTree *, _BCD_func__10682);
+extern (C) void gtk_ctree_set_expander_style(aGtkCTree *, int);
+extern (C) void gtk_ctree_set_line_style(aGtkCTree *, int);
+extern (C) void gtk_ctree_set_show_stub(aGtkCTree *, int);
+extern (C) void gtk_ctree_set_spacing(aGtkCTree *, int);
+extern (C) void gtk_ctree_set_indent(aGtkCTree *, int);
+extern (C) int gtk_ctree_node_is_visible(aGtkCTree *, aGtkCTreeNode *);
+extern (C) void gtk_ctree_node_moveto(aGtkCTree *, aGtkCTreeNode *, int, float, float);
+extern (C) void * gtk_ctree_node_get_row_data(aGtkCTree *, aGtkCTreeNode *);
+extern (C) void gtk_ctree_node_set_row_data_full(aGtkCTree *, aGtkCTreeNode *, void *, _BCD_func__13158);
+extern (C) void gtk_ctree_node_set_row_data(aGtkCTree *, aGtkCTreeNode *, void *);
+extern (C) void gtk_ctree_node_set_background(aGtkCTree *, aGtkCTreeNode *, _GdkColor *);
+extern (C) void gtk_ctree_node_set_foreground(aGtkCTree *, aGtkCTreeNode *, _GdkColor *);
+extern (C) _GtkStyle * gtk_ctree_node_get_cell_style(aGtkCTree *, aGtkCTreeNode *, int);
+extern (C) void gtk_ctree_node_set_cell_style(aGtkCTree *, aGtkCTreeNode *, int, aGtkStyle *);
+extern (C) _GtkStyle * gtk_ctree_node_get_row_style(aGtkCTree *, aGtkCTreeNode *);
+extern (C) void gtk_ctree_node_set_row_style(aGtkCTree *, aGtkCTreeNode *, aGtkStyle *);
+extern (C) int gtk_ctree_get_node_info(aGtkCTree *, aGtkCTreeNode *, char * *, char *, _GdkDrawable * *, _GdkDrawable * *, _GdkDrawable * *, _GdkDrawable * *, int *, int *);
+extern (C) int gtk_ctree_node_get_pixtext(aGtkCTree *, aGtkCTreeNode *, int, char * *, char *, _GdkDrawable * *, _GdkDrawable * *);
+extern (C) int gtk_ctree_node_get_pixmap(aGtkCTree *, aGtkCTreeNode *, int, _GdkDrawable * *, _GdkDrawable * *);
+extern (C) int gtk_ctree_node_get_text(aGtkCTree *, aGtkCTreeNode *, int, char * *);
+extern (C) int gtk_ctree_node_get_cell_type(aGtkCTree *, aGtkCTreeNode *, int);
+extern (C) int gtk_ctree_node_get_selectable(aGtkCTree *, aGtkCTreeNode *);
+extern (C) void gtk_ctree_node_set_selectable(aGtkCTree *, aGtkCTreeNode *, int);
+extern (C) void gtk_ctree_node_set_shift(aGtkCTree *, aGtkCTreeNode *, int, int, int);
+extern (C) void gtk_ctree_set_node_info(aGtkCTree *, aGtkCTreeNode *, char *, char, _GdkDrawable *, _GdkDrawable *, _GdkDrawable *, _GdkDrawable *, int, int);
+extern (C) void gtk_ctree_node_set_pixtext(aGtkCTree *, aGtkCTreeNode *, int, char *, char, _GdkDrawable *, _GdkDrawable *);
+extern (C) void gtk_ctree_node_set_pixmap(aGtkCTree *, aGtkCTreeNode *, int, _GdkDrawable *, _GdkDrawable *);
+extern (C) void gtk_ctree_node_set_text(aGtkCTree *, aGtkCTreeNode *, int, char *);
+extern (C) void gtk_ctree_real_select_recursive(aGtkCTree *, aGtkCTreeNode *, int);
+extern (C) void gtk_ctree_unselect_recursive(aGtkCTree *, aGtkCTreeNode *);
+extern (C) void gtk_ctree_unselect(aGtkCTree *, aGtkCTreeNode *);
+extern (C) void gtk_ctree_select_recursive(aGtkCTree *, aGtkCTreeNode *);
+extern (C) void gtk_ctree_select(aGtkCTree *, aGtkCTreeNode *);
+extern (C) void gtk_ctree_toggle_expansion_recursive(aGtkCTree *, aGtkCTreeNode *);
+extern (C) void gtk_ctree_toggle_expansion(aGtkCTree *, aGtkCTreeNode *);
+extern (C) void gtk_ctree_collapse_to_depth(aGtkCTree *, aGtkCTreeNode *, int);
+extern (C) void gtk_ctree_collapse_recursive(aGtkCTree *, aGtkCTreeNode *);
+extern (C) void gtk_ctree_collapse(aGtkCTree *, aGtkCTreeNode *);
+extern (C) void gtk_ctree_expand_to_depth(aGtkCTree *, aGtkCTreeNode *, int);
+extern (C) void gtk_ctree_expand_recursive(aGtkCTree *, aGtkCTreeNode *);
+extern (C) void gtk_ctree_expand(aGtkCTree *, aGtkCTreeNode *);
+extern (C) void gtk_ctree_move(aGtkCTree *, aGtkCTreeNode *, aGtkCTreeNode *, aGtkCTreeNode *);
+extern (C) int gtk_ctree_is_hot_spot(aGtkCTree *, int, int);
+extern (C) _GList * gtk_ctree_find_all_by_row_data_custom(aGtkCTree *, aGtkCTreeNode *, void *, _BCD_func__14970);
+extern (C) _GtkCTreeNode * gtk_ctree_find_by_row_data_custom(aGtkCTree *, aGtkCTreeNode *, void *, _BCD_func__14970);
+extern (C) _GList * gtk_ctree_find_all_by_row_data(aGtkCTree *, aGtkCTreeNode *, void *);
+extern (C) _GtkCTreeNode * gtk_ctree_find_by_row_data(aGtkCTree *, aGtkCTreeNode *, void *);
+extern (C) int gtk_ctree_is_ancestor(aGtkCTree *, aGtkCTreeNode *, aGtkCTreeNode *);
+extern (C) int gtk_ctree_find(aGtkCTree *, aGtkCTreeNode *, aGtkCTreeNode *);
+extern (C) _GtkCTreeNode * gtk_ctree_node_nth(aGtkCTree *, uint);
+extern (C) _GtkCTreeNode * gtk_ctree_find_node_ptr(aGtkCTree *, aGtkCTreeRow *);
+extern (C) _GtkCTreeNode * gtk_ctree_last(aGtkCTree *, aGtkCTreeNode *);
+extern (C) int gtk_ctree_is_viewable(aGtkCTree *, aGtkCTreeNode *);
+extern (C) void gtk_ctree_pre_recursive_to_depth(aGtkCTree *, aGtkCTreeNode *, int, _BCD_func__10684, void *);
+extern (C) void gtk_ctree_pre_recursive(aGtkCTree *, aGtkCTreeNode *, _BCD_func__10684, void *);
+extern (C) void gtk_ctree_post_recursive_to_depth(aGtkCTree *, aGtkCTreeNode *, int, _BCD_func__10684, void *);
+extern (C) void gtk_ctree_post_recursive(aGtkCTree *, aGtkCTreeNode *, _BCD_func__10684, void *);
+extern (C) _GNode * gtk_ctree_export_to_gnode(aGtkCTree *, _GNode *, _GNode *, aGtkCTreeNode *, _BCD_func__10683, void *);
+extern (C) _GtkCTreeNode * gtk_ctree_insert_gnode(aGtkCTree *, aGtkCTreeNode *, aGtkCTreeNode *, _GNode *, _BCD_func__10683, void *);
+extern (C) void gtk_ctree_remove_node(aGtkCTree *, aGtkCTreeNode *);
+extern (C) _GtkCTreeNode * gtk_ctree_insert_node(aGtkCTree *, aGtkCTreeNode *, aGtkCTreeNode *, char * *, char, _GdkDrawable *, _GdkDrawable *, _GdkDrawable *, _GdkDrawable *, int, int);
+extern (C) _GtkWidget * gtk_ctree_new(int, int);
+extern (C) _GtkWidget * gtk_ctree_new_with_titles(int, int, char * *);
+extern (C) uint gtk_ctree_get_type();
+extern (C) _GtkWidget * gtk_combo_box_entry_new_text();
+extern (C) int gtk_combo_box_entry_get_text_column(aGtkComboBoxEntry *);
+extern (C) void gtk_combo_box_entry_set_text_column(aGtkComboBoxEntry *, int);
+extern (C) _GtkWidget * gtk_combo_box_entry_new_with_model(void *, int);
+extern (C) _GtkWidget * gtk_combo_box_entry_new();
+extern (C) uint gtk_combo_box_entry_get_type();
+extern (C) int _gtk_combo_box_editing_canceled(aGtkComboBox *);
+extern (C) _AtkObject * gtk_combo_box_get_popup_accessible(aGtkComboBox *);
+extern (C) void gtk_combo_box_popdown(aGtkComboBox *);
+extern (C) void gtk_combo_box_popup(aGtkComboBox *);
+extern (C) char * gtk_combo_box_get_active_text(aGtkComboBox *);
+extern (C) void gtk_combo_box_remove_text(aGtkComboBox *, int);
+extern (C) void gtk_combo_box_prepend_text(aGtkComboBox *, char *);
+extern (C) void gtk_combo_box_insert_text(aGtkComboBox *, int, char *);
+extern (C) void gtk_combo_box_append_text(aGtkComboBox *, char *);
+extern (C) _GtkWidget * gtk_combo_box_new_text();
+extern (C) void gtk_combo_box_set_row_separator_func(aGtkComboBox *, _BCD_func__10753, void *, _BCD_func__13158);
+extern (C) _BCD_func__10753 gtk_combo_box_get_row_separator_func(aGtkComboBox *);
+extern (C) void * gtk_combo_box_get_model(aGtkComboBox *);
+extern (C) void gtk_combo_box_set_model(aGtkComboBox *, void *);
+extern (C) void gtk_combo_box_set_active_iter(aGtkComboBox *, aGtkTreeIter *);
+extern (C) int gtk_combo_box_get_active_iter(aGtkComboBox *, aGtkTreeIter *);
+extern (C) void gtk_combo_box_set_active(aGtkComboBox *, int);
+extern (C) int gtk_combo_box_get_active(aGtkComboBox *);
+extern (C) void gtk_combo_box_set_focus_on_click(aGtkComboBox *, int);
+extern (C) int gtk_combo_box_get_focus_on_click(aGtkComboBox *);
+extern (C) void gtk_combo_box_set_title(aGtkComboBox *, char *);
+extern (C) char * gtk_combo_box_get_title(aGtkComboBox *);
+extern (C) void gtk_combo_box_set_add_tearoffs(aGtkComboBox *, int);
+extern (C) int gtk_combo_box_get_add_tearoffs(aGtkComboBox *);
+extern (C) void gtk_combo_box_set_column_span_column(aGtkComboBox *, int);
+extern (C) int gtk_combo_box_get_column_span_column(aGtkComboBox *);
+extern (C) void gtk_combo_box_set_row_span_column(aGtkComboBox *, int);
+extern (C) int gtk_combo_box_get_row_span_column(aGtkComboBox *);
+extern (C) void gtk_combo_box_set_wrap_width(aGtkComboBox *, int);
+extern (C) int gtk_combo_box_get_wrap_width(aGtkComboBox *);
+extern (C) _GtkWidget * gtk_combo_box_new_with_model(void *);
+extern (C) _GtkWidget * gtk_combo_box_new();
+extern (C) uint gtk_combo_box_get_type();
+extern (C) int gtk_tree_view_get_tooltip_column(aGtkTreeView *);
+extern (C) void gtk_tree_view_set_tooltip_column(aGtkTreeView *, int);
+extern (C) int gtk_tree_view_get_tooltip_context(aGtkTreeView *, int *, int *, int, void * *, void * *, aGtkTreeIter *);
+extern (C) void gtk_tree_view_set_tooltip_cell(aGtkTreeView *, void *, void *, aGtkTreeViewColumn *, aGtkCellRenderer *);
+extern (C) void gtk_tree_view_set_tooltip_row(aGtkTreeView *, void *, void *);
+extern (C) int gtk_tree_view_get_level_indentation(aGtkTreeView *);
+extern (C) void gtk_tree_view_set_level_indentation(aGtkTreeView *, int);
+extern (C) int gtk_tree_view_get_show_expanders(aGtkTreeView *);
+extern (C) void gtk_tree_view_set_show_expanders(aGtkTreeView *, int);
+extern (C) void gtk_tree_view_set_enable_tree_lines(aGtkTreeView *, int);
+extern (C) int gtk_tree_view_get_enable_tree_lines(aGtkTreeView *);
+extern (C) void gtk_tree_view_set_grid_lines(aGtkTreeView *, int);
+extern (C) int gtk_tree_view_get_grid_lines(aGtkTreeView *);
+extern (C) void gtk_tree_view_set_row_separator_func(aGtkTreeView *, _BCD_func__10753, void *, _BCD_func__13158);
+extern (C) _BCD_func__10753 gtk_tree_view_get_row_separator_func(aGtkTreeView *);
+extern (C) int gtk_tree_view_is_rubber_banding_active(aGtkTreeView *);
+extern (C) int gtk_tree_view_get_rubber_banding(aGtkTreeView *);
+extern (C) void gtk_tree_view_set_rubber_banding(aGtkTreeView *, int);
+extern (C) int gtk_tree_view_get_hover_expand(aGtkTreeView *);
+extern (C) void gtk_tree_view_set_hover_expand(aGtkTreeView *, int);
+extern (C) int gtk_tree_view_get_hover_selection(aGtkTreeView *);
+extern (C) void gtk_tree_view_set_hover_selection(aGtkTreeView *, int);
+extern (C) int gtk_tree_view_get_fixed_height_mode(aGtkTreeView *);
+extern (C) void gtk_tree_view_set_fixed_height_mode(aGtkTreeView *, int);
+extern (C) void gtk_tree_view_set_destroy_count_func(aGtkTreeView *, _BCD_func__10748, void *, _BCD_func__13158);
+extern (C) void gtk_tree_view_convert_bin_window_to_tree_coords(aGtkTreeView *, int, int, int *, int *);
+extern (C) void gtk_tree_view_convert_tree_to_bin_window_coords(aGtkTreeView *, int, int, int *, int *);
+extern (C) void gtk_tree_view_convert_bin_window_to_widget_coords(aGtkTreeView *, int, int, int *, int *);
+extern (C) void gtk_tree_view_convert_widget_to_bin_window_coords(aGtkTreeView *, int, int, int *, int *);
+extern (C) void gtk_tree_view_convert_tree_to_widget_coords(aGtkTreeView *, int, int, int *, int *);
+extern (C) void gtk_tree_view_convert_widget_to_tree_coords(aGtkTreeView *, int, int, int *, int *);
+extern (C) void gtk_tree_view_set_search_position_func(aGtkTreeView *, _BCD_func__10752, void *, _BCD_func__13158);
+extern (C) _BCD_func__10752 gtk_tree_view_get_search_position_func(aGtkTreeView *);
+extern (C) void gtk_tree_view_set_search_entry(aGtkTreeView *, aGtkEntry *);
+extern (C) _GtkEntry * gtk_tree_view_get_search_entry(aGtkTreeView *);
+extern (C) void gtk_tree_view_set_search_equal_func(aGtkTreeView *, _BCD_func__10754, void *, _BCD_func__13158);
+extern (C) _BCD_func__10754 gtk_tree_view_get_search_equal_func(aGtkTreeView *);
+extern (C) void gtk_tree_view_set_search_column(aGtkTreeView *, int);
+extern (C) int gtk_tree_view_get_search_column(aGtkTreeView *);
+extern (C) int gtk_tree_view_get_enable_search(aGtkTreeView *);
+extern (C) void gtk_tree_view_set_enable_search(aGtkTreeView *, int);
+extern (C) _GdkDrawable * gtk_tree_view_create_row_drag_icon(aGtkTreeView *, void *);
+extern (C) int gtk_tree_view_get_dest_row_at_pos(aGtkTreeView *, int, int, void * *, int *);
+extern (C) void gtk_tree_view_get_drag_dest_row(aGtkTreeView *, void * *, int *);
+extern (C) void gtk_tree_view_set_drag_dest_row(aGtkTreeView *, void *, int);
+extern (C) void gtk_tree_view_unset_rows_drag_dest(aGtkTreeView *);
+extern (C) void gtk_tree_view_unset_rows_drag_source(aGtkTreeView *);
+extern (C) void gtk_tree_view_enable_model_drag_dest(aGtkTreeView *, aGtkTargetEntry *, int, int);
+extern (C) void gtk_tree_view_enable_model_drag_source(aGtkTreeView *, int, aGtkTargetEntry *, int, int);
+extern (C) int gtk_tree_view_get_visible_range(aGtkTreeView *, void * *, void * *);
+extern (C) void gtk_tree_view_tree_to_widget_coords(aGtkTreeView *, int, int, int *, int *);
+extern (C) void gtk_tree_view_widget_to_tree_coords(aGtkTreeView *, int, int, int *, int *);
+extern (C) void gtk_tree_view_get_visible_rect(aGtkTreeView *, _GdkRectangle *);
+extern (C) void gtk_tree_view_get_background_area(aGtkTreeView *, void *, aGtkTreeViewColumn *, _GdkRectangle *);
+extern (C) void gtk_tree_view_get_cell_area(aGtkTreeView *, void *, aGtkTreeViewColumn *, _GdkRectangle *);
+extern (C) int gtk_tree_view_get_path_at_pos(aGtkTreeView *, int, int, void * *, _GtkTreeViewColumn * *, int *, int *);
+extern (C) _GdkDrawable * gtk_tree_view_get_bin_window(aGtkTreeView *);
+extern (C) void gtk_tree_view_get_cursor(aGtkTreeView *, void * *, _GtkTreeViewColumn * *);
+extern (C) void gtk_tree_view_set_cursor_on_cell(aGtkTreeView *, void *, aGtkTreeViewColumn *, aGtkCellRenderer *, int);
+extern (C) void gtk_tree_view_set_cursor(aGtkTreeView *, void *, aGtkTreeViewColumn *, int);
+extern (C) int gtk_tree_view_get_reorderable(aGtkTreeView *);
+extern (C) void gtk_tree_view_set_reorderable(aGtkTreeView *, int);
+extern (C) int gtk_tree_view_row_expanded(aGtkTreeView *, void *);
+extern (C) void gtk_tree_view_map_expanded_rows(aGtkTreeView *, _BCD_func__10755, void *);
+extern (C) int gtk_tree_view_collapse_row(aGtkTreeView *, void *);
+extern (C) int gtk_tree_view_expand_row(aGtkTreeView *, void *, int);
+extern (C) void gtk_tree_view_expand_to_path(aGtkTreeView *, void *);
+extern (C) void gtk_tree_view_collapse_all(aGtkTreeView *);
+extern (C) void gtk_tree_view_expand_all(aGtkTreeView *);
+extern (C) void gtk_tree_view_row_activated(aGtkTreeView *, void *, aGtkTreeViewColumn *);
+extern (C) void gtk_tree_view_scroll_to_cell(aGtkTreeView *, void *, aGtkTreeViewColumn *, int, float, float);
+extern (C) void gtk_tree_view_scroll_to_point(aGtkTreeView *, int, int);
+extern (C) void gtk_tree_view_set_column_drag_function(aGtkTreeView *, _BCD_func__10756, void *, _BCD_func__13158);
+extern (C) _GtkTreeViewColumn * gtk_tree_view_get_expander_column(aGtkTreeView *);
+extern (C) void gtk_tree_view_set_expander_column(aGtkTreeView *, aGtkTreeViewColumn *);
+extern (C) void gtk_tree_view_move_column_after(aGtkTreeView *, aGtkTreeViewColumn *, aGtkTreeViewColumn *);
+extern (C) _GList * gtk_tree_view_get_columns(aGtkTreeView *);
+extern (C) _GtkTreeViewColumn * gtk_tree_view_get_column(aGtkTreeView *, int);
+extern (C) int gtk_tree_view_insert_column_with_data_func(aGtkTreeView *, int, char *, aGtkCellRenderer *, _BCD_func__11636, void *, _BCD_func__13158);
+extern (C) int gtk_tree_view_insert_column_with_attributes(aGtkTreeView *, int, char *, aGtkCellRenderer *, ...);
+extern (C) int gtk_tree_view_insert_column(aGtkTreeView *, aGtkTreeViewColumn *, int);
+extern (C) int gtk_tree_view_remove_column(aGtkTreeView *, aGtkTreeViewColumn *);
+extern (C) int gtk_tree_view_append_column(aGtkTreeView *, aGtkTreeViewColumn *);
+extern (C) int gtk_tree_view_get_rules_hint(aGtkTreeView *);
+extern (C) void gtk_tree_view_set_rules_hint(aGtkTreeView *, int);
+extern (C) void gtk_tree_view_set_headers_clickable(aGtkTreeView *, int);
+extern (C) int gtk_tree_view_get_headers_clickable(aGtkTreeView *);
+extern (C) void gtk_tree_view_columns_autosize(aGtkTreeView *);
+extern (C) void gtk_tree_view_set_headers_visible(aGtkTreeView *, int);
+extern (C) int gtk_tree_view_get_headers_visible(aGtkTreeView *);
+extern (C) void gtk_tree_view_set_vadjustment(aGtkTreeView *, aGtkAdjustment *);
+extern (C) _GtkAdjustment * gtk_tree_view_get_vadjustment(aGtkTreeView *);
+extern (C) void gtk_tree_view_set_hadjustment(aGtkTreeView *, aGtkAdjustment *);
+extern (C) _GtkAdjustment * gtk_tree_view_get_hadjustment(aGtkTreeView *);
+extern (C) _GtkTreeSelection * gtk_tree_view_get_selection(aGtkTreeView *);
+extern (C) void gtk_tree_view_set_model(aGtkTreeView *, void *);
+extern (C) void * gtk_tree_view_get_model(aGtkTreeView *);
+extern (C) _GtkWidget * gtk_tree_view_new_with_model(void *);
+extern (C) _GtkWidget * gtk_tree_view_new();
+extern (C) uint gtk_tree_view_get_type();
+extern (C) void gtk_entry_set_editable(aGtkEntry *, int);
+extern (C) void gtk_entry_select_region(aGtkEntry *, int, int);
+extern (C) void gtk_entry_set_position(aGtkEntry *, int);
+extern (C) void gtk_entry_prepend_text(aGtkEntry *, char *);
+extern (C) void gtk_entry_append_text(aGtkEntry *, char *);
+extern (C) _GtkWidget * gtk_entry_new_with_max_length(int);
+extern (C) _GtkAdjustment * gtk_entry_get_cursor_hadjustment(aGtkEntry *);
+extern (C) void gtk_entry_set_cursor_hadjustment(aGtkEntry *, aGtkAdjustment *);
+extern (C) int gtk_entry_text_index_to_layout_index(aGtkEntry *, int);
+extern (C) int gtk_entry_layout_index_to_text_index(aGtkEntry *, int);
+extern (C) _GtkEntryCompletion * gtk_entry_get_completion(aGtkEntry *);
+extern (C) void gtk_entry_set_completion(aGtkEntry *, aGtkEntryCompletion *);
+extern (C) float gtk_entry_get_alignment(aGtkEntry *);
+extern (C) void gtk_entry_set_alignment(aGtkEntry *, float);
+extern (C) void gtk_entry_get_layout_offsets(aGtkEntry *, int *, int *);
+extern (C) void * gtk_entry_get_layout(aGtkEntry *);
+extern (C) char * gtk_entry_get_text(aGtkEntry *);
+extern (C) void gtk_entry_set_text(aGtkEntry *, char *);
+extern (C) int gtk_entry_get_width_chars(aGtkEntry *);
+extern (C) void gtk_entry_set_width_chars(aGtkEntry *, int);
+extern (C) int gtk_entry_get_activates_default(aGtkEntry *);
+extern (C) void gtk_entry_set_activates_default(aGtkEntry *, int);
+extern (C) int gtk_entry_get_max_length(aGtkEntry *);
+extern (C) void gtk_entry_set_max_length(aGtkEntry *, int);
+extern (C) _GtkBorder * gtk_entry_get_inner_border(aGtkEntry *);
+extern (C) void gtk_entry_set_inner_border(aGtkEntry *, aGtkBorder *);
+extern (C) int gtk_entry_get_has_frame(aGtkEntry *);
+extern (C) void gtk_entry_set_has_frame(aGtkEntry *, int);
+extern (C) uint gtk_entry_get_invisible_char(aGtkEntry *);
+extern (C) void gtk_entry_set_invisible_char(aGtkEntry *, uint);
+extern (C) int gtk_entry_get_visibility(aGtkEntry *);
+extern (C) void gtk_entry_set_visibility(aGtkEntry *, int);
+extern (C) _GtkWidget * gtk_entry_new();
+extern (C) uint gtk_entry_get_type();
+extern (C) int gtk_entry_completion_get_text_column(aGtkEntryCompletion *);
+extern (C) void gtk_entry_completion_set_text_column(aGtkEntryCompletion *, int);
+extern (C) char * gtk_entry_completion_get_completion_prefix(aGtkEntryCompletion *);
+extern (C) int gtk_entry_completion_get_popup_single_match(aGtkEntryCompletion *);
+extern (C) void gtk_entry_completion_set_popup_single_match(aGtkEntryCompletion *, int);
+extern (C) int gtk_entry_completion_get_popup_set_width(aGtkEntryCompletion *);
+extern (C) void gtk_entry_completion_set_popup_set_width(aGtkEntryCompletion *, int);
+extern (C) int gtk_entry_completion_get_popup_completion(aGtkEntryCompletion *);
+extern (C) void gtk_entry_completion_set_popup_completion(aGtkEntryCompletion *, int);
+extern (C) int gtk_entry_completion_get_inline_selection(aGtkEntryCompletion *);
+extern (C) void gtk_entry_completion_set_inline_selection(aGtkEntryCompletion *, int);
+extern (C) int gtk_entry_completion_get_inline_completion(aGtkEntryCompletion *);
+extern (C) void gtk_entry_completion_set_inline_completion(aGtkEntryCompletion *, int);
+extern (C) void gtk_entry_completion_delete_action(aGtkEntryCompletion *, int);
+extern (C) void gtk_entry_completion_insert_action_markup(aGtkEntryCompletion *, int, char *);
+extern (C) void gtk_entry_completion_insert_action_text(aGtkEntryCompletion *, int, char *);
+extern (C) void gtk_entry_completion_insert_prefix(aGtkEntryCompletion *);
+extern (C) void gtk_entry_completion_complete(aGtkEntryCompletion *);
+extern (C) int gtk_entry_completion_get_minimum_key_length(aGtkEntryCompletion *);
+extern (C) void gtk_entry_completion_set_minimum_key_length(aGtkEntryCompletion *, int);
+extern (C) void gtk_entry_completion_set_match_func(aGtkEntryCompletion *, _BCD_func__10863, void *, _BCD_func__13158);
+extern (C) void * gtk_entry_completion_get_model(aGtkEntryCompletion *);
+extern (C) void gtk_entry_completion_set_model(aGtkEntryCompletion *, void *);
+extern (C) _GtkWidget * gtk_entry_completion_get_entry(aGtkEntryCompletion *);
+extern (C) _GtkEntryCompletion * gtk_entry_completion_new();
+extern (C) uint gtk_entry_completion_get_type();
+extern (C) void gtk_tree_model_filter_clear_cache(aGtkTreeModelFilter *);
+extern (C) void gtk_tree_model_filter_refilter(aGtkTreeModelFilter *);
+extern (C) void * gtk_tree_model_filter_convert_path_to_child_path(aGtkTreeModelFilter *, void *);
+extern (C) void * gtk_tree_model_filter_convert_child_path_to_path(aGtkTreeModelFilter *, void *);
+extern (C) void gtk_tree_model_filter_convert_iter_to_child_iter(aGtkTreeModelFilter *, aGtkTreeIter *, aGtkTreeIter *);
+extern (C) int gtk_tree_model_filter_convert_child_iter_to_iter(aGtkTreeModelFilter *, aGtkTreeIter *, aGtkTreeIter *);
+extern (C) void * gtk_tree_model_filter_get_model(aGtkTreeModelFilter *);
+extern (C) void gtk_tree_model_filter_set_visible_column(aGtkTreeModelFilter *, int);
+extern (C) void gtk_tree_model_filter_set_modify_func(aGtkTreeModelFilter *, int, uint *, _BCD_func__10889, void *, _BCD_func__13158);
+extern (C) void gtk_tree_model_filter_set_visible_func(aGtkTreeModelFilter *, _BCD_func__10753, void *, _BCD_func__13158);
+extern (C) void * gtk_tree_model_filter_new(void *, void *);
+extern (C) uint gtk_tree_model_filter_get_type();
+extern (C) void gtk_list_store_move_before(aGtkListStore *, aGtkTreeIter *, aGtkTreeIter *);
+extern (C) void gtk_list_store_move_after(aGtkListStore *, aGtkTreeIter *, aGtkTreeIter *);
+extern (C) void gtk_list_store_swap(aGtkListStore *, aGtkTreeIter *, aGtkTreeIter *);
+extern (C) void gtk_list_store_reorder(aGtkListStore *, int *);
+extern (C) int gtk_list_store_iter_is_valid(aGtkListStore *, aGtkTreeIter *);
+extern (C) void gtk_list_store_clear(aGtkListStore *);
+extern (C) void gtk_list_store_append(aGtkListStore *, aGtkTreeIter *);
+extern (C) void gtk_list_store_prepend(aGtkListStore *, aGtkTreeIter *);
+extern (C) void gtk_list_store_insert_with_valuesv(aGtkListStore *, aGtkTreeIter *, int, int *, _GValue *, int);
+extern (C) void gtk_list_store_insert_with_values(aGtkListStore *, aGtkTreeIter *, int, ...);
+extern (C) void gtk_list_store_insert_after(aGtkListStore *, aGtkTreeIter *, aGtkTreeIter *);
+extern (C) void gtk_list_store_insert_before(aGtkListStore *, aGtkTreeIter *, aGtkTreeIter *);
+extern (C) void gtk_list_store_insert(aGtkListStore *, aGtkTreeIter *, int);
+extern (C) int gtk_list_store_remove(aGtkListStore *, aGtkTreeIter *);
+extern (C) void gtk_list_store_set_valist(aGtkListStore *, aGtkTreeIter *, char *);
+extern (C) void gtk_list_store_set_valuesv(aGtkListStore *, aGtkTreeIter *, int *, _GValue *, int);
+extern (C) void gtk_list_store_set(aGtkListStore *, aGtkTreeIter *, ...);
+extern (C) void gtk_list_store_set_value(aGtkListStore *, aGtkTreeIter *, int, _GValue *);
+extern (C) void gtk_list_store_set_column_types(aGtkListStore *, int, uint *);
+extern (C) _GtkListStore * gtk_list_store_newv(int, uint *);
+extern (C) _GtkListStore * gtk_list_store_new(int, ...);
+extern (C) uint gtk_list_store_get_type();
+extern (C) int gtk_im_context_delete_surrounding(aGtkIMContext *, int, int);
+extern (C) int gtk_im_context_get_surrounding(aGtkIMContext *, char * *, int *);
+extern (C) void gtk_im_context_set_surrounding(aGtkIMContext *, char *, int, int);
+extern (C) void gtk_im_context_set_use_preedit(aGtkIMContext *, int);
+extern (C) void gtk_im_context_set_cursor_location(aGtkIMContext *, _GdkRectangle *);
+extern (C) void gtk_im_context_reset(aGtkIMContext *);
+extern (C) void gtk_im_context_focus_out(aGtkIMContext *);
+extern (C) void gtk_im_context_focus_in(aGtkIMContext *);
+extern (C) int gtk_im_context_filter_keypress(aGtkIMContext *, _GdkEventKey *);
+extern (C) void gtk_im_context_get_preedit_string(aGtkIMContext *, char * *, void * *, int *);
+extern (C) void gtk_im_context_set_client_window(aGtkIMContext *, _GdkDrawable *);
+extern (C) uint gtk_im_context_get_type();
+extern (C) int gtk_editable_get_editable(void *);
+extern (C) void gtk_editable_set_editable(void *, int);
+extern (C) int gtk_editable_get_position(void *);
+extern (C) void gtk_editable_set_position(void *, int);
+extern (C) void gtk_editable_delete_selection(void *);
+extern (C) void gtk_editable_paste_clipboard(void *);
+extern (C) void gtk_editable_copy_clipboard(void *);
+extern (C) void gtk_editable_cut_clipboard(void *);
+extern (C) char * gtk_editable_get_chars(void *, int, int);
+extern (C) void gtk_editable_delete_text(void *, int, int);
+extern (C) void gtk_editable_insert_text(void *, char *, int, int *);
+extern (C) int gtk_editable_get_selection_bounds(void *, int *, int *);
+extern (C) void gtk_editable_select_region(void *, int, int);
+extern (C) uint gtk_editable_get_type();
+extern (C) void gtk_drag_set_default_icon(_GdkColormap *, _GdkDrawable *, _GdkDrawable *, int, int);
+extern (C) void _gtk_drag_dest_handle_event(aGtkWidget *, _GdkEvent *);
+extern (C) void _gtk_drag_source_handle_event(aGtkWidget *, _GdkEvent *);
+extern (C) int gtk_drag_check_threshold(aGtkWidget *, int, int, int, int);
+extern (C) void gtk_drag_set_icon_default(_GdkDragContext *);
+extern (C) void gtk_drag_set_icon_name(_GdkDragContext *, char *, int, int);
+extern (C) void gtk_drag_set_icon_stock(_GdkDragContext *, char *, int, int);
+extern (C) void gtk_drag_set_icon_pixbuf(_GdkDragContext *, void *, int, int);
+extern (C) void gtk_drag_set_icon_pixmap(_GdkDragContext *, _GdkColormap *, _GdkDrawable *, _GdkDrawable *, int, int);
+extern (C) void gtk_drag_set_icon_widget(_GdkDragContext *, aGtkWidget *, int, int);
+extern (C) _GdkDragContext * gtk_drag_begin(aGtkWidget *, aGtkTargetList *, int, int, _GdkEvent *);
+extern (C) void gtk_drag_source_set_icon_name(aGtkWidget *, char *);
+extern (C) void gtk_drag_source_set_icon_stock(aGtkWidget *, char *);
+extern (C) void gtk_drag_source_set_icon_pixbuf(aGtkWidget *, void *);
+extern (C) void gtk_drag_source_set_icon(aGtkWidget *, _GdkColormap *, _GdkDrawable *, _GdkDrawable *);
+extern (C) void gtk_drag_source_add_uri_targets(aGtkWidget *);
+extern (C) void gtk_drag_source_add_image_targets(aGtkWidget *);
+extern (C) void gtk_drag_source_add_text_targets(aGtkWidget *);
+extern (C) void gtk_drag_source_set_target_list(aGtkWidget *, aGtkTargetList *);
+extern (C) _GtkTargetList * gtk_drag_source_get_target_list(aGtkWidget *);
+extern (C) void gtk_drag_source_unset(aGtkWidget *);
+extern (C) void gtk_drag_source_set(aGtkWidget *, int, aGtkTargetEntry *, int, int);
+extern (C) int gtk_drag_dest_get_track_motion(aGtkWidget *);
+extern (C) void gtk_drag_dest_set_track_motion(aGtkWidget *, int);
+extern (C) void gtk_drag_dest_add_uri_targets(aGtkWidget *);
+extern (C) void gtk_drag_dest_add_image_targets(aGtkWidget *);
+extern (C) void gtk_drag_dest_add_text_targets(aGtkWidget *);
+extern (C) void gtk_drag_dest_set_target_list(aGtkWidget *, aGtkTargetList *);
+extern (C) _GtkTargetList * gtk_drag_dest_get_target_list(aGtkWidget *);
+extern (C) void * gtk_drag_dest_find_target(aGtkWidget *, _GdkDragContext *, aGtkTargetList *);
+extern (C) void gtk_drag_dest_unset(aGtkWidget *);
+extern (C) void gtk_drag_dest_set_proxy(aGtkWidget *, _GdkDrawable *, int, int);
+extern (C) void gtk_drag_dest_set(aGtkWidget *, int, aGtkTargetEntry *, int, int);
+extern (C) void gtk_drag_unhighlight(aGtkWidget *);
+extern (C) void gtk_drag_highlight(aGtkWidget *);
+extern (C) _GtkWidget * gtk_drag_get_source_widget(_GdkDragContext *);
+extern (C) void gtk_drag_finish(_GdkDragContext *, int, int, uint);
+extern (C) void gtk_drag_get_data(aGtkWidget *, _GdkDragContext *, void *, uint);
+extern (C) void gtk_combo_disable_activate(aGtkCombo *);
+extern (C) void gtk_combo_set_popdown_strings(aGtkCombo *, _GList *);
+extern (C) void gtk_combo_set_item_string(aGtkCombo *, aGtkItem *, char *);
+extern (C) void gtk_combo_set_case_sensitive(aGtkCombo *, int);
+extern (C) void gtk_combo_set_use_arrows_always(aGtkCombo *, int);
+extern (C) void gtk_combo_set_use_arrows(aGtkCombo *, int);
+extern (C) void gtk_combo_set_value_in_list(aGtkCombo *, int, int);
+extern (C) _GtkWidget * gtk_combo_new();
+extern (C) uint gtk_combo_get_type();
+extern (C) _GtkWidget * gtk_hbox_new(int, int);
+extern (C) uint gtk_hbox_get_type();
+extern (C) _GtkWidget * gtk_color_selection_dialog_new(char *);
+extern (C) uint gtk_color_selection_dialog_get_type();
+extern (C) void gtk_color_selection_set_update_policy(aGtkColorSelection *, int);
+extern (C) void gtk_color_selection_get_color(aGtkColorSelection *, double *);
+extern (C) void gtk_color_selection_set_color(aGtkColorSelection *, double *);
+extern (C) _BCD_func__11008 gtk_color_selection_set_change_palette_with_screen_hook(_BCD_func__11008);
+extern (C) _BCD_func__11009 gtk_color_selection_set_change_palette_hook(_BCD_func__11009);
+extern (C) char * gtk_color_selection_palette_to_string(_GdkColor *, int);
+extern (C) int gtk_color_selection_palette_from_string(char *, _GdkColor * *, int *);
+extern (C) int gtk_color_selection_is_adjusting(aGtkColorSelection *);
+extern (C) ushort gtk_color_selection_get_previous_alpha(aGtkColorSelection *);
+extern (C) void gtk_color_selection_get_previous_color(aGtkColorSelection *, _GdkColor *);
+extern (C) void gtk_color_selection_set_previous_alpha(aGtkColorSelection *, ushort);
+extern (C) void gtk_color_selection_set_previous_color(aGtkColorSelection *, _GdkColor *);
+extern (C) ushort gtk_color_selection_get_current_alpha(aGtkColorSelection *);
+extern (C) void gtk_color_selection_get_current_color(aGtkColorSelection *, _GdkColor *);
+extern (C) void gtk_color_selection_set_current_alpha(aGtkColorSelection *, ushort);
+extern (C) void gtk_color_selection_set_current_color(aGtkColorSelection *, _GdkColor *);
+extern (C) void gtk_color_selection_set_has_palette(aGtkColorSelection *, int);
+extern (C) int gtk_color_selection_get_has_palette(aGtkColorSelection *);
+extern (C) void gtk_color_selection_set_has_opacity_control(aGtkColorSelection *, int);
+extern (C) int gtk_color_selection_get_has_opacity_control(aGtkColorSelection *);
+extern (C) _GtkWidget * gtk_color_selection_new();
+extern (C) uint gtk_color_selection_get_type();
+extern (C) _GtkWidget * gtk_vbox_new(int, int);
+extern (C) uint gtk_vbox_get_type();
+extern (C) char * gtk_color_button_get_title(aGtkColorButton *);
+extern (C) void gtk_color_button_set_title(aGtkColorButton *, char *);
+extern (C) int gtk_color_button_get_use_alpha(aGtkColorButton *);
+extern (C) void gtk_color_button_set_use_alpha(aGtkColorButton *, int);
+extern (C) ushort gtk_color_button_get_alpha(aGtkColorButton *);
+extern (C) void gtk_color_button_get_color(aGtkColorButton *, _GdkColor *);
+extern (C) void gtk_color_button_set_alpha(aGtkColorButton *, ushort);
+extern (C) void gtk_color_button_set_color(aGtkColorButton *, _GdkColor *);
+extern (C) _GtkWidget * gtk_color_button_new_with_color(_GdkColor *);
+extern (C) _GtkWidget * gtk_color_button_new();
+extern (C) uint gtk_color_button_get_type();
+extern (C) void * _gtk_clist_create_cell_layout(aGtkCList *, aGtkCListRow *, int);
+extern (C) void gtk_clist_set_auto_sort(aGtkCList *, int);
+extern (C) void gtk_clist_sort(aGtkCList *);
+extern (C) void gtk_clist_set_sort_type(aGtkCList *, int);
+extern (C) void gtk_clist_set_sort_column(aGtkCList *, int);
+extern (C) void gtk_clist_set_compare_func(aGtkCList *, _BCD_func__11051);
+extern (C) void gtk_clist_row_move(aGtkCList *, int, int);
+extern (C) void gtk_clist_swap_rows(aGtkCList *, int, int);
+extern (C) void gtk_clist_unselect_all(aGtkCList *);
+extern (C) void gtk_clist_select_all(aGtkCList *);
+extern (C) int gtk_clist_get_selection_info(aGtkCList *, int, int, int *, int *);
+extern (C) void gtk_clist_clear(aGtkCList *);
+extern (C) void gtk_clist_undo_selection(aGtkCList *);
+extern (C) void gtk_clist_unselect_row(aGtkCList *, int, int);
+extern (C) void gtk_clist_select_row(aGtkCList *, int, int);
+extern (C) int gtk_clist_find_row_from_data(aGtkCList *, void *);
+extern (C) void * gtk_clist_get_row_data(aGtkCList *, int);
+extern (C) void gtk_clist_set_row_data_full(aGtkCList *, int, void *, _BCD_func__13158);
+extern (C) void gtk_clist_set_row_data(aGtkCList *, int, void *);
+extern (C) void gtk_clist_remove(aGtkCList *, int);
+extern (C) int gtk_clist_insert(aGtkCList *, int, char * *);
+extern (C) int gtk_clist_append(aGtkCList *, char * *);
+extern (C) int gtk_clist_prepend(aGtkCList *, char * *);
+extern (C) int gtk_clist_get_selectable(aGtkCList *, int);
+extern (C) void gtk_clist_set_selectable(aGtkCList *, int, int);
+extern (C) void gtk_clist_set_shift(aGtkCList *, int, int, int, int);
+extern (C) _GtkStyle * gtk_clist_get_row_style(aGtkCList *, int);
+extern (C) void gtk_clist_set_row_style(aGtkCList *, int, aGtkStyle *);
+extern (C) _GtkStyle * gtk_clist_get_cell_style(aGtkCList *, int, int);
+extern (C) void gtk_clist_set_cell_style(aGtkCList *, int, int, aGtkStyle *);
+extern (C) void gtk_clist_set_background(aGtkCList *, int, _GdkColor *);
+extern (C) void gtk_clist_set_foreground(aGtkCList *, int, _GdkColor *);
+extern (C) int gtk_clist_get_pixtext(aGtkCList *, int, int, char * *, char *, _GdkDrawable * *, _GdkDrawable * *);
+extern (C) void gtk_clist_set_pixtext(aGtkCList *, int, int, char *, char, _GdkDrawable *, _GdkDrawable *);
+extern (C) int gtk_clist_get_pixmap(aGtkCList *, int, int, _GdkDrawable * *, _GdkDrawable * *);
+extern (C) void gtk_clist_set_pixmap(aGtkCList *, int, int, _GdkDrawable *, _GdkDrawable *);
+extern (C) int gtk_clist_get_text(aGtkCList *, int, int, char * *);
+extern (C) void gtk_clist_set_text(aGtkCList *, int, int, char *);
+extern (C) int gtk_clist_get_cell_type(aGtkCList *, int, int);
+extern (C) int gtk_clist_row_is_visible(aGtkCList *, int);
+extern (C) void gtk_clist_moveto(aGtkCList *, int, int, float, float);
+extern (C) void gtk_clist_set_row_height(aGtkCList *, uint);
+extern (C) void gtk_clist_set_column_max_width(aGtkCList *, int, int);
+extern (C) void gtk_clist_set_column_min_width(aGtkCList *, int, int);
+extern (C) void gtk_clist_set_column_width(aGtkCList *, int, int);
+extern (C) int gtk_clist_optimal_column_width(aGtkCList *, int);
+extern (C) int gtk_clist_columns_autosize(aGtkCList *);
+extern (C) void gtk_clist_set_column_auto_resize(aGtkCList *, int, int);
+extern (C) void gtk_clist_set_column_resizeable(aGtkCList *, int, int);
+extern (C) void gtk_clist_set_column_visibility(aGtkCList *, int, int);
+extern (C) void gtk_clist_set_column_justification(aGtkCList *, int, int);
+extern (C) _GtkWidget * gtk_clist_get_column_widget(aGtkCList *, int);
+extern (C) void gtk_clist_set_column_widget(aGtkCList *, int, aGtkWidget *);
+extern (C) char * gtk_clist_get_column_title(aGtkCList *, int);
+extern (C) void gtk_clist_set_column_title(aGtkCList *, int, char *);
+extern (C) void gtk_clist_column_titles_passive(aGtkCList *);
+extern (C) void gtk_clist_column_titles_active(aGtkCList *);
+extern (C) void gtk_clist_column_title_passive(aGtkCList *, int);
+extern (C) void gtk_clist_column_title_active(aGtkCList *, int);
+extern (C) void gtk_clist_column_titles_hide(aGtkCList *);
+extern (C) void gtk_clist_column_titles_show(aGtkCList *);
+extern (C) void gtk_clist_thaw(aGtkCList *);
+extern (C) void gtk_clist_freeze(aGtkCList *);
+extern (C) void gtk_clist_set_button_actions(aGtkCList *, uint, char);
+extern (C) void gtk_clist_set_use_drag_icons(aGtkCList *, int);
+extern (C) void gtk_clist_set_reorderable(aGtkCList *, int);
+extern (C) void gtk_clist_set_selection_mode(aGtkCList *, int);
+extern (C) void gtk_clist_set_shadow_type(aGtkCList *, int);
+extern (C) _GtkAdjustment * gtk_clist_get_vadjustment(aGtkCList *);
+extern (C) _GtkAdjustment * gtk_clist_get_hadjustment(aGtkCList *);
+extern (C) void gtk_clist_set_vadjustment(aGtkCList *, aGtkAdjustment *);
+extern (C) void gtk_clist_set_hadjustment(aGtkCList *, aGtkAdjustment *);
+extern (C) _GtkWidget * gtk_clist_new_with_titles(int, char * *);
+extern (C) _GtkWidget * gtk_clist_new(int);
+extern (C) uint gtk_clist_get_type();
+extern (C) _GtkWidget * gtk_vscrollbar_new(aGtkAdjustment *);
+extern (C) uint gtk_vscrollbar_get_type();
+extern (C) _GtkWidget * gtk_hscrollbar_new(aGtkAdjustment *);
+extern (C) uint gtk_hscrollbar_get_type();
+extern (C) uint gtk_scrollbar_get_type();
+extern (C) double _gtk_range_get_wheel_delta(aGtkRange *, int);
+extern (C) double gtk_range_get_fill_level(aGtkRange *);
+extern (C) void gtk_range_set_fill_level(aGtkRange *, double);
+extern (C) int gtk_range_get_restrict_to_fill_level(aGtkRange *);
+extern (C) void gtk_range_set_restrict_to_fill_level(aGtkRange *, int);
+extern (C) int gtk_range_get_show_fill_level(aGtkRange *);
+extern (C) void gtk_range_set_show_fill_level(aGtkRange *, int);
+extern (C) double gtk_range_get_value(aGtkRange *);
+extern (C) void gtk_range_set_value(aGtkRange *, double);
+extern (C) void gtk_range_set_range(aGtkRange *, double, double);
+extern (C) void gtk_range_set_increments(aGtkRange *, double, double);
+extern (C) int gtk_range_get_upper_stepper_sensitivity(aGtkRange *);
+extern (C) void gtk_range_set_upper_stepper_sensitivity(aGtkRange *, int);
+extern (C) int gtk_range_get_lower_stepper_sensitivity(aGtkRange *);
+extern (C) void gtk_range_set_lower_stepper_sensitivity(aGtkRange *, int);
+extern (C) int gtk_range_get_inverted(aGtkRange *);
+extern (C) void gtk_range_set_inverted(aGtkRange *, int);
+extern (C) _GtkAdjustment * gtk_range_get_adjustment(aGtkRange *);
+extern (C) void gtk_range_set_adjustment(aGtkRange *, aGtkAdjustment *);
+extern (C) int gtk_range_get_update_policy(aGtkRange *);
+extern (C) void gtk_range_set_update_policy(aGtkRange *, int);
+extern (C) uint gtk_range_get_type();
+extern (C) void _gtk_clipboard_store_all();
+extern (C) void _gtk_clipboard_handle_event(_GdkEventOwnerChange *);
+extern (C) void gtk_clipboard_store(void *);
+extern (C) void gtk_clipboard_set_can_store(void *, aGtkTargetEntry *, int);
+extern (C) int gtk_clipboard_wait_is_target_available(void *, void *);
+extern (C) int gtk_clipboard_wait_is_image_available(void *);
+extern (C) int gtk_clipboard_wait_is_rich_text_available(void *, aGtkTextBuffer *);
+extern (C) int gtk_clipboard_wait_is_text_available(void *);
+extern (C) int gtk_clipboard_wait_for_targets(void *, void * * *, int *);
+extern (C) void * gtk_clipboard_wait_for_image(void *);
+extern (C) char * gtk_clipboard_wait_for_rich_text(void *, aGtkTextBuffer *, void * *, uint *);
+extern (C) char * gtk_clipboard_wait_for_text(void *);
+extern (C) _GtkSelectionData * gtk_clipboard_wait_for_contents(void *, void *);
+extern (C) void gtk_clipboard_request_targets(void *, _BCD_func__11269, void *);
+extern (C) void gtk_clipboard_request_image(void *, _BCD_func__11270, void *);
+extern (C) void gtk_clipboard_request_rich_text(void *, aGtkTextBuffer *, _BCD_func__11271, void *);
+extern (C) void gtk_clipboard_request_text(void *, _BCD_func__11272, void *);
+extern (C) void gtk_clipboard_request_contents(void *, void *, _BCD_func__11273, void *);
+extern (C) void gtk_clipboard_set_image(void *, void *);
+extern (C) void gtk_clipboard_set_text(void *, char *, int);
+extern (C) void gtk_clipboard_clear(void *);
+extern (C) _GObject * gtk_clipboard_get_owner(void *);
+extern (C) int gtk_clipboard_set_with_owner(void *, aGtkTargetEntry *, uint, _BCD_func__11268, _BCD_func__11267, _GObject *);
+extern (C) int gtk_clipboard_set_with_data(void *, aGtkTargetEntry *, uint, _BCD_func__11268, _BCD_func__11267, void *);
+extern (C) _GdkDisplay * gtk_clipboard_get_display(void *);
+extern (C) void * gtk_clipboard_get(void *);
+extern (C) void * gtk_clipboard_get_for_display(_GdkDisplay *, void *);
+extern (C) uint gtk_clipboard_get_type();
+extern (C) uint gtk_target_list_get_type();
+extern (C) void gtk_selection_data_free(aGtkSelectionData *);
+extern (C) _GtkSelectionData * gtk_selection_data_copy(aGtkSelectionData *);
+extern (C) uint gtk_selection_data_get_type();
+extern (C) int _gtk_selection_property_notify(aGtkWidget *, _GdkEventProperty *);
+extern (C) int _gtk_selection_notify(aGtkWidget *, _GdkEventSelection *);
+extern (C) int _gtk_selection_incr_event(_GdkDrawable *, _GdkEventProperty *);
+extern (C) int _gtk_selection_request(aGtkWidget *, _GdkEventSelection *);
+extern (C) int gtk_selection_clear(aGtkWidget *, _GdkEventSelection *);
+extern (C) void gtk_selection_remove_all(aGtkWidget *);
+extern (C) int gtk_targets_include_uri(void * *, int);
+extern (C) int gtk_targets_include_image(void * *, int, int);
+extern (C) int gtk_targets_include_rich_text(void * *, int, aGtkTextBuffer *);
+extern (C) int gtk_targets_include_text(void * *, int);
+extern (C) int gtk_selection_data_targets_include_uri(aGtkSelectionData *);
+extern (C) int gtk_selection_data_targets_include_image(aGtkSelectionData *, int);
+extern (C) int gtk_selection_data_targets_include_rich_text(aGtkSelectionData *, aGtkTextBuffer *);
+extern (C) int gtk_selection_data_targets_include_text(aGtkSelectionData *);
+extern (C) int gtk_selection_data_get_targets(aGtkSelectionData *, void * * *, int *);
+extern (C) char * * gtk_selection_data_get_uris(aGtkSelectionData *);
+extern (C) int gtk_selection_data_set_uris(aGtkSelectionData *, char * *);
+extern (C) void * gtk_selection_data_get_pixbuf(aGtkSelectionData *);
+extern (C) int gtk_selection_data_set_pixbuf(aGtkSelectionData *, void *);
+extern (C) char * gtk_selection_data_get_text(aGtkSelectionData *);
+extern (C) int gtk_selection_data_set_text(aGtkSelectionData *, char *, int);
+extern (C) void gtk_selection_data_set(aGtkSelectionData *, void *, int, char *, int);
+extern (C) int gtk_selection_convert(aGtkWidget *, void *, void *, uint);
+extern (C) void gtk_selection_clear_targets(aGtkWidget *, void *);
+extern (C) void gtk_selection_add_targets(aGtkWidget *, void *, aGtkTargetEntry *, uint);
+extern (C) void gtk_selection_add_target(aGtkWidget *, void *, void *, uint);
+extern (C) int gtk_selection_owner_set_for_display(_GdkDisplay *, aGtkWidget *, void *, uint);
+extern (C) int gtk_selection_owner_set(aGtkWidget *, void *, uint);
+extern (C) void gtk_target_table_free(aGtkTargetEntry *, int);
+extern (C) _GtkTargetEntry * gtk_target_table_new_from_list(aGtkTargetList *, int *);
+extern (C) int gtk_target_list_find(aGtkTargetList *, void *, uint *);
+extern (C) void gtk_target_list_remove(aGtkTargetList *, void *);
+extern (C) void gtk_target_list_add_table(aGtkTargetList *, aGtkTargetEntry *, uint);
+extern (C) void gtk_target_list_add_uri_targets(aGtkTargetList *, uint);
+extern (C) void gtk_target_list_add_image_targets(aGtkTargetList *, uint, int);
+extern (C) void gtk_target_list_add_rich_text_targets(aGtkTargetList *, uint, int, aGtkTextBuffer *);
+extern (C) void gtk_target_list_add_text_targets(aGtkTargetList *, uint);
+extern (C) void gtk_target_list_add(aGtkTargetList *, void *, uint, uint);
+extern (C) void gtk_target_list_unref(aGtkTargetList *);
+extern (C) _GtkTargetList * gtk_target_list_ref(aGtkTargetList *);
+extern (C) _GtkTargetList * gtk_target_list_new(aGtkTargetEntry *, uint);
+extern (C) void gtk_text_iter_order(aGtkTextIter *, aGtkTextIter *);
+extern (C) int gtk_text_iter_in_range(aGtkTextIter *, aGtkTextIter *, aGtkTextIter *);
+extern (C) int gtk_text_iter_compare(aGtkTextIter *, aGtkTextIter *);
+extern (C) int gtk_text_iter_equal(aGtkTextIter *, aGtkTextIter *);
+extern (C) int gtk_text_iter_backward_search(aGtkTextIter *, char *, int, aGtkTextIter *, aGtkTextIter *, aGtkTextIter *);
+extern (C) int gtk_text_iter_forward_search(aGtkTextIter *, char *, int, aGtkTextIter *, aGtkTextIter *, aGtkTextIter *);
+extern (C) int gtk_text_iter_backward_find_char(aGtkTextIter *, _BCD_func__11292, void *, aGtkTextIter *);
+extern (C) int gtk_text_iter_forward_find_char(aGtkTextIter *, _BCD_func__11292, void *, aGtkTextIter *);
+extern (C) int gtk_text_iter_backward_to_tag_toggle(aGtkTextIter *, aGtkTextTag *);
+extern (C) int gtk_text_iter_forward_to_tag_toggle(aGtkTextIter *, aGtkTextTag *);
+extern (C) void gtk_text_iter_set_visible_line_index(aGtkTextIter *, int);
+extern (C) void gtk_text_iter_set_visible_line_offset(aGtkTextIter *, int);
+extern (C) int gtk_text_iter_forward_to_line_end(aGtkTextIter *);
+extern (C) void gtk_text_iter_forward_to_end(aGtkTextIter *);
+extern (C) void gtk_text_iter_set_line_index(aGtkTextIter *, int);
+extern (C) void gtk_text_iter_set_line_offset(aGtkTextIter *, int);
+extern (C) void gtk_text_iter_set_line(aGtkTextIter *, int);
+extern (C) void gtk_text_iter_set_offset(aGtkTextIter *, int);
+extern (C) int gtk_text_iter_backward_visible_cursor_positions(aGtkTextIter *, int);
+extern (C) int gtk_text_iter_forward_visible_cursor_positions(aGtkTextIter *, int);
+extern (C) int gtk_text_iter_backward_visible_cursor_position(aGtkTextIter *);
+extern (C) int gtk_text_iter_forward_visible_cursor_position(aGtkTextIter *);
+extern (C) int gtk_text_iter_backward_cursor_positions(aGtkTextIter *, int);
+extern (C) int gtk_text_iter_forward_cursor_positions(aGtkTextIter *, int);
+extern (C) int gtk_text_iter_backward_cursor_position(aGtkTextIter *);
+extern (C) int gtk_text_iter_forward_cursor_position(aGtkTextIter *);
+extern (C) int gtk_text_iter_backward_sentence_starts(aGtkTextIter *, int);
+extern (C) int gtk_text_iter_forward_sentence_ends(aGtkTextIter *, int);
+extern (C) int gtk_text_iter_backward_sentence_start(aGtkTextIter *);
+extern (C) int gtk_text_iter_forward_sentence_end(aGtkTextIter *);
+extern (C) int gtk_text_iter_backward_visible_word_starts(aGtkTextIter *, int);
+extern (C) int gtk_text_iter_forward_visible_word_ends(aGtkTextIter *, int);
+extern (C) int gtk_text_iter_backward_visible_word_start(aGtkTextIter *);
+extern (C) int gtk_text_iter_forward_visible_word_end(aGtkTextIter *);
+extern (C) int gtk_text_iter_backward_visible_lines(aGtkTextIter *, int);
+extern (C) int gtk_text_iter_forward_visible_lines(aGtkTextIter *, int);
+extern (C) int gtk_text_iter_backward_visible_line(aGtkTextIter *);
+extern (C) int gtk_text_iter_forward_visible_line(aGtkTextIter *);
+extern (C) int gtk_text_iter_backward_word_starts(aGtkTextIter *, int);
+extern (C) int gtk_text_iter_forward_word_ends(aGtkTextIter *, int);
+extern (C) int gtk_text_iter_backward_word_start(aGtkTextIter *);
+extern (C) int gtk_text_iter_forward_word_end(aGtkTextIter *);
+extern (C) int gtk_text_iter_backward_lines(aGtkTextIter *, int);
+extern (C) int gtk_text_iter_forward_lines(aGtkTextIter *, int);
+extern (C) int gtk_text_iter_backward_line(aGtkTextIter *);
+extern (C) int gtk_text_iter_forward_line(aGtkTextIter *);
+extern (C) int gtk_text_iter_backward_chars(aGtkTextIter *, int);
+extern (C) int gtk_text_iter_forward_chars(aGtkTextIter *, int);
+extern (C) int gtk_text_iter_backward_char(aGtkTextIter *);
+extern (C) int gtk_text_iter_forward_char(aGtkTextIter *);
+extern (C) int gtk_text_iter_is_start(aGtkTextIter *);
+extern (C) int gtk_text_iter_is_end(aGtkTextIter *);
+extern (C) void * gtk_text_iter_get_language(aGtkTextIter *);
+extern (C) int gtk_text_iter_get_attributes(aGtkTextIter *, aGtkTextAttributes *);
+extern (C) int gtk_text_iter_get_bytes_in_line(aGtkTextIter *);
+extern (C) int gtk_text_iter_get_chars_in_line(aGtkTextIter *);
+extern (C) int gtk_text_iter_is_cursor_position(aGtkTextIter *);
+extern (C) int gtk_text_iter_ends_line(aGtkTextIter *);
+extern (C) int gtk_text_iter_starts_line(aGtkTextIter *);
+extern (C) int gtk_text_iter_inside_sentence(aGtkTextIter *);
+extern (C) int gtk_text_iter_ends_sentence(aGtkTextIter *);
+extern (C) int gtk_text_iter_starts_sentence(aGtkTextIter *);
+extern (C) int gtk_text_iter_inside_word(aGtkTextIter *);
+extern (C) int gtk_text_iter_ends_word(aGtkTextIter *);
+extern (C) int gtk_text_iter_starts_word(aGtkTextIter *);
+extern (C) int gtk_text_iter_can_insert(aGtkTextIter *, int);
+extern (C) int gtk_text_iter_editable(aGtkTextIter *, int);
+extern (C) _GSList * gtk_text_iter_get_tags(aGtkTextIter *);
+extern (C) int gtk_text_iter_has_tag(aGtkTextIter *, aGtkTextTag *);
+extern (C) int gtk_text_iter_toggles_tag(aGtkTextIter *, aGtkTextTag *);
+extern (C) int gtk_text_iter_ends_tag(aGtkTextIter *, aGtkTextTag *);
+extern (C) int gtk_text_iter_begins_tag(aGtkTextIter *, aGtkTextTag *);
+extern (C) _GSList * gtk_text_iter_get_toggled_tags(aGtkTextIter *, int);
+extern (C) _GtkTextChildAnchor * gtk_text_iter_get_child_anchor(aGtkTextIter *);
+extern (C) _GSList * gtk_text_iter_get_marks(aGtkTextIter *);
+extern (C) void * gtk_text_iter_get_pixbuf(aGtkTextIter *);
+extern (C) char * gtk_text_iter_get_visible_text(aGtkTextIter *, aGtkTextIter *);
+extern (C) char * gtk_text_iter_get_visible_slice(aGtkTextIter *, aGtkTextIter *);
+extern (C) char * gtk_text_iter_get_text(aGtkTextIter *, aGtkTextIter *);
+extern (C) char * gtk_text_iter_get_slice(aGtkTextIter *, aGtkTextIter *);
+extern (C) uint gtk_text_iter_get_char(aGtkTextIter *);
+extern (C) int gtk_text_iter_get_visible_line_index(aGtkTextIter *);
+extern (C) int gtk_text_iter_get_visible_line_offset(aGtkTextIter *);
+extern (C) int gtk_text_iter_get_line_index(aGtkTextIter *);
+extern (C) int gtk_text_iter_get_line_offset(aGtkTextIter *);
+extern (C) int gtk_text_iter_get_line(aGtkTextIter *);
+extern (C) int gtk_text_iter_get_offset(aGtkTextIter *);
+extern (C) uint gtk_text_iter_get_type();
+extern (C) void gtk_text_iter_free(aGtkTextIter *);
+extern (C) _GtkTextIter * gtk_text_iter_copy(aGtkTextIter *);
+extern (C) _GtkTextBuffer * gtk_text_iter_get_buffer(aGtkTextIter *);
+extern (C) int gtk_text_child_anchor_get_deleted(aGtkTextChildAnchor *);
+extern (C) _GList * gtk_text_child_anchor_get_widgets(aGtkTextChildAnchor *);
+extern (C) _GtkTextChildAnchor * gtk_text_child_anchor_new();
+extern (C) uint gtk_text_child_anchor_get_type();
+extern (C) uint gtk_text_attributes_get_type();
+extern (C) _GtkTextAttributes * gtk_text_attributes_ref(aGtkTextAttributes *);
+extern (C) void gtk_text_attributes_unref(aGtkTextAttributes *);
+extern (C) void gtk_text_attributes_copy_values(aGtkTextAttributes *, aGtkTextAttributes *);
+extern (C) _GtkTextAttributes * gtk_text_attributes_copy(aGtkTextAttributes *);
+extern (C) _GtkTextAttributes * gtk_text_attributes_new();
+extern (C) int gtk_text_tag_event(aGtkTextTag *, _GObject *, _GdkEvent *, aGtkTextIter *);
+extern (C) void gtk_text_tag_set_priority(aGtkTextTag *, int);
+extern (C) int gtk_text_tag_get_priority(aGtkTextTag *);
+extern (C) _GtkTextTag * gtk_text_tag_new(char *);
+extern (C) uint gtk_text_tag_get_type();
+extern (C) void gtk_check_menu_item_set_show_toggle(aGtkCheckMenuItem *, int);
+extern (C) int gtk_check_menu_item_get_draw_as_radio(aGtkCheckMenuItem *);
+extern (C) void gtk_check_menu_item_set_draw_as_radio(aGtkCheckMenuItem *, int);
+extern (C) int gtk_check_menu_item_get_inconsistent(aGtkCheckMenuItem *);
+extern (C) void gtk_check_menu_item_set_inconsistent(aGtkCheckMenuItem *, int);
+extern (C) void gtk_check_menu_item_toggled(aGtkCheckMenuItem *);
+extern (C) int gtk_check_menu_item_get_active(aGtkCheckMenuItem *);
+extern (C) void gtk_check_menu_item_set_active(aGtkCheckMenuItem *, int);
+extern (C) _GtkWidget * gtk_check_menu_item_new_with_mnemonic(char *);
+extern (C) _GtkWidget * gtk_check_menu_item_new_with_label(char *);
+extern (C) _GtkWidget * gtk_check_menu_item_new();
+extern (C) uint gtk_check_menu_item_get_type();
+extern (C) void gtk_menu_item_remove_submenu(aGtkMenuItem *);
+extern (C) void _gtk_menu_item_popdown_submenu(aGtkWidget *);
+extern (C) void _gtk_menu_item_popup_submenu(aGtkWidget *, int);
+extern (C) int _gtk_menu_item_is_selectable(aGtkWidget *);
+extern (C) void _gtk_menu_item_refresh_accel_path(aGtkMenuItem *, char *, aGtkAccelGroup *, int);
+extern (C) void gtk_menu_item_set_accel_path(aGtkMenuItem *, char *);
+extern (C) int gtk_menu_item_get_right_justified(aGtkMenuItem *);
+extern (C) void gtk_menu_item_set_right_justified(aGtkMenuItem *, int);
+extern (C) void gtk_menu_item_toggle_size_allocate(aGtkMenuItem *, int);
+extern (C) void gtk_menu_item_toggle_size_request(aGtkMenuItem *, int *);
+extern (C) void gtk_menu_item_activate(aGtkMenuItem *);
+extern (C) void gtk_menu_item_deselect(aGtkMenuItem *);
+extern (C) void gtk_menu_item_select(aGtkMenuItem *);
+extern (C) _GtkWidget * gtk_menu_item_get_submenu(aGtkMenuItem *);
+extern (C) void gtk_menu_item_set_submenu(aGtkMenuItem *, aGtkWidget *);
+extern (C) _GtkWidget * gtk_menu_item_new_with_mnemonic(char *);
+extern (C) _GtkWidget * gtk_menu_item_new_with_label(char *);
+extern (C) _GtkWidget * gtk_menu_item_new();
+extern (C) uint gtk_menu_item_get_type();
+extern (C) void gtk_item_toggle(aGtkItem *);
+extern (C) void gtk_item_deselect(aGtkItem *);
+extern (C) void gtk_item_select(aGtkItem *);
+extern (C) uint gtk_item_get_type();
+extern (C) void _gtk_check_button_get_props(aGtkCheckButton *, int *, int *);
+extern (C) _GtkWidget * gtk_check_button_new_with_mnemonic(char *);
+extern (C) _GtkWidget * gtk_check_button_new_with_label(char *);
+extern (C) _GtkWidget * gtk_check_button_new();
+extern (C) uint gtk_check_button_get_type();
+extern (C) int gtk_toggle_button_get_inconsistent(aGtkToggleButton *);
+extern (C) void gtk_toggle_button_set_inconsistent(aGtkToggleButton *, int);
+extern (C) void gtk_toggle_button_toggled(aGtkToggleButton *);
+extern (C) int gtk_toggle_button_get_active(aGtkToggleButton *);
+extern (C) void gtk_toggle_button_set_active(aGtkToggleButton *, int);
+extern (C) int gtk_toggle_button_get_mode(aGtkToggleButton *);
+extern (C) void gtk_toggle_button_set_mode(aGtkToggleButton *, int);
+extern (C) _GtkWidget * gtk_toggle_button_new_with_mnemonic(char *);
+extern (C) _GtkWidget * gtk_toggle_button_new_with_label(char *);
+extern (C) _GtkWidget * gtk_toggle_button_new();
+extern (C) uint gtk_toggle_button_get_type();
+extern (C) _GList * gtk_cell_view_get_cell_renderers(aGtkCellView *);
+extern (C) void gtk_cell_view_set_background_color(aGtkCellView *, _GdkColor *);
+extern (C) int gtk_cell_view_get_size_of_row(aGtkCellView *, void *, aGtkRequisition *);
+extern (C) void * gtk_cell_view_get_displayed_row(aGtkCellView *);
+extern (C) void gtk_cell_view_set_displayed_row(aGtkCellView *, void *);
+extern (C) void gtk_cell_view_set_model(aGtkCellView *, void *);
+extern (C) _GtkWidget * gtk_cell_view_new_with_pixbuf(void *);
+extern (C) _GtkWidget * gtk_cell_view_new_with_markup(char *);
+extern (C) _GtkWidget * gtk_cell_view_new_with_text(char *);
+extern (C) _GtkWidget * gtk_cell_view_new();
+extern (C) uint gtk_cell_view_get_type();
+extern (C) void gtk_cell_renderer_toggle_set_active(aGtkCellRendererToggle *, int);
+extern (C) int gtk_cell_renderer_toggle_get_active(aGtkCellRendererToggle *);
+extern (C) void gtk_cell_renderer_toggle_set_radio(aGtkCellRendererToggle *, int);
+extern (C) int gtk_cell_renderer_toggle_get_radio(aGtkCellRendererToggle *);
+extern (C) _GtkCellRenderer * gtk_cell_renderer_toggle_new();
+extern (C) uint gtk_cell_renderer_toggle_get_type();
+extern (C) _GtkCellRenderer * gtk_cell_renderer_spin_new();
+extern (C) uint gtk_cell_renderer_spin_get_type();
+extern (C) _GtkCellRenderer * gtk_cell_renderer_progress_new();
+extern (C) uint gtk_cell_renderer_progress_get_type();
+extern (C) _GtkCellRenderer * gtk_cell_renderer_pixbuf_new();
+extern (C) uint gtk_cell_renderer_pixbuf_get_type();
+extern (C) _GtkCellRenderer * gtk_cell_renderer_combo_new();
+extern (C) uint gtk_cell_renderer_combo_get_type();
+extern (C) _GtkCellRenderer * gtk_cell_renderer_accel_new();
+extern (C) uint gtk_cell_renderer_accel_get_type();
+extern (C) void gtk_cell_renderer_text_set_fixed_height_from_font(aGtkCellRendererText *, int);
+extern (C) _GtkCellRenderer * gtk_cell_renderer_text_new();
+extern (C) uint gtk_cell_renderer_text_get_type();
+extern (C) void _gtk_cell_layout_buildable_add_child(void *, aGtkBuilder *, _GObject *, char *);
+extern (C) void _gtk_cell_layout_buildable_custom_tag_end(void *, aGtkBuilder *, _GObject *, char *, void * *);
+extern (C) int _gtk_cell_layout_buildable_custom_tag_start(void *, aGtkBuilder *, _GObject *, char *, _GMarkupParser *, void * *);
+extern (C) void gtk_cell_layout_reorder(void *, aGtkCellRenderer *, int);
+extern (C) void gtk_cell_layout_clear_attributes(void *, aGtkCellRenderer *);
+extern (C) void gtk_cell_layout_set_cell_data_func(void *, aGtkCellRenderer *, _BCD_func__11624, void *, _BCD_func__13158);
+extern (C) void gtk_cell_layout_add_attribute(void *, aGtkCellRenderer *, char *, int);
+extern (C) void gtk_cell_layout_set_attributes(void *, aGtkCellRenderer *, ...);
+extern (C) void gtk_cell_layout_clear(void *);
+extern (C) _GList * gtk_cell_layout_get_cells(void *);
+extern (C) void gtk_cell_layout_pack_end(void *, aGtkCellRenderer *, int);
+extern (C) void gtk_cell_layout_pack_start(void *, aGtkCellRenderer *, int);
+extern (C) uint gtk_cell_layout_get_type();
+extern (C) _GtkWidget * gtk_tree_view_column_get_tree_view(aGtkTreeViewColumn *);
+extern (C) void gtk_tree_view_column_queue_resize(aGtkTreeViewColumn *);
+extern (C) int gtk_tree_view_column_cell_get_position(aGtkTreeViewColumn *, aGtkCellRenderer *, int *, int *);
+extern (C) void gtk_tree_view_column_focus_cell(aGtkTreeViewColumn *, aGtkCellRenderer *);
+extern (C) int gtk_tree_view_column_cell_is_visible(aGtkTreeViewColumn *);
+extern (C) void gtk_tree_view_column_cell_get_size(aGtkTreeViewColumn *, _GdkRectangle *, int *, int *, int *, int *);
+extern (C) void gtk_tree_view_column_cell_set_cell_data(aGtkTreeViewColumn *, void *, aGtkTreeIter *, int, int);
+extern (C) int gtk_tree_view_column_get_sort_order(aGtkTreeViewColumn *);
+extern (C) void gtk_tree_view_column_set_sort_order(aGtkTreeViewColumn *, int);
+extern (C) int gtk_tree_view_column_get_sort_indicator(aGtkTreeViewColumn *);
+extern (C) void gtk_tree_view_column_set_sort_indicator(aGtkTreeViewColumn *, int);
+extern (C) int gtk_tree_view_column_get_sort_column_id(aGtkTreeViewColumn *);
+extern (C) void gtk_tree_view_column_set_sort_column_id(aGtkTreeViewColumn *, int);
+extern (C) int gtk_tree_view_column_get_reorderable(aGtkTreeViewColumn *);
+extern (C) void gtk_tree_view_column_set_reorderable(aGtkTreeViewColumn *, int);
+extern (C) float gtk_tree_view_column_get_alignment(aGtkTreeViewColumn *);
+extern (C) void gtk_tree_view_column_set_alignment(aGtkTreeViewColumn *, float);
+extern (C) _GtkWidget * gtk_tree_view_column_get_widget(aGtkTreeViewColumn *);
+extern (C) void gtk_tree_view_column_set_widget(aGtkTreeViewColumn *, aGtkWidget *);
+extern (C) int gtk_tree_view_column_get_clickable(aGtkTreeViewColumn *);
+extern (C) void gtk_tree_view_column_set_clickable(aGtkTreeViewColumn *, int);
+extern (C) int gtk_tree_view_column_get_expand(aGtkTreeViewColumn *);
+extern (C) void gtk_tree_view_column_set_expand(aGtkTreeViewColumn *, int);
+extern (C) char * gtk_tree_view_column_get_title(aGtkTreeViewColumn *);
+extern (C) void gtk_tree_view_column_set_title(aGtkTreeViewColumn *, char *);
+extern (C) void gtk_tree_view_column_clicked(aGtkTreeViewColumn *);
+extern (C) int gtk_tree_view_column_get_max_width(aGtkTreeViewColumn *);
+extern (C) void gtk_tree_view_column_set_max_width(aGtkTreeViewColumn *, int);
+extern (C) int gtk_tree_view_column_get_min_width(aGtkTreeViewColumn *);
+extern (C) void gtk_tree_view_column_set_min_width(aGtkTreeViewColumn *, int);
+extern (C) void gtk_tree_view_column_set_fixed_width(aGtkTreeViewColumn *, int);
+extern (C) int gtk_tree_view_column_get_fixed_width(aGtkTreeViewColumn *);
+extern (C) int gtk_tree_view_column_get_width(aGtkTreeViewColumn *);
+extern (C) int gtk_tree_view_column_get_sizing(aGtkTreeViewColumn *);
+extern (C) void gtk_tree_view_column_set_sizing(aGtkTreeViewColumn *, int);
+extern (C) int gtk_tree_view_column_get_resizable(aGtkTreeViewColumn *);
+extern (C) void gtk_tree_view_column_set_resizable(aGtkTreeViewColumn *, int);
+extern (C) int gtk_tree_view_column_get_visible(aGtkTreeViewColumn *);
+extern (C) void gtk_tree_view_column_set_visible(aGtkTreeViewColumn *, int);
+extern (C) int gtk_tree_view_column_get_spacing(aGtkTreeViewColumn *);
+extern (C) void gtk_tree_view_column_set_spacing(aGtkTreeViewColumn *, int);
+extern (C) void gtk_tree_view_column_clear_attributes(aGtkTreeViewColumn *, aGtkCellRenderer *);
+extern (C) void gtk_tree_view_column_set_cell_data_func(aGtkTreeViewColumn *, aGtkCellRenderer *, _BCD_func__11636, void *, _BCD_func__13158);
+extern (C) void gtk_tree_view_column_set_attributes(aGtkTreeViewColumn *, aGtkCellRenderer *, ...);
+extern (C) void gtk_tree_view_column_add_attribute(aGtkTreeViewColumn *, aGtkCellRenderer *, char *, int);
+extern (C) _GList * gtk_tree_view_column_get_cell_renderers(aGtkTreeViewColumn *);
+extern (C) void gtk_tree_view_column_clear(aGtkTreeViewColumn *);
+extern (C) void gtk_tree_view_column_pack_end(aGtkTreeViewColumn *, aGtkCellRenderer *, int);
+extern (C) void gtk_tree_view_column_pack_start(aGtkTreeViewColumn *, aGtkCellRenderer *, int);
+extern (C) _GtkTreeViewColumn * gtk_tree_view_column_new_with_attributes(char *, aGtkCellRenderer *, ...);
+extern (C) _GtkTreeViewColumn * gtk_tree_view_column_new();
+extern (C) uint gtk_tree_view_column_get_type();
+extern (C) int gtk_tree_sortable_has_default_sort_func(void *);
+extern (C) void gtk_tree_sortable_set_default_sort_func(void *, _BCD_func__11685, void *, _BCD_func__13158);
+extern (C) void gtk_tree_sortable_set_sort_func(void *, int, _BCD_func__11685, void *, _BCD_func__13158);
+extern (C) void gtk_tree_sortable_set_sort_column_id(void *, int, int);
+extern (C) int gtk_tree_sortable_get_sort_column_id(void *, int *, int *);
+extern (C) void gtk_tree_sortable_sort_column_changed(void *);
+extern (C) uint gtk_tree_sortable_get_type();
+extern (C) void gtk_tree_model_rows_reordered(void *, void *, aGtkTreeIter *, int *);
+extern (C) void gtk_tree_model_row_deleted(void *, void *);
+extern (C) void gtk_tree_model_row_has_child_toggled(void *, void *, aGtkTreeIter *);
+extern (C) void gtk_tree_model_row_inserted(void *, void *, aGtkTreeIter *);
+extern (C) void gtk_tree_model_row_changed(void *, void *, aGtkTreeIter *);
+extern (C) void gtk_tree_model_foreach(void *, _BCD_func__11697, void *);
+extern (C) void gtk_tree_model_get_valist(void *, aGtkTreeIter *, char *);
+extern (C) void gtk_tree_model_get(void *, aGtkTreeIter *, ...);
+extern (C) void gtk_tree_model_unref_node(void *, aGtkTreeIter *);
+extern (C) void gtk_tree_model_ref_node(void *, aGtkTreeIter *);
+extern (C) int gtk_tree_model_iter_parent(void *, aGtkTreeIter *, aGtkTreeIter *);
+extern (C) int gtk_tree_model_iter_nth_child(void *, aGtkTreeIter *, aGtkTreeIter *, int);
+extern (C) int gtk_tree_model_iter_n_children(void *, aGtkTreeIter *);
+extern (C) int gtk_tree_model_iter_has_child(void *, aGtkTreeIter *);
+extern (C) int gtk_tree_model_iter_children(void *, aGtkTreeIter *, aGtkTreeIter *);
+extern (C) int gtk_tree_model_iter_next(void *, aGtkTreeIter *);
+extern (C) void gtk_tree_model_get_value(void *, aGtkTreeIter *, int, _GValue *);
+extern (C) void * gtk_tree_model_get_path(void *, aGtkTreeIter *);
+extern (C) int gtk_tree_model_get_iter_first(void *, aGtkTreeIter *);
+extern (C) char * gtk_tree_model_get_string_from_iter(void *, aGtkTreeIter *);
+extern (C) int gtk_tree_model_get_iter_from_string(void *, aGtkTreeIter *, char *);
+extern (C) int gtk_tree_model_get_iter(void *, aGtkTreeIter *, void *);
+extern (C) uint gtk_tree_model_get_column_type(void *, int);
+extern (C) int gtk_tree_model_get_n_columns(void *);
+extern (C) int gtk_tree_model_get_flags(void *);
+extern (C) uint gtk_tree_model_get_type();
+extern (C) uint gtk_tree_iter_get_type();
+extern (C) void gtk_tree_iter_free(aGtkTreeIter *);
+extern (C) _GtkTreeIter * gtk_tree_iter_copy(aGtkTreeIter *);
+extern (C) void gtk_tree_row_reference_reordered(_GObject *, void *, aGtkTreeIter *, int *);
+extern (C) void gtk_tree_row_reference_deleted(_GObject *, void *);
+extern (C) void gtk_tree_row_reference_inserted(_GObject *, void *);
+extern (C) void gtk_tree_row_reference_free(void *);
+extern (C) void * gtk_tree_row_reference_copy(void *);
+extern (C) int gtk_tree_row_reference_valid(void *);
+extern (C) void * gtk_tree_row_reference_get_model(void *);
+extern (C) void * gtk_tree_row_reference_get_path(void *);
+extern (C) void * gtk_tree_row_reference_new_proxy(_GObject *, void *, void *);
+extern (C) void * gtk_tree_row_reference_new(void *, void *);
+extern (C) uint gtk_tree_row_reference_get_type();
+extern (C) int gtk_tree_path_is_descendant(void *, void *);
+extern (C) int gtk_tree_path_is_ancestor(void *, void *);
+extern (C) void gtk_tree_path_down(void *);
+extern (C) int gtk_tree_path_up(void *);
+extern (C) int gtk_tree_path_prev(void *);
+extern (C) void gtk_tree_path_next(void *);
+extern (C) int gtk_tree_path_compare(void *, void *);
+extern (C) uint gtk_tree_path_get_type();
+extern (C) void * gtk_tree_path_copy(void *);
+extern (C) void gtk_tree_path_free(void *);
+extern (C) int * gtk_tree_path_get_indices(void *);
+extern (C) int gtk_tree_path_get_depth(void *);
+extern (C) void gtk_tree_path_prepend_index(void *, int);
+extern (C) void gtk_tree_path_append_index(void *, int);
+extern (C) void * gtk_tree_path_new_first();
+extern (C) char * gtk_tree_path_to_string(void *);
+extern (C) void * gtk_tree_path_new_from_indices(int, ...);
+extern (C) void * gtk_tree_path_new_from_string(char *);
+extern (C) void * gtk_tree_path_new();
+extern (C) void gtk_cell_renderer_stop_editing(aGtkCellRenderer *, int);
+extern (C) void gtk_cell_renderer_editing_canceled(aGtkCellRenderer *);
+extern (C) void gtk_cell_renderer_get_fixed_size(aGtkCellRenderer *, int *, int *);
+extern (C) void gtk_cell_renderer_set_fixed_size(aGtkCellRenderer *, int, int);
+extern (C) void * gtk_cell_renderer_start_editing(aGtkCellRenderer *, _GdkEvent *, aGtkWidget *, char *, _GdkRectangle *, _GdkRectangle *, int);
+extern (C) int gtk_cell_renderer_activate(aGtkCellRenderer *, _GdkEvent *, aGtkWidget *, char *, _GdkRectangle *, _GdkRectangle *, int);
+extern (C) void gtk_cell_renderer_render(aGtkCellRenderer *, _GdkDrawable *, aGtkWidget *, _GdkRectangle *, _GdkRectangle *, _GdkRectangle *, int);
+extern (C) void gtk_cell_renderer_get_size(aGtkCellRenderer *, aGtkWidget *, _GdkRectangle *, int *, int *, int *, int *);
+extern (C) uint gtk_cell_renderer_get_type();
+extern (C) void gtk_cell_editable_remove_widget(void *);
+extern (C) void gtk_cell_editable_editing_done(void *);
+extern (C) void gtk_cell_editable_start_editing(void *, _GdkEvent *);
+extern (C) uint gtk_cell_editable_get_type();
+extern (C) void gtk_calendar_thaw(aGtkCalendar *);
+extern (C) void gtk_calendar_freeze(aGtkCalendar *);
+extern (C) void gtk_calendar_get_date(aGtkCalendar *, uint *, uint *, uint *);
+extern (C) void gtk_calendar_display_options(aGtkCalendar *, int);
+extern (C) int gtk_calendar_get_display_options(aGtkCalendar *);
+extern (C) void gtk_calendar_set_display_options(aGtkCalendar *, int);
+extern (C) void gtk_calendar_clear_marks(aGtkCalendar *);
+extern (C) int gtk_calendar_unmark_day(aGtkCalendar *, uint);
+extern (C) int gtk_calendar_mark_day(aGtkCalendar *, uint);
+extern (C) void gtk_calendar_select_day(aGtkCalendar *, uint);
+extern (C) int gtk_calendar_select_month(aGtkCalendar *, uint, uint);
+extern (C) _GtkWidget * gtk_calendar_new();
+extern (C) uint gtk_calendar_get_type();
+extern (C) void gtk_signal_compat_matched(aGtkObject *, _BCD_func__12122, void *, int, uint);
+extern (C) void gtk_signal_emitv_by_name(aGtkObject *, char *, aGtkArg *);
+extern (C) void gtk_signal_emit_by_name(aGtkObject *, char *, ...);
+extern (C) void gtk_signal_emit(aGtkObject *, uint, ...);
+extern (C) void gtk_signal_emitv(aGtkObject *, uint, aGtkArg *);
+extern (C) uint gtk_signal_connect_full(aGtkObject *, char *, _BCD_func__12122, _BCD_func__13157, void *, _BCD_func__13158, int, int);
+extern (C) void gtk_signal_connect_while_alive(aGtkObject *, char *, _BCD_func__12122, void *, aGtkObject *);
+extern (C) void gtk_signal_connect_object_while_alive(aGtkObject *, char *, _BCD_func__12122, aGtkObject *);
+extern (C) void gtk_signal_emit_stop_by_name(aGtkObject *, char *);
+extern (C) uint gtk_signal_new(char *, int, uint, uint, _BCD_func__13146, uint, uint, ...);
+extern (C) uint gtk_signal_newv(char *, int, uint, uint, _BCD_func__13146, uint, uint, uint *);
+extern (C) void gtk_marshal_VOID__UINT_STRING(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void gtk_marshal_VOID__UINT_POINTER_UINT_UINT_ENUM(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void gtk_marshal_VOID__UINT_POINTER_UINT_ENUM_ENUM_POINTER(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void gtk_marshal_VOID__STRING_INT_POINTER(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void gtk_marshal_VOID__POINTER_UINT_UINT(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void gtk_marshal_VOID__POINTER_INT_INT_POINTER_UINT_UINT(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void gtk_marshal_VOID__POINTER_POINTER_UINT_UINT(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void gtk_marshal_VOID__POINTER_UINT_ENUM(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void gtk_marshal_VOID__POINTER_UINT(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void gtk_marshal_VOID__POINTER_STRING_STRING(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void gtk_marshal_VOID__POINTER_POINTER_POINTER(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void gtk_marshal_VOID__POINTER_POINTER(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void gtk_marshal_VOID__POINTER_INT(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void gtk_marshal_VOID__INT_INT_POINTER(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void gtk_marshal_VOID__INT_INT(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void gtk_marshal_VOID__ENUM_FLOAT_BOOLEAN(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void gtk_marshal_VOID__ENUM_FLOAT(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void gtk_marshal_INT__POINTER_CHAR_CHAR(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void gtk_marshal_INT__POINTER(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void gtk_marshal_ENUM__ENUM(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void gtk_marshal_BOOLEAN__POINTER_STRING_STRING_POINTER(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void gtk_marshal_BOOLEAN__POINTER_INT_INT_UINT(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void gtk_marshal_BOOLEAN__POINTER_INT_INT(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void gtk_marshal_BOOLEAN__POINTER_POINTER_INT_INT(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void gtk_marshal_BOOLEAN__POINTER(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void gtk_marshal_BOOLEAN__VOID(_GClosure *, _GValue *, uint, _GValue *, void *, void *);
+extern (C) void _gtk_button_paint(aGtkButton *, _GdkRectangle *, int, int, char *, char *);
+extern (C) void _gtk_button_set_depressed(aGtkButton *, int);
+extern (C) int gtk_button_get_image_position(aGtkButton *);
+extern (C) void gtk_button_set_image_position(aGtkButton *, int);
+extern (C) _GtkWidget * gtk_button_get_image(aGtkButton *);
+extern (C) void gtk_button_set_image(aGtkButton *, aGtkWidget *);
+extern (C) void gtk_button_get_alignment(aGtkButton *, float *, float *);
+extern (C) void gtk_button_set_alignment(aGtkButton *, float, float);
+extern (C) int gtk_button_get_focus_on_click(aGtkButton *);
+extern (C) void gtk_button_set_focus_on_click(aGtkButton *, int);
+extern (C) int gtk_button_get_use_stock(aGtkButton *);
+extern (C) void gtk_button_set_use_stock(aGtkButton *, int);
+extern (C) int gtk_button_get_use_underline(aGtkButton *);
+extern (C) void gtk_button_set_use_underline(aGtkButton *, int);
+extern (C) char * gtk_button_get_label(aGtkButton *);
+extern (C) void gtk_button_set_label(aGtkButton *, char *);
+extern (C) int gtk_button_get_relief(aGtkButton *);
+extern (C) void gtk_button_set_relief(aGtkButton *, int);
+extern (C) void gtk_button_leave(aGtkButton *);
+extern (C) void gtk_button_enter(aGtkButton *);
+extern (C) void gtk_button_clicked(aGtkButton *);
+extern (C) void gtk_button_released(aGtkButton *);
+extern (C) void gtk_button_pressed(aGtkButton *);
+extern (C) _GtkWidget * gtk_button_new_with_mnemonic(char *);
+extern (C) _GtkWidget * gtk_button_new_from_stock(char *);
+extern (C) _GtkWidget * gtk_button_new_with_label(char *);
+extern (C) _GtkWidget * gtk_button_new();
+extern (C) uint gtk_button_get_type();
+extern (C) void gtk_image_get(aGtkImage *, _GdkImage * *, _GdkDrawable * *);
+extern (C) void gtk_image_set(aGtkImage *, _GdkImage *, _GdkDrawable *);
+extern (C) int gtk_image_get_pixel_size(aGtkImage *);
+extern (C) void gtk_image_get_icon_name(aGtkImage *, char * *, int *);
+extern (C) void * gtk_image_get_animation(aGtkImage *);
+extern (C) void gtk_image_get_icon_set(aGtkImage *, void * *, int *);
+extern (C) void gtk_image_get_stock(aGtkImage *, char * *, int *);
+extern (C) void * gtk_image_get_pixbuf(aGtkImage *);
+extern (C) void gtk_image_get_image(aGtkImage *, _GdkImage * *, _GdkDrawable * *);
+extern (C) void gtk_image_get_pixmap(aGtkImage *, _GdkDrawable * *, _GdkDrawable * *);
+extern (C) int gtk_image_get_storage_type(aGtkImage *);
+extern (C) void gtk_image_set_pixel_size(aGtkImage *, int);
+extern (C) void gtk_image_set_from_icon_name(aGtkImage *, char *, int);
+extern (C) void gtk_image_set_from_animation(aGtkImage *, void *);
+extern (C) void gtk_image_set_from_icon_set(aGtkImage *, void *, int);
+extern (C) void gtk_image_set_from_stock(aGtkImage *, char *, int);
+extern (C) void gtk_image_set_from_pixbuf(aGtkImage *, void *);
+extern (C) void gtk_image_set_from_file(aGtkImage *, char *);
+extern (C) void gtk_image_set_from_image(aGtkImage *, _GdkImage *, _GdkDrawable *);
+extern (C) void gtk_image_set_from_pixmap(aGtkImage *, _GdkDrawable *, _GdkDrawable *);
+extern (C) void gtk_image_clear(aGtkImage *);
+extern (C) _GtkWidget * gtk_image_new_from_icon_name(char *, int);
+extern (C) _GtkWidget * gtk_image_new_from_animation(void *);
+extern (C) _GtkWidget * gtk_image_new_from_icon_set(void *, int);
+extern (C) _GtkWidget * gtk_image_new_from_stock(char *, int);
+extern (C) _GtkWidget * gtk_image_new_from_pixbuf(void *);
+extern (C) _GtkWidget * gtk_image_new_from_file(char *);
+extern (C) _GtkWidget * gtk_image_new_from_image(_GdkImage *, _GdkDrawable *);
+extern (C) _GtkWidget * gtk_image_new_from_pixmap(_GdkDrawable *, _GdkDrawable *);
+extern (C) _GtkWidget * gtk_image_new();
+extern (C) uint gtk_image_get_type();
+extern (C) _GObject * gtk_buildable_get_internal_child(void *, aGtkBuilder *, char *);
+extern (C) void gtk_buildable_parser_finished(void *, aGtkBuilder *);
+extern (C) void gtk_buildable_custom_finished(void *, aGtkBuilder *, _GObject *, char *, void *);
+extern (C) void gtk_buildable_custom_tag_end(void *, aGtkBuilder *, _GObject *, char *, void * *);
+extern (C) int gtk_buildable_custom_tag_start(void *, aGtkBuilder *, _GObject *, char *, _GMarkupParser *, void * *);
+extern (C) _GObject * gtk_buildable_construct_child(void *, aGtkBuilder *, char *);
+extern (C) void gtk_buildable_set_buildable_property(void *, aGtkBuilder *, char *, _GValue *);
+extern (C) void gtk_buildable_add_child(void *, aGtkBuilder *, _GObject *, char *);
+extern (C) char * gtk_buildable_get_name(void *);
+extern (C) void gtk_buildable_set_name(void *, char *);
+extern (C) uint gtk_buildable_get_type();
+extern (C) int gtk_builder_value_from_string_type(aGtkBuilder *, uint, char *, _GValue *, _GError * *);
+extern (C) int gtk_builder_value_from_string(aGtkBuilder *, _GParamSpec *, char *, _GValue *, _GError * *);
+extern (C) uint gtk_builder_get_type_from_name(aGtkBuilder *, char *);
+extern (C) char * gtk_builder_get_translation_domain(aGtkBuilder *);
+extern (C) void gtk_builder_set_translation_domain(aGtkBuilder *, char *);
+extern (C) void gtk_builder_connect_signals_full(aGtkBuilder *, _BCD_func__11889, void *);
+extern (C) void gtk_builder_connect_signals(aGtkBuilder *, void *);
+extern (C) _GSList * gtk_builder_get_objects(aGtkBuilder *);
+extern (C) _GObject * gtk_builder_get_object(aGtkBuilder *, char *);
+extern (C) uint gtk_builder_add_from_string(aGtkBuilder *, char *, uint, _GError * *);
+extern (C) uint gtk_builder_add_from_file(aGtkBuilder *, char *, _GError * *);
+extern (C) _GtkBuilder * gtk_builder_new();
+extern (C) uint gtk_builder_get_type();
+extern (C) uint gtk_builder_error_quark();
+extern (C) uint _gtk_binding_signal_new(char *, uint, int, _BCD_func__12122, _BCD_func__14366, void *, _BCD_func__13146, uint, uint, ...);
+extern (C) void _gtk_binding_entry_add_signall(aGtkBindingSet *, uint, int, char *, _GSList *);
+extern (C) void _gtk_binding_reset_parsed();
+extern (C) uint _gtk_binding_parse_binding(_GScanner *);
+extern (C) void gtk_binding_set_add_path(aGtkBindingSet *, int, char *, int);
+extern (C) void gtk_binding_entry_remove(aGtkBindingSet *, uint, int);
+extern (C) void gtk_binding_entry_add_signal(aGtkBindingSet *, uint, int, char *, uint, ...);
+extern (C) void gtk_binding_entry_skip(aGtkBindingSet *, uint, int);
+extern (C) uint gtk_binding_parse_binding(_GScanner *);
+extern (C) void gtk_binding_entry_add_signall(aGtkBindingSet *, uint, int, char *, _GSList *);
+extern (C) void gtk_binding_entry_clear(aGtkBindingSet *, uint, int);
+extern (C) int gtk_binding_set_activate(aGtkBindingSet *, uint, int, aGtkObject *);
+extern (C) int gtk_bindings_activate_event(aGtkObject *, _GdkEventKey *);
+extern (C) int gtk_bindings_activate(aGtkObject *, uint, int);
+extern (C) _GtkBindingSet * gtk_binding_set_find(char *);
+extern (C) _GtkBindingSet * gtk_binding_set_by_class(void *);
+extern (C) _GtkBindingSet * gtk_binding_set_new(char *);
+extern (C) void _gtk_button_box_child_requisition(aGtkWidget *, int *, int *, int *, int *);
+extern (C) void gtk_button_box_get_child_ipadding(aGtkButtonBox *, int *, int *);
+extern (C) void gtk_button_box_get_child_size(aGtkButtonBox *, int *, int *);
+extern (C) void gtk_button_box_set_child_ipadding(aGtkButtonBox *, int, int);
+extern (C) void gtk_button_box_set_child_size(aGtkButtonBox *, int, int);
+extern (C) void gtk_button_box_set_child_secondary(aGtkButtonBox *, aGtkWidget *, int);
+extern (C) int gtk_button_box_get_child_secondary(aGtkButtonBox *, aGtkWidget *);
+extern (C) void gtk_button_box_set_layout(aGtkButtonBox *, int);
+extern (C) int gtk_button_box_get_layout(aGtkButtonBox *);
+extern (C) uint gtk_button_box_get_type();
+extern (C) void gtk_box_set_child_packing(aGtkBox *, aGtkWidget *, int, int, uint, int);
+extern (C) void gtk_box_query_child_packing(aGtkBox *, aGtkWidget *, int *, int *, uint *, int *);
+extern (C) void gtk_box_reorder_child(aGtkBox *, aGtkWidget *, int);
+extern (C) int gtk_box_get_spacing(aGtkBox *);
+extern (C) void gtk_box_set_spacing(aGtkBox *, int);
+extern (C) int gtk_box_get_homogeneous(aGtkBox *);
+extern (C) void gtk_box_set_homogeneous(aGtkBox *, int);
+extern (C) void gtk_box_pack_end_defaults(aGtkBox *, aGtkWidget *);
+extern (C) void gtk_box_pack_start_defaults(aGtkBox *, aGtkWidget *);
+extern (C) void gtk_box_pack_end(aGtkBox *, aGtkWidget *, int, int, uint);
+extern (C) void gtk_box_pack_start(aGtkBox *, aGtkWidget *, int, int, uint);
+extern (C) uint gtk_box_get_type();
+extern (C) void gtk_assistant_update_buttons_state(aGtkAssistant *);
+extern (C) void gtk_assistant_remove_action_widget(aGtkAssistant *, aGtkWidget *);
+extern (C) void gtk_assistant_add_action_widget(aGtkAssistant *, aGtkWidget *);
+extern (C) int gtk_assistant_get_page_complete(aGtkAssistant *, aGtkWidget *);
+extern (C) void gtk_assistant_set_page_complete(aGtkAssistant *, aGtkWidget *, int);
+extern (C) void * gtk_assistant_get_page_side_image(aGtkAssistant *, aGtkWidget *);
+extern (C) void gtk_assistant_set_page_side_image(aGtkAssistant *, aGtkWidget *, void *);
+extern (C) void * gtk_assistant_get_page_header_image(aGtkAssistant *, aGtkWidget *);
+extern (C) void gtk_assistant_set_page_header_image(aGtkAssistant *, aGtkWidget *, void *);
+extern (C) char * gtk_assistant_get_page_title(aGtkAssistant *, aGtkWidget *);
+extern (C) void gtk_assistant_set_page_title(aGtkAssistant *, aGtkWidget *, char *);
+extern (C) int gtk_assistant_get_page_type(aGtkAssistant *, aGtkWidget *);
+extern (C) void gtk_assistant_set_page_type(aGtkAssistant *, aGtkWidget *, int);
+extern (C) void gtk_assistant_set_forward_page_func(aGtkAssistant *, _BCD_func__11971, void *, _BCD_func__13158);
+extern (C) int gtk_assistant_insert_page(aGtkAssistant *, aGtkWidget *, int);
+extern (C) int gtk_assistant_append_page(aGtkAssistant *, aGtkWidget *);
+extern (C) int gtk_assistant_prepend_page(aGtkAssistant *, aGtkWidget *);
+extern (C) _GtkWidget * gtk_assistant_get_nth_page(aGtkAssistant *, int);
+extern (C) int gtk_assistant_get_n_pages(aGtkAssistant *);
+extern (C) void gtk_assistant_set_current_page(aGtkAssistant *, int);
+extern (C) int gtk_assistant_get_current_page(aGtkAssistant *);
+extern (C) _GtkWidget * gtk_assistant_new();
+extern (C) uint gtk_assistant_get_type();
+extern (C) void gtk_aspect_frame_set(aGtkAspectFrame *, float, float, float, int);
+extern (C) _GtkWidget * gtk_aspect_frame_new(char *, float, float, float, int);
+extern (C) uint gtk_aspect_frame_get_type();
+extern (C) int gtk_frame_get_shadow_type(aGtkFrame *);
+extern (C) void gtk_frame_set_shadow_type(aGtkFrame *, int);
+extern (C) void gtk_frame_get_label_align(aGtkFrame *, float *, float *);
+extern (C) void gtk_frame_set_label_align(aGtkFrame *, float, float);
+extern (C) _GtkWidget * gtk_frame_get_label_widget(aGtkFrame *);
+extern (C) void gtk_frame_set_label_widget(aGtkFrame *, aGtkWidget *);
+extern (C) char * gtk_frame_get_label(aGtkFrame *);
+extern (C) void gtk_frame_set_label(aGtkFrame *, char *);
+extern (C) _GtkWidget * gtk_frame_new(char *);
+extern (C) uint gtk_frame_get_type();
+extern (C) void gtk_arrow_set(aGtkArrow *, int, int);
+extern (C) _GtkWidget * gtk_arrow_new(int, int);
+extern (C) uint gtk_arrow_get_type();
+extern (C) void gtk_alignment_get_padding(aGtkAlignment *, uint *, uint *, uint *, uint *);
+extern (C) void gtk_alignment_set_padding(aGtkAlignment *, uint, uint, uint, uint);
+extern (C) void gtk_alignment_set(aGtkAlignment *, float, float, float, float);
+extern (C) _GtkWidget * gtk_alignment_new(float, float, float, float);
+extern (C) uint gtk_alignment_get_type();
+extern (C) void _gtk_action_group_emit_post_activate(aGtkActionGroup *, aGtkAction *);
+extern (C) void _gtk_action_group_emit_pre_activate(aGtkActionGroup *, aGtkAction *);
+extern (C) void _gtk_action_group_emit_disconnect_proxy(aGtkActionGroup *, aGtkAction *, aGtkWidget *);
+extern (C) void _gtk_action_group_emit_connect_proxy(aGtkActionGroup *, aGtkAction *, aGtkWidget *);
+extern (C) char * gtk_action_group_translate_string(aGtkActionGroup *, char *);
+extern (C) void gtk_action_group_set_translation_domain(aGtkActionGroup *, char *);
+extern (C) void gtk_action_group_set_translate_func(aGtkActionGroup *, _BCD_func__12124, void *, _BCD_func__13158);
+extern (C) void gtk_action_group_add_radio_actions_full(aGtkActionGroup *, aGtkRadioActionEntry *, uint, int, _BCD_func__12122, void *, _BCD_func__13158);
+extern (C) void gtk_action_group_add_toggle_actions_full(aGtkActionGroup *, aGtkToggleActionEntry *, uint, void *, _BCD_func__13158);
+extern (C) void gtk_action_group_add_actions_full(aGtkActionGroup *, aGtkActionEntry *, uint, void *, _BCD_func__13158);
+extern (C) void gtk_action_group_add_radio_actions(aGtkActionGroup *, aGtkRadioActionEntry *, uint, int, _BCD_func__12122, void *);
+extern (C) void gtk_action_group_add_toggle_actions(aGtkActionGroup *, aGtkToggleActionEntry *, uint, void *);
+extern (C) void gtk_action_group_add_actions(aGtkActionGroup *, aGtkActionEntry *, uint, void *);
+extern (C) void gtk_action_group_remove_action(aGtkActionGroup *, aGtkAction *);
+extern (C) void gtk_action_group_add_action_with_accel(aGtkActionGroup *, aGtkAction *, char *);
+extern (C) void gtk_action_group_add_action(aGtkActionGroup *, aGtkAction *);
+extern (C) _GList * gtk_action_group_list_actions(aGtkActionGroup *);
+extern (C) _GtkAction * gtk_action_group_get_action(aGtkActionGroup *, char *);
+extern (C) void gtk_action_group_set_visible(aGtkActionGroup *, int);
+extern (C) int gtk_action_group_get_visible(aGtkActionGroup *);
+extern (C) void gtk_action_group_set_sensitive(aGtkActionGroup *, int);
+extern (C) int gtk_action_group_get_sensitive(aGtkActionGroup *);
+extern (C) char * gtk_action_group_get_name(aGtkActionGroup *);
+extern (C) _GtkActionGroup * gtk_action_group_new(char *);
+extern (C) uint gtk_action_group_get_type();
+extern (C) void gtk_item_factories_path_delete(char *, char *);
+extern (C) void gtk_item_factory_create_menu_entries(uint, GtkMenuEntry *);
+extern (C) _GtkItemFactory * gtk_item_factory_from_path(char *);
+extern (C) void gtk_item_factory_create_items_ac(aGtkItemFactory *, uint, aGtkItemFactoryEntry *, void *, uint);
+extern (C) void gtk_item_factory_set_translate_func(aGtkItemFactory *, _BCD_func__12124, void *, _BCD_func__13158);
+extern (C) void * gtk_item_factory_popup_data_from_widget(aGtkWidget *);
+extern (C) void * gtk_item_factory_popup_data(aGtkItemFactory *);
+extern (C) void gtk_item_factory_popup_with_data(aGtkItemFactory *, void *, _BCD_func__13158, uint, uint, uint, uint);
+extern (C) void gtk_item_factory_popup(aGtkItemFactory *, uint, uint, uint, uint);
+extern (C) void gtk_item_factory_delete_entries(aGtkItemFactory *, uint, aGtkItemFactoryEntry *);
+extern (C) void gtk_item_factory_delete_entry(aGtkItemFactory *, aGtkItemFactoryEntry *);
+extern (C) void gtk_item_factory_delete_item(aGtkItemFactory *, char *);
+extern (C) void gtk_item_factory_create_items(aGtkItemFactory *, uint, aGtkItemFactoryEntry *, void *);
+extern (C) void gtk_item_factory_create_item(aGtkItemFactory *, aGtkItemFactoryEntry *, void *, uint);
+extern (C) _GtkWidget * gtk_item_factory_get_item_by_action(aGtkItemFactory *, uint);
+extern (C) _GtkWidget * gtk_item_factory_get_widget_by_action(aGtkItemFactory *, uint);
+extern (C) _GtkWidget * gtk_item_factory_get_widget(aGtkItemFactory *, char *);
+extern (C) _GtkWidget * gtk_item_factory_get_item(aGtkItemFactory *, char *);
+extern (C) char * gtk_item_factory_path_from_widget(aGtkWidget *);
+extern (C) _GtkItemFactory * gtk_item_factory_from_widget(aGtkWidget *);
+extern (C) void gtk_item_factory_add_foreign(aGtkWidget *, char *, aGtkAccelGroup *, uint, int);
+extern (C) void gtk_item_factory_construct(aGtkItemFactory *, uint, char *, aGtkAccelGroup *);
+extern (C) _GtkItemFactory * gtk_item_factory_new(uint, char *, aGtkAccelGroup *);
+extern (C) uint gtk_item_factory_get_type();
+extern (C) void _gtk_action_sync_menu_visible(aGtkAction *, aGtkWidget *, int);
+extern (C) void _gtk_action_sync_visible(aGtkAction *);
+extern (C) void _gtk_action_sync_sensitive(aGtkAction *);
+extern (C) void gtk_action_set_accel_group(aGtkAction *, aGtkAccelGroup *);
+extern (C) void gtk_action_set_accel_path(aGtkAction *, char *);
+extern (C) void _gtk_action_emit_activate(aGtkAction *);
+extern (C) void gtk_action_unblock_activate_from(aGtkAction *, aGtkWidget *);
+extern (C) void gtk_action_block_activate_from(aGtkAction *, aGtkWidget *);
+extern (C) _GClosure * gtk_action_get_accel_closure(aGtkAction *);
+extern (C) char * gtk_action_get_accel_path(aGtkAction *);
+extern (C) void gtk_action_disconnect_accelerator(aGtkAction *);
+extern (C) void gtk_action_connect_accelerator(aGtkAction *);
+extern (C) _GtkAction * gtk_widget_get_action(aGtkWidget *);
+extern (C) _GSList * gtk_action_get_proxies(aGtkAction *);
+extern (C) void gtk_action_disconnect_proxy(aGtkAction *, aGtkWidget *);
+extern (C) void gtk_action_connect_proxy(aGtkAction *, aGtkWidget *);
+extern (C) _GtkWidget * gtk_action_create_menu(aGtkAction *);
+extern (C) _GtkWidget * gtk_action_create_tool_item(aGtkAction *);
+extern (C) _GtkWidget * gtk_action_create_menu_item(aGtkAction *);
+extern (C) _GtkWidget * gtk_action_create_icon(aGtkAction *, int);
+extern (C) void gtk_action_activate(aGtkAction *);
+extern (C) void gtk_action_set_visible(aGtkAction *, int);
+extern (C) int gtk_action_get_visible(aGtkAction *);
+extern (C) int gtk_action_is_visible(aGtkAction *);
+extern (C) void gtk_action_set_sensitive(aGtkAction *, int);
+extern (C) int gtk_action_get_sensitive(aGtkAction *);
+extern (C) int gtk_action_is_sensitive(aGtkAction *);
+extern (C) char * gtk_action_get_name(aGtkAction *);
+extern (C) _GtkAction * gtk_action_new(char *, char *, char *, char *);
+extern (C) uint gtk_action_get_type();
+extern (C) void gtk_accessible_connect_widget_destroyed(aGtkAccessible *);
+extern (C) uint gtk_accessible_get_type();
+extern (C) int _gtk_accel_path_is_valid(char *);
+extern (C) void _gtk_accel_map_remove_group(char *, aGtkAccelGroup *);
+extern (C) void _gtk_accel_map_add_group(char *, aGtkAccelGroup *);
+extern (C) void _gtk_accel_map_init();
+extern (C) void * gtk_accel_map_get();
+extern (C) uint gtk_accel_map_get_type();
+extern (C) void gtk_accel_map_foreach_unfiltered(void *, _BCD_func__12490);
+extern (C) void gtk_accel_map_add_filter(char *);
+extern (C) void gtk_accel_map_unlock_path(char *);
+extern (C) void gtk_accel_map_lock_path(char *);
+extern (C) void gtk_accel_map_save_fd(int);
+extern (C) void gtk_accel_map_load_scanner(_GScanner *);
+extern (C) void gtk_accel_map_load_fd(int);
+extern (C) void gtk_accel_map_foreach(void *, _BCD_func__12490);
+extern (C) void gtk_accel_map_save(char *);
+extern (C) void gtk_accel_map_load(char *);
+extern (C) int gtk_accel_map_change_entry(char *, uint, int, int);
+extern (C) int gtk_accel_map_lookup_entry(char *, aGtkAccelKey *);
+extern (C) void gtk_accel_map_add_entry(char *, uint, int);
+extern (C) char * _gtk_accel_label_class_get_accelerator_label(aGtkAccelLabelClass *, uint, int);
+extern (C) int gtk_accel_label_refetch(aGtkAccelLabel *);
+extern (C) void gtk_accel_label_set_accel_closure(aGtkAccelLabel *, _GClosure *);
+extern (C) void gtk_accel_label_set_accel_widget(aGtkAccelLabel *, aGtkWidget *);
+extern (C) uint gtk_accel_label_get_accel_width(aGtkAccelLabel *);
+extern (C) _GtkWidget * gtk_accel_label_get_accel_widget(aGtkAccelLabel *);
+extern (C) _GtkWidget * gtk_accel_label_new(char *);
+extern (C) uint gtk_accel_label_get_type();
+extern (C) uint gtk_label_parse_uline(aGtkLabel *, char *);
+extern (C) void gtk_label_get(aGtkLabel *, char * *);
+extern (C) int gtk_label_get_single_line_mode(aGtkLabel *);
+extern (C) void gtk_label_set_single_line_mode(aGtkLabel *, int);
+extern (C) void gtk_label_get_layout_offsets(aGtkLabel *, int *, int *);
+extern (C) void * gtk_label_get_layout(aGtkLabel *);
+extern (C) int gtk_label_get_selection_bounds(aGtkLabel *, int *, int *);
+extern (C) void gtk_label_select_region(aGtkLabel *, int, int);
+extern (C) double gtk_label_get_angle(aGtkLabel *);
+extern (C) void gtk_label_set_angle(aGtkLabel *, double);
+extern (C) int gtk_label_get_selectable(aGtkLabel *);
+extern (C) void gtk_label_set_selectable(aGtkLabel *, int);
+extern (C) int gtk_label_get_line_wrap_mode(aGtkLabel *);
+extern (C) void gtk_label_set_line_wrap_mode(aGtkLabel *, int);
+extern (C) int gtk_label_get_line_wrap(aGtkLabel *);
+extern (C) void gtk_label_set_line_wrap(aGtkLabel *, int);
+extern (C) void gtk_label_set_pattern(aGtkLabel *, char *);
+extern (C) int gtk_label_get_max_width_chars(aGtkLabel *);
+extern (C) void gtk_label_set_max_width_chars(aGtkLabel *, int);
+extern (C) int gtk_label_get_width_chars(aGtkLabel *);
+extern (C) void gtk_label_set_width_chars(aGtkLabel *, int);
+extern (C) int gtk_label_get_ellipsize(aGtkLabel *);
+extern (C) void gtk_label_set_ellipsize(aGtkLabel *, int);
+extern (C) int gtk_label_get_justify(aGtkLabel *);
+extern (C) void gtk_label_set_justify(aGtkLabel *, int);
+extern (C) void gtk_label_set_text_with_mnemonic(aGtkLabel *, char *);
+extern (C) _GtkWidget * gtk_label_get_mnemonic_widget(aGtkLabel *);
+extern (C) void gtk_label_set_mnemonic_widget(aGtkLabel *, aGtkWidget *);
+extern (C) uint gtk_label_get_mnemonic_keyval(aGtkLabel *);
+extern (C) void gtk_label_set_markup_with_mnemonic(aGtkLabel *, char *);
+extern (C) int gtk_label_get_use_underline(aGtkLabel *);
+extern (C) void gtk_label_set_use_underline(aGtkLabel *, int);
+extern (C) int gtk_label_get_use_markup(aGtkLabel *);
+extern (C) void gtk_label_set_use_markup(aGtkLabel *, int);
+extern (C) void gtk_label_set_markup(aGtkLabel *, char *);
+extern (C) char * gtk_label_get_label(aGtkLabel *);
+extern (C) void gtk_label_set_label(aGtkLabel *, char *);
+extern (C) void * gtk_label_get_attributes(aGtkLabel *);
+extern (C) void gtk_label_set_attributes(aGtkLabel *, void *);
+extern (C) char * gtk_label_get_text(aGtkLabel *);
+extern (C) void gtk_label_set_text(aGtkLabel *, char *);
+extern (C) _GtkWidget * gtk_label_new_with_mnemonic(char *);
+extern (C) _GtkWidget * gtk_label_new(char *);
+extern (C) uint gtk_label_get_type();
+extern (C) _GList * gtk_menu_get_for_attach_widget(aGtkWidget *);
+extern (C) void gtk_menu_set_monitor(aGtkMenu *, int);
+extern (C) void gtk_menu_attach(aGtkMenu *, aGtkWidget *, uint, uint, uint, uint);
+extern (C) void gtk_menu_set_screen(aGtkMenu *, _GdkScreen *);
+extern (C) void gtk_menu_reorder_child(aGtkMenu *, aGtkWidget *, int);
+extern (C) char * gtk_menu_get_title(aGtkMenu *);
+extern (C) void gtk_menu_set_title(aGtkMenu *, char *);
+extern (C) int gtk_menu_get_tearoff_state(aGtkMenu *);
+extern (C) void gtk_menu_set_tearoff_state(aGtkMenu *, int);
+extern (C) _GtkWidget * gtk_menu_get_attach_widget(aGtkMenu *);
+extern (C) void gtk_menu_detach(aGtkMenu *);
+extern (C) void gtk_menu_attach_to_widget(aGtkMenu *, aGtkWidget *, _BCD_func__12552);
+extern (C) void gtk_menu_set_accel_path(aGtkMenu *, char *);
+extern (C) _GtkAccelGroup * gtk_menu_get_accel_group(aGtkMenu *);
+extern (C) void gtk_menu_set_accel_group(aGtkMenu *, aGtkAccelGroup *);
+extern (C) void gtk_menu_set_active(aGtkMenu *, uint);
+extern (C) _GtkWidget * gtk_menu_get_active(aGtkMenu *);
+extern (C) void gtk_menu_popdown(aGtkMenu *);
+extern (C) void gtk_menu_reposition(aGtkMenu *);
+extern (C) void gtk_menu_popup(aGtkMenu *, aGtkWidget *, aGtkWidget *, _BCD_func__12553, void *, uint, uint);
+extern (C) _GtkWidget * gtk_menu_new();
+extern (C) uint gtk_menu_get_type();
+extern (C) void gtk_menu_shell_set_take_focus(aGtkMenuShell *, int);
+extern (C) int gtk_menu_shell_get_take_focus(aGtkMenuShell *);
+extern (C) void _gtk_menu_shell_remove_mnemonic(aGtkMenuShell *, uint, aGtkWidget *);
+extern (C) void _gtk_menu_shell_add_mnemonic(aGtkMenuShell *, uint, aGtkWidget *);
+extern (C) void gtk_menu_shell_cancel(aGtkMenuShell *);
+extern (C) int _gtk_menu_shell_get_popup_delay(aGtkMenuShell *);
+extern (C) void _gtk_menu_shell_activate(aGtkMenuShell *);
+extern (C) void _gtk_menu_shell_select_last(aGtkMenuShell *, int);
+extern (C) void gtk_menu_shell_select_first(aGtkMenuShell *, int);
+extern (C) void gtk_menu_shell_activate_item(aGtkMenuShell *, aGtkWidget *, int);
+extern (C) void gtk_menu_shell_deselect(aGtkMenuShell *);
+extern (C) void gtk_menu_shell_select_item(aGtkMenuShell *, aGtkWidget *);
+extern (C) void gtk_menu_shell_deactivate(aGtkMenuShell *);
+extern (C) void gtk_menu_shell_insert(aGtkMenuShell *, aGtkWidget *, int);
+extern (C) void gtk_menu_shell_prepend(aGtkMenuShell *, aGtkWidget *);
+extern (C) void gtk_menu_shell_append(aGtkMenuShell *, aGtkWidget *);
+extern (C) uint gtk_menu_shell_get_type();
+extern (C) void gtk_misc_get_padding(aGtkMisc *, int *, int *);
+extern (C) void gtk_misc_set_padding(aGtkMisc *, int, int);
+extern (C) void gtk_misc_get_alignment(aGtkMisc *, float *, float *);
+extern (C) void gtk_misc_set_alignment(aGtkMisc *, float, float);
+extern (C) uint gtk_misc_get_type();
+extern (C) _BCD_func__12632 gtk_about_dialog_set_url_hook(_BCD_func__12632, void *, _BCD_func__13158);
+extern (C) _BCD_func__12632 gtk_about_dialog_set_email_hook(_BCD_func__12632, void *, _BCD_func__13158);
+extern (C) void gtk_about_dialog_set_logo_icon_name(aGtkAboutDialog *, char *);
+extern (C) char * gtk_about_dialog_get_logo_icon_name(aGtkAboutDialog *);
+extern (C) void gtk_about_dialog_set_logo(aGtkAboutDialog *, void *);
+extern (C) void * gtk_about_dialog_get_logo(aGtkAboutDialog *);
+extern (C) void gtk_about_dialog_set_translator_credits(aGtkAboutDialog *, char *);
+extern (C) char * gtk_about_dialog_get_translator_credits(aGtkAboutDialog *);
+extern (C) void gtk_about_dialog_set_artists(aGtkAboutDialog *, char * *);
+extern (C) char * * gtk_about_dialog_get_artists(aGtkAboutDialog *);
+extern (C) void gtk_about_dialog_set_documenters(aGtkAboutDialog *, char * *);
+extern (C) char * * gtk_about_dialog_get_documenters(aGtkAboutDialog *);
+extern (C) void gtk_about_dialog_set_authors(aGtkAboutDialog *, char * *);
+extern (C) char * * gtk_about_dialog_get_authors(aGtkAboutDialog *);
+extern (C) void gtk_about_dialog_set_website_label(aGtkAboutDialog *, char *);
+extern (C) char * gtk_about_dialog_get_website_label(aGtkAboutDialog *);
+extern (C) void gtk_about_dialog_set_website(aGtkAboutDialog *, char *);
+extern (C) char * gtk_about_dialog_get_website(aGtkAboutDialog *);
+extern (C) void gtk_about_dialog_set_wrap_license(aGtkAboutDialog *, int);
+extern (C) int gtk_about_dialog_get_wrap_license(aGtkAboutDialog *);
+extern (C) void gtk_about_dialog_set_license(aGtkAboutDialog *, char *);
+extern (C) char * gtk_about_dialog_get_license(aGtkAboutDialog *);
+extern (C) void gtk_about_dialog_set_comments(aGtkAboutDialog *, char *);
+extern (C) char * gtk_about_dialog_get_comments(aGtkAboutDialog *);
+extern (C) void gtk_about_dialog_set_copyright(aGtkAboutDialog *, char *);
+extern (C) char * gtk_about_dialog_get_copyright(aGtkAboutDialog *);
+extern (C) void gtk_about_dialog_set_version(aGtkAboutDialog *, char *);
+extern (C) char * gtk_about_dialog_get_version(aGtkAboutDialog *);
+extern (C) void gtk_about_dialog_set_program_name(aGtkAboutDialog *, char *);
+extern (C) char * gtk_about_dialog_get_program_name(aGtkAboutDialog *);
+extern (C) void gtk_about_dialog_set_name(aGtkAboutDialog *, char *);
+extern (C) char * gtk_about_dialog_get_name(aGtkAboutDialog *);
+extern (C) void gtk_show_about_dialog(aGtkWindow *, char *, ...);
+extern (C) _GtkWidget * gtk_about_dialog_new();
+extern (C) uint gtk_about_dialog_get_type();
+extern (C) void _gtk_dialog_set_ignore_separator(aGtkDialog *, int);
+extern (C) int gtk_dialog_run(aGtkDialog *);
+extern (C) void gtk_dialog_response(aGtkDialog *, int);
+extern (C) void gtk_dialog_set_alternative_button_order_from_array(aGtkDialog *, int, int *);
+extern (C) void gtk_dialog_set_alternative_button_order(aGtkDialog *, int, ...);
+extern (C) int gtk_alternative_dialog_button_order(_GdkScreen *);
+extern (C) int gtk_dialog_get_has_separator(aGtkDialog *);
+extern (C) void gtk_dialog_set_has_separator(aGtkDialog *, int);
+extern (C) int gtk_dialog_get_response_for_widget(aGtkDialog *, aGtkWidget *);
+extern (C) void gtk_dialog_set_default_response(aGtkDialog *, int);
+extern (C) void gtk_dialog_set_response_sensitive(aGtkDialog *, int, int);
+extern (C) void gtk_dialog_add_buttons(aGtkDialog *, char *, ...);
+extern (C) _GtkWidget * gtk_dialog_add_button(aGtkDialog *, char *, int);
+extern (C) void gtk_dialog_add_action_widget(aGtkDialog *, aGtkWidget *, int);
+extern (C) _GtkWidget * gtk_dialog_new_with_buttons(char *, aGtkWindow *, int, char *, ...);
+extern (C) _GtkWidget * gtk_dialog_new();
+extern (C) uint gtk_dialog_get_type();
+extern (C) int _gtk_window_query_nonaccels(aGtkWindow *, uint, int);
+extern (C) void _gtk_window_keys_foreach(aGtkWindow *, _BCD_func__12662, void *);
+extern (C) void _gtk_window_set_is_active(aGtkWindow *, int);
+extern (C) void _gtk_window_unset_focus_and_default(aGtkWindow *, aGtkWidget *);
+extern (C) void _gtk_window_set_has_toplevel_focus(aGtkWindow *, int);
+extern (C) _GtkWidget * _gtk_window_group_get_current_grab(aGtkWindowGroup *);
+extern (C) void _gtk_window_constrain_size(aGtkWindow *, int, int, int *, int *);
+extern (C) void _gtk_window_reposition(aGtkWindow *, int, int);
+extern (C) void gtk_window_add_embedded_xid(aGtkWindow *, uint);
+extern (C) void gtk_window_remove_embedded_xid(aGtkWindow *, uint);
+extern (C) void _gtk_window_internal_set_focus(aGtkWindow *, aGtkWidget *);
+extern (C) void gtk_window_group_remove_window(aGtkWindowGroup *, aGtkWindow *);
+extern (C) void gtk_window_group_add_window(aGtkWindowGroup *, aGtkWindow *);
+extern (C) _GtkWindowGroup * gtk_window_group_new();
+extern (C) uint gtk_window_group_get_type();
+extern (C) void gtk_window_reshow_with_initial_size(aGtkWindow *);
+extern (C) _GtkWindowGroup * gtk_window_get_group(aGtkWindow *);
+extern (C) int gtk_window_parse_geometry(aGtkWindow *, char *);
+extern (C) void gtk_window_get_position(aGtkWindow *, int *, int *);
+extern (C) void gtk_window_move(aGtkWindow *, int, int);
+extern (C) void gtk_window_get_size(aGtkWindow *, int *, int *);
+extern (C) void gtk_window_resize(aGtkWindow *, int, int);
+extern (C) void gtk_window_get_default_size(aGtkWindow *, int *, int *);
+extern (C) void gtk_window_set_default_size(aGtkWindow *, int, int);
+extern (C) void gtk_window_set_policy(aGtkWindow *, int, int, int);
+extern (C) void gtk_window_begin_move_drag(aGtkWindow *, int, int, int, uint);
+extern (C) void gtk_window_begin_resize_drag(aGtkWindow *, int, int, int, int, uint);
+extern (C) void gtk_window_set_keep_below(aGtkWindow *, int);
+extern (C) void gtk_window_set_keep_above(aGtkWindow *, int);
+extern (C) void gtk_window_unfullscreen(aGtkWindow *);
+extern (C) void gtk_window_fullscreen(aGtkWindow *);
+extern (C) void gtk_window_unmaximize(aGtkWindow *);
+extern (C) void gtk_window_maximize(aGtkWindow *);
+extern (C) void gtk_window_unstick(aGtkWindow *);
+extern (C) void gtk_window_stick(aGtkWindow *);
+extern (C) void gtk_window_deiconify(aGtkWindow *);
+extern (C) void gtk_window_iconify(aGtkWindow *);
+extern (C) void gtk_window_present_with_time(aGtkWindow *, uint);
+extern (C) void gtk_window_present(aGtkWindow *);
+extern (C) int gtk_window_propagate_key_event(aGtkWindow *, _GdkEventKey *);
+extern (C) int gtk_window_activate_key(aGtkWindow *, _GdkEventKey *);
+extern (C) int gtk_window_get_mnemonic_modifier(aGtkWindow *);
+extern (C) void gtk_window_set_mnemonic_modifier(aGtkWindow *, int);
+extern (C) int gtk_window_mnemonic_activate(aGtkWindow *, uint, int);
+extern (C) void gtk_window_remove_mnemonic(aGtkWindow *, uint, aGtkWidget *);
+extern (C) void gtk_window_add_mnemonic(aGtkWindow *, uint, aGtkWidget *);
+extern (C) _GList * gtk_window_list_toplevels();
+extern (C) int gtk_window_get_modal(aGtkWindow *);
+extern (C) void gtk_window_set_modal(aGtkWindow *, int);
+extern (C) void gtk_window_set_auto_startup_notification(int);
+extern (C) int gtk_window_set_default_icon_from_file(char *, _GError * *);
+extern (C) void gtk_window_set_default_icon_name(char *);
+extern (C) void gtk_window_set_default_icon(void *);
+extern (C) _GList * gtk_window_get_default_icon_list();
+extern (C) void gtk_window_set_default_icon_list(_GList *);
+extern (C) char * gtk_window_get_icon_name(aGtkWindow *);
+extern (C) void * gtk_window_get_icon(aGtkWindow *);
+extern (C) int gtk_window_set_icon_from_file(aGtkWindow *, char *, _GError * *);
+extern (C) void gtk_window_set_icon_name(aGtkWindow *, char *);
+extern (C) void gtk_window_set_icon(aGtkWindow *, void *);
+extern (C) _GList * gtk_window_get_icon_list(aGtkWindow *);
+extern (C) void gtk_window_set_icon_list(aGtkWindow *, _GList *);
+extern (C) int gtk_window_get_deletable(aGtkWindow *);
+extern (C) void gtk_window_set_deletable(aGtkWindow *, int);
+extern (C) int gtk_window_get_decorated(aGtkWindow *);
+extern (C) void gtk_window_set_decorated(aGtkWindow *, int);
+extern (C) void gtk_window_get_frame_dimensions(aGtkWindow *, int *, int *, int *, int *);
+extern (C) void gtk_window_set_frame_dimensions(aGtkWindow *, int, int, int, int);
+extern (C) int gtk_window_get_has_frame(aGtkWindow *);
+extern (C) void gtk_window_set_has_frame(aGtkWindow *, int);
+extern (C) int gtk_window_has_toplevel_focus(aGtkWindow *);
+extern (C) int gtk_window_is_active(aGtkWindow *);
+extern (C) _GdkScreen * gtk_window_get_screen(aGtkWindow *);
+extern (C) void gtk_window_set_screen(aGtkWindow *, _GdkScreen *);
+extern (C) void gtk_window_set_geometry_hints(aGtkWindow *, aGtkWidget *, _GdkGeometry *, int);
+extern (C) int gtk_window_get_gravity(aGtkWindow *);
+extern (C) void gtk_window_set_gravity(aGtkWindow *, int);
+extern (C) int gtk_window_get_resizable(aGtkWindow *);
+extern (C) void gtk_window_set_resizable(aGtkWindow *, int);
+extern (C) int gtk_window_get_destroy_with_parent(aGtkWindow *);
+extern (C) void gtk_window_set_destroy_with_parent(aGtkWindow *, int);
+extern (C) int gtk_window_get_focus_on_map(aGtkWindow *);
+extern (C) void gtk_window_set_focus_on_map(aGtkWindow *, int);
+extern (C) int gtk_window_get_accept_focus(aGtkWindow *);
+extern (C) void gtk_window_set_accept_focus(aGtkWindow *, int);
+extern (C) int gtk_window_get_urgency_hint(aGtkWindow *);
+extern (C) void gtk_window_set_urgency_hint(aGtkWindow *, int);
+extern (C) int gtk_window_get_skip_pager_hint(aGtkWindow *);
+extern (C) void gtk_window_set_skip_pager_hint(aGtkWindow *, int);
+extern (C) int gtk_window_get_skip_taskbar_hint(aGtkWindow *);
+extern (C) void gtk_window_set_skip_taskbar_hint(aGtkWindow *, int);
+extern (C) int gtk_window_get_type_hint(aGtkWindow *);
+extern (C) void gtk_window_set_type_hint(aGtkWindow *, int);
+extern (C) double gtk_window_get_opacity(aGtkWindow *);
+extern (C) void gtk_window_set_opacity(aGtkWindow *, double);
+extern (C) _GtkWindow * gtk_window_get_transient_for(aGtkWindow *);
+extern (C) void gtk_window_set_transient_for(aGtkWindow *, aGtkWindow *);
+extern (C) int gtk_window_activate_default(aGtkWindow *);
+extern (C) void gtk_window_set_default(aGtkWindow *, aGtkWidget *);
+extern (C) _GtkWidget * gtk_window_get_focus(aGtkWindow *);
+extern (C) void gtk_window_set_focus(aGtkWindow *, aGtkWidget *);
+extern (C) int gtk_window_activate_focus(aGtkWindow *);
+extern (C) void gtk_window_set_position(aGtkWindow *, int);
+extern (C) void gtk_window_remove_accel_group(aGtkWindow *, aGtkAccelGroup *);
+extern (C) void gtk_window_add_accel_group(aGtkWindow *, aGtkAccelGroup *);
+extern (C) char * gtk_window_get_role(aGtkWindow *);
+extern (C) void gtk_window_set_startup_id(aGtkWindow *, char *);
+extern (C) void gtk_window_set_role(aGtkWindow *, char *);
+extern (C) void gtk_window_set_wmclass(aGtkWindow *, char *, char *);
+extern (C) char * gtk_window_get_title(aGtkWindow *);
+extern (C) void gtk_window_set_title(aGtkWindow *, char *);
+extern (C) _GtkWidget * gtk_window_new(int);
+extern (C) uint gtk_window_get_type();
+extern (C) _GtkWidget * gtk_bin_get_child(aGtkBin *);
+extern (C) uint gtk_bin_get_type();
+extern (C) _GList * _gtk_container_focus_sort(aGtkContainer *, _GList *, int, aGtkWidget *);
+extern (C) void _gtk_container_dequeue_resize_handler(aGtkContainer *);
+extern (C) char * _gtk_container_child_composite_name(aGtkContainer *, aGtkWidget *);
+extern (C) void _gtk_container_clear_resize_widgets(aGtkContainer *);
+extern (C) void _gtk_container_queue_resize(aGtkContainer *);
+extern (C) void gtk_container_forall(aGtkContainer *, _BCD_func__12090, void *);
+extern (C) void gtk_container_child_get_property(aGtkContainer *, aGtkWidget *, char *, _GValue *);
+extern (C) void gtk_container_child_set_property(aGtkContainer *, aGtkWidget *, char *, _GValue *);
+extern (C) void gtk_container_child_get_valist(aGtkContainer *, aGtkWidget *, char *, char *);
+extern (C) void gtk_container_child_set_valist(aGtkContainer *, aGtkWidget *, char *, char *);
+extern (C) void gtk_container_child_get(aGtkContainer *, aGtkWidget *, char *, ...);
+extern (C) void gtk_container_child_set(aGtkContainer *, aGtkWidget *, char *, ...);
+extern (C) void gtk_container_add_with_properties(aGtkContainer *, aGtkWidget *, char *, ...);
+extern (C) _GParamSpec * * gtk_container_class_list_child_properties(_GObjectClass *, uint *);
+extern (C) _GParamSpec * gtk_container_class_find_child_property(_GObjectClass *, char *);
+extern (C) void gtk_container_class_install_child_property(aGtkContainerClass *, uint, _GParamSpec *);
+extern (C) uint gtk_container_child_type(aGtkContainer *);
+extern (C) void gtk_container_resize_children(aGtkContainer *);
+extern (C) _GtkAdjustment * gtk_container_get_focus_hadjustment(aGtkContainer *);
+extern (C) void gtk_container_set_focus_hadjustment(aGtkContainer *, aGtkAdjustment *);
+extern (C) _GtkAdjustment * gtk_container_get_focus_vadjustment(aGtkContainer *);
+extern (C) void gtk_container_set_focus_vadjustment(aGtkContainer *, aGtkAdjustment *);
+extern (C) void gtk_container_set_focus_child(aGtkContainer *, aGtkWidget *);
+extern (C) void gtk_container_set_reallocate_redraws(aGtkContainer *, int);
+extern (C) void gtk_container_unset_focus_chain(aGtkContainer *);
+extern (C) int gtk_container_get_focus_chain(aGtkContainer *, _GList * *);
+extern (C) void gtk_container_set_focus_chain(aGtkContainer *, _GList *);
+extern (C) void gtk_container_propagate_expose(aGtkContainer *, aGtkWidget *, _GdkEventExpose *);
+extern (C) _GList * gtk_container_get_children(aGtkContainer *);
+extern (C) void gtk_container_foreach_full(aGtkContainer *, _BCD_func__12090, _BCD_func__13157, void *, _BCD_func__13158);
+extern (C) void gtk_container_foreach(aGtkContainer *, _BCD_func__12090, void *);
+extern (C) void gtk_container_check_resize(aGtkContainer *);
+extern (C) int gtk_container_get_resize_mode(aGtkContainer *);
+extern (C) void gtk_container_set_resize_mode(aGtkContainer *, int);
+extern (C) void gtk_container_remove(aGtkContainer *, aGtkWidget *);
+extern (C) void gtk_container_add(aGtkContainer *, aGtkWidget *);
+extern (C) uint gtk_container_get_border_width(aGtkContainer *);
+extern (C) void gtk_container_set_border_width(aGtkContainer *, uint);
+extern (C) uint gtk_container_get_type();
+extern (C) _GdkColormap * _gtk_widget_peek_colormap();
+extern (C) void _gtk_widget_propagate_composited_changed(aGtkWidget *);
+extern (C) void _gtk_widget_propagate_screen_changed(aGtkWidget *, _GdkScreen *);
+extern (C) void _gtk_widget_propagate_hierarchy_changed(aGtkWidget *, aGtkWidget *);
+extern (C) _GtkWidgetAuxInfo * _gtk_widget_get_aux_info(aGtkWidget *, int);
+extern (C) void _gtk_widget_grab_notify(aGtkWidget *, int);
+extern (C) void gtk_requisition_free(aGtkRequisition *);
+extern (C) _GtkRequisition * gtk_requisition_copy(aGtkRequisition *);
+extern (C) uint gtk_requisition_get_type();
+extern (C) int gtk_widget_get_has_tooltip(aGtkWidget *);
+extern (C) void gtk_widget_set_has_tooltip(aGtkWidget *, int);
+extern (C) char * gtk_widget_get_tooltip_markup(aGtkWidget *);
+extern (C) void gtk_widget_set_tooltip_markup(aGtkWidget *, char *);
+extern (C) char * gtk_widget_get_tooltip_text(aGtkWidget *);
+extern (C) void gtk_widget_set_tooltip_text(aGtkWidget *, char *);
+extern (C) void gtk_widget_trigger_tooltip_query(aGtkWidget *);
+extern (C) _GtkWindow * gtk_widget_get_tooltip_window(aGtkWidget *);
+extern (C) void gtk_widget_set_tooltip_window(aGtkWidget *, aGtkWindow *);
+extern (C) void gtk_widget_remove_mnemonic_label(aGtkWidget *, aGtkWidget *);
+extern (C) void gtk_widget_add_mnemonic_label(aGtkWidget *, aGtkWidget *);
+extern (C) _GList * gtk_widget_list_mnemonic_labels(aGtkWidget *);
+extern (C) void gtk_widget_class_path(aGtkWidget *, uint *, char * *, char * *);
+extern (C) void gtk_widget_path(aGtkWidget *, uint *, char * *, char * *);
+extern (C) void gtk_widget_reset_shapes(aGtkWidget *);
+extern (C) void gtk_widget_input_shape_combine_mask(aGtkWidget *, _GdkDrawable *, int, int);
+extern (C) void gtk_widget_shape_combine_mask(aGtkWidget *, _GdkDrawable *, int, int);
+extern (C) int gtk_widget_is_composited(aGtkWidget *);
+extern (C) int gtk_widget_get_default_direction();
+extern (C) void gtk_widget_set_default_direction(int);
+extern (C) int gtk_widget_get_direction(aGtkWidget *);
+extern (C) void gtk_widget_set_direction(aGtkWidget *, int);
+extern (C) _GdkVisual * gtk_widget_get_default_visual();
+extern (C) _GdkColormap * gtk_widget_get_default_colormap();
+extern (C) _GtkStyle * gtk_widget_get_default_style();
+extern (C) void gtk_widget_set_default_colormap(_GdkColormap *);
+extern (C) void gtk_widget_style_get(aGtkWidget *, char *, ...);
+extern (C) void gtk_widget_style_get_valist(aGtkWidget *, char *, char *);
+extern (C) void gtk_widget_style_get_property(aGtkWidget *, char *, _GValue *);
+extern (C) _GParamSpec * * gtk_widget_class_list_style_properties(aGtkWidgetClass *, uint *);
+extern (C) _GParamSpec * gtk_widget_class_find_style_property(aGtkWidgetClass *, char *);
+extern (C) void gtk_widget_class_install_style_property_parser(aGtkWidgetClass *, _GParamSpec *, _BCD_func__12993);
+extern (C) void gtk_widget_class_install_style_property(aGtkWidgetClass *, _GParamSpec *);
+extern (C) void gtk_widget_pop_colormap();
+extern (C) void gtk_widget_pop_composite_child();
+extern (C) void gtk_widget_push_composite_child();
+extern (C) void gtk_widget_push_colormap(_GdkColormap *);
+extern (C) void gtk_widget_reset_rc_styles(aGtkWidget *);
+extern (C) char * gtk_widget_get_composite_name(aGtkWidget *);
+extern (C) void gtk_widget_set_composite_name(aGtkWidget *, char *);
+extern (C) void * gtk_widget_render_icon(aGtkWidget *, char *, int, char *);
+extern (C) void * gtk_widget_create_pango_layout(aGtkWidget *, char *);
+extern (C) void * gtk_widget_get_pango_context(aGtkWidget *);
+extern (C) void * gtk_widget_create_pango_context(aGtkWidget *);
+extern (C) void gtk_widget_modify_font(aGtkWidget *, void *);
+extern (C) void gtk_widget_modify_cursor(aGtkWidget *, _GdkColor *, _GdkColor *);
+extern (C) void gtk_widget_modify_base(aGtkWidget *, int, _GdkColor *);
+extern (C) void gtk_widget_modify_text(aGtkWidget *, int, _GdkColor *);
+extern (C) void gtk_widget_modify_bg(aGtkWidget *, int, _GdkColor *);
+extern (C) void gtk_widget_modify_fg(aGtkWidget *, int, _GdkColor *);
+extern (C) _GtkRcStyle * gtk_widget_get_modifier_style(aGtkWidget *);
+extern (C) void gtk_widget_modify_style(aGtkWidget *, aGtkRcStyle *);
+extern (C) _GtkStyle * gtk_widget_get_style(aGtkWidget *);
+extern (C) void gtk_widget_ensure_style(aGtkWidget *);
+extern (C) void gtk_widget_set_style(aGtkWidget *, aGtkStyle *);
+extern (C) int gtk_widget_hide_on_delete(aGtkWidget *);
+extern (C) int gtk_widget_translate_coordinates(aGtkWidget *, aGtkWidget *, int, int, int *, int *);
+extern (C) int gtk_widget_is_ancestor(aGtkWidget *, aGtkWidget *);
+extern (C) void gtk_widget_get_pointer(aGtkWidget *, int *, int *);
+extern (C) int gtk_widget_get_events(aGtkWidget *);
+extern (C) void gtk_widget_set_colormap(aGtkWidget *, _GdkColormap *);
+extern (C) _AtkObject * gtk_widget_get_accessible(aGtkWidget *);
+extern (C) void * gtk_widget_get_clipboard(aGtkWidget *, void *);
+extern (C) _GtkSettings * gtk_widget_get_settings(aGtkWidget *);
+extern (C) _GdkDrawable * gtk_widget_get_root_window(aGtkWidget *);
+extern (C) _GdkDisplay * gtk_widget_get_display(aGtkWidget *);
+extern (C) int gtk_widget_has_screen(aGtkWidget *);
+extern (C) _GdkScreen * gtk_widget_get_screen(aGtkWidget *);
+extern (C) _GdkVisual * gtk_widget_get_visual(aGtkWidget *);
+extern (C) _GdkColormap * gtk_widget_get_colormap(aGtkWidget *);
+extern (C) _GtkWidget * gtk_widget_get_ancestor(aGtkWidget *, uint);
+extern (C) _GtkWidget * gtk_widget_get_toplevel(aGtkWidget *);
+extern (C) int gtk_widget_get_extension_events(aGtkWidget *);
+extern (C) void gtk_widget_set_extension_events(aGtkWidget *, int);
+extern (C) void gtk_widget_add_events(aGtkWidget *, int);
+extern (C) void gtk_widget_set_events(aGtkWidget *, int);
+extern (C) void gtk_widget_set_usize(aGtkWidget *, int, int);
+extern (C) void gtk_widget_set_uposition(aGtkWidget *, int, int);
+extern (C) void gtk_widget_get_size_request(aGtkWidget *, int *, int *);
+extern (C) void gtk_widget_set_size_request(aGtkWidget *, int, int);
+extern (C) void gtk_widget_error_bell(aGtkWidget *);
+extern (C) int gtk_widget_keynav_failed(aGtkWidget *, int);
+extern (C) int gtk_widget_child_focus(aGtkWidget *, int);
+extern (C) _GdkDrawable * gtk_widget_get_parent_window(aGtkWidget *);
+extern (C) _GtkWidget * gtk_widget_get_parent(aGtkWidget *);
+extern (C) int gtk_widget_get_child_visible(aGtkWidget *);
+extern (C) void gtk_widget_set_child_visible(aGtkWidget *, int);
+extern (C) void gtk_widget_set_parent_window(aGtkWidget *, _GdkDrawable *);
+extern (C) void gtk_widget_set_parent(aGtkWidget *, aGtkWidget *);
+extern (C) void gtk_widget_set_redraw_on_allocate(aGtkWidget *, int);
+extern (C) void gtk_widget_set_double_buffered(aGtkWidget *, int);
+extern (C) void gtk_widget_set_app_paintable(aGtkWidget *, int);
+extern (C) void gtk_widget_set_sensitive(aGtkWidget *, int);
+extern (C) void gtk_widget_set_state(aGtkWidget *, int);
+extern (C) char * gtk_widget_get_name(aGtkWidget *);
+extern (C) void gtk_widget_set_name(aGtkWidget *, char *);
+extern (C) void gtk_widget_grab_default(aGtkWidget *);
+extern (C) void gtk_widget_grab_focus(aGtkWidget *);
+extern (C) int gtk_widget_is_focus(aGtkWidget *);
+extern (C) void gtk_widget_thaw_child_notify(aGtkWidget *);
+extern (C) void gtk_widget_child_notify(aGtkWidget *, char *);
+extern (C) void gtk_widget_freeze_child_notify(aGtkWidget *);
+extern (C) void * gtk_widget_region_intersect(aGtkWidget *, void *);
+extern (C) int gtk_widget_intersect(aGtkWidget *, _GdkRectangle *, _GdkRectangle *);
+extern (C) void gtk_widget_reparent(aGtkWidget *, aGtkWidget *);
+extern (C) int gtk_widget_set_scroll_adjustments(aGtkWidget *, aGtkAdjustment *, aGtkAdjustment *);
+extern (C) int gtk_widget_activate(aGtkWidget *);
+extern (C) int gtk_widget_send_expose(aGtkWidget *, _GdkEvent *);
+extern (C) int gtk_widget_event(aGtkWidget *, _GdkEvent *);
+extern (C) int gtk_widget_mnemonic_activate(aGtkWidget *, int);
+extern (C) int gtk_widget_can_activate_accel(aGtkWidget *, uint);
+extern (C) _GList * gtk_widget_list_accel_closures(aGtkWidget *);
+extern (C) char * _gtk_widget_get_accel_path(aGtkWidget *, int *);
+extern (C) void gtk_widget_set_accel_path(aGtkWidget *, char *, aGtkAccelGroup *);
+extern (C) int gtk_widget_remove_accelerator(aGtkWidget *, aGtkAccelGroup *, uint, int);
+extern (C) void gtk_widget_add_accelerator(aGtkWidget *, char *, aGtkAccelGroup *, uint, int, int);
+extern (C) void gtk_widget_get_child_requisition(aGtkWidget *, aGtkRequisition *);
+extern (C) void gtk_widget_size_allocate(aGtkWidget *, _GdkRectangle *);
+extern (C) void gtk_widget_size_request(aGtkWidget *, aGtkRequisition *);
+extern (C) void gtk_widget_draw(aGtkWidget *, _GdkRectangle *);
+extern (C) void gtk_widget_queue_resize_no_redraw(aGtkWidget *);
+extern (C) void gtk_widget_queue_resize(aGtkWidget *);
+extern (C) void gtk_widget_queue_clear_area(aGtkWidget *, int, int, int, int);
+extern (C) void gtk_widget_queue_clear(aGtkWidget *);
+extern (C) void gtk_widget_queue_draw_area(aGtkWidget *, int, int, int, int);
+extern (C) void gtk_widget_queue_draw(aGtkWidget *);
+extern (C) void gtk_widget_unrealize(aGtkWidget *);
+extern (C) void gtk_widget_realize(aGtkWidget *);
+extern (C) void gtk_widget_unmap(aGtkWidget *);
+extern (C) void gtk_widget_map(aGtkWidget *);
+extern (C) int gtk_widget_get_no_show_all(aGtkWidget *);
+extern (C) void gtk_widget_set_no_show_all(aGtkWidget *, int);
+extern (C) void gtk_widget_hide_all(aGtkWidget *);
+extern (C) void gtk_widget_show_all(aGtkWidget *);
+extern (C) void gtk_widget_hide(aGtkWidget *);
+extern (C) void gtk_widget_show_now(aGtkWidget *);
+extern (C) void gtk_widget_show(aGtkWidget *);
+extern (C) void gtk_widget_unparent(aGtkWidget *);
+extern (C) void gtk_widget_set(aGtkWidget *, char *, ...);
+extern (C) void gtk_widget_unref(aGtkWidget *);
+extern (C) _GtkWidget * gtk_widget_ref(aGtkWidget *);
+extern (C) void gtk_widget_destroyed(aGtkWidget *, _GtkWidget * *);
+extern (C) void gtk_widget_destroy(aGtkWidget *);
+extern (C) _GtkWidget * gtk_widget_new(uint, char *, ...);
+extern (C) uint gtk_widget_get_type();
+extern (C) int _gtk_settings_parse_convert(_BCD_func__12993, _GValue *, _GParamSpec *, _GValue *);
+extern (C) _BCD_func__12993 _gtk_rc_property_parser_from_type(uint);
+extern (C) void _gtk_settings_handle_event(_GdkEventSetting *);
+extern (C) void _gtk_settings_reset_rc_values(aGtkSettings *);
+extern (C) void _gtk_settings_set_property_value_from_rc(aGtkSettings *, char *, aGtkSettingsValue *);
+extern (C) void gtk_settings_set_double_property(aGtkSettings *, char *, double, char *);
+extern (C) void gtk_settings_set_long_property(aGtkSettings *, char *, int, char *);
+extern (C) void gtk_settings_set_string_property(aGtkSettings *, char *, char *, char *);
+extern (C) void gtk_settings_set_property_value(aGtkSettings *, char *, aGtkSettingsValue *);
+extern (C) int gtk_rc_property_parse_border(_GParamSpec *, _GString *, _GValue *);
+extern (C) int gtk_rc_property_parse_requisition(_GParamSpec *, _GString *, _GValue *);
+extern (C) int gtk_rc_property_parse_flags(_GParamSpec *, _GString *, _GValue *);
+extern (C) int gtk_rc_property_parse_enum(_GParamSpec *, _GString *, _GValue *);
+extern (C) int gtk_rc_property_parse_color(_GParamSpec *, _GString *, _GValue *);
+extern (C) void gtk_settings_install_property_parser(_GParamSpec *, _BCD_func__12993);
+extern (C) void gtk_settings_install_property(_GParamSpec *);
+extern (C) _GtkSettings * gtk_settings_get_for_screen(_GdkScreen *);
+extern (C) _GtkSettings * gtk_settings_get_default();
+extern (C) uint gtk_settings_get_type();
+extern (C) void _gtk_rc_context_destroy(aGtkSettings *);
+extern (C) char * _gtk_rc_context_get_default_font_name(aGtkSettings *);
+extern (C) _GSList * _gtk_rc_style_get_color_hashes(aGtkRcStyle *);
+extern (C) void _gtk_rc_style_unset_rc_property(aGtkRcStyle *, uint, uint);
+extern (C) void _gtk_rc_style_set_rc_property(aGtkRcStyle *, aGtkRcProperty *);
+extern (C) _GtkRcProperty * _gtk_rc_style_lookup_rc_property(aGtkRcStyle *, uint, uint);
+extern (C) uint gtk_rc_parse_priority(_GScanner *, int *);
+extern (C) uint gtk_rc_parse_state(_GScanner *, int *);
+extern (C) uint gtk_rc_parse_color_full(_GScanner *, aGtkRcStyle *, _GdkColor *);
+extern (C) uint gtk_rc_parse_color(_GScanner *, _GdkColor *);
+extern (C) _GScanner * gtk_rc_scanner_new();
+extern (C) char * gtk_rc_get_im_module_file();
+extern (C) char * gtk_rc_get_im_module_path();
+extern (C) char * gtk_rc_get_module_dir();
+extern (C) char * gtk_rc_get_theme_dir();
+extern (C) char * gtk_rc_find_module_in_path(char *);
+extern (C) void gtk_rc_style_unref(aGtkRcStyle *);
+extern (C) void gtk_rc_style_ref(aGtkRcStyle *);
+extern (C) _GtkRcStyle * gtk_rc_style_copy(aGtkRcStyle *);
+extern (C) _GtkRcStyle * gtk_rc_style_new();
+extern (C) uint gtk_rc_style_get_type();
+extern (C) void gtk_rc_add_class_style(aGtkRcStyle *, char *);
+extern (C) void gtk_rc_add_widget_class_style(aGtkRcStyle *, char *);
+extern (C) void gtk_rc_add_widget_name_style(aGtkRcStyle *, char *);
+extern (C) int gtk_rc_reparse_all();
+extern (C) void gtk_rc_parse_string(char *);
+extern (C) void gtk_rc_parse(char *);
+extern (C) char * gtk_rc_find_pixmap_in_path(aGtkSettings *, _GScanner *, char *);
+extern (C) void gtk_rc_reset_styles(aGtkSettings *);
+extern (C) int gtk_rc_reparse_all_for_settings(aGtkSettings *, int);
+extern (C) _GtkStyle * gtk_rc_get_style_by_paths(aGtkSettings *, char *, char *, uint);
+extern (C) _GtkStyle * gtk_rc_get_style(aGtkWidget *);
+extern (C) char * * gtk_rc_get_default_files();
+extern (C) void gtk_rc_set_default_files(char * *);
+extern (C) void gtk_rc_add_default_file(char *);
+extern (C) int _gtk_rc_match_widget_class(_GSList *, int, char *, char *);
+extern (C) void _gtk_rc_free_widget_class_path(_GSList *);
+extern (C) _GSList * _gtk_rc_parse_widget_class_path(char *);
+extern (C) void _gtk_rc_init();
+extern (C) void _gtk_widget_get_cursor_color(aGtkWidget *, _GdkColor *);
+extern (C) _GdkGC * _gtk_widget_get_cursor_gc(aGtkWidget *);
+extern (C) void gtk_draw_insertion_cursor(aGtkWidget *, _GdkDrawable *, _GdkRectangle *, _GdkRectangle *, int, int, int);
+extern (C) void gtk_paint_string(aGtkStyle *, _GdkDrawable *, int, _GdkRectangle *, aGtkWidget *, char *, int, int, char *);
+extern (C) void gtk_draw_string(aGtkStyle *, _GdkDrawable *, int, int, int, char *);
+extern (C) void _gtk_style_shade(_GdkColor *, _GdkColor *, double);
+extern (C) void _gtk_style_init_for_settings(aGtkStyle *, aGtkSettings *);
+extern (C) _GValue * _gtk_style_peek_property_value(aGtkStyle *, uint, _GParamSpec *, _BCD_func__12993);
+extern (C) void gtk_border_free(aGtkBorder *);
+extern (C) _GtkBorder * gtk_border_copy(aGtkBorder *);
+extern (C) uint gtk_border_get_type();
+extern (C) void gtk_paint_resize_grip(aGtkStyle *, _GdkDrawable *, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int, int);
+extern (C) void gtk_paint_layout(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, int, int, void *);
+extern (C) void gtk_paint_expander(aGtkStyle *, _GdkDrawable *, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int);
+extern (C) void gtk_paint_handle(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int, int);
+extern (C) void gtk_paint_slider(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int, int);
+extern (C) void gtk_paint_focus(aGtkStyle *, _GdkDrawable *, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int);
+extern (C) void gtk_paint_extension(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int, int);
+extern (C) void gtk_paint_box_gap(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int, int, int, int);
+extern (C) void gtk_paint_shadow_gap(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int, int, int, int);
+extern (C) void gtk_paint_tab(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int);
+extern (C) void gtk_paint_option(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int);
+extern (C) void gtk_paint_check(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int);
+extern (C) void gtk_paint_flat_box(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int);
+extern (C) void gtk_paint_box(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int);
+extern (C) void gtk_paint_diamond(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int);
+extern (C) void gtk_paint_arrow(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int, int, int);
+extern (C) void gtk_paint_polygon(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, _GdkPoint *, int, int);
+extern (C) void gtk_paint_shadow(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int, int);
+extern (C) void gtk_paint_vline(aGtkStyle *, _GdkDrawable *, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int);
+extern (C) void gtk_paint_hline(aGtkStyle *, _GdkDrawable *, int, _GdkRectangle *, aGtkWidget *, char *, int, int, int);
+extern (C) void gtk_draw_resize_grip(aGtkStyle *, _GdkDrawable *, int, int, int, int, int, int);
+extern (C) void gtk_draw_layout(aGtkStyle *, _GdkDrawable *, int, int, int, int, void *);
+extern (C) void gtk_draw_expander(aGtkStyle *, _GdkDrawable *, int, int, int, int);
+extern (C) void gtk_draw_handle(aGtkStyle *, _GdkDrawable *, int, int, int, int, int, int, int);
+extern (C) void gtk_draw_slider(aGtkStyle *, _GdkDrawable *, int, int, int, int, int, int, int);
+extern (C) void gtk_draw_focus(aGtkStyle *, _GdkDrawable *, int, int, int, int);
+extern (C) void gtk_draw_extension(aGtkStyle *, _GdkDrawable *, int, int, int, int, int, int, int);
+extern (C) void gtk_draw_box_gap(aGtkStyle *, _GdkDrawable *, int, int, int, int, int, int, int, int, int);
+extern (C) void gtk_draw_shadow_gap(aGtkStyle *, _GdkDrawable *, int, int, int, int, int, int, int, int, int);
+extern (C) void gtk_draw_tab(aGtkStyle *, _GdkDrawable *, int, int, int, int, int, int);
+extern (C) void gtk_draw_option(aGtkStyle *, _GdkDrawable *, int, int, int, int, int, int);
+extern (C) void gtk_draw_check(aGtkStyle *, _GdkDrawable *, int, int, int, int, int, int);
+extern (C) void gtk_draw_flat_box(aGtkStyle *, _GdkDrawable *, int, int, int, int, int, int);
+extern (C) void gtk_draw_box(aGtkStyle *, _GdkDrawable *, int, int, int, int, int, int);
+extern (C) void gtk_draw_diamond(aGtkStyle *, _GdkDrawable *, int, int, int, int, int, int);
+extern (C) void gtk_draw_arrow(aGtkStyle *, _GdkDrawable *, int, int, int, int, int, int, int, int);
+extern (C) void gtk_draw_polygon(aGtkStyle *, _GdkDrawable *, int, int, _GdkPoint *, int, int);
+extern (C) void gtk_draw_shadow(aGtkStyle *, _GdkDrawable *, int, int, int, int, int, int);
+extern (C) void gtk_draw_vline(aGtkStyle *, _GdkDrawable *, int, int, int, int);
+extern (C) void gtk_draw_hline(aGtkStyle *, _GdkDrawable *, int, int, int, int);
+extern (C) void * gtk_style_render_icon(aGtkStyle *, void *, int, int, int, aGtkWidget *, char *);
+extern (C) int gtk_style_lookup_color(aGtkStyle *, char *, _GdkColor *);
+extern (C) void * gtk_style_lookup_icon_set(aGtkStyle *, char *);
+extern (C) void gtk_style_apply_default_background(aGtkStyle *, _GdkDrawable *, int, int, _GdkRectangle *, int, int, int, int);
+extern (C) void gtk_style_set_background(aGtkStyle *, _GdkDrawable *, int);
+extern (C) void gtk_style_set_font(aGtkStyle *, _GdkFont *);
+extern (C) _GdkFont * gtk_style_get_font(aGtkStyle *);
+extern (C) void gtk_style_unref(aGtkStyle *);
+extern (C) _GtkStyle * gtk_style_ref(aGtkStyle *);
+extern (C) void gtk_style_detach(aGtkStyle *);
+extern (C) _GtkStyle * gtk_style_attach(aGtkStyle *, _GdkDrawable *);
+extern (C) _GtkStyle * gtk_style_copy(aGtkStyle *);
+extern (C) _GtkStyle * gtk_style_new();
+extern (C) uint gtk_style_get_type();
+extern (C) void gtk_adjustment_set_value(aGtkAdjustment *, double);
+extern (C) double gtk_adjustment_get_value(aGtkAdjustment *);
+extern (C) void gtk_adjustment_clamp_page(aGtkAdjustment *, double, double);
+extern (C) void gtk_adjustment_value_changed(aGtkAdjustment *);
+extern (C) void gtk_adjustment_changed(aGtkAdjustment *);
+extern (C) _GtkObject * gtk_adjustment_new(double, double, double, double, double, double);
+extern (C) uint gtk_adjustment_get_type();
+extern (C) void gtk_object_add_arg_type(char *, uint, uint, uint);
+extern (C) void gtk_object_set(aGtkObject *, char *, ...);
+extern (C) void gtk_object_get(aGtkObject *, char *, ...);
+extern (C) void gtk_object_remove_no_notify_by_id(aGtkObject *, uint);
+extern (C) void gtk_object_remove_data_by_id(aGtkObject *, uint);
+extern (C) void * gtk_object_get_data_by_id(aGtkObject *, uint);
+extern (C) void gtk_object_set_data_by_id_full(aGtkObject *, uint, void *, _BCD_func__13158);
+extern (C) void gtk_object_set_data_by_id(aGtkObject *, uint, void *);
+extern (C) void * gtk_object_get_user_data(aGtkObject *);
+extern (C) void gtk_object_set_user_data(aGtkObject *, void *);
+extern (C) void gtk_object_remove_no_notify(aGtkObject *, char *);
+extern (C) void * gtk_object_get_data(aGtkObject *, char *);
+extern (C) void gtk_object_remove_data(aGtkObject *, char *);
+extern (C) void gtk_object_set_data_full(aGtkObject *, char *, void *, _BCD_func__13158);
+extern (C) void gtk_object_set_data(aGtkObject *, char *, void *);
+extern (C) void gtk_object_weakunref(aGtkObject *, _BCD_func__13158, void *);
+extern (C) void gtk_object_weakref(aGtkObject *, _BCD_func__13158, void *);
+extern (C) void gtk_object_unref(aGtkObject *);
+extern (C) _GtkObject * gtk_object_ref(aGtkObject *);
+extern (C) _GtkObject * gtk_object_new(uint, char *, ...);
+extern (C) void gtk_object_destroy(aGtkObject *);
+extern (C) void gtk_object_sink(aGtkObject *);
+extern (C) uint gtk_object_get_type();
+extern (C) extern uint gtk_debug_flags;
+extern (C) void gtk_type_init(int);
+extern (C) _GFlagsValue * gtk_type_flags_find_value(uint, char *);
+extern (C) _GEnumValue * gtk_type_enum_find_value(uint, char *);
+extern (C) _GFlagsValue * gtk_type_flags_get_values(uint);
+extern (C) _GEnumValue * gtk_type_enum_get_values(uint);
+extern (C) void * gtk_type_new(uint);
+extern (C) uint gtk_type_unique(uint, aGtkTypeInfo *);
+extern (C) void * gtk_type_class(uint);
+extern (C) uint gtk_identifier_get_type();
+extern (C) uint gtk_widget_help_type_get_type();
+extern (C) uint gtk_widget_flags_get_type();
+extern (C) uint gtk_ui_manager_item_type_get_type();
+extern (C) uint gtk_tree_view_column_sizing_get_type();
+extern (C) uint gtk_tree_view_drop_position_get_type();
+extern (C) uint gtk_tree_model_flags_get_type();
+extern (C) uint gtk_tree_view_mode_get_type();
+extern (C) uint gtk_toolbar_space_style_get_type();
+extern (C) uint gtk_toolbar_child_type_get_type();
+extern (C) uint gtk_text_window_type_get_type();
+extern (C) uint gtk_text_search_flags_get_type();
+extern (C) uint gtk_text_buffer_target_info_get_type();
+extern (C) uint gtk_spin_type_get_type();
+extern (C) uint gtk_spin_button_update_policy_get_type();
+extern (C) uint gtk_size_group_mode_get_type();
+extern (C) uint gtk_recent_manager_error_get_type();
+extern (C) uint gtk_recent_filter_flags_get_type();
+extern (C) uint gtk_recent_chooser_error_get_type();
+extern (C) uint gtk_recent_sort_type_get_type();
+extern (C) uint gtk_rc_token_type_get_type();
+extern (C) uint gtk_rc_flags_get_type();
+extern (C) uint gtk_progress_bar_orientation_get_type();
+extern (C) uint gtk_progress_bar_style_get_type();
+extern (C) uint gtk_private_flags_get_type();
+extern (C) uint gtk_print_error_get_type();
+extern (C) uint gtk_print_operation_action_get_type();
+extern (C) uint gtk_print_operation_result_get_type();
+extern (C) uint gtk_print_status_get_type();
+extern (C) uint gtk_arg_flags_get_type();
+extern (C) uint gtk_object_flags_get_type();
+extern (C) uint gtk_notebook_tab_get_type();
+extern (C) uint gtk_buttons_type_get_type();
+extern (C) uint gtk_message_type_get_type();
+extern (C) uint gtk_image_type_get_type();
+extern (C) uint gtk_icon_view_drop_position_get_type();
+extern (C) uint gtk_icon_theme_error_get_type();
+extern (C) uint gtk_icon_lookup_flags_get_type();
+extern (C) uint gtk_file_filter_flags_get_type();
+extern (C) uint gtk_file_chooser_error_get_type();
+extern (C) uint gtk_file_chooser_confirmation_get_type();
+extern (C) uint gtk_file_chooser_action_get_type();
+extern (C) uint gtk_drag_result_get_type();
+extern (C) uint gtk_tree_view_grid_lines_get_type();
+extern (C) uint gtk_unit_get_type();
+extern (C) uint gtk_print_duplex_get_type();
+extern (C) uint gtk_print_quality_get_type();
+extern (C) uint gtk_page_orientation_get_type();
+extern (C) uint gtk_page_set_get_type();
+extern (C) uint gtk_print_pages_get_type();
+extern (C) uint gtk_pack_direction_get_type();
+extern (C) uint gtk_im_status_style_get_type();
+extern (C) uint gtk_im_preedit_style_get_type();
+extern (C) uint gtk_sort_type_get_type();
+extern (C) uint gtk_wrap_mode_get_type();
+extern (C) uint gtk_window_type_get_type();
+extern (C) uint gtk_window_position_get_type();
+extern (C) uint gtk_visibility_get_type();
+extern (C) uint gtk_update_type_get_type();
+extern (C) uint gtk_toolbar_style_get_type();
+extern (C) uint gtk_submenu_placement_get_type();
+extern (C) uint gtk_submenu_direction_get_type();
+extern (C) uint gtk_state_type_get_type();
+extern (C) uint gtk_shadow_type_get_type();
+extern (C) uint gtk_selection_mode_get_type();
+extern (C) uint gtk_scroll_type_get_type();
+extern (C) uint gtk_signal_run_type_get_type();
+extern (C) uint gtk_resize_mode_get_type();
+extern (C) uint gtk_relief_style_get_type();
+extern (C) uint gtk_preview_type_get_type();
+extern (C) uint gtk_position_type_get_type();
+extern (C) uint gtk_policy_type_get_type();
+extern (C) uint gtk_path_type_get_type();
+extern (C) uint gtk_path_priority_type_get_type();
+extern (C) uint gtk_pack_type_get_type();
+extern (C) uint gtk_corner_type_get_type();
+extern (C) uint gtk_orientation_get_type();
+extern (C) uint gtk_scroll_step_get_type();
+extern (C) uint gtk_movement_step_get_type();
+extern (C) uint gtk_metric_type_get_type();
+extern (C) uint gtk_menu_direction_type_get_type();
+extern (C) uint gtk_match_type_get_type();
+extern (C) uint gtk_justification_get_type();
+extern (C) uint gtk_text_direction_get_type();
+extern (C) uint gtk_side_type_get_type();
+extern (C) uint gtk_sensitivity_type_get_type();
+extern (C) uint gtk_icon_size_get_type();
+extern (C) uint gtk_expander_style_get_type();
+extern (C) uint gtk_direction_type_get_type();
+extern (C) uint gtk_delete_type_get_type();
+extern (C) uint gtk_curve_type_get_type();
+extern (C) uint gtk_button_box_style_get_type();
+extern (C) uint gtk_attach_options_get_type();
+extern (C) uint gtk_arrow_type_get_type();
+extern (C) uint gtk_anchor_type_get_type();
+extern (C) uint gtk_target_flags_get_type();
+extern (C) uint gtk_dest_defaults_get_type();
+extern (C) uint gtk_response_type_get_type();
+extern (C) uint gtk_dialog_flags_get_type();
+extern (C) uint gtk_debug_flag_get_type();
+extern (C) uint gtk_ctree_expansion_type_get_type();
+extern (C) uint gtk_ctree_expander_style_get_type();
+extern (C) uint gtk_ctree_line_style_get_type();
+extern (C) uint gtk_ctree_pos_get_type();
+extern (C) uint gtk_button_action_get_type();
+extern (C) uint gtk_clist_drag_pos_get_type();
+extern (C) uint gtk_cell_type_get_type();
+extern (C) uint gtk_cell_renderer_accel_mode_get_type();
+extern (C) uint gtk_cell_renderer_mode_get_type();
+extern (C) uint gtk_cell_renderer_state_get_type();
+extern (C) uint gtk_calendar_display_options_get_type();
+extern (C) uint gtk_builder_error_get_type();
+extern (C) uint gtk_assistant_page_type_get_type();
+extern (C) uint gtk_accel_flags_get_type();
+extern (C) void _gtk_accel_group_reconnect(aGtkAccelGroup *, uint);
+extern (C) _GtkAccelGroupEntry * gtk_accel_group_query(aGtkAccelGroup *, uint, int, uint *);
+extern (C) uint gtk_accelerator_get_default_mod_mask();
+extern (C) void gtk_accelerator_set_default_mod_mask(int);
+extern (C) char * gtk_accelerator_get_label(uint, int);
+extern (C) char * gtk_accelerator_name(uint, int);
+extern (C) void gtk_accelerator_parse(char *, uint *, int *);
+extern (C) int gtk_accelerator_valid(uint, int);
+extern (C) _GtkAccelGroup * gtk_accel_group_from_accel_closure(_GClosure *);
+extern (C) _GtkAccelKey * gtk_accel_group_find(aGtkAccelGroup *, _BCD_func__13177, void *);
+extern (C) _GSList * gtk_accel_groups_from_object(_GObject *);
+extern (C) int gtk_accel_groups_activate(_GObject *, uint, int);
+extern (C) void _gtk_accel_group_detach(aGtkAccelGroup *, _GObject *);
+extern (C) void _gtk_accel_group_attach(aGtkAccelGroup *, _GObject *);
+extern (C) int gtk_accel_group_activate(aGtkAccelGroup *, uint, _GObject *, uint, int);
+extern (C) int gtk_accel_group_disconnect_key(aGtkAccelGroup *, uint, int);
+extern (C) int gtk_accel_group_disconnect(aGtkAccelGroup *, _GClosure *);
+extern (C) void gtk_accel_group_connect_by_path(aGtkAccelGroup *, char *, _GClosure *);
+extern (C) void gtk_accel_group_connect(aGtkAccelGroup *, uint, int, int, _GClosure *);
+extern (C) void gtk_accel_group_unlock(aGtkAccelGroup *);
+extern (C) void gtk_accel_group_lock(aGtkAccelGroup *);
+extern (C) _GtkAccelGroup * gtk_accel_group_new();
+extern (C) uint gtk_accel_group_get_type();
+} // version(DYNLINK)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/gtk_unix_print_2_0.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,387 @@
+/******************************************************************************
+    Based on the generated files from the BCD tool
+    modified by: Frank Benoit <keinfarbton@googlemail.com>
+******************************************************************************/
+module org.eclipse.swt.internal.c.gtk_unix_print_2_0;
+
+import java.lang.all;
+
+version=DYNLINK;
+
+version(DYNLINK){
+    import tango.sys.SharedLib : SharedLib;
+    struct Symbol{
+        String name;
+        void** symbol;
+    }
+}
+
+void loadLib(){
+    version(DYNLINK){
+        String libname = "libgtk-x11-2.0.so";
+
+        SharedLib lib = SharedLib.load( libname );
+        if( lib is null ){
+            lib = SharedLib.load( libname ~ ".0" );
+        }
+
+        if ( lib !is null ) {
+            foreach( inout s; symbols ){
+                try{
+                    *s.symbol = lib.getSymbol( s.name.ptr );
+                }
+                catch(Exception e){}
+                if( *s.symbol is null ){
+                    getDwtLogger().trace( __FILE__, __LINE__,  "{}: Symbol '{}' not found", libname, s.name );
+                }
+            }
+        } else {
+            getDwtLogger().trace( __FILE__, __LINE__,  "Could not load the library {}", libname );
+        }
+    }
+}
+
+extern(C):
+align(4):
+
+public import org.eclipse.swt.internal.c.atk;
+public import org.eclipse.swt.internal.c.cairo;
+public import org.eclipse.swt.internal.c.pango;
+public import org.eclipse.swt.internal.c.gdk;
+public import org.eclipse.swt.internal.c.gtk;
+public import org.eclipse.swt.internal.c.glib_object;
+
+alias void GtkPrintUnixDialogPrivate;
+alias _GtkPrintUnixDialogClass GtkPrintUnixDialogClass;
+alias void function() _BCD_func__5891;
+alias _GtkPrintUnixDialog GtkPrintUnixDialog;
+alias _GtkPrintJob GtkPrintJob;
+alias void function(_GtkPrintJob *, void *, _GError *) _BCD_func__5238;
+alias _BCD_func__5238 GtkPrintJobCompleteFunc;
+alias void GtkPrintJobPrivate;
+alias _GtkPrintJobClass GtkPrintJobClass;
+alias void function(_GtkPrintJob *) _BCD_func__8505;
+alias _GtkPrinter GtkPrinter;
+alias int function(_GtkPrinter *, void *) _BCD_func__5323;
+alias _BCD_func__5323 GtkPrinterFunc;
+alias void GtkPrintBackend;
+alias void GtkPrinterPrivate;
+alias _GtkPrinterClass GtkPrinterClass;
+alias void function(_GtkPrinter *, int) _BCD_func__8525;
+enum GtkPrintCapabilities {
+GTK_PRINT_CAPABILITY_PAGE_SET=1,
+GTK_PRINT_CAPABILITY_COPIES=2,
+GTK_PRINT_CAPABILITY_COLLATE=4,
+GTK_PRINT_CAPABILITY_REVERSE=8,
+GTK_PRINT_CAPABILITY_SCALE=16,
+GTK_PRINT_CAPABILITY_GENERATE_PDF=32,
+GTK_PRINT_CAPABILITY_GENERATE_PS=64,
+GTK_PRINT_CAPABILITY_PREVIEW=128,
+GTK_PRINT_CAPABILITY_NUMBER_UP=256,
+}
+alias void GtkPageSetupUnixDialogPrivate;
+alias _GtkPageSetupUnixDialogClass GtkPageSetupUnixDialogClass;
+alias _GtkPageSetupUnixDialog GtkPageSetupUnixDialog;
+alias void function(void *) _BCD_func__5893;
+alias void function(void *, void *) _BCD_func__5263;
+alias int function(_GtkWidget *, _GdkEventKey *, void *) _BCD_func__5322;
+alias void function(char *, char *, void *) _BCD_func__5364;
+alias void function(_GtkWindow *, uint, int, int, void *) _BCD_func__5383;
+alias void function(_GtkWidget *, void *) _BCD_func__5476;
+alias void function(_AtkObject *, _AtkPropertyValues *) _BCD_func__5620;
+alias int function(void *) _BCD_func__5621;
+alias int function(_GParamSpec *, _GString *, _GValue *) _BCD_func__5727;
+alias void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *) _BCD_func__5880;
+alias void function(_GtkObject *, void *, uint, _GtkArg *) _BCD_func__5892;
+alias void function(_GTypeInstance *, void *) _BCD_func__5904;
+alias int function(_GtkAccelKey *, _GClosure *, void *) _BCD_func__5915;
+alias int function(_GtkAccelGroup *, _GObject *, uint, int) _BCD_func__5916;
+alias void function(_GdkSpan *, void *) _BCD_func__6036;
+alias int function(void *, _GdkEvent *, void *) _BCD_func__6205;
+alias void function(_GdkEvent *, void *) _BCD_func__6206;
+alias void function(void *, _PangoAttrShape *, int, void *) _BCD_func__6460;
+alias void function(void *) _BCD_func__6477;
+alias char * function(void *) _BCD_func__6478;
+alias int function(char *, uint, _GError * *, void *) _BCD_func__6485;
+alias void function(char *, void *) _BCD_func__6488;
+alias void function(void *, int, int) _BCD_func__6500;
+alias int function(void *) _BCD_func__2322;
+alias int function(void *, long *, int) _BCD_func__2324;
+alias int function(void *, char *, uint) _BCD_func__2326;
+alias int function(void *, char *, uint) _BCD_func__2328;
+alias int function(void * *, char *) _BCD_func__6666;
+alias int function(char *, char * * *, uint *) _BCD_func__6667;
+alias int function(void *, char *, char *, char *, char *) _BCD_func__6668;
+alias int function(__gconv_step *, __gconv_step_data *, void *, char *, char * *, char *, char * *, uint *) _BCD_func__6669;
+alias void function(__gconv_step *) _BCD_func__6670;
+alias int function(__gconv_step *) _BCD_func__6671;
+alias uint function(__gconv_step *, char) _BCD_func__6672;
+alias int function(__gconv_step *, __gconv_step_data *, char * *, char *, char * *, uint *, int, int) _BCD_func__6673;
+alias int function(void *, void *, void *) _BCD_func__6822;
+alias void * function(void *) _BCD_func__6846;
+alias int function(_PangoAttribute *, void *) _BCD_func__6847;
+alias void function(void *, uint, uint, _GInterfaceInfo *) _BCD_func__6949;
+alias void function(void *, uint, _GTypeInfo *, _GTypeValueTable *) _BCD_func__6950;
+alias void function(void *) _BCD_func__6951;
+alias void function(void *, _GObject *, int) _BCD_func__7096;
+alias void function(void *, _GObject *) _BCD_func__7098;
+alias void function(_GObject *) _BCD_func__7099;
+alias void function(_GObject *, uint, _GValue *, _GParamSpec *) _BCD_func__7100;
+alias void function(_GObject *, uint, _GValue *, _GParamSpec *) _BCD_func__7101;
+alias int function(_GSignalInvocationHint *, _GValue *, _GValue *, void *) _BCD_func__7126;
+alias int function(_GSignalInvocationHint *, uint, _GValue *, void *) _BCD_func__7127;
+alias void function(void *, _GClosure *) _BCD_func__7146;
+alias void function(_GValue *, _GValue *) _BCD_func__7203;
+alias void * function(void *) _BCD_func__7221;
+alias void function(void *, void *) _BCD_func__7225;
+alias int function(void *, _GTypeClass *) _BCD_func__7226;
+alias int function(void *, void *, void *) _BCD_func__7274;
+alias int function(void *, void *, void *) _BCD_func__7288;
+alias void function(_GScanner *, char *, int) _BCD_func__7290;
+alias int function(void *, _GString *, void *) _BCD_func__7362;
+alias void function(void *, void *, void *, _GError * *) _BCD_func__7379;
+alias int function(void *, void *, void *, _GError * *) _BCD_func__7380;
+alias int function(char *, char *, void *, _GError * *) _BCD_func__7381;
+alias void * function(void *, void *) _BCD_func__7392;
+alias void function(_GNode *, void *) _BCD_func__7393;
+alias int function(_GNode *, void *) _BCD_func__7394;
+alias void function(char *) _BCD_func__7402;
+alias void function(char *, int, char *, void *) _BCD_func__7404;
+alias int function(_GIOChannel *, int, void *) _BCD_func__7418;
+alias int function(_GPollFD *, uint, int) _BCD_func__7468;
+alias void function(int, int, void *) _BCD_func__7474;
+alias void function(_GHookList *, _GHook *) _BCD_func__7505;
+alias int function(_GHook *, void *) _BCD_func__7506;
+alias void function(_GHook *, void *) _BCD_func__7507;
+alias int function(_GHook *, _GHook *) _BCD_func__7508;
+alias void function(uint, void *, void *) _BCD_func__7542;
+alias int function(char *, char *, uint) _BCD_func__7545;
+alias char * function(void *) _BCD_func__7546;
+alias char * function(char *, void *) _BCD_func__7731;
+alias void function(void *, void *, void *) _BCD_func__7732;
+alias uint function(void *) _BCD_func__7733;
+alias int function(void *, void *) _BCD_func__7734;
+alias int function(void *, void *, void *) _BCD_func__7735;
+alias int function(void *, void *) _BCD_func__7736;
+alias int function(void *, char *, uint) _BCD_func__7807;
+alias int function(void *, char *, uint) _BCD_func__7808;
+struct _GtkPrintUnixDialogClass {
+_GtkDialogClass parent_class;
+_BCD_func__5891 _gtk_reserved1;
+_BCD_func__5891 _gtk_reserved2;
+_BCD_func__5891 _gtk_reserved3;
+_BCD_func__5891 _gtk_reserved4;
+_BCD_func__5891 _gtk_reserved5;
+_BCD_func__5891 _gtk_reserved6;
+_BCD_func__5891 _gtk_reserved7;
+}
+struct _GtkPrintUnixDialog {
+_GtkDialog parent_instance;
+void * priv;
+}
+struct _GtkPrintJobClass {
+_GObjectClass parent_class;
+_BCD_func__8505 status_changed;
+_BCD_func__5891 _gtk_reserved1;
+_BCD_func__5891 _gtk_reserved2;
+_BCD_func__5891 _gtk_reserved3;
+_BCD_func__5891 _gtk_reserved4;
+_BCD_func__5891 _gtk_reserved5;
+_BCD_func__5891 _gtk_reserved6;
+_BCD_func__5891 _gtk_reserved7;
+}
+struct _GtkPrintJob {
+_GObject parent_instance;
+void * priv;
+int print_pages;
+_GtkPageRange * page_ranges;
+int num_page_ranges;
+int page_set;
+int num_copies;
+double scale;
+uint bitfield0;
+}
+struct _GtkPrinterClass {
+_GObjectClass parent_class;
+_BCD_func__8525 details_acquired;
+_BCD_func__5891 _gtk_reserved1;
+_BCD_func__5891 _gtk_reserved2;
+_BCD_func__5891 _gtk_reserved3;
+_BCD_func__5891 _gtk_reserved4;
+_BCD_func__5891 _gtk_reserved5;
+_BCD_func__5891 _gtk_reserved6;
+_BCD_func__5891 _gtk_reserved7;
+}
+struct _GtkPrinter {
+_GObject parent_instance;
+void * priv;
+}
+struct _GtkPageSetupUnixDialogClass {
+_GtkDialogClass parent_class;
+_BCD_func__5891 _gtk_reserved1;
+_BCD_func__5891 _gtk_reserved2;
+_BCD_func__5891 _gtk_reserved3;
+_BCD_func__5891 _gtk_reserved4;
+_BCD_func__5891 _gtk_reserved5;
+_BCD_func__5891 _gtk_reserved6;
+_BCD_func__5891 _gtk_reserved7;
+}
+struct _GtkPageSetupUnixDialog {
+_GtkDialog parent_instance;
+void * priv;
+}
+version(DYNLINK){
+alias extern (C) void function(_GtkPrintUnixDialog *, int) TGTKgtk_print_unix_dialog_set_manual_capabilities; extern(D) TGTKgtk_print_unix_dialog_set_manual_capabilities gtk_print_unix_dialog_set_manual_capabilities;
+alias extern (C) void function(_GtkPrintUnixDialog *, _GtkWidget *, _GtkWidget *) TGTKgtk_print_unix_dialog_add_custom_tab; extern(D) TGTKgtk_print_unix_dialog_add_custom_tab gtk_print_unix_dialog_add_custom_tab;
+alias extern (C) _GtkPrinter * function(_GtkPrintUnixDialog *) TGTKgtk_print_unix_dialog_get_selected_printer; extern(D) TGTKgtk_print_unix_dialog_get_selected_printer gtk_print_unix_dialog_get_selected_printer;
+alias extern (C) void * function(_GtkPrintUnixDialog *) TGTKgtk_print_unix_dialog_get_settings; extern(D) TGTKgtk_print_unix_dialog_get_settings gtk_print_unix_dialog_get_settings;
+alias extern (C) void function(_GtkPrintUnixDialog *, void *) TGTKgtk_print_unix_dialog_set_settings; extern(D) TGTKgtk_print_unix_dialog_set_settings gtk_print_unix_dialog_set_settings;
+alias extern (C) int function(_GtkPrintUnixDialog *) TGTKgtk_print_unix_dialog_get_current_page; extern(D) TGTKgtk_print_unix_dialog_get_current_page gtk_print_unix_dialog_get_current_page;
+alias extern (C) void function(_GtkPrintUnixDialog *, int) TGTKgtk_print_unix_dialog_set_current_page; extern(D) TGTKgtk_print_unix_dialog_set_current_page gtk_print_unix_dialog_set_current_page;
+alias extern (C) void * function(_GtkPrintUnixDialog *) TGTKgtk_print_unix_dialog_get_page_setup; extern(D) TGTKgtk_print_unix_dialog_get_page_setup gtk_print_unix_dialog_get_page_setup;
+alias extern (C) void function(_GtkPrintUnixDialog *, void *) TGTKgtk_print_unix_dialog_set_page_setup; extern(D) TGTKgtk_print_unix_dialog_set_page_setup gtk_print_unix_dialog_set_page_setup;
+alias extern (C) _GtkWidget * function(char *, _GtkWindow *) TGTKgtk_print_unix_dialog_new; extern(D) TGTKgtk_print_unix_dialog_new gtk_print_unix_dialog_new;
+alias extern (C) uint function() TGTKgtk_print_unix_dialog_get_type; extern(D) TGTKgtk_print_unix_dialog_get_type gtk_print_unix_dialog_get_type;
+alias extern (C) void function(_GtkPrintJob *, _BCD_func__5238, void *, _BCD_func__5893) TGTKgtk_print_job_send; extern(D) TGTKgtk_print_job_send gtk_print_job_send;
+alias extern (C) int function(_GtkPrintJob *) TGTKgtk_print_job_get_track_print_status; extern(D) TGTKgtk_print_job_get_track_print_status gtk_print_job_get_track_print_status;
+alias extern (C) void function(_GtkPrintJob *, int) TGTKgtk_print_job_set_track_print_status; extern(D) TGTKgtk_print_job_set_track_print_status gtk_print_job_set_track_print_status;
+alias extern (C) void * function(_GtkPrintJob *, _GError * *) TGTKgtk_print_job_get_surface; extern(D) TGTKgtk_print_job_get_surface gtk_print_job_get_surface;
+alias extern (C) int function(_GtkPrintJob *, char *, _GError * *) TGTKgtk_print_job_set_source_file; extern(D) TGTKgtk_print_job_set_source_file gtk_print_job_set_source_file;
+alias extern (C) int function(_GtkPrintJob *) TGTKgtk_print_job_get_status; extern(D) TGTKgtk_print_job_get_status gtk_print_job_get_status;
+alias extern (C) char * function(_GtkPrintJob *) TGTKgtk_print_job_get_title; extern(D) TGTKgtk_print_job_get_title gtk_print_job_get_title;
+alias extern (C) _GtkPrinter * function(_GtkPrintJob *) TGTKgtk_print_job_get_printer; extern(D) TGTKgtk_print_job_get_printer gtk_print_job_get_printer;
+alias extern (C) void * function(_GtkPrintJob *) TGTKgtk_print_job_get_settings; extern(D) TGTKgtk_print_job_get_settings gtk_print_job_get_settings;
+alias extern (C) _GtkPrintJob * function(char *, _GtkPrinter *, void *, void *) TGTKgtk_print_job_new; extern(D) TGTKgtk_print_job_new gtk_print_job_new;
+alias extern (C) uint function() TGTKgtk_print_job_get_type; extern(D) TGTKgtk_print_job_get_type gtk_print_job_get_type;
+alias extern (C) void function(_BCD_func__5323, void *, _BCD_func__5893, int) TGTKgtk_enumerate_printers; extern(D) TGTKgtk_enumerate_printers gtk_enumerate_printers;
+alias extern (C) int function(_GtkPrinter *) TGTKgtk_printer_get_capabilities; extern(D) TGTKgtk_printer_get_capabilities gtk_printer_get_capabilities;
+alias extern (C) void function(_GtkPrinter *) TGTKgtk_printer_request_details; extern(D) TGTKgtk_printer_request_details gtk_printer_request_details;
+alias extern (C) int function(_GtkPrinter *) TGTKgtk_printer_has_details; extern(D) TGTKgtk_printer_has_details gtk_printer_has_details;
+alias extern (C) int function(_GtkPrinter *, _GtkPrinter *) TGTKgtk_printer_compare; extern(D) TGTKgtk_printer_compare gtk_printer_compare;
+alias extern (C) _GList * function(_GtkPrinter *) TGTKgtk_printer_list_papers; extern(D) TGTKgtk_printer_list_papers gtk_printer_list_papers;
+alias extern (C) int function(_GtkPrinter *) TGTKgtk_printer_accepts_ps; extern(D) TGTKgtk_printer_accepts_ps gtk_printer_accepts_ps;
+alias extern (C) int function(_GtkPrinter *) TGTKgtk_printer_accepts_pdf; extern(D) TGTKgtk_printer_accepts_pdf gtk_printer_accepts_pdf;
+alias extern (C) int function(_GtkPrinter *) TGTKgtk_printer_is_default; extern(D) TGTKgtk_printer_is_default gtk_printer_is_default;
+alias extern (C) int function(_GtkPrinter *) TGTKgtk_printer_is_virtual; extern(D) TGTKgtk_printer_is_virtual gtk_printer_is_virtual;
+alias extern (C) int function(_GtkPrinter *) TGTKgtk_printer_is_active; extern(D) TGTKgtk_printer_is_active gtk_printer_is_active;
+alias extern (C) int function(_GtkPrinter *) TGTKgtk_printer_get_job_count; extern(D) TGTKgtk_printer_get_job_count gtk_printer_get_job_count;
+alias extern (C) char * function(_GtkPrinter *) TGTKgtk_printer_get_icon_name; extern(D) TGTKgtk_printer_get_icon_name gtk_printer_get_icon_name;
+alias extern (C) char * function(_GtkPrinter *) TGTKgtk_printer_get_location; extern(D) TGTKgtk_printer_get_location gtk_printer_get_location;
+alias extern (C) char * function(_GtkPrinter *) TGTKgtk_printer_get_description; extern(D) TGTKgtk_printer_get_description gtk_printer_get_description;
+alias extern (C) char * function(_GtkPrinter *) TGTKgtk_printer_get_state_message; extern(D) TGTKgtk_printer_get_state_message gtk_printer_get_state_message;
+alias extern (C) char * function(_GtkPrinter *) TGTKgtk_printer_get_name; extern(D) TGTKgtk_printer_get_name gtk_printer_get_name;
+alias extern (C) void * function(_GtkPrinter *) TGTKgtk_printer_get_backend; extern(D) TGTKgtk_printer_get_backend gtk_printer_get_backend;
+alias extern (C) _GtkPrinter * function(char *, void *, int) TGTKgtk_printer_new; extern(D) TGTKgtk_printer_new gtk_printer_new;
+alias extern (C) uint function() TGTKgtk_printer_get_type; extern(D) TGTKgtk_printer_get_type gtk_printer_get_type;
+alias extern (C) uint function() TGTKgtk_print_capabilities_get_type; extern(D) TGTKgtk_print_capabilities_get_type gtk_print_capabilities_get_type;
+alias extern (C) void * function(_GtkPageSetupUnixDialog *) TGTKgtk_page_setup_unix_dialog_get_print_settings; extern(D) TGTKgtk_page_setup_unix_dialog_get_print_settings gtk_page_setup_unix_dialog_get_print_settings;
+alias extern (C) void function(_GtkPageSetupUnixDialog *, void *) TGTKgtk_page_setup_unix_dialog_set_print_settings; extern(D) TGTKgtk_page_setup_unix_dialog_set_print_settings gtk_page_setup_unix_dialog_set_print_settings;
+alias extern (C) void * function(_GtkPageSetupUnixDialog *) TGTKgtk_page_setup_unix_dialog_get_page_setup; extern(D) TGTKgtk_page_setup_unix_dialog_get_page_setup gtk_page_setup_unix_dialog_get_page_setup;
+alias extern (C) void function(_GtkPageSetupUnixDialog *, void *) TGTKgtk_page_setup_unix_dialog_set_page_setup; extern(D) TGTKgtk_page_setup_unix_dialog_set_page_setup gtk_page_setup_unix_dialog_set_page_setup;
+alias extern (C) _GtkWidget * function(char *, _GtkWindow *) TGTKgtk_page_setup_unix_dialog_new; extern(D) TGTKgtk_page_setup_unix_dialog_new gtk_page_setup_unix_dialog_new;
+alias extern (C) uint function() TGTKgtk_page_setup_unix_dialog_get_type; extern(D) TGTKgtk_page_setup_unix_dialog_get_type gtk_page_setup_unix_dialog_get_type;
+
+
+extern(D) Symbol[] symbols = [
+    { "gtk_print_unix_dialog_set_manual_capabilities",  cast(void**)& gtk_print_unix_dialog_set_manual_capabilities},
+    { "gtk_print_unix_dialog_add_custom_tab",  cast(void**)& gtk_print_unix_dialog_add_custom_tab},
+    { "gtk_print_unix_dialog_get_selected_printer",  cast(void**)& gtk_print_unix_dialog_get_selected_printer},
+    { "gtk_print_unix_dialog_get_settings",  cast(void**)& gtk_print_unix_dialog_get_settings},
+    { "gtk_print_unix_dialog_set_settings",  cast(void**)& gtk_print_unix_dialog_set_settings},
+    { "gtk_print_unix_dialog_get_current_page",  cast(void**)& gtk_print_unix_dialog_get_current_page},
+    { "gtk_print_unix_dialog_set_current_page",  cast(void**)& gtk_print_unix_dialog_set_current_page},
+    { "gtk_print_unix_dialog_get_page_setup",  cast(void**)& gtk_print_unix_dialog_get_page_setup},
+    { "gtk_print_unix_dialog_set_page_setup",  cast(void**)& gtk_print_unix_dialog_set_page_setup},
+    { "gtk_print_unix_dialog_new",  cast(void**)& gtk_print_unix_dialog_new},
+    { "gtk_print_unix_dialog_get_type",  cast(void**)& gtk_print_unix_dialog_get_type},
+    { "gtk_print_job_send",  cast(void**)& gtk_print_job_send},
+    { "gtk_print_job_get_track_print_status",  cast(void**)& gtk_print_job_get_track_print_status},
+    { "gtk_print_job_set_track_print_status",  cast(void**)& gtk_print_job_set_track_print_status},
+    { "gtk_print_job_get_surface",  cast(void**)& gtk_print_job_get_surface},
+    { "gtk_print_job_set_source_file",  cast(void**)& gtk_print_job_set_source_file},
+    { "gtk_print_job_get_status",  cast(void**)& gtk_print_job_get_status},
+    { "gtk_print_job_get_title",  cast(void**)& gtk_print_job_get_title},
+    { "gtk_print_job_get_printer",  cast(void**)& gtk_print_job_get_printer},
+    { "gtk_print_job_get_settings",  cast(void**)& gtk_print_job_get_settings},
+    { "gtk_print_job_new",  cast(void**)& gtk_print_job_new},
+    { "gtk_print_job_get_type",  cast(void**)& gtk_print_job_get_type},
+    { "gtk_enumerate_printers",  cast(void**)& gtk_enumerate_printers},
+    { "gtk_printer_get_capabilities",  cast(void**)& gtk_printer_get_capabilities},
+    { "gtk_printer_request_details",  cast(void**)& gtk_printer_request_details},
+    { "gtk_printer_has_details",  cast(void**)& gtk_printer_has_details},
+    { "gtk_printer_compare",  cast(void**)& gtk_printer_compare},
+    { "gtk_printer_list_papers",  cast(void**)& gtk_printer_list_papers},
+    { "gtk_printer_accepts_ps",  cast(void**)& gtk_printer_accepts_ps},
+    { "gtk_printer_accepts_pdf",  cast(void**)& gtk_printer_accepts_pdf},
+    { "gtk_printer_is_default",  cast(void**)& gtk_printer_is_default},
+    { "gtk_printer_is_virtual",  cast(void**)& gtk_printer_is_virtual},
+    { "gtk_printer_is_active",  cast(void**)& gtk_printer_is_active},
+    { "gtk_printer_get_job_count",  cast(void**)& gtk_printer_get_job_count},
+    { "gtk_printer_get_icon_name",  cast(void**)& gtk_printer_get_icon_name},
+    { "gtk_printer_get_location",  cast(void**)& gtk_printer_get_location},
+    { "gtk_printer_get_description",  cast(void**)& gtk_printer_get_description},
+    { "gtk_printer_get_state_message",  cast(void**)& gtk_printer_get_state_message},
+    { "gtk_printer_get_name",  cast(void**)& gtk_printer_get_name},
+    { "gtk_printer_get_backend",  cast(void**)& gtk_printer_get_backend},
+    { "gtk_printer_new",  cast(void**)& gtk_printer_new},
+    { "gtk_printer_get_type",  cast(void**)& gtk_printer_get_type},
+    { "gtk_print_capabilities_get_type",  cast(void**)& gtk_print_capabilities_get_type},
+    { "gtk_page_setup_unix_dialog_get_print_settings",  cast(void**)& gtk_page_setup_unix_dialog_get_print_settings},
+    { "gtk_page_setup_unix_dialog_set_print_settings",  cast(void**)& gtk_page_setup_unix_dialog_set_print_settings},
+    { "gtk_page_setup_unix_dialog_get_page_setup",  cast(void**)& gtk_page_setup_unix_dialog_get_page_setup},
+    { "gtk_page_setup_unix_dialog_set_page_setup",  cast(void**)& gtk_page_setup_unix_dialog_set_page_setup},
+    { "gtk_page_setup_unix_dialog_new",  cast(void**)& gtk_page_setup_unix_dialog_new},
+    { "gtk_page_setup_unix_dialog_get_type",  cast(void**)& gtk_page_setup_unix_dialog_get_type},
+];
+
+} else { // version(DYNLINK)
+extern (C) void gtk_print_unix_dialog_set_manual_capabilities(_GtkPrintUnixDialog *, int);
+extern (C) void gtk_print_unix_dialog_add_custom_tab(_GtkPrintUnixDialog *, _GtkWidget *, _GtkWidget *);
+extern (C) _GtkPrinter * gtk_print_unix_dialog_get_selected_printer(_GtkPrintUnixDialog *);
+extern (C) void * gtk_print_unix_dialog_get_settings(_GtkPrintUnixDialog *);
+extern (C) void gtk_print_unix_dialog_set_settings(_GtkPrintUnixDialog *, void *);
+extern (C) int gtk_print_unix_dialog_get_current_page(_GtkPrintUnixDialog *);
+extern (C) void gtk_print_unix_dialog_set_current_page(_GtkPrintUnixDialog *, int);
+extern (C) void * gtk_print_unix_dialog_get_page_setup(_GtkPrintUnixDialog *);
+extern (C) void gtk_print_unix_dialog_set_page_setup(_GtkPrintUnixDialog *, void *);
+extern (C) _GtkWidget * gtk_print_unix_dialog_new(char *, _GtkWindow *);
+extern (C) uint gtk_print_unix_dialog_get_type();
+extern (C) void gtk_print_job_send(_GtkPrintJob *, _BCD_func__5238, void *, _BCD_func__5893);
+extern (C) int gtk_print_job_get_track_print_status(_GtkPrintJob *);
+extern (C) void gtk_print_job_set_track_print_status(_GtkPrintJob *, int);
+extern (C) void * gtk_print_job_get_surface(_GtkPrintJob *, _GError * *);
+extern (C) int gtk_print_job_set_source_file(_GtkPrintJob *, char *, _GError * *);
+extern (C) int gtk_print_job_get_status(_GtkPrintJob *);
+extern (C) char * gtk_print_job_get_title(_GtkPrintJob *);
+extern (C) _GtkPrinter * gtk_print_job_get_printer(_GtkPrintJob *);
+extern (C) void * gtk_print_job_get_settings(_GtkPrintJob *);
+extern (C) _GtkPrintJob * gtk_print_job_new(char *, _GtkPrinter *, void *, void *);
+extern (C) uint gtk_print_job_get_type();
+extern (C) void gtk_enumerate_printers(_BCD_func__5323, void *, _BCD_func__5893, int);
+extern (C) int gtk_printer_get_capabilities(_GtkPrinter *);
+extern (C) void gtk_printer_request_details(_GtkPrinter *);
+extern (C) int gtk_printer_has_details(_GtkPrinter *);
+extern (C) int gtk_printer_compare(_GtkPrinter *, _GtkPrinter *);
+extern (C) _GList * gtk_printer_list_papers(_GtkPrinter *);
+extern (C) int gtk_printer_accepts_ps(_GtkPrinter *);
+extern (C) int gtk_printer_accepts_pdf(_GtkPrinter *);
+extern (C) int gtk_printer_is_default(_GtkPrinter *);
+extern (C) int gtk_printer_is_virtual(_GtkPrinter *);
+extern (C) int gtk_printer_is_active(_GtkPrinter *);
+extern (C) int gtk_printer_get_job_count(_GtkPrinter *);
+extern (C) char * gtk_printer_get_icon_name(_GtkPrinter *);
+extern (C) char * gtk_printer_get_location(_GtkPrinter *);
+extern (C) char * gtk_printer_get_description(_GtkPrinter *);
+extern (C) char * gtk_printer_get_state_message(_GtkPrinter *);
+extern (C) char * gtk_printer_get_name(_GtkPrinter *);
+extern (C) void * gtk_printer_get_backend(_GtkPrinter *);
+extern (C) _GtkPrinter * gtk_printer_new(char *, void *, int);
+extern (C) uint gtk_printer_get_type();
+extern (C) uint gtk_print_capabilities_get_type();
+extern (C) void * gtk_page_setup_unix_dialog_get_print_settings(_GtkPageSetupUnixDialog *);
+extern (C) void gtk_page_setup_unix_dialog_set_print_settings(_GtkPageSetupUnixDialog *, void *);
+extern (C) void * gtk_page_setup_unix_dialog_get_page_setup(_GtkPageSetupUnixDialog *);
+extern (C) void gtk_page_setup_unix_dialog_set_page_setup(_GtkPageSetupUnixDialog *, void *);
+extern (C) _GtkWidget * gtk_page_setup_unix_dialog_new(char *, _GtkWindow *);
+extern (C) uint gtk_page_setup_unix_dialog_get_type();
+} // version(DYNLINK)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/pango.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,1621 @@
+/******************************************************************************
+    Based on the generated files from the BCD tool
+    modified by: Frank Benoit <keinfarbton@googlemail.com>
+******************************************************************************/
+module org.eclipse.swt.internal.c.pango;
+
+import java.lang.all;
+
+//version=DYNLINK;
+
+public import org.eclipse.swt.internal.c.glib_object;
+
+version(DYNLINK){
+    import tango.sys.SharedLib : SharedLib;
+    struct Symbol{
+        String name;
+        void** symbol;
+    }
+}
+
+void loadLib(){
+    version(DYNLINK){
+        String libname = "libpango-1.0.so";
+
+        SharedLib lib = SharedLib.load( libname );
+        if( lib is null ){
+            lib = SharedLib.load( libname ~ ".0" );
+        }
+        int loaded;
+        if ( lib !is null ) {
+            foreach( s; symbols ){
+                try{
+                    *s.symbol = lib.getSymbol( s.name.ptr );
+                }
+                catch(Exception e){}
+                if( *s.symbol is null ){
+                    getDwtLogger().trace( __FILE__, __LINE__,  "{}: Symbol '{}' not found", libname, s.name );
+                }
+                else{
+                    loaded++;
+                }
+            }
+        } else {
+            getDwtLogger().trace( __FILE__, __LINE__,  "Could not load the library {}", libname );
+        }
+    }
+}
+
+
+
+
+extern(C):
+align(4):
+
+
+struct _IO_FILE{};
+// .. gen ..
+
+const int PANGO_SCALE = 1024;
+const int PANGO_VERSION_MAJOR = 1;
+const int PANGO_VERSION_MINOR = 18;
+const int PANGO_VERSION_MICRO = 3;
+const String PANGO_VERSION_STRING = "1.18.3";
+enum PangoRenderPart {
+PANGO_RENDER_PART_FOREGROUND=0,
+PANGO_RENDER_PART_BACKGROUND=1,
+PANGO_RENDER_PART_UNDERLINE=2,
+PANGO_RENDER_PART_STRIKETHROUGH=3,
+}
+alias void PangoRendererPrivate;
+alias _PangoRendererClass PangoRendererClass;
+alias _PangoRenderer PangoRenderer;
+alias void PangoFont;
+alias _PangoGlyphString PangoGlyphString;
+alias void function(_PangoRenderer *, void *, _PangoGlyphString *, int, int) _BCD_func__4309;
+alias void function(_PangoRenderer *, int, int, int, int, int) _BCD_func__4310;
+alias void function(_PangoRenderer *, int, int, int, int) _BCD_func__4311;
+alias _PangoAttrShape PangoAttrShape;
+alias void function(_PangoRenderer *, _PangoAttrShape *, int, int) _BCD_func__4312;
+alias void function(_PangoRenderer *, int, double, double, double, double, double, double) _BCD_func__4313;
+alias void function(_PangoRenderer *, void *, uint, double, double) _BCD_func__4314;
+alias void function(_PangoRenderer *, int) _BCD_func__4315;
+alias void function(_PangoRenderer *) _BCD_func__4316;
+alias _PangoGlyphItem PangoGlyphItem;
+alias _PangoGlyphItem PangoLayoutRun;
+alias void function(_PangoRenderer *, _PangoGlyphItem *) _BCD_func__4317;
+alias void function() _BCD_func__3343;
+enum PangoUnderline {
+PANGO_UNDERLINE_NONE=0,
+PANGO_UNDERLINE_SINGLE=1,
+PANGO_UNDERLINE_DOUBLE=2,
+PANGO_UNDERLINE_LOW=3,
+PANGO_UNDERLINE_ERROR=4,
+}
+alias _PangoMatrix PangoMatrix;
+alias void PangoLayoutIter;
+enum PangoEllipsizeMode {
+PANGO_ELLIPSIZE_NONE=0,
+PANGO_ELLIPSIZE_START=1,
+PANGO_ELLIPSIZE_MIDDLE=2,
+PANGO_ELLIPSIZE_END=3,
+}
+enum PangoWrapMode {
+PANGO_WRAP_WORD=0,
+PANGO_WRAP_CHAR=1,
+PANGO_WRAP_WORD_CHAR=2,
+}
+enum PangoAlignment {
+PANGO_ALIGN_LEFT=0,
+PANGO_ALIGN_CENTER=1,
+PANGO_ALIGN_RIGHT=2,
+}
+alias _PangoLayoutLine PangoLayoutLine;
+alias void PangoLayout;
+alias void PangoLayoutClass;
+enum PangoTabAlign {
+PANGO_TAB_LEFT=0,
+}
+alias void PangoTabArray;
+alias _PangoItem PangoItem;
+alias int PangoGlyphUnit;
+alias _PangoGlyphInfo PangoGlyphInfo;
+alias uint PangoGlyph;
+alias _PangoGlyphGeometry PangoGlyphGeometry;
+alias _PangoGlyphVisAttr PangoGlyphVisAttr;
+alias void PangoContextClass;
+alias void PangoContext;
+alias void PangoFontset;
+alias int function(void *, void *, void *) _BCD_func__3004;
+alias _BCD_func__3004 PangoFontsetForeachFunc;
+alias _PangoAnalysis PangoAnalysis;
+alias void PangoEngineShape;
+alias void PangoEngineLang;
+alias void PangoLanguage;
+alias void * function(void *) _BCD_func__3030;
+alias _BCD_func__3030 PangoAttrDataCopyFunc;
+alias _PangoAttribute PangoAttribute;
+alias int function(_PangoAttribute *, void *) _BCD_func__3031;
+alias _BCD_func__3031 PangoAttrFilterFunc;
+enum PangoAttrType {
+PANGO_ATTR_INVALID=0,
+PANGO_ATTR_LANGUAGE=1,
+PANGO_ATTR_FAMILY=2,
+PANGO_ATTR_STYLE=3,
+PANGO_ATTR_WEIGHT=4,
+PANGO_ATTR_VARIANT=5,
+PANGO_ATTR_STRETCH=6,
+PANGO_ATTR_SIZE=7,
+PANGO_ATTR_FONT_DESC=8,
+PANGO_ATTR_FOREGROUND=9,
+PANGO_ATTR_BACKGROUND=10,
+PANGO_ATTR_UNDERLINE=11,
+PANGO_ATTR_STRIKETHROUGH=12,
+PANGO_ATTR_RISE=13,
+PANGO_ATTR_SHAPE=14,
+PANGO_ATTR_SCALE=15,
+PANGO_ATTR_FALLBACK=16,
+PANGO_ATTR_LETTER_SPACING=17,
+PANGO_ATTR_UNDERLINE_COLOR=18,
+PANGO_ATTR_STRIKETHROUGH_COLOR=19,
+PANGO_ATTR_ABSOLUTE_SIZE=20,
+PANGO_ATTR_GRAVITY=21,
+PANGO_ATTR_GRAVITY_HINT=22,
+}
+alias void PangoAttrIterator;
+alias void PangoAttrList;
+alias _PangoRectangle PangoRectangle;
+alias void function(void *) _BCD_func__2834;
+alias _PangoAttrFontDesc PangoAttrFontDesc;
+alias void PangoFontDescription;
+alias _PangoAttrColor PangoAttrColor;
+alias _PangoColor PangoColor;
+alias _PangoAttrFloat PangoAttrFloat;
+alias _PangoAttrSize PangoAttrSize;
+alias _PangoAttrInt PangoAttrInt;
+alias _PangoAttrLanguage PangoAttrLanguage;
+alias _PangoAttrString PangoAttrString;
+alias _PangoAttrClass PangoAttrClass;
+alias _PangoAttribute * function(_PangoAttribute *) _BCD_func__4336;
+alias void function(_PangoAttribute *) _BCD_func__4337;
+alias int function(_PangoAttribute *, _PangoAttribute *) _BCD_func__4338;
+alias void PangoFontFace;
+alias void PangoFontFamily;
+enum PangoFontMask {
+PANGO_FONT_MASK_FAMILY=1,
+PANGO_FONT_MASK_STYLE=2,
+PANGO_FONT_MASK_VARIANT=4,
+PANGO_FONT_MASK_WEIGHT=8,
+PANGO_FONT_MASK_STRETCH=16,
+PANGO_FONT_MASK_SIZE=32,
+PANGO_FONT_MASK_GRAVITY=64,
+}
+enum PangoStretch {
+PANGO_STRETCH_ULTRA_CONDENSED=0,
+PANGO_STRETCH_EXTRA_CONDENSED=1,
+PANGO_STRETCH_CONDENSED=2,
+PANGO_STRETCH_SEMI_CONDENSED=3,
+PANGO_STRETCH_NORMAL=4,
+PANGO_STRETCH_SEMI_EXPANDED=5,
+PANGO_STRETCH_EXPANDED=6,
+PANGO_STRETCH_EXTRA_EXPANDED=7,
+PANGO_STRETCH_ULTRA_EXPANDED=8,
+}
+enum PangoWeight {
+PANGO_WEIGHT_ULTRALIGHT=200,
+PANGO_WEIGHT_LIGHT=300,
+PANGO_WEIGHT_NORMAL=400,
+PANGO_WEIGHT_SEMIBOLD=600,
+PANGO_WEIGHT_BOLD=700,
+PANGO_WEIGHT_ULTRABOLD=800,
+PANGO_WEIGHT_HEAVY=900,
+}
+enum PangoVariant {
+PANGO_VARIANT_NORMAL=0,
+PANGO_VARIANT_SMALL_CAPS=1,
+}
+enum PangoStyle {
+PANGO_STYLE_NORMAL=0,
+PANGO_STYLE_OBLIQUE=1,
+PANGO_STYLE_ITALIC=2,
+}
+alias void PangoFontMetrics;
+enum PangoScript {
+PANGO_SCRIPT_INVALID_CODE=-1,
+PANGO_SCRIPT_COMMON=0,
+PANGO_SCRIPT_INHERITED=1,
+PANGO_SCRIPT_ARABIC=2,
+PANGO_SCRIPT_ARMENIAN=3,
+PANGO_SCRIPT_BENGALI=4,
+PANGO_SCRIPT_BOPOMOFO=5,
+PANGO_SCRIPT_CHEROKEE=6,
+PANGO_SCRIPT_COPTIC=7,
+PANGO_SCRIPT_CYRILLIC=8,
+PANGO_SCRIPT_DESERET=9,
+PANGO_SCRIPT_DEVANAGARI=10,
+PANGO_SCRIPT_ETHIOPIC=11,
+PANGO_SCRIPT_GEORGIAN=12,
+PANGO_SCRIPT_GOTHIC=13,
+PANGO_SCRIPT_GREEK=14,
+PANGO_SCRIPT_GUJARATI=15,
+PANGO_SCRIPT_GURMUKHI=16,
+PANGO_SCRIPT_HAN=17,
+PANGO_SCRIPT_HANGUL=18,
+PANGO_SCRIPT_HEBREW=19,
+PANGO_SCRIPT_HIRAGANA=20,
+PANGO_SCRIPT_KANNADA=21,
+PANGO_SCRIPT_KATAKANA=22,
+PANGO_SCRIPT_KHMER=23,
+PANGO_SCRIPT_LAO=24,
+PANGO_SCRIPT_LATIN=25,
+PANGO_SCRIPT_MALAYALAM=26,
+PANGO_SCRIPT_MONGOLIAN=27,
+PANGO_SCRIPT_MYANMAR=28,
+PANGO_SCRIPT_OGHAM=29,
+PANGO_SCRIPT_OLD_ITALIC=30,
+PANGO_SCRIPT_ORIYA=31,
+PANGO_SCRIPT_RUNIC=32,
+PANGO_SCRIPT_SINHALA=33,
+PANGO_SCRIPT_SYRIAC=34,
+PANGO_SCRIPT_TAMIL=35,
+PANGO_SCRIPT_TELUGU=36,
+PANGO_SCRIPT_THAANA=37,
+PANGO_SCRIPT_THAI=38,
+PANGO_SCRIPT_TIBETAN=39,
+PANGO_SCRIPT_CANADIAN_ABORIGINAL=40,
+PANGO_SCRIPT_YI=41,
+PANGO_SCRIPT_TAGALOG=42,
+PANGO_SCRIPT_HANUNOO=43,
+PANGO_SCRIPT_BUHID=44,
+PANGO_SCRIPT_TAGBANWA=45,
+PANGO_SCRIPT_BRAILLE=46,
+PANGO_SCRIPT_CYPRIOT=47,
+PANGO_SCRIPT_LIMBU=48,
+PANGO_SCRIPT_OSMANYA=49,
+PANGO_SCRIPT_SHAVIAN=50,
+PANGO_SCRIPT_LINEAR_B=51,
+PANGO_SCRIPT_TAI_LE=52,
+PANGO_SCRIPT_UGARITIC=53,
+PANGO_SCRIPT_NEW_TAI_LUE=54,
+PANGO_SCRIPT_BUGINESE=55,
+PANGO_SCRIPT_GLAGOLITIC=56,
+PANGO_SCRIPT_TIFINAGH=57,
+PANGO_SCRIPT_SYLOTI_NAGRI=58,
+PANGO_SCRIPT_OLD_PERSIAN=59,
+PANGO_SCRIPT_KHAROSHTHI=60,
+PANGO_SCRIPT_UNKNOWN=61,
+PANGO_SCRIPT_BALINESE=62,
+PANGO_SCRIPT_CUNEIFORM=63,
+PANGO_SCRIPT_PHOENICIAN=64,
+PANGO_SCRIPT_PHAGS_PA=65,
+PANGO_SCRIPT_NKO=66,
+}
+alias void PangoScriptIter;
+enum PangoGravityHint {
+PANGO_GRAVITY_HINT_NATURAL=0,
+PANGO_GRAVITY_HINT_STRONG=1,
+PANGO_GRAVITY_HINT_LINE=2,
+}
+enum PangoGravity {
+PANGO_GRAVITY_SOUTH=0,
+PANGO_GRAVITY_EAST=1,
+PANGO_GRAVITY_NORTH=2,
+PANGO_GRAVITY_WEST=3,
+PANGO_GRAVITY_AUTO=4,
+}
+enum PangoDirection {
+PANGO_DIRECTION_LTR=0,
+PANGO_DIRECTION_RTL=1,
+PANGO_DIRECTION_TTB_LTR=2,
+PANGO_DIRECTION_TTB_RTL=3,
+PANGO_DIRECTION_WEAK_LTR=4,
+PANGO_DIRECTION_WEAK_RTL=5,
+PANGO_DIRECTION_NEUTRAL=6,
+}
+alias void PangoFontMap;
+alias _PangoLogAttr PangoLogAttr;
+enum PangoCoverageLevel {
+PANGO_COVERAGE_NONE=0,
+PANGO_COVERAGE_FALLBACK=1,
+PANGO_COVERAGE_APPROXIMATE=2,
+PANGO_COVERAGE_EXACT=3,
+}
+alias void PangoCoverage;
+alias int function(void *) _BCD_func__143;
+alias int function(void *, long *, int) _BCD_func__145;
+alias int function(void *, char *, uint) _BCD_func__147;
+alias int function(void *, char *, uint) _BCD_func__149;
+alias int function(void * *, char *) _BCD_func__2835;
+alias int function(char *, char * * *, uint *) _BCD_func__2836;
+alias int function(void *, char *, char *, char *, char *) _BCD_func__2837;
+alias int function(__gconv_step *, __gconv_step_data *, void *, char *, char * *, char *, char * *, uint *) _BCD_func__2838;
+alias void function(__gconv_step *) _BCD_func__2839;
+alias int function(__gconv_step *) _BCD_func__2840;
+alias uint function(__gconv_step *, char) _BCD_func__2841;
+alias int function(__gconv_step *, __gconv_step_data *, char * *, char *, char * *, uint *, int, int) _BCD_func__2842;
+alias void function(void *, uint, uint, _GInterfaceInfo *) _BCD_func__3136;
+alias void function(void *, uint, _GTypeInfo *, _GTypeValueTable *) _BCD_func__3137;
+alias void function(void *) _BCD_func__3138;
+alias void function(void *, _GObject *, int) _BCD_func__3286;
+alias void function(void *, _GObject *) _BCD_func__3292;
+alias void function(_GObject *) _BCD_func__3293;
+alias void function(_GObject *, uint, _GValue *, _GParamSpec *) _BCD_func__3294;
+alias void function(_GObject *, uint, _GValue *, _GParamSpec *) _BCD_func__3295;
+alias int function(_GSignalInvocationHint *, _GValue *, _GValue *, void *) _BCD_func__3321;
+alias int function(_GSignalInvocationHint *, uint, _GValue *, void *) _BCD_func__3322;
+alias void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *) _BCD_func__3323;
+alias void function(void *, _GClosure *) _BCD_func__3342;
+alias void function(_GValue *, _GValue *) _BCD_func__3400;
+alias void * function(void *) _BCD_func__3428;
+alias void function(void *, void *) _BCD_func__3432;
+alias int function(void *, _GTypeClass *) _BCD_func__3433;
+alias void function(_GTypeInstance *, void *) _BCD_func__3434;
+alias int function(void *, void *, void *) _BCD_func__3490;
+alias int function(void *, void *, void *) _BCD_func__3506;
+alias void function(_GScanner *, char *, int) _BCD_func__3509;
+alias int function(void *, _GString *, void *) _BCD_func__3582;
+alias void function(void *, void *, void *, _GError * *) _BCD_func__3600;
+alias int function(void *, void *, void *, _GError * *) _BCD_func__3601;
+alias int function(char *, char *, void *, _GError * *) _BCD_func__3602;
+alias void * function(void *, void *) _BCD_func__3613;
+alias void function(_GNode *, void *) _BCD_func__3614;
+alias int function(_GNode *, void *) _BCD_func__3615;
+alias void function(char *) _BCD_func__3623;
+alias void function(char *, int, char *, void *) _BCD_func__3625;
+alias int function(_GIOChannel *, int, void *) _BCD_func__3642;
+alias int function(_GPollFD *, uint, int) _BCD_func__3694;
+alias void function(int, int, void *) _BCD_func__3700;
+alias int function(void *) _BCD_func__3701;
+alias void function(_GHookList *, _GHook *) _BCD_func__3736;
+alias int function(_GHook *, void *) _BCD_func__3737;
+alias void function(_GHook *, void *) _BCD_func__3738;
+alias int function(_GHook *, _GHook *) _BCD_func__3739;
+alias void function(uint, void *, void *) _BCD_func__3773;
+alias int function(char *, char *, uint) _BCD_func__3776;
+alias char * function(void *) _BCD_func__3777;
+alias char * function(char *, void *) _BCD_func__3965;
+alias void function(void *, void *, void *) _BCD_func__3966;
+alias uint function(void *) _BCD_func__3967;
+alias int function(void *, void *) _BCD_func__3968;
+alias int function(void *, void *, void *) _BCD_func__3969;
+alias int function(void *, void *) _BCD_func__3970;
+struct _PangoRendererClass {
+_GObjectClass parent_class;
+_BCD_func__4309 draw_glyphs;
+_BCD_func__4310 draw_rectangle;
+_BCD_func__4311 draw_error_underline;
+_BCD_func__4312 draw_shape;
+_BCD_func__4313 draw_trapezoid;
+_BCD_func__4314 draw_glyph;
+_BCD_func__4315 part_changed;
+_BCD_func__4316 begin;
+_BCD_func__4316 end;
+_BCD_func__4317 prepare_run;
+_BCD_func__3343 _pango_reserved1;
+_BCD_func__3343 _pango_reserved2;
+_BCD_func__3343 _pango_reserved3;
+_BCD_func__3343 _pango_reserved4;
+}
+struct _PangoRenderer {
+_GObject parent_instance;
+int underline;
+int strikethrough;
+int active_count;
+_PangoMatrix * matrix;
+void * priv;
+}
+struct _PangoLayoutLine {
+void * layout;
+int start_index;
+int length;
+_GSList * runs;
+uint bitfield0;
+// uint is_paragraph_start // bits 0 .. 1
+// uint resolved_dir // bits 1 .. 4
+uint is_paragraph_start(){ return ( bitfield0 >> 0 ) & 0x01; }
+uint resolved_dir      (){ return ( bitfield0 >> 1 ) & 0x07; }
+
+uint is_paragraph_start( uint v ){ bitfield0 &= ~( 0x01 << 0 ); bitfield0 |= ( v & 0x01 ) << 0; return is_paragraph_start(); }
+uint resolved_dir      ( uint v ){ bitfield0 &= ~( 0x07 << 1 ); bitfield0 |= ( v & 0x07 ) << 1; return resolved_dir      (); }
+
+}
+struct _PangoGlyphItem {
+_PangoItem * item;
+_PangoGlyphString * glyphs;
+}
+struct _PangoGlyphString {
+int num_glyphs;
+_PangoGlyphInfo * glyphs;
+int * log_clusters;
+int space;
+}
+struct _PangoGlyphInfo {
+uint glyph;
+_PangoGlyphGeometry geometry;
+_PangoGlyphVisAttr attr;
+}
+struct _PangoGlyphVisAttr {
+uint bitfield0;
+// uint is_cluster_start // bits 0 .. 1
+}
+struct _PangoGlyphGeometry {
+int width;
+int x_offset;
+int y_offset;
+}
+struct _PangoItem {
+int offset;
+int length;
+int num_chars;
+_PangoAnalysis analysis;
+}
+struct _PangoAnalysis {
+void * shape_engine;
+void * lang_engine;
+void * font;
+char level;
+char gravity;
+char flags;
+char script;
+void * language;
+_GSList * extra_attrs;
+}
+struct _PangoAttrShape {
+_PangoAttribute attr;
+_PangoRectangle ink_rect;
+_PangoRectangle logical_rect;
+void * data;
+_BCD_func__3030 copy_func;
+_BCD_func__2834 destroy_func;
+}
+struct _PangoAttrFontDesc {
+_PangoAttribute attr;
+void * desc;
+}
+struct _PangoAttrColor {
+_PangoAttribute attr;
+_PangoColor color;
+}
+struct _PangoAttrFloat {
+_PangoAttribute attr;
+double value;
+}
+struct _PangoAttrSize {
+_PangoAttribute attr;
+int size;
+uint bitfield0;
+// uint absolute // bits 0 .. 1
+}
+struct _PangoAttrInt {
+_PangoAttribute attr;
+int value;
+}
+struct _PangoAttrLanguage {
+_PangoAttribute attr;
+void * value;
+}
+struct _PangoAttrString {
+_PangoAttribute attr;
+char * value;
+}
+struct _PangoAttrClass {
+int type;
+_BCD_func__4336 copy;
+_BCD_func__4337 destroy;
+_BCD_func__4338 equal;
+}
+struct _PangoAttribute {
+_PangoAttrClass * klass;
+uint start_index;
+uint end_index;
+}
+struct _PangoColor {
+ushort red;
+ushort green;
+ushort blue;
+}
+struct _PangoMatrix {
+double xx;
+double xy;
+double yx;
+double yy;
+double x0;
+double y0;
+}
+struct _PangoRectangle {
+int x;
+int y;
+int width;
+int height;
+}
+struct _PangoLogAttr {
+uint bitfield0;
+bool is_line_break              (){ return (bitfield0 & (1<< 0)) !is 0; }
+bool is_mandatory_break         (){ return (bitfield0 & (1<< 1)) !is 0; }
+bool is_char_break              (){ return (bitfield0 & (1<< 2)) !is 0; }
+bool is_white                   (){ return (bitfield0 & (1<< 3)) !is 0; }
+bool is_cursor_position         (){ return (bitfield0 & (1<< 4)) !is 0; }
+bool is_word_start              (){ return (bitfield0 & (1<< 5)) !is 0; }
+bool is_word_end                (){ return (bitfield0 & (1<< 6)) !is 0; }
+bool is_sentence_boundary       (){ return (bitfield0 & (1<< 7)) !is 0; }
+bool is_sentence_start          (){ return (bitfield0 & (1<< 8)) !is 0; }
+bool is_sentence_end            (){ return (bitfield0 & (1<< 9)) !is 0; }
+bool backspace_deletes_character(){ return (bitfield0 & (1<<10)) !is 0; }
+bool is_expandable_space        (){ return (bitfield0 & (1<<11)) !is 0; }
+bool is_line_break              (bool v){ if(v) bitfield0 |= (1<< 0); else bitfield0 &= ~(1<< 0); return v; }
+bool is_mandatory_break         (bool v){ if(v) bitfield0 |= (1<< 1); else bitfield0 &= ~(1<< 1); return v; }
+bool is_char_break              (bool v){ if(v) bitfield0 |= (1<< 2); else bitfield0 &= ~(1<< 2); return v; }
+bool is_white                   (bool v){ if(v) bitfield0 |= (1<< 3); else bitfield0 &= ~(1<< 3); return v; }
+bool is_cursor_position         (bool v){ if(v) bitfield0 |= (1<< 4); else bitfield0 &= ~(1<< 4); return v; }
+bool is_word_start              (bool v){ if(v) bitfield0 |= (1<< 5); else bitfield0 &= ~(1<< 5); return v; }
+bool is_word_end                (bool v){ if(v) bitfield0 |= (1<< 6); else bitfield0 &= ~(1<< 6); return v; }
+bool is_sentence_boundary       (bool v){ if(v) bitfield0 |= (1<< 7); else bitfield0 &= ~(1<< 7); return v; }
+bool is_sentence_start          (bool v){ if(v) bitfield0 |= (1<< 8); else bitfield0 &= ~(1<< 8); return v; }
+bool is_sentence_end            (bool v){ if(v) bitfield0 |= (1<< 9); else bitfield0 &= ~(1<< 9); return v; }
+bool backspace_deletes_character(bool v){ if(v) bitfield0 |= (1<<10); else bitfield0 &= ~(1<<10); return v; }
+bool is_expandable_space        (bool v){ if(v) bitfield0 |= (1<<11); else bitfield0 &= ~(1<<11); return v; }
+// uint is_line_break // bits 0 .. 1
+// uint is_mandatory_break // bits 1 .. 2
+// uint is_char_break // bits 2 .. 3
+// uint is_white // bits 3 .. 4
+// uint is_cursor_position // bits 4 .. 5
+// uint is_word_start // bits 5 .. 6
+// uint is_word_end // bits 6 .. 7
+// uint is_sentence_boundary // bits 7 .. 8
+// uint is_sentence_start // bits 8 .. 9
+// uint is_sentence_end // bits 9 .. 10
+// uint backspace_deletes_character // bits 10 .. 11
+// uint is_expandable_space // bits 11 .. 12
+}
+version(DYNLINK){
+extern (C) char * function(int, int, int)pango_version_check;
+extern (C) char * function()pango_version_string;
+extern (C) int function()pango_version;
+extern (C) int function(uint)pango_is_zero_width;
+extern (C) char * function(char *, int, int *)pango_log2vis_get_embedding_levels;
+extern (C) void function(int *, int *)pango_quantize_line_geometry;
+extern (C) int function(char *, int *, int)pango_parse_stretch;
+extern (C) int function(char *, int *, int)pango_parse_weight;
+extern (C) int function(char *, int *, int)pango_parse_variant;
+extern (C) int function(char *, int *, int)pango_parse_style;
+extern (C) int function(uint, char *, int *, int, char * *)pango_parse_enum;
+extern (C) int function(char * *, int *)pango_scan_int;
+extern (C) int function(char * *, _GString *)pango_scan_string;
+extern (C) int function(char * *, _GString *)pango_scan_word;
+extern (C) int function(char * *)pango_skip_space;
+extern (C) int function(_IO_FILE *, _GString *)pango_read_line;
+extern (C) char * function(char *)pango_trim_string;
+extern (C) char * * function(char *)pango_split_file_list;
+extern (C) _PangoMatrix * function(_PangoRenderer *)pango_renderer_get_matrix;
+extern (C) void function(_PangoRenderer *, _PangoMatrix *)pango_renderer_set_matrix;
+extern (C) _PangoColor * function(_PangoRenderer *, int)pango_renderer_get_color;
+extern (C) void function(_PangoRenderer *, int, _PangoColor *)pango_renderer_set_color;
+extern (C) void function(_PangoRenderer *, int)pango_renderer_part_changed;
+extern (C) void function(_PangoRenderer *)pango_renderer_deactivate;
+extern (C) void function(_PangoRenderer *)pango_renderer_activate;
+extern (C) void function(_PangoRenderer *, void *, uint, double, double)pango_renderer_draw_glyph;
+extern (C) void function(_PangoRenderer *, int, double, double, double, double, double, double)pango_renderer_draw_trapezoid;
+extern (C) void function(_PangoRenderer *, int, int, int, int)pango_renderer_draw_error_underline;
+extern (C) void function(_PangoRenderer *, int, int, int, int, int)pango_renderer_draw_rectangle;
+extern (C) void function(_PangoRenderer *, void *, _PangoGlyphString *, int, int)pango_renderer_draw_glyphs;
+extern (C) void function(_PangoRenderer *, _PangoLayoutLine *, int, int)pango_renderer_draw_layout_line;
+extern (C) void function(_PangoRenderer *, void *, int, int)pango_renderer_draw_layout;
+extern (C) uint function()pango_renderer_get_type;
+extern (C) int function(void *)pango_layout_iter_get_baseline;
+extern (C) void function(void *, _PangoRectangle *, _PangoRectangle *)pango_layout_iter_get_layout_extents;
+extern (C) void function(void *, int *, int *)pango_layout_iter_get_line_yrange;
+extern (C) void function(void *, _PangoRectangle *, _PangoRectangle *)pango_layout_iter_get_line_extents;
+extern (C) void function(void *, _PangoRectangle *, _PangoRectangle *)pango_layout_iter_get_run_extents;
+extern (C) void function(void *, _PangoRectangle *, _PangoRectangle *)pango_layout_iter_get_cluster_extents;
+extern (C) void function(void *, _PangoRectangle *)pango_layout_iter_get_char_extents;
+extern (C) int function(void *)pango_layout_iter_next_line;
+extern (C) int function(void *)pango_layout_iter_next_run;
+extern (C) int function(void *)pango_layout_iter_next_cluster;
+extern (C) int function(void *)pango_layout_iter_next_char;
+extern (C) int function(void *)pango_layout_iter_at_last_line;
+extern (C) _PangoLayoutLine * function(void *)pango_layout_iter_get_line_readonly;
+extern (C) _PangoLayoutLine * function(void *)pango_layout_iter_get_line;
+extern (C) _PangoGlyphItem * function(void *)pango_layout_iter_get_run_readonly;
+extern (C) _PangoGlyphItem * function(void *)pango_layout_iter_get_run;
+extern (C) int function(void *)pango_layout_iter_get_index;
+extern (C) void function(void *)pango_layout_iter_free;
+extern (C) void * function(void *)pango_layout_get_iter;
+extern (C) uint function()pango_layout_iter_get_type;
+extern (C) void function(_PangoLayoutLine *, _PangoRectangle *, _PangoRectangle *)pango_layout_line_get_pixel_extents;
+extern (C) void function(_PangoLayoutLine *, _PangoRectangle *, _PangoRectangle *)pango_layout_line_get_extents;
+extern (C) void function(_PangoLayoutLine *, int, int, int * *, int *)pango_layout_line_get_x_ranges;
+extern (C) void function(_PangoLayoutLine *, int, int, int *)pango_layout_line_index_to_x;
+extern (C) int function(_PangoLayoutLine *, int, int *, int *)pango_layout_line_x_to_index;
+extern (C) void function(_PangoLayoutLine *)pango_layout_line_unref;
+extern (C) _PangoLayoutLine * function(_PangoLayoutLine *)pango_layout_line_ref;
+extern (C) uint function()pango_layout_line_get_type;
+extern (C) _GSList * function(void *)pango_layout_get_lines_readonly;
+extern (C) _GSList * function(void *)pango_layout_get_lines;
+extern (C) _PangoLayoutLine * function(void *, int)pango_layout_get_line_readonly;
+extern (C) _PangoLayoutLine * function(void *, int)pango_layout_get_line;
+extern (C) int function(void *)pango_layout_get_line_count;
+extern (C) void function(void *, int *, int *)pango_layout_get_pixel_size;
+extern (C) void function(void *, int *, int *)pango_layout_get_size;
+extern (C) void function(void *, _PangoRectangle *, _PangoRectangle *)pango_layout_get_pixel_extents;
+extern (C) void function(void *, _PangoRectangle *, _PangoRectangle *)pango_layout_get_extents;
+extern (C) int function(void *, int, int, int *, int *)pango_layout_xy_to_index;
+extern (C) void function(void *, int, int, int, int, int *, int *)pango_layout_move_cursor_visually;
+extern (C) void function(void *, int, _PangoRectangle *, _PangoRectangle *)pango_layout_get_cursor_pos;
+extern (C) void function(void *, int, int, int *, int *)pango_layout_index_to_line_x;
+extern (C) void function(void *, int, _PangoRectangle *)pango_layout_index_to_pos;
+extern (C) void function(void *, _PangoLogAttr * *, int *)pango_layout_get_log_attrs;
+extern (C) void function(void *)pango_layout_context_changed;
+extern (C) int function(void *)pango_layout_get_unknown_glyphs_count;
+extern (C) int function(void *)pango_layout_is_ellipsized;
+extern (C) int function(void *)pango_layout_get_ellipsize;
+extern (C) void function(void *, int)pango_layout_set_ellipsize;
+extern (C) int function(void *)pango_layout_get_single_paragraph_mode;
+extern (C) void function(void *, int)pango_layout_set_single_paragraph_mode;
+extern (C) void * function(void *)pango_layout_get_tabs;
+extern (C) void function(void *, void *)pango_layout_set_tabs;
+extern (C) int function(void *)pango_layout_get_alignment;
+extern (C) void function(void *, int)pango_layout_set_alignment;
+extern (C) int function(void *)pango_layout_get_auto_dir;
+extern (C) void function(void *, int)pango_layout_set_auto_dir;
+extern (C) int function(void *)pango_layout_get_justify;
+extern (C) void function(void *, int)pango_layout_set_justify;
+extern (C) int function(void *)pango_layout_get_spacing;
+extern (C) void function(void *, int)pango_layout_set_spacing;
+extern (C) int function(void *)pango_layout_get_indent;
+extern (C) void function(void *, int)pango_layout_set_indent;
+extern (C) int function(void *)pango_layout_is_wrapped;
+extern (C) int function(void *)pango_layout_get_wrap;
+extern (C) void function(void *, int)pango_layout_set_wrap;
+extern (C) int function(void *)pango_layout_get_width;
+extern (C) void function(void *, int)pango_layout_set_width;
+extern (C) void * function(void *)pango_layout_get_font_description;
+extern (C) void function(void *, void *)pango_layout_set_font_description;
+extern (C) void function(void *, char *, int, uint, uint *)pango_layout_set_markup_with_accel;
+extern (C) void function(void *, char *, int)pango_layout_set_markup;
+extern (C) char * function(void *)pango_layout_get_text;
+extern (C) void function(void *, char *, int)pango_layout_set_text;
+extern (C) void * function(void *)pango_layout_get_attributes;
+extern (C) void function(void *, void *)pango_layout_set_attributes;
+extern (C) void * function(void *)pango_layout_get_context;
+extern (C) void * function(void *)pango_layout_copy;
+extern (C) void * function(void *)pango_layout_new;
+extern (C) uint function()pango_layout_get_type;
+extern (C) int function(void *)pango_tab_array_get_positions_in_pixels;
+extern (C) void function(void *, int * *, int * *)pango_tab_array_get_tabs;
+extern (C) void function(void *, int, int *, int *)pango_tab_array_get_tab;
+extern (C) void function(void *, int, int, int)pango_tab_array_set_tab;
+extern (C) void function(void *, int)pango_tab_array_resize;
+extern (C) int function(void *)pango_tab_array_get_size;
+extern (C) void function(void *)pango_tab_array_free;
+extern (C) void * function(void *)pango_tab_array_copy;
+extern (C) uint function()pango_tab_array_get_type;
+extern (C) void * function(int, int, int, int, ...)pango_tab_array_new_with_positions;
+extern (C) void * function(int, int)pango_tab_array_new;
+extern (C) void function(_PangoGlyphItem *, char *, _PangoLogAttr *, int)pango_glyph_item_letter_space;
+extern (C) _GSList * function(_PangoGlyphItem *, char *, void *)pango_glyph_item_apply_attrs;
+extern (C) void function(_PangoGlyphItem *)pango_glyph_item_free;
+extern (C) _PangoGlyphItem * function(_PangoGlyphItem *, char *, int)pango_glyph_item_split;
+extern (C) uint function()pango_direction_get_type;
+extern (C) uint function()pango_tab_align_get_type;
+extern (C) uint function()pango_script_get_type;
+extern (C) uint function()pango_render_part_get_type;
+extern (C) uint function()pango_ellipsize_mode_get_type;
+extern (C) uint function()pango_wrap_mode_get_type;
+extern (C) uint function()pango_alignment_get_type;
+extern (C) uint function()pango_gravity_hint_get_type;
+extern (C) uint function()pango_gravity_get_type;
+extern (C) uint function()pango_font_mask_get_type;
+extern (C) uint function()pango_stretch_get_type;
+extern (C) uint function()pango_weight_get_type;
+extern (C) uint function()pango_variant_get_type;
+extern (C) uint function()pango_style_get_type;
+extern (C) uint function()pango_coverage_level_get_type;
+extern (C) uint function()pango_underline_get_type;
+extern (C) uint function()pango_attr_type_get_type;
+extern (C) _GList * function(_GList *)pango_reorder_items;
+extern (C) void function(char *, int, _PangoAnalysis *, _PangoGlyphString *)pango_shape;
+extern (C) void function(_PangoGlyphString *, char *, int, _PangoAnalysis *, int, int *, int *)pango_glyph_string_x_to_index;
+extern (C) void function(_PangoGlyphString *, char *, int, _PangoAnalysis *, int, int, int *)pango_glyph_string_index_to_x;
+extern (C) void function(_PangoGlyphString *, char *, int, int, int *)pango_glyph_string_get_logical_widths;
+extern (C) void function(_PangoGlyphString *, int, int, void *, _PangoRectangle *, _PangoRectangle *)pango_glyph_string_extents_range;
+extern (C) int function(_PangoGlyphString *)pango_glyph_string_get_width;
+extern (C) void function(_PangoGlyphString *, void *, _PangoRectangle *, _PangoRectangle *)pango_glyph_string_extents;
+extern (C) void function(_PangoGlyphString *)pango_glyph_string_free;
+extern (C) _PangoGlyphString * function(_PangoGlyphString *)pango_glyph_string_copy;
+extern (C) uint function()pango_glyph_string_get_type;
+extern (C) void function(_PangoGlyphString *, int)pango_glyph_string_set_size;
+extern (C) _PangoGlyphString * function()pango_glyph_string_new;
+extern (C) _GList * function(void *, int, char *, int, int, void *, void *)pango_itemize_with_base_dir;
+extern (C) _GList * function(void *, char *, int, int, void *, void *)pango_itemize;
+extern (C) _PangoMatrix * function(void *)pango_context_get_matrix;
+extern (C) void function(void *, _PangoMatrix *)pango_context_set_matrix;
+extern (C) int function(void *)pango_context_get_gravity_hint;
+extern (C) void function(void *, int)pango_context_set_gravity_hint;
+extern (C) int function(void *)pango_context_get_gravity;
+extern (C) int function(void *)pango_context_get_base_gravity;
+extern (C) void function(void *, int)pango_context_set_base_gravity;
+extern (C) int function(void *)pango_context_get_base_dir;
+extern (C) void function(void *, int)pango_context_set_base_dir;
+extern (C) void function(void *, void *)pango_context_set_language;
+extern (C) void * function(void *)pango_context_get_language;
+extern (C) void * function(void *)pango_context_get_font_description;
+extern (C) void function(void *, void *)pango_context_set_font_description;
+extern (C) void * function(void *, void *, void *)pango_context_get_metrics;
+extern (C) void * function(void *, void *, void *)pango_context_load_fontset;
+extern (C) void * function(void *, void *)pango_context_load_font;
+extern (C) void function(void *, void * * *, int *)pango_context_list_families;
+extern (C) void * function(void *)pango_context_get_font_map;
+extern (C) uint function()pango_context_get_type;
+extern (C) void function(void *, void * * *, int *)pango_font_map_list_families;
+extern (C) void * function(void *, void *, void *, void *)pango_font_map_load_fontset;
+extern (C) void * function(void *, void *, void *)pango_font_map_load_font;
+extern (C) uint function()pango_font_map_get_type;
+extern (C) void function(void *, _BCD_func__3004, void *)pango_fontset_foreach;
+extern (C) void * function(void *)pango_fontset_get_metrics;
+extern (C) void * function(void *, uint)pango_fontset_get_font;
+extern (C) uint function()pango_fontset_get_type;
+extern (C) void function(char *, int, int, void *, _PangoLogAttr *, int)pango_get_log_attrs;
+extern (C) void function(char *, int, int *, int *)pango_find_paragraph_boundary;
+extern (C) void function(char *, int, _PangoAnalysis *, _PangoLogAttr *, int)pango_break;
+extern (C) _PangoItem * function(_PangoItem *, int, int)pango_item_split;
+extern (C) void function(_PangoItem *)pango_item_free;
+extern (C) _PangoItem * function(_PangoItem *)pango_item_copy;
+extern (C) _PangoItem * function()pango_item_new;
+extern (C) uint function()pango_item_get_type;
+extern (C) int function(char *, int, uint, void * *, char * *, uint *, _GError * *)pango_parse_markup;
+extern (C) _GSList * function(void *)pango_attr_iterator_get_attrs;
+extern (C) void function(void *, void *, void * *, _GSList * *)pango_attr_iterator_get_font;
+extern (C) _PangoAttribute * function(void *, int)pango_attr_iterator_get;
+extern (C) void function(void *)pango_attr_iterator_destroy;
+extern (C) void * function(void *)pango_attr_iterator_copy;
+extern (C) int function(void *)pango_attr_iterator_next;
+extern (C) void function(void *, int *, int *)pango_attr_iterator_range;
+extern (C) void * function(void *)pango_attr_list_get_iterator;
+extern (C) void * function(void *, _BCD_func__3031, void *)pango_attr_list_filter;
+extern (C) void function(void *, void *, int, int)pango_attr_list_splice;
+extern (C) void function(void *, _PangoAttribute *)pango_attr_list_change;
+extern (C) void function(void *, _PangoAttribute *)pango_attr_list_insert_before;
+extern (C) void function(void *, _PangoAttribute *)pango_attr_list_insert;
+extern (C) void * function(void *)pango_attr_list_copy;
+extern (C) void function(void *)pango_attr_list_unref;
+extern (C) void * function(void *)pango_attr_list_ref;
+extern (C) void * function()pango_attr_list_new;
+extern (C) uint function()pango_attr_list_get_type;
+extern (C) _PangoAttribute * function(int)pango_attr_gravity_hint_new;
+extern (C) _PangoAttribute * function(int)pango_attr_gravity_new;
+extern (C) _PangoAttribute * function(_PangoRectangle *, _PangoRectangle *, void *, _BCD_func__3030, _BCD_func__2834)pango_attr_shape_new_with_data;
+extern (C) _PangoAttribute * function(_PangoRectangle *, _PangoRectangle *)pango_attr_shape_new;
+extern (C) _PangoAttribute * function(int)pango_attr_letter_spacing_new;
+extern (C) _PangoAttribute * function(int)pango_attr_fallback_new;
+extern (C) _PangoAttribute * function(double)pango_attr_scale_new;
+extern (C) _PangoAttribute * function(int)pango_attr_rise_new;
+extern (C) _PangoAttribute * function(ushort, ushort, ushort)pango_attr_strikethrough_color_new;
+extern (C) _PangoAttribute * function(int)pango_attr_strikethrough_new;
+extern (C) _PangoAttribute * function(ushort, ushort, ushort)pango_attr_underline_color_new;
+extern (C) _PangoAttribute * function(int)pango_attr_underline_new;
+extern (C) _PangoAttribute * function(void *)pango_attr_font_desc_new;
+extern (C) _PangoAttribute * function(int)pango_attr_stretch_new;
+extern (C) _PangoAttribute * function(int)pango_attr_variant_new;
+extern (C) _PangoAttribute * function(int)pango_attr_weight_new;
+extern (C) _PangoAttribute * function(int)pango_attr_style_new;
+extern (C) _PangoAttribute * function(int)pango_attr_size_new_absolute;
+extern (C) _PangoAttribute * function(int)pango_attr_size_new;
+extern (C) _PangoAttribute * function(ushort, ushort, ushort)pango_attr_background_new;
+extern (C) _PangoAttribute * function(ushort, ushort, ushort)pango_attr_foreground_new;
+extern (C) _PangoAttribute * function(char *)pango_attr_family_new;
+extern (C) _PangoAttribute * function(void *)pango_attr_language_new;
+extern (C) int function(_PangoAttribute *, _PangoAttribute *)pango_attribute_equal;
+extern (C) void function(_PangoAttribute *)pango_attribute_destroy;
+extern (C) _PangoAttribute * function(_PangoAttribute *)pango_attribute_copy;
+extern (C) int function(char *)pango_attr_type_register;
+extern (C) char * function(_PangoColor *)pango_color_to_string;
+extern (C) int function(_PangoColor *, char *)pango_color_parse;
+extern (C) void function(_PangoColor *)pango_color_free;
+extern (C) _PangoColor * function(_PangoColor *)pango_color_copy;
+extern (C) uint function()pango_color_get_type;
+extern (C) void * function(void *)pango_font_get_font_map;
+extern (C) void function(void *, uint, _PangoRectangle *, _PangoRectangle *)pango_font_get_glyph_extents;
+extern (C) void * function(void *, void *)pango_font_get_metrics;
+extern (C) void * function(void *, void *, uint)pango_font_find_shaper;
+extern (C) void * function(void *, void *)pango_font_get_coverage;
+extern (C) void * function(void *)pango_font_describe_with_absolute_size;
+extern (C) void * function(void *)pango_font_describe;
+extern (C) uint function()pango_font_get_type;
+extern (C) int function(void *)pango_font_face_is_synthesized;
+extern (C) void function(void *, int * *, int *)pango_font_face_list_sizes;
+extern (C) char * function(void *)pango_font_face_get_face_name;
+extern (C) void * function(void *)pango_font_face_describe;
+extern (C) uint function()pango_font_face_get_type;
+extern (C) int function(void *)pango_font_family_is_monospace;
+extern (C) char * function(void *)pango_font_family_get_name;
+extern (C) void function(void *, void * * *, int *)pango_font_family_list_faces;
+extern (C) uint function()pango_font_family_get_type;
+extern (C) int function(void *)pango_font_metrics_get_strikethrough_thickness;
+extern (C) int function(void *)pango_font_metrics_get_strikethrough_position;
+extern (C) int function(void *)pango_font_metrics_get_underline_thickness;
+extern (C) int function(void *)pango_font_metrics_get_underline_position;
+extern (C) int function(void *)pango_font_metrics_get_approximate_digit_width;
+extern (C) int function(void *)pango_font_metrics_get_approximate_char_width;
+extern (C) int function(void *)pango_font_metrics_get_descent;
+extern (C) int function(void *)pango_font_metrics_get_ascent;
+extern (C) void function(void *)pango_font_metrics_unref;
+extern (C) void * function(void *)pango_font_metrics_ref;
+extern (C) uint function()pango_font_metrics_get_type;
+extern (C) char * function(void *)pango_font_description_to_filename;
+extern (C) char * function(void *)pango_font_description_to_string;
+extern (C) void * function(char *)pango_font_description_from_string;
+extern (C) int function(void *, void *, void *)pango_font_description_better_match;
+extern (C) void function(void *, void *, int)pango_font_description_merge_static;
+extern (C) void function(void *, void *, int)pango_font_description_merge;
+extern (C) void function(void *, int)pango_font_description_unset_fields;
+extern (C) int function(void *)pango_font_description_get_set_fields;
+extern (C) int function(void *)pango_font_description_get_gravity;
+extern (C) void function(void *, int)pango_font_description_set_gravity;
+extern (C) int function(void *)pango_font_description_get_size_is_absolute;
+extern (C) void function(void *, double)pango_font_description_set_absolute_size;
+extern (C) int function(void *)pango_font_description_get_size;
+extern (C) void function(void *, int)pango_font_description_set_size;
+extern (C) int function(void *)pango_font_description_get_stretch;
+extern (C) void function(void *, int)pango_font_description_set_stretch;
+extern (C) int function(void *)pango_font_description_get_weight;
+extern (C) void function(void *, int)pango_font_description_set_weight;
+extern (C) int function(void *)pango_font_description_get_variant;
+extern (C) void function(void *, int)pango_font_description_set_variant;
+extern (C) int function(void *)pango_font_description_get_style;
+extern (C) void function(void *, int)pango_font_description_set_style;
+extern (C) char * function(void *)pango_font_description_get_family;
+extern (C) void function(void *, char *)pango_font_description_set_family_static;
+extern (C) void function(void *, char *)pango_font_description_set_family;
+extern (C) void function(void * *, int)pango_font_descriptions_free;
+extern (C) void function(void *)pango_font_description_free;
+extern (C) int function(void *, void *)pango_font_description_equal;
+extern (C) uint function(void *)pango_font_description_hash;
+extern (C) void * function(void *)pango_font_description_copy_static;
+extern (C) void * function(void *)pango_font_description_copy;
+extern (C) void * function()pango_font_description_new;
+extern (C) uint function()pango_font_description_get_type;
+extern (C) int function(int, int, int)pango_gravity_get_for_script;
+extern (C) int function(_PangoMatrix *)pango_gravity_get_for_matrix;
+extern (C) double function(int)pango_gravity_to_rotation;
+extern (C) int function(void *, int)pango_language_includes_script;
+extern (C) void * function(int)pango_script_get_sample_language;
+extern (C) void function(void *)pango_script_iter_free;
+extern (C) int function(void *)pango_script_iter_next;
+extern (C) void function(void *, char * *, char * *, int *)pango_script_iter_get_range;
+extern (C) void * function(char *, int)pango_script_iter_new;
+extern (C) int function(uint)pango_script_for_unichar;
+extern (C) int function(void *, char *)pango_language_matches;
+extern (C) void * function()pango_language_get_default;
+extern (C) char * function(void *)pango_language_get_sample_string;
+extern (C) void * function(char *)pango_language_from_string;
+extern (C) uint function()pango_language_get_type;
+extern (C) double function(_PangoMatrix *)pango_matrix_get_font_scale_factor;
+extern (C) void function(_PangoMatrix *, _PangoRectangle *)pango_matrix_transform_pixel_rectangle;
+extern (C) void function(_PangoMatrix *, _PangoRectangle *)pango_matrix_transform_rectangle;
+extern (C) void function(_PangoMatrix *, double *, double *)pango_matrix_transform_distance;
+extern (C) void function(_PangoMatrix *, double *, double *)pango_matrix_transform_point;
+extern (C) void function(_PangoMatrix *, _PangoMatrix *)pango_matrix_concat;
+extern (C) void function(_PangoMatrix *, double)pango_matrix_rotate;
+extern (C) void function(_PangoMatrix *, double, double)pango_matrix_scale;
+extern (C) void function(_PangoMatrix *, double, double)pango_matrix_translate;
+extern (C) void function(_PangoMatrix *)pango_matrix_free;
+extern (C) _PangoMatrix * function(_PangoMatrix *)pango_matrix_copy;
+extern (C) uint function()pango_matrix_get_type;
+extern (C) int function(uint, uint *)pango_get_mirror_char;
+extern (C) int function(char *, int)pango_find_base_dir;
+extern (C) int function(uint)pango_unichar_direction;
+extern (C) void function(_PangoRectangle *, _PangoRectangle *)pango_extents_to_pixels;
+extern (C) double function(int)pango_units_to_double;
+extern (C) int function(double)pango_units_from_double;
+extern (C) void * function(char *, int)pango_coverage_from_bytes;
+extern (C) void function(void *, char * *, int *)pango_coverage_to_bytes;
+extern (C) void function(void *, void *)pango_coverage_max;
+extern (C) void function(void *, int, int)pango_coverage_set;
+extern (C) int function(void *, int)pango_coverage_get;
+extern (C) void * function(void *)pango_coverage_copy;
+extern (C) void function(void *)pango_coverage_unref;
+extern (C) void * function(void *)pango_coverage_ref;
+extern (C) void * function()pango_coverage_new;
+
+
+Symbol[] symbols = [
+    { "pango_version_check",  cast(void**)& pango_version_check},
+    { "pango_version_string",  cast(void**)& pango_version_string},
+    { "pango_version",  cast(void**)& pango_version},
+    { "pango_is_zero_width",  cast(void**)& pango_is_zero_width},
+    { "pango_log2vis_get_embedding_levels",  cast(void**)& pango_log2vis_get_embedding_levels},
+    { "pango_quantize_line_geometry",  cast(void**)& pango_quantize_line_geometry},
+    { "pango_parse_stretch",  cast(void**)& pango_parse_stretch},
+    { "pango_parse_weight",  cast(void**)& pango_parse_weight},
+    { "pango_parse_variant",  cast(void**)& pango_parse_variant},
+    { "pango_parse_style",  cast(void**)& pango_parse_style},
+    { "pango_parse_enum",  cast(void**)& pango_parse_enum},
+    { "pango_scan_int",  cast(void**)& pango_scan_int},
+    { "pango_scan_string",  cast(void**)& pango_scan_string},
+    { "pango_scan_word",  cast(void**)& pango_scan_word},
+    { "pango_skip_space",  cast(void**)& pango_skip_space},
+    { "pango_read_line",  cast(void**)& pango_read_line},
+    { "pango_trim_string",  cast(void**)& pango_trim_string},
+    { "pango_split_file_list",  cast(void**)& pango_split_file_list},
+    { "pango_renderer_get_matrix",  cast(void**)& pango_renderer_get_matrix},
+    { "pango_renderer_set_matrix",  cast(void**)& pango_renderer_set_matrix},
+    { "pango_renderer_get_color",  cast(void**)& pango_renderer_get_color},
+    { "pango_renderer_set_color",  cast(void**)& pango_renderer_set_color},
+    { "pango_renderer_part_changed",  cast(void**)& pango_renderer_part_changed},
+    { "pango_renderer_deactivate",  cast(void**)& pango_renderer_deactivate},
+    { "pango_renderer_activate",  cast(void**)& pango_renderer_activate},
+    { "pango_renderer_draw_glyph",  cast(void**)& pango_renderer_draw_glyph},
+    { "pango_renderer_draw_trapezoid",  cast(void**)& pango_renderer_draw_trapezoid},
+    { "pango_renderer_draw_error_underline",  cast(void**)& pango_renderer_draw_error_underline},
+    { "pango_renderer_draw_rectangle",  cast(void**)& pango_renderer_draw_rectangle},
+    { "pango_renderer_draw_glyphs",  cast(void**)& pango_renderer_draw_glyphs},
+    { "pango_renderer_draw_layout_line",  cast(void**)& pango_renderer_draw_layout_line},
+    { "pango_renderer_draw_layout",  cast(void**)& pango_renderer_draw_layout},
+    { "pango_renderer_get_type",  cast(void**)& pango_renderer_get_type},
+    { "pango_layout_iter_get_baseline",  cast(void**)& pango_layout_iter_get_baseline},
+    { "pango_layout_iter_get_layout_extents",  cast(void**)& pango_layout_iter_get_layout_extents},
+    { "pango_layout_iter_get_line_yrange",  cast(void**)& pango_layout_iter_get_line_yrange},
+    { "pango_layout_iter_get_line_extents",  cast(void**)& pango_layout_iter_get_line_extents},
+    { "pango_layout_iter_get_run_extents",  cast(void**)& pango_layout_iter_get_run_extents},
+    { "pango_layout_iter_get_cluster_extents",  cast(void**)& pango_layout_iter_get_cluster_extents},
+    { "pango_layout_iter_get_char_extents",  cast(void**)& pango_layout_iter_get_char_extents},
+    { "pango_layout_iter_next_line",  cast(void**)& pango_layout_iter_next_line},
+    { "pango_layout_iter_next_run",  cast(void**)& pango_layout_iter_next_run},
+    { "pango_layout_iter_next_cluster",  cast(void**)& pango_layout_iter_next_cluster},
+    { "pango_layout_iter_next_char",  cast(void**)& pango_layout_iter_next_char},
+    { "pango_layout_iter_at_last_line",  cast(void**)& pango_layout_iter_at_last_line},
+    { "pango_layout_iter_get_line_readonly",  cast(void**)& pango_layout_iter_get_line_readonly},
+    { "pango_layout_iter_get_line",  cast(void**)& pango_layout_iter_get_line},
+    { "pango_layout_iter_get_run_readonly",  cast(void**)& pango_layout_iter_get_run_readonly},
+    { "pango_layout_iter_get_run",  cast(void**)& pango_layout_iter_get_run},
+    { "pango_layout_iter_get_index",  cast(void**)& pango_layout_iter_get_index},
+    { "pango_layout_iter_free",  cast(void**)& pango_layout_iter_free},
+    { "pango_layout_get_iter",  cast(void**)& pango_layout_get_iter},
+    { "pango_layout_iter_get_type",  cast(void**)& pango_layout_iter_get_type},
+    { "pango_layout_line_get_pixel_extents",  cast(void**)& pango_layout_line_get_pixel_extents},
+    { "pango_layout_line_get_extents",  cast(void**)& pango_layout_line_get_extents},
+    { "pango_layout_line_get_x_ranges",  cast(void**)& pango_layout_line_get_x_ranges},
+    { "pango_layout_line_index_to_x",  cast(void**)& pango_layout_line_index_to_x},
+    { "pango_layout_line_x_to_index",  cast(void**)& pango_layout_line_x_to_index},
+    { "pango_layout_line_unref",  cast(void**)& pango_layout_line_unref},
+    { "pango_layout_line_ref",  cast(void**)& pango_layout_line_ref},
+    { "pango_layout_line_get_type",  cast(void**)& pango_layout_line_get_type},
+    { "pango_layout_get_lines_readonly",  cast(void**)& pango_layout_get_lines_readonly},
+    { "pango_layout_get_lines",  cast(void**)& pango_layout_get_lines},
+    { "pango_layout_get_line_readonly",  cast(void**)& pango_layout_get_line_readonly},
+    { "pango_layout_get_line",  cast(void**)& pango_layout_get_line},
+    { "pango_layout_get_line_count",  cast(void**)& pango_layout_get_line_count},
+    { "pango_layout_get_pixel_size",  cast(void**)& pango_layout_get_pixel_size},
+    { "pango_layout_get_size",  cast(void**)& pango_layout_get_size},
+    { "pango_layout_get_pixel_extents",  cast(void**)& pango_layout_get_pixel_extents},
+    { "pango_layout_get_extents",  cast(void**)& pango_layout_get_extents},
+    { "pango_layout_xy_to_index",  cast(void**)& pango_layout_xy_to_index},
+    { "pango_layout_move_cursor_visually",  cast(void**)& pango_layout_move_cursor_visually},
+    { "pango_layout_get_cursor_pos",  cast(void**)& pango_layout_get_cursor_pos},
+    { "pango_layout_index_to_line_x",  cast(void**)& pango_layout_index_to_line_x},
+    { "pango_layout_index_to_pos",  cast(void**)& pango_layout_index_to_pos},
+    { "pango_layout_get_log_attrs",  cast(void**)& pango_layout_get_log_attrs},
+    { "pango_layout_context_changed",  cast(void**)& pango_layout_context_changed},
+    { "pango_layout_get_unknown_glyphs_count",  cast(void**)& pango_layout_get_unknown_glyphs_count},
+    { "pango_layout_is_ellipsized",  cast(void**)& pango_layout_is_ellipsized},
+    { "pango_layout_get_ellipsize",  cast(void**)& pango_layout_get_ellipsize},
+    { "pango_layout_set_ellipsize",  cast(void**)& pango_layout_set_ellipsize},
+    { "pango_layout_get_single_paragraph_mode",  cast(void**)& pango_layout_get_single_paragraph_mode},
+    { "pango_layout_set_single_paragraph_mode",  cast(void**)& pango_layout_set_single_paragraph_mode},
+    { "pango_layout_get_tabs",  cast(void**)& pango_layout_get_tabs},
+    { "pango_layout_set_tabs",  cast(void**)& pango_layout_set_tabs},
+    { "pango_layout_get_alignment",  cast(void**)& pango_layout_get_alignment},
+    { "pango_layout_set_alignment",  cast(void**)& pango_layout_set_alignment},
+    { "pango_layout_get_auto_dir",  cast(void**)& pango_layout_get_auto_dir},
+    { "pango_layout_set_auto_dir",  cast(void**)& pango_layout_set_auto_dir},
+    { "pango_layout_get_justify",  cast(void**)& pango_layout_get_justify},
+    { "pango_layout_set_justify",  cast(void**)& pango_layout_set_justify},
+    { "pango_layout_get_spacing",  cast(void**)& pango_layout_get_spacing},
+    { "pango_layout_set_spacing",  cast(void**)& pango_layout_set_spacing},
+    { "pango_layout_get_indent",  cast(void**)& pango_layout_get_indent},
+    { "pango_layout_set_indent",  cast(void**)& pango_layout_set_indent},
+    { "pango_layout_is_wrapped",  cast(void**)& pango_layout_is_wrapped},
+    { "pango_layout_get_wrap",  cast(void**)& pango_layout_get_wrap},
+    { "pango_layout_set_wrap",  cast(void**)& pango_layout_set_wrap},
+    { "pango_layout_get_width",  cast(void**)& pango_layout_get_width},
+    { "pango_layout_set_width",  cast(void**)& pango_layout_set_width},
+    { "pango_layout_get_font_description",  cast(void**)& pango_layout_get_font_description},
+    { "pango_layout_set_font_description",  cast(void**)& pango_layout_set_font_description},
+    { "pango_layout_set_markup_with_accel",  cast(void**)& pango_layout_set_markup_with_accel},
+    { "pango_layout_set_markup",  cast(void**)& pango_layout_set_markup},
+    { "pango_layout_get_text",  cast(void**)& pango_layout_get_text},
+    { "pango_layout_set_text",  cast(void**)& pango_layout_set_text},
+    { "pango_layout_get_attributes",  cast(void**)& pango_layout_get_attributes},
+    { "pango_layout_set_attributes",  cast(void**)& pango_layout_set_attributes},
+    { "pango_layout_get_context",  cast(void**)& pango_layout_get_context},
+    { "pango_layout_copy",  cast(void**)& pango_layout_copy},
+    { "pango_layout_new",  cast(void**)& pango_layout_new},
+    { "pango_layout_get_type",  cast(void**)& pango_layout_get_type},
+    { "pango_tab_array_get_positions_in_pixels",  cast(void**)& pango_tab_array_get_positions_in_pixels},
+    { "pango_tab_array_get_tabs",  cast(void**)& pango_tab_array_get_tabs},
+    { "pango_tab_array_get_tab",  cast(void**)& pango_tab_array_get_tab},
+    { "pango_tab_array_set_tab",  cast(void**)& pango_tab_array_set_tab},
+    { "pango_tab_array_resize",  cast(void**)& pango_tab_array_resize},
+    { "pango_tab_array_get_size",  cast(void**)& pango_tab_array_get_size},
+    { "pango_tab_array_free",  cast(void**)& pango_tab_array_free},
+    { "pango_tab_array_copy",  cast(void**)& pango_tab_array_copy},
+    { "pango_tab_array_get_type",  cast(void**)& pango_tab_array_get_type},
+    { "pango_tab_array_new_with_positions",  cast(void**)& pango_tab_array_new_with_positions},
+    { "pango_tab_array_new",  cast(void**)& pango_tab_array_new},
+    { "pango_glyph_item_letter_space",  cast(void**)& pango_glyph_item_letter_space},
+    { "pango_glyph_item_apply_attrs",  cast(void**)& pango_glyph_item_apply_attrs},
+    { "pango_glyph_item_free",  cast(void**)& pango_glyph_item_free},
+    { "pango_glyph_item_split",  cast(void**)& pango_glyph_item_split},
+    { "pango_direction_get_type",  cast(void**)& pango_direction_get_type},
+    { "pango_tab_align_get_type",  cast(void**)& pango_tab_align_get_type},
+    { "pango_script_get_type",  cast(void**)& pango_script_get_type},
+    { "pango_render_part_get_type",  cast(void**)& pango_render_part_get_type},
+    { "pango_ellipsize_mode_get_type",  cast(void**)& pango_ellipsize_mode_get_type},
+    { "pango_wrap_mode_get_type",  cast(void**)& pango_wrap_mode_get_type},
+    { "pango_alignment_get_type",  cast(void**)& pango_alignment_get_type},
+    { "pango_gravity_hint_get_type",  cast(void**)& pango_gravity_hint_get_type},
+    { "pango_gravity_get_type",  cast(void**)& pango_gravity_get_type},
+    { "pango_font_mask_get_type",  cast(void**)& pango_font_mask_get_type},
+    { "pango_stretch_get_type",  cast(void**)& pango_stretch_get_type},
+    { "pango_weight_get_type",  cast(void**)& pango_weight_get_type},
+    { "pango_variant_get_type",  cast(void**)& pango_variant_get_type},
+    { "pango_style_get_type",  cast(void**)& pango_style_get_type},
+    { "pango_coverage_level_get_type",  cast(void**)& pango_coverage_level_get_type},
+    { "pango_underline_get_type",  cast(void**)& pango_underline_get_type},
+    { "pango_attr_type_get_type",  cast(void**)& pango_attr_type_get_type},
+    { "pango_reorder_items",  cast(void**)& pango_reorder_items},
+    { "pango_shape",  cast(void**)& pango_shape},
+    { "pango_glyph_string_x_to_index",  cast(void**)& pango_glyph_string_x_to_index},
+    { "pango_glyph_string_index_to_x",  cast(void**)& pango_glyph_string_index_to_x},
+    { "pango_glyph_string_get_logical_widths",  cast(void**)& pango_glyph_string_get_logical_widths},
+    { "pango_glyph_string_extents_range",  cast(void**)& pango_glyph_string_extents_range},
+    { "pango_glyph_string_get_width",  cast(void**)& pango_glyph_string_get_width},
+    { "pango_glyph_string_extents",  cast(void**)& pango_glyph_string_extents},
+    { "pango_glyph_string_free",  cast(void**)& pango_glyph_string_free},
+    { "pango_glyph_string_copy",  cast(void**)& pango_glyph_string_copy},
+    { "pango_glyph_string_get_type",  cast(void**)& pango_glyph_string_get_type},
+    { "pango_glyph_string_set_size",  cast(void**)& pango_glyph_string_set_size},
+    { "pango_glyph_string_new",  cast(void**)& pango_glyph_string_new},
+    { "pango_itemize_with_base_dir",  cast(void**)& pango_itemize_with_base_dir},
+    { "pango_itemize",  cast(void**)& pango_itemize},
+    { "pango_context_get_matrix",  cast(void**)& pango_context_get_matrix},
+    { "pango_context_set_matrix",  cast(void**)& pango_context_set_matrix},
+    { "pango_context_get_gravity_hint",  cast(void**)& pango_context_get_gravity_hint},
+    { "pango_context_set_gravity_hint",  cast(void**)& pango_context_set_gravity_hint},
+    { "pango_context_get_gravity",  cast(void**)& pango_context_get_gravity},
+    { "pango_context_get_base_gravity",  cast(void**)& pango_context_get_base_gravity},
+    { "pango_context_set_base_gravity",  cast(void**)& pango_context_set_base_gravity},
+    { "pango_context_get_base_dir",  cast(void**)& pango_context_get_base_dir},
+    { "pango_context_set_base_dir",  cast(void**)& pango_context_set_base_dir},
+    { "pango_context_set_language",  cast(void**)& pango_context_set_language},
+    { "pango_context_get_language",  cast(void**)& pango_context_get_language},
+    { "pango_context_get_font_description",  cast(void**)& pango_context_get_font_description},
+    { "pango_context_set_font_description",  cast(void**)& pango_context_set_font_description},
+    { "pango_context_get_metrics",  cast(void**)& pango_context_get_metrics},
+    { "pango_context_load_fontset",  cast(void**)& pango_context_load_fontset},
+    { "pango_context_load_font",  cast(void**)& pango_context_load_font},
+    { "pango_context_list_families",  cast(void**)& pango_context_list_families},
+    { "pango_context_get_font_map",  cast(void**)& pango_context_get_font_map},
+    { "pango_context_get_type",  cast(void**)& pango_context_get_type},
+    { "pango_font_map_list_families",  cast(void**)& pango_font_map_list_families},
+    { "pango_font_map_load_fontset",  cast(void**)& pango_font_map_load_fontset},
+    { "pango_font_map_load_font",  cast(void**)& pango_font_map_load_font},
+    { "pango_font_map_get_type",  cast(void**)& pango_font_map_get_type},
+    { "pango_fontset_foreach",  cast(void**)& pango_fontset_foreach},
+    { "pango_fontset_get_metrics",  cast(void**)& pango_fontset_get_metrics},
+    { "pango_fontset_get_font",  cast(void**)& pango_fontset_get_font},
+    { "pango_fontset_get_type",  cast(void**)& pango_fontset_get_type},
+    { "pango_get_log_attrs",  cast(void**)& pango_get_log_attrs},
+    { "pango_find_paragraph_boundary",  cast(void**)& pango_find_paragraph_boundary},
+    { "pango_break",  cast(void**)& pango_break},
+    { "pango_item_split",  cast(void**)& pango_item_split},
+    { "pango_item_free",  cast(void**)& pango_item_free},
+    { "pango_item_copy",  cast(void**)& pango_item_copy},
+    { "pango_item_new",  cast(void**)& pango_item_new},
+    { "pango_item_get_type",  cast(void**)& pango_item_get_type},
+    { "pango_parse_markup",  cast(void**)& pango_parse_markup},
+    { "pango_attr_iterator_get_attrs",  cast(void**)& pango_attr_iterator_get_attrs},
+    { "pango_attr_iterator_get_font",  cast(void**)& pango_attr_iterator_get_font},
+    { "pango_attr_iterator_get",  cast(void**)& pango_attr_iterator_get},
+    { "pango_attr_iterator_destroy",  cast(void**)& pango_attr_iterator_destroy},
+    { "pango_attr_iterator_copy",  cast(void**)& pango_attr_iterator_copy},
+    { "pango_attr_iterator_next",  cast(void**)& pango_attr_iterator_next},
+    { "pango_attr_iterator_range",  cast(void**)& pango_attr_iterator_range},
+    { "pango_attr_list_get_iterator",  cast(void**)& pango_attr_list_get_iterator},
+    { "pango_attr_list_filter",  cast(void**)& pango_attr_list_filter},
+    { "pango_attr_list_splice",  cast(void**)& pango_attr_list_splice},
+    { "pango_attr_list_change",  cast(void**)& pango_attr_list_change},
+    { "pango_attr_list_insert_before",  cast(void**)& pango_attr_list_insert_before},
+    { "pango_attr_list_insert",  cast(void**)& pango_attr_list_insert},
+    { "pango_attr_list_copy",  cast(void**)& pango_attr_list_copy},
+    { "pango_attr_list_unref",  cast(void**)& pango_attr_list_unref},
+    { "pango_attr_list_ref",  cast(void**)& pango_attr_list_ref},
+    { "pango_attr_list_new",  cast(void**)& pango_attr_list_new},
+    { "pango_attr_list_get_type",  cast(void**)& pango_attr_list_get_type},
+    { "pango_attr_gravity_hint_new",  cast(void**)& pango_attr_gravity_hint_new},
+    { "pango_attr_gravity_new",  cast(void**)& pango_attr_gravity_new},
+    { "pango_attr_shape_new_with_data",  cast(void**)& pango_attr_shape_new_with_data},
+    { "pango_attr_shape_new",  cast(void**)& pango_attr_shape_new},
+    { "pango_attr_letter_spacing_new",  cast(void**)& pango_attr_letter_spacing_new},
+    { "pango_attr_fallback_new",  cast(void**)& pango_attr_fallback_new},
+    { "pango_attr_scale_new",  cast(void**)& pango_attr_scale_new},
+    { "pango_attr_rise_new",  cast(void**)& pango_attr_rise_new},
+    { "pango_attr_strikethrough_color_new",  cast(void**)& pango_attr_strikethrough_color_new},
+    { "pango_attr_strikethrough_new",  cast(void**)& pango_attr_strikethrough_new},
+    { "pango_attr_underline_color_new",  cast(void**)& pango_attr_underline_color_new},
+    { "pango_attr_underline_new",  cast(void**)& pango_attr_underline_new},
+    { "pango_attr_font_desc_new",  cast(void**)& pango_attr_font_desc_new},
+    { "pango_attr_stretch_new",  cast(void**)& pango_attr_stretch_new},
+    { "pango_attr_variant_new",  cast(void**)& pango_attr_variant_new},
+    { "pango_attr_weight_new",  cast(void**)& pango_attr_weight_new},
+    { "pango_attr_style_new",  cast(void**)& pango_attr_style_new},
+    { "pango_attr_size_new_absolute",  cast(void**)& pango_attr_size_new_absolute},
+    { "pango_attr_size_new",  cast(void**)& pango_attr_size_new},
+    { "pango_attr_background_new",  cast(void**)& pango_attr_background_new},
+    { "pango_attr_foreground_new",  cast(void**)& pango_attr_foreground_new},
+    { "pango_attr_family_new",  cast(void**)& pango_attr_family_new},
+    { "pango_attr_language_new",  cast(void**)& pango_attr_language_new},
+    { "pango_attribute_equal",  cast(void**)& pango_attribute_equal},
+    { "pango_attribute_destroy",  cast(void**)& pango_attribute_destroy},
+    { "pango_attribute_copy",  cast(void**)& pango_attribute_copy},
+    { "pango_attr_type_register",  cast(void**)& pango_attr_type_register},
+    { "pango_color_to_string",  cast(void**)& pango_color_to_string},
+    { "pango_color_parse",  cast(void**)& pango_color_parse},
+    { "pango_color_free",  cast(void**)& pango_color_free},
+    { "pango_color_copy",  cast(void**)& pango_color_copy},
+    { "pango_color_get_type",  cast(void**)& pango_color_get_type},
+    { "pango_font_get_font_map",  cast(void**)& pango_font_get_font_map},
+    { "pango_font_get_glyph_extents",  cast(void**)& pango_font_get_glyph_extents},
+    { "pango_font_get_metrics",  cast(void**)& pango_font_get_metrics},
+    { "pango_font_find_shaper",  cast(void**)& pango_font_find_shaper},
+    { "pango_font_get_coverage",  cast(void**)& pango_font_get_coverage},
+    { "pango_font_describe_with_absolute_size",  cast(void**)& pango_font_describe_with_absolute_size},
+    { "pango_font_describe",  cast(void**)& pango_font_describe},
+    { "pango_font_get_type",  cast(void**)& pango_font_get_type},
+    { "pango_font_face_is_synthesized",  cast(void**)& pango_font_face_is_synthesized},
+    { "pango_font_face_list_sizes",  cast(void**)& pango_font_face_list_sizes},
+    { "pango_font_face_get_face_name",  cast(void**)& pango_font_face_get_face_name},
+    { "pango_font_face_describe",  cast(void**)& pango_font_face_describe},
+    { "pango_font_face_get_type",  cast(void**)& pango_font_face_get_type},
+    { "pango_font_family_is_monospace",  cast(void**)& pango_font_family_is_monospace},
+    { "pango_font_family_get_name",  cast(void**)& pango_font_family_get_name},
+    { "pango_font_family_list_faces",  cast(void**)& pango_font_family_list_faces},
+    { "pango_font_family_get_type",  cast(void**)& pango_font_family_get_type},
+    { "pango_font_metrics_get_strikethrough_thickness",  cast(void**)& pango_font_metrics_get_strikethrough_thickness},
+    { "pango_font_metrics_get_strikethrough_position",  cast(void**)& pango_font_metrics_get_strikethrough_position},
+    { "pango_font_metrics_get_underline_thickness",  cast(void**)& pango_font_metrics_get_underline_thickness},
+    { "pango_font_metrics_get_underline_position",  cast(void**)& pango_font_metrics_get_underline_position},
+    { "pango_font_metrics_get_approximate_digit_width",  cast(void**)& pango_font_metrics_get_approximate_digit_width},
+    { "pango_font_metrics_get_approximate_char_width",  cast(void**)& pango_font_metrics_get_approximate_char_width},
+    { "pango_font_metrics_get_descent",  cast(void**)& pango_font_metrics_get_descent},
+    { "pango_font_metrics_get_ascent",  cast(void**)& pango_font_metrics_get_ascent},
+    { "pango_font_metrics_unref",  cast(void**)& pango_font_metrics_unref},
+    { "pango_font_metrics_ref",  cast(void**)& pango_font_metrics_ref},
+    { "pango_font_metrics_get_type",  cast(void**)& pango_font_metrics_get_type},
+    { "pango_font_description_to_filename",  cast(void**)& pango_font_description_to_filename},
+    { "pango_font_description_to_string",  cast(void**)& pango_font_description_to_string},
+    { "pango_font_description_from_string",  cast(void**)& pango_font_description_from_string},
+    { "pango_font_description_better_match",  cast(void**)& pango_font_description_better_match},
+    { "pango_font_description_merge_static",  cast(void**)& pango_font_description_merge_static},
+    { "pango_font_description_merge",  cast(void**)& pango_font_description_merge},
+    { "pango_font_description_unset_fields",  cast(void**)& pango_font_description_unset_fields},
+    { "pango_font_description_get_set_fields",  cast(void**)& pango_font_description_get_set_fields},
+    { "pango_font_description_get_gravity",  cast(void**)& pango_font_description_get_gravity},
+    { "pango_font_description_set_gravity",  cast(void**)& pango_font_description_set_gravity},
+    { "pango_font_description_get_size_is_absolute",  cast(void**)& pango_font_description_get_size_is_absolute},
+    { "pango_font_description_set_absolute_size",  cast(void**)& pango_font_description_set_absolute_size},
+    { "pango_font_description_get_size",  cast(void**)& pango_font_description_get_size},
+    { "pango_font_description_set_size",  cast(void**)& pango_font_description_set_size},
+    { "pango_font_description_get_stretch",  cast(void**)& pango_font_description_get_stretch},
+    { "pango_font_description_set_stretch",  cast(void**)& pango_font_description_set_stretch},
+    { "pango_font_description_get_weight",  cast(void**)& pango_font_description_get_weight},
+    { "pango_font_description_set_weight",  cast(void**)& pango_font_description_set_weight},
+    { "pango_font_description_get_variant",  cast(void**)& pango_font_description_get_variant},
+    { "pango_font_description_set_variant",  cast(void**)& pango_font_description_set_variant},
+    { "pango_font_description_get_style",  cast(void**)& pango_font_description_get_style},
+    { "pango_font_description_set_style",  cast(void**)& pango_font_description_set_style},
+    { "pango_font_description_get_family",  cast(void**)& pango_font_description_get_family},
+    { "pango_font_description_set_family_static",  cast(void**)& pango_font_description_set_family_static},
+    { "pango_font_description_set_family",  cast(void**)& pango_font_description_set_family},
+    { "pango_font_descriptions_free",  cast(void**)& pango_font_descriptions_free},
+    { "pango_font_description_free",  cast(void**)& pango_font_description_free},
+    { "pango_font_description_equal",  cast(void**)& pango_font_description_equal},
+    { "pango_font_description_hash",  cast(void**)& pango_font_description_hash},
+    { "pango_font_description_copy_static",  cast(void**)& pango_font_description_copy_static},
+    { "pango_font_description_copy",  cast(void**)& pango_font_description_copy},
+    { "pango_font_description_new",  cast(void**)& pango_font_description_new},
+    { "pango_font_description_get_type",  cast(void**)& pango_font_description_get_type},
+    { "pango_gravity_get_for_script",  cast(void**)& pango_gravity_get_for_script},
+    { "pango_gravity_get_for_matrix",  cast(void**)& pango_gravity_get_for_matrix},
+    { "pango_gravity_to_rotation",  cast(void**)& pango_gravity_to_rotation},
+    { "pango_language_includes_script",  cast(void**)& pango_language_includes_script},
+    { "pango_script_get_sample_language",  cast(void**)& pango_script_get_sample_language},
+    { "pango_script_iter_free",  cast(void**)& pango_script_iter_free},
+    { "pango_script_iter_next",  cast(void**)& pango_script_iter_next},
+    { "pango_script_iter_get_range",  cast(void**)& pango_script_iter_get_range},
+    { "pango_script_iter_new",  cast(void**)& pango_script_iter_new},
+    { "pango_script_for_unichar",  cast(void**)& pango_script_for_unichar},
+    { "pango_language_matches",  cast(void**)& pango_language_matches},
+    { "pango_language_get_default",  cast(void**)& pango_language_get_default},
+    { "pango_language_get_sample_string",  cast(void**)& pango_language_get_sample_string},
+    { "pango_language_from_string",  cast(void**)& pango_language_from_string},
+    { "pango_language_get_type",  cast(void**)& pango_language_get_type},
+    { "pango_matrix_get_font_scale_factor",  cast(void**)& pango_matrix_get_font_scale_factor},
+    { "pango_matrix_transform_pixel_rectangle",  cast(void**)& pango_matrix_transform_pixel_rectangle},
+    { "pango_matrix_transform_rectangle",  cast(void**)& pango_matrix_transform_rectangle},
+    { "pango_matrix_transform_distance",  cast(void**)& pango_matrix_transform_distance},
+    { "pango_matrix_transform_point",  cast(void**)& pango_matrix_transform_point},
+    { "pango_matrix_concat",  cast(void**)& pango_matrix_concat},
+    { "pango_matrix_rotate",  cast(void**)& pango_matrix_rotate},
+    { "pango_matrix_scale",  cast(void**)& pango_matrix_scale},
+    { "pango_matrix_translate",  cast(void**)& pango_matrix_translate},
+    { "pango_matrix_free",  cast(void**)& pango_matrix_free},
+    { "pango_matrix_copy",  cast(void**)& pango_matrix_copy},
+    { "pango_matrix_get_type",  cast(void**)& pango_matrix_get_type},
+    { "pango_get_mirror_char",  cast(void**)& pango_get_mirror_char},
+    { "pango_find_base_dir",  cast(void**)& pango_find_base_dir},
+    { "pango_unichar_direction",  cast(void**)& pango_unichar_direction},
+    { "pango_extents_to_pixels",  cast(void**)& pango_extents_to_pixels},
+    { "pango_units_to_double",  cast(void**)& pango_units_to_double},
+    { "pango_units_from_double",  cast(void**)& pango_units_from_double},
+    { "pango_coverage_from_bytes",  cast(void**)& pango_coverage_from_bytes},
+    { "pango_coverage_to_bytes",  cast(void**)& pango_coverage_to_bytes},
+    { "pango_coverage_max",  cast(void**)& pango_coverage_max},
+    { "pango_coverage_set",  cast(void**)& pango_coverage_set},
+    { "pango_coverage_get",  cast(void**)& pango_coverage_get},
+    { "pango_coverage_copy",  cast(void**)& pango_coverage_copy},
+    { "pango_coverage_unref",  cast(void**)& pango_coverage_unref},
+    { "pango_coverage_ref",  cast(void**)& pango_coverage_ref},
+    { "pango_coverage_new",  cast(void**)& pango_coverage_new},
+];
+
+} else { // version(DYNLINK)
+extern (C) char * pango_version_check(int, int, int);
+extern (C) char * pango_version_string();
+extern (C) int pango_version();
+extern (C) int pango_is_zero_width(uint);
+extern (C) char * pango_log2vis_get_embedding_levels(char *, int, int *);
+extern (C) void pango_quantize_line_geometry(int *, int *);
+extern (C) int pango_parse_stretch(char *, int *, int);
+extern (C) int pango_parse_weight(char *, int *, int);
+extern (C) int pango_parse_variant(char *, int *, int);
+extern (C) int pango_parse_style(char *, int *, int);
+extern (C) int pango_parse_enum(uint, char *, int *, int, char * *);
+extern (C) int pango_scan_int(char * *, int *);
+extern (C) int pango_scan_string(char * *, _GString *);
+extern (C) int pango_scan_word(char * *, _GString *);
+extern (C) int pango_skip_space(char * *);
+extern (C) int pango_read_line(_IO_FILE *, _GString *);
+extern (C) char * pango_trim_string(char *);
+extern (C) char * * pango_split_file_list(char *);
+extern (C) _PangoMatrix * pango_renderer_get_matrix(_PangoRenderer *);
+extern (C) void pango_renderer_set_matrix(_PangoRenderer *, _PangoMatrix *);
+extern (C) _PangoColor * pango_renderer_get_color(_PangoRenderer *, int);
+extern (C) void pango_renderer_set_color(_PangoRenderer *, int, _PangoColor *);
+extern (C) void pango_renderer_part_changed(_PangoRenderer *, int);
+extern (C) void pango_renderer_deactivate(_PangoRenderer *);
+extern (C) void pango_renderer_activate(_PangoRenderer *);
+extern (C) void pango_renderer_draw_glyph(_PangoRenderer *, void *, uint, double, double);
+extern (C) void pango_renderer_draw_trapezoid(_PangoRenderer *, int, double, double, double, double, double, double);
+extern (C) void pango_renderer_draw_error_underline(_PangoRenderer *, int, int, int, int);
+extern (C) void pango_renderer_draw_rectangle(_PangoRenderer *, int, int, int, int, int);
+extern (C) void pango_renderer_draw_glyphs(_PangoRenderer *, void *, _PangoGlyphString *, int, int);
+extern (C) void pango_renderer_draw_layout_line(_PangoRenderer *, _PangoLayoutLine *, int, int);
+extern (C) void pango_renderer_draw_layout(_PangoRenderer *, void *, int, int);
+extern (C) uint pango_renderer_get_type();
+extern (C) int pango_layout_iter_get_baseline(void *);
+extern (C) void pango_layout_iter_get_layout_extents(void *, _PangoRectangle *, _PangoRectangle *);
+extern (C) void pango_layout_iter_get_line_yrange(void *, int *, int *);
+extern (C) void pango_layout_iter_get_line_extents(void *, _PangoRectangle *, _PangoRectangle *);
+extern (C) void pango_layout_iter_get_run_extents(void *, _PangoRectangle *, _PangoRectangle *);
+extern (C) void pango_layout_iter_get_cluster_extents(void *, _PangoRectangle *, _PangoRectangle *);
+extern (C) void pango_layout_iter_get_char_extents(void *, _PangoRectangle *);
+extern (C) int pango_layout_iter_next_line(void *);
+extern (C) int pango_layout_iter_next_run(void *);
+extern (C) int pango_layout_iter_next_cluster(void *);
+extern (C) int pango_layout_iter_next_char(void *);
+extern (C) int pango_layout_iter_at_last_line(void *);
+extern (C) _PangoLayoutLine * pango_layout_iter_get_line_readonly(void *);
+extern (C) _PangoLayoutLine * pango_layout_iter_get_line(void *);
+extern (C) _PangoGlyphItem * pango_layout_iter_get_run_readonly(void *);
+extern (C) _PangoGlyphItem * pango_layout_iter_get_run(void *);
+extern (C) int pango_layout_iter_get_index(void *);
+extern (C) void pango_layout_iter_free(void *);
+extern (C) void * pango_layout_get_iter(void *);
+extern (C) uint pango_layout_iter_get_type();
+extern (C) void pango_layout_line_get_pixel_extents(_PangoLayoutLine *, _PangoRectangle *, _PangoRectangle *);
+extern (C) void pango_layout_line_get_extents(_PangoLayoutLine *, _PangoRectangle *, _PangoRectangle *);
+extern (C) void pango_layout_line_get_x_ranges(_PangoLayoutLine *, int, int, int * *, int *);
+extern (C) void pango_layout_line_index_to_x(_PangoLayoutLine *, int, int, int *);
+extern (C) int pango_layout_line_x_to_index(_PangoLayoutLine *, int, int *, int *);
+extern (C) void pango_layout_line_unref(_PangoLayoutLine *);
+extern (C) _PangoLayoutLine * pango_layout_line_ref(_PangoLayoutLine *);
+extern (C) uint pango_layout_line_get_type();
+extern (C) _GSList * pango_layout_get_lines_readonly(void *);
+extern (C) _GSList * pango_layout_get_lines(void *);
+extern (C) _PangoLayoutLine * pango_layout_get_line_readonly(void *, int);
+extern (C) _PangoLayoutLine * pango_layout_get_line(void *, int);
+extern (C) int pango_layout_get_line_count(void *);
+extern (C) void pango_layout_get_pixel_size(void *, int *, int *);
+extern (C) void pango_layout_get_size(void *, int *, int *);
+extern (C) void pango_layout_get_pixel_extents(void *, _PangoRectangle *, _PangoRectangle *);
+extern (C) void pango_layout_get_extents(void *, _PangoRectangle *, _PangoRectangle *);
+extern (C) int pango_layout_xy_to_index(void *, int, int, int *, int *);
+extern (C) void pango_layout_move_cursor_visually(void *, int, int, int, int, int *, int *);
+extern (C) void pango_layout_get_cursor_pos(void *, int, _PangoRectangle *, _PangoRectangle *);
+extern (C) void pango_layout_index_to_line_x(void *, int, int, int *, int *);
+extern (C) void pango_layout_index_to_pos(void *, int, _PangoRectangle *);
+extern (C) void pango_layout_get_log_attrs(void *, _PangoLogAttr * *, int *);
+extern (C) void pango_layout_context_changed(void *);
+extern (C) int pango_layout_get_unknown_glyphs_count(void *);
+extern (C) int pango_layout_is_ellipsized(void *);
+extern (C) int pango_layout_get_ellipsize(void *);
+extern (C) void pango_layout_set_ellipsize(void *, int);
+extern (C) int pango_layout_get_single_paragraph_mode(void *);
+extern (C) void pango_layout_set_single_paragraph_mode(void *, int);
+extern (C) void * pango_layout_get_tabs(void *);
+extern (C) void pango_layout_set_tabs(void *, void *);
+extern (C) int pango_layout_get_alignment(void *);
+extern (C) void pango_layout_set_alignment(void *, int);
+extern (C) int pango_layout_get_auto_dir(void *);
+extern (C) void pango_layout_set_auto_dir(void *, int);
+extern (C) int pango_layout_get_justify(void *);
+extern (C) void pango_layout_set_justify(void *, int);
+extern (C) int pango_layout_get_spacing(void *);
+extern (C) void pango_layout_set_spacing(void *, int);
+extern (C) int pango_layout_get_indent(void *);
+extern (C) void pango_layout_set_indent(void *, int);
+extern (C) int pango_layout_is_wrapped(void *);
+extern (C) int pango_layout_get_wrap(void *);
+extern (C) void pango_layout_set_wrap(void *, int);
+extern (C) int pango_layout_get_width(void *);
+extern (C) void pango_layout_set_width(void *, int);
+extern (C) void * pango_layout_get_font_description(void *);
+extern (C) void pango_layout_set_font_description(void *, void *);
+extern (C) void pango_layout_set_markup_with_accel(void *, char *, int, uint, uint *);
+extern (C) void pango_layout_set_markup(void *, char *, int);
+extern (C) char * pango_layout_get_text(void *);
+extern (C) void pango_layout_set_text(void *, char *, int);
+extern (C) void * pango_layout_get_attributes(void *);
+extern (C) void pango_layout_set_attributes(void *, void *);
+extern (C) void * pango_layout_get_context(void *);
+extern (C) void * pango_layout_copy(void *);
+extern (C) void * pango_layout_new(void *);
+extern (C) uint pango_layout_get_type();
+extern (C) int pango_tab_array_get_positions_in_pixels(void *);
+extern (C) void pango_tab_array_get_tabs(void *, int * *, int * *);
+extern (C) void pango_tab_array_get_tab(void *, int, int *, int *);
+extern (C) void pango_tab_array_set_tab(void *, int, int, int);
+extern (C) void pango_tab_array_resize(void *, int);
+extern (C) int pango_tab_array_get_size(void *);
+extern (C) void pango_tab_array_free(void *);
+extern (C) void * pango_tab_array_copy(void *);
+extern (C) uint pango_tab_array_get_type();
+extern (C) void * pango_tab_array_new_with_positions(int, int, int, int, ...);
+extern (C) void * pango_tab_array_new(int, int);
+extern (C) void pango_glyph_item_letter_space(_PangoGlyphItem *, char *, _PangoLogAttr *, int);
+extern (C) _GSList * pango_glyph_item_apply_attrs(_PangoGlyphItem *, char *, void *);
+extern (C) void pango_glyph_item_free(_PangoGlyphItem *);
+extern (C) _PangoGlyphItem * pango_glyph_item_split(_PangoGlyphItem *, char *, int);
+extern (C) uint pango_direction_get_type();
+extern (C) uint pango_tab_align_get_type();
+extern (C) uint pango_script_get_type();
+extern (C) uint pango_render_part_get_type();
+extern (C) uint pango_ellipsize_mode_get_type();
+extern (C) uint pango_wrap_mode_get_type();
+extern (C) uint pango_alignment_get_type();
+extern (C) uint pango_gravity_hint_get_type();
+extern (C) uint pango_gravity_get_type();
+extern (C) uint pango_font_mask_get_type();
+extern (C) uint pango_stretch_get_type();
+extern (C) uint pango_weight_get_type();
+extern (C) uint pango_variant_get_type();
+extern (C) uint pango_style_get_type();
+extern (C) uint pango_coverage_level_get_type();
+extern (C) uint pango_underline_get_type();
+extern (C) uint pango_attr_type_get_type();
+extern (C) _GList * pango_reorder_items(_GList *);
+extern (C) void pango_shape(char *, int, _PangoAnalysis *, _PangoGlyphString *);
+extern (C) void pango_glyph_string_x_to_index(_PangoGlyphString *, char *, int, _PangoAnalysis *, int, int *, int *);
+extern (C) void pango_glyph_string_index_to_x(_PangoGlyphString *, char *, int, _PangoAnalysis *, int, int, int *);
+extern (C) void pango_glyph_string_get_logical_widths(_PangoGlyphString *, char *, int, int, int *);
+extern (C) void pango_glyph_string_extents_range(_PangoGlyphString *, int, int, void *, _PangoRectangle *, _PangoRectangle *);
+extern (C) int pango_glyph_string_get_width(_PangoGlyphString *);
+extern (C) void pango_glyph_string_extents(_PangoGlyphString *, void *, _PangoRectangle *, _PangoRectangle *);
+extern (C) void pango_glyph_string_free(_PangoGlyphString *);
+extern (C) _PangoGlyphString * pango_glyph_string_copy(_PangoGlyphString *);
+extern (C) uint pango_glyph_string_get_type();
+extern (C) void pango_glyph_string_set_size(_PangoGlyphString *, int);
+extern (C) _PangoGlyphString * pango_glyph_string_new();
+extern (C) _GList * pango_itemize_with_base_dir(void *, int, char *, int, int, void *, void *);
+extern (C) _GList * pango_itemize(void *, char *, int, int, void *, void *);
+extern (C) _PangoMatrix * pango_context_get_matrix(void *);
+extern (C) void pango_context_set_matrix(void *, _PangoMatrix *);
+extern (C) int pango_context_get_gravity_hint(void *);
+extern (C) void pango_context_set_gravity_hint(void *, int);
+extern (C) int pango_context_get_gravity(void *);
+extern (C) int pango_context_get_base_gravity(void *);
+extern (C) void pango_context_set_base_gravity(void *, int);
+extern (C) int pango_context_get_base_dir(void *);
+extern (C) void pango_context_set_base_dir(void *, int);
+extern (C) void pango_context_set_language(void *, void *);
+extern (C) void * pango_context_get_language(void *);
+extern (C) void * pango_context_get_font_description(void *);
+extern (C) void pango_context_set_font_description(void *, void *);
+extern (C) void * pango_context_get_metrics(void *, void *, void *);
+extern (C) void * pango_context_load_fontset(void *, void *, void *);
+extern (C) void * pango_context_load_font(void *, void *);
+extern (C) void pango_context_list_families(void *, void * * *, int *);
+extern (C) void * pango_context_get_font_map(void *);
+extern (C) uint pango_context_get_type();
+extern (C) void pango_font_map_list_families(void *, void * * *, int *);
+extern (C) void * pango_font_map_load_fontset(void *, void *, void *, void *);
+extern (C) void * pango_font_map_load_font(void *, void *, void *);
+extern (C) uint pango_font_map_get_type();
+extern (C) void pango_fontset_foreach(void *, _BCD_func__3004, void *);
+extern (C) void * pango_fontset_get_metrics(void *);
+extern (C) void * pango_fontset_get_font(void *, uint);
+extern (C) uint pango_fontset_get_type();
+extern (C) void pango_get_log_attrs(char *, int, int, void *, _PangoLogAttr *, int);
+extern (C) void pango_find_paragraph_boundary(char *, int, int *, int *);
+extern (C) void pango_break(char *, int, _PangoAnalysis *, _PangoLogAttr *, int);
+extern (C) _PangoItem * pango_item_split(_PangoItem *, int, int);
+extern (C) void pango_item_free(_PangoItem *);
+extern (C) _PangoItem * pango_item_copy(_PangoItem *);
+extern (C) _PangoItem * pango_item_new();
+extern (C) uint pango_item_get_type();
+extern (C) int pango_parse_markup(char *, int, uint, void * *, char * *, uint *, _GError * *);
+extern (C) _GSList * pango_attr_iterator_get_attrs(void *);
+extern (C) void pango_attr_iterator_get_font(void *, void *, void * *, _GSList * *);
+extern (C) _PangoAttribute * pango_attr_iterator_get(void *, int);
+extern (C) void pango_attr_iterator_destroy(void *);
+extern (C) void * pango_attr_iterator_copy(void *);
+extern (C) int pango_attr_iterator_next(void *);
+extern (C) void pango_attr_iterator_range(void *, int *, int *);
+extern (C) void * pango_attr_list_get_iterator(void *);
+extern (C) void * pango_attr_list_filter(void *, _BCD_func__3031, void *);
+extern (C) void pango_attr_list_splice(void *, void *, int, int);
+extern (C) void pango_attr_list_change(void *, _PangoAttribute *);
+extern (C) void pango_attr_list_insert_before(void *, _PangoAttribute *);
+extern (C) void pango_attr_list_insert(void *, _PangoAttribute *);
+extern (C) void * pango_attr_list_copy(void *);
+extern (C) void pango_attr_list_unref(void *);
+extern (C) void * pango_attr_list_ref(void *);
+extern (C) void * pango_attr_list_new();
+extern (C) uint pango_attr_list_get_type();
+extern (C) _PangoAttribute * pango_attr_gravity_hint_new(int);
+extern (C) _PangoAttribute * pango_attr_gravity_new(int);
+extern (C) _PangoAttribute * pango_attr_shape_new_with_data(_PangoRectangle *, _PangoRectangle *, void *, _BCD_func__3030, _BCD_func__2834);
+extern (C) _PangoAttribute * pango_attr_shape_new(_PangoRectangle *, _PangoRectangle *);
+extern (C) _PangoAttribute * pango_attr_letter_spacing_new(int);
+extern (C) _PangoAttribute * pango_attr_fallback_new(int);
+extern (C) _PangoAttribute * pango_attr_scale_new(double);
+extern (C) _PangoAttribute * pango_attr_rise_new(int);
+extern (C) _PangoAttribute * pango_attr_strikethrough_color_new(ushort, ushort, ushort);
+extern (C) _PangoAttribute * pango_attr_strikethrough_new(int);
+extern (C) _PangoAttribute * pango_attr_underline_color_new(ushort, ushort, ushort);
+extern (C) _PangoAttribute * pango_attr_underline_new(int);
+extern (C) _PangoAttribute * pango_attr_font_desc_new(void *);
+extern (C) _PangoAttribute * pango_attr_stretch_new(int);
+extern (C) _PangoAttribute * pango_attr_variant_new(int);
+extern (C) _PangoAttribute * pango_attr_weight_new(int);
+extern (C) _PangoAttribute * pango_attr_style_new(int);
+extern (C) _PangoAttribute * pango_attr_size_new_absolute(int);
+extern (C) _PangoAttribute * pango_attr_size_new(int);
+extern (C) _PangoAttribute * pango_attr_background_new(ushort, ushort, ushort);
+extern (C) _PangoAttribute * pango_attr_foreground_new(ushort, ushort, ushort);
+extern (C) _PangoAttribute * pango_attr_family_new(char *);
+extern (C) _PangoAttribute * pango_attr_language_new(void *);
+extern (C) int pango_attribute_equal(_PangoAttribute *, _PangoAttribute *);
+extern (C) void pango_attribute_destroy(_PangoAttribute *);
+extern (C) _PangoAttribute * pango_attribute_copy(_PangoAttribute *);
+extern (C) int pango_attr_type_register(char *);
+extern (C) char * pango_color_to_string(_PangoColor *);
+extern (C) int pango_color_parse(_PangoColor *, char *);
+extern (C) void pango_color_free(_PangoColor *);
+extern (C) _PangoColor * pango_color_copy(_PangoColor *);
+extern (C) uint pango_color_get_type();
+extern (C) void * pango_font_get_font_map(void *);
+extern (C) void pango_font_get_glyph_extents(void *, uint, _PangoRectangle *, _PangoRectangle *);
+extern (C) void * pango_font_get_metrics(void *, void *);
+extern (C) void * pango_font_find_shaper(void *, void *, uint);
+extern (C) void * pango_font_get_coverage(void *, void *);
+extern (C) void * pango_font_describe_with_absolute_size(void *);
+extern (C) void * pango_font_describe(void *);
+extern (C) uint pango_font_get_type();
+extern (C) int pango_font_face_is_synthesized(void *);
+extern (C) void pango_font_face_list_sizes(void *, int * *, int *);
+extern (C) char * pango_font_face_get_face_name(void *);
+extern (C) void * pango_font_face_describe(void *);
+extern (C) uint pango_font_face_get_type();
+extern (C) int pango_font_family_is_monospace(void *);
+extern (C) char * pango_font_family_get_name(void *);
+extern (C) void pango_font_family_list_faces(void *, void * * *, int *);
+extern (C) uint pango_font_family_get_type();
+extern (C) int pango_font_metrics_get_strikethrough_thickness(void *);
+extern (C) int pango_font_metrics_get_strikethrough_position(void *);
+extern (C) int pango_font_metrics_get_underline_thickness(void *);
+extern (C) int pango_font_metrics_get_underline_position(void *);
+extern (C) int pango_font_metrics_get_approximate_digit_width(void *);
+extern (C) int pango_font_metrics_get_approximate_char_width(void *);
+extern (C) int pango_font_metrics_get_descent(void *);
+extern (C) int pango_font_metrics_get_ascent(void *);
+extern (C) void pango_font_metrics_unref(void *);
+extern (C) void * pango_font_metrics_ref(void *);
+extern (C) uint pango_font_metrics_get_type();
+extern (C) char * pango_font_description_to_filename(void *);
+extern (C) char * pango_font_description_to_string(void *);
+extern (C) void * pango_font_description_from_string(char *);
+extern (C) int pango_font_description_better_match(void *, void *, void *);
+extern (C) void pango_font_description_merge_static(void *, void *, int);
+extern (C) void pango_font_description_merge(void *, void *, int);
+extern (C) void pango_font_description_unset_fields(void *, int);
+extern (C) int pango_font_description_get_set_fields(void *);
+extern (C) int pango_font_description_get_gravity(void *);
+extern (C) void pango_font_description_set_gravity(void *, int);
+extern (C) int pango_font_description_get_size_is_absolute(void *);
+extern (C) void pango_font_description_set_absolute_size(void *, double);
+extern (C) int pango_font_description_get_size(void *);
+extern (C) void pango_font_description_set_size(void *, int);
+extern (C) int pango_font_description_get_stretch(void *);
+extern (C) void pango_font_description_set_stretch(void *, int);
+extern (C) int pango_font_description_get_weight(void *);
+extern (C) void pango_font_description_set_weight(void *, int);
+extern (C) int pango_font_description_get_variant(void *);
+extern (C) void pango_font_description_set_variant(void *, int);
+extern (C) int pango_font_description_get_style(void *);
+extern (C) void pango_font_description_set_style(void *, int);
+extern (C) char * pango_font_description_get_family(void *);
+extern (C) void pango_font_description_set_family_static(void *, char *);
+extern (C) void pango_font_description_set_family(void *, char *);
+extern (C) void pango_font_descriptions_free(void * *, int);
+extern (C) void pango_font_description_free(void *);
+extern (C) int pango_font_description_equal(void *, void *);
+extern (C) uint pango_font_description_hash(void *);
+extern (C) void * pango_font_description_copy_static(void *);
+extern (C) void * pango_font_description_copy(void *);
+extern (C) void * pango_font_description_new();
+extern (C) uint pango_font_description_get_type();
+extern (C) int pango_gravity_get_for_script(int, int, int);
+extern (C) int pango_gravity_get_for_matrix(_PangoMatrix *);
+extern (C) double pango_gravity_to_rotation(int);
+extern (C) int pango_language_includes_script(void *, int);
+extern (C) void * pango_script_get_sample_language(int);
+extern (C) void pango_script_iter_free(void *);
+extern (C) int pango_script_iter_next(void *);
+extern (C) void pango_script_iter_get_range(void *, char * *, char * *, int *);
+extern (C) void * pango_script_iter_new(char *, int);
+extern (C) int pango_script_for_unichar(uint);
+extern (C) int pango_language_matches(void *, char *);
+extern (C) void * pango_language_get_default();
+extern (C) char * pango_language_get_sample_string(void *);
+extern (C) void * pango_language_from_string(char *);
+extern (C) uint pango_language_get_type();
+extern (C) double pango_matrix_get_font_scale_factor(_PangoMatrix *);
+extern (C) void pango_matrix_transform_pixel_rectangle(_PangoMatrix *, _PangoRectangle *);
+extern (C) void pango_matrix_transform_rectangle(_PangoMatrix *, _PangoRectangle *);
+extern (C) void pango_matrix_transform_distance(_PangoMatrix *, double *, double *);
+extern (C) void pango_matrix_transform_point(_PangoMatrix *, double *, double *);
+extern (C) void pango_matrix_concat(_PangoMatrix *, _PangoMatrix *);
+extern (C) void pango_matrix_rotate(_PangoMatrix *, double);
+extern (C) void pango_matrix_scale(_PangoMatrix *, double, double);
+extern (C) void pango_matrix_translate(_PangoMatrix *, double, double);
+extern (C) void pango_matrix_free(_PangoMatrix *);
+extern (C) _PangoMatrix * pango_matrix_copy(_PangoMatrix *);
+extern (C) uint pango_matrix_get_type();
+extern (C) int pango_get_mirror_char(uint, uint *);
+extern (C) int pango_find_base_dir(char *, int);
+extern (C) int pango_unichar_direction(uint);
+extern (C) void pango_extents_to_pixels(_PangoRectangle *, _PangoRectangle *);
+extern (C) double pango_units_to_double(int);
+extern (C) int pango_units_from_double(double);
+extern (C) void * pango_coverage_from_bytes(char *, int);
+extern (C) void pango_coverage_to_bytes(void *, char * *, int *);
+extern (C) void pango_coverage_max(void *, void *);
+extern (C) void pango_coverage_set(void *, int, int);
+extern (C) int pango_coverage_get(void *, int);
+extern (C) void * pango_coverage_copy(void *);
+extern (C) void pango_coverage_unref(void *);
+extern (C) void * pango_coverage_ref(void *);
+extern (C) void * pango_coverage_new();
+} // version(DYNLINK)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/c/pangocairo.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,161 @@
+/******************************************************************************
+    Based on the generated files from the BCD tool
+    modified by: Frank Benoit <keinfarbton@googlemail.com>
+******************************************************************************/
+module org.eclipse.swt.internal.c.pangocairo;
+
+import java.lang.all;
+
+public import org.eclipse.swt.internal.c.cairo;
+public import org.eclipse.swt.internal.c.pango;
+public import org.eclipse.swt.internal.c.glib_object;
+
+extern(C):
+align(4):
+
+alias void function(void *, _PangoAttrShape *, int, void *) _BCD_func__2844;
+alias _BCD_func__2844 PangoCairoShapeRendererFunc;
+alias void PangoCairoFontMap;
+alias void PangoCairoFont;
+alias void function(void *) _BCD_func__2912;
+alias int function(void *, char *, uint) _BCD_func__2907;
+alias int function(void *, char *, uint) _BCD_func__2908;
+alias void * function(void *) _BCD_func__3005;
+alias int function(_PangoAttribute *, void *) _BCD_func__3006;
+alias int function(void *, void *, void *) _BCD_func__3062;
+alias void function(void *, uint, uint, _GInterfaceInfo *) _BCD_func__3114;
+alias void function(void *, uint, _GTypeInfo *, _GTypeValueTable *) _BCD_func__3115;
+alias void function(void *) _BCD_func__3116;
+alias void function(void *, _GObject *, int) _BCD_func__3264;
+alias void function(void *, _GObject *) _BCD_func__3269;
+alias void function(_GObject *) _BCD_func__3270;
+alias void function(_GObject *, uint, _GValue *, _GParamSpec *) _BCD_func__3271;
+alias void function(_GObject *, uint, _GValue *, _GParamSpec *) _BCD_func__3272;
+alias int function(_GSignalInvocationHint *, _GValue *, _GValue *, void *) _BCD_func__3298;
+alias int function(_GSignalInvocationHint *, uint, _GValue *, void *) _BCD_func__3299;
+alias void function(_GClosure *, _GValue *, uint, _GValue *, void *, void *) _BCD_func__3300;
+alias void function(void *, _GClosure *) _BCD_func__3319;
+alias void function() _BCD_func__3320;
+alias void function(_GValue *, _GValue *) _BCD_func__3377;
+alias void * function(void *) _BCD_func__3405;
+alias void function(void *, void *) _BCD_func__3409;
+alias int function(void *, _GTypeClass *) _BCD_func__3410;
+alias void function(_GTypeInstance *, void *) _BCD_func__3411;
+alias int function(void *, void *, void *) _BCD_func__3467;
+alias int function(void *, void *, void *) _BCD_func__3483;
+alias void function(_GScanner *, char *, int) _BCD_func__3486;
+alias int function(void *, _GString *, void *) _BCD_func__3559;
+alias void function(void *, void *, void *, _GError * *) _BCD_func__3577;
+alias int function(void *, void *, void *, _GError * *) _BCD_func__3578;
+alias int function(char *, char *, void *, _GError * *) _BCD_func__3579;
+alias void * function(void *, void *) _BCD_func__3590;
+alias void function(_GNode *, void *) _BCD_func__3591;
+alias int function(_GNode *, void *) _BCD_func__3592;
+alias void function(char *) _BCD_func__3600;
+alias void function(char *, int, char *, void *) _BCD_func__3602;
+alias int function(_GIOChannel *, int, void *) _BCD_func__3620;
+alias int function(_GPollFD *, uint, int) _BCD_func__3672;
+alias void function(int, int, void *) _BCD_func__3678;
+alias int function(void *) _BCD_func__3679;
+alias void function(_GHookList *, _GHook *) _BCD_func__3714;
+alias int function(_GHook *, void *) _BCD_func__3715;
+alias void function(_GHook *, void *) _BCD_func__3716;
+alias int function(_GHook *, _GHook *) _BCD_func__3717;
+alias void function(uint, void *, void *) _BCD_func__3751;
+alias int function(char *, char *, uint) _BCD_func__3754;
+alias char * function(void *) _BCD_func__3755;
+alias char * function(char *, void *) _BCD_func__3946;
+alias void function(void *, void *, void *) _BCD_func__3947;
+alias uint function(void *) _BCD_func__3948;
+alias int function(void *, void *) _BCD_func__3949;
+alias int function(void *, void *, void *) _BCD_func__3950;
+alias int function(void *, void *) _BCD_func__3951;
+version(DYNLINK){
+extern (C) void function(void *, double, double, double, double)pango_cairo_error_underline_path;
+extern (C) void function(void *, void *)pango_cairo_layout_path;
+extern (C) void function(void *, _PangoLayoutLine *)pango_cairo_layout_line_path;
+extern (C) void function(void *, void *, _PangoGlyphString *)pango_cairo_glyph_string_path;
+extern (C) void function(void *, double, double, double, double)pango_cairo_show_error_underline;
+extern (C) void function(void *, void *)pango_cairo_show_layout;
+extern (C) void function(void *, _PangoLayoutLine *)pango_cairo_show_layout_line;
+extern (C) void function(void *, void *, _PangoGlyphString *)pango_cairo_show_glyph_string;
+extern (C) void function(void *, void *)pango_cairo_update_layout;
+extern (C) void * function(void *)pango_cairo_create_layout;
+extern (C) _BCD_func__2844 function(void *, void * *)pango_cairo_context_get_shape_renderer;
+extern (C) void function(void *, _BCD_func__2844, void *, _BCD_func__2912)pango_cairo_context_set_shape_renderer;
+extern (C) double function(void *)pango_cairo_context_get_resolution;
+extern (C) void function(void *, double)pango_cairo_context_set_resolution;
+extern (C) void * function(void *)pango_cairo_context_get_font_options;
+extern (C) void function(void *, void *)pango_cairo_context_set_font_options;
+extern (C) void function(void *, void *)pango_cairo_update_context;
+extern (C) void * function(void *)pango_cairo_font_get_scaled_font;
+extern (C) uint function()pango_cairo_font_get_type;
+extern (C) void * function(void *)pango_cairo_font_map_create_context;
+extern (C) double function(void *)pango_cairo_font_map_get_resolution;
+extern (C) void function(void *, double)pango_cairo_font_map_set_resolution;
+extern (C) int function(void *)pango_cairo_font_map_get_font_type;
+extern (C) void * function()pango_cairo_font_map_get_default;
+extern (C) void * function(int)pango_cairo_font_map_new_for_font_type;
+extern (C) void * function()pango_cairo_font_map_new;
+extern (C) uint function()pango_cairo_font_map_get_type;
+
+
+Symbol[] symbols = [
+    { "pango_cairo_error_underline_path",  cast(void**)& pango_cairo_error_underline_path},
+    { "pango_cairo_layout_path",  cast(void**)& pango_cairo_layout_path},
+    { "pango_cairo_layout_line_path",  cast(void**)& pango_cairo_layout_line_path},
+    { "pango_cairo_glyph_string_path",  cast(void**)& pango_cairo_glyph_string_path},
+    { "pango_cairo_show_error_underline",  cast(void**)& pango_cairo_show_error_underline},
+    { "pango_cairo_show_layout",  cast(void**)& pango_cairo_show_layout},
+    { "pango_cairo_show_layout_line",  cast(void**)& pango_cairo_show_layout_line},
+    { "pango_cairo_show_glyph_string",  cast(void**)& pango_cairo_show_glyph_string},
+    { "pango_cairo_update_layout",  cast(void**)& pango_cairo_update_layout},
+    { "pango_cairo_create_layout",  cast(void**)& pango_cairo_create_layout},
+    { "pango_cairo_context_get_shape_renderer",  cast(void**)& pango_cairo_context_get_shape_renderer},
+    { "pango_cairo_context_set_shape_renderer",  cast(void**)& pango_cairo_context_set_shape_renderer},
+    { "pango_cairo_context_get_resolution",  cast(void**)& pango_cairo_context_get_resolution},
+    { "pango_cairo_context_set_resolution",  cast(void**)& pango_cairo_context_set_resolution},
+    { "pango_cairo_context_get_font_options",  cast(void**)& pango_cairo_context_get_font_options},
+    { "pango_cairo_context_set_font_options",  cast(void**)& pango_cairo_context_set_font_options},
+    { "pango_cairo_update_context",  cast(void**)& pango_cairo_update_context},
+    { "pango_cairo_font_get_scaled_font",  cast(void**)& pango_cairo_font_get_scaled_font},
+    { "pango_cairo_font_get_type",  cast(void**)& pango_cairo_font_get_type},
+    { "pango_cairo_font_map_create_context",  cast(void**)& pango_cairo_font_map_create_context},
+    { "pango_cairo_font_map_get_resolution",  cast(void**)& pango_cairo_font_map_get_resolution},
+    { "pango_cairo_font_map_set_resolution",  cast(void**)& pango_cairo_font_map_set_resolution},
+    { "pango_cairo_font_map_get_font_type",  cast(void**)& pango_cairo_font_map_get_font_type},
+    { "pango_cairo_font_map_get_default",  cast(void**)& pango_cairo_font_map_get_default},
+    { "pango_cairo_font_map_new_for_font_type",  cast(void**)& pango_cairo_font_map_new_for_font_type},
+    { "pango_cairo_font_map_new",  cast(void**)& pango_cairo_font_map_new},
+    { "pango_cairo_font_map_get_type",  cast(void**)& pango_cairo_font_map_get_type},
+];
+
+} else { // version(DYNLINK)
+extern (C) void pango_cairo_error_underline_path(void *, double, double, double, double);
+extern (C) void pango_cairo_layout_path(void *, void *);
+extern (C) void pango_cairo_layout_line_path(void *, _PangoLayoutLine *);
+extern (C) void pango_cairo_glyph_string_path(void *, void *, _PangoGlyphString *);
+extern (C) void pango_cairo_show_error_underline(void *, double, double, double, double);
+extern (C) void pango_cairo_show_layout(void *, void *);
+extern (C) void pango_cairo_show_layout_line(void *, _PangoLayoutLine *);
+extern (C) void pango_cairo_show_glyph_string(void *, void *, _PangoGlyphString *);
+extern (C) void pango_cairo_update_layout(void *, void *);
+extern (C) void * pango_cairo_create_layout(void *);
+extern (C) _BCD_func__2844 pango_cairo_context_get_shape_renderer(void *, void * *);
+extern (C) void pango_cairo_context_set_shape_renderer(void *, _BCD_func__2844, void *, _BCD_func__2912);
+extern (C) double pango_cairo_context_get_resolution(void *);
+extern (C) void pango_cairo_context_set_resolution(void *, double);
+extern (C) void * pango_cairo_context_get_font_options(void *);
+extern (C) void pango_cairo_context_set_font_options(void *, void *);
+extern (C) void pango_cairo_update_context(void *, void *);
+extern (C) void * pango_cairo_font_get_scaled_font(void *);
+extern (C) uint pango_cairo_font_get_type();
+extern (C) void * pango_cairo_font_map_create_context(void *);
+extern (C) double pango_cairo_font_map_get_resolution(void *);
+extern (C) void pango_cairo_font_map_set_resolution(void *, double);
+extern (C) int pango_cairo_font_map_get_font_type(void *);
+extern (C) void * pango_cairo_font_map_get_default();
+extern (C) void * pango_cairo_font_map_new_for_font_type(int);
+extern (C) void * pango_cairo_font_map_new();
+extern (C) uint pango_cairo_font_map_get_type();
+} // version(DYNLINK)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/cairo/Cairo.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,298 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * -  Binding to permit interfacing between Cairo and SWT
+ * -  Copyright (C) 2005 IBM Corp.  All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+/* Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ */
+module org.eclipse.swt.internal.cairo.Cairo;
+
+import java.lang.all;
+
+import  org.eclipse.swt.internal.c.cairo;
+import  org.eclipse.swt.internal.c.cairo_xlib;
+import  org.eclipse.swt.internal.c.cairo_ps;
+import  org.eclipse.swt.internal.c.cairo_pdf;
+import  org.eclipse.swt.internal.c.Xlib;
+import  org.eclipse.swt.internal.Platform;
+
+import tango.core.Traits;
+
+public alias org.eclipse.swt.internal.c.cairo.cairo_t cairo_t;
+public alias org.eclipse.swt.internal.c.cairo.cairo_pattern_t cairo_pattern_t;
+public alias org.eclipse.swt.internal.c.cairo.cairo_surface_t cairo_surface_t;
+public alias org.eclipse.swt.internal.c.cairo.cairo_text_extents_t cairo_text_extents_t;
+public alias org.eclipse.swt.internal.c.cairo.cairo_font_extents_t cairo_font_extents_t;
+public alias org.eclipse.swt.internal.c.cairo.cairo_matrix_t cairo_matrix_t;
+public alias org.eclipse.swt.internal.c.cairo.cairo_path_t cairo_path_t;
+public alias org.eclipse.swt.internal.c.cairo.cairo_path_data_t cairo_path_data_t;
+
+/++++
+private extern(C) {
+cairo_surface_t *
+cairo_xlib_surface_create (void     *dpy,
+               XID/*Drawable*/ drawable,
+               Visual      *visual,
+               int      width,
+               int      height);
+}
+++++/
+
+private int CAIRO_VERSION_ENCODE(int major, int minor, int micro) {
+    return ((major) * 10000)
+        + ((minor) *   100)
+        + ((micro) *     1);
+}
+
+template NameOfFunc(alias f) {
+    // Note: highly dependent on the .stringof formatting
+    // the value begins with "& " which is why the first two chars are cut off
+    version( LDC ){
+        // stringof in LLVMDC is "&foobar"
+        const char[] NameOfFunc = (&f).stringof[1 .. $];
+    }
+    else{
+        // stringof in DMD is "& foobar"
+        const char[] NameOfFunc = (&f).stringof[2 .. $];
+    }
+}
+
+template ForwardGtkCairoCFunc( alias cFunc ) {
+    alias ParameterTupleOf!(cFunc) P;
+    alias ReturnTypeOf!(cFunc) R;
+    mixin("public static R " ~ NameOfFunc!(cFunc) ~ "( P p ){
+        lock.lock();
+        scope(exit) lock.unlock();
+        return cFunc(p);
+    }");
+}
+
+public class Cairo : Platform {
+
+    /** Constants */
+    public static const int CAIRO_ANTIALIAS_DEFAULT = 0;
+    public static const int CAIRO_ANTIALIAS_NONE = 1;
+    public static const int CAIRO_ANTIALIAS_GRAY = 2;
+    public static const int CAIRO_ANTIALIAS_SUBPIXEL = 3;
+    public static const int CAIRO_FORMAT_ARGB32 = 0;
+    public static const int CAIRO_FORMAT_RGB24 = 1;
+    public static const int CAIRO_FORMAT_A8 = 2;
+    public static const int CAIRO_FORMAT_A1 = 3;
+    public static const int CAIRO_OPERATOR_CLEAR = 0;
+    public static const int CAIRO_OPERATOR_SRC = 1;
+    public static const int CAIRO_OPERATOR_DST = 2;
+    public static const int CAIRO_OPERATOR_OVER = 3;
+    public static const int CAIRO_OPERATOR_OVER_REVERSE = 4;
+    public static const int CAIRO_OPERATOR_IN = 5;
+    public static const int CAIRO_OPERATOR_IN_REVERSE = 6;
+    public static const int CAIRO_OPERATOR_OUT = 7;
+    public static const int CAIRO_OPERATOR_OUT_REVERSE = 8;
+    public static const int CAIRO_OPERATOR_ATOP = 9;
+    public static const int CAIRO_OPERATOR_ATOP_REVERSE = 10;
+    public static const int CAIRO_OPERATOR_XOR = 11;
+    public static const int CAIRO_OPERATOR_ADD = 12;
+    public static const int CAIRO_OPERATOR_SATURATE = 13;
+    public static const int CAIRO_FILL_RULE_WINDING = 0;
+    public static const int CAIRO_FILL_RULE_EVEN_ODD = 1;
+    public static const int CAIRO_LINE_CAP_BUTT = 0;
+    public static const int CAIRO_LINE_CAP_ROUND = 1;
+    public static const int CAIRO_LINE_CAP_SQUARE = 2;
+    public static const int CAIRO_LINE_JOIN_MITER = 0;
+    public static const int CAIRO_LINE_JOIN_ROUND = 1;
+    public static const int CAIRO_LINE_JOIN_BEVEL = 2;
+    public static const int CAIRO_FONT_SLANT_NORMAL = 0;
+    public static const int CAIRO_FONT_SLANT_ITALIC = 1;
+    public static const int CAIRO_FONT_SLANT_OBLIQUE = 2;
+    public static const int CAIRO_FONT_WEIGHT_NORMAL = 0;
+    public static const int CAIRO_FONT_WEIGHT_BOLD = 1;
+    public static const int CAIRO_STATUS_SUCCESS = 0;
+    public static const int CAIRO_STATUS_NO_MEMORY = 1;
+    public static const int CAIRO_STATUS_INVALID_RESTORE = 2;
+    public static const int CAIRO_STATUS_INVALID_POP_GROUP = 3;
+    public static const int CAIRO_STATUS_NO_CURRENT_POINT = 4;
+    public static const int CAIRO_STATUS_INVALID_MATRIX = 5;
+    public static const int CAIRO_STATUS_NO_TARGET_SURFACE = 6;
+    public static const int CAIRO_STATUS_NULL_POINTER =7;
+    public static const int CAIRO_SURFACE_TYPE_IMAGE = 0;
+    public static const int CAIRO_SURFACE_TYPE_PDF = 1;
+    public static const int CAIRO_SURFACE_TYPE_PS = 2;
+    public static const int CAIRO_SURFACE_TYPE_XLIB = 3;
+    public static const int CAIRO_SURFACE_TYPE_XCB = 4;
+    public static const int CAIRO_SURFACE_TYPE_GLITZ = 5;
+    public static const int CAIRO_SURFACE_TYPE_QUARTZ = 6;
+    public static const int CAIRO_SURFACE_TYPE_WIN32 = 7;
+    public static const int CAIRO_SURFACE_TYPE_BEOS = 8;
+    public static const int CAIRO_SURFACE_TYPE_DIRECTFB = 9;
+    public static const int CAIRO_SURFACE_TYPE_SVG = 10;
+    public static const int CAIRO_FILTER_FAST = 0;
+    public static const int CAIRO_FILTER_GOOD = 1;
+    public static const int CAIRO_FILTER_BEST = 2;
+    public static const int CAIRO_FILTER_NEAREST = 3;
+    public static const int CAIRO_FILTER_BILINEAR = 4;
+    public static const int CAIRO_FILTER_GAUSSIAN = 5;
+    public static const int CAIRO_EXTEND_NONE = 0;
+    public static const int CAIRO_EXTEND_REPEAT = 1;
+    public static const int CAIRO_EXTEND_REFLECT = 2;
+    public static const int CAIRO_EXTEND_PAD = 3;
+    public static const int CAIRO_PATH_MOVE_TO = 0;
+    public static const int CAIRO_PATH_LINE_TO = 1;
+    public static const int CAIRO_PATH_CURVE_TO = 2;
+    public static const int CAIRO_PATH_CLOSE_PATH = 3;
+
+    mixin ForwardGtkCairoCFunc!(.CAIRO_VERSION_ENCODE);
+    mixin ForwardGtkCairoCFunc!(.cairo_append_path);
+    mixin ForwardGtkCairoCFunc!(.cairo_arc);
+    mixin ForwardGtkCairoCFunc!(.cairo_arc_negative);
+    mixin ForwardGtkCairoCFunc!(.cairo_clip);
+    mixin ForwardGtkCairoCFunc!(.cairo_clip_preserve);
+    mixin ForwardGtkCairoCFunc!(.cairo_close_path);
+    mixin ForwardGtkCairoCFunc!(.cairo_copy_page);
+    mixin ForwardGtkCairoCFunc!(.cairo_copy_path);
+    mixin ForwardGtkCairoCFunc!(.cairo_copy_path_flat);
+    mixin ForwardGtkCairoCFunc!(.cairo_create);
+    mixin ForwardGtkCairoCFunc!(.cairo_curve_to);
+    mixin ForwardGtkCairoCFunc!(.cairo_destroy);
+    mixin ForwardGtkCairoCFunc!(.cairo_device_to_user);
+    mixin ForwardGtkCairoCFunc!(.cairo_device_to_user_distance);
+    mixin ForwardGtkCairoCFunc!(.cairo_fill);
+    mixin ForwardGtkCairoCFunc!(.cairo_fill_extents);
+    mixin ForwardGtkCairoCFunc!(.cairo_fill_preserve);
+    mixin ForwardGtkCairoCFunc!(.cairo_font_extents);
+    mixin ForwardGtkCairoCFunc!(.cairo_font_options_create);
+    mixin ForwardGtkCairoCFunc!(.cairo_font_options_destroy);
+    mixin ForwardGtkCairoCFunc!(.cairo_font_options_get_antialias);
+    mixin ForwardGtkCairoCFunc!(.cairo_font_options_set_antialias);
+    mixin ForwardGtkCairoCFunc!(.cairo_get_antialias);
+    mixin ForwardGtkCairoCFunc!(.cairo_get_current_point);
+    mixin ForwardGtkCairoCFunc!(.cairo_get_fill_rule);
+    mixin ForwardGtkCairoCFunc!(.cairo_get_font_face);
+    mixin ForwardGtkCairoCFunc!(.cairo_get_font_matrix);
+    mixin ForwardGtkCairoCFunc!(.cairo_get_font_options);
+    mixin ForwardGtkCairoCFunc!(.cairo_get_line_cap);
+    mixin ForwardGtkCairoCFunc!(.cairo_get_line_join);
+    mixin ForwardGtkCairoCFunc!(.cairo_get_line_width);
+    mixin ForwardGtkCairoCFunc!(.cairo_get_matrix);
+    mixin ForwardGtkCairoCFunc!(.cairo_get_miter_limit);
+    mixin ForwardGtkCairoCFunc!(.cairo_get_operator);
+    mixin ForwardGtkCairoCFunc!(.cairo_get_source);
+    mixin ForwardGtkCairoCFunc!(.cairo_get_target);
+    mixin ForwardGtkCairoCFunc!(.cairo_get_tolerance);
+    mixin ForwardGtkCairoCFunc!(.cairo_glyph_extents);
+    mixin ForwardGtkCairoCFunc!(.cairo_glyph_path);
+    mixin ForwardGtkCairoCFunc!(.cairo_identity_matrix);
+    mixin ForwardGtkCairoCFunc!(.cairo_image_surface_create);
+    mixin ForwardGtkCairoCFunc!(.cairo_image_surface_create_for_data);
+    mixin ForwardGtkCairoCFunc!(.cairo_image_surface_get_height);
+    mixin ForwardGtkCairoCFunc!(.cairo_image_surface_get_width);
+    mixin ForwardGtkCairoCFunc!(.cairo_in_fill);
+    mixin ForwardGtkCairoCFunc!(.cairo_in_stroke);
+    mixin ForwardGtkCairoCFunc!(.cairo_line_to);
+    mixin ForwardGtkCairoCFunc!(.cairo_mask);
+    mixin ForwardGtkCairoCFunc!(.cairo_mask_surface);
+    mixin ForwardGtkCairoCFunc!(.cairo_matrix_init);
+    mixin ForwardGtkCairoCFunc!(.cairo_matrix_init_identity);
+    mixin ForwardGtkCairoCFunc!(.cairo_matrix_init_rotate);
+    mixin ForwardGtkCairoCFunc!(.cairo_matrix_init_scale);
+    mixin ForwardGtkCairoCFunc!(.cairo_matrix_init_translate);
+    mixin ForwardGtkCairoCFunc!(.cairo_matrix_invert);
+    mixin ForwardGtkCairoCFunc!(.cairo_matrix_multiply);
+    mixin ForwardGtkCairoCFunc!(.cairo_matrix_rotate);
+    mixin ForwardGtkCairoCFunc!(.cairo_matrix_scale);
+    mixin ForwardGtkCairoCFunc!(.cairo_matrix_transform_distance);
+    mixin ForwardGtkCairoCFunc!(.cairo_matrix_transform_point);
+    mixin ForwardGtkCairoCFunc!(.cairo_matrix_translate);
+    mixin ForwardGtkCairoCFunc!(.cairo_move_to);
+    mixin ForwardGtkCairoCFunc!(.cairo_new_path);
+    mixin ForwardGtkCairoCFunc!(.cairo_paint);
+    mixin ForwardGtkCairoCFunc!(.cairo_paint_with_alpha);
+    mixin ForwardGtkCairoCFunc!(.cairo_path_destroy);
+    mixin ForwardGtkCairoCFunc!(.cairo_pattern_add_color_stop_rgb);
+    mixin ForwardGtkCairoCFunc!(.cairo_pattern_add_color_stop_rgba);
+    mixin ForwardGtkCairoCFunc!(.cairo_pattern_create_for_surface);
+    mixin ForwardGtkCairoCFunc!(.cairo_pattern_create_linear);
+    mixin ForwardGtkCairoCFunc!(.cairo_pattern_create_radial);
+    mixin ForwardGtkCairoCFunc!(.cairo_pattern_destroy);
+    mixin ForwardGtkCairoCFunc!(.cairo_pattern_get_extend);
+    mixin ForwardGtkCairoCFunc!(.cairo_pattern_get_filter);
+    mixin ForwardGtkCairoCFunc!(.cairo_pattern_get_matrix);
+    mixin ForwardGtkCairoCFunc!(.cairo_pattern_reference);
+    mixin ForwardGtkCairoCFunc!(.cairo_pattern_set_extend);
+    mixin ForwardGtkCairoCFunc!(.cairo_pattern_set_filter);
+    mixin ForwardGtkCairoCFunc!(.cairo_pattern_set_matrix);
+    mixin ForwardGtkCairoCFunc!(.cairo_pdf_surface_set_size);
+    mixin ForwardGtkCairoCFunc!(.cairo_ps_surface_set_size);
+    mixin ForwardGtkCairoCFunc!(.cairo_rectangle);
+    mixin ForwardGtkCairoCFunc!(.cairo_reference);
+    mixin ForwardGtkCairoCFunc!(.cairo_rel_curve_to);
+    mixin ForwardGtkCairoCFunc!(.cairo_rel_line_to);
+    mixin ForwardGtkCairoCFunc!(.cairo_rel_move_to);
+    mixin ForwardGtkCairoCFunc!(.cairo_reset_clip);
+    mixin ForwardGtkCairoCFunc!(.cairo_restore);
+    mixin ForwardGtkCairoCFunc!(.cairo_rotate);
+    mixin ForwardGtkCairoCFunc!(.cairo_save);
+    mixin ForwardGtkCairoCFunc!(.cairo_scale);
+    mixin ForwardGtkCairoCFunc!(.cairo_select_font_face);
+    mixin ForwardGtkCairoCFunc!(.cairo_set_antialias);
+    mixin ForwardGtkCairoCFunc!(.cairo_set_dash);
+    mixin ForwardGtkCairoCFunc!(.cairo_set_fill_rule);
+    mixin ForwardGtkCairoCFunc!(.cairo_set_font_face);
+    mixin ForwardGtkCairoCFunc!(.cairo_set_font_matrix);
+    mixin ForwardGtkCairoCFunc!(.cairo_set_font_options);
+    mixin ForwardGtkCairoCFunc!(.cairo_set_font_size);
+    mixin ForwardGtkCairoCFunc!(.cairo_set_line_cap);
+    mixin ForwardGtkCairoCFunc!(.cairo_set_line_join);
+    mixin ForwardGtkCairoCFunc!(.cairo_set_line_width);
+    mixin ForwardGtkCairoCFunc!(.cairo_set_matrix);
+    mixin ForwardGtkCairoCFunc!(.cairo_set_miter_limit);
+    mixin ForwardGtkCairoCFunc!(.cairo_set_operator);
+    mixin ForwardGtkCairoCFunc!(.cairo_set_source);
+    mixin ForwardGtkCairoCFunc!(.cairo_set_source_rgb);
+    mixin ForwardGtkCairoCFunc!(.cairo_set_source_rgba);
+    mixin ForwardGtkCairoCFunc!(.cairo_set_source_surface);
+    mixin ForwardGtkCairoCFunc!(.cairo_set_tolerance);
+    mixin ForwardGtkCairoCFunc!(.cairo_show_glyphs);
+    mixin ForwardGtkCairoCFunc!(.cairo_show_page);
+    mixin ForwardGtkCairoCFunc!(.cairo_show_text);
+    mixin ForwardGtkCairoCFunc!(.cairo_status);
+    mixin ForwardGtkCairoCFunc!(.cairo_status_to_string);
+    mixin ForwardGtkCairoCFunc!(.cairo_stroke);
+    mixin ForwardGtkCairoCFunc!(.cairo_stroke_extents);
+    mixin ForwardGtkCairoCFunc!(.cairo_stroke_preserve);
+    mixin ForwardGtkCairoCFunc!(.cairo_surface_create_similar);
+    mixin ForwardGtkCairoCFunc!(.cairo_surface_destroy);
+    mixin ForwardGtkCairoCFunc!(.cairo_surface_finish);
+    mixin ForwardGtkCairoCFunc!(.cairo_surface_get_type);
+    mixin ForwardGtkCairoCFunc!(.cairo_surface_get_user_data);
+    mixin ForwardGtkCairoCFunc!(.cairo_surface_reference);
+    mixin ForwardGtkCairoCFunc!(.cairo_surface_set_device_offset);
+    mixin ForwardGtkCairoCFunc!(.cairo_surface_set_fallback_resolution);
+    mixin ForwardGtkCairoCFunc!(.cairo_surface_set_user_data);
+    mixin ForwardGtkCairoCFunc!(.cairo_text_extents);
+    mixin ForwardGtkCairoCFunc!(.cairo_text_path);
+    mixin ForwardGtkCairoCFunc!(.cairo_transform);
+    mixin ForwardGtkCairoCFunc!(.cairo_translate);
+    mixin ForwardGtkCairoCFunc!(.cairo_user_to_device);
+    mixin ForwardGtkCairoCFunc!(.cairo_user_to_device_distance);
+    mixin ForwardGtkCairoCFunc!(.cairo_version);
+    mixin ForwardGtkCairoCFunc!(.cairo_xlib_surface_create);
+    /++/
+    mixin ForwardGtkCairoCFunc!(.cairo_xlib_surface_create_for_bitmap);
+    mixin ForwardGtkCairoCFunc!(.cairo_xlib_surface_set_size);
+/++/
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/gtk/OS.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,2994 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved.
+ * The contents of this file are made available under the terms
+ * of the GNU Lesser General Public License (LGPL) Version 2.1 that
+ * accompanies this distribution (lgpl-v21.txt).  The LGPL is also
+ * available at http://www.gnu.org/licenses/lgpl.html.  If the version
+ * of the LGPL at http://www.gnu.org is different to the version of
+ * the LGPL accompanying this distribution and there is any conflict
+ * between the two license versions, the terms of the LGPL accompanying
+ * this distribution shall govern.
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *     John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.internal.gtk.OS;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.Platform;
+import tango.core.Traits;
+import tango.stdc.locale;
+import tango.stdc.posix.stdlib : realpath;
+
+import  org.eclipse.swt.internal.c.gtk,
+        org.eclipse.swt.internal.c.gdk,
+        org.eclipse.swt.internal.c.gdkx,
+        org.eclipse.swt.internal.c.atk,
+        org.eclipse.swt.internal.c.cairo,
+        org.eclipse.swt.internal.c.pango,
+        org.eclipse.swt.internal.c.pangocairo,
+        org.eclipse.swt.internal.c.gtk_unix_print_2_0,
+        org.eclipse.swt.internal.c.Xlib,
+        org.eclipse.swt.internal.c.XTest,
+        org.eclipse.swt.internal.c.Xrender,
+        org.eclipse.swt.internal.c.glib_object;
+
+static import tango.stdc.string;
+//version=GTK_DYN_LINK;
+
+public alias org.eclipse.swt.internal.c.glib_object.GPollFD GPollFD;
+public alias org.eclipse.swt.internal.c.glib_object.GClosure GClosure;
+public alias org.eclipse.swt.internal.c.glib_object.GList GList;
+public alias org.eclipse.swt.internal.c.glib_object.GObject GObject;
+public alias org.eclipse.swt.internal.c.glib_object.GTypeInfo GTypeInfo;
+public alias org.eclipse.swt.internal.c.glib_object.GCallback GCallback;
+public alias org.eclipse.swt.internal.c.glib_object.GClosureNotify GClosureNotify;
+public alias org.eclipse.swt.internal.c.glib_object.GPollFunc GPollFunc;
+public alias org.eclipse.swt.internal.c.glib_object.GTypeInstance GTypeInstance;
+public alias org.eclipse.swt.internal.c.glib_object.GObjectClass GObjectClass;
+public alias org.eclipse.swt.internal.c.glib_object.GTypeClass GTypeClass;
+public alias org.eclipse.swt.internal.c.glib_object.GInterfaceInfo GInterfaceInfo;
+public alias org.eclipse.swt.internal.c.glib_object.GTypeQuery GTypeQuery;
+public alias org.eclipse.swt.internal.c.glib_object.GError GError;
+public alias org.eclipse.swt.internal.c.glib_object.GSignalEmissionHook GSignalEmissionHook;
+public alias org.eclipse.swt.internal.c.glib_object.GSignalInvocationHint GSignalInvocationHint;
+public alias org.eclipse.swt.internal.c.glib_object.GValue GValue;
+
+public alias org.eclipse.swt.internal.c.gdk.GdkColor GdkColor;
+public alias org.eclipse.swt.internal.c.gdk.GdkRegion GdkRegion;
+public alias org.eclipse.swt.internal.c.gdk.GdkDrawable GdkDrawable;
+public alias org.eclipse.swt.internal.c.gdk.GdkGC GdkGC;
+public alias org.eclipse.swt.internal.c.gdk.GdkPixbuf GdkPixbuf;
+public alias org.eclipse.swt.internal.c.gdk.GdkCursor GdkCursor;
+public alias org.eclipse.swt.internal.c.gdk.GdkEvent GdkEvent;
+public alias org.eclipse.swt.internal.c.gdk.GdkEventKey GdkEventKey;
+public alias org.eclipse.swt.internal.c.gdk.GdkWindow GdkWindow;
+public alias org.eclipse.swt.internal.c.gdk.GdkEventButton GdkEventButton;
+public alias org.eclipse.swt.internal.c.gdk.GdkRectangle GdkRectangle;
+public alias org.eclipse.swt.internal.c.gdk.GdkEventExpose GdkEventExpose;
+public alias org.eclipse.swt.internal.c.gdk.GdkEventCrossing GdkEventCrossing;
+public alias org.eclipse.swt.internal.c.gdk.GdkEventMotion GdkEventMotion;
+public alias org.eclipse.swt.internal.c.gdk.GdkEventScroll GdkEventScroll;
+public alias org.eclipse.swt.internal.c.gdk.GdkEventVisibility GdkEventVisibility;
+public alias org.eclipse.swt.internal.c.gdk.GdkXEvent GdkXEvent;
+public alias org.eclipse.swt.internal.c.gdk.GdkPoint GdkPoint;
+public alias org.eclipse.swt.internal.c.gdk.GdkPixmap GdkPixmap;
+public alias org.eclipse.swt.internal.c.gdk.GdkBitmap GdkBitmap;
+public alias org.eclipse.swt.internal.c.gdk.GdkGCValues GdkGCValues;
+public alias org.eclipse.swt.internal.c.gdk.GdkDisplay GdkDisplay;
+public alias org.eclipse.swt.internal.c.gdk.GdkImage GdkImage;
+public alias org.eclipse.swt.internal.c.gdk.GdkEventAny GdkEventAny;
+public alias org.eclipse.swt.internal.c.gdk.GdkEventFocus GdkEventFocus;
+public alias org.eclipse.swt.internal.c.gdk.GdkWindowAttr GdkWindowAttr;
+public alias org.eclipse.swt.internal.c.gdk.GdkEventWindowState GdkEventWindowState;
+public alias org.eclipse.swt.internal.c.gdk.GdkDragContext GdkDragContext;
+
+public alias org.eclipse.swt.internal.c.pango.PangoAttrColor PangoAttrColor;
+public alias org.eclipse.swt.internal.c.pango.PangoAttribute PangoAttribute;
+public alias org.eclipse.swt.internal.c.pango.PangoAttrList PangoAttrList;
+public alias org.eclipse.swt.internal.c.pango.PangoAttrInt PangoAttrInt;
+public alias org.eclipse.swt.internal.c.pango.PangoContext PangoContext;
+public alias org.eclipse.swt.internal.c.pango.PangoFontDescription PangoFontDescription;
+public alias org.eclipse.swt.internal.c.pango.PangoFontFace PangoFontFace;
+public alias org.eclipse.swt.internal.c.pango.PangoFontFamily PangoFontFamily;
+public alias org.eclipse.swt.internal.c.pango.PangoItem PangoItem;
+public alias org.eclipse.swt.internal.c.pango.PangoLogAttr PangoLogAttr;
+public alias org.eclipse.swt.internal.c.pango.PangoLayout PangoLayout;
+public alias org.eclipse.swt.internal.c.pango.PangoLayoutLine PangoLayoutLine;
+public alias org.eclipse.swt.internal.c.pango.PangoLayoutRun PangoLayoutRun;
+public alias org.eclipse.swt.internal.c.pango.PangoRectangle PangoRectangle;
+public alias org.eclipse.swt.internal.c.pango.PangoTabArray PangoTabArray;
+
+public alias org.eclipse.swt.internal.c.cairo.cairo_t cairo_t;
+public alias org.eclipse.swt.internal.c.cairo.cairo_pattern_t cairo_pattern_t;
+public alias org.eclipse.swt.internal.c.cairo.cairo_surface_t cairo_surface_t;
+public alias org.eclipse.swt.internal.c.cairo.cairo_text_extents_t cairo_text_extents_t;
+public alias org.eclipse.swt.internal.c.cairo.cairo_font_extents_t cairo_font_extents_t;
+public alias org.eclipse.swt.internal.c.cairo.cairo_matrix_t cairo_matrix_t;
+public alias org.eclipse.swt.internal.c.cairo.cairo_path_t cairo_path_t;
+public alias org.eclipse.swt.internal.c.cairo.cairo_path_data_t cairo_path_data_t;
+
+public alias org.eclipse.swt.internal.c.gtk.GtkVSeparatorClass GtkVSeparatorClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkVSeparator GtkVSeparator;
+public alias org.eclipse.swt.internal.c.gtk.GtkVScaleClass GtkVScaleClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkVScale GtkVScale;
+public alias org.eclipse.swt.internal.c.gtk.GtkVRulerClass GtkVRulerClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkVRuler GtkVRuler;
+public alias org.eclipse.swt.internal.c.gtk.GtkVPanedClass GtkVPanedClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkVPaned GtkVPaned;
+public alias org.eclipse.swt.internal.c.gtk.GtkVolumeButtonClass GtkVolumeButtonClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkVButtonBoxClass GtkVButtonBoxClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkVButtonBox GtkVButtonBox;
+public alias org.eclipse.swt.internal.c.gtk.GtkUIManagerClass GtkUIManagerClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkUIManager GtkUIManager;
+public alias org.eclipse.swt.internal.c.gtk.GtkTreeStoreClass GtkTreeStoreClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkTreeStore GtkTreeStore;
+public alias org.eclipse.swt.internal.c.gtk.GtkTreeModelSortClass GtkTreeModelSortClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkTreeModelSort GtkTreeModelSort;
+public alias org.eclipse.swt.internal.c.gtk.GtkTreeDragDestIface GtkTreeDragDestIface;
+public alias org.eclipse.swt.internal.c.gtk.GtkTreeDragSourceIface GtkTreeDragSourceIface;
+public alias org.eclipse.swt.internal.c.gtk.GtkToolbarClass GtkToolbarClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkToolbar GtkToolbar;
+public alias org.eclipse.swt.internal.c.gtk.GtkToolbarChild GtkToolbarChild;
+public alias org.eclipse.swt.internal.c.gtk.GtkTipsQueryClass GtkTipsQueryClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkTipsQuery GtkTipsQuery;
+public alias org.eclipse.swt.internal.c.gtk.GtkTextViewClass GtkTextViewClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkTextView GtkTextView;
+public alias org.eclipse.swt.internal.c.gtk.GtkTextBufferClass GtkTextBufferClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkTextMarkClass GtkTextMarkClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkTextMark GtkTextMark;
+public alias org.eclipse.swt.internal.c.gtk.GtkTextTagTableClass GtkTextTagTableClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkTearoffMenuItemClass GtkTearoffMenuItemClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkTearoffMenuItem GtkTearoffMenuItem;
+public alias org.eclipse.swt.internal.c.gtk.GtkTableRowCol GtkTableRowCol;
+public alias org.eclipse.swt.internal.c.gtk.GtkTableChild GtkTableChild;
+public alias org.eclipse.swt.internal.c.gtk.GtkTableClass GtkTableClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkTable GtkTable;
+public alias org.eclipse.swt.internal.c.gtk.GtkStockItem GtkStockItem;
+public alias org.eclipse.swt.internal.c.gtk.GtkStatusIconClass GtkStatusIconClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkStatusIcon GtkStatusIcon;
+public alias org.eclipse.swt.internal.c.gtk.GtkStatusbarClass GtkStatusbarClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkStatusbar GtkStatusbar;
+public alias org.eclipse.swt.internal.c.gtk.GtkSpinButtonClass GtkSpinButtonClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkSpinButton GtkSpinButton;
+public alias org.eclipse.swt.internal.c.gtk.GtkSizeGroupClass GtkSizeGroupClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkSizeGroup GtkSizeGroup;
+public alias org.eclipse.swt.internal.c.gtk.GtkSeparatorToolItemClass GtkSeparatorToolItemClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkSeparatorToolItem GtkSeparatorToolItem;
+public alias org.eclipse.swt.internal.c.gtk.GtkSeparatorMenuItemClass GtkSeparatorMenuItemClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkSeparatorMenuItem GtkSeparatorMenuItem;
+public alias org.eclipse.swt.internal.c.gtk.GtkScrolledWindowClass GtkScrolledWindowClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkScrolledWindow GtkScrolledWindow;
+public alias org.eclipse.swt.internal.c.gtk.GtkViewportClass GtkViewportClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkViewport GtkViewport;
+public alias org.eclipse.swt.internal.c.gtk.GtkScaleButtonClass GtkScaleButtonClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkScaleButton GtkScaleButton;
+public alias org.eclipse.swt.internal.c.gtk.GtkRecentChooserWidgetClass GtkRecentChooserWidgetClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkRecentChooserWidget GtkRecentChooserWidget;
+public alias org.eclipse.swt.internal.c.gtk.GtkRecentChooserMenuClass GtkRecentChooserMenuClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkRecentChooserMenu GtkRecentChooserMenu;
+public alias org.eclipse.swt.internal.c.gtk.GtkRecentChooserDialogClass GtkRecentChooserDialogClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkRecentChooserDialog GtkRecentChooserDialog;
+public alias org.eclipse.swt.internal.c.gtk.GtkRecentChooserIface GtkRecentChooserIface;
+public alias org.eclipse.swt.internal.c.gtk.GtkRecentFilterInfo GtkRecentFilterInfo;
+public alias org.eclipse.swt.internal.c.gtk.GtkRecentActionClass GtkRecentActionClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkRecentAction GtkRecentAction;
+public alias org.eclipse.swt.internal.c.gtk.GtkRecentManagerClass GtkRecentManagerClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkRecentManager GtkRecentManager;
+public alias org.eclipse.swt.internal.c.gtk.GtkRecentData GtkRecentData;
+public alias org.eclipse.swt.internal.c.gtk.GtkRadioToolButtonClass GtkRadioToolButtonClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkRadioToolButton GtkRadioToolButton;
+public alias org.eclipse.swt.internal.c.gtk.GtkToggleToolButtonClass GtkToggleToolButtonClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkToggleToolButton GtkToggleToolButton;
+public alias org.eclipse.swt.internal.c.gtk.GtkRadioMenuItemClass GtkRadioMenuItemClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkRadioMenuItem GtkRadioMenuItem;
+public alias org.eclipse.swt.internal.c.gtk.GtkRadioButtonClass GtkRadioButtonClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkRadioButton GtkRadioButton;
+public alias org.eclipse.swt.internal.c.gtk.GtkRadioActionClass GtkRadioActionClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkRadioAction GtkRadioAction;
+public alias org.eclipse.swt.internal.c.gtk.GtkToggleActionClass GtkToggleActionClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkToggleAction GtkToggleAction;
+public alias org.eclipse.swt.internal.c.gtk.GtkProgressBarClass GtkProgressBarClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkProgressBar GtkProgressBar;
+public alias org.eclipse.swt.internal.c.gtk.GtkProgressClass GtkProgressClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkProgress GtkProgress;
+public alias org.eclipse.swt.internal.c.gtk.GtkPrintOperation GtkPrintOperation;
+public alias org.eclipse.swt.internal.c.gtk.GtkPrintOperationClass GtkPrintOperationClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkPrintOperationPreviewIface GtkPrintOperationPreviewIface;
+public alias org.eclipse.swt.internal.c.gtk.GtkPageRange GtkPageRange;
+public alias org.eclipse.swt.internal.c.gtk.GtkPreviewClass GtkPreviewClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkPreviewInfo GtkPreviewInfo;
+public alias org.eclipse.swt.internal.c.gtk.GtkPreview GtkPreview;
+public alias org.eclipse.swt.internal.c.gtk.GtkPlugClass GtkPlugClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkPlug GtkPlug;
+public alias org.eclipse.swt.internal.c.gtk.GtkSocketClass GtkSocketClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkSocket GtkSocket;
+public alias org.eclipse.swt.internal.c.gtk.GtkPixmapClass GtkPixmapClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkPixmap GtkPixmap;
+public alias org.eclipse.swt.internal.c.gtk.GtkOptionMenuClass GtkOptionMenuClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkOptionMenu GtkOptionMenu;
+public alias org.eclipse.swt.internal.c.gtk.GtkOldEditableClass GtkOldEditableClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkOldEditable GtkOldEditable;
+public alias org.eclipse.swt.internal.c.gtk.GtkNotebookClass GtkNotebookClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkNotebook GtkNotebook;
+public alias org.eclipse.swt.internal.c.gtk.GtkMessageDialogClass GtkMessageDialogClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkMessageDialog GtkMessageDialog;
+public alias org.eclipse.swt.internal.c.gtk.GtkMenuToolButton GtkMenuToolButton;
+public alias org.eclipse.swt.internal.c.gtk.GtkMenuToolButtonClass GtkMenuToolButtonClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkToolButtonClass GtkToolButtonClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkToolButton GtkToolButton;
+public alias org.eclipse.swt.internal.c.gtk.GtkToolItemClass GtkToolItemClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkToolItem GtkToolItem;
+public alias org.eclipse.swt.internal.c.gtk.GtkTooltipsData GtkTooltipsData;
+public alias org.eclipse.swt.internal.c.gtk.GtkTooltipsClass GtkTooltipsClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkTooltips GtkTooltips;
+public alias org.eclipse.swt.internal.c.gtk.GtkMenuBarClass GtkMenuBarClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkMenuBar GtkMenuBar;
+public alias org.eclipse.swt.internal.c.gtk.GtkListClass GtkListClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkList GtkList;
+public alias org.eclipse.swt.internal.c.gtk.GtkListItemClass GtkListItemClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkListItem GtkListItem;
+public alias org.eclipse.swt.internal.c.gtk.GtkLinkButtonClass GtkLinkButtonClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkLinkButton GtkLinkButton;
+public alias org.eclipse.swt.internal.c.gtk.GtkLayoutClass GtkLayoutClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkLayout GtkLayout;
+public alias org.eclipse.swt.internal.c.gtk.GtkInvisibleClass GtkInvisibleClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkInvisible GtkInvisible;
+public alias org.eclipse.swt.internal.c.gtk.GtkInputDialogClass GtkInputDialogClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkInputDialog GtkInputDialog;
+public alias org.eclipse.swt.internal.c.gtk.GtkIMMulticontextClass GtkIMMulticontextClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkIMMulticontext GtkIMMulticontext;
+public alias org.eclipse.swt.internal.c.gtk.GtkIMContextSimpleClass GtkIMContextSimpleClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkIMContextSimple GtkIMContextSimple;
+public alias org.eclipse.swt.internal.c.gtk.GtkImageMenuItemClass GtkImageMenuItemClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkImageMenuItem GtkImageMenuItem;
+public alias org.eclipse.swt.internal.c.gtk.GtkIconViewClass GtkIconViewClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkIconView GtkIconView;
+public alias org.eclipse.swt.internal.c.gtk.GtkIconThemeClass GtkIconThemeClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkIconTheme GtkIconTheme;
+public alias org.eclipse.swt.internal.c.gtk.GtkIconFactoryClass GtkIconFactoryClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkHSeparatorClass GtkHSeparatorClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkHSeparator GtkHSeparator;
+public alias org.eclipse.swt.internal.c.gtk.GtkSeparatorClass GtkSeparatorClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkSeparator GtkSeparator;
+public alias org.eclipse.swt.internal.c.gtk.GtkHScaleClass GtkHScaleClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkHScale GtkHScale;
+public alias org.eclipse.swt.internal.c.gtk.GtkScaleClass GtkScaleClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkScale GtkScale;
+public alias org.eclipse.swt.internal.c.gtk.GtkHRulerClass GtkHRulerClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkHRuler GtkHRuler;
+public alias org.eclipse.swt.internal.c.gtk.GtkRulerMetric GtkRulerMetric;
+public alias org.eclipse.swt.internal.c.gtk.GtkRulerClass GtkRulerClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkRuler GtkRuler;
+public alias org.eclipse.swt.internal.c.gtk.GtkHPanedClass GtkHPanedClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkHPaned GtkHPaned;
+public alias org.eclipse.swt.internal.c.gtk.GtkPanedClass GtkPanedClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkPaned GtkPaned;
+public alias org.eclipse.swt.internal.c.gtk.GtkHButtonBoxClass GtkHButtonBoxClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkHButtonBox GtkHButtonBox;
+public alias org.eclipse.swt.internal.c.gtk.GtkHandleBoxClass GtkHandleBoxClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkHandleBox GtkHandleBox;
+public alias org.eclipse.swt.internal.c.gtk.GtkGammaCurveClass GtkGammaCurveClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkGammaCurve GtkGammaCurve;
+public alias org.eclipse.swt.internal.c.gtk.GtkFontSelectionDialogClass GtkFontSelectionDialogClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkFontSelectionDialog GtkFontSelectionDialog;
+public alias org.eclipse.swt.internal.c.gtk.GtkFontSelectionClass GtkFontSelectionClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkFontSelection GtkFontSelection;
+public alias org.eclipse.swt.internal.c.gtk.GtkFontButtonClass GtkFontButtonClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkFontButton GtkFontButton;
+public alias org.eclipse.swt.internal.c.gtk.GtkFileChooserWidgetClass GtkFileChooserWidgetClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkFileChooserWidget GtkFileChooserWidget;
+public alias org.eclipse.swt.internal.c.gtk.GtkFileChooserDialogClass GtkFileChooserDialogClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkFileChooserDialog GtkFileChooserDialog;
+public alias org.eclipse.swt.internal.c.gtk.GtkFileChooserButtonClass GtkFileChooserButtonClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkFileChooserButton GtkFileChooserButton;
+public alias org.eclipse.swt.internal.c.gtk.GtkFileFilterInfo GtkFileFilterInfo;
+public alias org.eclipse.swt.internal.c.gtk.GtkFileFilter GtkFileFilter;
+public alias org.eclipse.swt.internal.c.gtk.GtkFixedChild GtkFixedChild;
+public alias org.eclipse.swt.internal.c.gtk.GtkFixedClass GtkFixedClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkFixed GtkFixed;
+public alias org.eclipse.swt.internal.c.gtk.GtkFileSelectionClass GtkFileSelectionClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkFileSelection GtkFileSelection;
+public alias org.eclipse.swt.internal.c.gtk.GtkExpanderClass GtkExpanderClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkExpander GtkExpander;
+public alias org.eclipse.swt.internal.c.gtk.GtkEventBoxClass GtkEventBoxClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkEventBox GtkEventBox;
+public alias org.eclipse.swt.internal.c.gtk.GtkCurveClass GtkCurveClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkCurve GtkCurve;
+public alias org.eclipse.swt.internal.c.gtk.GtkDrawingAreaClass GtkDrawingAreaClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkDrawingArea GtkDrawingArea;
+public alias org.eclipse.swt.internal.c.gtk.GtkCTreeNode GtkCTreeNode;
+public alias org.eclipse.swt.internal.c.gtk.GtkCTreeRow GtkCTreeRow;
+public alias org.eclipse.swt.internal.c.gtk.GtkCTreeClass GtkCTreeClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkCTree GtkCTree;
+public alias org.eclipse.swt.internal.c.gtk.GtkComboBoxEntryClass GtkComboBoxEntryClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkComboBoxEntry GtkComboBoxEntry;
+public alias org.eclipse.swt.internal.c.gtk.GtkComboBoxClass GtkComboBoxClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkComboBox GtkComboBox;
+public alias org.eclipse.swt.internal.c.gtk.GtkTreeSelectionClass GtkTreeSelectionClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkTreeSelection GtkTreeSelection;
+public alias org.eclipse.swt.internal.c.gtk.GtkTreeViewClass GtkTreeViewClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkTreeView GtkTreeView;
+public alias org.eclipse.swt.internal.c.gtk.GtkEntryClass GtkEntryClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkEntry GtkEntry;
+public alias org.eclipse.swt.internal.c.gtk.GtkEntryCompletionClass GtkEntryCompletionClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkEntryCompletion GtkEntryCompletion;
+public alias org.eclipse.swt.internal.c.gtk.GtkTreeModelFilterClass GtkTreeModelFilterClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkTreeModelFilter GtkTreeModelFilter;
+public alias org.eclipse.swt.internal.c.gtk.GtkListStoreClass GtkListStoreClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkListStore GtkListStore;
+public alias org.eclipse.swt.internal.c.gtk.GtkIMContextClass GtkIMContextClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkIMContext GtkIMContext;
+public alias org.eclipse.swt.internal.c.gtk.GtkEditableClass GtkEditableClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkComboClass GtkComboClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkCombo GtkCombo;
+public alias org.eclipse.swt.internal.c.gtk.GtkHBoxClass GtkHBoxClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkHBox GtkHBox;
+public alias org.eclipse.swt.internal.c.gtk.GtkColorSelectionDialogClass GtkColorSelectionDialogClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkColorSelectionDialog GtkColorSelectionDialog;
+public alias org.eclipse.swt.internal.c.gtk.GtkColorSelectionClass GtkColorSelectionClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkColorSelection GtkColorSelection;
+public alias org.eclipse.swt.internal.c.gtk.GtkVBoxClass GtkVBoxClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkVBox GtkVBox;
+public alias org.eclipse.swt.internal.c.gtk.GtkColorButtonClass GtkColorButtonClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkColorButton GtkColorButton;
+public alias org.eclipse.swt.internal.c.gtk.GtkCListDestInfo GtkCListDestInfo;
+public alias org.eclipse.swt.internal.c.gtk.GtkCListCellInfo GtkCListCellInfo;
+public alias org.eclipse.swt.internal.c.gtk.GtkCellWidget GtkCellWidget;
+public alias org.eclipse.swt.internal.c.gtk.GtkCellPixText GtkCellPixText;
+public alias org.eclipse.swt.internal.c.gtk.GtkCellPixmap GtkCellPixmap;
+public alias org.eclipse.swt.internal.c.gtk.GtkCellText GtkCellText;
+public alias org.eclipse.swt.internal.c.gtk.GtkCell GtkCell;
+public alias org.eclipse.swt.internal.c.gtk.GtkCListRow GtkCListRow;
+public alias org.eclipse.swt.internal.c.gtk.GtkCListColumn GtkCListColumn;
+public alias org.eclipse.swt.internal.c.gtk.GtkCListClass GtkCListClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkCList GtkCList;
+public alias org.eclipse.swt.internal.c.gtk.GtkVScrollbarClass GtkVScrollbarClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkVScrollbar GtkVScrollbar;
+public alias org.eclipse.swt.internal.c.gtk.GtkHScrollbarClass GtkHScrollbarClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkHScrollbar GtkHScrollbar;
+public alias org.eclipse.swt.internal.c.gtk.GtkScrollbarClass GtkScrollbarClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkScrollbar GtkScrollbar;
+public alias org.eclipse.swt.internal.c.gtk.GtkRangeClass GtkRangeClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkRange GtkRange;
+public alias org.eclipse.swt.internal.c.gtk.GtkTargetPair GtkTargetPair;
+public alias org.eclipse.swt.internal.c.gtk.GtkTargetEntry GtkTargetEntry;
+public alias org.eclipse.swt.internal.c.gtk.GtkTargetList GtkTargetList;
+public alias org.eclipse.swt.internal.c.gtk.GtkTextBuffer GtkTextBuffer;
+public alias org.eclipse.swt.internal.c.gtk.GtkTextChildAnchorClass GtkTextChildAnchorClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkTextChildAnchor GtkTextChildAnchor;
+public alias org.eclipse.swt.internal.c.gtk.GtkTextAppearance GtkTextAppearance;
+public alias org.eclipse.swt.internal.c.gtk.GtkTextTagClass GtkTextTagClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkTextTag GtkTextTag;
+public alias org.eclipse.swt.internal.c.gtk.GtkTextAttributes GtkTextAttributes;
+public alias org.eclipse.swt.internal.c.gtk.GtkTextTagTable GtkTextTagTable;
+public alias org.eclipse.swt.internal.c.gtk.GtkTextIter GtkTextIter;
+public alias org.eclipse.swt.internal.c.gtk.GtkCheckMenuItemClass GtkCheckMenuItemClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkCheckMenuItem GtkCheckMenuItem;
+public alias org.eclipse.swt.internal.c.gtk.GtkMenuItemClass GtkMenuItemClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkMenuItem GtkMenuItem;
+public alias org.eclipse.swt.internal.c.gtk.GtkItemClass GtkItemClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkItem GtkItem;
+public alias org.eclipse.swt.internal.c.gtk.GtkCheckButtonClass GtkCheckButtonClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkCheckButton GtkCheckButton;
+public alias org.eclipse.swt.internal.c.gtk.GtkToggleButtonClass GtkToggleButtonClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkToggleButton GtkToggleButton;
+public alias org.eclipse.swt.internal.c.gtk.GtkCellViewClass GtkCellViewClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkCellView GtkCellView;
+public alias org.eclipse.swt.internal.c.gtk.GtkCellRendererToggleClass GtkCellRendererToggleClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkCellRendererToggle GtkCellRendererToggle;
+public alias org.eclipse.swt.internal.c.gtk.GtkCellRendererSpinClass GtkCellRendererSpinClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkCellRendererSpin GtkCellRendererSpin;
+public alias org.eclipse.swt.internal.c.gtk.GtkCellRendererProgressClass GtkCellRendererProgressClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkCellRendererProgress GtkCellRendererProgress;
+public alias org.eclipse.swt.internal.c.gtk.GtkCellRendererPixbufClass GtkCellRendererPixbufClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkCellRendererPixbuf GtkCellRendererPixbuf;
+public alias org.eclipse.swt.internal.c.gtk.GtkCellRendererComboClass GtkCellRendererComboClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkCellRendererCombo GtkCellRendererCombo;
+public alias org.eclipse.swt.internal.c.gtk.GtkCellRendererAccelClass GtkCellRendererAccelClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkCellRendererAccel GtkCellRendererAccel;
+public alias org.eclipse.swt.internal.c.gtk.GtkCellRendererTextClass GtkCellRendererTextClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkCellRendererText GtkCellRendererText;
+public alias org.eclipse.swt.internal.c.gtk.GtkCellLayoutIface GtkCellLayoutIface;
+public alias org.eclipse.swt.internal.c.gtk.GtkTreeViewColumnClass GtkTreeViewColumnClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkTreeViewColumn GtkTreeViewColumn;
+public alias org.eclipse.swt.internal.c.gtk.GtkTreeSortableIface GtkTreeSortableIface;
+public alias org.eclipse.swt.internal.c.gtk.GtkTreeModelIface GtkTreeModelIface;
+public alias org.eclipse.swt.internal.c.gtk.GtkTreeIter GtkTreeIter;
+public alias org.eclipse.swt.internal.c.gtk.GtkCellRendererClass GtkCellRendererClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkCellRenderer GtkCellRenderer;
+public alias org.eclipse.swt.internal.c.gtk.GtkCellEditableIface GtkCellEditableIface;
+public alias org.eclipse.swt.internal.c.gtk.GtkCalendarClass GtkCalendarClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkCalendar GtkCalendar;
+public alias org.eclipse.swt.internal.c.gtk.GtkButtonClass GtkButtonClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkButton GtkButton;
+public alias org.eclipse.swt.internal.c.gtk.GtkImageIconNameData GtkImageIconNameData;
+public alias org.eclipse.swt.internal.c.gtk.GtkImageAnimationData GtkImageAnimationData;
+public alias org.eclipse.swt.internal.c.gtk.GtkImageIconSetData GtkImageIconSetData;
+public alias org.eclipse.swt.internal.c.gtk.GtkImageStockData GtkImageStockData;
+public alias org.eclipse.swt.internal.c.gtk.GtkImagePixbufData GtkImagePixbufData;
+public alias org.eclipse.swt.internal.c.gtk.GtkImageImageData GtkImageImageData;
+public alias org.eclipse.swt.internal.c.gtk.GtkImagePixmapData GtkImagePixmapData;
+public alias org.eclipse.swt.internal.c.gtk.GtkImageClass GtkImageClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkImage GtkImage;
+public alias org.eclipse.swt.internal.c.gtk.GtkBuildableIface GtkBuildableIface;
+public alias org.eclipse.swt.internal.c.gtk.GtkBuilderClass GtkBuilderClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkBuilder GtkBuilder;
+public alias org.eclipse.swt.internal.c.gtk.GtkBindingArg GtkBindingArg;
+public alias org.eclipse.swt.internal.c.gtk.GtkBindingSignal GtkBindingSignal;
+public alias org.eclipse.swt.internal.c.gtk.GtkBindingEntry GtkBindingEntry;
+public alias org.eclipse.swt.internal.c.gtk.GtkBindingSet GtkBindingSet;
+public alias org.eclipse.swt.internal.c.gtk.GtkButtonBoxClass GtkButtonBoxClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkButtonBox GtkButtonBox;
+public alias org.eclipse.swt.internal.c.gtk.GtkBoxChild GtkBoxChild;
+public alias org.eclipse.swt.internal.c.gtk.GtkBoxClass GtkBoxClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkBox GtkBox;
+public alias org.eclipse.swt.internal.c.gtk.GtkAssistantClass GtkAssistantClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkAssistant GtkAssistant;
+public alias org.eclipse.swt.internal.c.gtk.GtkAspectFrameClass GtkAspectFrameClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkAspectFrame GtkAspectFrame;
+public alias org.eclipse.swt.internal.c.gtk.GtkFrameClass GtkFrameClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkFrame GtkFrame;
+public alias org.eclipse.swt.internal.c.gtk.GtkArrowClass GtkArrowClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkArrow GtkArrow;
+public alias org.eclipse.swt.internal.c.gtk.GtkAlignmentClass GtkAlignmentClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkAlignment GtkAlignment;
+public alias org.eclipse.swt.internal.c.gtk.GtkRadioActionEntry GtkRadioActionEntry;
+public alias org.eclipse.swt.internal.c.gtk.GtkToggleActionEntry GtkToggleActionEntry;
+public alias org.eclipse.swt.internal.c.gtk.GtkActionEntry GtkActionEntry;
+public alias org.eclipse.swt.internal.c.gtk.GtkActionGroupClass GtkActionGroupClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkActionGroup GtkActionGroup;
+public alias org.eclipse.swt.internal.c.gtk.GtkItemFactoryItem GtkItemFactoryItem;
+public alias org.eclipse.swt.internal.c.gtk.GtkItemFactoryEntry GtkItemFactoryEntry;
+public alias org.eclipse.swt.internal.c.gtk.GtkItemFactoryClass GtkItemFactoryClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkItemFactory GtkItemFactory;
+public alias org.eclipse.swt.internal.c.gtk.GtkActionClass GtkActionClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkAction GtkAction;
+public alias org.eclipse.swt.internal.c.gtk.GtkAccessibleClass GtkAccessibleClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkAccessible GtkAccessible;
+public alias org.eclipse.swt.internal.c.gtk.GtkAccelLabelClass GtkAccelLabelClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkAccelLabel GtkAccelLabel;
+public alias org.eclipse.swt.internal.c.gtk.GtkLabelClass GtkLabelClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkLabel GtkLabel;
+public alias org.eclipse.swt.internal.c.gtk.GtkMenuClass GtkMenuClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkMenu GtkMenu;
+public alias org.eclipse.swt.internal.c.gtk.GtkMenuShellClass GtkMenuShellClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkMenuShell GtkMenuShell;
+public alias org.eclipse.swt.internal.c.gtk.GtkMiscClass GtkMiscClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkMisc GtkMisc;
+public alias org.eclipse.swt.internal.c.gtk.GtkAboutDialogClass GtkAboutDialogClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkAboutDialog GtkAboutDialog;
+public alias org.eclipse.swt.internal.c.gtk.GtkDialogClass GtkDialogClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkDialog GtkDialog;
+public alias org.eclipse.swt.internal.c.gtk.GtkWindowGroupClass GtkWindowGroupClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkWindowGroup GtkWindowGroup;
+public alias org.eclipse.swt.internal.c.gtk.GtkWindowClass GtkWindowClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkBinClass GtkBinClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkBin GtkBin;
+public alias org.eclipse.swt.internal.c.gtk.GtkContainerClass GtkContainerClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkContainer GtkContainer;
+public alias org.eclipse.swt.internal.c.gtk.GtkWindow GtkWindow;
+public alias org.eclipse.swt.internal.c.gtk.GtkWidgetShapeInfo GtkWidgetShapeInfo;
+public alias org.eclipse.swt.internal.c.gtk.GtkWidgetAuxInfo GtkWidgetAuxInfo;
+public alias org.eclipse.swt.internal.c.gtk.GtkWidgetClass GtkWidgetClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkSelectionData GtkSelectionData;
+public alias org.eclipse.swt.internal.c.gtk.GtkRequisition GtkRequisition;
+public alias org.eclipse.swt.internal.c.gtk.GtkSettingsValue GtkSettingsValue;
+public alias org.eclipse.swt.internal.c.gtk.GtkSettingsClass GtkSettingsClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkRcStyleClass GtkRcStyleClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkIconFactory GtkIconFactory;
+public alias org.eclipse.swt.internal.c.gtk.GtkWidget GtkWidget;
+public alias org.eclipse.swt.internal.c.gtk.GtkSettings GtkSettings;
+public alias org.eclipse.swt.internal.c.gtk.GtkRcProperty GtkRcProperty;
+public alias org.eclipse.swt.internal.c.gtk.GtkRcStyle GtkRcStyle;
+public alias org.eclipse.swt.internal.c.gtk.GtkStyleClass GtkStyleClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkStyle GtkStyle;
+public alias org.eclipse.swt.internal.c.gtk.GtkBorder GtkBorder;
+public alias org.eclipse.swt.internal.c.gtk.GtkAdjustmentClass GtkAdjustmentClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkAdjustment GtkAdjustment;
+public alias org.eclipse.swt.internal.c.gtk.GtkObjectClass GtkObjectClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkTypeInfo GtkTypeInfo;
+public alias org.eclipse.swt.internal.c.gtk.GtkObject GtkObject;
+public alias org.eclipse.swt.internal.c.gtk.GtkArg GtkArg;
+public alias org.eclipse.swt.internal.c.gtk.GtkAccelGroupEntry GtkAccelGroupEntry;
+public alias org.eclipse.swt.internal.c.gtk.GtkAccelKey GtkAccelKey;
+public alias org.eclipse.swt.internal.c.gtk.GtkAccelGroupClass GtkAccelGroupClass;
+public alias org.eclipse.swt.internal.c.gtk.GtkAccelGroup GtkAccelGroup;
+public alias org.eclipse.swt.internal.c.gtk.GtkClipboard GtkClipboard;
+
+public alias org.eclipse.swt.internal.c.gtk.GtkTreeModel GtkTreeModel;
+public alias org.eclipse.swt.internal.c.gtk.GtkTreePath GtkTreePath;
+public alias org.eclipse.swt.internal.c.gtk.GtkEditable GtkEditable;
+public alias org.eclipse.swt.internal.c.gtk.GtkCallback GtkCallback;
+public alias org.eclipse.swt.internal.c.gtk.GtkAllocation GtkAllocation;
+public alias org.eclipse.swt.internal.c.gtk.GtkPageSetup GtkPageSetup;
+
+
+public alias org.eclipse.swt.internal.c.gtk_unix_print_2_0.GtkPrinter GtkPrinter;
+public alias org.eclipse.swt.internal.c.gtk_unix_print_2_0.GtkPrintUnixDialog GtkPrintUnixDialog;
+public alias org.eclipse.swt.internal.c.gtk_unix_print_2_0.GtkPrintJob GtkPrintJob;
+public alias org.eclipse.swt.internal.c.gtk_unix_print_2_0.GtkPrintSettings GtkPrintSettings;
+public alias org.eclipse.swt.internal.c.gtk_unix_print_2_0.GtkPaperSize GtkPaperSize;
+
+public alias org.eclipse.swt.internal.c.Xlib.XErrorEvent XErrorEvent;
+public alias org.eclipse.swt.internal.c.Xlib.XExposeEvent XExposeEvent;
+public alias org.eclipse.swt.internal.c.Xlib.XVisibilityEvent XVisibilityEvent;
+public alias org.eclipse.swt.internal.c.Xlib.XEvent XEvent;
+public alias org.eclipse.swt.internal.c.Xlib.XRectangle XRectangle;
+public alias org.eclipse.swt.internal.c.Xlib.XButtonEvent XButtonEvent;
+public alias org.eclipse.swt.internal.c.Xlib.XWindowChanges XWindowChanges;
+public alias org.eclipse.swt.internal.c.Xlib.XFocusChangeEvent XFocusChangeEvent;
+public alias org.eclipse.swt.internal.c.Xlib.XClientMessageEvent XClientMessageEvent;
+
+public alias org.eclipse.swt.internal.c.Xrender.XRenderPictureAttributes XRenderPictureAttributes;
+public alias org.eclipse.swt.internal.c.Xrender.XTransform XTransform;
+
+
+// function with variadic argument list
+private void gtk_widget_style_get1( GtkWidget* widget, char* firstPropertyName, int* res ){
+    gtk_widget_style_get( widget, firstPropertyName, res, null );
+}
+// function with variadic argument list
+private void g_object_get1( void* obj, char* firstPropertyName, int* res ){
+    g_object_get( obj, firstPropertyName, res, null );
+}
+
+private void g_object_set1( void* obj, char* firstPropertyName, int value ){
+    g_object_set( obj, firstPropertyName, value, null );
+}
+
+private void g_object_set1_float( void* obj, char* firstPropertyName, float value ){
+    g_object_set( obj, firstPropertyName, value, null );
+}
+
+private void g_signal_emit_by_name0( void* instance, char* detailed_signal ){
+    g_signal_emit_by_name( instance, detailed_signal );
+}
+
+private void g_signal_emit_by_name1( void* instance, char* detailed_signal, int value ){
+    g_signal_emit_by_name( instance, detailed_signal, value );
+}
+
+private void g_signal_emit_by_name2( void* instance, char* detailed_signal, int value1, int value2 ){
+    g_signal_emit_by_name( instance, detailed_signal, value1, value2 );
+}
+
+private void g_signal_emit_by_name3( void* instance, char* detailed_signal, int value1, int value2, int value3 ){
+    g_signal_emit_by_name( instance, detailed_signal, value1, value2, value3 );
+}
+
+private void gdk_pixbuf_save_to_buffer0(GdkPixbuf *pixbuf, char **buffer, uint *buffer_size,
+   char *type, GError **error ){
+    gdk_pixbuf_save_to_buffer( pixbuf, buffer, buffer_size, type, error );
+}
+
+private void gtk_list_store_set1(void* store , void* iter, int column, void* value ){
+    gtk_list_store_set( cast(GtkListStore *)store, cast(GtkTreeIter *)iter, column, value, -1 );
+}
+
+private void gtk_tree_model_get1(void* store , void* iter, int column, void** value ){
+    gtk_tree_model_get( cast(GtkTreeModel*) store, cast(GtkTreeIter *)iter, column, value, -1 );
+}
+
+private void gtk_tree_store_set1(void* tree_store, GtkTreeIter *iter, int column, void* value ){
+    gtk_tree_store_set( tree_store, iter, column, value, -1 );
+}
+private void gtk_cell_layout_set_attributes1( void *cell_layout, void* cell, void* key, void* value ){
+    gtk_cell_layout_set_attributes( cast(GtkCellLayout *)cell_layout, cast(GtkCellRenderer*)cell, key, value, null );
+}
+GtkWidget * gtk_file_chooser_dialog_new2(char * title, aGtkWindow * parent, int action, char * btn0_text, int btn0_id, char * btn1_text, int btn1_id ){
+    return gtk_file_chooser_dialog_new( title, parent, action, btn0_text, btn0_id, btn1_text, btn1_id, null );
+}
+// for linux always true, the other possibility would be GDK_WINDOWING_WIN32
+private bool GDK_WINDOWING_X11(){
+    return true;
+}
+
+private uint GDK_PIXMAP_XID(GdkDrawable* win){
+    return gdk_x11_drawable_get_xid(win);
+}
+
+// macro
+int g_signal_connect( void* instance, char* sig, GCallback handle, void* ptr ){
+    return g_signal_connect_data( instance, sig, handle, ptr, cast(GClosureNotify) 0, cast(GConnectFlags)0 );
+}
+// macro
+void gdk_cursor_destroy( GdkCursor* cursor ){
+    gdk_cursor_unref(cursor);
+}
+
+int g_thread_supported(){
+    return g_threads_got_initialized;
+}
+
+private char* localeconv_decimal_point(){
+    return localeconv().decimal_point;
+}
+
+// fontconfig.h
+struct FcConfig{};
+private extern(C) int FcConfigAppFontAddFile (FcConfig *config, char  *file);
+
+
+template NameOfFunc(alias f) {
+    // Note: highly dependent on the .stringof formatting
+    // the value begins with "& " which is why the first two chars are cut off
+
+    // this is also used in org.eclipse.swt/internal/cairo/Cairo and org.eclipse.swt/internal/accessible/gtk/ATK
+    version( LDC ){
+        // stringof in LDC is "&foobar"
+        static assert( (&f).stringof[0] == '&' );
+        static assert( (&f).stringof[1] != ' ' );
+        const char[] NameOfFunc = (&f).stringof[1 .. $];
+    }
+    else{
+        // stringof in DMD is "& foobar"
+        static assert( (&f).stringof[0] == '&' );
+        static assert( (&f).stringof[1] == ' ' );
+        const char[] NameOfFunc = (&f).stringof[2 .. $];
+    }
+}
+
+template ForwardGtkOsCFunc( alias cFunc ) {
+    alias ParameterTupleOf!(cFunc) P;
+    alias ReturnTypeOf!(cFunc) R;
+    mixin("public static R " ~ NameOfFunc!(cFunc) ~ "( P p ){
+        lock.lock();
+        scope(exit) lock.unlock();
+        return cFunc(p);
+    }");
+}
+/+
+// alternative template implementation, might be more stable
+template ForwardGtkOsCFunc(char[] name) {
+  alias typeof(mixin(name)) func;
+  alias ParameterTupleOf!(func) Params;
+  alias ReturnTypeOf!(func) Ret;
+  mixin("public static Ret "~name~"( Params p ) {
+    return ."~name~"(p);
+  }");
+}
++/
+//import org.eclipse.swt.internal.*;
+
+// for ctfe, save static ctor
+private int buildVERSION(int major, int minor, int micro) {
+    return (major << 16) + (minor << 8) + micro;
+}
+private int GTK_VERSION(){
+    version( GTK_DYN_LINK ) return buildVERSION(*gtk_major_version, *gtk_minor_version, *gtk_micro_version);
+    else                    return buildVERSION( gtk_major_version,  gtk_minor_version,  gtk_micro_version);
+}
+
+public class OS : Platform {
+
+    static this(){
+        org.eclipse.swt.internal.c.gtk.loadLib();
+        org.eclipse.swt.internal.c.pango.loadLib();
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 10, 0)){
+//            org.eclipse.swt.internal.c.gtk_unix_print_2_0.loadLib();
+        }
+    }
+
+
+
+    /** OS Constants */
+    public static const bool IsAIX   = false;
+    public static const bool IsSunOS = false;
+    public static const bool IsLinux = true;
+    public static const bool IsHPUX  = false;
+
+    /** Constants */
+    public static const int ATK_RELATION_LABELLED_BY = 4;
+    public static const int G_SIGNAL_MATCH_DATA = 1 << 4;
+    public static const int G_SIGNAL_MATCH_ID = 1 << 0;
+    public static const int GDK_2BUTTON_PRESS = 0x5;
+    public static const int GDK_3BUTTON_PRESS = 0x6;
+    public static const int GDK_ACTION_COPY = 1 << 1;
+    public static const int GDK_ACTION_MOVE = 1 << 2;
+    public static const int GDK_ACTION_LINK = 1 << 3;
+    public static const int GDK_Alt_L = 0xffe9;
+    public static const int GDK_Alt_R = 0xffea;
+    public static const int GDK_AND = 4;
+    public static const int GDK_BackSpace = 0xff08;
+    public static const int GDK_BOTTOM_LEFT_CORNER = 0xc;
+    public static const int GDK_BOTTOM_RIGHT_CORNER = 0xe;
+    public static const int GDK_BOTTOM_SIDE = 0x10;
+    public static const int GDK_BUTTON1_MASK = 0x100;
+    public static const int GDK_BUTTON2_MASK = 0x200;
+    public static const int GDK_BUTTON3_MASK = 0x400;
+    public static const int GDK_BUTTON_MOTION_MASK  = 1 << 4;
+    public static const int GDK_BUTTON1_MOTION_MASK = 1 << 5;
+    public static const int GDK_BUTTON2_MOTION_MASK = 1 << 6;
+    public static const int GDK_BUTTON3_MOTION_MASK = 1 << 7;
+    public static const int GDK_BUTTON_PRESS = 0x4;
+    public static const int GDK_BUTTON_PRESS_MASK = 0x100;
+    public static const int GDK_BUTTON_RELEASE = 0x7;
+    public static const int GDK_BUTTON_RELEASE_MASK = 0x200;
+    public static const int GDK_CAP_BUTT = 0x1;
+    public static const int GDK_CAP_PROJECTING = 3;
+    public static const int GDK_CAP_ROUND = 0x2;
+    public static const int GDK_COLORSPACE_RGB = 0;
+    public static const int GDK_CONFIGURE = 13;
+    public static const int GDK_CONTROL_MASK = 0x4;
+    public static const int GDK_COPY = 0x0;
+    public static const int GDK_CROSS = 0x1e;
+    public static const int GDK_CROSSING_NORMAL = 0;
+    public static const int GDK_CROSSING_GRAB = 1;
+    public static const int GDK_CROSSING_UNGRAB = 2;
+    public static const int GDK_Break = 0xff6b;
+    public static const int GDK_Cancel = 0xff69;
+    public static const int GDK_Caps_Lock = 0xffE5;
+    public static const int GDK_Clear = 0xff0B;
+    public static const int GDK_Control_L = 0xffe3;
+    public static const int GDK_Control_R = 0xffe4;
+    public static const int GDK_CURRENT_TIME = 0x0;
+    public static const int GDK_DECOR_BORDER = 0x2;
+    public static const int GDK_DECOR_MAXIMIZE = 0x40;
+    public static const int GDK_DECOR_MENU = 0x10;
+    public static const int GDK_DECOR_MINIMIZE = 0x20;
+    public static const int GDK_DECOR_RESIZEH = 0x4;
+    public static const int GDK_DECOR_TITLE = 0x8;
+    public static const int GDK_DOUBLE_ARROW = 0x2a;
+    public static const int GDK_Delete = 0xffff;
+    public static const int GDK_Down = 0xff54;
+    public static const int GDK_ENTER_NOTIFY_MASK = 0x1000;
+    public static const int GDK_ENTER_NOTIFY = 10;
+    public static const int GDK_EVEN_ODD_RULE = 0;
+    public static const int GTK_EXPANDER_COLAPSED = 0;
+    public static const int GTK_EXPANDER_SEMI_COLLAPSED = 1;
+    public static const int GTK_EXPANDER_SEMI_EXPANDED = 2;
+    public static const int GTK_EXPANDER_EXPANDED = 3;
+    public static const int GDK_EXPOSE = 2;
+    public static const int GDK_EXPOSURE_MASK = 0x2;
+    public static const int GDK_End = 0xff57;
+    public static const int GDK_Escape = 0xff1b;
+    public static const int GDK_F1 = 0xffbe;
+    public static const int GDK_F10 = 0xffc7;
+    public static const int GDK_F11 = 0xffc8;
+    public static const int GDK_F12 = 0xffc9;
+    public static const int GDK_F13 = 0xffca;
+    public static const int GDK_F14 = 0xffcb;
+    public static const int GDK_F15 = 0xffcc;
+    public static const int GDK_F2 = 0xffbf;
+    public static const int GDK_F3 = 0xffc0;
+    public static const int GDK_F4 = 0xffc1;
+    public static const int GDK_F5 = 0xffc2;
+    public static const int GDK_F6 = 0xffc3;
+    public static const int GDK_F7 = 0xffc4;
+    public static const int GDK_F8 = 0xffc5;
+    public static const int GDK_F9 = 0xffc6;
+    public static const int GDK_FLEUR = 0x34;
+    public static const int GDK_FOCUS_CHANGE = 0xc;
+    public static const int GDK_FOCUS_CHANGE_MASK = 0x4000;
+    public static const int GDK_GC_FOREGROUND = 0x1;
+    public static const int GDK_GC_CLIP_MASK = 0x80;
+    public static const int GDK_GC_CLIP_X_ORIGIN = 0x800;
+    public static const int GDK_GC_CLIP_Y_ORIGIN = 0x1000;
+    public static const int GDK_GC_LINE_WIDTH = 0x4000;
+    public static const int GDK_GC_LINE_STYLE = 0x8000;
+    public static const int GDK_GC_CAP_STYLE = 0x10000;
+    public static const int GDK_GC_JOIN_STYLE = 0x20000;
+    public static const int GDK_GRAB_SUCCESS = 0x0;
+    public static const int GDK_HAND2 = 0x3c;
+    public static const int GDK_Help = 0xFF6A;
+    public static const int GDK_HINT_MIN_SIZE = 1 << 1;
+    public static const int GDK_Home = 0xff50;
+    public static const int GDK_INCLUDE_INFERIORS = 0x1;
+    public static const int GDK_INPUT_ONLY = 1;
+    public static const int GDK_INTERP_BILINEAR = 0x2;
+    public static const int GDK_Insert = 0xff63;
+    public static const int GDK_ISO_Left_Tab = 0xfe20;
+    public static const int GDK_JOIN_MITER = 0x0;
+    public static const int GDK_JOIN_ROUND = 0x1;
+    public static const int GDK_JOIN_BEVEL = 0x2;
+    public static const int GDK_KEY_PRESS = 0x8;
+    public static const int GDK_KEY_PRESS_MASK = 0x400;
+    public static const int GDK_KEY_RELEASE = 0x9;
+    public static const int GDK_KEY_RELEASE_MASK = 0x800;
+    public static const int GDK_KP_0 = 0xffb0;
+    public static const int GDK_KP_1 = 0xffb1;
+    public static const int GDK_KP_2 = 0xffb2;
+    public static const int GDK_KP_3 = 0xffb3;
+    public static const int GDK_KP_4 = 0xffb4;
+    public static const int GDK_KP_5 = 0xffb5;
+    public static const int GDK_KP_6 = 0xffb6;
+    public static const int GDK_KP_7 = 0xffb7;
+    public static const int GDK_KP_8 = 0xffb8;
+    public static const int GDK_KP_9 = 0xffb9;
+    public static const int GDK_KP_Add = 0xffab;
+    public static const int GDK_KP_Decimal = 0xffae;
+    public static const int GDK_KP_Delete = 0xFF9F;
+    public static const int GDK_KP_Divide = 0xffaf;
+    public static const int GDK_KP_Down = 0xFF99;
+    public static const int GDK_KP_End = 0xFF9C;
+    public static const int GDK_KP_Enter = 0xff8d;
+    public static const int GDK_KP_Equal = 0xffbd;
+    public static const int GDK_KP_Home = 0xFF95;
+    public static const int GDK_KP_Insert = 0xFF9E;
+    public static const int GDK_KP_Left = 0xFF96;
+    public static const int GDK_KP_Multiply = 0xffaa;
+    public static const int GDK_KP_Page_Down = 0xFF9B;
+    public static const int GDK_KP_Page_Up = 0xFF9A;
+    public static const int GDK_KP_Right = 0xFF98;
+    public static const int GDK_KP_Subtract = 0xffad;
+    public static const int GDK_KP_Up = 0xFF97;
+    public static const int GDK_LEAVE_NOTIFY = 11;
+    public static const int GDK_LEAVE_NOTIFY_MASK = 0x2000;
+    public static const int GDK_LEFT_PTR = 0x44;
+    public static const int GDK_LEFT_SIDE = 0x46;
+    public static const int GDK_LINE_ON_OFF_DASH = 0x1;
+    public static const int GDK_LINE_SOLID = 0x0;
+    public static const int GDK_Linefeed = 0xff0A;
+    public static const int GDK_LSB_FIRST = 0x0;
+    public static const int GDK_Left = 0xff51;
+    public static const int GDK_Meta_L = 0xFFE7;
+    public static const int GDK_Meta_R = 0xFFE8;
+    public static const int GDK_MAP = 14;
+    public static const int GDK_MOD1_MASK = 0x8;
+    public static const int GDK_MOTION_NOTIFY = 0x3;
+    public static const int GDK_NO_EXPOSE = 30;
+    public static const int GDK_NONE = 0;
+    public static const int GDK_NOTIFY_INFERIOR = 2;
+    public static const int GDK_Num_Lock = 0xFF7F;
+    public static const int GDK_OVERLAP_RECTANGLE_OUT = 0x1;
+    public static const int GDK_PIXBUF_ALPHA_BILEVEL = 0x0;
+    public static const int GDK_POINTER_MOTION_HINT_MASK = 0x8;
+    public static const int GDK_POINTER_MOTION_MASK = 0x4;
+    public static const int GDK_PROPERTY_NOTIFY = 16;
+    public static const int GDK_Page_Down = 0xff56;
+    public static const int GDK_Page_Up = 0xff55;
+    public static const int GDK_Pause = 0xff13;
+    public static const int GDK_Print = 0xff61;
+    public static const int GDK_QUESTION_ARROW = 0x5c;
+    public static const int GDK_RGB_DITHER_NORMAL = 0x1;
+    public static const int GDK_RIGHT_SIDE = 0x60;
+    public static const int GDK_Return = 0xff0d;
+    public static const int GDK_Right = 0xff53;
+    public static const int GDK_space = 0x20;
+    public static const int GDK_SB_H_DOUBLE_ARROW = 0x6c;
+    public static const int GDK_SB_UP_ARROW = 0x72;
+    public static const int GDK_SB_V_DOUBLE_ARROW = 0x74;
+    public static const int GDK_SCROLL_UP = 0;
+    public static const int GDK_SCROLL_DOWN = 1;
+    public static const int GDK_SCROLL_LEFT = 2;
+    public static const int GDK_SCROLL_RIGHT = 3;
+    public static const int GDK_SELECTION_CLEAR = 17;
+    public static const int GDK_SELECTION_NOTIFY = 19;
+    public static const int GDK_SELECTION_REQUEST = 18;
+    public static const int GDK_SHIFT_MASK = 0x1;
+    public static const int GDK_SIZING = 0x78;
+    public static const int GDK_STIPPLED = 0x2;
+    public static const int GDK_TILED = 0x1;
+    public static const int GDK_Shift_L = 0xffe1;
+    public static const int GDK_Shift_R = 0xffe2;
+    public static const int GDK_SCROLL = 31;
+    public static const int GDK_Scroll_Lock = 0xff14;
+    public static const int GDK_TOP_LEFT_CORNER = 0x86;
+    public static const int GDK_TOP_RIGHT_CORNER = 0x88;
+    public static const int GDK_TOP_SIDE = 0x8a;
+    public static const int GDK_Tab = 0xff09;
+    public static const int GDK_Up = 0xff52;
+    public static const int GDK_WATCH = 0x96;
+    public static const int GDK_XOR = 0x2;
+    public static const int GDK_XTERM = 0x98;
+    public static const int GDK_X_CURSOR = 0x0;
+    public static const int GDK_VISIBILITY_FULLY_OBSCURED = 2;
+    public static const int GDK_VISIBILITY_NOTIFY_MASK = 1 << 17;
+    public static const int GDK_WINDOW_CHILD = 2;
+    public static const int GDK_WINDOW_STATE_ICONIFIED  = 1 << 1;
+    public static const int GDK_WINDOW_STATE_MAXIMIZED  = 1 << 2;
+    public static const int GDK_WINDOW_STATE_FULLSCREEN  = 1 << 4;
+    public static const int GTK_ACCEL_VISIBLE = 0x1;
+    public static const int GTK_ARROW_DOWN = 0x1;
+    public static const int GTK_ARROW_LEFT = 0x2;
+    public static const int GTK_ARROW_RIGHT = 0x3;
+    public static const int GTK_ARROW_UP = 0x0;
+    public static const int GTK_CALENDAR_SHOW_HEADING = 1 << 0;
+    public static const int GTK_CALENDAR_SHOW_DAY_NAMES = 1 << 1;
+    public static const int GTK_CALENDAR_NO_MONTH_CHANGE = 1 << 2;
+    public static const int GTK_CALENDAR_SHOW_WEEK_NUMBERS = 1 << 3;
+    public static const int GTK_CALENDAR_WEEK_START_MONDAY = 1 << 4;
+    public static const int GTK_CAN_DEFAULT = 0x2000;
+    public static const int GTK_CAN_FOCUS = 0x800;
+    public static const int GTK_CELL_RENDERER_MODE_ACTIVATABLE = 1;
+    public static const int GTK_CELL_RENDERER_SELECTED = 1 << 0;
+    public static const int GTK_CELL_RENDERER_FOCUSED = 1 << 4;
+    public static const int GTK_CLIST_SHOW_TITLES = 0x4;
+    public static const int GTK_CORNER_TOP_LEFT = 0x0;
+    public static const int GTK_CORNER_TOP_RIGHT = 0x2;
+    public static const int GTK_DIALOG_DESTROY_WITH_PARENT = 1 << 1;
+    public static const int GTK_DIALOG_MODAL = 1 << 0;
+    public static const int GTK_DIR_TAB_FORWARD = 0;
+    public static const int GTK_DIR_TAB_BACKWARD = 1;
+    public static const int GTK_FILE_CHOOSER_ACTION_OPEN = 0;
+    public static const int GTK_FILE_CHOOSER_ACTION_SAVE = 1;
+    public static const int GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER = 2;
+    public static const int GTK_HAS_FOCUS = 1 << 12;
+    public static const int GTK_ICON_SIZE_MENU = 1;
+    public static const int GTK_ICON_SIZE_SMALL_TOOLBAR = 2;
+    public static const int GTK_ICON_SIZE_LARGE_TOOLBAR = 3;
+    public static const int GTK_ICON_SIZE_DIALOG = 6;
+    public static const int GTK_JUSTIFY_CENTER = 0x2;
+    public static const int GTK_JUSTIFY_LEFT = 0x0;
+    public static const int GTK_JUSTIFY_RIGHT = 0x1;
+    public static const int GTK_MAPPED = 1 << 7;
+    public static const int GTK_MESSAGE_INFO = 0;
+    public static const int GTK_MESSAGE_WARNING = 1;
+    public static const int GTK_MESSAGE_QUESTION = 2;
+    public static const int GTK_MESSAGE_ERROR = 3;
+    public static const int GTK_NO_WINDOW = 1 << 5;
+    public static const int GTK_ORIENTATION_HORIZONTAL = 0x0;
+    public static const int GTK_ORIENTATION_VERTICAL = 0x1;
+    public static const int GTK_PACK_END = 1;
+    public static const int GTK_PACK_START = 0;
+    public static const int GTK_POLICY_ALWAYS = 0x0;
+    public static const int GTK_POLICY_AUTOMATIC = 0x1;
+    public static const int GTK_POLICY_NEVER = 0x2;
+    public static const int GTK_POS_TOP = 0x2;
+    public static const int GTK_POS_BOTTOM = 0x3;
+    public static const int GTK_PRINT_CAPABILITY_PAGE_SET     = 1 << 0;
+    public static const int GTK_PRINT_CAPABILITY_COPIES       = 1 << 1;
+    public static const int GTK_PRINT_CAPABILITY_COLLATE      = 1 << 2;
+    public static const int GTK_PRINT_CAPABILITY_REVERSE      = 1 << 3;
+    public static const int GTK_PRINT_CAPABILITY_SCALE        = 1 << 4;
+    public static const int GTK_PRINT_CAPABILITY_GENERATE_PDF = 1 << 5;
+    public static const int GTK_PRINT_CAPABILITY_GENERATE_PS  = 1 << 6;
+    public static const int GTK_PRINT_CAPABILITY_PREVIEW      = 1 << 7;
+    public static const int GTK_PRINT_PAGES_ALL = 0;
+    public static const int GTK_PRINT_PAGES_CURRENT = 1;
+    public static const int GTK_PRINT_PAGES_RANGES = 2;
+    public static const int GTK_PROGRESS_CONTINUOUS = 0x0;
+    public static const int GTK_PROGRESS_DISCRETE = 0x1;
+    public static const int GTK_PROGRESS_LEFT_TO_RIGHT = 0x0;
+    public static const int GTK_PROGRESS_BOTTOM_TO_TOP = 0x2;
+    public static const int GTK_REALIZED  = 1 << 6;
+    public static const int GTK_RECEIVES_DEFAULT = 1 << 20;
+    public static const int GTK_RELIEF_NONE = 0x2;
+    public static const int GTK_RELIEF_NORMAL = 0;
+    public static const int GTK_RC_BG = 1 << 1;
+    public static const int GTK_RC_FG = 1 << 0;
+    public static const int GTK_RC_TEXT = 1 << 2;
+    public static const int GTK_RC_BASE = 1 << 3;
+    public static const int GTK_RESPONSE_APPLY = 0xfffffff6;
+    public static const int GTK_RESPONSE_CANCEL = 0xfffffffa;
+    public static const int GTK_RESPONSE_OK = 0xfffffffb;
+    public static const int GTK_SCROLL_NONE = 0;
+    public static const int GTK_SCROLL_JUMP = 1;
+    public static const int GTK_SCROLL_STEP_BACKWARD = 2;
+    public static const int GTK_SCROLL_STEP_FORWARD = 3;
+    public static const int GTK_SCROLL_PAGE_BACKWARD = 4;
+    public static const int GTK_SCROLL_PAGE_FORWARD = 5;
+    public static const int GTK_SCROLL_STEP_UP = 6;
+    public static const int GTK_SCROLL_STEP_DOWN = 7;
+    public static const int GTK_SCROLL_PAGE_UP = 8;
+    public static const int GTK_SCROLL_PAGE_DOWN = 9;
+    public static const int GTK_SCROLL_STEP_LEFT = 10;
+    public static const int GTK_SCROLL_STEP_RIGHT = 11;
+    public static const int GTK_SCROLL_PAGE_LEFT = 12;
+    public static const int GTK_SCROLL_PAGE_RIGHT = 13;
+    public static const int GTK_SCROLL_START = 14;
+    public static const int GTK_SCROLL_END = 15;
+    public static const int GTK_SELECTION_BROWSE = 0x2;
+    public static const int GTK_SELECTION_MULTIPLE = 0x3;
+    public static const int GTK_SENSITIVE = 0x200;
+    public static const int GTK_SHADOW_ETCHED_IN = 0x3;
+    public static const int GTK_SHADOW_ETCHED_OUT = 0x4;
+    public static const int GTK_SHADOW_IN = 0x1;
+    public static const int GTK_SHADOW_NONE = 0x0;
+    public static const int GTK_SHADOW_OUT = 0x2;
+    public static const int GTK_STATE_ACTIVE = 0x1;
+    public static const int GTK_STATE_INSENSITIVE = 0x4;
+    public static const int GTK_STATE_NORMAL = 0x0;
+    public static const int GTK_STATE_PRELIGHT = 0x2;
+    public static const int GTK_STATE_SELECTED = 0x3;
+    public static const int GTK_TEXT_DIR_LTR = 1;
+    public static const int GTK_TEXT_DIR_NONE = 0 ;
+    public static const int GTK_TEXT_DIR_RTL = 2;
+    public static const int GTK_TEXT_WINDOW_TEXT = 2;
+    public static const int GTK_TOOLBAR_CHILD_BUTTON = 0x1;
+    public static const int GTK_TOOLBAR_CHILD_RADIOBUTTON = 0x3;
+    public static const int GTK_TOOLBAR_CHILD_TOGGLEBUTTON = 0x2;
+    public static const int GTK_TREE_VIEW_COLUMN_GROW_ONLY = 0;
+    public static const int GTK_TREE_VIEW_COLUMN_AUTOSIZE = 1;
+    public static const int GTK_TREE_VIEW_COLUMN_FIXED = 2;
+    public static const int GTK_TREE_VIEW_DROP_BEFORE = 0;
+    public static const int GTK_TREE_VIEW_DROP_AFTER = 1;
+    public static const int GTK_TREE_VIEW_DROP_INTO_OR_BEFORE = 2;
+    public static const int GTK_TREE_VIEW_DROP_INTO_OR_AFTER = 3;
+    public static const int GDK_UNMAP = 15;
+    public static const int GTK_UNIT_PIXEL = 0;
+    public static const int GTK_UNIT_POINTS = 1;
+    public static const int GTK_UNIT_INCH = 2;
+    public static const int GTK_UNIT_MM = 3;
+    public static const int GTK_VISIBILITY_FULL = 0x2;
+    public static const int GTK_VISIBILITY_NONE = 0x0;
+    public static const int GTK_VISIBLE = 0x100;
+    public static const int GDK_WA_X = 1 << 2;
+    public static const int GDK_WA_Y = 1 << 3;
+    public static const int GDK_WA_VISUAL = 1 << 6;
+    public static const int GTK_WINDOW_POPUP = 0x1;
+    public static const int GTK_WINDOW_TOPLEVEL = 0x0;
+    public static const int GDK_WINDOW_TYPE_HINT_DIALOG = 1;
+    public static const int GTK_WRAP_NONE = 0;
+    public static const int GTK_WRAP_WORD = 2;
+    public static const int GTK_WRAP_WORD_CHAR = 3;
+    public static const int G_LOG_FLAG_FATAL = 0x2;
+    public static const int G_LOG_FLAG_RECURSION = 0x1;
+    public static const int G_LOG_LEVEL_MASK = 0xfffffffc;
+    public static const int None = 0;
+    public static const int PANGO_ALIGN_LEFT = 0;
+    public static const int PANGO_ALIGN_CENTER = 1;
+    public static const int PANGO_ALIGN_RIGHT = 2;
+    public static const int PANGO_ATTR_FOREGROUND = 9;
+    public static const int PANGO_ATTR_BACKGROUND = 10;
+    public static const int PANGO_ATTR_UNDERLINE = 11;
+    public static final int PANGO_ATTR_UNDERLINE_COLOR = 18;
+    public static const int PANGO_DIRECTION_LTR = 0;
+    public static const int PANGO_DIRECTION_RTL = 1;
+    public static const int PANGO_SCALE = 1024;
+    public static const int PANGO_STRETCH_NORMAL = 0x4;
+    public static const int PANGO_STYLE_ITALIC = 0x2;
+    public static const int PANGO_STYLE_NORMAL = 0x0;
+    public static const int PANGO_STYLE_OBLIQUE = 0x1;
+    public static const int PANGO_TAB_LEFT = 0;
+    public static const int PANGO_UNDERLINE_NONE = 0;
+    public static const int PANGO_UNDERLINE_SINGLE = 1;
+    public static const int PANGO_UNDERLINE_DOUBLE = 2;
+    public static const int PANGO_UNDERLINE_LOW = 3;
+    public static const int PANGO_UNDERLINE_ERROR = 4;
+    public static const int PANGO_WEIGHT_BOLD = 0x2bc;
+    public static const int PANGO_WEIGHT_NORMAL = 0x190;
+    public static const int PANGO_WRAP_WORD = 0;
+    public static const int PANGO_WRAP_WORD_CHAR = 2;
+    public static const int RTLD_LAZY = 1;
+    public static const int XA_CARDINAL = 6;
+    public static const int XA_WINDOW = 33;
+
+    /** Signals */
+    public static const char[] activate = "activate";
+    public static const char[] button_press_event = "button-press-event";
+    public static const char[] button_release_event = "button-release-event";
+    public static const char[] changed = "changed";
+    public static const char[] change_current_page = "change-current-page";
+    public static const char[] change_value = "change-value";
+    public static const char[] clicked = "clicked";
+    public static const char[] commit = "commit";
+    public static const char[] configure_event = "configure-event";
+    public static const char[] delete_event = "delete-event";
+    public static const char[] day_selected = "day-selected";
+    public static const char[] delete_range = "delete-range";
+    public static const char[] delete_text = "delete-text";
+    public static const char[] drag_data_delete = "drag_data_delete";
+    public static const char[] drag_data_get = "drag_data_get";
+    public static const char[] drag_data_received = "drag_data_received";
+    public static const char[] drag_drop = "drag_drop";
+    public static const char[] drag_end = "drag_end";
+    public static const char[] drag_leave = "drag_leave";
+    public static const char[] drag_motion = "drag_motion";
+    public static const char[] enter_notify_event = "enter-notify-event";
+    public static const char[] event = "event";
+    public static const char[] event_after = "event-after";
+    public static const char[] expand_collapse_cursor_row = "expand-collapse-cursor-row";
+    public static const char[] expose_event = "expose-event";
+    public static const char[] focus = "focus";
+    public static const char[] focus_in_event = "focus-in-event";
+    public static const char[] focus_out_event = "focus-out-event";
+    public static const char[] grab_focus = "grab-focus";
+    public static const char[] hide = "hide";
+    public static const char[] input = "input";
+    public static const char[] insert_text = "insert-text";
+    public static const char[] key_press_event = "key-press-event";
+    public static const char[] key_release_event = "key-release-event";
+    public static const char[] leave_notify_event = "leave-notify-event";
+    public static const char[] map = "map";
+    public static const char[] map_event = "map-event";
+    public static const char[] mnemonic_activate = "mnemonic-activate";
+    public static const char[] month_changed = "month-changed";
+    public static const char[] motion_notify_event = "motion-notify-event";
+    public static const char[] move_focus = "move-focus";
+    public static const char[] output = "output";
+    public static const char[] popup_menu = "popup-menu";
+    public static final char[] populate_popup = "populate-popup";
+    public static const char[] preedit_changed = "preedit-changed";
+    public static const char[] realize = "realize";
+    public static const char[] row_activated = "row-activated";
+    public static const char[] row_changed = "row-changed";
+    public static const char[] scroll_child = "scroll-child";
+    public static const char[] scroll_event = "scroll-event";
+    public static const char[] select = "select";
+    public static const char[] show = "show";
+    public static const char[] show_help = "show-help";
+    public static const char[] size_allocate = "size-allocate";
+    public static const char[] size_request = "size-request";
+    public static const char[] style_set = "style-set";
+    public static const char[] switch_page = "switch-page";
+    public static const char[] test_collapse_row = "test-collapse-row";
+    public static const char[] test_expand_row = "test-expand-row";
+    public static const char[] toggled = "toggled";
+    public static const char[] unmap = "unmap";
+    public static const char[] unmap_event = "unmap-event";
+    public static const char[] unrealize = "unrealize";
+    public static const char[] value_changed = "value-changed";
+    public static const char[] visibility_notify_event = "visibility-notify-event";
+    public static const char[] window_state_event = "window-state-event";
+
+    /** Properties */
+    public static const char[] active = "active";
+    public static const char[] background_gdk = "background-gdk";
+    public static const char[] button_relief = "button-relief";
+    public static const char[] cell_background_gdk = "cell-background-gdk";
+    public static const char[] default_border = "default-border";
+    public static const char[] expander_size = "expander-size";
+    public static const char[] fixed_height_mode = "fixed-height-mode";
+    public static const char[] focus_line_width = "focus-line-width";
+    public static const char[] font_desc = "font-desc";
+    public static const char[] foreground_gdk = "foreground-gdk";
+    public static const char[] gtk_cursor_blink = "gtk-cursor-blink";
+    public static const char[] gtk_cursor_blink_time = "gtk-cursor-blink-time";
+    public static const char[] gtk_double_click_time = "gtk-double-click-time";
+    public static const char[] gtk_entry_select_on_focus = "gtk-entry-select-on-focus";
+    public static const char[] horizontal_separator = "horizontal-separator";
+    public static const char[] inconsistent = "inconsistent";
+    public static const char[] interior_focus = "interior-focus";
+    public static const char[] mode = "mode";
+    public static const char[] pixbuf = "pixbuf";
+    public static const char[] text = "text";
+    public static const char[] xalign = "xalign";
+    public static const char[] ypad = "ypad";
+    public static const char[] GTK_PRINT_SETTINGS_OUTPUT_URI = "output-uri";
+
+    public static int GTK_VERSION(){
+        return .GTK_VERSION();
+    }
+//     = buildVERSION(gtk_major_version(), gtk_minor_version(), gtk_micro_version());
+
+
+public static int buildVERSION(int major, int minor, int micro) {
+    return .buildVERSION( major, minor, micro );
+}
+
+/++
+public static final native int /*long*/ localeconv_decimal_point();
+public static final native int /*long*/ realpath(byte[] path, byte[] realPath);
+++/
+
+/** X11 Native methods and constants */
+public static const int Above = 0;
+public static const int Below = 1;
+public static const int ButtonRelease = 5;
+public static const int ClientMessage = 33;
+public static const int CurrentTime = 0;
+public static const int CWSibling = 0x20;
+public static const int CWStackMode = 0x40;
+public static const int EnterNotify = 7;
+public static const int Expose = 12;
+public static const int FocusChangeMask = 1 << 21;
+public static const int FocusIn = 9;
+public static const int FocusOut = 10;
+public static const int GraphicsExpose = 13;
+public static const int NoExpose = 14;
+public static const int ExposureMask = 1 << 15;
+public static const int /*long*/ NoEventMask = 0;
+public static const int NotifyNormal = 0;
+public static const int NotifyGrab = 1;
+public static const int NotifyHint = 1;
+public static const int NotifyUngrab = 2;
+public static const int NotifyWhileGrabbed = 3;
+public static const int NotifyAncestor = 0;
+public static const int NotifyVirtual = 1;
+public static const int NotifyNonlinear = 3;
+public static const int NotifyNonlinearVirtual = 4;
+public static const int NotifyPointer = 5;
+public static const int RevertToParent = 2;
+public static const int VisibilityChangeMask = 1 << 16;
+public static const int VisibilityFullyObscured = 2;
+public static const int VisibilityNotify = 15;
+public static const int SYSTEM_TRAY_REQUEST_DOCK = 0;
+
+/** X render natives and constants */
+public static const int PictStandardARGB32 = 0;
+public static const int PictStandardRGB24 = 1;
+public static const int PictStandardA8 = 2;
+public static const int PictStandardA4 = 3;
+public static const int PictStandardA1 = 4;
+public static const int PictOpSrc = 1;
+public static const int PictOpOver = 3;
+
+    public static int gtk_major_version(){
+        version(GTK_DYN_LINK) return *.gtk_minor_version;
+        else                  return .gtk_minor_version;
+    }
+    public static int gtk_minor_version(){
+        version(GTK_DYN_LINK) return *.gtk_minor_version;
+        else                  return .gtk_minor_version;
+    }
+    public static int gtk_micro_version(){
+        version(GTK_DYN_LINK) return *.gtk_micro_version;
+        else                  return .gtk_micro_version;
+    }
+    mixin ForwardGtkOsCFunc!(localeconv_decimal_point);
+    mixin ForwardGtkOsCFunc!(realpath);
+
+//    mixin ForwardGtkOsCFunc!(X_EVENT_TYPE);
+//    mixin ForwardGtkOsCFunc!(X_EVENT_WINDOW);
+//    mixin ForwardGtkOsCFunc!(.Call);
+//    mixin ForwardGtkOsCFunc!(.call );
+    mixin ForwardGtkOsCFunc!(.GDK_WINDOWING_X11);
+    mixin ForwardGtkOsCFunc!(.GDK_PIXMAP_XID);
+
+//     mixin ForwardGtkOsCFunc!(.XCheckMaskEvent);
+//     mixin ForwardGtkOsCFunc!(.XCheckWindowEvent);
+    mixin ForwardGtkOsCFunc!(.XCheckIfEvent);
+    mixin ForwardGtkOsCFunc!(.XDefaultScreen);
+    mixin ForwardGtkOsCFunc!(.XDefaultRootWindow);
+    mixin ForwardGtkOsCFunc!(.XFlush);
+    mixin ForwardGtkOsCFunc!(.XFree);
+    mixin ForwardGtkOsCFunc!(.XGetSelectionOwner);
+    mixin ForwardGtkOsCFunc!(.XInternAtom);
+    mixin ForwardGtkOsCFunc!(.XQueryPointer);
+    mixin ForwardGtkOsCFunc!(.XQueryTree);
+    mixin ForwardGtkOsCFunc!(.XKeysymToKeycode);
+    mixin ForwardGtkOsCFunc!(.XListProperties);
+    mixin ForwardGtkOsCFunc!(.XReconfigureWMWindow);
+    mixin ForwardGtkOsCFunc!(.XSendEvent);
+
+    mixin ForwardGtkOsCFunc!(.XSetIOErrorHandler);
+    mixin ForwardGtkOsCFunc!(.XSetErrorHandler);
+    mixin ForwardGtkOsCFunc!(.XSetInputFocus);
+    mixin ForwardGtkOsCFunc!(.XSetTransientForHint);
+    mixin ForwardGtkOsCFunc!(.XSynchronize);
+    mixin ForwardGtkOsCFunc!(.XTestFakeButtonEvent);
+    mixin ForwardGtkOsCFunc!(.XTestFakeKeyEvent);
+    mixin ForwardGtkOsCFunc!(.XTestFakeMotionEvent);
+    mixin ForwardGtkOsCFunc!(.XWarpPointer);
+
+    mixin ForwardGtkOsCFunc!(.gdk_x11_atom_to_xatom);
+    mixin ForwardGtkOsCFunc!(.gdk_x11_colormap_get_xcolormap);
+    mixin ForwardGtkOsCFunc!(.gdk_x11_drawable_get_xdisplay);
+    mixin ForwardGtkOsCFunc!(.gdk_x11_drawable_get_xid);
+    mixin ForwardGtkOsCFunc!(.gdk_x11_screen_lookup_visual);
+    mixin ForwardGtkOsCFunc!(.gdk_x11_screen_get_window_manager_name);
+    mixin ForwardGtkOsCFunc!(.gdk_x11_visual_get_xvisual);
+    mixin ForwardGtkOsCFunc!(.gdk_pixmap_foreign_new);
+    mixin ForwardGtkOsCFunc!(.gdk_window_lookup);
+    mixin ForwardGtkOsCFunc!(.gdk_window_add_filter);
+    mixin ForwardGtkOsCFunc!(.gdk_window_remove_filter);
+
+/** X render natives and constants */
+
+    mixin ForwardGtkOsCFunc!(.XRenderQueryExtension);
+    mixin ForwardGtkOsCFunc!(.XRenderQueryVersion);
+    mixin ForwardGtkOsCFunc!(.XRenderCreatePicture);
+    mixin ForwardGtkOsCFunc!(.XRenderSetPictureClipRectangles);
+    mixin ForwardGtkOsCFunc!(.XRenderSetPictureTransform);
+    mixin ForwardGtkOsCFunc!(.XRenderFreePicture);
+    mixin ForwardGtkOsCFunc!(.XRenderComposite);
+    mixin ForwardGtkOsCFunc!(.XRenderFindStandardFormat);
+    mixin ForwardGtkOsCFunc!(.XRenderFindVisualFormat);
+
+    mixin ForwardGtkOsCFunc!(.g_signal_add_emission_hook);
+    mixin ForwardGtkOsCFunc!(.g_signal_remove_emission_hook);
+    mixin ForwardGtkOsCFunc!(.g_cclosure_new);
+    mixin ForwardGtkOsCFunc!(.g_closure_ref);
+    mixin ForwardGtkOsCFunc!(.g_closure_unref);
+    mixin ForwardGtkOsCFunc!(.g_main_context_acquire);
+    mixin ForwardGtkOsCFunc!(.g_main_context_check);
+    mixin ForwardGtkOsCFunc!(.g_main_context_default);
+    mixin ForwardGtkOsCFunc!(.g_main_context_iteration);
+    mixin ForwardGtkOsCFunc!(.g_main_context_pending);
+    mixin ForwardGtkOsCFunc!(.g_main_context_get_poll_func);
+    mixin ForwardGtkOsCFunc!(.g_main_context_prepare);
+    mixin ForwardGtkOsCFunc!(.g_main_context_query);
+    mixin ForwardGtkOsCFunc!(.g_main_context_release);
+
+    // no lock for g_main_context_wakeup
+    alias .g_main_context_wakeup g_main_context_wakeup;
+
+    mixin ForwardGtkOsCFunc!(.g_filename_to_utf8);
+    mixin ForwardGtkOsCFunc!(.g_filename_to_uri);
+    mixin ForwardGtkOsCFunc!(.g_filename_from_utf8);
+    mixin ForwardGtkOsCFunc!(.g_filename_from_uri);
+    mixin ForwardGtkOsCFunc!(.g_free);
+    mixin ForwardGtkOsCFunc!(.g_idle_add);
+    mixin ForwardGtkOsCFunc!(.g_list_append);
+    mixin ForwardGtkOsCFunc!(.g_list_free);
+    mixin ForwardGtkOsCFunc!(.g_list_free_1);
+    mixin ForwardGtkOsCFunc!(.g_list_length);
+    mixin ForwardGtkOsCFunc!(.g_list_nth);
+    mixin ForwardGtkOsCFunc!(.g_list_nth_data);
+    mixin ForwardGtkOsCFunc!(.g_list_prepend);
+    mixin ForwardGtkOsCFunc!(.g_list_remove_link);
+    mixin ForwardGtkOsCFunc!(.g_list_reverse);
+    mixin ForwardGtkOsCFunc!(.g_locale_from_utf8);
+    mixin ForwardGtkOsCFunc!(.g_locale_to_utf8);
+    mixin ForwardGtkOsCFunc!(.g_log_default_handler);
+    mixin ForwardGtkOsCFunc!(.g_log_remove_handler);
+    mixin ForwardGtkOsCFunc!(.g_log_set_handler);
+    mixin ForwardGtkOsCFunc!(.g_malloc);
+    mixin ForwardGtkOsCFunc!(.g_object_get1);
+    mixin ForwardGtkOsCFunc!(.g_object_get_qdata);
+    mixin ForwardGtkOsCFunc!(.g_object_new);
+    mixin ForwardGtkOsCFunc!(.g_object_ref);
+    mixin ForwardGtkOsCFunc!(.g_object_set1);
+    mixin ForwardGtkOsCFunc!(.g_object_set1_float);
+    mixin ForwardGtkOsCFunc!(.g_object_set_qdata);
+    mixin ForwardGtkOsCFunc!(.g_object_unref);
+    mixin ForwardGtkOsCFunc!(.g_object_get_data);
+    mixin ForwardGtkOsCFunc!(.g_object_set_data);
+    mixin ForwardGtkOsCFunc!(.g_quark_from_string);
+    mixin ForwardGtkOsCFunc!(.g_set_prgname);
+    mixin ForwardGtkOsCFunc!(.g_signal_connect_closure);
+    mixin ForwardGtkOsCFunc!(.g_signal_connect_closure_by_id);
+    mixin ForwardGtkOsCFunc!(.g_signal_emit_by_name0);
+    mixin ForwardGtkOsCFunc!(.g_signal_emit_by_name1);
+    mixin ForwardGtkOsCFunc!(.g_signal_emit_by_name2);
+    mixin ForwardGtkOsCFunc!(.g_signal_emit_by_name3);
+    mixin ForwardGtkOsCFunc!(.g_signal_handler_disconnect);
+    mixin ForwardGtkOsCFunc!(.g_signal_handlers_block_matched);
+    mixin ForwardGtkOsCFunc!(.g_signal_handlers_disconnect_matched);
+    mixin ForwardGtkOsCFunc!(.g_signal_handlers_unblock_matched);
+    mixin ForwardGtkOsCFunc!(.g_signal_lookup );
+    mixin ForwardGtkOsCFunc!(.g_signal_stop_emission_by_name);
+    mixin ForwardGtkOsCFunc!(.g_source_remove );
+    mixin ForwardGtkOsCFunc!(.g_slist_free );
+    mixin ForwardGtkOsCFunc!(.g_slist_length );
+    mixin ForwardGtkOsCFunc!(.g_strfreev);
+    mixin ForwardGtkOsCFunc!(.g_strtod);
+    mixin ForwardGtkOsCFunc!(.g_type_add_interface_static );
+    mixin ForwardGtkOsCFunc!(.g_type_class_peek );
+    mixin ForwardGtkOsCFunc!(.g_type_class_peek_parent );
+    mixin ForwardGtkOsCFunc!(.g_type_from_name );
+    mixin ForwardGtkOsCFunc!(.g_type_interface_peek_parent );
+    mixin ForwardGtkOsCFunc!(.g_type_is_a );
+    mixin ForwardGtkOsCFunc!(.g_type_name );
+    mixin ForwardGtkOsCFunc!(.g_type_parent );
+    mixin ForwardGtkOsCFunc!(.g_type_query );
+    mixin ForwardGtkOsCFunc!(.g_type_register_static );
+    mixin ForwardGtkOsCFunc!(.g_thread_init);
+    mixin ForwardGtkOsCFunc!(.g_thread_supported);
+    mixin ForwardGtkOsCFunc!(.g_utf16_to_utf8);
+    mixin ForwardGtkOsCFunc!(.g_utf8_offset_to_pointer);
+    mixin ForwardGtkOsCFunc!(.g_utf8_pointer_to_offset);
+    mixin ForwardGtkOsCFunc!(.g_utf8_strlen);
+    mixin ForwardGtkOsCFunc!(.g_utf8_to_utf16);
+    mixin ForwardGtkOsCFunc!(.g_value_peek_pointer);
+    mixin ForwardGtkOsCFunc!(.gdk_atom_intern);
+    mixin ForwardGtkOsCFunc!(.gdk_atom_name);
+    mixin ForwardGtkOsCFunc!(.gdk_beep);
+    mixin ForwardGtkOsCFunc!(.gdk_bitmap_create_from_data);
+    mixin ForwardGtkOsCFunc!(.gdk_cairo_region);
+    mixin ForwardGtkOsCFunc!(.gdk_cairo_set_source_color);
+    mixin ForwardGtkOsCFunc!(.gdk_color_white);
+    mixin ForwardGtkOsCFunc!(.gdk_colormap_alloc_color);
+    mixin ForwardGtkOsCFunc!(.gdk_colormap_free_colors);
+    mixin ForwardGtkOsCFunc!(.gdk_colormap_get_system);
+    mixin ForwardGtkOsCFunc!(.gdk_colormap_query_color);
+    mixin ForwardGtkOsCFunc!(.gdk_cursor_destroy); // is alias for gdk_cursor_unref
+    mixin ForwardGtkOsCFunc!(.gdk_cursor_new);
+    mixin ForwardGtkOsCFunc!(.gdk_cursor_new_from_pixmap);
+    mixin ForwardGtkOsCFunc!(.gdk_cursor_new_from_pixbuf);
+    mixin ForwardGtkOsCFunc!(.gdk_display_get_default);
+    mixin ForwardGtkOsCFunc!(.gdk_display_supports_cursor_color);
+    mixin ForwardGtkOsCFunc!(.gdk_drag_status);
+    mixin ForwardGtkOsCFunc!(.gdk_draw_arc);
+    mixin ForwardGtkOsCFunc!(.gdk_draw_drawable);
+    mixin ForwardGtkOsCFunc!(.gdk_draw_image);
+    mixin ForwardGtkOsCFunc!(.gdk_draw_layout);
+    mixin ForwardGtkOsCFunc!(.gdk_draw_layout_with_colors);
+    mixin ForwardGtkOsCFunc!(.gdk_draw_line);
+    mixin ForwardGtkOsCFunc!(.gdk_draw_lines);
+    mixin ForwardGtkOsCFunc!(.gdk_draw_pixbuf);
+    mixin ForwardGtkOsCFunc!(.gdk_draw_point);
+    mixin ForwardGtkOsCFunc!(.gdk_draw_polygon);
+    mixin ForwardGtkOsCFunc!(.gdk_draw_rectangle);
+    mixin ForwardGtkOsCFunc!(.gdk_drawable_get_depth);
+    mixin ForwardGtkOsCFunc!(.gdk_drawable_get_image);
+    mixin ForwardGtkOsCFunc!(.gdk_drawable_get_size);
+    mixin ForwardGtkOsCFunc!(.gdk_drawable_get_visible_region);
+    mixin ForwardGtkOsCFunc!(.gdk_event_copy);
+    mixin ForwardGtkOsCFunc!(.gdk_event_free);
+    mixin ForwardGtkOsCFunc!(.gdk_event_get);
+    mixin ForwardGtkOsCFunc!(.gdk_event_get_root_coords);
+    mixin ForwardGtkOsCFunc!(.gdk_event_get_coords);
+    mixin ForwardGtkOsCFunc!(.gdk_event_get_graphics_expose);
+    mixin ForwardGtkOsCFunc!(.gdk_event_get_state);
+    mixin ForwardGtkOsCFunc!(.gdk_event_get_time);
+    mixin ForwardGtkOsCFunc!(.gdk_event_handler_set);
+    mixin ForwardGtkOsCFunc!(.gdk_event_new);
+    mixin ForwardGtkOsCFunc!(.gdk_event_peek);
+    mixin ForwardGtkOsCFunc!(.gdk_event_put);
+    mixin ForwardGtkOsCFunc!(.gdk_error_trap_push);
+    mixin ForwardGtkOsCFunc!(.gdk_error_trap_pop);
+    mixin ForwardGtkOsCFunc!(.gdk_flush);
+//    mixin ForwardGtkOsCFunc!(.gdk_free_text_list);
+    mixin ForwardGtkOsCFunc!(.gdk_gc_get_values);
+    mixin ForwardGtkOsCFunc!(.gdk_gc_new);
+    mixin ForwardGtkOsCFunc!(.gdk_gc_set_background);
+    mixin ForwardGtkOsCFunc!(.gdk_gc_set_clip_mask);
+    mixin ForwardGtkOsCFunc!(.gdk_gc_set_clip_origin);
+    mixin ForwardGtkOsCFunc!(.gdk_gc_set_clip_rectangle);
+    mixin ForwardGtkOsCFunc!(.gdk_gc_set_clip_region);
+    mixin ForwardGtkOsCFunc!(.gdk_gc_set_dashes);
+    mixin ForwardGtkOsCFunc!(.gdk_gc_set_exposures);
+    mixin ForwardGtkOsCFunc!(.gdk_gc_set_fill);
+    mixin ForwardGtkOsCFunc!(.gdk_gc_set_foreground);
+    mixin ForwardGtkOsCFunc!(.gdk_gc_set_function);
+    mixin ForwardGtkOsCFunc!(.gdk_gc_set_line_attributes);
+    mixin ForwardGtkOsCFunc!(.gdk_gc_set_stipple);
+    mixin ForwardGtkOsCFunc!(.gdk_gc_set_subwindow);
+    mixin ForwardGtkOsCFunc!(.gdk_gc_set_tile);
+    mixin ForwardGtkOsCFunc!(.gdk_gc_set_ts_origin);
+    mixin ForwardGtkOsCFunc!(.gdk_gc_set_values);
+    mixin ForwardGtkOsCFunc!(.gdk_keyboard_ungrab);
+    mixin ForwardGtkOsCFunc!(.gdk_keymap_get_default);
+    mixin ForwardGtkOsCFunc!(.gdk_keymap_translate_keyboard_state );
+    mixin ForwardGtkOsCFunc!(.gdk_keyval_to_lower);
+    mixin ForwardGtkOsCFunc!(.gdk_keyval_to_unicode);
+    mixin ForwardGtkOsCFunc!(.gdk_pango_context_get);
+    mixin ForwardGtkOsCFunc!(.gdk_pango_context_set_colormap);
+    mixin ForwardGtkOsCFunc!(.gdk_pango_layout_get_clip_region);
+    mixin ForwardGtkOsCFunc!(.gdk_pixbuf_copy_area);
+    mixin ForwardGtkOsCFunc!(.gdk_pixbuf_get_from_drawable);
+    mixin ForwardGtkOsCFunc!(.gdk_pixbuf_get_has_alpha);
+    mixin ForwardGtkOsCFunc!(.gdk_pixbuf_get_height);
+    mixin ForwardGtkOsCFunc!(.gdk_pixbuf_get_pixels);
+    mixin ForwardGtkOsCFunc!(.gdk_pixbuf_get_rowstride);
+    mixin ForwardGtkOsCFunc!(.gdk_pixbuf_get_width);
+    mixin ForwardGtkOsCFunc!(.gdk_pixbuf_loader_new);
+    mixin ForwardGtkOsCFunc!(.gdk_pixbuf_loader_close);
+    mixin ForwardGtkOsCFunc!(.gdk_pixbuf_loader_get_pixbuf);
+    mixin ForwardGtkOsCFunc!(.gdk_pixbuf_loader_write);
+    mixin ForwardGtkOsCFunc!(.gdk_pixbuf_new);
+    mixin ForwardGtkOsCFunc!(.gdk_pixbuf_new_from_file);
+    mixin ForwardGtkOsCFunc!(.gdk_pixbuf_render_to_drawable);
+    mixin ForwardGtkOsCFunc!(.gdk_pixbuf_render_to_drawable_alpha);
+    mixin ForwardGtkOsCFunc!(.gdk_pixbuf_render_pixmap_and_mask);
+    mixin ForwardGtkOsCFunc!(.gdk_pixbuf_save_to_buffer0);
+    mixin ForwardGtkOsCFunc!(.gdk_pixbuf_scale);
+    mixin ForwardGtkOsCFunc!(.gdk_pixbuf_scale_simple);
+    mixin ForwardGtkOsCFunc!(.gdk_pixmap_new);
+    mixin ForwardGtkOsCFunc!(.gdk_pointer_grab);
+    mixin ForwardGtkOsCFunc!(.gdk_pointer_is_grabbed);
+    mixin ForwardGtkOsCFunc!(.gdk_pointer_ungrab);
+    mixin ForwardGtkOsCFunc!(.gdk_property_get);
+    mixin ForwardGtkOsCFunc!(.gdk_region_destroy);
+    mixin ForwardGtkOsCFunc!(.gdk_region_empty);
+    mixin ForwardGtkOsCFunc!(.gdk_region_get_clipbox);
+    mixin ForwardGtkOsCFunc!(.gdk_region_get_rectangles);
+    mixin ForwardGtkOsCFunc!(.gdk_region_intersect);
+    mixin ForwardGtkOsCFunc!(.gdk_region_new);
+    mixin ForwardGtkOsCFunc!(.gdk_region_offset);
+    mixin ForwardGtkOsCFunc!(.gdk_region_point_in);
+    mixin ForwardGtkOsCFunc!(.gdk_region_polygon);
+    mixin ForwardGtkOsCFunc!(.gdk_region_rectangle);
+    mixin ForwardGtkOsCFunc!(.gdk_region_rect_in);
+    mixin ForwardGtkOsCFunc!(.gdk_region_subtract);
+    mixin ForwardGtkOsCFunc!(.gdk_region_union);
+    mixin ForwardGtkOsCFunc!(.gdk_region_union_with_rect);
+    mixin ForwardGtkOsCFunc!(.gdk_rgb_init);
+    mixin ForwardGtkOsCFunc!(.gdk_screen_get_default);
+    mixin ForwardGtkOsCFunc!(.gdk_screen_get_monitor_at_point );
+    mixin ForwardGtkOsCFunc!(.gdk_screen_get_monitor_at_window);
+    mixin ForwardGtkOsCFunc!(.gdk_screen_get_monitor_geometry );
+    mixin ForwardGtkOsCFunc!(.gdk_screen_get_n_monitors);
+    mixin ForwardGtkOsCFunc!(.gdk_screen_get_number);
+    mixin ForwardGtkOsCFunc!(.gdk_screen_height);
+    mixin ForwardGtkOsCFunc!(.gdk_screen_width);
+    mixin ForwardGtkOsCFunc!(.gdk_screen_width_mm);
+    mixin ForwardGtkOsCFunc!(.gdk_set_program_class);
+    mixin ForwardGtkOsCFunc!(.gdk_utf8_to_compound_text);
+    mixin ForwardGtkOsCFunc!(.gdk_utf8_to_string_target);
+    mixin ForwardGtkOsCFunc!(.gdk_text_property_to_utf8_list);
+    mixin ForwardGtkOsCFunc!(.gtk_tooltip_trigger_tooltip_query);
+    mixin ForwardGtkOsCFunc!(.gdk_unicode_to_keyval);
+    mixin ForwardGtkOsCFunc!(.gdk_visual_get_system);
+    mixin ForwardGtkOsCFunc!(.gdk_window_at_pointer);
+    mixin ForwardGtkOsCFunc!(.gdk_window_begin_paint_rect);
+    mixin ForwardGtkOsCFunc!(.gdk_window_clear_area);
+    mixin ForwardGtkOsCFunc!(.gdk_window_destroy);
+    mixin ForwardGtkOsCFunc!(.gdk_window_end_paint);
+    mixin ForwardGtkOsCFunc!(.gdk_window_get_children);
+    mixin ForwardGtkOsCFunc!(.gdk_window_get_events);
+    mixin ForwardGtkOsCFunc!(.gdk_window_focus);
+    mixin ForwardGtkOsCFunc!(.gdk_window_freeze_updates);
+    mixin ForwardGtkOsCFunc!(.gdk_window_get_frame_extents);
+    mixin ForwardGtkOsCFunc!(.gdk_window_get_internal_paint_info);
+    mixin ForwardGtkOsCFunc!(.gdk_window_get_origin);
+    mixin ForwardGtkOsCFunc!(.gdk_window_get_parent);
+    mixin ForwardGtkOsCFunc!(.gdk_window_get_pointer);
+    mixin ForwardGtkOsCFunc!(.gdk_window_get_position);
+    mixin ForwardGtkOsCFunc!(.gdk_window_get_user_data);
+    mixin ForwardGtkOsCFunc!(.gdk_window_hide);
+    mixin ForwardGtkOsCFunc!(.gdk_window_invalidate_rect);
+    mixin ForwardGtkOsCFunc!(.gdk_window_invalidate_region);
+    mixin ForwardGtkOsCFunc!(.gdk_window_is_visible);
+    mixin ForwardGtkOsCFunc!(.gdk_window_move);
+    mixin ForwardGtkOsCFunc!(.gdk_window_new);
+    mixin ForwardGtkOsCFunc!(.gdk_window_lower);
+    mixin ForwardGtkOsCFunc!(.gdk_window_process_all_updates);
+    mixin ForwardGtkOsCFunc!(.gdk_window_process_updates);
+    mixin ForwardGtkOsCFunc!(.gdk_window_raise);
+    mixin ForwardGtkOsCFunc!(.gdk_window_resize);
+    mixin ForwardGtkOsCFunc!(.gdk_window_scroll);
+    mixin ForwardGtkOsCFunc!(.gdk_window_set_accept_focus);
+    mixin ForwardGtkOsCFunc!(.gdk_window_set_back_pixmap);
+    mixin ForwardGtkOsCFunc!(.gdk_window_set_cursor);
+    mixin ForwardGtkOsCFunc!(.gdk_window_set_debug_updates);
+    mixin ForwardGtkOsCFunc!(.gdk_window_set_decorations);
+    mixin ForwardGtkOsCFunc!(.gdk_window_set_events);
+    mixin ForwardGtkOsCFunc!(.gdk_window_set_icon);
+    mixin ForwardGtkOsCFunc!(.gdk_window_set_icon_list);
+    mixin ForwardGtkOsCFunc!(.gdk_window_set_keep_above);
+    mixin ForwardGtkOsCFunc!(.gdk_window_set_override_redirect);
+    mixin ForwardGtkOsCFunc!(.gdk_window_set_user_data);
+    mixin ForwardGtkOsCFunc!(.gdk_window_shape_combine_region );
+    mixin ForwardGtkOsCFunc!(.gdk_window_show);
+    mixin ForwardGtkOsCFunc!(.gdk_window_show_unraised);
+    mixin ForwardGtkOsCFunc!(.gdk_window_thaw_updates);
+    mixin ForwardGtkOsCFunc!(.gtk_accel_group_new);
+    mixin ForwardGtkOsCFunc!(.gtk_accel_groups_activate);
+    mixin ForwardGtkOsCFunc!(.gtk_accel_label_set_accel_widget);
+    mixin ForwardGtkOsCFunc!(.gtk_adjustment_changed);
+    mixin ForwardGtkOsCFunc!(.gtk_adjustment_new);
+    mixin ForwardGtkOsCFunc!(.gtk_adjustment_set_value);
+    mixin ForwardGtkOsCFunc!(.gtk_adjustment_value_changed);
+    mixin ForwardGtkOsCFunc!(.gtk_arrow_new);
+    mixin ForwardGtkOsCFunc!(.gtk_arrow_set);
+    mixin ForwardGtkOsCFunc!(.gtk_bin_get_child);
+    mixin ForwardGtkOsCFunc!(.gtk_box_set_spacing);
+    mixin ForwardGtkOsCFunc!(.gtk_box_set_child_packing);
+    mixin ForwardGtkOsCFunc!(.gtk_button_clicked);
+    mixin ForwardGtkOsCFunc!(.gtk_button_get_relief);
+    mixin ForwardGtkOsCFunc!(.gtk_button_new);
+    mixin ForwardGtkOsCFunc!(.gtk_button_set_relief);
+    mixin ForwardGtkOsCFunc!(.gtk_calendar_new);
+    mixin ForwardGtkOsCFunc!(.gtk_calendar_select_month);
+    mixin ForwardGtkOsCFunc!(.gtk_calendar_select_day);
+    mixin ForwardGtkOsCFunc!(.gtk_calendar_set_display_options);
+    mixin ForwardGtkOsCFunc!(.gtk_calendar_display_options);
+    mixin ForwardGtkOsCFunc!(.gtk_calendar_get_date);
+    mixin ForwardGtkOsCFunc!(.gtk_cell_layout_clear);
+    mixin ForwardGtkOsCFunc!(.gtk_cell_layout_set_attributes1);
+    mixin ForwardGtkOsCFunc!(.gtk_cell_layout_pack_start);
+    mixin ForwardGtkOsCFunc!(.gtk_cell_renderer_get_size);
+    mixin ForwardGtkOsCFunc!(.gtk_cell_renderer_pixbuf_new);
+    mixin ForwardGtkOsCFunc!(.gtk_cell_renderer_text_new);
+    mixin ForwardGtkOsCFunc!(.gtk_cell_renderer_toggle_new);
+    mixin ForwardGtkOsCFunc!(.gtk_check_button_new);
+    mixin ForwardGtkOsCFunc!(.gtk_check_menu_item_get_active);
+    mixin ForwardGtkOsCFunc!(.gtk_check_menu_item_new_with_label);
+    mixin ForwardGtkOsCFunc!(.gtk_check_menu_item_set_active);
+    mixin ForwardGtkOsCFunc!(.gtk_check_version);
+    mixin ForwardGtkOsCFunc!(.gtk_clipboard_clear);
+    mixin ForwardGtkOsCFunc!(.gtk_clipboard_get);
+    mixin ForwardGtkOsCFunc!(.gtk_clipboard_set_with_data);
+    mixin ForwardGtkOsCFunc!(.gtk_clipboard_wait_for_contents);
+    mixin ForwardGtkOsCFunc!(.gtk_color_selection_dialog_new);
+    mixin ForwardGtkOsCFunc!(.gtk_color_selection_get_current_color);
+    mixin ForwardGtkOsCFunc!(.gtk_color_selection_set_current_color);
+    mixin ForwardGtkOsCFunc!(.gtk_color_selection_set_has_palette);
+    mixin ForwardGtkOsCFunc!(.gtk_combo_disable_activate);
+    mixin ForwardGtkOsCFunc!(.gtk_combo_new);
+    mixin ForwardGtkOsCFunc!(.gtk_combo_set_case_sensitive);
+    mixin ForwardGtkOsCFunc!(.gtk_combo_box_set_focus_on_click);
+    mixin ForwardGtkOsCFunc!(.gtk_combo_set_popdown_strings);
+    mixin ForwardGtkOsCFunc!(.gtk_combo_box_entry_new_text);
+    mixin ForwardGtkOsCFunc!(.gtk_combo_box_new_text);
+    mixin ForwardGtkOsCFunc!(.gtk_combo_box_insert_text);
+    mixin ForwardGtkOsCFunc!(.gtk_combo_box_remove_text);
+    mixin ForwardGtkOsCFunc!(.gtk_combo_box_get_active);
+    mixin ForwardGtkOsCFunc!(.gtk_combo_box_get_model);
+    mixin ForwardGtkOsCFunc!(.gtk_combo_box_set_active);
+    mixin ForwardGtkOsCFunc!(.gtk_combo_box_popup);
+    mixin ForwardGtkOsCFunc!(.gtk_combo_box_popdown);
+    mixin ForwardGtkOsCFunc!(.gtk_container_add);
+    mixin ForwardGtkOsCFunc!(.gtk_container_forall);
+    mixin ForwardGtkOsCFunc!(.gtk_container_get_border_width);
+    mixin ForwardGtkOsCFunc!(.gtk_container_get_children);
+    mixin ForwardGtkOsCFunc!(.gtk_container_remove);
+    mixin ForwardGtkOsCFunc!(.gtk_container_resize_children);
+    mixin ForwardGtkOsCFunc!(.gtk_container_set_border_width);
+    mixin ForwardGtkOsCFunc!(.gtk_dialog_add_button);
+    mixin ForwardGtkOsCFunc!(.gtk_dialog_run);
+    mixin ForwardGtkOsCFunc!(.gtk_drag_begin);
+    mixin ForwardGtkOsCFunc!(.gtk_drag_check_threshold);
+    mixin ForwardGtkOsCFunc!(.gtk_drag_dest_find_target);
+    mixin ForwardGtkOsCFunc!(.gtk_drag_dest_set);
+    mixin ForwardGtkOsCFunc!(.gtk_drag_dest_unset);
+    mixin ForwardGtkOsCFunc!(.gtk_drag_finish);
+    mixin ForwardGtkOsCFunc!(.gtk_drag_get_data);
+    mixin ForwardGtkOsCFunc!(.gtk_drag_set_icon_pixbuf);
+    mixin ForwardGtkOsCFunc!(.gtk_drawing_area_new);
+    mixin ForwardGtkOsCFunc!(.gtk_editable_copy_clipboard);
+    mixin ForwardGtkOsCFunc!(.gtk_editable_cut_clipboard);
+    mixin ForwardGtkOsCFunc!(.gtk_editable_delete_selection);
+    mixin ForwardGtkOsCFunc!(.gtk_editable_delete_text);
+    mixin ForwardGtkOsCFunc!(.gtk_editable_get_chars);
+    mixin ForwardGtkOsCFunc!(.gtk_editable_get_editable);
+    mixin ForwardGtkOsCFunc!(.gtk_editable_get_position);
+    mixin ForwardGtkOsCFunc!(.gtk_editable_get_selection_bounds);
+    mixin ForwardGtkOsCFunc!(.gtk_editable_insert_text);
+    mixin ForwardGtkOsCFunc!(.gtk_editable_paste_clipboard);
+    mixin ForwardGtkOsCFunc!(.gtk_editable_select_region);
+    mixin ForwardGtkOsCFunc!(.gtk_editable_set_editable);
+    mixin ForwardGtkOsCFunc!(.gtk_editable_set_position);
+    mixin ForwardGtkOsCFunc!(.gtk_entry_get_invisible_char);
+    mixin ForwardGtkOsCFunc!(.gtk_entry_get_layout );
+    mixin ForwardGtkOsCFunc!(.gtk_entry_get_layout_offsets );
+    mixin ForwardGtkOsCFunc!(.gtk_entry_text_index_to_layout_index );
+    mixin ForwardGtkOsCFunc!(.gtk_entry_get_max_length);
+    mixin ForwardGtkOsCFunc!(.gtk_entry_get_text);
+    mixin ForwardGtkOsCFunc!(.FcConfigAppFontAddFile);
+    mixin ForwardGtkOsCFunc!(.gtk_entry_get_visibility);
+    mixin ForwardGtkOsCFunc!(.gtk_entry_new);
+    mixin ForwardGtkOsCFunc!(.gtk_entry_set_activates_default);
+    mixin ForwardGtkOsCFunc!(.gtk_entry_set_alignment);
+    mixin ForwardGtkOsCFunc!(.gtk_entry_set_has_frame);
+    mixin ForwardGtkOsCFunc!(.gtk_entry_set_invisible_char);
+    mixin ForwardGtkOsCFunc!(.gtk_entry_set_max_length);
+    mixin ForwardGtkOsCFunc!(.gtk_entry_set_text);
+    mixin ForwardGtkOsCFunc!(.gtk_entry_set_visibility);
+
+    mixin ForwardGtkOsCFunc!(.gtk_events_pending);
+    mixin ForwardGtkOsCFunc!(.gtk_expander_get_expanded);
+    mixin ForwardGtkOsCFunc!(.gtk_expander_get_label_widget);
+    mixin ForwardGtkOsCFunc!(.gtk_expander_new);
+    mixin ForwardGtkOsCFunc!(.gtk_expander_set_expanded);
+    mixin ForwardGtkOsCFunc!(.gtk_expander_set_label);
+    mixin ForwardGtkOsCFunc!(.gtk_expander_set_label_widget);
+    mixin ForwardGtkOsCFunc!(.gtk_file_chooser_add_filter);
+    mixin ForwardGtkOsCFunc!(.gtk_file_chooser_dialog_new2);
+    mixin ForwardGtkOsCFunc!(.gtk_file_chooser_get_current_folder);
+    mixin ForwardGtkOsCFunc!(.gtk_file_chooser_get_filename);
+    mixin ForwardGtkOsCFunc!(.gtk_file_chooser_get_filenames);
+    mixin ForwardGtkOsCFunc!(.gtk_file_chooser_get_filter);
+    mixin ForwardGtkOsCFunc!(.gtk_file_chooser_set_current_folder);
+    mixin ForwardGtkOsCFunc!(.gtk_file_chooser_set_current_name);
+    mixin ForwardGtkOsCFunc!(.gtk_file_chooser_set_do_overwrite_confirmation);
+    mixin ForwardGtkOsCFunc!(.gtk_file_chooser_set_extra_widget);
+    mixin ForwardGtkOsCFunc!(.gtk_file_chooser_set_filename);
+    mixin ForwardGtkOsCFunc!(.gtk_file_chooser_set_filter);
+    mixin ForwardGtkOsCFunc!(.gtk_file_chooser_set_select_multiple);
+    mixin ForwardGtkOsCFunc!(.gtk_file_filter_add_pattern);
+    mixin ForwardGtkOsCFunc!(.gtk_file_filter_new);
+    mixin ForwardGtkOsCFunc!(.gtk_file_filter_get_name);
+    mixin ForwardGtkOsCFunc!(.gtk_file_filter_set_name);
+    mixin ForwardGtkOsCFunc!(.gtk_file_selection_get_filename);
+    mixin ForwardGtkOsCFunc!(.gtk_file_selection_get_selections);
+    mixin ForwardGtkOsCFunc!(.gtk_file_selection_hide_fileop_buttons);
+    mixin ForwardGtkOsCFunc!(.gtk_file_selection_new);
+    mixin ForwardGtkOsCFunc!(.gtk_file_selection_set_filename);
+    mixin ForwardGtkOsCFunc!(.gtk_file_selection_set_select_multiple);
+    mixin ForwardGtkOsCFunc!(.gtk_fixed_move);
+    mixin ForwardGtkOsCFunc!(.gtk_fixed_new);
+    mixin ForwardGtkOsCFunc!(.gtk_fixed_set_has_window);
+    mixin ForwardGtkOsCFunc!(.gtk_font_selection_dialog_get_font_name);
+    mixin ForwardGtkOsCFunc!(.gtk_font_selection_dialog_new);
+    mixin ForwardGtkOsCFunc!(.gtk_font_selection_dialog_set_font_name);
+    mixin ForwardGtkOsCFunc!(.gtk_frame_new);
+    mixin ForwardGtkOsCFunc!(.gtk_frame_get_label_widget);
+    mixin ForwardGtkOsCFunc!(.gtk_frame_set_label);
+    mixin ForwardGtkOsCFunc!(.gtk_frame_set_label_widget);
+    mixin ForwardGtkOsCFunc!(.gtk_frame_set_shadow_type);
+    mixin ForwardGtkOsCFunc!(.gtk_get_current_event);
+    mixin ForwardGtkOsCFunc!(.gtk_get_current_event_state );
+    mixin ForwardGtkOsCFunc!(.gtk_get_current_event_time);
+    mixin ForwardGtkOsCFunc!(.gtk_get_default_language);
+    mixin ForwardGtkOsCFunc!(.gtk_get_event_widget);
+    mixin ForwardGtkOsCFunc!(.gtk_grab_add);
+    mixin ForwardGtkOsCFunc!(.gtk_grab_get_current);
+    mixin ForwardGtkOsCFunc!(.gtk_grab_remove);
+    mixin ForwardGtkOsCFunc!(.gtk_hbox_new);
+    mixin ForwardGtkOsCFunc!(.gtk_hscale_new);
+    mixin ForwardGtkOsCFunc!(.gtk_hscrollbar_new);
+    mixin ForwardGtkOsCFunc!(.gtk_hseparator_new);
+    mixin ForwardGtkOsCFunc!(.gtk_icon_factory_lookup_default);
+    mixin ForwardGtkOsCFunc!(.gtk_icon_source_free);
+    mixin ForwardGtkOsCFunc!(.gtk_icon_source_new);
+    mixin ForwardGtkOsCFunc!(.gtk_icon_source_set_pixbuf);
+    mixin ForwardGtkOsCFunc!(.gtk_icon_set_render_icon);
+    mixin ForwardGtkOsCFunc!(.gtk_im_context_filter_keypress);
+    mixin ForwardGtkOsCFunc!(.gtk_im_context_focus_in);
+    mixin ForwardGtkOsCFunc!(.gtk_im_context_focus_out);
+    mixin ForwardGtkOsCFunc!(.gtk_im_context_get_preedit_string);
+    mixin ForwardGtkOsCFunc!(.gtk_im_context_get_type);
+    mixin ForwardGtkOsCFunc!(.gtk_im_context_reset);
+    mixin ForwardGtkOsCFunc!(.gtk_im_context_set_client_window);
+    mixin ForwardGtkOsCFunc!(.gtk_im_context_set_cursor_location);
+    mixin ForwardGtkOsCFunc!(.gtk_im_multicontext_append_menuitems );
+    mixin ForwardGtkOsCFunc!(.gtk_im_multicontext_new);
+    mixin ForwardGtkOsCFunc!(.gtk_image_menu_item_new_with_label);
+    mixin ForwardGtkOsCFunc!(.gtk_image_menu_item_set_image);
+    mixin ForwardGtkOsCFunc!(.gtk_image_new);
+    mixin ForwardGtkOsCFunc!(.gtk_image_new_from_pixbuf);
+    mixin ForwardGtkOsCFunc!(.gtk_image_new_from_pixmap);
+    mixin ForwardGtkOsCFunc!(.gtk_image_set_from_pixbuf);
+    mixin ForwardGtkOsCFunc!(.gtk_image_set_from_pixmap);
+    mixin ForwardGtkOsCFunc!(.gtk_init_check);
+    mixin ForwardGtkOsCFunc!(.gtk_label_get_layout);
+    mixin ForwardGtkOsCFunc!(.gtk_label_get_mnemonic_keyval);
+    mixin ForwardGtkOsCFunc!(.gtk_label_new);
+    mixin ForwardGtkOsCFunc!(.gtk_label_new_with_mnemonic);
+    mixin ForwardGtkOsCFunc!(.gtk_label_set_attributes);
+    mixin ForwardGtkOsCFunc!(.gtk_label_set_justify);
+    mixin ForwardGtkOsCFunc!(.gtk_label_set_line_wrap);
+    mixin ForwardGtkOsCFunc!(.gtk_label_set_line_wrap_mode);
+    mixin ForwardGtkOsCFunc!(.gtk_label_set_text);
+    mixin ForwardGtkOsCFunc!(.gtk_label_set_text_with_mnemonic);
+    mixin ForwardGtkOsCFunc!(.gtk_list_append_items);
+    mixin ForwardGtkOsCFunc!(.gtk_list_clear_items);
+    mixin ForwardGtkOsCFunc!(.gtk_list_insert_items);
+    mixin ForwardGtkOsCFunc!(.gtk_list_item_new_with_label);
+    mixin ForwardGtkOsCFunc!(.gtk_list_remove_items);
+    mixin ForwardGtkOsCFunc!(.gtk_list_select_item);
+    mixin ForwardGtkOsCFunc!(.gtk_list_unselect_all);
+    mixin ForwardGtkOsCFunc!(.gtk_list_unselect_item);
+    mixin ForwardGtkOsCFunc!(.gtk_list_store_append);
+    mixin ForwardGtkOsCFunc!(.gtk_list_store_clear);
+    mixin ForwardGtkOsCFunc!(.gtk_list_store_insert);
+    mixin ForwardGtkOsCFunc!(.gtk_list_store_newv);
+    mixin ForwardGtkOsCFunc!(.gtk_list_store_remove);
+    mixin ForwardGtkOsCFunc!(.gtk_list_store_set1);
+    mixin ForwardGtkOsCFunc!(.gtk_main);
+    mixin ForwardGtkOsCFunc!(.gtk_main_iteration);
+    mixin ForwardGtkOsCFunc!(.gtk_main_do_event);
+    mixin ForwardGtkOsCFunc!(.gtk_menu_bar_new);
+    mixin ForwardGtkOsCFunc!(.gtk_menu_item_remove_submenu);
+    mixin ForwardGtkOsCFunc!(.gtk_menu_item_get_submenu);
+    mixin ForwardGtkOsCFunc!(.gtk_menu_item_set_submenu);
+    mixin ForwardGtkOsCFunc!(.gtk_menu_new);
+    mixin ForwardGtkOsCFunc!(.gtk_menu_popdown);
+    mixin ForwardGtkOsCFunc!(.gtk_menu_popup);
+    mixin ForwardGtkOsCFunc!(.gtk_menu_shell_deactivate);
+    mixin ForwardGtkOsCFunc!(.gtk_menu_shell_insert);
+    mixin ForwardGtkOsCFunc!(.gtk_menu_shell_select_item);
+    mixin ForwardGtkOsCFunc!(.gtk_menu_shell_set_take_focus);
+    mixin ForwardGtkOsCFunc!(.gtk_message_dialog_new);
+    mixin ForwardGtkOsCFunc!(.gtk_misc_set_alignment);
+    mixin ForwardGtkOsCFunc!(.gtk_notebook_get_current_page);
+    mixin ForwardGtkOsCFunc!(.gtk_notebook_get_scrollable);
+    mixin ForwardGtkOsCFunc!(.gtk_notebook_insert_page);
+    mixin ForwardGtkOsCFunc!(.gtk_notebook_new);
+    mixin ForwardGtkOsCFunc!(.gtk_notebook_next_page);
+    mixin ForwardGtkOsCFunc!(.gtk_notebook_prev_page);
+    mixin ForwardGtkOsCFunc!(.gtk_notebook_remove_page);
+    mixin ForwardGtkOsCFunc!(.gtk_notebook_set_current_page);
+    mixin ForwardGtkOsCFunc!(.gtk_notebook_set_scrollable);
+    mixin ForwardGtkOsCFunc!(.gtk_notebook_set_show_tabs);
+    mixin ForwardGtkOsCFunc!(.gtk_notebook_set_tab_pos);
+    mixin ForwardGtkOsCFunc!(.gtk_object_sink);
+    mixin ForwardGtkOsCFunc!(.gtk_page_setup_new );
+    mixin ForwardGtkOsCFunc!(.gtk_page_setup_get_orientation);
+    mixin ForwardGtkOsCFunc!(.gtk_page_setup_set_orientation);
+    mixin ForwardGtkOsCFunc!(.gtk_page_setup_get_paper_size);
+    mixin ForwardGtkOsCFunc!(.gtk_page_setup_set_paper_size);
+    mixin ForwardGtkOsCFunc!(.gtk_page_setup_get_top_margin);
+    mixin ForwardGtkOsCFunc!(.gtk_page_setup_set_top_margin);
+    mixin ForwardGtkOsCFunc!(.gtk_page_setup_get_bottom_margin);
+    mixin ForwardGtkOsCFunc!(.gtk_page_setup_set_bottom_margin);
+    mixin ForwardGtkOsCFunc!(.gtk_page_setup_get_left_margin);
+    mixin ForwardGtkOsCFunc!(.gtk_page_setup_set_left_margin);
+    mixin ForwardGtkOsCFunc!(.gtk_page_setup_get_right_margin);
+    mixin ForwardGtkOsCFunc!(.gtk_page_setup_set_right_margin);
+    mixin ForwardGtkOsCFunc!(.gtk_page_setup_get_paper_width);
+    mixin ForwardGtkOsCFunc!(.gtk_page_setup_get_paper_height);
+    mixin ForwardGtkOsCFunc!(.gtk_page_setup_get_page_width);
+    mixin ForwardGtkOsCFunc!(.gtk_page_setup_get_page_height);
+    mixin ForwardGtkOsCFunc!(.gtk_paint_handle);
+    mixin ForwardGtkOsCFunc!(.gtk_paint_flat_box);
+    mixin ForwardGtkOsCFunc!(.gtk_paint_focus);
+    mixin ForwardGtkOsCFunc!(.gtk_paint_option);
+    mixin ForwardGtkOsCFunc!(.gtk_paint_slider);
+    mixin ForwardGtkOsCFunc!(.gtk_paint_tab);
+    mixin ForwardGtkOsCFunc!(.gtk_paint_arrow);
+    mixin ForwardGtkOsCFunc!(.gtk_paint_box);
+    mixin ForwardGtkOsCFunc!(.gtk_paint_box_gap);
+    mixin ForwardGtkOsCFunc!(.gtk_paint_check);
+    mixin ForwardGtkOsCFunc!(.gtk_paint_expander);
+    mixin ForwardGtkOsCFunc!(.gtk_paint_extension);
+    mixin ForwardGtkOsCFunc!(.gtk_paint_hline);
+    mixin ForwardGtkOsCFunc!(.gtk_paint_layout);
+    mixin ForwardGtkOsCFunc!(.gtk_paint_shadow_gap);
+    mixin ForwardGtkOsCFunc!(.gtk_paint_shadow);
+    mixin ForwardGtkOsCFunc!(.gtk_paint_vline);
+    mixin ForwardGtkOsCFunc!(.gtk_paper_size_new);
+    mixin ForwardGtkOsCFunc!(.gtk_paper_size_new_from_ppd);
+    mixin ForwardGtkOsCFunc!(.gtk_paper_size_new_custom);
+    mixin ForwardGtkOsCFunc!(.gtk_paper_size_get_name);
+    mixin ForwardGtkOsCFunc!(.gtk_paper_size_get_display_name);
+    mixin ForwardGtkOsCFunc!(.gtk_paper_size_get_ppd_name);
+    mixin ForwardGtkOsCFunc!(.gtk_paper_size_get_width);
+    mixin ForwardGtkOsCFunc!(.gtk_paper_size_get_height);
+    mixin ForwardGtkOsCFunc!(.gtk_paper_size_is_custom);
+    mixin ForwardGtkOsCFunc!(.gtk_paper_size_free);
+    mixin ForwardGtkOsCFunc!(.gtk_plug_get_id);
+    mixin ForwardGtkOsCFunc!(.gtk_plug_new);
+    mixin ForwardGtkOsCFunc!(.gtk_printer_get_backend);
+    mixin ForwardGtkOsCFunc!(.gtk_printer_get_name);
+    mixin ForwardGtkOsCFunc!(.gtk_printer_is_default);
+    mixin ForwardGtkOsCFunc!(.gtk_enumerate_printers);
+    mixin ForwardGtkOsCFunc!(.gtk_print_job_new);
+    mixin ForwardGtkOsCFunc!(.gtk_print_job_get_settings);
+    mixin ForwardGtkOsCFunc!(.gtk_print_job_get_printer);
+    mixin ForwardGtkOsCFunc!(.gtk_print_job_get_title);
+    mixin ForwardGtkOsCFunc!(.gtk_print_job_get_status);
+    mixin ForwardGtkOsCFunc!(.gtk_print_job_set_source_file);
+    mixin ForwardGtkOsCFunc!(.gtk_print_job_get_surface);
+    mixin ForwardGtkOsCFunc!(.gtk_print_job_send);
+    mixin ForwardGtkOsCFunc!(.gtk_print_settings_new);
+    mixin ForwardGtkOsCFunc!(.gtk_print_settings_foreach);
+    mixin ForwardGtkOsCFunc!(.gtk_print_settings_get);
+    mixin ForwardGtkOsCFunc!(.gtk_print_settings_set);
+    mixin ForwardGtkOsCFunc!(.gtk_print_settings_get_printer);
+    mixin ForwardGtkOsCFunc!(.gtk_print_settings_set_printer);
+    mixin ForwardGtkOsCFunc!(.gtk_print_settings_get_orientation);
+    mixin ForwardGtkOsCFunc!(.gtk_print_settings_set_orientation);
+    mixin ForwardGtkOsCFunc!(.gtk_print_settings_get_collate);
+    mixin ForwardGtkOsCFunc!(.gtk_print_settings_set_collate);
+    mixin ForwardGtkOsCFunc!(.gtk_print_settings_get_n_copies);
+    mixin ForwardGtkOsCFunc!(.gtk_print_settings_set_n_copies);
+    mixin ForwardGtkOsCFunc!(.gtk_print_settings_get_print_pages);
+    mixin ForwardGtkOsCFunc!(.gtk_print_settings_set_print_pages);
+    mixin ForwardGtkOsCFunc!(.gtk_print_settings_get_page_ranges);
+    mixin ForwardGtkOsCFunc!(.gtk_print_settings_set_page_ranges);
+    mixin ForwardGtkOsCFunc!(.gtk_print_settings_get_paper_width);
+    mixin ForwardGtkOsCFunc!(.gtk_print_settings_get_paper_height);
+    mixin ForwardGtkOsCFunc!(.gtk_print_settings_get_resolution);
+    mixin ForwardGtkOsCFunc!(.gtk_print_unix_dialog_new);
+    mixin ForwardGtkOsCFunc!(.gtk_print_unix_dialog_set_page_setup);
+    mixin ForwardGtkOsCFunc!(.gtk_print_unix_dialog_get_page_setup);
+    mixin ForwardGtkOsCFunc!(.gtk_print_unix_dialog_set_current_page);
+    mixin ForwardGtkOsCFunc!(.gtk_print_unix_dialog_get_current_page);
+    mixin ForwardGtkOsCFunc!(.gtk_print_unix_dialog_set_settings);
+    mixin ForwardGtkOsCFunc!(.gtk_print_unix_dialog_get_settings);
+    mixin ForwardGtkOsCFunc!(.gtk_print_unix_dialog_get_selected_printer);
+    mixin ForwardGtkOsCFunc!(.gtk_print_unix_dialog_set_manual_capabilities);
+    mixin ForwardGtkOsCFunc!(.gtk_progress_bar_new);
+    mixin ForwardGtkOsCFunc!(.gtk_progress_bar_pulse);
+    mixin ForwardGtkOsCFunc!(.gtk_progress_bar_set_fraction);
+    mixin ForwardGtkOsCFunc!(.gtk_progress_bar_set_orientation);
+    mixin ForwardGtkOsCFunc!(.gtk_radio_button_get_group);
+    mixin ForwardGtkOsCFunc!(.gtk_radio_button_new);
+    mixin ForwardGtkOsCFunc!(.gtk_radio_menu_item_get_group);
+    mixin ForwardGtkOsCFunc!(.gtk_radio_menu_item_new);
+    mixin ForwardGtkOsCFunc!(.gtk_radio_menu_item_new_with_label);
+    mixin ForwardGtkOsCFunc!(.gtk_range_get_adjustment);
+    mixin ForwardGtkOsCFunc!(.gtk_range_set_increments);
+    mixin ForwardGtkOsCFunc!(.gtk_range_set_inverted);
+    mixin ForwardGtkOsCFunc!(.gtk_range_set_range);
+    mixin ForwardGtkOsCFunc!(.gtk_range_set_value);
+    mixin ForwardGtkOsCFunc!(.gtk_rc_parse_string);
+//    mixin ForwardGtkOsCFunc!(.gtk_rc_style_get_bg_pixmap_name);
+//    mixin ForwardGtkOsCFunc!(.gtk_rc_style_get_color_flags);
+//    mixin ForwardGtkOsCFunc!(.gtk_rc_style_set_bg);
+//    mixin ForwardGtkOsCFunc!(.gtk_rc_style_set_bg_pixmap_name);
+//    mixin ForwardGtkOsCFunc!(.gtk_rc_style_set_color_flags);
+    mixin ForwardGtkOsCFunc!(.gtk_scale_set_digits);
+    mixin ForwardGtkOsCFunc!(.gtk_scale_set_draw_value);
+//    mixin ForwardGtkOsCFunc!(.gtk_rc_style_set_fg);
+//    mixin ForwardGtkOsCFunc!(.gtk_rc_style_set_text);
+    mixin ForwardGtkOsCFunc!(.gtk_scrolled_window_add_with_viewport);
+    mixin ForwardGtkOsCFunc!(.gtk_scrolled_window_get_hadjustment);
+    mixin ForwardGtkOsCFunc!(.gtk_scrolled_window_get_policy);
+    mixin ForwardGtkOsCFunc!(.gtk_scrolled_window_get_shadow_type);
+    mixin ForwardGtkOsCFunc!(.gtk_scrolled_window_get_vadjustment);
+    mixin ForwardGtkOsCFunc!(.gtk_scrolled_window_new);
+    mixin ForwardGtkOsCFunc!(.gtk_scrolled_window_set_placement);
+    mixin ForwardGtkOsCFunc!(.gtk_scrolled_window_set_policy);
+    mixin ForwardGtkOsCFunc!(.gtk_scrolled_window_set_shadow_type);
+    mixin ForwardGtkOsCFunc!(.gtk_settings_get_default);
+    mixin ForwardGtkOsCFunc!(.gtk_selection_data_free);
+    mixin ForwardGtkOsCFunc!(.gtk_selection_data_set);
+    mixin ForwardGtkOsCFunc!(.gtk_separator_menu_item_new);
+    mixin ForwardGtkOsCFunc!(.gtk_set_locale);
+    mixin ForwardGtkOsCFunc!(.gtk_socket_get_id);
+    mixin ForwardGtkOsCFunc!(.gtk_socket_new);
+    mixin ForwardGtkOsCFunc!(.gtk_spin_button_new);
+    mixin ForwardGtkOsCFunc!(.gtk_spin_button_get_adjustment);
+    mixin ForwardGtkOsCFunc!(.gtk_spin_button_get_digits);
+    mixin ForwardGtkOsCFunc!(.gtk_spin_button_set_digits);
+    mixin ForwardGtkOsCFunc!(.gtk_spin_button_set_increments);
+    mixin ForwardGtkOsCFunc!(.gtk_spin_button_set_range);
+    mixin ForwardGtkOsCFunc!(.gtk_spin_button_set_value);
+    mixin ForwardGtkOsCFunc!(.gtk_spin_button_set_wrap);
+    mixin ForwardGtkOsCFunc!(.gtk_spin_button_update);
+//    mixin ForwardGtkOsCFunc!(.gtk_style_get_base);
+//    mixin ForwardGtkOsCFunc!(.gtk_style_get_black);
+//    mixin ForwardGtkOsCFunc!(.gtk_style_get_bg);
+//    mixin ForwardGtkOsCFunc!(.gtk_style_get_dark);
+//    mixin ForwardGtkOsCFunc!(.gtk_style_get_fg);
+//    mixin ForwardGtkOsCFunc!(.gtk_style_get_fg_gc);
+//    mixin ForwardGtkOsCFunc!(.gtk_style_get_bg_gc);
+//    mixin ForwardGtkOsCFunc!(.gtk_style_get_light_gc);
+//    mixin ForwardGtkOsCFunc!(.gtk_style_get_dark_gc);
+//    mixin ForwardGtkOsCFunc!(.gtk_style_get_mid_gc);
+//    mixin ForwardGtkOsCFunc!(.gtk_style_get_text_gc);
+//    mixin ForwardGtkOsCFunc!(.gtk_style_get_text_aa_gc);
+//    mixin ForwardGtkOsCFunc!(.gtk_style_get_black_gc);
+//    mixin ForwardGtkOsCFunc!(.gtk_style_get_white_gc);
+//    mixin ForwardGtkOsCFunc!(.gtk_style_get_font_desc);
+//    mixin ForwardGtkOsCFunc!(.gtk_style_get_light);
+//    mixin ForwardGtkOsCFunc!(.gtk_style_get_text);
+//    mixin ForwardGtkOsCFunc!(.gtk_style_get_xthickness);
+//    mixin ForwardGtkOsCFunc!(.gtk_style_get_ythickness);
+    mixin ForwardGtkOsCFunc!(.gtk_style_render_icon);
+    mixin ForwardGtkOsCFunc!(.gtk_target_list_new);
+    mixin ForwardGtkOsCFunc!(.gtk_target_list_unref);
+    mixin ForwardGtkOsCFunc!(.gtk_text_buffer_copy_clipboard);
+    mixin ForwardGtkOsCFunc!(.gtk_text_buffer_cut_clipboard);
+    mixin ForwardGtkOsCFunc!(.gtk_text_buffer_delete);
+    mixin ForwardGtkOsCFunc!(.gtk_text_buffer_get_bounds);
+    mixin ForwardGtkOsCFunc!(.gtk_text_buffer_get_char_count);
+    mixin ForwardGtkOsCFunc!(.gtk_text_buffer_get_end_iter);
+    mixin ForwardGtkOsCFunc!(.gtk_text_buffer_get_insert);
+    mixin ForwardGtkOsCFunc!(.gtk_text_buffer_get_iter_at_line);
+    mixin ForwardGtkOsCFunc!(.gtk_text_buffer_get_iter_at_mark);
+    mixin ForwardGtkOsCFunc!(.gtk_text_buffer_get_iter_at_offset);
+    mixin ForwardGtkOsCFunc!(.gtk_text_buffer_get_line_count);
+    mixin ForwardGtkOsCFunc!(.gtk_text_buffer_get_selection_bound);
+    mixin ForwardGtkOsCFunc!(.gtk_text_buffer_get_selection_bounds);
+    mixin ForwardGtkOsCFunc!(.gtk_text_buffer_get_text);
+    mixin ForwardGtkOsCFunc!(.gtk_text_buffer_insert);
+    mixin ForwardGtkOsCFunc!(.gtk_text_buffer_move_mark);
+    mixin ForwardGtkOsCFunc!(.gtk_text_buffer_paste_clipboard);
+    mixin ForwardGtkOsCFunc!(.gtk_text_buffer_place_cursor);
+    mixin ForwardGtkOsCFunc!(.gtk_text_buffer_set_text);
+    mixin ForwardGtkOsCFunc!(.gtk_text_iter_get_line);
+    mixin ForwardGtkOsCFunc!(.gtk_text_iter_get_offset);
+    mixin ForwardGtkOsCFunc!(.gtk_text_view_buffer_to_window_coords);
+    mixin ForwardGtkOsCFunc!(.gtk_text_view_get_buffer);
+    mixin ForwardGtkOsCFunc!(.gtk_text_view_get_editable);
+    mixin ForwardGtkOsCFunc!(.gtk_text_view_get_iter_at_location);
+    mixin ForwardGtkOsCFunc!(.gtk_text_view_get_iter_location);
+    mixin ForwardGtkOsCFunc!(.gtk_text_view_get_line_at_y);
+    mixin ForwardGtkOsCFunc!(.gtk_text_view_get_visible_rect);
+    mixin ForwardGtkOsCFunc!(.gtk_text_view_get_window);
+    mixin ForwardGtkOsCFunc!(.gtk_text_view_new);
+    mixin ForwardGtkOsCFunc!(.gtk_text_view_scroll_mark_onscreen);
+    mixin ForwardGtkOsCFunc!(.gtk_text_view_scroll_to_iter);
+    mixin ForwardGtkOsCFunc!(.gtk_text_view_set_editable);
+    mixin ForwardGtkOsCFunc!(.gtk_text_view_set_justification);
+    mixin ForwardGtkOsCFunc!(.gtk_text_view_set_tabs);
+    mixin ForwardGtkOsCFunc!(.gtk_text_view_set_wrap_mode);
+    mixin ForwardGtkOsCFunc!(.gtk_text_view_window_to_buffer_coords);
+    mixin ForwardGtkOsCFunc!(.gtk_timeout_add);
+    mixin ForwardGtkOsCFunc!(.gtk_timeout_remove);
+    mixin ForwardGtkOsCFunc!(.gtk_toggle_button_get_active);
+    mixin ForwardGtkOsCFunc!(.gtk_toggle_button_new);
+    mixin ForwardGtkOsCFunc!(.gtk_toggle_button_get_inconsistent);
+    mixin ForwardGtkOsCFunc!(.gtk_toggle_button_set_active);
+    mixin ForwardGtkOsCFunc!(.gtk_toggle_button_set_inconsistent);
+    mixin ForwardGtkOsCFunc!(.gtk_toggle_button_set_mode);
+    mixin ForwardGtkOsCFunc!(.gtk_toolbar_insert_widget);
+    mixin ForwardGtkOsCFunc!(.gtk_toolbar_new);
+    mixin ForwardGtkOsCFunc!(.gtk_toolbar_set_orientation);
+    mixin ForwardGtkOsCFunc!(.gtk_tooltips_data_get);
+    mixin ForwardGtkOsCFunc!(.gtk_tooltips_disable);
+    mixin ForwardGtkOsCFunc!(.gtk_tooltips_enable);
+    mixin ForwardGtkOsCFunc!(.gtk_tooltips_new);
+    mixin ForwardGtkOsCFunc!(.gtk_tooltips_force_window);
+    mixin ForwardGtkOsCFunc!(.gtk_tooltips_set_tip);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_model_get1);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_model_get_iter);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_model_get_iter_first);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_model_get_n_columns);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_model_get_path);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_model_get_type);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_model_iter_children);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_model_iter_n_children);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_model_iter_next);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_model_iter_nth_child);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_path_append_index);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_path_compare);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_path_down);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_path_free);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_path_get_depth);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_path_get_indices);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_path_new);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_path_new_first);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_path_new_from_string);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_path_next);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_path_prev);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_path_up);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_selection_count_selected_rows);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_selection_get_selected);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_selection_get_selected_rows);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_selection_path_is_selected);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_selection_select_all);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_selection_select_iter);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_selection_selected_foreach);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_selection_set_mode);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_selection_unselect_all);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_selection_unselect_iter);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_store_append);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_store_clear);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_store_insert);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_store_newv);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_store_remove);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_store_set1);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_create_row_drag_icon);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_collapse_row);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_add_attribute);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_cell_get_position);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_cell_get_size);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_cell_set_cell_data);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_clear);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_get_cell_renderers);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_get_fixed_width);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_get_reorderable);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_get_resizable);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_get_sizing);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_get_spacing);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_get_visible);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_get_sort_indicator);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_get_sort_order);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_get_width);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_new);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_pack_start);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_pack_end);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_set_alignment);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_set_cell_data_func);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_set_clickable);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_set_fixed_width);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_set_min_width);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_set_reorderable);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_set_resizable);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_set_sizing);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_set_sort_indicator);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_set_sort_order);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_set_title);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_set_visible );
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_column_set_widget);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_set_drag_dest_row);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_set_enable_search );
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_expand_row);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_get_background_area);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_get_bin_window);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_get_cell_area);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_get_expander_column);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_get_column);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_get_columns);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_get_cursor);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_get_headers_visible);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_get_path_at_pos);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_get_rules_hint);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_get_selection);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_get_visible_rect);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_insert_column);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_move_column_after);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_new_with_model);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_remove_column);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_row_expanded);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_scroll_to_cell);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_scroll_to_point );
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_set_cursor);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_set_headers_visible);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_set_model);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_set_rules_hint);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_set_search_column);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_tree_to_widget_coords);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_unset_rows_drag_dest);
+    mixin ForwardGtkOsCFunc!(.gtk_tree_view_widget_to_tree_coords);
+    mixin ForwardGtkOsCFunc!(.gtk_vbox_new);
+    mixin ForwardGtkOsCFunc!(.gtk_vscale_new);
+    mixin ForwardGtkOsCFunc!(.gtk_vscrollbar_new);
+    mixin ForwardGtkOsCFunc!(.gtk_vseparator_new);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_add_accelerator);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_add_events);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_child_focus);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_create_pango_layout);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_destroy);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_event);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_get_accessible );
+    mixin ForwardGtkOsCFunc!(.gtk_widget_get_child_visible );
+    mixin ForwardGtkOsCFunc!(.gtk_widget_get_default_direction);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_get_default_style);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_get_direction);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_get_events);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_get_modifier_style);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_get_pango_context);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_get_parent);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_get_style);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_get_size_request);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_get_toplevel );
+    mixin ForwardGtkOsCFunc!(.gtk_widget_grab_focus);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_hide);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_is_composited);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_is_focus);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_map);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_mnemonic_activate);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_modify_base);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_modify_bg);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_modify_fg);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_modify_font);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_modify_style);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_modify_text);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_queue_resize);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_realize);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_remove_accelerator);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_reparent);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_send_expose);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_set_app_paintable);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_set_default_direction);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_set_direction);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_set_double_buffered);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_set_name);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_set_redraw_on_allocate);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_set_sensitive);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_set_size_request);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_set_state);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_set_style);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_shape_combine_mask);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_show);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_show_now);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_size_allocate);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_size_request);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_style_get1); // 1=get one property, see above
+    mixin ForwardGtkOsCFunc!(.gtk_widget_translate_coordinates);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_unrealize);
+    mixin ForwardGtkOsCFunc!(.gtk_window_activate_default);
+    mixin ForwardGtkOsCFunc!(.gtk_window_add_accel_group);
+    mixin ForwardGtkOsCFunc!(.gtk_window_deiconify);
+    mixin ForwardGtkOsCFunc!(.gtk_window_get_focus);
+    mixin ForwardGtkOsCFunc!(.gtk_window_get_group);
+    mixin ForwardGtkOsCFunc!(.gtk_window_get_icon_list);
+    mixin ForwardGtkOsCFunc!(.gtk_window_get_modal);
+    mixin ForwardGtkOsCFunc!(.gtk_window_get_mnemonic_modifier);
+    mixin ForwardGtkOsCFunc!(.gtk_window_get_opacity);
+    mixin ForwardGtkOsCFunc!(.gtk_window_get_position);
+    mixin ForwardGtkOsCFunc!(.gtk_window_get_size);
+    mixin ForwardGtkOsCFunc!(.gtk_window_group_add_window);
+    mixin ForwardGtkOsCFunc!(.gtk_window_group_remove_window);
+    mixin ForwardGtkOsCFunc!(.gtk_window_group_new);
+    mixin ForwardGtkOsCFunc!(.gtk_window_iconify);
+    mixin ForwardGtkOsCFunc!(.gtk_window_list_toplevels);
+    mixin ForwardGtkOsCFunc!(.gtk_window_maximize);
+    mixin ForwardGtkOsCFunc!(.gtk_window_fullscreen);
+    mixin ForwardGtkOsCFunc!(.gtk_window_unfullscreen);
+    mixin ForwardGtkOsCFunc!(.gtk_window_move);
+    mixin ForwardGtkOsCFunc!(.gtk_window_new);
+    mixin ForwardGtkOsCFunc!(.gtk_window_present);
+    mixin ForwardGtkOsCFunc!(.gtk_window_remove_accel_group);
+    mixin ForwardGtkOsCFunc!(.gtk_window_resize);
+    mixin ForwardGtkOsCFunc!(.gtk_window_set_default);
+    mixin ForwardGtkOsCFunc!(.gtk_window_set_destroy_with_parent);
+    mixin ForwardGtkOsCFunc!(.gtk_window_set_keep_below);
+    mixin ForwardGtkOsCFunc!(.gtk_window_set_geometry_hints);
+    mixin ForwardGtkOsCFunc!(.gtk_window_set_icon_list);
+    mixin ForwardGtkOsCFunc!(.gtk_window_set_modal);
+    mixin ForwardGtkOsCFunc!(.gtk_window_set_opacity);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_set_tooltip_text);
+    mixin ForwardGtkOsCFunc!(.gtk_widget_set_parent_window);
+    mixin ForwardGtkOsCFunc!(.gtk_window_set_resizable);
+    mixin ForwardGtkOsCFunc!(.gtk_window_set_title);
+    mixin ForwardGtkOsCFunc!(.gtk_window_set_skip_taskbar_hint);
+    mixin ForwardGtkOsCFunc!(.gtk_window_set_type_hint);
+    mixin ForwardGtkOsCFunc!(.gtk_window_set_transient_for);
+    mixin ForwardGtkOsCFunc!(.gtk_window_unmaximize);
+    mixin ForwardGtkOsCFunc!(.pango_attr_background_new );
+    mixin ForwardGtkOsCFunc!(.pango_attr_font_desc_new);
+    mixin ForwardGtkOsCFunc!(.pango_attr_foreground_new );
+    mixin ForwardGtkOsCFunc!(.pango_attr_rise_new);
+    mixin ForwardGtkOsCFunc!(.pango_attr_shape_new);
+    mixin ForwardGtkOsCFunc!(.pango_attr_list_insert);
+    mixin ForwardGtkOsCFunc!(.pango_attr_list_change);
+    mixin ForwardGtkOsCFunc!(.pango_attr_list_get_iterator);
+    mixin ForwardGtkOsCFunc!(.pango_attr_iterator_next);
+    mixin ForwardGtkOsCFunc!(.pango_attr_iterator_range);
+    mixin ForwardGtkOsCFunc!(.pango_attr_iterator_get);
+    mixin ForwardGtkOsCFunc!(.pango_attr_iterator_get_attrs);
+    mixin ForwardGtkOsCFunc!(.pango_attr_iterator_destroy);
+    mixin ForwardGtkOsCFunc!(.pango_attr_list_new);
+    mixin ForwardGtkOsCFunc!(.pango_attr_list_unref);
+    mixin ForwardGtkOsCFunc!(.pango_attr_strikethrough_color_new);
+    mixin ForwardGtkOsCFunc!(.pango_attr_strikethrough_new);
+    mixin ForwardGtkOsCFunc!(.pango_attr_underline_color_new);
+    mixin ForwardGtkOsCFunc!(.pango_attr_underline_new);
+    mixin ForwardGtkOsCFunc!(.pango_attr_weight_new);
+//    mixin ForwardGtkOsCFunc!(.pango_cairo_font_map_get_default);
+//    mixin ForwardGtkOsCFunc!(.pango_cairo_font_map_new);
+//    mixin ForwardGtkOsCFunc!(.pango_cairo_font_map_create_context);
+    mixin ForwardGtkOsCFunc!(.pango_cairo_create_layout);
+    mixin ForwardGtkOsCFunc!(.pango_cairo_context_get_font_options);
+    mixin ForwardGtkOsCFunc!(.pango_cairo_context_set_font_options);
+//    mixin ForwardGtkOsCFunc!(.pango_cairo_font_map_set_resolution);
+    mixin ForwardGtkOsCFunc!(.pango_cairo_layout_path);
+    mixin ForwardGtkOsCFunc!(.pango_cairo_show_layout);
+    mixin ForwardGtkOsCFunc!(.pango_context_get_base_dir);
+    mixin ForwardGtkOsCFunc!(.pango_context_get_language);
+    mixin ForwardGtkOsCFunc!(.pango_context_get_metrics);
+    mixin ForwardGtkOsCFunc!(.pango_context_list_families);
+    mixin ForwardGtkOsCFunc!(.pango_context_set_base_dir);
+    mixin ForwardGtkOsCFunc!(.pango_context_set_language);
+    mixin ForwardGtkOsCFunc!(.pango_font_description_copy);
+    mixin ForwardGtkOsCFunc!(.pango_font_description_free);
+    mixin ForwardGtkOsCFunc!(.pango_font_description_from_string);
+    mixin ForwardGtkOsCFunc!(.pango_font_description_get_family);
+    mixin ForwardGtkOsCFunc!(.pango_font_description_get_size);
+    mixin ForwardGtkOsCFunc!(.pango_font_description_get_style);
+    mixin ForwardGtkOsCFunc!(.pango_font_description_get_weight);
+    mixin ForwardGtkOsCFunc!(.pango_font_description_new);
+    mixin ForwardGtkOsCFunc!(.pango_font_description_set_family);
+    mixin ForwardGtkOsCFunc!(.pango_font_description_set_size);
+    mixin ForwardGtkOsCFunc!(.pango_font_description_set_stretch);
+    mixin ForwardGtkOsCFunc!(.pango_font_description_set_style);
+    mixin ForwardGtkOsCFunc!(.pango_font_description_set_weight);
+    mixin ForwardGtkOsCFunc!(.pango_font_description_to_string);
+    mixin ForwardGtkOsCFunc!(.pango_font_face_describe);
+    mixin ForwardGtkOsCFunc!(.pango_font_family_get_name);
+    mixin ForwardGtkOsCFunc!(.pango_font_family_list_faces);
+    mixin ForwardGtkOsCFunc!(.pango_font_get_metrics);
+    mixin ForwardGtkOsCFunc!(.pango_font_metrics_get_approximate_char_width);
+    mixin ForwardGtkOsCFunc!(.pango_font_metrics_get_ascent);
+    mixin ForwardGtkOsCFunc!(.pango_font_metrics_get_descent);
+    mixin ForwardGtkOsCFunc!(.pango_font_metrics_get_underline_thickness);
+    mixin ForwardGtkOsCFunc!(.pango_font_metrics_get_underline_position);
+    mixin ForwardGtkOsCFunc!(.pango_font_metrics_get_strikethrough_thickness);
+    mixin ForwardGtkOsCFunc!(.pango_font_metrics_get_strikethrough_position);
+    mixin ForwardGtkOsCFunc!(.pango_font_metrics_unref);
+    mixin ForwardGtkOsCFunc!(.pango_language_from_string);
+    mixin ForwardGtkOsCFunc!(.pango_layout_context_changed);
+    mixin ForwardGtkOsCFunc!(.pango_layout_get_alignment);
+    mixin ForwardGtkOsCFunc!(.pango_layout_get_context);
+    mixin ForwardGtkOsCFunc!(.pango_layout_get_attributes);
+    mixin ForwardGtkOsCFunc!(.pango_layout_get_indent);
+    mixin ForwardGtkOsCFunc!(.pango_layout_get_iter);
+    mixin ForwardGtkOsCFunc!(.pango_layout_get_justify);
+    mixin ForwardGtkOsCFunc!(.pango_layout_get_line);
+    mixin ForwardGtkOsCFunc!(.pango_layout_get_line_count);
+    mixin ForwardGtkOsCFunc!(.pango_layout_get_log_attrs);
+    mixin ForwardGtkOsCFunc!(.pango_layout_get_size);
+    mixin ForwardGtkOsCFunc!(.pango_layout_get_spacing);
+    mixin ForwardGtkOsCFunc!(.pango_layout_get_tabs);
+    mixin ForwardGtkOsCFunc!(.pango_layout_get_text);
+    mixin ForwardGtkOsCFunc!(.pango_layout_get_width);
+    mixin ForwardGtkOsCFunc!(.pango_layout_index_to_pos);
+    mixin ForwardGtkOsCFunc!(.pango_layout_iter_free);
+    mixin ForwardGtkOsCFunc!(.pango_layout_iter_get_line_extents);
+    mixin ForwardGtkOsCFunc!(.pango_layout_iter_get_index);
+    mixin ForwardGtkOsCFunc!(.pango_layout_iter_get_run);
+    mixin ForwardGtkOsCFunc!(.pango_layout_iter_next_line);
+    mixin ForwardGtkOsCFunc!(.pango_layout_iter_next_run);
+    mixin ForwardGtkOsCFunc!(.pango_layout_line_get_extents);
+    mixin ForwardGtkOsCFunc!(.pango_layout_line_x_to_index);
+    mixin ForwardGtkOsCFunc!(.pango_layout_new);
+    mixin ForwardGtkOsCFunc!(.pango_layout_set_alignment );
+    mixin ForwardGtkOsCFunc!(.pango_layout_set_attributes);
+    mixin ForwardGtkOsCFunc!(.pango_layout_set_auto_dir);
+    mixin ForwardGtkOsCFunc!(.pango_layout_set_font_description);
+    mixin ForwardGtkOsCFunc!(.pango_layout_set_indent);
+    mixin ForwardGtkOsCFunc!(.pango_layout_set_justify);
+    mixin ForwardGtkOsCFunc!(.pango_layout_set_single_paragraph_mode);
+    mixin ForwardGtkOsCFunc!(.pango_layout_set_spacing);
+    mixin ForwardGtkOsCFunc!(.pango_layout_set_tabs);
+    mixin ForwardGtkOsCFunc!(.pango_layout_set_text);
+    mixin ForwardGtkOsCFunc!(.pango_layout_set_width);
+    mixin ForwardGtkOsCFunc!(.pango_layout_set_wrap );
+    mixin ForwardGtkOsCFunc!(.pango_layout_xy_to_index);
+    mixin ForwardGtkOsCFunc!(.pango_tab_array_get_size);
+    mixin ForwardGtkOsCFunc!(.pango_tab_array_get_tabs);
+    mixin ForwardGtkOsCFunc!(.pango_tab_array_free);
+    mixin ForwardGtkOsCFunc!(.pango_tab_array_new);
+    mixin ForwardGtkOsCFunc!(.pango_tab_array_set_tab);
+    mixin ForwardGtkOsCFunc!(.atk_object_add_relationship );
+
+    /* Field accessors */
+
+    public static uint pango_layout_line_get_resolved_dir( PangoLayoutLine* line ){
+        return line.resolved_dir();
+    }
+
+    static void    GTK_ACCEL_LABEL_SET_ACCEL_STRING( void *arg0, gchar * arg1 )
+            { (cast(GtkAccelLabel*)arg0).accel_string = arg1; }
+    static gchar*  GTK_ACCEL_LABEL_GET_ACCEL_STRING( void* arg0)
+            { return (cast(GtkAccelLabel*)arg0).accel_string; }
+
+    static GtkWidget* GTK_SCROLLED_WINDOW_HSCROLLBAR( void* arg0 )
+            { return (cast(GtkScrolledWindow*)arg0).hscrollbar; }
+    static GtkWidget* GTK_SCROLLED_WINDOW_VSCROLLBAR( void* arg0 )
+            { return (cast(GtkScrolledWindow*)arg0).vscrollbar; }
+
+    static int GTK_SCROLLED_WINDOW_SCROLLBAR_SPACING( void* arg0)
+    {
+        return   ((cast(GtkScrolledWindowClass*) ((cast(GTypeInstance*) arg0).g_class) ).scrollbar_spacing >= 0 ?
+                  (cast(GtkScrolledWindowClass*) ((cast(GTypeInstance*) arg0).g_class)).scrollbar_spacing : 3) ;
+    }
+
+    static int  GTK_WIDGET_HEIGHT( void* arg0 )
+         { return (cast(GtkWidget*)arg0).allocation.height; }
+    static void GTK_WIDGET_SET_HEIGHT( void* arg0, int arg1)
+         { (cast(GtkWidget*)arg0).allocation.height = arg1; }
+    static int  GTK_WIDGET_WIDTH( void* arg0)
+         { return (cast(GtkWidget*)arg0).allocation.width; }
+    static void GTK_WIDGET_SET_WIDTH( void* arg0, int arg1)
+         { (cast(GtkWidget*)arg0).allocation.width = arg1; }
+    static GdkWindow* GTK_WIDGET_WINDOW( void* arg0)
+         { return (cast(GtkWidget*)arg0).window; }
+    static int  GTK_WIDGET_X( void* arg0 )
+         { return (cast(GtkWidget*)arg0).allocation.x; }
+    static void GTK_WIDGET_SET_X( void* arg0, int arg1)
+         { (cast(GtkWidget*)arg0).allocation.x = arg1; }
+    static int  GTK_WIDGET_Y( void* arg0 )
+         { return (cast(GtkWidget*)arg0).allocation.y; }
+    static void GTK_WIDGET_SET_Y( void* arg0, int arg1)
+         { (cast(GtkWidget*)arg0).allocation.y = arg1; }
+    static int  GTK_WIDGET_REQUISITION_WIDTH( void* arg0 )
+         { return (cast(GtkWidget*)arg0).requisition.width;  }
+    static int  GTK_WIDGET_REQUISITION_HEIGHT( void* arg0 )
+         { return (cast(GtkWidget*)arg0).requisition.height; }
+
+    static GtkIMContext* GTK_ENTRY_IM_CONTEXT( void* arg0 )
+         { return (cast(GtkEntry*)arg0).im_context; }
+
+    static GtkIMContext* GTK_TEXTVIEW_IM_CONTEXT( void* arg0)
+         { return (cast(GtkTextView*)arg0).im_context; }
+
+    static GtkWidget* GTK_TOOLTIPS_TIP_WINDOW( void* arg0)
+         { return (cast(GtkTooltips*)arg0).tip_window; }
+    static void GTK_TOOLTIPS_SET_ACTIVE( void* arg0, void*  arg1 )
+         { (cast(GtkTooltips*)arg0).active_tips_data = cast(GtkTooltipsData*)arg1; }
+
+    static int  GDK_EVENT_TYPE( void* arg0 )
+         { return (cast(GdkEvent*)arg0).type; }
+    static GdkWindow* GDK_EVENT_WINDOW( void* arg0 )
+         { return (cast(GdkEventAny*)arg0).window; }
+    static int  X_EVENT_TYPE( void* arg0 )
+         { return (cast(XEvent*)arg0).type; }
+    //Window X_EVENT_WINDOW( XAnyEvent* arg0 )
+    //     { return arg0.window; }
+
+/+
+
+    //gtk_rc_style_get_bg_pixmap_name(arg0, arg1) (arg0)->bg_pixmap_name[arg1]
+    static char* gtk_rc_style_get_bg_pixmap_name( GtkRcStyle* arg0, int arg1 ) {
+        return arg0.bg_pixmap_name[arg1];
+    }
+    //gtk_rc_style_get_color_flags(arg0, arg1) (arg0)->color_flags[arg1]
+    static int gtk_rc_style_get_color_flags( GtkRcStyle* arg0, int arg1 ) {
+        return arg0.color_flags[arg1];
+    }
+    //gtk_rc_style_set_bg(arg0, arg1, arg2) if (arg2) (arg0)->bg[arg1] = *arg2
+    static void gtk_rc_style_set_bg( GtkRcStyle* arg0, int arg1, GdkColor* arg2 ) {
+        if (arg2) arg0.bg[arg1] = *arg2;
+    }
+    //gtk_rc_style_set_bg_pixmap_name(arg0, arg1, arg2) (arg0)->bg_pixmap_name[arg1] = (char *)arg2
+    static void gtk_rc_style_set_bg_pixmap_name( GtkRcStyle* arg0, int arg1, char* arg2 ) {
+        arg0.bg_pixmap_name[arg1] = arg2;
+    }
+
+    //gtk_rc_style_set_color_flags(arg0, arg1, arg2) (arg0)->color_flags[arg1] = arg2
+    static void gtk_rc_style_set_color_flags( GtkRcStyle* arg0, int arg1, int arg2 ) {
+        arg0.color_flags[arg1] = arg2;
+    }
+
+    //gtk_rc_style_set_fg(arg0, arg1, arg2) if (arg2) (arg0)->fg[arg1] = *arg2
+    static void gtk_rc_style_set_fg( GtkRcStyle* arg0, int arg1, GdkColor* arg2 ) {
+        if (arg2) arg0.fg[arg1] = *arg2;
+    }
+    //gtk_rc_style_set_text(arg0, arg1, arg2) if (arg2) (arg0)->text[arg1] = *arg2
+    static void gtk_rc_style_set_text( GtkRcStyle* arg0, int arg1, GdkColor* arg2 ) {
+        if (arg2) arg0.text[arg1] = *arg2;
+    }
+
+    //gtk_style_get_font_desc(arg0) (arg0)->font_desc
+    static PangoFontDescription* gtk_style_get_font_desc( GtkStyle* arg0 ) {
+        return cast( PangoFontDescription* ) arg0.font_desc;
+    }
+    //gtk_style_get_base(arg0, arg1, arg2) *arg2 = (arg0)->base[arg1]
+    static void gtk_style_get_base( GtkStyle* arg0, int arg1, GdkColor* arg2 ) {
+        *arg2 = arg0.base[arg1];
+    }
+    //gtk_style_get_bg(arg0, arg1, arg2) *arg2 = (arg0)->bg[arg1]
+    static void gtk_style_get_bg( GtkStyle* arg0, int arg1, GdkColor* arg2 ) {
+        *arg2 = arg0.bg[arg1];
+    }
+    //gtk_style_get_black(arg0, arg1) *arg1 = (arg0)->black
+    static void gtk_style_get_black( GtkStyle* arg0, GdkColor* arg1 ) {
+        *arg1 = arg0.black;
+    }
+    //gtk_style_get_dark(arg0, arg1, arg2) *arg2 = (arg0)->dark[arg1]
+    static void gtk_style_get_dark( GtkStyle* arg0, int arg1, GdkColor* arg2 ) {
+        *arg2 = arg0.dark[arg1];
+    }
+    //gtk_style_get_fg(arg0, arg1, arg2) *arg2 = (arg0)->fg[arg1]
+    static void gtk_style_get_fg( GtkStyle* arg0, int arg1, GdkColor* arg2 ) {
+        *arg2 = arg0.fg[arg1];
+    }
+    //gtk_style_get_light(arg0, arg1, arg2) *arg2 = (arg0)->light[arg1]
+    static void gtk_style_get_light( GtkStyle* arg0, int arg1, GdkColor* arg2 ) {
+        *arg2 = arg0.light[arg1];
+    }
+    //gtk_style_get_text(arg0, arg1, arg2) *arg2 = (arg0)->text[arg1]
+    static void gtk_style_get_text( GtkStyle* arg0, int arg1, GdkColor* arg2 ) {
+        *arg2 = arg0.text[arg1];
+    }
+
+    //gtk_style_get_xthickness(arg0) (arg0)->xthickness
+    static int gtk_style_get_xthickness( GtkStyle* arg0 ) {
+        return arg0.xthickness;
+    }
+    //gtk_style_get_ythickness(arg0) (arg0)->ythickness
+    static int gtk_style_get_ythickness( GtkStyle* arg0 ) {
+        return arg0.ythickness;
+    }
+    +/
+    /+
+    gtk_style_get_fg_gc(arg0, arg1, arg2) *arg2 = (arg0)->fg_gc[arg1]
+    gtk_style_get_bg_gc(arg0, arg1, arg2) *arg2 = (arg0)->bg_gc[arg1]
+    gtk_style_get_light_gc(arg0, arg1, arg2) *arg2 = (arg0)->light_gc[arg1]
+    gtk_style_get_dark_gc(arg0, arg1, arg2) *arg2 = (arg0)->dark_gc[arg1]
+    gtk_style_get_mid_gc(arg0, arg1, arg2) *arg2 = (arg0)->mid_gc[arg1]
+    gtk_style_get_text_gc(arg0, arg1, arg2) *arg2 = (arg0)->text_gc[arg1]
+    gtk_style_get_text_aa_gc(arg0, arg1, arg2) *arg2 = (arg0)->text_aa_gc[arg1]
+    gtk_style_get_black_gc(arg0, arg1) *arg1 = (arg0)->black_gc
+    gtk_style_get_white_gc(arg0, arg1) *arg1 = (arg0)->white_gc
+
+    localeconv_decimal_point() localeconv()->decimal_point
++/
+
+   /**************************************************************************
+
+        Utility methods -- conversions of gtk macros
+
+    **************************************************************************/
+    static gulong g_signal_connect( gpointer arg0, gchar* arg1, GCallback arg2, gpointer arg3 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return g_signal_connect_data (arg0, arg1, arg2, arg3, null , cast(GConnectFlags) 0) ;
+    }
+
+    static gulong g_signal_connect_after( gpointer arg0, gchar* arg1, GCallback arg2, gpointer arg3 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return g_signal_connect_data ( arg0, arg1, arg2, arg3, null, GConnectFlags.G_CONNECT_AFTER );
+    }
+
+    static GSList* g_slist_next( GSList* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return arg0 ? arg0.next : null;
+    }
+
+    static GList* g_list_next( GList* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return arg0 ? arg0.next : null;
+    }
+
+    static GList* g_list_previous( GList* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return arg0 ? arg0.prev : null;
+    }
+
+    static Display* GDK_DISPLAY()
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        // gdk_display needs to be a reference to the an external X11 global
+        // representing the current X11 display
+        return gdk_display;
+    }
+
+    static GdkWindow* GDK_ROOT_PARENT()
+    {
+        lock.lock();
+        scope(exit) lock.unlock;
+        return gdk_get_default_root_window();
+    }
+
+    static GType GDK_TYPE_COLOR()
+    {
+        lock.lock();
+        scope(exit) lock.unlock;
+        return gdk_color_get_type();
+    }
+
+    static GType GDK_TYPE_PIXBUF()
+    {
+        lock.lock();
+        scope(exit) lock.unlock;
+        return gdk_pixbuf_get_type();
+    }
+
+    static bool GTK_IS_BUTTON( void* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return  cast(bool)g_type_check_instance_is_a( cast(GTypeInstance*)arg0, gtk_button_get_type() );
+    }
+
+    static bool GTK_IS_WINDOW( void* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return cast(bool)g_type_check_instance_is_a( cast(GTypeInstance*)arg0, gtk_window_get_type());
+    }
+
+    static bool GTK_IS_CELL_RENDERER_PIXBUF( void* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return cast(bool)g_type_check_instance_is_a( cast(GTypeInstance*)arg0, gtk_cell_renderer_pixbuf_get_type());
+    }
+
+    static bool GTK_IS_CELL_RENDERER_TEXT( void* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return cast(bool)g_type_check_instance_is_a( cast(GTypeInstance*)arg0, gtk_cell_renderer_text_get_type());
+    }
+
+    static bool GTK_IS_CELL_RENDERER_TOGGLE( void* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return cast(bool)g_type_check_instance_is_a( cast(GTypeInstance*)arg0, gtk_cell_renderer_toggle_get_type ());
+    }
+
+    static bool GTK_IS_CONTAINER( void* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return cast(bool)g_type_check_instance_is_a( cast(GTypeInstance*)arg0, gtk_container_get_type () );
+    }
+
+
+    static bool GTK_IS_IMAGE_MENU_ITEM( void* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return cast(bool)g_type_check_instance_is_a( cast(GTypeInstance*)arg0, gtk_image_menu_item_get_type ());
+    }
+
+    static bool GTK_IS_MENU_ITEM( void* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return cast(bool)g_type_check_instance_is_a( cast(GTypeInstance*)arg0, gtk_menu_item_get_type ());
+    }
+
+    static bool GTK_IS_PLUG( void* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return cast(bool)g_type_check_instance_is_a( cast(GTypeInstance*)arg0, gtk_plug_get_type () );
+    }
+
+    // Should use d char[] instead for next two methods? - JJR
+    static char* GTK_STOCK_CANCEL()
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return "gtk-cancel";
+    }
+
+    static char* GTK_STOCK_OK()
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return "gtk-ok";
+    }
+
+    static GType GTK_TYPE_CELL_RENDERER_TEXT()
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return gtk_cell_renderer_text_get_type();
+    }
+
+    static GType GTK_TYPE_CELL_RENDERER_PIXBUF()
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return gtk_cell_renderer_pixbuf_get_type();
+    }
+
+    static GType GTK_TYPE_CELL_RENDERER_TOGGLE ()
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return gtk_cell_renderer_toggle_get_type();
+    }
+
+    static GType GTK_TYPE_FIXED()
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return gtk_fixed_get_type ();
+    }
+
+    static GType GTK_TYPE_MENU()
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return gtk_menu_get_type ();
+    }
+
+    static GType GTK_TYPE_WIDGET()
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return gtk_widget_get_type ();
+    }
+
+    static uint GTK_WIDGET_FLAGS( void* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return    (cast(GtkObject*) g_type_check_instance_cast (cast(GTypeInstance*) arg0,  gtk_object_get_type ())).flags ;
+    }
+
+    static ubyte GTK_WIDGET_STATE( void* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return (  cast(GtkWidget*) g_type_check_instance_cast (cast(GTypeInstance*)arg0, gtk_widget_get_type ())).state;
+    }
+
+    static bool GTK_WIDGET_HAS_DEFAULT( void* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return ( ( ( cast(GtkObject*) g_type_check_instance_cast (cast(GTypeInstance*)arg0, gtk_object_get_type () )).flags & GtkWidgetFlags.GTK_HAS_DEFAULT) != 0) ;
+    }
+
+    static bool GTK_WIDGET_HAS_FOCUS( void* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return ( ( ( cast(GtkObject*) g_type_check_instance_cast (cast(GTypeInstance*)arg0, gtk_object_get_type () )).flags & GtkWidgetFlags.GTK_HAS_FOCUS) != 0) ;
+    }
+
+    static bool GTK_WIDGET_IS_SENSITIVE( void* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return ( ( ( cast (GtkObject*) g_type_check_instance_cast ( cast(GTypeInstance*)arg0, gtk_object_get_type ()) ).flags & GtkWidgetFlags.GTK_SENSITIVE) != 0)   && ( ( ( cast(GtkObject*) g_type_check_instance_cast ( cast(GTypeInstance*)arg0, gtk_object_get_type ()) ).flags & GtkWidgetFlags.GTK_PARENT_SENSITIVE) != 0);
+    }
+
+    static bool GTK_WIDGET_MAPPED( void* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return ( ( ( cast(GtkObject*) g_type_check_instance_cast (cast(GTypeInstance*)arg0, gtk_object_get_type () )).flags & GtkWidgetFlags.GTK_MAPPED) != 0) ;
+    }
+
+    static bool GTK_WIDGET_SENSITIVE( void* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return ( ( ( cast(GtkObject*) g_type_check_instance_cast (cast(GTypeInstance*)arg0, gtk_object_get_type () )).flags & GTK_SENSITIVE) != 0) ;
+    }
+
+    static void GTK_WIDGET_SET_FLAGS( void* arg0, uint arg1 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        (cast(GtkObject*) g_type_check_instance_cast ( cast(GTypeInstance*)arg0,  gtk_object_get_type () ) ).flags |= arg1;
+    }
+
+    static void GTK_WIDGET_UNSET_FLAGS( void* arg0, uint arg1 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        (cast(GtkObject*) g_type_check_instance_cast ( cast(GTypeInstance*)arg0,  gtk_object_get_type () ) ).flags &= ~arg1;
+    }
+
+    static bool GTK_WIDGET_VISIBLE( void* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return ( ( ( cast(GtkObject*) g_type_check_instance_cast (cast(GTypeInstance*)arg0, gtk_object_get_type () )).flags & GTK_VISIBLE) != 0) ;
+    }
+
+    static GObjectClass* G_OBJECT_CLASS( void* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return (cast(GObjectClass*) g_type_check_class_cast ( cast(GTypeClass*)arg0, cast(GType) (20 << 2) ) ) ;
+    }
+
+    static GObjectClass* G_OBJECT_GET_CLASS( void* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return (cast(GObjectClass*) (cast(GTypeInstance*)arg0).g_class) ;
+    }
+
+    static gchar* G_OBJECT_TYPE_NAME( void* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return g_type_name( (cast(GTypeClass*) (cast(GTypeInstance*)arg0).g_class).g_type ) ;
+    }
+
+    static GType G_TYPE_BOOLEAN()
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return  (cast(GType) (5 << 2)) ;
+    }
+
+    static GType G_TYPE_INT()
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return (cast(GType) (6 << 2));
+    }
+
+    static GType G_OBJECT_TYPE( GTypeInstance* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return (cast(GTypeClass*) arg0.g_class).g_type;
+    }
+
+    static GType G_TYPE_STRING()
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return (cast(GType) (16 << 2));
+    }
+
+
+    static int PANGO_PIXELS( int arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return ((arg0 + 512) >> 10);
+    }
+
+    static GType PANGO_TYPE_FONT_DESCRIPTION()
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return pango_font_description_get_type () ;
+    }
+
+    /**************************************************************************
+
+        Utility methods -- conversions of SWT macros
+
+    **************************************************************************/
+
+    static gpointer g_list_data( GList* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return arg0.data;
+    }
+
+    static gpointer g_slist_data( GSList* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return arg0.data;
+    }
+
+    static void g_list_set_next( GList* arg0, GList* arg1 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        arg0.next = arg1;
+    }
+
+    static void g_list_set_previous( GList* arg0, GList* arg1 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        arg0.prev = arg1;
+    }
+
+    static char* gtk_rc_style_get_bg_pixmap_name( GtkRcStyle* arg0, int arg1 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return arg0.bg_pixmap_name[arg1];
+    }
+
+    static int  gtk_rc_style_get_color_flags( GtkRcStyle* arg0, int arg1)
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return arg0.color_flags[arg1];
+    }
+
+    static void gtk_rc_style_set_bg( GtkRcStyle* arg0, int arg1, GdkColor* arg2)
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        if (arg2 !is null) {
+            arg0.bg[arg1] = *arg2;
+        }
+    }
+
+    static void gtk_rc_style_set_bg_pixmap_name( GtkRcStyle* arg0, int arg1, char* arg2)
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        arg0.bg_pixmap_name[arg1] = arg2;
+    }
+
+    static void gtk_rc_style_set_color_flags( GtkRcStyle* arg0, int arg1, int arg2)
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        arg0.color_flags[arg1] = arg2;
+    }
+
+    static void gtk_rc_style_set_fg( GtkRcStyle* arg0, int arg1, GdkColor* arg2)
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        if (arg2 !is null ) {
+            arg0.fg[arg1] = *arg2;
+        }
+    }
+
+    static void gtk_rc_style_set_text( GtkRcStyle* arg0, int arg1, GdkColor* arg2)
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        if (arg2 !is null) {
+            arg0.text[arg1] = *arg2;
+        }
+    }
+
+    static void* gtk_style_get_font_desc( GtkStyle* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return arg0.font_desc;
+    }
+
+    static void gtk_style_get_base( GtkStyle* arg0, int arg1, GdkColor* arg2 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        *arg2 = arg0.base[arg1];
+    }
+
+    static void gtk_style_get_bg( GtkStyle* arg0, int arg1, GdkColor* arg2 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        *arg2 = arg0.bg[arg1];
+    }
+
+    static void gtk_style_get_black( GtkStyle* arg0, GdkColor* arg1 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        *arg1 = arg0.black;
+    }
+
+    static void gtk_style_get_dark( GtkStyle* arg0, int arg1, GdkColor* arg2 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        *arg2 = arg0.dark[arg1];
+    }
+
+    static void gtk_style_get_fg( GtkStyle* arg0, int arg1, GdkColor* arg2 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        *arg2 = arg0.fg[arg1];
+    }
+
+    static void gtk_style_get_light( GtkStyle* arg0, int arg1, GdkColor* arg2)
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        *arg2 = arg0.light[arg1];
+    }
+
+    static void gtk_style_get_text( GtkStyle* arg0, int arg1, GdkColor* arg2)
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        *arg2 = arg0.text[arg1];
+    }
+
+    static int  gtk_style_get_xthickness( GtkStyle* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return arg0.xthickness;
+    }
+
+    static int gtk_style_get_ythickness( GtkStyle* arg0 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return arg0.ythickness;
+    }
+
+    static void gtk_style_get_fg_gc( GtkStyle* arg0, int arg1, GdkGC** arg2 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        *arg2 = arg0.fg_gc[arg1];
+    }
+
+    static void gtk_style_get_bg_gc( GtkStyle* arg0, int arg1, GdkGC** arg2 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        *arg2 = arg0.bg_gc[arg1];
+    }
+
+    static void gtk_style_get_light_gc( GtkStyle* arg0, int arg1, GdkGC** arg2 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        *arg2 = arg0.light_gc[arg1];
+    }
+
+    static void gtk_style_get_dark_gc( GtkStyle* arg0, int arg1, GdkGC** arg2 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        *arg2 = arg0.dark_gc[arg1];
+    }
+
+    static void gtk_style_get_mid_gc( GtkStyle* arg0, int arg1, GdkGC** arg2 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        *arg2 = arg0.mid_gc[arg1];
+    }
+
+    static void gtk_style_get_text_gc( GtkStyle* arg0, int arg1, GdkGC** arg2 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        *arg2 = arg0.text_gc[arg1];
+    }
+
+    static void gtk_style_get_text_aa_gc( GtkStyle* arg0, int arg1, GdkGC** arg2 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        *arg2 = arg0.text_aa_gc[arg1];
+    }
+
+    static void gtk_style_get_black_gc( GtkStyle* arg0, GdkGC** arg1 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        *arg1 = arg0.black_gc;
+    }
+
+    static void gtk_style_get_white_gc( GtkStyle* arg0, GdkGC** arg1 )
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        *arg1 = arg0.white_gc;
+    }
+
+    static int strlen( char* ptr ){
+        return tango.stdc.string.strlen( ptr );
+    }
+    //localeconv_decimal_point() localeconv()->decimal_point
+}
+
+
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/FileFormat.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,147 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.FileFormat;
+
+import java.lang.all;
+
+public import org.eclipse.swt.graphics.ImageLoader;
+public import org.eclipse.swt.graphics.ImageData;
+public import org.eclipse.swt.internal.image.LEDataInputStream;
+public import org.eclipse.swt.internal.image.LEDataOutputStream;
+
+import org.eclipse.swt.SWT;
+
+public import java.io.InputStream;
+public import java.io.OutputStream;
+
+import org.eclipse.swt.internal.image.GIFFileFormat;
+import org.eclipse.swt.internal.image.WinBMPFileFormat;
+import org.eclipse.swt.internal.image.WinICOFileFormat;
+import org.eclipse.swt.internal.image.TIFFFileFormat;
+import org.eclipse.swt.internal.image.OS2BMPFileFormat;
+import org.eclipse.swt.internal.image.JPEGFileFormat;
+import org.eclipse.swt.internal.image.PNGFileFormat;
+
+import tango.core.Exception;
+import tango.core.Tuple;
+
+/**
+ * Abstract factory class for loading/unloading images from files or streams
+ * in various image file formats.
+ *
+ */
+public abstract class FileFormat {
+    static const String FORMAT_PACKAGE = "org.eclipse.swt.internal.image"; //$NON-NLS-1$
+    static const String FORMAT_SUFFIX = "FileFormat"; //$NON-NLS-1$
+    static const String[] FORMATS = [ "WinBMP"[], "WinBMP", "GIF", "WinICO", "JPEG", "PNG", "TIFF", "OS2BMP" ]; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$//$NON-NLS-5$ //$NON-NLS-6$//$NON-NLS-7$//$NON-NLS-8$
+    alias Tuple!( WinBMPFileFormat, WinBMPFileFormat, GIFFileFormat, WinICOFileFormat, JPEGFileFormat, PNGFileFormat, TIFFFileFormat, OS2BMPFileFormat ) TFormats;
+    LEDataInputStream inputStream;
+    LEDataOutputStream outputStream;
+    ImageLoader loader;
+    int compression;
+
+/**
+ * Return whether or not the specified input stream
+ * represents a supported file format.
+ */
+abstract bool isFileFormat(LEDataInputStream stream);
+
+abstract ImageData[] loadFromByteStream();
+
+/**
+ * Read the specified input stream, and return the
+ * device independent image array represented by the stream.
+ */
+public ImageData[] loadFromStream(LEDataInputStream stream) {
+    try {
+        inputStream = stream;
+        return loadFromByteStream();
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+        return null;
+    } catch (Exception e) {
+        SWT.error(SWT.ERROR_INVALID_IMAGE, e);
+        return null;
+    }
+}
+
+/**
+ * Read the specified input stream using the specified loader, and
+ * return the device independent image array represented by the stream.
+ */
+public static ImageData[] load(InputStream istr, ImageLoader loader) {
+    FileFormat fileFormat = null;
+    LEDataInputStream stream = new LEDataInputStream(istr);
+    bool isSupported = false;    
+    foreach( TFormat; TFormats ){
+        try{
+            fileFormat = new TFormat();
+            if (fileFormat.isFileFormat(stream)) {
+                isSupported = true;
+                break;
+            }
+        } catch (Exception e) {
+        }
+    }
+    if (!isSupported) SWT.error(SWT.ERROR_UNSUPPORTED_FORMAT);
+    fileFormat.loader = loader;
+    return fileFormat.loadFromStream(stream);
+}
+
+/**
+ * Write the device independent image array stored in the specified loader
+ * to the specified output stream using the specified file format.
+ */
+public static void save(OutputStream os, int format, ImageLoader loader) {
+    if (format < 0 || format >= FORMATS.length) SWT.error(SWT.ERROR_UNSUPPORTED_FORMAT);
+    if (FORMATS[format] is null) SWT.error(SWT.ERROR_UNSUPPORTED_FORMAT);
+    if (loader.data is null || loader.data.length < 1) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+
+    LEDataOutputStream stream = new LEDataOutputStream(os);
+    FileFormat fileFormat = null;
+    try {
+        foreach( idx, TFormat; TFormats ){
+            if( idx is format ){
+                fileFormat = new TFormat();
+            }
+        }
+    } catch (Exception e) {
+        SWT.error(SWT.ERROR_UNSUPPORTED_FORMAT);
+    }
+    if (format is SWT.IMAGE_BMP_RLE) {
+        switch (loader.data[0].depth) {
+            case 8: fileFormat.compression = 1; break;
+            case 4: fileFormat.compression = 2; break;
+            default:
+        }
+    }
+    fileFormat.unloadIntoStream(loader, stream);
+}
+
+abstract void unloadIntoByteStream(ImageLoader loader);
+
+/**
+ * Write the device independent image array stored in the specified loader
+ * to the specified output stream.
+ */
+public void unloadIntoStream(ImageLoader loader, LEDataOutputStream stream) {
+    try {
+        outputStream = stream;
+        unloadIntoByteStream(loader);
+        outputStream.flush();
+    } catch (Exception e) {
+        try {outputStream.flush();} catch (Exception f) {}
+        SWT.error(SWT.ERROR_IO, e);
+    }
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/GIFFileFormat.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,632 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.GIFFileFormat;
+
+public import org.eclipse.swt.internal.image.FileFormat;
+public import org.eclipse.swt.graphics.PaletteData;
+import org.eclipse.swt.internal.image.LEDataInputStream;
+import org.eclipse.swt.internal.image.LZWCodec;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.ImageLoaderEvent;
+import org.eclipse.swt.graphics.ImageLoader;
+import tango.core.Exception;
+import java.lang.all;
+
+
+final class GIFFileFormat : FileFormat {
+    String signature;
+    int screenWidth, screenHeight, backgroundPixel, bitsPerPixel, defaultDepth;
+    int disposalMethod = 0;
+    int delayTime = 0;
+    int transparentPixel = -1;
+    int repeatCount = 1;
+
+    static final int GIF_APPLICATION_EXTENSION_BLOCK_ID = 0xFF;
+    static final int GIF_GRAPHICS_CONTROL_BLOCK_ID = 0xF9;
+    static final int GIF_PLAIN_TEXT_BLOCK_ID = 0x01;
+    static final int GIF_COMMENT_BLOCK_ID = 0xFE;
+    static final int GIF_EXTENSION_BLOCK_ID = 0x21;
+    static final int GIF_IMAGE_BLOCK_ID = 0x2C;
+    static final int GIF_TRAILER_ID = 0x3B;
+    static final byte[] GIF89a = cast(byte[])"GIF89a";
+    static final byte[] NETSCAPE2_0 = cast(byte[])"NETSCAPE2.0";
+
+    /**
+     * Answer a palette containing numGrays
+     * shades of gray, ranging from black to white.
+     */
+    static PaletteData grayRamp(int numGrays) {
+        int n = numGrays - 1;
+        RGB[] colors = new RGB[numGrays];
+        for (int i = 0; i < numGrays; i++) {
+            int intensity = cast(byte)((i * 3) * 256 / n);
+            colors[i] = new RGB(intensity, intensity, intensity);
+        }
+        return new PaletteData(colors);
+    }
+
+    override bool isFileFormat(LEDataInputStream stream) {
+        try {
+            byte[3] signature;
+            stream.read(signature);
+            stream.unread(signature);
+            return signature[0] is 'G' && signature[1] is 'I' && signature[2] is 'F';
+        } catch (Exception e) {
+            return false;
+        }
+    }
+
+    /**
+     * Load the GIF image(s) stored in the input stream.
+     * Return an array of ImageData representing the image(s).
+     */
+    override ImageData[] loadFromByteStream() {
+        byte[3] signature;
+        byte[3] versionBytes;
+        byte[7] block;
+        try {
+            inputStream.read(signature);
+            if (!(signature[0] is 'G' && signature[1] is 'I' && signature[2] is 'F'))
+                SWT.error(SWT.ERROR_INVALID_IMAGE);
+
+            inputStream.read(versionBytes);
+
+            inputStream.read(block);
+        } catch (IOException e) {
+            SWT.error(SWT.ERROR_IO, e);
+        }
+        screenWidth = (block[0] & 0xFF) | ((block[1] & 0xFF) << 8);
+        loader.logicalScreenWidth = screenWidth;
+        screenHeight = (block[2] & 0xFF) | ((block[3] & 0xFF) << 8);
+        loader.logicalScreenHeight = screenHeight;
+        byte bitField = block[4];
+        backgroundPixel = block[5] & 0xFF;
+        //aspect = block[6] & 0xFF;
+        bitsPerPixel = ((bitField >> 4) & 0x07) + 1;
+        defaultDepth = (bitField & 0x7) + 1;
+        PaletteData palette = null;
+        if ((bitField & 0x80) !is 0) {
+            // Global palette.
+            //sorted = (bitField & 0x8) !is 0;
+            palette = readPalette(1 << defaultDepth);
+        } else {
+            // No global palette.
+            //sorted = false;
+            backgroundPixel = -1;
+            defaultDepth = bitsPerPixel;
+        }
+        loader.backgroundPixel = backgroundPixel;
+
+        getExtensions();
+        int id = readID();
+        ImageData[] images = new ImageData[0];
+        while (id is GIF_IMAGE_BLOCK_ID) {
+            ImageData image = readImageBlock(palette);
+            if (loader.hasListeners()) {
+                loader.notifyListeners(new ImageLoaderEvent(loader, image, 3, true));
+            }
+            ImageData[] oldImages = images;
+            images = new ImageData[oldImages.length + 1];
+            System.arraycopy(oldImages, 0, images, 0, oldImages.length);
+            images[images.length - 1] = image;
+            //images ~= image;
+            try {
+                /* Read the 0-byte terminator at the end of the image. */
+                id = inputStream.read();
+                if (id > 0) {
+                    /* We read the terminator earlier. */
+                    byte[1] arr;
+                    arr[0] = id;
+                    inputStream.unread( arr );
+                }
+            } catch (IOException e) {
+                SWT.error(SWT.ERROR_IO, e);
+            }
+            getExtensions();
+            id = readID();
+        }
+        return images;
+    }
+
+    /**
+     * Read and return the next block or extension identifier from the file.
+     */
+    int readID() {
+        try {
+            return inputStream.read();
+        } catch (IOException e) {
+            SWT.error(SWT.ERROR_IO, e);
+        }
+        return -1;
+    }
+
+    /**
+     * Read extensions until an image descriptor appears.
+     * In the future, if we care about the extensions, they
+     * should be properly grouped with the image data before
+     * which they appeared. Right now, the interesting parts
+     * of some extensions are kept, but the rest is discarded.
+     * Throw an error if an error occurs.
+     */
+    void getExtensions() {
+        int id = readID();
+        while (id !is GIF_IMAGE_BLOCK_ID && id !is GIF_TRAILER_ID && id > 0) {
+            if (id is GIF_EXTENSION_BLOCK_ID) {
+                readExtension();
+            } else {
+                SWT.error(SWT.ERROR_INVALID_IMAGE);
+            }
+            id = readID();
+        }
+        if (id is GIF_IMAGE_BLOCK_ID || id is GIF_TRAILER_ID) {
+            try {
+                byte[1] arr;
+                arr[0] = id;
+                inputStream.unread(arr);
+            } catch (IOException e) {
+                SWT.error(SWT.ERROR_IO, e);
+            }
+        }
+    }
+
+    /**
+     * Read a control extension.
+     * Return the extension block data.
+     */
+    byte[] readExtension() {
+        int extensionID = readID();
+        if (extensionID is GIF_COMMENT_BLOCK_ID)
+            return readCommentExtension();
+        if (extensionID is GIF_PLAIN_TEXT_BLOCK_ID)
+            return readPlainTextExtension();
+        if (extensionID is GIF_GRAPHICS_CONTROL_BLOCK_ID)
+            return readGraphicsControlExtension();
+        if (extensionID is GIF_APPLICATION_EXTENSION_BLOCK_ID)
+            return readApplicationExtension();
+        // Otherwise, we don't recognize the block. If the
+        // field size is correct, we can just skip over
+        // the block contents.
+        try {
+            int extSize = inputStream.read();
+            if (extSize < 0) {
+                SWT.error(SWT.ERROR_INVALID_IMAGE);
+            }
+            byte[] ext = new byte[extSize];
+            inputStream.read(ext, 0, extSize);
+            return ext;
+        } catch (IOException e) {
+            SWT.error(SWT.ERROR_IO, e);
+            return null;
+        }
+    }
+
+    /**
+     * We have just read the Comment extension identifier
+     * from the input stream. Read in the rest of the comment
+     * and return it. GIF comment blocks are variable size.
+     */
+    byte[] readCommentExtension() {
+        try {
+            byte[] comment = new byte[0];
+            byte[] block = new byte[255];
+            int size = inputStream.read();
+            while ((size > 0) && (inputStream.read(block, 0, size) !is -1)) {
+                byte[] oldComment = comment;
+                comment = new byte[oldComment.length + size];
+                System.arraycopy(oldComment, 0, comment, 0, oldComment.length);
+                System.arraycopy(block, 0, comment, oldComment.length, size);
+                //comment ~= block[ 0 .. size ];
+                size = inputStream.read();
+            }
+            return comment;
+        } catch (Exception e) {
+            SWT.error(SWT.ERROR_IO, e);
+            return null;
+        }
+    }
+
+    /**
+     * We have just read the PlainText extension identifier
+     * from the input stream. Read in the plain text info and text,
+     * and return the text. GIF plain text blocks are variable size.
+     */
+    byte[] readPlainTextExtension() {
+        try {
+            // Read size of block = 0x0C.
+            inputStream.read();
+            // Read the text information (x, y, width, height, colors).
+            byte[] info = new byte[12];
+            inputStream.read(info);
+            // Read the text.
+            byte[] text = new byte[0];
+            byte[] block = new byte[255];
+            int size = inputStream.read();
+            while ((size > 0) && (inputStream.read(block, 0, size) !is -1)) {
+                byte[] oldText = text;
+                text = new byte[oldText.length + size];
+                System.arraycopy(oldText, 0, text, 0, oldText.length);
+                System.arraycopy(block, 0, text, oldText.length, size);
+                //text ~= block[ 0 .. size ];
+                size = inputStream.read();
+            }
+            return text;
+        } catch (Exception e) {
+            SWT.error(SWT.ERROR_IO, e);
+            return null;
+        }
+    }
+
+    /**
+     * We have just read the GraphicsControl extension identifier
+     * from the input stream. Read in the control information, store
+     * it, and return it.
+     */
+    byte[] readGraphicsControlExtension() {
+        try {
+            // Read size of block = 0x04.
+            inputStream.read();
+            // Read the control block.
+            byte[] controlBlock = new byte[4];
+            inputStream.read(controlBlock);
+            byte bitField = controlBlock[0];
+            // Store the user input field.
+            //userInput = (bitField & 0x02) !is 0;
+            // Store the disposal method.
+            disposalMethod = (bitField >> 2) & 0x07;
+            // Store the delay time.
+            delayTime = (controlBlock[1] & 0xFF) | ((controlBlock[2] & 0xFF) << 8);
+            // Store the transparent color.
+            if ((bitField & 0x01) !is 0) {
+                transparentPixel = controlBlock[3] & 0xFF;
+            } else {
+                transparentPixel = -1;
+            }
+            // Read block terminator.
+            inputStream.read();
+            return controlBlock;
+        } catch (Exception e) {
+            SWT.error(SWT.ERROR_IO, e);
+            return null;
+        }
+    }
+
+    /**
+     * We have just read the Application extension identifier
+     * from the input stream.  Read in the rest of the extension,
+     * look for and store 'number of repeats', and return the data.
+     */
+    byte[] readApplicationExtension() {
+        try {
+            // Read size of block = 0x0B.
+            inputStream.read();
+            // Read application identifier.
+            byte[] application = new byte[8];
+            inputStream.read(application);
+            // Read authentication code.
+            byte[] authentication = new byte[3];
+            inputStream.read(authentication);
+            // Read application data.
+            byte[] data = new byte[0];
+            byte[] block = new byte[255];
+            int size = inputStream.read();
+            while ((size > 0) && (inputStream.read(block, 0, size) !is -1)) {
+                byte[] oldData = data;
+                data = new byte[oldData.length + size];
+                System.arraycopy(oldData, 0, data, 0, oldData.length);
+                System.arraycopy(block, 0, data, oldData.length, size);
+                //data ~= block[ 0 .. size ];
+                size = inputStream.read();
+            }
+            // Look for the NETSCAPE 'repeat count' field for an animated GIF.
+            bool netscape =
+                application[0] is 'N' &&
+                application[1] is 'E' &&
+                application[2] is 'T' &&
+                application[3] is 'S' &&
+                application[4] is 'C' &&
+                application[5] is 'A' &&
+                application[6] is 'P' &&
+                application[7] is 'E';
+            bool authentic =
+                authentication[0] is '2' &&
+                authentication[1] is '.' &&
+                authentication[2] is '0';
+            if (netscape && authentic && data[0] is 01) { //$NON-NLS-1$ //$NON-NLS-2$
+                repeatCount = (data[1] & 0xFF) | ((data[2] & 0xFF) << 8);
+                loader.repeatCount = repeatCount;
+            }
+            return data;
+        } catch (Exception e) {
+            SWT.error(SWT.ERROR_IO, e);
+            return null;
+        }
+    }
+
+    /**
+     * Return a DeviceIndependentImage representing the
+     * image block at the current position in the input stream.
+     * Throw an error if an error occurs.
+     */
+    ImageData readImageBlock(PaletteData defaultPalette) {
+        int depth;
+        PaletteData palette;
+        byte[] block = new byte[9];
+        try {
+            inputStream.read(block);
+        } catch (IOException e) {
+            SWT.error(SWT.ERROR_IO, e);
+        }
+        int left = (block[0] & 0xFF) | ((block[1] & 0xFF) << 8);
+        int top = (block[2] & 0xFF) | ((block[3] & 0xFF) << 8);
+        int width = (block[4] & 0xFF) | ((block[5] & 0xFF) << 8);
+        int height = (block[6] & 0xFF) | ((block[7] & 0xFF) << 8);
+        byte bitField = block[8];
+        bool interlaced = (bitField & 0x40) !is 0;
+        //bool sorted = (bitField & 0x20) !is 0;
+        if ((bitField & 0x80) !is 0) {
+            // Local palette.
+            depth = (bitField & 0x7) + 1;
+            palette = readPalette(1 << depth);
+        } else {
+            // No local palette.
+            depth = defaultDepth;
+            palette = defaultPalette;
+        }
+        /* Work around: Ignore the case where a GIF specifies an
+         * invalid index for the transparent pixel that is larger
+         * than the number of entries in the palette. */
+        if (transparentPixel > 1 << depth) {
+            transparentPixel = -1;
+        }
+        // Promote depth to next highest supported value.
+        if (!(depth is 1 || depth is 4 || depth is 8)) {
+            if (depth < 4)
+                depth = 4;
+            else
+                depth = 8;
+        }
+        if (palette is null) {
+            palette = grayRamp(1 << depth);
+        }
+        int initialCodeSize = -1;
+        try {
+            initialCodeSize = inputStream.read();
+        } catch (IOException e) {
+            SWT.error(SWT.ERROR_IO, e);
+        }
+        if (initialCodeSize < 0) {
+            SWT.error(SWT.ERROR_INVALID_IMAGE);
+        }
+        ImageData image = ImageData.internal_new(
+            width,
+            height,
+            depth,
+            palette,
+            4,
+            null,
+            0,
+            null,
+            null,
+            -1,
+            transparentPixel,
+            SWT.IMAGE_GIF,
+            left,
+            top,
+            disposalMethod,
+            delayTime);
+        LZWCodec codec = new LZWCodec();
+        codec.decode(inputStream, loader, image, interlaced, initialCodeSize);
+        return image;
+    }
+
+    /**
+     * Read a palette from the input stream.
+     */
+    PaletteData readPalette(int numColors) {
+        byte[] bytes = new byte[numColors * 3];
+        try {
+            if (inputStream.read(bytes) !is bytes.length)
+                SWT.error(SWT.ERROR_INVALID_IMAGE);
+        } catch (IOException e) {
+            SWT.error(SWT.ERROR_IO, e);
+        }
+        RGB[] colors = new RGB[numColors];
+        for (int i = 0; i < numColors; i++)
+            colors[i] = new RGB(bytes[i*3] & 0xFF,
+                bytes[i*3+1] & 0xFF, bytes[i*3+2] & 0xFF);
+        return new PaletteData(colors);
+    }
+
+    override void unloadIntoByteStream(ImageLoader loader) {
+
+        /* Step 1: Acquire GIF parameters. */
+        ImageData[] data = loader.data;
+        int frameCount = data.length;
+        bool multi = frameCount > 1;
+        ImageData firstImage = data[0];
+        int logicalScreenWidth = multi ? loader.logicalScreenWidth : firstImage.width;
+        int logicalScreenHeight = multi ? loader.logicalScreenHeight : firstImage.height;
+        int backgroundPixel = loader.backgroundPixel;
+        int depth = firstImage.depth;
+        PaletteData palette = firstImage.palette;
+        RGB[] colors = palette.getRGBs();
+        short globalTable = 1;
+
+        /* Step 2: Check for validity and global/local color map. */
+        if (!(depth is 1 || depth is 4 || depth is 8)) {
+            SWT.error(SWT.ERROR_UNSUPPORTED_DEPTH);
+        }
+        for (int i=0; i<frameCount; i++) {
+            if (data[i].palette.isDirect) {
+                SWT.error(SWT.ERROR_INVALID_IMAGE);
+            }
+            if (multi) {
+                if (!(data[i].height <= logicalScreenHeight && data[i].width <= logicalScreenWidth && data[i].depth is depth)) {
+                    SWT.error(SWT.ERROR_INVALID_IMAGE);
+                }
+                if (globalTable is 1) {
+                    RGB rgbs[] = data[i].palette.getRGBs();
+                    if (rgbs.length !is colors.length) {
+                        globalTable = 0;
+                    } else {
+                        for (int j=0; j<colors.length; j++) {
+                            if (!(rgbs[j].red is colors[j].red &&
+                                rgbs[j].green is colors[j].green &&
+                                rgbs[j].blue is colors[j].blue))
+                                    globalTable = 0;
+                        }
+                    }
+                }
+            }
+        }
+
+        try {
+            /* Step 3: Write the GIF89a Header and Logical Screen Descriptor. */
+            outputStream.write(GIF89a);
+            int bitField = globalTable*128 + (depth-1)*16 + depth-1;
+            outputStream.writeShort(cast(short)logicalScreenWidth);
+            outputStream.writeShort(cast(short)logicalScreenHeight);
+            outputStream.write(bitField);
+            outputStream.write(backgroundPixel);
+            outputStream.write(0); // Aspect ratio is 1:1
+        } catch (IOException e) {
+            SWT.error(SWT.ERROR_IO, e);
+        }
+
+        /* Step 4: Write Global Color Table if applicable. */
+        if (globalTable is 1) {
+            writePalette(palette, depth);
+        }
+
+        /* Step 5: Write Application Extension if applicable. */
+        if (multi) {
+            int repeatCount = loader.repeatCount;
+            try {
+                outputStream.write(GIF_EXTENSION_BLOCK_ID);
+                outputStream.write(GIF_APPLICATION_EXTENSION_BLOCK_ID);
+                outputStream.write(NETSCAPE2_0.length);
+                outputStream.write(NETSCAPE2_0);
+                outputStream.write(3); // Three bytes follow
+                outputStream.write(1); // Extension type
+                outputStream.writeShort(cast(short) repeatCount);
+                outputStream.write(0); // Block terminator
+            } catch (IOException e) {
+                SWT.error(SWT.ERROR_IO, e);
+            }
+        }
+
+        for (int frame=0; frame<frameCount; frame++) {
+
+            /* Step 6: Write Graphics Control Block for each frame if applicable. */
+            if (multi || data[frame].transparentPixel !is -1) {
+                writeGraphicsControlBlock(data[frame]);
+            }
+
+            /* Step 7: Write Image Header for each frame. */
+            int x = data[frame].x;
+            int y = data[frame].y;
+            int width = data[frame].width;
+            int height = data[frame].height;
+            try {
+                outputStream.write(GIF_IMAGE_BLOCK_ID);
+                byte[] block = new byte[9];
+                block[0] = cast(byte)(x & 0xFF);
+                block[1] = cast(byte)((x >> 8) & 0xFF);
+                block[2] = cast(byte)(y & 0xFF);
+                block[3] = cast(byte)((y >> 8) & 0xFF);
+                block[4] = cast(byte)(width & 0xFF);
+                block[5] = cast(byte)((width >> 8) & 0xFF);
+                block[6] = cast(byte)(height & 0xFF);
+                block[7] = cast(byte)((height >> 8) & 0xFF);
+                block[8] = cast(byte)(globalTable is 0 ? (depth-1) | 0x80 : 0x00);
+                outputStream.write(block);
+            } catch (IOException e) {
+                SWT.error(SWT.ERROR_IO, e);
+            }
+
+            /* Step 8: Write Local Color Table for each frame if applicable. */
+            if (globalTable is 0) {
+                writePalette(data[frame].palette, depth);
+            }
+
+            /* Step 9: Write the actual data for each frame. */
+            try {
+                outputStream.write(depth); // Minimum LZW Code size
+            } catch (IOException e) {
+                SWT.error(SWT.ERROR_IO, e);
+            }
+            (new LZWCodec()).encode(outputStream, data[frame]);
+        }
+
+        /* Step 10: Write GIF terminator. */
+        try {
+            outputStream.write(0x3B);
+        } catch (IOException e) {
+            SWT.error(SWT.ERROR_IO, e);
+        }
+    }
+
+    /**
+     * Write out a GraphicsControlBlock to describe
+     * the specified device independent image.
+     */
+    void writeGraphicsControlBlock(ImageData image) {
+        try {
+            outputStream.write(GIF_EXTENSION_BLOCK_ID);
+            outputStream.write(GIF_GRAPHICS_CONTROL_BLOCK_ID);
+            byte[] gcBlock = new byte[4];
+            gcBlock[0] = 0;
+            gcBlock[1] = 0;
+            gcBlock[2] = 0;
+            gcBlock[3] = 0;
+            if (image.transparentPixel !is -1) {
+                gcBlock[0] = cast(byte)0x01;
+                gcBlock[3] = cast(byte)image.transparentPixel;
+            }
+            if (image.disposalMethod !is 0) {
+                gcBlock[0] |= cast(byte)((image.disposalMethod & 0x07) << 2);
+            }
+            if (image.delayTime !is 0) {
+                gcBlock[1] = cast(byte)(image.delayTime & 0xFF);
+                gcBlock[2] = cast(byte)((image.delayTime >> 8) & 0xFF);
+            }
+            outputStream.write(cast(byte)gcBlock.length);
+            outputStream.write(gcBlock);
+            outputStream.write(0); // Block terminator
+        } catch (IOException e) {
+            SWT.error(SWT.ERROR_IO, e);
+        }
+    }
+
+    /**
+     * Write the specified palette to the output stream.
+     */
+    void writePalette(PaletteData palette, int depth) {
+        byte[] bytes = new byte[(1 << depth) * 3];
+        int offset = 0;
+        for (int i = 0; i < palette.colors.length; i++) {
+            RGB color = palette.colors[i];
+            bytes[offset] = cast(byte)color.red;
+            bytes[offset + 1] = cast(byte)color.green;
+            bytes[offset + 2] = cast(byte)color.blue;
+            offset += 3;
+        }
+        try {
+            outputStream.write(bytes);
+        } catch (IOException e) {
+            SWT.error(SWT.ERROR_IO, e);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGAppn.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.JPEGAppn;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.image.JPEGVariableSizeSegment;
+import org.eclipse.swt.internal.image.JPEGFileFormat;
+import org.eclipse.swt.internal.image.LEDataInputStream;
+
+final class JPEGAppn : JPEGVariableSizeSegment {
+
+    public this(byte[] reference) {
+        super(reference);
+    }
+
+    public this(LEDataInputStream byteStream) {
+        super(byteStream);
+    }
+
+    public override bool verify() {
+        int marker = getSegmentMarker();
+        return marker >= JPEGFileFormat.APP0 && marker <= JPEGFileFormat.APP15;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGArithmeticConditioningTable.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.JPEGArithmeticConditioningTable;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.image.JPEGVariableSizeSegment;
+import org.eclipse.swt.internal.image.JPEGFileFormat;
+import org.eclipse.swt.internal.image.LEDataInputStream;
+
+final class JPEGArithmeticConditioningTable : JPEGVariableSizeSegment {
+
+    public this(LEDataInputStream byteStream) {
+        super(byteStream);
+    }
+
+    public override int signature() {
+        return JPEGFileFormat.DAC;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGComment.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.JPEGComment;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.image.JPEGVariableSizeSegment;
+import org.eclipse.swt.internal.image.JPEGFileFormat;
+import org.eclipse.swt.internal.image.LEDataInputStream;
+
+final class JPEGComment : JPEGVariableSizeSegment {
+
+    public this(byte[] reference) {
+        super(reference);
+    }
+
+    public this(LEDataInputStream byteStream) {
+        super(byteStream);
+    }
+
+    public override int signature() {
+        return JPEGFileFormat.COM;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGDecoder.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,6394 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.JPEGDecoder;
+
+import org.eclipse.swt.SWT;
+import java.io.InputStream;
+import org.eclipse.swt.internal.image.LEDataInputStream;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.ImageLoader;
+import org.eclipse.swt.graphics.ImageLoaderEvent;
+import org.eclipse.swt.graphics.PaletteData;
+import org.eclipse.swt.graphics.RGB;
+import java.lang.all;
+
+import tango.core.Exception;
+import tango.util.Convert;
+
+public class JPEGDecoder {
+
+    static const int DCTSIZE = 8;
+    static const int DCTSIZE2 = 64;
+    static const int NUM_QUANT_TBLS = 4;
+    static const int NUM_HUFF_TBLS = 4;
+    static const int NUM_ARITH_TBLS = 16;
+    static const int MAX_COMPS_IN_SCAN = 4;
+    static const int MAX_COMPONENTS = 10;
+    static const int MAX_SAMP_FACTOR = 4;
+    static const int D_MAX_BLOCKS_IN_MCU = 10;
+    static const int HUFF_LOOKAHEAD = 8;
+    static const int MAX_Q_COMPS = 4;
+    static const int IFAST_SCALE_BITS = 2;
+    static const int MAXJSAMPLE = 255;
+    static const int CENTERJSAMPLE = 128;
+    static const int MIN_GET_BITS = 32-7;
+    static const int INPUT_BUFFER_SIZE = 4096;
+
+    static const int SCALEBITS = 16;    /* speediest right-shift on some machines */
+    static const int ONE_HALF = 1 << (SCALEBITS-1);
+
+    static const int RGB_RED = 2;   /* Offset of Red in an RGB scanline element */
+    static const int RGB_GREEN = 1; /* Offset of Green */
+    static const int RGB_BLUE = 0;  /* Offset of Blue */
+    static const int RGB_PIXELSIZE = 3;
+
+    static const int JBUF_PASS_THRU = 0;
+    static const int JBUF_SAVE_SOURCE = 1;  /* Run source subobject only, save output */
+    static const int JBUF_CRANK_DEST = 2;   /* Run dest subobject only, using saved data */
+    static const int JBUF_SAVE_AND_PASS = 3;
+
+    static const int JPEG_MAX_DIMENSION = 65500;
+    static const int BITS_IN_JSAMPLE = 8;
+
+    static const int JDITHER_NONE = 0;      /* no dithering */
+    static const int JDITHER_ORDERED = 1;   /* simple ordered dither */
+    static const int JDITHER_FS = 2;
+
+    static const int JDCT_ISLOW = 0;    /* slow but accurate integer algorithm */
+    static const int JDCT_IFAST = 1;    /* faster, less accurate integer method */
+    static const int JDCT_FLOAT = 2;    /* floating-point: accurate, fast on fast HW */
+    static const int JDCT_DEFAULT = JDCT_ISLOW;
+
+    static const int JCS_UNKNOWN = 0;       /* error/unspecified */
+    static const int JCS_GRAYSCALE = 1;     /* monochrome */
+    static const int JCS_RGB = 2;       /* red/green/blue */
+    static const int JCS_YCbCr = 3;     /* Y/Cb/Cr (also known as YUV) */
+    static const int JCS_CMYK = 4;      /* C/M/Y/K */
+    static const int JCS_YCCK = 5;      /* Y/Cb/Cr/K */
+
+    static const int SAVED_COEFS = 6;
+    static const int Q01_POS = 1;
+    static const int Q10_POS = 8;
+    static const int Q20_POS = 16;
+    static const int Q11_POS = 9;
+    static const int Q02_POS = 2;
+
+    static const int CTX_PREPARE_FOR_IMCU = 0;  /* need to prepare for MCU row */
+    static const int CTX_PROCESS_IMCU = 1;  /* feeding iMCU to postprocessor */
+    static const int CTX_POSTPONED_ROW = 2; /* feeding postponed row group */
+
+    static const int APP0_DATA_LEN = 14;    /* Length of interesting data in APP0 */
+    static const int APP14_DATA_LEN = 12;   /* Length of interesting data in APP14 */
+    static const int APPN_DATA_LEN = 14;    /* Must be the largest of the above!! */
+
+    /* markers */
+    static const int M_SOF0 = 0xc0;
+    static const int M_SOF1 = 0xc1;
+    static const int M_SOF2 = 0xc2;
+    static const int M_SOF3 = 0xc3;
+    static const int M_SOF5 = 0xc5;
+    static const int M_SOF6 = 0xc6;
+    static const int M_SOF7 = 0xc7;
+    static const int M_JPG = 0xc8;
+    static const int M_SOF9 = 0xc9;
+    static const int M_SOF10 = 0xca;
+    static const int M_SOF11 = 0xcb;
+    static const int M_SOF13 = 0xcd;
+    static const int M_SOF14 = 0xce;
+    static const int M_SOF15 = 0xcf;
+    static const int M_DHT = 0xc4;
+    static const int M_DAC = 0xcc;
+    static const int M_RST0 = 0xd0;
+    static const int M_RST1 = 0xd1;
+    static const int M_RST2 = 0xd2;
+    static const int M_RST3 = 0xd3;
+    static const int M_RST4 = 0xd4;
+    static const int M_RST5 = 0xd5;
+    static const int M_RST6 = 0xd6;
+    static const int M_RST7 = 0xd7;
+    static const int M_SOI = 0xd8;
+    static const int M_EOI = 0xd9;
+    static const int M_SOS = 0xda;
+    static const int M_DQT = 0xdb;
+    static const int M_DNL = 0xdc;
+    static const int M_DRI = 0xdd;
+    static const int M_DHP = 0xde;
+    static const int M_EXP = 0xdf;
+    static const int M_APP0 = 0xe0;
+    static const int M_APP1 = 0xe1;
+    static const int M_APP2 = 0xe2;
+    static const int M_APP3 = 0xe3;
+    static const int M_APP4 = 0xe4;
+    static const int M_APP5 = 0xe5;
+    static const int M_APP6 = 0xe6;
+    static const int M_APP7 = 0xe7;
+    static const int M_APP8 = 0xe8;
+    static const int M_APP9 = 0xe9;
+    static const int M_APP10 = 0xea;
+    static const int M_APP11 = 0xeb;
+    static const int M_APP12 = 0xec;
+    static const int M_APP13 = 0xed;
+    static const int M_APP14 = 0xee;
+    static const int M_APP15 = 0xef;
+    static const int M_JPG0 = 0xf0;
+    static const int M_JPG13 = 0xfd;
+    static const int M_COM = 0xfe;
+    static const int M_TEM = 0x01;
+    static const int M_ERROR = 0x100;
+
+    /* Values of global_state field (jdapi.c has some dependencies on ordering!) */
+    static const int CSTATE_START = 100;    /* after create_compress */
+    static const int CSTATE_SCANNING = 101; /* start_compress done, write_scanlines OK */
+    static const int CSTATE_RAW_OK = 102;   /* start_compress done, write_raw_data OK */
+    static const int CSTATE_WRCOEFS = 103;  /* jpeg_write_coefficients done */
+    static const int DSTATE_START = 200;    /* after create_decompress */
+    static const int DSTATE_INHEADER = 201; /* reading header markers, no SOS yet */
+    static const int DSTATE_READY = 202;    /* found SOS, ready for start_decompress */
+    static const int DSTATE_PRELOAD = 203;  /* reading multiscan file in start_decompress*/
+    static const int DSTATE_PRESCAN = 204;  /* performing dummy pass for 2-pass quant */
+    static const int DSTATE_SCANNING = 205; /* start_decompress done, read_scanlines OK */
+    static const int DSTATE_RAW_OK = 206;   /* start_decompress done, read_raw_data OK */
+    static const int DSTATE_BUFIMAGE = 207; /* expecting jpeg_start_output */
+    static const int DSTATE_BUFPOST = 208;  /* looking for SOS/EOI in jpeg_finish_output */
+    static const int DSTATE_RDCOEFS = 209;  /* reading file in jpeg_read_coefficients */
+    static const int DSTATE_STOPPING = 210; /* looking for EOI in jpeg_finish_decompress */
+
+    static const int JPEG_REACHED_SOS = 1; /* Reached start of new scan */
+    static const int JPEG_REACHED_EOI = 2; /* Reached end of image */
+    static const int JPEG_ROW_COMPLETED = 3; /* Completed one iMCU row */
+    static const int JPEG_SCAN_COMPLETED = 4; /* Completed last iMCU row of a scan */
+
+    static const int JPEG_SUSPENDED = 0; /* Suspended due to lack of input data */
+    static const int JPEG_HEADER_OK = 1; /* Found valid image datastream */
+    static const int JPEG_HEADER_TABLES_ONLY = 2; /* Found valid table-specs-only datastream */
+
+    /* Function pointers */
+    static const int DECOMPRESS_DATA = 0;
+    static const int DECOMPRESS_SMOOTH_DATA = 1;
+    static const int DECOMPRESS_ONEPASS = 2;
+
+    static const int CONSUME_DATA = 0;
+    static const int DUMMY_CONSUME_DATA = 1;
+
+    static const int PROCESS_DATA_SIMPLE_MAIN = 0;
+    static const int PROCESS_DATA_CONTEXT_MAIN = 1;
+    static const int PROCESS_DATA_CRANK_POST = 2;
+
+    static const int POST_PROCESS_1PASS = 0;
+    static const int POST_PROCESS_DATA_UPSAMPLE = 1;
+
+    static const int NULL_CONVERT = 0;
+    static const int GRAYSCALE_CONVERT = 1;
+    static const int YCC_RGB_CONVERT = 2;
+    static const int GRAY_RGB_CONVERT = 3;
+    static const int YCCK_CMYK_CONVERT = 4;
+
+    static const int NOOP_UPSAMPLE = 0;
+    static const int FULLSIZE_UPSAMPLE = 1;
+    static const int H2V1_FANCY_UPSAMPLE = 2;
+    static const int H2V1_UPSAMPLE = 3;
+    static const int H2V2_FANCY_UPSAMPLE = 4;
+    static const int H2V2_UPSAMPLE = 5;
+    static const int INT_UPSAMPLE = 6;
+
+    static const int INPUT_CONSUME_INPUT = 0;
+    static const int COEF_CONSUME_INPUT = 1;
+
+    static int extend_test[] =   /* entry n is 2**(n-1) */
+    [
+        0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,
+        0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000
+    ];
+
+    static int extend_offset[] = /* entry n is (-1 << n) + 1 */
+    [
+        0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1,
+        ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1,
+        ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1,
+        ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1
+    ];
+
+    static int jpeg_natural_order[] = [
+        0,  1,  8, 16,  9,  2,  3, 10,
+        17, 24, 32, 25, 18, 11, 4,  5,
+        12, 19, 26, 33, 40, 48, 41, 34,
+        27, 20, 13, 6,  7, 14, 21, 28,
+        35, 42, 49, 56, 57, 50, 43, 36,
+        29, 22, 15, 23, 30, 37, 44, 51,
+        58, 59, 52, 45, 38, 31, 39, 46,
+        53, 60, 61, 54, 47, 55, 62, 63,
+        63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */
+        63, 63, 63, 63, 63, 63, 63, 63
+    ];
+
+    static final class JQUANT_TBL {
+        /* This array gives the coefficient quantizers in natural array order
+         * (not the zigzag order in which they are stored in a JPEG DQT marker).
+         * CAUTION: IJG versions prior to v6a kept this array in zigzag order.
+         */
+        short[DCTSIZE2] quantval;// = new short[DCTSIZE2];  /* quantization step for each coefficient */
+        /* This field is used only during compression.  It's initialized false when
+         * the table is created, and set true when it's been output to the file.
+         * You could suppress output of a table by setting this to true.
+         * (See jpeg_suppress_tables for an example.)
+         */
+        bool sent_table;     /* true when table has been output */
+    }
+
+    static final class JHUFF_TBL {
+        /* These two fields directly represent the contents of a JPEG DHT marker */
+        byte[17] bits;// = new byte[17]; /* bits[k] = # of symbols with codes of */
+                                    /* length k bits; bits[0] is unused */
+        byte[256] huffval;// = new byte[256];       /* The symbols, in order of incr code length */
+        /* This field is used only during compression.  It's initialized false when
+         * the table is created, and set true when it's been output to the file.
+         * You could suppress output of a table by setting this to true.
+         * (See jpeg_suppress_tables for an example.)
+         */
+        bool sent_table;     /* true when table has been output */
+    }
+
+    static final class bitread_perm_state {     /* Bitreading state saved across MCUs */
+        int get_buffer; /* current bit-extraction buffer */
+        int bits_left;      /* # of unused bits in it */
+    }
+
+    static final class bitread_working_state {      /* Bitreading working state within an MCU */
+        /* Current data source location */
+        /* We need a copy, rather than munging the original, in case of suspension */
+        byte[] buffer; /* => next byte to read from source */
+        int bytes_offset;
+        int bytes_in_buffer;    /* # of bytes remaining in source buffer */
+        /* Bit input buffer --- note these values are kept in register variables,
+         * not in this struct, inside the inner loops.
+         */
+        int get_buffer; /* current bit-extraction buffer */
+        int bits_left;      /* # of unused bits in it */
+        /* Pointer needed by jpeg_fill_bit_buffer. */
+        jpeg_decompress_struct cinfo;   /* back link to decompress master record */
+    }
+
+    static final class savable_state {
+        int EOBRUN; //Note that this is only used in the progressive case
+        int[MAX_COMPS_IN_SCAN] last_dc_val;// = new int[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
+    }
+
+    static final class d_derived_tbl {
+        /* Basic tables: (element [0] of each array is unused) */
+        int[18] maxcode;// = new int[18];       /* largest code of length k (-1 if none) */
+        /* (maxcode[17] is a sentinel to ensure jpeg_huff_decode terminates) */
+        int[17] valoffset;// = new int[17];     /* huffval[] offset for codes of length k */
+        /* valoffset[k] = huffval[] index of 1st symbol of code length k, less
+         * the smallest code of length k; so given a code of length k, the
+         * corresponding symbol is huffval[code + valoffset[k]]
+         */
+
+        /* Link to public Huffman table (needed only in jpeg_huff_decode) */
+        JHUFF_TBL pub;
+
+        /* Lookahead tables: indexed by the next HUFF_LOOKAHEAD bits of
+         * the input data stream.   If the next Huffman code is no more
+         * than HUFF_LOOKAHEAD bits long, we can obtain its length and
+         * the corresponding symbol directly from these tables.
+         */
+        int[1<<HUFF_LOOKAHEAD] look_nbits;// = new int[1<<HUFF_LOOKAHEAD]; /* # bits, or 0 if too long */
+        byte[1<<HUFF_LOOKAHEAD] look_sym;// = new byte[1<<HUFF_LOOKAHEAD]; /* symbol, or unused */
+    }
+
+    static final class jpeg_d_coef_controller {
+        int consume_data;
+        int decompress_data;
+
+        /* Pointer to array of coefficient virtual arrays, or null if none */
+        short[][][] coef_arrays;
+
+        /* These variables keep track of the current location of the input side. */
+        /* cinfo.input_iMCU_row is also used for this. */
+        int MCU_ctr;        /* counts MCUs processed in current row */
+        int MCU_vert_offset;        /* counts MCU rows within iMCU row */
+        int MCU_rows_per_iMCU_row;  /* number of such rows needed */
+
+        /* The output side's location is represented by cinfo.output_iMCU_row. */
+
+        /* In single-pass modes, it's sufficient to buffer just one MCU.
+         * We allocate a workspace of D_MAX_BLOCKS_IN_MCU coefficient blocks,
+         * and let the entropy decoder write into that workspace each time.
+         * (On 80x86, the workspace is FAR even though it's not really very big;
+         * this is to keep the module interfaces unchanged when a large coefficient
+         * buffer is necessary.)
+         * In multi-pass modes, this array points to the current MCU's blocks
+         * within the virtual arrays; it is used only by the input side.
+         */
+        short[][D_MAX_BLOCKS_IN_MCU] MCU_buffer;// = new short[D_MAX_BLOCKS_IN_MCU][];
+
+        /* In multi-pass modes, we need a virtual block array for each component. */
+        short[][][][MAX_COMPONENTS] whole_image;// = new short[MAX_COMPONENTS][][][];
+
+        /* When doing block smoothing, we latch coefficient Al values here */
+        int[] coef_bits_latch;
+
+        short[] workspace;
+
+        void start_input_pass (jpeg_decompress_struct cinfo) {
+            cinfo.input_iMCU_row = 0;
+            start_iMCU_row(cinfo);
+        }
+
+        /* Reset within-iMCU-row counters for a new row (input side) */
+        void start_iMCU_row (jpeg_decompress_struct cinfo) {
+            jpeg_d_coef_controller coef = cinfo.coef;
+
+            /* In an interleaved scan, an MCU row is the same as an iMCU row.
+             * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.
+             * But at the bottom of the image, process only what's left.
+             */
+            if (cinfo.comps_in_scan > 1) {
+                coef.MCU_rows_per_iMCU_row = 1;
+            } else {
+                if (cinfo.input_iMCU_row < (cinfo.total_iMCU_rows-1))
+                    coef.MCU_rows_per_iMCU_row = cinfo.cur_comp_info[0].v_samp_factor;
+                else
+                    coef.MCU_rows_per_iMCU_row = cinfo.cur_comp_info[0].last_row_height;
+            }
+
+            coef.MCU_ctr = 0;
+            coef.MCU_vert_offset = 0;
+        }
+
+    }
+
+    static abstract class jpeg_entropy_decoder {
+        abstract void start_pass (jpeg_decompress_struct cinfo);
+        abstract bool decode_mcu (jpeg_decompress_struct cinfo, short[][] MCU_data);
+
+        /* This is here to share code between baseline and progressive decoders; */
+        /* other modules probably should not use it */
+        bool insufficient_data;  /* set true after emitting warning */
+
+        bitread_working_state br_state_local;
+        savable_state state_local;
+        public this(){
+            br_state_local = new bitread_working_state();
+            state_local = new savable_state();
+        }
+    }
+
+    static final class huff_entropy_decoder : jpeg_entropy_decoder {
+        bitread_perm_state bitstate;// = new bitread_perm_state();  /* Bit buffer at start of MCU */
+        savable_state saved;// = new savable_state();       /* Other state at start of MCU */
+
+        /* These fields are NOT loaded into local working state. */
+        int restarts_to_go; /* MCUs left in this restart interval */
+
+        /* Pointers to derived tables (these workspaces have image lifespan) */
+        d_derived_tbl[NUM_HUFF_TBLS] dc_derived_tbls;// = new d_derived_tbl[NUM_HUFF_TBLS];
+        d_derived_tbl[NUM_HUFF_TBLS] ac_derived_tbls;// = new d_derived_tbl[NUM_HUFF_TBLS];
+
+        /* Precalculated info set up by start_pass for use in decode_mcu: */
+
+        /* Pointers to derived tables to be used for each block within an MCU */
+        d_derived_tbl[D_MAX_BLOCKS_IN_MCU] dc_cur_tbls;// = new d_derived_tbl[D_MAX_BLOCKS_IN_MCU];
+        d_derived_tbl[D_MAX_BLOCKS_IN_MCU] ac_cur_tbls;// = new d_derived_tbl[D_MAX_BLOCKS_IN_MCU];
+        /* Whether we care about the DC and AC coefficient values for each block */
+        bool[D_MAX_BLOCKS_IN_MCU] dc_needed;// = new bool[D_MAX_BLOCKS_IN_MCU];
+        bool[D_MAX_BLOCKS_IN_MCU] ac_needed;// = new bool[D_MAX_BLOCKS_IN_MCU];
+
+        public this(){
+            bitstate = new bitread_perm_state(); /* Bit buffer at start of MCU */
+            saved = new savable_state();      /* Other state at start of MCU */
+        }
+
+        override void start_pass (jpeg_decompress_struct cinfo) {
+            start_pass_huff_decoder(cinfo);
+        }
+
+        override bool decode_mcu (jpeg_decompress_struct cinfo, short[][] MCU_data) {
+            huff_entropy_decoder entropy = this;
+            int blkn;
+//          BITREAD_STATE_VARS;
+            int get_buffer;
+            int bits_left;
+//          bitread_working_state br_state = new bitread_working_state();
+//          savable_state state = new savable_state();
+            bitread_working_state br_state = br_state_local;
+            savable_state state = state_local;
+
+                /* Process restart marker if needed; may have to suspend */
+            if (cinfo.restart_interval !is 0) {
+                if (entropy.restarts_to_go is 0)
+                    if (! process_restart(cinfo))
+                        return false;
+            }
+
+            /* If we've run out of data, just leave the MCU set to zeroes.
+             * This way, we return uniform gray for the remainder of the segment.
+             */
+            if (! entropy.insufficient_data) {
+
+                /* Load up working state */
+//              BITREAD_LOAD_STATE(cinfo,entropy.bitstate);
+                br_state.cinfo = cinfo;
+                br_state.buffer = cinfo.buffer;
+                br_state.bytes_in_buffer = cinfo.bytes_in_buffer;
+                br_state.bytes_offset = cinfo.bytes_offset;
+                get_buffer = entropy.bitstate.get_buffer;
+                bits_left = entropy.bitstate.bits_left;
+
+//              ASSIGN_STATE(state, entropy.saved);
+                state.last_dc_val[0] = entropy.saved.last_dc_val[0];
+                state.last_dc_val[1] = entropy.saved.last_dc_val[1];
+                state.last_dc_val[2] = entropy.saved.last_dc_val[2];
+                state.last_dc_val[3] = entropy.saved.last_dc_val[3];
+
+                /* Outer loop handles each block in the MCU */
+
+                for (blkn = 0; blkn < cinfo.blocks_in_MCU; blkn++) {
+                    short[] block = MCU_data[blkn];
+                    d_derived_tbl dctbl = entropy.dc_cur_tbls[blkn];
+                    d_derived_tbl actbl = entropy.ac_cur_tbls[blkn];
+                    int s = 0, k, r;
+
+                    /* Decode a single block's worth of coefficients */
+
+                    /* Section F.2.2.1: decode the DC coefficient difference */
+//                  HUFF_DECODE(s, br_state, dctbl, return FALSE, label1);
+                    {
+                    int nb = 0, look;
+                    if (bits_left < HUFF_LOOKAHEAD) {
+                        if (!jpeg_fill_bit_buffer(br_state,get_buffer,bits_left, 0)) {
+                            return false;
+                        }
+                        get_buffer = br_state.get_buffer; bits_left = br_state.bits_left;
+                        if (bits_left < HUFF_LOOKAHEAD) {
+                            nb = 1;
+//                          goto slowlabel;
+                            if ((s=jpeg_huff_decode(br_state,get_buffer,bits_left,dctbl,nb)) < 0) {
+                                return false;
+                            }
+                            get_buffer = br_state.get_buffer; bits_left = br_state.bits_left;
+                        }
+                    }
+//                  look = PEEK_BITS(HUFF_LOOKAHEAD);
+                    if (nb !is 1) {
+                        look = (( (get_buffer >> (bits_left -   (HUFF_LOOKAHEAD)))) & ((1<<(HUFF_LOOKAHEAD))-1));
+                        if ((nb = dctbl.look_nbits[look]) !is 0) {
+//                          DROP_BITS(nb);
+                            bits_left -= nb;
+                            s = dctbl.look_sym[look] & 0xFF;
+                        } else {
+                            nb = HUFF_LOOKAHEAD+1;
+//                          slowlabel:
+                            if ((s=jpeg_huff_decode(br_state,get_buffer,bits_left,dctbl,nb)) < 0) {
+                                return false;
+                            }
+                            get_buffer = br_state.get_buffer; bits_left = br_state.bits_left;
+                        }
+                    }
+                    }
+
+                    if (s !is 0) {
+//                      CHECK_BIT_BUFFER(br_state, s, return FALSE);
+                        {
+                        if (bits_left < (s)) {
+                            if (!jpeg_fill_bit_buffer(br_state,get_buffer,bits_left,s)) {
+                                return false;
+                            }
+                            get_buffer = br_state.get_buffer; bits_left = br_state.bits_left;
+                        }
+                        }
+//                      r = GET_BITS(s);
+                        r = (( (get_buffer >> (bits_left -= (s)))) & ((1<<(s))-1));
+//                      s = HUFF_EXTEND(r, s);
+                        s = ((r) < extend_test[s] ? (r) + extend_offset[s] : (r));
+                    }
+
+                    if (entropy.dc_needed[blkn]) {
+                        /* Convert DC difference to actual value, update last_dc_val */
+                        int ci = cinfo.MCU_membership[blkn];
+                        s += state.last_dc_val[ci];
+                        state.last_dc_val[ci] = s;
+                        /* Output the DC coefficient (assumes jpeg_natural_order[0] = 0) */
+                        block[0] = cast(short) s;
+                    }
+
+                    if (entropy.ac_needed[blkn]) {
+
+                        /* Section F.2.2.2: decode the AC coefficients */
+                        /* Since zeroes are skipped, output area must be cleared beforehand */
+                        for (k = 1; k < DCTSIZE2; k++) {
+//                          HUFF_DECODE(s, br_state, actbl, return FALSE, label2);
+                            {
+                            int nb = 0, look;
+                            if (bits_left < HUFF_LOOKAHEAD) {
+                                if (!jpeg_fill_bit_buffer(br_state,get_buffer,bits_left, 0)) {
+                                    return false;
+                                }
+                                get_buffer = br_state.get_buffer; bits_left = br_state.bits_left;
+                                if (bits_left < HUFF_LOOKAHEAD) {
+                                    nb = 1;
+//                                  goto slowlabel;
+                                    if ((s=jpeg_huff_decode(br_state,get_buffer,bits_left,actbl,nb)) < 0) {
+                                        return false;
+                                    }
+                                    get_buffer = br_state.get_buffer; bits_left = br_state.bits_left;
+                                }
+                            }
+                            if (nb !is 1) {
+//                              look = PEEK_BITS(HUFF_LOOKAHEAD);
+                                look = (( (get_buffer >> (bits_left -   (HUFF_LOOKAHEAD)))) & ((1<<(HUFF_LOOKAHEAD))-1));
+                                if ((nb = actbl.look_nbits[look]) !is 0) {
+//                                  DROP_BITS(nb);
+                                    bits_left -= (nb);
+                                    s = actbl.look_sym[look] & 0xFF;
+                                } else {
+                                    nb = HUFF_LOOKAHEAD+1;
+//                                  slowlabel:
+                                    if ((s=jpeg_huff_decode(br_state,get_buffer,bits_left,actbl,nb)) < 0) {
+                                        return false;
+                                    }
+                                    get_buffer = br_state.get_buffer; bits_left = br_state.bits_left;
+                                }
+                            }
+                            }
+                            r = s >> 4;
+                            s &= 15;
+
+                            if (s !is 0) {
+                                k += r;
+//                              CHECK_BIT_BUFFER(br_state, s, return FALSE);
+                                {
+                                if (bits_left < (s)) {
+                                    if (!jpeg_fill_bit_buffer(br_state, get_buffer, bits_left, s)) {
+                                        return false;
+                                    }
+                                    get_buffer = br_state.get_buffer;
+                                    bits_left = br_state.bits_left;
+                                }
+                                }
+//                              r = GET_BITS(s);
+                                r = (((get_buffer >> (bits_left -= (s)))) & ((1 << (s)) - 1));
+//                              s = HUFF_EXTEND(r, s);
+                                s = ((r) < extend_test[s] ? (r) + extend_offset[s] : (r));
+                                /*
+                                 * Output coefficient in natural (dezigzagged)
+                                 * order. Note: the extra entries in
+                                 * jpeg_natural_order[] will save us if k >=
+                                 * DCTSIZE2, which could happen if the data is
+                                 * corrupted.
+                                 */
+                                block[jpeg_natural_order[k]] = cast(short) s;
+                            } else {
+                                if (r !is 15)
+                                    break;
+                                k += 15;
+                            }
+                        }
+
+                    } else {
+
+                        /* Section F.2.2.2: decode the AC coefficients */
+                        /* In this path we just discard the values */
+                        for (k = 1; k < DCTSIZE2; k++) {
+//                          HUFF_DECODE(s, br_state, actbl, return FALSE, label3);
+                            {
+                            int nb = 0, look;
+                            if (bits_left < HUFF_LOOKAHEAD) {
+                                if (!jpeg_fill_bit_buffer(br_state,get_buffer,bits_left, 0)) {
+                                    return false;
+                                }
+                                get_buffer = br_state.get_buffer; bits_left = br_state.bits_left;
+                                if (bits_left < HUFF_LOOKAHEAD) {
+                                    nb = 1;
+//                                  goto slowlabel;
+                                    if ((s=jpeg_huff_decode(br_state,get_buffer,bits_left,actbl,nb)) < 0) {
+                                        return false;
+                                    }
+                                    get_buffer = br_state.get_buffer; bits_left = br_state.bits_left;
+                                }
+                            }
+                            if (nb !is 1) {
+//                              look = PEEK_BITS(HUFF_LOOKAHEAD);
+                                look = (( (get_buffer >> (bits_left -   (HUFF_LOOKAHEAD)))) & ((1<<(HUFF_LOOKAHEAD))-1));
+                                if ((nb = actbl.look_nbits[look]) !is 0) {
+//                                  DROP_BITS(nb);
+                                    bits_left -= (nb);
+                                    s = actbl.look_sym[look] & 0xFF;
+                                } else {
+                                    nb = HUFF_LOOKAHEAD+1;
+//                                  slowlabel:
+                                    if ((s=jpeg_huff_decode(br_state,get_buffer,bits_left,actbl,nb)) < 0) {
+                                        return false;
+                                    }
+                                    get_buffer = br_state.get_buffer; bits_left = br_state.bits_left;
+                                }
+                            }
+                            }
+                            r = s >> 4;
+                            s &= 15;
+
+                            if (s !is 0) {
+                                k += r;
+//                              CHECK_BIT_BUFFER(br_state, s, return FALSE);
+                                {
+                                if (bits_left < (s)) {
+                                    if (!jpeg_fill_bit_buffer(br_state,get_buffer,bits_left,s)) {
+                                        return false;
+                                    }
+                                    get_buffer = br_state.get_buffer; bits_left = br_state.bits_left;
+                                    }
+                                }
+//                              DROP_BITS(s);
+                                bits_left -= s;
+                            } else {
+                                if (r !is 15)
+                                    break;
+                                k += 15;
+                            }
+                        }
+
+                    }
+                }
+
+                /* Completed MCU, so update state */
+//              BITREAD_SAVE_STATE(cinfo,entropy.bitstate);
+                cinfo.buffer = br_state.buffer;
+                cinfo.bytes_in_buffer = br_state.bytes_in_buffer;
+                cinfo.bytes_offset = br_state.bytes_offset;
+                entropy.bitstate.get_buffer = get_buffer;
+                entropy.bitstate.bits_left = bits_left;
+//              ASSIGN_STATE(entropy.saved, state);
+                entropy.saved.last_dc_val[0] = state.last_dc_val[0];
+                entropy.saved.last_dc_val[1] = state.last_dc_val[1];
+                entropy.saved.last_dc_val[2] = state.last_dc_val[2];
+                entropy.saved.last_dc_val[3] = state.last_dc_val[3];
+            }
+
+            /* Account for restart interval (no-op if not using restarts) */
+            entropy.restarts_to_go--;
+
+            return true;
+        }
+
+        void start_pass_huff_decoder (jpeg_decompress_struct cinfo) {
+            huff_entropy_decoder entropy = this;
+            int ci, blkn, dctbl, actbl;
+            jpeg_component_info compptr;
+
+            /* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG.
+             * This ought to be an error condition, but we make it a warning because
+             * there are some baseline files out there with all zeroes in these bytes.
+             */
+            if (cinfo.Ss !is 0 || cinfo.Se !is DCTSIZE2-1 || cinfo.Ah !is 0 || cinfo.Al !is 0) {
+//              WARNMS(cinfo, JWRN_NOT_SEQUENTIAL);
+            }
+
+            for (ci = 0; ci < cinfo.comps_in_scan; ci++) {
+                compptr = cinfo.cur_comp_info[ci];
+                dctbl = compptr.dc_tbl_no;
+                actbl = compptr.ac_tbl_no;
+                /* Compute derived values for Huffman tables */
+                /* We may do this more than once for a table, but it's not expensive */
+                jpeg_make_d_derived_tbl(cinfo, true, dctbl, entropy.dc_derived_tbls[dctbl] = new d_derived_tbl());
+                jpeg_make_d_derived_tbl(cinfo, false, actbl, entropy.ac_derived_tbls[actbl] = new d_derived_tbl());
+                /* Initialize DC predictions to 0 */
+                entropy.saved.last_dc_val[ci] = 0;
+            }
+
+            /* Precalculate decoding info for each block in an MCU of this scan */
+            for (blkn = 0; blkn < cinfo.blocks_in_MCU; blkn++) {
+                ci = cinfo.MCU_membership[blkn];
+                compptr = cinfo.cur_comp_info[ci];
+                /* Precalculate which table to use for each block */
+                entropy.dc_cur_tbls[blkn] = entropy.dc_derived_tbls[compptr.dc_tbl_no];
+                entropy.ac_cur_tbls[blkn] = entropy.ac_derived_tbls[compptr.ac_tbl_no];
+                /* Decide whether we really care about the coefficient values */
+                if (compptr.component_needed) {
+                    entropy.dc_needed[blkn] = true;
+                    /* we don't need the ACs if producing a 1/8th-size image */
+                    entropy.ac_needed[blkn] = (compptr.DCT_scaled_size > 1);
+                } else {
+                    entropy.dc_needed[blkn] = entropy.ac_needed[blkn] = false;
+                }
+            }
+
+            /* Initialize bitread state variables */
+            entropy.bitstate.bits_left = 0;
+            entropy.bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */
+            entropy.insufficient_data = false;
+
+            /* Initialize restart counter */
+            entropy.restarts_to_go = cinfo.restart_interval;
+        }
+
+        bool process_restart (jpeg_decompress_struct cinfo) {
+            huff_entropy_decoder entropy = this;
+            int ci;
+
+            /* Throw away any unused bits remaining in bit buffer; */
+            /* include any full bytes in next_marker's count of discarded bytes */
+            cinfo.marker.discarded_bytes += entropy.bitstate.bits_left / 8;
+            entropy.bitstate.bits_left = 0;
+
+            /* Advance past the RSTn marker */
+            if (! read_restart_marker (cinfo))
+                return false;
+
+            /* Re-initialize DC predictions to 0 */
+            for (ci = 0; ci < cinfo.comps_in_scan; ci++)
+                entropy.saved.last_dc_val[ci] = 0;
+
+            /* Reset restart counter */
+            entropy.restarts_to_go = cinfo.restart_interval;
+
+            /* Reset out-of-data flag, unless read_restart_marker left us smack up
+             * against a marker.    In that case we will end up treating the next data
+             * segment as empty, and we can avoid producing bogus output pixels by
+             * leaving the flag set.
+             */
+            if (cinfo.unread_marker is 0)
+                entropy.insufficient_data = false;
+
+            return true;
+        }
+    }
+
+    static final class phuff_entropy_decoder : jpeg_entropy_decoder {
+
+        /* These fields are loaded into local variables at start of each MCU.
+         * In case of suspension, we exit WITHOUT updating them.
+         */
+        bitread_perm_state bitstate;// = new bitread_perm_state();  /* Bit buffer at start of MCU */
+        savable_state saved;// = new savable_state();       /* Other state at start of MCU */
+
+        /* These fields are NOT loaded into local working state. */
+        int restarts_to_go; /* MCUs left in this restart interval */
+
+        /* Pointers to derived tables (these workspaces have image lifespan) */
+        d_derived_tbl[NUM_HUFF_TBLS] derived_tbls;// = new d_derived_tbl[NUM_HUFF_TBLS];
+
+        d_derived_tbl ac_derived_tbl; /* active table during an AC scan */
+
+        int[DCTSIZE2] newnz_pos;// = new int[DCTSIZE2];
+
+        public this(){
+            bitstate = new bitread_perm_state(); /* Bit buffer at start of MCU */
+            saved = new savable_state();      /* Other state at start of MCU */
+        }
+
+        override void start_pass (jpeg_decompress_struct cinfo) {
+            start_pass_phuff_decoder(cinfo);
+        }
+
+        override bool decode_mcu (jpeg_decompress_struct cinfo, short[][] MCU_data) {
+            bool is_DC_band = (cinfo.Ss is 0);
+            if (cinfo.Ah is 0) {
+                if (is_DC_band)
+                    return decode_mcu_DC_first(cinfo, MCU_data);
+                else
+                    return decode_mcu_AC_first(cinfo, MCU_data);
+            } else {
+                if (is_DC_band)
+                    return decode_mcu_DC_refine(cinfo, MCU_data);
+                else
+                    return decode_mcu_AC_refine(cinfo, MCU_data);
+            }
+        }
+
+        bool decode_mcu_DC_refine (jpeg_decompress_struct cinfo, short[][] MCU_data) {
+            phuff_entropy_decoder entropy = this;
+            int p1 = 1 << cinfo.Al; /* 1 in the bit position being coded */
+            int blkn;
+            short[] block;
+//          BITREAD_STATE_VARS;
+            int get_buffer;
+            int bits_left;
+//          bitread_working_state br_state = new bitread_working_state();
+            bitread_working_state br_state = br_state_local;
+
+            /* Process restart marker if needed; may have to suspend */
+            if (cinfo.restart_interval !is 0) {
+                if (entropy.restarts_to_go is 0)
+                    if (! process_restart(cinfo))
+                        return false;
+            }
+
+            /* Not worth the cycles to check insufficient_data here,
+             * since we will not change the data anyway if we read zeroes.
+             */
+
+            /* Load up working state */
+//          BITREAD_LOAD_STATE(cinfo,entropy.bitstate);
+            br_state.cinfo = cinfo;
+            br_state.buffer = cinfo.buffer;
+            br_state.bytes_in_buffer = cinfo.bytes_in_buffer;
+            br_state.bytes_offset = cinfo.bytes_offset;
+            get_buffer = entropy.bitstate.get_buffer;
+            bits_left = entropy.bitstate.bits_left;
+
+            /* Outer loop handles each block in the MCU */
+
+            for (blkn = 0; blkn < cinfo.blocks_in_MCU; blkn++) {
+                block = MCU_data[blkn];
+
+                /* Encoded data is simply the next bit of the two's-complement DC value */
+//              CHECK_BIT_BUFFER(br_state, 1, return FALSE);
+                {
+                if (bits_left < (1)) {
+                    if (!jpeg_fill_bit_buffer(br_state,get_buffer,bits_left,1)) {
+                         return false;
+                    }
+                    get_buffer = br_state.get_buffer; bits_left = br_state.bits_left;
+                }
+                }
+//              if (GET_BITS(1))
+                if ((( (get_buffer >> (bits_left -= (1)))) & ((1<<(1))-1)) !is 0)
+                    block[0] |= p1;
+                    /* Note: since we use |=, repeating the assignment later is safe */
+            }
+
+            /* Completed MCU, so update state */
+//          BITREAD_SAVE_STATE(cinfo,entropy.bitstate);
+            cinfo.buffer = br_state.buffer;
+            cinfo.bytes_in_buffer = br_state.bytes_in_buffer;
+            cinfo.bytes_offset = br_state.bytes_offset;
+            entropy.bitstate.get_buffer = get_buffer;
+            entropy.bitstate.bits_left = bits_left;
+
+            /* Account for restart interval (no-op if not using restarts) */
+            entropy.restarts_to_go--;
+
+            return true;
+
+        }
+
+        bool decode_mcu_AC_refine (jpeg_decompress_struct cinfo, short[][] MCU_data) {
+            phuff_entropy_decoder entropy = this;
+            int Se = cinfo.Se;
+            int p1 = 1 << cinfo.Al; /* 1 in the bit position being coded */
+            int m1 = (-1) << cinfo.Al;  /* -1 in the bit position being coded */
+            int s = 0, k, r;
+            int EOBRUN;
+            short[] block;
+            short[] thiscoef;
+//          BITREAD_STATE_VARS;
+            int get_buffer;
+            int bits_left;
+//          bitread_working_state br_state = new bitread_working_state();
+            bitread_working_state br_state = br_state_local;
+
+            d_derived_tbl tbl;
+            int num_newnz;
+            int[] newnz_pos = entropy.newnz_pos;
+
+                /* Process restart marker if needed; may have to suspend */
+            if (cinfo.restart_interval !is 0) {
+                if (entropy.restarts_to_go is 0)
+                    if (! process_restart(cinfo))
+                        return false;
+            }
+
+            /* If we've run out of data, don't modify the MCU.
+             */
+            if (! entropy.insufficient_data) {
+
+                /* Load up working state */
+//              BITREAD_LOAD_STATE(cinfo,entropy.bitstate);
+                br_state.cinfo = cinfo;
+                br_state.buffer = cinfo.buffer;
+                br_state.bytes_in_buffer = cinfo.bytes_in_buffer;
+                br_state.bytes_offset = cinfo.bytes_offset;
+                get_buffer = entropy.bitstate.get_buffer;
+                bits_left = entropy.bitstate.bits_left;
+
+                EOBRUN = entropy.saved.EOBRUN; /* only part of saved state we need */
+
+                /* There is always only one block per MCU */
+                block = MCU_data[0];
+                tbl = entropy.ac_derived_tbl;
+
+                /* If we are forced to suspend, we must undo the assignments to any newly
+                 * nonzero coefficients in the block, because otherwise we'd get confused
+                 * next time about which coefficients were already nonzero.
+                 * But we need not undo addition of bits to already-nonzero coefficients;
+                 * instead, we can test the current bit to see if we already did it.
+                 */
+                num_newnz = 0;
+
+                /* initialize coefficient loop counter to start of band */
+                k = cinfo.Ss;
+
+                if (EOBRUN is 0) {
+                    for (; k <= Se; k++) {
+//                      HUFF_DECODE(s, br_state, tbl, goto undoit, label3);
+                        {
+                        int nb = 0, look;
+                        if (bits_left < HUFF_LOOKAHEAD) {
+                            if (! jpeg_fill_bit_buffer(br_state,get_buffer,bits_left, 0)) {
+//                              failaction;
+                                while (num_newnz > 0)
+                                    block[newnz_pos[--num_newnz]] = 0;
+
+                                return false;
+                            }
+                            get_buffer = br_state.get_buffer; bits_left = br_state.bits_left;
+                            if (bits_left < HUFF_LOOKAHEAD) {
+                                nb = 1;
+//                              goto slowlabel;
+                                if ((s=jpeg_huff_decode(br_state,get_buffer,bits_left,tbl,nb)) < 0) {
+//                                  failaction;
+                                    while (num_newnz > 0)
+                                        block[newnz_pos[--num_newnz]] = 0;
+
+                                    return false;
+                                }
+                                get_buffer = br_state.get_buffer; bits_left = br_state.bits_left;
+                            }
+                        }
+                        if (nb !is 1) {
+//                          look = PEEK_BITS(HUFF_LOOKAHEAD);
+                            look = (( (get_buffer >> (bits_left -   (HUFF_LOOKAHEAD)))) & ((1<<(HUFF_LOOKAHEAD))-1));
+                            if ((nb = tbl.look_nbits[look]) !is 0) {
+//                              DROP_BITS(nb);
+                                bits_left -= nb;
+                                s = tbl.look_sym[look] & 0xFF;
+                            } else {
+                                nb = HUFF_LOOKAHEAD+1;
+//                              slowlabel:
+                                if ((s=jpeg_huff_decode(br_state,get_buffer,bits_left,tbl,nb)) < 0) {
+//                                  failaction;
+                                    while (num_newnz > 0)
+                                        block[newnz_pos[--num_newnz]] = 0;
+
+                                    return false;
+                                }
+                                get_buffer = br_state.get_buffer; bits_left = br_state.bits_left;
+                            }
+                        }
+                        }
+                        r = s >> 4;
+                        s &= 15;
+                        if (s !is 0) {
+                            if (s !is 1) {       /* size of new coef should always be 1 */
+//                              WARNMS(cinfo, JWRN_HUFF_BAD_CODE);
+                            }
+//                          CHECK_BIT_BUFFER(br_state, 1, goto undoit);
+                            {
+                            if (bits_left < (1)) {
+                                if (! jpeg_fill_bit_buffer(br_state,get_buffer,bits_left,1)) {
+//                                  failaction;
+                                    while (num_newnz > 0)
+                                        block[newnz_pos[--num_newnz]] = 0;
+
+                                    return false;
+                                }
+                                get_buffer = br_state.get_buffer; bits_left = br_state.bits_left;
+                                }
+                            }
+//                          if (GET_BITS(1))
+                            if ((( (get_buffer >> (bits_left -= (1)))) & ((1<<(1))-1)) !is 0)
+                                s = p1;     /* newly nonzero coef is positive */
+                            else
+                                s = m1;     /* newly nonzero coef is negative */
+                        } else {
+                            if (r !is 15) {
+                                EOBRUN = 1 << r;    /* EOBr, run length is 2^r + appended bits */
+                                if (r !is 0) {
+//                                  CHECK_BIT_BUFFER(br_state, r, goto undoit);
+                                    {
+                                    if (bits_left < (r)) {
+                                        if (!jpeg_fill_bit_buffer(br_state,get_buffer,bits_left,r)) {
+//                                          failaction;
+                                            while (num_newnz > 0)
+                                                block[newnz_pos[--num_newnz]] = 0;
+
+                                            return false;
+                                        }
+                                        get_buffer = br_state.get_buffer; bits_left = br_state.bits_left;
+                                    }
+                                    }
+//                                  r = GET_BITS(r);
+                                    r = (( (get_buffer >> (bits_left -= (r)))) & ((1<<(r))-1));
+                                    EOBRUN += r;
+                                }
+                                break;      /* rest of block is handled by EOB logic */
+                            }
+                            /* note s = 0 for processing ZRL */
+                        }
+                        /* Advance over already-nonzero coefs and r still-zero coefs,
+                         * appending correction bits to the nonzeroes.  A correction bit is 1
+                         * if the absolute value of the coefficient must be increased.
+                         */
+                        do {
+                            thiscoef = block;
+                            int thiscoef_offset = jpeg_natural_order[k];
+                            if (thiscoef[thiscoef_offset] !is 0) {
+//                              CHECK_BIT_BUFFER(br_state, 1, goto undoit);
+                                {
+                                if (bits_left < (1)) {
+                                    if (!jpeg_fill_bit_buffer(br_state,get_buffer,bits_left,1)) {
+//                                      failaction;
+                                        while (num_newnz > 0)
+                                            block[newnz_pos[--num_newnz]] = 0;
+
+                                        return false;
+                                    }
+                                    get_buffer = br_state.get_buffer; bits_left = br_state.bits_left;
+                                }
+                                }
+//                              if (GET_BITS(1)) {
+                                if ((( (get_buffer >> (bits_left -= (1)))) & ((1<<(1))-1)) !is 0) {
+                                    if ((thiscoef[thiscoef_offset] & p1) is 0) { /* do nothing if already set it */
+                                        if (thiscoef[thiscoef_offset] >= 0)
+                                            thiscoef[thiscoef_offset] += p1;
+                                        else
+                                            thiscoef[thiscoef_offset] += m1;
+                                    }
+                                }
+                            } else {
+                                if (--r < 0)
+                                    break;      /* reached target zero coefficient */
+                            }
+                            k++;
+                        } while (k <= Se);
+                        if (s !is 0) {
+                            int pos = jpeg_natural_order[k];
+                            /* Output newly nonzero coefficient */
+                            block[pos] = cast(short) s;
+                            /* Remember its position in case we have to suspend */
+                            newnz_pos[num_newnz++] = pos;
+                        }
+                    }
+                }
+
+                if (EOBRUN > 0) {
+                    /* Scan any remaining coefficient positions after the end-of-band
+                     * (the last newly nonzero coefficient, if any).    Append a correction
+                     * bit to each already-nonzero coefficient. A correction bit is 1
+                     * if the absolute value of the coefficient must be increased.
+                     */
+                    for (; k <= Se; k++) {
+                        thiscoef = block;
+                        int thiscoef_offset = jpeg_natural_order[k];
+                        if (thiscoef[thiscoef_offset] !is 0) {
+//                          CHECK_BIT_BUFFER(br_state, 1, goto undoit);
+                            {
+                            if (bits_left < (1)) {
+                                if (! jpeg_fill_bit_buffer(br_state,get_buffer,bits_left,1)) {
+//                                  failaction;
+                                    while (num_newnz > 0)
+                                        block[newnz_pos[--num_newnz]] = 0;
+
+                                    return false;
+                                }
+                                get_buffer = br_state.get_buffer; bits_left = br_state.bits_left;
+                            }
+                            }
+//                          if (GET_BITS(1)) {
+                            if ((( (get_buffer >> (bits_left -= (1)))) & ((1<<(1))-1)) !is 0) {
+                                if ((thiscoef[thiscoef_offset] & p1) is 0) { /* do nothing if already changed it */
+                                    if (thiscoef[thiscoef_offset] >= 0)
+                                        thiscoef[thiscoef_offset] += p1;
+                                    else
+                                        thiscoef[thiscoef_offset] += m1;
+                                }
+                            }
+                        }
+                    }
+                        /* Count one block completed in EOB run */
+                    EOBRUN--;
+                }
+
+                /* Completed MCU, so update state */
+//              BITREAD_SAVE_STATE(cinfo,entropy.bitstate);
+                cinfo.buffer = br_state.buffer;
+                cinfo.bytes_in_buffer = br_state.bytes_in_buffer;
+                cinfo.bytes_offset = br_state.bytes_offset;
+                entropy.bitstate.get_buffer = get_buffer;
+                entropy.bitstate.bits_left = bits_left;
+
+                entropy.saved.EOBRUN = EOBRUN; /* only part of saved state we need */
+            }
+
+            /* Account for restart interval (no-op if not using restarts) */
+            entropy.restarts_to_go--;
+
+            return true;
+
+//          undoit:
+//              /* Re-zero any output coefficients that we made newly nonzero */
+//              while (num_newnz > 0)
+//                  (*block)[newnz_pos[--num_newnz]] = 0;
+//
+//              return false;
+
+        }
+
+        bool decode_mcu_AC_first (jpeg_decompress_struct cinfo, short[][] MCU_data) {
+            phuff_entropy_decoder entropy = this;
+            int Se = cinfo.Se;
+            int Al = cinfo.Al;
+            int s = 0, k, r;
+            int EOBRUN;
+            short[] block;
+//          BITREAD_STATE_VARS;
+            int get_buffer;
+            int bits_left;
+//          bitread_working_state br_state = new bitread_working_state();
+            bitread_working_state br_state = br_state_local;
+
+            d_derived_tbl tbl;
+
+            /* Process restart marker if needed; may have to suspend */
+            if (cinfo.restart_interval !is 0) {
+                if (entropy.restarts_to_go is 0)
+                    if (! process_restart(cinfo))
+                        return false;
+            }
+
+            /* If we've run out of data, just leave the MCU set to zeroes.
+             * This way, we return uniform gray for the remainder of the segment.
+             */
+            if (! entropy.insufficient_data) {
+
+                /* Load up working state.
+                 * We can avoid loading/saving bitread state if in an EOB run.
+                 */
+                EOBRUN = entropy.saved.EOBRUN;  /* only part of saved state we need */
+
+                /* There is always only one block per MCU */
+
+                if (EOBRUN > 0)     /* if it's a band of zeroes... */
+                    EOBRUN--;           /* ...process it now (we do nothing) */
+                else {
+//                  BITREAD_LOAD_STATE(cinfo,entropy.bitstate);
+                    br_state.cinfo = cinfo;
+                    br_state.buffer = cinfo.buffer;
+                    br_state.bytes_in_buffer = cinfo.bytes_in_buffer;
+                    br_state.bytes_offset = cinfo.bytes_offset;
+                    get_buffer = entropy.bitstate.get_buffer;
+                    bits_left = entropy.bitstate.bits_left;
+
+                    block = MCU_data[0];
+                    tbl = entropy.ac_derived_tbl;
+
+                    for (k = cinfo.Ss; k <= Se; k++) {
+//                      HUFF_DECODE(s, br_state, tbl, return FALSE, label2);
+                        {
+                        int nb = 0, look;
+                        if (bits_left < HUFF_LOOKAHEAD) {
+                            if (! jpeg_fill_bit_buffer(br_state,get_buffer,bits_left, 0)) {
+                                return false;
+                            }
+                            get_buffer = br_state.get_buffer; bits_left = br_state.bits_left;
+                            if (bits_left < HUFF_LOOKAHEAD) {
+                                nb = 1;
+//                              goto slowlabel;
+                                if ((s=jpeg_huff_decode(br_state,get_buffer,bits_left,tbl,nb)) < 0) {
+                                    return false;
+                                }
+                                get_buffer = br_state.get_buffer; bits_left = br_state.bits_left;
+                            }
+                        }
+                        if (nb !is 1) {
+//                          look = PEEK_BITS(HUFF_LOOKAHEAD);
+                            look = (( (get_buffer >> (bits_left -   (HUFF_LOOKAHEAD)))) & ((1<<(HUFF_LOOKAHEAD))-1));
+
+                            if ((nb = tbl.look_nbits[look]) !is 0) {
+//                              DROP_BITS(nb);
+                                bits_left -= nb;
+                                s = tbl.look_sym[look] & 0xFF;
+                            } else {
+                                nb = HUFF_LOOKAHEAD+1;
+//                              slowlabel:
+                                if ((s=jpeg_huff_decode(br_state,get_buffer,bits_left,tbl,nb)) < 0) {
+                                    return false;
+                                }
+                                get_buffer = br_state.get_buffer; bits_left = br_state.bits_left;
+                            }
+                        }
+                        }
+                        r = s >> 4;
+                        s &= 15;
+                        if (s !is 0) {
+                            k += r;
+//                          CHECK_BIT_BUFFER(br_state, s, return FALSE);
+                            {
+                            if (bits_left < (s)) {
+                                if (! jpeg_fill_bit_buffer(br_state,get_buffer,bits_left,s)) {
+                                    return false;
+                                }
+                                get_buffer = br_state.get_buffer; bits_left = br_state.bits_left;
+                            }
+                            }
+//                          r = GET_BITS(s);
+                            r = (( (get_buffer >> (bits_left -= (s)))) & ((1<<(s))-1));
+//                          s = HUFF_EXTEND(r, s);
+                            s = ((r) < extend_test[s] ? (r) + extend_offset[s] : (r));
+                            /* Scale and output coefficient in natural (dezigzagged) order */
+                            block[jpeg_natural_order[k]] = cast(short) (s << Al);
+                        } else {
+                            if (r is 15) {  /* ZRL */
+                                k += 15;        /* skip 15 zeroes in band */
+                            } else {        /* EOBr, run length is 2^r + appended bits */
+                                EOBRUN = 1 << r;
+                                if (r !is 0) {       /* EOBr, r > 0 */
+//                                  CHECK_BIT_BUFFER(br_state, r, return FALSE);
+                                    {
+                                    if (bits_left < (r)) {
+                                        if (! jpeg_fill_bit_buffer(br_state,get_buffer,bits_left,r)) {
+                                            return false;
+                                        }
+                                        get_buffer = br_state.get_buffer; bits_left = br_state.bits_left;
+                                    }
+                                    }
+//                                  r = GET_BITS(r);
+                                    r = (( (get_buffer >> (bits_left -= (r)))) & ((1<<(r))-1));
+                                    EOBRUN += r;
+                                }
+                                EOBRUN--;       /* this band is processed at this moment */
+                                break;      /* force end-of-band */
+                            }
+                        }
+                    }
+
+//                  BITREAD_SAVE_STATE(cinfo,entropy.bitstate);
+                    cinfo.buffer = br_state.buffer;
+                    cinfo.bytes_in_buffer = br_state.bytes_in_buffer;
+                    cinfo.bytes_offset = br_state.bytes_offset;
+                    entropy.bitstate.get_buffer = get_buffer;
+                    entropy.bitstate.bits_left = bits_left;
+                }
+
+                /* Completed MCU, so update state */
+                entropy.saved.EOBRUN = EOBRUN;  /* only part of saved state we need */
+            }
+
+            /* Account for restart interval (no-op if not using restarts) */
+            entropy.restarts_to_go--;
+
+            return true;
+        }
+
+        bool decode_mcu_DC_first (jpeg_decompress_struct cinfo, short[][] MCU_data) {     
+            phuff_entropy_decoder entropy = this;
+            int Al = cinfo.Al;
+            int s = 0, r;
+            int blkn, ci;
+            short[] block;
+//          BITREAD_STATE_VARS;
+            int get_buffer;
+            int bits_left;
+//          bitread_working_state br_state = new bitread_working_state();
+            bitread_working_state br_state = br_state_local;
+
+//          savable_state state = new savable_state();
+            savable_state state = state_local;
+            d_derived_tbl tbl;
+            jpeg_component_info compptr;
+
+            /* Process restart marker if needed; may have to suspend */
+            if (cinfo.restart_interval !is 0) {
+                if (entropy.restarts_to_go is 0)
+                    if (! process_restart(cinfo))
+                        return false;
+            }
+
+            /* If we've run out of data, just leave the MCU set to zeroes.
+             * This way, we return uniform gray for the remainder of the segment.
+             */
+            if (! entropy.insufficient_data) {
+
+                /* Load up working state */
+//              BITREAD_LOAD_STATE(cinfo,entropy.bitstate);
+                br_state.cinfo = cinfo;
+                br_state.buffer = cinfo.buffer;
+                br_state.bytes_in_buffer = cinfo.bytes_in_buffer;
+                br_state.bytes_offset = cinfo.bytes_offset;
+                get_buffer = entropy.bitstate.get_buffer;
+                bits_left = entropy.bitstate.bits_left;
+
+//              ASSIGN_STATE(state, entropy.saved);
+                state.EOBRUN = entropy.saved.EOBRUN;
+                state.last_dc_val[0] = entropy.saved.last_dc_val[0];
+                state.last_dc_val[1] = entropy.saved.last_dc_val[1];
+                state.last_dc_val[2] = entropy.saved.last_dc_val[2];
+                state.last_dc_val[3] = entropy.saved.last_dc_val[3];
+
+                /* Outer loop handles each block in the MCU */
+
+                for (blkn = 0; blkn < cinfo.blocks_in_MCU; blkn++) {
+                    block = MCU_data[blkn];
+                    ci = cinfo.MCU_membership[blkn];
+                    compptr = cinfo.cur_comp_info[ci];
+                    tbl = entropy.derived_tbls[compptr.dc_tbl_no];
+
+                    /* Decode a single block's worth of coefficients */
+
+                    /* Section F.2.2.1: decode the DC coefficient difference */
+//                  HUFF_DECODE(s, br_state, tbl, return FALSE, label1);
+                    {
+                    int nb = 0, look;
+                    if (bits_left < HUFF_LOOKAHEAD) {
+                        if (! jpeg_fill_bit_buffer(br_state,get_buffer,bits_left, 0)) {
+                            return false;
+                        }
+                        get_buffer = br_state.get_buffer; bits_left = br_state.bits_left;
+                        if (bits_left < HUFF_LOOKAHEAD) {
+                            nb = 1;
+//                          goto slowlabel;
+                            if ((s=jpeg_huff_decode(br_state,get_buffer,bits_left,tbl,nb)) < 0) {
+                                return false;
+                            }
+                            get_buffer = br_state.get_buffer; bits_left = br_state.bits_left;
+                        }
+                    }
+                    if (nb !is 1) {
+//                      look = PEEK_BITS(HUFF_LOOKAHEAD);
+                        look = (( (get_buffer >> (bits_left -   (HUFF_LOOKAHEAD)))) & ((1<<(HUFF_LOOKAHEAD))-1));
+
+                        if ((nb = tbl.look_nbits[look]) !is 0) {
+//                          DROP_BITS(nb);
+                            bits_left -= nb;
+                            s = tbl.look_sym[look] & 0xFF;
+                        } else {
+                            nb = HUFF_LOOKAHEAD+1;
+//                          slowlabel:
+                            if ((s=jpeg_huff_decode(br_state,get_buffer,bits_left,tbl,nb)) < 0) {
+                                return false;
+                            }
+                            get_buffer = br_state.get_buffer; bits_left = br_state.bits_left;
+                        }
+                    }
+                    }
+                    if (s !is 0) {
+//                      CHECK_BIT_BUFFER(br_state, s, return FALSE);
+                        {
+                        if (bits_left < (s)) {
+                            if (! jpeg_fill_bit_buffer(br_state,get_buffer,bits_left,s)) {
+                                return false;
+                            }
+                            get_buffer = br_state.get_buffer; bits_left = br_state.bits_left;
+                        }
+                        }
+//                      r = GET_BITS(s);
+                        r = (( (get_buffer >> (bits_left -= (s)))) & ((1<<(s))-1));
+//                      s = HUFF_EXTEND(r, s);
+                        s = ((r) < extend_test[s] ? (r) + extend_offset[s] : (r));
+                    }
+
+                        /* Convert DC difference to actual value, update last_dc_val */
+                    s += state.last_dc_val[ci];
+                    state.last_dc_val[ci] = s;
+                    /* Scale and output the coefficient (assumes jpeg_natural_order[0]=0) */
+                    block[0] = cast(short) (s << Al);
+                }
+
+                /* Completed MCU, so update state */
+//              BITREAD_SAVE_STATE(cinfo,entropy.bitstate);
+                cinfo.buffer = br_state.buffer;
+                cinfo.bytes_in_buffer = br_state.bytes_in_buffer;
+                cinfo.bytes_offset = br_state.bytes_offset;
+                entropy.bitstate.get_buffer = get_buffer;
+                entropy.bitstate.bits_left = bits_left;
+//              ASSIGN_STATE(entropy.saved, state);
+                entropy.saved.EOBRUN = state.EOBRUN;
+                entropy.saved.last_dc_val[0] = state.last_dc_val[0];
+                entropy.saved.last_dc_val[1] = state.last_dc_val[1];
+                entropy.saved.last_dc_val[2] = state.last_dc_val[2];
+                entropy.saved.last_dc_val[3] = state.last_dc_val[3];
+            }
+
+            /* Account for restart interval (no-op if not using restarts) */
+            entropy.restarts_to_go--;
+
+            return true;
+        }
+
+        bool process_restart (jpeg_decompress_struct cinfo) {
+            phuff_entropy_decoder entropy = this;
+            int ci;
+
+            /* Throw away any unused bits remaining in bit buffer; */
+            /* include any full bytes in next_marker's count of discarded bytes */
+            cinfo.marker.discarded_bytes += entropy.bitstate.bits_left / 8;
+            entropy.bitstate.bits_left = 0;
+
+            /* Advance past the RSTn marker */
+            if (! read_restart_marker (cinfo))
+                return false;
+
+            /* Re-initialize DC predictions to 0 */
+            for (ci = 0; ci < cinfo.comps_in_scan; ci++)
+                entropy.saved.last_dc_val[ci] = 0;
+                /* Re-init EOB run count, too */
+            entropy.saved.EOBRUN = 0;
+
+            /* Reset restart counter */
+            entropy.restarts_to_go = cinfo.restart_interval;
+
+            /* Reset out-of-data flag, unless read_restart_marker left us smack up
+             * against a marker.    In that case we will end up treating the next data
+             * segment as empty, and we can avoid producing bogus output pixels by
+             * leaving the flag set.
+             */
+            if (cinfo.unread_marker is 0)
+                entropy.insufficient_data = false;
+
+            return true;
+        }
+
+        void start_pass_phuff_decoder (jpeg_decompress_struct cinfo) {
+            phuff_entropy_decoder entropy = this;
+            bool is_DC_band, bad;
+            int ci, coefi, tbl;
+            int[] coef_bit_ptr;
+            jpeg_component_info compptr;
+
+            is_DC_band = (cinfo.Ss is 0);
+
+            /* Validate scan parameters */
+            bad = false;
+            if (is_DC_band) {
+                if (cinfo.Se !is 0)
+                    bad = true;
+            } else {
+                /* need not check Ss/Se < 0 since they came from unsigned bytes */
+                if (cinfo.Ss > cinfo.Se || cinfo.Se >= DCTSIZE2)
+                    bad = true;
+                /* AC scans may have only one component */
+                if (cinfo.comps_in_scan !is 1)
+                    bad = true;
+            }
+            if (cinfo.Ah !is 0) {
+                /* Successive approximation refinement scan: must have Al = Ah-1. */
+                if (cinfo.Al !is cinfo.Ah-1)
+                    bad = true;
+            }
+            if (cinfo.Al > 13)      /* need not check for < 0 */
+                bad = true;
+            /* Arguably the maximum Al value should be less than 13 for 8-bit precision,
+             * but the spec doesn't say so, and we try to be liberal about what we
+             * accept.  Note: large Al values could result in out-of-range DC
+             * coefficients during early scans, leading to bizarre displays due to
+             * overflows in the IDCT math.  But we won't crash.
+             */
+            if (bad)
+                error();
+//              ERREXIT4(cinfo, JERR_BAD_PROGRESSION, cinfo.Ss, cinfo.Se, cinfo.Ah, cinfo.Al);
+            /* Update progression status, and verify that scan order is legal.
+             * Note that inter-scan inconsistencies are treated as warnings
+             * not fatal errors ... not clear if this is right way to behave.
+             */
+            for (ci = 0; ci < cinfo.comps_in_scan; ci++) {
+                int cindex = cinfo.cur_comp_info[ci].component_index;
+                coef_bit_ptr = cinfo.coef_bits[cindex];
+                if (!is_DC_band && coef_bit_ptr[0] < 0) {/* AC without prior DC scan */
+//                  WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0);
+                }
+                for (coefi = cinfo.Ss; coefi <= cinfo.Se; coefi++) {
+                    int expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi];
+                    if (cinfo.Ah !is expected) {
+//                      WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, coefi);
+                    }
+                    coef_bit_ptr[coefi] = cinfo.Al;
+                }
+            }
+
+            /* Select MCU decoding routine */
+//          if (cinfo.Ah is 0) {
+//              if (is_DC_band)
+//                  entropy.pub.decode_mcu = decode_mcu_DC_first;
+//              else
+//                  entropy.pub.decode_mcu = decode_mcu_AC_first;
+//          } else {
+//              if (is_DC_band)
+//                  entropy.pub.decode_mcu = decode_mcu_DC_refine;
+//              else
+//                  entropy.pub.decode_mcu = decode_mcu_AC_refine;
+//          }
+
+            for (ci = 0; ci < cinfo.comps_in_scan; ci++) {
+                compptr = cinfo.cur_comp_info[ci];
+                /* Make sure requested tables are present, and compute derived tables.
+                 * We may build same derived table more than once, but it's not expensive.
+                 */
+                if (is_DC_band) {
+                    if (cinfo.Ah is 0) {    /* DC refinement needs no table */
+                        tbl = compptr.dc_tbl_no;
+                        jpeg_make_d_derived_tbl(cinfo, true, tbl, entropy.derived_tbls[tbl] = new d_derived_tbl());
+                    }
+                } else {
+                    tbl = compptr.ac_tbl_no;
+                    jpeg_make_d_derived_tbl(cinfo, false, tbl, entropy.derived_tbls[tbl] = new d_derived_tbl());
+                    /* remember the single active table */
+                    entropy.ac_derived_tbl = entropy.derived_tbls[tbl];
+                }
+                /* Initialize DC predictions to 0 */
+                entropy.saved.last_dc_val[ci] = 0;
+            }
+
+            /* Initialize bitread state variables */
+            entropy.bitstate.bits_left = 0;
+            entropy.bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */
+            entropy.insufficient_data = false;
+
+            /* Initialize private state variables */
+            entropy.saved.EOBRUN = 0;
+
+            /* Initialize restart counter */
+            entropy.restarts_to_go = cinfo.restart_interval;
+        }
+
+    }
+
+    static final class jpeg_component_info {
+        /* These values are fixed over the whole image. */
+        /* For compression, they must be supplied by parameter setup; */
+        /* for decompression, they are read from the SOF marker. */
+        int component_id;       /* identifier for this component (0..255) */
+        int component_index;        /* its index in SOF or cinfo.comp_info[] */
+        int h_samp_factor;      /* horizontal sampling factor (1..4) */
+        int v_samp_factor;      /* vertical sampling factor (1..4) */
+        int quant_tbl_no;       /* quantization table selector (0..3) */
+        /* These values may vary between scans. */
+        /* For compression, they must be supplied by parameter setup; */
+        /* for decompression, they are read from the SOS marker. */
+        /* The decompressor output side may not use these variables. */
+        int dc_tbl_no;      /* DC entropy table selector (0..3) */
+        int ac_tbl_no;      /* AC entropy table selector (0..3) */
+
+        /* Remaining fields should be treated as private by applications. */
+
+        /* These values are computed during compression or decompression startup: */
+        /* Component's size in DCT blocks.
+         * Any dummy blocks added to complete an MCU are not counted; therefore
+         * these values do not depend on whether a scan is interleaved or not.
+         */
+        int width_in_blocks;
+        int height_in_blocks;
+        /* Size of a DCT block in samples.  Always DCTSIZE for compression.
+         * For decompression this is the size of the output from one DCT block,
+         * reflecting any scaling we choose to apply during the IDCT step.
+         * Values of 1,2,4,8 are likely to be supported.    Note that different
+         * components may receive different IDCT scalings.
+         */
+        int DCT_scaled_size;
+        /* The downsampled dimensions are the component's actual, unpadded number
+         * of samples at the main buffer (preprocessing/compression interface), thus
+         * downsampled_width = ceil(image_width * Hi/Hmax)
+         * and similarly for height.    For decompression, IDCT scaling is included, so
+         * downsampled_width = ceil(image_width * Hi/Hmax * DCT_scaled_size/DCTSIZE)
+         */
+        int downsampled_width;   /* actual width in samples */
+        int downsampled_height; /* actual height in samples */
+        /* This flag is used only for decompression.    In cases where some of the
+         * components will be ignored (eg grayscale output from YCbCr image),
+         * we can skip most computations for the unused components.
+         */
+        bool component_needed;   /* do we need the value of this component? */
+
+        /* These values are computed before starting a scan of the component. */
+        /* The decompressor output side may not use these variables. */
+        int MCU_width;      /* number of blocks per MCU, horizontally */
+        int MCU_height;     /* number of blocks per MCU, vertically */
+        int MCU_blocks;     /* MCU_width * MCU_height */
+        int MCU_sample_width;       /* MCU width in samples, MCU_width*DCT_scaled_size */
+        int last_col_width;     /* # of non-dummy blocks across in last MCU */
+        int last_row_height;        /* # of non-dummy blocks down in last MCU */
+
+        /* Saved quantization table for component; null if none yet saved.
+         * See jdinput.c comments about the need for this information.
+         * This field is currently used only for decompression.
+         */
+        JQUANT_TBL quant_table;
+
+        /* Private per-component storage for DCT or IDCT subsystem. */
+        int[] dct_table;
+    }
+
+    static final class jpeg_color_quantizer {
+//      JMETHOD(void, start_pass, (j_decompress_ptr cinfo, bool is_pre_scan));
+//      JMETHOD(void, color_quantize, (j_decompress_ptr cinfo,
+//                   JSAMPARRAY input_buf, JSAMPARRAY output_buf,
+//                   int num_rows));
+//      JMETHOD(void, finish_pass, (j_decompress_ptr cinfo));
+//      JMETHOD(void, new_color_map, (j_decompress_ptr cinfo));
+
+        /* Initially allocated colormap is saved here */
+        int[][] sv_colormap;    /* The color map as a 2-D pixel array */
+        int sv_actual;      /* number of entries in use */
+
+        int[][] colorindex; /* Precomputed mapping for speed */
+        /* colorindex[i][j] = index of color closest to pixel value j in component i,
+         * premultiplied as described above.    Since colormap indexes must fit into
+         * JSAMPLEs, the entries of this array will too.
+         */
+        bool is_padded;      /* is the colorindex padded for odither? */
+
+        int[MAX_Q_COMPS] Ncolors;// = new int [MAX_Q_COMPS];    /* # of values alloced to each component */
+
+        /* Variables for ordered dithering */
+        int row_index;      /* cur row's vertical index in dither matrix */
+//          ODITHER_MATRIX_PTR odither[MAX_Q_COMPS]; /* one dither array per component */
+
+        /* Variables for Floyd-Steinberg dithering */
+//          FSERRPTR fserrors[MAX_Q_COMPS]; /* accumulated errors */
+        bool on_odd_row; 
+
+        void start_pass (jpeg_decompress_struct cinfo, bool is_pre_scan) {
+            error();
+        }
+    }
+
+    static final class jpeg_upsampler {
+//      JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
+//      JMETHOD(void, upsample, (j_decompress_ptr cinfo,
+//                   JSAMPIMAGE input_buf,
+//                   JDIMENSION *in_row_group_ctr,
+//                   JDIMENSION in_row_groups_avail,
+//                   JSAMPARRAY output_buf,
+//                   JDIMENSION *out_row_ctr,
+//                   JDIMENSION out_rows_avail));
+
+        bool need_context_rows;  /* TRUE if need rows above & below */
+
+        /* Color conversion buffer. When using separate upsampling and color
+         * conversion steps, this buffer holds one upsampled row group until it
+         * has been color converted and output.
+         * Note: we do not allocate any storage for component(s) which are full-size,
+         * ie do not need rescaling.    The corresponding entry of color_buf[] is
+         * simply set to point to the input data array, thereby avoiding copying.
+         */
+        byte[][][MAX_COMPONENTS] color_buf;// = new byte[MAX_COMPONENTS][][];
+        int[MAX_COMPONENTS] color_buf_offset;// = new int[MAX_COMPONENTS];
+
+        /* Per-component upsampling method pointers */
+        int[MAX_COMPONENTS] methods;// = new int[MAX_COMPONENTS];
+
+        int next_row_out;       /* counts rows emitted from color_buf */
+        int rows_to_go; /* counts rows remaining in image */
+
+        /* Height of an input row group for each component. */
+        int[MAX_COMPONENTS] rowgroup_height;// = new int[MAX_COMPONENTS];
+
+        /* These arrays save pixel expansion factors so that int_expand need not
+         * recompute them each time.    They are unused for other upsampling methods.
+         */
+        byte[MAX_COMPONENTS] h_expand;// = new byte[MAX_COMPONENTS];
+        byte[MAX_COMPONENTS] v_expand;// = new byte[MAX_COMPONENTS];
+
+        void start_pass (jpeg_decompress_struct cinfo) {
+            jpeg_upsampler upsample = cinfo.upsample;
+
+            /* Mark the conversion buffer empty */
+            upsample.next_row_out = cinfo.max_v_samp_factor;
+            /* Initialize total-height counter for detecting bottom of image */
+            upsample.rows_to_go = cinfo.output_height;
+        }
+
+    }
+
+    static final class jpeg_marker_reader {
+        /* Read a restart marker --- exported for use by entropy decoder only */
+//      jpeg_marker_parser_method read_restart_marker;
+
+        /* State of marker reader --- nominally internal, but applications
+         * supplying COM or APPn handlers might like to know the state.
+         */
+        bool saw_SOI;        /* found SOI? */
+        bool saw_SOF;        /* found SOF? */
+        int next_restart_num;       /* next restart number expected (0-7) */
+        int discarded_bytes;    /* # of bytes skipped looking for a marker */
+
+        /* Application-overridable marker processing methods */
+//      jpeg_marker_parser_method process_COM;
+//      jpeg_marker_parser_method process_APPn[16];
+
+        /* Limit on marker data length to save for each marker type */
+        int length_limit_COM;
+        int[16] length_limit_APPn;// = new int[16];
+
+        /* Status of COM/APPn marker saving */
+//      jpeg_marker_reader cur_marker;  /* null if not processing a marker */
+//      int bytes_read;     /* data bytes read so far in marker */
+        /* Note: cur_marker is not linked into marker_list until it's all read. */
+    }
+
+
+    static final class jpeg_d_main_controller {
+//      JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode));
+        int process_data;
+
+         /* Pointer to allocated workspace (M or M+2 row groups). */
+        byte[][][MAX_COMPONENTS] buffer;// = new byte[MAX_COMPONENTS][][];
+        int[MAX_COMPONENTS] buffer_offset;// = new int[MAX_COMPONENTS];
+
+        bool buffer_full;        /* Have we gotten an iMCU row from decoder? */
+        int[1] rowgroup_ctr;// = new int[1];    /* counts row groups output to postprocessor */
+
+        /* Remaining fields are only used in the context case. */
+
+        /* These are the master pointers to the funny-order pointer lists. */
+        byte[][][][2] xbuffer;// = new byte[2][][][];   /* pointers to weird pointer lists */
+        int[][2] xbuffer_offset;// = new int[2][];
+
+        int whichptr;           /* indicates which pointer set is now in use */
+        int context_state;      /* process_data state machine status */
+        int rowgroups_avail;    /* row groups available to postprocessor */
+        int iMCU_row_ctr;   /* counts iMCU rows to detect image top/bot */
+
+        void start_pass (jpeg_decompress_struct cinfo, int pass_mode) {
+            jpeg_d_main_controller main = cinfo.main;
+
+            switch (pass_mode) {
+                case JBUF_PASS_THRU:
+                    if (cinfo.upsample.need_context_rows) {
+                        main.process_data = PROCESS_DATA_CONTEXT_MAIN;
+                        make_funny_pointers(cinfo); /* Create the xbuffer[] lists */
+                        main.whichptr = 0;  /* Read first iMCU row into xbuffer[0] */
+                        main.context_state = CTX_PREPARE_FOR_IMCU;
+                        main.iMCU_row_ctr = 0;
+                    } else {
+                        /* Simple case with no context needed */
+                        main.process_data = PROCESS_DATA_SIMPLE_MAIN;
+                    }
+                    main.buffer_full = false;   /* Mark buffer empty */
+                    main.rowgroup_ctr[0] = 0;
+                    break;
+//              #ifdef QUANT_2PASS_SUPPORTED
+//              case JBUF_CRANK_DEST:
+//                  /* For last pass of 2-pass quantization, just crank the postprocessor */
+//                  main.process_data = PROCESS_DATA_CRANK_POST;
+//                  break;
+//              #endif
+                default:
+                    error();
+//                  ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+                    break;
+            }
+        }
+
+    }
+
+    static final class jpeg_decomp_master {
+//      JMETHOD(void, prepare_for_output_pass, (j_decompress_ptr cinfo));
+//      JMETHOD(void, finish_output_pass, (j_decompress_ptr cinfo));
+
+        /* State variables made visible to other modules */
+        bool is_dummy_pass;
+
+        int pass_number;        /* # of passes completed */
+
+        bool using_merged_upsample; /* true if using merged upsample/cconvert */
+
+        /* Saved references to initialized quantizer modules,
+         * in case we need to switch modes.
+         */
+        jpeg_color_quantizer quantizer_1pass;
+        jpeg_color_quantizer quantizer_2pass;
+    }
+
+    static final class jpeg_inverse_dct {
+//      JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
+//      /* It is useful to allow each component to have a separate IDCT method. */
+//      inverse_DCT_method_ptr inverse_DCT[MAX_COMPONENTS];
+        int[MAX_COMPONENTS] cur_method;// = new int[MAX_COMPONENTS];
+
+        void start_pass (jpeg_decompress_struct cinfo) {
+            jpeg_inverse_dct idct = cinfo.idct;
+            int ci, i;
+            jpeg_component_info compptr;
+            int method = 0;
+//          inverse_DCT_method_ptr method_ptr = NULL;
+            JQUANT_TBL qtbl;
+
+            for (ci = 0; ci < cinfo.num_components; ci++) {
+                compptr = cinfo.comp_info[ci];
+                /* Select the proper IDCT routine for this component's scaling */
+                switch (compptr.DCT_scaled_size) {
+//                  #ifdef IDCT_SCALING_SUPPORTED
+//                  case 1:
+//                      method_ptr = jpeg_idct_1x1;
+//                      method = JDCT_ISLOW;    /* jidctred uses islow-style table */
+//                      break;
+//                  case 2:
+//                      method_ptr = jpeg_idct_2x2;
+//                      method = JDCT_ISLOW;    /* jidctred uses islow-style table */
+//                      break;
+//                  case 4:
+//                      method_ptr = jpeg_idct_4x4;
+//                      method = JDCT_ISLOW;    /* jidctred uses islow-style table */
+//                      break;
+//                  #endif
+                    case DCTSIZE:
+                        switch (cinfo.dct_method) {
+//                          #ifdef DCT_ISLOW_SUPPORTED
+                            case JDCT_ISLOW:
+//                              method_ptr = jpeg_idct_islow;
+                                method = JDCT_ISLOW;
+                                break;
+//                          #endif
+//                          #ifdef DCT_IFAST_SUPPORTED
+//                          case JDCT_IFAST:
+//                              method_ptr = jpeg_idct_ifast;
+//                              method = JDCT_IFAST;
+//                              break;
+//                          #endif
+//                          #ifdef DCT_FLOAT_SUPPORTED
+//                          case JDCT_FLOAT:
+//                              method_ptr = jpeg_idct_float;
+//                              method = JDCT_FLOAT;
+//                              break;
+//                          #endif
+                            default:
+                                error();
+//                              ERREXIT(cinfo, JERR_NOT_COMPILED);
+                                break;
+                        }
+                        break;
+                    default:
+                        error();
+//                      ERREXIT1(cinfo, JERR_BAD_DCTSIZE, compptr.DCT_scaled_size);
+                        break;
+                    }
+//                  idct.inverse_DCT[ci] = method_ptr;
+                    /* Create multiplier table from quant table.
+                     * However, we can skip this if the component is uninteresting
+                     * or if we already built the table.    Also, if no quant table
+                     * has yet been saved for the component, we leave the
+                     * multiplier table all-zero; we'll be reading zeroes from the
+                     * coefficient controller's buffer anyway.
+                     */
+                    if (! compptr.component_needed || idct.cur_method[ci] is method)
+                        continue;
+                    qtbl = compptr.quant_table;
+                    if (qtbl is null)       /* happens if no data yet for component */
+                        continue;
+                    idct.cur_method[ci] = method;
+                    switch (method) {
+//                      #ifdef PROVIDE_ISLOW_TABLES
+                        case JDCT_ISLOW:
+                        {
+                            /* For LL&M IDCT method, multipliers are equal to raw quantization
+                             * coefficients, but are stored as ints to ensure access efficiency.
+                             */
+                            int[] ismtbl = compptr.dct_table;
+                            for (i = 0; i < DCTSIZE2; i++) {
+                                ismtbl[i] = qtbl.quantval[i];
+                            }
+                        }
+                        break;
+//                      #endif
+//                      #ifdef DCT_IFAST_SUPPORTED
+//                      case JDCT_IFAST:
+//                      {
+//                          /* For AA&N IDCT method, multipliers are equal to quantization
+//                           * coefficients scaled by scalefactor[row]*scalefactor[col], where
+//                           *   scalefactor[0] = 1
+//                           *   scalefactor[k] = cos(k*PI/16) * sqrt(2)        for k=1..7
+//                           * For integer operation, the multiplier table is to be scaled by
+//                           * IFAST_SCALE_BITS.
+//                           */
+//                          int[] ifmtbl = compptr.dct_table;
+//                          short aanscales[] = {
+//                              /* precomputed values scaled up by 14 bits */
+//                              16384, 22725, 21407, 19266, 16384, 12873,   8867,   4520,
+//                              22725, 31521, 29692, 26722, 22725, 17855, 12299,    6270,
+//                              21407, 29692, 27969, 25172, 21407, 16819, 11585,    5906,
+//                              19266, 26722, 25172, 22654, 19266, 15137, 10426,    5315,
+//                              16384, 22725, 21407, 19266, 16384, 12873,   8867,   4520,
+//                              12873, 17855, 16819, 15137, 12873, 10114,   6967,   3552,
+//                              8867, 12299, 11585, 10426,  8867,   6967,   4799,   2446,
+//                              4520,   6270,   5906,   5315,   4520,   3552,   2446,   1247
+//                          };
+//                          SHIFT_TEMPS
+//
+//                          for (i = 0; i < DCTSIZE2; i++) {
+//                              ifmtbl[i] = DESCALE(MULTIPLY16V16( qtbl.quantval[i], aanscales[i]), CONST_BITS-IFAST_SCALE_BITS);
+//                          }
+//                      }
+//                      break;
+//                      #endif
+//                      #ifdef DCT_FLOAT_SUPPORTED
+//                      case JDCT_FLOAT:
+//                      {
+//                          /* For float AA&N IDCT method, multipliers are equal to quantization
+//                           * coefficients scaled by scalefactor[row]*scalefactor[col], where
+//                           *   scalefactor[0] = 1
+//                           *   scalefactor[k] = cos(k*PI/16) * sqrt(2)        for k=1..7
+//                           */
+//                          FLOAT_MULT_TYPE * fmtbl = (FLOAT_MULT_TYPE *) compptr.dct_table;
+//                          int row, col;
+//                          static const double aanscalefactor[DCTSIZE] = {
+//                              1.0, 1.387039845, 1.306562965, 1.175875602,
+//                              1.0, 0.785694958, 0.541196100, 0.275899379
+//                          };
+//
+//                          i = 0;
+//                          for (row = 0; row < DCTSIZE; row++) {
+//                              for (col = 0; col < DCTSIZE; col++) {
+//                                  fmtbl[i] = (FLOAT_MULT_TYPE)
+//                                      ((double) qtbl.quantval[i] *
+//                                   aanscalefactor[row] * aanscalefactor[col]);
+//                                  i++;
+//                              }
+//                          }
+//                      }
+//                      break;
+//                      #endif
+                    default:
+                        error();
+//                      ERREXIT(cinfo, JERR_NOT_COMPILED);
+                        break;
+                }
+            }
+        }
+    }
+
+    static final class jpeg_input_controller {
+        int consume_input;
+        bool has_multiple_scans; /* True if file has multiple scans */
+        bool eoi_reached;
+
+        bool inheaders;      /* true until first SOS is reached */
+    }
+
+    static final class  jpeg_color_deconverter {
+//      JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
+        int color_convert;
+
+        /* Private state for YCC.RGB conversion */
+        int[] Cr_r_tab;     /* => table for Cr to R conversion */
+        int[] Cb_b_tab;     /* => table for Cb to B conversion */
+        int[] Cr_g_tab;     /* => table for Cr to G conversion */
+        int[] Cb_g_tab;     /* => table for Cb to G conversion */
+
+        void start_pass (jpeg_decompress_struct cinfo) {
+            /* no work needed */
+        }
+
+    }
+
+    static final class jpeg_d_post_controller {
+//      JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode));
+        int post_process_data;
+
+        /* Color quantization source buffer: this holds output data from
+         * the upsample/color conversion step to be passed to the quantizer.
+         * For two-pass color quantization, we need a full-image buffer;
+         * for one-pass operation, a strip buffer is sufficient.
+         */
+        int[] whole_image;  /* virtual array, or NULL if one-pass */
+        int[][] buffer;     /* strip buffer, or current strip of virtual */
+        int strip_height;   /* buffer size in rows */
+        /* for two-pass mode only: */
+        int starting_row;   /* row # of first row in current strip */
+        int next_row;       /* index of next row to fill/empty in strip */
+
+        void start_pass (jpeg_decompress_struct cinfo, int pass_mode) {
+            jpeg_d_post_controller post = cinfo.post;
+
+            switch (pass_mode) {
+                case JBUF_PASS_THRU:
+                    if (cinfo.quantize_colors) {
+                        error(SWT.ERROR_NOT_IMPLEMENTED);
+//                      /* Single-pass processing with color quantization. */
+//                      post.post_process_data = POST_PROCESS_1PASS;
+//                      /* We could be doing buffered-image output before starting a 2-pass
+//                       * color quantization; in that case, jinit_d_post_controller did not
+//                       * allocate a strip buffer. Use the virtual-array buffer as workspace.
+//                       */
+//                      if (post.buffer is null) {
+//                          post.buffer = (*cinfo.mem.access_virt_sarray)
+//                              ((j_common_ptr) cinfo, post.whole_image,
+//                              (JDIMENSION) 0, post.strip_height, TRUE);
+//                      }
+                    } else {
+                        /* For single-pass processing without color quantization,
+                         * I have no work to do; just call the upsampler directly.
+                         */
+                        post.post_process_data = POST_PROCESS_DATA_UPSAMPLE;
+                    }
+                    break;
+//              #ifdef QUANT_2PASS_SUPPORTED
+//              case JBUF_SAVE_AND_PASS:
+//                  /* First pass of 2-pass quantization */
+//                  if (post.whole_image is NULL)
+//                      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+//                  post.pub.post_process_data = post_process_prepass;
+//                  break;
+//              case JBUF_CRANK_DEST:
+//                  /* Second pass of 2-pass quantization */
+//                  if (post.whole_image is NULL)
+//                      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+//                  post.pub.post_process_data = post_process_2pass;
+//                  break;
+//              #endif /* QUANT_2PASS_SUPPORTED */
+                    default:
+                        error();
+//                      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+                        break;
+            }
+            post.starting_row = post.next_row = 0;
+        }
+
+    }
+
+    static final class jpeg_decompress_struct {
+//      jpeg_error_mgr * err;   /* Error handler module */\
+//      struct jpeg_memory_mgr * mem;   /* Memory manager module */\
+//      struct jpeg_progress_mgr * progress; /* Progress monitor, or null if none */\
+//      void * client_data;     /* Available for use by application */\
+        bool is_decompressor;    /* So common code can tell which is which */
+        int global_state;       /* For checking call sequence validity */
+
+//      /* Source of compressed data */
+//      struct jpeg_source_mgr * src;
+        InputStream inputStream;
+        byte[] buffer;
+        int bytes_in_buffer;
+        int bytes_offset;
+        bool start_of_file;
+
+        /* Basic description of image --- filled in by jpeg_read_header(). */
+        /* Application may inspect these values to decide how to process image. */
+
+        int image_width;    /* nominal image width (from SOF marker) */
+        int image_height;   /* nominal image height */
+        int num_components;     /* # of color components in JPEG image */
+        int jpeg_color_space; /* colorspace of JPEG image */
+
+        /* Decompression processing parameters --- these fields must be set before
+         * calling jpeg_start_decompress(). Note that jpeg_read_header() initializes
+         * them to default values.
+         */
+
+        int out_color_space; /* colorspace for output */
+
+        int scale_num, scale_denom; /* fraction by which to scale image */
+
+        double output_gamma;        /* image gamma wanted in output */
+
+        bool buffered_image; /* true=multiple output passes */
+        bool raw_data_out;       /* true=downsampled data wanted */
+
+        int dct_method; /* IDCT algorithm selector */
+        bool do_fancy_upsampling;    /* true=apply fancy upsampling */
+        bool do_block_smoothing; /* true=apply interblock smoothing */
+
+        bool quantize_colors;    /* true=colormapped output wanted */
+        /* the following are ignored if not quantize_colors: */
+        int dither_mode;    /* type of color dithering to use */
+        bool two_pass_quantize;  /* true=use two-pass color quantization */
+        int desired_number_of_colors;   /* max # colors to use in created colormap */
+        /* these are significant only in buffered-image mode: */
+        bool enable_1pass_quant; /* enable future use of 1-pass quantizer */
+        bool enable_external_quant;/* enable future use of external colormap */
+        bool enable_2pass_quant; /* enable future use of 2-pass quantizer */
+
+        /* Description of actual output image that will be returned to application.
+         * These fields are computed by jpeg_start_decompress().
+         * You can also use jpeg_calc_output_dimensions() to determine these values
+         * in advance of calling jpeg_start_decompress().
+         */
+
+        int output_width;   /* scaled image width */
+        int output_height;  /* scaled image height */
+        int out_color_components;   /* # of color components in out_color_space */
+        int output_components;  /* # of color components returned */
+        /* output_components is 1 (a colormap index) when quantizing colors;
+         * otherwise it equals out_color_components.
+         */
+        int rec_outbuf_height;  /* min recommended height of scanline buffer */
+        /* If the buffer passed to jpeg_read_scanlines() is less than this many rows
+         * high, space and time will be wasted due to unnecessary data copying.
+         * Usually rec_outbuf_height will be 1 or 2, at most 4.
+         */
+
+        /* When quantizing colors, the output colormap is described by these fields.
+         * The application can supply a colormap by setting colormap non-null before
+         * calling jpeg_start_decompress; otherwise a colormap is created during
+         * jpeg_start_decompress or jpeg_start_output.
+         * The map has out_color_components rows and actual_number_of_colors columns.
+         */
+        int actual_number_of_colors;    /* number of entries in use */
+        int[] colormap;     /* The color map as a 2-D pixel array */
+
+        /* State variables: these variables indicate the progress of decompression.
+         * The application may examine these but must not modify them.
+         */
+
+        /* Row index of next scanline to be read from jpeg_read_scanlines().
+         * Application may use this to control its processing loop, e.g.,
+         * "while (output_scanline < output_height)".
+         */
+        int output_scanline;    /* 0 .. output_height-1 */
+
+        /* Current input scan number and number of iMCU rows completed in scan.
+         * These indicate the progress of the decompressor input side.
+         */
+        int input_scan_number;  /* Number of SOS markers seen so far */
+        int input_iMCU_row; /* Number of iMCU rows completed */
+
+        /* The "output scan number" is the notional scan being displayed by the
+         * output side. The decompressor will not allow output scan/row number
+         * to get ahead of input scan/row, but it can fall arbitrarily far behind.
+         */
+        int output_scan_number; /* Nominal scan number being displayed */
+        int output_iMCU_row;    /* Number of iMCU rows read */
+
+        /* Current progression status.  coef_bits[c][i] indicates the precision
+         * with which component c's DCT coefficient i (in zigzag order) is known.
+         * It is -1 when no data has yet been received, otherwise it is the point
+         * transform (shift) value for the most recent scan of the coefficient
+         * (thus, 0 at completion of the progression).
+         * This pointer is null when reading a non-progressive file.
+         */
+        int[][] coef_bits;  /* -1 or current Al value for each coef */
+
+        /* Internal JPEG parameters --- the application usually need not look at
+         * these fields.    Note that the decompressor output side may not use
+         * any parameters that can change between scans.
+         */
+
+        /* Quantization and Huffman tables are carried forward across input
+         * datastreams when processing abbreviated JPEG datastreams.
+         */
+
+        JQUANT_TBL[NUM_QUANT_TBLS] quant_tbl_ptrs;// = new JQUANT_TBL[NUM_QUANT_TBLS];
+        /* ptrs to coefficient quantization tables, or null if not defined */
+
+        JHUFF_TBL[NUM_HUFF_TBLS] dc_huff_tbl_ptrs;// = new JHUFF_TBL[NUM_HUFF_TBLS];
+        JHUFF_TBL[NUM_HUFF_TBLS] ac_huff_tbl_ptrs;// = new JHUFF_TBL[NUM_HUFF_TBLS];
+        /* ptrs to Huffman coding tables, or null if not defined */
+
+        /* These parameters are never carried across datastreams, since they
+         * are given in SOF/SOS markers or defined to be reset by SOI.
+         */
+
+        int data_precision;     /* bits of precision in image data */
+
+        jpeg_component_info[] comp_info;
+        /* comp_info[i] describes component that appears i'th in SOF */
+
+        bool progressive_mode;   /* true if SOFn specifies progressive mode */
+        bool arith_code;     /* true=arithmetic coding, false=Huffman */
+
+        byte[NUM_ARITH_TBLS] arith_dc_L;// = new byte[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
+        byte[NUM_ARITH_TBLS] arith_dc_U;// = new byte[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
+        byte[NUM_ARITH_TBLS] arith_ac_K;// = new byte[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
+
+        int restart_interval; /* MCUs per restart interval, or 0 for no restart */
+
+        /* These fields record data obtained from optional markers recognized by
+         * the JPEG library.
+         */
+        bool saw_JFIF_marker;    /* true iff a JFIF APP0 marker was found */
+        /* Data copied from JFIF marker; only valid if saw_JFIF_marker is true: */
+        byte JFIF_major_version;    /* JFIF version number */
+        byte JFIF_minor_version;
+        byte density_unit;      /* JFIF code for pixel size units */
+        short X_density;        /* Horizontal pixel density */
+        short Y_density;        /* Vertical pixel density */
+        bool saw_Adobe_marker;   /* true iff an Adobe APP14 marker was found */
+        byte Adobe_transform;   /* Color transform code from Adobe marker */
+
+        bool CCIR601_sampling;   /* true=first samples are cosited */
+
+        /* Aside from the specific data retained from APPn markers known to the
+         * library, the uninterpreted contents of any or all APPn and COM markers
+         * can be saved in a list for examination by the application.
+         */
+        jpeg_marker_reader marker_list; /* Head of list of saved markers */
+
+        /* Remaining fields are known throughout decompressor, but generally
+         * should not be touched by a surrounding application.
+         */
+
+        /*
+         * These fields are computed during decompression startup
+         */
+        int max_h_samp_factor;  /* largest h_samp_factor */
+        int max_v_samp_factor;  /* largest v_samp_factor */
+
+        int min_DCT_scaled_size;    /* smallest DCT_scaled_size of any component */
+
+        int total_iMCU_rows;    /* # of iMCU rows in image */
+        /* The coefficient controller's input and output progress is measured in
+         * units of "iMCU" (interleaved MCU) rows.  These are the same as MCU rows
+         * in fully interleaved JPEG scans, but are used whether the scan is
+         * interleaved or not.  We define an iMCU row as v_samp_factor DCT block
+         * rows of each component.  Therefore, the IDCT output contains
+         * v_samp_factor*DCT_scaled_size sample rows of a component per iMCU row.
+         */
+
+        byte[] sample_range_limit; /* table for fast range-limiting */
+        int sample_range_limit_offset;
+
+        /*
+         * These fields are valid during any one scan.
+         * They describe the components and MCUs actually appearing in the scan.
+         * Note that the decompressor output side must not use these fields.
+         */
+        int comps_in_scan;      /* # of JPEG components in this scan */
+        jpeg_component_info[MAX_COMPS_IN_SCAN] cur_comp_info;// = new jpeg_component_info[MAX_COMPS_IN_SCAN];
+        /* *cur_comp_info[i] describes component that appears i'th in SOS */
+
+        int MCUs_per_row;   /* # of MCUs across the image */
+        int MCU_rows_in_scan;   /* # of MCU rows in the image */
+
+        int blocks_in_MCU;      /* # of DCT blocks per MCU */
+        int[D_MAX_BLOCKS_IN_MCU] MCU_membership;// = new int[D_MAX_BLOCKS_IN_MCU];
+        /* MCU_membership[i] is index in cur_comp_info of component owning */
+        /* i'th block in an MCU */
+
+        int Ss, Se, Ah, Al;     /* progressive JPEG parameters for scan */
+
+        /* This field is shared between entropy decoder and marker parser.
+         * It is either zero or the code of a JPEG marker that has been
+         * read from the data source, but has not yet been processed.
+         */
+        int unread_marker;
+
+        int[DCTSIZE2] workspace;// = new int[DCTSIZE2];
+        int[1] row_ctr;// = new int[1];
+
+        /*
+         * Links to decompression subobjects (methods, private variables of modules)
+         */
+        jpeg_decomp_master master;
+        jpeg_d_main_controller main;
+        jpeg_d_coef_controller coef;
+        jpeg_d_post_controller post;
+        jpeg_input_controller inputctl;
+        jpeg_marker_reader marker;
+        jpeg_entropy_decoder entropy;
+        jpeg_inverse_dct idct;
+        jpeg_upsampler upsample;
+        jpeg_color_deconverter cconvert;
+        jpeg_color_quantizer cquantize;
+    }
+
+static void error() {
+    SWT.error(SWT.ERROR_INVALID_IMAGE);
+}
+
+static void error(int code) {
+    SWT.error(code);
+}
+
+static void error(String msg) {
+    SWT.error(SWT.ERROR_INVALID_IMAGE, null, msg);
+}
+
+static void jinit_marker_reader (jpeg_decompress_struct cinfo) {
+    jpeg_marker_reader marker = cinfo.marker = new jpeg_marker_reader();
+//  int i;
+
+    /* Initialize COM/APPn processing.
+     * By default, we examine and then discard APP0 and APP14,
+     * but simply discard COM and all other APPn.
+     */
+//  marker.process_COM = skip_variable;
+    marker.length_limit_COM = 0;
+//  for (i = 0; i < 16; i++) {
+//      marker.process_APPn[i] = skip_variable;
+//      marker.length_limit_APPn[i] = 0;
+//  }
+//  marker.process_APPn[0] = get_interesting_appn;
+//  marker.process_APPn[14] = get_interesting_appn;
+    /* Reset marker processing state */
+    reset_marker_reader(cinfo);
+}
+
+static void jinit_d_coef_controller (jpeg_decompress_struct cinfo, bool need_full_buffer) {
+    jpeg_d_coef_controller coef = new jpeg_d_coef_controller();
+    cinfo.coef = coef;
+//  coef.pub.start_input_pass = start_input_pass;
+//  coef.pub.start_output_pass = start_output_pass;
+    coef.coef_bits_latch = null;
+
+    /* Create the coefficient buffer. */
+    if (need_full_buffer) {
+//#ifdef D_MULTISCAN_FILES_SUPPORTED
+        /* Allocate a full-image virtual array for each component, */
+        /* padded to a multiple of samp_factor DCT blocks in each direction. */
+        /* Note we ask for a pre-zeroed array. */
+        int ci, access_rows;
+        jpeg_component_info compptr;
+
+        for (ci = 0; ci < cinfo.num_components; ci++) {
+            compptr = cinfo.comp_info[ci];
+            access_rows = compptr.v_samp_factor;
+//#ifdef BLOCK_SMOOTHING_SUPPORTED
+            /* If block smoothing could be used, need a bigger window */
+            if (cinfo.progressive_mode)
+                access_rows *= 3;
+//#endif
+            coef.whole_image[ci] =
+                new short[][][](
+                    cast(int)jround_up( compptr.height_in_blocks, compptr.v_samp_factor),
+                    cast(int)jround_up( compptr.width_in_blocks, compptr.h_samp_factor),
+                    DCTSIZE2
+                    );
+        }
+//      coef.consume_data = consume_data;
+        coef.decompress_data = DECOMPRESS_DATA;
+        coef.coef_arrays = coef.whole_image[0]; /* link to virtual arrays */
+//      #else
+//              ERREXIT(cinfo, JERR_NOT_COMPILED);
+//      #endif
+    } else {
+        /* We only need a single-MCU buffer. */
+        foreach( inout el; coef.MCU_buffer ){
+            el = new short[](DCTSIZE2);
+        }
+//      coef.consume_data = dummy_consume_data;
+        coef.decompress_data = DECOMPRESS_ONEPASS;
+        coef.coef_arrays = null; /* flag for no virtual arrays */
+    }
+}
+
+static void start_output_pass (jpeg_decompress_struct cinfo) {
+//#ifdef BLOCK_SMOOTHING_SUPPORTED
+    jpeg_d_coef_controller coef = cinfo.coef;
+
+    /* If multipass, check to see whether to use block smoothing on this pass */
+    if (coef.coef_arrays !is null) {
+        if (cinfo.do_block_smoothing && smoothing_ok(cinfo))
+            coef.decompress_data = DECOMPRESS_SMOOTH_DATA;
+        else
+            coef.decompress_data = DECOMPRESS_DATA;
+    }
+//#endif
+    cinfo.output_iMCU_row = 0;
+}
+
+static void jpeg_create_decompress(jpeg_decompress_struct cinfo) {
+    cinfo.is_decompressor = true;
+
+
+    /* Initialize marker processor so application can override methods
+     * for COM, APPn markers before calling jpeg_read_header.
+     */
+    cinfo.marker_list = null;
+    jinit_marker_reader(cinfo);
+
+    /* And initialize the overall input controller. */
+    jinit_input_controller(cinfo);
+
+    /* OK, I'm ready */
+    cinfo.global_state = DSTATE_START;
+}
+
+static void jpeg_calc_output_dimensions (jpeg_decompress_struct cinfo)
+/* Do computations that are needed before master selection phase */
+{
+//#ifdef IDCT_SCALING_SUPPORTED
+//  int ci;
+//  jpeg_component_info compptr;
+//#endif
+
+    /* Prevent application from calling me at wrong times */
+    if (cinfo.global_state !is DSTATE_READY)
+        error();
+//      ERREXIT1(cinfo, JERR_BAD_STATE, cinfo.global_state);
+
+//#ifdef IDCT_SCALING_SUPPORTED
+//
+//  /* Compute actual output image dimensions and DCT scaling choices. */
+//  if (cinfo.scale_num * 8 <= cinfo.scale_denom) {
+//      /* Provide 1/8 scaling */
+//      cinfo.output_width = cast(int)
+//          jdiv_round_up(cinfo.image_width, 8L);
+//      cinfo.output_height = cast(int)
+//          jdiv_round_up(cinfo.image_height, 8L);
+//      cinfo.min_DCT_scaled_size = 1;
+//  } else if (cinfo.scale_num * 4 <= cinfo.scale_denom) {
+//      /* Provide 1/4 scaling */
+//      cinfo.output_width = cast(int)
+//          jdiv_round_up(cinfo.image_width, 4L);
+//      cinfo.output_height = cast(int)
+//          jdiv_round_up(cinfo.image_height, 4L);
+//      cinfo.min_DCT_scaled_size = 2;
+//  } else if (cinfo.scale_num * 2 <= cinfo.scale_denom) {
+//      /* Provide 1/2 scaling */
+//      cinfo.output_width = cast(int)
+//          jdiv_round_up(cinfo.image_width, 2L);
+//      cinfo.output_height = cast(int)
+//          jdiv_round_up(cinfo.image_height, 2L);
+//      cinfo.min_DCT_scaled_size = 4;
+//  } else {
+//      /* Provide 1/1 scaling */
+//      cinfo.output_width = cinfo.image_width;
+//      cinfo.output_height = cinfo.image_height;
+//      cinfo.min_DCT_scaled_size = DCTSIZE;
+//  }
+//  /* In selecting the actual DCT scaling for each component, we try to
+//   * scale up the chroma components via IDCT scaling rather than upsampling.
+//   * This saves time if the upsampler gets to use 1:1 scaling.
+//   * Note this code assumes that the supported DCT scalings are powers of 2.
+//   */
+//  for (ci = 0; ci < cinfo.num_components; ci++) {
+//      compptr = cinfo.comp_info[ci];
+//      int ssize = cinfo.min_DCT_scaled_size;
+//      while (ssize < DCTSIZE &&
+//          (compptr.h_samp_factor * ssize * 2 <= cinfo.max_h_samp_factor * cinfo.min_DCT_scaled_size) &&
+//          (compptr.v_samp_factor * ssize * 2 <= cinfo.max_v_samp_factor * cinfo.min_DCT_scaled_size))
+//      {
+//          ssize = ssize * 2;
+//      }
+//      compptr.DCT_scaled_size = ssize;
+//  }
+//
+//  /* Recompute downsampled dimensions of components;
+//   * application needs to know these if using raw downsampled data.
+//   */
+//  for (ci = 0; ci < cinfo.num_components; ci++) {
+//      compptr = cinfo.comp_info[ci];
+//      /* Size in samples, after IDCT scaling */
+//      compptr.downsampled_width = cast(int)
+//          jdiv_round_up(cast(long) cinfo.image_width * cast(long) (compptr.h_samp_factor * compptr.DCT_scaled_size),
+//              (cinfo.max_h_samp_factor * DCTSIZE));
+//      compptr.downsampled_height = cast(int)
+//          jdiv_round_up(cast(long) cinfo.image_height * cast(long) (compptr.v_samp_factor * compptr.DCT_scaled_size),
+//              (cinfo.max_v_samp_factor * DCTSIZE));
+//  }
+//
+//#else /* !IDCT_SCALING_SUPPORTED */
+
+    /* Hardwire it to "no scaling" */
+    cinfo.output_width = cinfo.image_width;
+    cinfo.output_height = cinfo.image_height;
+    /* jdinput.c has already initialized DCT_scaled_size to DCTSIZE,
+     * and has computed unscaled downsampled_width and downsampled_height.
+     */
+
+//#endif /* IDCT_SCALING_SUPPORTED */
+
+    /* Report number of components in selected colorspace. */
+    /* Probably this should be in the color conversion module... */
+    switch (cinfo.out_color_space) {
+        case JCS_GRAYSCALE:
+            cinfo.out_color_components = 1;
+            break;
+        case JCS_RGB:
+            if (RGB_PIXELSIZE !is 3) {
+                cinfo.out_color_components = RGB_PIXELSIZE;
+                break;
+            }
+            //FALLTHROUGH
+        case JCS_YCbCr:
+            cinfo.out_color_components = 3;
+            break;
+        case JCS_CMYK:
+        case JCS_YCCK:
+            cinfo.out_color_components = 4;
+            break;
+        default:            /* else must be same colorspace as in file */
+            cinfo.out_color_components = cinfo.num_components;
+            break;
+    }
+    cinfo.output_components = (cinfo.quantize_colors ? 1 : cinfo.out_color_components);
+
+    /* See if upsampler will want to emit more than one row at a time */
+    if (use_merged_upsample(cinfo))
+        cinfo.rec_outbuf_height = cinfo.max_v_samp_factor;
+    else
+        cinfo.rec_outbuf_height = 1;
+}
+
+static bool use_merged_upsample (jpeg_decompress_struct cinfo) {
+//#ifdef UPSAMPLE_MERGING_SUPPORTED
+    /* Merging is the equivalent of plain box-filter upsampling */
+    if (cinfo.do_fancy_upsampling || cinfo.CCIR601_sampling)
+        return false;
+    /* jdmerge.c only supports YCC=>RGB color conversion */
+    if (cinfo.jpeg_color_space !is JCS_YCbCr || cinfo.num_components !is 3 ||
+            cinfo.out_color_space !is JCS_RGB ||
+            cinfo.out_color_components !is RGB_PIXELSIZE)
+        return false;
+    /* and it only handles 2h1v or 2h2v sampling ratios */
+    if (cinfo.comp_info[0].h_samp_factor !is 2 ||
+            cinfo.comp_info[1].h_samp_factor !is 1 ||
+            cinfo.comp_info[2].h_samp_factor !is 1 ||
+            cinfo.comp_info[0].v_samp_factor >  2 ||
+            cinfo.comp_info[1].v_samp_factor !is 1 ||
+            cinfo.comp_info[2].v_samp_factor !is 1)
+        return false;
+    /* furthermore, it doesn't work if we've scaled the IDCTs differently */
+    if (cinfo.comp_info[0].DCT_scaled_size !is cinfo.min_DCT_scaled_size ||
+            cinfo.comp_info[1].DCT_scaled_size !is cinfo.min_DCT_scaled_size ||
+            cinfo.comp_info[2].DCT_scaled_size !is cinfo.min_DCT_scaled_size)
+        return false;
+    /* ??? also need to test for upsample-time rescaling, when & if supported */
+    return true;            /* by golly, it'll work... */
+//#else
+//  return false;
+//#endif
+}
+
+static void prepare_range_limit_table (jpeg_decompress_struct cinfo)
+/* Allocate and fill in the sample_range_limit table */
+{
+    byte[] table;
+    int i;
+
+    table = new byte[5 * (MAXJSAMPLE+1) + CENTERJSAMPLE];
+    int offset = (MAXJSAMPLE+1);    /* allow negative subscripts of simple table */
+    cinfo.sample_range_limit_offset = offset;
+    cinfo.sample_range_limit = table;
+    /* First segment of "simple" table: limit[x] = 0 for x < 0 */
+    /* Main part of "simple" table: limit[x] = x */
+    for (i = 0; i <= MAXJSAMPLE; i++)
+        table[i + offset] = cast(byte)i;
+    offset += CENTERJSAMPLE;    /* Point to where post-IDCT table starts */
+    /* End of simple table, rest of first half of post-IDCT table */
+    for (i = CENTERJSAMPLE; i < 2*(MAXJSAMPLE+1); i++)
+        table[i+offset] = cast(byte)MAXJSAMPLE;
+    /* Second half of post-IDCT table */
+    System.arraycopy(cinfo.sample_range_limit, cinfo.sample_range_limit_offset, table, offset + (4 * (MAXJSAMPLE+1) - CENTERJSAMPLE), CENTERJSAMPLE);
+}
+
+static void build_ycc_rgb_table (jpeg_decompress_struct cinfo) {
+    jpeg_color_deconverter cconvert = cinfo.cconvert;
+    int i;
+    int x;
+//  SHIFT_TEMPS
+
+    cconvert.Cr_r_tab = new int[MAXJSAMPLE+1];
+    cconvert.Cb_b_tab = new int[MAXJSAMPLE+1];
+    cconvert.Cr_g_tab = new int[MAXJSAMPLE+1];
+    cconvert.Cb_g_tab = new int[MAXJSAMPLE+1];
+
+    for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
+        /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
+        /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
+        /* Cr=>R value is nearest int to 1.40200 * x */
+        cconvert.Cr_r_tab[i] = (cast(int)(1.40200f * (1<<SCALEBITS) + 0.5f) * x + ONE_HALF) >> SCALEBITS;
+        /* Cb=>B value is nearest int to 1.77200 * x */
+        cconvert.Cb_b_tab[i] = (cast(int)(1.77200f * (1<<SCALEBITS) + 0.5f) * x + ONE_HALF) >> SCALEBITS;
+        /* Cr=>G value is scaled-up -0.71414 * x */
+        cconvert.Cr_g_tab[i] = (cast(int)(- (0.71414f * (1<<SCALEBITS) + 0.5f)) * x);
+        /* Cb=>G value is scaled-up -0.34414 * x */
+        /* We also add in ONE_HALF so that need not do it in inner loop */
+        cconvert.Cb_g_tab[i] = (cast(int)(- (0.34414f* (1<<SCALEBITS) + 0.5f)) * x + ONE_HALF);
+    }
+}
+
+static void jinit_color_deconverter (jpeg_decompress_struct cinfo) {
+    jpeg_color_deconverter cconvert = cinfo.cconvert = new jpeg_color_deconverter();
+//  cconvert.start_pass = start_pass_dcolor;
+
+    /* Make sure num_components agrees with jpeg_color_space */
+    switch (cinfo.jpeg_color_space) {
+        case JCS_GRAYSCALE:
+            if (cinfo.num_components !is 1)
+                error();
+//              ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
+            break;
+
+        case JCS_RGB:
+        case JCS_YCbCr:
+            if (cinfo.num_components !is 3)
+                error();
+//              ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
+            break;
+
+        case JCS_CMYK:
+        case JCS_YCCK:
+            if (cinfo.num_components !is 4)
+                error();
+//              ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
+            break;
+
+        default:            /* JCS_UNKNOWN can be anything */
+            if (cinfo.num_components < 1)
+                error();
+//              ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
+            break;
+    }
+
+    /* Set out_color_components and conversion method based on requested space.
+     * Also clear the component_needed flags for any unused components,
+     * so that earlier pipeline stages can avoid useless computation.
+     */
+
+    int ci;
+    switch (cinfo.out_color_space) {
+        case JCS_GRAYSCALE:
+            cinfo.out_color_components = 1;
+            if (cinfo.jpeg_color_space is JCS_GRAYSCALE || cinfo.jpeg_color_space is JCS_YCbCr) {
+                cconvert.color_convert = GRAYSCALE_CONVERT;
+                /* For color.grayscale conversion, only the Y (0) component is needed */
+                for (ci = 1; ci < cinfo.num_components; ci++)
+                    cinfo.comp_info[ci].component_needed = false;
+            } else
+                error();
+//              ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
+            break;
+
+        case JCS_RGB:
+            cinfo.out_color_components = RGB_PIXELSIZE;
+            if (cinfo.jpeg_color_space is JCS_YCbCr) {
+                cconvert.color_convert = YCC_RGB_CONVERT;
+                build_ycc_rgb_table(cinfo);
+            } else if (cinfo.jpeg_color_space is JCS_GRAYSCALE) {
+                cconvert.color_convert = GRAY_RGB_CONVERT;
+            } else if (cinfo.jpeg_color_space is JCS_RGB && RGB_PIXELSIZE is 3) {
+                cconvert.color_convert = NULL_CONVERT;
+            } else
+                error();
+//              ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
+                break;
+
+        case JCS_CMYK:
+            cinfo.out_color_components = 4;
+            if (cinfo.jpeg_color_space is JCS_YCCK) {
+                cconvert.color_convert = YCCK_CMYK_CONVERT;
+                build_ycc_rgb_table(cinfo);
+            } else if (cinfo.jpeg_color_space is JCS_CMYK) {
+                cconvert.color_convert = NULL_CONVERT;
+            } else
+                error();
+//              ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
+            break;
+
+        default:
+            /* Permit null conversion to same output space */
+            if (cinfo.out_color_space is cinfo.jpeg_color_space) {
+                cinfo.out_color_components = cinfo.num_components;
+                cconvert.color_convert = NULL_CONVERT;
+            } else  /* unsupported non-null conversion */
+                error();
+//              ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
+            break;
+    }
+
+    if (cinfo.quantize_colors)
+        cinfo.output_components = 1; /* single colormapped output component */
+    else
+        cinfo.output_components = cinfo.out_color_components;
+}
+
+static void jinit_d_post_controller (jpeg_decompress_struct cinfo, bool need_full_buffer) {
+    jpeg_d_post_controller post = cinfo.post = new jpeg_d_post_controller();
+//  post.pub.start_pass = start_pass_dpost;
+    post.whole_image = null;    /* flag for no virtual arrays */
+    post.buffer = null;     /* flag for no strip buffer */
+
+    /* Create the quantization buffer, if needed */
+    if (cinfo.quantize_colors) {
+        error(SWT.ERROR_NOT_IMPLEMENTED);
+//      /* The buffer strip height is max_v_samp_factor, which is typically
+//       * an efficient number of rows for upsampling to return.
+//       * (In the presence of output rescaling, we might want to be smarter?)
+//       */
+//      post.strip_height = cinfo.max_v_samp_factor;
+//      if (need_full_buffer) {
+//          /* Two-pass color quantization: need full-image storage. */
+//          /* We round up the number of rows to a multiple of the strip height. */
+//#ifdef QUANT_2PASS_SUPPORTED
+//          post.whole_image = (*cinfo.mem.request_virt_sarray)
+//              ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
+//              cinfo.output_width * cinfo.out_color_components,
+//              (JDIMENSION) jround_up(cast(long) cinfo.output_height,
+//              cast(long) post.strip_height),
+//   post.strip_height);
+//#else
+//          ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+//#endif /* QUANT_2PASS_SUPPORTED */
+//      } else {
+//          /* One-pass color quantization: just make a strip buffer. */
+//          post.buffer = (*cinfo.mem.alloc_sarray)
+//              ((j_common_ptr) cinfo, JPOOL_IMAGE,
+//              cinfo.output_width * cinfo.out_color_components,
+//              post.strip_height);
+//      }
+    }
+}
+
+static void make_funny_pointers (jpeg_decompress_struct cinfo)
+/* Create the funny pointer lists discussed in the comments above.
+ * The actual workspace is already allocated (in main.buffer),
+ * and the space for the pointer lists is allocated too.
+ * This routine just fills in the curiously ordered lists.
+ * This will be repeated at the beginning of each pass.
+ */
+{
+    jpeg_d_main_controller main = cinfo.main;
+    int ci, i, rgroup;
+    int M = cinfo.min_DCT_scaled_size;
+    jpeg_component_info compptr;
+    byte[][] buf, xbuf0, xbuf1;
+
+    for (ci = 0; ci < cinfo.num_components; ci++) {
+        compptr = cinfo.comp_info[ci];
+        rgroup = (compptr.v_samp_factor * compptr.DCT_scaled_size) /
+            cinfo.min_DCT_scaled_size; /* height of a row group of component */
+        xbuf0 = main.xbuffer[0][ci];
+        int xbuf0_offset = main.xbuffer_offset[0][ci];
+        xbuf1 = main.xbuffer[1][ci];
+        int xbuf1_offset = main.xbuffer_offset[1][ci];
+        /* First copy the workspace pointers as-is */
+        buf = main.buffer[ci];
+        for (i = 0; i < rgroup * (M + 2); i++) {
+            xbuf0[i + xbuf0_offset] = xbuf1[i + xbuf1_offset] = buf[i];
+        }
+        /* In the second list, put the last four row groups in swapped order */
+        for (i = 0; i < rgroup * 2; i++) {
+            xbuf1[rgroup*(M-2) + i + xbuf1_offset] = buf[rgroup*M + i];
+            xbuf1[rgroup*M + i + xbuf1_offset] = buf[rgroup*(M-2) + i];
+        }
+        /* The wraparound pointers at top and bottom will be filled later
+         * (see set_wraparound_pointers, below).    Initially we want the "above"
+         * pointers to duplicate the first actual data line.    This only needs
+         * to happen in xbuffer[0].
+         */
+        for (i = 0; i < rgroup; i++) {
+            xbuf0[i - rgroup + xbuf0_offset] = xbuf0[0 + xbuf0_offset];
+        }
+    }
+}
+
+static void alloc_funny_pointers (jpeg_decompress_struct cinfo)
+/* Allocate space for the funny pointer lists.
+ * This is done only once, not once per pass.
+ */
+{
+    jpeg_d_main_controller main = cinfo.main;
+    int ci, rgroup;
+    int M = cinfo.min_DCT_scaled_size;
+    jpeg_component_info compptr;
+    byte[][] xbuf;
+
+    /* Get top-level space for component array pointers.
+     * We alloc both arrays with one call to save a few cycles.
+     */
+    main.xbuffer[0] = new byte[][][](cinfo.num_components);
+    main.xbuffer[1] = new byte[][][](cinfo.num_components);
+    main.xbuffer_offset[0] = new int[](cinfo.num_components);
+    main.xbuffer_offset[1] = new int[](cinfo.num_components);
+
+    for (ci = 0; ci < cinfo.num_components; ci++) {
+        compptr = cinfo.comp_info[ci];
+        rgroup = (compptr.v_samp_factor * compptr.DCT_scaled_size) / cinfo.min_DCT_scaled_size; /* height of a row group of component */
+        /* Get space for pointer lists --- M+4 row groups in each list.
+         * We alloc both pointer lists with one call to save a few cycles.
+         */
+        xbuf = new byte[][](2 * (rgroup * (M + 4)));
+        int offset = rgroup;
+        main.xbuffer_offset[0][ci] = offset;
+        main.xbuffer[0][ci] = xbuf;
+        offset += rgroup * (M + 4);
+        main.xbuffer_offset[1][ci] = offset;
+        main.xbuffer[1][ci] = xbuf;
+    }
+}
+
+
+static void jinit_d_main_controller (jpeg_decompress_struct cinfo, bool need_full_buffer) {
+    int ci, rgroup, ngroups;
+    jpeg_component_info compptr;
+
+    jpeg_d_main_controller main = cinfo.main = new jpeg_d_main_controller();
+//  main.pub.start_pass = start_pass_main;
+
+    if (need_full_buffer)       /* shouldn't happen */
+        error();
+//      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+
+    /* Allocate the workspace.
+     * ngroups is the number of row groups we need.
+     */
+    if (cinfo.upsample.need_context_rows) {
+        if (cinfo.min_DCT_scaled_size < 2) /* unsupported, see comments above */
+            error();
+//          ERREXIT(cinfo, JERR_NOTIMPL);
+        alloc_funny_pointers(cinfo); /* Alloc space for xbuffer[] lists */
+        ngroups = cinfo.min_DCT_scaled_size + 2;
+    } else {
+        ngroups = cinfo.min_DCT_scaled_size;
+    }
+
+    for (ci = 0; ci < cinfo.num_components; ci++) {
+        compptr = cinfo.comp_info[ci];
+        rgroup = (compptr.v_samp_factor * compptr.DCT_scaled_size) / cinfo.min_DCT_scaled_size; /* height of a row group of component */
+        main.buffer[ci] = new byte[][]( rgroup * ngroups, compptr.width_in_blocks * compptr.DCT_scaled_size );
+    }
+}
+
+static long jround_up (long a, long b)
+/* Compute a rounded up to next multiple of b, ie, ceil(a/b)*b */
+/* Assumes a >= 0, b > 0 */
+{
+    a += b - 1L;
+    return a - (a % b);
+}
+
+static void jinit_upsampler (jpeg_decompress_struct cinfo) {
+    int ci;
+    jpeg_component_info compptr;
+    bool need_buffer, do_fancy;
+    int h_in_group, v_in_group, h_out_group, v_out_group;
+
+    jpeg_upsampler upsample = new jpeg_upsampler();
+    cinfo.upsample = upsample;
+//  upsample.start_pass = start_pass_upsample;
+//  upsample.upsample = sep_upsample;
+    upsample.need_context_rows = false; /* until we find out differently */
+
+    if (cinfo.CCIR601_sampling) /* this isn't supported */
+        error();
+//      ERREXIT(cinfo, JERR_CCIR601_NOTIMPL);
+
+    /* jdmainct.c doesn't support context rows when min_DCT_scaled_size = 1,
+     * so don't ask for it.
+     */
+    do_fancy = cinfo.do_fancy_upsampling && cinfo.min_DCT_scaled_size > 1;
+
+    /* Verify we can handle the sampling factors, select per-component methods,
+     * and create storage as needed.
+     */
+    for (ci = 0; ci < cinfo.num_components; ci++) {
+        compptr = cinfo.comp_info[ci];
+        /* Compute size of an "input group" after IDCT scaling. This many samples
+         * are to be converted to max_h_samp_factor * max_v_samp_factor pixels.
+         */
+        h_in_group = (compptr.h_samp_factor * compptr.DCT_scaled_size) /
+         cinfo.min_DCT_scaled_size;
+        v_in_group = (compptr.v_samp_factor * compptr.DCT_scaled_size) /
+         cinfo.min_DCT_scaled_size;
+        h_out_group = cinfo.max_h_samp_factor;
+        v_out_group = cinfo.max_v_samp_factor;
+        upsample.rowgroup_height[ci] = v_in_group; /* save for use later */
+        need_buffer = true;
+        if (! compptr.component_needed) {
+            /* Don't bother to upsample an uninteresting component. */
+            upsample.methods[ci] = NOOP_UPSAMPLE;
+            need_buffer = false;
+        } else if (h_in_group is h_out_group && v_in_group is v_out_group) {
+            /* Fullsize components can be processed without any work. */
+            upsample.methods[ci] = FULLSIZE_UPSAMPLE;
+            need_buffer = false;
+        } else if (h_in_group * 2 is h_out_group && v_in_group is v_out_group) {
+            /* Special cases for 2h1v upsampling */
+            if (do_fancy && compptr.downsampled_width > 2)
+                upsample.methods[ci] = H2V1_FANCY_UPSAMPLE;
+            else
+                upsample.methods[ci] = H2V1_UPSAMPLE;
+        } else if (h_in_group * 2 is h_out_group && v_in_group * 2 is v_out_group) {
+            /* Special cases for 2h2v upsampling */
+            if (do_fancy && compptr.downsampled_width > 2) {
+                upsample.methods[ci] = H2V2_FANCY_UPSAMPLE;
+                upsample.need_context_rows = true;
+            } else
+                upsample.methods[ci] = H2V2_UPSAMPLE;
+        } else if ((h_out_group % h_in_group) is 0 && (v_out_group % v_in_group) is 0) {
+            /* Generic integral-factors upsampling method */
+            upsample.methods[ci] = INT_UPSAMPLE;
+            upsample.h_expand[ci] = cast(byte) (h_out_group / h_in_group);
+            upsample.v_expand[ci] = cast(byte) (v_out_group / v_in_group);
+        } else
+            error();
+//          ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);
+        if (need_buffer) {
+            upsample.color_buf[ci] = new byte[][]( cinfo.max_v_samp_factor,
+                         cast(int) jround_up(cinfo.output_width, cinfo.max_h_samp_factor));
+        }
+    }
+}
+
+static void jinit_phuff_decoder (jpeg_decompress_struct cinfo) {
+    int[][] coef_bit_ptr;
+    int ci, i;
+
+    cinfo.entropy = new phuff_entropy_decoder();
+//  entropy.pub.start_pass = start_pass_phuff_decoder;
+
+    /* Create progression status table */
+    cinfo.coef_bits = new int[][]( cinfo.num_components, DCTSIZE2 );
+    coef_bit_ptr = cinfo.coef_bits;
+    for (ci = 0; ci < cinfo.num_components; ci++)
+        for (i = 0; i < DCTSIZE2; i++)
+            coef_bit_ptr[ci][i] = -1;
+}
+
+
+static void jinit_huff_decoder (jpeg_decompress_struct cinfo) {
+
+    cinfo.entropy = new huff_entropy_decoder();
+//  entropy.pub.start_pass = start_pass_huff_decoder;
+//  entropy.pub.decode_mcu = decode_mcu;
+
+}
+
+static void jinit_inverse_dct (jpeg_decompress_struct cinfo) {
+    int ci;
+    jpeg_component_info compptr;
+
+    jpeg_inverse_dct idct = cinfo.idct = new jpeg_inverse_dct();
+//  idct.pub.start_pass = start_pass;
+
+    for (ci = 0; ci < cinfo.num_components; ci++) {
+        compptr = cinfo.comp_info[ci];
+        /* Allocate and pre-zero a multiplier table for each component */
+        compptr.dct_table = new int[DCTSIZE2];
+        /* Mark multiplier table not yet set up for any method */
+        idct.cur_method[ci] = -1;
+    }
+}
+
+static final int CONST_BITS = 13;
+static final int PASS1_BITS = 2;
+static final int RANGE_MASK =(MAXJSAMPLE * 4 + 3);
+static void jpeg_idct_islow (jpeg_decompress_struct cinfo, jpeg_component_info compptr,
+    short[] coef_block,
+    byte[][] output_buf, int output_buf_offset, int output_col)
+{
+    int tmp0, tmp1, tmp2, tmp3;
+    int tmp10, tmp11, tmp12, tmp13;
+    int z1, z2, z3, z4, z5;
+    short[] inptr;
+    int[] quantptr;
+    int[] wsptr;
+    byte[] outptr;
+    byte[] range_limit = cinfo.sample_range_limit;
+    int range_limit_offset = cinfo.sample_range_limit_offset + CENTERJSAMPLE;
+    int ctr;
+    int[] workspace = cinfo.workspace;  /* buffers data between passes */
+//  SHIFT_TEMPS
+
+    /* Pass 1: process columns from input, store into work array. */
+    /* Note results are scaled up by sqrt(8) compared to a true IDCT; */
+    /* furthermore, we scale the results by 2**PASS1_BITS. */
+
+    inptr = coef_block;
+    quantptr = compptr.dct_table;
+    wsptr = workspace;
+    int inptr_offset = 0, quantptr_offset = 0, wsptr_offset = 0;
+    for (ctr = DCTSIZE; ctr > 0; ctr--) {
+        /* Due to quantization, we will usually find that many of the input
+         * coefficients are zero, especially the AC terms.  We can exploit this
+         * by short-circuiting the IDCT calculation for any column in which all
+         * the AC terms are zero.   In that case each output is equal to the
+         * DC coefficient (with scale factor as needed).
+         * With typical images and quantization tables, half or more of the
+         * column DCT calculations can be simplified this way.
+         */
+
+        if (inptr[DCTSIZE*1+inptr_offset] is 0 && inptr[DCTSIZE*2+inptr_offset] is 0 &&
+            inptr[DCTSIZE*3+inptr_offset] is 0 && inptr[DCTSIZE*4+inptr_offset] is 0 &&
+            inptr[DCTSIZE*5+inptr_offset] is 0 && inptr[DCTSIZE*6+inptr_offset] is 0 &&
+            inptr[DCTSIZE*7+inptr_offset] is 0)
+        {
+            /* AC terms all zero */
+            int dcval = ((inptr[DCTSIZE*0+inptr_offset]) * quantptr[DCTSIZE*0+quantptr_offset]) << PASS1_BITS;
+
+            wsptr[DCTSIZE*0+wsptr_offset] = dcval;
+            wsptr[DCTSIZE*1+wsptr_offset] = dcval;
+            wsptr[DCTSIZE*2+wsptr_offset] = dcval;
+            wsptr[DCTSIZE*3+wsptr_offset] = dcval;
+            wsptr[DCTSIZE*4+wsptr_offset] = dcval;
+            wsptr[DCTSIZE*5+wsptr_offset] = dcval;
+            wsptr[DCTSIZE*6+wsptr_offset] = dcval;
+            wsptr[DCTSIZE*7+wsptr_offset] = dcval;
+
+            inptr_offset++;         /* advance pointers to next column */
+            quantptr_offset++;
+            wsptr_offset++;
+            continue;
+        }
+
+        /* Even part: reverse the even part of the forward DCT. */
+        /* The rotator is sqrt(2)*c(-6). */
+
+        z2 = ((inptr[DCTSIZE*2+inptr_offset]) * quantptr[DCTSIZE*2+quantptr_offset]);
+        z3 = ((inptr[DCTSIZE*6+inptr_offset]) * quantptr[DCTSIZE*6+quantptr_offset]);
+
+        z1 = ((z2 + z3) * 4433/*FIX_0_541196100*/);
+        tmp2 = z1 + (z3 * - 15137/*FIX_1_847759065*/);
+        tmp3 = z1 + (z2 * 6270/*FIX_0_765366865*/);
+
+        z2 = ((inptr[DCTSIZE*0+inptr_offset]) * quantptr[DCTSIZE*0+quantptr_offset]);
+        z3 = ((inptr[DCTSIZE*4+inptr_offset]) * quantptr[DCTSIZE*4+quantptr_offset]);
+
+        tmp0 = (z2 + z3) << CONST_BITS;
+        tmp1 = (z2 - z3) << CONST_BITS;
+
+        tmp10 = tmp0 + tmp3;
+        tmp13 = tmp0 - tmp3;
+        tmp11 = tmp1 + tmp2;
+        tmp12 = tmp1 - tmp2;
+
+        /* Odd part per figure 8; the matrix is unitary and hence its
+         * transpose is its inverse.    i0..i3 are y7,y5,y3,y1 respectively.
+         */
+
+        tmp0 = ((inptr[DCTSIZE*7+inptr_offset]) * quantptr[DCTSIZE*7+quantptr_offset]);
+        tmp1 = ((inptr[DCTSIZE*5+inptr_offset]) * quantptr[DCTSIZE*5+quantptr_offset]);
+        tmp2 = ((inptr[DCTSIZE*3+inptr_offset]) * quantptr[DCTSIZE*3+quantptr_offset]);
+        tmp3 = ((inptr[DCTSIZE*1+inptr_offset]) * quantptr[DCTSIZE*1+quantptr_offset]);
+
+        z1 = tmp0 + tmp3;
+        z2 = tmp1 + tmp2;
+        z3 = tmp0 + tmp2;
+        z4 = tmp1 + tmp3;
+        z5 = ((z3 + z4) * 9633/*FIX_1_175875602*/); /* sqrt(2) * c3 */
+
+        tmp0 = (tmp0 * 2446/*FIX_0_298631336*/); /* sqrt(2) * (-c1+c3+c5-c7) */
+        tmp1 = (tmp1 * 16819/*FIX_2_053119869*/); /* sqrt(2) * ( c1+c3-c5+c7) */
+        tmp2 = (tmp2 * 25172/*FIX_3_072711026*/); /* sqrt(2) * ( c1+c3+c5-c7) */
+        tmp3 = (tmp3 * 12299/*FIX_1_501321110*/); /* sqrt(2) * ( c1+c3-c5-c7) */
+        z1 = (z1 * - 7373/*FIX_0_899976223*/); /* sqrt(2) * (c7-c3) */
+        z2 = (z2 * - 20995/*FIX_2_562915447*/); /* sqrt(2) * (-c1-c3) */
+        z3 = (z3 * - 16069/*FIX_1_961570560*/); /* sqrt(2) * (-c3-c5) */
+        z4 = (z4 * - 3196/*FIX_0_390180644*/); /* sqrt(2) * (c5-c3) */
+
+        z3 += z5;
+        z4 += z5;
+
+        tmp0 += z1 + z3;
+        tmp1 += z2 + z4;
+        tmp2 += z2 + z3;
+        tmp3 += z1 + z4;
+
+        /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
+
+//      #define DESCALE(x,n)    RIGHT_SHIFT((x) + (ONE << ((n)-1)), n)
+        wsptr[DCTSIZE*0+wsptr_offset] = (((tmp10 + tmp3) + (1 << ((CONST_BITS-PASS1_BITS)-1))) >> (CONST_BITS-PASS1_BITS));
+        wsptr[DCTSIZE*7+wsptr_offset] = (((tmp10 - tmp3) + (1 << ((CONST_BITS-PASS1_BITS)-1))) >> (CONST_BITS-PASS1_BITS));
+        wsptr[DCTSIZE*1+wsptr_offset] = (((tmp11 + tmp2) + (1 << ((CONST_BITS-PASS1_BITS)-1))) >> (CONST_BITS-PASS1_BITS));
+        wsptr[DCTSIZE*6+wsptr_offset] = (((tmp11 - tmp2) + (1 << ((CONST_BITS-PASS1_BITS)-1))) >> (CONST_BITS-PASS1_BITS));
+        wsptr[DCTSIZE*2+wsptr_offset] = (((tmp12 + tmp1) + (1 << ((CONST_BITS-PASS1_BITS)-1))) >> (CONST_BITS-PASS1_BITS));
+        wsptr[DCTSIZE*5+wsptr_offset] = (((tmp12 - tmp1) + (1 << ((CONST_BITS-PASS1_BITS)-1))) >> (CONST_BITS-PASS1_BITS));
+        wsptr[DCTSIZE*3+wsptr_offset] = (((tmp13 + tmp0) + (1 << ((CONST_BITS-PASS1_BITS)-1))) >> (CONST_BITS-PASS1_BITS));
+        wsptr[DCTSIZE*4+wsptr_offset] = (((tmp13 - tmp0) + (1 << ((CONST_BITS-PASS1_BITS)-1))) >> (CONST_BITS-PASS1_BITS));
+
+        inptr_offset++;         /* advance pointers to next column */
+        quantptr_offset++;
+        wsptr_offset++;
+    }
+
+
+    /* Pass 2: process rows from work array, store into output array. */
+    /* Note that we must descale the results by a factor of 8 is 2**3, */
+    /* and also undo the PASS1_BITS scaling. */
+
+    int outptr_offset = 0;
+    wsptr = workspace;
+    wsptr_offset =0;
+    for (ctr = 0; ctr < DCTSIZE; ctr++) {
+        outptr = output_buf[ctr+output_buf_offset];
+        outptr_offset = output_col;
+        /* Rows of zeroes can be exploited in the same way as we did with columns.
+         * However, the column calculation has created many nonzero AC terms, so
+         * the simplification applies less often (typically 5% to 10% of the time).
+         * On machines with very fast multiplication, it's possible that the
+         * test takes more time than it's worth.    In that case this section
+         * may be commented out.
+         */
+
+//#ifndef NO_ZERO_ROW_TEST
+        if (wsptr[1+wsptr_offset] is 0 && wsptr[2+wsptr_offset] is 0 && wsptr[3+wsptr_offset] is 0 && wsptr[4+wsptr_offset] is 0 &&
+            wsptr[5+wsptr_offset] is 0 && wsptr[6+wsptr_offset] is 0 && wsptr[7+wsptr_offset] is 0)
+        {
+            /* AC terms all zero */
+//          #define DESCALE(x,n)    RIGHT_SHIFT((x) + (ONE << ((n)-1)), n)
+            byte dcval = range_limit[range_limit_offset + ((((wsptr[0+wsptr_offset]) + (1 << ((PASS1_BITS+3)-1))) >> PASS1_BITS+3)
+                    & RANGE_MASK)];
+
+            outptr[0+outptr_offset] = dcval;
+            outptr[1+outptr_offset] = dcval;
+            outptr[2+outptr_offset] = dcval;
+            outptr[3+outptr_offset] = dcval;
+            outptr[4+outptr_offset] = dcval;
+            outptr[5+outptr_offset] = dcval;
+            outptr[6+outptr_offset] = dcval;
+            outptr[7+outptr_offset] = dcval;
+
+            wsptr_offset += DCTSIZE;        /* advance pointer to next row */
+            continue;
+        }
+//#endif
+
+        /* Even part: reverse the even part of the forward DCT. */
+        /* The rotator is sqrt(2)*c(-6). */
+
+        z2 = wsptr[2+wsptr_offset];
+        z3 = wsptr[6+wsptr_offset];
+
+        z1 = ((z2 + z3) * 4433/*FIX_0_541196100*/);
+        tmp2 = z1 + (z3 * - 15137/*FIX_1_847759065*/);
+        tmp3 = z1 + (z2 * 6270/*FIX_0_765366865*/);
+
+        tmp0 = (wsptr[0+wsptr_offset] + wsptr[4+wsptr_offset]) << CONST_BITS;
+        tmp1 = (wsptr[0+wsptr_offset] - wsptr[4+wsptr_offset]) << CONST_BITS;
+
+        tmp10 = tmp0 + tmp3;
+        tmp13 = tmp0 - tmp3;
+        tmp11 = tmp1 + tmp2;
+        tmp12 = tmp1 - tmp2;
+
+        /* Odd part per figure 8; the matrix is unitary and hence its
+         * transpose is its inverse.    i0..i3 are y7,y5,y3,y1 respectively.
+         */
+
+        tmp0 = wsptr[7+wsptr_offset];
+        tmp1 = wsptr[5+wsptr_offset];
+        tmp2 = wsptr[3+wsptr_offset];
+        tmp3 = wsptr[1+wsptr_offset];
+
+        z1 = tmp0 + tmp3;
+        z2 = tmp1 + tmp2;
+        z3 = tmp0 + tmp2;
+        z4 = tmp1 + tmp3;
+        z5 = ((z3 + z4) * 9633/*FIX_1_175875602*/); /* sqrt(2) * c3 */
+
+        tmp0 = (tmp0 * 2446/*FIX_0_298631336*/); /* sqrt(2) * (-c1+c3+c5-c7) */
+        tmp1 = (tmp1 * 16819/*FIX_2_053119869*/); /* sqrt(2) * ( c1+c3-c5+c7) */
+        tmp2 = (tmp2 * 25172/*FIX_3_072711026*/); /* sqrt(2) * ( c1+c3+c5-c7) */
+        tmp3 = (tmp3 * 12299/*FIX_1_501321110*/); /* sqrt(2) * ( c1+c3-c5-c7) */
+        z1 = (z1 * - 7373/*FIX_0_899976223*/); /* sqrt(2) * (c7-c3) */
+        z2 = (z2 * - 20995/*FIX_2_562915447*/); /* sqrt(2) * (-c1-c3) */
+        z3 = (z3 * - 16069/*FIX_1_961570560*/); /* sqrt(2) * (-c3-c5) */
+        z4 = (z4 * - 3196/*FIX_0_390180644*/); /* sqrt(2) * (c5-c3) */
+
+        z3 += z5;
+        z4 += z5;
+
+        tmp0 += z1 + z3;
+        tmp1 += z2 + z4;
+        tmp2 += z2 + z3;
+        tmp3 += z1 + z4;
+
+        /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
+
+
+//      #define DESCALE(x,n)    RIGHT_SHIFT((x) + (ONE << ((n)-1)), n)
+        outptr[0+outptr_offset] = range_limit[range_limit_offset + ((((tmp10 + tmp3) + (1 << ((CONST_BITS+PASS1_BITS+3)-1))) >>
+                        CONST_BITS+PASS1_BITS+3)
+                    & RANGE_MASK)];
+        outptr[7+outptr_offset] = range_limit[range_limit_offset + ((((tmp10 - tmp3) + (1 << ((CONST_BITS+PASS1_BITS+3)-1))) >>
+                                    CONST_BITS+PASS1_BITS+3)
+                    & RANGE_MASK)];
+        outptr[1+outptr_offset] = range_limit[range_limit_offset + ((((tmp11 + tmp2) + (1 << ((CONST_BITS+PASS1_BITS+3)-1))) >>
+                                    CONST_BITS+PASS1_BITS+3)
+                    & RANGE_MASK)];
+        outptr[6+outptr_offset] = range_limit[range_limit_offset + ((((tmp11 - tmp2) + (1 << ((CONST_BITS+PASS1_BITS+3)-1))) >>
+                                    CONST_BITS+PASS1_BITS+3)
+                    & RANGE_MASK)];
+        outptr[2+outptr_offset] = range_limit[range_limit_offset + ((((tmp12 + tmp1) + (1 << ((CONST_BITS+PASS1_BITS+3)-1))) >>
+                                    CONST_BITS+PASS1_BITS+3)
+                    & RANGE_MASK)];
+        outptr[5+outptr_offset] = range_limit[range_limit_offset + ((((tmp12 - tmp1) + (1 << ((CONST_BITS+PASS1_BITS+3)-1))) >>
+                                    CONST_BITS+PASS1_BITS+3)
+                    & RANGE_MASK)];
+        outptr[3+outptr_offset] = range_limit[range_limit_offset + ((((tmp13 + tmp0) + (1 << ((CONST_BITS+PASS1_BITS+3)-1))) >>
+                                    CONST_BITS+PASS1_BITS+3)
+                    & RANGE_MASK)];
+        outptr[4+outptr_offset] = range_limit[range_limit_offset + ((((tmp13 - tmp0) + (1 << ((CONST_BITS+PASS1_BITS+3)-1))) >>
+                                    CONST_BITS+PASS1_BITS+3)
+                    & RANGE_MASK)];
+
+        wsptr_offset += DCTSIZE;        /* advance pointer to next row */
+    }
+}
+
+static void upsample (jpeg_decompress_struct cinfo,
+    byte[][][] input_buf, int[] input_buf_offset, int[] in_row_group_ctr,
+    int in_row_groups_avail,
+    byte[][] output_buf, int[] out_row_ctr,
+    int out_rows_avail)
+{
+    sep_upsample(cinfo, input_buf, input_buf_offset, in_row_group_ctr, in_row_groups_avail, output_buf, out_row_ctr, out_rows_avail);
+}
+
+static bool smoothing_ok (jpeg_decompress_struct cinfo) {
+    jpeg_d_coef_controller coef = cinfo.coef;
+    bool smoothing_useful = false;
+    int ci, coefi;
+    jpeg_component_info compptr;
+    JQUANT_TBL qtable;
+    int[] coef_bits;
+    int[] coef_bits_latch;
+
+    if (! cinfo.progressive_mode || cinfo.coef_bits is null)
+        return false;
+
+    /* Allocate latch area if not already done */
+    if (coef.coef_bits_latch is null)
+        coef.coef_bits_latch = new int[cinfo.num_components * SAVED_COEFS];
+    coef_bits_latch = coef.coef_bits_latch;
+    int coef_bits_latch_offset = 0;
+
+    for (ci = 0; ci < cinfo.num_components; ci++) {
+        compptr = cinfo.comp_info[ci];
+        /* All components' quantization values must already be latched. */
+        if ((qtable = compptr.quant_table) is null)
+            return false;
+        /* Verify DC & first 5 AC quantizers are nonzero to avoid zero-divide. */
+        if (qtable.quantval[0] is 0 ||
+            qtable.quantval[Q01_POS] is 0 ||
+            qtable.quantval[Q10_POS] is 0 ||
+            qtable.quantval[Q20_POS] is 0 ||
+            qtable.quantval[Q11_POS] is 0 ||
+            qtable.quantval[Q02_POS] is 0)
+                return false;
+        /* DC values must be at least partly known for all components. */
+        coef_bits = cinfo.coef_bits[ci];
+        if (coef_bits[0] < 0)
+            return false;
+        /* Block smoothing is helpful if some AC coefficients remain inaccurate. */
+        for (coefi = 1; coefi <= 5; coefi++) {
+            coef_bits_latch[coefi+coef_bits_latch_offset] = coef_bits[coefi];
+            if (coef_bits[coefi] !is 0)
+                smoothing_useful = true;
+        }
+        coef_bits_latch_offset += SAVED_COEFS;
+    }
+
+    return smoothing_useful;
+}
+
+static void master_selection (jpeg_decompress_struct cinfo) {
+    jpeg_decomp_master master = cinfo.master;
+    bool use_c_buffer;
+    long samplesperrow;
+    int jd_samplesperrow;
+
+    /* Initialize dimensions and other stuff */
+    jpeg_calc_output_dimensions(cinfo);
+    prepare_range_limit_table(cinfo);
+
+    /* Width of an output scanline must be representable as JDIMENSION. */
+    samplesperrow = cast(long) cinfo.output_width * cast(long) cinfo.out_color_components;
+    jd_samplesperrow = cast(int) samplesperrow;
+    if ( jd_samplesperrow !is samplesperrow)
+        error();
+//      ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
+
+    /* Initialize my private state */
+    master.pass_number = 0;
+    master.using_merged_upsample = use_merged_upsample(cinfo);
+
+    /* Color quantizer selection */
+    master.quantizer_1pass = null;
+    master.quantizer_2pass = null;
+    /* No mode changes if not using buffered-image mode. */
+    if (! cinfo.quantize_colors || ! cinfo.buffered_image) {
+        cinfo.enable_1pass_quant = false;
+        cinfo.enable_external_quant = false;
+        cinfo.enable_2pass_quant = false;
+    }
+    if (cinfo.quantize_colors) {
+        error(SWT.ERROR_NOT_IMPLEMENTED);
+//      if (cinfo.raw_data_out)
+//          ERREXIT(cinfo, JERR_NOTIMPL);
+//      /* 2-pass quantizer only works in 3-component color space. */
+//      if (cinfo.out_color_components !is 3) {
+//          cinfo.enable_1pass_quant = true;
+//          cinfo.enable_external_quant = false;
+//          cinfo.enable_2pass_quant = false;
+//          cinfo.colormap = null;
+//      } else if (cinfo.colormap !is null) {
+//          cinfo.enable_external_quant = true;
+//      } else if (cinfo.two_pass_quantize) {
+//          cinfo.enable_2pass_quant = true;
+//      } else {
+//          cinfo.enable_1pass_quant = true;
+//      }
+//
+//      if (cinfo.enable_1pass_quant) {
+//#ifdef QUANT_1PASS_SUPPORTED
+//          jinit_1pass_quantizer(cinfo);
+//          master.quantizer_1pass = cinfo.cquantize;
+//#else
+//          ERREXIT(cinfo, JERR_NOT_COMPILED);
+//#endif
+//      }
+//
+//      /* We use the 2-pass code to map to external colormaps. */
+//      if (cinfo.enable_2pass_quant || cinfo.enable_external_quant) {
+//#ifdef QUANT_2PASS_SUPPORTED
+//          jinit_2pass_quantizer(cinfo);
+//          master.quantizer_2pass = cinfo.cquantize;
+//#else
+//          ERREXIT(cinfo, JERR_NOT_COMPILED);
+//#endif
+//      }
+//      /* If both quantizers are initialized, the 2-pass one is left active;
+//       * this is necessary for starting with quantization to an external map.
+//       */
+    }
+
+    /* Post-processing: in particular, color conversion first */
+    if (! cinfo.raw_data_out) {
+        if (master.using_merged_upsample) {
+//#ifdef UPSAMPLE_MERGING_SUPPORTED
+//          jinit_merged_upsampler(cinfo); /* does color conversion too */
+//#else
+            error();
+//          ERREXIT(cinfo, JERR_NOT_COMPILED);
+//#endif
+        } else {
+            jinit_color_deconverter(cinfo);
+            jinit_upsampler(cinfo);
+        }
+        jinit_d_post_controller(cinfo, cinfo.enable_2pass_quant);
+    }
+    /* Inverse DCT */
+    jinit_inverse_dct(cinfo);
+    /* Entropy decoding: either Huffman or arithmetic coding. */
+    if (cinfo.arith_code) {
+        error();
+//      ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
+    } else {
+        if (cinfo.progressive_mode) {
+//#ifdef D_PROGRESSIVE_SUPPORTED
+            jinit_phuff_decoder(cinfo);
+//#else
+//          ERREXIT(cinfo, JERR_NOT_COMPILED);
+//#endif
+        } else
+            jinit_huff_decoder(cinfo);
+    }
+
+    /* Initialize principal buffer controllers. */
+    use_c_buffer = cinfo.inputctl.has_multiple_scans || cinfo.buffered_image;
+    jinit_d_coef_controller(cinfo, use_c_buffer);
+
+    if (! cinfo.raw_data_out)
+        jinit_d_main_controller(cinfo, false /* never need full buffer here */);
+
+    /* Initialize input side of decompressor to consume first scan. */
+    start_input_pass (cinfo);
+
+//#ifdef D_MULTISCAN_FILES_SUPPORTED
+    /* If jpeg_start_decompress will read the whole file, initialize
+     * progress monitoring appropriately.   The input step is counted
+     * as one pass.
+     */
+//  if (cinfo.progress !is null && ! cinfo.buffered_image &&
+//          cinfo.inputctl.has_multiple_scans) {
+//      int nscans;
+//      /* Estimate number of scans to set pass_limit. */
+//      if (cinfo.progressive_mode) {
+//          /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */
+//          nscans = 2 + 3 * cinfo.num_components;
+//      } else {
+//          /* For a nonprogressive multiscan file, estimate 1 scan per component. */
+//          nscans = cinfo.num_components;
+//      }
+//      cinfo.progress.pass_counter = 0L;
+//      cinfo.progress.pass_limit = cast(long) cinfo.total_iMCU_rows * nscans;
+//      cinfo.progress.completed_passes = 0;
+//      cinfo.progress.total_passes = (cinfo.enable_2pass_quant ? 3 : 2);
+//      /* Count the input pass as done */
+//      master.pass_number++;
+//  }
+//#endif /* D_MULTISCAN_FILES_SUPPORTED */
+}
+
+static void jinit_master_decompress (jpeg_decompress_struct cinfo) {
+    jpeg_decomp_master master = new jpeg_decomp_master();
+    cinfo.master = master;
+//  master.prepare_for_output_pass = prepare_for_output_pass;
+//  master.finish_output_pass = finish_output_pass;
+
+    master.is_dummy_pass = false;
+
+    master_selection(cinfo);
+}
+
+static void
+jcopy_sample_rows (byte[][] input_array, int source_row,
+           byte[][] output_array, int dest_row,
+           int num_rows, int num_cols)
+/* Copy some rows of samples from one place to another.
+ * num_rows rows are copied from input_array[source_row++]
+ * to output_array[dest_row++]; these areas may overlap for duplication.
+ * The source and destination arrays must be at least as wide as num_cols.
+ */
+{
+  byte[] inptr, outptr;
+  int count = num_cols;
+  int row;
+
+  int input_array_offset = source_row;
+  int output_array_offset = dest_row;
+
+  for (row = num_rows; row > 0; row--) {
+    inptr = input_array[input_array_offset++];
+    outptr = output_array[output_array_offset++];
+    System.arraycopy(inptr, 0, outptr, 0, count);
+  }
+}
+
+static bool jpeg_start_decompress (jpeg_decompress_struct cinfo) {
+    if (cinfo.global_state is DSTATE_READY) {
+        /* First call: initialize master control, select active modules */
+        jinit_master_decompress(cinfo);
+        if (cinfo.buffered_image) {
+            /* No more work here; expecting jpeg_start_output next */
+            cinfo.global_state = DSTATE_BUFIMAGE;
+            return true;
+        }
+        cinfo.global_state = DSTATE_PRELOAD;
+    }
+    if (cinfo.global_state is DSTATE_PRELOAD) {
+        /* If file has multiple scans, absorb them all into the coef buffer */
+        if (cinfo.inputctl.has_multiple_scans) {
+//#ifdef D_MULTISCAN_FILES_SUPPORTED
+            for (;;) {
+                int retcode;
+                /* Call progress monitor hook if present */
+//              if (cinfo.progress !is null)
+//                  (*cinfo.progress.progress_monitor) ((j_common_ptr) cinfo);
+                /* Absorb some more input */
+                retcode = consume_input (cinfo);
+                if (retcode is JPEG_SUSPENDED)
+                    return false;
+                if (retcode is JPEG_REACHED_EOI)
+                    break;
+                /* Advance progress counter if appropriate */
+//              if (cinfo.progress !is null && (retcode is JPEG_ROW_COMPLETED || retcode is JPEG_REACHED_SOS)) {
+//                  if (++cinfo.progress.pass_counter >= cinfo.progress.pass_limit) {
+//                      /* jdmaster underestimated number of scans; ratchet up one scan */
+//                      cinfo.progress.pass_limit += cast(long) cinfo.total_iMCU_rows;
+//                  }
+//              }
+            }
+//#else
+//          ERREXIT(cinfo, JERR_NOT_COMPILED);
+//#endif /* D_MULTISCAN_FILES_SUPPORTED */
+        }
+        cinfo.output_scan_number = cinfo.input_scan_number;
+    } else if (cinfo.global_state !is DSTATE_PRESCAN)
+        error();
+//      ERREXIT1(cinfo, JERR_BAD_STATE, cinfo.global_state);
+    /* Perform any dummy output passes, and set up for the final pass */
+    return output_pass_setup(cinfo);
+}
+
+static void prepare_for_output_pass (jpeg_decompress_struct cinfo) {
+    jpeg_decomp_master master = cinfo.master;
+
+    if (master.is_dummy_pass) {
+//#ifdef QUANT_2PASS_SUPPORTED
+//      /* Final pass of 2-pass quantization */
+//      master.pub.is_dummy_pass = FALSE;
+//      (*cinfo.cquantize.start_pass) (cinfo, FALSE);
+//      (*cinfo.post.start_pass) (cinfo, JBUF_CRANK_DEST);
+//      (*cinfo.main.start_pass) (cinfo, JBUF_CRANK_DEST);
+//#else
+        error(SWT.ERROR_NOT_IMPLEMENTED);
+//      ERREXIT(cinfo, JERR_NOT_COMPILED);
+//#endif /* QUANT_2PASS_SUPPORTED */
+    } else {
+        if (cinfo.quantize_colors && cinfo.colormap is null) {
+            /* Select new quantization method */
+            if (cinfo.two_pass_quantize && cinfo.enable_2pass_quant) {
+                cinfo.cquantize = master.quantizer_2pass;
+                master.is_dummy_pass = true;
+            } else if (cinfo.enable_1pass_quant) {
+                cinfo.cquantize = master.quantizer_1pass;
+            } else {
+                error();
+//  ERREXIT(cinfo, JERR_MODE_CHANGE);
+            }
+        }
+        cinfo.idct.start_pass (cinfo);
+        start_output_pass (cinfo);
+        if (! cinfo.raw_data_out) {
+            if (! master.using_merged_upsample)
+                cinfo.cconvert.start_pass (cinfo);
+            cinfo.upsample.start_pass (cinfo);
+            if (cinfo.quantize_colors)
+                cinfo.cquantize.start_pass (cinfo, master.is_dummy_pass);
+            cinfo.post.start_pass (cinfo, (master.is_dummy_pass ? JBUF_SAVE_AND_PASS : JBUF_PASS_THRU));
+            cinfo.main.start_pass (cinfo, JBUF_PASS_THRU);
+        }
+    }
+
+//  /* Set up progress monitor's pass info if present */
+//  if (cinfo.progress !is NULL) {
+//      cinfo.progress.completed_passes = master.pass_number;
+//      cinfo.progress.total_passes = master.pass_number +
+//                      (master.pub.is_dummy_pass ? 2 : 1);
+//      /* In buffered-image mode, we assume one more output pass if EOI not
+//       * yet reached, but no more passes if EOI has been reached.
+//       */
+//      if (cinfo.buffered_image && ! cinfo.inputctl.eoi_reached) {
+//          cinfo.progress.total_passes += (cinfo.enable_2pass_quant ? 2 : 1);
+//      }
+//  }
+}
+
+
+static bool jpeg_resync_to_restart (jpeg_decompress_struct cinfo, int desired) {
+    int marker = cinfo.unread_marker;
+    int action = 1;
+
+    /* Always put up a warning. */
+//  WARNMS2(cinfo, JWRN_MUST_RESYNC, marker, desired);
+
+    /* Outer loop handles repeated decision after scanning forward. */
+    for (;;) {
+        if (marker < M_SOF0)
+            action = 2;     /* invalid marker */
+        else if (marker < M_RST0 || marker > M_RST7)
+            action = 3;     /* valid non-restart marker */
+        else {
+            if (marker is (M_RST0 + ((desired+1) & 7)) || marker is ( M_RST0 + ((desired+2) & 7)))
+                action = 3;     /* one of the next two expected restarts */
+            else if (marker is (M_RST0 + ((desired-1) & 7)) || marker is ( M_RST0 + ((desired-2) & 7)))
+                action = 2;     /* a prior restart, so advance */
+            else
+                action = 1;     /* desired restart or too far away */
+        }
+//      TRACEMS2(cinfo, 4, JTRC_RECOVERY_ACTION, marker, action);
+        switch (action) {
+            case 1:
+                /* Discard marker and let entropy decoder resume processing. */
+                cinfo.unread_marker = 0;
+                return true;
+            case 2:
+                /* Scan to the next marker, and repeat the decision loop. */
+                if (! next_marker(cinfo))
+                    return false;
+                marker = cinfo.unread_marker;
+                break;
+            case 3:
+                /* Return without advancing past this marker. */
+                /* Entropy decoder will be forced to process an empty segment. */
+                return true;
+            default:
+        }
+    } /* end loop */
+}
+
+static bool read_restart_marker (jpeg_decompress_struct cinfo) {
+    /* Obtain a marker unless we already did. */
+    /* Note that next_marker will complain if it skips any data. */
+    if (cinfo.unread_marker is 0) {
+        if (! next_marker(cinfo))
+            return false;
+    }
+
+    if (cinfo.unread_marker is (M_RST0 + cinfo.marker.next_restart_num)) {
+        /* Normal case --- swallow the marker and let entropy decoder continue */
+//      TRACEMS1(cinfo, 3, JTRC_RST, cinfo.marker.next_restart_num);
+        cinfo.unread_marker = 0;
+    } else {
+        /* Uh-oh, the restart markers have been messed up. */
+        /* Let the data source manager determine how to resync. */
+        if (! jpeg_resync_to_restart (cinfo, cinfo.marker.next_restart_num))
+            return false;
+    }
+
+    /* Update next-restart state */
+    cinfo.marker.next_restart_num = (cinfo.marker.next_restart_num + 1) & 7;
+
+    return true;
+}
+
+static bool jpeg_fill_bit_buffer (bitread_working_state state, int get_buffer, int bits_left, int nbits)
+/* Load up the bit buffer to a depth of at least nbits */
+{
+    /* Copy heavily used state fields into locals (hopefully registers) */
+    byte[] buffer = state.buffer;
+    int bytes_in_buffer = state.bytes_in_buffer;
+    int bytes_offset = state.bytes_offset;
+    jpeg_decompress_struct cinfo = state.cinfo;
+
+    /* Attempt to load at least MIN_GET_BITS bits into get_buffer. */
+    /* (It is assumed that no request will be for more than that many bits.) */
+    /* We fail to do so only if we hit a marker or are forced to suspend. */
+
+    if (cinfo.unread_marker is 0) { /* cannot advance past a marker */
+        while (bits_left < MIN_GET_BITS) {
+            int c;
+
+            /* Attempt to read a byte */
+            if (bytes_offset is bytes_in_buffer) {
+                if (! fill_input_buffer (cinfo))
+                    return false;
+                buffer = cinfo.buffer;
+                bytes_in_buffer = cinfo.bytes_in_buffer;
+                bytes_offset = cinfo.bytes_offset;
+            }
+            c = buffer[bytes_offset++] & 0xFF;
+
+            /* If it's 0xFF, check and discard stuffed zero byte */
+            if (c is 0xFF) {
+                /* Loop here to discard any padding FF's on terminating marker,
+                 * so that we can save a valid unread_marker value. NOTE: we will
+                 * accept multiple FF's followed by a 0 as meaning a single FF data
+                 * byte.    This data pattern is not valid according to the standard.
+                 */
+                do {
+                    if (bytes_offset is bytes_in_buffer) {
+                        if (! fill_input_buffer (cinfo))
+                            return false;
+                        buffer = cinfo.buffer;
+                        bytes_in_buffer = cinfo.bytes_in_buffer;
+                        bytes_offset = cinfo.bytes_offset;
+                    }
+                    c = buffer[bytes_offset++] & 0xFF;
+                } while (c is 0xFF);
+
+                if (c is 0) {
+                    /* Found FF/00, which represents an FF data byte */
+                    c = 0xFF;
+                } else {
+                    /* Oops, it's actually a marker indicating end of compressed data.
+                     * Save the marker code for later use.
+                     * Fine point: it might appear that we should save the marker into
+                     * bitread working state, not straight into permanent state.    But
+                     * once we have hit a marker, we cannot need to suspend within the
+                     * current MCU, because we will read no more bytes from the data
+                     * source.  So it is OK to update permanent state right away.
+                     */
+                    cinfo.unread_marker = c;
+                    /* See if we need to insert some fake zero bits. */
+//                  goto no_more_bytes;
+                    if (nbits > bits_left) {
+                        /* Uh-oh.   Report corrupted data to user and stuff zeroes into
+                         * the data stream, so that we can produce some kind of image.
+                         * We use a nonvolatile flag to ensure that only one warning message
+                         * appears per data segment.
+                         */
+                        if (! cinfo.entropy.insufficient_data) {
+//                          WARNMS(cinfo, JWRN_HIT_MARKER);
+                            cinfo.entropy.insufficient_data = true;
+                        }
+                    /* Fill the buffer with zero bits */
+                        get_buffer <<= MIN_GET_BITS - bits_left;
+                        bits_left = MIN_GET_BITS;
+                    }
+
+                    /* Unload the local registers */
+                    state.buffer = buffer;
+                    state.bytes_in_buffer = bytes_in_buffer;
+                    state.bytes_offset = bytes_offset;
+                    state.get_buffer = get_buffer;
+                    state.bits_left = bits_left;
+
+                    return true;
+
+                }
+            }
+
+            /* OK, load c into get_buffer */
+            get_buffer = (get_buffer << 8) | c;
+            bits_left += 8;
+        } /* end while */
+    } else {
+//      no_more_bytes:
+        /* We get here if we've read the marker that terminates the compressed
+         * data segment.    There should be enough bits in the buffer register
+         * to satisfy the request; if so, no problem.
+         */
+        if (nbits > bits_left) {
+            /* Uh-oh.   Report corrupted data to user and stuff zeroes into
+             * the data stream, so that we can produce some kind of image.
+             * We use a nonvolatile flag to ensure that only one warning message
+             * appears per data segment.
+             */
+            if (! cinfo.entropy.insufficient_data) {
+//              WARNMS(cinfo, JWRN_HIT_MARKER);
+                cinfo.entropy.insufficient_data = true;
+            }
+            /* Fill the buffer with zero bits */
+            get_buffer <<= MIN_GET_BITS - bits_left;
+            bits_left = MIN_GET_BITS;
+        }
+    }
+
+    /* Unload the local registers */
+    state.buffer = buffer;
+    state.bytes_in_buffer = bytes_in_buffer;
+    state.bytes_offset = bytes_offset;
+    state.get_buffer = get_buffer;
+    state.bits_left = bits_left;
+
+    return true;
+}
+
+static int jpeg_huff_decode (bitread_working_state state, int get_buffer, int bits_left, d_derived_tbl htbl, int min_bits) {
+    int l = min_bits;
+    int code;
+
+    /* HUFF_DECODE has determined that the code is at least min_bits */
+    /* bits long, so fetch that many bits in one swoop. */
+
+//  CHECK_BIT_BUFFER(*state, l, return -1);
+    {
+    if (bits_left < (l)) {
+        if (! jpeg_fill_bit_buffer(state,get_buffer,bits_left,l)) {
+            return -1;
+        }
+        get_buffer = state.get_buffer; bits_left = state.bits_left;
+    }
+    }
+//  code = GET_BITS(l);
+    code = (( (get_buffer >> (bits_left -= (l)))) & ((1<<(l))-1));
+
+    /* Collect the rest of the Huffman code one bit at a time. */
+    /* This is per Figure F.16 in the JPEG spec. */
+
+    while (code > htbl.maxcode[l]) {
+        code <<= 1;
+//      CHECK_BIT_BUFFER(*state, 1, return -1);
+        {
+        if (bits_left < (1)) {
+            if (! jpeg_fill_bit_buffer(state,get_buffer,bits_left,1)) {
+                return -1;
+            }
+            get_buffer = state.get_buffer; bits_left = state.bits_left;
+        }
+        }
+//      code |= GET_BITS(1);
+        code |= (( (get_buffer >> (bits_left -= (1)))) & ((1<<(1))-1));
+        l++;
+    }
+
+    /* Unload the local registers */
+    state.get_buffer = get_buffer;
+    state.bits_left = bits_left;
+
+    /* With garbage input we may reach the sentinel value l = 17. */
+
+    if (l > 16) {
+//      WARNMS(state.cinfo, JWRN_HUFF_BAD_CODE);
+        return 0;           /* fake a zero as the safest result */
+    }
+
+    return htbl.pub.huffval[ (code + htbl.valoffset[l]) ] & 0xFF;
+}
+
+static int decompress_onepass (jpeg_decompress_struct cinfo, byte[][][] output_buf, int[] output_buf_offset) {
+    jpeg_d_coef_controller coef = cinfo.coef;
+    int MCU_col_num;    /* index of current MCU within row */
+    int last_MCU_col = cinfo.MCUs_per_row - 1;
+    int last_iMCU_row = cinfo.total_iMCU_rows - 1;
+    int blkn, ci, xindex, yindex, yoffset, useful_width;
+    byte[][] output_ptr;
+    int start_col, output_col;
+    jpeg_component_info compptr;
+//  inverse_DCT_method_ptr inverse_DCT;
+
+    /* Loop to process as much as one whole iMCU row */
+    for (yoffset = coef.MCU_vert_offset; yoffset < coef.MCU_rows_per_iMCU_row; yoffset++) {
+        for (MCU_col_num = coef.MCU_ctr; MCU_col_num <= last_MCU_col; MCU_col_num++) {
+            /* Try to fetch an MCU. Entropy decoder expects buffer to be zeroed. */
+            for (int i = 0; i < cinfo.blocks_in_MCU; i++) {
+                short[] blk = coef.MCU_buffer[i];
+                for (int j = 0; j < blk.length; j++) {
+                    blk[j] = 0;
+                }
+            }
+            if (! cinfo.entropy.decode_mcu (cinfo, coef.MCU_buffer)) {
+                /* Suspension forced; update state counters and exit */
+                coef.MCU_vert_offset = yoffset;
+                coef.MCU_ctr = MCU_col_num;
+                return JPEG_SUSPENDED;
+            }
+            /* Determine where data should go in output_buf and do the IDCT thing.
+             * We skip dummy blocks at the right and bottom edges (but blkn gets
+             * incremented past them!). Note the inner loop relies on having
+             * allocated the MCU_buffer[] blocks sequentially.
+             */
+            blkn = 0;           /* index of current DCT block within MCU */
+            for (ci = 0; ci < cinfo.comps_in_scan; ci++) {
+                compptr = cinfo.cur_comp_info[ci];
+                /* Don't bother to IDCT an uninteresting component. */
+                if (! compptr.component_needed) {
+                    blkn += compptr.MCU_blocks;
+                    continue;
+                }
+//              inverse_DCT = cinfo.idct.inverse_DCT[compptr.component_index];
+                useful_width = (MCU_col_num < last_MCU_col) ? compptr.MCU_width : compptr.last_col_width;
+                output_ptr = output_buf[compptr.component_index];
+                int output_ptr_offset = output_buf_offset[compptr.component_index] + yoffset * compptr.DCT_scaled_size;
+                start_col = MCU_col_num * compptr.MCU_sample_width;
+                for (yindex = 0; yindex < compptr.MCU_height; yindex++) {
+                    if (cinfo.input_iMCU_row < last_iMCU_row || yoffset+yindex < compptr.last_row_height) {
+                        output_col = start_col;
+                        for (xindex = 0; xindex < useful_width; xindex++) {
+                            jpeg_idct_islow(cinfo, compptr, coef.MCU_buffer[blkn+xindex], output_ptr, output_ptr_offset, output_col);
+                            output_col += compptr.DCT_scaled_size;
+                        }
+                    }
+                    blkn += compptr.MCU_width;
+                    output_ptr_offset += compptr.DCT_scaled_size;
+                }
+            }
+        }
+        /* Completed an MCU row, but perhaps not an iMCU row */
+        coef.MCU_ctr = 0;
+    }
+    /* Completed the iMCU row, advance counters for next one */
+    cinfo.output_iMCU_row++;
+    if (++(cinfo.input_iMCU_row) < cinfo.total_iMCU_rows) {
+        coef.start_iMCU_row(cinfo);
+        return JPEG_ROW_COMPLETED;
+    }
+    /* Completed the scan */
+    finish_input_pass (cinfo);
+    return JPEG_SCAN_COMPLETED;
+}
+
+static int decompress_smooth_data (jpeg_decompress_struct cinfo, byte[][][] output_buf, int[] output_buf_offset) {
+    jpeg_d_coef_controller coef = cinfo.coef;
+    int last_iMCU_row = cinfo.total_iMCU_rows - 1;
+    int block_num, last_block_column;
+    int ci, block_row, block_rows, access_rows;
+    short[][][] buffer;
+    short[][] buffer_ptr, prev_block_row, next_block_row;
+    byte[][] output_ptr;
+    int output_col;
+    jpeg_component_info compptr;
+//  inverse_DCT_method_ptr inverse_DCT;
+    bool first_row, last_row;
+    short[] workspace = coef.workspace;
+    if (workspace is null) workspace = coef.workspace = new short[DCTSIZE2];
+    int[] coef_bits;
+    JQUANT_TBL quanttbl;
+    int Q00,Q01,Q02,Q10,Q11,Q20, num;
+    int DC1,DC2,DC3,DC4,DC5,DC6,DC7,DC8,DC9;
+    int Al, pred;
+
+    /* Force some input to be done if we are getting ahead of the input. */
+    while (cinfo.input_scan_number <= cinfo.output_scan_number && ! cinfo.inputctl.eoi_reached) {
+        if (cinfo.input_scan_number is cinfo.output_scan_number) {
+            /* If input is working on current scan, we ordinarily want it to
+             * have completed the current row.  But if input scan is DC,
+             * we want it to keep one row ahead so that next block row's DC
+             * values are up to date.
+             */
+            int delta = (cinfo.Ss is 0) ? 1 : 0;
+            if (cinfo.input_iMCU_row > cinfo.output_iMCU_row+delta)
+                break;
+        }
+        if (consume_input(cinfo) is JPEG_SUSPENDED)
+            return JPEG_SUSPENDED;
+    }
+
+    /* OK, output from the virtual arrays. */
+    for (ci = 0; ci < cinfo.num_components; ci++) {
+        compptr = cinfo.comp_info[ci];
+        /* Don't bother to IDCT an uninteresting component. */
+        if (! compptr.component_needed)
+            continue;
+        /* Count non-dummy DCT block rows in this iMCU row. */
+        if (cinfo.output_iMCU_row < last_iMCU_row) {
+            block_rows = compptr.v_samp_factor;
+            access_rows = block_rows * 2; /* this and next iMCU row */
+            last_row = false;
+        } else {
+            /* NB: can't use last_row_height here; it is input-side-dependent! */
+            block_rows = (compptr.height_in_blocks % compptr.v_samp_factor);
+            if (block_rows is 0) block_rows = compptr.v_samp_factor;
+            access_rows = block_rows; /* this iMCU row only */
+            last_row = true;
+        }
+        /* Align the virtual buffer for this component. */
+        int buffer_offset;
+        if (cinfo.output_iMCU_row > 0) {
+            access_rows += compptr.v_samp_factor; /* prior iMCU row too */
+            buffer = coef.whole_image[ci];
+            buffer_offset = (cinfo.output_iMCU_row - 1) * compptr.v_samp_factor;
+            buffer_offset += compptr.v_samp_factor; /* point to current iMCU row */
+            first_row = false;
+        } else {
+            buffer = coef.whole_image[ci];
+            buffer_offset = 0;
+            first_row = true;
+        }
+        /* Fetch component-dependent info */
+        coef_bits = coef.coef_bits_latch;
+        int coef_offset = (ci * SAVED_COEFS);
+        quanttbl = compptr.quant_table;
+        Q00 = quanttbl.quantval[0];
+        Q01 = quanttbl.quantval[Q01_POS];
+        Q10 = quanttbl.quantval[Q10_POS];
+        Q20 = quanttbl.quantval[Q20_POS];
+        Q11 = quanttbl.quantval[Q11_POS];
+        Q02 = quanttbl.quantval[Q02_POS];
+//      inverse_DCT = cinfo.idct.inverse_DCT[ci];
+        output_ptr = output_buf[ci];
+        int output_ptr_offset = output_buf_offset[ci];
+        /* Loop over all DCT blocks to be processed. */
+        for (block_row = 0; block_row < block_rows; block_row++) {
+            buffer_ptr = buffer[block_row+buffer_offset];
+            int buffer_ptr_offset = 0, prev_block_row_offset = 0, next_block_row_offset = 0;
+            if (first_row && block_row is 0) {
+                prev_block_row = buffer_ptr;
+                prev_block_row_offset = buffer_ptr_offset;
+            } else {
+                prev_block_row = buffer[block_row-1+buffer_offset];
+                prev_block_row_offset = 0;
+            }
+            if (last_row && block_row is block_rows-1) {
+                next_block_row = buffer_ptr;
+                next_block_row_offset = buffer_ptr_offset;
+            } else {
+                next_block_row = buffer[block_row+1+buffer_offset];
+                next_block_row_offset = 0;
+            }
+            /* We fetch the surrounding DC values using a sliding-register approach.
+             * Initialize all nine here so as to do the right thing on narrow pics.
+             */
+            DC1 = DC2 = DC3 = prev_block_row[0+prev_block_row_offset][0];
+            DC4 = DC5 = DC6 = buffer_ptr[0+buffer_ptr_offset][0];
+            DC7 = DC8 = DC9 = next_block_row[0+next_block_row_offset][0];
+            output_col = 0;
+            last_block_column = compptr.width_in_blocks - 1;
+            for (block_num = 0; block_num <= last_block_column; block_num++) {
+                /* Fetch current DCT block into workspace so we can modify it. */
+//              jcopy_block_row(buffer_ptr, workspace, 1);
+                System.arraycopy(buffer_ptr[buffer_ptr_offset], 0, workspace, 0, workspace.length);
+                /* Update DC values */
+                if (block_num < last_block_column) {
+                    DC3 = prev_block_row[1+prev_block_row_offset][0];
+                    DC6 = buffer_ptr[1+buffer_ptr_offset][0];
+                    DC9 = next_block_row[1+next_block_row_offset][0];
+                }
+                /* Compute coefficient estimates per K.8.
+                 * An estimate is applied only if coefficient is still zero,
+                 * and is not known to be fully accurate.
+                 */
+                /* AC01 */
+                if ((Al=coef_bits[1+coef_offset]) !is 0 && workspace[1] is 0) {
+                    num = 36 * Q00 * (DC4 - DC6);
+                    if (num >= 0) {
+                        pred = (((Q01<<7) + num) / (Q01<<8));
+                        if (Al > 0 && pred >= (1<<Al))
+                            pred = (1<<Al)-1;
+                    } else {
+                        pred = (((Q01<<7) - num) / (Q01<<8));
+                        if (Al > 0 && pred >= (1<<Al))
+                            pred = (1<<Al)-1;
+                        pred = -pred;
+                    }
+                    workspace[1] = cast(short) pred;
+                }
+                /* AC10 */
+                if ((Al=coef_bits[2+coef_offset]) !is 0 && workspace[8] is 0) {
+                    num = 36 * Q00 * (DC2 - DC8);
+                    if (num >= 0) {
+                        pred = (((Q10<<7) + num) / (Q10<<8));
+                        if (Al > 0 && pred >= (1<<Al))
+                            pred = (1<<Al)-1;
+                    } else {
+                        pred = (((Q10<<7) - num) / (Q10<<8));
+                        if (Al > 0 && pred >= (1<<Al))
+                            pred = (1<<Al)-1;
+                        pred = -pred;
+                    }
+                    workspace[8] = cast(short) pred;
+                }
+                /* AC20 */
+                if ((Al=coef_bits[3+coef_offset]) !is 0 && workspace[16] is 0) {
+                    num = 9 * Q00 * (DC2 + DC8 - 2*DC5);
+                    if (num >= 0) {
+                        pred = (((Q20<<7) + num) / (Q20<<8));
+                        if (Al > 0 && pred >= (1<<Al))
+                            pred = (1<<Al)-1;
+                    } else {
+                        pred = (((Q20<<7) - num) / (Q20<<8));
+                        if (Al > 0 && pred >= (1<<Al))
+                            pred = (1<<Al)-1;
+                        pred = -pred;
+                    }
+                    workspace[16] = cast(short) pred;
+                }
+                /* AC11 */
+                if ((Al=coef_bits[4+coef_offset]) !is 0 && workspace[9] is 0) {
+                    num = 5 * Q00 * (DC1 - DC3 - DC7 + DC9);
+                    if (num >= 0) {
+                        pred = (((Q11<<7) + num) / (Q11<<8));
+                        if (Al > 0 && pred >= (1<<Al))
+                            pred = (1<<Al)-1;
+                    } else {
+                        pred = (((Q11<<7) - num) / (Q11<<8));
+                        if (Al > 0 && pred >= (1<<Al))
+                            pred = (1<<Al)-1;
+                        pred = -pred;
+                    }
+                    workspace[9] = cast(short) pred;
+                }
+                /* AC02 */
+                if ((Al=coef_bits[5+coef_offset]) !is 0 && workspace[2] is 0) {
+                    num = 9 * Q00 * (DC4 + DC6 - 2*DC5);
+                    if (num >= 0) {
+                        pred = (((Q02<<7) + num) / (Q02<<8));
+                        if (Al > 0 && pred >= (1<<Al))
+                            pred = (1<<Al)-1;
+                    } else {
+                        pred = (((Q02<<7) - num) / (Q02<<8));
+                        if (Al > 0 && pred >= (1<<Al))
+                            pred = (1<<Al)-1;
+                        pred = -pred;
+                    }
+                    workspace[2] = cast(short) pred;
+                }
+                /* OK, do the IDCT */
+                jpeg_idct_islow(cinfo, compptr, workspace, output_ptr, output_ptr_offset, output_col);
+                /* Advance for next column */
+                DC1 = DC2; DC2 = DC3;
+                DC4 = DC5; DC5 = DC6;
+                DC7 = DC8; DC8 = DC9;
+                buffer_ptr_offset++; prev_block_row_offset++; next_block_row_offset++;
+                output_col += compptr.DCT_scaled_size;
+            }
+            output_ptr_offset += compptr.DCT_scaled_size;
+        }
+    }
+
+    if (++(cinfo.output_iMCU_row) < cinfo.total_iMCU_rows)
+        return JPEG_ROW_COMPLETED;
+    return JPEG_SCAN_COMPLETED;
+}
+
+static int decompress_data (jpeg_decompress_struct cinfo, byte[][][] output_buf, int[] output_buf_offset) {
+    jpeg_d_coef_controller coef = cinfo.coef;
+    int last_iMCU_row = cinfo.total_iMCU_rows - 1;
+    int block_num;
+    int ci, block_row, block_rows;
+    short[][][] buffer;
+    short[][] buffer_ptr;
+    byte[][] output_ptr;
+    int output_col;
+    jpeg_component_info compptr;
+//  inverse_DCT_method_ptr inverse_DCT;
+
+    /* Force some input to be done if we are getting ahead of the input. */
+    while (cinfo.input_scan_number < cinfo.output_scan_number ||
+     (cinfo.input_scan_number is cinfo.output_scan_number &&
+        cinfo.input_iMCU_row <= cinfo.output_iMCU_row))
+    {
+        if (consume_input(cinfo) is JPEG_SUSPENDED)
+            return JPEG_SUSPENDED;
+    }
+
+    /* OK, output from the virtual arrays. */
+    for (ci = 0; ci < cinfo.num_components; ci++) {
+        compptr = cinfo.comp_info[ci];
+        /* Don't bother to IDCT an uninteresting component. */
+        if (! compptr.component_needed)
+            continue;
+        /* Align the virtual buffer for this component. */
+        buffer = coef.whole_image[ci];
+        int buffer_offset = cinfo.output_iMCU_row * compptr.v_samp_factor;
+        /* Count non-dummy DCT block rows in this iMCU row. */
+        if (cinfo.output_iMCU_row < last_iMCU_row)
+            block_rows = compptr.v_samp_factor;
+        else {
+            /* NB: can't use last_row_height here; it is input-side-dependent! */
+            block_rows = (compptr.height_in_blocks % compptr.v_samp_factor);
+            if (block_rows is 0) block_rows = compptr.v_samp_factor;
+        }
+//      inverse_DCT = cinfo.idct.inverse_DCT[ci];
+        output_ptr = output_buf[ci];
+        int output_ptr_offset = output_buf_offset[ci];
+        /* Loop over all DCT blocks to be processed. */
+        for (block_row = 0; block_row < block_rows; block_row++) {
+            buffer_ptr = buffer[block_row+buffer_offset];
+            int buffer_ptr_offset = 0;
+            output_col = 0;
+            for (block_num = 0; block_num < compptr.width_in_blocks; block_num++) {
+                jpeg_idct_islow(cinfo, compptr, buffer_ptr[buffer_ptr_offset], output_ptr, output_ptr_offset, output_col);
+
+                buffer_ptr_offset++;
+                output_col += compptr.DCT_scaled_size;
+            }
+            output_ptr_offset += compptr.DCT_scaled_size;
+        }
+    }
+
+    if (++(cinfo.output_iMCU_row) < cinfo.total_iMCU_rows)
+        return JPEG_ROW_COMPLETED;
+    return JPEG_SCAN_COMPLETED;
+}
+
+static void post_process_data (jpeg_decompress_struct cinfo,
+                byte[][][] input_buf, int[] input_buf_offset, int[] in_row_group_ctr,
+                int in_row_groups_avail,
+                byte[][] output_buf, int[] out_row_ctr,
+                int out_rows_avail)
+{
+    upsample(cinfo, input_buf, input_buf_offset, in_row_group_ctr, in_row_groups_avail, output_buf, out_row_ctr, out_rows_avail);
+}
+
+static void set_bottom_pointers (jpeg_decompress_struct cinfo)
+/* Change the pointer lists to duplicate the last sample row at the bottom
+ * of the image.    whichptr indicates which xbuffer holds the final iMCU row.
+ * Also sets rowgroups_avail to indicate number of nondummy row groups in row.
+ */
+{
+    jpeg_d_main_controller main = cinfo.main;
+    int ci, i, rgroup, iMCUheight, rows_left;
+    jpeg_component_info compptr;
+    byte[][] xbuf;
+
+    for (ci = 0; ci < cinfo.num_components; ci++) {
+        compptr = cinfo.comp_info[ci];
+        /* Count sample rows in one iMCU row and in one row group */
+        iMCUheight = compptr.v_samp_factor * compptr.DCT_scaled_size;
+        rgroup = iMCUheight / cinfo.min_DCT_scaled_size;
+        /* Count nondummy sample rows remaining for this component */
+        rows_left = (compptr.downsampled_height % iMCUheight);
+        if (rows_left is 0) rows_left = iMCUheight;
+        /* Count nondummy row groups.   Should get same answer for each component,
+         * so we need only do it once.
+         */
+        if (ci is 0) {
+            main.rowgroups_avail = ((rows_left-1) / rgroup + 1);
+        }
+        /* Duplicate the last real sample row rgroup*2 times; this pads out the
+         * last partial rowgroup and ensures at least one full rowgroup of context.
+         */
+        xbuf = main.xbuffer[main.whichptr][ci];
+        int xbuf_offset = main.xbuffer_offset[main.whichptr][ci];
+        for (i = 0; i < rgroup * 2; i++) {
+            xbuf[rows_left + i + xbuf_offset] = xbuf[rows_left-1 + xbuf_offset];
+        }
+    }
+}
+
+static void set_wraparound_pointers (jpeg_decompress_struct cinfo)
+/* Set up the "wraparound" pointers at top and bottom of the pointer lists.
+ * This changes the pointer list state from top-of-image to the normal state.
+ */
+{
+    jpeg_d_main_controller main = cinfo.main;
+    int ci, i, rgroup;
+    int M = cinfo.min_DCT_scaled_size;
+    jpeg_component_info compptr;
+    byte[][] xbuf0, xbuf1;
+
+    for (ci = 0; ci < cinfo.num_components; ci++) {
+        compptr = cinfo.comp_info[ci];
+        rgroup = (compptr.v_samp_factor * compptr.DCT_scaled_size) / cinfo.min_DCT_scaled_size; /* height of a row group of component */
+        xbuf0 = main.xbuffer[0][ci];
+        int xbuf0_offset = main.xbuffer_offset[0][ci];
+        xbuf1 = main.xbuffer[1][ci];
+        int xbuf1_offset = main.xbuffer_offset[1][ci];
+        for (i = 0; i < rgroup; i++) {
+            xbuf0[i - rgroup + xbuf0_offset] = xbuf0[rgroup*(M+1) + i + xbuf0_offset];
+            xbuf1[i - rgroup + xbuf1_offset] = xbuf1[rgroup*(M+1) + i + xbuf1_offset];
+            xbuf0[rgroup*(M+2) + i + xbuf0_offset] = xbuf0[i + xbuf0_offset];
+            xbuf1[rgroup*(M+2) + i + xbuf1_offset] = xbuf1[i + xbuf1_offset];
+        }
+    }
+}
+
+static void process_data_crank_post (jpeg_decompress_struct cinfo,
+    byte[][] output_buf, int[] out_row_ctr,
+    int out_rows_avail)
+{
+    error();
+}
+
+static void process_data_context_main (jpeg_decompress_struct cinfo,
+    byte[][] output_buf, int[] out_row_ctr,
+    int out_rows_avail)
+{
+    jpeg_d_main_controller main = cinfo.main;
+
+    /* Read input data if we haven't filled the main buffer yet */
+    if (! main.buffer_full) {
+        int result;
+        switch (cinfo.coef.decompress_data) {
+            case DECOMPRESS_DATA:
+                result = decompress_data(cinfo, main.xbuffer[main.whichptr], main.xbuffer_offset[main.whichptr]);
+                break;
+            case DECOMPRESS_SMOOTH_DATA:
+                result = decompress_smooth_data(cinfo, main.xbuffer[main.whichptr], main.xbuffer_offset[main.whichptr]);
+                break;
+            case DECOMPRESS_ONEPASS:
+                result = decompress_onepass(cinfo, main.xbuffer[main.whichptr], main.xbuffer_offset[main.whichptr]);
+                break;
+            default: result = 0;
+        }
+        if (result is 0)
+            return;         /* suspension forced, can do nothing more */
+        main.buffer_full = true;    /* OK, we have an iMCU row to work with */
+        main.iMCU_row_ctr++;    /* count rows received */
+    }
+
+    /* Postprocessor typically will not swallow all the input data it is handed
+     * in one call (due to filling the output buffer first).    Must be prepared
+     * to exit and restart. This switch lets us keep track of how far we got.
+     * Note that each case falls through to the next on successful completion.
+     */
+    switch (main.context_state) {
+        case CTX_POSTPONED_ROW:
+            /* Call postprocessor using previously set pointers for postponed row */
+            post_process_data (cinfo, main.xbuffer[main.whichptr], main.xbuffer_offset[main.whichptr], main.rowgroup_ctr, main.rowgroups_avail, output_buf, out_row_ctr, out_rows_avail);
+            if (main.rowgroup_ctr[0] < main.rowgroups_avail)
+                return;         /* Need to suspend */
+            main.context_state = CTX_PREPARE_FOR_IMCU;
+            if (out_row_ctr[0] >= out_rows_avail)
+                return;         /* Postprocessor exactly filled output buf */
+            /*FALLTHROUGH*/
+        case CTX_PREPARE_FOR_IMCU:
+            /* Prepare to process first M-1 row groups of this iMCU row */
+            main.rowgroup_ctr[0] = 0;
+            main.rowgroups_avail = (cinfo.min_DCT_scaled_size - 1);
+            /* Check for bottom of image: if so, tweak pointers to "duplicate"
+             * the last sample row, and adjust rowgroups_avail to ignore padding rows.
+             */
+            if (main.iMCU_row_ctr is cinfo.total_iMCU_rows)
+                set_bottom_pointers(cinfo);
+            main.context_state = CTX_PROCESS_IMCU;
+            /*FALLTHROUGH*/
+        case CTX_PROCESS_IMCU:
+            /* Call postprocessor using previously set pointers */
+            post_process_data (cinfo, main.xbuffer[main.whichptr], main.xbuffer_offset[main.whichptr], main.rowgroup_ctr, main.rowgroups_avail, output_buf, out_row_ctr, out_rows_avail);
+            if (main.rowgroup_ctr[0] < main.rowgroups_avail)
+                return;         /* Need to suspend */
+            /* After the first iMCU, change wraparound pointers to normal state */
+            if (main.iMCU_row_ctr is 1)
+                set_wraparound_pointers(cinfo);
+            /* Prepare to load new iMCU row using other xbuffer list */
+            main.whichptr ^= 1; /* 0=>1 or 1=>0 */
+            main.buffer_full = false;
+            /* Still need to process last row group of this iMCU row, */
+            /* which is saved at index M+1 of the other xbuffer */
+            main.rowgroup_ctr[0] = (cinfo.min_DCT_scaled_size + 1);
+            main.rowgroups_avail =  (cinfo.min_DCT_scaled_size + 2);
+            main.context_state = CTX_POSTPONED_ROW;
+        default:
+    }
+}
+
+static void process_data_simple_main (jpeg_decompress_struct cinfo, byte[][] output_buf, int[] out_row_ctr, int out_rows_avail) {
+    jpeg_d_main_controller main = cinfo.main;
+    int rowgroups_avail;
+
+    /* Read input data if we haven't filled the main buffer yet */
+    if (! main.buffer_full) {
+        int result;
+        switch (cinfo.coef.decompress_data) {
+            case DECOMPRESS_DATA:
+                result = decompress_data(cinfo, main.buffer, main.buffer_offset);
+                break;
+            case DECOMPRESS_SMOOTH_DATA:
+                result = decompress_smooth_data(cinfo, main.buffer, main.buffer_offset);
+                break;
+            case DECOMPRESS_ONEPASS:
+                result = decompress_onepass(cinfo, main.buffer, main.buffer_offset);
+                break;
+            default: result = 0;
+        }
+        if (result is 0)
+            return;         /* suspension forced, can do nothing more */
+        main.buffer_full = true;    /* OK, we have an iMCU row to work with */
+    }
+
+    /* There are always min_DCT_scaled_size row groups in an iMCU row. */
+    rowgroups_avail = cinfo.min_DCT_scaled_size;
+    /* Note: at the bottom of the image, we may pass extra garbage row groups
+     * to the postprocessor.    The postprocessor has to check for bottom
+     * of image anyway (at row resolution), so no point in us doing it too.
+     */
+
+    /* Feed the postprocessor */
+    post_process_data (cinfo, main.buffer, main.buffer_offset, main.rowgroup_ctr, rowgroups_avail, output_buf, out_row_ctr, out_rows_avail);
+
+    /* Has postprocessor consumed all the data yet? If so, mark buffer empty */
+    if (main.rowgroup_ctr[0] >= rowgroups_avail) {
+        main.buffer_full = false;
+        main.rowgroup_ctr[0] = 0;
+    }
+}
+
+static int jpeg_read_scanlines (jpeg_decompress_struct cinfo, byte[][] scanlines, int max_lines) {
+
+    if (cinfo.global_state !is DSTATE_SCANNING)
+        error();
+//      ERREXIT1(cinfo, JERR_BAD_STATE, cinfo.global_state);
+    if (cinfo.output_scanline >= cinfo.output_height) {
+//      WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
+        return 0;
+    }
+
+    /* Call progress monitor hook if present */
+//  if (cinfo.progress !is NULL) {
+//      cinfo.progress.pass_counter = cast(long) cinfo.output_scanline;
+//      cinfo.progress.pass_limit = cast(long) cinfo.output_height;
+//      (*cinfo.progress.progress_monitor) ((j_common_ptr) cinfo);
+//  }
+
+    /* Process some data */
+    cinfo.row_ctr[0] = 0;
+    switch (cinfo.main.process_data) {
+        case PROCESS_DATA_SIMPLE_MAIN:
+            process_data_simple_main (cinfo, scanlines, cinfo.row_ctr, max_lines);
+            break;
+        case PROCESS_DATA_CONTEXT_MAIN:
+            process_data_context_main (cinfo, scanlines, cinfo.row_ctr, max_lines);
+            break;
+        case PROCESS_DATA_CRANK_POST:
+            process_data_crank_post (cinfo, scanlines, cinfo.row_ctr, max_lines);
+            break;
+        default: error();
+    }
+    cinfo.output_scanline += cinfo.row_ctr[0];
+    return cinfo.row_ctr[0];
+}
+
+
+static bool output_pass_setup (jpeg_decompress_struct cinfo) {
+    if (cinfo.global_state !is DSTATE_PRESCAN) {
+        /* First call: do pass setup */
+        prepare_for_output_pass (cinfo);
+        cinfo.output_scanline = 0;
+        cinfo.global_state = DSTATE_PRESCAN;
+    }
+    /* Loop over any required dummy passes */
+    while (cinfo.master.is_dummy_pass) {
+        error();
+//#ifdef QUANT_2PASS_SUPPORTED
+//      /* Crank through the dummy pass */
+//      while (cinfo.output_scanline < cinfo.output_height) {
+//          JDIMENSION last_scanline;
+//          /* Call progress monitor hook if present */
+//          if (cinfo.progress !is NULL) {
+//  cinfo.progress.pass_counter = cast(long) cinfo.output_scanline;
+//  cinfo.progress.pass_limit = cast(long) cinfo.output_height;
+//  (*cinfo.progress.progress_monitor) ((j_common_ptr) cinfo);
+//          }
+//          /* Process some data */
+//          last_scanline = cinfo.output_scanline;
+//          (*cinfo.main.process_data) (cinfo, (JSAMPARRAY) NULL,
+//                      &cinfo.output_scanline, (JDIMENSION) 0);
+//          if (cinfo.output_scanline is last_scanline)
+//  return FALSE;       /* No progress made, must suspend */
+//      }
+//      /* Finish up dummy pass, and set up for another one */
+//      (*cinfo.master.finish_output_pass) (cinfo);
+//      (*cinfo.master.prepare_for_output_pass) (cinfo);
+//      cinfo.output_scanline = 0;
+//#else
+//      ERREXIT(cinfo, JERR_NOT_COMPILED);
+//#endif /* QUANT_2PASS_SUPPORTED */
+    }
+    /* Ready for application to drive output pass through
+     * jpeg_read_scanlines or jpeg_read_raw_data.
+     */
+    cinfo.global_state = cinfo.raw_data_out ? DSTATE_RAW_OK : DSTATE_SCANNING;
+    return true;
+}
+
+static bool get_dht (jpeg_decompress_struct cinfo)
+/* Process a DHT marker */
+{
+    int length;
+    byte[] bits = new byte[17];
+    byte[] huffval = new byte[256];
+    int i, index, count;
+    JHUFF_TBL htblptr;
+
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    length = (cinfo.buffer[cinfo.bytes_offset++] & 0xFF) << 8;
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    length |= cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+    length -= 2;
+
+    while (length > 16) {
+        if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+        index = cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+
+//      TRACEMS1(cinfo, 1, JTRC_DHT, index);
+
+        bits[0] = 0;
+        count = 0;
+        for (i = 1; i <= 16; i++) {
+            if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+        bits[i] = cinfo.buffer[cinfo.bytes_offset++];
+            count += bits[i] & 0xFF;
+        }
+
+        length -= 1 + 16;
+
+//      TRACEMS8(cinfo, 2, JTRC_HUFFBITS,
+//           bits[1], bits[2], bits[3], bits[4],
+//           bits[5], bits[6], bits[7], bits[8]);
+//      TRACEMS8(cinfo, 2, JTRC_HUFFBITS,
+//           bits[9], bits[10], bits[11], bits[12],
+//           bits[13], bits[14], bits[15], bits[16]);
+
+        /* Here we just do minimal validation of the counts to avoid walking
+         * off the end of our table space.  jdhuff.c will check more carefully.
+         */
+        if (count > 256 || (count) > length)
+            error();
+//          ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
+
+        for (i = 0; i < count; i++) {
+            if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+            huffval[i] = cinfo.buffer[cinfo.bytes_offset++];
+        }
+
+        length -= count;
+
+        if ((index & 0x10) !is 0) {      /* AC table definition */
+            index -= 0x10;
+            htblptr = cinfo.ac_huff_tbl_ptrs[index] = new JHUFF_TBL();
+        } else {            /* DC table definition */
+            htblptr = cinfo.dc_huff_tbl_ptrs[index] = new JHUFF_TBL();
+        }
+
+        if (index < 0 || index >= NUM_HUFF_TBLS)
+            error();
+//          ERREXIT1(cinfo, JERR_DHT_INDEX, index);
+
+        System.arraycopy(bits, 0, htblptr.bits, 0, bits.length);
+        System.arraycopy(huffval, 0, htblptr.huffval, 0, huffval.length);
+    }
+
+    if (length !is 0)
+        error();
+//      ERREXIT(cinfo, JERR_BAD_LENGTH);
+
+    return true;
+}
+
+
+static bool get_dqt (jpeg_decompress_struct cinfo)
+/* Process a DQT marker */
+{
+    int length;
+    int n, i, prec;
+    int tmp;
+    JQUANT_TBL quant_ptr;
+
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    length = (cinfo.buffer[cinfo.bytes_offset++] & 0xFF) << 8;
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    length |= cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+    length -= 2;
+
+    while (length > 0) {
+        if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    n = cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+        prec = n >> 4;
+        n &= 0x0F;
+
+//      TRACEMS2(cinfo, 1, JTRC_DQT, n, prec);
+
+        if (n >= NUM_QUANT_TBLS)
+            error();
+//          ERREXIT1(cinfo, JERR_DQT_INDEX, n);
+
+        if (cinfo.quant_tbl_ptrs[n] is null)
+            cinfo.quant_tbl_ptrs[n] = new JQUANT_TBL();
+        quant_ptr = cinfo.quant_tbl_ptrs[n];
+
+        for (i = 0; i < DCTSIZE2; i++) {
+            if (prec !is 0) {
+                if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+                tmp = (cinfo.buffer[cinfo.bytes_offset++] & 0xFF) << 8;
+                if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+                tmp |= cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+            } else {
+                    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+                tmp = cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+            }
+            /* We convert the zigzag-order table to natural array order. */
+            quant_ptr.quantval[jpeg_natural_order[i]] = cast(short) tmp;
+        }
+
+//      if (cinfo.err.trace_level >= 2) {
+//          for (i = 0; i < DCTSIZE2; i += 8) {
+//              TRACEMS8(cinfo, 2, JTRC_QUANTVALS,
+//                  quant_ptr.quantval[i],   quant_ptr.quantval[i+1],
+//                   quant_ptr.quantval[i+2], quant_ptr.quantval[i+3],
+//                   quant_ptr.quantval[i+4], quant_ptr.quantval[i+5],
+//                   quant_ptr.quantval[i+6], quant_ptr.quantval[i+7]);
+//          }
+//      }
+
+        length -= (DCTSIZE2+1);
+        if (prec !is 0) length -= DCTSIZE2;
+    }
+
+    if (length !is 0)
+        error();
+//      ERREXIT(cinfo, JERR_BAD_LENGTH);
+
+    return true;
+}
+
+static bool get_dri (jpeg_decompress_struct cinfo)
+/* Process a DRI marker */
+{
+    int length;
+    int tmp;
+
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    length = (cinfo.buffer[cinfo.bytes_offset++] & 0xFF) << 8;
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    length |= cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+
+    if (length !is 4)
+    error();
+//      ERREXIT(cinfo, JERR_BAD_LENGTH);
+
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    tmp = (cinfo.buffer[cinfo.bytes_offset++] & 0xFF) << 8;
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    tmp |= cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+
+//  TRACEMS1(cinfo, 1, JTRC_DRI, tmp);
+
+    cinfo.restart_interval = tmp;
+
+    return true;
+}
+
+static bool get_dac (jpeg_decompress_struct cinfo)
+/* Process a DAC marker */
+{
+    int length;
+    int index, val;
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    length = (cinfo.buffer[cinfo.bytes_offset++] & 0xFF) << 8;
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    length |= cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+    length -= 2;
+
+    while (length > 0) {
+        if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+        index = cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+        if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+        val = cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+
+        length -= 2;
+
+//      TRACEMS2(cinfo, 1, JTRC_DAC, index, val);
+
+        if (index < 0 || index >= (2*NUM_ARITH_TBLS))
+            error();
+//          ERREXIT1(cinfo, JERR_DAC_INDEX, index);
+
+        if (index >= NUM_ARITH_TBLS) { /* define AC table */
+            cinfo.arith_ac_K[index-NUM_ARITH_TBLS] = cast(byte) val;
+        } else {            /* define DC table */
+            cinfo.arith_dc_L[index] = cast(byte) (val & 0x0F);
+            cinfo.arith_dc_U[index] = cast(byte) (val >> 4);
+            if (cinfo.arith_dc_L[index] > cinfo.arith_dc_U[index])
+                error();
+//  ERREXIT1(cinfo, JERR_DAC_VALUE, val);
+        }
+    }
+
+    if (length !is 0)
+        error();
+//      ERREXIT(cinfo, JERR_BAD_LENGTH);
+
+    return true;
+}
+
+
+static bool get_sos (jpeg_decompress_struct cinfo)
+/* Process a SOS marker */
+{
+    int length;
+    int i, ci, n, c, cc;
+    jpeg_component_info compptr = null;
+
+    if (! cinfo.marker.saw_SOF)
+        error();
+//      ERREXIT(cinfo, JERR_SOS_NO_SOF);
+
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    length = (cinfo.buffer[cinfo.bytes_offset++] & 0xFF) << 8;
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    length |= cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    n = cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+
+//  TRACEMS1(cinfo, 1, JTRC_SOS, n);
+
+    if (length !is (n * 2 + 6) || n < 1 || n > MAX_COMPS_IN_SCAN)
+        error();
+//      ERREXIT(cinfo, JERR_BAD_LENGTH);
+
+    cinfo.comps_in_scan = n;
+
+    /* Collect the component-spec parameters */
+
+    for (i = 0; i < n; i++) {
+        if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+        cc = cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+        if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+        c = cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+
+        for (ci = 0; ci < cinfo.num_components; ci++) {
+            compptr = cinfo.comp_info[ci];
+            if (cc is compptr.component_id)
+                break;
+        }
+
+        if (ci is cinfo.num_components)
+            error();
+//          ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc);
+
+        cinfo.cur_comp_info[i] = compptr;
+        compptr.dc_tbl_no = (c >> 4) & 15;
+        compptr.ac_tbl_no = (c       ) & 15;
+
+//      TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, cc, compptr.dc_tbl_no, compptr.ac_tbl_no);
+    }
+
+    /* Collect the additional scan parameters Ss, Se, Ah/Al. */
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    c = cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+    cinfo.Ss = c;
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    c = cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+    cinfo.Se = c;
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    c = cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+    cinfo.Ah = (c >> 4) & 15;
+    cinfo.Al = (c        ) & 15;
+
+//  TRACEMS4(cinfo, 1, JTRC_SOS_PARAMS, cinfo.Ss, cinfo.Se, cinfo.Ah, cinfo.Al);
+
+    /* Prepare to scan data & restart markers */
+    cinfo.marker.next_restart_num = 0;
+
+    /* Count another SOS marker */
+    cinfo.input_scan_number++;
+
+    return true;
+}
+
+static bool get_sof (jpeg_decompress_struct cinfo, bool is_prog, bool is_arith) {
+    int length;
+    int c, ci;
+
+    cinfo.progressive_mode = is_prog;
+    cinfo.arith_code = is_arith;
+
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    length = (cinfo.buffer[cinfo.bytes_offset++] & 0xFF) << 8;
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    length |= cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    cinfo.data_precision = cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    cinfo.image_height = (cinfo.buffer[cinfo.bytes_offset++] & 0xFF) << 8;
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    cinfo.image_height |= cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    cinfo.image_width = (cinfo.buffer[cinfo.bytes_offset++] & 0xFF) << 8;
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    cinfo.image_width |= cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    cinfo.num_components = cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+
+    length -= 8;
+
+//  TRACEMS4(cinfo, 1, JTRC_SOF, cinfo.unread_marker,
+//       cast(int) cinfo.image_width, cast(int) cinfo.image_height,
+//       cinfo.num_components);
+
+    if (cinfo.marker.saw_SOF)
+        error();
+//      ERREXIT(cinfo, JERR_SOF_DUPLICATE);
+
+    /* We don't support files in which the image height is initially specified */
+    /* as 0 and is later redefined by DNL.  As long as we have to check that,   */
+    /* might as well have a general sanity check. */
+    if (cinfo.image_height <= 0 || cinfo.image_width <= 0 || cinfo.num_components <= 0)
+        error();
+//      ERREXIT(cinfo, JERR_EMPTY_IMAGE);
+
+    if (length !is (cinfo.num_components * 3))
+        error();
+//      ERREXIT(cinfo, JERR_BAD_LENGTH);
+
+    if (cinfo.comp_info is null)    /* do only once, even if suspend */
+        cinfo.comp_info = new jpeg_component_info[cinfo.num_components];
+
+    for (ci = 0; ci < cinfo.num_components; ci++) {
+        jpeg_component_info compptr = cinfo.comp_info[ci] = new jpeg_component_info();
+        compptr.component_index = ci;
+        if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+        compptr.component_id = cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+        if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+        c = cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+        compptr.h_samp_factor = (c >> 4) & 15;
+        compptr.v_samp_factor = (c       ) & 15;
+        if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+        compptr.quant_tbl_no = cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+
+//      TRACEMS4(cinfo, 1, JTRC_SOF_COMPONENT,
+//           compptr.component_id, compptr.h_samp_factor,
+//           compptr.v_samp_factor, compptr.quant_tbl_no);
+    }
+
+    cinfo.marker.saw_SOF = true;
+
+    return true;
+}
+
+static void sep_upsample (jpeg_decompress_struct cinfo, byte[][][] input_buf, int[] input_buf_offset,
+        int[] in_row_group_ctr, int in_row_groups_avail,
+        byte[][] output_buf, int[] out_row_ctr, int out_rows_avail)
+{
+    jpeg_upsampler upsample = cinfo.upsample;
+    int ci;
+    jpeg_component_info compptr;
+    int num_rows;
+
+    /* Fill the conversion buffer, if it's empty */
+    if (upsample.next_row_out >= cinfo.max_v_samp_factor) {
+        for (ci = 0; ci < cinfo.num_components; ci++) {
+            compptr = cinfo.comp_info[ci];
+            /* Invoke per-component upsample method.    Notice we pass a POINTER
+             * to color_buf[ci], so that fullsize_upsample can change it.
+             */
+            int offset = input_buf_offset[ci] + (in_row_group_ctr[0] * upsample.rowgroup_height[ci]);
+            switch (upsample.methods[ci]) {
+                case NOOP_UPSAMPLE: noop_upsample(cinfo, compptr, input_buf[ci], offset, upsample.color_buf, upsample.color_buf_offset, ci); break;
+                case FULLSIZE_UPSAMPLE: fullsize_upsample(cinfo, compptr, input_buf[ci], offset, upsample.color_buf, upsample.color_buf_offset, ci); break;
+                case H2V1_FANCY_UPSAMPLE: h2v1_fancy_upsample(cinfo, compptr, input_buf[ci], offset, upsample.color_buf, upsample.color_buf_offset, ci); break;
+                case H2V1_UPSAMPLE: h2v1_upsample(cinfo, compptr, input_buf[ci], offset, upsample.color_buf, upsample.color_buf_offset, ci); break;
+                case H2V2_FANCY_UPSAMPLE: h2v2_fancy_upsample(cinfo, compptr, input_buf[ci], offset, upsample.color_buf, upsample.color_buf_offset, ci); break;
+                case H2V2_UPSAMPLE: h2v2_upsample(cinfo, compptr, input_buf[ci], offset, upsample.color_buf, upsample.color_buf_offset, ci); break;
+                case INT_UPSAMPLE: int_upsample(cinfo, compptr, input_buf[ci], offset, upsample.color_buf, upsample.color_buf_offset, ci); break;
+            default:
+            }
+        }
+        upsample.next_row_out = 0;
+    }
+
+    /* Color-convert and emit rows */
+
+    /* How many we have in the buffer: */
+    num_rows =  (cinfo.max_v_samp_factor - upsample.next_row_out);
+    /* Not more than the distance to the end of the image.  Need this test
+     * in case the image height is not a multiple of max_v_samp_factor:
+     */
+    if (num_rows > upsample.rows_to_go)
+        num_rows = upsample.rows_to_go;
+    /* And not more than what the client can accept: */
+    out_rows_avail -= out_row_ctr[0];
+    if (num_rows > out_rows_avail)
+        num_rows = out_rows_avail;
+
+    switch (cinfo.cconvert.color_convert) {
+        case NULL_CONVERT: null_convert (cinfo, upsample.color_buf, upsample.color_buf_offset, upsample.next_row_out, output_buf, out_row_ctr[0], num_rows); break;
+        case GRAYSCALE_CONVERT: grayscale_convert (cinfo, upsample.color_buf, upsample.color_buf_offset, upsample.next_row_out, output_buf, out_row_ctr[0], num_rows); break;
+        case YCC_RGB_CONVERT: ycc_rgb_convert (cinfo, upsample.color_buf, upsample.color_buf_offset, upsample.next_row_out, output_buf, out_row_ctr[0], num_rows); break;
+        case GRAY_RGB_CONVERT: gray_rgb_convert (cinfo, upsample.color_buf, upsample.color_buf_offset, upsample.next_row_out, output_buf, out_row_ctr[0], num_rows); break;
+        case YCCK_CMYK_CONVERT: error(); break;
+            default:
+    }
+
+    /* Adjust counts */
+    out_row_ctr[0] += num_rows;
+    upsample.rows_to_go -= num_rows;
+    upsample.next_row_out += num_rows;
+    /* When the buffer is emptied, declare this input row group consumed */
+    if (upsample.next_row_out >= cinfo.max_v_samp_factor) {
+        in_row_group_ctr[0]++;
+    }
+}
+
+static void noop_upsample (jpeg_decompress_struct cinfo, jpeg_component_info compptr,
+     byte[][] input_data, int input_data_offset, byte[][][] output_data_ptr, int[] output_data_offset, int output_data_index)
+{
+    output_data_ptr[output_data_index] = null;  /* safety check */
+}
+
+static void fullsize_upsample (jpeg_decompress_struct cinfo, jpeg_component_info compptr,
+     byte[][] input_data, int input_data_offset, byte[][][] output_data_ptr, int[] output_data_offset, int output_data_index)
+{
+    output_data_ptr[output_data_index] = input_data;
+    output_data_offset[output_data_index] = input_data_offset;
+}
+
+static void h2v1_upsample (jpeg_decompress_struct cinfo, jpeg_component_info compptr,
+     byte[][] input_data, int input_data_offset, byte[][][] output_data_ptr, int[] output_data_offset, int output_data_index)
+{
+    byte[][] output_data = output_data_ptr[output_data_index];
+    byte[] inptr, outptr;
+    byte invalue;
+    int outend;
+    int inrow;
+    output_data_offset[output_data_index] = 0;
+
+    for (inrow = 0; inrow < cinfo.max_v_samp_factor; inrow++) {
+        inptr = input_data[inrow+input_data_offset];
+        outptr = output_data[inrow];
+        int inptr_offset = 0, outptr_offset = 0;
+        outend = outptr_offset + cinfo.output_width;
+        while (outptr_offset < outend) {
+            invalue = inptr[inptr_offset++];    /* don't need GETJSAMPLE() here */
+            outptr[outptr_offset++] = invalue;
+            outptr[outptr_offset++] = invalue;
+        }
+    }
+}
+
+static void h2v2_upsample (jpeg_decompress_struct cinfo, jpeg_component_info compptr,
+    byte[][] input_data, int input_data_offset, byte[][][] output_data_ptr, int[] output_data_offset, int output_data_index)
+{
+    byte[][] output_data = output_data_ptr[output_data_index];
+    byte[] inptr, outptr;
+    byte invalue;
+    int outend;
+    int inrow, outrow;
+    output_data_offset[output_data_index] = 0;
+
+    inrow = outrow = 0;
+    while (outrow < cinfo.max_v_samp_factor) {
+        inptr = input_data[inrow+input_data_offset];
+        outptr = output_data[outrow];
+        int inptr_offset = 0, outptr_offset = 0;
+        outend = outptr_offset + cinfo.output_width;
+        while (outptr_offset < outend) {
+            invalue = inptr[inptr_offset++];    /* don't need GETJSAMPLE() here */
+            outptr[outptr_offset++] = invalue;
+            outptr[outptr_offset++] = invalue;
+        }
+        jcopy_sample_rows(output_data, outrow, output_data, outrow+1, 1, cinfo.output_width);
+        inrow++;
+        outrow += 2;
+    }
+}
+
+static void h2v1_fancy_upsample (jpeg_decompress_struct cinfo, jpeg_component_info compptr,
+     byte[][] input_data, int input_data_offset, byte[][][] output_data_ptr, int[] output_data_offset, int output_data_index)
+{
+    byte[][] output_data = output_data_ptr[output_data_index];
+    byte[] inptr, outptr;
+    int invalue;
+    int colctr;
+    int inrow;
+    output_data_offset[output_data_index] = 0;
+
+    for (inrow = 0; inrow < cinfo.max_v_samp_factor; inrow++) {
+        inptr = input_data[inrow+input_data_offset];
+        outptr = output_data[inrow];
+        int inptr_offset = 0, outptr_offset = 0;
+        /* Special case for first column */
+        invalue = inptr[inptr_offset++] & 0xFF;
+        outptr[outptr_offset++] = cast(byte) invalue;
+        outptr[outptr_offset++] = cast(byte) ((invalue * 3 + (inptr[inptr_offset] & 0xFF) + 2) >> 2);
+
+        for (colctr = compptr.downsampled_width - 2; colctr > 0; colctr--) {
+            /* General case: 3/4 * nearer pixel + 1/4 * further pixel */
+            invalue = (inptr[inptr_offset++] & 0xFF) * 3;
+            outptr[outptr_offset++] = cast(byte) ((invalue + (inptr[inptr_offset-2] & 0xFF) + 1) >> 2);
+            outptr[outptr_offset++] = cast(byte) ((invalue + (inptr[inptr_offset] & 0xFF) + 2) >> 2);
+        }
+
+        /* Special case for last column */
+        invalue = (inptr[inptr_offset] & 0xFF);
+        outptr[outptr_offset++] = cast(byte) ((invalue * 3 + (inptr[inptr_offset-1] & 0xFF) + 1) >> 2);
+        outptr[outptr_offset++] = cast(byte) invalue;
+    }
+}
+
+static void h2v2_fancy_upsample (jpeg_decompress_struct cinfo, jpeg_component_info compptr,
+    byte[][] input_data, int input_data_offset, byte[][][] output_data_ptr, int[] output_data_offset, int output_data_index)
+{
+    byte[][] output_data = output_data_ptr[output_data_index];
+    byte[] inptr0, inptr1, outptr;
+    int thiscolsum, lastcolsum, nextcolsum;
+    int colctr;
+    int inrow, outrow, v;
+    output_data_offset[output_data_index] = 0;
+
+    inrow = outrow = 0;
+    while (outrow < cinfo.max_v_samp_factor) {
+        for (v = 0; v < 2; v++) {
+            /* inptr0 points to nearest input row, inptr1 points to next nearest */
+            inptr0 = input_data[inrow+input_data_offset];
+            if (v is 0)     /* next nearest is row above */
+                inptr1 = input_data[inrow-1+input_data_offset];
+            else            /* next nearest is row below */
+                inptr1 = input_data[inrow+1+input_data_offset];
+            outptr = output_data[outrow++];
+
+            int inptr0_offset = 0, inptr1_offset = 0, outptr_offset = 0;
+
+            /* Special case for first column */
+            thiscolsum = (inptr0[inptr0_offset++] & 0xFF) * 3 + (inptr1[inptr1_offset++] & 0xFF);
+            nextcolsum = (inptr0[inptr0_offset++] & 0xFF) * 3 + (inptr1[inptr1_offset++] & 0xFF);
+            outptr[outptr_offset++] = cast(byte) ((thiscolsum * 4 + 8) >> 4);
+            outptr[outptr_offset++] = cast(byte) ((thiscolsum * 3 + nextcolsum + 7) >> 4);
+            lastcolsum = thiscolsum; thiscolsum = nextcolsum;
+
+            for (colctr = compptr.downsampled_width - 2; colctr > 0; colctr--) {
+                /* General case: 3/4 * nearer pixel + 1/4 * further pixel in each */
+                /* dimension, thus 9/16, 3/16, 3/16, 1/16 overall */
+                nextcolsum = (inptr0[inptr0_offset++] & 0xFF) * 3 + (inptr1[inptr1_offset++] & 0xFF);
+                outptr[outptr_offset++] = cast(byte) ((thiscolsum * 3 + lastcolsum + 8) >> 4);
+                outptr[outptr_offset++] = cast(byte) ((thiscolsum * 3 + nextcolsum + 7) >> 4);
+                lastcolsum = thiscolsum; thiscolsum = nextcolsum;
+            }
+
+            /* Special case for last column */
+            outptr[outptr_offset++] = cast(byte) ((thiscolsum * 3 + lastcolsum + 8) >> 4);
+            outptr[outptr_offset++] = cast(byte) ((thiscolsum * 4 + 7) >> 4);
+        }
+        inrow++;
+    }
+}
+
+static void int_upsample (jpeg_decompress_struct cinfo, jpeg_component_info compptr,
+     byte[][] input_data, int input_data_offset, byte[][][] output_data_ptr, int[] output_data_offset, int output_data_index)
+{
+    jpeg_upsampler upsample = cinfo.upsample;
+    byte[][] output_data = output_data_ptr[output_data_index];
+    byte[] inptr, outptr;
+    byte invalue;
+    int h;
+    int outend;
+    int h_expand, v_expand;
+    int inrow, outrow;
+    output_data_offset[output_data_index] = 0;
+
+    h_expand = upsample.h_expand[compptr.component_index];
+    v_expand = upsample.v_expand[compptr.component_index];
+
+    inrow = outrow = 0;
+    while (outrow < cinfo.max_v_samp_factor) {
+        /* Generate one output row with proper horizontal expansion */
+        inptr = input_data[inrow+input_data_offset];
+        int inptr_offset = 0;
+        outptr = output_data[outrow];
+        int outptr_offset = 0;
+        outend = outptr_offset + cinfo.output_width;
+        while (outptr_offset < outend) {
+            invalue = inptr[inptr_offset++];    /* don't need GETJSAMPLE() here */
+            for (h = h_expand; h > 0; h--) {
+                outptr[outptr_offset++] = invalue;
+            }
+        }
+        /* Generate any additional output rows by duplicating the first one */
+        if (v_expand > 1) {
+            jcopy_sample_rows(output_data, outrow, output_data, outrow+1, v_expand-1, cinfo.output_width);
+        }
+        inrow++;
+        outrow += v_expand;
+    }
+}
+
+static void null_convert (jpeg_decompress_struct cinfo,
+    byte[][][] input_buf, int[] input_buf_offset, int input_row,
+    byte[][] output_buf, int output_buf_offset, int num_rows)
+{
+    byte[] inptr, outptr;
+    int count;
+    int num_components = cinfo.num_components;
+    int num_cols = cinfo.output_width;
+    int ci;
+
+    while (--num_rows >= 0) {
+        for (ci = 0; ci < num_components; ci++) {
+            inptr = input_buf[ci][input_row+input_buf_offset[0]];
+            outptr = output_buf[output_buf_offset];
+            /* BGR instead of RGB */
+            int offset = 0;
+            switch (ci) {
+                case 2: offset = RGB_BLUE; break;
+                case 1: offset = RGB_GREEN; break;
+                case 0: offset = RGB_RED; break;
+            default:
+            }
+            int outptr_offset = offset, inptr_offset = 0;
+            for (count = num_cols; count > 0; count--) {
+                outptr[outptr_offset] = inptr[inptr_offset++];  /* needn't bother with GETJSAMPLE() here */
+                outptr_offset += num_components;
+            }
+        }
+        input_row++;
+        output_buf_offset++;
+    }
+}
+
+static void grayscale_convert (jpeg_decompress_struct cinfo,
+    byte[][][] input_buf, int[] input_buf_offset, int input_row,
+    byte[][] output_buf, int output_buf_offset, int num_rows)
+{
+  jcopy_sample_rows(input_buf[0], input_row+input_buf_offset[0], output_buf, output_buf_offset,
+            num_rows, cinfo.output_width);
+}
+
+static void gray_rgb_convert (jpeg_decompress_struct cinfo,
+    byte[][][] input_buf, int[] input_buf_offset, int input_row,
+    byte[][] output_buf, int output_buf_offset, int num_rows)
+{
+    byte[] inptr, outptr;
+    int col;
+    int num_cols = cinfo.output_width;
+
+    while (--num_rows >= 0) {
+        inptr = input_buf[0][input_row+++input_buf_offset[0]];
+        outptr = output_buf[output_buf_offset++];
+        int outptr_offset = 0;
+        for (col = 0; col < num_cols; col++) {
+            /* We can dispense with GETJSAMPLE() here */
+            outptr[RGB_RED+outptr_offset] = outptr[RGB_GREEN+outptr_offset] = outptr[RGB_BLUE+outptr_offset] = inptr[col];
+            outptr_offset += RGB_PIXELSIZE;
+        }
+    }
+}
+
+static void ycc_rgb_convert (jpeg_decompress_struct cinfo,
+    byte[][][] input_buf, int[] input_buf_offset, int input_row,
+    byte[][] output_buf, int output_buf_offset, int num_rows)
+{
+    jpeg_color_deconverter cconvert = cinfo.cconvert;
+    int y, cb, cr;
+    byte[] outptr;
+    byte[] inptr0, inptr1, inptr2;
+    int col;
+    int num_cols = cinfo.output_width;
+    /* copy these pointers into registers if possible */
+    byte[] range_limit = cinfo.sample_range_limit;
+    int range_limit_offset = cinfo.sample_range_limit_offset;
+    int[] Crrtab = cconvert.Cr_r_tab;
+    int[] Cbbtab = cconvert.Cb_b_tab;
+    int[] Crgtab = cconvert.Cr_g_tab;
+    int[] Cbgtab = cconvert.Cb_g_tab;
+//      SHIFT_TEMPS
+
+    while (--num_rows >= 0) {
+        inptr0 = input_buf[0][input_row+input_buf_offset[0]];
+        inptr1 = input_buf[1][input_row+input_buf_offset[1]];
+        inptr2 = input_buf[2][input_row+input_buf_offset[2]];
+        input_row++;
+        outptr = output_buf[output_buf_offset++];
+        int outptr_offset = 0;
+        for (col = 0; col < num_cols; col++) {
+            y = (inptr0[col] & 0xFF);
+            cb = (inptr1[col] & 0xFF);
+            cr = (inptr2[col] & 0xFF);
+            /* Range-limiting is essential due to noise introduced by DCT losses. */
+            outptr[outptr_offset + RGB_RED] =   range_limit[y + Crrtab[cr] + range_limit_offset];
+            outptr[outptr_offset + RGB_GREEN] = range_limit[y + ((Cbgtab[cb] + Crgtab[cr]>>SCALEBITS)) + range_limit_offset];
+            outptr[outptr_offset + RGB_BLUE] =  range_limit[y + Cbbtab[cb] + range_limit_offset];
+            outptr_offset += RGB_PIXELSIZE;
+        }
+    }
+}
+
+static bool process_APPn(int n, jpeg_decompress_struct cinfo) {
+    if (n is 0 || n is 14) {
+        return get_interesting_appn(cinfo);
+    }
+    return skip_variable(cinfo);
+}
+
+static bool process_COM(jpeg_decompress_struct cinfo) {
+    return skip_variable(cinfo);
+}
+
+static void skip_input_data (jpeg_decompress_struct cinfo, int num_bytes) {
+    if (num_bytes > 0) {
+        while (num_bytes > cinfo.bytes_in_buffer - cinfo.bytes_offset) {
+            num_bytes -= cinfo.bytes_in_buffer - cinfo.bytes_offset;
+            if (!fill_input_buffer(cinfo)) error();
+            /* note we assume that fill_input_buffer will never return FALSE,
+             * so suspension need not be handled.
+             */
+        }
+        cinfo.bytes_offset += num_bytes;
+    }
+}
+
+static bool skip_variable (jpeg_decompress_struct cinfo)
+/* Skip over an unknown or uninteresting variable-length marker */
+{
+    int length;
+
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    length = (cinfo.buffer[cinfo.bytes_offset++] & 0xFF) << 8;
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    length |= cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+
+    length -= 2;
+
+//  TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo.unread_marker, cast(int) length);
+
+    if (length > 0) {
+        skip_input_data (cinfo, length);
+    }
+
+    return true;
+}
+
+static bool get_interesting_appn (jpeg_decompress_struct cinfo)
+/* Process an APP0 or APP14 marker without saving it */
+{
+    int length;
+    byte[] b = new byte[APPN_DATA_LEN];
+    int i, numtoread;
+
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    length = (cinfo.buffer[cinfo.bytes_offset++] & 0xFF) << 8;
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    length |= cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+    length -= 2;
+
+    /* get the interesting part of the marker data */
+    if (length >= APPN_DATA_LEN)
+        numtoread = APPN_DATA_LEN;
+    else if (length > 0)
+        numtoread = length;
+    else
+        numtoread = 0;
+    for (i = 0; i < numtoread; i++) {
+        if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+        b[i] = cinfo.buffer[cinfo.bytes_offset++];
+    }
+    length -= numtoread;
+
+    /* process it */
+    switch (cinfo.unread_marker) {
+        case M_APP0:
+            examine_app0(cinfo, b, numtoread, length);
+            break;
+        case M_APP14:
+            examine_app14(cinfo, b, numtoread, length);
+            break;
+        default:
+            /* can't get here unless jpeg_save_markers chooses wrong processor */
+            error();
+//          ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo.unread_marker);
+            break;
+    }
+
+    /* skip any remaining data -- could be lots */
+    if (length > 0)
+        skip_input_data (cinfo, length);
+
+    return true;
+}
+
+static void examine_app0 (jpeg_decompress_struct cinfo, byte[] data, int datalen, int remaining)
+/* Examine first few bytes from an APP0.
+ * Take appropriate action if it is a JFIF marker.
+ * datalen is # of bytes at data[], remaining is length of rest of marker data.
+ */
+{
+    int totallen = datalen + remaining;
+
+    if (datalen >= APP0_DATA_LEN &&
+            (data[0] & 0xFF) is 0x4A &&
+            (data[1] & 0xFF) is 0x46 &&
+            (data[2] & 0xFF) is 0x49 &&
+            (data[3] & 0xFF) is 0x46 &&
+            (data[4] & 0xFF) is 0)
+    {
+        /* Found JFIF APP0 marker: save info */
+        cinfo.saw_JFIF_marker = true;
+        cinfo.JFIF_major_version = (data[5]);
+        cinfo.JFIF_minor_version = cast(byte)(data[6] & 0xFF);
+        cinfo.density_unit = cast(byte)(data[7] & 0xFF);
+        cinfo.X_density = cast(short)(((data[8] & 0xFF) << 8) + (data[9] & 0xFF));
+        cinfo.Y_density = cast(short)(((data[10] & 0xFF) << 8) + (data[11] & 0xFF));
+        /* Check version.
+         * Major version must be 1, anything else signals an incompatible change.
+         * (We used to treat this as an error, but now it's a nonfatal warning,
+         * because some bozo at Hijaak couldn't read the spec.)
+         * Minor version should be 0..2, but process anyway if newer.
+         */
+        if (cinfo.JFIF_major_version !is 1) {
+//          WARNMS2(cinfo, JWRN_JFIF_MAJOR,
+//              cinfo.JFIF_major_version, cinfo.JFIF_minor_version);
+        }
+        /* Generate trace messages */
+//      TRACEMS5(cinfo, 1, JTRC_JFIF,
+//           cinfo.JFIF_major_version, cinfo.JFIF_minor_version,
+//           cinfo.X_density, cinfo.Y_density, cinfo.density_unit);
+        /* Validate thumbnail dimensions and issue appropriate messages */
+        if (((data[12] & 0xFF) | (data[13]) & 0xFF) !is 0) {
+//          TRACEMS2(cinfo, 1, JTRC_JFIF_THUMBNAIL,
+//               GETJOCTET(data[12]), GETJOCTET(data[13]));
+        }
+        totallen -= APP0_DATA_LEN;
+        if (totallen !is ((data[12] & 0xFF) * (data[13] & 0xFF) * 3)) {
+//          TRACEMS1(cinfo, 1, JTRC_JFIF_BADTHUMBNAILSIZE, cast(int) totallen);
+        }
+    } else if (datalen >= 6 &&
+            (data[0] & 0xFF) is 0x4A &&
+            (data[1] & 0xFF) is 0x46 &&
+            (data[2] & 0xFF) is 0x58 &&
+            (data[3] & 0xFF) is 0x58 &&
+            (data[4] & 0xFF) is 0)
+    {
+        /* Found JFIF "JFXX" extension APP0 marker */
+        /* The library doesn't actually do anything with these,
+         * but we try to produce a helpful trace message.
+         */
+        switch ((data[5]) & 0xFF) {
+            case 0x10:
+//              TRACEMS1(cinfo, 1, JTRC_THUMB_JPEG, cast(int) totallen);
+                break;
+            case 0x11:
+//              TRACEMS1(cinfo, 1, JTRC_THUMB_PALETTE, cast(int) totallen);
+                break;
+            case 0x13:
+//              TRACEMS1(cinfo, 1, JTRC_THUMB_RGB, cast(int) totallen);
+                break;
+            default:
+//              TRACEMS2(cinfo, 1, JTRC_JFIF_EXTENSION, GETJOCTET(data[5]), cast(int) totallen);
+            break;
+        }
+    } else {
+        /* Start of APP0 does not match "JFIF" or "JFXX", or too short */
+//      TRACEMS1(cinfo, 1, JTRC_APP0, cast(int) totallen);
+    }
+}
+
+static void examine_app14 (jpeg_decompress_struct cinfo, byte[] data, int datalen, int remaining)
+/* Examine first few bytes from an APP14.
+ * Take appropriate action if it is an Adobe marker.
+ * datalen is # of bytes at data[], remaining is length of rest of marker data.
+ */
+{
+    int /*version, flags0, flags1, */transform;
+
+    if (datalen >= APP14_DATA_LEN &&
+            (data[0] & 0xFF) is 0x41 &&
+            (data[1] & 0xFF) is 0x64 &&
+            (data[2] & 0xFF) is 0x6F &&
+            (data[3] & 0xFF) is 0x62 &&
+            (data[4] & 0xFF) is 0x65)
+    {
+        /* Found Adobe APP14 marker */
+//      version = ((data[5] & 0xFF) << 8) + (data[6] & 0xFF);
+//      flags0 = ((data[7] & 0xFF) << 8) + (data[8] & 0xFF);
+//      flags1 = ((data[9] & 0xFF) << 8) + (data[10] & 0xFF);
+        transform = (data[11] & 0xFF);
+//      TRACEMS4(cinfo, 1, JTRC_ADOBE, version, flags0, flags1, transform);
+        cinfo.saw_Adobe_marker = true;
+        cinfo.Adobe_transform = cast(byte) transform;
+    } else {
+        /* Start of APP14 does not match "Adobe", or too short */
+//      TRACEMS1(cinfo, 1, JTRC_APP14, cast(int) (datalen + remaining));
+    }
+}
+
+static bool get_soi (jpeg_decompress_struct cinfo) /* Process an SOI marker */ {
+    int i;
+
+//  TRACEMS(cinfo, 1, JTRC_SOI);
+
+    if (cinfo.marker.saw_SOI)
+        error();
+//      ERREXIT(cinfo, JERR_SOI_DUPLICATE);
+
+    /* Reset all parameters that are defined to be reset by SOI */
+
+    for (i = 0; i < NUM_ARITH_TBLS; i++) {
+        cinfo.arith_dc_L[i] = 0;
+        cinfo.arith_dc_U[i] = 1;
+        cinfo.arith_ac_K[i] = 5;
+    }
+    cinfo.restart_interval = 0;
+
+    /* Set initial assumptions for colorspace etc */
+
+    cinfo.jpeg_color_space = JCS_UNKNOWN;
+    cinfo.CCIR601_sampling = false; /* Assume non-CCIR sampling??? */
+
+    cinfo.saw_JFIF_marker = false;
+    cinfo.JFIF_major_version = 1; /* set default JFIF APP0 values */
+    cinfo.JFIF_minor_version = 1;
+    cinfo.density_unit = 0;
+    cinfo.X_density = 1;
+    cinfo.Y_density = 1;
+    cinfo.saw_Adobe_marker = false;
+    cinfo.Adobe_transform = 0;
+
+    cinfo.marker.saw_SOI = true;
+
+    return true;
+}
+
+static void jinit_input_controller (jpeg_decompress_struct cinfo)
+{
+    /* Initialize state: can't use reset_input_controller since we don't
+     * want to try to reset other modules yet.
+     */
+    jpeg_input_controller inputctl = cinfo.inputctl = new jpeg_input_controller();
+    inputctl.has_multiple_scans = false; /* "unknown" would be better */
+    inputctl.eoi_reached = false;
+    inputctl.inheaders = true;
+}
+
+static void reset_marker_reader (jpeg_decompress_struct cinfo) {
+    jpeg_marker_reader marker = cinfo.marker;
+
+    cinfo.comp_info = null;     /* until allocated by get_sof */
+    cinfo.input_scan_number = 0;        /* no SOS seen yet */
+    cinfo.unread_marker = 0;        /* no pending marker */
+    marker.saw_SOI = false;     /* set internal state too */
+    marker.saw_SOF = false;
+    marker.discarded_bytes = 0;
+//  marker.cur_marker = null;
+}
+
+static void reset_input_controller (jpeg_decompress_struct cinfo) {
+    jpeg_input_controller inputctl = cinfo.inputctl;
+
+    inputctl.has_multiple_scans = false; /* "unknown" would be better */
+    inputctl.eoi_reached = false;
+    inputctl.inheaders = true;
+    /* Reset other modules */
+    reset_marker_reader (cinfo);
+    /* Reset progression state -- would be cleaner if entropy decoder did this */
+    cinfo.coef_bits = null;
+}
+
+static void finish_output_pass (jpeg_decompress_struct cinfo) {
+    jpeg_decomp_master master = cinfo.master;
+
+    if (cinfo.quantize_colors) {
+        error(SWT.ERROR_NOT_IMPLEMENTED);
+//      (*cinfo.cquantize.finish_pass) (cinfo);
+    }
+    master.pass_number++;
+}
+
+static void jpeg_destroy (jpeg_decompress_struct cinfo) {
+    /* We need only tell the memory manager to release everything. */
+    /* NB: mem pointer is NULL if memory mgr failed to initialize. */
+//  if (cinfo.mem !is NULL)
+//      (*cinfo.mem.self_destruct) (cinfo);
+//  cinfo.mem = NULL;       /* be safe if jpeg_destroy is called twice */
+    cinfo.global_state = 0; /* mark it destroyed */
+}
+
+static void jpeg_destroy_decompress (jpeg_decompress_struct cinfo) {
+    jpeg_destroy(cinfo); /* use common routine */
+}
+
+static bool jpeg_input_complete (jpeg_decompress_struct cinfo) {
+    /* Check for valid jpeg object */
+    if (cinfo.global_state < DSTATE_START || cinfo.global_state > DSTATE_STOPPING)
+        error();
+//      ERREXIT1(cinfo, JERR_BAD_STATE, cinfo.global_state);
+    return cinfo.inputctl.eoi_reached;
+}
+
+static bool jpeg_start_output (jpeg_decompress_struct cinfo, int scan_number) {
+    if (cinfo.global_state !is DSTATE_BUFIMAGE && cinfo.global_state !is DSTATE_PRESCAN)
+        error();
+//      ERREXIT1(cinfo, JERR_BAD_STATE, cinfo.global_state);
+    /* Limit scan number to valid range */
+    if (scan_number <= 0)
+        scan_number = 1;
+    if (cinfo.inputctl.eoi_reached && scan_number > cinfo.input_scan_number)
+        scan_number = cinfo.input_scan_number;
+    cinfo.output_scan_number = scan_number;
+    /* Perform any dummy output passes, and set up for the real pass */
+    return output_pass_setup(cinfo);
+}
+
+static bool jpeg_finish_output (jpeg_decompress_struct cinfo) {
+    if ((cinfo.global_state is DSTATE_SCANNING || cinfo.global_state is DSTATE_RAW_OK) && cinfo.buffered_image) {
+        /* Terminate this pass. */
+        /* We do not require the whole pass to have been completed. */
+        finish_output_pass (cinfo);
+        cinfo.global_state = DSTATE_BUFPOST;
+    } else if (cinfo.global_state !is DSTATE_BUFPOST) {
+        /* BUFPOST = repeat call after a suspension, anything else is error */
+        error();
+//      ERREXIT1(cinfo, JERR_BAD_STATE, cinfo.global_state);
+    }
+    /* Read markers looking for SOS or EOI */
+    while (cinfo.input_scan_number <= cinfo.output_scan_number && !cinfo.inputctl.eoi_reached) {
+        if (consume_input (cinfo) is JPEG_SUSPENDED)
+            return false;       /* Suspend, come back later */
+    }
+    cinfo.global_state = DSTATE_BUFIMAGE;
+    return true;
+}
+
+static bool jpeg_finish_decompress (jpeg_decompress_struct cinfo) {
+    if ((cinfo.global_state is DSTATE_SCANNING || cinfo.global_state is DSTATE_RAW_OK) && ! cinfo.buffered_image) {
+        /* Terminate final pass of non-buffered mode */
+        if (cinfo.output_scanline < cinfo.output_height)
+            error();
+//          ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);
+        finish_output_pass (cinfo);
+        cinfo.global_state = DSTATE_STOPPING;
+    } else if (cinfo.global_state is DSTATE_BUFIMAGE) {
+        /* Finishing after a buffered-image operation */
+        cinfo.global_state = DSTATE_STOPPING;
+    } else if (cinfo.global_state !is DSTATE_STOPPING) {
+        /* STOPPING = repeat call after a suspension, anything else is error */
+        error();
+//      ERREXIT1(cinfo, JERR_BAD_STATE, cinfo.global_state);
+    }
+    /* Read until EOI */
+    while (! cinfo.inputctl.eoi_reached) {
+        if (consume_input (cinfo) is JPEG_SUSPENDED)
+            return false;       /* Suspend, come back later */
+    }
+    /* Do final cleanup */
+//  (*cinfo.src.term_source) (cinfo);
+    /* We can use jpeg_abort to release memory and reset global_state */
+    jpeg_abort(cinfo);
+    return true;
+}
+
+
+static int jpeg_read_header (jpeg_decompress_struct cinfo, bool require_image) {
+    int retcode;
+
+    if (cinfo.global_state !is DSTATE_START && cinfo.global_state !is DSTATE_INHEADER)
+        error();
+//      ERREXIT1(cinfo, JERR_BAD_STATE, cinfo.global_state);
+
+    retcode = jpeg_consume_input(cinfo);
+
+    switch (retcode) {
+        case JPEG_REACHED_SOS:
+            retcode = JPEG_HEADER_OK;
+            break;
+        case JPEG_REACHED_EOI:
+            if (require_image)      /* Complain if application wanted an image */
+                error();
+//              ERREXIT(cinfo, JERR_NO_IMAGE);
+            /* Reset to start state; it would be safer to require the application to
+             * call jpeg_abort, but we can't change it now for compatibility reasons.
+             * A side effect is to free any temporary memory (there shouldn't be any).
+             */
+            jpeg_abort(cinfo); /* sets state = DSTATE_START */
+            retcode = JPEG_HEADER_TABLES_ONLY;
+            break;
+        case JPEG_SUSPENDED:
+            /* no work */
+            break;
+        default:
+    }
+
+    return retcode;
+}
+
+static int dummy_consume_data (jpeg_decompress_struct cinfo) {
+    return JPEG_SUSPENDED;  /* Always indicate nothing was done */
+}
+
+static int consume_data (jpeg_decompress_struct cinfo) {
+    jpeg_d_coef_controller coef = cinfo.coef;
+    int MCU_col_num;    /* index of current MCU within row */
+    int blkn, ci, xindex, yindex, yoffset;
+    int start_col;
+//  short[][][][] buffer = new short[MAX_COMPS_IN_SCAN][][][];
+    short[][] buffer_ptr;
+    jpeg_component_info compptr;
+
+//  /* Align the virtual buffers for the components used in this scan. */
+//  for (ci = 0; ci < cinfo.comps_in_scan; ci++) {
+//      compptr = cinfo.cur_comp_info[ci];
+//      buffer[ci] = coef.whole_image[compptr.component_index];
+//      /* Note: entropy decoder expects buffer to be zeroed,
+//       * but this is handled automatically by the memory manager
+//       * because we requested a pre-zeroed array.
+//       */
+//  }
+
+    /* Loop to process one whole iMCU row */
+    for (yoffset = coef.MCU_vert_offset; yoffset < coef.MCU_rows_per_iMCU_row; yoffset++) {
+        for (MCU_col_num = coef.MCU_ctr; MCU_col_num < cinfo.MCUs_per_row; MCU_col_num++) {
+            /* Construct list of pointers to DCT blocks belonging to this MCU */
+            blkn = 0; /* index of current DCT block within MCU */
+            for (ci = 0; ci < cinfo.comps_in_scan; ci++) {
+                compptr = cinfo.cur_comp_info[ci];
+                start_col = MCU_col_num * compptr.MCU_width;
+                for (yindex = 0; yindex < compptr.MCU_height; yindex++) {
+//                  buffer_ptr = buffer[ci][yindex+yoffset] + start_col;
+                    buffer_ptr = coef.whole_image[compptr.component_index][yindex+yoffset+cinfo.input_iMCU_row*compptr.v_samp_factor];
+                    int buffer_ptr_offset = start_col;
+                    for (xindex = 0; xindex < compptr.MCU_width; xindex++) {
+                        coef.MCU_buffer[blkn++] = buffer_ptr[buffer_ptr_offset++];
+                    }
+                }
+            }
+            /* Try to fetch the MCU. */
+            if (! cinfo.entropy.decode_mcu (cinfo, coef.MCU_buffer)) {
+                /* Suspension forced; update state counters and exit */
+                coef.MCU_vert_offset = yoffset;
+                coef.MCU_ctr = MCU_col_num;
+                return JPEG_SUSPENDED;
+            }
+        }
+        /* Completed an MCU row, but perhaps not an iMCU row */
+        coef.MCU_ctr = 0;
+    }
+    /* Completed the iMCU row, advance counters for next one */
+    if (++(cinfo.input_iMCU_row) < cinfo.total_iMCU_rows) {
+        coef.start_iMCU_row(cinfo);
+        return JPEG_ROW_COMPLETED;
+    }
+    /* Completed the scan */
+    finish_input_pass (cinfo);
+    return JPEG_SCAN_COMPLETED;
+}
+
+static int consume_input (jpeg_decompress_struct cinfo) {
+    switch (cinfo.inputctl.consume_input) {
+        case COEF_CONSUME_INPUT:
+             switch (cinfo.coef.consume_data) {
+                case CONSUME_DATA: return consume_data(cinfo);
+                case DUMMY_CONSUME_DATA: return dummy_consume_data(cinfo);
+                default: error();
+             }
+             break;
+        case INPUT_CONSUME_INPUT:
+            return consume_markers(cinfo);
+        default:
+            error();
+    }
+    return 0;
+}
+
+static bool fill_input_buffer(jpeg_decompress_struct cinfo) {
+    try {
+        InputStream inputStream = cinfo.inputStream;
+        int nbytes = inputStream.read(cinfo.buffer);
+        if (nbytes <= 0) {
+            if (cinfo.start_of_file)    /* Treat empty input file as fatal error */
+                error();
+//              ERREXIT(cinfo, JERR_INPUT_EMPTY);
+//          WARNMS(cinfo, JWRN_JPEG_EOF);
+            /* Insert a fake EOI marker */
+            cinfo.buffer[0] = cast(byte)0xFF;
+            cinfo.buffer[1] = cast(byte)M_EOI;
+            nbytes = 2;
+        }
+        cinfo.bytes_in_buffer = nbytes;
+        cinfo.bytes_offset = 0;
+        cinfo.start_of_file = false;
+    } catch (IOException e) {
+        error(SWT.ERROR_IO);
+        return false;
+    }
+    return true;
+}
+
+static bool first_marker (jpeg_decompress_struct cinfo) {
+    /* Like next_marker, but used to obtain the initial SOI marker. */
+    /* For this marker, we do not allow preceding garbage or fill; otherwise,
+     * we might well scan an entire input file before realizing it ain't JPEG.
+     * If an application wants to process non-JFIF files, it must seek to the
+     * SOI before calling the JPEG library.
+     */
+    int c, c2;
+
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    c = cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+    if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+    c2 = cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+    if (c !is 0xFF || c2 !is M_SOI)
+        error();
+//      ERREXIT2(cinfo, JERR_NO_SOI, c, c2);
+
+    cinfo.unread_marker = c2;
+
+    return true;
+}
+
+static bool next_marker (jpeg_decompress_struct cinfo) {
+    int c;
+
+    for (;;) {
+        if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+        c = cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+        /* Skip any non-FF bytes.
+         * This may look a bit inefficient, but it will not occur in a valid file.
+         * We sync after each discarded byte so that a suspending data source
+         * can discard the byte from its buffer.
+         */
+        while (c !is 0xFF) {
+            cinfo.marker.discarded_bytes++;
+            if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+            c = cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+        }
+        /* This loop swallows any duplicate FF bytes.   Extra FFs are legal as
+         * pad bytes, so don't count them in discarded_bytes.   We assume there
+         * will not be so many consecutive FF bytes as to overflow a suspending
+         * data source's input buffer.
+         */
+        do {
+             if (cinfo.bytes_offset is cinfo.bytes_in_buffer) fill_input_buffer(cinfo);
+                c = cinfo.buffer[cinfo.bytes_offset++] & 0xFF;
+        } while (c is 0xFF);
+        if (c !is 0)
+            break;          /* found a valid marker, exit loop */
+        /* Reach here if we found a stuffed-zero data sequence (FF/00).
+         * Discard it and loop back to try again.
+         */
+        cinfo.marker.discarded_bytes += 2;
+    }
+
+    if (cinfo.marker.discarded_bytes !is 0) {
+//      WARNMS2(cinfo, JWRN_EXTRANEOUS_DATA, cinfo.marker.discarded_bytes, c);
+        cinfo.marker.discarded_bytes = 0;
+    }
+
+    cinfo.unread_marker = c;
+
+    return true;
+}
+
+static int read_markers (jpeg_decompress_struct cinfo) {
+    /* Outer loop repeats once for each marker. */
+    for (;;) {
+        /* Collect the marker proper, unless we already did. */
+        /* NB: first_marker() enforces the requirement that SOI appear first. */
+        if (cinfo.unread_marker is 0) {
+            if (! cinfo.marker.saw_SOI) {
+                if (! first_marker(cinfo))
+                    return JPEG_SUSPENDED;
+                } else {
+                    if (! next_marker(cinfo))
+                        return JPEG_SUSPENDED;
+                }
+        }
+        /* At this point cinfo.unread_marker contains the marker code and the
+         * input point is just past the marker proper, but before any parameters.
+         * A suspension will cause us to return with this state still true.
+         */
+        switch (cinfo.unread_marker) {
+            case M_SOI:
+                if (! get_soi(cinfo))
+                    return JPEG_SUSPENDED;
+                break;
+
+            case M_SOF0:        /* Baseline */
+            case M_SOF1:        /* Extended sequential, Huffman */
+                if (! get_sof(cinfo, false, false))
+                    return JPEG_SUSPENDED;
+                break;
+
+            case M_SOF2:        /* Progressive, Huffman */
+                if (! get_sof(cinfo, true, false))
+                    return JPEG_SUSPENDED;
+                break;
+
+            case M_SOF9:        /* Extended sequential, arithmetic */
+                if (! get_sof(cinfo, false, true))
+                    return JPEG_SUSPENDED;
+                break;
+
+            case M_SOF10:       /* Progressive, arithmetic */
+                if (! get_sof(cinfo, true, true))
+                    return JPEG_SUSPENDED;
+                break;
+
+            /* Currently unsupported SOFn types */
+            case M_SOF3:        /* Lossless, Huffman */
+            case M_SOF5:        /* Differential sequential, Huffman */
+            case M_SOF6:        /* Differential progressive, Huffman */
+            case M_SOF7:        /* Differential lossless, Huffman */
+            case M_JPG:         /* Reserved for JPEG extensions */
+            case M_SOF11:       /* Lossless, arithmetic */
+            case M_SOF13:       /* Differential sequential, arithmetic */
+            case M_SOF14:       /* Differential progressive, arithmetic */
+            case M_SOF15:       /* Differential lossless, arithmetic */
+                error();
+//              ERREXIT1(cinfo, JERR_SOF_UNSUPPORTED, cinfo.unread_marker);
+                break;
+
+            case M_SOS:
+                if (! get_sos(cinfo))
+                    return JPEG_SUSPENDED;
+                cinfo.unread_marker = 0;    /* processed the marker */
+                return JPEG_REACHED_SOS;
+
+            case M_EOI:
+//              TRACEMS(cinfo, 1, JTRC_EOI);
+                cinfo.unread_marker = 0;    /* processed the marker */
+                return JPEG_REACHED_EOI;
+
+            case M_DAC:
+                if (! get_dac(cinfo))
+                    return JPEG_SUSPENDED;
+                break;
+
+            case M_DHT:
+                if (! get_dht(cinfo))
+                    return JPEG_SUSPENDED;
+                break;
+
+            case M_DQT:
+                if (! get_dqt(cinfo))
+                    return JPEG_SUSPENDED;
+                break;
+
+            case M_DRI:
+                if (! get_dri(cinfo))
+                    return JPEG_SUSPENDED;
+                break;
+
+            case M_APP0:
+            case M_APP1:
+            case M_APP2:
+            case M_APP3:
+            case M_APP4:
+            case M_APP5:
+            case M_APP6:
+            case M_APP7:
+            case M_APP8:
+            case M_APP9:
+            case M_APP10:
+            case M_APP11:
+            case M_APP12:
+            case M_APP13:
+            case M_APP14:
+            case M_APP15:
+                if (! process_APPn(cinfo.unread_marker - M_APP0, cinfo))
+                    return JPEG_SUSPENDED;
+                break;
+
+            case M_COM:
+                if (! process_COM(cinfo))
+                    return JPEG_SUSPENDED;
+                break;
+
+            case M_RST0:        /* these are all parameterless */
+            case M_RST1:
+            case M_RST2:
+            case M_RST3:
+            case M_RST4:
+            case M_RST5:
+            case M_RST6:
+            case M_RST7:
+            case M_TEM:
+//              TRACEMS1(cinfo, 1, JTRC_PARMLESS_MARKER, cinfo.unread_marker);
+                break;
+
+            case M_DNL:         /* Ignore DNL ... perhaps the wrong thing */
+                if (! skip_variable(cinfo))
+                    return JPEG_SUSPENDED;
+                break;
+
+            default:            /* must be DHP, EXP, JPGn, or RESn */
+                /* For now, we treat the reserved markers as fatal errors since they are
+                 * likely to be used to signal incompatible JPEG Part 3 extensions.
+                 * Once the JPEG 3 version-number marker is well defined, this code
+                 * ought to change!
+                 */
+                error();
+ //             ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo.unread_marker);
+                break;
+        }
+        /* Successfully processed marker, so reset state variable */
+        cinfo.unread_marker = 0;
+    } /* end loop */
+}
+
+static long jdiv_round_up (long a, long b)
+/* Compute a/b rounded up to next integer, ie, ceil(a/b) */
+/* Assumes a >= 0, b > 0 */
+{
+    return (a + b - 1) / b;
+}
+
+static void initial_setup (jpeg_decompress_struct cinfo)
+/* Called once, when first SOS marker is reached */
+{
+    int ci;
+    jpeg_component_info compptr;
+
+    /* Make sure image isn't bigger than I can handle */
+    if (cinfo.image_height >    JPEG_MAX_DIMENSION || cinfo.image_width > JPEG_MAX_DIMENSION)
+        error();
+//      ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
+
+    /* For now, precision must match compiled-in value... */
+    if (cinfo.data_precision !is BITS_IN_JSAMPLE)
+        error(" [data precision=" ~ to!(String)(cinfo.data_precision) ~ "]");
+//      ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo.data_precision);
+
+    /* Check that number of components won't exceed internal array sizes */
+    if (cinfo.num_components > MAX_COMPONENTS)
+        error();
+//      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo.num_components, MAX_COMPONENTS);
+
+    /* Compute maximum sampling factors; check factor validity */
+    cinfo.max_h_samp_factor = 1;
+    cinfo.max_v_samp_factor = 1;
+    for (ci = 0; ci < cinfo.num_components; ci++) {
+        compptr = cinfo.comp_info[ci];
+        if (compptr.h_samp_factor<=0 || compptr.h_samp_factor>MAX_SAMP_FACTOR || compptr.v_samp_factor<=0 || compptr.v_samp_factor>MAX_SAMP_FACTOR)
+            error();
+//          ERREXIT(cinfo, JERR_BAD_SAMPLING);
+        cinfo.max_h_samp_factor = Math.max(cinfo.max_h_samp_factor, compptr.h_samp_factor);
+        cinfo.max_v_samp_factor = Math.max(cinfo.max_v_samp_factor, compptr.v_samp_factor);
+    }
+
+    /* We initialize DCT_scaled_size and min_DCT_scaled_size to DCTSIZE.
+     * In the full decompressor, this will be overridden by jdmaster.c;
+     * but in the transcoder, jdmaster.c is not used, so we must do it here.
+     */
+    cinfo.min_DCT_scaled_size = DCTSIZE;
+
+    /* Compute dimensions of components */
+    for (ci = 0; ci < cinfo.num_components; ci++) {
+        compptr = cinfo.comp_info[ci];
+        compptr.DCT_scaled_size = DCTSIZE;
+        /* Size in DCT blocks */
+        compptr.width_in_blocks = cast(int)jdiv_round_up(cast(long) cinfo.image_width * cast(long) compptr.h_samp_factor, (cinfo.max_h_samp_factor * DCTSIZE));
+        compptr.height_in_blocks = cast(int)jdiv_round_up(cast(long) cinfo.image_height * cast(long) compptr.v_samp_factor, (cinfo.max_v_samp_factor * DCTSIZE));
+        /* downsampled_width and downsampled_height will also be overridden by
+         * jdmaster.c if we are doing full decompression.   The transcoder library
+         * doesn't use these values, but the calling application might.
+         */
+        /* Size in samples */
+        compptr.downsampled_width = cast(int)jdiv_round_up(cast(long) cinfo.image_width * cast(long) compptr.h_samp_factor, cinfo.max_h_samp_factor);
+        compptr.downsampled_height = cast(int)jdiv_round_up(cast(long) cinfo.image_height * cast(long) compptr.v_samp_factor, cinfo.max_v_samp_factor);
+        /* Mark component needed, until color conversion says otherwise */
+        compptr.component_needed = true;
+        /* Mark no quantization table yet saved for component */
+        compptr.quant_table = null;
+    }
+
+    /* Compute number of fully interleaved MCU rows. */
+    cinfo.total_iMCU_rows = cast(int)jdiv_round_up( cinfo.image_height, (cinfo.max_v_samp_factor*DCTSIZE));
+
+    /* Decide whether file contains multiple scans */
+    if (cinfo.comps_in_scan < cinfo.num_components || cinfo.progressive_mode)
+        cinfo.inputctl.has_multiple_scans = true;
+    else
+        cinfo.inputctl.has_multiple_scans = false;
+}
+
+
+static void per_scan_setup (jpeg_decompress_struct cinfo)
+/* Do computations that are needed before processing a JPEG scan */
+/* cinfo.comps_in_scan and cinfo.cur_comp_info[] were set from SOS marker */
+{
+    int ci, mcublks, tmp = 0;
+    jpeg_component_info compptr;
+
+    if (cinfo.comps_in_scan is 1) {
+
+        /* Noninterleaved (single-component) scan */
+        compptr = cinfo.cur_comp_info[0];
+
+        /* Overall image size in MCUs */
+        cinfo.MCUs_per_row = compptr.width_in_blocks;
+        cinfo.MCU_rows_in_scan = compptr.height_in_blocks;
+
+        /* For noninterleaved scan, always one block per MCU */
+        compptr.MCU_width = 1;
+        compptr.MCU_height = 1;
+        compptr.MCU_blocks = 1;
+        compptr.MCU_sample_width = compptr.DCT_scaled_size;
+        compptr.last_col_width = 1;
+        /* For noninterleaved scans, it is convenient to define last_row_height
+         * as the number of block rows present in the last iMCU row.
+         */
+        tmp = (compptr.height_in_blocks % compptr.v_samp_factor);
+        if (tmp is 0) tmp = compptr.v_samp_factor;
+        compptr.last_row_height = tmp;
+
+        /* Prepare array describing MCU composition */
+        cinfo.blocks_in_MCU = 1;
+        cinfo.MCU_membership[0] = 0;
+
+    } else {
+
+        /* Interleaved (multi-component) scan */
+        if (cinfo.comps_in_scan <= 0 || cinfo.comps_in_scan > MAX_COMPS_IN_SCAN)
+            error();
+//          ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo.comps_in_scan, MAX_COMPS_IN_SCAN);
+
+        /* Overall image size in MCUs */
+        cinfo.MCUs_per_row = cast(int)jdiv_round_up( cinfo.image_width, (cinfo.max_h_samp_factor*DCTSIZE));
+        cinfo.MCU_rows_in_scan = cast(int)jdiv_round_up( cinfo.image_height, (cinfo.max_v_samp_factor*DCTSIZE));
+
+        cinfo.blocks_in_MCU = 0;
+
+        for (ci = 0; ci < cinfo.comps_in_scan; ci++) {
+            compptr = cinfo.cur_comp_info[ci];
+            /* Sampling factors give # of blocks of component in each MCU */
+            compptr.MCU_width = compptr.h_samp_factor;
+            compptr.MCU_height = compptr.v_samp_factor;
+            compptr.MCU_blocks = compptr.MCU_width * compptr.MCU_height;
+            compptr.MCU_sample_width = compptr.MCU_width * compptr.DCT_scaled_size;
+            /* Figure number of non-dummy blocks in last MCU column & row */
+            tmp = (compptr.width_in_blocks % compptr.MCU_width);
+            if (tmp is 0) tmp = compptr.MCU_width;
+            compptr.last_col_width = tmp;
+            tmp = (compptr.height_in_blocks % compptr.MCU_height);
+            if (tmp is 0) tmp = compptr.MCU_height;
+            compptr.last_row_height = tmp;
+            /* Prepare array describing MCU composition */
+            mcublks = compptr.MCU_blocks;
+            if (cinfo.blocks_in_MCU + mcublks > D_MAX_BLOCKS_IN_MCU)
+                error();
+//  ERREXIT(cinfo, JERR_BAD_MCU_SIZE);
+            while (mcublks-- > 0) {
+                cinfo.MCU_membership[cinfo.blocks_in_MCU++] = ci;
+            }
+        }
+
+    }
+}
+
+static void latch_quant_tables (jpeg_decompress_struct cinfo) {
+    int ci, qtblno;
+    jpeg_component_info compptr;
+    JQUANT_TBL qtbl;
+
+    for (ci = 0; ci < cinfo.comps_in_scan; ci++) {
+        compptr = cinfo.cur_comp_info[ci];
+        /* No work if we already saved Q-table for this component */
+        if (compptr.quant_table !is null)
+            continue;
+        /* Make sure specified quantization table is present */
+        qtblno = compptr.quant_tbl_no;
+        if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS || cinfo.quant_tbl_ptrs[qtblno] is null)
+            error();
+//          ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);
+        /* OK, save away the quantization table */
+        qtbl = new JQUANT_TBL();
+        System.arraycopy(cinfo.quant_tbl_ptrs[qtblno].quantval, 0, qtbl.quantval, 0, qtbl.quantval.length);
+        qtbl.sent_table = cinfo.quant_tbl_ptrs[qtblno].sent_table;
+        compptr.quant_table = qtbl;
+    }
+}
+
+static void jpeg_make_d_derived_tbl (jpeg_decompress_struct cinfo, bool isDC, int tblno, d_derived_tbl dtbl) {
+    JHUFF_TBL htbl;
+    int p, i = 0, l, si, numsymbols;
+    int lookbits, ctr;
+    byte[] huffsize = new byte[257];
+    int[] huffcode = new int[257];
+    int code;
+
+    /* Note that huffsize[] and huffcode[] are filled in code-length order,
+     * paralleling the order of the symbols themselves in htbl.huffval[].
+     */
+
+    /* Find the input Huffman table */
+    if (tblno < 0 || tblno >= NUM_HUFF_TBLS)
+        error();
+//      ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
+    htbl = isDC ? cinfo.dc_huff_tbl_ptrs[tblno] : cinfo.ac_huff_tbl_ptrs[tblno];
+    if (htbl is null)
+        error();
+//      ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
+
+    /* Allocate a workspace if we haven't already done so. */
+    dtbl.pub = htbl;        /* fill in back link */
+
+    /* Figure C.1: make table of Huffman code length for each symbol */
+
+    p = 0;
+    for (l = 1; l <= 16; l++) {
+        i = htbl.bits[l] & 0xFF;
+        if (i < 0 || p + i > 256)   /* protect against table overrun */
+            error();
+//          ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
+        while (i-- !is 0)
+            huffsize[p++] = cast(byte) l;
+    }
+    huffsize[p] = 0;
+    numsymbols = p;
+
+    /* Figure C.2: generate the codes themselves */
+    /* We also validate that the counts represent a legal Huffman code tree. */
+
+    code = 0;
+    si = huffsize[0];
+    p = 0;
+    while ( huffsize[p] !is 0) {
+        while (( huffsize[p]) is si) {
+            huffcode[p++] = code;
+            code++;
+        }
+        /* code is now 1 more than the last code used for codelength si; but
+         * it must still fit in si bits, since no code is allowed to be all ones.
+         */
+        if (( code) >= (( 1) << si))
+            error();
+//          ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
+        code <<= 1;
+        si++;
+    }
+
+    /* Figure F.15: generate decoding tables for bit-sequential decoding */
+
+    p = 0;
+    for (l = 1; l <= 16; l++) {
+        if ((htbl.bits[l] & 0xFF) !is 0) {
+            /* valoffset[l] = huffval[] index of 1st symbol of code length l,
+             * minus the minimum code of length l
+             */
+            dtbl.valoffset[l] = p - huffcode[p];
+            p += (htbl.bits[l] & 0xFF);
+            dtbl.maxcode[l] = huffcode[p-1]; /* maximum code of length l */
+        } else {
+            dtbl.maxcode[l] = -1;   /* -1 if no codes of this length */
+        }
+    }
+    dtbl.maxcode[17] = 0xFFFFF; /* ensures jpeg_huff_decode terminates */
+
+    /* Compute lookahead tables to speed up decoding.
+     * First we set all the table entries to 0, indicating "too long";
+     * then we iterate through the Huffman codes that are short enough and
+     * fill in all the entries that correspond to bit sequences starting
+     * with that code.
+     */
+
+    for (int j = 0; j < dtbl.look_nbits.length; j++) {
+        dtbl.look_nbits[j] = 0;
+    }
+
+    p = 0;
+    for (l = 1; l <= HUFF_LOOKAHEAD; l++) {
+        for (i = 1; i <= (htbl.bits[l] & 0xFF); i++, p++) {
+            /* l = current code's length, p = its index in huffcode[] & huffval[]. */
+            /* Generate left-justified code followed by all possible bit sequences */
+            lookbits = huffcode[p] << (HUFF_LOOKAHEAD-l);
+            for (ctr = 1 << (HUFF_LOOKAHEAD-l); ctr > 0; ctr--) {
+                dtbl.look_nbits[lookbits] = l;
+                dtbl.look_sym[lookbits] = htbl.huffval[p];
+                lookbits++;
+            }
+        }
+    }
+
+    /* Validate symbols as being reasonable.
+     * For AC tables, we make no check, but accept all byte values 0..255.
+     * For DC tables, we require the symbols to be in range 0..15.
+     * (Tighter bounds could be applied depending on the data depth and mode,
+     * but this is sufficient to ensure safe decoding.)
+     */
+    if (isDC) {
+        for (i = 0; i < numsymbols; i++) {
+            int sym = htbl.huffval[i] & 0xFF;
+            if (sym < 0 || sym > 15)
+                error();
+//              ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
+        }
+    }
+}
+
+static void start_input_pass (jpeg_decompress_struct cinfo) {
+    per_scan_setup(cinfo);
+    latch_quant_tables(cinfo);
+    cinfo.entropy.start_pass(cinfo);
+    cinfo.coef.start_input_pass (cinfo);
+    cinfo.inputctl.consume_input = COEF_CONSUME_INPUT;
+}
+
+static void finish_input_pass (jpeg_decompress_struct cinfo) {
+    cinfo.inputctl.consume_input = INPUT_CONSUME_INPUT;
+}
+
+static int consume_markers (jpeg_decompress_struct cinfo) {
+    jpeg_input_controller inputctl = cinfo.inputctl;
+    int val;
+
+    if (inputctl.eoi_reached) /* After hitting EOI, read no further */
+        return JPEG_REACHED_EOI;
+
+    val = read_markers (cinfo);
+
+    switch (val) {
+    case JPEG_REACHED_SOS:  /* Found SOS */
+        if (inputctl.inheaders) {   /* 1st SOS */
+            initial_setup(cinfo);
+            inputctl.inheaders = false;
+            /* Note: start_input_pass must be called by jdmaster.c
+             * before any more input can be consumed.   jdapimin.c is
+             * responsible for enforcing this sequencing.
+             */
+        } else {            /* 2nd or later SOS marker */
+            if (! inputctl.has_multiple_scans)
+                error();
+//              ERREXIT(cinfo, JERR_EOI_EXPECTED); /* Oops, I wasn't expecting this! */
+            start_input_pass(cinfo);
+        }
+        break;
+    case JPEG_REACHED_EOI:  /* Found EOI */
+        inputctl.eoi_reached = true;
+        if (inputctl.inheaders) {   /* Tables-only datastream, apparently */
+            if (cinfo.marker.saw_SOF)
+                error();
+//              ERREXIT(cinfo, JERR_SOF_NO_SOS);
+        } else {
+            /* Prevent infinite loop in coef ctlr's decompress_data routine
+             * if user set output_scan_number larger than number of scans.
+             */
+            if (cinfo.output_scan_number > cinfo.input_scan_number)
+                cinfo.output_scan_number = cinfo.input_scan_number;
+        }
+        break;
+    case JPEG_SUSPENDED:
+        break;
+    default:
+    }
+
+    return val;
+}
+
+static void default_decompress_parms (jpeg_decompress_struct cinfo) {
+    /* Guess the input colorspace, and set output colorspace accordingly. */
+    /* (Wish JPEG committee had provided a real way to specify this...) */
+    /* Note application may override our guesses. */
+    switch (cinfo.num_components) {
+        case 1:
+            cinfo.jpeg_color_space = JCS_GRAYSCALE;
+            cinfo.out_color_space = JCS_GRAYSCALE;
+            break;
+
+        case 3:
+            if (cinfo.saw_JFIF_marker) {
+                cinfo.jpeg_color_space = JCS_YCbCr; /* JFIF implies YCbCr */
+            } else if (cinfo.saw_Adobe_marker) {
+                switch (cinfo.Adobe_transform) {
+                    case 0:
+                        cinfo.jpeg_color_space = JCS_RGB;
+                        break;
+                    case 1:
+                        cinfo.jpeg_color_space = JCS_YCbCr;
+                        break;
+                    default:
+//                      WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo.Adobe_transform);
+                        cinfo.jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */
+                    break;
+                }
+            } else {
+                /* Saw no special markers, try to guess from the component IDs */
+                int cid0 = cinfo.comp_info[0].component_id;
+                int cid1 = cinfo.comp_info[1].component_id;
+                int cid2 = cinfo.comp_info[2].component_id;
+
+                if (cid0 is 1 && cid1 is 2 && cid2 is 3)
+                    cinfo.jpeg_color_space = JCS_YCbCr; /* assume JFIF w/out marker */
+                else if (cid0 is 82 && cid1 is 71 && cid2 is 66)
+                    cinfo.jpeg_color_space = JCS_RGB; /* ASCII 'R', 'G', 'B' */
+                else {
+//                  TRACEMS3(cinfo, 1, JTRC_UNKNOWN_IDS, cid0, cid1, cid2);
+                    cinfo.jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */
+                }
+            }
+            /* Always guess RGB is proper output colorspace. */
+            cinfo.out_color_space = JCS_RGB;
+            break;
+
+        case 4:
+            if (cinfo.saw_Adobe_marker) {
+                switch (cinfo.Adobe_transform) {
+                    case 0:
+                        cinfo.jpeg_color_space = JCS_CMYK;
+                        break;
+                    case 2:
+                        cinfo.jpeg_color_space = JCS_YCCK;
+                        break;
+                    default:
+//                      WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo.Adobe_transform);
+                        cinfo.jpeg_color_space = JCS_YCCK; /* assume it's YCCK */
+                        break;
+                }
+            } else {
+                /* No special markers, assume straight CMYK. */
+                cinfo.jpeg_color_space = JCS_CMYK;
+            }
+            cinfo.out_color_space = JCS_CMYK;
+            break;
+
+        default:
+            cinfo.jpeg_color_space = JCS_UNKNOWN;
+            cinfo.out_color_space = JCS_UNKNOWN;
+            break;
+    }
+
+    /* Set defaults for other decompression parameters. */
+    cinfo.scale_num = 1;        /* 1:1 scaling */
+    cinfo.scale_denom = 1;
+    cinfo.output_gamma = 1.0;
+    cinfo.buffered_image = false;
+    cinfo.raw_data_out = false;
+    cinfo.dct_method = JDCT_DEFAULT;
+    cinfo.do_fancy_upsampling = true;
+    cinfo.do_block_smoothing = true;
+    cinfo.quantize_colors = false;
+    /* We set these in case application only sets quantize_colors. */
+    cinfo.dither_mode = JDITHER_FS;
+    cinfo.two_pass_quantize = true;
+    cinfo.desired_number_of_colors = 256;
+    cinfo.colormap = null;
+    /* Initialize for no mode change in buffered-image mode. */
+    cinfo.enable_1pass_quant = false;
+    cinfo.enable_external_quant = false;
+    cinfo.enable_2pass_quant = false;
+}
+
+static void init_source(jpeg_decompress_struct cinfo) {
+    cinfo.buffer = new byte[INPUT_BUFFER_SIZE];
+    cinfo.bytes_in_buffer = 0;
+    cinfo.bytes_offset = 0;
+    cinfo.start_of_file = true;
+}
+
+static int jpeg_consume_input (jpeg_decompress_struct cinfo) {
+    int retcode = JPEG_SUSPENDED;
+
+    /* NB: every possible DSTATE value should be listed in this switch */
+    switch (cinfo.global_state) {
+    case DSTATE_START:
+        /* Start-of-datastream actions: reset appropriate modules */
+        reset_input_controller(cinfo);
+        /* Initialize application's data source module */
+        init_source (cinfo);
+        cinfo.global_state = DSTATE_INHEADER;
+        /*FALLTHROUGH*/
+    case DSTATE_INHEADER:
+        retcode = consume_input(cinfo);
+        if (retcode is JPEG_REACHED_SOS) { /* Found SOS, prepare to decompress */
+            /* Set up default parameters based on header data */
+            default_decompress_parms(cinfo);
+            /* Set global state: ready for start_decompress */
+            cinfo.global_state = DSTATE_READY;
+        }
+        break;
+    case DSTATE_READY:
+        /* Can't advance past first SOS until start_decompress is called */
+        retcode = JPEG_REACHED_SOS;
+        break;
+    case DSTATE_PRELOAD:
+    case DSTATE_PRESCAN:
+    case DSTATE_SCANNING:
+    case DSTATE_RAW_OK:
+    case DSTATE_BUFIMAGE:
+    case DSTATE_BUFPOST:
+    case DSTATE_STOPPING:
+        retcode = consume_input (cinfo);
+        break;
+    default:
+        error();
+//      ERREXIT1(cinfo, JERR_BAD_STATE, cinfo.global_state);
+    }
+    return retcode;
+}
+
+
+static void jpeg_abort (jpeg_decompress_struct cinfo) {
+//  int pool;
+//
+//  /* Releasing pools in reverse order might help avoid fragmentation
+//   * with some (brain-damaged) malloc libraries.
+//   */
+//  for (pool = JPOOL_NUMPOOLS-1; pool > JPOOL_PERMANENT; pool--) {
+//      (*cinfo.mem.free_pool) (cinfo, pool);
+//  }
+
+    /* Reset overall state for possible reuse of object */
+    if (cinfo.is_decompressor) {
+        cinfo.global_state = DSTATE_START;
+        /* Try to keep application from accessing now-deleted marker list.
+         * A bit kludgy to do it here, but this is the most central place.
+         */
+//      ((j_decompress_ptr) cinfo).marker_list = null;
+    } else {
+        cinfo.global_state = CSTATE_START;
+    }
+}
+
+
+static bool isFileFormat(LEDataInputStream stream) {
+    try {
+        byte[] buffer = new byte[2];
+        stream.read(buffer);
+        stream.unread(buffer);
+        return (buffer[0] & 0xFF) is 0xFF && (buffer[1] & 0xFF) is M_SOI;
+    } catch (Exception e) {
+        return false;
+    }
+}
+
+static ImageData[] loadFromByteStream(InputStream inputStream, ImageLoader loader) {
+    jpeg_decompress_struct cinfo = new jpeg_decompress_struct();
+    cinfo.inputStream = inputStream;
+    jpeg_create_decompress(cinfo);
+    jpeg_read_header(cinfo, true);
+    cinfo.buffered_image = cinfo.progressive_mode && loader.hasListeners();
+    jpeg_start_decompress(cinfo);
+    PaletteData palette = null;
+    switch (cinfo.out_color_space) {
+        case JCS_RGB:
+            palette = new PaletteData(0xFF, 0xFF00, 0xFF0000);
+            break;
+        case JCS_GRAYSCALE:
+            RGB[] colors = new RGB[256];
+            for (int i = 0; i < colors.length; i++) {
+                colors[i] = new RGB(i, i, i);
+            }
+            palette = new PaletteData(colors);
+            break;
+        default:
+            error();
+    }
+    int scanlinePad = 4;
+    int row_stride = (((cinfo.output_width * cinfo.out_color_components * 8 + 7) / 8) + (scanlinePad - 1)) / scanlinePad * scanlinePad;
+    byte[][] buffer = new byte[][]( 1, row_stride );
+    byte[] data = new byte[row_stride * cinfo.output_height];
+    ImageData imageData = ImageData.internal_new(
+            cinfo.output_width, cinfo.output_height, palette.isDirect ? 24 : 8, palette, scanlinePad, data,
+            0, null, null, -1, -1, SWT.IMAGE_JPEG, 0, 0, 0, 0);
+    if (cinfo.buffered_image) {
+        bool done;
+        do {
+            int incrementCount = cinfo.input_scan_number - 1;
+            jpeg_start_output(cinfo, cinfo.input_scan_number);
+            while (cinfo.output_scanline < cinfo.output_height) {
+                int offset = row_stride * cinfo.output_scanline;
+                jpeg_read_scanlines(cinfo, buffer, 1);
+                System.arraycopy(buffer[0], 0, data, offset, row_stride);
+            }
+            jpeg_finish_output(cinfo);
+            loader.notifyListeners(new ImageLoaderEvent(loader, cast(ImageData)imageData.clone(), incrementCount, done = jpeg_input_complete(cinfo)));
+        } while (!done);
+    } else {
+        while (cinfo.output_scanline < cinfo.output_height) {
+            int offset = row_stride * cinfo.output_scanline;
+            jpeg_read_scanlines(cinfo, buffer, 1);
+            System.arraycopy(buffer[0], 0, data, offset, row_stride);
+        }
+    }
+    jpeg_finish_decompress(cinfo);
+    jpeg_destroy_decompress(cinfo);
+    return [imageData];
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGEndOfImage.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.JPEGEndOfImage;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.image.JPEGFixedSizeSegment;
+import org.eclipse.swt.internal.image.JPEGFileFormat;
+import org.eclipse.swt.internal.image.LEDataInputStream;
+
+final class JPEGEndOfImage : JPEGFixedSizeSegment {
+
+    public this() {
+        super();
+    }
+
+    public this(byte[] reference) {
+        super(reference);
+    }
+
+    public override int signature() {
+        return JPEGFileFormat.EOI;
+    }
+
+    public override int fixedSize() {
+        return 2;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGFileFormat.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,1904 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved.  This source file is made available under the terms contained in the README file
+ * accompanying this program.  The README file should be located in the about_files directory of the
+ * plug-in that contains this source file.
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.JPEGFileFormat;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.image.JPEGFrameHeader;
+import org.eclipse.swt.internal.image.JPEGScanHeader;
+import org.eclipse.swt.internal.image.JPEGHuffmanTable;
+import org.eclipse.swt.internal.image.JPEGAppn;
+import org.eclipse.swt.internal.image.JPEGSegment;
+import org.eclipse.swt.internal.image.FileFormat;
+import org.eclipse.swt.internal.image.JPEGComment;
+import org.eclipse.swt.internal.image.JPEGArithmeticConditioningTable;
+import org.eclipse.swt.internal.image.JPEGRestartInterval;
+import org.eclipse.swt.internal.image.JPEGQuantizationTable;
+import org.eclipse.swt.internal.image.JPEGStartOfImage;
+import org.eclipse.swt.internal.image.JPEGDecoder;
+import org.eclipse.swt.internal.image.JPEGEndOfImage;
+import java.lang.all;
+
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.PaletteData;
+
+import tango.core.Exception;
+
+final class JPEGFileFormat : FileFormat {
+    int restartInterval;
+    JPEGFrameHeader frameHeader;
+    int imageWidth, imageHeight;
+    int interleavedMcuCols, interleavedMcuRows;
+    int maxV, maxH;
+    bool progressive;
+    int samplePrecision;
+    int nComponents;
+    int[][] frameComponents;
+    int[] componentIds;
+    byte[][] imageComponents;
+    int[] dataUnit;
+    int[][][] dataUnits;
+    int[] precedingDCs;
+    JPEGScanHeader scanHeader;
+    byte[] dataBuffer;
+    int currentBitCount;
+    int bufferCurrentPosition;
+    int restartsToGo;
+    int nextRestartNumber;
+    JPEGHuffmanTable[] acHuffmanTables;
+    JPEGHuffmanTable[] dcHuffmanTables;
+    int[][] quantizationTables;
+    int currentByte;
+    int encoderQFactor = 75;
+    int eobrun = 0;
+    /* JPEGConstants */
+    public static const int DCTSIZE = 8;
+    public static const int DCTSIZESQR = 64;
+    /* JPEGFixedPointConstants */
+    public static const int FIX_0_899976223 = 7373;
+    public static const int FIX_1_961570560 = 16069;
+    public static const int FIX_2_053119869 = 16819;
+    public static const int FIX_0_298631336 = 2446;
+    public static const int FIX_1_847759065 = 15137;
+    public static const int FIX_1_175875602 = 9633;
+    public static const int FIX_3_072711026 = 25172;
+    public static const int FIX_0_765366865 = 6270;
+    public static const int FIX_2_562915447 = 20995;
+    public static const int FIX_0_541196100 = 4433;
+    public static const int FIX_0_390180644 = 3196;
+    public static const int FIX_1_501321110 = 12299;
+    /* JPEGMarkerCodes */
+    public static const int APP0  = 0xFFE0;
+    public static const int APP15 = 0xFFEF;
+    public static const int COM   = 0xFFFE;
+    public static const int DAC   = 0xFFCC;
+    public static const int DHP   = 0xFFDE;
+    public static const int DHT   = 0xFFC4;
+    public static const int DNL   = 0xFFDC;
+    public static const int DRI   = 0xFFDD;
+    public static const int DQT   = 0xFFDB;
+    public static const int EOI   = 0xFFD9;
+    public static const int EXP   = 0xFFDF;
+    public static const int JPG   = 0xFFC8;
+    public static const int JPG0  = 0xFFF0;
+    public static const int JPG13 = 0xFFFD;
+    public static const int RST0  = 0xFFD0;
+    public static const int RST1  = 0xFFD1;
+    public static const int RST2  = 0xFFD2;
+    public static const int RST3  = 0xFFD3;
+    public static const int RST4  = 0xFFD4;
+    public static const int RST5  = 0xFFD5;
+    public static const int RST6  = 0xFFD6;
+    public static const int RST7  = 0xFFD7;
+    public static const int SOF0  = 0xFFC0;
+    public static const int SOF1  = 0xFFC1;
+    public static const int SOF2  = 0xFFC2;
+    public static const int SOF3  = 0xFFC3;
+    public static const int SOF5  = 0xFFC5;
+    public static const int SOF6  = 0xFFC6;
+    public static const int SOF7  = 0xFFC7;
+    public static const int SOF9  = 0xFFC9;
+    public static const int SOF10 = 0xFFCA;
+    public static const int SOF11 = 0xFFCB;
+    public static const int SOF13 = 0xFFCD;
+    public static const int SOF14 = 0xFFCE;
+    public static const int SOF15 = 0xFFCF;
+    public static const int SOI   = 0xFFD8;
+    public static const int SOS   = 0xFFDA;
+    public static const int TEM   = 0xFF01;
+    /* JPEGFrameComponentParameterConstants */
+    public static const int TQI = 0;
+    public static const int HI  = 1;
+    public static const int VI  = 2;
+    public static const int CW  = 3;
+    public static const int CH  = 4;
+    /* JPEGScanComponentParameterConstants */
+    public static const int DC  = 0;
+    public static const int AC  = 1;
+    /* JFIF Component Constants */
+    public static const int ID_Y        = 1 - 1;
+    public static const int ID_CB   = 2 - 1;
+    public static const int ID_CR   = 3 - 1;
+    public static /*const*/ RGB[] RGB16;
+    public static const int[] ExtendTest = [
+        0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048,
+        4096, 8192, 16384, 32768, 65536, 131072, 262144
+    ];
+    public static const int[] ExtendOffset = [
+        0, -1, -3, -7, -15, -31, -63, -127, -255, -511, -1023, -2047,
+        -4095, -8191, -16383, -32767, -65535, -131071, -262143
+    ];
+    public static const int[] ZigZag8x8 = [
+        0, 1, 8, 16, 9, 2, 3, 10,
+        17, 24, 32, 25, 18, 11, 4, 5,
+        12, 19, 26, 33, 40, 48, 41, 34,
+        27, 20, 13, 6, 7, 14, 21, 28,
+        35, 42, 49, 56, 57, 50, 43, 36,
+        29, 22, 15, 23, 30, 37, 44, 51,
+        58, 59, 52, 45, 38, 31, 39, 46,
+        53, 60, 61, 54, 47, 55, 62, 63
+    ];
+
+    public static int[] CrRTable, CbBTable, CrGTable, CbGTable;
+    public static int[] RYTable, GYTable, BYTable,
+        RCbTable, GCbTable, BCbTable, RCrTable, GCrTable, BCrTable, NBitsTable;
+    //public static void static_this() {
+    static this() {
+
+        RGB16 = [
+            new RGB(0,0,0),
+            new RGB(0x80,0,0),
+            new RGB(0,0x80,0),
+            new RGB(0x80,0x80,0),
+            new RGB(0,0,0x80),
+            new RGB(0x80,0,0x80),
+            new RGB(0,0x80,0x80),
+            new RGB(0xC0,0xC0,0xC0),
+            new RGB(0x80,0x80,0x80),
+            new RGB(0xFF,0,0),
+            new RGB(0,0xFF,0),
+            new RGB(0xFF,0xFF,0),
+            new RGB(0,0,0xFF),
+            new RGB(0xFF,0,0xFF),
+            new RGB(0,0xFF,0xFF),
+            new RGB(0xFF,0xFF,0xFF)
+        ];
+        int [] rYTable = new int[256];
+        int [] gYTable = new int[256];
+        int [] bYTable = new int[256];
+        int [] rCbTable = new int[256];
+        int [] gCbTable = new int[256];
+        int [] bCbTable = new int[256];
+        int [] rCrTable = new int[256];
+        int [] gCrTable = new int[256];
+        int [] bCrTable = new int[256];
+        for (int i = 0; i < 256; i++) {
+            rYTable[i] = i * 19595;
+            gYTable[i] = i * 38470;
+            bYTable[i] = i * 7471 + 32768;
+            rCbTable[i] = i * -11059;
+            gCbTable[i] = i * -21709;
+            bCbTable[i] = i * 32768 + 8388608;
+            gCrTable[i] = i * -27439;
+            bCrTable[i] = i * -5329;
+        }
+        RYTable = rYTable;
+        GYTable = gYTable;
+        BYTable = bYTable;
+        RCbTable = rCbTable;
+        GCbTable = gCbTable;
+        BCbTable = bCbTable;
+        RCrTable = bCbTable;
+        GCrTable = gCrTable;
+        BCrTable = bCrTable;
+
+        /* Initialize YCbCr-RGB Tables */
+        int [] crRTable = new int[256];
+        int [] cbBTable = new int[256];
+        int [] crGTable = new int[256];
+        int [] cbGTable = new int[256];
+        for (int i = 0; i < 256; i++) {
+            int x2 = 2 * i - 255;
+            crRTable[i] = (45941 * x2 + 32768) >> 16;
+            cbBTable[i] = (58065 * x2 + 32768) >> 16;
+            crGTable[i] = -23401 * x2;
+            cbGTable[i] = -11277 * x2 + 32768;
+        }
+        CrRTable = crRTable;
+        CbBTable = cbBTable;
+        CrGTable = crGTable;
+        CbGTable = cbGTable;
+
+        /* Initialize BitCount Table */
+        int nBits = 1;
+        int power2 = 2;
+        int [] nBitsTable = new int[2048];
+        nBitsTable[0] = 0;
+        for (int i = 1; i < nBitsTable.length; i++) {
+            if (!(i < power2)) {
+                nBits++;
+                power2 *= 2;
+            }
+            nBitsTable[i] = nBits;
+        }
+        NBitsTable = nBitsTable;
+    }
+void compress(ImageData image, byte[] dataYComp, byte[] dataCbComp, byte[] dataCrComp) {
+    int srcWidth = image.width;
+    int srcHeight = image.height;
+    int vhFactor = maxV * maxH;
+    int[] frameComponent;
+    imageComponents = new byte[][](nComponents);
+    for (int i = 0; i < nComponents; i++) {
+        frameComponent = frameComponents[componentIds[i]];
+        imageComponents[i] = new byte[frameComponent[CW] * frameComponent[CH]];
+    }
+    frameComponent = frameComponents[componentIds[ID_Y]];
+    for (int yPos = 0; yPos < srcHeight; yPos++) {
+        int srcOfs = yPos * srcWidth;
+        int dstOfs = yPos * frameComponent[CW];
+        System.arraycopy(dataYComp, srcOfs, imageComponents[ID_Y], dstOfs, srcWidth);
+    }
+    frameComponent = frameComponents[componentIds[ID_CB]];
+    for (int yPos = 0; yPos < srcHeight / maxV; yPos++) {
+        int destRowIndex = yPos * frameComponent[CW];
+        for (int xPos = 0; xPos < srcWidth / maxH; xPos++) {
+            int sum = 0;
+            for (int iv = 0; iv < maxV; iv++) {
+                int srcIndex = (yPos * maxV + iv) * srcWidth + (xPos * maxH);
+                for (int ih = 0; ih < maxH; ih++) {
+                    sum += dataCbComp[srcIndex + ih] & 0xFF;
+                }
+            }
+            imageComponents[ID_CB][destRowIndex + xPos] = cast(byte)(sum / vhFactor);
+        }
+    }
+    frameComponent = frameComponents[componentIds[ID_CR]];
+    for (int yPos = 0; yPos < srcHeight / maxV; yPos++) {
+        int destRowIndex = yPos * frameComponent[CW];
+        for (int xPos = 0; xPos < srcWidth / maxH; xPos++) {
+            int sum = 0;
+            for (int iv = 0; iv < maxV; iv++) {
+                int srcIndex = (yPos * maxV + iv) * srcWidth + (xPos * maxH);
+                for (int ih = 0; ih < maxH; ih++) {
+                    sum += dataCrComp[srcIndex + ih] & 0xFF;
+                }
+            }
+            imageComponents[ID_CR][destRowIndex + xPos] = cast(byte)(sum / vhFactor);
+        }
+    }
+    for (int iComp = 0; iComp < nComponents; iComp++) {
+        byte[] imageComponent = imageComponents[iComp];
+        frameComponent = frameComponents[componentIds[iComp]];
+        int hFactor = frameComponent[HI];
+        int vFactor = frameComponent[VI];
+        int componentWidth = frameComponent[CW];
+        int componentHeight = frameComponent[CH];
+        int compressedWidth = srcWidth / (maxH / hFactor);
+        int compressedHeight = srcHeight / (maxV / vFactor);
+        if (compressedWidth < componentWidth) {
+            int delta = componentWidth - compressedWidth;
+            for (int yPos = 0; yPos < compressedHeight; yPos++) {
+                int dstOfs = ((yPos + 1) * componentWidth - delta);
+                int dataValue = imageComponent[(dstOfs > 0) ? dstOfs - 1 : 0] & 0xFF;
+                for (int i = 0; i < delta; i++) {
+                    imageComponent[dstOfs + i] = cast(byte)dataValue;
+                }
+            }
+        }
+        if (compressedHeight < componentHeight) {
+            int srcOfs = (compressedHeight > 0) ? (compressedHeight - 1) * componentWidth : 1;
+            for (int yPos = (compressedHeight > 0) ? compressedHeight : 1; yPos <= componentHeight; yPos++) {
+                int dstOfs = (yPos - 1) * componentWidth;
+                System.arraycopy(imageComponent, srcOfs, imageComponent, dstOfs, componentWidth);
+            }
+        }
+    }
+}
+void convert4BitRGBToYCbCr(ImageData image) {
+    RGB[] rgbs = image.getRGBs();
+    int paletteSize = rgbs.length;
+    byte[] yComp = new byte[paletteSize];
+    byte[] cbComp = new byte[paletteSize];
+    byte[] crComp = new byte[paletteSize];
+    int srcWidth = image.width;
+    int srcHeight = image.height;
+    for (int i = 0; i < paletteSize; i++) {
+        RGB color = rgbs[i];
+        int r = color.red;
+        int g = color.green;
+        int b = color.blue;
+        int n = RYTable[r] + GYTable[g] + BYTable[b];
+        yComp[i] = cast(byte)(n >> 16);
+        if ((n < 0) && ((n & 0xFFFF) !is 0)) yComp[i]--;
+        n = RCbTable[r] + GCbTable[g] + BCbTable[b];
+        cbComp[i] = cast(byte)(n >> 16);
+        if ((n < 0) && ((n & 0xFFFF) !is 0)) cbComp[i]--;
+        n = RCrTable[r] + GCrTable[g] + BCrTable[b];
+        crComp[i] = cast(byte)(n >> 16);
+        if ((n < 0) && ((n & 0xFFFF) !is 0)) crComp[i]--;
+    }
+    int bSize = srcWidth * srcHeight;
+    byte[] dataYComp = new byte[bSize];
+    byte[] dataCbComp = new byte[bSize];
+    byte[] dataCrComp = new byte[bSize];
+    byte[] origData = image.data;
+    int bytesPerLine = image.bytesPerLine;
+    int maxScanlineByte = srcWidth >> 1;
+    for (int yPos = 0; yPos < srcHeight; yPos++) {
+        for (int xPos = 0; xPos < maxScanlineByte; xPos++) {
+            int srcIndex = yPos * bytesPerLine + xPos;
+            int dstIndex = yPos * srcWidth + (xPos * 2);
+            int value2 = origData[srcIndex] & 0xFF;
+            int value1 = value2 >> 4;
+            value2 &= 0x0F;
+            dataYComp[dstIndex] = yComp[value1];
+            dataCbComp[dstIndex] = cbComp[value1];
+            dataCrComp[dstIndex] = crComp[value1];
+            dataYComp[dstIndex + 1] = yComp[value2];
+            dataCbComp[dstIndex + 1] = cbComp[value2];
+            dataCrComp[dstIndex + 1] = crComp[value2];
+        }
+    }
+    compress(image, dataYComp, dataCbComp, dataCrComp);
+}
+void convert8BitRGBToYCbCr(ImageData image) {
+    RGB[] rgbs = image.getRGBs();
+    int paletteSize = rgbs.length;
+    byte[] yComp = new byte[paletteSize];
+    byte[] cbComp = new byte[paletteSize];
+    byte[] crComp = new byte[paletteSize];
+    int srcWidth = image.width;
+    int srcHeight = image.height;
+    for (int i = 0; i < paletteSize; i++) {
+        RGB color = rgbs[i];
+        int r = color.red;
+        int g = color.green;
+        int b = color.blue;
+        int n = RYTable[r] + GYTable[g] + BYTable[b];
+        yComp[i] = cast(byte)(n >> 16);
+        if ((n < 0) && ((n & 0xFFFF) !is 0)) yComp[i]--;
+        n = RCbTable[r] + GCbTable[g] + BCbTable[b];
+        cbComp[i] = cast(byte)(n >> 16);
+        if ((n < 0) && ((n & 0xFFFF) !is 0)) cbComp[i]--;
+        n = RCrTable[r] + GCrTable[g] + BCrTable[b];
+        crComp[i] = cast(byte)(n >> 16);
+        if ((n < 0) && ((n & 0xFFFF) !is 0)) crComp[i]--;
+    }
+    int dstWidth = image.width;
+    int dstHeight = srcHeight;
+    int stride = ((srcWidth + 3) >> 2) << 2;
+    int bSize = dstWidth * dstHeight;
+    byte[] dataYComp = new byte[bSize];
+    byte[] dataCbComp = new byte[bSize];
+    byte[] dataCrComp = new byte[bSize];
+    byte[] origData = image.data;
+    for (int yPos = 0; yPos < srcHeight; yPos++) {
+        int srcRowIndex = yPos * stride;
+        int dstRowIndex = yPos * dstWidth;
+        for (int xPos = 0; xPos < srcWidth; xPos++) {
+            int value = origData[srcRowIndex + xPos] & 0xFF;
+            int dstIndex = dstRowIndex + xPos;
+            dataYComp[dstIndex] = yComp[value];
+            dataCbComp[dstIndex] = cbComp[value];
+            dataCrComp[dstIndex] = crComp[value];
+        }
+    }
+    compress(image, dataYComp, dataCbComp, dataCrComp);
+}
+byte[] convertCMYKToRGB() {
+    /* Unsupported CMYK format. Answer an empty byte array. */
+    return new byte[0];
+}
+void convertImageToYCbCr(ImageData image) {
+    switch (image.depth) {
+        case 4:
+            convert4BitRGBToYCbCr(image);
+            return;
+        case 8:
+            convert8BitRGBToYCbCr(image);
+            return;
+        case 16:
+        case 24:
+        case 32:
+            convertMultiRGBToYCbCr(image);
+            return;
+        default:
+            SWT.error(SWT.ERROR_UNSUPPORTED_DEPTH);
+    }
+    return;
+}
+void convertMultiRGBToYCbCr(ImageData image) {
+    int srcWidth = image.width;
+    int srcHeight = image.height;
+    int bSize = srcWidth * srcHeight;
+    byte[] dataYComp = new byte[bSize];
+    byte[] dataCbComp = new byte[bSize];
+    byte[] dataCrComp = new byte[bSize];
+    PaletteData palette = image.palette;
+    int[] buffer = new int[srcWidth];
+    if (palette.isDirect) {
+        int redMask = palette.redMask;
+        int greenMask = palette.greenMask;
+        int blueMask = palette.blueMask;
+        int redShift = palette.redShift;
+        int greenShift = palette.greenShift;
+        int blueShift = palette.blueShift;
+        for (int yPos = 0; yPos < srcHeight; yPos++) {
+            image.getPixels(0, yPos, srcWidth, buffer, 0);
+            int dstRowIndex = yPos * srcWidth;
+            for (int xPos = 0; xPos < srcWidth; xPos++) {
+                int pixel = buffer[xPos];
+                int dstDataIndex = dstRowIndex + xPos;
+                int r = pixel & redMask;
+                r = (redShift < 0) ? r >>> -redShift : r << redShift;
+                int g = pixel & greenMask;
+                g = (greenShift < 0) ? g >>> -greenShift : g << greenShift;
+                int b = pixel & blueMask;
+                b = (blueShift < 0) ? b >>> -blueShift : b << blueShift;
+                dataYComp[dstDataIndex] = cast(byte)((RYTable[r] + GYTable[g] + BYTable[b]) >> 16);
+                dataCbComp[dstDataIndex] = cast(byte)((RCbTable[r] + GCbTable[g] + BCbTable[b]) >> 16);
+                dataCrComp[dstDataIndex] = cast(byte)((RCrTable[r] + GCrTable[g] + BCrTable[b]) >> 16);
+            }
+        }
+    } else {
+        for (int yPos = 0; yPos < srcHeight; yPos++) {
+            image.getPixels(0, yPos, srcWidth, buffer, 0);
+            int dstRowIndex = yPos * srcWidth;
+            for (int xPos = 0; xPos < srcWidth; xPos++) {
+                int pixel = buffer[xPos];
+                int dstDataIndex = dstRowIndex + xPos;
+                RGB rgb = palette.getRGB(pixel);
+                int r = rgb.red;
+                int g = rgb.green;
+                int b = rgb.blue;
+                dataYComp[dstDataIndex] = cast(byte)((RYTable[r] + GYTable[g] + BYTable[b]) >> 16);
+                dataCbComp[dstDataIndex] = cast(byte)((RCbTable[r] + GCbTable[g] + BCbTable[b]) >> 16);
+                dataCrComp[dstDataIndex] = cast(byte)((RCrTable[r] + GCrTable[g] + BCrTable[b]) >> 16);
+            }
+        }
+    }
+    compress(image, dataYComp, dataCbComp, dataCrComp);
+}
+byte[] convertYToRGB() {
+    int compWidth = frameComponents[componentIds[ID_Y]][CW];
+    int bytesPerLine = (((imageWidth * 8 + 7) / 8) + 3) / 4 * 4;
+    byte[] data = new byte[bytesPerLine * imageHeight];
+    byte[] yComp = imageComponents[ID_Y];
+    int destIndex = 0;
+    for (int i = 0; i < imageHeight; i++) {
+        int srcIndex = i * compWidth;
+        for (int j = 0; j < bytesPerLine; j++) {
+            int y = yComp[srcIndex] & 0xFF;
+            if (y < 0) {
+                y = 0;
+            } else {
+                if (y > 255) y = 255;
+            }
+            if (j >= imageWidth) {
+                y = 0;
+            }
+            data[destIndex] = cast(byte)y;
+            srcIndex++;
+            destIndex++;
+        }
+    }
+    return data;
+}
+byte[] convertYCbCrToRGB() {
+    /**
+     * Convert existing image components into an RGB format.
+     * YCbCr is defined per CCIR 601-1, except that Cb and Cr are
+     * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
+     * The conversion equations to be implemented are therefore
+     *  R = Y                + 1.40200 * Cr
+     *  G = Y - 0.34414 * Cb - 0.71414 * Cr
+     *  B = Y + 1.77200 * Cb
+     * where Cb and Cr represent the incoming values less MAXJSAMPLE/2.
+     * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)
+     *
+     * To avoid floating-point arithmetic, we represent the fractional constants
+     * as integers scaled up by 2^16 (about 4 digits precision); we have to divide
+     * the products by 2^16, with appropriate rounding, to get the correct answer.
+     * Notice that Y, being an integral input, does not contribute any fraction
+     * so it need not participate in the rounding.
+     *
+     * For even more speed, we avoid doing any multiplications in the inner loop
+     * by precalculating the constants times Cb and Cr for all possible values.
+     * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);
+     * for 12-bit samples it is still acceptable.  It's not very reasonable for
+     * 16-bit samples, but if you want lossless storage you shouldn't be changing
+     * colorspace anyway.
+     * The Cr=>R and Cb=>B values can be rounded to integers in advance; the
+     * values for the G calculation are left scaled up, since we must add them
+     * together before rounding.
+     */
+    int bSize = imageWidth * imageHeight * nComponents;
+    byte[] rgbData = new byte[bSize];
+    int destIndex = 0;
+    expandImageComponents();
+    byte[] yComp = imageComponents[ID_Y];
+    byte[] cbComp = imageComponents[ID_CB];
+    byte[] crComp = imageComponents[ID_CR];
+    int compWidth = frameComponents[componentIds[ID_Y]][CW];
+    for (int v = 0; v < imageHeight; v++) {
+        int srcIndex = v * compWidth;
+        for (int i = 0; i < imageWidth; i++) {
+            int y = yComp[srcIndex] & 0xFF;
+            int cb = cbComp[srcIndex] & 0xFF;
+            int cr = crComp[srcIndex] & 0xFF;
+            int r = y + CrRTable[cr];
+            int g = y + ((CbGTable[cb] + CrGTable[cr]) >> 16);
+            int b = y + CbBTable[cb];
+            if (r < 0) {
+                r = 0;
+            } else {
+                if (r > 255) r = 255;
+            }
+            if (g < 0) {
+                g = 0;
+            } else {
+                if (g > 255) g = 255;
+            }
+            if (b < 0) {
+                b = 0;
+            } else {
+                if (b > 255) b = 255;
+            }
+            rgbData[destIndex] = cast(byte)b;
+            rgbData[destIndex + 1] = cast(byte)g;
+            rgbData[destIndex + 2] = cast(byte)r;
+            destIndex += 3;
+            srcIndex++;
+        }
+    }
+    return rgbData;
+}
+void decodeACCoefficients(int[] dataUnit, int iComp) {
+    int[] sParams = scanHeader.componentParameters[componentIds[iComp]];
+    JPEGHuffmanTable acTable = acHuffmanTables[sParams[AC]];
+    int k = 1;
+    while (k < 64) {
+        int rs = decodeUsingTable(acTable);
+        int r = rs >> 4;
+        int s = rs & 0xF;
+        if (s is 0) {
+            if (r is 15) {
+                k += 16;
+            } else {
+                break;
+            }
+        } else {
+            k += r;
+            int bits = receive(s);
+            dataUnit[ZigZag8x8[k]] = extendBy(bits, s);
+            k++;
+        }
+    }
+}
+void decodeACFirstCoefficients(int[] dataUnit, int iComp, int start, int end, int approxBit) {
+    if (eobrun > 0) {
+        eobrun--;
+        return;
+    }
+    int[] sParams = scanHeader.componentParameters[componentIds[iComp]];
+    JPEGHuffmanTable acTable = acHuffmanTables[sParams[AC]];
+    int k = start;
+    while (k <= end) {
+        int rs = decodeUsingTable(acTable);
+        int r = rs >> 4;
+        int s = rs & 0xF;
+        if (s is 0) {
+            if (r is 15) {
+                k += 16;
+            } else {
+                eobrun = (1 << r) + receive(r) - 1;
+                break;
+            }
+        } else {
+            k += r;
+            int bits = receive(s);
+            dataUnit[ZigZag8x8[k]] = extendBy(bits, s) << approxBit;
+            k++;
+        }
+    }
+}
+void decodeACRefineCoefficients(int[] dataUnit, int iComp, int start, int end, int approxBit) {
+    int[] sParams = scanHeader.componentParameters[componentIds[iComp]];
+    JPEGHuffmanTable acTable = acHuffmanTables[sParams[AC]];
+    int k = start;
+    while (k <= end) {
+        if (eobrun > 0) {
+            while (k <= end) {
+                int zzIndex = ZigZag8x8[k];
+                if (dataUnit[zzIndex] !is 0) {
+                    dataUnit[zzIndex] = refineAC(dataUnit[zzIndex], approxBit);
+                }
+                k++;
+            }
+            eobrun--;
+        } else {
+            int rs = decodeUsingTable(acTable);
+            int r = rs >> 4;
+            int s = rs & 0xF;
+            if (s is 0) {
+                if (r is 15) {
+                    int zeros = 0;
+                    while (zeros < 16 && k <= end) {
+                        int zzIndex = ZigZag8x8[k];
+                        if (dataUnit[zzIndex] !is 0) {
+                            dataUnit[zzIndex] = refineAC(dataUnit[zzIndex], approxBit);
+                        } else {
+                            zeros++;
+                        }
+                        k++;
+                    }
+                } else {
+                    eobrun = (1 << r) + receive(r);
+                }
+            } else {
+                int bit = receive(s);
+                int zeros = 0;
+                int zzIndex = ZigZag8x8[k];
+                while ((zeros < r || dataUnit[zzIndex] !is 0) && k <= end) {
+                    if (dataUnit[zzIndex] !is 0) {
+                        dataUnit[zzIndex] = refineAC(dataUnit[zzIndex], approxBit);
+                    } else {
+                        zeros++;
+                    }
+                    k++;
+                    zzIndex = ZigZag8x8[k];
+                }
+                if (bit !is 0) {
+                    dataUnit[zzIndex] = 1 << approxBit;
+                } else {
+                    dataUnit[zzIndex] = -1 << approxBit;
+                }
+                k++;
+            }
+        }
+    }
+}
+int refineAC(int ac, int approxBit) {
+    if (ac > 0) {
+        int bit = nextBit();
+        if (bit !is 0) {
+            ac += 1 << approxBit;
+        }
+    } else if (ac < 0) {
+        int bit = nextBit();
+        if (bit !is 0) {
+            ac += -1 << approxBit;
+        }
+    }
+    return ac;
+}
+void decodeDCCoefficient(int[] dataUnit, int iComp, bool first, int approxBit) {
+    int[] sParams = scanHeader.componentParameters[componentIds[iComp]];
+    JPEGHuffmanTable dcTable = dcHuffmanTables[sParams[DC]];
+    int lastDC = 0;
+    if (progressive && !first) {
+        int bit = nextBit();
+        lastDC = dataUnit[0] + (bit << approxBit);
+    } else {
+        lastDC = precedingDCs[iComp];
+        int nBits = decodeUsingTable(dcTable);
+        if (nBits !is 0) {
+            int bits = receive(nBits);
+            int diff = extendBy(bits, nBits);
+            lastDC += diff;
+            precedingDCs[iComp] = lastDC;
+        }
+        if (progressive) {
+            lastDC = lastDC << approxBit;
+        }
+    }
+    dataUnit[0] = lastDC;
+}
+void dequantize(int[] dataUnit, int iComp) {
+    int[] qTable = quantizationTables[frameComponents[componentIds[iComp]][TQI]];
+    for (int i = 0; i < dataUnit.length; i++) {
+        int zzIndex = ZigZag8x8[i];
+        dataUnit[zzIndex] = dataUnit[zzIndex] * qTable[i];
+    }
+}
+byte[] decodeImageComponents() {
+    if (nComponents is 3) { // compIds 1, 2, 3
+        return convertYCbCrToRGB();
+    }
+//  if (nComponents is 3) { // compIds 1, 4, 5
+//      Unsupported CMYK format.
+//      return convertYIQToRGB();
+//  }
+    if (nComponents is 4) {
+        return convertCMYKToRGB();
+    }
+    return convertYToRGB();
+}
+void decodeMCUAtXAndY(int xmcu, int ymcu, int nComponentsInScan, bool first, int start, int end, int approxBit) {
+    for (int iComp = 0; iComp < nComponentsInScan; iComp++) {
+        int scanComponent = iComp;
+        while (scanHeader.componentParameters[componentIds[scanComponent]] is null) {
+            scanComponent++;
+        }
+        int[] frameComponent = frameComponents[componentIds[scanComponent]];
+        int hi = frameComponent[HI];
+        int vi = frameComponent[VI];
+        if (nComponentsInScan is 1) {
+            hi = 1;
+            vi = 1;
+        }
+        int compWidth = frameComponent[CW];
+        for (int ivi = 0; ivi < vi; ivi++) {
+            for (int ihi = 0; ihi < hi; ihi++) {
+                if (progressive) {
+                    // Progressive: First scan - create a new data unit.
+                    // Subsequent scans - refine the existing data unit.
+                    int index = (ymcu * vi + ivi) * compWidth + xmcu * hi + ihi;
+                    dataUnit = dataUnits[scanComponent][index];
+                    if (dataUnit is null) {
+                        dataUnit = new int[64];
+                        dataUnits[scanComponent][index] = dataUnit;
+                    }
+                } else {
+                    // Sequential: Clear and reuse the data unit buffer.
+                    for (int i = 0; i < dataUnit.length; i++) {
+                        dataUnit[i] = 0;
+                    }
+                }
+                if (!progressive || scanHeader.isDCProgressiveScan()) {
+                    decodeDCCoefficient(dataUnit, scanComponent, first, approxBit);
+                }
+                if (!progressive) {
+                    decodeACCoefficients(dataUnit, scanComponent);
+                } else {
+                    if (scanHeader.isACProgressiveScan()) {
+                        if (first) {
+                            decodeACFirstCoefficients(dataUnit, scanComponent, start, end, approxBit);
+                        } else {
+                            decodeACRefineCoefficients(dataUnit, scanComponent, start, end, approxBit);
+                        }
+                    }
+                    if (loader.hasListeners()) {
+                        // Dequantization, IDCT, up-sampling and color conversion
+                        // are done on a copy of the coefficient data in order to
+                        // display the image incrementally.
+                        int[] temp = dataUnit;
+                        dataUnit = new int[64];
+                        System.arraycopy(temp, 0, dataUnit, 0, 64);
+                    }
+                }
+                if (!progressive || (progressive && loader.hasListeners())) {
+                    dequantize(dataUnit, scanComponent);
+                    inverseDCT(dataUnit);
+                    storeData(dataUnit, scanComponent, xmcu, ymcu, hi, ihi, vi, ivi);
+                }
+            }
+        }
+    }
+}
+void decodeScan() {
+    if (progressive && !scanHeader.verifyProgressiveScan()) {
+        SWT.error(SWT.ERROR_INVALID_IMAGE);
+    }
+    int nComponentsInScan = scanHeader.getNumberOfImageComponents();
+    int mcuRowsInScan = interleavedMcuRows;
+    int mcusPerRow = interleavedMcuCols;
+    if (nComponentsInScan is 1) {
+        // Non-interleaved.
+        int scanComponent = 0;
+        while (scanHeader.componentParameters[componentIds[scanComponent]] is null) {
+            scanComponent++;
+        }
+        int[] frameComponent = frameComponents[componentIds[scanComponent]];
+        int hi = frameComponent[HI];
+        int vi = frameComponent[VI];
+        int mcuWidth = DCTSIZE * maxH / hi;
+        int mcuHeight = DCTSIZE * maxV / vi;
+        mcusPerRow = (imageWidth + mcuWidth - 1) / mcuWidth;
+        mcuRowsInScan = (imageHeight + mcuHeight - 1) / mcuHeight;
+    }
+    bool first = scanHeader.isFirstScan();
+    int start = scanHeader.getStartOfSpectralSelection();
+    int end = scanHeader.getEndOfSpectralSelection();
+    int approxBit = scanHeader.getApproxBitPositionLow();
+    restartsToGo = restartInterval;
+    nextRestartNumber = 0;
+    for (int ymcu = 0; ymcu < mcuRowsInScan; ymcu++) {
+        for (int xmcu = 0; xmcu < mcusPerRow; xmcu++) {
+            if (restartInterval !is 0) {
+                if (restartsToGo is 0) processRestartInterval();
+                restartsToGo--;
+            }
+            decodeMCUAtXAndY(xmcu, ymcu, nComponentsInScan, first, start, end, approxBit);
+        }
+    }
+}
+int decodeUsingTable(JPEGHuffmanTable huffmanTable) {
+    int i = 0;
+    int[] maxCodes = huffmanTable.getDhMaxCodes();
+    int[] minCodes = huffmanTable.getDhMinCodes();
+    int[] valPtrs = huffmanTable.getDhValPtrs();
+    int[] huffVals = huffmanTable.getDhValues();
+    int code = nextBit();
+    while (code > maxCodes[i]) {
+        code = code * 2 + nextBit();
+        i++;
+    }
+    int j = valPtrs[i] + code - minCodes[i];
+    return huffVals[j];
+}
+void emit(int huffCode, int nBits) {
+    if (nBits is 0) {
+        SWT.error(SWT.ERROR_INVALID_IMAGE);
+    }
+    int[] power2m1 = [
+        1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191,
+        16383, 32767, 65535, 131125
+    ];
+    int code = (huffCode & power2m1[nBits - 1]) << (24 - nBits - currentBitCount);
+    byte[] codeBuffer = new byte[4];
+    codeBuffer[0] = cast(byte)(code & 0xFF);
+    codeBuffer[1] = cast(byte)((code >> 8) & 0xFF);
+    codeBuffer[2] = cast(byte)((code >> 16) & 0xFF);
+    codeBuffer[3] = cast(byte)((code >> 24) & 0xFF);
+    int abs = nBits - (8 - currentBitCount);
+    if (abs < 0) abs = -abs;
+    if ((abs >> 3) > 0) {
+        currentByte += codeBuffer[2];
+        emitByte(cast(byte)currentByte);
+        emitByte(codeBuffer[1]);
+        currentByte = codeBuffer[0];
+        currentBitCount += nBits - 16;
+    } else {
+        currentBitCount += nBits;
+        if (currentBitCount >= 8) {
+            currentByte += codeBuffer[2];
+            emitByte(cast(byte)currentByte);
+            currentByte = codeBuffer[1];
+            currentBitCount -= 8;
+        } else {
+            currentByte += codeBuffer[2];
+        }
+    }
+}
+void emitByte(byte byteValue) {
+    if (bufferCurrentPosition >= 512) {
+        resetOutputBuffer();
+    }
+    dataBuffer[bufferCurrentPosition] = byteValue;
+    bufferCurrentPosition++;
+    if (byteValue is -1) {
+        emitByte(cast(byte)0);
+    }
+}
+void encodeACCoefficients(int[] dataUnit, int iComp) {
+    int[] sParams = scanHeader.componentParameters[iComp];
+    JPEGHuffmanTable acTable = acHuffmanTables[sParams[AC]];
+    int[] ehCodes = acTable.ehCodes;
+    byte[] ehSizes = acTable.ehCodeLengths;
+    int r = 0;
+    int k = 1;
+    while (k < 64) {
+        k++;
+        int acValue = dataUnit[ZigZag8x8[k - 1]];
+        if (acValue is 0) {
+            if (k is 64) {
+                emit(ehCodes[0], ehSizes[0] & 0xFF);
+            } else {
+                r++;
+            }
+        } else {
+            while (r > 15) {
+                emit(ehCodes[0xF0], ehSizes[0xF0] & 0xFF);
+                r -= 16;
+            }
+            if (acValue < 0) {
+                int absACValue = acValue;
+                if (absACValue < 0) absACValue = -absACValue;
+                int nBits = NBitsTable[absACValue];
+                int rs = r * 16 + nBits;
+                emit(ehCodes[rs], ehSizes[rs] & 0xFF);
+                emit(0xFFFFFF - absACValue, nBits);
+            } else {
+                int nBits = NBitsTable[acValue];
+                int rs = r * 16 + nBits;
+                emit(ehCodes[rs], ehSizes[rs] & 0xFF);
+                emit(acValue, nBits);
+            }
+            r = 0;
+        }
+    }
+}
+void encodeDCCoefficients(int[] dataUnit, int iComp) {
+    int[] sParams = scanHeader.componentParameters[iComp];
+    JPEGHuffmanTable dcTable = dcHuffmanTables[sParams[DC]];
+    int lastDC = precedingDCs[iComp];
+    int dcValue = dataUnit[0];
+    int diff = dcValue - lastDC;
+    precedingDCs[iComp] = dcValue;
+    if (diff < 0) {
+        int absDiff = 0 - diff;
+        int nBits = NBitsTable[absDiff];
+        emit(dcTable.ehCodes[nBits], dcTable.ehCodeLengths[nBits]);
+        emit(0xFFFFFF - absDiff, nBits);
+    } else {
+        int nBits = NBitsTable[diff];
+        emit(dcTable.ehCodes[nBits], dcTable.ehCodeLengths[nBits]);
+        if (nBits !is 0) {
+            emit(diff, nBits);
+        }
+    }
+}
+void encodeMCUAtXAndY(int xmcu, int ymcu) {
+    int nComponentsInScan = scanHeader.getNumberOfImageComponents();
+    dataUnit = new int[64];
+    for (int iComp = 0; iComp < nComponentsInScan; iComp++) {
+        int[] frameComponent = frameComponents[componentIds[iComp]];
+        int hi = frameComponent[HI];
+        int vi = frameComponent[VI];
+        for (int ivi = 0; ivi < vi; ivi++) {
+            for (int ihi = 0; ihi < hi; ihi++) {
+                extractData(dataUnit, iComp, xmcu, ymcu, ihi, ivi);
+                forwardDCT(dataUnit);
+                quantizeData(dataUnit, iComp);
+                encodeDCCoefficients(dataUnit, iComp);
+                encodeACCoefficients(dataUnit, iComp);
+            }
+        }
+    }
+}
+void encodeScan() {
+    for (int ymcu = 0; ymcu < interleavedMcuRows; ymcu++) {
+        for (int xmcu = 0; xmcu < interleavedMcuCols; xmcu++) {
+            encodeMCUAtXAndY(xmcu, ymcu);
+        }
+    }
+    if (currentBitCount !is 0) {
+        emitByte(cast(byte)currentByte);
+    }
+    resetOutputBuffer();
+}
+void expandImageComponents() {
+    for (int iComp = 0; iComp < nComponents; iComp++) {
+        int[] frameComponent = frameComponents[componentIds[iComp]];
+        int hi = frameComponent[HI];
+        int vi = frameComponent[VI];
+        int upH = maxH / hi;
+        int upV = maxV / vi;
+        if ((upH * upV) > 1) {
+            byte[] component = imageComponents[iComp];
+            int compWidth = frameComponent[CW];
+            int compHeight = frameComponent[CH];
+            int upCompWidth = compWidth * upH;
+            int upCompHeight = compHeight * upV;
+            ImageData src = new ImageData(compWidth, compHeight, 8, new PaletteData(RGB16), 4, component);
+            ImageData dest = src.scaledTo(upCompWidth, upCompHeight);
+            imageComponents[iComp] = dest.data;
+        }
+    }
+}
+int extendBy(int diff, int t) {
+    if (diff < ExtendTest[t]) {
+        return diff + ExtendOffset[t];
+    } else {
+        return diff;
+    }
+}
+void extractData(int[] dataUnit, int iComp, int xmcu, int ymcu, int ihi, int ivi) {
+    byte[] compImage = imageComponents[iComp];
+    int[] frameComponent = frameComponents[componentIds[iComp]];
+    int hi = frameComponent[HI];
+    int vi = frameComponent[VI];
+    int compWidth = frameComponent[CW];
+    int srcIndex = ((ymcu * vi + ivi) * compWidth * DCTSIZE) + ((xmcu * hi + ihi) * DCTSIZE);
+    int destIndex = 0;
+    for (int i = 0; i < DCTSIZE; i++) {
+        for (int col = 0; col < DCTSIZE; col++) {
+            dataUnit[destIndex] = (compImage[srcIndex + col] & 0xFF) - 128;
+            destIndex++;
+        }
+        srcIndex += compWidth;
+    }
+}
+void forwardDCT(int[] dataUnit) {
+    for (int row = 0; row < 8; row++) {
+        int rIndex = row * DCTSIZE;
+        int tmp0 = dataUnit[rIndex] + dataUnit[rIndex + 7];
+        int tmp7 = dataUnit[rIndex] - dataUnit[rIndex + 7];
+        int tmp1 = dataUnit[rIndex + 1] + dataUnit[rIndex + 6];
+        int tmp6 = dataUnit[rIndex + 1] - dataUnit[rIndex + 6];
+        int tmp2 = dataUnit[rIndex + 2] + dataUnit[rIndex + 5];
+        int tmp5 = dataUnit[rIndex + 2] - dataUnit[rIndex + 5];
+        int tmp3 = dataUnit[rIndex + 3] + dataUnit[rIndex + 4];
+        int tmp4 = dataUnit[rIndex + 3] - dataUnit[rIndex + 4];
+
+        /**
+         * Even part per LL&M figure 1 --- note that published figure
+         * is faulty; rotator 'sqrt(2)*c1' should be 'sqrt(2)*c6'.
+         */
+        int tmp10 = tmp0 + tmp3;
+        int tmp13 = tmp0 - tmp3;
+        int tmp11 = tmp1 + tmp2;
+        int tmp12 = tmp1 - tmp2;
+
+        dataUnit[rIndex] = (tmp10 + tmp11) * 4;
+        dataUnit[rIndex + 4]  = (tmp10 - tmp11) * 4;
+
+        int z1 = (tmp12 + tmp13) * FIX_0_541196100;
+        int n = z1 + (tmp13 * FIX_0_765366865) + 1024;
+        dataUnit[rIndex + 2] = n >> 11;
+        if ((n < 0) && ((n & 0x07FF) !is 0)) dataUnit[rIndex + 2]--;
+        n = z1 + (tmp12 * (0 - FIX_1_847759065)) + 1024;
+        dataUnit[rIndex + 6] = n >> 11;
+        if ((n < 0) && ((n & 0x07FF) !is 0)) dataUnit[rIndex + 6]--;
+
+        /**
+         * Odd part per figure 8 --- note paper omits factor of sqrt(2).
+         * cK represents cos(K*pi/16).
+         * i0..i3 in the paper are tmp4..tmp7 here.
+         */
+        z1 = tmp4 + tmp7;
+        int z2 = tmp5 + tmp6;
+        int z3 = tmp4 + tmp6;
+        int z4 = tmp5 + tmp7;
+        int z5 = (z3 + z4) * FIX_1_175875602;   // sqrt(2) * c3
+
+        tmp4 *= FIX_0_298631336;    // sqrt(2) * (-c1+c3+c5-c7)
+        tmp5 *= FIX_2_053119869;    // sqrt(2) * ( c1+c3-c5+c7)
+        tmp6 *= FIX_3_072711026;    // sqrt(2) * ( c1+c3+c5-c7)
+        tmp7 *= FIX_1_501321110;    // sqrt(2) * ( c1+c3-c5-c7)
+        z1 *= 0 - FIX_0_899976223;  // sqrt(2) * (c7-c3)
+        z2 *= 0 - FIX_2_562915447;  // sqrt(2) * (-c1-c3)
+        z3 *= 0 - FIX_1_961570560;  // sqrt(2) * (-c3-c5)
+        z4 *= 0 - FIX_0_390180644;  // sqrt(2) * (c5-c3)
+
+        z3 += z5;
+        z4 += z5;
+
+        n = tmp4 + z1 + z3 + 1024;
+        dataUnit[rIndex + 7] = n >> 11;
+        if ((n < 0) && ((n & 0x07FF) !is 0)) dataUnit[rIndex + 7]--;
+        n = tmp5 + z2 + z4 + 1024;
+        dataUnit[rIndex + 5] = n >> 11;
+        if ((n < 0) && ((n & 0x07FF) !is 0)) dataUnit[rIndex + 5]--;
+        n = tmp6 + z2 + z3 + 1024;
+        dataUnit[rIndex + 3] = n >> 11;
+        if ((n < 0) && ((n & 0x07FF) !is 0)) dataUnit[rIndex + 3]--;
+        n = tmp7 + z1 + z4 + 1024;
+        dataUnit[rIndex + 1] = n >> 11;
+        if ((n < 0) && ((n & 0x07FF) !is 0)) dataUnit[rIndex + 1]--;
+    }
+
+    /**
+     * Pass 2: process columns.
+     * Note that we must descale the results by a factor of 8 is 2**3,
+     * and also undo the PASS1_BITS scaling.
+     */
+    for (int col = 0; col < 8; col++) {
+        int c0 = col;
+        int c1 = col + 8;
+        int c2 = col + 16;
+        int c3 = col + 24;
+        int c4 = col + 32;
+        int c5 = col + 40;
+        int c6 = col + 48;
+        int c7 = col + 56;
+        int tmp0 = dataUnit[c0] + dataUnit[c7];
+        int tmp7 = dataUnit[c0] - dataUnit[c7];
+        int tmp1 = dataUnit[c1] + dataUnit[c6];
+        int tmp6 = dataUnit[c1] - dataUnit[c6];
+        int tmp2 = dataUnit[c2] + dataUnit[c5];
+        int tmp5 = dataUnit[c2] - dataUnit[c5];
+        int tmp3 = dataUnit[c3] + dataUnit[c4];
+        int tmp4 = dataUnit[c3] - dataUnit[c4];
+
+        /**
+         * Even part per LL&M figure 1 --- note that published figure
+         * is faulty; rotator 'sqrt(2)*c1' should be 'sqrt(2)*c6'.
+         */
+        int tmp10 = tmp0 + tmp3;
+        int tmp13 = tmp0 - tmp3;
+        int tmp11 = tmp1 + tmp2;
+        int tmp12 = tmp1 - tmp2;
+
+        int n = tmp10 + tmp11 + 16;
+        dataUnit[c0] = n >> 5;
+        if ((n < 0) && ((n & 0x1F) !is 0)) dataUnit[c0]--;
+        n = tmp10 - tmp11 + 16;
+        dataUnit[c4] = n >> 5;
+        if ((n < 0) && ((n & 0x1F) !is 0)) dataUnit[c4]--;
+
+        int z1 = (tmp12 + tmp13) * FIX_0_541196100;
+        n = z1 + (tmp13 * FIX_0_765366865) + 131072;
+        dataUnit[c2] = n >> 18;
+        if ((n < 0) && ((n & 0x3FFFF) !is 0)) dataUnit[c2]--;
+        n = z1 + (tmp12 * (0 - FIX_1_847759065)) + 131072;
+        dataUnit[c6] = n >> 18;
+        if ((n < 0) && ((n & 0x3FFFF) !is 0)) dataUnit[c6]--;
+
+        /**
+         * Odd part per figure 8 --- note paper omits factor of sqrt(2).
+         * cK represents cos(K*pi/16).
+         * i0..i3 in the paper are tmp4..tmp7 here.
+         */
+        z1 = tmp4 + tmp7;
+        int z2 = tmp5 + tmp6;
+        int z3 = tmp4 + tmp6;
+        int z4 = tmp5 + tmp7;
+        int z5 = (z3 + z4) * FIX_1_175875602;   // sqrt(2) * c3
+
+        tmp4 *= FIX_0_298631336;    // sqrt(2) * (-c1+c3+c5-c7)
+        tmp5 *= FIX_2_053119869;    // sqrt(2) * ( c1+c3-c5+c7)
+        tmp6 *= FIX_3_072711026;    // sqrt(2) * ( c1+c3+c5-c7)
+        tmp7 *= FIX_1_501321110;    // sqrt(2) * ( c1+c3-c5-c7)
+        z1 *= 0 - FIX_0_899976223;  // sqrt(2) * (c7-c3)
+        z2 *= 0 - FIX_2_562915447;  // sqrt(2) * (-c1-c3)
+        z3 *= 0 - FIX_1_961570560;  // sqrt(2) * (-c3-c5)
+        z4 *= 0 - FIX_0_390180644;  // sqrt(2) * (c5-c3)
+
+        z3 += z5;
+        z4 += z5;
+
+        n = tmp4 + z1 + z3 + 131072;
+        dataUnit[c7] = n >> 18;
+        if ((n < 0) && ((n & 0x3FFFF) !is 0)) dataUnit[c7]--;
+        n = tmp5 + z2 + z4 + 131072;
+        dataUnit[c5] = n >> 18;
+        if ((n < 0) && ((n & 0x3FFFF) !is 0)) dataUnit[c5]--;
+        n = tmp6 + z2 + z3 + 131072;
+        dataUnit[c3] = n >> 18;
+        if ((n < 0) && ((n & 0x3FFFF) !is 0)) dataUnit[c3]--;
+        n = tmp7 + z1 + z4 + 131072;
+        dataUnit[c1] = n >> 18;
+        if ((n < 0) && ((n & 0x3FFFF) !is 0)) dataUnit[c1]--;
+    }
+}
+void getAPP0() {
+    JPEGAppn appn = new JPEGAppn(inputStream);
+    if (!appn.verify()) {
+        SWT.error(SWT.ERROR_INVALID_IMAGE);
+    }
+}
+void getCOM() {
+    new JPEGComment(inputStream);
+}
+void getDAC() {
+    new JPEGArithmeticConditioningTable(inputStream);
+}
+void getDHT() {
+    JPEGHuffmanTable dht = new JPEGHuffmanTable(inputStream);
+    if (!dht.verify()) {
+        SWT.error(SWT.ERROR_INVALID_IMAGE);
+    }
+    if (acHuffmanTables is null) {
+        acHuffmanTables = new JPEGHuffmanTable[4];
+    }
+    if (dcHuffmanTables is null) {
+        dcHuffmanTables = new JPEGHuffmanTable[4];
+    }
+    JPEGHuffmanTable[] dhtTables = dht.getAllTables();
+    for (int i = 0; i < dhtTables.length; i++) {
+        JPEGHuffmanTable dhtTable = dhtTables[i];
+        if (dhtTable.getTableClass() is 0) {
+            dcHuffmanTables[dhtTable.getTableIdentifier()] = dhtTable;
+        } else {
+            acHuffmanTables[dhtTable.getTableIdentifier()] = dhtTable;
+        }
+    }
+}
+void getDNL() {
+    new JPEGRestartInterval(inputStream);
+}
+void getDQT() {
+    JPEGQuantizationTable dqt = new JPEGQuantizationTable(inputStream);
+    int[][] currentTables = quantizationTables;
+    if (currentTables is null) {
+        currentTables = new int[][](4);
+    }
+    int[] dqtTablesKeys = dqt.getQuantizationTablesKeys();
+    int[][] dqtTablesValues = dqt.getQuantizationTablesValues();
+    for (int i = 0; i < dqtTablesKeys.length; i++) {
+        int index = dqtTablesKeys[i];
+        currentTables[index] = dqtTablesValues[i];
+    }
+    quantizationTables = currentTables;
+}
+void getDRI() {
+    JPEGRestartInterval dri = new JPEGRestartInterval(inputStream);
+    if (!dri.verify()) {
+        SWT.error(SWT.ERROR_INVALID_IMAGE);
+    }
+    restartInterval = dri.getRestartInterval();
+}
+void inverseDCT(int[] dataUnit) {
+    for (int row = 0; row < 8; row++) {
+        int rIndex = row * DCTSIZE;
+        /**
+         * Due to quantization, we will usually find that many of the input
+         * coefficients are zero, especially the AC terms.  We can exploit this
+         * by short-circuiting the IDCT calculation for any row in which all
+         * the AC terms are zero.  In that case each output is equal to the
+         * DC coefficient (with scale factor as needed).
+         * With typical images and quantization tables, half or more of the
+         * row DCT calculations can be simplified this way.
+         */
+        if (isZeroInRow(dataUnit, rIndex)) {
+            int dcVal = dataUnit[rIndex] << 2;
+            for (int i = rIndex + 7; i >= rIndex; i--) {
+                dataUnit[i] = dcVal;
+            }
+        } else {
+            /**
+             * Even part: reverse the even part of the forward DCT.
+             * The rotator is sqrt(2)*c(-6).
+             */
+            int z2 = dataUnit[rIndex + 2];
+            int z3 = dataUnit[rIndex + 6];
+            int z1 = (z2 + z3) * FIX_0_541196100;
+            int tmp2 = z1 + (z3 * (0 - FIX_1_847759065));
+            int tmp3 = z1 + (z2 * FIX_0_765366865);
+            int tmp0 = (dataUnit[rIndex] + dataUnit[rIndex + 4]) << 13;
+            int tmp1 = (dataUnit[rIndex] - dataUnit[rIndex + 4]) << 13;
+            int tmp10 = tmp0 + tmp3;
+            int tmp13 = tmp0 - tmp3;
+            int tmp11 = tmp1 + tmp2;
+            int tmp12 = tmp1 - tmp2;
+            /**
+             * Odd part per figure 8; the matrix is unitary and hence its
+             * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively.
+             */
+            tmp0 = dataUnit[rIndex + 7];
+            tmp1 = dataUnit[rIndex + 5];
+            tmp2 = dataUnit[rIndex + 3];
+            tmp3 = dataUnit[rIndex + 1];
+            z1 = tmp0 + tmp3;
+            z2 = tmp1 + tmp2;
+            z3 = tmp0 + tmp2;
+            int z4 = tmp1 + tmp3;
+            int z5 = (z3 + z4) * FIX_1_175875602; /* sqrt(2) * c3 */
+
+            tmp0 *= FIX_0_298631336;        /* sqrt(2) * (-c1+c3+c5-c7) */
+            tmp1 *= FIX_2_053119869;        /* sqrt(2) * ( c1+c3-c5+c7) */
+            tmp2 *= FIX_3_072711026;        /* sqrt(2) * ( c1+c3+c5-c7) */
+            tmp3 *= FIX_1_501321110;        /* sqrt(2) * ( c1+c3-c5-c7) */
+            z1 *= 0 - FIX_0_899976223;  /* sqrt(2) * (c7-c3) */
+            z2 *= 0 - FIX_2_562915447;  /* sqrt(2) * (-c1-c3) */
+            z3 *= 0 - FIX_1_961570560;  /* sqrt(2) * (-c3-c5) */
+            z4 *= 0 - FIX_0_390180644;  /* sqrt(2) * (c5-c3) */
+
+            z3 += z5;
+            z4 += z5;
+            tmp0 += z1 + z3;
+            tmp1 += z2 + z4;
+            tmp2 += z2 + z3;
+            tmp3 += z1 + z4;
+
+            dataUnit[rIndex] = (tmp10 + tmp3 + 1024) >> 11;
+            dataUnit[rIndex + 7] = (tmp10 - tmp3 + 1024) >> 11;
+            dataUnit[rIndex + 1] = (tmp11 + tmp2 + 1024) >> 11;
+            dataUnit[rIndex + 6] = (tmp11 - tmp2 + 1024) >> 11;
+            dataUnit[rIndex + 2] = (tmp12 + tmp1 + 1024) >> 11;
+            dataUnit[rIndex + 5] = (tmp12 - tmp1 + 1024) >> 11;
+            dataUnit[rIndex + 3] = (tmp13 + tmp0 + 1024) >> 11;
+            dataUnit[rIndex + 4] = (tmp13 - tmp0 + 1024) >> 11;
+         }
+    }
+    /**
+     * Pass 2: process columns.
+     * Note that we must descale the results by a factor of 8 is 2**3,
+     * and also undo the PASS1_BITS scaling.
+     */
+    for (int col = 0; col < 8; col++) {
+        int c0 = col;
+        int c1 = col + 8;
+        int c2 = col + 16;
+        int c3 = col + 24;
+        int c4 = col + 32;
+        int c5 = col + 40;
+        int c6 = col + 48;
+        int c7 = col + 56;
+        if (isZeroInColumn(dataUnit, col)) {
+            int dcVal = (dataUnit[c0] + 16) >> 5;
+            dataUnit[c0] = dcVal;
+            dataUnit[c1] = dcVal;
+            dataUnit[c2] = dcVal;
+            dataUnit[c3] = dcVal;
+            dataUnit[c4] = dcVal;
+            dataUnit[c5] = dcVal;
+            dataUnit[c6] = dcVal;
+            dataUnit[c7] = dcVal;
+        } else {
+            /**
+             * Even part: reverse the even part of the forward DCT.
+             * The rotator is sqrt(2)*c(-6).
+             */
+            int z0 = dataUnit[c0];
+            int z2 = dataUnit[c2];
+            int z3 = dataUnit[c6];
+            int z4 = dataUnit[c4];
+            int z1 = (z2 + z3) * FIX_0_541196100;
+            int tmp2 = z1 + (z3 * (0 - FIX_1_847759065));
+            int tmp3 = z1 + (z2 * FIX_0_765366865);
+            int tmp0 = (z0 + z4) << 13;
+            int tmp1 = (z0 - z4) << 13;
+            int tmp10 = tmp0 + tmp3;
+            int tmp13 = tmp0 - tmp3;
+            int tmp11 = tmp1 + tmp2;
+            int tmp12 = tmp1 - tmp2;
+            /**
+             * Odd part per figure 8; the matrix is unitary and hence its
+             * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively.
+             */
+            tmp0 = dataUnit[c7];
+            tmp1 = dataUnit[c5];
+            tmp2 = dataUnit[c3];
+            tmp3 = dataUnit[c1];
+            z1 = tmp0 + tmp3;
+            z2 = tmp1 + tmp2;
+            z3 = tmp0 + tmp2;
+            z4 = tmp1 + tmp3;
+            z0 = (z3 + z4) * FIX_1_175875602;   /* sqrt(2) * c3 */
+
+            tmp0 *= FIX_0_298631336;        /* sqrt(2) * (-c1+c3+c5-c7) */
+            tmp1 *= FIX_2_053119869;        /* sqrt(2) * ( c1+c3-c5+c7) */
+            tmp2 *= FIX_3_072711026;        /* sqrt(2) * ( c1+c3+c5-c7) */
+            tmp3 *= FIX_1_501321110;        /* sqrt(2) * ( c1+c3-c5-c7) */
+            z1 *= 0 - FIX_0_899976223;  /* sqrt(2) * (c7-c3) */
+            z2 *= 0 - FIX_2_562915447;  /* sqrt(2) * (-c1-c3) */
+            z3 *= 0 - FIX_1_961570560;  /* sqrt(2) * (-c3-c5) */
+            z4 *= 0 - FIX_0_390180644;  /* sqrt(2) * (c5-c3) */
+
+            z3 += z0;
+            z4 += z0;
+
+            tmp0 += z1 + z3;
+            tmp1 += z2 + z4;
+            tmp2 += z2 + z3;
+            tmp3 += z1 + z4;
+
+            /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
+            dataUnit[c0] = (tmp10 + tmp3 + 131072) >> 18;
+            dataUnit[c7] = (tmp10 - tmp3 + 131072) >> 18;
+            dataUnit[c1] = (tmp11 + tmp2 + 131072) >> 18;
+            dataUnit[c6] = (tmp11 - tmp2 + 131072) >> 18;
+            dataUnit[c2] = (tmp12 + tmp1 + 131072) >> 18;
+            dataUnit[c5] = (tmp12 - tmp1 + 131072) >> 18;
+            dataUnit[c3] = (tmp13 + tmp0 + 131072) >> 18;
+            dataUnit[c4] = (tmp13 - tmp0 + 131072) >> 18;
+        }
+    }
+}
+override bool isFileFormat(LEDataInputStream stream) {
+    try {
+        JPEGStartOfImage soi = new JPEGStartOfImage(stream);
+        stream.unread(soi.reference);
+        return soi.verify();  // we no longer check for appN
+    } catch (Exception e) {
+        return false;
+    }
+}
+bool isZeroInColumn(int[] dataUnit, int col) {
+    return dataUnit[col + 8] is 0 && dataUnit[col + 16] is 0
+            && dataUnit[col + 24] is 0 && dataUnit[col + 32] is 0
+            && dataUnit[col + 40] is 0 && dataUnit[col + 48] is 0
+            && dataUnit[col + 56] is 0;
+}
+bool isZeroInRow(int[] dataUnit, int rIndex) {
+    return dataUnit[rIndex + 1] is 0 && dataUnit[rIndex + 2] is 0
+            && dataUnit[rIndex + 3] is 0 && dataUnit[rIndex + 4] is 0
+            && dataUnit[rIndex + 5] is 0 && dataUnit[rIndex + 6] is 0
+            && dataUnit[rIndex + 7] is 0;
+}
+override ImageData[] loadFromByteStream() {
+    //TEMPORARY CODE
+    //PORTING_FIXME
+    if (/+System.getProperty("org.eclipse.swt.internal.image.JPEGFileFormat_3.2") is null+/ true ) {
+        return JPEGDecoder.loadFromByteStream(inputStream, loader);
+    }
+    JPEGStartOfImage soi = new JPEGStartOfImage(inputStream);
+    if (!soi.verify()) SWT.error(SWT.ERROR_INVALID_IMAGE);
+    restartInterval = 0;
+
+    /* Process the tables preceding the frame header. */
+    processTables();
+
+    /* Start of Frame. */
+    frameHeader = new JPEGFrameHeader(inputStream);
+    if (!frameHeader.verify()) SWT.error(SWT.ERROR_INVALID_IMAGE);
+    imageWidth = frameHeader.getSamplesPerLine();
+    imageHeight = frameHeader.getNumberOfLines();
+    maxH = frameHeader.getMaxHFactor();
+    maxV = frameHeader.getMaxVFactor();
+    int mcuWidth = maxH * DCTSIZE;
+    int mcuHeight = maxV * DCTSIZE;
+    interleavedMcuCols = (imageWidth + mcuWidth - 1) / mcuWidth;
+    interleavedMcuRows = (imageHeight + mcuHeight - 1) / mcuHeight;
+    progressive = frameHeader.isProgressive();
+    samplePrecision = frameHeader.getSamplePrecision();
+    nComponents = frameHeader.getNumberOfImageComponents();
+    frameComponents = frameHeader.componentParameters;
+    componentIds = frameHeader.componentIdentifiers;
+    imageComponents = new byte[][](nComponents);
+    if (progressive) {
+        // Progressive jpeg: need to keep all of the data units.
+        dataUnits = new int[][][](nComponents);
+    } else {
+        // Sequential jpeg: only need one data unit.
+        dataUnit = new int[8 * 8];
+    }
+    for (int i = 0; i < nComponents; i++) {
+        int[] frameComponent = frameComponents[componentIds[i]];
+        int bufferSize = frameComponent[CW] * frameComponent[CH];
+        imageComponents[i] = new byte[bufferSize];
+        if (progressive) {
+            dataUnits[i] = new int[][](bufferSize);
+        }
+    }
+
+    /* Process the tables preceding the scan header. */
+    processTables();
+
+    /* Start of Scan. */
+    scanHeader = new JPEGScanHeader(inputStream);
+    if (!scanHeader.verify()) SWT.error(SWT.ERROR_INVALID_IMAGE);
+
+    /* Process scan(s) and further tables until EOI. */
+    int progressiveScanCount = 0;
+    bool done = false;
+    while(!done) {
+        resetInputBuffer();
+        precedingDCs = new int[4];
+        decodeScan();
+        if (progressive && loader.hasListeners()) {
+            ImageData imageData = createImageData();
+            loader.notifyListeners(new ImageLoaderEvent(loader, imageData, progressiveScanCount, false));
+            progressiveScanCount++;
+        }
+
+        /* Unread any buffered data before looking for tables again. */
+        int delta = 512 - bufferCurrentPosition - 1;
+        if (delta > 0) {
+            byte[] unreadBuffer = new byte[delta];
+            System.arraycopy(dataBuffer, bufferCurrentPosition + 1, unreadBuffer, 0, delta);
+            try {
+                inputStream.unread(unreadBuffer);
+            } catch (IOException e) {
+                SWT.error(SWT.ERROR_IO, e);
+            }
+        }
+
+        /* Process the tables preceding the next scan header. */
+        JPEGSegment jpegSegment = processTables();
+        if (jpegSegment is null || jpegSegment.getSegmentMarker() is EOI) {
+            done = true;
+        } else {
+            scanHeader = new JPEGScanHeader(inputStream);
+            if (!scanHeader.verify()) SWT.error(SWT.ERROR_INVALID_IMAGE);
+        }
+    }
+
+    if (progressive) {
+        for (int ymcu = 0; ymcu < interleavedMcuRows; ymcu++) {
+            for (int xmcu = 0; xmcu < interleavedMcuCols; xmcu++) {
+                for (int iComp = 0; iComp < nComponents; iComp++) {
+                    int[] frameComponent = frameComponents[componentIds[iComp]];
+                    int hi = frameComponent[HI];
+                    int vi = frameComponent[VI];
+                    int compWidth = frameComponent[CW];
+                    for (int ivi = 0; ivi < vi; ivi++) {
+                        for (int ihi = 0; ihi < hi; ihi++) {
+                            int index = (ymcu * vi + ivi) * compWidth + xmcu * hi + ihi;
+                            dataUnit = dataUnits[iComp][index];
+                            dequantize(dataUnit, iComp);
+                            inverseDCT(dataUnit);
+                            storeData(dataUnit, iComp, xmcu, ymcu, hi, ihi, vi, ivi);
+                        }
+                    }
+                }
+            }
+        }
+        dataUnits = null; // release memory
+    }
+    ImageData imageData = createImageData();
+    if (progressive && loader.hasListeners()) {
+        loader.notifyListeners(new ImageLoaderEvent(loader, imageData, progressiveScanCount, true));
+    }
+    return [imageData];
+}
+ImageData createImageData() {
+    return ImageData.internal_new(
+        imageWidth,
+        imageHeight,
+        nComponents * samplePrecision,
+        setUpPalette(),
+        nComponents is 1 ? 4 : 1,
+        decodeImageComponents(),
+        0,
+        null,
+        null,
+        -1,
+        -1,
+        SWT.IMAGE_JPEG,
+        0,
+        0,
+        0,
+        0);
+}
+int nextBit() {
+    if (currentBitCount !is 0) {
+        currentBitCount--;
+        currentByte *= 2;
+        if (currentByte > 255) {
+            currentByte -= 256;
+            return 1;
+        } else {
+            return 0;
+        }
+    }
+    bufferCurrentPosition++;
+    if (bufferCurrentPosition >= 512) {
+        resetInputBuffer();
+        bufferCurrentPosition = 0;
+    }
+    currentByte = dataBuffer[bufferCurrentPosition] & 0xFF;
+    currentBitCount = 8;
+    byte nextByte;
+    if (bufferCurrentPosition is 511) {
+        resetInputBuffer();
+        currentBitCount = 8;
+        nextByte = dataBuffer[0];
+    } else {
+        nextByte = dataBuffer[bufferCurrentPosition + 1];
+    }
+    if (currentByte is 0xFF) {
+        if (nextByte is 0) {
+            bufferCurrentPosition ++;
+            currentBitCount--;
+            currentByte *= 2;
+            if (currentByte > 255) {
+                currentByte -= 256;
+                return 1;
+            } else {
+                return 0;
+            }
+        } else {
+            if ((nextByte & 0xFF) + 0xFF00 is DNL) {
+                getDNL();
+                return 0;
+            } else {
+                SWT.error(SWT.ERROR_INVALID_IMAGE);
+                return 0;
+            }
+        }
+    } else {
+        currentBitCount--;
+        currentByte *= 2;
+        if (currentByte > 255) {
+            currentByte -= 256;
+            return 1;
+        } else {
+            return 0;
+        }
+    }
+}
+void processRestartInterval() {
+    do {
+        bufferCurrentPosition++;
+        if (bufferCurrentPosition > 511) {
+            resetInputBuffer();
+            bufferCurrentPosition = 0;
+        }
+        currentByte = dataBuffer[bufferCurrentPosition] & 0xFF;
+    } while (currentByte !is 0xFF);
+    while (currentByte is 0xFF) {
+        bufferCurrentPosition++;
+        if (bufferCurrentPosition > 511) {
+            resetInputBuffer();
+            bufferCurrentPosition = 0;
+        }
+        currentByte = dataBuffer[bufferCurrentPosition] & 0xFF;
+    }
+    if (currentByte !is ((RST0 + nextRestartNumber) & 0xFF)) {
+        SWT.error(SWT.ERROR_INVALID_IMAGE);
+    }
+    bufferCurrentPosition++;
+    if (bufferCurrentPosition > 511) {
+        resetInputBuffer();
+        bufferCurrentPosition = 0;
+    }
+    currentByte = dataBuffer[bufferCurrentPosition] & 0xFF;
+    currentBitCount = 8;
+    restartsToGo = restartInterval;
+    nextRestartNumber = (nextRestartNumber + 1) & 0x7;
+    precedingDCs = new int[4];
+    eobrun = 0;
+}
+/* Process all markers until a frame header, scan header, or EOI is found. */
+JPEGSegment processTables() {
+    while (true) {
+        JPEGSegment jpegSegment = seekUnspecifiedMarker(inputStream);
+        if (jpegSegment is null) return null;
+        JPEGFrameHeader sof = new JPEGFrameHeader(jpegSegment.reference);
+        if (sof.verify()) {
+            return jpegSegment;
+        }
+        int marker = jpegSegment.getSegmentMarker();
+        switch (marker) {
+            case SOI: // there should only be one SOI per file
+                SWT.error(SWT.ERROR_INVALID_IMAGE);
+            case EOI:
+            case SOS:
+                return jpegSegment;
+            case DQT:
+                getDQT();
+                break;
+            case DHT:
+                getDHT();
+                break;
+            case DAC:
+                getDAC();
+                break;
+            case DRI:
+                getDRI();
+                break;
+            case APP0:
+                getAPP0();
+                break;
+            case COM:
+                getCOM();
+                break;
+            default:
+                skipSegmentFrom(inputStream);
+
+        }
+    }
+}
+void quantizeData(int[] dataUnit, int iComp) {
+    int[] qTable = quantizationTables[frameComponents[componentIds[iComp]][TQI]];
+    for (int i = 0; i < dataUnit.length; i++) {
+        int zzIndex = ZigZag8x8[i];
+        int data = dataUnit[zzIndex];
+        int absData = data < 0 ? 0 - data : data;
+        int qValue = qTable[i];
+        int q2 = qValue >> 1;
+        absData += q2;
+        if (absData < qValue) {
+            dataUnit[zzIndex] = 0;
+        } else {
+            absData /= qValue;
+            if (data >= 0) {
+                dataUnit[zzIndex] = absData;
+            } else {
+                dataUnit[zzIndex] = 0 - absData;
+            }
+        }
+    }
+}
+int receive(int nBits) {
+    int v = 0;
+    for (int i = 0; i < nBits; i++) {
+        v = v * 2 + nextBit();
+    }
+    return v;
+}
+void resetInputBuffer() {
+    if (dataBuffer is null) {
+        dataBuffer = new byte[512];
+    }
+    try {
+        inputStream.read(dataBuffer);
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+    currentBitCount = 0;
+    bufferCurrentPosition = -1;
+}
+void resetOutputBuffer() {
+    if (dataBuffer is null) {
+        dataBuffer = new byte[512];
+    } else {
+        try {
+            outputStream.write(dataBuffer, 0, bufferCurrentPosition);
+        } catch (IOException e) {
+            SWT.error(SWT.ERROR_IO, e);
+        }
+    }
+    bufferCurrentPosition = 0;
+}
+static JPEGSegment seekUnspecifiedMarker(LEDataInputStream byteStream) {
+    byte[] byteArray = new byte[2];
+    try {
+        while (true) {
+            if (byteStream.read(byteArray, 0, 1) !is 1) return null;
+            if (byteArray[0] is cast(byte) 0xFF) {
+                if (byteStream.read(byteArray, 1, 1) !is 1) return null;
+                if (byteArray[1] !is cast(byte) 0xFF && byteArray[1] !is 0) {
+                    byteStream.unread(byteArray);
+                    return new JPEGSegment(byteArray);
+                }
+            }
+        }
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+    return null;
+}
+PaletteData setUpPalette() {
+    if (nComponents is 1) {
+        RGB[] entries = new RGB[256];
+        for (int i = 0; i < 256; i++) {
+            entries[i] = new RGB(i, i, i);
+        }
+        return new PaletteData(entries);
+    }
+    return new PaletteData(0xFF, 0xFF00, 0xFF0000);
+}
+static void skipSegmentFrom(LEDataInputStream byteStream) {
+    try {
+        byte[] byteArray = new byte[4];
+        JPEGSegment jpegSegment = new JPEGSegment(byteArray);
+
+        if (byteStream.read(byteArray) !is byteArray.length) {
+            SWT.error(SWT.ERROR_INVALID_IMAGE);
+        }
+        if (!(byteArray[0] is -1 && byteArray[1] !is 0 && byteArray[1] !is -1)) {
+            SWT.error(SWT.ERROR_INVALID_IMAGE);
+        }
+        int delta = jpegSegment.getSegmentLength() - 2;
+        byteStream.skip(delta);
+    } catch (Exception e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+}
+void storeData(int[] dataUnit, int iComp, int xmcu, int ymcu, int hi, int ihi, int vi, int ivi) {
+    byte[] compImage = imageComponents[iComp];
+    int[] frameComponent = frameComponents[componentIds[iComp]];
+    int compWidth = frameComponent[CW];
+    int destIndex = ((ymcu * vi + ivi) * compWidth * DCTSIZE) + ((xmcu * hi + ihi) * DCTSIZE);
+    int srcIndex = 0;
+    for (int i = 0; i < DCTSIZE; i++) {
+        for (int col = 0; col < DCTSIZE; col++) {
+            int x = dataUnit[srcIndex] + 128;
+            if (x < 0) {
+                x = 0;
+            } else {
+                if (x > 255) x = 255;
+            }
+            compImage[destIndex + col] = cast(byte)x;
+            srcIndex++;
+        }
+        destIndex += compWidth;
+    }
+}
+override void unloadIntoByteStream(ImageLoader loader) {
+    ImageData image = loader.data[0];
+    if (!(new JPEGStartOfImage()).writeToStream(outputStream)) {
+        SWT.error(SWT.ERROR_IO);
+    }
+    JPEGAppn appn = new JPEGAppn([cast(byte)0xFF, cast(byte)0xE0, 0, 0x10, 0x4A, 0x46, 0x49, 0x46, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0]);
+    if (!appn.writeToStream(outputStream)) {
+        SWT.error(SWT.ERROR_IO);
+    }
+    quantizationTables = new int[][](4);
+    JPEGQuantizationTable chromDQT = JPEGQuantizationTable.defaultChrominanceTable();
+    chromDQT.scaleBy(encoderQFactor);
+    int[] jpegDQTKeys = chromDQT.getQuantizationTablesKeys();
+    int[][] jpegDQTValues = chromDQT.getQuantizationTablesValues();
+    for (int i = 0; i < jpegDQTKeys.length; i++) {
+        quantizationTables[jpegDQTKeys[i]] = jpegDQTValues[i];
+    }
+    JPEGQuantizationTable lumDQT = JPEGQuantizationTable.defaultLuminanceTable();
+    lumDQT.scaleBy(encoderQFactor);
+    jpegDQTKeys = lumDQT.getQuantizationTablesKeys();
+    jpegDQTValues = lumDQT.getQuantizationTablesValues();
+    for (int i = 0; i < jpegDQTKeys.length; i++) {
+        quantizationTables[jpegDQTKeys[i]] = jpegDQTValues[i];
+    }
+    if (!lumDQT.writeToStream(outputStream)) {
+        SWT.error(SWT.ERROR_IO);
+    }
+    if (!chromDQT.writeToStream(outputStream)) {
+        SWT.error(SWT.ERROR_IO);
+    }
+    int frameLength, scanLength, precision;
+    int[][] frameParams, scanParams;
+    if (image.depth is 1) {
+        frameLength = 11;
+        frameParams = new int[][](1);
+        frameParams[0] = [1, 1, 1, 0, 0];
+        scanParams = new int[][](1);
+        scanParams[0] = [0, 0];
+        scanLength = 8;
+        nComponents = 1;
+        precision = 1;
+    } else {
+        frameLength = 17;
+        frameParams = new int[][](3);
+        frameParams[0] = [0, 2, 2, 0, 0];
+        frameParams[1] = [1, 1, 1, 0, 0];
+        frameParams[2] = [1, 1, 1, 0, 0];
+        scanParams = new int[][](3);
+        scanParams[0] = [0, 0];
+        scanParams[1] = [1, 1];
+        scanParams[2] = [1, 1];
+        scanLength = 12;
+        nComponents = 3;
+        precision = 8;
+    }
+    imageWidth = image.width;
+    imageHeight = image.height;
+    frameHeader = new JPEGFrameHeader(new byte[19]);
+    frameHeader.setSegmentMarker(SOF0);
+    frameHeader.setSegmentLength(frameLength);
+    frameHeader.setSamplePrecision(precision);
+    frameHeader.setSamplesPerLine(imageWidth);
+    frameHeader.setNumberOfLines(imageHeight);
+    frameHeader.setNumberOfImageComponents(nComponents);
+    frameHeader.componentParameters = frameParams;
+    frameHeader.componentIdentifiers = [0, 1, 2];
+    frameHeader.initializeContents();
+    if (!frameHeader.writeToStream(outputStream)) {
+        SWT.error(SWT.ERROR_IO);
+    }
+    frameComponents = frameParams;
+    componentIds = frameHeader.componentIdentifiers;
+    maxH = frameHeader.getMaxHFactor();
+    maxV = frameHeader.getMaxVFactor();
+    int mcuWidth = maxH * DCTSIZE;
+    int mcuHeight = maxV * DCTSIZE;
+    interleavedMcuCols = (imageWidth + mcuWidth - 1) / mcuWidth;
+    interleavedMcuRows = (imageHeight + mcuHeight - 1) / mcuHeight;
+    acHuffmanTables = new JPEGHuffmanTable[4];
+    dcHuffmanTables = new JPEGHuffmanTable[4];
+    JPEGHuffmanTable[] dhtTables = [
+        JPEGHuffmanTable.getDefaultDCLuminanceTable(),
+        JPEGHuffmanTable.getDefaultDCChrominanceTable(),
+        JPEGHuffmanTable.getDefaultACLuminanceTable(),
+        JPEGHuffmanTable.getDefaultACChrominanceTable()
+    ];
+    for (int i = 0; i < dhtTables.length; i++) {
+        JPEGHuffmanTable dhtTable = dhtTables[i];
+        if (!dhtTable.writeToStream(outputStream)) {
+            SWT.error(SWT.ERROR_IO);
+        }
+        JPEGHuffmanTable[] allTables = dhtTable.getAllTables();
+        for (int j = 0; j < allTables.length; j++) {
+            JPEGHuffmanTable huffmanTable = allTables[j];
+            if (huffmanTable.getTableClass() is 0) {
+                dcHuffmanTables[huffmanTable.getTableIdentifier()] = huffmanTable;
+            } else {
+                acHuffmanTables[huffmanTable.getTableIdentifier()] = huffmanTable;
+            }
+        }
+    }
+    precedingDCs = new int[4];
+    scanHeader = new JPEGScanHeader(new byte[14]);
+    scanHeader.setSegmentMarker(SOS);
+    scanHeader.setSegmentLength(scanLength);
+    scanHeader.setNumberOfImageComponents(nComponents);
+    scanHeader.setStartOfSpectralSelection(0);
+    scanHeader.setEndOfSpectralSelection(63);
+    scanHeader.componentParameters = scanParams;
+    scanHeader.initializeContents();
+    if (!scanHeader.writeToStream(outputStream)) {
+        SWT.error(SWT.ERROR_IO);
+    }
+    convertImageToYCbCr(image);
+    resetOutputBuffer();
+    currentByte = 0;
+    currentBitCount = 0;
+    encodeScan();
+    if (!(new JPEGEndOfImage()).writeToStream(outputStream)) {
+        SWT.error(SWT.ERROR_IO);
+    }
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGFixedSizeSegment.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.JPEGFixedSizeSegment;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.image.JPEGSegment;
+import org.eclipse.swt.internal.image.LEDataInputStream;
+
+import tango.core.Exception;
+
+
+abstract class JPEGFixedSizeSegment : JPEGSegment {
+
+    public this() {
+        reference = new byte[fixedSize()];
+        setSegmentMarker(signature());
+    }
+
+    public this(byte[] reference) {
+        super(reference);
+    }
+
+    public this(LEDataInputStream byteStream) {
+        reference = new byte[fixedSize()];
+        try {
+            byteStream.read(reference);
+        } catch (Exception e) {
+            SWT.error(SWT.ERROR_IO, e);
+        }
+    }
+
+    abstract public int fixedSize();
+
+    public override int getSegmentLength() {
+        return fixedSize() - 2;
+    }
+
+    public override void setSegmentLength(int length) {
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGFrameHeader.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,220 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.JPEGFrameHeader;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.image.JPEGVariableSizeSegment;
+import org.eclipse.swt.internal.image.JPEGFileFormat;
+import org.eclipse.swt.internal.image.LEDataInputStream;
+import java.lang.all;
+
+final class JPEGFrameHeader : JPEGVariableSizeSegment {
+    int maxVFactor;
+    int maxHFactor;
+    public int[] componentIdentifiers;
+    public int[][] componentParameters;
+
+    public this(byte[] reference) {
+        super(reference);
+    }
+
+    public this(LEDataInputStream byteStream) {
+        super(byteStream);
+        initializeComponentParameters();
+    }
+
+    public int getSamplePrecision() {
+        return reference[4] & 0xFF;
+    }
+
+    public int getNumberOfLines() {
+        return (reference[5] & 0xFF) << 8 | (reference[6] & 0xFF);
+    }
+
+    public int getSamplesPerLine() {
+        return (reference[7] & 0xFF) << 8 | (reference[8] & 0xFF);
+    }
+
+    public int getNumberOfImageComponents() {
+        return reference[9] & 0xFF;
+    }
+
+    public void setSamplePrecision(int precision) {
+        reference[4] = cast(byte)(precision & 0xFF);
+    }
+
+    public void setNumberOfLines(int anInteger) {
+        reference[5] = cast(byte)((anInteger & 0xFF00) >> 8);
+        reference[6] = cast(byte)(anInteger & 0xFF);
+    }
+
+    public void setSamplesPerLine(int samples) {
+        reference[7] = cast(byte)((samples & 0xFF00) >> 8);
+        reference[8] = cast(byte)(samples & 0xFF);
+    }
+
+    public void setNumberOfImageComponents(int anInteger) {
+        reference[9] = cast(byte)(anInteger & 0xFF);
+    }
+
+    public int getMaxHFactor() {
+        return maxHFactor;
+    }
+
+    public int getMaxVFactor() {
+        return maxVFactor;
+    }
+
+    public void setMaxHFactor(int anInteger) {
+        maxHFactor = anInteger;
+    }
+
+    public void setMaxVFactor(int anInteger) {
+        maxVFactor = anInteger;
+    }
+
+    /* Used when decoding. */
+    void initializeComponentParameters() {
+        int nf = getNumberOfImageComponents();
+        componentIdentifiers = new int[nf];
+        int[][] compSpecParams;
+        int hmax = 1;
+        int vmax = 1;
+        for (int i = 0; i < nf; i++) {
+            int ofs = i * 3 + 10;
+            int ci = reference[ofs] & 0xFF;
+            componentIdentifiers[i] = ci;
+            int hi = (reference[ofs + 1] & 0xFF) >> 4;
+            int vi = reference[ofs + 1] & 0xF;
+            int tqi = reference[ofs + 2] & 0xFF;
+            if (hi > hmax) {
+                hmax = hi;
+            }
+            if (vi > vmax) {
+                vmax = vi;
+            }
+            int[] compParam = new int[5];
+            compParam[0] = tqi;
+            compParam[1] = hi;
+            compParam[2] = vi;
+            if (compSpecParams.length <= ci) {
+                int[][] newParams = new int[][](ci + 1);
+                System.arraycopy(compSpecParams, 0, newParams, 0, compSpecParams.length);
+                compSpecParams = newParams;
+            }
+            compSpecParams[ci] = compParam;
+        }
+        int x = getSamplesPerLine();
+        int y = getNumberOfLines();
+        int[] multiples = [ 8, 16, 24, 32 ];
+        for (int i = 0; i < nf; i++) {
+            int[] compParam = compSpecParams[componentIdentifiers[i]];
+            int hi = compParam[1];
+            int vi = compParam[2];
+            int compWidth = (x * hi + hmax - 1) / hmax;
+            int compHeight = (y * vi + vmax - 1) / vmax;
+            int dsWidth = roundUpToMultiple(compWidth, multiples[hi - 1]);
+            int dsHeight = roundUpToMultiple(compHeight, multiples[vi - 1]);
+            compParam[3] = dsWidth;
+            compParam[4] = dsHeight;
+        }
+        setMaxHFactor(hmax);
+        setMaxVFactor(vmax);
+        componentParameters = compSpecParams;
+    }
+
+    /* Used when encoding. */
+    public void initializeContents() {
+        int nf = getNumberOfImageComponents();
+        if (nf is 0 || nf !is componentParameters.length) {
+            SWT.error(SWT.ERROR_INVALID_IMAGE);
+        }
+        int hmax = 0;
+        int vmax = 0;
+        int[][] compSpecParams = componentParameters;
+        for (int i = 0; i < nf; i++) {
+            int ofs = i * 3 + 10;
+            int[] compParam = compSpecParams[componentIdentifiers[i]];
+            int hi = compParam[1];
+            int vi = compParam[2];
+            if (hi * vi > 4) {
+                SWT.error(SWT.ERROR_INVALID_IMAGE);
+            }
+            reference[ofs] = cast(byte)(i + 1);
+            reference[ofs + 1] = cast(byte)(hi * 16 + vi);
+            reference[ofs + 2] = cast(byte)(compParam[0]);
+            if (hi > hmax) hmax = hi;
+            if (vi > vmax) vmax = vi;
+        }
+        int x = getSamplesPerLine();
+        int y = getNumberOfLines();
+        int[] multiples = [8, 16, 24, 32];
+        for (int i = 0; i < nf; i++) {
+            int[] compParam = compSpecParams[componentIdentifiers[i]];
+            int hi = compParam[1];
+            int vi = compParam[2];
+            int compWidth = (x * hi + hmax - 1) / hmax;
+            int compHeight = (y * vi + vmax - 1) / vmax;
+            int dsWidth = roundUpToMultiple(compWidth, multiples[hi - 1]);
+            int dsHeight = roundUpToMultiple(compHeight, multiples[vi - 1]);
+            compParam[3] = dsWidth;
+            compParam[4] = dsHeight;
+        }
+        setMaxHFactor(hmax);
+        setMaxVFactor(vmax);
+    }
+
+    int roundUpToMultiple(int anInteger, int mInteger) {
+        int a = anInteger + mInteger - 1;
+        return a - (a % mInteger);
+    }
+
+    /*
+     * Verify the information contained in the receiver is correct.
+     * Answer true if the header contains a valid marker. Otherwise,
+     * answer false. Valid Start Of Frame markers are:
+     *  SOF_0  - Baseline DCT, Huffman coding
+     *  SOF_1  - Extended sequential DCT, Huffman coding
+     *  SOF_2  - Progressive DCT, Huffman coding
+     *  SOF_3  - Lossless (sequential), Huffman coding
+     *  SOF_5  - Differential sequential, Huffman coding
+     *  SOF_6  - Differential progressive, Huffman coding
+     *  SOF_7  - Differential lossless, Huffman coding
+     *  SOF_9  - Extended sequential DCT, arithmetic coding
+     *  SOF_10 - Progressive DCT, arithmetic coding
+     *  SOF_11 - Lossless (sequential), arithmetic coding
+     *  SOF_13 - Differential sequential, arithmetic coding
+     *  SOF_14 - Differential progressive, arithmetic coding
+     *  SOF_15 - Differential lossless, arithmetic coding
+     */
+    public override bool verify() {
+        int marker = getSegmentMarker();
+        return (marker >= JPEGFileFormat.SOF0 && marker <= JPEGFileFormat.SOF3) ||
+            (marker >= JPEGFileFormat.SOF5 && marker <= JPEGFileFormat.SOF7) ||
+            (marker >= JPEGFileFormat.SOF9 && marker <= JPEGFileFormat.SOF11) ||
+            (marker >= JPEGFileFormat.SOF13 && marker <= JPEGFileFormat.SOF15);
+    }
+
+    public bool isProgressive() {
+        int marker = getSegmentMarker();
+        return marker is JPEGFileFormat.SOF2
+            || marker is JPEGFileFormat.SOF6
+            || marker is JPEGFileFormat.SOF10
+            || marker is JPEGFileFormat.SOF14;
+    }
+
+    public bool isArithmeticCoding() {
+        return getSegmentMarker() >= JPEGFileFormat.SOF9;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGHuffmanTable.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,271 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.JPEGHuffmanTable;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.image.JPEGVariableSizeSegment;
+import org.eclipse.swt.internal.image.LEDataInputStream;
+import org.eclipse.swt.internal.image.JPEGFileFormat;
+
+/**
+ * JPEGHuffmanTable class actually represents two types of object:
+ * 1) A DHT (Define Huffman Tables) segment, which may represent
+ *  as many as 4 Huffman tables. In this case, the tables are
+ *  stored in the allTables array.
+ * 2) A single Huffman table. In this case, the allTables array
+ *  will be null.
+ * The 'reference' field is stored in both types of object, but
+ * 'initialize' is only called if the object represents a DHT.
+ */
+final class JPEGHuffmanTable : JPEGVariableSizeSegment {
+    JPEGHuffmanTable[] allTables;
+    int tableClass;
+    int tableIdentifier;
+    int[] dhMaxCodes;
+    int[] dhMinCodes;
+    int[] dhValPtrs;
+    int[] dhValues;
+    int[] ehCodes;
+    byte[] ehCodeLengths;
+    static byte[] DCLuminanceTable = [
+        cast(byte)255, cast(byte)196, 0, 31, 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,
+        0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
+    ];
+    static byte[] DCChrominanceTable = [
+        cast(byte)255, cast(byte)196, 0, 31, 1, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
+        0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
+    ];
+    static byte[] ACLuminanceTable = [
+        cast(byte)255, cast(byte)196, 0, cast(byte)181, 16, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125,
+        1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20,
+        50, cast(byte)129, cast(byte)145, cast(byte)161, 8, 35, 66, cast(byte)177, cast(byte)193, 21, 82, cast(byte)209, cast(byte)240, 36, 51, 98,
+        114, cast(byte)130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53,
+        54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87,
+        88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118,
+        119, 120, 121, 122, cast(byte)131, cast(byte)132, cast(byte)133, cast(byte)134, cast(byte)135, cast(byte)136, cast(byte)137, cast(byte)138, cast(byte)146, cast(byte)147, cast(byte)148,
+        cast(byte)149, cast(byte)150, cast(byte)151, cast(byte)152, cast(byte)153, cast(byte)154, cast(byte)162, cast(byte)163, cast(byte)164, cast(byte)165, cast(byte)166, cast(byte)167, cast(byte)168, cast(byte)169, cast(byte)170,
+        cast(byte)178, cast(byte)179, cast(byte)180, cast(byte)181, cast(byte)182, cast(byte)183, cast(byte)184, cast(byte)185, cast(byte)186, cast(byte)194, cast(byte)195, cast(byte)196, cast(byte)197, cast(byte)198, cast(byte)199,
+        cast(byte)200, cast(byte)201, cast(byte)202, cast(byte)210, cast(byte)211, cast(byte)212, cast(byte)213, cast(byte)214, cast(byte)215, cast(byte)216, cast(byte)217, cast(byte)218, cast(byte)225, cast(byte)226, cast(byte)227,
+        cast(byte)228, cast(byte)229, cast(byte)230, cast(byte)231, cast(byte)232, cast(byte)233, cast(byte)234, cast(byte)241, cast(byte)242, cast(byte)243, cast(byte)244, cast(byte)245, cast(byte)246, cast(byte)247, cast(byte)248,
+        cast(byte)249, cast(byte)250
+    ];
+    static byte[] ACChrominanceTable = [
+        cast(byte)255, cast(byte)196, 0, cast(byte)181, 17, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0,
+        1, 2, 119, 0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34,
+        50, cast(byte)129, 8, 20, 66, cast(byte)145, cast(byte)161, cast(byte)177, cast(byte)193, 9, 35,
+        51, 82, cast(byte)240, 21, 98, 114, cast(byte)209, 10, 22, 36, 52, cast(byte)225, 37,
+        cast(byte)241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67,
+        68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102,
+        103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, cast(byte)130,
+        cast(byte)131, cast(byte)132, cast(byte)133, cast(byte)134, cast(byte)135, cast(byte)136, cast(byte)137,
+        cast(byte)138, cast(byte)146, cast(byte)147, cast(byte)148, cast(byte)149, cast(byte)150, cast(byte)151,
+        cast(byte)152, cast(byte)153, cast(byte)154, cast(byte)162, cast(byte)163, cast(byte)164, cast(byte)165,
+        cast(byte)166, cast(byte)167, cast(byte)168, cast(byte)169, cast(byte)170, cast(byte)178, cast(byte)179,
+        cast(byte)180, cast(byte)181, cast(byte)182, cast(byte)183, cast(byte)184, cast(byte)185, cast(byte)186,
+        cast(byte)194, cast(byte)195, cast(byte)196, cast(byte)197, cast(byte)198, cast(byte)199, cast(byte)200,
+        cast(byte)201, cast(byte)202, cast(byte)210, cast(byte)211, cast(byte)212, cast(byte)213, cast(byte)214,
+        cast(byte)215, cast(byte)216, cast(byte)217, cast(byte)218, cast(byte)226, cast(byte)227, cast(byte)228,
+        cast(byte)229, cast(byte)230, cast(byte)231, cast(byte)232, cast(byte)233, cast(byte)234, cast(byte)242,
+        cast(byte)243, cast(byte)244, cast(byte)245, cast(byte)246, cast(byte)247, cast(byte)248, cast(byte)249,
+        cast(byte)250
+    ];
+
+public this(byte[] reference) {
+    super(reference);
+}
+
+public this(LEDataInputStream byteStream) {
+    super(byteStream);
+    initialize();
+}
+
+public JPEGHuffmanTable[] getAllTables() {
+    return allTables;
+}
+
+public static JPEGHuffmanTable getDefaultACChrominanceTable() {
+    JPEGHuffmanTable result = new JPEGHuffmanTable(ACChrominanceTable);
+    result.initialize();
+    return result;
+}
+
+public static JPEGHuffmanTable getDefaultACLuminanceTable() {
+    JPEGHuffmanTable result = new JPEGHuffmanTable(ACLuminanceTable);
+    result.initialize();
+    return result;
+}
+
+public static JPEGHuffmanTable getDefaultDCChrominanceTable() {
+    JPEGHuffmanTable result = new JPEGHuffmanTable(DCChrominanceTable);
+    result.initialize();
+    return result;
+}
+
+public static JPEGHuffmanTable getDefaultDCLuminanceTable() {
+    JPEGHuffmanTable result = new JPEGHuffmanTable(DCLuminanceTable);
+    result.initialize();
+    return result;
+}
+
+public int[] getDhMaxCodes() {
+    return dhMaxCodes;
+}
+
+public int[] getDhMinCodes() {
+    return dhMinCodes;
+}
+
+public int[] getDhValPtrs() {
+    return dhValPtrs;
+}
+
+public int[] getDhValues() {
+    return dhValues;
+}
+
+public int getTableClass() {
+    return tableClass;
+}
+
+public int getTableIdentifier() {
+    return tableIdentifier;
+}
+
+void initialize() {
+    int totalLength = getSegmentLength() - 2;
+    int ofs = 4;
+    int[] bits = new int[16];
+    JPEGHuffmanTable[] huffTables = new JPEGHuffmanTable[8]; // maximum is 4 AC + 4 DC
+    int huffTableCount = 0;
+    while (totalLength > 0) {
+        int tc = (reference[ofs] & 0xFF) >> 4; // table class: AC (1) or DC (0)
+        int tid = reference[ofs] & 0xF; // table id: 0-1 baseline, 0-3 prog/ext
+        ofs++;
+
+        /* Read the 16 count bytes and add them together to get the table size. */
+        int count = 0;
+        for (int i = 0; i < bits.length; i++) {
+            int bCount = reference[ofs + i] & 0xFF;
+            bits[i] = bCount;
+            count += bCount;
+        }
+        ofs += 16;
+        totalLength -= 17;
+
+        /* Read the table. */
+        int[] huffVals = new int[count];
+        for (int i = 0; i < count; i++) {
+            huffVals[i] = reference[ofs + i] & 0xFF;
+        }
+        ofs += count;
+        totalLength -= count;
+
+        /* Calculate the lengths. */
+        int[] huffCodeLengths = new int[50]; // start with 50 and increment as needed
+        int huffCodeLengthsIndex = 0;
+        for (int i = 0; i < 16; i++) {
+            for (int j = 0; j < bits[i]; j++) {
+                if (huffCodeLengthsIndex >= huffCodeLengths.length) {
+                    int[] newHuffCodeLengths = new int[huffCodeLengths.length + 50];
+                    System.arraycopy(huffCodeLengths, 0, newHuffCodeLengths, 0, huffCodeLengths.length);
+                    huffCodeLengths = newHuffCodeLengths;
+                }
+                huffCodeLengths[huffCodeLengthsIndex] = i + 1;
+                huffCodeLengthsIndex++;
+            }
+        }
+
+        /* Truncate huffCodeLengths to the correct size. */
+        if (huffCodeLengthsIndex < huffCodeLengths.length) {
+            int[] newHuffCodeLengths = new int[huffCodeLengthsIndex];
+            System.arraycopy(huffCodeLengths, 0, newHuffCodeLengths, 0, huffCodeLengthsIndex);
+            huffCodeLengths = newHuffCodeLengths;
+        }
+
+        /* Calculate the Huffman codes. */
+        int[] huffCodes = new int[50]; // start with 50 and increment as needed
+        int huffCodesIndex = 0;
+        int k = 1;
+        int code = 0;
+        int si = huffCodeLengths[0];
+        int p = 0;
+        while (p < huffCodeLengthsIndex) {
+            while ((p < huffCodeLengthsIndex) && (huffCodeLengths[p] is si)) {
+                if (huffCodesIndex >= huffCodes.length) {
+                    int[] newHuffCodes = new int[huffCodes.length + 50];
+                    System.arraycopy(huffCodes, 0, newHuffCodes, 0, huffCodes.length);
+                    huffCodes = newHuffCodes;
+                }
+                huffCodes[huffCodesIndex] = code;
+                huffCodesIndex++;
+                code++;
+                p++;
+            }
+            code *= 2;
+            si++;
+        }
+
+        /* Truncate huffCodes to the correct size. */
+        if (huffCodesIndex < huffCodes.length) {
+            int[] newHuffCodes = new int[huffCodesIndex];
+            System.arraycopy(huffCodes, 0, newHuffCodes, 0, huffCodesIndex);
+            huffCodes = newHuffCodes;
+        }
+
+        /* Calculate the maximum and minimum codes */
+        k = 0;
+        int[] maxCodes = new int[16];
+        int[] minCodes = new int[16];
+        int[] valPtrs = new int[16];
+        for (int i = 0; i < 16; i++) {
+            int bSize = bits[i];
+            if (bSize is 0) {
+                maxCodes[i] = -1;
+            } else {
+                valPtrs[i] = k;
+                minCodes[i] = huffCodes[k];
+                k += bSize;
+                maxCodes[i] = huffCodes[k - 1];
+            }
+        }
+
+        /* Calculate the eHuffman codes and lengths. */
+        int[] eHuffCodes = new int[256];
+        byte[] eHuffSize = new byte[256];
+        for (int i = 0; i < huffCodesIndex; i++) {
+            eHuffCodes[huffVals[i]] = huffCodes[i];
+            eHuffSize[huffVals[i]] = cast(byte)huffCodeLengths[i];
+        }
+
+        /* Create the new JPEGHuffmanTable and add it to the allTables array. */
+        JPEGHuffmanTable dhtTable = new JPEGHuffmanTable(reference);
+        dhtTable.tableClass = tc;
+        dhtTable.tableIdentifier = tid;
+        dhtTable.dhValues = huffVals;
+        dhtTable.dhMinCodes = minCodes;
+        dhtTable.dhMaxCodes = maxCodes;
+        dhtTable.dhValPtrs = valPtrs;
+        dhtTable.ehCodes = eHuffCodes;
+        dhtTable.ehCodeLengths = eHuffSize;
+        huffTables[huffTableCount] = dhtTable;
+        huffTableCount++;
+    }
+    allTables = new JPEGHuffmanTable[huffTableCount];
+    System.arraycopy(huffTables, 0, allTables, 0, huffTableCount);
+}
+
+public override int signature() {
+    return JPEGFileFormat.DHT;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGQuantizationTable.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,173 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.JPEGQuantizationTable;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.image.LEDataInputStream;
+import org.eclipse.swt.internal.image.JPEGVariableSizeSegment;
+import org.eclipse.swt.internal.image.JPEGFileFormat;
+
+
+final class JPEGQuantizationTable : JPEGVariableSizeSegment {
+    public static byte[] DefaultLuminanceQTable = [
+        cast(byte)255, cast(byte)219, 0, 67, 0,
+        16, 11, 10, 16, 24, 40, 51, 61,
+        12, 12, 14, 19, 26, 58, 60, 55,
+        14, 13, 16, 24, 40, 57, 69, 56,
+        14, 17, 22, 29, 51, 87, 80, 62,
+        18, 22, 37, 56, 68, 109, 103, 77,
+        24, 35, 55, 64, 81, 104, 113, 92,
+        49, 64, 78, 87, 103, 121, 120, 101,
+        72, 92, 95, 98, 112, 100, 103, 99
+    ];
+    public static byte[] DefaultChrominanceQTable = [
+        cast(byte)255, cast(byte)219, 0, 67, 1,
+        17, 18, 24, 47, 99, 99, 99, 99,
+        18, 21, 26, 66, 99, 99, 99, 99,
+        24, 26, 56, 99, 99, 99, 99, 99,
+        47, 66, 99, 99, 99, 99, 99, 99,
+        99, 99, 99, 99, 99, 99, 99, 99,
+        99, 99, 99, 99, 99, 99, 99, 99,
+        99, 99, 99, 99, 99, 99, 99, 99,
+        99, 99, 99, 99, 99, 99, 99, 99
+    ];
+
+public this(byte[] reference) {
+    super(reference);
+}
+
+public this(LEDataInputStream byteStream) {
+    super(byteStream);
+}
+
+public static JPEGQuantizationTable defaultChrominanceTable() {
+    byte[] data = new byte[DefaultChrominanceQTable.length];
+    System.arraycopy(DefaultChrominanceQTable, 0, data, 0, data.length);
+    return new JPEGQuantizationTable(data);
+}
+
+public static JPEGQuantizationTable defaultLuminanceTable() {
+    byte[] data = new byte[DefaultLuminanceQTable.length];
+    System.arraycopy(DefaultLuminanceQTable, 0, data, 0, data.length);
+    return new JPEGQuantizationTable(data);
+}
+
+public int[] getQuantizationTablesKeys() {
+    int[] keys = new int[4];
+    int keysIndex = 0;
+    int totalLength = getSegmentLength() - 2;
+    int ofs = 4;
+    while (totalLength > 64) {
+        int tq = reference[ofs] & 0xF;
+        int pq = (reference[ofs] & 0xFF) >> 4;
+        if (pq is 0) {
+            ofs += 65;
+            totalLength -= 65;
+        } else {
+            ofs += 129;
+            totalLength -= 129;
+        }
+        if (keysIndex >= keys.length) {
+            int[] newKeys = new int[keys.length + 4];
+            System.arraycopy(keys, 0, newKeys, 0, keys.length);
+            keys = newKeys;
+        }
+        keys[keysIndex] = tq;
+        keysIndex++;
+    }
+    int[] newKeys = new int[keysIndex];
+    System.arraycopy(keys, 0, newKeys, 0, keysIndex);
+    return newKeys;
+}
+
+public int[][] getQuantizationTablesValues() {
+    int[][] values = new int[][](4);
+    int valuesIndex = 0;
+    int totalLength = getSegmentLength() - 2;
+    int ofs = 4;
+    while (totalLength > 64) {
+        int[] qk = new int[64];
+        int pq = (reference[ofs] & 0xFF) >> 4;
+        if (pq is 0) {
+            for (int i = 0; i < qk.length; i++) {
+                qk[i] = reference[ofs + i + 1] & 0xFF;
+            }
+            ofs += 65;
+            totalLength -= 65;
+        } else {
+            for (int i = 0; i < qk.length; i++) {
+                int idx = (i - 1) * 2 ;
+                qk[i] = (reference[ofs + idx + 1] & 0xFF) * 256 + (reference[ofs + idx + 2] & 0xFF);
+            }
+            ofs += 129;
+            totalLength -= 129;
+        }
+        if (valuesIndex >= values.length) {
+            int[][] newValues = new int[][](values.length + 4);
+            System.arraycopy(values, 0, newValues, 0, values.length);
+            values = newValues;
+        }
+        values[valuesIndex] = qk;
+        valuesIndex++;
+    }
+    int[][] newValues = new int[][](valuesIndex);
+    System.arraycopy(values, 0, newValues, 0, valuesIndex);
+    return newValues;
+}
+
+public void scaleBy(int qualityFactor) {
+    int qFactor = qualityFactor;
+    if (qFactor <= 0) {
+        qFactor = 1;
+    }
+    if (qFactor > 100) {
+        qFactor = 100;
+    }
+    if (qFactor < 50) {
+        qFactor = 5000 / qFactor;
+    } else {
+        qFactor = 200 - (qFactor * 2);
+    }
+    int totalLength = getSegmentLength() - 2;
+    int ofs = 4;
+    while (totalLength > 64) {
+//      int tq = reference[ofs] & 0xFF;
+        int pq = (reference[ofs] & 0xFF) >> 4;
+        if (pq is 0) {
+            for (int i = ofs + 1; i <= ofs + 64; i++) {
+                int temp = ((reference[i] & 0xFF) * qFactor + 50) / 100;
+                if (temp <= 0) temp = 1;
+                if (temp > 255) temp = 255;
+                reference[i] = cast(byte)temp;
+            }
+            ofs += 65;
+            totalLength -= 65;
+        } else {
+            for (int i = ofs + 1; i <= ofs + 128; i += 2) {
+                int temp = (((reference[i] & 0xFF) * 256 + (reference[i + 1] & 0xFF)) * qFactor + 50) / 100;
+                if (temp <= 0) temp = 1;
+                if (temp > 32767) temp = 32767;
+                reference[i] = cast(byte)(temp >> 8);
+                reference[i + 1] = cast(byte)(temp & 0xFF);
+            }
+            ofs += 129;
+            totalLength -= 129;
+        }
+    }
+}
+
+public override int signature() {
+    return JPEGFileFormat.DQT;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGRestartInterval.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.JPEGRestartInterval;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.image.JPEGFixedSizeSegment;
+import org.eclipse.swt.internal.image.LEDataInputStream;
+import org.eclipse.swt.internal.image.JPEGFileFormat;
+
+final class JPEGRestartInterval : JPEGFixedSizeSegment {
+
+    public this(LEDataInputStream byteStream) {
+        super(byteStream);
+    }
+
+    public override int signature() {
+        return JPEGFileFormat.DRI;
+    }
+
+    public int getRestartInterval() {
+        return ((reference[4] & 0xFF) << 8 | (reference[5] & 0xFF));
+    }
+
+    public override int fixedSize() {
+        return 6;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGScanHeader.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,128 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.JPEGScanHeader;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.image.JPEGVariableSizeSegment;
+import org.eclipse.swt.internal.image.LEDataInputStream;
+import org.eclipse.swt.internal.image.JPEGFileFormat;
+import java.lang.all;
+
+final class JPEGScanHeader : JPEGVariableSizeSegment {
+    public int[][] componentParameters;
+
+public this(byte[] reference) {
+    super(reference);
+}
+
+public this(LEDataInputStream byteStream) {
+    super(byteStream);
+    initializeComponentParameters();
+}
+
+public int getApproxBitPositionHigh() {
+    return reference[(2 * getNumberOfImageComponents()) + 7] >> 4;
+}
+
+public int getApproxBitPositionLow() {
+    return reference[(2 * getNumberOfImageComponents()) + 7] & 0xF;
+}
+
+public int getEndOfSpectralSelection() {
+    return reference[(2 * getNumberOfImageComponents()) + 6];
+}
+
+public int getNumberOfImageComponents() {
+    return reference[4];
+}
+
+public int getStartOfSpectralSelection() {
+    return reference[(2 * getNumberOfImageComponents()) + 5];
+}
+
+/* Used when decoding. */
+void initializeComponentParameters() {
+    int compCount = getNumberOfImageComponents();
+    componentParameters = null;
+    for (int i = 0; i < compCount; i++) {
+        int ofs = 5 + i * 2;
+        int cid = reference[ofs] & 0xFF;
+        int dc = (reference[ofs + 1] & 0xFF) >> 4;
+        int ac = reference[ofs + 1] & 0xF;
+        if (componentParameters.length <= cid) {
+            int[][] newParams = new int[][](cid + 1);
+            System.arraycopy(componentParameters, 0, newParams, 0, componentParameters.length);
+            componentParameters = newParams;
+        }
+        componentParameters[cid] = [ dc, ac ];
+    }
+}
+
+/* Used when encoding. */
+public void initializeContents() {
+    int compCount = getNumberOfImageComponents();
+    int[][] compSpecParams = componentParameters;
+    if (compCount is 0 || compCount !is compSpecParams.length) {
+        SWT.error(SWT.ERROR_INVALID_IMAGE);
+    }
+    for (int i = 0; i < compCount; i++) {
+        int ofs = i * 2 + 5;
+        int[] compParams = compSpecParams[i];
+        reference[ofs] = cast(byte)(i + 1);
+        reference[ofs + 1] = cast(byte)(compParams[0] * 16 + compParams[1]);
+    }
+}
+
+public void setEndOfSpectralSelection(int anInteger) {
+    reference[(2 * getNumberOfImageComponents()) + 6] = cast(byte)anInteger;
+}
+
+public void setNumberOfImageComponents(int anInteger) {
+    reference[4] = cast(byte)(anInteger & 0xFF);
+}
+
+public void setStartOfSpectralSelection(int anInteger) {
+    reference[(2 * getNumberOfImageComponents()) + 5] = cast(byte)anInteger;
+}
+
+public override int signature() {
+    return JPEGFileFormat.SOS;
+}
+
+public bool verifyProgressiveScan() {
+    int start = getStartOfSpectralSelection();
+    int end = getEndOfSpectralSelection();
+    int low = getApproxBitPositionLow();
+    int high = getApproxBitPositionHigh();
+    int count = getNumberOfImageComponents();
+    if ((start is 0 && end is 00) || (start <= end && end <= 63)) {
+        if (low <= 13 && high <= 13 && (high is 0 || high is low + 1)) {
+            return start is 0 || (start > 0 && count is 1);
+        }
+    }
+    return false;
+}
+
+public bool isACProgressiveScan() {
+    return getStartOfSpectralSelection() !is 0 && getEndOfSpectralSelection() !is 0;
+}
+
+public bool isDCProgressiveScan() {
+    return getStartOfSpectralSelection() is 0 && getEndOfSpectralSelection() is 0;
+}
+
+public bool isFirstScan() {
+    return getApproxBitPositionHigh() is 0;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGSegment.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.JPEGSegment;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.image.LEDataOutputStream;
+
+import tango.core.Exception;
+
+class JPEGSegment {
+    public byte[] reference;
+
+    this() {
+    }
+
+    public this(byte[] reference) {
+        this.reference = reference;
+    }
+
+    public int signature() {
+        return 0;
+    }
+
+    public bool verify() {
+        return getSegmentMarker() is signature();
+    }
+
+    public int getSegmentMarker() {
+        return ((reference[0] & 0xFF) << 8 | (reference[1] & 0xFF));
+    }
+
+    public void setSegmentMarker(int marker) {
+        reference[0] = cast(byte)((marker & 0xFF00) >> 8);
+        reference[1] = cast(byte)(marker & 0xFF);
+    }
+
+    public int getSegmentLength() {
+        return ((reference[2] & 0xFF) << 8 | (reference[3] & 0xFF));
+    }
+
+    public void setSegmentLength(int length) {
+        reference[2] = cast(byte)((length & 0xFF00) >> 8);
+        reference[3] = cast(byte)(length & 0xFF);
+    }
+
+    public bool writeToStream(LEDataOutputStream byteStream) {
+        try {
+            byteStream.write(reference);
+            return true;
+        } catch (Exception e) {
+            return false;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGStartOfImage.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.JPEGStartOfImage;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.image.JPEGFixedSizeSegment;
+import org.eclipse.swt.internal.image.LEDataInputStream;
+import org.eclipse.swt.internal.image.JPEGFileFormat;
+
+final class JPEGStartOfImage : JPEGFixedSizeSegment {
+
+    public this() {
+        super();
+    }
+
+    public this(byte[] reference) {
+        super(reference);
+    }
+
+    public this(LEDataInputStream byteStream) {
+        super(byteStream);
+    }
+
+    public override int signature() {
+        return JPEGFileFormat.SOI;
+    }
+
+    public override int fixedSize() {
+        return 2;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/JPEGVariableSizeSegment.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.JPEGVariableSizeSegment;
+
+import java.lang.all;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.image.JPEGSegment;
+import org.eclipse.swt.internal.image.LEDataInputStream;
+
+import tango.core.Exception;
+
+abstract class JPEGVariableSizeSegment : JPEGSegment {
+
+    public this(byte[] reference) {
+        super(reference);
+    }
+
+    public this(LEDataInputStream byteStream) {
+        try {
+            byte[] header = new byte[4];
+            byteStream.read(header);
+            reference = header; // to use getSegmentLength()
+            byte[] contents = new byte[getSegmentLength() + 2];
+            contents[0] = header[0];
+            contents[1] = header[1];
+            contents[2] = header[2];
+            contents[3] = header[3];
+            byteStream.read(contents, 4, contents.length - 4);
+            reference = contents;
+        } catch (Exception e) {
+            SWT.error(SWT.ERROR_IO, e);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/LEDataInputStream.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,195 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.LEDataInputStream;
+
+import java.lang.all;
+
+
+import java.io.InputStream;
+import tango.core.Exception;
+
+final class LEDataInputStream : InputStream{
+
+    alias InputStream.read read;
+
+    InputStream host;
+
+    int position;
+
+    /**
+     * The byte array containing the bytes to read.
+     */
+    protected byte[] buf;
+
+    /**
+     * The current position within the byte array <code>buf</code>. A value
+     * equal to buf.length indicates no bytes available.  A value of
+     * 0 indicates the buffer is full.
+     */
+    protected int pos;
+
+
+    public this(InputStream input) {
+        this(input, 512);
+    }
+
+    public this(InputStream input, int bufferSize) {
+        host = input;
+        if (bufferSize > 0) {
+            buf = new byte[bufferSize];
+            pos = bufferSize;
+        }
+        else throw new IllegalArgumentException("bufferSize must be greater zero" );
+    }
+
+    public void close() {
+        buf = null;
+        if (host !is null) {
+            host.close();
+            host = null;
+        }
+    }
+
+    /**
+     * Answer how many bytes were read.
+     */
+    public int getPosition() {
+        return position;
+    }
+
+    /**
+     * Answers how many bytes are available for reading without blocking
+     */
+    public override int available() {
+        if (buf is null) throw new IOException("buf is null");
+        return (buf.length - pos) + host.available();
+    }
+
+    /**
+     * Answer the next byte of the input stream.
+     */
+    public override int read() {
+        if (buf is null) throw new IOException("buf is null");
+        if (pos < buf.length) {
+            position++;
+            return (buf[pos++] & 0xFF);
+        }
+        int c = host.read();
+        if (c !is -1 ) position++;
+        return c;
+    }
+
+    /**
+     * Don't imitate the JDK behaviour of reading a random number
+     * of bytes when you can actually read them all.
+     */
+    public override int read(byte b[], int off, int len) {
+        int read = 0, count;
+        while (read !is len && (count = readData(b, off, len - read)) !is -1) {
+            off += count;
+            read += count;
+        }
+        position += read;
+        if (read is 0 && read !is len) return -1;
+        return read;
+    }
+
+    /**
+     * Reads at most <code>length</code> bytes from this LEDataInputStream and
+     * stores them in byte array <code>buffer</code> starting at <code>offset</code>.
+     * <p>
+     * Answer the number of bytes actually read or -1 if no bytes were read and
+     * end of stream was encountered.  This implementation reads bytes from
+     * the pushback buffer first, then the target stream if more bytes are required
+     * to satisfy <code>count</code>.
+     * </p>
+     * @param buffer the byte array in which to store the read bytes.
+     * @param offset the offset in <code>buffer</code> to store the read bytes.
+     * @param length the maximum number of bytes to store in <code>buffer</code>.
+     *
+     * @return int the number of bytes actually read or -1 if end of stream.
+     *
+     * @exception java.io.IOException if an IOException occurs.
+     */
+    private int readData(byte[] buffer, int offset, int len) {
+        if (buf is null) throw new IOException("buf is null");
+        if (offset < 0 || offset > buffer.length ||
+            len < 0 || (len > buffer.length - offset)) {
+            throw new ArrayBoundsException(__FILE__,__LINE__);
+            }
+
+        int cacheCopied = 0;
+        int newOffset = offset;
+
+        // Are there pushback bytes available?
+        int available = buf.length - pos;
+        if (available > 0) {
+            cacheCopied = (available >= len) ? len : available;
+            System.arraycopy(buf, pos, buffer, newOffset, cacheCopied);
+            newOffset += cacheCopied;
+            pos += cacheCopied;
+        }
+
+        // Have we copied enough?
+        if (cacheCopied is len) return len;
+
+        int inCopied = host.read( buffer, newOffset, len - cacheCopied );
+        if( inCopied is -1 ) inCopied = -1;
+        if (inCopied > 0 ) return inCopied + cacheCopied;
+        if (cacheCopied is 0) return inCopied;
+        return cacheCopied;
+    }
+
+    /**
+     * Answer an integer comprised of the next
+     * four bytes of the input stream.
+     */
+    public int readInt() {
+        byte[4] buf = void;
+        read(buf);
+        return ((buf[3] & 0xFF) << 24) | 
+            ((buf[2] & 0xFF) << 16) | 
+            ((buf[1] & 0xFF) << 8) | 
+            (buf[0] & 0xFF);
+    }
+
+    /**
+     * Answer a short comprised of the next
+     * two bytes of the input stream.
+     */
+    public short readShort() {
+        byte[2] buf = void;
+        read(buf);
+        return cast(short)(((buf[1] & 0xFF) << 8) | (buf[0] & 0xFF));
+    }
+
+    /**
+     * Push back the entire content of the given buffer <code>b</code>.
+     * <p>
+     * The bytes are pushed so that they would be read back b[0], b[1], etc.
+     * If the push back buffer cannot handle the bytes copied from <code>b</code>,
+     * an IOException will be thrown and no byte will be pushed back.
+     * </p>
+     *
+     * @param b the byte array containing bytes to push back into the stream
+     *
+     * @exception   java.io.IOException if the pushback buffer is too small
+     */
+    public void unread(byte[] b) {
+        int l = b.length;
+        if (l > pos) throw new IOException("cannot unread");
+        position -= l;
+        pos -= l;
+        System.arraycopy(b, 0, buf, pos, l);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/LEDataOutputStream.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.LEDataOutputStream;
+
+import java.lang.all;
+
+
+import java.io.OutputStream;
+
+final class LEDataOutputStream : OutputStream {
+
+    alias OutputStream.write write;
+
+    OutputStream ostr;
+
+public this(OutputStream output) {
+    this.ostr = output;
+}
+/**
+ * Write the specified number of bytes of the given byte array,
+ * starting at the specified offset, to the output stream.
+ */
+public override void write(byte b[], int off, int len) {
+    ostr.write(b, off, len);
+}
+/**
+ * Write the given byte to the output stream.
+ */
+public override void write(int b)  {
+    ostr.write(b);
+}
+/**
+ * Write the given byte to the output stream.
+ */
+public void writeByte(byte b) {
+    ostr.write(b);
+}
+/**
+ * Write the four bytes of the given integer
+ * to the output stream.
+ */
+public void writeInt(int theInt) {
+    ostr.write(theInt & 0xFF);
+    ostr.write((theInt >> 8) & 0xFF);
+    ostr.write((theInt >> 16) & 0xFF);
+    ostr.write((theInt >> 24) & 0xFF);
+}
+/**
+ * Write the two bytes of the given short
+ * to the output stream.
+ */
+public void writeShort(int theShort) {
+    ostr.write(theShort & 0xFF);
+    ostr.write((theShort >> 8) & 0xFF);
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/LZWCodec.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,487 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.LZWCodec;
+
+
+import org.eclipse.swt.internal.image.LZWNode;
+import org.eclipse.swt.internal.image.LEDataInputStream;
+import org.eclipse.swt.internal.image.LEDataOutputStream;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.ImageLoader;
+import org.eclipse.swt.graphics.ImageLoaderEvent;
+import java.lang.all;
+
+import tango.core.Exception;
+
+final class LZWCodec {
+    int bitsPerPixel, blockSize, blockIndex, currentByte, bitsLeft,
+        codeSize, clearCode, endCode, newCodes, topSlot, currentSlot,
+        imageWidth, imageHeight, imageX, imageY, pass, line, codeMask;
+    byte[] block, lineArray;
+    int[] stack, suffix, prefix;
+    LZWNode[] nodeStack;
+    LEDataInputStream inputStream;
+    LEDataOutputStream outputStream;
+    ImageData image;
+    ImageLoader loader;
+    bool interlaced;
+    static final int[] MASK_TABLE = [
+        0x1, 0x3, 0x7, 0xF, 0x1F, 0x3F, 0x7F,
+        0xFF, 0x1FF, 0x3FF, 0x7FF, 0xFFF
+    ];
+
+/**
+ * Decode the input.
+ */
+void decode() {
+    int code;
+    int oc = 0;
+    int fc = 0;
+    byte[] buf = new byte[imageWidth];
+    int stackIndex = 0;
+    int bufIndex = 0;
+    int c;
+    while ((c = nextCode()) !is endCode) {
+        if (c is clearCode) {
+            codeSize = bitsPerPixel + 1;
+            codeMask = MASK_TABLE[bitsPerPixel];
+            currentSlot = newCodes;
+            topSlot = 1 << codeSize;
+            while ((c = nextCode()) is clearCode) {}
+            if (c !is endCode) {
+                oc = fc = c;
+                buf[bufIndex] = cast(byte)c;
+                bufIndex++;
+                if (bufIndex is imageWidth) {
+                    nextPutPixels(buf);
+                    bufIndex = 0;
+                }
+            }
+        } else {
+            code = c;
+            if (code >= currentSlot) {
+                code = oc;
+                stack[stackIndex] = fc;
+                stackIndex++;
+            }
+            while (code >= newCodes) {
+                stack[stackIndex] = suffix[code];
+                stackIndex++;
+                code = prefix[code];
+            }
+            stack[stackIndex] = code;
+            stackIndex++;
+            if (currentSlot < topSlot) {
+                fc = code;
+                suffix[currentSlot] = fc;
+                prefix[currentSlot] = oc;
+                currentSlot++;
+                oc = c;
+            }
+            if (currentSlot >= topSlot) {
+                if (codeSize < 12) {
+                    codeMask = MASK_TABLE[codeSize];
+                    codeSize++;
+                    topSlot = topSlot + topSlot;
+                }
+            }
+            while (stackIndex > 0) {
+                stackIndex--;
+                buf[bufIndex] = cast(byte)stack[stackIndex];
+                bufIndex++;
+                if (bufIndex is imageWidth) {
+                    nextPutPixels(buf);
+                    bufIndex = 0;
+                }
+            }
+        }
+    }
+    if (bufIndex !is 0 && line < imageHeight) {
+        nextPutPixels(buf);
+    }
+}
+/**
+ * Decode the LZW-encoded bytes in the given byte stream
+ * into the given DeviceIndependentImage.
+ */
+public void decode(LEDataInputStream inputStream, ImageLoader loader, ImageData image, bool interlaced, int depth) {
+    this.inputStream = inputStream;
+    this.loader = loader;
+    this.image = image;
+    this.interlaced = interlaced;
+    this.bitsPerPixel = depth;
+    initializeForDecoding();
+    decode();
+}
+/**
+ * Encode the image.
+ */
+void encode() {
+    nextPutCode(clearCode);
+    int lastPrefix = encodeLoop();
+    nextPutCode(lastPrefix);
+    nextPutCode(endCode);
+
+    // Write out last partial block
+    if (bitsLeft is 8) {
+        block[0] = cast(byte)(blockIndex - 1); // Nothing in last byte
+    } else {
+        block[0] = cast(byte)(blockIndex); // Last byte has data
+    }
+    writeBlock();
+
+    // Write out empty block to indicate the end (if needed)
+    if (block[0] !is 0) {
+        block[0] = 0;
+        writeBlock();
+    }
+}
+/**
+ * Encode the bytes into the given byte stream
+ * from the given DeviceIndependentImage.
+ */
+public void encode(LEDataOutputStream byteStream, ImageData image) {
+    this.outputStream = byteStream;
+    this.image = image;
+    initializeForEncoding();
+    encode();
+}
+/**
+ * Encoding loop broken out to allow early return.
+ */
+int encodeLoop() {
+    int pixel = nextPixel();
+    bool found;
+    LZWNode node;
+    while (true) {
+        int currentPrefix = pixel;
+        node = nodeStack[currentPrefix];
+        found = true;
+        pixel = nextPixel();
+        if (pixel < 0)
+            return currentPrefix;
+        while (found && (node.children !is null)) {
+            node = node.children;
+            while (found && (node.suffix !is pixel)) {
+                if (pixel < node.suffix) {
+                    if (node.left is null) {
+                        node.left = new LZWNode();
+                        found = false;
+                    }
+                    node = node.left;
+                } else {
+                    if (node.right is null) {
+                        node.right = new LZWNode();
+                        found = false;
+                    }
+                    node = node.right;
+                }
+            }
+            if (found) {
+                currentPrefix = node.code;
+                pixel = nextPixel();
+                if (pixel < 0)
+                    return currentPrefix;
+            }
+        }
+        if (found) {
+            node.children = new LZWNode();
+            node = node.children;
+        }
+        node.children = null;
+        node.left = null;
+        node.right = null;
+        node.code = currentSlot;
+        node.prefix = currentPrefix;
+        node.suffix = pixel;
+        nextPutCode(currentPrefix);
+        currentSlot++;
+        // Off by one?
+        if (currentSlot < 4096) {
+            if (currentSlot > topSlot) {
+                codeSize++;
+                codeMask = MASK_TABLE[codeSize - 1];
+                topSlot *= 2;
+            }
+        } else {
+            nextPutCode(clearCode);
+            for (int i = 0; i < nodeStack.length; i++)
+                nodeStack[i].children = null;
+            codeSize = bitsPerPixel + 1;
+            codeMask = MASK_TABLE[codeSize - 1];
+            currentSlot = newCodes;
+            topSlot = 1 << codeSize;
+        }
+    }
+}
+/**
+ * Initialize the receiver for decoding the given
+ * byte array.
+ */
+void initializeForDecoding() {
+    pass = 1;
+    line = 0;
+    codeSize = bitsPerPixel + 1;
+    topSlot = 1 << codeSize;
+    clearCode = 1 << bitsPerPixel;
+    endCode = clearCode + 1;
+    newCodes = currentSlot = endCode + 1;
+    currentByte = -1;
+    blockSize = bitsLeft = 0;
+    blockIndex = 0;
+    codeMask = MASK_TABLE[codeSize - 1];
+    stack = new int[4096];
+    suffix = new int[4096];
+    prefix = new int[4096];
+    block = new byte[256];
+    imageWidth = image.width;
+    imageHeight = image.height;
+}
+/**
+ * Initialize the receiver for encoding the given
+ * byte array.
+ */
+void initializeForEncoding() {
+    interlaced = false;
+    bitsPerPixel = image.depth;
+    codeSize = bitsPerPixel + 1;
+    topSlot = 1 << codeSize;
+    clearCode = 1 << bitsPerPixel;
+    endCode = clearCode + 1;
+    newCodes = currentSlot = endCode + 1;
+    bitsLeft = 8;
+    currentByte = 0;
+    blockIndex = 1;
+    blockSize = 255;
+    block = new byte[blockSize];
+    block[0] = cast(byte)(blockSize - 1);
+    nodeStack = new LZWNode[1 << bitsPerPixel];
+    for (int i = 0; i < nodeStack.length; i++) {
+        LZWNode node = new LZWNode();
+        node.code = i + 1;
+        node.prefix = -1;
+        node.suffix = i + 1;
+        nodeStack[i] = node;
+    }
+    imageWidth = image.width;
+    imageHeight = image.height;
+    imageY = -1;
+    lineArray = new byte[imageWidth];
+    imageX = imageWidth + 1; // Force a read
+}
+/**
+ * Answer the next code from the input byte array.
+ */
+int nextCode() {
+    int code;
+    if (bitsLeft is 0) {
+        if (blockIndex >= blockSize) {
+            blockSize = readBlock();
+            blockIndex = 0;
+            if (blockSize is 0) return endCode;
+        }
+        blockIndex++;
+        currentByte = block[blockIndex] & 0xFF;
+        bitsLeft = 8;
+        code = currentByte;
+    } else {
+        int shift = bitsLeft - 8;
+        if (shift < 0)
+            code = currentByte >> (0 - shift);
+        else
+            code = currentByte << shift;
+    }
+    while (codeSize > bitsLeft) {
+        if (blockIndex >= blockSize) {
+            blockSize = readBlock();
+            blockIndex = 0;
+            if (blockSize is 0) return endCode;
+        }
+        blockIndex++;
+        currentByte = block[blockIndex] & 0xFF;
+        code += currentByte << bitsLeft;
+        bitsLeft += 8;
+    }
+    bitsLeft -= codeSize;
+    return code & codeMask;
+}
+/**
+ * Answer the next pixel to encode in the image
+ */
+int nextPixel() {
+    imageX++;
+    if (imageX > imageWidth) {
+        imageY++;
+        if (imageY >= imageHeight) {
+            return -1;
+        } else {
+            nextPixels(lineArray, imageWidth);
+        }
+        imageX = 1;
+    }
+    return this.lineArray[imageX - 1] & 0xFF;
+}
+/**
+ * Copy a row of pixel values from the image.
+ */
+void nextPixels(byte[] buf, int lineWidth) {
+    if (image.depth is 8) {
+        System.arraycopy(image.data, imageY * image.bytesPerLine, buf, 0, lineWidth);
+    } else {
+        image.getPixels(0, imageY, lineWidth, buf, 0);
+    }
+}
+/**
+ * Output aCode to the output stream.
+ */
+void nextPutCode(int aCode) {
+    int codeToDo = aCode;
+    int codeBitsToDo = codeSize;
+    // Fill in the remainder of the current byte with the
+    // *high-order* bits of the code.
+    int c = codeToDo & MASK_TABLE[bitsLeft - 1];
+    currentByte = currentByte | (c << (8 - bitsLeft));
+    block[blockIndex] = cast(byte)currentByte;
+    codeBitsToDo -= bitsLeft;
+    if (codeBitsToDo < 1) {
+        // The whole code fit in the first byte, so we are done.
+        bitsLeft -= codeSize;
+        if (bitsLeft is 0) {
+            // We used the whole last byte, so get ready
+            // for the next one.
+            bitsLeft = 8;
+            blockIndex++;
+            if (blockIndex >= blockSize) {
+                writeBlock();
+                blockIndex = 1;
+            }
+            currentByte = 0;
+        }
+        return;
+    }
+    codeToDo = codeToDo >> bitsLeft;
+
+    // Fill in any remaining whole bytes (i.e. not the last one!)
+    blockIndex++;
+    if (blockIndex >= blockSize) {
+        writeBlock();
+        blockIndex = 1;
+    }
+    while (codeBitsToDo >= 8) {
+        currentByte = codeToDo & 0xFF;
+        block[blockIndex] = cast(byte)currentByte;
+        codeToDo = codeToDo >> 8;
+        codeBitsToDo -= 8;
+        blockIndex++;
+        if (blockIndex >= blockSize) {
+            writeBlock();
+            blockIndex = 1;
+        }
+    }
+    // Fill the *low-order* bits of the last byte with the remainder
+    bitsLeft = 8 - codeBitsToDo;
+    currentByte = codeToDo;
+    block[blockIndex] = cast(byte)currentByte;
+}
+/**
+ * Copy a row of pixel values to the image.
+ */
+void nextPutPixels(byte[] buf) {
+    if (image.depth is 8) {
+        // Slight optimization for depth = 8.
+        int start = line * image.bytesPerLine;
+        for (int i = 0; i < imageWidth; i++)
+            image.data[start + i] = buf[i];
+    } else {
+        image.setPixels(0, line, imageWidth, buf, 0);
+    }
+    if (interlaced) {
+        if (pass is 1) {
+            copyRow(buf, 7);
+            line += 8;
+        } else if (pass is 2) {
+            copyRow(buf, 3);
+            line += 8;
+        } else if (pass is 3) {
+            copyRow(buf, 1);
+            line += 4;
+        } else if (pass is 4) {
+            line += 2;
+        } else if (pass is 5) {
+            line += 0;
+        }
+        if (line >= imageHeight) {
+            pass++;
+            if (pass is 2) line = 4;
+            else if (pass is 3) line = 2;
+            else if (pass is 4) line = 1;
+            else if (pass is 5) line = 0;
+            if (pass < 5) {
+                if (loader.hasListeners()) {
+                    ImageData imageCopy = cast(ImageData) image.clone();
+                    loader.notifyListeners(
+                        new ImageLoaderEvent(loader, imageCopy, pass - 2, false));
+                }
+            }
+        }
+        if (line >= imageHeight) line = 0;
+    } else {
+        line++;
+    }
+}
+/**
+ * Copy duplicate rows of pixel values to the image.
+ * This is to fill in rows if the image is interlaced.
+ */
+void copyRow(byte[] buf, int copies) {
+    for (int i = 1; i <= copies; i++) {
+        if (line + i < imageHeight) {
+            image.setPixels(0, line + i, imageWidth, buf, 0);
+        }
+    }
+}
+/**
+ * Read a block from the byte stream.
+ * Return the number of bytes read.
+ * Throw an exception if the block could not be read.
+ */
+int readBlock() {
+    int size = -1;
+    try {
+        size = inputStream.read();
+        if (size is -1) {
+            SWT.error(SWT.ERROR_INVALID_IMAGE);
+        }
+        block[0] = cast(byte)size;
+        size = inputStream.read(block, 1, size);
+        if (size is -1) {
+            SWT.error(SWT.ERROR_INVALID_IMAGE);
+        }
+    } catch (Exception e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+    return size;
+}
+/**
+ * Write a block to the byte stream.
+ * Throw an exception if the block could not be written.
+ */
+void writeBlock() {
+    try {
+        outputStream.write(block, 0, (block[0] & 0xFF) + 1);
+    } catch (Exception e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/LZWNode.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.LZWNode;
+
+import java.lang.all;
+
+
+final class LZWNode {
+    public LZWNode left, right, children;
+    public int code, prefix, suffix;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/OS2BMPFileFormat.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,303 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.OS2BMPFileFormat;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.ImageLoader;
+import org.eclipse.swt.graphics.PaletteData;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.internal.image.LEDataInputStream;
+import org.eclipse.swt.internal.image.FileFormat;
+import java.io.ByteArrayOutputStream;
+import java.lang.all;
+
+import tango.core.Exception;
+
+final class OS2BMPFileFormat : FileFormat {
+    static final int BMPFileHeaderSize = 14;
+    static final int BMPHeaderFixedSize = 12;
+    int width, height, bitCount;
+
+override bool isFileFormat(LEDataInputStream stream) {
+    try {
+        byte[] header = new byte[18];
+        stream.read(header);
+        stream.unread(header);
+        int infoHeaderSize = (header[14] & 0xFF) | ((header[15] & 0xFF) << 8) | ((header[16] & 0xFF) << 16) | ((header[17] & 0xFF) << 24);
+        return header[0] is 0x42 && header[1] is 0x4D && infoHeaderSize is BMPHeaderFixedSize;
+    } catch (Exception e) {
+        return false;
+    }
+}
+byte[] loadData(byte[] infoHeader) {
+    int stride = (width * bitCount + 7) / 8;
+    stride = (stride + 3) / 4 * 4; // Round up to 4 byte multiple
+    byte[] data = loadData(infoHeader, stride);
+    flipScanLines(data, stride, height);
+    return data;
+}
+byte[] loadData(byte[] infoHeader, int stride) {
+    int dataSize = height * stride;
+    byte[] data = new byte[dataSize];
+    try {
+        if (inputStream.read(data) !is dataSize)
+            SWT.error(SWT.ERROR_INVALID_IMAGE);
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+    return data;
+}
+int[] loadFileHeader() {
+    int[] header = new int[5];
+    try {
+        header[0] = inputStream.readShort();
+        header[1] = inputStream.readInt();
+        header[2] = inputStream.readShort();
+        header[3] = inputStream.readShort();
+        header[4] = inputStream.readInt();
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+    if (header[0] !is 0x4D42)
+        SWT.error(SWT.ERROR_INVALID_IMAGE);
+    return header;
+}
+override ImageData[] loadFromByteStream() {
+    int[] fileHeader = loadFileHeader();
+    byte[] infoHeader = new byte[BMPHeaderFixedSize];
+    try {
+        inputStream.read(infoHeader);
+    } catch (Exception e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+    width = (infoHeader[4] & 0xFF) | ((infoHeader[5] & 0xFF) << 8);
+    height = (infoHeader[6] & 0xFF) | ((infoHeader[7] & 0xFF) << 8);
+    bitCount = (infoHeader[10] & 0xFF) | ((infoHeader[11] & 0xFF) << 8);
+    PaletteData palette = loadPalette(infoHeader);
+    if (inputStream.getPosition() < fileHeader[4]) {
+        // Seek to the specified offset
+        try {
+            inputStream.skip(fileHeader[4] - inputStream.getPosition());
+        } catch (IOException e) {
+            SWT.error(SWT.ERROR_IO, e);
+        }
+    }
+    byte[] data = loadData(infoHeader);
+    int type = SWT.IMAGE_OS2_BMP;
+    return [
+        ImageData.internal_new(
+            width,
+            height,
+            bitCount,
+            palette,
+            4,
+            data,
+            0,
+            null,
+            null,
+            -1,
+            -1,
+            type,
+            0,
+            0,
+            0,
+            0)
+    ];
+}
+PaletteData loadPalette(byte[] infoHeader) {
+    if (bitCount <= 8) {
+        int numColors = 1 << bitCount;
+        byte[] buf = new byte[numColors * 3];
+        try {
+            if (inputStream.read(buf) !is buf.length)
+                SWT.error(SWT.ERROR_INVALID_IMAGE);
+        } catch (IOException e) {
+            SWT.error(SWT.ERROR_IO, e);
+        }
+        return paletteFromBytes(buf, numColors);
+    }
+    if (bitCount is 16) return new PaletteData(0x7C00, 0x3E0, 0x1F);
+    if (bitCount is 24) return new PaletteData(0xFF, 0xFF00, 0xFF0000);
+    return new PaletteData(0xFF00, 0xFF0000, 0xFF000000);
+}
+PaletteData paletteFromBytes(byte[] bytes, int numColors) {
+    int bytesOffset = 0;
+    RGB[] colors = new RGB[numColors];
+    for (int i = 0; i < numColors; i++) {
+        colors[i] = new RGB(bytes[bytesOffset + 2] & 0xFF,
+            bytes[bytesOffset + 1] & 0xFF,
+            bytes[bytesOffset] & 0xFF);
+        bytesOffset += 3;
+    }
+    return new PaletteData(colors);
+}
+/**
+ * Answer a byte array containing the BMP representation of
+ * the given device independent palette.
+ */
+static byte[] paletteToBytes(PaletteData pal) {
+    int n = pal.colors is null ? 0 : (pal.colors.length < 256 ? pal.colors.length : 256);
+    byte[] bytes = new byte[n * 3];
+    int offset = 0;
+    for (int i = 0; i < n; i++) {
+        RGB col = pal.colors[i];
+        bytes[offset] = cast(byte)col.blue;
+        bytes[offset + 1] = cast(byte)col.green;
+        bytes[offset + 2] = cast(byte)col.red;
+        offset += 3;
+    }
+    return bytes;
+}
+/**
+ * Unload the given image's data into the given byte stream.
+ * Answer the number of bytes written.
+ */
+int unloadData(ImageData image, OutputStream ostr) {
+    int bmpBpl = 0;
+    try {
+        int bpl = (image.width * image.depth + 7) / 8;
+        bmpBpl = (bpl + 3) / 4 * 4; // BMP pads scanlines to multiples of 4 bytes
+        int linesPerBuf = 32678 / bmpBpl;
+        byte[] buf = new byte[linesPerBuf * bmpBpl];
+        byte[] data = image.data;
+        int imageBpl = image.bytesPerLine;
+        int dataIndex = imageBpl * (image.height - 1); // Start at last line
+        if (image.depth is 16) {
+            for (int y = 0; y < image.height; y += linesPerBuf) {
+                int count = image.height - y;
+                if (linesPerBuf < count) count = linesPerBuf;
+                int bufOffset = 0;
+                for (int i = 0; i < count; i++) {
+                    for (int wIndex = 0; wIndex < bpl; wIndex += 2) {
+                        buf[bufOffset + wIndex + 1] = data[dataIndex + wIndex + 1];
+                        buf[bufOffset + wIndex] = data[dataIndex + wIndex];
+                    }
+                    bufOffset += bmpBpl;
+                    dataIndex -= imageBpl;
+                }
+                ostr.write(buf, 0, bufOffset);
+            }
+        } else {
+            for (int y = 0; y < image.height; y += linesPerBuf) {
+                int tmp = image.height - y;
+                int count = tmp < linesPerBuf ? tmp : linesPerBuf;
+                int bufOffset = 0;
+                for (int i = 0; i < count; i++) {
+                    System.arraycopy(data, dataIndex, buf, bufOffset, bpl);
+                    bufOffset += bmpBpl;
+                    dataIndex -= imageBpl;
+                }
+                ostr.write(buf, 0, bufOffset);
+            }
+        }
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+    return bmpBpl * image.height;
+}
+/**
+ * Unload a DeviceIndependentImage using Windows .BMP format into the given
+ * byte stream.
+ */
+override void unloadIntoByteStream(ImageLoader loader) {
+    ImageData image = loader.data[0];
+    byte[] rgbs;
+    int numCols;
+    if (!((image.depth is 1) || (image.depth is 4) || (image.depth is 8) ||
+          (image.depth is 16) || (image.depth is 24) || (image.depth is 32)))
+            SWT.error(SWT.ERROR_UNSUPPORTED_DEPTH);
+    PaletteData pal = image.palette;
+    if ((image.depth is 16) || (image.depth is 24) || (image.depth is 32)) {
+        if (!pal.isDirect)
+            SWT.error(SWT.ERROR_INVALID_IMAGE);
+        numCols = 0;
+        rgbs = null;
+    } else {
+        if (pal.isDirect)
+            SWT.error(SWT.ERROR_INVALID_IMAGE);
+        numCols = pal.colors.length;
+        rgbs = paletteToBytes(pal);
+    }
+    // Fill in file header, except for bfsize, which is done later.
+    int headersSize = BMPFileHeaderSize + BMPHeaderFixedSize;
+    int[] fileHeader = new int[5];
+    fileHeader[0] = 0x4D42; // Signature
+    fileHeader[1] = 0; // File size - filled in later
+    fileHeader[2] = 0; // Reserved 1
+    fileHeader[3] = 0; // Reserved 2
+    fileHeader[4] = headersSize; // Offset to data
+    if (rgbs !is null) {
+        fileHeader[4] += rgbs.length;
+    }
+
+    // Prepare data. This is done first so we don't have to try to rewind
+    // the stream and fill in the details later.
+    ByteArrayOutputStream ostr = new ByteArrayOutputStream();
+    unloadData(image, ostr);
+    byte[] data = ostr.toByteArray();
+
+    // Calculate file size
+    fileHeader[1] = fileHeader[4] + data.length;
+
+    // Write the headers
+    try {
+        outputStream.writeShort(fileHeader[0]);
+        outputStream.writeInt(fileHeader[1]);
+        outputStream.writeShort(fileHeader[2]);
+        outputStream.writeShort(fileHeader[3]);
+        outputStream.writeInt(fileHeader[4]);
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+    try {
+        outputStream.writeInt(BMPHeaderFixedSize);
+        outputStream.writeShort(image.width);
+        outputStream.writeShort(image.height);
+        outputStream.writeShort(1);
+        outputStream.writeShort(cast(short)image.depth);
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+
+    // Unload palette
+    if (numCols > 0) {
+        try {
+            outputStream.write(rgbs);
+        } catch (IOException e) {
+            SWT.error(SWT.ERROR_IO, e);
+        }
+    }
+
+    // Unload the data
+    try {
+        outputStream.write(data);
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+}
+void flipScanLines(byte[] data, int stride, int height) {
+    int i1 = 0;
+    int i2 = (height - 1) * stride;
+    for (int i = 0; i < height / 2; i++) {
+        for (int index = 0; index < stride; index++) {
+            byte b = data[index + i1];
+            data[index + i1] = data[index + i2];
+            data[index + i2] = b;
+        }
+        i1 += stride;
+        i2 -= stride;
+    }
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PNGFileFormat.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,595 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.PNGFileFormat;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.ImageLoaderEvent;
+import org.eclipse.swt.graphics.ImageLoader;
+import org.eclipse.swt.graphics.PaletteData;
+import org.eclipse.swt.internal.Compatibility;
+import org.eclipse.swt.internal.image.FileFormat;
+import org.eclipse.swt.internal.image.PngIhdrChunk;
+import org.eclipse.swt.internal.image.PngPlteChunk;
+import org.eclipse.swt.internal.image.PngChunkReader;
+import org.eclipse.swt.internal.image.PngChunk;
+import org.eclipse.swt.internal.image.PngTrnsChunk;
+import org.eclipse.swt.internal.image.PngIdatChunk;
+import org.eclipse.swt.internal.image.PngEncoder;
+import org.eclipse.swt.internal.image.PngInputStream;
+import org.eclipse.swt.internal.image.PngDecodingDataStream;
+import java.lang.all;
+
+import java.io.BufferedInputStream;
+
+import tango.core.Exception;
+
+final class PNGFileFormat : FileFormat {
+    static final int SIGNATURE_LENGTH = 8;
+    static final int PRIME = 65521;
+    PngIhdrChunk headerChunk;
+    PngPlteChunk paletteChunk;
+    ImageData imageData;
+    byte[] data;
+    byte[] alphaPalette;
+    byte headerByte1;
+    byte headerByte2;
+    int adler;
+
+/**
+ * Skip over signature data. This has already been
+ * verified in isFileFormat().
+ */
+void readSignature()  {
+    byte[] signature = new byte[SIGNATURE_LENGTH];
+    inputStream.read(signature);
+}
+/**
+ * Load the PNG image from the byte stream.
+ */
+override ImageData[] loadFromByteStream() {
+    try {
+        readSignature();
+        PngChunkReader chunkReader = new PngChunkReader(inputStream);
+        headerChunk = chunkReader.getIhdrChunk();
+        int width = headerChunk.getWidth(), height = headerChunk.getHeight();
+        if (width <= 0 || height <= 0) SWT.error(SWT.ERROR_INVALID_IMAGE);
+        int imageSize = getAlignedBytesPerRow() * height;
+        data = new byte[imageSize];
+        imageData = ImageData.internal_new(
+            width,
+            height,
+            headerChunk.getSwtBitsPerPixel(),
+            new PaletteData(0, 0, 0),
+            4,
+            data,
+            0,
+            null,
+            null,
+            -1,
+            -1,
+            SWT.IMAGE_PNG,
+            0,
+            0,
+            0,
+            0);
+
+        if (headerChunk.usesDirectColor()) {
+            imageData.palette = headerChunk.getPaletteData();
+        }
+
+        // Read and process chunks until the IEND chunk is encountered.
+        while (chunkReader.hasMoreChunks()) {
+            readNextChunk(chunkReader);
+        }
+
+        return [imageData];
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_INVALID_IMAGE);
+        return null;
+    }
+}
+/**
+ * Read and handle the next chunk of data from the
+ * PNG file.
+ */
+void readNextChunk(PngChunkReader chunkReader)  {
+    PngChunk chunk = chunkReader.readNextChunk();
+    switch (chunk.getChunkType()) {
+        case PngChunk.CHUNK_IEND:
+            break;
+        case PngChunk.CHUNK_PLTE:
+            if (!headerChunk.usesDirectColor()) {
+                paletteChunk = cast(PngPlteChunk) chunk;
+                imageData.palette = paletteChunk.getPaletteData();
+            }
+            break;
+        case PngChunk.CHUNK_tRNS:
+            PngTrnsChunk trnsChunk = cast(PngTrnsChunk) chunk;
+            if (trnsChunk.getTransparencyType(headerChunk) is
+                PngTrnsChunk.TRANSPARENCY_TYPE_PIXEL)
+            {
+                imageData.transparentPixel =
+                    trnsChunk.getSwtTransparentPixel(headerChunk);
+            } else {
+                alphaPalette = trnsChunk.getAlphaValues(headerChunk, paletteChunk);
+                int transparentCount = 0, transparentPixel = -1;
+                for (int i = 0; i < alphaPalette.length; i++) {
+                    if ((alphaPalette[i] & 0xFF) !is 255) {
+                        transparentCount++;
+                        transparentPixel = i;
+                    }
+                }
+                if (transparentCount is 0) {
+                    alphaPalette = null;
+                } else if (transparentCount is 1 && alphaPalette[transparentPixel] is 0) {
+                    alphaPalette = null;
+                    imageData.transparentPixel = transparentPixel;
+                }
+            }
+            break;
+        case PngChunk.CHUNK_IDAT:
+            if (chunkReader.readPixelData()) {
+                // All IDAT chunks in an image file must be
+                // sequential. If the pixel data has already
+                // been read and another IDAT block is encountered,
+                // then this is an invalid image.
+                SWT.error(SWT.ERROR_INVALID_IMAGE);
+            } else {
+                // Read in the pixel data for the image. This should
+                // go through all the image's IDAT chunks.
+                PngIdatChunk dataChunk = cast(PngIdatChunk) chunk;
+                readPixelData(dataChunk, chunkReader);
+            }
+            break;
+        default:
+            if (chunk.isCritical()) {
+                // All critical chunks must be supported.
+                SWT.error(SWT.ERROR_NOT_IMPLEMENTED);
+            }
+    }
+}
+override void unloadIntoByteStream(ImageLoader loader) {
+    PngEncoder encoder = new PngEncoder(loader);
+    encoder.encode(outputStream);
+}
+override bool isFileFormat(LEDataInputStream stream) {
+    try {
+        byte[] signature = new byte[SIGNATURE_LENGTH];
+        stream.read(signature);
+        stream.unread(signature);
+        if ((signature[0] & 0xFF) !is 137) return false; //137
+        if ((signature[1] & 0xFF) !is 80) return false; //P
+        if ((signature[2] & 0xFF) !is 78) return false; //N
+        if ((signature[3] & 0xFF) !is 71) return false; //G
+        if ((signature[4] & 0xFF) !is 13) return false; //<RETURN>
+        if ((signature[5] & 0xFF) !is 10) return false; //<LINEFEED>
+        if ((signature[6] & 0xFF) !is 26) return false; //<CTRL/Z>
+        if ((signature[7] & 0xFF) !is 10) return false; //<LINEFEED>     
+        return true;
+    } catch (Exception e) {
+        return false;
+    }
+}
+/**
+ * SWT does not support 16-bit depths. If this image uses
+ * 16-bit depths, convert the data to an 8-bit depth.
+ */
+byte[] validateBitDepth(byte[] data) {
+    if (headerChunk.getBitDepth() > 8) {
+        byte[] result = new byte[data.length / 2];
+        compress16BitDepthTo8BitDepth(data, 0, result, 0, result.length);
+        return result;
+    } else {
+        return data;
+    }
+}
+/**
+ * SWT does not support greyscale as a color type. For
+ * plain grayscale, we create a palette. For Grayscale
+ * with Alpha, however, we need to convert the pixels
+ * to use RGB values.
+ * Note: This method assumes that the bit depth of the
+ * data has already been restricted to 8 or less.
+ */
+void setPixelData(byte[] data, ImageData imageData) {
+    switch (headerChunk.getColorType()) {
+        case PngIhdrChunk.COLOR_TYPE_GRAYSCALE_WITH_ALPHA:
+        {
+            int width = imageData.width;
+            int height = imageData.height;
+            int destBytesPerLine = imageData.bytesPerLine;
+            /*
+            * If the image uses 16-bit depth, it is converted
+            * to an 8-bit depth image.
+            */
+            int srcBytesPerLine = getAlignedBytesPerRow();
+            if (headerChunk.getBitDepth() > 8) srcBytesPerLine /= 2;
+
+            byte[] rgbData = new byte[destBytesPerLine * height];
+            byte[] alphaData = new byte[width * height];
+            for (int y = 0; y < height; y++) {
+                int srcIndex = srcBytesPerLine * y;
+                int destIndex = destBytesPerLine * y;
+                int destAlphaIndex = width * y;
+                for (int x = 0; x < width; x++) {
+                    byte grey = data[srcIndex];
+                    byte alpha = data[srcIndex + 1];
+                    rgbData[destIndex + 0] = grey;
+                    rgbData[destIndex + 1] = grey;
+                    rgbData[destIndex + 2] = grey;
+                    alphaData[destAlphaIndex] = alpha;
+                    srcIndex += 2;
+                    destIndex += 3;
+                    destAlphaIndex++;
+                }
+            }
+            imageData.data = rgbData;
+            imageData.alphaData = alphaData;
+            break;
+        }
+        case PngIhdrChunk.COLOR_TYPE_RGB_WITH_ALPHA:
+        {
+            int width = imageData.width;
+            int height = imageData.height;
+            int destBytesPerLine = imageData.bytesPerLine;
+            int srcBytesPerLine = getAlignedBytesPerRow();
+            /*
+            * If the image uses 16-bit depth, it is converted
+            * to an 8-bit depth image.
+            */
+            if (headerChunk.getBitDepth() > 8) srcBytesPerLine /= 2;
+
+            byte[] rgbData = new byte[destBytesPerLine * height];
+            byte[] alphaData = new byte[width * height];
+            for (int y = 0; y < height; y++) {
+                int srcIndex = srcBytesPerLine * y;
+                int destIndex = destBytesPerLine * y;
+                int destAlphaIndex = width * y;
+                for (int x = 0; x < width; x++) {
+                    rgbData[destIndex + 0] = data[srcIndex + 0];
+                    rgbData[destIndex + 1] = data[srcIndex + 1];
+                    rgbData[destIndex + 2] = data[srcIndex + 2];
+                    alphaData[destAlphaIndex] = data[srcIndex + 3];
+                    srcIndex += 4;
+                    destIndex += 3;
+                    destAlphaIndex++;
+                }
+            }
+            imageData.data = rgbData;
+            imageData.alphaData = alphaData;
+            break;
+        }
+        case PngIhdrChunk.COLOR_TYPE_RGB:
+            imageData.data = data;
+            break;
+        case PngIhdrChunk.COLOR_TYPE_PALETTE:
+            imageData.data = data;
+            if (alphaPalette !is null) {
+                int size = imageData.width * imageData.height;
+                byte[] alphaData = new byte[size];
+                byte[] pixelData = new byte[size];
+                imageData.getPixels(0, 0, size, pixelData, 0);
+                for (int i = 0; i < pixelData.length; i++) {
+                    alphaData[i] = alphaPalette[pixelData[i] & 0xFF];
+                }
+                imageData.alphaData = alphaData;
+            }
+            break;
+        default:
+            imageData.data = data;
+            break;
+    }
+}
+/**
+ * PNG supports some color types and bit depths that are
+ * unsupported by SWT. If the image uses an unsupported
+ * color type (either of the gray scale types) or bit
+ * depth (16), convert the data to an SWT-supported
+ * format. Then assign the data into the ImageData given.
+ */
+void setImageDataValues(byte[] data, ImageData imageData) {
+    byte[] result = validateBitDepth(data);
+    setPixelData(result, imageData);
+}
+/**
+ * Read the image data from the data stream. This must handle
+ * decoding the data, filtering, and interlacing.
+ */
+void readPixelData(PngIdatChunk chunk, PngChunkReader chunkReader)  {
+    InputStream stream = new PngInputStream(chunk, chunkReader);
+    //TEMPORARY CODE
+    //PORTING_FIXME
+    bool use3_2 = true;//System.getProperty("org.eclipse.swt.internal.image.PNGFileFormat_3.2") !is null;
+    InputStream inflaterStream = use3_2 ? null : Compatibility.newInflaterInputStream(stream);
+    if (inflaterStream !is null) {
+        stream = inflaterStream;
+    } else {
+        stream = new PngDecodingDataStream(stream);
+    }
+    int interlaceMethod = headerChunk.getInterlaceMethod();
+    if (interlaceMethod is PngIhdrChunk.INTERLACE_METHOD_NONE) {
+        readNonInterlacedImage(stream);
+    } else {
+        readInterlacedImage(stream);
+    }
+    /*
+    * InflaterInputStream does not consume all bytes in the stream
+    * when it is closed. This may leave unread IDAT chunks. The fix
+    * is to read all available bytes before closing it.
+    */
+    while (stream.available() > 0) stream.read();
+    stream.close();
+}
+/**
+ * Answer the number of bytes in a word-aligned row of pixel data.
+ */
+int getAlignedBytesPerRow() {
+    return ((getBytesPerRow(headerChunk.getWidth()) + 3) / 4) * 4;
+}
+/**
+ * Answer the number of bytes in each row of the image
+ * data. Each PNG row is byte-aligned, so images with bit
+ * depths less than a byte may have unused bits at the
+ * end of each row. The value of these bits is undefined.
+ */
+int getBytesPerRow() {
+    return getBytesPerRow(headerChunk.getWidth());
+}
+/**
+ * Answer the number of bytes needed to represent a pixel.
+ * This value depends on the image's color type and bit
+ * depth.
+ * Note that this method rounds up if an image's pixel size
+ * isn't byte-aligned.
+ */
+int getBytesPerPixel() {
+    int bitsPerPixel = headerChunk.getBitsPerPixel();
+    return (bitsPerPixel + 7) / 8;
+}
+/**
+ * Answer the number of bytes in a row of the given pixel
+ * width. Each row is byte-aligned, so images with bit
+ * depths less than a byte may have unused bits at the
+ * end of each row. The value of these bits is undefined.
+ */
+int getBytesPerRow(int rowWidthInPixels) {
+    int bitsPerPixel = headerChunk.getBitsPerPixel();
+    int bitsPerRow = bitsPerPixel * rowWidthInPixels;
+    int bitsPerByte = 8;
+    return (bitsPerRow + (bitsPerByte - 1)) / bitsPerByte;
+}
+/**
+ * 1. Read one of the seven frames of interlaced data.
+ * 2. Update the imageData.
+ * 3. Notify the image loader's listeners of the frame load.
+ */
+void readInterlaceFrame(
+    InputStream inputStream,
+    int rowInterval,
+    int columnInterval,
+    int startRow,
+    int startColumn,
+    int frameCount)
+{
+    int width = headerChunk.getWidth();
+    int alignedBytesPerRow = getAlignedBytesPerRow();
+    int height = headerChunk.getHeight();
+    if (startRow >= height || startColumn >= width) return;
+
+    int pixelsPerRow = (width - startColumn + columnInterval - 1) / columnInterval;
+    int bytesPerRow = getBytesPerRow(pixelsPerRow);
+    byte[] row1 = new byte[bytesPerRow];
+    byte[] row2 = new byte[bytesPerRow];
+    byte[] currentRow = row1;
+    byte[] lastRow = row2;
+    for (int row = startRow; row < height; row += rowInterval) {
+        byte filterType = cast(byte)inputStream.read();
+        int read = 0;
+        while (read !is bytesPerRow) {
+            read += inputStream.read(currentRow, read, bytesPerRow - read);
+        }
+        filterRow(currentRow, lastRow, filterType);
+        if (headerChunk.getBitDepth() >= 8) {
+            int bytesPerPixel = getBytesPerPixel();
+            int dataOffset = (row * alignedBytesPerRow) + (startColumn * bytesPerPixel);
+            for (int rowOffset = 0; rowOffset < currentRow.length; rowOffset += bytesPerPixel) {
+                for (int byteOffset = 0; byteOffset < bytesPerPixel; byteOffset++) {
+                    data[dataOffset + byteOffset] = currentRow[rowOffset + byteOffset];
+                }
+                dataOffset += (columnInterval * bytesPerPixel);
+            }
+        } else {
+            int bitsPerPixel = headerChunk.getBitDepth();
+            int pixelsPerByte = 8 / bitsPerPixel;
+            int column = startColumn;
+            int rowBase = row * alignedBytesPerRow;
+            int valueMask = 0;
+            for (int i = 0; i < bitsPerPixel; i++) {
+                valueMask <<= 1;
+                valueMask |= 1;
+            }
+            int maxShift = 8 - bitsPerPixel;
+            for (int byteOffset = 0; byteOffset < currentRow.length; byteOffset++) {
+                for (int bitOffset = maxShift; bitOffset >= 0; bitOffset -= bitsPerPixel) {
+                    if (column < width) {
+                        int dataOffset = rowBase + (column * bitsPerPixel / 8);
+                        int value = (currentRow[byteOffset] >> bitOffset) & valueMask;
+                        int dataShift = maxShift - (bitsPerPixel * (column % pixelsPerByte));
+                        data[dataOffset] |= value << dataShift;
+                    }
+                    column += columnInterval;
+                }
+            }
+        }
+        currentRow = (currentRow is row1) ? row2 : row1;
+        lastRow = (lastRow is row1) ? row2 : row1;
+    }
+    setImageDataValues(data, imageData);
+    fireInterlacedFrameEvent(frameCount);
+}
+/**
+ * Read the pixel data for an interlaced image from the
+ * data stream.
+ */
+void readInterlacedImage(InputStream inputStream)  {
+    readInterlaceFrame(inputStream, 8, 8, 0, 0, 0);
+    readInterlaceFrame(inputStream, 8, 8, 0, 4, 1);
+    readInterlaceFrame(inputStream, 8, 4, 4, 0, 2);
+    readInterlaceFrame(inputStream, 4, 4, 0, 2, 3);
+    readInterlaceFrame(inputStream, 4, 2, 2, 0, 4);
+    readInterlaceFrame(inputStream, 2, 2, 0, 1, 5);
+    readInterlaceFrame(inputStream, 2, 1, 1, 0, 6);
+}
+/**
+ * Fire an event to let listeners know that an interlaced
+ * frame has been loaded.
+ * finalFrame should be true if the image has finished
+ * loading, false if there are more frames to come.
+ */
+void fireInterlacedFrameEvent(int frameCount) {
+    if (loader.hasListeners()) {
+        ImageData image = cast(ImageData) imageData.clone();
+        bool finalFrame = frameCount is 6;
+        loader.notifyListeners(new ImageLoaderEvent(loader, image, frameCount, finalFrame));
+    }
+}
+/**
+ * Read the pixel data for a non-interlaced image from the
+ * data stream.
+ * Update the imageData to reflect the new data.
+ */
+void readNonInterlacedImage(InputStream inputStream)  {
+    int dataOffset = 0;
+    int alignedBytesPerRow = getAlignedBytesPerRow();
+    int bytesPerRow = getBytesPerRow();
+    byte[] row1 = new byte[bytesPerRow];
+    byte[] row2 = new byte[bytesPerRow];
+    byte[] currentRow = row1;
+    byte[] lastRow = row2;
+    int height = headerChunk.getHeight();
+    for (int row = 0; row < height; row++) {
+        byte filterType = cast(byte)inputStream.read();
+        int read = 0;
+        while (read !is bytesPerRow) {
+            read += inputStream.read(currentRow, read, bytesPerRow - read);
+        }
+        filterRow(currentRow, lastRow, filterType);
+        System.arraycopy(currentRow, 0, data, dataOffset, bytesPerRow);
+        dataOffset += alignedBytesPerRow;
+        currentRow = (currentRow is row1) ? row2 : row1;
+        lastRow = (lastRow is row1) ? row2 : row1;
+    }
+    setImageDataValues(data, imageData);
+}
+/**
+ * SWT does not support 16-bit depth color formats.
+ * Convert the 16-bit data to 8-bit data.
+ * The correct way to do this is to multiply each
+ * 16 bit value by the value:
+ * (2^8 - 1) / (2^16 - 1).
+ * The fast way to do this is just to drop the low
+ * byte of the 16-bit value.
+ */
+static void compress16BitDepthTo8BitDepth(
+    byte[] source,
+    int sourceOffset,
+    byte[] destination,
+    int destinationOffset,
+    int numberOfValues)
+{
+    //double multiplier = (Compatibility.pow2(8) - 1) / (Compatibility.pow2(16) - 1);
+    for (int i = 0; i < numberOfValues; i++) {
+        int sourceIndex = sourceOffset + (2 * i);
+        int destinationIndex = destinationOffset + i;
+        //int value = (source[sourceIndex] << 8) | source[sourceIndex + 1];
+        //byte compressedValue = (byte)(value * multiplier);
+        byte compressedValue = source[sourceIndex];
+        destination[destinationIndex] = compressedValue;
+    }
+}
+/**
+ * SWT does not support 16-bit depth color formats.
+ * Convert the 16-bit data to 8-bit data.
+ * The correct way to do this is to multiply each
+ * 16 bit value by the value:
+ * (2^8 - 1) / (2^16 - 1).
+ * The fast way to do this is just to drop the low
+ * byte of the 16-bit value.
+ */
+static int compress16BitDepthTo8BitDepth(int value) {
+    //double multiplier = (Compatibility.pow2(8) - 1) / (Compatibility.pow2(16) - 1);
+    //byte compressedValue = (byte)(value * multiplier);
+    return value >> 8;
+}
+/**
+ * PNG supports four filtering types. These types are applied
+ * per row of image data. This method unfilters the given row
+ * based on the filterType.
+ */
+void filterRow(byte[] row, byte[] previousRow, int filterType) {
+    int byteOffset = headerChunk.getFilterByteOffset();
+    switch (filterType) {
+        case PngIhdrChunk.FILTER_NONE:
+            break;
+        case PngIhdrChunk.FILTER_SUB:
+            for (int i = byteOffset; i < row.length; i++) {
+                int current = row[i] & 0xFF;
+                int left = row[i - byteOffset] & 0xFF;
+                row[i] = cast(byte)((current + left) & 0xFF);
+            }
+            break;
+        case PngIhdrChunk.FILTER_UP:
+            for (int i = 0; i < row.length; i++) {
+                int current = row[i] & 0xFF;
+                int above = previousRow[i] & 0xFF;
+                row[i] = cast(byte)((current + above) & 0xFF);
+            }
+            break;
+        case PngIhdrChunk.FILTER_AVERAGE:
+            for (int i = 0; i < row.length; i++) {
+                int left = (i < byteOffset) ? 0 : row[i - byteOffset] & 0xFF;
+                int above = previousRow[i] & 0xFF;
+                int current = row[i] & 0xFF;
+                row[i] = cast(byte)((current + ((left + above) / 2)) & 0xFF);
+            }
+            break;
+        case PngIhdrChunk.FILTER_PAETH:
+            for (int i = 0; i < row.length; i++) {
+                int left = (i < byteOffset) ? 0 : row[i - byteOffset] & 0xFF;
+                int aboveLeft = (i < byteOffset) ? 0 : previousRow[i - byteOffset] & 0xFF;
+                int above = previousRow[i] & 0xFF;
+
+                int a = Math.abs(above - aboveLeft);
+                int b = Math.abs(left - aboveLeft);
+                int c = Math.abs(left - aboveLeft + above - aboveLeft);
+
+                int preductor = 0;
+                if (a <= b && a <= c) {
+                    preductor = left;
+                } else if (b <= c) {
+                    preductor = above;
+                } else {
+                    preductor = aboveLeft;
+                }
+
+                int currentValue = row[i] & 0xFF;
+                row[i] = cast(byte) ((currentValue + preductor) & 0xFF);
+            }
+            break;
+        default:
+    }
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngChunk.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,386 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.PngChunk;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.image.LEDataInputStream;
+import org.eclipse.swt.internal.image.PngFileReadState;
+import org.eclipse.swt.internal.image.PngIhdrChunk;
+import org.eclipse.swt.internal.image.PngPlteChunk;
+import org.eclipse.swt.internal.image.PngIdatChunk;
+import org.eclipse.swt.internal.image.PngIendChunk;
+import org.eclipse.swt.internal.image.PngTrnsChunk;
+import java.lang.all;
+
+import tango.core.Exception;
+import tango.text.convert.Format;
+
+class PngChunk {
+    byte[] reference;
+
+    static const int LENGTH_OFFSET = 0;
+    static const int TYPE_OFFSET = 4;
+    static const int DATA_OFFSET = 8;
+
+    static const int TYPE_FIELD_LENGTH = 4;
+    static const int LENGTH_FIELD_LENGTH = 4;
+    static const int MIN_LENGTH = 12;
+
+    static const int CHUNK_UNKNOWN = -1;
+    // Critical chunks.
+    static const int CHUNK_IHDR = 0;
+    static const int CHUNK_PLTE = 1;
+    static const int CHUNK_IDAT = 2;
+    static const int CHUNK_IEND = 3;
+    // Non-critical chunks.
+    static const int CHUNK_tRNS = 5;
+
+    static const byte[] TYPE_IHDR = cast(byte[])"IHDR";//{(byte) 'I', (byte) 'H', (byte) 'D', (byte) 'R'};
+    static const byte[] TYPE_PLTE = cast(byte[])"PLTE";//{(byte) 'P', (byte) 'L', (byte) 'T', (byte) 'E'};
+    static const byte[] TYPE_IDAT = cast(byte[])"IDAT";//{(byte) 'I', (byte) 'D', (byte) 'A', (byte) 'T'};
+    static const byte[] TYPE_IEND = cast(byte[])"IEND";//{(byte) 'I', (byte) 'E', (byte) 'N', (byte) 'D'};
+    static const byte[] TYPE_tRNS = cast(byte[])"tRNS";//{(byte) 't', (byte) 'R', (byte) 'N', (byte) 'S'};
+
+    static const int[] CRC_TABLE;
+    //public static void static_this() {
+    static this() {
+        CRC_TABLE = new int[256];
+        for (int i = 0; i < 256; i++) {
+            CRC_TABLE[i] = i;
+            for (int j = 0; j < 8; j++) {
+                if ((CRC_TABLE[i] & 0x1) is 0) {
+                    CRC_TABLE[i] = (CRC_TABLE[i] >> 1) & 0x7FFFFFFF;
+                } else {
+                    CRC_TABLE[i] = 0xEDB88320 ^ ((CRC_TABLE[i] >> 1) & 0x7FFFFFFF);
+                }
+            }
+        }
+    }
+
+    int length;
+
+/**
+ * Construct a PngChunk using the reference bytes
+ * given.
+ */
+this(byte[] reference) {
+    setReference(reference);
+    if (reference.length < LENGTH_OFFSET + LENGTH_FIELD_LENGTH) SWT.error(SWT.ERROR_INVALID_IMAGE);
+    length = getInt32(LENGTH_OFFSET);
+}
+
+/**
+ * Construct a PngChunk with the specified number of
+ * data bytes.
+ */
+this(int dataLength) {
+    this(new byte[MIN_LENGTH + dataLength]);
+    setLength(dataLength);
+}
+
+/**
+ * Get the PngChunk's reference byteArray;
+ */
+byte[] getReference() {
+    return reference;
+}
+
+/**
+ * Set the PngChunk's reference byteArray;
+ */
+void setReference(byte[] reference) {
+    this.reference = reference;
+}
+
+/**
+ * Get the 16-bit integer from the reference byte
+ * array at the given offset.
+ */
+int getInt16(int offset) {
+    int answer = 0;
+    answer |= (reference[offset] & 0xFF) << 8;
+    answer |= (reference[offset + 1] & 0xFF);
+    return answer;
+}
+
+/**
+ * Set the 16-bit integer in the reference byte
+ * array at the given offset.
+ */
+void setInt16(int offset, int value) {
+    reference[offset] = cast(byte) ((value >> 8) & 0xFF);
+    reference[offset + 1] = cast(byte) (value & 0xFF);
+}
+
+/**
+ * Get the 32-bit integer from the reference byte
+ * array at the given offset.
+ */
+int getInt32(int offset) {
+    int answer = 0;
+    answer |= (reference[offset] & 0xFF) << 24;
+    answer |= (reference[offset + 1] & 0xFF) << 16;
+    answer |= (reference[offset + 2] & 0xFF) << 8;
+    answer |= (reference[offset + 3] & 0xFF);
+    return answer;
+}
+
+/**
+ * Set the 32-bit integer in the reference byte
+ * array at the given offset.
+ */
+void setInt32(int offset, int value) {
+    reference[offset] = cast(byte) ((value >> 24) & 0xFF);
+    reference[offset + 1] = cast(byte) ((value >> 16) & 0xFF);
+    reference[offset + 2] = cast(byte) ((value >> 8) & 0xFF);
+    reference[offset + 3] = cast(byte) (value & 0xFF);
+}
+
+/**
+ * Get the length of the data component of this chunk.
+ * This is not the length of the entire chunk.
+ */
+int getLength() {
+    return length;
+}
+
+/**
+ * Set the length of the data component of this chunk.
+ * This is not the length of the entire chunk.
+ */
+void setLength(int value) {
+    setInt32(LENGTH_OFFSET, value);
+    length = value;
+}
+
+/**
+ * Get the chunk type. This is a four byte value.
+ * Each byte should be an ASCII character.
+ * The first byte is upper case if the chunk is critical.
+ * The second byte is upper case if the chunk is publicly defined.
+ * The third byte must be upper case.
+ * The fourth byte is upper case if the chunk is unsafe to copy.
+ * Public chunk types are defined by the PNG Development Group.
+ */
+byte[] getTypeBytes() {
+    byte[] type = new byte[4];
+    System.arraycopy(reference, TYPE_OFFSET, type, 0, TYPE_FIELD_LENGTH);
+    return type;
+}
+
+/**
+ * Set the chunk type. This is a four byte value.
+ * Each byte should be an ASCII character.
+ * The first byte is upper case if the chunk is critical.
+ * The second byte is upper case if the chunk is publicly defined.
+ * The third byte must be upper case.
+ * The fourth byte is upper case if the chunk is unsafe to copy.
+ * Public chunk types are defined by the PNG Development Group.
+ */
+void setType(byte[] value) {
+    if (value.length !is TYPE_FIELD_LENGTH) {
+        SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+    }
+    System.arraycopy(value, 0, reference, TYPE_OFFSET, TYPE_FIELD_LENGTH);
+}
+
+/**
+ * Get the chunk's data.
+ */
+byte[] getData() {
+    int dataLength = getLength();
+    if (reference.length < MIN_LENGTH + dataLength) {
+        SWT.error (SWT.ERROR_INVALID_RANGE);
+    }
+    byte[] data = new byte[dataLength];
+    System.arraycopy(reference, DATA_OFFSET, data, 0, dataLength);
+    return data;
+}
+
+/**
+ * Set the chunk's data.
+ * This method has two side-effects.
+ * 1. It will set the length field to be the length
+ *    of the data array given.
+ * 2. It will set the CRC field to the computed CRC
+ *    value of the data array given.
+ */
+void setData(byte[] data) {
+    setLength(data.length);
+    System.arraycopy(data, 0, reference, DATA_OFFSET, data.length);
+    setCRC(computeCRC());
+}
+
+/**
+ * Get the CRC value for the chunk's data.
+ * Ensure that the length field has a good
+ * value before making this call.
+ */
+int getCRC() {
+    int crcOffset = DATA_OFFSET + getLength();
+    return getInt32(crcOffset);
+}
+
+/**
+ * Set the CRC value for the chunk's data.
+ * Ensure that the length field has a good
+ * value before making this call.
+ */
+void setCRC(int value) {
+    int crcOffset = DATA_OFFSET + getLength();
+    setInt32(crcOffset, value);
+}
+
+/**
+ * Get the chunk's total size including the length, type, and crc fields.
+ */
+int getSize() {
+    return MIN_LENGTH + getLength();
+}
+
+/**
+ * Compute the CRC value for the chunk's data. Answer
+ * whether this value matches the value stored in the
+ * chunk.
+ */
+bool checkCRC() {
+    int crc = computeCRC();
+    int storedCRC = getCRC();
+    return crc is storedCRC;
+}
+
+/**
+ * Answer the CRC value of chunk's data.
+ */
+int computeCRC() {
+    int crc = 0xFFFFFFFF;
+    int start = TYPE_OFFSET;
+    int stop = DATA_OFFSET + getLength();
+    for (int i = start; i < stop; i++) {
+        int index = (crc ^ reference[i]) & 0xFF;
+        crc =  CRC_TABLE[index] ^ ((crc >> 8) & 0x00FFFFFF);
+    }
+    return ~crc;
+}
+
+bool typeMatchesArray(byte[] array) {
+    for (int i = 0; i < TYPE_FIELD_LENGTH; i++) {
+        if (reference[TYPE_OFFSET + i] !is array[i]){
+            return false;
+        }
+    }
+    return true;
+}
+
+bool isCritical() {
+    char c = cast(char) getTypeBytes()[0];
+    return 'A' <= c && c <= 'Z';
+}
+
+int getChunkType() {
+    if (typeMatchesArray(TYPE_IHDR)) return CHUNK_IHDR;
+    if (typeMatchesArray(TYPE_PLTE)) return CHUNK_PLTE;
+    if (typeMatchesArray(TYPE_IDAT)) return CHUNK_IDAT;
+    if (typeMatchesArray(TYPE_IEND)) return CHUNK_IEND;
+    if (typeMatchesArray(TYPE_tRNS)) return CHUNK_tRNS;
+    return CHUNK_UNKNOWN;
+}
+
+/**
+ * Read the next PNG chunk from the input stream given.
+ * If unable to read a chunk, return null.
+ */
+static PngChunk readNextFromStream(LEDataInputStream stream) {
+    try {
+        int headerLength = LENGTH_FIELD_LENGTH + TYPE_FIELD_LENGTH;
+        byte[] headerBytes = new byte[headerLength];
+        int result = stream.read(headerBytes, 0, headerLength);
+        stream.unread(headerBytes);
+        if (result !is headerLength) return null;
+
+        PngChunk tempChunk = new PngChunk(headerBytes);
+
+        int chunkLength = tempChunk.getSize();
+        byte[] chunk = new byte[chunkLength];
+
+        result = stream.read(chunk, 0, chunkLength);
+        if (result !is chunkLength) return null;
+
+        switch (tempChunk.getChunkType()) {
+            case CHUNK_IHDR:
+                return new PngIhdrChunk(chunk);
+            case CHUNK_PLTE:
+                return new PngPlteChunk(chunk);
+            case CHUNK_IDAT:
+                return new PngIdatChunk(chunk);
+            case CHUNK_IEND:
+                return new PngIendChunk(chunk);
+            case CHUNK_tRNS:
+                return new PngTrnsChunk(chunk);
+            default:
+                return new PngChunk(chunk);
+        }
+    } catch (IOException e) {
+        return null;
+    }
+}
+
+/**
+ * Answer whether the chunk is a valid PNG chunk.
+ */
+void validate(PngFileReadState readState, PngIhdrChunk headerChunk) {
+    if (reference.length < MIN_LENGTH) SWT.error(SWT.ERROR_INVALID_IMAGE);
+
+    byte[] type = getTypeBytes();
+
+    // The third character MUST be upper case.
+    char c = cast(char) type[2];
+    if (!('A' <= c && c <= 'Z')) SWT.error(SWT.ERROR_INVALID_IMAGE);
+
+    // All characters must be letters.
+    for (int i = 0; i < TYPE_FIELD_LENGTH; i++) {
+        c = cast(char) type[i];
+        if (!(('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z'))) {
+            SWT.error(SWT.ERROR_INVALID_IMAGE);
+        }
+    }
+
+    // The stored CRC must match the data's computed CRC.
+    if (!checkCRC()) SWT.error(SWT.ERROR_INVALID_IMAGE);
+}
+
+/**
+ * Provided so that subclasses can override and add
+ * data to the toString() call.
+ */
+String contributeToString() {
+    return "";
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+public override String toString() {
+    String buffer = Format( "{\n\tLength: {}\n\tType: {}{}\n\tCRC: {:X}\n}",
+        getLength(),
+        cast(String) getTypeBytes(),
+        contributeToString(),
+        getCRC());
+    return buffer;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngChunkReader.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.PngChunkReader;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.image.LEDataInputStream;
+import org.eclipse.swt.internal.image.PngFileReadState;
+import org.eclipse.swt.internal.image.PngIhdrChunk;
+import org.eclipse.swt.internal.image.PngPlteChunk;
+import org.eclipse.swt.internal.image.PngTrnsChunk;
+import org.eclipse.swt.internal.image.PngChunk;
+
+public class PngChunkReader {
+    LEDataInputStream inputStream;
+    PngFileReadState readState;
+    PngIhdrChunk headerChunk;
+    PngPlteChunk paletteChunk;
+
+this(LEDataInputStream inputStream) {
+    this.inputStream = inputStream;
+    readState = new PngFileReadState();
+    headerChunk = null;
+}
+
+PngIhdrChunk getIhdrChunk() {
+    if (headerChunk is null) {
+        PngChunk chunk = PngChunk.readNextFromStream(inputStream);
+        if (chunk is null) SWT.error(SWT.ERROR_INVALID_IMAGE);
+        if(( headerChunk = cast(PngIhdrChunk) chunk ) !is null ){
+            headerChunk.validate(readState, null);
+        }
+        else{
+            SWT.error(SWT.ERROR_INVALID_IMAGE);
+        }
+    }
+    return headerChunk;
+}
+
+PngChunk readNextChunk() {
+    if (headerChunk is null) return getIhdrChunk();
+
+    PngChunk chunk = PngChunk.readNextFromStream(inputStream);
+    if (chunk is null) SWT.error(SWT.ERROR_INVALID_IMAGE);
+    switch (chunk.getChunkType()) {
+        case PngChunk.CHUNK_tRNS:
+            (cast(PngTrnsChunk) chunk).validate(readState, headerChunk, paletteChunk);
+            break;
+        case PngChunk.CHUNK_PLTE:
+            chunk.validate(readState, headerChunk);
+            paletteChunk = cast(PngPlteChunk) chunk;
+            break;
+        default:
+            chunk.validate(readState, headerChunk);
+    }
+    if (readState.readIDAT && !(chunk.getChunkType() is PngChunk.CHUNK_IDAT)) {
+        readState.readPixelData = true;
+    }
+    return chunk;
+}
+
+bool readPixelData() {
+    return readState.readPixelData;
+}
+
+bool hasMoreChunks() {
+    return !readState.readIEND;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngDecodingDataStream.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,143 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.PngDecodingDataStream;
+
+import java.lang.all;
+
+
+import java.io.InputStream;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.image.PngLzBlockReader;
+
+public class PngDecodingDataStream : InputStream {
+
+    alias InputStream.read read;
+
+    InputStream stream;
+    byte currentByte;
+    int nextBitIndex;
+
+    PngLzBlockReader lzBlockReader;
+    int adlerValue;
+
+    static final int PRIME = 65521;
+    static final int MAX_BIT = 7;
+
+this(InputStream stream) {
+    super();
+    this.stream = stream;
+    nextBitIndex = MAX_BIT + 1;
+    adlerValue = 1;
+    lzBlockReader = new PngLzBlockReader(this);
+    readCompressedDataHeader();
+    lzBlockReader.readNextBlockHeader();
+}
+
+/**
+ * This method should be called when the image decoder thinks
+ * that all of the compressed image data has been read. This
+ * method will ensure that the next data value is an end of
+ * block marker. If there are more blocks after this one,
+ * the method will read them and ensure that they are empty.
+ */
+void assertImageDataAtEnd() {
+    lzBlockReader.assertCompressedDataAtEnd();
+}
+
+public override void close() {
+    assertImageDataAtEnd();
+    checkAdler();
+}
+
+int getNextIdatBits(int length) {
+    int value = 0;
+    for (int i = 0; i < length; i++) {
+        value |= (getNextIdatBit() << i);
+    }
+    return value;
+}
+
+int getNextIdatBit() {
+    if (nextBitIndex > MAX_BIT) {
+        currentByte = getNextIdatByte();
+        nextBitIndex = 0;
+    }
+    return (currentByte & (1 << nextBitIndex)) >> nextBitIndex++;
+}
+
+byte getNextIdatByte() {
+    byte nextByte = cast(byte)stream.read();
+    nextBitIndex = MAX_BIT + 1;
+    return nextByte;
+}
+
+void updateAdler(byte value) {
+    int low = adlerValue & 0xFFFF;
+    int high = (adlerValue >> 16) & 0xFFFF;
+    int valueInt = value & 0xFF;
+    low = (low + valueInt) % PRIME;
+    high = (low + high) % PRIME;
+    adlerValue = (high << 16) | low;
+}
+
+public override int read() {
+    byte nextDecodedByte = lzBlockReader.getNextByte();
+    updateAdler(nextDecodedByte);
+    return nextDecodedByte & 0xFF;
+}
+
+public override int read(byte[] buffer, int off, int len) {
+    for (int i = 0; i < len; i++) {
+        int b = read();
+        if (b is -1) return i;
+        buffer[off + i] = cast(byte)b;
+    }
+    return len;
+}
+
+void error() {
+    SWT.error(SWT.ERROR_INVALID_IMAGE);
+}
+
+private void readCompressedDataHeader() {
+    byte headerByte1 = getNextIdatByte();
+    byte headerByte2 = getNextIdatByte();
+
+    int number = ((headerByte1 & 0xFF) << 8) | (headerByte2 & 0xFF);
+    if (number % 31 !is 0) error();
+
+    int compressionMethod = headerByte1 & 0x0F;
+    if (compressionMethod !is 8) error();
+
+    int windowSizeHint = (headerByte1 & 0xF0) >> 4;
+    if (windowSizeHint > 7) error();
+    int windowSize = (1 << (windowSizeHint + 8));
+    lzBlockReader.setWindowSize(windowSize);
+
+    int dictionary = (headerByte2 & (1 << 5));
+    if (dictionary !is 0) error();
+
+//  int compressionLevel = (headerByte2 & 0xC0) >> 6;
+}
+
+void checkAdler() {
+    int storedAdler = 0;
+    storedAdler |= ((getNextIdatByte() & 0xFF) << 24);
+    storedAdler |= ((getNextIdatByte() & 0xFF) << 16);
+    storedAdler |= ((getNextIdatByte() & 0xFF) << 8);
+    storedAdler |=  (getNextIdatByte() & 0xFF);
+    if (storedAdler !is adlerValue) error();
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngDeflater.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,625 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.PngDeflater;
+
+import java.lang.all;
+
+import java.io.ByteArrayOutputStream;
+
+public class PngDeflater {
+
+    static const int BASE = 65521;
+    static const int WINDOW = 32768;
+    static const int MIN_LENGTH = 3;
+    static const int MAX_MATCHES = 32;
+    static const int HASH = 8209;
+
+    byte[] istr;
+    int inLength;
+
+    ByteArrayOutputStream bytes;
+
+    int adler32 = 1;
+
+    int buffer, bitCount;
+
+    Link[HASH] hashtable;// = new Link[HASH];
+    Link[WINDOW] window;// = new Link[WINDOW];
+    int nextWindow;
+
+public this(){
+    bytes = new ByteArrayOutputStream(1024);
+}
+
+class Link {
+
+    int hash, value;
+    Link previous, next;
+
+    this() {
+
+        this.hash = 0;
+        this.value = 0;
+        this.previous = null;
+        this.next = null;
+
+    }
+
+}
+
+static class Match {
+
+    int length, distance;
+
+    this(int length, int distance) {
+
+        this.length = length;
+        this.distance = distance;
+
+    }
+
+}
+
+static const short mirrorBytes[] = [ cast(short)
+
+    0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
+    0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
+    0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
+    0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
+    0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,
+    0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
+    0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,
+    0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
+    0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2,
+    0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
+    0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea,
+    0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
+    0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6,
+    0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
+    0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee,
+    0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
+    0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1,
+    0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
+    0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9,
+    0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
+    0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5,
+    0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
+    0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed,
+    0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
+    0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3,
+    0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
+    0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb,
+    0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
+    0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7,
+    0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
+    0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
+    0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff,
+
+];
+
+static class Code {
+
+    int code, extraBits, min, max;
+
+    this(int code, int extraBits, int min, int max) {
+
+        this.code = code;
+        this.extraBits = extraBits;
+        this.min = min;
+        this.max = max;
+
+    }
+
+}
+
+static const Code lengthCodes[];
+static const Code distanceCodes[];
+
+static this() {
+    lengthCodes = [
+        new Code(257, 0, 3, 3),
+        new Code(258, 0, 4, 4),
+        new Code(259, 0, 5, 5),
+        new Code(260, 0, 6, 6),
+        new Code(261, 0, 7, 7),
+        new Code(262, 0, 8, 8),
+        new Code(263, 0, 9, 9),
+        new Code(264, 0, 10, 10),
+        new Code(265, 1, 11, 12),
+        new Code(266, 1, 13, 14),
+        new Code(267, 1, 15, 16),
+        new Code(268, 1, 17, 18),
+        new Code(269, 2, 19, 22),
+        new Code(270, 2, 23, 26),
+        new Code(271, 2, 27, 30),
+        new Code(272, 2, 31, 34),
+        new Code(273, 3, 35, 42),
+        new Code(274, 3, 43, 50),
+        new Code(275, 3, 51, 58),
+        new Code(276, 3, 59, 66),
+        new Code(277, 4, 67, 82),
+        new Code(278, 4, 83, 98),
+        new Code(279, 4, 99, 114),
+        new Code(280, 4, 115, 130),
+        new Code(281, 5, 131, 162),
+        new Code(282, 5, 163, 194),
+        new Code(283, 5, 195, 226),
+        new Code(284, 5, 227, 257),
+        new Code(285, 0, 258, 258)];
+
+    distanceCodes = [
+        new Code(0, 0, 1, 1),
+        new Code(1, 0, 2, 2),
+        new Code(2, 0, 3, 3),
+        new Code(3, 0, 4, 4),
+        new Code(4, 1, 5, 6),
+        new Code(5, 1, 7, 8),
+        new Code(6, 2, 9, 12),
+        new Code(7, 2, 13, 16),
+        new Code(8, 3, 17, 24),
+        new Code(9, 3, 25, 32),
+        new Code(10, 4, 33, 48),
+        new Code(11, 4, 49, 64),
+        new Code(12, 5, 65, 96),
+        new Code(13, 5, 97, 128),
+        new Code(14, 6, 129, 192),
+        new Code(15, 6, 193, 256),
+        new Code(16, 7, 257, 384),
+        new Code(17, 7, 385, 512),
+        new Code(18, 8, 513, 768),
+        new Code(19, 8, 769, 1024),
+        new Code(20, 9, 1025, 1536),
+        new Code(21, 9, 1537, 2048),
+        new Code(22, 10, 2049, 3072),
+        new Code(23, 10, 3073, 4096),
+        new Code(24, 11, 4097, 6144),
+        new Code(25, 11, 6145, 8192),
+        new Code(26, 12, 8193, 12288),
+        new Code(27, 12, 12289, 16384),
+        new Code(28, 13, 16385, 24576),
+        new Code(29, 13, 24577, 32768)];
+}
+
+void writeShortLSB(ByteArrayOutputStream baos, int theShort) {
+
+    byte byte1 = cast(byte) (theShort & 0xff);
+    byte byte2 = cast(byte) ((theShort >> 8) & 0xff);
+    byte[] temp = [byte1, byte2];
+    baos.write(temp, 0, 2);
+
+}
+
+void writeInt(ByteArrayOutputStream baos, int theInt) {
+
+    byte byte1 = cast(byte) ((theInt >> 24) & 0xff);
+    byte byte2 = cast(byte) ((theInt >> 16) & 0xff);
+    byte byte3 = cast(byte) ((theInt >> 8) & 0xff);
+    byte byte4 = cast(byte) (theInt & 0xff);
+    byte[] temp = [byte1, byte2, byte3, byte4];
+    baos.write(temp, 0, 4);
+
+}
+
+void updateAdler(byte value) {
+
+    int low = adler32 & 0xffff;
+    int high = (adler32 >> 16) & 0xffff;
+    int valueInt = value & 0xff;
+    low = (low + valueInt) % BASE;
+    high = (low + high) % BASE;
+    adler32 = (high << 16) | low;
+
+}
+
+int hash(byte[] bytes) {
+
+    int hash = ((bytes[0] & 0xff) << 24 | (bytes[1] & 0xff) << 16 | (bytes[2] & 0xff) << 8) % HASH;
+    if (hash < 0) {
+        hash = hash + HASH;
+    }
+    return hash;
+
+}
+
+void writeBits(int value, int count) {
+
+    buffer |= value << bitCount;
+    bitCount += count;
+    if (bitCount >= 16) {
+        bytes.write(cast(byte) buffer);
+        bytes.write(cast(byte) (buffer >>> 8));
+        buffer >>>= 16;
+        bitCount -= 16;
+    }
+
+}
+
+void alignToByte() {
+
+    if (bitCount > 0) {
+        bytes.write(cast(byte) buffer);
+        if (bitCount > 8) bytes.write(cast(byte) (buffer >>> 8));
+    }
+    buffer = 0;
+    bitCount = 0;
+
+}
+
+void outputLiteral(byte literal) {
+
+    int i = literal & 0xff;
+
+    if (i <= 143) {
+        // 0 through 143 are 8 bits long starting at 00110000
+        writeBits(mirrorBytes[0x30 + i], 8);
+    }
+    else {
+        // 144 through 255 are 9 bits long starting at 110010000
+        writeBits(1 + 2 * mirrorBytes[0x90 - 144 + i], 9);
+    }
+
+}
+
+Code findCode(int value, Code[] codes) {
+
+    int i, j, k;
+
+    i = -1;
+    j = codes.length;
+    while (true) {
+        k = (j + i) / 2;
+        if (value < codes[k].min) {
+            j = k;
+        }
+        else if (value > codes[k].max) {
+            i = k;
+        }
+        else {
+            return codes[k];
+        }
+    }
+
+}
+
+void outputMatch(int length, int distance) {
+
+    Code d, l;
+    int thisLength;
+
+    while (length > 0) {
+
+        // we can transmit matches of lengths 3 through 258 inclusive
+        // so if length exceeds 258, we must transmit in several steps,
+        // with 258 or less in each step
+
+        if (length > 260) {
+            thisLength = 258;
+        }
+        else if (length <= 258) {
+            thisLength = length;
+        }
+        else {
+            thisLength = length - 3;
+        }
+
+        length = length - thisLength;
+
+        // find length code
+        l = findCode(thisLength, lengthCodes);
+
+        // transmit the length code
+        // 256 through 279 are 7 bits long starting at 0000000
+        // 280 through 287 are 8 bits long starting at 11000000
+        if (l.code <= 279) {
+            writeBits(mirrorBytes[(l.code - 256) * 2], 7);
+        }
+        else {
+            writeBits(mirrorBytes[0xc0 - 280 + l.code], 8);
+        }
+
+        // transmit the extra bits
+        if (l.extraBits !is 0) {
+            writeBits(thisLength - l.min, l.extraBits);
+        }
+
+        // find distance code
+        d = findCode(distance, distanceCodes);
+
+        // transmit the distance code
+        // 5 bits long starting at 00000
+        writeBits(mirrorBytes[d.code * 8], 5);
+
+        // transmit the extra bits
+        if (d.extraBits !is 0) {
+            writeBits(distance - d.min, d.extraBits);
+        }
+
+    }
+
+}
+
+Match findLongestMatch(int position, Link firstPosition) {
+
+    Link link = firstPosition;
+    int numberOfMatches = 0;
+    Match bestMatch = new Match(-1, -1);
+
+    while (true) {
+
+        int matchPosition = link.value;
+
+        if (position - matchPosition < WINDOW && matchPosition !is 0) {
+
+            int i;
+
+            for (i = 1; position + i < inLength; i++) {
+                if (istr[position + i] !is istr[matchPosition + i]) {
+                    break;
+                }
+            }
+
+            if (i >= MIN_LENGTH) {
+
+                if (i > bestMatch.length) {
+                    bestMatch.length = i;
+                    bestMatch.distance = position - matchPosition;
+                }
+
+                numberOfMatches = numberOfMatches + 1;
+
+                if (numberOfMatches is MAX_MATCHES) {
+                    break;
+                }
+
+            }
+
+        }
+
+        link = link.next;
+        if (link is null) {
+            break;
+        }
+
+    }
+
+    if (bestMatch.length < MIN_LENGTH || bestMatch.distance < 1 || bestMatch.distance > WINDOW) {
+        return null;
+    }
+
+    return bestMatch;
+
+}
+
+void updateHashtable(int to, int from) {
+
+    byte[] data = new byte[3];
+    int hashval;
+    Link temp;
+
+    for (int i = to; i < from; i++) {
+
+        if (i + MIN_LENGTH > inLength) {
+            break;
+        }
+
+        data[0] = istr[i];
+        data[1] = istr[i + 1];
+        data[2] = istr[i + 2];
+
+        hashval = hash(data);
+
+        if (window[nextWindow].previous !is null) {
+            window[nextWindow].previous.next = null;
+        }
+        else if (window[nextWindow].hash !is 0) {
+            hashtable[window[nextWindow].hash].next = null;
+        }
+
+        window[nextWindow].hash = hashval;
+        window[nextWindow].value = i;
+        window[nextWindow].previous = null;
+        temp = window[nextWindow].next = hashtable[hashval].next;
+        hashtable[hashval].next = window[nextWindow];
+        if (temp !is null) {
+            temp.previous = window[nextWindow];
+        }
+
+        nextWindow = nextWindow + 1;
+        if (nextWindow is WINDOW) {
+            nextWindow = 0;
+        }
+
+    }
+
+}
+
+void compress() {
+
+    int position, newPosition;
+    byte[] data = new byte[3];
+    int hashval;
+    for (int i = 0; i < HASH; i++) {
+        hashtable[i] = new Link();
+    }
+    for (int i = 0; i < WINDOW; i++) {
+        window[i] = new Link();
+    }
+    nextWindow = 0;
+    Link firstPosition;
+    Match match;
+    int deferredPosition = -1;
+    Match deferredMatch = null;
+
+    writeBits(0x01, 1); // BFINAL = 0x01 (final block)
+    writeBits(0x01, 2); // BTYPE = 0x01 (compression with fixed Huffman codes)
+
+    // just output first byte so we never match at zero
+    outputLiteral(istr[0]);
+    position = 1;
+
+    while (position < inLength) {
+
+        if (inLength - position < MIN_LENGTH) {
+            outputLiteral(istr[position]);
+            position = position + 1;
+            continue;
+        }
+
+        data[0] = istr[position];
+        data[1] = istr[position + 1];
+        data[2] = istr[position + 2];
+
+        hashval = hash(data);
+        firstPosition = hashtable[hashval];
+
+        match = findLongestMatch(position, firstPosition);
+
+        updateHashtable(position, position + 1);
+
+        if (match !is null) {
+
+            if (deferredMatch !is null) {
+                if (match.length > deferredMatch.length + 1) {
+                    // output literal at deferredPosition
+                    outputLiteral(istr[deferredPosition]);
+                    // defer this match
+                    deferredPosition = position;
+                    deferredMatch = match;
+                    position = position + 1;
+                }
+                else {
+                    // output deferredMatch
+                    outputMatch(deferredMatch.length, deferredMatch.distance);
+                    newPosition = deferredPosition + deferredMatch.length;
+                    deferredPosition = -1;
+                    deferredMatch = null;
+                    updateHashtable(position + 1, newPosition);
+                    position = newPosition;
+                }
+            }
+            else {
+                // defer this match
+                deferredPosition = position;
+                deferredMatch = match;
+                position = position + 1;
+            }
+
+        }
+
+        else {
+
+            // no match found
+            if (deferredMatch !is null) {
+                outputMatch(deferredMatch.length, deferredMatch.distance);
+                newPosition = deferredPosition + deferredMatch.length;
+                deferredPosition = -1;
+                deferredMatch = null;
+                updateHashtable(position + 1, newPosition);
+                position = newPosition;
+            }
+            else {
+                outputLiteral(istr[position]);
+                position = position + 1;
+            }
+
+        }
+
+    }
+
+    writeBits(0, 7); // end of block code
+    alignToByte();
+
+}
+
+void compressHuffmanOnly() {
+
+    int position;
+
+    writeBits(0x01, 1); // BFINAL = 0x01 (final block)
+    writeBits(0x01, 2); // BTYPE = 0x01 (compression with fixed Huffman codes)
+
+    for (position = 0; position < inLength;) {
+
+        outputLiteral(istr[position]);
+        position = position + 1;
+
+    }
+
+    writeBits(0, 7); // end of block code
+    alignToByte();
+
+}
+
+void store() {
+
+    // stored blocks are limited to 0xffff bytes
+
+    int start = 0;
+    int length = inLength;
+    int blockLength;
+    int BFINAL = 0x00; // BFINAL = 0x00 or 0x01 (if final block), BTYPE = 0x00 (no compression)
+
+    while (length > 0) {
+
+        if (length < 65535) {
+            blockLength = length;
+            BFINAL = 0x01;
+        }
+        else {
+            blockLength = 65535;
+            BFINAL = 0x00;
+        }
+
+        // write data header
+        bytes.write(cast(byte) BFINAL);
+        writeShortLSB(bytes, blockLength); // LEN
+        writeShortLSB(bytes, blockLength ^ 0xffff); // NLEN (one's complement of LEN)
+
+        // write actual data
+        bytes.write(istr, start, blockLength);
+
+        length = length - blockLength;
+        start = start + blockLength;
+
+    }
+
+}
+
+public byte[] deflate(byte[] input) {
+
+    istr = input;
+    inLength = input.length;
+
+    // write zlib header
+    bytes.write(cast(byte) 0x78); // window size = 0x70 (32768), compression method = 0x08
+    bytes.write(cast(byte) 0x9C); // compression level = 0x80 (default), check bits = 0x1C
+
+    // compute checksum
+    for (int i = 0; i < inLength; i++) {
+        updateAdler(istr[i]);
+    }
+
+    //store();
+
+    //compressHuffmanOnly();
+
+    compress();
+
+    // write checksum
+    writeInt(bytes, adler32);
+
+    return bytes.toByteArray();
+
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngEncoder.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,372 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.PngEncoder;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.image.LEDataOutputStream;
+import org.eclipse.swt.internal.image.PngDeflater;
+import java.io.ByteArrayOutputStream;
+import java.io.OutputStream;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.ImageLoader;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.internal.Compatibility;
+import org.eclipse.swt.internal.image.PngChunk;
+
+import tango.core.Exception;
+
+final class PngEncoder {
+
+    static const byte SIGNATURE[] = [cast(byte) '\211', cast(byte) 'P', cast(byte) 'N', cast(byte) 'G', cast(byte) '\r', cast(byte) '\n', cast(byte) '\032', cast(byte) '\n'];
+    static const byte TAG_IHDR[] = [cast(byte) 'I', cast(byte) 'H', cast(byte) 'D', cast(byte) 'R'];
+    static const byte TAG_PLTE[] = [cast(byte) 'P', cast(byte) 'L', cast(byte) 'T', cast(byte) 'E'];
+    static const byte TAG_TRNS[] = [cast(byte) 't', cast(byte) 'R', cast(byte) 'N', cast(byte) 'S'];
+    static const byte TAG_IDAT[] = [cast(byte) 'I', cast(byte) 'D', cast(byte) 'A', cast(byte) 'T'];
+    static const byte TAG_IEND[] = [cast(byte) 'I', cast(byte) 'E', cast(byte) 'N', cast(byte) 'D'];
+
+    ByteArrayOutputStream bytes;
+    PngChunk chunk;
+
+    ImageLoader loader;
+    ImageData data;
+    int transparencyType;
+
+    int width, height, bitDepth, colorType;
+
+    int compressionMethod = 0;
+    int filterMethod = 0;
+    int interlaceMethod = 0;
+
+public this(ImageLoader loader) {
+    this.bytes = new ByteArrayOutputStream(1024);
+    this.loader = loader;
+    this.data = loader.data[0];
+    this.transparencyType = data.getTransparencyType();
+
+    this.width = data.width;
+    this.height = data.height;
+
+    this.bitDepth = 8;
+
+    this.colorType = 2;
+
+    if (data.palette.isDirect) {
+        if (transparencyType is SWT.TRANSPARENCY_ALPHA) {
+            this.colorType = 6;
+        }
+    }
+    else {
+        this.colorType = 3;
+    }
+
+    if (!(colorType is 2 || colorType is 3 || colorType is 6)) SWT.error(SWT.ERROR_INVALID_IMAGE);
+
+}
+
+void writeShort(ByteArrayOutputStream baos, int theShort) {
+
+    byte byte1 = cast(byte) ((theShort >> 8) & 0xff);
+    byte byte2 = cast(byte) (theShort & 0xff);
+    byte[] temp = [byte1, byte2];
+    baos.write(temp, 0, 2);
+
+}
+
+void writeInt(ByteArrayOutputStream baos, int theInt) {
+
+    byte byte1 = cast(byte) ((theInt >> 24) & 0xff);
+    byte byte2 = cast(byte) ((theInt >> 16) & 0xff);
+    byte byte3 = cast(byte) ((theInt >> 8) & 0xff);
+    byte byte4 = cast(byte) (theInt & 0xff);
+    byte[] temp = [byte1, byte2, byte3, byte4];
+    baos.write(temp, 0, 4);
+
+}
+
+void writeChunk(byte[] tag, byte[] buffer) {
+
+    int bufferLength = (buffer !is null) ? buffer.length : 0;
+
+    chunk = new PngChunk(bufferLength);
+
+    writeInt(bytes, bufferLength);
+    bytes.write(tag, 0, 4);
+    chunk.setType(tag);
+    if (bufferLength !is 0) {
+        bytes.write(buffer, 0, bufferLength);
+        chunk.setData(buffer);
+    }
+    else {
+        chunk.setCRC(chunk.computeCRC());
+    }
+    writeInt(bytes, chunk.getCRC());
+
+}
+
+void writeSignature() {
+
+    bytes.write(SIGNATURE, 0, 8);
+
+}
+
+void writeHeader() {
+
+    ByteArrayOutputStream baos = new ByteArrayOutputStream(13);
+
+    writeInt(baos, width);
+    writeInt(baos, height);
+    baos.write(bitDepth);
+    baos.write(colorType);
+    baos.write(compressionMethod);
+    baos.write(filterMethod);
+    baos.write(interlaceMethod);
+
+    writeChunk(TAG_IHDR, baos.toByteArray());
+
+}
+
+void writePalette() {
+
+    RGB[] RGBs = data.palette.getRGBs();
+
+    if (RGBs.length > 256) SWT.error(SWT.ERROR_INVALID_IMAGE);
+
+    ByteArrayOutputStream baos = new ByteArrayOutputStream(RGBs.length);
+
+    for (int i = 0; i < RGBs.length; i++) {
+
+        baos.write(cast(byte) RGBs[i].red);
+        baos.write(cast(byte) RGBs[i].green);
+        baos.write(cast(byte) RGBs[i].blue);
+
+    }
+
+    writeChunk(TAG_PLTE, baos.toByteArray());
+
+}
+
+void writeTransparency() {
+
+    ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+    switch (transparencyType) {
+
+        case SWT.TRANSPARENCY_ALPHA:
+
+            int pixelValue, alphaValue;
+
+            byte[] alphas = new byte[data.palette.getRGBs().length];
+
+            for (int y = 0; y < height; y++) {
+
+                for (int x = 0; x < width; x++) {
+
+                    pixelValue = data.getPixel(x, y);
+                    alphaValue = data.getAlpha(x, y);
+
+                    alphas[pixelValue] = cast(byte) alphaValue;
+
+                }
+
+            }
+
+            baos.write(alphas, 0, alphas.length);
+
+            break;
+
+        case SWT.TRANSPARENCY_PIXEL:
+
+            int pixel = data.transparentPixel;
+
+            if (colorType is 2) {
+
+                int redMask = data.palette.redMask;
+                int redShift = data.palette.redShift;
+                int greenMask = data.palette.greenMask;
+                int greenShift = data.palette.greenShift;
+                int blueShift = data.palette.blueShift;
+                int blueMask = data.palette.blueMask;
+
+                int r = pixel & redMask;
+                r = (redShift < 0) ? r >>> -redShift : r << redShift;
+                int g = pixel & greenMask;
+                g = (greenShift < 0) ? g >>> -greenShift : g << greenShift;
+                int b = pixel & blueMask;
+                b = (blueShift < 0) ? b >>> -blueShift : b << blueShift;
+
+                writeShort(baos, r);
+                writeShort(baos, g);
+                writeShort(baos, b);
+
+            }
+
+            if (colorType is 3) {
+
+                byte[] padding = new byte[pixel + 1];
+
+                for (int i = 0; i < pixel; i++) {
+
+                    padding[i] = cast(byte) 255;
+
+                }
+
+                padding[pixel] = cast(byte) 0;
+
+                baos.write(padding, 0, padding.length);
+
+            }
+
+            break;
+        default:
+
+    }
+
+    writeChunk(TAG_TRNS, baos.toByteArray());
+
+}
+
+void writeImageData() {
+
+    ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
+    OutputStream os = Compatibility.newDeflaterOutputStream(baos);
+    if (os is null) os = baos;
+
+    if (colorType is 3) {
+
+        byte[] lineData = new byte[width];
+
+        for (int y = 0; y < height; y++) {
+
+            int filter = 0;
+            os.write(filter);
+
+            data.getPixels(0, y, width, lineData, 0);
+
+            for (int x = 0; x < lineData.length; x++) {
+
+                os.write(lineData[x]);
+
+            }
+
+        }
+
+    }
+
+    else {
+
+        int[] lineData = new int[width];
+        byte[] alphaData = null;
+        if (colorType is 6) {
+            alphaData = new byte[width];
+        }
+
+        int redMask = data.palette.redMask;
+        int redShift = data.palette.redShift;
+        int greenMask = data.palette.greenMask;
+        int greenShift = data.palette.greenShift;
+        int blueShift = data.palette.blueShift;
+        int blueMask = data.palette.blueMask;
+
+        for (int y = 0; y < height; y++) {
+
+            int filter = 0;
+            os.write(filter);
+
+            data.getPixels(0, y, width, lineData, 0);
+
+            if (colorType is 6) {
+                data.getAlphas(0, y, width, alphaData, 0);
+            }
+
+            for (int x = 0; x < lineData.length; x++) {
+
+                int pixel = lineData[x];
+
+                int r = pixel & redMask;
+                r = (redShift < 0) ? r >>> -redShift : r << redShift;
+                int g = pixel & greenMask;
+                g = (greenShift < 0) ? g >>> -greenShift : g << greenShift;
+                int b = pixel & blueMask;
+                b = (blueShift < 0) ? b >>> -blueShift : b << blueShift;
+
+                os.write(r);
+                os.write(g);
+                os.write(b);
+
+                if (colorType is 6) {
+                    os.write(alphaData[x]);
+                }
+
+            }
+
+        }
+
+    }
+
+    os.flush();
+    os.close();
+
+    byte[] compressed = baos.toByteArray();
+    if (os is baos) {
+        PngDeflater deflater = new PngDeflater();
+        compressed = deflater.deflate(compressed);
+    }
+
+    writeChunk(TAG_IDAT, compressed);
+
+}
+
+void writeEnd() {
+
+    writeChunk(TAG_IEND, null);
+
+}
+
+public void encode(LEDataOutputStream outputStream) {
+
+    try {
+
+        writeSignature();
+        writeHeader();
+
+        if (colorType is 3) {
+            writePalette();
+        }
+
+        bool transparencyAlpha = (transparencyType is SWT.TRANSPARENCY_ALPHA);
+        bool transparencyPixel = (transparencyType is SWT.TRANSPARENCY_PIXEL);
+        bool type2Transparency = (colorType is 2 && transparencyPixel);
+        bool type3Transparency = (colorType is 3 && (transparencyAlpha || transparencyPixel));
+
+        if (type2Transparency || type3Transparency) {
+            writeTransparency();
+        }
+
+        writeImageData();
+        writeEnd();
+
+        outputStream.write(bytes.toByteArray());
+
+    }
+
+    catch (IOException e) {
+
+        SWT.error(SWT.ERROR_IO, e);
+
+    }
+
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngFileReadState.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.PngFileReadState;
+
+import java.lang.all;
+
+
+class PngFileReadState {
+    bool readIHDR;
+    bool readPLTE;
+    bool readIDAT;
+    bool readIEND;
+
+    // Non - critical chunks
+    bool readTRNS;
+
+    // Set to true after IDATs have been read.
+    bool readPixelData;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngHuffmanTable.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,128 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.PngHuffmanTable;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.image.PngDecodingDataStream;
+
+public class PngHuffmanTable {
+    CodeLengthInfo[] codeLengthInfo;
+    int[] codeValues;
+
+    static const int MAX_CODE_LENGTH = 15;
+    static const int BAD_CODE = 0xFFFFFFF;
+    static const int incs[] = [1391376, 463792, 198768, 86961, 33936, 13776, 4592, 1968, 861, 336, 112, 48, 21, 7, 3, 1];
+
+this (int[] lengths) {
+    initialize(lengths);
+    generateTable(lengths);
+}
+
+private void initialize(int[] lengths) {
+    codeValues = new int[lengths.length];
+    for (int i = 0; i < codeValues.length; i++) {
+        codeValues[i] = i;
+    }
+
+    // minCodesByLength[n] : The smallest Huffman code of length n + 1.
+    // maxCodesByLength[n] : The largest Huffman code of length n + 1.
+    // indexesByLength[n] : Index into the values array. First value with a code of length n + 1.
+    codeLengthInfo = new CodeLengthInfo[MAX_CODE_LENGTH];
+    for (int i = 0; i < MAX_CODE_LENGTH; i++) {
+        codeLengthInfo[i] = new CodeLengthInfo();
+        codeLengthInfo[i].length = i;
+        codeLengthInfo[i].baseIndex = 0;
+        codeLengthInfo[i].min = BAD_CODE;
+        codeLengthInfo[i].max = -1;
+    }
+}
+
+private void generateTable(int[] lengths) {
+    // Sort the values using shellsort. Primary key is code size. Secondary key is value.
+    int codeValuesTemp;
+    for (int k = 0; k < 16; k++) {
+        for (int h = incs[k], i = h; i < lengths.length; i++) {
+            int v = lengths[i];
+            codeValuesTemp = codeValues[i];
+            int j = i;
+            while (j >= h && (lengths[j - h] > v || (lengths[j - h] is v && codeValues[j - h] > codeValuesTemp))) {
+                lengths[j] = lengths[j - h];
+                codeValues[j] = codeValues[j - h];
+                j -= h;
+            }
+            lengths[j] = v;
+            codeValues[j] = codeValuesTemp;
+        }
+    }
+
+    // These values in these arrays correspond to the elements of the
+    // "values" array. The Huffman code for codeValues[N] is codes[N]
+    // and the length of the code is lengths[N].
+    int[] codes = new int[lengths.length];
+    int lastLength = 0;
+    int code = 0;
+    for (int i = 0; i < lengths.length; i++) {
+        while (lastLength !is lengths[i]) {
+            lastLength++;
+            code <<= 1;
+        }
+        if (lastLength !is 0) {
+            codes[i] = code;
+            code++;
+        }
+    }
+
+    int last = 0;
+    for (int i = 0; i < lengths.length; i++) {
+        if (last !is lengths[i]) {
+            last = lengths[i];
+            codeLengthInfo[last - 1].baseIndex = i;
+            codeLengthInfo[last - 1].min = codes[i];
+        }
+        if (last !is 0) codeLengthInfo[last - 1].max = codes[i];
+    }
+}
+
+int getNextValue(PngDecodingDataStream stream) {
+    int code = stream.getNextIdatBit();
+    int codelength = 0;
+
+    // Here we are taking advantage of the fact that 1 bits are used as
+    // a prefix to the longer codeValues.
+    while (codelength < MAX_CODE_LENGTH && code > codeLengthInfo[codelength].max) {
+        code = ((code << 1) | stream.getNextIdatBit());
+        codelength++;
+    }
+    if (codelength >= MAX_CODE_LENGTH) stream.error();
+
+    // Now we have a Huffman code of length (codelength + 1) that
+    // is somewhere in the range
+    // minCodesByLength[codelength]..maxCodesByLength[codelength].
+    // This code is the (offset + 1)'th code of (codelength + 1);
+    int offset = code - codeLengthInfo[codelength].min;
+
+    // indexesByLength[codelength] is the first code of length (codelength + 1)
+    // so now we can look up the value for the Huffman code in the table.
+    int index = codeLengthInfo[codelength].baseIndex + offset;
+    return codeValues[index];
+}
+
+static class CodeLengthInfo {
+    int length;
+    int max;
+    int min;
+    int baseIndex;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngHuffmanTables.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,166 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.PngHuffmanTables;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.image.PngHuffmanTable;
+import org.eclipse.swt.internal.image.PngDecodingDataStream;
+import org.eclipse.swt.internal.image.PngLzBlockReader;
+
+public class PngHuffmanTables {
+    PngHuffmanTable literalTable;
+    PngHuffmanTable distanceTable;
+
+    static PngHuffmanTable FixedLiteralTable;
+    static PngHuffmanTable FixedDistanceTable;
+
+    static final int LiteralTableSize = 288;
+    static final int[] FixedLiteralLengths = [
+        8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+        8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+        8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+        8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+        8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+        8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+        9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+        9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+        9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+        9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+        9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 7, 7, 7, 7, 7, 7, 7, 7,
+        7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8,
+    ];
+
+    static final int DistanceTableSize = 32;
+    static final int[] FixedDistanceLengths = [
+        5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+        5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+    ];
+
+    static final int LengthCodeTableSize = 19;
+    static final int[] LengthCodeOrder = [
+        16, 17, 18, 0, 8, 7, 9, 6, 10, 5,
+        11, 4, 12, 3, 13, 2, 14, 1, 15
+    ];
+
+static PngHuffmanTables getDynamicTables(PngDecodingDataStream stream)  {
+    return new PngHuffmanTables(stream);
+}
+static PngHuffmanTables getFixedTables() {
+    return new PngHuffmanTables();
+}
+
+private PngHuffmanTable getFixedLiteralTable() {
+    if (FixedLiteralTable is null) {
+        FixedLiteralTable = new PngHuffmanTable(FixedLiteralLengths);
+    }
+    return FixedLiteralTable;
+}
+
+private PngHuffmanTable getFixedDistanceTable() {
+    if (FixedDistanceTable is null) {
+        FixedDistanceTable = new PngHuffmanTable(FixedDistanceLengths);
+    }
+    return FixedDistanceTable;
+}
+
+private this () {
+    literalTable = getFixedLiteralTable();
+    distanceTable = getFixedDistanceTable();
+}
+
+private this (PngDecodingDataStream stream)  {
+    int literals = PngLzBlockReader.FIRST_LENGTH_CODE
+        + stream.getNextIdatBits(5);
+    int distances = PngLzBlockReader.FIRST_DISTANCE_CODE
+        + stream.getNextIdatBits(5);
+    int codeLengthCodes = PngLzBlockReader.FIRST_CODE_LENGTH_CODE
+        + stream.getNextIdatBits(4);
+
+    if (codeLengthCodes > PngLzBlockReader.LAST_CODE_LENGTH_CODE) {
+        stream.error();
+    }
+
+    /* Tricky, tricky, tricky. The length codes are stored in
+     * a very odd order. (For the order, see the definition of
+     * the static field lengthCodeOrder.) Also, the data may
+     * not contain values for all the codes. It may just contain
+     * values for the first X number of codes. The table should
+     * be of size <LengthCodeTableSize> regardless of the number
+     * of values actually given in the table.
+     */
+    int[] lengthCodes = new int[LengthCodeTableSize];
+    for (int i = 0; i < codeLengthCodes; i++) {
+        lengthCodes[LengthCodeOrder[i]] = stream.getNextIdatBits(3);
+    }
+    PngHuffmanTable codeLengthsTable = new PngHuffmanTable(lengthCodes);
+
+    int[] literalLengths = readLengths(
+        stream, literals, codeLengthsTable, LiteralTableSize);
+    int[] distanceLengths = readLengths(
+        stream, distances, codeLengthsTable, DistanceTableSize);
+
+    literalTable = new PngHuffmanTable(literalLengths);
+    distanceTable = new PngHuffmanTable(distanceLengths);
+}
+
+private int [] readLengths (PngDecodingDataStream stream,
+    int numLengths,
+    PngHuffmanTable lengthsTable,
+    int tableSize)
+{
+    int[] lengths = new int[tableSize];
+
+    for (int index = 0; index < numLengths;) {
+        int value = lengthsTable.getNextValue(stream);
+        if (value < 16) {
+            // Literal value
+            lengths[index] = value;
+            index++;
+        } else if (value is 16) {
+            // Repeat the previous code 3-6 times.
+            int count = stream.getNextIdatBits(2) + 3;
+            for (int i = 0; i < count; i++) {
+                lengths[index] = lengths [index - 1];
+                index++;
+            }
+        } else if (value is 17) {
+            // Repeat 0 3-10 times.
+            int count = stream.getNextIdatBits(3) + 3;
+            for (int i = 0; i < count; i++) {
+                lengths[index] = 0;
+                index++;
+            }
+        } else if (value is 18) {
+            // Repeat 0 11-138 times.
+            int count = stream.getNextIdatBits(7) + 11;
+            for (int i = 0; i < count; i++) {
+                lengths[index] = 0;
+                index++;
+            }
+        } else {
+            stream.error();
+        }
+    }
+    return lengths;
+}
+
+int getNextLiteralValue(PngDecodingDataStream stream)  {
+    return literalTable.getNextValue(stream);
+}
+
+int getNextDistanceValue(PngDecodingDataStream stream)  {
+    return distanceTable.getNextValue(stream);
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngIdatChunk.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.PngIdatChunk;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.image.PngFileReadState;
+import org.eclipse.swt.internal.image.PngIhdrChunk;
+import org.eclipse.swt.internal.image.PngChunk;
+import java.lang.all;
+
+class PngIdatChunk : PngChunk {
+
+    static const int HEADER_BYTES_LENGTH = 2;
+    static const int ADLER_FIELD_LENGTH = 4;
+    static const int HEADER_BYTE1_DATA_OFFSET = DATA_OFFSET + 0;
+    static const int HEADER_BYTE2_DATA_OFFSET = DATA_OFFSET + 1;
+    static const int ADLER_DATA_OFFSET = DATA_OFFSET + 2; // plus variable compressed data length
+
+this(byte headerByte1, byte headerByte2, byte[] data, int adler) {
+    super(data.length + HEADER_BYTES_LENGTH + ADLER_FIELD_LENGTH);
+    setType(TYPE_IDAT);
+    reference[HEADER_BYTE1_DATA_OFFSET] = headerByte1;
+    reference[HEADER_BYTE2_DATA_OFFSET] = headerByte2;
+    System.arraycopy(data, 0, reference, DATA_OFFSET, data.length);
+    setInt32(ADLER_DATA_OFFSET, adler);
+    setCRC(computeCRC());
+}
+
+this(byte[] reference) {
+    super(reference);
+}
+
+override int getChunkType() {
+    return CHUNK_IDAT;
+}
+
+/**
+ * Answer whether the chunk is a valid IDAT chunk.
+ */
+override void validate(PngFileReadState readState, PngIhdrChunk headerChunk) {
+    if (!readState.readIHDR
+        || (headerChunk.getMustHavePalette() && !readState.readPLTE)
+        || readState.readIEND)
+    {
+        SWT.error(SWT.ERROR_INVALID_IMAGE);
+    } else {
+        readState.readIDAT = true;
+    }
+
+    super.validate(readState, headerChunk);
+}
+
+byte getDataByteAtOffset(int offset) {
+    return reference[DATA_OFFSET + offset];
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngIendChunk.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.PngIendChunk;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.image.PngFileReadState;
+import org.eclipse.swt.internal.image.PngIhdrChunk;
+import org.eclipse.swt.internal.image.PngChunk;
+
+class PngIendChunk : PngChunk {
+
+this() {
+    super(0);
+    setType(TYPE_IEND);
+    setCRC(computeCRC());
+}
+
+this(byte[] reference){
+    super(reference);
+}
+
+override int getChunkType() {
+    return CHUNK_IEND;
+}
+
+/**
+ * Answer whether the chunk is a valid IEND chunk.
+ */
+override void validate(PngFileReadState readState, PngIhdrChunk headerChunk) {
+    // An IEND chunk is invalid if no IHDR has been read.
+    // Or if a palette is required and has not been read.
+    // Or if no IDAT chunk has been read.
+    if (!readState.readIHDR
+        || (headerChunk.getMustHavePalette() && !readState.readPLTE)
+        || !readState.readIDAT
+        || readState.readIEND)
+    {
+        SWT.error(SWT.ERROR_INVALID_IMAGE);
+    } else {
+        readState.readIEND = true;
+    }
+
+    super.validate(readState, headerChunk);
+
+    // IEND chunks are not allowed to have any data.
+    if (getLength() > 0) SWT.error(SWT.ERROR_INVALID_IMAGE);
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngIhdrChunk.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,405 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.PngIhdrChunk;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.PaletteData;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.internal.image.PngFileReadState;
+import org.eclipse.swt.internal.image.PngIhdrChunk;
+import org.eclipse.swt.internal.image.PngChunk;
+import tango.text.convert.Format;
+
+class PngIhdrChunk : PngChunk {
+    static const int IHDR_DATA_LENGTH = 13;
+
+    static const int WIDTH_DATA_OFFSET = DATA_OFFSET + 0;
+    static const int HEIGHT_DATA_OFFSET = DATA_OFFSET + 4;
+    static const int BIT_DEPTH_OFFSET = DATA_OFFSET + 8;
+    static const int COLOR_TYPE_OFFSET = DATA_OFFSET + 9;
+    static const int COMPRESSION_METHOD_OFFSET = DATA_OFFSET + 10;
+    static const int FILTER_METHOD_OFFSET = DATA_OFFSET + 11;
+    static const int INTERLACE_METHOD_OFFSET = DATA_OFFSET + 12;
+
+    static const byte COLOR_TYPE_GRAYSCALE = 0;
+    static const byte COLOR_TYPE_RGB = 2;
+    static const byte COLOR_TYPE_PALETTE = 3;
+    static const byte COLOR_TYPE_GRAYSCALE_WITH_ALPHA = 4;
+    static const byte COLOR_TYPE_RGB_WITH_ALPHA = 6;
+
+    static const int INTERLACE_METHOD_NONE = 0;
+    static const int INTERLACE_METHOD_ADAM7 = 1;
+
+    static const int FILTER_NONE = 0;
+    static const int FILTER_SUB = 1;
+    static const int FILTER_UP = 2;
+    static const int FILTER_AVERAGE = 3;
+    static const int FILTER_PAETH = 4;
+
+    static const byte[] ValidBitDepths = [ cast(byte)1, 2, 4, 8, 16];
+    static const byte[] ValidColorTypes = [ cast(byte)0, 2, 3, 4, 6];
+
+    int width, height;
+    byte bitDepth, colorType, compressionMethod, filterMethod, interlaceMethod;
+
+this(int width, int height, byte bitDepth, byte colorType, byte compressionMethod, byte filterMethod, byte interlaceMethod) {
+    super(IHDR_DATA_LENGTH);
+    setType(TYPE_IHDR);
+    setWidth(width);
+    setHeight(height);
+    setBitDepth(bitDepth);
+    setColorType(colorType);
+    setCompressionMethod(compressionMethod);
+    setFilterMethod(filterMethod);
+    setInterlaceMethod(interlaceMethod);
+    setCRC(computeCRC());
+}
+
+/**
+ * Construct a PNGChunk using the reference bytes
+ * given.
+ */
+this(byte[] reference) {
+    super(reference);
+    if (reference.length <= IHDR_DATA_LENGTH) SWT.error(SWT.ERROR_INVALID_IMAGE);
+    width = getInt32(WIDTH_DATA_OFFSET);
+    height = getInt32(HEIGHT_DATA_OFFSET);
+    bitDepth = reference[BIT_DEPTH_OFFSET];
+    colorType = reference[COLOR_TYPE_OFFSET];
+    compressionMethod = reference[COMPRESSION_METHOD_OFFSET];
+    filterMethod = reference[FILTER_METHOD_OFFSET];
+    interlaceMethod = reference[INTERLACE_METHOD_OFFSET];
+}
+
+override int getChunkType() {
+    return CHUNK_IHDR;
+}
+
+/**
+ * Get the image's width in pixels.
+ */
+int getWidth() {
+    return width;
+}
+
+/**
+ * Set the image's width in pixels.
+ */
+void setWidth(int value) {
+    setInt32(WIDTH_DATA_OFFSET, value);
+    width = value;
+}
+
+/**
+ * Get the image's height in pixels.
+ */
+int getHeight() {
+    return height;
+}
+
+/**
+ * Set the image's height in pixels.
+ */
+void setHeight(int value) {
+    setInt32(HEIGHT_DATA_OFFSET, value);
+    height = value;
+}
+
+/**
+ * Get the image's bit depth.
+ * This is limited to the values 1, 2, 4, 8, or 16.
+ */
+byte getBitDepth() {
+    return bitDepth;
+}
+
+/**
+ * Set the image's bit depth.
+ * This is limited to the values 1, 2, 4, 8, or 16.
+ */
+void setBitDepth(byte value) {
+    reference[BIT_DEPTH_OFFSET] = value;
+    bitDepth = value;
+}
+
+/**
+ * Get the image's color type.
+ * This is limited to the values:
+ * 0 - Grayscale image.
+ * 2 - RGB triple.
+ * 3 - Palette.
+ * 4 - Grayscale with Alpha channel.
+ * 6 - RGB with Alpha channel.
+ */
+byte getColorType() {
+    return colorType;
+}
+
+/**
+ * Set the image's color type.
+ * This is limited to the values:
+ * 0 - Grayscale image.
+ * 2 - RGB triple.
+ * 3 - Palette.
+ * 4 - Grayscale with Alpha channel.
+ * 6 - RGB with Alpha channel.
+ */
+void setColorType(byte value) {
+    reference[COLOR_TYPE_OFFSET] = value;
+    colorType = value;
+}
+
+/**
+ * Get the image's compression method.
+ * This value must be 0.
+ */
+byte getCompressionMethod() {
+    return compressionMethod;
+}
+
+/**
+ * Set the image's compression method.
+ * This value must be 0.
+ */
+void setCompressionMethod(byte value) {
+    reference[COMPRESSION_METHOD_OFFSET] = value;
+    compressionMethod = value;
+}
+
+/**
+ * Get the image's filter method.
+ * This value must be 0.
+ */
+byte getFilterMethod() {
+    return filterMethod;
+}
+
+/**
+ * Set the image's filter method.
+ * This value must be 0.
+ */
+void setFilterMethod(byte value) {
+    reference[FILTER_METHOD_OFFSET] = value;
+    filterMethod = value;
+}
+
+/**
+ * Get the image's interlace method.
+ * This value is limited to:
+ * 0 - No interlacing used.
+ * 1 - Adam7 interlacing used.
+ */
+byte getInterlaceMethod() {
+    return interlaceMethod;
+}
+
+/**
+ * Set the image's interlace method.
+ * This value is limited to:
+ * 0 - No interlacing used.
+ * 1 - Adam7 interlacing used.
+ */
+void setInterlaceMethod(byte value) {
+    reference[INTERLACE_METHOD_OFFSET] = value;
+    interlaceMethod = value;
+}
+
+/**
+ * Answer whether the chunk is a valid IHDR chunk.
+ */
+override void validate(PngFileReadState readState, PngIhdrChunk headerChunk) {
+    // An IHDR chunk is invalid if any other chunk has
+    // been read.
+    if (readState.readIHDR
+        || readState.readPLTE
+        || readState.readIDAT
+        || readState.readIEND)
+    {
+        SWT.error(SWT.ERROR_INVALID_IMAGE);
+    } else {
+        readState.readIHDR = true;
+    }
+
+    super.validate(readState, headerChunk);
+
+    if (length !is IHDR_DATA_LENGTH) SWT.error(SWT.ERROR_INVALID_IMAGE);
+    if (compressionMethod !is 0) SWT.error(SWT.ERROR_INVALID_IMAGE);
+    if (interlaceMethod !is INTERLACE_METHOD_NONE &&
+        interlaceMethod !is INTERLACE_METHOD_ADAM7) {
+            SWT.error(SWT.ERROR_INVALID_IMAGE);
+    }
+
+    bool colorTypeIsValid = false;
+    for (int i = 0; i < ValidColorTypes.length; i++) {
+        if (ValidColorTypes[i] is colorType) {
+            colorTypeIsValid = true;
+            break;
+        }
+    }
+    if (!colorTypeIsValid) SWT.error(SWT.ERROR_INVALID_IMAGE);
+
+    bool bitDepthIsValid = false;
+    for (int i = 0; i < ValidBitDepths.length; i++) {
+        if (ValidBitDepths[i] is bitDepth) {
+            bitDepthIsValid = true;
+            break;
+        }
+    }
+    if (!bitDepthIsValid) SWT.error(SWT.ERROR_INVALID_IMAGE);
+
+    if ((colorType is COLOR_TYPE_RGB
+        || colorType is COLOR_TYPE_RGB_WITH_ALPHA
+        || colorType is COLOR_TYPE_GRAYSCALE_WITH_ALPHA)
+        && bitDepth < 8)
+    {
+            SWT.error(SWT.ERROR_INVALID_IMAGE);
+    }
+
+    if (colorType is COLOR_TYPE_PALETTE && bitDepth > 8) {
+        SWT.error(SWT.ERROR_INVALID_IMAGE);
+    }
+}
+
+String getColorTypeString() {
+    switch (colorType) {
+        case COLOR_TYPE_GRAYSCALE:              return "Grayscale";
+        case COLOR_TYPE_RGB:                    return "RGB";
+        case COLOR_TYPE_PALETTE:                return "Palette";
+        case COLOR_TYPE_GRAYSCALE_WITH_ALPHA:   return "Grayscale with Alpha";
+        case COLOR_TYPE_RGB_WITH_ALPHA:         return "RGB with Alpha";
+        default:                                return "Unknown - " ~ cast(char)colorType;
+    }
+}
+
+String getFilterMethodString() {
+    switch (filterMethod) {
+        case FILTER_NONE:       return "None";
+        case FILTER_SUB:        return "Sub";
+        case FILTER_UP:         return "Up";
+        case FILTER_AVERAGE:    return "Average";
+        case FILTER_PAETH:      return "Paeth";
+        default:                return "Unknown";
+    }
+}
+
+String getInterlaceMethodString() {
+    switch (interlaceMethod) {
+        case INTERLACE_METHOD_NONE:     return "Not Interlaced";
+        case INTERLACE_METHOD_ADAM7:    return "Interlaced - ADAM7";
+        default:                return "Unknown";
+    }
+}
+
+override String contributeToString() {
+    return Format( "\n\tWidth: {}\n\tHeight: {}\n\tBit Depth: {}\n\tColor Type: {}\n\tCompression Method: {}\n\tFilter Method: {}\n\tInterlace Method: {}",
+        width, height, bitDepth, getColorTypeString(), compressionMethod, getFilterMethodString(), getInterlaceMethodString() );
+}
+
+bool getMustHavePalette() {
+    return colorType is COLOR_TYPE_PALETTE;
+}
+
+bool getCanHavePalette() {
+    return colorType !is COLOR_TYPE_GRAYSCALE &&
+        colorType !is COLOR_TYPE_GRAYSCALE_WITH_ALPHA;
+}
+
+/**
+ * Answer the pixel size in bits based on the color type
+ * and bit depth.
+ */
+int getBitsPerPixel() {
+    switch (colorType) {
+        case COLOR_TYPE_RGB_WITH_ALPHA:
+            return 4 * bitDepth;
+        case COLOR_TYPE_RGB:
+            return 3 * bitDepth;
+        case COLOR_TYPE_GRAYSCALE_WITH_ALPHA:
+            return 2 * bitDepth;
+        case COLOR_TYPE_GRAYSCALE:
+        case COLOR_TYPE_PALETTE:
+            return bitDepth;
+        default:
+            SWT.error(SWT.ERROR_INVALID_IMAGE);
+            return 0;
+    }
+}
+
+/**
+ * Answer the pixel size in bits based on the color type
+ * and bit depth.
+ */
+int getSwtBitsPerPixel() {
+    switch (colorType) {
+        case COLOR_TYPE_RGB_WITH_ALPHA:
+        case COLOR_TYPE_RGB:
+        case COLOR_TYPE_GRAYSCALE_WITH_ALPHA:
+            return 24;
+        case COLOR_TYPE_GRAYSCALE:
+        case COLOR_TYPE_PALETTE:
+            return Math.min(bitDepth, 8);
+        default:
+            SWT.error(SWT.ERROR_INVALID_IMAGE);
+            return 0;
+    }
+}
+
+int getFilterByteOffset() {
+    if (bitDepth < 8) return 1;
+    return getBitsPerPixel() / 8;
+}
+
+bool usesDirectColor() {
+    switch (colorType) {
+        case COLOR_TYPE_GRAYSCALE:
+        case COLOR_TYPE_GRAYSCALE_WITH_ALPHA:
+        case COLOR_TYPE_RGB:
+        case COLOR_TYPE_RGB_WITH_ALPHA:
+            return true;
+        default:
+            return false;
+    }
+}
+
+PaletteData createGrayscalePalette() {
+    int depth = Math.min(bitDepth, 8);
+    int max = (1 << depth) - 1;
+    int delta = 255 / max;
+    int gray = 0;
+    RGB[] rgbs = new RGB[max + 1];
+    for (int i = 0; i <= max; i++) {
+        rgbs[i] = new RGB(gray, gray, gray);
+        gray += delta;
+    }
+    return new PaletteData(rgbs);
+}
+
+PaletteData getPaletteData() {
+    switch (colorType) {
+        case COLOR_TYPE_GRAYSCALE:
+            return createGrayscalePalette();
+        case COLOR_TYPE_GRAYSCALE_WITH_ALPHA:
+        case COLOR_TYPE_RGB:
+        case COLOR_TYPE_RGB_WITH_ALPHA:
+            return new PaletteData(0xFF0000, 0xFF00, 0xFF);
+        default:
+            return null;
+    }
+}
+
+
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngInputStream.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.PngInputStream;
+
+import java.lang.all;
+
+import java.io.InputStream;
+import org.eclipse.swt.internal.image.PngIdatChunk;
+import org.eclipse.swt.internal.image.PngChunkReader;
+import org.eclipse.swt.internal.image.PngChunk;
+
+import tango.core.Exception;
+
+public class PngInputStream : InputStream {
+
+    alias InputStream.read read;
+
+    PngChunkReader reader;
+    PngChunk chunk;
+    int offset, length;
+
+    final static int DATA_OFFSET = 8;
+
+public this(PngIdatChunk chunk, PngChunkReader reader) {
+    this.chunk = chunk;
+    this.reader = reader;
+    length = chunk.getLength();
+    offset = 0;
+}
+
+private bool checkChunk()  {
+    while (offset is length) {
+        chunk = reader.readNextChunk();
+        if (chunk is null) throw new IOException("no data");
+        if (chunk.getChunkType() is PngChunk.CHUNK_IEND) return false;
+        if (chunk.getChunkType() !is PngChunk.CHUNK_IDAT) throw new IOException("");
+        length = chunk.getLength();
+        offset = 0;
+    }
+    return true;
+}
+
+public override void close()  {
+    chunk = null;
+}
+
+public override int read()  {
+    if (chunk is null) throw new IOException("");
+    if (offset is length && !checkChunk()) return -1;
+    int b = chunk.reference[DATA_OFFSET + offset] & 0xFF;
+    offset++;
+    return b;
+}
+
+public override int read(byte[] b, int off, int len)  {
+    if (chunk is null) throw new IOException("");
+    if (offset is length && !checkChunk()) return -1;
+    len = Math.min(len, length - offset);
+    System.arraycopy(chunk.reference, DATA_OFFSET + offset, b, off, len);
+    offset += len;
+    return len;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngLzBlockReader.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,177 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.PngLzBlockReader;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.image.PngDecodingDataStream;
+import org.eclipse.swt.internal.image.PngHuffmanTables;
+
+public class PngLzBlockReader {
+    bool isLastBlock;
+    byte compressionType;
+    int uncompressedBytesRemaining;
+    PngDecodingDataStream stream;
+    PngHuffmanTables huffmanTables;
+
+    byte[] window;
+    int windowIndex;
+    int copyIndex;
+    int copyBytesRemaining;
+
+    static const int UNCOMPRESSED = 0;
+    static const int COMPRESSED_FIXED = 1;
+    static const int COMPRESSED_DYNAMIC = 2;
+
+    static const int END_OF_COMPRESSED_BLOCK = 256;
+    static const int FIRST_LENGTH_CODE = 257;
+    static const int LAST_LENGTH_CODE = 285;
+    static const int FIRST_DISTANCE_CODE = 1;
+    static const int LAST_DISTANCE_CODE = 29;
+    static const int FIRST_CODE_LENGTH_CODE = 4;
+    static const int LAST_CODE_LENGTH_CODE = 19;
+
+    static const int[] lengthBases = [
+        3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27,
+        31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258
+    ];
+    static const int[] extraLengthBits = [
+        0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
+        3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0,
+    ];
+    static const int[] distanceBases = [
+        1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129,
+        193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097,
+        6145, 8193, 12289, 16385, 24577,
+    ];
+    static const int[] extraDistanceBits = [
+        0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7,  7,
+        8,  8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13,
+    ];
+
+
+this(PngDecodingDataStream stream) {
+    this.stream = stream;
+    isLastBlock = false;
+}
+
+void setWindowSize(int windowSize) {
+    window = new byte[windowSize];
+}
+
+void readNextBlockHeader()  {
+    isLastBlock = stream.getNextIdatBit() !is 0;
+    compressionType = cast(byte)(stream.getNextIdatBits(2) & 0xFF);
+    if (compressionType > 2) stream.error();
+
+    if (compressionType is UNCOMPRESSED) {
+        byte b1 = stream.getNextIdatByte();
+        byte b2 = stream.getNextIdatByte();
+        byte b3 = stream.getNextIdatByte();
+        byte b4 = stream.getNextIdatByte();
+        if (b1 !is ~b3 || b2 !is ~b4) stream.error();
+        uncompressedBytesRemaining = (b1 & 0xFF) | ((b2 & 0xFF) << 8);
+    } else if (compressionType is COMPRESSED_DYNAMIC) {
+        huffmanTables = PngHuffmanTables.getDynamicTables(stream);
+    } else {
+        huffmanTables = PngHuffmanTables.getFixedTables();
+    }
+}
+
+byte getNextByte()  {
+    if (compressionType is UNCOMPRESSED) {
+        if (uncompressedBytesRemaining is 0) {
+            readNextBlockHeader();
+            return getNextByte();
+        }
+        uncompressedBytesRemaining--;
+        return stream.getNextIdatByte();
+    } else {
+        byte value = getNextCompressedByte();
+        if (value is END_OF_COMPRESSED_BLOCK) {
+            if (isLastBlock) stream.error();
+            readNextBlockHeader();
+            return getNextByte();
+        } else {
+            return value;
+        }
+    }
+}
+
+private void assertBlockAtEnd()  {
+    if (compressionType is UNCOMPRESSED) {
+        if (uncompressedBytesRemaining > 0) stream.error();
+    } else if (copyBytesRemaining > 0 ||
+        (huffmanTables.getNextLiteralValue(stream) !is END_OF_COMPRESSED_BLOCK))
+    {
+        stream.error();
+    }
+}
+void assertCompressedDataAtEnd()  {
+    assertBlockAtEnd();
+    while (!isLastBlock) {
+        readNextBlockHeader();
+        assertBlockAtEnd();
+    }
+}
+
+private byte getNextCompressedByte()  {
+    if (copyBytesRemaining > 0) {
+        byte value = window[copyIndex];
+        window[windowIndex] = value;
+        copyBytesRemaining--;
+
+        copyIndex++;
+        windowIndex++;
+        if (copyIndex is window.length) copyIndex = 0;
+        if (windowIndex is window.length) windowIndex = 0;
+
+        return value;
+    }
+
+    int value = huffmanTables.getNextLiteralValue(stream);
+    if (value < END_OF_COMPRESSED_BLOCK) {
+        window[windowIndex] = cast(byte) (value & 0xFF);
+        windowIndex++;
+        if (windowIndex >= window.length) windowIndex = 0;
+        return cast(byte) (value & 0xFF);
+    } else if (value is END_OF_COMPRESSED_BLOCK) {
+        readNextBlockHeader();
+        return getNextByte();
+    } else if (value <= LAST_LENGTH_CODE) {
+        int extraBits = extraLengthBits[value - FIRST_LENGTH_CODE];
+        int length = lengthBases[value - FIRST_LENGTH_CODE];
+        if (extraBits > 0) {
+            length += stream.getNextIdatBits(extraBits);
+        }
+
+        value = huffmanTables.getNextDistanceValue(stream);
+        if (value > LAST_DISTANCE_CODE) stream.error();
+        extraBits = extraDistanceBits[value];
+        int distance = distanceBases[value];
+        if (extraBits > 0) {
+            distance += stream.getNextIdatBits(extraBits);
+        }
+
+        copyIndex = windowIndex - distance;
+        if (copyIndex < 0) copyIndex += window.length;
+
+        copyBytesRemaining = length;
+        return getNextCompressedByte();
+    } else {
+        stream.error();
+        return 0;
+    }
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngPlteChunk.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,132 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.PngPlteChunk;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.PaletteData;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.internal.image.PngChunk;
+import org.eclipse.swt.internal.image.PngFileReadState;
+import org.eclipse.swt.internal.image.PngIhdrChunk;
+
+import tango.text.convert.Format;
+
+class PngPlteChunk : PngChunk {
+
+    int paletteSize;
+
+this(PaletteData palette) {
+    super(palette.getRGBs().length * 3);
+    paletteSize = length / 3;
+    setType(TYPE_PLTE);
+    setPaletteData(palette);
+    setCRC(computeCRC());
+}
+
+this(byte[] reference){
+    super(reference);
+    paletteSize = length / 3;
+}
+
+override int getChunkType() {
+    return CHUNK_PLTE;
+}
+
+/**
+ * Get the number of colors in this palette.
+ */
+int getPaletteSize() {
+    return paletteSize;
+}
+
+/**
+ * Get a PaletteData object representing the colors
+ * stored in this PLTE chunk.
+ * The result should be cached as the PLTE chunk
+ * does not store the palette data created.
+ */
+PaletteData getPaletteData() {
+    RGB[] rgbs = new RGB[paletteSize];
+//  int start = DATA_OFFSET;
+//  int end = DATA_OFFSET + length;
+    for (int i = 0; i < rgbs.length; i++) {
+        int offset = DATA_OFFSET + (i * 3);
+        int red = reference[offset] & 0xFF;
+        int green = reference[offset + 1] & 0xFF;
+        int blue = reference[offset + 2] & 0xFF;
+        rgbs[i] = new RGB(red, green, blue);
+    }
+    return new PaletteData(rgbs);
+}
+
+/**
+ * Set the data of a PLTE chunk to the colors
+ * stored in the specified PaletteData object.
+ */
+void setPaletteData(PaletteData palette) {
+    RGB[] rgbs = palette.getRGBs();
+    for (int i = 0; i < rgbs.length; i++) {
+        int offset = DATA_OFFSET + (i * 3);
+        reference[offset] = cast(byte) rgbs[i].red;
+        reference[offset + 1] = cast(byte) rgbs[i].green;
+        reference[offset + 2] = cast(byte) rgbs[i].blue;
+    }
+}
+
+/**
+ * Answer whether the chunk is a valid PLTE chunk.
+ */
+override void validate(PngFileReadState readState, PngIhdrChunk headerChunk) {
+    // A PLTE chunk is invalid if no IHDR has been read or if any PLTE,
+    // IDAT, or IEND chunk has been read.
+    if (!readState.readIHDR
+        || readState.readPLTE
+        || readState.readTRNS
+        || readState.readIDAT
+        || readState.readIEND)
+    {
+        SWT.error(SWT.ERROR_INVALID_IMAGE);
+    } else {
+        readState.readPLTE = true;
+    }
+
+    super.validate(readState, headerChunk);
+
+    // Palettes cannot be included in grayscale images.
+    //
+    // Note: just ignore the palette.
+//  if (!headerChunk.getCanHavePalette()) SWT.error(SWT.ERROR_INVALID_IMAGE);
+
+    // Palette chunks' data fields must be event multiples
+    // of 3. Each 3-byte group represents an RGB value.
+    if (getLength() % 3 !is 0) SWT.error(SWT.ERROR_INVALID_IMAGE);   
+
+    // Palettes cannot have more entries than 2^bitDepth
+    // where bitDepth is the bit depth of the image given
+    // in the IHDR chunk.
+    if (1 << headerChunk.getBitDepth() < paletteSize) {
+        SWT.error(SWT.ERROR_INVALID_IMAGE);
+    }
+
+    // Palettes cannot have more than 256 entries.
+    if (256 < paletteSize) SWT.error(SWT.ERROR_INVALID_IMAGE);
+}
+
+override String contributeToString() {
+    return Format("\n\tPalette size:{}", paletteSize );
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/PngTrnsChunk.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,166 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.PngTrnsChunk;
+
+import java.lang.all;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.PaletteData;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.internal.image.PngChunk;
+import org.eclipse.swt.internal.image.PNGFileFormat;
+import org.eclipse.swt.internal.image.PngFileReadState;
+import org.eclipse.swt.internal.image.PngIhdrChunk;
+import org.eclipse.swt.internal.image.PngPlteChunk;
+
+public class PngTrnsChunk : PngChunk {
+
+    alias PngChunk.validate validate;
+
+    static const int TRANSPARENCY_TYPE_PIXEL = 0;
+    static const int TRANSPARENCY_TYPE_ALPHAS = 1;
+    static const int RGB_DATA_LENGTH = 6;
+
+this(RGB rgb) {
+    super(RGB_DATA_LENGTH);
+    setType(TYPE_tRNS);
+    setInt16(DATA_OFFSET, rgb.red);
+    setInt16(DATA_OFFSET + 2, rgb.green);
+    setInt16(DATA_OFFSET + 4, rgb.blue);
+    setCRC(computeCRC());
+}
+
+this(byte[] reference){
+    super(reference);
+}
+
+override int getChunkType() {
+    return CHUNK_tRNS;
+}
+
+void validateLength(PngIhdrChunk header, PngPlteChunk paletteChunk) {
+    bool valid;
+    switch (header.getColorType()) {
+        case PngIhdrChunk.COLOR_TYPE_RGB:
+            // Three 2-byte values (RGB)
+            valid = getLength() is 6;
+            break;
+        case PngIhdrChunk.COLOR_TYPE_PALETTE:
+            // Three 2-byte values (RGB)
+            valid = getLength() <= paletteChunk.getLength();
+            break;
+        case PngIhdrChunk.COLOR_TYPE_GRAYSCALE:
+            // One 2-byte value
+            valid = getLength() is 2;
+            break;
+        // Cannot use both Alpha and tRNS
+        case PngIhdrChunk.COLOR_TYPE_RGB_WITH_ALPHA:
+        case PngIhdrChunk.COLOR_TYPE_GRAYSCALE_WITH_ALPHA:
+        default:
+            valid = false;
+    }
+    if (!valid) {
+        SWT.error(SWT.ERROR_INVALID_IMAGE);
+    }
+}
+
+/**
+ * Answer whether the chunk is a valid tRNS chunk.
+ */
+void validate(PngFileReadState readState, PngIhdrChunk headerChunk, PngPlteChunk paletteChunk) {
+    if (!readState.readIHDR
+        || (headerChunk.getMustHavePalette() && !readState.readPLTE)
+        || readState.readIDAT
+        || readState.readIEND)
+    {
+        SWT.error(SWT.ERROR_INVALID_IMAGE);
+    } else {
+        readState.readTRNS = true;
+    }
+
+    validateLength(headerChunk, paletteChunk);
+
+    super.validate(readState, headerChunk);
+}
+
+
+int getTransparencyType(PngIhdrChunk header) {
+    if (header.getColorType() is PngIhdrChunk.COLOR_TYPE_PALETTE) {
+        return TRANSPARENCY_TYPE_ALPHAS;
+    }
+    return TRANSPARENCY_TYPE_PIXEL;
+}
+
+/**
+ * Answer the transparent pixel RGB value.
+ * This is not valid for palette color types.
+ * This is not valid for alpha color types.
+ * This will convert a grayscale value into
+ * a palette index.
+ * It will compress a 6 byte RGB into a 3 byte
+ * RGB.
+ */
+int getSwtTransparentPixel(PngIhdrChunk header) {
+    switch (header.getColorType()) {
+        case PngIhdrChunk.COLOR_TYPE_GRAYSCALE:
+            int gray = ((reference[DATA_OFFSET] & 0xFF) << 8)
+                + (reference[DATA_OFFSET + 1] & 0xFF);
+            if (header.getBitDepth() > 8) {
+                return PNGFileFormat.compress16BitDepthTo8BitDepth(gray);
+            }
+            return gray & 0xFF;
+        case PngIhdrChunk.COLOR_TYPE_RGB:
+            int red = ((reference[DATA_OFFSET] & 0xFF) << 8)
+                | (reference[DATA_OFFSET + 1] & 0xFF);
+            int green = ((reference[DATA_OFFSET + 2] & 0xFF) << 8)
+                | (reference[DATA_OFFSET + 3] & 0xFF);
+            int blue = ((reference[DATA_OFFSET + 4] & 0xFF) << 8)
+                | (reference[DATA_OFFSET + 5] & 0xFF);
+            if (header.getBitDepth() > 8) {
+                red = PNGFileFormat.compress16BitDepthTo8BitDepth(red);
+                green = PNGFileFormat.compress16BitDepthTo8BitDepth(green);
+                blue = PNGFileFormat.compress16BitDepthTo8BitDepth(blue);
+            }
+            return (red << 16) | (green << 8) | blue;
+        default:
+            SWT.error(SWT.ERROR_INVALID_IMAGE);
+            return -1;
+    }
+}
+
+/**
+ * Answer an array of Alpha values that correspond to the
+ * colors in the palette.
+ * This is only valid for the COLOR_TYPE_PALETTE color type.
+ */
+byte[] getAlphaValues(PngIhdrChunk header, PngPlteChunk paletteChunk) {
+    if (header.getColorType() !is PngIhdrChunk.COLOR_TYPE_PALETTE) {
+        SWT.error(SWT.ERROR_INVALID_IMAGE);
+    }
+    byte[] alphas = new byte[paletteChunk.getPaletteSize()];
+    int dataLength = getLength();
+    int i = 0;
+    for (i = 0; i < dataLength; i++) {
+        alphas[i] = reference[DATA_OFFSET + i];
+    }
+    /**
+     * Any palette entries which do not have a corresponding
+     * alpha value in the tRNS chunk are spec'd to have an
+     * alpha of 255.
+     */
+    for (int j = i; j < alphas.length; j++) {
+        alphas[j] = cast(byte) 255;
+    }
+    return alphas;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/TIFFDirectory.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,634 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.TIFFDirectory;
+
+import org.eclipse.swt.internal.image.TIFFRandomFileAccess;
+import org.eclipse.swt.internal.image.TIFFModifiedHuffmanCodec;
+import org.eclipse.swt.internal.image.LEDataOutputStream;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.ImageLoaderEvent;
+import org.eclipse.swt.graphics.ImageLoader;
+import org.eclipse.swt.graphics.PaletteData;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.SWT;
+import java.lang.all;
+
+final class TIFFDirectory {
+
+    TIFFRandomFileAccess file;
+    bool isLittleEndian;
+    ImageLoader loader;
+    int depth;
+
+    /* Directory fields */
+    int imageWidth;
+    int imageLength;
+    int[] bitsPerSample;
+    int compression;
+    int photometricInterpretation;
+    int[] stripOffsets;
+    int samplesPerPixel;
+    int rowsPerStrip;
+    int[] stripByteCounts;
+    int t4Options;
+    int colorMapOffset;
+
+    /* Encoder fields */
+    ImageData image;
+    LEDataOutputStream ostr;
+
+    static const int NO_VALUE = -1;
+
+    static const short TAG_ImageWidth = 256;
+    static const short TAG_ImageLength = 257;
+    static const short TAG_BitsPerSample = 258;
+    static const short TAG_Compression = 259;
+    static const short TAG_PhotometricInterpretation = 262;
+    static const short TAG_StripOffsets = 273;
+    static const short TAG_SamplesPerPixel = 277;
+    static const short TAG_RowsPerStrip = 278;
+    static const short TAG_StripByteCounts = 279;
+    static const short TAG_XResolution = 282;
+    static const short TAG_YResolution = 283;
+    static const short TAG_T4Options = 292;
+    static const short TAG_ResolutionUnit = 296;
+    static const short TAG_ColorMap = 320;
+
+    static const int TYPE_BYTE = 1;
+    static const int TYPE_ASCII = 2;
+    static const int TYPE_SHORT = 3;
+    static const int TYPE_LONG = 4;
+    static const int TYPE_RATIONAL = 5;
+
+    /* Different compression schemes */
+    static const int COMPRESSION_NONE = 1;
+    static const int COMPRESSION_CCITT_3_1 = 2;
+    static const int COMPRESSION_PACKBITS = 32773;
+
+    static const int IFD_ENTRY_SIZE = 12;
+
+public this(TIFFRandomFileAccess file, bool isLittleEndian, ImageLoader loader) {
+    this.file = file;
+    this.isLittleEndian = isLittleEndian;
+    this.loader = loader;
+}
+
+public this(ImageData image) {
+    this.image = image;
+}
+
+/* PackBits decoder */
+int decodePackBits(byte[] src, byte[] dest, int offsetDest) {
+    int destIndex = offsetDest;
+    int srcIndex = 0;
+    while (srcIndex < src.length) {
+        byte n = src[srcIndex];
+        if (0 <= n && n <= 127) {
+            /* Copy next n+1 bytes literally */
+            System.arraycopy(src, ++srcIndex, dest, destIndex, n + 1);
+            srcIndex += n + 1;
+            destIndex += n + 1;
+        } else if (-127 <= n && n <= -1) {
+            /* Copy next byte -n+1 times */
+            byte value = src[++srcIndex];
+            for (int j = 0; j < -n + 1; j++) {
+                dest[destIndex++] = value;
+            }
+            srcIndex++;
+        } else {
+            /* Noop when n is -128 */
+            srcIndex++;
+        }
+    }
+    /* Number of bytes copied */
+    return destIndex - offsetDest;
+}
+
+int getEntryValue(int type, byte[] buffer, int index) {
+    return toInt(buffer, index + 8, type);
+}
+
+void getEntryValue(int type, byte[] buffer, int index, int[] values)  {
+    int start = index + 8;
+    int size;
+    int offset = toInt(buffer, start, TYPE_LONG);
+    switch (type) {
+        case TYPE_SHORT: size = 2; break;
+        case TYPE_LONG: size = 4; break;
+        case TYPE_RATIONAL: size = 8; break;
+        case TYPE_ASCII:
+        case TYPE_BYTE: size = 1; break;
+        default: SWT.error(SWT.ERROR_UNSUPPORTED_FORMAT); return;
+    }
+    if (values.length * size > 4) {
+        buffer = new byte[values.length * size];
+        file.seek(offset);
+        file.read(buffer);
+        start = 0;
+    }
+    for (int i = 0; i < values.length; i++) {
+        values[i] = toInt(buffer, start + i * size, type);
+    }
+}
+
+void decodePixels(ImageData image)  {
+    /* Each row is byte aligned */
+    byte[] imageData = new byte[(imageWidth * depth + 7) / 8 * imageLength];
+    image.data = imageData;
+    int destIndex = 0;
+    int length = stripOffsets.length;
+    for (int i = 0; i < length; i++) {
+        /* Read a strip */
+        byte[] data = new byte[](stripByteCounts[i]);
+        file.seek(stripOffsets[i]);
+        file.read(data);
+        if (compression is COMPRESSION_NONE) {
+            System.arraycopy(data, 0, imageData, destIndex, data.length);
+            destIndex += data.length;
+        } else if (compression is COMPRESSION_PACKBITS) {
+            destIndex += decodePackBits(data, imageData, destIndex);
+        } else if (compression is COMPRESSION_CCITT_3_1 || compression is 3) {
+            TIFFModifiedHuffmanCodec codec = new TIFFModifiedHuffmanCodec();
+            int nRows = rowsPerStrip;
+            if (i is length -1) {
+                int n = imageLength % rowsPerStrip;
+                if (n !is 0) nRows = n;
+            }
+            destIndex += codec.decode(data, imageData, destIndex, imageWidth, nRows);
+        }
+        if (loader.hasListeners()) {
+            loader.notifyListeners(new ImageLoaderEvent(loader, image, i, i is length - 1));
+        }
+    }
+}
+
+PaletteData getColorMap()  {
+    int numColors = 1 << bitsPerSample[0];
+    /* R, G, B entries are 16 bit wide (2 bytes) */
+    int numBytes = 3 * 2 * numColors;
+    byte[] buffer = new byte[numBytes];
+    file.seek(colorMapOffset);
+    file.read(buffer);
+    RGB[] colors = new RGB[numColors];
+    /**
+     * SWT does not support 16-bit depth color formats.
+     * Convert the 16-bit data to 8-bit data.
+     * The correct way to do this is to multiply each
+     * 16 bit value by the value:
+     * (2^8 - 1) / (2^16 - 1).
+     * The fast way to do this is just to drop the low
+     * byte of the 16-bit value.
+     */
+    int offset = isLittleEndian ? 1 : 0;
+    int startG = 2 * numColors;
+    int startB = startG + 2 * numColors;
+    for (int i = 0; i < numColors; i++) {
+        int r = buffer[offset] & 0xFF;
+        int g = buffer[startG + offset] & 0xFF;
+        int b = buffer[startB + offset] & 0xFF;
+        colors[i] = new RGB(r, g, b);
+        offset += 2;
+    }
+    return new PaletteData(colors);
+}
+
+PaletteData getGrayPalette() {
+    int numColors = 1 << bitsPerSample[0];
+    RGB[] rgbs = new RGB[numColors];
+    for (int i = 0; i < numColors; i++) {
+        int value = i * 0xFF / (numColors - 1);
+        if (photometricInterpretation is 0) value = 0xFF - value;
+        rgbs[i] = new RGB(value, value, value);
+    }
+    return new PaletteData(rgbs);
+}
+
+PaletteData getRGBPalette(int bitsR, int bitsG, int bitsB) {
+    int blueMask = 0;
+    for (int i = 0; i < bitsB; i++) {
+        blueMask |= 1 << i;
+    }
+    int greenMask = 0;
+    for (int i = bitsB; i < bitsB + bitsG; i++) {
+        greenMask |= 1 << i;
+    }
+    int redMask = 0;
+    for (int i = bitsB + bitsG; i < bitsB + bitsG + bitsR; i++) {
+        redMask |= 1 << i;
+    }
+    return new PaletteData(redMask, greenMask, blueMask);
+}
+
+int formatStrips(int rowByteSize, int nbrRows, byte[] data, int maxStripByteSize, int offsetPostIFD, int extraBytes, int[][] strips) {
+    /*
+    * Calculate the nbr of required strips given the following requirements:
+    * - each strip should, if possible, not be greater than maxStripByteSize
+    * - each strip should contain 1 or more entire rows
+    *
+    * Format the strip fields arrays so that the image data is stored in one
+    * contiguous block. This block is stored after the IFD and after any tag
+    * info described in the IFD.
+    */
+    int n, nbrRowsPerStrip;
+    if (rowByteSize > maxStripByteSize) {
+        /* Each strip contains 1 row */
+        n = data.length / rowByteSize;
+        nbrRowsPerStrip = 1;
+    } else {
+        int nbr = (data.length + maxStripByteSize - 1) / maxStripByteSize;
+        nbrRowsPerStrip = nbrRows / nbr;
+        n = (nbrRows + nbrRowsPerStrip - 1) / nbrRowsPerStrip;
+    }
+    int stripByteSize = rowByteSize * nbrRowsPerStrip;
+
+    int[] offsets = new int[n];
+    int[] counts = new int[n];
+    /*
+    * Nbr of bytes between the end of the IFD directory and the start of
+    * the image data. Keep space for at least the offsets and counts
+    * data, each field being TYPE_LONG (4 bytes). If other tags require
+    * space between the IFD and the image block, use the extraBytes
+    * parameter.
+    * If there is only one strip, the offsets and counts data is stored
+    * directly in the IFD and we need not reserve space for it.
+    */
+    int postIFDData = n is 1 ? 0 : n * 2 * 4;
+    int startOffset = offsetPostIFD + extraBytes + postIFDData; /* offset of image data */
+
+    int offset = startOffset;
+    for (int i = 0; i < n; i++) {
+        /*
+        * Store all strips sequentially to allow us
+        * to copy all pixels in one contiguous area.
+        */
+        offsets[i] = offset;
+        counts[i] = stripByteSize;
+        offset += stripByteSize;
+    }
+    /* The last strip may contain fewer rows */
+    int mod = data.length % stripByteSize;
+    if (mod !is 0) counts[counts.length - 1] = mod;
+
+    strips[0] = offsets;
+    strips[1] = counts;
+    return nbrRowsPerStrip;
+}
+
+int[] formatColorMap(RGB[] rgbs) {
+    /*
+    * In a TIFF ColorMap, all red come first, followed by
+    * green and blue. All values must be converted from
+    * 8 bit to 16 bit.
+    */
+    int[] colorMap = new int[rgbs.length * 3];
+    int offsetGreen = rgbs.length;
+    int offsetBlue = rgbs.length * 2;
+    for (int i = 0; i < rgbs.length; i++) {
+        colorMap[i] = rgbs[i].red << 8 | rgbs[i].red;
+        colorMap[i + offsetGreen] = rgbs[i].green << 8 | rgbs[i].green;
+        colorMap[i + offsetBlue] = rgbs[i].blue << 8 | rgbs[i].blue;
+    }
+    return colorMap;
+}
+
+void parseEntries(byte[] buffer)  {
+    for (int offset = 0; offset < buffer.length; offset += IFD_ENTRY_SIZE) {
+        int tag = toInt(buffer, offset, TYPE_SHORT);
+        int type = toInt(buffer, offset + 2, TYPE_SHORT);
+        int count = toInt(buffer, offset + 4, TYPE_LONG);
+        switch (tag) {
+            case TAG_ImageWidth: {
+                imageWidth = getEntryValue(type, buffer, offset);
+                break;
+            }
+            case TAG_ImageLength: {
+                imageLength = getEntryValue(type, buffer, offset);
+                break;
+            }
+            case TAG_BitsPerSample: {
+                if (type !is TYPE_SHORT) SWT.error(SWT.ERROR_INVALID_IMAGE);
+                bitsPerSample = new int[count];
+                getEntryValue(type, buffer, offset, bitsPerSample);
+                break;
+            }
+            case TAG_Compression: {
+                compression = getEntryValue(type, buffer, offset);
+                break;
+            }
+            case TAG_PhotometricInterpretation: {
+                photometricInterpretation = getEntryValue(type, buffer, offset);
+                break;
+            }
+            case TAG_StripOffsets: {
+                if (type !is TYPE_LONG && type !is TYPE_SHORT) SWT.error(SWT.ERROR_INVALID_IMAGE);
+                stripOffsets = new int[count];
+                getEntryValue(type, buffer, offset, stripOffsets);
+                break;
+            }
+            case TAG_SamplesPerPixel: {
+                if (type !is TYPE_SHORT) SWT.error(SWT.ERROR_INVALID_IMAGE);
+                samplesPerPixel = getEntryValue(type, buffer, offset);
+                /* Only the basic 1 and 3 values are supported */
+                if (samplesPerPixel !is 1 && samplesPerPixel !is 3) SWT.error(SWT.ERROR_UNSUPPORTED_DEPTH);
+                break;
+            }
+            case TAG_RowsPerStrip: {
+                rowsPerStrip = getEntryValue(type, buffer, offset);
+                break;
+            }
+            case TAG_StripByteCounts: {
+                stripByteCounts = new int[count];
+                getEntryValue(type, buffer, offset, stripByteCounts);
+                break;
+            }
+            case TAG_XResolution: {
+                /* Ignored */
+                break;
+            }
+            case TAG_YResolution: {
+                /* Ignored */
+                break;
+            }
+            case TAG_T4Options: {
+                if (type !is TYPE_LONG) SWT.error(SWT.ERROR_INVALID_IMAGE);
+                t4Options = getEntryValue(type, buffer, offset);
+                if ((t4Options & 0x1) is 1) {
+                    /* 2-dimensional coding is not supported */
+                    SWT.error(SWT.ERROR_UNSUPPORTED_FORMAT);
+                }
+                break;
+            }
+            case TAG_ResolutionUnit: {
+                /* Ignored */
+                break;
+            }
+            case TAG_ColorMap: {
+                if (type !is TYPE_SHORT) SWT.error(SWT.ERROR_INVALID_IMAGE);
+                /* Get the offset of the colorMap (use TYPE_LONG) */
+                colorMapOffset = getEntryValue(TYPE_LONG, buffer, offset);
+                break;
+            }
+            default:
+        }
+    }
+}
+
+public ImageData read()  {
+    /* Set TIFF default values */
+    bitsPerSample = [1];
+    colorMapOffset = NO_VALUE;
+    compression = 1;
+    imageLength = NO_VALUE;
+    imageWidth = NO_VALUE;
+    photometricInterpretation = NO_VALUE;
+    rowsPerStrip = Integer.MAX_VALUE;
+    samplesPerPixel = 1;
+    stripByteCounts = null;
+    stripOffsets = null;
+
+    byte[] buffer = new byte[2];
+    file.read(buffer);
+    int numberEntries = toInt(buffer, 0, TYPE_SHORT);
+    buffer = new byte[IFD_ENTRY_SIZE * numberEntries];
+    file.read(buffer);
+    parseEntries(buffer);
+
+    PaletteData palette = null;
+    depth = 0;
+    switch (photometricInterpretation) {
+        case 0:
+        case 1: {
+            /* Bilevel or Grayscale image */
+            palette = getGrayPalette();
+            depth = bitsPerSample[0];
+            break;
+        }
+        case 2: {
+            /* RGB image */
+            if (colorMapOffset !is NO_VALUE) SWT.error(SWT.ERROR_INVALID_IMAGE);
+            /* SamplesPerPixel 3 is the only value supported */
+            palette = getRGBPalette(bitsPerSample[0], bitsPerSample[1], bitsPerSample[2]);
+            depth = bitsPerSample[0] + bitsPerSample[1] + bitsPerSample[2];
+            break;
+        }
+        case 3: {
+            /* Palette Color image */
+            if (colorMapOffset is NO_VALUE) SWT.error(SWT.ERROR_INVALID_IMAGE);
+            palette = getColorMap();
+            depth = bitsPerSample[0];
+            break;
+        }
+        default: {
+            SWT.error(SWT.ERROR_INVALID_IMAGE);
+        }
+    }
+
+    ImageData image = ImageData.internal_new(
+            imageWidth,
+            imageLength,
+            depth,
+            palette,
+            1,
+            null,
+            0,
+            null,
+            null,
+            -1,
+            -1,
+            SWT.IMAGE_TIFF,
+            0,
+            0,
+            0,
+            0);
+    decodePixels(image);
+    return image;
+}
+
+int toInt(byte[] buffer, int i, int type) {
+    if (type is TYPE_LONG) {
+        return isLittleEndian ?
+        (buffer[i] & 0xFF) | ((buffer[i + 1] & 0xFF) << 8) | ((buffer[i + 2] & 0xFF) << 16) | ((buffer[i + 3] & 0xFF) << 24) :
+        (buffer[i + 3] & 0xFF) | ((buffer[i + 2] & 0xFF) << 8) | ((buffer[i + 1] & 0xFF) << 16) | ((buffer[i] & 0xFF) << 24);
+    }
+    if (type is TYPE_SHORT) {
+        return isLittleEndian ?
+        (buffer[i] & 0xFF) | ((buffer[i + 1] & 0xFF) << 8) :
+        (buffer[i + 1] & 0xFF) | ((buffer[i] & 0xFF) << 8);
+    }
+    /* Invalid type */
+    SWT.error(SWT.ERROR_INVALID_IMAGE);
+    return -1;
+}
+
+void write(int photometricInterpretation)  {
+    bool isRGB = photometricInterpretation is 2;
+    bool isColorMap = photometricInterpretation is 3;
+    bool isBiLevel = photometricInterpretation is 0 || photometricInterpretation is 1;
+
+    int imageWidth = image.width;
+    int imageLength = image.height;
+    int rowByteSize = image.bytesPerLine;
+
+    int numberEntries = isBiLevel ? 9 : 11;
+    int lengthDirectory = 2 + 12 * numberEntries + 4;
+    /* Offset following the header and the directory */
+    int nextOffset = 8 + lengthDirectory;
+
+    /* Extra space used by XResolution and YResolution values */
+    int extraBytes = 16;
+
+    int[] colorMap = null;
+    if (isColorMap) {
+        PaletteData palette = image.palette;
+        RGB[] rgbs = palette.getRGBs();
+        colorMap = formatColorMap(rgbs);
+        /* The number of entries of the Color Map must match the bitsPerSample field */
+        if (colorMap.length !is 3 * 1 << image.depth) SWT.error(SWT.ERROR_UNSUPPORTED_FORMAT);
+        /* Extra space used by ColorMap values */
+        extraBytes += colorMap.length * 2;
+    }
+    if (isRGB) {
+        /* Extra space used by BitsPerSample values */
+        extraBytes += 6;
+    }
+    /* TIFF recommends storing the data in strips of no more than 8 Ko */
+    byte[] data = image.data;
+    int[][] strips = new int[][](2);
+    int nbrRowsPerStrip = formatStrips(rowByteSize, imageLength, data, 8192, nextOffset, extraBytes, strips);
+    int[] stripOffsets = strips[0];
+    int[] stripByteCounts = strips[1];
+
+    int bitsPerSampleOffset = NO_VALUE;
+    if (isRGB) {
+        bitsPerSampleOffset = nextOffset;
+        nextOffset += 6;
+    }
+    int stripOffsetsOffset = NO_VALUE, stripByteCountsOffset = NO_VALUE;
+    int xResolutionOffset, yResolutionOffset, colorMapOffset = NO_VALUE;
+    int cnt = stripOffsets.length;
+    if (cnt > 1) {
+        stripOffsetsOffset = nextOffset;
+        nextOffset += 4 * cnt;
+        stripByteCountsOffset = nextOffset;
+        nextOffset += 4 * cnt;
+    }
+    xResolutionOffset = nextOffset;
+    nextOffset += 8;
+    yResolutionOffset = nextOffset;
+    nextOffset += 8;
+    if (isColorMap) {
+        colorMapOffset = nextOffset;
+        nextOffset += colorMap.length * 2;
+    }
+    /* TIFF header */
+    writeHeader();
+
+    /* Image File Directory */
+    ostr.writeShort(numberEntries);
+    writeEntry(TAG_ImageWidth, TYPE_LONG, 1, imageWidth);
+    writeEntry(TAG_ImageLength, TYPE_LONG, 1, imageLength);
+    if (isColorMap) writeEntry(TAG_BitsPerSample, TYPE_SHORT, 1, image.depth);
+    if (isRGB) writeEntry(TAG_BitsPerSample, TYPE_SHORT, 3, bitsPerSampleOffset);
+    writeEntry(TAG_Compression, TYPE_SHORT, 1, COMPRESSION_NONE);
+    writeEntry(TAG_PhotometricInterpretation, TYPE_SHORT, 1, photometricInterpretation);
+    writeEntry(TAG_StripOffsets, TYPE_LONG, cnt, cnt > 1 ? stripOffsetsOffset : stripOffsets[0]);
+    if (isRGB) writeEntry(TAG_SamplesPerPixel, TYPE_SHORT, 1, 3);
+    writeEntry(TAG_RowsPerStrip, TYPE_LONG, 1, nbrRowsPerStrip);
+    writeEntry(TAG_StripByteCounts, TYPE_LONG, cnt, cnt > 1 ? stripByteCountsOffset : stripByteCounts[0]);
+    writeEntry(TAG_XResolution, TYPE_RATIONAL, 1, xResolutionOffset);
+    writeEntry(TAG_YResolution, TYPE_RATIONAL, 1, yResolutionOffset);
+    if (isColorMap) writeEntry(TAG_ColorMap, TYPE_SHORT, colorMap.length, colorMapOffset);
+    /* Offset of next IFD (0 for last IFD) */
+    ostr.writeInt(0);
+
+    /* Values longer than 4 bytes Section */
+
+    /* BitsPerSample 8,8,8 */
+    if (isRGB) for (int i = 0; i < 3; i++) ostr.writeShort(8);
+    if (cnt > 1) {
+        for (int i = 0; i < cnt; i++) ostr.writeInt(stripOffsets[i]);
+        for (int i = 0; i < cnt; i++) ostr.writeInt(stripByteCounts[i]);
+    }
+    /* XResolution and YResolution set to 300 dpi */
+    for (int i = 0; i < 2; i++) {
+        ostr.writeInt(300);
+        ostr.writeInt(1);
+    }
+    /* ColorMap */
+    if (isColorMap) for (int i = 0; i < colorMap.length; i++) ostr.writeShort(colorMap[i]);
+
+    /* Image Data */
+    ostr.write(data);
+}
+
+void writeEntry(short tag, int type, int count, int value) {
+    ostr.writeShort(tag);
+    ostr.writeShort(type);
+    ostr.writeInt(count);
+    ostr.writeInt(value);
+}
+
+void writeHeader() {
+    /* little endian */
+    ostr.write(0x49);
+    ostr.write(0x49);
+
+    /* TIFF identifier */
+    ostr.writeShort(42);
+    /*
+    * Offset of the first IFD is chosen to be 8.
+    * It is word aligned and immediately after this header.
+    */
+    ostr.writeInt(8);
+}
+
+void writeToStream(LEDataOutputStream byteStream) {
+    ostr = byteStream;
+    int photometricInterpretation = -1;
+
+    /* Scanline pad must be 1 */
+    if (image.scanlinePad !is 1) SWT.error(SWT.ERROR_UNSUPPORTED_FORMAT);
+    switch (image.depth) {
+        case 1: {
+            /* Palette must be black and white or white and black */
+            PaletteData palette = image.palette;
+            RGB[] rgbs = palette.colors;
+            if (palette.isDirect || rgbs is null || rgbs.length !is 2) SWT.error(SWT.ERROR_UNSUPPORTED_FORMAT);
+            RGB rgb0 = rgbs[0];
+            RGB rgb1 = rgbs[1];
+            if (!(rgb0.red is rgb0.green && rgb0.green is rgb0.blue &&
+                rgb1.red is rgb1.green && rgb1.green is rgb1.blue &&
+                ((rgb0.red is 0x0 && rgb1.red is 0xFF) || (rgb0.red is 0xFF && rgb1.red is 0x0)))) {
+                SWT.error(SWT.ERROR_UNSUPPORTED_FORMAT);
+            }
+            /* 0 means a color index of 0 is imaged as white */
+            photometricInterpretation = image.palette.colors[0].red is 0xFF ? 0 : 1;
+            break;
+        }
+        case 4:
+        case 8: {
+            photometricInterpretation = 3;
+            break;
+        }
+        case 24: {
+            photometricInterpretation = 2;
+            break;
+        }
+        default: {
+            SWT.error(SWT.ERROR_UNSUPPORTED_FORMAT);
+        }
+    }
+    write(photometricInterpretation);
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/TIFFFileFormat.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.TIFFFileFormat;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.image.TIFFRandomFileAccess;
+import org.eclipse.swt.internal.image.TIFFDirectory;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.ImageLoader;
+import org.eclipse.swt.internal.image.FileFormat;
+
+import tango.core.Exception;
+
+/**
+ * Baseline TIFF decoder revision 6.0
+ * Extension T4-encoding CCITT T.4 1D
+ */
+final class TIFFFileFormat : FileFormat {
+
+override bool isFileFormat(LEDataInputStream stream) {
+    try {
+        byte[] header = new byte[4];
+        stream.read(header);
+        stream.unread(header);
+        if (header[0] !is header[1]) return false;
+        if (!(header[0] is 0x49 && header[2] is 42 && header[3] is 0) &&
+            !(header[0] is 0x4d && header[2] is 0 && header[3] is 42)) {
+            return false;
+        }
+        return true;
+    } catch (Exception e) {
+        return false;
+    }
+}
+
+override ImageData[] loadFromByteStream() {
+    byte[] header = new byte[8];
+    bool isLittleEndian;
+    ImageData[] images = new ImageData[0];
+    TIFFRandomFileAccess file = new TIFFRandomFileAccess(inputStream);
+    try {
+        file.read(header);
+        if (header[0] !is header[1]) SWT.error(SWT.ERROR_INVALID_IMAGE);
+        if (!(header[0] is 0x49 && header[2] is 42 && header[3] is 0) &&
+            !(header[0] is 0x4d && header[2] is 0 && header[3] is 42)) {
+            SWT.error(SWT.ERROR_INVALID_IMAGE);
+        }
+        isLittleEndian = header[0] is 0x49;
+        int offset = isLittleEndian ?
+            (header[4] & 0xFF) | ((header[5] & 0xFF) << 8) | ((header[6] & 0xFF) << 16) | ((header[7] & 0xFF) << 24) :
+            (header[7] & 0xFF) | ((header[6] & 0xFF) << 8) | ((header[5] & 0xFF) << 16) | ((header[4] & 0xFF) << 24);
+        file.seek(offset);
+        TIFFDirectory directory = new TIFFDirectory(file, isLittleEndian, loader);
+        ImageData image = directory.read();
+        /* A baseline reader is only expected to read the first directory */
+        images = [image];
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+    return images;
+}
+
+override void unloadIntoByteStream(ImageLoader loader) {
+    /* We do not currently support writing multi-page tiff,
+     * so we use the first image data in the loader's array. */
+    ImageData image = loader.data[0];
+    TIFFDirectory directory = new TIFFDirectory(image);
+    try {
+        directory.writeToStream(outputStream);
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/TIFFModifiedHuffmanCodec.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,221 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.TIFFModifiedHuffmanCodec;
+
+import java.lang.all;
+
+import org.eclipse.swt.SWT;
+
+/*
+* Decoder for
+* - CCITT Group 3 1-Dimensional Modified Huffman run length encoding
+*   (TIFF compression type 2)
+* - CCITT T.4 bi-level encoding 1D
+*   (TIFF compression type 3 option 1D)
+*/
+final class TIFFModifiedHuffmanCodec {
+    static final short[][][] BLACK_CODE = [
+        /* 2 bits  */
+        [[ cast(short)2, 3], [ cast(short)3, 2]],
+        /* 3 bits  */
+        [[ cast(short)2, 1], [ cast(short)3, 4]],
+        /* 4 bits  */
+        [[ cast(short)2, 6], [ cast(short)3, 5]],
+        /* 5 bits  */
+        [[ cast(short)3, 7]],
+        /* 6 bits  */
+        [[ cast(short)4, 9], [ cast(short)5, 8]],
+        /* 7 bits  */
+        [[ cast(short)4, 10], [ cast(short)5, 11], [ cast(short)7, 12]],
+        /* 8 bits  */
+        [[ cast(short)4, 13], [ cast(short)7, 14]],
+        /* 9 bits  */
+        [[ cast(short)24, 15]],
+        /* 10 bits */
+        [[ cast(short)8, 18], [ cast(short)15, 64], [ cast(short)23, 16], [ cast(short)24, 17], [ cast(short)55, 0]],
+        /* 11 bits */
+        [/* EOL */[ cast(short)0, -1], [ cast(short)8, 1792], [ cast(short)23, 24], [ cast(short)24, 25], [ cast(short)40, 23], [ cast(short)55, 22], [ cast(short)103, 19],
+        [ cast(short)104, 20], [ cast(short)108, 21], [ cast(short)12, 1856], [ cast(short)13, 1920]],
+        /* 12 bits */
+        [[ cast(short)18, 1984], [ cast(short)19, 2048], [ cast(short)20, 2112], [ cast(short)21, 2176], [ cast(short)22, 2240], [ cast(short)23, 2304],
+        [ cast(short)28, 2368], [ cast(short)29, 2432], [ cast(short)30, 2496], [ cast(short)31, 2560], [ cast(short)36, 52], [ cast(short)39, 55], [ cast(short)40, 56],
+        [ cast(short)43, 59], [ cast(short)44, 60], [ cast(short)51, 320], [ cast(short)52, 384], [ cast(short)53, 448], [ cast(short)55, 53], [ cast(short)56, 54], [ cast(short)82, 50],
+        [ cast(short)83, 51], [ cast(short)84, 44], [ cast(short)85, 45], [ cast(short)86, 46], [ cast(short)87, 47], [ cast(short)88, 57], [ cast(short)89, 58], [ cast(short)90, 61],
+        [ cast(short)91, 256], [ cast(short)100, 48], [ cast(short)101, 49], [ cast(short)102, 62], [ cast(short)103, 63], [ cast(short)104, 30], [ cast(short)105, 31],
+        [ cast(short)106, 32], [ cast(short)107, 33], [ cast(short)108, 40], [ cast(short)109, 41], [ cast(short)200, 128], [ cast(short)201, 192], [ cast(short)202, 26],
+        [ cast(short)203, 27], [ cast(short)204, 28], [ cast(short)205, 29], [ cast(short)210, 34], [ cast(short)211, 35], [ cast(short)212, 36], [ cast(short)213, 37],
+        [ cast(short)214, 38], [ cast(short)215, 39], [ cast(short)218, 42], [ cast(short)219, 43]],
+        /* 13 bits */
+        [[ cast(short)74, 640], [ cast(short)75, 704], [ cast(short)76, 768], [ cast(short)77, 832], [ cast(short)82, 1280], [ cast(short)83, 1344], [ cast(short)84, 1408],
+        [ cast(short)85, 1472], [ cast(short)90, 1536], [ cast(short)91, 1600], [ cast(short)100, 1664], [ cast(short)101, 1728], [ cast(short)108, 512],
+        [ cast(short)109, 576], [ cast(short)114, 896], [ cast(short)115, 960], [ cast(short)116, 1024], [ cast(short)117, 1088], [ cast(short)118, 1152],
+        [ cast(short)119, 1216]]
+    ];
+
+    static final short[][][] WHITE_CODE = [
+        /* 4 bits */
+        [[ cast(short)7, 2], [ cast(short)8, 3], [ cast(short)11, 4], [ cast(short)12, 5], [ cast(short)14, 6], [ cast(short)15, 7]],
+        /* 5 bits */
+        [[ cast(short)7, 10], [ cast(short)8, 11], [ cast(short)18, 128], [ cast(short)19, 8], [ cast(short)20, 9], [ cast(short)27, 64]],
+        /* 6 bits */
+        [[ cast(short)3, 13], [ cast(short)7, 1], [ cast(short)8, 12], [ cast(short)23, 192], [ cast(short)24, 1664], [ cast(short)42, 16], [ cast(short)43, 17], [ cast(short)52, 14],
+        [ cast(short)53, 15]],
+        /* 7 bits */
+        [[ cast(short)3, 22], [ cast(short)4, 23], [ cast(short)8, 20], [ cast(short)12, 19], [ cast(short)19, 26], [ cast(short)23, 21], [ cast(short)24, 28], [ cast(short)36, 27],
+        [ cast(short)39, 18], [ cast(short)40, 24], [ cast(short)43, 25], [ cast(short)55, 256]],
+        /* 8 bits */
+        [[ cast(short)2, 29], [ cast(short)3, 30], [ cast(short)4, 45], [ cast(short)5, 46], [ cast(short)10, 47], [ cast(short)11, 48], [ cast(short)18, 33], [ cast(short)19, 34],
+        [ cast(short)20, 35], [ cast(short)21, 36], [ cast(short)22, 37], [ cast(short)23, 38], [ cast(short)26, 31], [ cast(short)27, 32], [ cast(short)36, 53], [ cast(short)37, 54],
+        [ cast(short)40, 39], [ cast(short)41, 40], [ cast(short)42, 41], [ cast(short)43, 42], [ cast(short)44, 43], [ cast(short)45, 44], [ cast(short)50, 61], [ cast(short)51, 62],
+        [ cast(short)52, 63], [ cast(short)53, 0], [ cast(short)54, 320], [ cast(short)55, 384], [ cast(short)74, 59], [ cast(short)75, 60], [ cast(short)82, 49], [ cast(short)83, 50],
+        [ cast(short)84, 51], [ cast(short)85, 52], [ cast(short)88, 55], [ cast(short)89, 56], [ cast(short)90, 57], [ cast(short)91, 58], [ cast(short)100, 448],
+        [ cast(short)101, 512], [ cast(short)103, 640], [ cast(short)104, 576]],
+        /* 9 bits */
+        [[ cast(short)152, 1472], [ cast(short)153, 1536], [ cast(short)154, 1600], [ cast(short)155, 1728], [ cast(short)204, 704], [ cast(short)205, 768],
+        [ cast(short)210, 832], [ cast(short)211, 896], [ cast(short)212, 960], [ cast(short)213, 1024], [ cast(short)214, 1088], [ cast(short)215, 1152],
+        [ cast(short)216, 1216], [ cast(short)217, 1280], [ cast(short)218, 1344], [ cast(short)219, 1408]],
+        /* 10 bits */
+        [],
+        /* 11 bits */
+        [[ cast(short)8, 1792], [ cast(short)12, 1856], [ cast(short)13, 1920]],
+        /* 12 bits */
+        [/* EOL */[ cast(short)1, -1], [ cast(short)18, 1984], [ cast(short)19, 2048], [ cast(short)20, 2112], [ cast(short)21, 2176], [ cast(short)22, 2240], [ cast(short)23, 2304],
+        [ cast(short)28, 2368], [ cast(short)29, 2432], [ cast(short)30, 2496], [ cast(short)31, 2560]]
+    ];
+
+    static final int BLACK_MIN_BITS = 2;
+    static final int WHITE_MIN_BITS = 4;
+
+    bool isWhite;
+    int whiteValue = 0;
+    int blackValue = 1;
+    byte[] src;
+    byte[] dest;
+    int byteOffsetSrc = 0;
+    int bitOffsetSrc = 0;
+    int byteOffsetDest = 0;
+    int bitOffsetDest = 0;
+    int code = 0;
+    int nbrBits = 0;
+    /* nbr of bytes per row */
+    int rowSize;
+
+public int decode(byte[] src, byte[] dest, int offsetDest, int rowSize, int nRows) {
+    this.src = src;
+    this.dest = dest;
+    this.rowSize = rowSize;
+    byteOffsetSrc = 0;
+    bitOffsetSrc = 0;
+    byteOffsetDest = offsetDest;
+    bitOffsetDest = 0;
+    int cnt = 0;
+    while (cnt < nRows && decodeRow()) {
+        cnt++;
+        /* byte aligned */
+        if (bitOffsetDest > 0) {
+            byteOffsetDest++;
+            bitOffsetDest = 0;
+        }
+    }
+    return byteOffsetDest - offsetDest;
+}
+
+bool decodeRow() {
+    isWhite = true;
+    int n = 0;
+    while (n < rowSize) {
+        int runLength = decodeRunLength();
+        if (runLength < 0) return false;
+        n += runLength;
+        setNextBits(isWhite ? whiteValue : blackValue, runLength);
+        isWhite = !isWhite;
+    }
+    return true;
+}
+
+int decodeRunLength() {
+    int runLength = 0;
+    int partialRun = 0;
+    short[][][] huffmanCode = isWhite ? WHITE_CODE : BLACK_CODE;
+    while (true) {
+        bool found = false;
+        nbrBits = isWhite ? WHITE_MIN_BITS : BLACK_MIN_BITS;
+        code = getNextBits(nbrBits);
+        for (int i = 0; i < huffmanCode.length; i++) {
+            for (int j = 0; j < huffmanCode[i].length; j++) {
+                if (huffmanCode[i][j][0] is code) {
+                    found = true;
+                    partialRun = huffmanCode[i][j][1];
+                    if (partialRun is -1) {
+                        /* Stop when reaching final EOL on last byte */
+                        if (byteOffsetSrc is src.length - 1) return -1;
+                        /* Group 3 starts each row with an EOL - ignore it */
+                    } else {
+                        runLength += partialRun;
+                        if (partialRun < 64) return runLength;
+                    }
+                    break;
+                }
+            }
+            if (found) break;
+            code = code << 1 | getNextBit();
+        }
+        if (!found) SWT.error(SWT.ERROR_INVALID_IMAGE);
+    }
+}
+
+int getNextBit() {
+    int value = (src[byteOffsetSrc] >>> (7 - bitOffsetSrc)) & 0x1;
+    bitOffsetSrc++;
+    if (bitOffsetSrc > 7) {
+        byteOffsetSrc++;
+        bitOffsetSrc = 0;
+    }
+    return value;
+}
+
+int getNextBits(int cnt) {
+    int value = 0;
+    for (int i = 0; i < cnt; i++) {
+        value = value << 1 | getNextBit();
+    }
+    return value;
+}
+
+void setNextBits(int value, int cnt) {
+    int n = cnt;
+    while (bitOffsetDest > 0 && bitOffsetDest <= 7 && n > 0) {
+        dest[byteOffsetDest] = value is 1 ?
+            cast(byte)(dest[byteOffsetDest] | (1 << (7 - bitOffsetDest))) :
+            cast(byte)(dest[byteOffsetDest] & ~(1 << (7 - bitOffsetDest)));
+        n--;
+        bitOffsetDest++;
+    }
+    if (bitOffsetDest is 8) {
+        byteOffsetDest++;
+        bitOffsetDest = 0;
+    }
+    while (n >= 8) {
+        dest[byteOffsetDest++] = cast(byte) (value is 1 ? 0xFF : 0);
+        n -= 8;
+    }
+    while (n > 0) {
+        dest[byteOffsetDest] = value is 1 ?
+            cast(byte)(dest[byteOffsetDest] | (1 << (7 - bitOffsetDest))) :
+            cast(byte)(dest[byteOffsetDest] & ~(1 << (7 - bitOffsetDest)));
+        n--;
+        bitOffsetDest++;
+    }
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/TIFFRandomFileAccess.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.TIFFRandomFileAccess;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.image.LEDataInputStream;
+import tango.core.Exception;
+
+final class TIFFRandomFileAccess {
+
+    LEDataInputStream inputStream;
+    int start, current, next;
+    byte[][] buffers;
+
+    static final int CHUNK_SIZE = 8192;
+    static final int LIST_SIZE = 128;
+
+public this(LEDataInputStream stream) {
+    inputStream = stream;
+    start = current = next = inputStream.getPosition();
+    buffers = new byte[][](LIST_SIZE);
+}
+
+void seek(int pos) {
+    if (pos is current) return;
+    if (pos < start) throw new IOException( "pos < start" );
+    current = pos;
+    if (current > next) {
+        int n = current - next;
+        /* store required bytes */
+        int index = next / CHUNK_SIZE;
+        int offset = next % CHUNK_SIZE;
+        while (n > 0) {
+            if (index >= buffers.length) {
+                byte[][] oldBuffers = buffers;
+                buffers = new byte[][]( Math.max(index + 1, oldBuffers.length + LIST_SIZE) );
+                System.arraycopy(oldBuffers, 0, buffers, 0, oldBuffers.length);
+            }
+            if (buffers[index] is null) buffers[index] = new byte[CHUNK_SIZE];
+            int cnt = inputStream.read(buffers[index], offset, Math.min(n, CHUNK_SIZE - offset));
+            n -= cnt;
+            next += cnt;
+            index++;
+            offset = 0;
+        }
+    }
+}
+
+void read(byte b[]) {
+    int size = b.length;
+    int nCached = Math.min(size, next - current);
+    int nMissing = size - next + current;
+    int destNext = 0;
+    if (nCached > 0) {
+        /* Get cached bytes */
+        int index = current / CHUNK_SIZE;
+        int offset = current % CHUNK_SIZE;
+        while (nCached > 0) {
+            int cnt = Math.min(nCached, CHUNK_SIZE - offset);
+            System.arraycopy(buffers[index], offset, b, destNext, cnt);
+            nCached -= cnt;
+            destNext += cnt;
+            index++;
+            offset = 0;
+        }
+    }
+    if (nMissing > 0) {
+        /* Read required bytes */
+        int index = next / CHUNK_SIZE;
+        int offset = next % CHUNK_SIZE;
+        while (nMissing > 0) {
+            if (index >= buffers.length) {
+                byte[][] oldBuffers = buffers;
+                buffers = new byte[][](Math.max(index, oldBuffers.length + LIST_SIZE));
+                System.arraycopy(oldBuffers, 0, buffers, 0, oldBuffers.length);
+            }
+            if (buffers[index] is null) buffers[index] = new byte[CHUNK_SIZE];
+            int cnt = inputStream.read(buffers[index], offset, Math.min(nMissing, CHUNK_SIZE - offset));
+            System.arraycopy(buffers[index], offset, b, destNext, cnt);
+            nMissing -= cnt;
+            next += cnt;
+            destNext += cnt;
+            index++;
+            offset = 0;
+        }
+    }
+    current += size;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/WinBMPFileFormat.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,702 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.WinBMPFileFormat;
+
+import org.eclipse.swt.internal.image.FileFormat;
+import org.eclipse.swt.graphics.PaletteData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.RGB;
+import java.io.ByteArrayOutputStream;
+import org.eclipse.swt.SWT;
+import java.lang.all;
+
+import tango.core.Exception;
+
+final class WinBMPFileFormat : FileFormat {
+
+    static final int BMPFileHeaderSize = 14;
+    static final int BMPHeaderFixedSize = 40;
+    int importantColors;
+    Point pelsPerMeter;
+
+public this(){
+    pelsPerMeter = new Point(0, 0);
+}
+
+/**
+ * Compress numBytes bytes of image data from src, storing in dest
+ * (starting at 0), using the technique specified by comp.
+ * If last is true, this indicates the last line of the image.
+ * Answer the size of the compressed data.
+ */
+int compress(int comp, byte[] src, int srcOffset, int numBytes, byte[] dest, bool last) {
+    if (comp is 1) { // BMP_RLE8_COMPRESSION
+        return compressRLE8Data(src, srcOffset, numBytes, dest, last);
+    }
+    if (comp is 2) { // BMP_RLE4_COMPRESSION
+        return compressRLE4Data(src, srcOffset, numBytes, dest, last);
+    }
+    SWT.error(SWT.ERROR_INVALID_IMAGE);
+    return 0;
+}
+int compressRLE4Data(byte[] src, int srcOffset, int numBytes, byte[] dest, bool last) {
+    int sp = srcOffset, end = srcOffset + numBytes, dp = 0;
+    int size = 0, left, i, n;
+    byte theByte;
+    while (sp < end) {
+        /* find two consecutive bytes that are the same in the next 128 */
+        left = end - sp - 1;
+        if (left > 127)
+            left = 127;
+        for (n = 0; n < left; n++) {
+            if (src[sp + n] is src[sp + n + 1])
+                break;
+        }
+        /* if there is only one more byte in the scan line, include it */
+        if (n < 127 && n is left)
+            n++;
+        /* store the intervening data */
+        switch (n) {
+            case 0:
+                break;
+            case 1: /* handled separately because 0,2 is a command */
+                dest[dp] = 2; dp++; /* 1 byte is 2 pixels */
+                dest[dp] = src[sp];
+                dp++; sp++;
+                size += 2;
+                break;
+            default:
+                dest[dp] = 0; dp++;
+                dest[dp] = cast(byte)(n + n); dp++; /* n bytes = n*2 pixels */
+                for (i = n; i > 0; i--) {
+                    dest[dp] = src[sp];
+                    dp++; sp++;
+                }
+                size += 2 + n;
+                if ((n & 1) !is 0) { /* pad to word */
+                    dest[dp] = 0;
+                    dp++;
+                    size++;
+                }
+                break;
+        }
+        /* find the length of the next run (up to 127) and store it */
+        left = end - sp;
+        if (left > 0) {
+            if (left > 127)
+                left = 127;
+            theByte = src[sp];
+            for (n = 1; n < left; n++) {
+                if (src[sp + n] !is theByte)
+                    break;
+            }
+            dest[dp] = cast(byte)(n + n); dp++; /* n bytes = n*2 pixels */
+            dest[dp] = theByte; dp++;
+            sp += n;
+            size += 2;
+        }
+    }
+
+    /* store the end of line or end of bitmap codes */
+    dest[dp] = 0; dp++;
+    if (last) {
+        dest[dp] = 1; dp++;
+    } else {
+        dest[dp] = 0; dp++;
+    }
+    size += 2;
+
+    return size;
+}
+int compressRLE8Data(byte[] src, int srcOffset, int numBytes, byte[] dest, bool last) {
+    int sp = srcOffset, end = srcOffset + numBytes, dp = 0;
+    int size = 0, left, i, n;
+    byte theByte;
+    while (sp < end) {
+        /* find two consecutive bytes that are the same in the next 256 */
+        left = end - sp - 1;
+        if (left > 254)
+            left = 254;
+        for (n = 0; n < left; n++) {
+            if (src[sp + n] is src[sp + n + 1])
+                break;
+        }
+        /* if there is only one more byte in the scan line, include it */
+        if (n is left)
+            n++;
+        /* store the intervening data */
+        switch (n) {
+            case 0:
+                break;
+            case 2: /* handled separately because 0,2 is a command */
+                dest[dp] = 1; dp++;
+                dest[dp] = src[sp];
+                dp++; sp++;
+                size += 2;
+                /* don't break, fall through */
+            case 1: /* handled separately because 0,1 is a command */
+                dest[dp] = 1; dp++;
+                dest[dp] = src[sp];
+                dp++; sp++;
+                size += 2;
+                break;
+            default:
+                dest[dp] = 0; dp++;
+                dest[dp] = cast(byte)n; dp++;
+                for (i = n; i > 0; i--) {
+                    dest[dp] = src[sp];
+                    dp++; sp++;
+                }
+                size += 2 + n;
+                if ((n & 1) !is 0) { /* pad to word */
+                    dest[dp] = 0;
+                    dp++;
+                    size++;
+                }
+                break;
+        }
+        /* find the length of the next run (up to 255) and store it */
+        left = end - sp;
+        if (left > 0) {
+            if (left > 255)
+                left = 255;
+            theByte = src[sp];
+            for (n = 1; n < left; n++) {
+                if (src[sp + n] !is theByte)
+                    break;
+            }
+            dest[dp] = cast(byte)n; dp++;
+            dest[dp] = theByte; dp++;
+            sp += n;
+            size += 2;
+        }
+    }
+
+    /* store the end of line or end of bitmap codes */
+    dest[dp] = 0; dp++;
+    if (last) {
+        dest[dp] = 1; dp++;
+    } else {
+        dest[dp] = 0; dp++;
+    }
+    size += 2;
+
+    return size;
+}
+void decompressData(byte[] src, byte[] dest, int stride, int cmp) {
+    if (cmp is 1) { // BMP_RLE8_COMPRESSION
+        if (decompressRLE8Data(src, src.length, stride, dest, dest.length) <= 0)
+            SWT.error(SWT.ERROR_INVALID_IMAGE);
+        return;
+    }
+    if (cmp is 2) { // BMP_RLE4_COMPRESSION
+        if (decompressRLE4Data(src, src.length, stride, dest, dest.length) <= 0)
+            SWT.error(SWT.ERROR_INVALID_IMAGE);
+        return;
+    }
+    SWT.error(SWT.ERROR_INVALID_IMAGE);
+}
+int decompressRLE4Data(byte[] src, int numBytes, int stride, byte[] dest, int destSize) {
+    int sp = 0;
+    int se = numBytes;
+    int dp = 0;
+    int de = destSize;
+    int x = 0, y = 0;
+    while (sp < se) {
+        int len = src[sp] & 0xFF;
+        sp++;
+        if (len is 0) {
+            len = src[sp] & 0xFF;
+            sp++;
+            switch (len) {
+                case 0: /* end of line */
+                    y++;
+                    x = 0;
+                    dp = y * stride;
+                    if (dp > de)
+                        return -1;
+                    break;
+                case 1: /* end of bitmap */
+                    return 1;
+                case 2: /* delta */
+                    x += src[sp] & 0xFF;
+                    sp++;
+                    y += src[sp] & 0xFF;
+                    sp++;
+                    dp = y * stride + x / 2;
+                    if (dp > de)
+                        return -1;
+                    break;
+                default: /* absolute mode run */
+                    if ((len & 1) !is 0) /* odd run lengths not currently supported */
+                        return -1;
+                    x += len;
+                    len = len / 2;
+                    if (len > (se - sp))
+                        return -1;
+                    if (len > (de - dp))
+                        return -1;
+                    for (int i = 0; i < len; i++) {
+                        dest[dp] = src[sp];
+                        dp++;
+                        sp++;
+                    }
+                    if ((sp & 1) !is 0)
+                        sp++; /* word align sp? */
+                    break;
+            }
+        } else {
+            if ((len & 1) !is 0)
+                return -1;
+            x += len;
+            len = len / 2;
+            byte theByte = src[sp];
+            sp++;
+            if (len > (de - dp))
+                return -1;
+            for (int i = 0; i < len; i++) {
+                dest[dp] = theByte;
+                dp++;
+            }
+        }
+    }
+    return 1;
+}
+int decompressRLE8Data(byte[] src, int numBytes, int stride, byte[] dest, int destSize) {
+    int sp = 0;
+    int se = numBytes;
+    int dp = 0;
+    int de = destSize;
+    int x = 0, y = 0;
+    while (sp < se) {
+        int len = src[sp] & 0xFF;
+        sp++;
+        if (len is 0) {
+            len = src[sp] & 0xFF;
+            sp++;
+            switch (len) {
+                case 0: /* end of line */
+                    y++;
+                    x = 0;
+                    dp = y * stride;
+                    if (dp > de)
+                        return -1;
+                    break;
+                case 1: /* end of bitmap */
+                    return 1;
+                case 2: /* delta */
+                    x += src[sp] & 0xFF;
+                    sp++;
+                    y += src[sp] & 0xFF;
+                    sp++;
+                    dp = y * stride + x;
+                    if (dp > de)
+                        return -1;
+                    break;
+                default: /* absolute mode run */
+                    if (len > (se - sp))
+                        return -1;
+                    if (len > (de - dp))
+                        return -1;
+                    for (int i = 0; i < len; i++) {
+                        dest[dp] = src[sp];
+                        dp++;
+                        sp++;
+                    }
+                    if ((sp & 1) !is 0)
+                        sp++; /* word align sp? */
+                    x += len;
+                    break;
+            }
+        } else {
+            byte theByte = src[sp];
+            sp++;
+            if (len > (de - dp))
+                return -1;
+            for (int i = 0; i < len; i++) {
+                dest[dp] = theByte;
+                dp++;
+            }
+            x += len;
+        }
+    }
+    return 1;
+}
+override bool isFileFormat(LEDataInputStream stream) {
+    try {
+        byte[] header = new byte[18];
+        stream.read(header);
+        stream.unread(header);
+        int infoHeaderSize = (header[14] & 0xFF) | ((header[15] & 0xFF) << 8) | ((header[16] & 0xFF) << 16) | ((header[17] & 0xFF) << 24);
+        return header[0] is 0x42 && header[1] is 0x4D && infoHeaderSize >= BMPHeaderFixedSize;
+    } catch (Exception e) {
+        return false;
+    }
+}
+byte[] loadData(byte[] infoHeader) {
+    int width = (infoHeader[4] & 0xFF) | ((infoHeader[5] & 0xFF) << 8) | ((infoHeader[6] & 0xFF) << 16) | ((infoHeader[7] & 0xFF) << 24);
+    int height = (infoHeader[8] & 0xFF) | ((infoHeader[9] & 0xFF) << 8) | ((infoHeader[10] & 0xFF) << 16) | ((infoHeader[11] & 0xFF) << 24);
+    int bitCount = (infoHeader[14] & 0xFF) | ((infoHeader[15] & 0xFF) << 8);
+    int stride = (width * bitCount + 7) / 8;
+    stride = (stride + 3) / 4 * 4; // Round up to 4 byte multiple
+    byte[] data = loadData(infoHeader, stride);
+    flipScanLines(data, stride, height);
+    return data;
+}
+byte[] loadData(byte[] infoHeader, int stride) {
+    int height = (infoHeader[8] & 0xFF) | ((infoHeader[9] & 0xFF) << 8) | ((infoHeader[10] & 0xFF) << 16) | ((infoHeader[11] & 0xFF) << 24);
+    if (height < 0) height = -height;
+    int dataSize = height * stride;
+    byte[] data = new byte[dataSize];
+    int cmp = (infoHeader[16] & 0xFF) | ((infoHeader[17] & 0xFF) << 8) | ((infoHeader[18] & 0xFF) << 16) | ((infoHeader[19] & 0xFF) << 24);
+    if (cmp is 0 || cmp is 3) { // BMP_NO_COMPRESSION
+        try {
+            if (inputStream.read(data) !is dataSize)
+                SWT.error(SWT.ERROR_INVALID_IMAGE);
+        } catch (IOException e) {
+            SWT.error(SWT.ERROR_IO, e);
+        }
+    } else {
+        int compressedSize = (infoHeader[20] & 0xFF) | ((infoHeader[21] & 0xFF) << 8) | ((infoHeader[22] & 0xFF) << 16) | ((infoHeader[23] & 0xFF) << 24);
+        byte[] compressed = new byte[compressedSize];
+        try {
+            if (inputStream.read(compressed) !is compressedSize)
+                SWT.error(SWT.ERROR_INVALID_IMAGE);
+        } catch (IOException e) {
+            SWT.error(SWT.ERROR_IO, e);
+        }
+        decompressData(compressed, data, stride, cmp);
+    }
+    return data;
+}
+int[] loadFileHeader() {
+    int[] header = new int[5];
+    try {
+        header[0] = inputStream.readShort();
+        header[1] = inputStream.readInt();
+        header[2] = inputStream.readShort();
+        header[3] = inputStream.readShort();
+        header[4] = inputStream.readInt();
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+    if (header[0] !is 0x4D42)
+        SWT.error(SWT.ERROR_INVALID_IMAGE);
+    return header;
+}
+override ImageData[] loadFromByteStream() {
+    int[] fileHeader = loadFileHeader();
+    byte[] infoHeader = new byte[BMPHeaderFixedSize];
+    try {
+        inputStream.read(infoHeader);
+    } catch (Exception e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+    int width = (infoHeader[4] & 0xFF) | ((infoHeader[5] & 0xFF) << 8) | ((infoHeader[6] & 0xFF) << 16) | ((infoHeader[7] & 0xFF) << 24);
+    int height = (infoHeader[8] & 0xFF) | ((infoHeader[9] & 0xFF) << 8) | ((infoHeader[10] & 0xFF) << 16) | ((infoHeader[11] & 0xFF) << 24);
+    if (height < 0) height = -height;
+    int bitCount = (infoHeader[14] & 0xFF) | ((infoHeader[15] & 0xFF) << 8);
+    this.compression = (infoHeader[16] & 0xFF) | ((infoHeader[17] & 0xFF) << 8) | ((infoHeader[18] & 0xFF) << 16) | ((infoHeader[19] & 0xFF) << 24);
+    PaletteData palette = loadPalette(infoHeader);
+    if (inputStream.getPosition() < fileHeader[4]) {
+        // Seek to the specified offset
+        try {
+            inputStream.skip(fileHeader[4] - inputStream.getPosition());
+        } catch (IOException e) {
+            SWT.error(SWT.ERROR_IO, e);
+        }
+    }
+    byte[] data = loadData(infoHeader);
+    this.importantColors = (infoHeader[36] & 0xFF) | ((infoHeader[37] & 0xFF) << 8) | ((infoHeader[38] & 0xFF) << 16) | ((infoHeader[39] & 0xFF) << 24);
+    int xPelsPerMeter = (infoHeader[24] & 0xFF) | ((infoHeader[25] & 0xFF) << 8) | ((infoHeader[26] & 0xFF) << 16) | ((infoHeader[27] & 0xFF) << 24);
+    int yPelsPerMeter = (infoHeader[28] & 0xFF) | ((infoHeader[29] & 0xFF) << 8) | ((infoHeader[30] & 0xFF) << 16) | ((infoHeader[31] & 0xFF) << 24);
+    this.pelsPerMeter = new Point(xPelsPerMeter, yPelsPerMeter);
+    int type = (this.compression is 1 /*BMP_RLE8_COMPRESSION*/) || (this.compression is 2 /*BMP_RLE4_COMPRESSION*/) ? SWT.IMAGE_BMP_RLE : SWT.IMAGE_BMP;
+    return [
+        ImageData.internal_new(
+            width,
+            height,
+            bitCount,
+            palette,
+            4,
+            data,
+            0,
+            null,
+            null,
+            -1,
+            -1,
+            type,
+            0,
+            0,
+            0,
+            0)
+    ];
+}
+PaletteData loadPalette(byte[] infoHeader) {
+    int depth = (infoHeader[14] & 0xFF) | ((infoHeader[15] & 0xFF) << 8);
+    if (depth <= 8) {
+        int numColors = (infoHeader[32] & 0xFF) | ((infoHeader[33] & 0xFF) << 8) | ((infoHeader[34] & 0xFF) << 16) | ((infoHeader[35] & 0xFF) << 24);
+        if (numColors is 0) {
+            numColors = 1 << depth;
+        } else {
+            if (numColors > 256)
+                numColors = 256;
+        }
+        byte[] buf = new byte[numColors * 4];
+        try {
+            if (inputStream.read(buf) !is buf.length)
+                SWT.error(SWT.ERROR_INVALID_IMAGE);
+        } catch (IOException e) {
+            SWT.error(SWT.ERROR_IO, e);
+        }
+        return paletteFromBytes(buf, numColors);
+    }
+    if (depth is 16) {
+        if (this.compression is 3) {
+            try {
+                return new PaletteData(inputStream.readInt(), inputStream.readInt(), inputStream.readInt());
+            } catch (IOException e) {
+                SWT.error(SWT.ERROR_IO, e);
+            }
+        }
+        return new PaletteData(0x7C00, 0x3E0, 0x1F);
+    }
+    if (depth is 24) return new PaletteData(0xFF, 0xFF00, 0xFF0000);
+    if (this.compression is 3) {
+        try {
+            return new PaletteData(inputStream.readInt(), inputStream.readInt(), inputStream.readInt());
+        } catch (IOException e) {
+            SWT.error(SWT.ERROR_IO, e);
+        }
+    }
+    return new PaletteData(0xFF00, 0xFF0000, 0xFF000000);
+}
+PaletteData paletteFromBytes(byte[] bytes, int numColors) {
+    int bytesOffset = 0;
+    RGB[] colors = new RGB[numColors];
+    for (int i = 0; i < numColors; i++) {
+        colors[i] = new RGB(bytes[bytesOffset + 2] & 0xFF,
+            bytes[bytesOffset + 1] & 0xFF,
+            bytes[bytesOffset] & 0xFF);
+        bytesOffset += 4;
+    }
+    return new PaletteData(colors);
+}
+/**
+ * Answer a byte array containing the BMP representation of
+ * the given device independent palette.
+ */
+static byte[] paletteToBytes(PaletteData pal) {
+    int n = pal.colors is null ? 0 : (pal.colors.length < 256 ? pal.colors.length : 256);
+    byte[] bytes = new byte[n * 4];
+    int offset = 0;
+    for (int i = 0; i < n; i++) {
+        RGB col = pal.colors[i];
+        bytes[offset] = cast(byte)col.blue;
+        bytes[offset + 1] = cast(byte)col.green;
+        bytes[offset + 2] = cast(byte)col.red;
+        offset += 4;
+    }
+    return bytes;
+}
+/**
+ * Unload the given image's data into the given byte stream
+ * using the given compression strategy.
+ * Answer the number of bytes written.
+ */
+int unloadData(ImageData image, OutputStream ostr, int comp) {
+    int totalSize = 0;
+    try {
+        if (comp is 0)
+            return unloadDataNoCompression(image, ostr);
+        int bpl = (image.width * image.depth + 7) / 8;
+        int bmpBpl = (bpl + 3) / 4 * 4; // BMP pads scanlines to multiples of 4 bytes
+        int imageBpl = image.bytesPerLine;
+        // Compression can actually take twice as much space, in worst case
+        byte[] buf = new byte[bmpBpl * 2];
+        int srcOffset = imageBpl * (image.height - 1); // Start at last line
+        byte[] data = image.data;
+        totalSize = 0;
+        byte[] buf2 = new byte[32768];
+        int buf2Offset = 0;
+        for (int y = image.height - 1; y >= 0; y--) {
+            int lineSize = compress(comp, data, srcOffset, bpl, buf, y is 0);
+            if (buf2Offset + lineSize > buf2.length) {
+                ostr.write(buf2, 0, buf2Offset);
+                buf2Offset = 0;
+            }
+            System.arraycopy(buf, 0, buf2, buf2Offset, lineSize);
+            buf2Offset += lineSize;
+            totalSize += lineSize;
+            srcOffset -= imageBpl;
+        }
+        if (buf2Offset > 0)
+            ostr.write(buf2, 0, buf2Offset);
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+    return totalSize;
+}
+/**
+ * Prepare the given image's data for unloading into a byte stream
+ * using no compression strategy.
+ * Answer the number of bytes written.
+ */
+int unloadDataNoCompression(ImageData image, OutputStream ostr) {
+    int bmpBpl = 0;
+    try {
+        int bpl = (image.width * image.depth + 7) / 8;
+        bmpBpl = (bpl + 3) / 4 * 4; // BMP pads scanlines to multiples of 4 bytes
+        int linesPerBuf = 32678 / bmpBpl;
+        byte[] buf = new byte[linesPerBuf * bmpBpl];
+        byte[] data = image.data;
+        int imageBpl = image.bytesPerLine;
+        int dataIndex = imageBpl * (image.height - 1); // Start at last line
+        if (image.depth is 16) {
+            for (int y = 0; y < image.height; y += linesPerBuf) {
+                int count = image.height - y;
+                if (linesPerBuf < count) count = linesPerBuf;
+                int bufOffset = 0;
+                for (int i = 0; i < count; i++) {
+                    for (int wIndex = 0; wIndex < bpl; wIndex += 2) {
+                        buf[bufOffset + wIndex + 1] = data[dataIndex + wIndex + 1];
+                        buf[bufOffset + wIndex] = data[dataIndex + wIndex];
+                    }
+                    bufOffset += bmpBpl;
+                    dataIndex -= imageBpl;
+                }
+                ostr.write(buf, 0, bufOffset);
+            }
+        } else {
+            for (int y = 0; y < image.height; y += linesPerBuf) {
+                int tmp = image.height - y;
+                int count = tmp < linesPerBuf ? tmp : linesPerBuf;
+                int bufOffset = 0;
+                for (int i = 0; i < count; i++) {
+                    System.arraycopy(data, dataIndex, buf, bufOffset, bpl);
+                    bufOffset += bmpBpl;
+                    dataIndex -= imageBpl;
+                }
+                ostr.write(buf, 0, bufOffset);
+            }
+        }
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+    return bmpBpl * image.height;
+}
+/**
+ * Unload a DeviceIndependentImage using Windows .BMP format into the given
+ * byte stream.
+ */
+override void unloadIntoByteStream(ImageLoader loader) {
+    ImageData image = loader.data[0];
+    byte[] rgbs;
+    int numCols;
+    if (!((image.depth is 1) || (image.depth is 4) || (image.depth is 8) ||
+          (image.depth is 16) || (image.depth is 24) || (image.depth is 32)))
+            SWT.error(SWT.ERROR_UNSUPPORTED_DEPTH);
+    int comp = this.compression;
+    if (!((comp is 0) || ((comp is 1) && (image.depth is 8)) ||
+          ((comp is 2) && (image.depth is 4))))
+            SWT.error(SWT.ERROR_INVALID_IMAGE);
+    PaletteData pal = image.palette;
+    if ((image.depth is 16) || (image.depth is 24) || (image.depth is 32)) {
+        if (!pal.isDirect)
+            SWT.error(SWT.ERROR_INVALID_IMAGE);
+        numCols = 0;
+        rgbs = null;
+    } else {
+        if (pal.isDirect)
+            SWT.error(SWT.ERROR_INVALID_IMAGE);
+        numCols = pal.colors.length;
+        rgbs = paletteToBytes(pal);
+    }
+    // Fill in file header, except for bfsize, which is done later.
+    int headersSize = BMPFileHeaderSize + BMPHeaderFixedSize;
+    int[] fileHeader = new int[5];
+    fileHeader[0] = 0x4D42; // Signature
+    fileHeader[1] = 0; // File size - filled in later
+    fileHeader[2] = 0; // Reserved 1
+    fileHeader[3] = 0; // Reserved 2
+    fileHeader[4] = headersSize; // Offset to data
+    if (rgbs !is null) {
+        fileHeader[4] += rgbs.length;
+    }
+
+    // Prepare data. This is done first so we don't have to try to rewind
+    // the stream and fill in the details later.
+    ByteArrayOutputStream ostr = new ByteArrayOutputStream();
+    unloadData(image, ostr, comp);
+    byte[] data = ostr.toByteArray();
+
+    // Calculate file size
+    fileHeader[1] = fileHeader[4] + data.length;
+
+    // Write the headers
+    try {
+        outputStream.writeShort(fileHeader[0]);
+        outputStream.writeInt(fileHeader[1]);
+        outputStream.writeShort(fileHeader[2]);
+        outputStream.writeShort(fileHeader[3]);
+        outputStream.writeInt(fileHeader[4]);
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+    try {
+        outputStream.writeInt(BMPHeaderFixedSize);
+        outputStream.writeInt(image.width);
+        outputStream.writeInt(image.height);
+        outputStream.writeShort(1);
+        outputStream.writeShort(cast(short)image.depth);
+        outputStream.writeInt(comp);
+        outputStream.writeInt(data.length);
+        outputStream.writeInt(pelsPerMeter.x);
+        outputStream.writeInt(pelsPerMeter.y);
+        outputStream.writeInt(numCols);
+        outputStream.writeInt(importantColors);
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+
+    // Unload palette
+    if (numCols > 0) {
+        try {
+            outputStream.write(rgbs);
+        } catch (IOException e) {
+            SWT.error(SWT.ERROR_IO, e);
+        }
+    }
+
+    // Unload the data
+    try {
+        outputStream.write(data);
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+}
+void flipScanLines(byte[] data, int stride, int height) {
+    int i1 = 0;
+    int i2 = (height - 1) * stride;
+    for (int i = 0; i < height / 2; i++) {
+        for (int index = 0; index < stride; index++) {
+            byte b = data[index + i1];
+            data[index + i1] = data[index + i2];
+            data[index + i2] = b;
+        }
+        i1 += stride;
+        i2 -= stride;
+    }
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/WinICOFileFormat.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,331 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.internal.image.WinICOFileFormat;
+
+import org.eclipse.swt.internal.image.FileFormat;
+import org.eclipse.swt.graphics.PaletteData;
+import org.eclipse.swt.internal.image.WinBMPFileFormat;
+import org.eclipse.swt.SWT;
+import java.lang.all;
+
+import tango.core.Exception;
+
+public final class WinICOFileFormat : FileFormat {
+
+byte[] bitInvertData(byte[] data, int startIndex, int endIndex) {
+    // Destructively bit invert data in the given byte array.
+    for (int i = startIndex; i < endIndex; i++) {
+        data[i] = cast(byte)(255 - data[i - startIndex]);
+    }
+    return data;
+}
+
+static final byte[] convertPad(byte[] data, int width, int height, int depth, int pad, int newPad) {
+    if (pad is newPad) return data;
+    int stride = (width * depth + 7) / 8;
+    int bpl = (stride + (pad - 1)) / pad * pad;
+    int newBpl = (stride + (newPad - 1)) / newPad * newPad;
+    byte[] newData = new byte[height * newBpl];
+    int srcIndex = 0, destIndex = 0;
+    for (int y = 0; y < height; y++) {
+        System.arraycopy(data, srcIndex, newData, destIndex, newBpl);
+        srcIndex += bpl;
+        destIndex += newBpl;
+    }
+    return newData;
+}
+/**
+ * Answer the size in bytes of the file representation of the given
+ * icon
+ */
+int iconSize(ImageData i) {
+    int shapeDataStride = (i.width * i.depth + 31) / 32 * 4;
+    int maskDataStride = (i.width + 31) / 32 * 4;
+    int dataSize = (shapeDataStride + maskDataStride) * i.height;
+    int paletteSize = i.palette.colors !is null ? i.palette.colors.length * 4 : 0;
+    return WinBMPFileFormat.BMPHeaderFixedSize + paletteSize + dataSize;
+}
+override bool isFileFormat(LEDataInputStream stream) {
+    try {
+        byte[] header = new byte[4];
+        stream.read(header);
+        stream.unread(header);
+        return header[0] is 0 && header[1] is 0 && header[2] is 1 && header[3] is 0;
+    } catch (Exception e) {
+        return false;
+    }
+}
+bool isValidIcon(ImageData i) {
+    switch (i.depth) {
+        case 1:
+        case 4:
+        case 8:
+            if (i.palette.isDirect) return false;
+            int size = i.palette.colors.length;
+            return size is 2 || size is 16 || size is 32 || size is 256;
+        case 24:
+        case 32:
+            return i.palette.isDirect;
+        default:
+    }
+    return false;
+}
+int loadFileHeader(LEDataInputStream byteStream) {
+    int[] fileHeader = new int[3];
+    try {
+        fileHeader[0] = byteStream.readShort();
+        fileHeader[1] = byteStream.readShort();
+        fileHeader[2] = byteStream.readShort();
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+    if ((fileHeader[0] !is 0) || (fileHeader[1] !is 1))
+        SWT.error(SWT.ERROR_INVALID_IMAGE);
+    int numIcons = fileHeader[2];
+    if (numIcons <= 0)
+        SWT.error(SWT.ERROR_INVALID_IMAGE);
+    return numIcons;
+}
+int loadFileHeader(LEDataInputStream byteStream, bool hasHeader) {
+    int[] fileHeader = new int[3];
+    try {
+        if (hasHeader) {
+            fileHeader[0] = byteStream.readShort();
+            fileHeader[1] = byteStream.readShort();
+        } else {
+            fileHeader[0] = 0;
+            fileHeader[1] = 1;
+        }
+        fileHeader[2] = byteStream.readShort();
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+    if ((fileHeader[0] !is 0) || (fileHeader[1] !is 1))
+        SWT.error(SWT.ERROR_INVALID_IMAGE);
+    int numIcons = fileHeader[2];
+    if (numIcons <= 0)
+        SWT.error(SWT.ERROR_INVALID_IMAGE);
+    return numIcons;
+}
+override ImageData[] loadFromByteStream() {
+    int numIcons = loadFileHeader(inputStream);
+    int[][] headers = loadIconHeaders(numIcons);
+    ImageData[] icons = new ImageData[headers.length];
+    for (int i = 0; i < icons.length; i++) {
+        icons[i] = loadIcon(headers[i]);
+    }
+    return icons;
+}
+/**
+ * Load one icon from the byte stream.
+ */
+ImageData loadIcon(int[] iconHeader) {
+    byte[] infoHeader = loadInfoHeader(iconHeader);
+    WinBMPFileFormat bmpFormat = new WinBMPFileFormat();
+    bmpFormat.inputStream = inputStream;
+    PaletteData palette = bmpFormat.loadPalette(infoHeader);
+    byte[] shapeData = bmpFormat.loadData(infoHeader);
+    int width = (infoHeader[4] & 0xFF) | ((infoHeader[5] & 0xFF) << 8) | ((infoHeader[6] & 0xFF) << 16) | ((infoHeader[7] & 0xFF) << 24);
+    int height = (infoHeader[8] & 0xFF) | ((infoHeader[9] & 0xFF) << 8) | ((infoHeader[10] & 0xFF) << 16) | ((infoHeader[11] & 0xFF) << 24);
+    if (height < 0) height = -height;
+    int depth = (infoHeader[14] & 0xFF) | ((infoHeader[15] & 0xFF) << 8);
+    infoHeader[14] = 1;
+    infoHeader[15] = 0;
+    byte[] maskData = bmpFormat.loadData(infoHeader);
+    maskData = convertPad(maskData, width, height, 1, 4, 2);
+    bitInvertData(maskData, 0, maskData.length);
+    return ImageData.internal_new(
+        width,
+        height,
+        depth,
+        palette,
+        4,
+        shapeData,
+        2,
+        maskData,
+        null,
+        -1,
+        -1,
+        SWT.IMAGE_ICO,
+        0,
+        0,
+        0,
+        0);
+}
+int[][] loadIconHeaders(int numIcons) {
+    int[][] headers = new int[][]( numIcons, 7 );
+    try {
+        for (int i = 0; i < numIcons; i++) {
+            headers[i][0] = inputStream.read();
+            headers[i][1] = inputStream.read();
+            headers[i][2] = inputStream.readShort();
+            headers[i][3] = inputStream.readShort();
+            headers[i][4] = inputStream.readShort();
+            headers[i][5] = inputStream.readInt();
+            headers[i][6] = inputStream.readInt();
+        }
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+    return headers;
+}
+byte[] loadInfoHeader(int[] iconHeader) {
+    int width = iconHeader[0];
+    int height = iconHeader[1];
+    int numColors = iconHeader[2]; // the number of colors is in the low byte, but the high byte must be 0
+    if (numColors is 0) numColors = 256; // this is specified: '00' represents '256' (0x100) colors
+    if ((numColors !is 2) && (numColors !is 8) && (numColors !is 16) &&
+        (numColors !is 32) && (numColors !is 256))
+        SWT.error(SWT.ERROR_INVALID_IMAGE);
+    if (inputStream.getPosition() < iconHeader[6]) {
+        // Seek to the specified offset
+        try {
+            inputStream.skip(iconHeader[6] - inputStream.getPosition());
+        } catch (IOException e) {
+            SWT.error(SWT.ERROR_IO, e);
+            return null;
+        }
+    }
+    byte[] infoHeader = new byte[WinBMPFileFormat.BMPHeaderFixedSize];
+    try {
+        inputStream.read(infoHeader);
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+    if (((infoHeader[12] & 0xFF) | ((infoHeader[13] & 0xFF) << 8)) !is 1)
+        SWT.error(SWT.ERROR_INVALID_IMAGE);
+    int infoWidth = (infoHeader[4] & 0xFF) | ((infoHeader[5] & 0xFF) << 8) | ((infoHeader[6] & 0xFF) << 16) | ((infoHeader[7] & 0xFF) << 24);
+    int infoHeight = (infoHeader[8] & 0xFF) | ((infoHeader[9] & 0xFF) << 8) | ((infoHeader[10] & 0xFF) << 16) | ((infoHeader[11] & 0xFF) << 24);
+    int bitCount = (infoHeader[14] & 0xFF) | ((infoHeader[15] & 0xFF) << 8);
+    if (height is infoHeight && bitCount is 1) height /= 2;
+    if (!((width is infoWidth) && (height * 2 is infoHeight) &&
+        (bitCount is 1 || bitCount is 4 || bitCount is 8 || bitCount is 24 || bitCount is 32)))
+            SWT.error(SWT.ERROR_INVALID_IMAGE);
+    infoHeader[8] = cast(byte)(height & 0xFF);
+    infoHeader[9] = cast(byte)((height >> 8) & 0xFF);
+    infoHeader[10] = cast(byte)((height >> 16) & 0xFF);
+    infoHeader[11] = cast(byte)((height >> 24) & 0xFF);
+    return infoHeader;
+}
+/**
+ * Unload a single icon
+ */
+void unloadIcon(ImageData icon) {
+    int sizeImage = (((icon.width * icon.depth + 31) / 32 * 4) +
+        ((icon.width + 31) / 32 * 4)) * icon.height;
+    try {
+        outputStream.writeInt(WinBMPFileFormat.BMPHeaderFixedSize);
+        outputStream.writeInt(icon.width);
+        outputStream.writeInt(icon.height * 2);
+        outputStream.writeShort(1);
+        outputStream.writeShort(cast(short)icon.depth);
+        outputStream.writeInt(0);
+        outputStream.writeInt(sizeImage);
+        outputStream.writeInt(0);
+        outputStream.writeInt(0);
+        outputStream.writeInt(icon.palette.colors !is null ? icon.palette.colors.length : 0);
+        outputStream.writeInt(0);
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+
+    byte[] rgbs = WinBMPFileFormat.paletteToBytes(icon.palette);
+    try {
+        outputStream.write(rgbs);
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+    unloadShapeData(icon);
+    unloadMaskData(icon);
+}
+/**
+ * Unload the icon header for the given icon, calculating the offset.
+ */
+void unloadIconHeader(ImageData i) {
+    int headerSize = 16;
+    int offset = headerSize + 6;
+    int iconSize = iconSize(i);
+    try {
+        outputStream.write(i.width);
+        outputStream.write(i.height);
+        outputStream.writeShort(i.palette.colors !is null ? i.palette.colors.length : 0);
+        outputStream.writeShort(0);
+        outputStream.writeShort(0);
+        outputStream.writeInt(iconSize);
+        outputStream.writeInt(offset);
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+}
+override void unloadIntoByteStream(ImageLoader loader) {
+    /* We do not currently support writing multi-image ico,
+     * so we use the first image data in the loader's array. */
+    ImageData image = loader.data[0];
+    if (!isValidIcon(image))
+        SWT.error(SWT.ERROR_INVALID_IMAGE);
+    try {
+        outputStream.writeShort(0);
+        outputStream.writeShort(1);
+        outputStream.writeShort(1);
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+    unloadIconHeader(image);
+    unloadIcon(image);
+}
+/**
+ * Unload the mask data for an icon. The data is flipped vertically
+ * and inverted.
+ */
+void unloadMaskData(ImageData icon) {
+    ImageData mask = icon.getTransparencyMask();
+    int bpl = (icon.width + 7) / 8;
+    int pad = mask.scanlinePad;
+    int srcBpl = (bpl + pad - 1) / pad * pad;
+    int destBpl = (bpl + 3) / 4 * 4;
+    byte[] buf = new byte[destBpl];
+    int offset = (icon.height - 1) * srcBpl;
+    byte[] data = mask.data;
+    try {
+        for (int i = 0; i < icon.height; i++) {
+            System.arraycopy(data, offset, buf, 0, bpl);
+            bitInvertData(buf, 0, bpl);
+            outputStream.write(buf, 0, destBpl);
+            offset -= srcBpl;
+        }
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+}
+/**
+ * Unload the shape data for an icon. The data is flipped vertically.
+ */
+void unloadShapeData(ImageData icon) {
+    int bpl = (icon.width * icon.depth + 7) / 8;
+    int pad = icon.scanlinePad;
+    int srcBpl = (bpl + pad - 1) / pad * pad;
+    int destBpl = (bpl + 3) / 4 * 4;
+    byte[] buf = new byte[destBpl];
+    int offset = (icon.height - 1) * srcBpl;
+    byte[] data = icon.data;
+    try {
+        for (int i = 0; i < icon.height; i++) {
+            System.arraycopy(data, offset, buf, 0, bpl);
+            outputStream.write(buf, 0, destBpl);
+            offset -= srcBpl;
+        }
+    } catch (IOException e) {
+        SWT.error(SWT.ERROR_IO, e);
+    }
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/Common.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,107 @@
+module org.eclipse.swt.internal.mozilla.Common; 
+
+import java.lang.all;
+
+version(Windows) {
+    const NS_WIN32 = 1;
+}
+version(linux) {
+    const NS_UNIX = 1;
+}
+
+alias uint nsresult;
+alias uint nsrefcnt;
+
+const nsnull = 0;
+
+/******************************************************************************
+
+    prtypes
+
+******************************************************************************/
+
+extern (System):
+
+alias ubyte PRUint8;
+alias byte  PRInt8;
+
+const PR_INT8_MAX = 127;
+const PR_UINT8_MAX = 255U;
+
+alias ushort PRUint16;
+alias short PRInt16;
+
+const PR_INT16_MAX = 32767;
+const PR_UINT16_MAX = 65535U;
+
+alias uint PRUint32;
+alias int PRInt32;
+
+alias long PRInt64;
+alias ulong PRUint64;
+
+alias int PRIntn;
+alias uint PRUintn;
+
+alias double PRFloat64;
+alias size_t PRSize;
+
+alias PRInt32 PROffset32;
+alias PRInt64 PROffset64;
+
+alias ptrdiff_t PRPtrdiff;
+alias uint      PRUptrdiff;
+
+alias PRIntn PRBool;
+
+const PR_TRUE = 1;
+const PR_FALSE = 0;
+
+alias PRUint8 PRPackedBool;
+
+enum
+{
+    PR_FAILURE = -1,
+    PR_SUCCESS,
+}
+
+alias int PRStatus;
+
+alias wchar PRUnichar;
+
+alias int PRWord;
+alias uint PRUword;
+
+/******************************************************************************
+
+    nscommon
+
+******************************************************************************/
+
+alias void* nsIWidget;
+alias void* nsILayoutHistoryState;
+alias void* nsIDeviceContext;
+alias void* nsPresContext;
+alias void* nsEvent;
+alias void* nsEventStatus;
+alias void* nsIPresShell;
+alias void* JSContext;
+
+alias void* PRThread;
+alias void* PLEvent;
+alias void* PLEventQueue;
+alias void* PLHandleEventProc;
+alias void* PLDestroyEventProc;
+
+/******************************************************************************
+
+    gfxtypes
+
+******************************************************************************/
+
+alias PRUint32 gfx_color;
+alias PRUint16 gfx_depth;
+alias PRInt32  gfx_format;
+
+alias void* nsIntRect;
+alias void* nsRect;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/XPCOM.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,202 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation.  All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * -  Binding to permit interfacing between Mozilla and SWT
+ * -  Copyright (C) 2003, 2006 IBM Corp.  All Rights Reserved.
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+
+module org.eclipse.swt.internal.mozilla.XPCOM;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+import org.eclipse.swt.internal.mozilla.nsIModule;
+import org.eclipse.swt.internal.mozilla.nsIComponentManager;
+import org.eclipse.swt.internal.mozilla.nsIComponentRegistrar;
+import org.eclipse.swt.internal.mozilla.nsIServiceManager;
+import org.eclipse.swt.internal.mozilla.nsIFile;
+import org.eclipse.swt.internal.mozilla.nsILocalFile;
+import org.eclipse.swt.internal.mozilla.nsIDirectoryService;
+import org.eclipse.swt.internal.mozilla.nsIMemory;
+import org.eclipse.swt.internal.mozilla.nsIDebug;
+import org.eclipse.swt.internal.mozilla.nsITraceRefcnt;
+
+private import java.lang.all;
+
+/******************************************************************************
+
+  Original SWT XPCOM constant declarations for XPCOM
+
+******************************************************************************/
+   
+const String MOZILLA_FIVE_HOME = "MOZILLA_FIVE_HOME"; //$NON-NLS-1$
+const String MOZILLA_PLUGIN_PATH = "MOZ_PLUGIN_PATH"; //$NON-NLS-1$
+const String CONTENT_MAYBETEXT = "application/x-vnd.mozilla.maybe-text"; //$NON-NLS-1$
+const String CONTENT_MULTIPART = "multipart/x-mixed-replace"; //$NON-NLS-1$
+const String DOMEVENT_FOCUS = "focus"; //$NON-NLS-1$
+const String DOMEVENT_UNLOAD = "unload"; //$NON-NLS-1$
+const String DOMEVENT_MOUSEDOWN = "mousedown"; //$NON-NLS-1$
+const String DOMEVENT_MOUSEUP = "mouseup"; //$NON-NLS-1$
+const String DOMEVENT_MOUSEMOVE = "mousemove"; //$NON-NLS-1$
+const String DOMEVENT_MOUSEDRAG = "draggesture"; //$NON-NLS-1$
+const String DOMEVENT_MOUSEWHEEL = "DOMMouseScroll"; //$NON-NLS-1$
+const String DOMEVENT_MOUSEOVER = "mouseover"; //$NON-NLS-1$
+const String DOMEVENT_MOUSEOUT = "mouseout"; //$NON-NLS-1$
+const String DOMEVENT_KEYUP = "keyup"; //$NON-NLS-1$
+const String DOMEVENT_KEYDOWN = "keydown"; //$NON-NLS-1$
+const String DOMEVENT_KEYPRESS = "keypress"; //$NON-NLS-1$
+
+/* CID constants */
+const nsID NS_APPSHELL_CID = { 0x2d96b3df, 0xc051, 0x11d1, [0xa8,0x27,0x00,0x40,0x95,0x9a,0x28, 0xc9]}; //$NON-NLS-1$
+const nsID NS_CATEGORYMANAGER_CID = { 0x16d222a6, 0x1dd2, 0x11b2, [0xb6,0x93,0xf3,0x8b,0x02,0xc0,0x21,0xb2]}; //$NON-NLS-1$
+const nsID NS_DOWNLOAD_CID = { 0xe3fa9D0a, 0x1dd1, 0x11b2, [0xbd,0xef,0x8c,0x72,0x0b,0x59,0x74,0x45]}; //$NON-NLS-1$
+const nsID NS_FILEPICKER_CID = { 0x54ae32f8, 0x1dd2, 0x11b2, [0xa2,0x09,0xdf,0x7c,0x50,0x53,0x70,0xf8]}; //$NON-NLS-1$
+const nsID NS_HELPERAPPLAUNCHERDIALOG_CID = {0xf68578eb,0x6ec2,0x4169,[0xae,0x19,0x8c,0x62,0x43,0xf0,0xab,0xe1]}; //$NON-NLS-1$
+const nsID NS_INPUTSTREAMCHANNEL_CID = {0x6ddb050c,0x0d04,0x11d4,[0x98,0x6e,0x00,0xc0,0x4f,0xa0,0xcf,0x4a]}; //$NON-NLS-1$
+const nsID NS_IOSERVICE_CID = {0x9ac9e770,0x18bc,0x11d3,[0x93,0x37,0x00,0x10,0x4b,0xa0,0xfd,0x40]}; //$NON-NLS-1$
+const nsID NS_LOADGROUP_CID = {0xe1c61582,0x2a84,0x11d3,[0x8c,0xce,0x00,0x60,0xb0,0xfc,0x14,0xa3]}; //$NON-NLS-1$
+const nsID NS_PROMPTSERVICE_CID = {0xa2112d6a,0x0e28,0x421f,[0xb4,0x6a,0x25,0xc0,0xb3,0x08,0xcb,0xd0]}; //$NON-NLS-1$
+
+const String NS_CONTEXTSTACK_CONTRACTID = "@mozilla.org/js/xpc/ContextStack;1"; //$NON-NLS-1$
+const String NS_COOKIEMANAGER_CONTRACTID = "@mozilla.org/cookiemanager;1"; //$NON-NLS-1$
+const String NS_DIRECTORYSERVICE_CONTRACTID = "@mozilla.org/file/directory_service;1"; //$NON-NLS-1$
+const String NS_DOMSERIALIZER_CONTRACTID = "@mozilla.org/xmlextras/xmlserializer;1"; //$NON-NLS-1$
+const String NS_DOWNLOAD_CONTRACTID = "@mozilla.org/download;1"; //$NON-NLS-1$
+const String NS_FILEPICKER_CONTRACTID = "@mozilla.org/filepicker;1"; //$NON-NLS-1$
+const String NS_HELPERAPPLAUNCHERDIALOG_CONTRACTID = "@mozilla.org/helperapplauncherdialog;1"; //$NON-NLS-1$
+const String NS_MEMORY_CONTRACTID = "@mozilla.org/xpcom/memory-service;1"; //$NON-NLS-1$
+const String NS_OBSERVER_CONTRACTID = "@mozilla.org/observer-service;1"; //$NON-NLS-1$
+const String NS_PREFLOCALIZEDSTRING_CONTRACTID = "@mozilla.org/pref-localizedstring;1"; //$NON-NLS-1$
+const String NS_PREFSERVICE_CONTRACTID = "@mozilla.org/preferences-service;1"; //$NON-NLS-1$
+const String NS_PROMPTSERVICE_CONTRACTID = "@mozilla.org/embedcomp/prompt-service;1"; //$NON-NLS-1$
+const String NS_TRANSFER_CONTRACTID = "@mozilla.org/transfer;1"; //$NON-NLS-1$
+const String NS_WEBNAVIGATIONINFO_CONTRACTID = "@mozilla.org/webnavigation-info;1"; //$NON-NLS-1$
+const String NS_WINDOWWATCHER_CONTRACTID = "@mozilla.org/embedcomp/window-watcher;1"; //$NON-NLS-1$
+
+/* directory service constants */
+const String NS_APP_APPLICATION_REGISTRY_DIR = "AppRegD"; //$NON-NLS-1$
+const String NS_APP_CACHE_PARENT_DIR = "cachePDir"; //$NON-NLS-1$
+const String NS_APP_HISTORY_50_FILE = "UHist"; //$NON-NLS-1$
+const String NS_APP_LOCALSTORE_50_FILE = "LclSt"; //$NON-NLS-1$
+const String NS_APP_PLUGINS_DIR_LIST = "APluginsDL"; //$NON-NLS-1$
+const String NS_APP_PREF_DEFAULTS_50_DIR = "PrfDef"; //$NON-NLS-1$
+const String NS_APP_PREFS_50_DIR = "PrefD"; //$NON-NLS-1$
+const String NS_APP_PREFS_50_FILE = "PrefF"; //$NON-NLS-1$
+const String NS_APP_USER_CHROME_DIR = "UChrm"; //$NON-NLS-1$
+const String NS_APP_USER_MIMETYPES_50_FILE = "UMimTyp"; //$NON-NLS-1$
+const String NS_APP_USER_PROFILE_50_DIR = "ProfD"; //$NON-NLS-1$
+const String NS_GRE_COMPONENT_DIR = "GreComsD"; //$NON-NLS-1$
+const String NS_GRE_DIR = "GreD"; //$NON-NLS-1$
+const String NS_OS_CURRENT_PROCESS_DIR = "CurProcD"; //$NON-NLS-1$
+const String NS_OS_HOME_DIR = "Home"; //$NON-NLS-1$
+const String NS_OS_TEMP_DIR = "TmpD"; //$NON-NLS-1$
+const String NS_XPCOM_COMPONENT_DIR = "ComsD"; //$NON-NLS-1$
+const String NS_XPCOM_CURRENT_PROCESS_DIR = "XCurProcD"; //$NON-NLS-1$
+const String NS_XPCOM_INIT_CURRENT_PROCESS_DIR = "MozBinD"; //$NON-NLS-1$
+
+/* XPCOM constants */
+const int NS_OK =  0;
+const int NS_COMFALSE = 1;
+const int NS_BINDING_ABORTED = 0x804B0002;
+const int NS_ERROR_BASE = 0xc1f30000;
+const int NS_ERROR_NOT_INITIALIZED =  NS_ERROR_BASE + 1;
+const int NS_ERROR_ALREADY_INITIALIZED = NS_ERROR_BASE + 2;
+const int NS_ERROR_NOT_IMPLEMENTED =  0x80004001;
+const int NS_NOINTERFACE =  0x80004002;
+const int NS_ERROR_NO_INTERFACE =  NS_NOINTERFACE;
+const int NS_ERROR_INVALID_POINTER =  0x80004003;
+const int NS_ERROR_NULL_POINTER = NS_ERROR_INVALID_POINTER;
+const int NS_ERROR_ABORT = 0x80004004;
+const int NS_ERROR_FAILURE = 0x80004005;
+const int NS_ERROR_UNEXPECTED = 0x8000ffff;
+const int NS_ERROR_OUT_OF_MEMORY = 0x8007000e;
+const int NS_ERROR_ILLEGAL_VALUE = 0x80070057;
+const int NS_ERROR_INVALID_ARG = NS_ERROR_ILLEGAL_VALUE;
+const int NS_ERROR_NO_AGGREGATION = 0x80040110;
+const int NS_ERROR_NOT_AVAILABLE = 0x80040111;
+const int NS_ERROR_FACTORY_NOT_REGISTERED = 0x80040154;
+const int NS_ERROR_FACTORY_REGISTER_AGAIN = 0x80040155;
+const int NS_ERROR_FACTORY_NOT_LOADED = 0x800401f8;
+const int NS_ERROR_FACTORY_NO_SIGNATURE_SUPPORT = NS_ERROR_BASE + 0x101;
+const int NS_ERROR_FACTORY_EXISTS = NS_ERROR_BASE + 0x100;
+const int NS_ERROR_HTMLPARSER_UNRESOLVEDDTD = 0x804e03f3;
+const int NS_ERROR_FILE_NOT_FOUND = 0x80520012;
+const int NS_ERROR_FILE_UNRECOGNIZED_PATH = 0x80520001;
+
+public nsresult NS_FAILED( nsresult result ) {
+    return result & 0x80000000;
+}
+
+public nsresult NS_SUCCEEDED( nsresult result ) {
+    return !(result & 0x80000000);
+}
+
+public PRUint32 strlen_PRUnichar ( PRUnichar* str )
+{
+    PRUint32 len = 0;
+    if (str !is null) 
+        while (*(str++) != 0) len++;
+    return len;
+}
+
+/******************************************************************************
+
+    XPCOM Startup functions
+
+******************************************************************************/
+
+extern (System):
+
+struct nsStaticModuleInfo
+{
+    char *name;
+    nsGetModuleProc getModule;
+}
+
+alias nsresult function (nsIComponentManager, nsIFile, nsIModule*) nsGetModuleProc;
+
+/******************************************************************************
+
+******************************************************************************/
+
+nsresult  NS_InitXPCOM2( nsIServiceManager *result, nsIFile binDirectory,
+	                     nsIDirectoryServiceProvider appFileLocationProvider );
+nsresult  NS_InitXPCOM3( nsIServiceManager *result, nsIFile binDirectory,
+	                     nsIDirectoryServiceProvider appFileLocationProvider,
+	                     nsStaticModuleInfo* staticComponents,
+	                     PRUint32 componentCount );
+
+nsresult  NS_ShutdownXPCOM(nsIServiceManager servMgr);
+nsresult  NS_GetServiceManager(nsIServiceManager *result);
+nsresult  NS_GetComponentManager(nsIComponentManager *result);
+nsresult  NS_GetComponentRegistrar(nsIComponentRegistrar *result);
+nsresult  NS_GetMemoryManager(nsIMemory *result);
+nsresult  NS_NewLocalFile(nsAString* path, PRBool followLinks, nsILocalFile* result);
+nsresult  NS_NewNativeLocalFile(nsACString* path, PRBool followLinks, nsILocalFile* result);
+void *    NS_Alloc(PRSize size);
+void *    NS_Realloc(void *ptr, PRSize size);
+void      NS_Free(void *ptr);
+nsresult  NS_GetDebug(nsIDebug *result);
+nsresult  NS_GetTraceRefcnt(nsITraceRefcnt *result);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/XPCOMInit.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,59 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation.  All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * -  Binding to permit interfacing between Mozilla and SWT
+ * -  Copyright (C) 2003, 2006 IBM Corp.  All Rights Reserved.
+ *
+ * Port to the D programming language:
+ *      John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.internal.mozilla.XPCOMInit;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+
+extern(System) {
+
+    align(4):
+
+    struct GREVersionRange {
+        char    *lower;
+        int     lowerInclusive;
+        char    *upper;
+        int     upperInclusive;
+    }
+
+    struct GREProperty {
+        char *property;
+        char *value;
+    } 
+}
+  
+const int PATH_MAX = 4096;
+
+extern(System):
+
+nsresult GRE_GetGREPathWithProperties(GREVersionRange *versions, PRUint32 versionsLength, GREProperty *properties, PRUint32 propertiesLength, char *buffer, PRUint32 buflen);
+nsresult XPCOMGlueStartup(char* xpcomFile);
+nsresult XPCOMGlueShutdown ();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/gfxIImageFrame.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,54 @@
+module org.eclipse.swt.internal.mozilla.gfxIImageFrame;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+const char[] GFXIIMAGEFRAME_IID_STR = "f6d00ee7-defc-4101-b2dc-e72cf4c37c3c";
+
+const nsIID GFXIIMAGEFRAME_IID= 
+  {0xf6d00ee7, 0xdefc, 0x4101, 
+    [ 0xb2, 0xdc, 0xe7, 0x2c, 0xf4, 0xc3, 0x7c, 0x3c ]};
+
+interface gfxIImageFrame : nsISupports {
+
+
+  static const char[] IID_STR = GFXIIMAGEFRAME_IID_STR;
+  static const nsIID IID = GFXIIMAGEFRAME_IID;
+
+extern(System):
+
+  nsresult Init(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight, gfx_format aFormat, gfx_depth aDepth);
+  nsresult GetMutable(PRBool *aMutable);
+  nsresult SetMutable(PRBool aMutable);
+  nsresult GetX(PRInt32 *aX);
+  nsresult GetY(PRInt32 *aY);
+  nsresult GetWidth(PRInt32 *aWidth);
+  nsresult GetHeight(PRInt32 *aHeight);
+  nsresult GetRect(nsIntRect * rect);
+  nsresult GetFormat(gfx_format *aFormat);
+  nsresult GetNeedsBackground(PRBool *aNeedsBackground);
+  nsresult GetImageBytesPerRow(PRUint32 *aImageBytesPerRow);
+  nsresult GetImageDataLength(PRUint32 *aImageDataLength);
+  nsresult GetImageData(PRUint8 **bits, PRUint32 *length);
+  nsresult SetImageData(PRUint8 *data, PRUint32 length, PRInt32 offset);
+  nsresult LockImageData();
+  nsresult UnlockImageData();
+  nsresult GetAlphaBytesPerRow(PRUint32 *aAlphaBytesPerRow);
+  nsresult GetAlphaDataLength(PRUint32 *aAlphaDataLength);
+  nsresult GetAlphaData(PRUint8 **bits, PRUint32 *length);
+  nsresult SetAlphaData(PRUint8 *data, PRUint32 length, PRInt32 offset);
+  nsresult LockAlphaData();
+  nsresult UnlockAlphaData();
+  nsresult DrawTo(gfxIImageFrame aDst, PRInt32 aDX, PRInt32 aDY, PRInt32 aDWidth, PRInt32 aDHeight);
+  nsresult GetTimeout(PRInt32 *aTimeout);
+  nsresult SetTimeout(PRInt32 aTimeout);
+  nsresult GetFrameDisposalMethod(PRInt32 *aFrameDisposalMethod);
+  nsresult SetFrameDisposalMethod(PRInt32 aFrameDisposalMethod);
+  nsresult GetBackgroundColor(gfx_color *aBackgroundColor);
+  nsresult SetBackgroundColor(gfx_color aBackgroundColor);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/imgIContainer.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,51 @@
+module org.eclipse.swt.internal.mozilla.imgIContainer;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.gfxIImageFrame;
+import org.eclipse.swt.internal.mozilla.imgIContainerObserver;
+
+const char[] IMGICONTAINER_IID_STR = "1a6290e6-8285-4e10-963d-d001f8d327b8";
+
+const nsIID IMGICONTAINER_IID= 
+  {0x1a6290e6, 0x8285, 0x4e10, 
+    [ 0x96, 0x3d, 0xd0, 0x01, 0xf8, 0xd3, 0x27, 0xb8 ]};
+
+
+interface imgIContainer : nsISupports {
+
+  static const char[] IID_STR = IMGICONTAINER_IID_STR;
+  static const nsIID IID = IMGICONTAINER_IID;
+
+extern(System):
+  nsresult Init(PRInt32 aWidth, PRInt32 aHeight, imgIContainerObserver aObserver);
+  nsresult GetPreferredAlphaChannelFormat(gfx_format *aPreferredAlphaChannelFormat);
+  nsresult GetWidth(PRInt32 *aWidth);
+  nsresult GetHeight(PRInt32 *aHeight);
+  nsresult GetCurrentFrame(gfxIImageFrame  *aCurrentFrame);
+  nsresult GetNumFrames(PRUint32 *aNumFrames);
+
+  enum { kNormalAnimMode = 0 };
+  enum { kDontAnimMode = 1 };
+  enum { kLoopOnceAnimMode = 2 };
+
+  nsresult GetAnimationMode(PRUint16 *aAnimationMode);
+  nsresult SetAnimationMode(PRUint16 aAnimationMode);
+  nsresult GetFrameAt(PRUint32 index, gfxIImageFrame *_retval);
+  nsresult AppendFrame(gfxIImageFrame item);
+  nsresult RemoveFrame(gfxIImageFrame item);
+  nsresult EndFrameDecode(PRUint32 framenumber, PRUint32 timeout);
+  nsresult DecodingComplete();
+  nsresult Clear();
+  nsresult StartAnimation();
+  nsresult StopAnimation();
+  nsresult ResetAnimation();
+  nsresult GetLoopCount(PRInt32 *aLoopCount);
+  nsresult SetLoopCount(PRInt32 aLoopCount);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/imgIContainerObserver.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,27 @@
+module org.eclipse.swt.internal.mozilla.imgIContainerObserver;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.imgIContainer;
+import org.eclipse.swt.internal.mozilla.gfxIImageFrame;
+
+const char[] IMGICONTAINEROBSERVER_IID_STR = "53102f15-0f53-4939-957e-aea353ad2700";
+
+const nsIID IMGICONTAINEROBSERVER_IID= 
+  {0x53102f15, 0x0f53, 0x4939, 
+    [ 0x95, 0x7e, 0xae, 0xa3, 0x53, 0xad, 0x27, 0x00 ]};
+
+interface imgIContainerObserver : nsISupports {
+
+  static const char[] IID_STR = IMGICONTAINEROBSERVER_IID_STR;
+  static const nsIID IID = IMGICONTAINEROBSERVER_IID;
+
+extern(System):
+  nsresult FrameChanged(imgIContainer aContainer, gfxIImageFrame aFrame, nsIntRect * aDirtyRect);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsEmbedString.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,93 @@
+module org.eclipse.swt.internal.mozilla.nsEmbedString;
+
+import java.lang.all;
+
+import Utf = tango.text.convert.Utf;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+import XPCOM = org.eclipse.swt.internal.mozilla.XPCOM;
+
+scope class nsEmbedString
+{    
+	this(wchar[] s)
+	{
+		nsresult result;
+		result = NS_StringContainerInit2(&str, s.ptr, s.length, 0);
+		if (XPCOM.NS_FAILED(result)) 
+			throw new Exception("Init string container fail");
+	}
+
+	this()
+	{
+		nsresult result;
+		result = NS_StringContainerInit(&str);
+		if (XPCOM.NS_FAILED(result)) 
+			throw new Exception("Init string container fail");
+	}
+
+	nsAString* opCast()
+	{
+		return cast(nsAString*)&str;
+	}
+
+	wchar[] toString16()
+	{
+		wchar* buffer = null;
+		PRBool terminated;
+		uint len = NS_StringGetData(cast(nsAString*)&str, &buffer, &terminated);
+		return buffer[0 .. len].dup;
+	}
+    
+    char[] toString()
+    {
+        return Utf.toString(this.toString16());
+    }
+    ~this()
+	{
+		NS_StringContainerFinish(&str);
+	}
+private:
+	nsStringContainer str;
+}
+
+
+scope class nsEmbedCString
+{
+	this(char[] s)
+	{
+		nsresult result;
+		result = NS_CStringContainerInit2(&str, s.ptr, s.length, 0);
+		if (XPCOM.NS_FAILED(result)) 
+			throw new Exception("Init string container fail");
+	}
+
+	this()
+	{
+		nsresult result;
+		result = NS_CStringContainerInit(&str);
+		if (XPCOM.NS_FAILED(result)) 
+			throw new Exception("Init string container fail");
+	}
+
+	nsACString* opCast()
+	{
+		return cast(nsACString*)&str;
+	}
+
+	char[] toString()
+	{
+		char* buffer = null;
+		PRBool terminated;
+		uint len = NS_CStringGetData(cast(nsACString*)&str, &buffer, &terminated);
+        return buffer[0 .. len].dup;
+	}
+
+	~this()
+	{
+		NS_CStringContainerFinish(&str);
+	}
+private:
+	nsCStringContainer str;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsError.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,69 @@
+module org.eclipse.swt.internal.mozilla.nsError;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+
+/**
+ * @name Standard Module Offset Code. Each Module should identify a unique number
+ *       and then all errors associated with that module become offsets from the
+ *       base associated with that module id. There are 16 bits of code bits for
+ *       each module.
+ */
+
+enum {
+    NS_ERROR_MODULE_XPCOM = 1,
+    NS_ERROR_MODULE_BASE = 2,
+    NS_ERROR_MODULE_GFX = 3,
+    NS_ERROR_MODULE_WIDGET = 4,
+    NS_ERROR_MODULE_CALENDAR = 5,
+    NS_ERROR_MODULE_NETWORK = 6,
+    NS_ERROR_MODULE_PLUGINS = 7,
+    NS_ERROR_MODULE_LAYOUT = 8,
+    NS_ERROR_MODULE_HTMLPARSER = 9,
+    NS_ERROR_MODULE_RDF = 10,
+    NS_ERROR_MODULE_UCONV = 11,
+    NS_ERROR_MODULE_REG = 12,
+    NS_ERROR_MODULE_FILES = 13,
+    NS_ERROR_MODULE_DOM = 14,
+    NS_ERROR_MODULE_IMGLIB = 15,
+    NS_ERROR_MODULE_MAILNEWS = 16,
+    NS_ERROR_MODULE_EDITOR = 17,
+    NS_ERROR_MODULE_XPCONNECT = 18,
+    NS_ERROR_MODULE_PROFILE = 19,
+    NS_ERROR_MODULE_LDAP = 20,
+    NS_ERROR_MODULE_SECURITY = 21,
+    NS_ERROR_MODULE_DOM_XPATH = 22,
+    NS_ERROR_MODULE_DOM_RANGE = 23,
+    NS_ERROR_MODULE_URILOADER = 24,
+    NS_ERROR_MODULE_CONTENT = 25,
+    NS_ERROR_MODULE_PYXPCOM = 26,
+    NS_ERROR_MODULE_XSLT = 27,
+    NS_ERROR_MODULE_IPC = 28,
+    NS_ERROR_MODULE_SVG = 29,
+    NS_ERROR_MODULE_STORAGE = 30,
+    NS_ERROR_MODULE_SCHEMA = 31,
+    NS_ERROR_MODULE_GENERAL = 51,
+    NS_ERROR_SEVERITY_ERROR = 1,
+    NS_ERROR_MODULE_BASE_OFFSET = 0x45,
+}
+
+const nsresult NS_OK = cast(nsresult)0;
+const nsresult NS_ERROR_BASE = cast(nsresult) 0xC1F30000;
+const nsresult NS_ERROR_NOT_INITIALIZED = cast(nsresult)(NS_ERROR_BASE + 1);
+const nsresult NS_ERROR_ALREADY_INITIALIZED = cast(nsresult)(NS_ERROR_BASE + 2);
+const nsresult NS_NOINTERFACE = cast(nsresult)0x80004002L;
+
+alias NS_NOINTERFACE NS_ERROR_NO_INTERFACE;
+
+const nsresult NS_ERROR_INVALID_POINTER = cast(nsresult)0x80004003L;
+
+alias NS_ERROR_INVALID_POINTER NS_ERROR_NULL_POINTER;
+
+const nsresult NS_ERROR_ABORT         = cast(nsresult)0x80004004L;
+const nsresult NS_ERROR_FAILURE       = cast(nsresult)0x80004005L;
+const nsresult NS_ERROR_UNEXPECTED    = cast(nsresult)0x8000ffffL;
+const nsresult NS_ERROR_OUT_OF_MEMORY = cast(nsresult) 0x8007000eL;
+const nsresult NS_ERROR_ILLEGAL_VALUE = cast(nsresult) 0x80070057L;
+
+alias NS_ERROR_ILLEGAL_VALUE NS_ERROR_INVALID_ARG;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIAppShell.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,30 @@
+module org.eclipse.swt.internal.mozilla.nsIAppShell;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsIEventQueue;
+
+const char[] NS_IAPPSHELL_IID_STR = "a0757c31-eeac-11d1-9ec1-00aa002fb821";
+
+const nsIID NS_IAPPSHELL_IID= 
+  {0xa0757c31, 0xeeac, 0x11d1, 
+    [ 0x9e, 0xc1, 0x00, 0xaa, 0x00, 0x2f, 0xb8, 0x21 ]};
+
+interface nsIAppShell : nsISupports {
+  static const char[] IID_STR = NS_IAPPSHELL_IID_STR;
+  static const nsIID IID = NS_IAPPSHELL_IID;
+
+extern(System):
+  nsresult Create(int *argc, char **argv);
+  nsresult Run();
+  nsresult Spinup();
+  nsresult Spindown();
+  nsresult ListenToEventQueue(nsIEventQueue * aQueue, PRBool aListen);
+  nsresult GetNativeEvent(PRBool * aRealEvent, void * * aEvent);
+  nsresult DispatchNativeEvent(PRBool aRealEvent, void * aEvent);
+  nsresult Exit();
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIAtom.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,30 @@
+module org.eclipse.swt.internal.mozilla.nsIAtom;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_IATOM_IID_STR = "3d1b15b0-93b4-11d1-895b-006008911b81";
+
+const nsIID NS_IATOM_IID= 
+  {0x3d1b15b0, 0x93b4, 0x11d1, 
+    [ 0x89, 0x5b, 0x00, 0x60, 0x08, 0x91, 0x1b, 0x81 ]};
+
+interface nsIAtom : nsISupports {
+
+  static const char[] IID_STR = NS_IATOM_IID_STR;
+  static const nsIID IID = NS_IATOM_IID;
+
+extern(System):
+  nsresult ToString(nsAString * _retval);
+  nsresult ToUTF8String(nsACString * _retval);
+  nsresult GetUTF8String(char **aResult);
+  nsresult Equals(nsAString * aString, PRBool *_retval);
+  nsresult EqualsUTF8(nsACString * aString, PRBool *_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIAuthInformation.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,37 @@
+module org.eclipse.swt.internal.mozilla.nsIAuthInformation;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_IAUTHINFORMATION_IID_STR =  "0d73639c-2a92-4518-9f92-28f71fea5f20";
+
+const nsIID NS_IAUTHINFORMATION_IID =
+   {0x0d73639c, 0x2a92, 0x4518, 
+    [ 0x9f, 0x92, 0x28, 0xf7, 0x1f, 0xea, 0x5f, 0x20 ] };
+
+interface nsIAuthInformation : nsISupports {
+
+  static const char[] IID_STR = NS_IAUTHINFORMATION_IID_STR;
+  static const nsIID IID = NS_IAUTHINFORMATION_IID;
+
+  enum { AUTH_HOST = 1U }
+  enum { AUTH_PROXY = 2U }
+  enum { NEED_DOMAIN = 4U }
+  enum { ONLY_PASSWORD = 8U }
+
+extern(System):
+  nsresult GetFlags(PRUint32 *aFlags);
+  nsresult GetRealm(nsAString * aRealm);;
+  nsresult GetAuthenticationScheme(nsACString * aAuthenticationScheme);
+  nsresult GetUsername(nsAString * aUsername);
+  nsresult SetUsername(nsAString * aUsername);
+  nsresult GetPassword(nsAString * aPassword);
+  nsresult SetPassword(nsAString * aPassword);
+  nsresult GetDomain(nsAString * aDomain);
+  nsresult SetDomain(nsAString * aDomain);
+
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIAuthPrompt.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,32 @@
+module org.eclipse.swt.internal.mozilla.nsIAuthPrompt;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+// import org.eclipse.swt.internal.mozilla.nsIPrompt;
+
+const char[] NS_IAUTHPROMPT_IID_STR = "2f977d45-5485-11d4-87e2-0010a4e75ef2";
+
+const nsIID NS_IAUTHPROMPT_IID= 
+  {0x2f977d45, 0x5485, 0x11d4, 
+    [ 0x87, 0xe2, 0x00, 0x10, 0xa4, 0xe7, 0x5e, 0xf2 ]};
+
+interface nsIAuthPrompt : nsISupports {
+
+  static const char[] IID_STR = NS_IAUTHPROMPT_IID_STR;
+  static const nsIID IID = NS_IAUTHPROMPT_IID;
+
+  enum { SAVE_PASSWORD_NEVER = 0U };
+  enum { SAVE_PASSWORD_FOR_SESSION = 1U };
+  enum { SAVE_PASSWORD_PERMANENTLY = 2U };
+
+extern(System):
+  nsresult Prompt(PRUnichar *dialogTitle, PRUnichar *text, PRUnichar *passwordRealm, PRUint32 savePassword, PRUnichar *defaultText, PRUnichar **result, PRBool *_retval);
+  nsresult PromptUsernameAndPassword(PRUnichar *dialogTitle, PRUnichar *text, PRUnichar *passwordRealm, PRUint32 savePassword, PRUnichar **user, PRUnichar **pwd, PRBool *_retval);
+  nsresult PromptPassword(PRUnichar *dialogTitle, PRUnichar *text, PRUnichar *passwordRealm, PRUint32 savePassword, PRUnichar **pwd, PRBool *_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIAuthPromptCallback.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,24 @@
+module org.eclipse.swt.internal.mozilla.nsIAuthPromptCallback;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsIAuthInformation;
+
+const char[] NS_IAUTHPROMPTCALLBACK_IID_STR = "bdc387d7-2d29-4cac-92f1-dd75d786631d";
+
+const nsIID NS_IAUTHPROMPTCALLBACK_IID= 
+  {0xbdc387d7, 0x2d29, 0x4cac, 
+    [ 0x92, 0xf1, 0xdd, 0x75, 0xd7, 0x86, 0x63, 0x1d ]};
+
+interface nsIAuthPromptCallback : nsISupports {
+
+  static const char[] IID_STR = NS_IAUTHPROMPTCALLBACK_IID_STR;
+  static const nsIID IID = NS_IAUTHPROMPTCALLBACK_IID;
+
+extern(System):
+  nsresult OnAuthAvailable(nsISupports aContext, nsIAuthInformation aAuthInfo);
+  nsresult OnAuthCancelled(nsISupports aContext, PRBool userCancel);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIBaseWindow.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,49 @@
+module org.eclipse.swt.internal.mozilla.nsIBaseWindow;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+alias void * nativeWindow;
+
+const char[] NS_IBASEWINDOW_IID_STR = "046bc8a0-8015-11d3-af70-00a024ffc08c";
+
+const nsIID NS_IBASEWINDOW_IID= 
+  {0x046bc8a0, 0x8015, 0x11d3, 
+    [ 0xaf, 0x70, 0x00, 0xa0, 0x24, 0xff, 0xc0, 0x8c ]};
+
+interface nsIBaseWindow : nsISupports {
+
+  static const char[] IID_STR = NS_IBASEWINDOW_IID_STR;
+  static const nsIID IID = NS_IBASEWINDOW_IID;
+
+extern(System):
+  nsresult InitWindow(nativeWindow parentNativeWindow, nsIWidget * parentWidget, PRInt32 x, PRInt32 y, PRInt32 cx, PRInt32 cy);
+  nsresult Create();
+  nsresult Destroy();
+  nsresult SetPosition(PRInt32 x, PRInt32 y);
+  nsresult GetPosition(PRInt32 *x, PRInt32 *y);
+  nsresult SetSize(PRInt32 cx, PRInt32 cy, PRBool fRepaint);
+  nsresult GetSize(PRInt32 *cx, PRInt32 *cy);
+  nsresult SetPositionAndSize(PRInt32 x, PRInt32 y, PRInt32 cx, PRInt32 cy, PRBool fRepaint);
+  nsresult GetPositionAndSize(PRInt32 *x, PRInt32 *y, PRInt32 *cx, PRInt32 *cy);
+  nsresult Repaint(PRBool force);
+  nsresult GetParentWidget(nsIWidget * *aParentWidget);
+  nsresult SetParentWidget(nsIWidget * aParentWidget);
+  nsresult GetParentNativeWindow(nativeWindow *aParentNativeWindow);
+  nsresult SetParentNativeWindow(nativeWindow aParentNativeWindow);
+  nsresult GetVisibility(PRBool *aVisibility);
+  nsresult SetVisibility(PRBool aVisibility);
+  nsresult GetEnabled(PRBool *aEnabled);
+  nsresult SetEnabled(PRBool aEnabled);
+  nsresult GetBlurSuppression(PRBool *aBlurSuppression);
+  nsresult SetBlurSuppression(PRBool aBlurSuppression);
+  nsresult GetMainWidget(nsIWidget * *aMainWidget);
+  nsresult SetFocus();
+  nsresult GetTitle(PRUnichar * *aTitle);
+  nsresult SetTitle(PRUnichar * aTitle);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIBinaryInputStream.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,38 @@
+module org.eclipse.swt.internal.mozilla.nsIBinaryInputStream;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIInputStream;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_IBINARYINPUTSTREAM_IID_STR = "7b456cb0-8772-11d3-90cf-0040056a906e";
+
+const nsIID NS_IBINARYINPUTSTREAM_IID= 
+  {0x7b456cb0, 0x8772, 0x11d3, 
+    [ 0x90, 0xcf, 0x00, 0x40, 0x05, 0x6a, 0x90, 0x6e ]};
+
+interface nsIBinaryInputStream : nsIInputStream {
+
+  static const char[] IID_STR = NS_IBINARYINPUTSTREAM_IID_STR;
+  static const nsIID IID = NS_IBINARYINPUTSTREAM_IID;
+
+extern(System):
+  nsresult SetInputStream(nsIInputStream aInputStream);
+  nsresult ReadBoolean(PRBool *_retval);
+  nsresult Read8(PRUint8 *_retval);
+  nsresult Read16(PRUint16 *_retval);
+  nsresult Read32(PRUint32 *_retval);
+  nsresult Read64(PRUint64 *_retval);
+  nsresult ReadFloat(float *_retval);
+  nsresult ReadDouble(double *_retval);
+  nsresult ReadCString(nsACString * _retval);
+  nsresult ReadString(nsAString * _retval);
+  nsresult ReadBytes(PRUint32 aLength, char **aString);
+  nsresult ReadByteArray(PRUint32 aLength, PRUint8 **aBytes);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIBinaryOutputStream.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,38 @@
+module org.eclipse.swt.internal.mozilla.nsIBinaryOutputStream;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIOutputStream;
+
+const char[] NS_IBINARYOUTPUTSTREAM_IID_STR = "204ee610-8765-11d3-90cf-0040056a906e";
+
+const nsIID NS_IBINARYOUTPUTSTREAM_IID= 
+  {0x204ee610, 0x8765, 0x11d3, 
+    [ 0x90, 0xcf, 0x00, 0x40, 0x05, 0x6a, 0x90, 0x6e ]};
+
+interface nsIBinaryOutputStream : nsIOutputStream {
+
+  static const char[] IID_STR = NS_IBINARYOUTPUTSTREAM_IID_STR;
+  static const nsIID IID = NS_IBINARYOUTPUTSTREAM_IID;
+
+extern(System):
+  nsresult SetOutputStream(nsIOutputStream aOutputStream);
+  nsresult WriteBoolean(PRBool aBoolean);
+  nsresult Write8(PRUint8 aByte);
+  nsresult Write16(PRUint16 a16);
+  nsresult Write32(PRUint32 a32);
+  nsresult Write64(PRUint64 a64);
+  nsresult WriteFloat(float aFloat);
+  nsresult WriteDouble(double aDouble);
+  nsresult WriteStringZ(char *aString);
+  nsresult WriteWStringZ(PRUnichar *aString);
+  nsresult WriteUtf8Z(PRUnichar *aString);
+  nsresult WriteBytes(char *aString, PRUint32 aLength);
+  nsresult WriteByteArray(PRUint8 *aBytes, PRUint32 aLength);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsICancelable.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,23 @@
+module org.eclipse.swt.internal.mozilla.nsICancelable;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+const char[] NS_ICANCELABLE_IID_STR = "d94ac0a0-bb18-46b8-844e-84159064b0bd";
+
+const nsIID NS_ICANCELABLE_IID= 
+  {0xd94ac0a0, 0xbb18, 0x46b8, 
+    [ 0x84, 0x4e, 0x84, 0x15, 0x90, 0x64, 0xb0, 0xbd ]};
+
+interface nsICancelable : nsISupports {
+
+  static const char[] IID_STR = NS_ICANCELABLE_IID_STR;
+  static const nsIID IID = NS_ICANCELABLE_IID;
+
+extern(System):
+  nsresult Cancel(nsresult aReason);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsICategoryManager.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,29 @@
+module org.eclipse.swt.internal.mozilla.nsICategoryManager;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsISimpleEnumerator;
+
+const char[] NS_ICATEGORYMANAGER_IID_STR = "3275b2cd-af6d-429a-80d7-f0c5120342ac";
+
+const nsIID NS_ICATEGORYMANAGER_IID= 
+  {0x3275b2cd, 0xaf6d, 0x429a, 
+    [ 0x80, 0xd7, 0xf0, 0xc5, 0x12, 0x03, 0x42, 0xac ]};
+
+interface nsICategoryManager : nsISupports {
+
+  static const char[] IID_STR = NS_ICATEGORYMANAGER_IID_STR;
+  static const nsIID IID = NS_ICATEGORYMANAGER_IID;
+
+extern(System):
+  nsresult GetCategoryEntry(char *aCategory, char *aEntry, char **_retval);
+  nsresult AddCategoryEntry(char *aCategory, char *aEntry, char *aValue, PRBool aPersist, PRBool aReplace, char **_retval);
+  nsresult DeleteCategoryEntry(char *aCategory, char *aEntry, PRBool aPersist);
+  nsresult DeleteCategory(char *aCategory);
+  nsresult EnumerateCategory(char *aCategory, nsISimpleEnumerator *_retval);
+  nsresult EnumerateCategories(nsISimpleEnumerator *_retval);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIChannel.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,52 @@
+module org.eclipse.swt.internal.mozilla.nsIChannel;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIRequest;
+import org.eclipse.swt.internal.mozilla.nsIURI;
+import org.eclipse.swt.internal.mozilla.nsIInterfaceRequestor; 
+import org.eclipse.swt.internal.mozilla.nsIInputStream; 
+import org.eclipse.swt.internal.mozilla.nsIStreamListener;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_ICHANNEL_IID_STR = "c63a055a-a676-4e71-bf3c-6cfa11082018";
+const nsIID NS_ICHANNEL_IID= 
+  {0xc63a055a, 0xa676, 0x4e71, 
+    [ 0xbf, 0x3c, 0x6c, 0xfa, 0x11, 0x08, 0x20, 0x18 ]};
+
+interface nsIChannel : nsIRequest {
+
+  static const char[] IID_STR = NS_ICHANNEL_IID_STR;
+  static const nsIID IID = NS_ICHANNEL_IID;
+
+extern(System):
+  nsresult GetOriginalURI(nsIURI  *aOriginalURI);
+  nsresult SetOriginalURI(nsIURI  aOriginalURI);
+  nsresult GetURI(nsIURI  *aURI);
+  nsresult GetOwner(nsISupports  *aOwner);
+  nsresult SetOwner(nsISupports  aOwner);
+
+  nsresult GetNotificationCallbacks(nsIInterfaceRequestor  *aNotificationCallbacks);
+  nsresult SetNotificationCallbacks(nsIInterfaceRequestor  aNotificationCallbacks);
+  nsresult GetSecurityInfo(nsISupports  *aSecurityInfo);
+  nsresult GetContentType(nsACString * aContentType);
+  nsresult SetContentType(nsACString * aContentType);
+  nsresult GetContentCharset(nsACString * aContentCharset);
+  nsresult SetContentCharset(nsACString * aContentCharset);
+  nsresult GetContentLength(PRInt32 *aContentLength);
+  nsresult SetContentLength(PRInt32 aContentLength);
+  nsresult Open(nsIInputStream *_retval);
+  nsresult AsyncOpen(nsIStreamListener aListener, nsISupports aContext);
+
+  enum { LOAD_DOCUMENT_URI = 65536U };
+  enum { LOAD_RETARGETED_DOCUMENT_URI = 131072U };
+  enum { LOAD_REPLACE = 262144U };
+  enum { LOAD_INITIAL_DOCUMENT_URI = 524288U };
+  enum { LOAD_TARGETED = 1048576U };
+  enum { LOAD_CALL_CONTENT_SNIFFERS = 2097152U };
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIChromeEventHandler.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,26 @@
+module org.eclipse.swt.internal.mozilla.nsIChromeEventHandler;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMEvent; 
+
+const char[] NS_ICHROMEEVENTHANDLER_IID_STR = "7bc08970-9e6c-11d3-afb2-00a024ffc08c";
+
+const nsIID NS_ICHROMEEVENTHANDLER_IID= 
+  {0x7bc08970, 0x9e6c, 0x11d3, 
+    [ 0xaf, 0xb2, 0x00, 0xa0, 0x24, 0xff, 0xc0, 0x8c ]};
+
+interface nsIChromeEventHandler : nsISupports {
+
+  static const char[] IID_STR = NS_ICHROMEEVENTHANDLER_IID_STR;
+  static const nsIID IID = NS_ICHROMEEVENTHANDLER_IID;
+
+extern(System):
+  nsresult HandleChromeEvent(nsPresContext * aPresContext, nsEvent * aEvent, nsIDOMEvent *aDOMEvent, PRUint32 aFlags, nsEventStatus *aStatus);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsICollection.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,34 @@
+module org.eclipse.swt.internal.mozilla.nsICollection;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsISerializable;
+import org.eclipse.swt.internal.mozilla.nsIEnumerator;
+
+const char[] NS_ICOLLECTION_IID_STR = "83b6019c-cbc4-11d2-8cca-0060b0fc14a3";
+
+const nsIID NS_ICOLLECTION_IID= 
+  {0x83b6019c, 0xcbc4, 0x11d2, 
+    [ 0x8c, 0xca, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3 ]};
+
+interface nsICollection : nsISerializable {
+
+  static const char[] IID_STR = NS_ICOLLECTION_IID_STR;
+  static const nsIID IID = NS_ICOLLECTION_IID;
+
+extern(System):
+  nsresult Count(PRUint32 *_retval);
+  nsresult GetElementAt(PRUint32 index, nsISupports *_retval);
+  nsresult QueryElementAt(PRUint32 index, nsIID * uuid, void * *result);
+  nsresult SetElementAt(PRUint32 index, nsISupports item);
+  nsresult AppendElement(nsISupports item);
+  nsresult RemoveElement(nsISupports item);
+  nsresult Enumerate(nsIEnumerator *_retval);
+  nsresult Clear();
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIComponentManager.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,26 @@
+module org.eclipse.swt.internal.mozilla.nsIComponentManager;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsIFactory;
+
+const char[] NS_ICOMPONENTMANAGER_IID_STR = "a88e5a60-205a-4bb1-94e1-2628daf51eae";
+
+const nsIID NS_ICOMPONENTMANAGER_IID= 
+  {0xa88e5a60, 0x205a, 0x4bb1, 
+    [ 0x94, 0xe1, 0x26, 0x28, 0xda, 0xf5, 0x1e, 0xae ]};
+
+interface nsIComponentManager : nsISupports {
+  static const char[] IID_STR = NS_ICOMPONENTMANAGER_IID_STR;
+  static const nsIID IID = NS_ICOMPONENTMANAGER_IID;
+
+extern(System):
+  nsresult GetClassObject(nsCID * aClass, nsIID * aIID, void * *result);
+  nsresult GetClassObjectByContractID(char *aContractID, nsIID * aIID, void * *result);
+  nsresult CreateInstance(nsCID * aClass, nsISupports aDelegate, nsIID * aIID, void * *result);
+  nsresult CreateInstanceByContractID(char *aContractID, nsISupports aDelegate, nsIID * aIID, void * *result);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIComponentRegistrar.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,36 @@
+module org.eclipse.swt.internal.mozilla.nsIComponentRegistrar;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsIFile;
+import org.eclipse.swt.internal.mozilla.nsIFactory;
+import org.eclipse.swt.internal.mozilla.nsISimpleEnumerator;
+
+const char[] NS_ICOMPONENTREGISTRAR_IID_STR = "2417cbfe-65ad-48a6-b4b6-eb84db174392";
+
+const nsIID NS_ICOMPONENTREGISTRAR_IID= 
+  {0x2417cbfe, 0x65ad, 0x48a6, 
+    [ 0xb4, 0xb6, 0xeb, 0x84, 0xdb, 0x17, 0x43, 0x92 ]};
+
+interface nsIComponentRegistrar : nsISupports {
+  static const char[] IID_STR = NS_ICOMPONENTREGISTRAR_IID_STR;
+  static const nsIID IID = NS_ICOMPONENTREGISTRAR_IID;
+
+extern(System):
+  nsresult AutoRegister(nsIFile aSpec);
+  nsresult AutoUnregister(nsIFile aSpec);
+  nsresult RegisterFactory(nsCID * aClass, char *aClassName, char *aContractID, nsIFactory aFactory);
+  nsresult UnregisterFactory(nsCID * aClass, nsIFactory aFactory);
+  nsresult RegisterFactoryLocation(nsCID * aClass, char *aClassName, char *aContractID, nsIFile aFile, char *aLoaderStr, char *aType);
+  nsresult UnregisterFactoryLocation(nsCID * aClass, nsIFile aFile);
+  nsresult IsCIDRegistered(nsCID * aClass, PRBool *_retval);
+  nsresult IsContractIDRegistered(char *aContractID, PRBool *_retval);
+  nsresult EnumerateCIDs(nsISimpleEnumerator *_retval);
+  nsresult EnumerateContractIDs(nsISimpleEnumerator *_retval);
+  nsresult CIDToContractID(nsCID * aClass, char **_retval);
+  nsresult ContractIDToCID(char *aContractID, nsCID * *_retval);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIContentViewer.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,76 @@
+module org.eclipse.swt.internal.mozilla.nsIContentViewer;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMDocument;
+import org.eclipse.swt.internal.mozilla.nsISHEntry;
+
+/******************************************************************************
+
+******************************************************************************/
+
+const char[] NS_ICONTENTVIEWER_IID_STR = "6a7ddb40-8a9e-4576-8ad1-71c5641d8780";
+
+const nsIID NS_ICONTENTVIEWER_IID= 
+  {0x6a7ddb40, 0x8a9e, 0x4576, 
+    [ 0x8a, 0xd1, 0x71, 0xc5, 0x64, 0x1d, 0x87, 0x80 ]};
+
+interface nsIContentViewer : nsISupports {
+
+  static const char[] IID_STR = NS_ICONTENTVIEWER_IID_STR;
+  static const nsIID IID = NS_ICONTENTVIEWER_IID;
+
+extern(System):
+  nsresult Init(nsIWidget * aParentWidget, nsIDeviceContext * aDeviceContext, nsRect * aBounds);
+  nsresult GetContainer(nsISupports  *aContainer);
+  nsresult SetContainer(nsISupports  aContainer);
+  nsresult LoadStart(nsISupports aDoc);
+  nsresult LoadComplete(PRUint32 aStatus);
+  nsresult PermitUnload(PRBool *_retval);
+  nsresult PageHide(PRBool isUnload);
+  nsresult Close(nsISHEntry historyEntry);
+  nsresult Destroy();
+  nsresult Stop();
+  nsresult GetDOMDocument(nsIDOMDocument  *aDOMDocument);
+  nsresult SetDOMDocument(nsIDOMDocument  aDOMDocument);
+  nsresult GetBounds(nsRect * aBounds);
+  nsresult SetBounds(nsRect * aBounds);
+  nsresult GetPreviousViewer(nsIContentViewer  *aPreviousViewer);
+  nsresult SetPreviousViewer(nsIContentViewer  aPreviousViewer);
+  nsresult Move(PRInt32 aX, PRInt32 aY);
+  nsresult Show();
+  nsresult Hide();
+  nsresult GetEnableRendering(PRBool *aEnableRendering);
+  nsresult SetEnableRendering(PRBool aEnableRendering);
+  nsresult GetSticky(PRBool *aSticky);
+  nsresult SetSticky(PRBool aSticky);
+  nsresult RequestWindowClose(PRBool *_retval);
+  nsresult Open(nsISupports aState);
+  nsresult ClearHistoryEntry();
+
+}
+
+/******************************************************************************
+
+******************************************************************************/
+
+const char[] NS_ICONTENTVIEWER_MOZILLA_1_8_BRANCH_IID_STR = "51341ed4-a3bf-4fd5-ae17-5fd3ec59dcab";
+
+const nsIID NS_ICONTENTVIEWER_MOZILLA_1_8_BRANCH_IID= 
+  {0x51341ed4, 0xa3bf, 0x4fd5, 
+    [ 0xae, 0x17, 0x5f, 0xd3, 0xec, 0x59, 0xdc, 0xab ]};
+
+interface nsIContentViewer_MOZILLA_1_8_BRANCH : nsISupports {
+
+  static const char[] IID_STR = NS_ICONTENTVIEWER_MOZILLA_1_8_BRANCH_IID_STR;
+  static const nsIID IID = NS_ICONTENTVIEWER_MOZILLA_1_8_BRANCH_IID;
+
+extern(System):
+  nsresult OpenWithEntry(nsISupports aState, nsISHEntry aSHEntry);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIContextMenuListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,32 @@
+module org.eclipse.swt.internal.mozilla.nsIContextMenuListener;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsIDOMEvent; 
+import org.eclipse.swt.internal.mozilla.nsIDOMNode; 
+
+const char[] NS_ICONTEXTMENULISTENER_IID_STR = "3478b6b0-3875-11d4-94ef-0020183bf181";
+
+const nsIID NS_ICONTEXTMENULISTENER_IID= 
+  {0x3478b6b0, 0x3875, 0x11d4, 
+    [ 0x94, 0xef, 0x00, 0x20, 0x18, 0x3b, 0xf1, 0x81 ]};
+
+interface nsIContextMenuListener : nsISupports {
+
+  static const char[] IID_STR = NS_ICONTEXTMENULISTENER_IID_STR;
+  static const nsIID IID = NS_ICONTEXTMENULISTENER_IID;
+
+extern(System):
+  enum { CONTEXT_NONE = 0U };
+  enum { CONTEXT_LINK = 1U };
+  enum { CONTEXT_IMAGE = 2U };
+  enum { CONTEXT_DOCUMENT = 4U };
+  enum { CONTEXT_TEXT = 8U };
+  enum { CONTEXT_INPUT = 16U };
+
+  nsresult OnShowContextMenu(PRUint32 aContextFlags, nsIDOMEvent aEvent, nsIDOMNode aNode);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIContextMenuListener2.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,61 @@
+module org.eclipse.swt.internal.mozilla.nsIContextMenuListener2;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsIDOMEvent;
+import org.eclipse.swt.internal.mozilla.nsIDOMNode; 
+import org.eclipse.swt.internal.mozilla.imgIContainer;
+import org.eclipse.swt.internal.mozilla.nsIURI; 
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_ICONTEXTMENULISTENER2_IID_STR = "7fb719b3-d804-4964-9596-77cf924ee314";
+
+const nsIID NS_ICONTEXTMENULISTENER2_IID= 
+  {0x7fb719b3, 0xd804, 0x4964, 
+    [ 0x95, 0x96, 0x77, 0xcf, 0x92, 0x4e, 0xe3, 0x14 ]};
+
+interface nsIContextMenuListener2 : nsISupports {
+
+  static const char[] IID_STR = NS_ICONTEXTMENULISTENER2_IID_STR;
+  static const nsIID IID = NS_ICONTEXTMENULISTENER2_IID;
+
+  enum { CONTEXT_NONE = 0U };
+  enum { CONTEXT_LINK = 1U };
+  enum { CONTEXT_IMAGE = 2U };
+  enum { CONTEXT_DOCUMENT = 4U };
+  enum { CONTEXT_TEXT = 8U };
+  enum { CONTEXT_INPUT = 16U };
+  enum { CONTEXT_BACKGROUND_IMAGE = 32U };
+
+extern(System):
+  nsresult OnShowContextMenu(PRUint32 aContextFlags, nsIContextMenuInfo aUtils);
+}
+
+/******************************************************************************
+
+******************************************************************************/
+
+const char[] NS_ICONTEXTMENUINFO_IID_STR = "2f977d56-5485-11d4-87e2-0010a4e75ef2";
+
+const nsIID NS_ICONTEXTMENUINFO_IID= 
+  {0x2f977d56, 0x5485, 0x11d4, 
+    [ 0x87, 0xe2, 0x00, 0x10, 0xa4, 0xe7, 0x5e, 0xf2 ]};
+
+interface nsIContextMenuInfo : nsISupports {
+
+  static const char[] IID_STR = NS_ICONTEXTMENUINFO_IID_STR;
+  static const nsIID IID = NS_ICONTEXTMENUINFO_IID;
+
+extern(System):
+  nsresult GetMouseEvent(nsIDOMEvent  *aMouseEvent);
+  nsresult GetTargetNode(nsIDOMNode  *aTargetNode);
+  nsresult GetAssociatedLink(nsAString * aAssociatedLink);
+  nsresult GetImageContainer(imgIContainer  *aImageContainer);
+  nsresult GetImageSrc(nsIURI  *aImageSrc);
+  nsresult GetBackgroundImageContainer(imgIContainer  *aBackgroundImageContainer);
+  nsresult GetBackgroundImageSrc(nsIURI  *aBackgroundImageSrc);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsICookie.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,50 @@
+module org.eclipse.swt.internal.mozilla.nsICookie;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+alias PRInt32 nsCookieStatus;
+alias PRInt32 nsCookiePolicy;
+
+const char[] NS_ICOOKIE_IID_STR = "e9fcb9a4-d376-458f-b720-e65e7df593bc";
+
+const nsIID NS_ICOOKIE_IID= 
+  {0xe9fcb9a4, 0xd376, 0x458f, 
+    [ 0xb7, 0x20, 0xe6, 0x5e, 0x7d, 0xf5, 0x93, 0xbc ]};
+
+interface nsICookie : nsISupports {
+
+  static const char[] IID_STR = NS_ICOOKIE_IID_STR;
+  static const nsIID IID = NS_ICOOKIE_IID;
+
+extern(System):
+  nsresult GetName(nsACString * aName);
+  nsresult GetValue(nsACString * aValue);
+  nsresult GetIsDomain(PRBool *aIsDomain);
+  nsresult GetHost(nsACString * aHost);
+  nsresult GetPath(nsACString * aPath);
+  nsresult GetIsSecure(PRBool *aIsSecure);
+  nsresult GetExpires(PRUint64 *aExpires);
+
+  enum { STATUS_UNKNOWN = 0 };
+  enum { STATUS_ACCEPTED = 1 };
+  enum { STATUS_DOWNGRADED = 2 };
+  enum { STATUS_FLAGGED = 3 };
+  enum { STATUS_REJECTED = 4 };
+
+  nsresult GetStatus(nsCookieStatus *aStatus);
+
+  enum { POLICY_UNKNOWN = 0 };
+  enum { POLICY_NONE = 1 };
+  enum { POLICY_NO_CONSENT = 2 };
+  enum { POLICY_IMPLICIT_CONSENT = 3 };
+  enum { POLICY_EXPLICIT_CONSENT = 4 };
+  enum { POLICY_NO_II = 5 };
+
+  nsresult GetPolicy(nsCookiePolicy *aPolicy);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsICookie2.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,26 @@
+module org.eclipse.swt.internal.mozilla.nsICookie2;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsICookie;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_ICOOKIE2_IID_STR = "d3493503-7854-46ed-8284-8af54a847efb";
+
+const nsIID NS_ICOOKIE2_IID= 
+  {0xd3493503, 0x7854, 0x46ed, 
+    [ 0x82, 0x84, 0x8a, 0xf5, 0x4a, 0x84, 0x7e, 0xfb ]};
+
+interface nsICookie2 : nsICookie {
+
+  static const char[] IID_STR = NS_ICOOKIE2_IID_STR;
+  static const nsIID IID = NS_ICOOKIE2_IID;
+
+extern(System):
+  nsresult GetRawHost(nsACString * aRawHost);
+  nsresult GetIsSession(PRBool *aIsSession);
+  nsresult GetExpiry(PRInt64 *aExpiry);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsICookieManager.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,28 @@
+module org.eclipse.swt.internal.mozilla.nsICookieManager;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsISimpleEnumerator;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_ICOOKIEMANAGER_IID_STR = "aaab6710-0f2c-11d5-a53b-0010a401eb10";
+
+const nsIID NS_ICOOKIEMANAGER_IID= 
+  {0xaaab6710, 0x0f2c, 0x11d5, 
+    [ 0xa5, 0x3b, 0x00, 0x10, 0xa4, 0x01, 0xeb, 0x10 ]};
+
+interface nsICookieManager : nsISupports {
+
+  static const char[] IID_STR = NS_ICOOKIEMANAGER_IID_STR;
+  static const nsIID IID = NS_ICOOKIEMANAGER_IID;
+
+extern(System):
+  nsresult RemoveAll();
+  nsresult GetEnumerator(nsISimpleEnumerator  *aEnumerator);
+  nsresult Remove(nsACString * aDomain, nsACString * aName, nsACString * aPath, PRBool aBlocked);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsICookieManager2.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,26 @@
+module org.eclipse.swt.internal.mozilla.nsICookieManager2;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsICookieManager;
+import org.eclipse.swt.internal.mozilla.nsICookie2;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_ICOOKIEMANAGER2_IID_STR = "3e73ff5f-154e-494f-b640-3c654ba2cc2b";
+
+const nsIID NS_ICOOKIEMANAGER2_IID= 
+  {0x3e73ff5f, 0x154e, 0x494f, 
+    [ 0xb6, 0x40, 0x3c, 0x65, 0x4b, 0xa2, 0xcc, 0x2b ]};
+
+interface nsICookieManager2 : nsICookieManager {
+
+  static const char[] IID_STR = NS_ICOOKIEMANAGER2_IID_STR;
+  static const nsIID IID = NS_ICOOKIEMANAGER2_IID;
+
+extern(System):
+  nsresult Add(nsACString * aDomain, nsACString * aPath, nsACString * aName, nsACString * aValue, PRBool aSecure, PRBool aIsSession, PRInt64 aExpiry);
+  nsresult FindMatchingCookie(nsICookie2 aCookie, PRUint32 *aCountFromHost, PRBool *_retval);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsID.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,48 @@
+module org.eclipse.swt.internal.mozilla.nsID;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import java.lang.all;
+import java.text.ParseException;
+
+
+align(1)
+struct nsID
+{
+    PRUint32 m0;
+    PRUint16 m1;
+    PRUint16 m2;
+    PRUint8[8] m3;
+
+	static nsID opCall(String aIDStr)
+	{
+        nsID id;
+        if(aIDStr == null) throw new ParseException();
+        int i = 0;
+        with(id) {
+            for (; i < 8; i++) m0 = (m0 << 4) + Integer.parseInt (aIDStr.substring (i, i + 1), 16);
+            if (aIDStr.charAt (i) != '-') throw new ParseException ();
+            i++;
+            for (; i < 13; i++) m1 = cast(short)((m1 << 4) + Integer.parseInt (aIDStr.substring (i, i + 1), 16));
+            if (aIDStr.charAt (i) != '-') throw new ParseException ();
+            i++;
+            for (; i < 18; i++) m2 = cast(short)((m2 << 4) + Integer.parseInt (aIDStr.substring (i, i + 1), 16));
+            if (aIDStr.charAt (i) != '-') throw new ParseException ();
+            i++;
+            for (; i < 21; i++) m3[0] = cast(byte)((m3[0] << 4) + Integer.parseInt (aIDStr.substring (i, i + 1), 16));
+            for (; i < 23; i++) m3[1] = cast(byte)((m3[1] << 4) + Integer.parseInt (aIDStr.substring (i, i + 1), 16));
+            if (aIDStr.charAt (i) != '-') throw new ParseException ();
+            i++;
+            for (; i < 26; i++) m3[2] = cast(byte)((m3[2] << 4) + Integer.parseInt (aIDStr.substring (i, i + 1), 16));
+            for (; i < 28; i++) m3[3] = cast(byte)((m3[3] << 4) + Integer.parseInt (aIDStr.substring (i, i + 1), 16));
+            for (; i < 30; i++) m3[4] = cast(byte)((m3[4] << 4) + Integer.parseInt (aIDStr.substring (i, i + 1), 16));
+            for (; i < 32; i++) m3[5] = cast(byte)((m3[5] << 4) + Integer.parseInt (aIDStr.substring (i, i + 1), 16));
+            for (; i < 34; i++) m3[6] = cast(byte)((m3[6] << 4) + Integer.parseInt (aIDStr.substring (i, i + 1), 16));
+            for (; i < 36; i++) m3[7] = cast(byte)((m3[7] << 4) + Integer.parseInt (aIDStr.substring (i, i + 1), 16));
+        }
+        return id;
+	}
+
+}
+
+alias nsID nsCID;
+alias nsID nsIID;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMAbstractView.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,28 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMAbstractView;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMDocumentView;
+
+alias PRUint64 DOMTimeStamp;
+
+const char[] NS_IDOMABSTRACTVIEW_IID_STR = "f51ebade-8b1a-11d3-aae7-0010830123b4";
+
+const nsIID NS_IDOMABSTRACTVIEW_IID= 
+  {0xf51ebade, 0x8b1a, 0x11d3, 
+    [ 0xaa, 0xe7, 0x00, 0x10, 0x83, 0x01, 0x23, 0xb4 ]};
+
+interface nsIDOMAbstractView : nsISupports {
+
+  static const char[] IID_STR = NS_IDOMABSTRACTVIEW_IID_STR;
+  static const nsIID IID = NS_IDOMABSTRACTVIEW_IID;
+
+extern(System):
+  nsresult GetDocument(nsIDOMDocumentView  *aDocument);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMAttr.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,30 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMAttr;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsIDOMNode;
+import org.eclipse.swt.internal.mozilla.nsIDOMElement;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_IDOMATTR_IID_STR = "a6cf9070-15b3-11d2-932e-00805f8add32";
+
+const nsIID NS_IDOMATTR_IID= 
+  {0xa6cf9070, 0x15b3, 0x11d2, 
+    [ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 ]};
+
+interface nsIDOMAttr : nsIDOMNode {
+
+  static const char[] IID_STR = NS_IDOMATTR_IID_STR;
+  static const nsIID IID = NS_IDOMATTR_IID;
+
+extern(System):
+  nsresult GetName(nsAString * aName);
+  nsresult GetSpecified(PRBool *aSpecified);
+  nsresult GetValue(nsAString * aValue);
+  nsresult SetValue(nsAString * aValue);
+  nsresult GetOwnerElement(nsIDOMElement  *aOwnerElement);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMBarProp.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,27 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMBarProp;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+alias PRUint64 DOMTimeStamp;
+
+const char[] NS_IDOMBARPROP_IID_STR = "9eb2c150-1d56-11d3-8221-0060083a0bcf";
+
+const nsIID NS_IDOMBARPROP_IID= 
+  {0x9eb2c150, 0x1d56, 0x11d3, 
+    [ 0x82, 0x21, 0x00, 0x60, 0x08, 0x3a, 0x0b, 0xcf ]};
+
+interface nsIDOMBarProp : nsISupports {
+
+  static const char[] IID_STR = NS_IDOMBARPROP_IID_STR;
+  static const nsIID IID = NS_IDOMBARPROP_IID;
+
+extern(System):
+  nsresult GetVisible(PRBool *aVisible);
+  nsresult SetVisible(PRBool aVisible);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMCDATASection.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,23 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMCDATASection;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMText;
+
+const char[] NS_IDOMCDATASECTION_IID_STR = "a6cf9071-15b3-11d2-932e-00805f8add32";
+
+const nsIID NS_IDOMCDATASECTION_IID= 
+  {0xa6cf9071, 0x15b3, 0x11d2, 
+    [ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 ]};
+
+interface nsIDOMCDATASection : nsIDOMText {
+
+extern(System):
+  static const char[] IID_STR = NS_IDOMCDATASECTION_IID_STR;
+  static const nsIID IID = NS_IDOMCDATASECTION_IID;
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMCharacterData.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,33 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMCharacterData;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMNode;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_IDOMCHARACTERDATA_IID_STR = "a6cf9072-15b3-11d2-932e-00805f8add32";
+
+const nsIID NS_IDOMCHARACTERDATA_IID= 
+  {0xa6cf9072, 0x15b3, 0x11d2, 
+    [ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 ]};
+
+interface nsIDOMCharacterData : nsIDOMNode {
+
+  static const char[] IID_STR = NS_IDOMCHARACTERDATA_IID_STR;
+  static const nsIID IID = NS_IDOMCHARACTERDATA_IID;
+
+extern(System):
+  nsresult GetData(nsAString * aData);
+  nsresult SetData(nsAString * aData);
+  nsresult GetLength(PRUint32 *aLength);
+  nsresult SubstringData(PRUint32 offset, PRUint32 count, nsAString * _retval);
+  nsresult AppendData(nsAString * arg);
+  nsresult InsertData(PRUint32 offset, nsAString * arg);
+  nsresult DeleteData(PRUint32 offset, PRUint32 count);
+  nsresult ReplaceData(PRUint32 offset, PRUint32 count, nsAString * arg);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMComment.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,23 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMComment;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMCharacterData;
+
+const char[] NS_IDOMCOMMENT_IID_STR = "a6cf9073-15b3-11d2-932e-00805f8add32";
+
+const nsIID NS_IDOMCOMMENT_IID= 
+  {0xa6cf9073, 0x15b3, 0x11d2, 
+    [ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 ]};
+
+interface nsIDOMComment : nsIDOMCharacterData {
+
+extern(System):
+  static const char[] IID_STR = NS_IDOMCOMMENT_IID_STR;
+  static const nsIID IID = NS_IDOMCOMMENT_IID;
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMDOMImplementation.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,30 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMDOMImplementation;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMDocumentType;
+import org.eclipse.swt.internal.mozilla.nsIDOMDocument;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_IDOMDOMIMPLEMENTATION_IID_STR = "a6cf9074-15b3-11d2-932e-00805f8add32";
+
+const nsIID NS_IDOMDOMIMPLEMENTATION_IID= 
+  {0xa6cf9074, 0x15b3, 0x11d2, 
+    [ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 ]};
+
+interface nsIDOMDOMImplementation : nsISupports {
+
+  static const char[] IID_STR = NS_IDOMDOMIMPLEMENTATION_IID_STR;
+  static const nsIID IID = NS_IDOMDOMIMPLEMENTATION_IID;
+
+extern(System):
+  nsresult HasFeature(nsAString * feature, nsAString * version_, PRBool *_retval);
+  nsresult CreateDocumentType(nsAString * qualifiedName, nsAString * publicId, nsAString * systemId, nsIDOMDocumentType *_retval);
+  nsresult CreateDocument(nsAString * namespaceURI, nsAString * qualifiedName, nsIDOMDocumentType doctype, nsIDOMDocument *_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMDocument.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,54 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMDocument;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsIDOMNode;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMNode;
+import org.eclipse.swt.internal.mozilla.nsIDOMNodeList;
+import org.eclipse.swt.internal.mozilla.nsIDOMDocumentType;
+import org.eclipse.swt.internal.mozilla.nsIDOMElement;
+import org.eclipse.swt.internal.mozilla.nsIDOMDocumentFragment;
+import org.eclipse.swt.internal.mozilla.nsIDOMText;
+import org.eclipse.swt.internal.mozilla.nsIDOMComment;
+import org.eclipse.swt.internal.mozilla.nsIDOMCDATASection;
+import org.eclipse.swt.internal.mozilla.nsIDOMProcessingInstruction;
+import org.eclipse.swt.internal.mozilla.nsIDOMDOMImplementation;
+import org.eclipse.swt.internal.mozilla.nsIDOMAttr;
+import org.eclipse.swt.internal.mozilla.nsIDOMEntityReference;
+
+const char[] NS_IDOMDOCUMENT_IID_STR = "a6cf9075-15b3-11d2-932e-00805f8add32";
+
+const nsIID NS_IDOMDOCUMENT_IID= 
+  {0xa6cf9075, 0x15b3, 0x11d2, 
+    [ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 ]};
+
+interface nsIDOMDocument : nsIDOMNode {
+
+  static const char[] IID_STR = NS_IDOMDOCUMENT_IID_STR;
+  static const nsIID IID = NS_IDOMDOCUMENT_IID;
+
+extern(System):
+  nsresult GetDoctype(nsIDOMDocumentType  *aDoctype);
+  nsresult GetImplementation(nsIDOMDOMImplementation  *aImplementation);
+  nsresult GetDocumentElement(nsIDOMElement  *aDocumentElement);
+  nsresult CreateElement(nsAString * tagName, nsIDOMElement *_retval);
+  nsresult CreateDocumentFragment(nsIDOMDocumentFragment *_retval);
+  nsresult CreateTextNode(nsAString * data, nsIDOMText *_retval);
+  nsresult CreateComment(nsAString * data, nsIDOMComment *_retval);
+  nsresult CreateCDATASection(nsAString * data, nsIDOMCDATASection *_retval);
+  nsresult CreateProcessingInstruction(nsAString * target, nsAString * data, nsIDOMProcessingInstruction *_retval);
+  nsresult CreateAttribute(nsAString * name, nsIDOMAttr *_retval);
+  nsresult CreateEntityReference(nsAString * name, nsIDOMEntityReference *_retval);
+  nsresult GetElementsByTagName(nsAString * tagname, nsIDOMNodeList *_retval);
+  nsresult ImportNode(nsIDOMNode importedNode, PRBool deep, nsIDOMNode *_retval);
+  nsresult CreateElementNS(nsAString * namespaceURI, nsAString * qualifiedName, nsIDOMElement *_retval);
+  nsresult CreateAttributeNS(nsAString * namespaceURI, nsAString * qualifiedName, nsIDOMAttr *_retval);
+  nsresult GetElementsByTagNameNS(nsAString * namespaceURI, nsAString * localName, nsIDOMNodeList *_retval);
+  nsresult GetElementById(nsAString * elementId, nsIDOMElement *_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMDocumentFragment.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,22 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMDocumentFragment;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMNode;
+
+const char[] NS_IDOMDOCUMENTFRAGMENT_IID_STR = "a6cf9076-15b3-11d2-932e-00805f8add32";
+
+const nsIID NS_IDOMDOCUMENTFRAGMENT_IID= 
+  {0xa6cf9076, 0x15b3, 0x11d2, 
+    [ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 ]};
+
+interface nsIDOMDocumentFragment : nsIDOMNode {
+  static const char[] IID_STR = NS_IDOMDOCUMENTFRAGMENT_IID_STR;
+  static const nsIID IID = NS_IDOMDOCUMENTFRAGMENT_IID;
+
+extern(System):
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMDocumentType.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,32 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMDocumentType;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMNode;
+import org.eclipse.swt.internal.mozilla.nsIDOMNamedNodeMap;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_IDOMDOCUMENTTYPE_IID_STR = "a6cf9077-15b3-11d2-932e-00805f8add32";
+
+const nsIID NS_IDOMDOCUMENTTYPE_IID= 
+  {0xa6cf9077, 0x15b3, 0x11d2, 
+    [ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 ]};
+
+interface nsIDOMDocumentType : nsIDOMNode {
+
+  static const char[] IID_STR = NS_IDOMDOCUMENTTYPE_IID_STR;
+  static const nsIID IID = NS_IDOMDOCUMENTTYPE_IID;
+
+extern(System):
+  nsresult GetName(nsAString * aName);
+  nsresult GetEntities(nsIDOMNamedNodeMap  *aEntities);
+  nsresult GetNotations(nsIDOMNamedNodeMap  *aNotations);
+  nsresult GetPublicId(nsAString * aPublicId);
+  nsresult GetSystemId(nsAString * aSystemId);
+  nsresult GetInternalSubset(nsAString * aInternalSubset);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMDocumentView.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,28 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMDocumentView;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMAbstractView;
+
+alias PRUint64 DOMTimeStamp;
+
+const char[] NS_IDOMDOCUMENTVIEW_IID_STR = "1acdb2ba-1dd2-11b2-95bc-9542495d2569";
+
+const nsIID NS_IDOMDOCUMENTVIEW_IID= 
+  {0x1acdb2ba, 0x1dd2, 0x11b2, 
+    [ 0x95, 0xbc, 0x95, 0x42, 0x49, 0x5d, 0x25, 0x69 ]};
+
+interface nsIDOMDocumentView : nsISupports {
+
+  static const char[] IID_STR = NS_IDOMDOCUMENTVIEW_IID_STR;
+  static const nsIID IID = NS_IDOMDOCUMENTVIEW_IID;
+
+extern(System):
+  nsresult GetDefaultView(nsIDOMAbstractView  *aDefaultView);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMElement.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,43 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMElement;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMNode;
+import org.eclipse.swt.internal.mozilla.nsIDOMNodeList;
+import org.eclipse.swt.internal.mozilla.nsIDOMAttr;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_IDOMELEMENT_IID_STR = "a6cf9078-15b3-11d2-932e-00805f8add32";
+
+const nsIID NS_IDOMELEMENT_IID= 
+  {0xa6cf9078, 0x15b3, 0x11d2, 
+    [ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 ]};
+
+interface nsIDOMElement : nsIDOMNode {
+
+  static const char[] IID_STR = NS_IDOMELEMENT_IID_STR;
+  static const nsIID IID = NS_IDOMELEMENT_IID;
+
+extern(System):
+  nsresult GetTagName(nsAString * aTagName);
+  nsresult GetAttribute(nsAString * name, nsAString * _retval);
+  nsresult SetAttribute(nsAString * name, nsAString * value);
+  nsresult RemoveAttribute(nsAString * name);
+  nsresult GetAttributeNode(nsAString * name, nsIDOMAttr *_retval);
+  nsresult SetAttributeNode(nsIDOMAttr newAttr, nsIDOMAttr *_retval);
+  nsresult RemoveAttributeNode(nsIDOMAttr oldAttr, nsIDOMAttr *_retval);
+  nsresult GetElementsByTagName(nsAString * name, nsIDOMNodeList *_retval);
+  nsresult GetAttributeNS(nsAString * namespaceURI, nsAString * localName, nsAString * _retval);
+  nsresult SetAttributeNS(nsAString * namespaceURI, nsAString * qualifiedName, nsAString * value);
+  nsresult RemoveAttributeNS(nsAString * namespaceURI, nsAString * localName);
+  nsresult GetAttributeNodeNS(nsAString * namespaceURI, nsAString * localName, nsIDOMAttr *_retval);
+  nsresult SetAttributeNodeNS(nsIDOMAttr newAttr, nsIDOMAttr *_retval);
+  nsresult GetElementsByTagNameNS(nsAString * namespaceURI, nsAString * localName, nsIDOMNodeList *_retval);
+  nsresult HasAttribute(nsAString * name, PRBool *_retval);
+  nsresult HasAttributeNS(nsAString * namespaceURI, nsAString * localName, PRBool *_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMEntityReference.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,23 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMEntityReference;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMNode;
+
+const char[] NS_IDOMENTITYREFERENCE_IID_STR = "a6cf907a-15b3-11d2-932e-00805f8add32";
+
+const nsIID NS_IDOMENTITYREFERENCE_IID= 
+  {0xa6cf907a, 0x15b3, 0x11d2, 
+    [ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 ]};
+
+interface nsIDOMEntityReference : nsIDOMNode {
+
+  static const char[] IID_STR = NS_IDOMENTITYREFERENCE_IID_STR;
+  static const nsIID IID = NS_IDOMENTITYREFERENCE_IID;
+
+extern(System):
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,41 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMEvent;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsIDOMEventTarget;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+alias PRUint64 DOMTimeStamp;
+
+const char[] NS_IDOMEVENT_IID_STR = "a66b7b80-ff46-bd97-0080-5f8ae38add32";
+
+const nsIID NS_IDOMEVENT_IID= 
+  {0xa66b7b80, 0xff46, 0xbd97, 
+    [ 0x00, 0x80, 0x5f, 0x8a, 0xe3, 0x8a, 0xdd, 0x32 ]};
+
+interface nsIDOMEvent : nsISupports {
+
+  static const char[] IID_STR = NS_IDOMEVENT_IID_STR;
+  static const nsIID IID = NS_IDOMEVENT_IID;
+
+extern(System):
+  enum { CAPTURING_PHASE = 1U };
+  enum { AT_TARGET = 2U };
+  enum { BUBBLING_PHASE = 3U };
+
+  nsresult GetType(nsAString * aType);
+  nsresult GetTarget(nsIDOMEventTarget  *aTarget);
+  nsresult GetCurrentTarget(nsIDOMEventTarget  *aCurrentTarget);
+  nsresult GetEventPhase(PRUint16 *aEventPhase);
+  nsresult GetBubbles(PRBool *aBubbles);
+  nsresult GetCancelable(PRBool *aCancelable);
+  nsresult GetTimeStamp(DOMTimeStamp *aTimeStamp);
+  nsresult StopPropagation();
+  nsresult PreventDefault();
+  nsresult InitEvent(nsAString * eventTypeArg, PRBool canBubbleArg, PRBool cancelableArg);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMEventGroup.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,26 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMEventGroup;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+alias PRUint64 DOMTimeStamp;
+
+const char[] NS_IDOMEVENTGROUP_IID_STR = "33347bee-6620-4841-8152-36091ae80c7e";
+
+const nsIID NS_IDOMEVENTGROUP_IID= 
+  {0x33347bee, 0x6620, 0x4841, 
+    [ 0x81, 0x52, 0x36, 0x09, 0x1a, 0xe8, 0x0c, 0x7e ]};
+
+interface nsIDOMEventGroup : nsISupports {
+
+  static const char[] IID_STR = NS_IDOMEVENTGROUP_IID_STR;
+  static const nsIID IID = NS_IDOMEVENTGROUP_IID;
+
+extern(System):
+  nsresult IsSameEventGroup(nsIDOMEventGroup other, PRBool *_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMEventListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,25 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMEventListener;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsIDOMEvent;
+
+alias PRUint64 DOMTimeStamp;
+
+const char[] NS_IDOMEVENTLISTENER_IID_STR = "df31c120-ded6-11d1-bd85-00805f8ae3f4";
+const nsIID NS_IDOMEVENTLISTENER_IID= 
+  {0xdf31c120, 0xded6, 0x11d1, 
+    [ 0xbd, 0x85, 0x00, 0x80, 0x5f, 0x8a, 0xe3, 0xf4 ]};
+
+interface nsIDOMEventListener : nsISupports {
+
+  static const char[] IID_STR = NS_IDOMEVENTLISTENER_IID_STR;
+  static const nsIID IID = NS_IDOMEVENTLISTENER_IID;
+
+extern(System):
+  nsresult HandleEvent(nsIDOMEvent event);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMEventTarget.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,33 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMEventTarget;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsIDOMEvent;
+import org.eclipse.swt.internal.mozilla.nsIDOMEventListener;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+alias PRUint64 DOMTimeStamp;
+
+const char[] NS_IDOMEVENTTARGET_IID_STR = "1c773b30-d1cf-11d2-bd95-00805f8ae3f4";
+
+const nsIID NS_IDOMEVENTTARGET_IID= 
+  {0x1c773b30, 0xd1cf, 0x11d2, 
+    [ 0xbd, 0x95, 0x00, 0x80, 0x5f, 0x8a, 0xe3, 0xf4 ]};
+
+//extern(System)
+
+interface nsIDOMEventTarget : nsISupports {
+
+  static const char[] IID_STR = NS_IDOMEVENTTARGET_IID_STR;
+  static const nsIID IID = NS_IDOMEVENTTARGET_IID;
+
+extern(System):
+  nsresult AddEventListener(nsAString * type, nsIDOMEventListener listener, PRBool useCapture);
+  nsresult RemoveEventListener(nsAString * type, nsIDOMEventListener listener, PRBool useCapture);
+  nsresult DispatchEvent(nsIDOMEvent evt, PRBool *_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMKeyEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,150 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMKeyEvent;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMUIEvent;
+import org.eclipse.swt.internal.mozilla.nsIDOMAbstractView;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_IDOMKEYEVENT_IID_STR = "028e0e6e-8b01-11d3-aae7-0010838a3123";
+
+const nsIID NS_IDOMKEYEVENT_IID= 
+  {0x028e0e6e, 0x8b01, 0x11d3, 
+    [ 0xaa, 0xe7, 0x00, 0x10, 0x83, 0x8a, 0x31, 0x23 ]};
+
+interface nsIDOMKeyEvent : nsIDOMUIEvent {
+
+  static const char[] IID_STR = NS_IDOMKEYEVENT_IID_STR;
+  static const nsIID IID = NS_IDOMKEYEVENT_IID;
+
+extern(System):
+  enum { DOM_VK_CANCEL = 3U };
+  enum { DOM_VK_HELP = 6U };
+  enum { DOM_VK_BACK_SPACE = 8U };
+  enum { DOM_VK_TAB = 9U };
+  enum { DOM_VK_CLEAR = 12U };
+  enum { DOM_VK_RETURN = 13U };
+  enum { DOM_VK_ENTER = 14U };
+  enum { DOM_VK_SHIFT = 16U };
+  enum { DOM_VK_CONTROL = 17U };
+  enum { DOM_VK_ALT = 18U };
+  enum { DOM_VK_PAUSE = 19U };
+  enum { DOM_VK_CAPS_LOCK = 20U };
+  enum { DOM_VK_ESCAPE = 27U };
+  enum { DOM_VK_SPACE = 32U };
+  enum { DOM_VK_PAGE_UP = 33U };
+  enum { DOM_VK_PAGE_DOWN = 34U };
+  enum { DOM_VK_END = 35U };
+  enum { DOM_VK_HOME = 36U };
+  enum { DOM_VK_LEFT = 37U };
+  enum { DOM_VK_UP = 38U };
+  enum { DOM_VK_RIGHT = 39U };
+  enum { DOM_VK_DOWN = 40U };
+  enum { DOM_VK_PRINTSCREEN = 44U };
+  enum { DOM_VK_INSERT = 45U };
+  enum { DOM_VK_DELETE = 46U };
+  enum { DOM_VK_0 = 48U };
+  enum { DOM_VK_1 = 49U };
+  enum { DOM_VK_2 = 50U };
+  enum { DOM_VK_3 = 51U };
+  enum { DOM_VK_4 = 52U };
+  enum { DOM_VK_5 = 53U };
+  enum { DOM_VK_6 = 54U };
+  enum { DOM_VK_7 = 55U };
+  enum { DOM_VK_8 = 56U };
+  enum { DOM_VK_9 = 57U };
+  enum { DOM_VK_SEMICOLON = 59U };
+  enum { DOM_VK_EQUALS = 61U };
+  enum { DOM_VK_A = 65U };
+  enum { DOM_VK_B = 66U };
+  enum { DOM_VK_C = 67U };
+  enum { DOM_VK_D = 68U };
+  enum { DOM_VK_E = 69U };
+  enum { DOM_VK_F = 70U };
+  enum { DOM_VK_G = 71U };
+  enum { DOM_VK_H = 72U };
+  enum { DOM_VK_I = 73U };
+  enum { DOM_VK_J = 74U };
+  enum { DOM_VK_K = 75U };
+  enum { DOM_VK_L = 76U };
+  enum { DOM_VK_M = 77U };
+  enum { DOM_VK_N = 78U };
+  enum { DOM_VK_O = 79U };
+  enum { DOM_VK_P = 80U };
+  enum { DOM_VK_Q = 81U };
+  enum { DOM_VK_R = 82U };
+  enum { DOM_VK_S = 83U };
+  enum { DOM_VK_T = 84U };
+  enum { DOM_VK_U = 85U };
+  enum { DOM_VK_V = 86U };
+  enum { DOM_VK_W = 87U };
+  enum { DOM_VK_X = 88U };
+  enum { DOM_VK_Y = 89U };
+  enum { DOM_VK_Z = 90U };
+  enum { DOM_VK_CONTEXT_MENU = 93U };
+  enum { DOM_VK_NUMPAD0 = 96U };
+  enum { DOM_VK_NUMPAD1 = 97U };
+  enum { DOM_VK_NUMPAD2 = 98U };
+  enum { DOM_VK_NUMPAD3 = 99U };
+  enum { DOM_VK_NUMPAD4 = 100U };
+  enum { DOM_VK_NUMPAD5 = 101U };
+  enum { DOM_VK_NUMPAD6 = 102U };
+  enum { DOM_VK_NUMPAD7 = 103U };
+  enum { DOM_VK_NUMPAD8 = 104U };
+  enum { DOM_VK_NUMPAD9 = 105U };
+  enum { DOM_VK_MULTIPLY = 106U };
+  enum { DOM_VK_ADD = 107U };
+  enum { DOM_VK_SEPARATOR = 108U };
+  enum { DOM_VK_SUBTRACT = 109U };
+  enum { DOM_VK_DECIMAL = 110U };
+  enum { DOM_VK_DIVIDE = 111U };
+  enum { DOM_VK_F1 = 112U };
+  enum { DOM_VK_F2 = 113U };
+  enum { DOM_VK_F3 = 114U };
+  enum { DOM_VK_F4 = 115U };
+  enum { DOM_VK_F5 = 116U };
+  enum { DOM_VK_F6 = 117U };
+  enum { DOM_VK_F7 = 118U };
+  enum { DOM_VK_F8 = 119U };
+  enum { DOM_VK_F9 = 120U };
+  enum { DOM_VK_F10 = 121U };
+  enum { DOM_VK_F11 = 122U };
+  enum { DOM_VK_F12 = 123U };
+  enum { DOM_VK_F13 = 124U };
+  enum { DOM_VK_F14 = 125U };
+  enum { DOM_VK_F15 = 126U };
+  enum { DOM_VK_F16 = 127U };
+  enum { DOM_VK_F17 = 128U };
+  enum { DOM_VK_F18 = 129U };
+  enum { DOM_VK_F19 = 130U };
+  enum { DOM_VK_F20 = 131U };
+  enum { DOM_VK_F21 = 132U };
+  enum { DOM_VK_F22 = 133U };
+  enum { DOM_VK_F23 = 134U };
+  enum { DOM_VK_F24 = 135U };
+  enum { DOM_VK_NUM_LOCK = 144U };
+  enum { DOM_VK_SCROLL_LOCK = 145U };
+  enum { DOM_VK_COMMA = 188U };
+  enum { DOM_VK_PERIOD = 190U };
+  enum { DOM_VK_SLASH = 191U };
+  enum { DOM_VK_BACK_QUOTE = 192U };
+  enum { DOM_VK_OPEN_BRACKET = 219U };
+  enum { DOM_VK_BACK_SLASH = 220U };
+  enum { DOM_VK_CLOSE_BRACKET = 221U };
+  enum { DOM_VK_QUOTE = 222U };
+  enum { DOM_VK_META = 224U };
+
+  nsresult GetCharCode(PRUint32 *aCharCode);
+  nsresult GetKeyCode(PRUint32 *aKeyCode);
+  nsresult GetAltKey(PRBool *aAltKey);
+  nsresult GetCtrlKey(PRBool *aCtrlKey);
+  nsresult GetShiftKey(PRBool *aShiftKey);
+  nsresult GetMetaKey(PRBool *aMetaKey);
+
+  nsresult InitKeyEvent(nsAString * typeArg, PRBool canBubbleArg, PRBool cancelableArg, nsIDOMAbstractView viewArg, PRBool ctrlKeyArg, PRBool altKeyArg, PRBool shiftKeyArg, PRBool metaKeyArg, PRUint32 keyCodeArg, PRUint32 charCodeArg);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMMouseEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,38 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMMouseEvent;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMUIEvent;
+import org.eclipse.swt.internal.mozilla.nsIDOMEventTarget;
+import org.eclipse.swt.internal.mozilla.nsIDOMAbstractView;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_IDOMMOUSEEVENT_IID_STR = "ff751edc-8b02-aae7-0010-8301838a3123";
+
+const nsIID NS_IDOMMOUSEEVENT_IID= 
+  {0xff751edc, 0x8b02, 0xaae7, 
+    [ 0x00, 0x10, 0x83, 0x01, 0x83, 0x8a, 0x31, 0x23 ]};
+
+interface nsIDOMMouseEvent : nsIDOMUIEvent {
+
+  static const char[] IID_STR = NS_IDOMMOUSEEVENT_IID_STR;
+  static const nsIID IID = NS_IDOMMOUSEEVENT_IID;
+
+extern(System):
+  nsresult GetScreenX(PRInt32 *aScreenX);
+  nsresult GetScreenY(PRInt32 *aScreenY);
+  nsresult GetClientX(PRInt32 *aClientX);
+  nsresult GetClientY(PRInt32 *aClientY);
+  nsresult GetCtrlKey(PRBool *aCtrlKey);
+  nsresult GetShiftKey(PRBool *aShiftKey);
+  nsresult GetAltKey(PRBool *aAltKey);
+  nsresult GetMetaKey(PRBool *aMetaKey);
+  nsresult GetButton(PRUint16 *aButton);
+  nsresult GetRelatedTarget(nsIDOMEventTarget  *aRelatedTarget);
+
+  nsresult InitMouseEvent(nsAString * typeArg, PRBool canBubbleArg, PRBool cancelableArg, nsIDOMAbstractView viewArg, PRInt32 detailArg, PRInt32 screenXArg, PRInt32 screenYArg, PRInt32 clientXArg, PRInt32 clientYArg, PRBool ctrlKeyArg, PRBool altKeyArg, PRBool shiftKeyArg, PRBool metaKeyArg, PRUint16 buttonArg, nsIDOMEventTarget relatedTargetArg);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMNamedNodeMap.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,36 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMNamedNodeMap;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMNode;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+alias PRUint64 DOMTimeStamp;
+
+const char[] NS_IDOMNAMEDNODEMAP_IID_STR = "a6cf907b-15b3-11d2-932e-00805f8add32";
+
+const nsIID NS_IDOMNAMEDNODEMAP_IID= 
+  {0xa6cf907b, 0x15b3, 0x11d2, 
+    [ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 ]};
+
+interface nsIDOMNamedNodeMap : nsISupports {
+
+  static const char[] IID_STR = NS_IDOMNAMEDNODEMAP_IID_STR;
+  static const nsIID IID = NS_IDOMNAMEDNODEMAP_IID;
+
+extern(System):
+  nsresult GetNamedItem(nsAString * name, nsIDOMNode *_retval);
+  nsresult SetNamedItem(nsIDOMNode arg, nsIDOMNode *_retval);
+  nsresult RemoveNamedItem(nsAString * name, nsIDOMNode *_retval);
+  nsresult Item(PRUint32 index, nsIDOMNode *_retval);
+  nsresult GetLength(PRUint32 *aLength);
+  nsresult GetNamedItemNS(nsAString * namespaceURI, nsAString * localName, nsIDOMNode *_retval);
+  nsresult SetNamedItemNS(nsIDOMNode arg, nsIDOMNode *_retval);
+  nsresult RemoveNamedItemNS(nsAString * namespaceURI, nsAString * localName, nsIDOMNode *_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMNode.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,68 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMNode;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMNodeList;
+import org.eclipse.swt.internal.mozilla.nsIDOMNamedNodeMap;
+import org.eclipse.swt.internal.mozilla.nsIDOMDocument;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+alias PRUint64 DOMTimeStamp;
+
+const char[] NS_IDOMNODE_IID_STR = "a6cf907c-15b3-11d2-932e-00805f8add32";
+
+const nsIID NS_IDOMNODE_IID= 
+  {0xa6cf907c, 0x15b3, 0x11d2, 
+    [ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 ]};
+
+interface nsIDOMNode : nsISupports {
+
+  static const char[] IID_STR = NS_IDOMNODE_IID_STR;
+  static const nsIID IID = NS_IDOMNODE_IID;
+
+extern(System):
+  enum { ELEMENT_NODE = 1U };
+  enum { ATTRIBUTE_NODE = 2U };
+  enum { TEXT_NODE = 3U };
+  enum { CDATA_SECTION_NODE = 4U };
+  enum { ENTITY_REFERENCE_NODE = 5U };
+  enum { ENTITY_NODE = 6U };
+  enum { PROCESSING_INSTRUCTION_NODE = 7U };
+  enum { COMMENT_NODE = 8U };
+  enum { DOCUMENT_NODE = 9U };
+  enum { DOCUMENT_TYPE_NODE = 10U };
+  enum { DOCUMENT_FRAGMENT_NODE = 11U };
+  enum { NOTATION_NODE = 12U };
+
+  nsresult GetNodeName(nsAString * aNodeName);
+  nsresult GetNodeValue(nsAString * aNodeValue);
+  nsresult SetNodeValue(nsAString * aNodeValue);
+  nsresult GetNodeType(PRUint16 *aNodeType);
+  nsresult GetParentNode(nsIDOMNode  *aParentNode);
+  nsresult GetChildNodes(nsIDOMNodeList  *aChildNodes);
+  nsresult GetFirstChild(nsIDOMNode  *aFirstChild);
+  nsresult GetLastChild(nsIDOMNode  *aLastChild);
+  nsresult GetPreviousSibling(nsIDOMNode  *aPreviousSibling);
+  nsresult GetNextSibling(nsIDOMNode  *aNextSibling);
+  nsresult GetAttributes(nsIDOMNamedNodeMap  *aAttributes);
+  nsresult GetOwnerDocument(nsIDOMDocument  *aOwnerDocument);
+  nsresult InsertBefore(nsIDOMNode newChild, nsIDOMNode refChild, nsIDOMNode *_retval);
+  nsresult ReplaceChild(nsIDOMNode newChild, nsIDOMNode oldChild, nsIDOMNode *_retval);
+  nsresult RemoveChild(nsIDOMNode oldChild, nsIDOMNode *_retval);
+  nsresult AppendChild(nsIDOMNode newChild, nsIDOMNode *_retval);
+  nsresult HasChildNodes(PRBool *_retval);
+  nsresult CloneNode(PRBool deep, nsIDOMNode *_retval);
+  nsresult Normalize();
+  nsresult IsSupported(nsAString * feature, nsAString * version_, PRBool *_retval);
+  nsresult GetNamespaceURI(nsAString * aNamespaceURI);
+  nsresult GetPrefix(nsAString * aPrefix);
+  nsresult SetPrefix(nsAString * aPrefix);
+  nsresult GetLocalName(nsAString * aLocalName);
+  nsresult HasAttributes(PRBool *_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMNodeList.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,31 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMNodeList;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMNode;
+
+alias PRUint64 DOMTimeStamp;
+
+const char[] NS_IDOMNODELIST_IID_STR = "a6cf907d-15b3-11d2-932e-00805f8add32";
+
+const nsIID NS_IDOMNODELIST_IID= 
+  {0xa6cf907d, 0x15b3, 0x11d2, 
+    [ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 ]};
+
+//extern(System)
+
+interface nsIDOMNodeList : nsISupports {
+
+  static const char[] IID_STR = NS_IDOMNODELIST_IID_STR;
+  static const nsIID IID = NS_IDOMNODELIST_IID;
+
+extern(System):
+  nsresult Item(PRUint32 index, nsIDOMNode *_retval);
+  nsresult GetLength(PRUint32 *aLength);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMProcessingInstruction.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,26 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMProcessingInstruction;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsIDOMNode;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_IDOMPROCESSINGINSTRUCTION_IID_STR = "a6cf907f-15b3-11d2-932e-00805f8add32";
+
+const nsIID NS_IDOMPROCESSINGINSTRUCTION_IID= 
+  {0xa6cf907f, 0x15b3, 0x11d2, 
+    [ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 ]};
+
+interface nsIDOMProcessingInstruction : nsIDOMNode {
+
+  static const char[] IID_STR = NS_IDOMPROCESSINGINSTRUCTION_IID_STR;
+  static const nsIID IID = NS_IDOMPROCESSINGINSTRUCTION_IID;
+
+  nsresult GetTarget(nsAString * aTarget);
+  nsresult GetData(nsAString * aData);
+  nsresult SetData(nsAString * aData);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMRange.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,57 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMRange;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMNode;
+import org.eclipse.swt.internal.mozilla.nsIDOMDocumentFragment;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_IDOMRANGE_IID_STR = "a6cf90ce-15b3-11d2-932e-00805f8add32";
+
+const nsIID NS_IDOMRANGE_IID= 
+  {0xa6cf90ce, 0x15b3, 0x11d2, 
+    [ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 ]};
+
+interface nsIDOMRange : nsISupports {
+
+  static const char[] IID_STR = NS_IDOMRANGE_IID_STR;
+  static const nsIID IID = NS_IDOMRANGE_IID;
+
+extern(System):
+  nsresult GetStartContainer(nsIDOMNode  *aStartContainer);
+  nsresult GetStartOffset(PRInt32 *aStartOffset);
+  nsresult GetEndContainer(nsIDOMNode  *aEndContainer);
+  nsresult GetEndOffset(PRInt32 *aEndOffset);
+  nsresult GetCollapsed(PRBool *aCollapsed);
+  nsresult GetCommonAncestorContainer(nsIDOMNode  *aCommonAncestorContainer);
+  nsresult SetStart(nsIDOMNode refNode, PRInt32 offset);
+  nsresult SetEnd(nsIDOMNode refNode, PRInt32 offset);
+  nsresult SetStartBefore(nsIDOMNode refNode);
+  nsresult SetStartAfter(nsIDOMNode refNode);
+  nsresult SetEndBefore(nsIDOMNode refNode);
+  nsresult SetEndAfter(nsIDOMNode refNode);
+  nsresult Collapse(PRBool toStart);
+  nsresult SelectNode(nsIDOMNode refNode);
+  nsresult SelectNodeContents(nsIDOMNode refNode);
+
+  enum { START_TO_START = 0U };
+  enum { START_TO_END = 1U };
+  enum { END_TO_END = 2U };
+  enum { END_TO_START = 3U };
+
+  nsresult CompareBoundaryPoints(PRUint16 how, nsIDOMRange sourceRange, PRInt16 *_retval);
+  nsresult DeleteContents();
+  nsresult ExtractContents(nsIDOMDocumentFragment *_retval);
+  nsresult CloneContents(nsIDOMDocumentFragment *_retval);
+  nsresult InsertNode(nsIDOMNode newNode);
+  nsresult SurroundContents(nsIDOMNode newParent);
+  nsresult CloneRange(nsIDOMRange *_retval);
+  nsresult ToString(nsAString * _retval);
+  nsresult Detach();
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMSerializer.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,29 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMSerializer;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsIOutputStream;
+import org.eclipse.swt.internal.mozilla.nsIDOMNode;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_IDOMSERIALIZER_IID_STR = "a6cf9123-15b3-11d2-932e-00805f8add32";
+
+const nsIID NS_IDOMSERIALIZER_IID= 
+  {0xa6cf9123, 0x15b3, 0x11d2, 
+    [ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 ]};
+
+interface nsIDOMSerializer : nsISupports {
+
+  static const char[] IID_STR = NS_IDOMSERIALIZER_IID_STR;
+  static const nsIID IID = NS_IDOMSERIALIZER_IID;
+
+extern(System):
+
+  nsresult SerializeToString(nsIDOMNode root, PRUnichar ** _retval);
+  nsresult SerializeToStream(nsIDOMNode root, nsIOutputStream stream, char* charset);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMSerializer_1_7.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,28 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMSerializer_1_7;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsIOutputStream;
+import org.eclipse.swt.internal.mozilla.nsIDOMNode;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_IDOMSERIALIZER_IID_STR = "9fd4ba15-e67c-4c98-b52c-7715f62c9196";
+
+const nsIID NS_IDOMSERIALIZER_IID= 
+  {0x9fd4ba15, 0xe67c, 0x4c98, 
+    [ 0xb5, 0x2c, 0x77, 0x15, 0xf6, 0x2c, 0x91, 0x96 ]};
+
+interface nsIDOMSerializer_1_7 : nsISupports {
+
+  static const char[] IID_STR = NS_IDOMSERIALIZER_IID_STR;
+  static const nsIID IID = NS_IDOMSERIALIZER_IID;
+
+extern(System):
+  nsresult SerializeToString(nsIDOMNode root, nsAString * _retval);
+  nsresult SerializeToStream(nsIDOMNode root, nsIOutputStream stream, nsACString * charset);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMStorage.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,33 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMStorage;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+import org.eclipse.swt.internal.mozilla.nsIDOMStorageItem;
+
+alias PRUint64 DOMTimeStamp;
+
+const char[] NS_IDOMSTORAGE_IID_STR = "95cc1383-3b62-4b89-aaef-1004a513ef47";
+
+const nsIID NS_IDOMSTORAGE_IID= 
+  {0x95cc1383, 0x3b62, 0x4b89, 
+    [ 0xaa, 0xef, 0x10, 0x04, 0xa5, 0x13, 0xef, 0x47 ]};
+
+interface nsIDOMStorage : nsISupports {
+
+  static const char[] IID_STR = NS_IDOMSTORAGE_IID_STR;
+  static const nsIID IID = NS_IDOMSTORAGE_IID;
+
+extern(System):
+  nsresult GetLength(PRUint32 *aLength);
+  nsresult Key(PRUint32 index, nsAString * _retval);
+  nsresult GetItem(nsAString * key, nsIDOMStorageItem *_retval);
+  nsresult SetItem(nsAString * key, nsAString * data);
+  nsresult RemoveItem(nsAString * key);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMStorageItem.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,31 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMStorageItem;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+alias PRUint64 DOMTimeStamp;
+
+const char[] NS_IDOMSTORAGEITEM_IID_STR = "0cc37c78-4c5f-48e1-adfc-7480b8fe9dc4";
+
+const nsIID NS_IDOMSTORAGEITEM_IID= 
+  {0x0cc37c78, 0x4c5f, 0x48e1, 
+    [ 0xad, 0xfc, 0x74, 0x80, 0xb8, 0xfe, 0x9d, 0xc4 ]};
+
+interface nsIDOMStorageItem : nsISupports {
+
+  static const char[] IID_STR = NS_IDOMSTORAGEITEM_IID_STR;
+  static const nsIID IID = NS_IDOMSTORAGEITEM_IID;
+
+extern(System):
+  nsresult GetSecure(PRBool *aSecure);
+  nsresult SetSecure(PRBool aSecure);
+  nsresult GetValue(nsAString * aValue);
+  nsresult SetValue(nsAString * aValue);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMText.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,25 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMText;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMCharacterData;
+
+const char[] NS_IDOMTEXT_IID_STR = "a6cf9082-15b3-11d2-932e-00805f8add32";
+
+const nsIID NS_IDOMTEXT_IID= 
+  {0xa6cf9082, 0x15b3, 0x11d2, 
+    [ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 ]};
+
+interface nsIDOMText : nsIDOMCharacterData {
+
+  static const char[] IID_STR = NS_IDOMTEXT_IID_STR;
+  static const nsIID IID = NS_IDOMTEXT_IID;
+
+extern(System):
+  nsresult SplitText(PRUint32 offset, nsIDOMText *_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMUIEvent.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,29 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMUIEvent;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMEvent;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+import org.eclipse.swt.internal.mozilla.nsIDOMAbstractView;
+
+const char[] NS_IDOMUIEVENT_IID_STR = "a6cf90c3-15b3-11d2-932e-00805f8add32";
+
+const nsIID NS_IDOMUIEVENT_IID= 
+  {0xa6cf90c3, 0x15b3, 0x11d2, 
+    [ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 ]};
+
+interface nsIDOMUIEvent : nsIDOMEvent {
+
+  static const char[] IID_STR = NS_IDOMUIEVENT_IID_STR;
+  static const nsIID IID = NS_IDOMUIEVENT_IID;
+
+extern(System):
+  nsresult GetView(nsIDOMAbstractView  *aView);
+  nsresult GetDetail(PRInt32 *aDetail);
+  nsresult InitUIEvent(nsAString * typeArg, PRBool canBubbleArg, PRBool cancelableArg, nsIDOMAbstractView viewArg, PRInt32 detailArg);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMWindow.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,48 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMWindow;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMWindowCollection;
+import org.eclipse.swt.internal.mozilla.nsIDOMDocument;
+import org.eclipse.swt.internal.mozilla.nsIDOMBarProp;
+import org.eclipse.swt.internal.mozilla.nsISelection;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+alias PRUint64 DOMTimeStamp;
+
+const char[] NS_IDOMWINDOW_IID_STR = "a6cf906b-15b3-11d2-932e-00805f8add32";
+
+const nsIID NS_IDOMWINDOW_IID= 
+  {0xa6cf906b, 0x15b3, 0x11d2, 
+    [ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 ]};
+
+interface nsIDOMWindow : nsISupports {
+
+  static const char[] IID_STR = NS_IDOMWINDOW_IID_STR;
+  static const nsIID IID = NS_IDOMWINDOW_IID;
+
+extern(System):
+  nsresult GetDocument(nsIDOMDocument  *aDocument);
+  nsresult GetParent(nsIDOMWindow  *aParent);
+  nsresult GetTop(nsIDOMWindow  *aTop);
+  nsresult GetScrollbars(nsIDOMBarProp  *aScrollbars);
+  nsresult GetFrames(nsIDOMWindowCollection  *aFrames);
+  nsresult GetName(nsAString * aName);
+  nsresult SetName(nsAString * aName);
+  nsresult GetTextZoom(float *aTextZoom);
+  nsresult SetTextZoom(float aTextZoom);
+  nsresult GetScrollX(PRInt32 *aScrollX);
+  nsresult GetScrollY(PRInt32 *aScrollY);
+  nsresult ScrollTo(PRInt32 xScroll, PRInt32 yScroll);
+  nsresult ScrollBy(PRInt32 xScrollDif, PRInt32 yScrollDif);
+  nsresult GetSelection(nsISelection *_retval);
+  nsresult ScrollByLines(PRInt32 numLines);
+  nsresult ScrollByPages(PRInt32 numPages);
+  nsresult SizeToContent();
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMWindow2.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,25 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMWindow2;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsIDOMWindow;
+import org.eclipse.swt.internal.mozilla.nsIDOMEventTarget;
+
+const char[] NS_IDOMWINDOW2_IID_STR = "65455132-b96a-40ec-adea-52fa22b1028c";
+
+const nsIID NS_IDOMWINDOW2_IID= 
+  {0x65455132, 0xb96a, 0x40ec, 
+    [ 0xad, 0xea, 0x52, 0xfa, 0x22, 0xb1, 0x02, 0x8c ]};
+
+interface nsIDOMWindow2 : nsIDOMWindow {
+
+  static const char[] IID_STR = NS_IDOMWINDOW2_IID_STR;
+  static const nsIID IID = NS_IDOMWINDOW2_IID;
+
+extern(System):
+  nsresult GetWindowRoot(nsIDOMEventTarget  *aWindowRoot);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDOMWindowCollection.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,30 @@
+module org.eclipse.swt.internal.mozilla.nsIDOMWindowCollection;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsIDOMWindow;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+alias PRUint64 DOMTimeStamp;
+
+const char[] NS_IDOMWINDOWCOLLECTION_IID_STR = "a6cf906f-15b3-11d2-932e-00805f8add32";
+
+const nsIID NS_IDOMWINDOWCOLLECTION_IID= 
+  {0xa6cf906f, 0x15b3, 0x11d2, 
+    [ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 ]};
+
+interface nsIDOMWindowCollection : nsISupports {
+
+  static const char[] IID_STR = NS_IDOMWINDOWCOLLECTION_IID_STR;
+  static const nsIID IID = NS_IDOMWINDOWCOLLECTION_IID;
+
+extern(System):
+  nsresult GetLength(PRUint32 *aLength);
+  nsresult Item(PRUint32 index, nsIDOMWindow *_retval);
+  nsresult NamedItem(nsAString * name, nsIDOMWindow *_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDebug.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,25 @@
+module org.eclipse.swt.internal.mozilla.nsIDebug;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+const char[] NS_IDEBUG_IID_STR = "3bf0c3d7-3bd9-4cf2-a971-33572c503e1e";
+
+const nsIID NS_IDEBUG_IID= 
+  {0x3bf0c3d7, 0x3bd9, 0x4cf2, 
+    [ 0xa9, 0x71, 0x33, 0x57, 0x2c, 0x50, 0x3e, 0x1e ]};
+
+interface nsIDebug : nsISupports {
+  static const char[] IID_STR = NS_IDEBUG_IID_STR;
+  static const nsIID IID = NS_IDEBUG_IID;
+
+extern(System):
+  nsresult Assertion(char *aStr, char *aExpr, char *aFile, PRInt32 aLine);
+  nsresult Warning(char *aStr, char *aFile, PRInt32 aLine);
+  nsresult Break(char *aFile, PRInt32 aLine);
+  nsresult Abort(char *aFile, PRInt32 aLine);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDirectoryService.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,71 @@
+module org.eclipse.swt.internal.mozilla.nsIDirectoryService;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISimpleEnumerator;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsIFile;
+
+/******************************************************************************
+
+******************************************************************************/
+
+const char[] NS_IDIRECTORYSERVICEPROVIDER_IID_STR = "bbf8cab0-d43a-11d3-8cc2-00609792278c";
+
+const nsIID NS_IDIRECTORYSERVICEPROVIDER_IID= 
+  {0xbbf8cab0, 0xd43a, 0x11d3, 
+    [ 0x8c, 0xc2, 0x00, 0x60, 0x97, 0x92, 0x27, 0x8c ]};
+
+interface nsIDirectoryServiceProvider : nsISupports {
+
+  static const char[] IID_STR = NS_IDIRECTORYSERVICEPROVIDER_IID_STR;
+  static const nsIID IID = NS_IDIRECTORYSERVICEPROVIDER_IID;
+
+extern(System):
+  nsresult GetFile(char *prop, PRBool *persistent, nsIFile *_retval);
+
+}
+
+/******************************************************************************
+
+******************************************************************************/
+
+const char[] NS_IDIRECTORYSERVICEPROVIDER2_IID_STR = "2f977d4b-5485-11d4-87e2-0010a4e75ef2";
+
+const nsIID NS_IDIRECTORYSERVICEPROVIDER2_IID= 
+  {0x2f977d4b, 0x5485, 0x11d4, 
+    [ 0x87, 0xe2, 0x00, 0x10, 0xa4, 0xe7, 0x5e, 0xf2 ]};
+
+interface nsIDirectoryServiceProvider2 : nsIDirectoryServiceProvider {
+
+  static const char[] IID_STR = NS_IDIRECTORYSERVICEPROVIDER2_IID_STR;
+  static const nsIID IID = NS_IDIRECTORYSERVICEPROVIDER2_IID;
+
+extern(System):
+  nsresult GetFiles(char *prop, nsISimpleEnumerator *_retval);
+
+}
+
+/******************************************************************************
+
+******************************************************************************/
+
+const char[] NS_IDIRECTORYSERVICE_IID_STR = "57a66a60-d43a-11d3-8cc2-00609792278c";
+
+const nsIID NS_IDIRECTORYSERVICE_IID= 
+  {0x57a66a60, 0xd43a, 0x11d3, 
+    [ 0x8c, 0xc2, 0x00, 0x60, 0x97, 0x92, 0x27, 0x8c ]};
+
+interface nsIDirectoryService : nsISupports {
+
+  static const char[] IID_STR = NS_IDIRECTORYSERVICE_IID_STR;
+  static const nsIID IID = NS_IDIRECTORYSERVICE_IID;
+
+extern(System):
+  nsresult Init();
+  nsresult RegisterProvider(nsIDirectoryServiceProvider prov);
+  nsresult UnregisterProvider(nsIDirectoryServiceProvider prov);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDocShell.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,169 @@
+// FIXME; IID's are not consistant with SWT version
+
+module org.eclipse.swt.internal.mozilla.nsIDocShell;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIURI;
+import org.eclipse.swt.internal.mozilla.nsIChannel;
+import org.eclipse.swt.internal.mozilla.nsIContentViewer;
+import org.eclipse.swt.internal.mozilla.nsIURIContentListener;
+import org.eclipse.swt.internal.mozilla.nsIChromeEventHandler;
+import org.eclipse.swt.internal.mozilla.nsIDocShellLoadInfo;
+import org.eclipse.swt.internal.mozilla.nsIDocumentCharsetInfo;
+import org.eclipse.swt.internal.mozilla.nsIWebNavigation;
+import org.eclipse.swt.internal.mozilla.nsISimpleEnumerator;
+import org.eclipse.swt.internal.mozilla.nsIInputStream;
+import org.eclipse.swt.internal.mozilla.nsIRequest;
+import org.eclipse.swt.internal.mozilla.nsISHEntry;
+import org.eclipse.swt.internal.mozilla.nsISecureBrowserUI;
+import org.eclipse.swt.internal.mozilla.nsIDOMStorage;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+/******************************************************************************
+
+******************************************************************************/
+
+const char[] NS_IDOCSHELL_IID_STR = "69e5de00-7b8b-11d3-af61-00a024ffc08c";
+
+const nsIID NS_IDOCSHELL_IID= 
+  { 0x69e5de00, 0x7b8b, 0x11d3, [0xaf,0x61,0x00,0xa0,0x24,0xff,0xc0,0x8c] };
+interface nsIDocShell : nsISupports {
+
+  static const char[] IID_STR = NS_IDOCSHELL_IID_STR;
+  static const nsIID IID = NS_IDOCSHELL_IID;
+
+extern(System):
+  nsresult LoadURI(nsIURI uri, nsIDocShellLoadInfo loadInfo, PRUint32 aLoadFlags, PRBool firstParty);
+  nsresult LoadStream(nsIInputStream aStream, nsIURI aURI, nsACString * aContentType, nsACString * aContentCharset, nsIDocShellLoadInfo aLoadInfo);
+
+  enum { INTERNAL_LOAD_FLAGS_NONE = 0 };
+  enum { INTERNAL_LOAD_FLAGS_INHERIT_OWNER = 1 };
+  enum { INTERNAL_LOAD_FLAGS_DONT_SEND_REFERRER = 2 };
+  enum { INTERNAL_LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP = 4 };
+  enum { INTERNAL_LOAD_FLAGS_FIRST_LOAD = 8 };
+
+  nsresult InternalLoad(nsIURI aURI, nsIURI aReferrer, nsISupports aOwner, PRUint32 aFlags, PRUnichar *aWindowTarget, char *aTypeHint, nsIInputStream aPostDataStream, nsIInputStream aHeadersStream, PRUint32 aLoadFlags, nsISHEntry aSHEntry, PRBool firstParty, nsIDocShell *aDocShell, nsIRequest *aRequest);
+
+  nsresult CreateLoadInfo(nsIDocShellLoadInfo *loadInfo);
+  nsresult PrepareForNewContentModel();
+  nsresult SetCurrentURI(nsIURI aURI);
+  nsresult FirePageHideNotification(PRBool isUnload);
+  nsresult GetPresContext(nsPresContext * *aPresContext);
+  nsresult GetPresShell(nsIPresShell * *aPresShell);
+  nsresult GetEldestPresShell(nsIPresShell * *aEldestPresShell);
+  nsresult GetContentViewer(nsIContentViewer  *aContentViewer);
+  nsresult GetChromeEventHandler(nsIChromeEventHandler  *aChromeEventHandler);
+  nsresult SetChromeEventHandler(nsIChromeEventHandler  aChromeEventHandler);
+  nsresult GetDocumentCharsetInfo(nsIDocumentCharsetInfo  *aDocumentCharsetInfo);
+  nsresult SetDocumentCharsetInfo(nsIDocumentCharsetInfo  aDocumentCharsetInfo);
+  nsresult GetAllowPlugins(PRBool *aAllowPlugins);
+  nsresult SetAllowPlugins(PRBool aAllowPlugins);
+  nsresult GetAllowJavascript(PRBool *aAllowJavascript);
+  nsresult SetAllowJavascript(PRBool aAllowJavascript);
+  nsresult GetAllowMetaRedirects(PRBool *aAllowMetaRedirects);
+  nsresult SetAllowMetaRedirects(PRBool aAllowMetaRedirects);
+  nsresult GetAllowSubframes(PRBool *aAllowSubframes);
+  nsresult SetAllowSubframes(PRBool aAllowSubframes);
+  nsresult GetAllowImages(PRBool *aAllowImages);
+  nsresult SetAllowImages(PRBool aAllowImages);
+
+  enum { ENUMERATE_FORWARDS = 0 };
+  enum { ENUMERATE_BACKWARDS = 1 };
+
+  nsresult GetDocShellEnumerator(PRInt32 aItemType, PRInt32 aDirection, nsISimpleEnumerator *_retval);
+
+  enum { APP_TYPE_UNKNOWN = 0U };
+  enum { APP_TYPE_MAIL = 1U };
+  enum { APP_TYPE_EDITOR = 2U };
+
+  nsresult GetAppType(PRUint32 *aAppType);
+  nsresult SetAppType(PRUint32 aAppType);
+  nsresult GetAllowAuth(PRBool *aAllowAuth);
+  nsresult SetAllowAuth(PRBool aAllowAuth);
+  nsresult GetZoom(float *aZoom);
+  nsresult SetZoom(float aZoom);
+  nsresult GetMarginWidth(PRInt32 *aMarginWidth);
+  nsresult SetMarginWidth(PRInt32 aMarginWidth);
+  nsresult GetMarginHeight(PRInt32 *aMarginHeight);
+  nsresult SetMarginHeight(PRInt32 aMarginHeight);
+  nsresult GetHasFocus(PRBool *aHasFocus);
+  nsresult SetHasFocus(PRBool aHasFocus);
+  nsresult GetCanvasHasFocus(PRBool *aCanvasHasFocus);
+  nsresult SetCanvasHasFocus(PRBool aCanvasHasFocus);
+  nsresult TabToTreeOwner(PRBool forward, PRBool *tookFocus);
+
+  enum { BUSY_FLAGS_NONE = 0U };
+  enum { BUSY_FLAGS_BUSY = 1U };
+  enum { BUSY_FLAGS_BEFORE_PAGE_LOAD = 2U };
+  enum { BUSY_FLAGS_PAGE_LOADING = 4U };
+  enum { LOAD_CMD_NORMAL = 1U };
+  enum { LOAD_CMD_RELOAD = 2U };
+  enum { LOAD_CMD_HISTORY = 4U };
+
+  nsresult GetBusyFlags(PRUint32 *aBusyFlags);
+  nsresult GetLoadType(PRUint32 *aLoadType);
+  nsresult SetLoadType(PRUint32 aLoadType);
+  nsresult IsBeingDestroyed(PRBool *_retval);
+  nsresult GetIsExecutingOnLoadHandler(PRBool *aIsExecutingOnLoadHandler);
+  nsresult GetLayoutHistoryState(nsILayoutHistoryState  *aLayoutHistoryState);
+  nsresult SetLayoutHistoryState(nsILayoutHistoryState  aLayoutHistoryState);
+  nsresult GetShouldSaveLayoutState(PRBool *aShouldSaveLayoutState);
+  nsresult GetSecurityUI(nsISecureBrowserUI  *aSecurityUI);
+  nsresult SetSecurityUI(nsISecureBrowserUI  aSecurityUI);
+  nsresult SuspendRefreshURIs();
+  nsresult ResumeRefreshURIs();
+  nsresult BeginRestore(nsIContentViewer viewer, PRBool top);
+  nsresult FinishRestore();
+  nsresult GetRestoringDocument(PRBool *aRestoringDocument);
+  nsresult GetUseErrorPages(PRBool *aUseErrorPages);
+  nsresult SetUseErrorPages(PRBool aUseErrorPages);
+  nsresult GetPreviousTransIndex(PRInt32 *aPreviousTransIndex);
+  nsresult GetLoadedTransIndex(PRInt32 *aLoadedTransIndex);
+  nsresult HistoryPurged(PRInt32 numEntries);
+}
+
+/******************************************************************************
+
+******************************************************************************/
+
+const char[] NS_IDOCSHELL_1_8_IID_STR = "9f0c7461-b9a4-47f6-b88c-421dce1bce66";
+
+const nsIID NS_IDOCSHELL_1_8_IID= 
+    { 0x9f0c7461, 0xb9a4, 0x47f6, 
+       [ 0xb8,0x8c,0x42,0x1d,0xce,0x1b,0xce,0x66 ] }; 
+
+interface nsIDocShell_1_8 : nsIDocShell {
+
+  static const char[] IID_STR = NS_IDOCSHELL_1_8_IID_STR;
+  static const nsIID IID = NS_IDOCSHELL_1_8_IID;
+
+extern(System):
+  nsresult GetSessionStorageForURI(nsIURI uri, nsIDOMStorage *_retval);
+  nsresult AddSessionStorage(nsACString * aDomain, nsIDOMStorage storage);
+  nsresult GetCurrentDocumentChannel(nsIChannel  *aCurrentDocumentChannel);
+}
+
+/******************************************************************************
+
+******************************************************************************/
+
+const char[] NS_IDOCSHELL_1_9_IID_STR = "10ed386d-8598-408c-b571-e75ad18edeb0";
+
+const nsIID NS_IDOCSHELL_1_9_IID = 
+    {0x10ed386d, 0x8598, 0x408c, [ 0xb5, 0x71, 0xe7, 0x5a, 0xd1, 0x8e, 0xde, 0xb0 ] };
+
+interface nsIDocShell_1_9 : nsIDocShell_1_8 {
+
+  static const char[] IID_STR = NS_IDOCSHELL_1_9_IID_STR;
+  static const nsIID IID = NS_IDOCSHELL_1_9_IID;
+
+extern(System):
+  nsresult GetSessionStorageForURI(nsIURI uri, nsIDOMStorage *_retval);
+  nsresult AddSessionStorage(nsACString * aDomain, nsIDOMStorage storage);
+  nsresult GetCurrentDocumentChannel(nsIChannel  *aCurrentDocumentChannel);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDocShellLoadInfo.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,63 @@
+module org.eclipse.swt.internal.mozilla.nsIDocShellLoadInfo;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIURI; 
+import org.eclipse.swt.internal.mozilla.nsIInputStream;
+import org.eclipse.swt.internal.mozilla.nsISHEntry;
+
+alias PRInt32 nsDocShellInfoLoadType;
+
+const char[] NS_IDOCSHELLLOADINFO_IID_STR = "4f813a88-7aca-4607-9896-d97270cdf15e";
+
+const nsIID NS_IDOCSHELLLOADINFO_IID= 
+  {0x4f813a88, 0x7aca, 0x4607, 
+    [ 0x98, 0x96, 0xd9, 0x72, 0x70, 0xcd, 0xf1, 0x5e ]};
+
+interface nsIDocShellLoadInfo : nsISupports {
+
+  static const char[] IID_STR = NS_IDOCSHELLLOADINFO_IID_STR;
+  static const nsIID IID = NS_IDOCSHELLLOADINFO_IID;
+
+extern(System):
+  nsresult GetReferrer(nsIURI  *aReferrer);
+  nsresult SetReferrer(nsIURI  aReferrer);
+  nsresult GetOwner(nsISupports  *aOwner);
+  nsresult SetOwner(nsISupports  aOwner);
+  nsresult GetInheritOwner(PRBool *aInheritOwner);
+  nsresult SetInheritOwner(PRBool aInheritOwner);
+
+  enum { loadNormal = 0 };
+  enum { loadNormalReplace = 1 };
+  enum { loadHistory = 2 };
+  enum { loadReloadNormal = 3 };
+  enum { loadReloadBypassCache = 4 };
+  enum { loadReloadBypassProxy = 5 };
+  enum { loadReloadBypassProxyAndCache = 6 };
+  enum { loadLink = 7 };
+  enum { loadRefresh = 8 };
+  enum { loadReloadCharsetChange = 9 };
+  enum { loadBypassHistory = 10 };
+  enum { loadStopContent = 11 };
+  enum { loadStopContentAndReplace = 12 };
+  enum { loadNormalExternal = 13 };
+
+  nsresult GetLoadType(nsDocShellInfoLoadType *aLoadType);
+  nsresult SetLoadType(nsDocShellInfoLoadType aLoadType);
+  nsresult GetSHEntry(nsISHEntry  *aSHEntry);
+  nsresult SetSHEntry(nsISHEntry  aSHEntry);
+  nsresult GetTarget(PRUnichar * *aTarget);
+  nsresult SetTarget(PRUnichar * aTarget);
+  nsresult GetPostDataStream(nsIInputStream  *aPostDataStream);
+  nsresult SetPostDataStream(nsIInputStream  aPostDataStream);
+  nsresult GetHeadersStream(nsIInputStream  *aHeadersStream);
+  nsresult SetHeadersStream(nsIInputStream  aHeadersStream);
+  nsresult GetSendReferrer(PRBool *aSendReferrer);
+  nsresult SetSendReferrer(PRBool aSendReferrer);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDocShellTreeItem.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,46 @@
+module org.eclipse.swt.internal.mozilla.nsIDocShellTreeItem;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIDocShellTreeOwner;
+
+const char[] NS_IDOCSHELLTREEITEM_IID_STR = "7d935d63-6d2a-4600-afb5-9a4f7d68b825";
+
+const nsIID NS_IDOCSHELLTREEITEM_IID= 
+  {0x7d935d63, 0x6d2a, 0x4600, 
+    [ 0xaf, 0xb5, 0x9a, 0x4f, 0x7d, 0x68, 0xb8, 0x25 ]};
+
+interface nsIDocShellTreeItem : nsISupports {
+
+  static const char[] IID_STR = NS_IDOCSHELLTREEITEM_IID_STR;
+  static const nsIID IID = NS_IDOCSHELLTREEITEM_IID;
+
+extern(System):
+  nsresult GetName(PRUnichar * *aName);
+  nsresult SetName(PRUnichar * aName);
+  nsresult NameEquals(PRUnichar *name, PRBool *_retval);
+
+  enum { typeChrome = 0 };
+  enum { typeContent = 1 };
+  enum { typeContentWrapper = 2 };
+  enum { typeChromeWrapper = 3 };
+  enum { typeAll = 2147483647 };
+
+  nsresult GetItemType(PRInt32 *aItemType);
+  nsresult SetItemType(PRInt32 aItemType);
+  nsresult GetParent(nsIDocShellTreeItem  *aParent);
+  nsresult GetSameTypeParent(nsIDocShellTreeItem  *aSameTypeParent);
+  nsresult GetRootTreeItem(nsIDocShellTreeItem  *aRootTreeItem);
+  nsresult GetSameTypeRootTreeItem(nsIDocShellTreeItem  *aSameTypeRootTreeItem);
+  nsresult FindItemWithName(PRUnichar *name, nsISupports aRequestor, nsIDocShellTreeItem aOriginalRequestor, nsIDocShellTreeItem *_retval);
+  nsresult GetTreeOwner(nsIDocShellTreeOwner  *aTreeOwner);
+  nsresult SetTreeOwner(nsIDocShellTreeOwner treeOwner);
+  nsresult GetChildOffset(PRInt32 *aChildOffset);
+  nsresult SetChildOffset(PRInt32 aChildOffset);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDocShellTreeOwner.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,57 @@
+module org.eclipse.swt.internal.mozilla.nsIDocShellTreeOwner;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIDocShellTreeItem;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+/******************************************************************************
+
+******************************************************************************/
+
+const char[] NS_IDOCSHELLTREEOWNER_IID_STR = "9e508466-5ebb-4618-abfa-9ad47bed0b2e";
+
+const nsIID NS_IDOCSHELLTREEOWNER_IID= 
+  {0x9e508466, 0x5ebb, 0x4618, 
+    [ 0xab, 0xfa, 0x9a, 0xd4, 0x7b, 0xed, 0x0b, 0x2e ]};
+
+interface nsIDocShellTreeOwner : nsISupports {
+
+  static const char[] IID_STR = NS_IDOCSHELLTREEOWNER_IID_STR;
+  static const nsIID IID = NS_IDOCSHELLTREEOWNER_IID;
+
+extern(System):
+  nsresult FindItemWithName(PRUnichar *name, nsIDocShellTreeItem aRequestor, nsIDocShellTreeItem aOriginalRequestor, nsIDocShellTreeItem *_retval);
+  nsresult ContentShellAdded(nsIDocShellTreeItem aContentShell, PRBool aPrimary, PRUnichar *aID);
+  nsresult GetPrimaryContentShell(nsIDocShellTreeItem  *aPrimaryContentShell);
+  nsresult SizeShellTo(nsIDocShellTreeItem shell, PRInt32 cx, PRInt32 cy);
+  nsresult SetPersistence(PRBool aPersistPosition, PRBool aPersistSize, PRBool aPersistSizeMode);
+  nsresult GetPersistence(PRBool *aPersistPosition, PRBool *aPersistSize, PRBool *aPersistSizeMode);
+
+}
+
+/******************************************************************************
+
+******************************************************************************/
+
+const char[] NS_IDOCSHELLTREEOWNER_MOZILLA_1_8_BRANCH_IID_STR = "3c2a6927-e923-4ea8-bbda-a335c768ce4e";
+
+const nsIID NS_IDOCSHELLTREEOWNER_MOZILLA_1_8_BRANCH_IID= 
+  {0x3c2a6927, 0xe923, 0x4ea8, 
+    [ 0xbb, 0xda, 0xa3, 0x35, 0xc7, 0x68, 0xce, 0x4e ]};
+
+interface nsIDocShellTreeOwner_MOZILLA_1_8_BRANCH : nsIDocShellTreeOwner {
+
+  static const char[] IID_STR = NS_IDOCSHELLTREEOWNER_MOZILLA_1_8_BRANCH_IID_STR;
+  static const nsIID IID = NS_IDOCSHELLTREEOWNER_MOZILLA_1_8_BRANCH_IID;
+
+extern(System):
+  nsresult ContentShellAdded2(nsIDocShellTreeItem aContentShell, PRBool aPrimary, PRBool aTargetable, nsAString * aID);
+  nsresult ContentShellRemoved(nsIDocShellTreeItem aContentShell);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDocumentCharsetInfo.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,33 @@
+module org.eclipse.swt.internal.mozilla.nsIDocumentCharsetInfo;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIAtom;
+
+const char[] NS_IDOCUMENTCHARSETINFO_IID_STR = "2d40b291-01e1-11d4-9d0e-0050040007b2";
+
+const nsIID NS_IDOCUMENTCHARSETINFO_IID= 
+  {0x2d40b291, 0x01e1, 0x11d4, 
+    [ 0x9d, 0x0e, 0x00, 0x50, 0x04, 0x00, 0x07, 0xb2 ]};
+
+interface nsIDocumentCharsetInfo : nsISupports {
+
+  static const char[] IID_STR = NS_IDOCUMENTCHARSETINFO_IID_STR;
+  static const nsIID IID = NS_IDOCUMENTCHARSETINFO_IID;
+
+extern(System):
+  nsresult GetForcedCharset(nsIAtom  *aForcedCharset);
+  nsresult SetForcedCharset(nsIAtom  aForcedCharset);
+  nsresult GetForcedDetector(PRBool *aForcedDetector);
+  nsresult SetForcedDetector(PRBool aForcedDetector);
+  nsresult GetParentCharset(nsIAtom  *aParentCharset);
+  nsresult SetParentCharset(nsIAtom  aParentCharset);
+  nsresult GetParentCharsetSource(PRInt32 *aParentCharsetSource);
+  nsresult SetParentCharsetSource(PRInt32 aParentCharsetSource);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDownload.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,43 @@
+module org.eclipse.swt.internal.mozilla.nsIDownload;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsITransfer;
+import org.eclipse.swt.internal.mozilla.nsIWebProgressListener;
+import org.eclipse.swt.internal.mozilla.nsIURI; 
+import org.eclipse.swt.internal.mozilla.nsILocalFile;
+import org.eclipse.swt.internal.mozilla.nsIObserver; 
+import org.eclipse.swt.internal.mozilla.nsICancelable;
+import org.eclipse.swt.internal.mozilla.nsIMIMEInfo; 
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+import org.eclipse.swt.internal.mozilla.prtime;
+
+const char[] NS_IDOWNLOAD_IID_STR = "9e1fd9f2-9727-4926-85cd-f16c375bba6d";
+
+const nsIID NS_IDOWNLOAD_IID= 
+  {0x9e1fd9f2, 0x9727, 0x4926, 
+    [ 0x85, 0xcd, 0xf1, 0x6c, 0x37, 0x5b, 0xba, 0x6d ]};
+
+interface nsIDownload : nsISupports {
+
+  static const char[] IID_STR = NS_IDOWNLOAD_IID_STR;
+  static const nsIID IID = NS_IDOWNLOAD_IID;
+
+extern(System):
+  nsresult Init(nsIURI aSource, nsIURI aTarget, nsAString* aDisplayName, nsIMIMEInfo aMIMEInfo, PRTime startTime, PRBool aPersist);
+  nsresult GetSource(nsIURI  *aSource);
+  nsresult GetTarget(nsIURI  *aTarget);
+  nsresult GetPersist(PRBool *aPersist);
+  nsresult GetPercentComplete(PRInt32 *aPercentComplete);
+  nsresult GetDisplayName(PRUnichar * *aDisplayName);
+  nsresult SetDisplayName(PRUnichar* aDisplayName);
+  nsresult GetStartTime(PRInt64 *aStartTime);
+  nsresult GetMIMEInfo(nsIMIMEInfo  *aMIMEInfo);
+  nsresult GetListener(nsIWebProgressListener* aListener);
+  nsresult SetListener(nsIWebProgressListener aListener);
+  nsresult GetObserver(nsIObserver * aObserver);
+  nsresult SetObserver(nsIObserver aObserver);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIDownload_1_8.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,37 @@
+module org.eclipse.swt.internal.mozilla.nsIDownload_1_8;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsITransfer;
+import org.eclipse.swt.internal.mozilla.nsIURI; 
+import org.eclipse.swt.internal.mozilla.nsILocalFile;
+import org.eclipse.swt.internal.mozilla.nsIObserver; 
+import org.eclipse.swt.internal.mozilla.nsICancelable;
+import org.eclipse.swt.internal.mozilla.nsIMIMEInfo; 
+
+const char[] NS_IDOWNLOAD_IID_STR = "9e1fd9f2-9727-4926-85cd-f16c375bba6d";
+
+const nsIID NS_IDOWNLOAD_IID= 
+  {0x9e1fd9f2, 0x9727, 0x4926, 
+    [ 0x85, 0xcd, 0xf1, 0x6c, 0x37, 0x5b, 0xba, 0x6d ]};
+
+interface nsIDownload_1_8 : nsITransfer {
+
+  static const char[] IID_STR = NS_IDOWNLOAD_IID_STR;
+  static const nsIID IID = NS_IDOWNLOAD_IID;
+
+extern(System):
+  nsresult GetTargetFile(nsILocalFile  *aTargetFile);
+  nsresult GetPercentComplete(PRInt32 *aPercentComplete);
+  nsresult GetAmountTransferred(PRUint64 *aAmountTransferred);
+  nsresult GetSize(PRUint64 *aSize);
+  nsresult GetSource(nsIURI  *aSource);
+  nsresult GetTarget(nsIURI  *aTarget);
+  nsresult GetCancelable(nsICancelable  *aCancelable);
+  nsresult GetDisplayName(PRUnichar * *aDisplayName);
+  nsresult GetStartTime(PRInt64 *aStartTime);
+  nsresult GetMIMEInfo(nsIMIMEInfo  *aMIMEInfo);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIEmbeddingSiteWindow.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,35 @@
+module org.eclipse.swt.internal.mozilla.nsIEmbeddingSiteWindow;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+const char[] NS_IEMBEDDINGSITEWINDOW_IID_STR = "3e5432cd-9568-4bd1-8cbe-d50aba110743";
+
+const nsIID NS_IEMBEDDINGSITEWINDOW_IID= 
+  {0x3e5432cd, 0x9568, 0x4bd1, 
+    [ 0x8c, 0xbe, 0xd5, 0x0a, 0xba, 0x11, 0x07, 0x43 ]};
+
+interface nsIEmbeddingSiteWindow : nsISupports {
+
+  static const char[] IID_STR = NS_IEMBEDDINGSITEWINDOW_IID_STR;
+  static const nsIID IID = NS_IEMBEDDINGSITEWINDOW_IID;
+
+  enum { DIM_FLAGS_POSITION = 1U };
+  enum { DIM_FLAGS_SIZE_INNER = 2U };
+  enum { DIM_FLAGS_SIZE_OUTER = 4U };
+
+extern(System):
+  nsresult SetDimensions(PRUint32 flags, PRInt32 x, PRInt32 y, PRInt32 cx, PRInt32 cy);
+  nsresult GetDimensions(PRUint32 flags, PRInt32 *x, PRInt32 *y, PRInt32 *cx, PRInt32 *cy);
+  nsresult SetFocus();
+  nsresult GetVisibility(PRBool *aVisibility);
+  nsresult SetVisibility(PRBool aVisibility);
+  nsresult GetTitle(PRUnichar * *aTitle);
+  nsresult SetTitle(PRUnichar * aTitle);
+  nsresult GetSiteWindow(void * *aSiteWindow);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIEmbeddingSiteWindow2.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,24 @@
+module org.eclipse.swt.internal.mozilla.nsIEmbeddingSiteWindow2;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsIEmbeddingSiteWindow;
+
+const char[] NS_IEMBEDDINGSITEWINDOW2_IID_STR = "e932bf55-0a64-4beb-923a-1f32d3661044";
+
+const nsIID NS_IEMBEDDINGSITEWINDOW2_IID= 
+  {0xe932bf55, 0x0a64, 0x4beb, 
+    [ 0x92, 0x3a, 0x1f, 0x32, 0xd3, 0x66, 0x10, 0x44 ]};
+
+interface nsIEmbeddingSiteWindow2 : nsIEmbeddingSiteWindow {
+
+  static const char[] IID_STR = NS_IEMBEDDINGSITEWINDOW2_IID_STR;
+  static const nsIID IID = NS_IEMBEDDINGSITEWINDOW2_IID;
+
+extern(System):
+  nsresult Blur();
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIEnumerator.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,52 @@
+module org.eclipse.swt.internal.mozilla.nsIEnumerator;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+/******************************************************************************
+
+******************************************************************************/
+
+const char[] NS_IENUMERATOR_IID_STR = "ad385286-cbc4-11d2-8cca-0060b0fc14a3";
+
+const nsIID NS_IENUMERATOR_IID= 
+  {0xad385286, 0xcbc4, 0x11d2, 
+    [ 0x8c, 0xca, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3 ]};
+
+interface nsIEnumerator : nsISupports {
+
+  static const char[] IID_STR = NS_IENUMERATOR_IID_STR;
+  static const nsIID IID = NS_IENUMERATOR_IID;
+
+extern(System):
+  nsresult First();
+  nsresult Next();
+  nsresult CurrentItem(nsISupports *_retval);
+  nsresult IsDone();
+
+}
+
+/******************************************************************************
+
+******************************************************************************/
+
+const char[] NS_IBIDIRECTIONALENUMERATOR_IID_STR = "75f158a0-cadd-11d2-8cca-0060b0fc14a3";
+
+const nsIID NS_IBIDIRECTIONALENUMERATOR_IID= 
+  {0x75f158a0, 0xcadd, 0x11d2, 
+    [ 0x8c, 0xca, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3 ]};
+
+interface nsIBidirectionalEnumerator : nsIEnumerator {
+
+  static const char[] IID_STR = NS_IBIDIRECTIONALENUMERATOR_IID_STR;
+  static const nsIID IID = NS_IBIDIRECTIONALENUMERATOR_IID;
+
+extern(System):
+  nsresult Last();
+  nsresult Prev();
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIEventQueue.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,40 @@
+module org.eclipse.swt.internal.mozilla.nsIEventQueue;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsIEventTarget;
+
+const char[] NS_IEVENTQUEUE_IID_STR = "176afb41-00a4-11d3-9f2a-00400553eef0";
+const nsIID NS_IEVENTQUEUE_IID= 
+  {0x176afb41, 0x00a4, 0x11d3, 
+    [ 0x9f, 0x2a, 0x00, 0x40, 0x05, 0x53, 0xee, 0xf0 ]};
+
+interface nsIEventQueue : nsIEventTarget {
+  static const char[] IID_STR = NS_IEVENTQUEUE_IID_STR;
+  static const nsIID IID = NS_IEVENTQUEUE_IID;
+
+extern(System):
+  nsresult InitEvent(PLEvent * aEvent, void * owner, PLHandleEventProc handler, PLDestroyEventProc destructor);
+  nsresult PostSynchronousEvent(PLEvent * aEvent, void * *aResult);
+  nsresult PendingEvents(PRBool *_retval);
+  nsresult ProcessPendingEvents();
+  nsresult EventLoop();
+  nsresult EventAvailable(PRBool * aResult);
+  nsresult GetEvent(PLEvent * *_retval);
+  nsresult HandleEvent(PLEvent * aEvent);
+  nsresult WaitForEvent(PLEvent * *_retval);
+  PRInt32  GetEventQueueSelectFD();
+  nsresult Init(PRBool aNative);
+  nsresult InitFromPRThread(PRThread * thread, PRBool aNative);
+  nsresult InitFromPLQueue(PLEventQueue * aQueue);
+  nsresult EnterMonitor();
+  nsresult ExitMonitor();
+  nsresult RevokeEvents(void * owner);
+  nsresult GetPLEventQueue(PLEventQueue * *_retval);
+  nsresult IsQueueNative(PRBool *_retval);
+  nsresult StopAcceptingEvents();
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIEventTarget.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,24 @@
+module org.eclipse.swt.internal.mozilla.nsIEventTarget;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsID;
+
+const char[] NS_IEVENTTARGET_IID_STR = "ea99ad5b-cc67-4efb-97c9-2ef620a59f2a";
+
+const nsIID NS_IEVENTTARGET_IID= 
+  {0xea99ad5b, 0xcc67, 0x4efb, 
+    [ 0x97, 0xc9, 0x2e, 0xf6, 0x20, 0xa5, 0x9f, 0x2a ]};
+
+interface nsIEventTarget : nsISupports {
+
+  static const char[] IID_STR = NS_IEVENTTARGET_IID_STR;
+  static const nsIID IID = NS_IEVENTTARGET_IID;
+
+extern(System):
+  nsresult PostEvent(PLEvent * aEvent);
+  nsresult IsOnCurrentThread(PRBool *_retval);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIFactory.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,24 @@
+
+module org.eclipse.swt.internal.mozilla.nsIFactory;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+const char[] NS_IFACTORY_IID_STR = "00000001-0000-0000-c000-000000000046";
+
+const nsIID NS_IFACTORY_IID= 
+  {0x00000001, 0x0000, 0x0000, 
+    [ 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 ]};
+
+interface nsIFactory : nsISupports {
+
+  static const char[] IID_STR = NS_IFACTORY_IID_STR;
+  static const nsIID IID = NS_IFACTORY_IID;
+
+extern(System):
+  nsresult CreateInstance(nsISupports aOuter, nsIID * iid, void * *result);
+  nsresult LockFactory(PRBool lock);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIFile.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,71 @@
+module org.eclipse.swt.internal.mozilla.nsIFile;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsISimpleEnumerator;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_IFILE_IID_STR = "c8c0a080-0868-11d3-915f-d9d889d48e3c";
+
+const nsIID NS_IFILE_IID= 
+  {0xc8c0a080, 0x0868, 0x11d3, 
+    [ 0x91, 0x5f, 0xd9, 0xd8, 0x89, 0xd4, 0x8e, 0x3c ]};
+
+interface nsIFile : nsISupports {
+  static const char[] IID_STR = NS_IFILE_IID_STR;
+  static const nsIID IID = NS_IFILE_IID;
+
+  enum { NORMAL_FILE_TYPE = 0U };
+  enum { DIRECTORY_TYPE = 1U };
+
+extern(System):
+  nsresult Append(nsAString * node);
+  nsresult AppendNative(nsACString * node);
+  nsresult Normalize();
+  nsresult Create(PRUint32 type, PRUint32 permissions);
+  nsresult GetLeafName(nsAString * aLeafName);
+  nsresult SetLeafName(nsAString * aLeafName);
+  nsresult GetNativeLeafName(nsACString * aNativeLeafName);
+  nsresult SetNativeLeafName(nsACString * aNativeLeafName);
+  nsresult CopyTo(nsIFile newParentDir, nsAString * newName);
+  nsresult CopyToNative(nsIFile newParentDir, nsACString * newName);
+  nsresult CopyToFollowingLinks(nsIFile newParentDir, nsAString * newName);
+  nsresult CopyToFollowingLinksNative(nsIFile newParentDir, nsACString * newName);
+  nsresult MoveTo(nsIFile newParentDir, nsAString * newName);
+  nsresult MoveToNative(nsIFile newParentDir, nsACString * newName);
+  nsresult Remove(PRBool recursive);
+  nsresult GetPermissions(PRUint32 *aPermissions);
+  nsresult SetPermissions(PRUint32 aPermissions);
+  nsresult GetPermissionsOfLink(PRUint32 *aPermissionsOfLink);
+  nsresult SetPermissionsOfLink(PRUint32 aPermissionsOfLink);
+  nsresult GetLastModifiedTime(PRInt64 *aLastModifiedTime);
+  nsresult SetLastModifiedTime(PRInt64 aLastModifiedTime);
+  nsresult GetLastModifiedTimeOfLink(PRInt64 *aLastModifiedTimeOfLink);
+  nsresult SetLastModifiedTimeOfLink(PRInt64 aLastModifiedTimeOfLink);
+  nsresult GetFileSize(PRInt64 *aFileSize);
+  nsresult SetFileSize(PRInt64 aFileSize);
+  nsresult GetFileSizeOfLink(PRInt64 *aFileSizeOfLink);
+  nsresult GetTarget(nsAString * aTarget);
+  nsresult GetNativeTarget(nsACString * aNativeTarget);
+  nsresult GetPath(nsAString * aPath);
+  nsresult GetNativePath(nsACString * aNativePath);
+  nsresult Exists(PRBool *_retval);
+  nsresult IsWritable(PRBool *_retval);
+  nsresult IsReadable(PRBool *_retval);
+  nsresult IsExecutable(PRBool *_retval);
+  nsresult IsHidden(PRBool *_retval);
+  nsresult IsDirectory(PRBool *_retval);
+  nsresult IsFile(PRBool *_retval);
+  nsresult IsSymlink(PRBool *_retval);
+  nsresult IsSpecial(PRBool *_retval);
+  nsresult CreateUnique(PRUint32 type, PRUint32 permissions);
+  nsresult Clone(nsIFile *_retval);
+  nsresult Equals(nsIFile inFile, PRBool *_retval);
+  nsresult Contains(nsIFile inFile, PRBool recur, PRBool *_retval);
+  nsresult GetParent(nsIFile  *aParent);
+  nsresult GetDirectoryEntries(nsISimpleEnumerator  *aDirectoryEntries);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIFilePicker.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,58 @@
+module org.eclipse.swt.internal.mozilla.nsIFilePicker;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsILocalFile;
+import org.eclipse.swt.internal.mozilla.nsIFileURL; 
+import org.eclipse.swt.internal.mozilla.nsIDOMWindow; 
+import org.eclipse.swt.internal.mozilla.nsISimpleEnumerator;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_IFILEPICKER_IID_STR = "c47de916-1dd1-11b2-8141-82507fa02b21";
+
+const nsIID NS_IFILEPICKER_IID= 
+  {0xc47de916, 0x1dd1, 0x11b2, 
+    [ 0x81, 0x41, 0x82, 0x50, 0x7f, 0xa0, 0x2b, 0x21 ]};
+
+interface nsIFilePicker : nsISupports {
+
+  static const char[] IID_STR = NS_IFILEPICKER_IID_STR;
+  static const nsIID IID = NS_IFILEPICKER_IID;
+
+  enum { modeOpen = 0 };
+  enum { modeSave = 1 };
+  enum { modeGetFolder = 2 };
+  enum { modeOpenMultiple = 3 };
+  enum { returnOK = 0 };
+  enum { returnCancel = 1 };
+  enum { returnReplace = 2 };
+  enum { filterAll = 1 };
+  enum { filterHTML = 2 };
+  enum { filterText = 4 };
+  enum { filterImages = 8 };
+  enum { filterXML = 16 };
+  enum { filterXUL = 32 };
+  enum { filterApps = 64 };
+
+extern(System):
+  nsresult Init(nsIDOMWindow parent, nsAString * title, PRInt16 mode);
+  nsresult AppendFilters(PRInt32 filterMask);
+  nsresult AppendFilter(nsAString * title, nsAString * filter);
+  nsresult GetDefaultString(nsAString * aDefaultString);
+  nsresult SetDefaultString(nsAString * aDefaultString);
+  nsresult GetDefaultExtension(nsAString * aDefaultExtension);
+  nsresult SetDefaultExtension(nsAString * aDefaultExtension);
+  nsresult GetFilterIndex(PRInt32 *aFilterIndex);
+  nsresult SetFilterIndex(PRInt32 aFilterIndex);
+  nsresult GetDisplayDirectory(nsILocalFile  *aDisplayDirectory);
+  nsresult SetDisplayDirectory(nsILocalFile  aDisplayDirectory);
+  nsresult GetFile(nsILocalFile  *aFile);
+  nsresult GetFileURL(nsIFileURL  *aFileURL);
+  nsresult GetFiles(nsISimpleEnumerator  *aFiles);
+  nsresult Show(PRInt16 *_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIFilePicker_1_8.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,58 @@
+module org.eclipse.swt.internal.mozilla.nsIFilePicker_1_8;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsILocalFile;
+import org.eclipse.swt.internal.mozilla.nsIFileURL; 
+import org.eclipse.swt.internal.mozilla.nsIDOMWindow; 
+import org.eclipse.swt.internal.mozilla.nsISimpleEnumerator;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_IFILEPICKER_IID_STR = "80faf095-c807-4558-a2cc-185ed70754ea";
+
+const nsIID NS_IFILEPICKER_IID= 
+  {0x80faf095, 0xc807, 0x4558, 
+    [ 0xa2, 0xcc, 0x18, 0x5e, 0xd7, 0x07, 0x54, 0xea ]};
+
+//extern(System)
+interface nsIFilePicker_1_8 : nsISupports {
+
+  static const char[] IID_STR = NS_IFILEPICKER_IID_STR;
+  static const nsIID IID = NS_IFILEPICKER_IID;
+
+  enum { modeOpen = 0 };
+  enum { modeSave = 1 };
+  enum { modeGetFolder = 2 };
+  enum { modeOpenMultiple = 3 };
+  enum { returnOK = 0 };
+  enum { returnCancel = 1 };
+  enum { returnReplace = 2 };
+  enum { filterAll = 1 };
+  enum { filterHTML = 2 };
+  enum { filterText = 4 };
+  enum { filterImages = 8 };
+  enum { filterXML = 16 };
+  enum { filterXUL = 32 };
+  enum { filterApps = 64 };
+
+extern(System):
+  nsresult Init(nsIDOMWindow parent, nsAString * title, PRInt16 mode);
+  nsresult AppendFilters(PRInt32 filterMask);
+  nsresult AppendFilter(nsAString * title, nsAString * filter);
+  nsresult GetDefaultString(nsAString * aDefaultString);
+  nsresult SetDefaultString(nsAString * aDefaultString);
+  nsresult GetDefaultExtension(nsAString * aDefaultExtension);
+  nsresult SetDefaultExtension(nsAString * aDefaultExtension);
+  nsresult GetFilterIndex(PRInt32 *aFilterIndex);
+  nsresult SetFilterIndex(PRInt32 aFilterIndex);
+  nsresult GetDisplayDirectory(nsILocalFile  *aDisplayDirectory);
+  nsresult SetDisplayDirectory(nsILocalFile  aDisplayDirectory);
+  nsresult GetFile(nsILocalFile  *aFile);
+  nsresult GetFileURL(nsIFileURL  *aFileURL);
+  nsresult GetFiles(nsISimpleEnumerator  *aFiles);
+  nsresult Show(PRInt16 *_retval);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIFileURL.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,26 @@
+module org.eclipse.swt.internal.mozilla.nsIFileURL;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsIURL;
+import org.eclipse.swt.internal.mozilla.nsIFile;
+
+const char[] NS_IFILEURL_IID_STR = "d26b2e2e-1dd1-11b2-88f3-8545a7ba7949";
+
+const nsIID NS_IFILEURL_IID= 
+  {0xd26b2e2e, 0x1dd1, 0x11b2, 
+    [ 0x88, 0xf3, 0x85, 0x45, 0xa7, 0xba, 0x79, 0x49 ]};
+
+interface nsIFileURL : nsIURL {
+
+  static const char[] IID_STR = NS_IFILEURL_IID_STR;
+  static const nsIID IID = NS_IFILEURL_IID;
+
+extern(System):
+  nsresult GetFile(nsIFile  *aFile);
+  nsresult SetFile(nsIFile  aFile);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIHelperAppLauncher.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,37 @@
+module org.eclipse.swt.internal.mozilla.nsIHelperAppLauncher;
+
+import java.lang.all;
+
+private import org.eclipse.swt.internal.mozilla.Common;
+private import org.eclipse.swt.internal.mozilla.nsID;
+private import org.eclipse.swt.internal.mozilla.nsISupports;
+private import org.eclipse.swt.internal.mozilla.nsIURI;
+private import org.eclipse.swt.internal.mozilla.nsIMIMEInfo;
+private import org.eclipse.swt.internal.mozilla.nsIFile;
+private import org.eclipse.swt.internal.mozilla.nsIWebProgressListener;
+private import org.eclipse.swt.internal.mozilla.nsStringAPI;
+private import org.eclipse.swt.internal.mozilla.prtime;
+
+const char[] NS_IHELPERAPPLAUNCHER_IID_STR = "9503d0fe-4c9d-11d4-98d0-001083010e9b";
+
+const nsIID NS_IHELPERAPPLAUNCHER_IID= 
+  {0x9503d0fe, 0x4c9d, 0x11d4, 
+    [ 0x98, 0xd0, 0x00, 0x10, 0x83, 0x01, 0x0e, 0x9b ]};
+
+interface nsIHelperAppLauncher : nsISupports {
+
+  static const char[] IID_STR = NS_IHELPERAPPLAUNCHER_IID_STR;
+  static const nsIID IID = NS_IHELPERAPPLAUNCHER_IID;
+
+extern(System):
+  nsresult GetMIMEInfo(nsIMIMEInfo  *aMIMEInfo);
+  nsresult GetSource(nsIURI  *aSource);
+  nsresult GetSuggestedFileName(nsAString * aSuggestedFileName);
+  nsresult SaveToDisk(nsIFile aNewFileLocation, PRBool aRememberThisPreference);
+  nsresult LaunchWithApplication(nsIFile aApplication, PRBool aRememberThisPreference);
+  nsresult Cancel();
+  nsresult SetWebProgressListener(nsIWebProgressListener aWebProgressListener);
+  nsresult CloseProgressWindow();
+  nsresult GetDownloadInfo( nsIURI* aSourceUrl, PRTime* aTimeDownloadStarted, nsIFile* result);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIHelperAppLauncherDialog.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,30 @@
+module org.eclipse.swt.internal.mozilla.nsIHelperAppLauncherDialog;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsIHelperAppLauncher;
+import org.eclipse.swt.internal.mozilla.nsILocalFile;
+
+const char[] NS_IHELPERAPPLAUNCHERDIALOG_IID_STR = "d7ebddf0-4c84-11d4-807a-00600811a9c3";
+
+const nsIID NS_IHELPERAPPLAUNCHERDIALOG_IID= 
+  { 0xd7ebddf0, 0x4c84, 0x11d4, [ 0x80,0x7a,0x00,0x60,0x08,0x11,0xa9,0xc3 ]};
+
+interface nsIHelperAppLauncherDialog : nsISupports {
+
+  static const char[] IID_STR = NS_IHELPERAPPLAUNCHERDIALOG_IID_STR;
+  static const nsIID IID = NS_IHELPERAPPLAUNCHERDIALOG_IID;
+
+  enum { REASON_CANTHANDLE = 0U };
+  enum { REASON_SERVERREQUEST = 1U };
+  enum { REASON_TYPESNIFFED = 2U };
+
+extern(System):
+  nsresult Show(nsIHelperAppLauncher aLauncher, nsISupports aContext, PRUint32 aReason);
+  nsresult PromptForSaveToFile(nsIHelperAppLauncher aLauncher, nsISupports aWindowContext, PRUnichar *aDefaultFile, PRUnichar *aSuggestedFileExtension, nsILocalFile *_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIHelperAppLauncherDialog_1_9.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,30 @@
+module org.eclipse.swt.internal.mozilla.nsIHelperAppLauncherDialog_1_9;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsIHelperAppLauncher_1_9;
+import org.eclipse.swt.internal.mozilla.nsILocalFile;
+
+const char[] NS_IHELPERAPPLAUNCHERDIALOG_1_9_IID_STR = "f3704fdc-8ae6-4eba-a3c3-f02958ac0649";
+
+const nsIID NS_IHELPERAPPLAUNCHERDIALOG_1_9_IID= 
+  { 0xf3704fdc, 0x8ae6, 0x4eba, [ 0xa3,0xc3,0xf0,0x29,0x58,0xac,0x06,0x49 ]};
+  
+interface nsIHelperAppLauncherDialog_1_9 : nsISupports {
+
+  static const char[] IID_STR = NS_IHELPERAPPLAUNCHERDIALOG_1_9_IID_STR;
+  static const nsIID IID = NS_IHELPERAPPLAUNCHERDIALOG_1_9_IID;
+
+  enum { REASON_CANTHANDLE = 0U };
+  enum { REASON_SERVERREQUEST = 1U };
+  enum { REASON_TYPESNIFFED = 2U };
+
+extern(System):
+  nsresult Show(nsIHelperAppLauncher_1_9 aLauncher, nsISupports aContext, PRUint32 aReason);
+  nsresult PromptForSaveToFile(nsIHelperAppLauncher_1_9 aLauncher, nsISupports aWindowContext, PRUnichar *aDefaultFile, PRUnichar *aSuggestedFileExtension, PRBool aForcePrompt, nsILocalFile *_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIHelperAppLauncher_1_8.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,37 @@
+module org.eclipse.swt.internal.mozilla.nsIHelperAppLauncher_1_8;
+
+import java.lang.all;
+
+private import org.eclipse.swt.internal.mozilla.Common;
+private import org.eclipse.swt.internal.mozilla.nsID;
+private import org.eclipse.swt.internal.mozilla.nsICancelable;
+private import org.eclipse.swt.internal.mozilla.nsIURI;
+private import org.eclipse.swt.internal.mozilla.nsIMIMEInfo;
+private import org.eclipse.swt.internal.mozilla.nsIFile;
+private import org.eclipse.swt.internal.mozilla.nsIWebProgressListener2;
+private import org.eclipse.swt.internal.mozilla.nsStringAPI;
+private import org.eclipse.swt.internal.mozilla.prtime;
+
+const char[] NS_IHELPERAPPLAUNCHER_1_8_IID_STR = "99a0882d-2ff9-4659-9952-9ac531ba5592";
+
+const nsIID NS_IHELPERAPPLAUNCHER_1_8_IID= 
+  {0x99a0882d, 0x2ff9, 0x4659, 
+    [ 0x99, 0x52, 0x9a, 0xc5, 0x31, 0xba, 0x55, 0x92 ]};
+
+interface nsIHelperAppLauncher_1_8 : nsICancelable {
+
+  static const char[] IID_STR = NS_IHELPERAPPLAUNCHER_1_8_IID_STR;
+  static const nsIID IID = NS_IHELPERAPPLAUNCHER_1_8_IID;
+
+extern(System):
+  nsresult GetMIMEInfo(nsIMIMEInfo  *aMIMEInfo);
+  nsresult GetSource(nsIURI  *aSource);
+  nsresult GetSuggestedFileName(nsAString * aSuggestedFileName);
+  nsresult SaveToDisk(nsIFile aNewFileLocation, PRBool aRememberThisPreference);
+  nsresult LaunchWithApplication(nsIFile aApplication, PRBool aRememberThisPreference);
+  nsresult SetWebProgressListener(nsIWebProgressListener2 aWebProgressListener);
+  nsresult CloseProgressWindow();
+  nsresult GetTargetFile(nsIFile  *aTargetFile);
+  nsresult GetTimeDownloadStarted(PRTime *aTimeDownloadStarted);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIHelperAppLauncher_1_9.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,37 @@
+module org.eclipse.swt.internal.mozilla.nsIHelperAppLauncher_1_9;
+
+import java.lang.all;
+
+private import org.eclipse.swt.internal.mozilla.Common;
+private import org.eclipse.swt.internal.mozilla.nsID;
+private import org.eclipse.swt.internal.mozilla.nsICancelable;
+private import org.eclipse.swt.internal.mozilla.nsIURI;
+private import org.eclipse.swt.internal.mozilla.nsIMIMEInfo;
+private import org.eclipse.swt.internal.mozilla.nsIFile;
+private import org.eclipse.swt.internal.mozilla.nsIWebProgressListener2;
+private import org.eclipse.swt.internal.mozilla.nsStringAPI;
+private import org.eclipse.swt.internal.mozilla.prtime;
+
+const char[] NS_IHELPERAPPLAUNCHER_1_9_IID_STR = "cc75c21a-0a79-4f68-90e1-563253d0c555";
+
+const nsIID NS_IHELPERAPPLAUNCHER_1_9_IID= 
+  {0xcc75c21a, 0x0a79, 0x4f68, 
+    [ 0x90, 0xe1, 0x56, 0x32, 0x53, 0xd0, 0xc5, 0x55 ]};
+
+interface nsIHelperAppLauncher_1_9 : nsICancelable {
+
+  static const char[] IID_STR = NS_IHELPERAPPLAUNCHER_1_9_IID_STR;
+  static const nsIID IID = NS_IHELPERAPPLAUNCHER_1_9_IID;
+
+extern(System):
+  nsresult GetMIMEInfo(nsIMIMEInfo  *aMIMEInfo);
+  nsresult GetSource(nsIURI *aSource);
+  nsresult GetSuggestedFileName(nsAString * aSuggestedFileName);
+  nsresult SaveToDisk(nsIFile aNewFileLocation, PRBool aRememberThisPreference);
+  nsresult LaunchWithApplication(nsIFile aApplication, PRBool aRememberThisPreference);
+  nsresult SetWebProgressListener(nsIWebProgressListener2 aWebProgressListener);
+  nsresult CloseProgressWindow();
+  nsresult GetTargetFile(nsIFile *aTargetFile);
+  nsresult GetTargetFileIsExecutable(PRBool* aTargetFileIsExecutable);
+  nsresult GetTimeDownloadStarted(PRTime *aTimeDownloadStarted);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIHistoryEntry.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,28 @@
+module org.eclipse.swt.internal.mozilla.nsIHistoryEntry;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIURI;
+
+const char[] NS_IHISTORYENTRY_IID_STR = "a41661d4-1417-11d5-9882-00c04fa02f40";
+
+const nsIID NS_IHISTORYENTRY_IID= 
+  {0xa41661d4, 0x1417, 0x11d5, 
+    [ 0x98, 0x82, 0x00, 0xc0, 0x4f, 0xa0, 0x2f, 0x40 ]};
+
+interface nsIHistoryEntry : nsISupports {
+
+  static const char[] IID_STR = NS_IHISTORYENTRY_IID_STR;
+  static const nsIID IID = NS_IHISTORYENTRY_IID;
+
+extern(System):
+  nsresult GetURI(nsIURI  *aURI);
+  nsresult GetTitle(PRUnichar * *aTitle);
+  nsresult GetIsSubFrame(PRBool *aIsSubFrame);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIIOService.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,38 @@
+module org.eclipse.swt.internal.mozilla.nsIIOService;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsIProtocolHandler;
+import org.eclipse.swt.internal.mozilla.nsIChannel; 
+import org.eclipse.swt.internal.mozilla.nsIURI; 
+import org.eclipse.swt.internal.mozilla.nsIFile; 
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_IIOSERVICE_IID_STR = "bddeda3f-9020-4d12-8c70-984ee9f7935e";
+
+const nsIID NS_IIOSERVICE_IID= 
+  {0xbddeda3f, 0x9020, 0x4d12, 
+    [ 0x8c, 0x70, 0x98, 0x4e, 0xe9, 0xf7, 0x93, 0x5e ]};
+
+interface nsIIOService : nsISupports {
+
+  static const char[] IID_STR = NS_IIOSERVICE_IID_STR;
+  static const nsIID IID = NS_IIOSERVICE_IID;
+
+extern(System):
+  nsresult GetProtocolHandler(char *aScheme, nsIProtocolHandler *_retval);
+  nsresult GetProtocolFlags(char *aScheme, PRUint32 *_retval);
+  nsresult NewURI(nsACString * aSpec, char *aOriginCharset, nsIURI aBaseURI, nsIURI *_retval);
+  nsresult NewFileURI(nsIFile aFile, nsIURI *_retval);
+  nsresult NewChannelFromURI(nsIURI aURI, nsIChannel *_retval);
+  nsresult NewChannel(nsACString * aSpec, char *aOriginCharset, nsIURI aBaseURI, nsIChannel *_retval);
+  nsresult GetOffline(PRBool *aOffline);
+  nsresult SetOffline(PRBool aOffline);
+  nsresult AllowPort(PRInt32 aPort, char *aScheme, PRBool *_retval);
+  nsresult ExtractScheme(nsACString * urlString, nsACString * _retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIIOService2.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,25 @@
+module org.eclipse.swt.internal.mozilla.nsIIOService2;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsIIOService;
+
+const char[] NS_IIOSERVICE2_IID_STR = "d44fe6d4-ee35-4789-886a-eb8f0554d04e";
+
+const nsIID NS_IIOSERVICE2_IID= 
+  {0xd44fe6d4, 0xee35, 0x4789, 
+    [ 0x88, 0x6a, 0xeb, 0x8f, 0x05, 0x54, 0xd0, 0x4e ]};
+
+interface nsIIOService2 : nsIIOService {
+
+  static const char[] IID_STR = NS_IIOSERVICE2_IID_STR;
+  static const nsIID IID = NS_IIOSERVICE2_IID;
+
+extern(System):
+  nsresult GetManageOfflineStatus(PRBool *aManageOfflineStatus);
+  nsresult SetManageOfflineStatus(PRBool aManageOfflineStatus);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIInputStream.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,35 @@
+module org.eclipse.swt.internal.mozilla.nsIInputStream;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+typedef nsresult function(nsIInputStream aInStream,
+	void *aClosure,
+	byte *aFromSegment,
+	PRUint32 aToOffset,
+	PRUint32 aCount,
+	PRUint32 *aWriteCount) nsWriteSegmentFun;
+
+const char[] NS_IINPUTSTREAM_IID_STR = "fa9c7f6c-61b3-11d4-9877-00c04fa0cf4a";
+
+const nsIID NS_IINPUTSTREAM_IID= 
+  {0xfa9c7f6c, 0x61b3, 0x11d4, 
+    [ 0x98, 0x77, 0x00, 0xc0, 0x4f, 0xa0, 0xcf, 0x4a ]};
+
+interface nsIInputStream : nsISupports {
+
+  static const char[] IID_STR = NS_IINPUTSTREAM_IID_STR;
+  static const nsIID IID = NS_IINPUTSTREAM_IID;
+
+extern(System):
+  nsresult Close();
+  nsresult Available(PRUint32 *_retval);
+  nsresult Read(byte * aBuf, PRUint32 aCount, PRUint32 *_retval);
+  nsresult ReadSegments(nsWriteSegmentFun aWriter, void * aClosure, PRUint32 aCount, PRUint32 *_retval);
+  nsresult IsNonBlocking(PRBool *_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIInterfaceRequestor.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,24 @@
+module org.eclipse.swt.internal.mozilla.nsIInterfaceRequestor;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+const char[] NS_IINTERFACEREQUESTOR_IID_STR = "033a1470-8b2a-11d3-af88-00a024ffc08c";
+
+const nsIID NS_IINTERFACEREQUESTOR_IID= 
+  {0x033a1470, 0x8b2a, 0x11d3, 
+    [ 0xaf, 0x88, 0x00, 0xa0, 0x24, 0xff, 0xc0, 0x8c ]};
+
+interface nsIInterfaceRequestor : nsISupports {
+
+  static const char[] IID_STR = NS_IINTERFACEREQUESTOR_IID_STR;
+  static const nsIID IID = NS_IINTERFACEREQUESTOR_IID;
+
+extern(System):
+  nsresult GetInterface(nsIID * uuid, void * *result);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIJSContextStack.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,74 @@
+module org.eclipse.swt.internal.mozilla.nsIJSContextStack;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+/******************************************************************************
+
+******************************************************************************/
+
+const char[] NS_IJSCONTEXTSTACK_IID_STR = "c67d8270-3189-11d3-9885-006008962422";
+
+const nsIID NS_IJSCONTEXTSTACK_IID= 
+  {0xc67d8270, 0x3189, 0x11d3, 
+    [ 0x98, 0x85, 0x00, 0x60, 0x08, 0x96, 0x24, 0x22 ]};
+
+interface nsIJSContextStack : nsISupports {
+
+  static const char[] IID_STR = NS_IJSCONTEXTSTACK_IID_STR;
+  static const nsIID IID = NS_IJSCONTEXTSTACK_IID;
+
+extern(System):
+  nsresult GetCount(PRInt32 *aCount);
+  nsresult Peek(JSContext * *_retval);
+  nsresult Pop(JSContext * *_retval);
+  nsresult Push(JSContext * cx);
+
+}
+
+/******************************************************************************
+
+******************************************************************************/
+
+const char[] NS_IJSCONTEXTSTACKITERATOR_IID_STR = "c7e6b7aa-fc12-4ca7-b140-98c38b698961";
+
+const nsIID NS_IJSCONTEXTSTACKITERATOR_IID= 
+  {0xc7e6b7aa, 0xfc12, 0x4ca7, 
+    [ 0xb1, 0x40, 0x98, 0xc3, 0x8b, 0x69, 0x89, 0x61 ]};
+
+interface nsIJSContextStackIterator : nsISupports {
+
+  static const char[] IID_STR = NS_IJSCONTEXTSTACKITERATOR_IID_STR;
+  static const nsIID IID = NS_IJSCONTEXTSTACKITERATOR_IID;
+
+extern(System):
+  nsresult Reset(nsIJSContextStack stack);
+  nsresult Done(PRBool *_retval);
+  nsresult Prev(JSContext * *_retval);
+
+}
+
+/******************************************************************************
+
+******************************************************************************/
+
+const char[] NS_ITHREADJSCONTEXTSTACK_IID_STR = "a1339ae0-05c1-11d4-8f92-0010a4e73d9a";
+
+const nsIID NS_ITHREADJSCONTEXTSTACK_IID= 
+  {0xa1339ae0, 0x05c1, 0x11d4, 
+    [ 0x8f, 0x92, 0x00, 0x10, 0xa4, 0xe7, 0x3d, 0x9a ]};
+
+interface nsIThreadJSContextStack : nsIJSContextStack {
+
+  static const char[] IID_STR = NS_ITHREADJSCONTEXTSTACK_IID_STR;
+  static const nsIID IID = NS_ITHREADJSCONTEXTSTACK_IID;
+
+extern(System):
+  nsresult GetSafeJSContext(JSContext * *aSafeJSContext);
+  nsresult SetSafeJSContext(JSContext * aSafeJSContext);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsILoadGroup.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,38 @@
+module org.eclipse.swt.internal.mozilla.nsILoadGroup;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIRequest;
+import org.eclipse.swt.internal.mozilla.nsISimpleEnumerator;
+import org.eclipse.swt.internal.mozilla.nsIRequestObserver; 
+import org.eclipse.swt.internal.mozilla.nsIInterfaceRequestor;
+
+const char[] NS_ILOADGROUP_IID_STR = "3de0a31c-feaf-400f-9f1e-4ef71f8b20cc";
+
+const nsIID NS_ILOADGROUP_IID= 
+  {0x3de0a31c, 0xfeaf, 0x400f, 
+    [ 0x9f, 0x1e, 0x4e, 0xf7, 0x1f, 0x8b, 0x20, 0xcc ]};
+
+interface nsILoadGroup : nsIRequest {
+
+  static const char[] IID_STR = NS_ILOADGROUP_IID_STR;
+  static const nsIID IID = NS_ILOADGROUP_IID;
+
+extern(System):
+  nsresult GetGroupObserver(nsIRequestObserver  *aGroupObserver);
+  nsresult SetGroupObserver(nsIRequestObserver  aGroupObserver);
+  nsresult GetDefaultLoadRequest(nsIRequest  *aDefaultLoadRequest);
+  nsresult SetDefaultLoadRequest(nsIRequest  aDefaultLoadRequest);
+  nsresult AddRequest(nsIRequest aRequest, nsISupports aContext);
+  nsresult RemoveRequest(nsIRequest aRequest, nsISupports aContext, nsresult aStatus);
+  nsresult GetRequests(nsISimpleEnumerator  *aRequests);
+  nsresult GetActiveCount(PRUint32 *aActiveCount);
+  nsresult GetNotificationCallbacks(nsIInterfaceRequestor  *aNotificationCallbacks);
+  nsresult SetNotificationCallbacks(nsIInterfaceRequestor  aNotificationCallbacks);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsILocalFile.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,45 @@
+module org.eclipse.swt.internal.mozilla.nsILocalFile;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.prlink;
+import org.eclipse.swt.internal.mozilla.prio;
+import org.eclipse.swt.internal.mozilla.prtime;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsIFile;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+import tango.stdc.stdio : FILE;
+
+const char[] NS_ILOCALFILE_IID_STR = "aa610f20-a889-11d3-8c81-000064657374";
+
+const nsIID NS_ILOCALFILE_IID= 
+  {0xaa610f20, 0xa889, 0x11d3, 
+    [ 0x8c, 0x81, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74 ]};
+
+interface nsILocalFile : nsIFile {
+
+    static const char[] IID_STR = NS_ILOCALFILE_IID_STR;
+    static const nsIID IID = NS_ILOCALFILE_IID;
+
+extern(System):
+    nsresult InitWithPath(nsAString * filePath);
+    nsresult InitWithNativePath(nsACString * filePath);
+    nsresult InitWithFile(nsILocalFile aFile);
+    nsresult GetFollowLinks(PRBool *aFollowLinks);
+    nsresult SetFollowLinks(PRBool aFollowLinks);
+    nsresult OpenNSPRFileDesc(PRInt32 flags, PRInt32 mode, PRFileDesc * *_retval);
+    nsresult OpenANSIFileDesc(char *mode, FILE * *_retval);
+    nsresult Load(PRLibrary * *_retval);
+    nsresult GetDiskSpaceAvailable(PRInt64 *aDiskSpaceAvailable);
+    nsresult AppendRelativePath(nsAString * relativeFilePath);
+    nsresult AppendRelativeNativePath(nsACString * relativeFilePath);
+    nsresult GetPersistentDescriptor(nsACString * aPersistentDescriptor);
+    nsresult SetPersistentDescriptor(nsACString * aPersistentDescriptor);
+    nsresult Reveal();
+    nsresult Launch();
+    nsresult GetRelativeDescriptor(nsILocalFile fromFile, nsACString * _retval);
+    nsresult SetRelativeDescriptor(nsILocalFile fromFile, nsACString * relativeDesc);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIMIMEInfo.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,61 @@
+module org.eclipse.swt.internal.mozilla.nsIMIMEInfo;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIURI;
+import org.eclipse.swt.internal.mozilla.nsIFile;
+import org.eclipse.swt.internal.mozilla.nsIStringEnumerator;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+alias PRInt32 nsMIMEInfoHandleAction;
+
+const char[] NS_IMIMEINFO_IID_STR = "1448b42f-cf0d-466e-9a15-64e876ebe857";
+
+const nsIID NS_IMIMEINFO_IID= 
+  {0x1448b42f, 0xcf0d, 0x466e, 
+    [ 0x9a, 0x15, 0x64, 0xe8, 0x76, 0xeb, 0xe8, 0x57 ]};
+
+interface nsIMIMEInfo : nsISupports {
+
+  static const char[] IID_STR = NS_IMIMEINFO_IID_STR;
+  static const nsIID IID = NS_IMIMEINFO_IID;
+
+extern(System):
+  nsresult GetFileExtensions(nsIUTF8StringEnumerator *_retval);
+  nsresult SetFileExtensions(nsACString * aExtensions);
+  nsresult ExtensionExists(nsACString * aExtension, PRBool *_retval);
+  nsresult AppendExtension(nsACString * aExtension);
+  nsresult GetPrimaryExtension(nsACString * aPrimaryExtension);
+  nsresult SetPrimaryExtension(nsACString * aPrimaryExtension);
+  nsresult GetMIMEType(nsACString * aMIMEType);
+  nsresult SetDescription(nsAString * aDescription);
+  nsresult GetMacType(PRUint32 *aMacType);
+  nsresult SetMacType(PRUint32 aMacType);
+  nsresult GetMacCreator(PRUint32 *aMacCreator);
+  nsresult SetMacCreator(PRUint32 aMacCreator);
+  nsresult Equals(nsIMIMEInfo aMIMEInfo, PRBool *_retval);
+  nsresult GetPreferredApplicationHandler(nsIFile  *aPreferredApplicationHandler);
+  nsresult SetPreferredApplicationHandler(nsIFile  aPreferredApplicationHandler);
+  nsresult GetApplicationDescription(nsAString * aApplicationDescription);
+  nsresult SetApplicationDescription(nsAString * aApplicationDescription);
+  nsresult GetHasDefaultHandler(PRBool *aHasDefaultHandler);
+  nsresult GetDefaultDescription(nsAString * aDefaultDescription);
+  nsresult LaunchWithFile(nsIFile aFile);
+
+  enum { saveToDisk = 0 };
+  enum { alwaysAsk = 1 };
+  enum { useHelperApp = 2 };
+  enum { handleInternally = 3 };
+  enum { useSystemDefault = 4 };
+
+  nsresult GetPreferredAction(nsMIMEInfoHandleAction *aPreferredAction);
+  nsresult SetPreferredAction(nsMIMEInfoHandleAction aPreferredAction);
+  nsresult GetAlwaysAskBeforeHandling(PRBool *aAlwaysAskBeforeHandling);
+  nsresult SetAlwaysAskBeforeHandling(PRBool aAlwaysAskBeforeHandling);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIMemory.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,26 @@
+module org.eclipse.swt.internal.mozilla.nsIMemory;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+const char[] NS_IMEMORY_IID_STR = "59e7e77a-38e4-11d4-8cf5-0060b0fc14a3";
+
+const nsIID NS_IMEMORY_IID= 
+  {0x59e7e77a, 0x38e4, 0x11d4, 
+    [ 0x8c, 0xf5, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3 ]};
+
+interface nsIMemory : nsISupports {
+  static const char[] IID_STR = NS_IMEMORY_IID_STR;
+  static const nsIID IID = NS_IMEMORY_IID;
+  
+extern(System):
+  void *    Alloc(size_t size);
+  void *    Realloc(void * ptr, size_t newSize);
+  void      Free(void * ptr);
+  nsresult  HeapMinimize(PRBool immediate);
+  nsresult  IsLowMemory(PRBool *_retval);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIModule.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,27 @@
+module org.eclipse.swt.internal.mozilla.nsIModule;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsIFile; 
+import org.eclipse.swt.internal.mozilla.nsIComponentManager;
+
+const char[] NS_IMODULE_IID_STR = "7392d032-5371-11d3-994e-00805fd26fee";
+
+const nsIID NS_IMODULE_IID= 
+  {0x7392d032, 0x5371, 0x11d3, 
+    [ 0x99, 0x4e, 0x00, 0x80, 0x5f, 0xd2, 0x6f, 0xee ]};
+
+interface nsIModule : nsISupports {
+  static const char[] IID_STR = NS_IMODULE_IID_STR;
+  static const nsIID IID = NS_IMODULE_IID;
+
+extern(System):
+  nsresult GetClassObject(nsIComponentManager aCompMgr, nsCID * aClass, nsIID * aIID, void * *aResult);
+  nsresult RegisterSelf(nsIComponentManager aCompMgr, nsIFile aLocation, char *aLoaderStr, char *aType);
+  nsresult UnregisterSelf(nsIComponentManager aCompMgr, nsIFile aLocation, char *aLoaderStr);
+  nsresult CanUnload(nsIComponentManager aCompMgr, PRBool *_retval);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIObjectInputStream.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,29 @@
+module org.eclipse.swt.internal.mozilla.nsIObjectInputStream;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIBinaryInputStream;
+
+const char[] NS_IOBJECTINPUTSTREAM_IID_STR = "6c248606-4eae-46fa-9df0-ba58502368eb";
+
+const nsIID NS_IOBJECTINPUTSTREAM_IID= 
+  {0x6c248606, 0x4eae, 0x46fa, 
+    [ 0x9d, 0xf0, 0xba, 0x58, 0x50, 0x23, 0x68, 0xeb ]};
+
+interface nsIObjectInputStream : nsIBinaryInputStream {
+
+  static const char[] IID_STR = NS_IOBJECTINPUTSTREAM_IID_STR;
+  static const nsIID IID = NS_IOBJECTINPUTSTREAM_IID;
+
+extern(System):
+  nsresult ReadObject(PRBool aIsStrongRef, nsISupports *_retval);
+  nsresult ReadID(nsID *aID);
+  char * GetBuffer(PRUint32 aLength, PRUint32 aAlignMask);
+  void PutBuffer(char * aBuffer, PRUint32 aLength);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIObjectOutputStream.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,31 @@
+module org.eclipse.swt.internal.mozilla.nsIObjectOutputStream;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIBinaryOutputStream;
+
+const char[] NS_IOBJECTOUTPUTSTREAM_IID_STR = "92c898ac-5fde-4b99-87b3-5d486422094b";
+
+const nsIID NS_IOBJECTOUTPUTSTREAM_IID= 
+  {0x92c898ac, 0x5fde, 0x4b99, 
+    [ 0x87, 0xb3, 0x5d, 0x48, 0x64, 0x22, 0x09, 0x4b ]};
+
+interface nsIObjectOutputStream : nsIBinaryOutputStream {
+
+  static const char[] IID_STR = NS_IOBJECTOUTPUTSTREAM_IID_STR;
+  static const nsIID IID = NS_IOBJECTOUTPUTSTREAM_IID;
+
+extern(System):
+  nsresult WriteObject(nsISupports aObject, PRBool aIsStrongRef);
+  nsresult WriteSingleRefObject(nsISupports aObject);
+  nsresult WriteCompoundObject(nsISupports aObject, nsIID * aIID, PRBool aIsStrongRef);
+  nsresult WriteID(nsID * aID);
+  char * GetBuffer(PRUint32 aLength, PRUint32 aAlignMask);
+  void PutBuffer(char * aBuffer, PRUint32 aLength);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIObserver.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,24 @@
+module org.eclipse.swt.internal.mozilla.nsIObserver;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+const char[] NS_IOBSERVER_IID_STR = "db242e01-e4d9-11d2-9dde-000064657374";
+
+const nsIID NS_IOBSERVER_IID= 
+  {0xdb242e01, 0xe4d9, 0x11d2, 
+    [ 0x9d, 0xde, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74 ]};
+
+interface nsIObserver : nsISupports {
+
+  static const char[] IID_STR = NS_IOBSERVER_IID_STR;
+  static const nsIID IID = NS_IOBSERVER_IID;
+
+extern(System):
+  nsresult Observe(nsISupports aSubject, char *aTopic, PRUnichar *aData);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIObserverService.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,29 @@
+module org.eclipse.swt.internal.mozilla.nsIObserverService;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsIObserver;
+import org.eclipse.swt.internal.mozilla.nsISimpleEnumerator;
+
+const char[] NS_IOBSERVERSERVICE_IID_STR = "d07f5192-e3d1-11d2-8acd-00105a1b8860";
+
+const nsIID NS_IOBSERVERSERVICE_IID= 
+  {0xd07f5192, 0xe3d1, 0x11d2, 
+    [ 0x8a, 0xcd, 0x00, 0x10, 0x5a, 0x1b, 0x88, 0x60 ]};
+
+interface nsIObserverService : nsISupports {
+
+  static const char[] IID_STR = NS_IOBSERVERSERVICE_IID_STR;
+  static const nsIID IID = NS_IOBSERVERSERVICE_IID;
+
+extern(System):
+  nsresult AddObserver(nsIObserver anObserver, char *aTopic, PRBool ownsWeak);
+  nsresult RemoveObserver(nsIObserver anObserver, char *aTopic);
+  nsresult NotifyObservers(nsISupports aSubject, char *aTopic, PRUnichar *someData);
+  nsresult EnumerateObservers(char *aTopic, nsISimpleEnumerator *_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIOutputStream.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,38 @@
+module org.eclipse.swt.internal.mozilla.nsIOutputStream;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIInputStream;
+
+typedef nsresult function(nsIOutputStream aOutStream,
+	void *aClosure,
+	char *aToSegment,
+	PRUint32 aFromOffset,
+	PRUint32 aCount,
+	PRUint32 *aReadCount) nsReadSegmentFun;
+
+const char[] NS_IOUTPUTSTREAM_IID_STR = "0d0acd2a-61b4-11d4-9877-00c04fa0cf4a";
+
+const nsIID NS_IOUTPUTSTREAM_IID= 
+  {0x0d0acd2a, 0x61b4, 0x11d4, 
+    [ 0x98, 0x77, 0x00, 0xc0, 0x4f, 0xa0, 0xcf, 0x4a ]};
+
+interface nsIOutputStream : nsISupports {
+
+  static const char[] IID_STR = NS_IOUTPUTSTREAM_IID_STR;
+  static const nsIID IID = NS_IOUTPUTSTREAM_IID;
+
+extern(System):
+  nsresult Close();
+  nsresult Flush();
+  nsresult Write(char *aBuf, PRUint32 aCount, PRUint32 *_retval);
+  nsresult WriteFrom(nsIInputStream aFromStream, PRUint32 aCount, PRUint32 *_retval);
+  nsresult WriteSegments(nsReadSegmentFun aReader, void * aClosure, PRUint32 aCount, PRUint32 *_retval);
+  nsresult IsNonBlocking(PRBool *_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIPrefBranch.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,46 @@
+module org.eclipse.swt.internal.mozilla.nsIPrefBranch;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+const char[] NS_IPREFBRANCH_IID_STR = "56c35506-f14b-11d3-99d3-ddbfac2ccf65";
+
+const nsIID NS_IPREFBRANCH_IID= 
+  {0x56c35506, 0xf14b, 0x11d3, 
+    [ 0x99, 0xd3, 0xdd, 0xbf, 0xac, 0x2c, 0xcf, 0x65 ]};
+
+interface nsIPrefBranch : nsISupports {
+
+  static const char[] IID_STR = NS_IPREFBRANCH_IID_STR;
+  static const nsIID IID = NS_IPREFBRANCH_IID;
+
+  enum { PREF_INVALID = 0 };
+  enum { PREF_STRING = 32 };
+  enum { PREF_INT = 64 };
+  enum { PREF_BOOL = 128 };
+
+extern(System):
+  nsresult GetRoot(char * *aRoot);
+  nsresult GetPrefType(char *aPrefName, PRInt32 *_retval);
+  nsresult GetBoolPref(char *aPrefName, PRBool *_retval);
+  nsresult SetBoolPref(char *aPrefName, PRInt32 aValue);
+  nsresult GetCharPref(char *aPrefName, char **_retval);
+  nsresult SetCharPref(char *aPrefName, char *aValue);
+  nsresult GetIntPref(char *aPrefName, PRInt32 *_retval);
+  nsresult SetIntPref(char *aPrefName, PRInt32 aValue);
+  nsresult GetComplexValue(char *aPrefName, nsIID * aType, void * *aValue);
+  nsresult SetComplexValue(char *aPrefName, nsIID * aType, nsISupports aValue);
+  nsresult ClearUserPref(char *aPrefName);
+  nsresult LockPref(char *aPrefName);
+  nsresult PrefHasUserValue(char *aPrefName, PRBool *_retval);
+  nsresult PrefIsLocked(char *aPrefName, PRBool *_retval);
+  nsresult UnlockPref(char *aPrefName);
+  nsresult DeleteBranch(char *aStartingAt);
+  nsresult GetChildList(char *aStartingAt, PRUint32 *aCount, char ***aChildArray);
+  nsresult ResetBranch(char *aStartingAt);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIPrefBranch2.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,27 @@
+module org.eclipse.swt.internal.mozilla.nsIPrefBranch2;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsIPrefBranch;
+import org.eclipse.swt.internal.mozilla.nsIObserver; 
+
+const char[] NS_IPREFBRANCH2_IID_STR = "74567534-eb94-4b1c-8f45-389643bfc555";
+
+const nsIID NS_IPREFBRANCH2_IID= 
+  {0x74567534, 0xeb94, 0x4b1c, 
+    [ 0x8f, 0x45, 0x38, 0x96, 0x43, 0xbf, 0xc5, 0x55 ]};
+
+interface nsIPrefBranch2 : nsIPrefBranch {
+
+  static const char[] IID_STR = NS_IPREFBRANCH2_IID_STR;
+  static const nsIID IID = NS_IPREFBRANCH2_IID;
+
+extern(System):
+  nsresult AddObserver(char *aDomain, nsIObserver aObserver, PRBool aHoldWeak);
+  nsresult RemoveObserver(char *aDomain, nsIObserver aObserver);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIPrefLocalizedString.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,27 @@
+module org.eclipse.swt.internal.mozilla.nsIPrefLocalizedString;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+const char[] NS_IPREFLOCALIZEDSTRING_IID_STR = "ae419e24-1dd1-11b2-b39a-d3e5e7073802";
+
+const nsIID NS_IPREFLOCALIZEDSTRING_IID= 
+  {0xae419e24, 0x1dd1, 0x11b2, 
+    [ 0xb3, 0x9a, 0xd3, 0xe5, 0xe7, 0x07, 0x38, 0x02 ]};
+
+interface nsIPrefLocalizedString : nsISupports {
+
+  static const char[] IID_STR = NS_IPREFLOCALIZEDSTRING_IID_STR;
+  static const nsIID IID = NS_IPREFLOCALIZEDSTRING_IID;
+
+extern(System):
+  nsresult GetData(PRUnichar * *aData);
+  nsresult SetData(PRUnichar * aData);
+  nsresult ToString(PRUnichar **_retval);
+  nsresult SetDataWithLength(PRUint32 length, PRUnichar *data);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIPrefService.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,31 @@
+module org.eclipse.swt.internal.mozilla.nsIPrefService;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsIPrefBranch;
+import org.eclipse.swt.internal.mozilla.nsIFile;
+
+const char[] NS_IPREFSERVICE_IID_STR = "decb9cc7-c08f-4ea5-be91-a8fc637ce2d2";
+
+const nsIID NS_IPREFSERVICE_IID= 
+  {0xdecb9cc7, 0xc08f, 0x4ea5, 
+    [ 0xbe, 0x91, 0xa8, 0xfc, 0x63, 0x7c, 0xe2, 0xd2 ]};
+
+interface nsIPrefService : nsISupports {
+
+  static const char[] IID_STR = NS_IPREFSERVICE_IID_STR;
+  static const nsIID IID = NS_IPREFSERVICE_IID;
+
+extern(System):
+  nsresult ReadUserPrefs(nsIFile aFile);
+  nsresult ResetPrefs();
+  nsresult ResetUserPrefs();
+  nsresult SavePrefFile(nsIFile aFile);
+  nsresult GetBranch(char *aPrefRoot, nsIPrefBranch *_retval);
+  nsresult GetDefaultBranch(char *aPrefRoot, nsIPrefBranch *_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIProgressDialog.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,31 @@
+module org.eclipse.swt.internal.mozilla.nsIProgressDialog;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsIDownload;
+import org.eclipse.swt.internal.mozilla.nsIDOMWindow; 
+import org.eclipse.swt.internal.mozilla.nsIObserver;
+
+const char[] NS_IPROGRESSDIALOG_IID_STR = "88a478b3-af65-440a-94dc-ed9b154d2990";
+
+const nsIID NS_IPROGRESSDIALOG_IID= 
+  {0x88a478b3, 0xaf65, 0x440a, 
+    [ 0x94, 0xdc, 0xed, 0x9b, 0x15, 0x4d, 0x29, 0x90 ]};
+
+interface nsIProgressDialog : nsIDownload {
+
+  static const char[] IID_STR = NS_IPROGRESSDIALOG_IID_STR;
+  static const nsIID IID = NS_IPROGRESSDIALOG_IID;
+
+extern(System):
+  nsresult Open(nsIDOMWindow aParent);
+  nsresult GetCancelDownloadOnClose(PRBool *aCancelDownloadOnClose);
+  nsresult SetCancelDownloadOnClose(PRBool aCancelDownloadOnClose);
+  nsresult GetDialog(nsIDOMWindow  *aDialog);
+  nsresult SetDialog(nsIDOMWindow  aDialog);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIProgressDialog_1_8.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,34 @@
+module org.eclipse.swt.internal.mozilla.nsIProgressDialog_1_8;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsIDownload;
+import org.eclipse.swt.internal.mozilla.nsIDOMWindow; 
+import org.eclipse.swt.internal.mozilla.nsIObserver;
+import org.eclipse.swt.internal.mozilla.nsIDownload_1_8;
+
+const char[] NS_IPROGRESSDIALOG_IID_STR = "20e790a2-76c6-462d-851a-22ab6cbbe48b";
+
+const nsIID NS_IPROGRESSDIALOG_IID= 
+  {0x20e790a2, 0x76c6, 0x462d, 
+    [ 0x85, 0x1a, 0x22, 0xab, 0x6c, 0xbb, 0xe4, 0x8b ]};
+
+interface nsIProgressDialog_1_8 : nsIDownload_1_8 {
+
+  static const char[] IID_STR = NS_IPROGRESSDIALOG_IID_STR;
+  static const nsIID IID = NS_IPROGRESSDIALOG_IID;
+
+extern(System):
+  nsresult Open(nsIDOMWindow aParent);
+  nsresult GetCancelDownloadOnClose(PRBool *aCancelDownloadOnClose);
+  nsresult SetCancelDownloadOnClose(PRBool aCancelDownloadOnClose);
+  nsresult GetObserver(nsIObserver  *aObserver);
+  nsresult SetObserver(nsIObserver  aObserver);
+  nsresult GetDialog(nsIDOMWindow  *aDialog);
+  nsresult SetDialog(nsIDOMWindow  aDialog);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIPrompt.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,50 @@
+module org.eclipse.swt.internal.mozilla.nsIPrompt;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+const char[] NS_IPROMPT_IID_STR = "a63f70c0-148b-11d3-9333-00104ba0fd40";
+
+const nsIID NS_IPROMPT_IID= 
+  {0xa63f70c0, 0x148b, 0x11d3, 
+    [ 0x93, 0x33, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40 ]};
+
+interface nsIPrompt : nsISupports {
+
+  static const char[] IID_STR = NS_IPROMPT_IID_STR;
+  static const nsIID IID = NS_IPROMPT_IID;
+
+extern(System):
+  nsresult Alert(PRUnichar *dialogTitle, PRUnichar *text);
+  nsresult AlertCheck(PRUnichar *dialogTitle, PRUnichar *text, PRUnichar *checkMsg, PRBool *checkValue);
+  nsresult Confirm(PRUnichar *dialogTitle, PRUnichar *text, PRBool *_retval);
+  nsresult ConfirmCheck(PRUnichar *dialogTitle, PRUnichar *text, PRUnichar *checkMsg, PRBool *checkValue, PRBool *_retval);
+
+  enum { BUTTON_POS_0 = 1U };
+  enum { BUTTON_POS_1 = 256U };
+  enum { BUTTON_POS_2 = 65536U };
+  enum { BUTTON_TITLE_OK = 1U };
+  enum { BUTTON_TITLE_CANCEL = 2U };
+  enum { BUTTON_TITLE_YES = 3U };
+  enum { BUTTON_TITLE_NO = 4U };
+  enum { BUTTON_TITLE_SAVE = 5U };
+  enum { BUTTON_TITLE_DONT_SAVE = 6U };
+  enum { BUTTON_TITLE_REVERT = 7U };
+  enum { BUTTON_TITLE_IS_STRING = 127U };
+  enum { BUTTON_POS_0_DEFAULT = 0U };
+  enum { BUTTON_POS_1_DEFAULT = 16777216U };
+  enum { BUTTON_POS_2_DEFAULT = 33554432U };
+  enum { BUTTON_DELAY_ENABLE = 67108864U };
+  enum { STD_OK_CANCEL_BUTTONS = 513U };
+
+  nsresult ConfirmEx(PRUnichar *dialogTitle, PRUnichar *text, PRUint32 buttonFlags, PRUnichar *button0Title, PRUnichar *button1Title, PRUnichar *button2Title, PRUnichar *checkMsg, PRBool *checkValue, PRInt32 *_retval);
+  nsresult Prompt(PRUnichar *dialogTitle, PRUnichar *text, PRUnichar **value, PRUnichar *checkMsg, PRBool *checkValue, PRBool *_retval);
+  nsresult PromptPassword(PRUnichar *dialogTitle, PRUnichar *text, PRUnichar **password, PRUnichar *checkMsg, PRBool *checkValue, PRBool *_retval);
+  nsresult PromptUsernameAndPassword(PRUnichar *dialogTitle, PRUnichar *text, PRUnichar **username, PRUnichar **password, PRUnichar *checkMsg, PRBool *checkValue, PRBool *_retval);
+  nsresult Select(PRUnichar *dialogTitle, PRUnichar *text, PRUint32 count, PRUnichar **selectList, PRInt32 *outSelection, PRBool *_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIPromptService.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,53 @@
+module org.eclipse.swt.internal.mozilla.nsIPromptService;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMWindow;
+
+const char[] NS_IPROMPTSERVICE_IID_STR = "1630c61a-325e-49ca-8759-a31b16c47aa5";
+
+const nsIID NS_IPROMPTSERVICE_IID= 
+  {0x1630c61a, 0x325e, 0x49ca, 
+    [ 0x87, 0x59, 0xa3, 0x1b, 0x16, 0xc4, 0x7a, 0xa5 ]};
+
+interface nsIPromptService : nsISupports {
+
+  static const char[] IID_STR = NS_IPROMPTSERVICE_IID_STR;
+  static const nsIID IID = NS_IPROMPTSERVICE_IID;
+
+extern(System):
+  nsresult Alert(nsIDOMWindow aParent, PRUnichar *aDialogTitle, PRUnichar *aText);
+  nsresult AlertCheck(nsIDOMWindow aParent, PRUnichar *aDialogTitle, PRUnichar *aText, PRUnichar *aCheckMsg, PRBool *aCheckState);
+  nsresult Confirm(nsIDOMWindow aParent, PRUnichar *aDialogTitle, PRUnichar *aText, PRBool *_retval);
+  nsresult ConfirmCheck(nsIDOMWindow aParent, PRUnichar *aDialogTitle, PRUnichar *aText, PRUnichar *aCheckMsg, PRBool *aCheckState, PRBool *_retval);
+
+  enum { BUTTON_POS_0 = 1U };
+  enum { BUTTON_POS_1 = 256U };
+  enum { BUTTON_POS_2 = 65536U };
+  enum { BUTTON_TITLE_OK = 1U };
+  enum { BUTTON_TITLE_CANCEL = 2U };
+  enum { BUTTON_TITLE_YES = 3U };
+  enum { BUTTON_TITLE_NO = 4U };
+  enum { BUTTON_TITLE_SAVE = 5U };
+  enum { BUTTON_TITLE_DONT_SAVE = 6U };
+  enum { BUTTON_TITLE_REVERT = 7U };
+  enum { BUTTON_TITLE_IS_STRING = 127U };
+  enum { BUTTON_POS_0_DEFAULT = 0U };
+  enum { BUTTON_POS_1_DEFAULT = 16777216U };
+  enum { BUTTON_POS_2_DEFAULT = 33554432U };
+  enum { BUTTON_DELAY_ENABLE = 67108864U };
+  enum { STD_OK_CANCEL_BUTTONS = 513U };
+  enum { STD_YES_NO_BUTTONS = 1027U };
+
+  nsresult ConfirmEx(nsIDOMWindow aParent, PRUnichar *aDialogTitle, PRUnichar *aText, PRUint32 aButtonFlags, PRUnichar *aButton0Title, PRUnichar *aButton1Title, PRUnichar *aButton2Title, PRUnichar *aCheckMsg, PRBool *aCheckState, PRInt32 *_retval);
+  nsresult Prompt(nsIDOMWindow aParent, PRUnichar *aDialogTitle, PRUnichar *aText, PRUnichar **aValue, PRUnichar *aCheckMsg, PRBool *aCheckState, PRBool *_retval);
+  nsresult PromptUsernameAndPassword(nsIDOMWindow aParent, PRUnichar *aDialogTitle, PRUnichar *aText, PRUnichar **aUsername, PRUnichar **aPassword, PRUnichar *aCheckMsg, PRBool *aCheckState, PRBool *_retval);
+  nsresult PromptPassword(nsIDOMWindow aParent, PRUnichar *aDialogTitle, PRUnichar *aText, PRUnichar **aPassword, PRUnichar *aCheckMsg, PRBool *aCheckState, PRBool *_retval);
+  nsresult Select(nsIDOMWindow aParent, PRUnichar *aDialogTitle, PRUnichar *aText, PRUint32 aCount, PRUnichar **aSelectList, PRInt32 *aOutSelection, PRBool *_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIPromptService2.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,32 @@
+module org.eclipse.swt.internal.mozilla.nsIPromptService2;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsICancelable;
+import org.eclipse.swt.internal.mozilla.nsIChannel;
+import org.eclipse.swt.internal.mozilla.nsIAuthInformation;
+import org.eclipse.swt.internal.mozilla.nsIAuthPromptCallback;
+import org.eclipse.swt.internal.mozilla.nsIPromptService;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMWindow;
+
+const char[] NS_IPROMPTSERVICE2_IID_STR = "cf86d196-dbee-4482-9dfa-3477aa128319";
+
+const nsIID NS_IPROMPTSERVICE2_IID= 
+  {0xcf86d196, 0xdbee, 0x4482, 
+    [ 0x9d, 0xfa, 0x34, 0x77, 0xaa, 0x12, 0x83, 0x19 ]};
+
+interface nsIPromptService2 : nsIPromptService {
+
+  static const char[] IID_STR = NS_IPROMPTSERVICE2_IID_STR;
+  static const nsIID IID = NS_IPROMPTSERVICE2_IID;
+
+extern(System):
+    public nsresult PromptAuth(nsIDOMWindow aParent, nsIChannel aChannel, PRUint32 level, nsIAuthInformation authInfo, PRUnichar* checkboxLabel, PRBool* checkValue, PRBool* _retval);
+
+    public nsresult AsyncPromptAuth(nsIDOMWindow aParent, nsIChannel aChannel, nsIAuthPromptCallback aCallback, nsISupports aContext, PRUint32 level, nsIAuthInformation authInfo, PRUnichar* checkboxLabel, PRBool* checkValue, nsICancelable* _retval);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIProperties.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,28 @@
+module org.eclipse.swt.internal.mozilla.nsIProperties;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+const char[] NS_IPROPERTIES_IID_STR = "78650582-4e93-4b60-8e85-26ebd3eb14ca";
+
+const nsIID NS_IPROPERTIES_IID= 
+  {0x78650582, 0x4e93, 0x4b60, 
+    [ 0x8e, 0x85, 0x26, 0xeb, 0xd3, 0xeb, 0x14, 0xca ]};
+
+interface nsIProperties : nsISupports {
+
+  static const char[] IID_STR = NS_IPROPERTIES_IID_STR;
+  static const nsIID IID = NS_IPROPERTIES_IID;
+
+extern(System):
+  nsresult Get(char *prop, nsIID * iid, void * *result);
+  nsresult Set(char *prop, nsISupports value);
+  nsresult Has(char *prop, PRBool *_retval);
+  nsresult Undefine(char *prop);
+  nsresult GetKeys(PRUint32 *count, char ***keys);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIProtocolHandler.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,38 @@
+module org.eclipse.swt.internal.mozilla.nsIProtocolHandler;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsIURI; 
+import org.eclipse.swt.internal.mozilla.nsIChannel;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_IPROTOCOLHANDLER_IID_STR = "15fd6940-8ea7-11d3-93ad-00104ba0fd40";
+
+const nsIID NS_IPROTOCOLHANDLER_IID= 
+  {0x15fd6940, 0x8ea7, 0x11d3, 
+    [ 0x93, 0xad, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40 ]};
+
+interface nsIProtocolHandler : nsISupports {
+
+  static const char[] IID_STR = NS_IPROTOCOLHANDLER_IID_STR;
+  static const nsIID IID = NS_IPROTOCOLHANDLER_IID;
+
+extern(System):
+  nsresult GetScheme(nsACString * aScheme);
+  nsresult GetDefaultPort(PRInt32 *aDefaultPort);
+  nsresult GetProtocolFlags(PRUint32 *aProtocolFlags);
+  nsresult NewURI(nsACString * aSpec, char *aOriginCharset, nsIURI aBaseURI, nsIURI *_retval);
+  nsresult NewChannel(nsIURI aURI, nsIChannel *_retval);
+  nsresult AllowPort(PRInt32 port, char *scheme, PRBool *_retval);
+
+  enum { URI_STD = 0U };
+  enum { URI_NORELATIVE = 1U };
+  enum { URI_NOAUTH = 2U };
+  enum { ALLOWS_PROXY = 4U };
+  enum { ALLOWS_PROXY_HTTP = 8U };
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIRequest.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,47 @@
+module org.eclipse.swt.internal.mozilla.nsIRequest;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsILoadGroup;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+alias PRUint32 nsLoadFlags;
+
+const char[] NS_IREQUEST_IID_STR = "ef6bfbd2-fd46-48d8-96b7-9f8f0fd387fe";
+
+const nsIID NS_IREQUEST_IID= 
+  {0xef6bfbd2, 0xfd46, 0x48d8, 
+    [ 0x96, 0xb7, 0x9f, 0x8f, 0x0f, 0xd3, 0x87, 0xfe ]};
+
+interface nsIRequest : nsISupports {
+
+  static const char[] IID_STR = NS_IREQUEST_IID_STR;
+  static const nsIID IID = NS_IREQUEST_IID;
+
+extern(System):
+  nsresult GetName(nsACString * aName);
+  nsresult IsPending(PRBool *_retval);
+  nsresult GetStatus(nsresult *aStatus);
+  nsresult Cancel(nsresult aStatus);
+  nsresult Suspend();
+  nsresult Resume();
+  nsresult GetLoadGroup(nsILoadGroup  *aLoadGroup);
+  nsresult SetLoadGroup(nsILoadGroup  aLoadGroup);
+  nsresult GetLoadFlags(nsLoadFlags *aLoadFlags);
+  nsresult SetLoadFlags(nsLoadFlags aLoadFlags);
+
+  enum { LOAD_NORMAL = 0U };
+  enum { LOAD_BACKGROUND = 1U };
+  enum { INHIBIT_CACHING = 128U };
+  enum { INHIBIT_PERSISTENT_CACHING = 256U };
+  enum { LOAD_BYPASS_CACHE = 512U };
+  enum { LOAD_FROM_CACHE = 1024U };
+  enum { VALIDATE_ALWAYS = 2048U };
+  enum { VALIDATE_NEVER = 4096U };
+  enum { VALIDATE_ONCE_PER_SESSION = 8192U };
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIRequestObserver.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,27 @@
+module org.eclipse.swt.internal.mozilla.nsIRequestObserver;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIRequest; 
+
+const char[] NS_IREQUESTOBSERVER_IID_STR = "fd91e2e0-1481-11d3-9333-00104ba0fd40";
+
+const nsIID NS_IREQUESTOBSERVER_IID= 
+  {0xfd91e2e0, 0x1481, 0x11d3, 
+    [ 0x93, 0x33, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40 ]};
+
+interface nsIRequestObserver : nsISupports {
+
+  static const char[] IID_STR = NS_IREQUESTOBSERVER_IID_STR;
+  static const nsIID IID = NS_IREQUESTOBSERVER_IID;
+
+extern(System):
+  nsresult OnStartRequest(nsIRequest aRequest, nsISupports aContext);
+  nsresult OnStopRequest(nsIRequest aRequest, nsISupports aContext, nsresult aStatusCode);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsISHEntry.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,75 @@
+module org.eclipse.swt.internal.mozilla.nsISHEntry;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIHistoryEntry;
+import org.eclipse.swt.internal.mozilla.nsIContentViewer; 
+import org.eclipse.swt.internal.mozilla.nsIURI;
+import org.eclipse.swt.internal.mozilla.nsIInputStream; 
+import org.eclipse.swt.internal.mozilla.nsIDocShellTreeItem;
+import org.eclipse.swt.internal.mozilla.nsISupportsArray;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_ISHENTRY_IID_STR = "542a98b9-2889-4922-aaf4-02b6056f4136";
+
+const nsIID NS_ISHENTRY_IID= 
+  {0x542a98b9, 0x2889, 0x4922, 
+    [ 0xaa, 0xf4, 0x02, 0xb6, 0x05, 0x6f, 0x41, 0x36 ]};
+
+interface nsISHEntry : nsIHistoryEntry {
+
+  static const char[] IID_STR = NS_ISHENTRY_IID_STR;
+  static const nsIID IID = NS_ISHENTRY_IID;
+
+extern(System):
+  nsresult SetURI(nsIURI aURI);
+  nsresult GetReferrerURI(nsIURI  *aReferrerURI);
+  nsresult SetReferrerURI(nsIURI  aReferrerURI);
+  nsresult GetContentViewer(nsIContentViewer  *aContentViewer);
+  nsresult SetContentViewer(nsIContentViewer  aContentViewer);
+  nsresult GetSticky(PRBool *aSticky);
+  nsresult SetSticky(PRBool aSticky);
+  nsresult GetWindowState(nsISupports  *aWindowState);
+  nsresult SetWindowState(nsISupports  aWindowState);
+  nsresult GetViewerBounds(nsRect * bounds);
+  nsresult SetViewerBounds(nsRect * bounds);
+  nsresult AddChildShell(nsIDocShellTreeItem shell);
+  nsresult ChildShellAt(PRInt32 index, nsIDocShellTreeItem *_retval);
+  nsresult ClearChildShells();
+  nsresult GetRefreshURIList(nsISupportsArray  *aRefreshURIList);
+  nsresult SetRefreshURIList(nsISupportsArray  aRefreshURIList);
+  nsresult SyncPresentationState();
+  nsresult SetTitle(nsAString * aTitle);
+  nsresult GetPostData(nsIInputStream  *aPostData);
+  nsresult SetPostData(nsIInputStream  aPostData);
+  nsresult GetLayoutHistoryState(nsILayoutHistoryState  *aLayoutHistoryState);
+  nsresult SetLayoutHistoryState(nsILayoutHistoryState  aLayoutHistoryState);
+  nsresult GetParent(nsISHEntry  *aParent);
+  nsresult SetParent(nsISHEntry  aParent);
+  nsresult GetLoadType(PRUint32 *aLoadType);
+  nsresult SetLoadType(PRUint32 aLoadType);
+  nsresult GetID(PRUint32 *aID);
+  nsresult SetID(PRUint32 aID);
+  nsresult GetPageIdentifier(PRUint32 *aPageIdentifier);
+  nsresult SetPageIdentifier(PRUint32 aPageIdentifier);
+  nsresult GetCacheKey(nsISupports  *aCacheKey);
+  nsresult SetCacheKey(nsISupports  aCacheKey);
+  nsresult GetSaveLayoutStateFlag(PRBool *aSaveLayoutStateFlag);
+  nsresult SetSaveLayoutStateFlag(PRBool aSaveLayoutStateFlag);
+  nsresult GetExpirationStatus(PRBool *aExpirationStatus);
+  nsresult SetExpirationStatus(PRBool aExpirationStatus);
+  nsresult GetContentType(nsACString * aContentType);
+  nsresult SetContentType(nsACString * aContentType);
+  nsresult SetScrollPosition(PRInt32 x, PRInt32 y);
+  nsresult GetScrollPosition(PRInt32 *x, PRInt32 *y);
+  nsresult Create(nsIURI URI, nsAString * title, nsIInputStream inputStream, nsILayoutHistoryState layoutHistoryState, nsISupports cacheKey, nsACString * contentType);
+  nsresult Clone(nsISHEntry *_retval);
+  nsresult SetIsSubFrame(PRBool aFlag);
+  nsresult GetAnyContentViewer(nsISHEntry *ownerEntry, nsIContentViewer *_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsISHistory.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,36 @@
+module org.eclipse.swt.internal.mozilla.nsISHistory;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIHistoryEntry; 
+import org.eclipse.swt.internal.mozilla.nsISHistoryListener; 
+import org.eclipse.swt.internal.mozilla.nsISimpleEnumerator;
+
+const char[] NS_ISHISTORY_IID_STR = "7294fe9b-14d8-11d5-9882-00c04fa02f40";
+
+const nsIID NS_ISHISTORY_IID= 
+  {0x7294fe9b, 0x14d8, 0x11d5, 
+    [ 0x98, 0x82, 0x00, 0xc0, 0x4f, 0xa0, 0x2f, 0x40 ]};
+
+interface nsISHistory : nsISupports {
+
+  static const char[] IID_STR = NS_ISHISTORY_IID_STR;
+  static const nsIID IID = NS_ISHISTORY_IID;
+
+extern(System):
+  nsresult GetCount(PRInt32 *aCount);
+  nsresult GetIndex(PRInt32 *aIndex);
+  nsresult GetMaxLength(PRInt32 *aMaxLength);
+  nsresult SetMaxLength(PRInt32 aMaxLength);
+  nsresult GetEntryAtIndex(PRInt32 index, PRBool modifyIndex, nsIHistoryEntry *_retval);
+  nsresult PurgeHistory(PRInt32 numEntries);
+  nsresult AddSHistoryListener(nsISHistoryListener aListener);
+  nsresult RemoveSHistoryListener(nsISHistoryListener aListener);
+  nsresult GetSHistoryEnumerator(nsISimpleEnumerator  *aSHistoryEnumerator);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsISHistoryListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,31 @@
+module org.eclipse.swt.internal.mozilla.nsISHistoryListener;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIURI;
+
+const char[] NS_ISHISTORYLISTENER_IID_STR = "3b07f591-e8e1-11d4-9882-00c04fa02f40";
+
+const nsIID NS_ISHISTORYLISTENER_IID= 
+  {0x3b07f591, 0xe8e1, 0x11d4, 
+    [ 0x98, 0x82, 0x00, 0xc0, 0x4f, 0xa0, 0x2f, 0x40 ]};
+
+interface nsISHistoryListener : nsISupports {
+
+  static const char[] IID_STR = NS_ISHISTORYLISTENER_IID_STR;
+  static const nsIID IID = NS_ISHISTORYLISTENER_IID;
+
+extern(System):
+  nsresult OnHistoryNewEntry(nsIURI aNewURI);
+  nsresult OnHistoryGoBack(nsIURI aBackURI, PRBool *_retval);
+  nsresult OnHistoryGoForward(nsIURI aForwardURI, PRBool *_retval);
+  nsresult OnHistoryReload(nsIURI aReloadURI, PRUint32 aReloadFlags, PRBool *_retval);
+  nsresult OnHistoryGotoIndex(PRInt32 aIndex, nsIURI aGotoURI, PRBool *_retval);
+  nsresult OnHistoryPurge(PRInt32 aNumEntries, PRBool *_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsISecureBrowserUI.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,29 @@
+module org.eclipse.swt.internal.mozilla.nsISecureBrowserUI;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMWindow;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_ISECUREBROWSERUI_IID_STR = "081e31e0-a144-11d3-8c7c-00609792278c";
+
+const nsIID NS_ISECUREBROWSERUI_IID= 
+  {0x081e31e0, 0xa144, 0x11d3, 
+    [ 0x8c, 0x7c, 0x00, 0x60, 0x97, 0x92, 0x27, 0x8c ]};
+
+interface nsISecureBrowserUI : nsISupports {
+
+  static const char[] IID_STR = NS_ISECUREBROWSERUI_IID_STR;
+  static const nsIID IID = NS_ISECUREBROWSERUI_IID;
+
+extern(System):
+  nsresult Init(nsIDOMWindow window);
+  nsresult GetState(PRUint32 *aState);
+  nsresult GetTooltipText(nsAString * aTooltipText);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsISelection.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,45 @@
+module org.eclipse.swt.internal.mozilla.nsISelection;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMNode;
+import org.eclipse.swt.internal.mozilla.nsIDOMRange;
+
+const char[] NS_ISELECTION_IID_STR = "b2c7ed59-8634-4352-9e37-5484c8b6e4e1";
+
+const nsIID NS_ISELECTION_IID= 
+  {0xb2c7ed59, 0x8634, 0x4352, 
+    [ 0x9e, 0x37, 0x54, 0x84, 0xc8, 0xb6, 0xe4, 0xe1 ]};
+
+interface nsISelection : nsISupports {
+
+  static const char[] IID_STR = NS_ISELECTION_IID_STR;
+  static const nsIID IID = NS_ISELECTION_IID;
+
+extern(System):
+  nsresult GetAnchorNode(nsIDOMNode  *aAnchorNode);
+  nsresult GetAnchorOffset(PRInt32 *aAnchorOffset);
+  nsresult GetFocusNode(nsIDOMNode  *aFocusNode);
+  nsresult GetFocusOffset(PRInt32 *aFocusOffset);
+  nsresult GetIsCollapsed(PRBool *aIsCollapsed);
+  nsresult GetRangeCount(PRInt32 *aRangeCount);
+  nsresult GetRangeAt(PRInt32 index, nsIDOMRange *_retval);
+  nsresult Collapse(nsIDOMNode parentNode, PRInt32 offset);
+  nsresult Extend(nsIDOMNode parentNode, PRInt32 offset);
+  nsresult CollapseToStart();
+  nsresult CollapseToEnd();
+  nsresult ContainsNode(nsIDOMNode node, PRBool entirelyContained, PRBool *_retval);
+  nsresult SelectAllChildren(nsIDOMNode parentNode);
+  nsresult AddRange(nsIDOMRange range);
+  nsresult RemoveRange(nsIDOMRange range);
+  nsresult RemoveAllRanges();
+  nsresult DeleteFromDocument();
+  nsresult SelectionLanguageChange(PRBool langRTL);
+  nsresult ToString(PRUnichar **_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsISerializable.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,28 @@
+module org.eclipse.swt.internal.mozilla.nsISerializable;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIObjectInputStream; 
+import org.eclipse.swt.internal.mozilla.nsIObjectOutputStream;
+
+const char[] NS_ISERIALIZABLE_IID_STR = "91cca981-c26d-44a8-bebe-d9ed4891503a";
+
+const nsIID NS_ISERIALIZABLE_IID= 
+  {0x91cca981, 0xc26d, 0x44a8, 
+    [ 0xbe, 0xbe, 0xd9, 0xed, 0x48, 0x91, 0x50, 0x3a ]};
+
+interface nsISerializable : nsISupports {
+
+  static const char[] IID_STR = NS_ISERIALIZABLE_IID_STR;
+  static const nsIID IID = NS_ISERIALIZABLE_IID;
+
+extern(System):
+  nsresult Read(nsIObjectInputStream aInputStream);
+  nsresult Write(nsIObjectOutputStream aOutputStream);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIServiceManager.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,26 @@
+module org.eclipse.swt.internal.mozilla.nsIServiceManager;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+const char[] NS_ISERVICEMANAGER_IID_STR = "8bb35ed9-e332-462d-9155-4a002ab5c958";
+const nsIID NS_ISERVICEMANAGER_IID= 
+  {0x8bb35ed9, 0xe332, 0x462d, 
+    [ 0x91, 0x55, 0x4a, 0x00, 0x2a, 0xb5, 0xc9, 0x58 ]};
+
+interface nsIServiceManager : nsISupports {
+
+  static const char[] IID_STR = NS_ISERVICEMANAGER_IID_STR;
+  static const nsIID IID = NS_ISERVICEMANAGER_IID;
+
+extern(System):
+  nsresult GetService(nsCID * aClass, nsIID * aIID, void * *result);
+  nsresult GetServiceByContractID(char *aContractID, nsIID * aIID, void * *result);
+  nsresult IsServiceInstantiated(nsCID * aClass, nsIID * aIID, PRBool *_retval);
+  nsresult IsServiceInstantiatedByContractID(char *aContractID, nsIID * aIID, PRBool *_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsISimpleEnumerator.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,25 @@
+module org.eclipse.swt.internal.mozilla.nsISimpleEnumerator;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+const char[] NS_ISIMPLEENUMERATOR_IID_STR = "d1899240-f9d2-11d2-bdd6-000064657374";
+
+const nsIID NS_ISIMPLEENUMERATOR_IID= 
+  {0xd1899240, 0xf9d2, 0x11d2, 
+    [ 0xbd, 0xd6, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74 ]};
+
+interface nsISimpleEnumerator : nsISupports {
+
+  static const char[] IID_STR = NS_ISIMPLEENUMERATOR_IID_STR;
+  static const nsIID IID = NS_ISIMPLEENUMERATOR_IID;
+
+extern(System):
+  nsresult HasMoreElements(PRBool *_retval);
+  nsresult GetNext(nsISupports *_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIStreamListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,28 @@
+module org.eclipse.swt.internal.mozilla.nsIStreamListener;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIRequestObserver;
+import org.eclipse.swt.internal.mozilla.nsIRequest;
+import org.eclipse.swt.internal.mozilla.nsIInputStream;
+
+const char[] NS_ISTREAMLISTENER_IID_STR = "1a637020-1482-11d3-9333-00104ba0fd40";
+
+const nsIID NS_ISTREAMLISTENER_IID= 
+  {0x1a637020, 0x1482, 0x11d3, 
+    [ 0x93, 0x33, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40 ]};
+
+interface nsIStreamListener : nsIRequestObserver {
+
+  static const char[] IID_STR = NS_ISTREAMLISTENER_IID_STR;
+  static const nsIID IID = NS_ISTREAMLISTENER_IID;
+
+extern(System):
+  nsresult OnDataAvailable(nsIRequest aRequest, nsISupports aContext, nsIInputStream aInputStream, PRUint32 aOffset, PRUint32 aCount);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIStringEnumerator.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,52 @@
+module org.eclipse.swt.internal.mozilla.nsIStringEnumerator;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+/******************************************************************************
+
+******************************************************************************/
+
+const char[] NS_ISTRINGENUMERATOR_IID_STR = "50d3ef6c-9380-4f06-9fb2-95488f7d141c";
+
+const nsIID NS_ISTRINGENUMERATOR_IID= 
+  {0x50d3ef6c, 0x9380, 0x4f06, 
+    [ 0x9f, 0xb2, 0x95, 0x48, 0x8f, 0x7d, 0x14, 0x1c ]};
+
+interface nsIStringEnumerator : nsISupports {
+
+  static const char[] IID_STR = NS_ISTRINGENUMERATOR_IID_STR;
+  static const nsIID IID = NS_ISTRINGENUMERATOR_IID;
+
+extern(System):
+  nsresult HasMore(PRBool *_retval);
+  nsresult GetNext(nsAString * _retval);
+
+}
+
+/******************************************************************************
+
+******************************************************************************/
+
+const char[] NS_IUTF8STRINGENUMERATOR_IID_STR = "9bdf1010-3695-4907-95ed-83d0410ec307";
+
+const nsIID NS_IUTF8STRINGENUMERATOR_IID= 
+  {0x9bdf1010, 0x3695, 0x4907, 
+    [ 0x95, 0xed, 0x83, 0xd0, 0x41, 0x0e, 0xc3, 0x07 ]};
+
+interface nsIUTF8StringEnumerator : nsISupports {
+
+  static const char[] IID_STR = NS_IUTF8STRINGENUMERATOR_IID_STR;
+  static const nsIID IID = NS_IUTF8STRINGENUMERATOR_IID;
+
+extern(System):
+  nsresult HasMore(PRBool *_retval);
+  nsresult GetNext(nsACString * _retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsISupports.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,32 @@
+module org.eclipse.swt.internal.mozilla.nsISupports;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+
+const char[] NS_ISUPPORTS_IID_STR = "00000000-0000-0000-c000-000000000046";
+
+const nsIID NS_ISUPPORTS_IID= 
+        { 0x00000000, 0x0000, 0x0000, 
+          [ 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 ] };
+
+interface IUnknown
+{
+    static const char[] IID_STR = NS_ISUPPORTS_IID_STR;
+    static const nsIID IID = NS_ISUPPORTS_IID;
+
+extern(System):
+    nsresult QueryInterface( nsIID* uuid, void **result);
+
+    nsrefcnt AddRef();
+    nsrefcnt Release();
+}
+
+// WHY WE USE COM's IUnknown for XPCOM:
+//
+// The IUnknown interface is special-cased in D and is specifically designed to be
+// compatible with MS COM.  XPCOM's nsISupports interface is the exact equivalent
+// of IUnknown so we alias it here to take advantage of D's COM support. -JJR
+
+alias IUnknown nsISupports;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsISupportsArray.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,50 @@
+module org.eclipse.swt.internal.mozilla.nsISupportsArray;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsICollection;
+
+typedef PRBool function(nsISupports, void*) nsISupportsArrayEnumFunc;
+
+const char[] NS_ISUPPORTSARRAY_IID_STR = "791eafa0-b9e6-11d1-8031-006008159b5a";
+
+const nsIID NS_ISUPPORTSARRAY_IID= 
+  {0x791eafa0, 0xb9e6, 0x11d1, 
+    [ 0x80, 0x31, 0x00, 0x60, 0x08, 0x15, 0x9b, 0x5a ]};
+
+interface nsISupportsArray : nsICollection {
+
+  static const char[] IID_STR = NS_ISUPPORTSARRAY_IID_STR;
+  static const nsIID IID = NS_ISUPPORTSARRAY_IID;
+
+extern(System):
+  PRBool Equals(nsISupportsArray other);
+  nsISupports  ElementAt(PRUint32 aIndex);
+  PRInt32 IndexOf(nsISupports aPossibleElement);
+  PRInt32 IndexOfStartingAt(nsISupports aPossibleElement, PRUint32 aStartIndex);
+  PRInt32 LastIndexOf(nsISupports aPossibleElement);
+  nsresult GetIndexOf(nsISupports aPossibleElement, PRInt32 *_retval);
+  nsresult GetIndexOfStartingAt(nsISupports aPossibleElement, PRUint32 aStartIndex, PRInt32 *_retval);
+  nsresult GetLastIndexOf(nsISupports aPossibleElement, PRInt32 *_retval);
+  PRBool InsertElementAt(nsISupports aElement, PRUint32 aIndex);
+  PRBool ReplaceElementAt(nsISupports aElement, PRUint32 aIndex);
+  PRBool RemoveElementAt(PRUint32 aIndex);
+  PRBool RemoveLastElement(nsISupports aElement);
+  nsresult DeleteLastElement(nsISupports aElement);
+  nsresult DeleteElementAt(PRUint32 aIndex);
+  PRBool AppendElements(nsISupportsArray aElements);
+  nsresult Compact();
+  PRBool EnumerateForwards(nsISupportsArrayEnumFunc aFunc, void * aData);
+  PRBool EnumerateBackwards(nsISupportsArrayEnumFunc aFunc, void * aData);
+  nsresult Clone(nsISupportsArray *_retval);
+  PRBool MoveElement(PRInt32 aFrom, PRInt32 aTo);
+  PRBool InsertElementsAt(nsISupportsArray aOther, PRUint32 aIndex);
+  PRBool RemoveElementsAt(PRUint32 aIndex, PRUint32 aCount);
+  PRBool SizeTo(PRInt32 aSize);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsITooltipListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,25 @@
+module org.eclipse.swt.internal.mozilla.nsITooltipListener;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+const char[] NS_ITOOLTIPLISTENER_IID_STR = "44b78386-1dd2-11b2-9ad2-e4eee2ca1916";
+
+const nsIID NS_ITOOLTIPLISTENER_IID= 
+  {0x44b78386, 0x1dd2, 0x11b2, 
+    [ 0x9a, 0xd2, 0xe4, 0xee, 0xe2, 0xca, 0x19, 0x16 ]};
+
+interface nsITooltipListener : nsISupports {
+
+  static const char[] IID_STR = NS_ITOOLTIPLISTENER_IID_STR;
+  static const nsIID IID = NS_ITOOLTIPLISTENER_IID;
+
+extern(System):
+  nsresult OnShowTooltip(PRInt32 aXCoords, PRInt32 aYCoords, PRUnichar *aTipText);
+  nsresult OnHideTooltip();
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsITraceRefcnt.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,27 @@
+module org.eclipse.swt.internal.mozilla.nsITraceRefcnt;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+const char[] NS_ITRACEREFCNT_IID_STR = "273dc92f-0fe6-4545-96a9-21be77828039";
+
+const nsIID NS_ITRACEREFCNT_IID= 
+  {0x273dc92f, 0x0fe6, 0x4545, 
+    [ 0x96, 0xa9, 0x21, 0xbe, 0x77, 0x82, 0x80, 0x39 ]};
+
+interface nsITraceRefcnt : nsISupports {
+  static const char[] IID_STR = NS_ITRACEREFCNT_IID_STR;
+  static const nsIID IID = NS_ITRACEREFCNT_IID;
+
+extern(System):
+  nsresult LogAddRef(void * aPtr, nsrefcnt aNewRefcnt, char *aTypeName, PRUint32 aInstanceSize);
+  nsresult LogRelease(void * aPtr, nsrefcnt aNewRefcnt, char *aTypeName);
+  nsresult LogCtor(void * aPtr, char *aTypeName, PRUint32 aInstanceSize);
+  nsresult LogDtor(void * aPtr, char *aTypeName, PRUint32 aInstanceSize);
+  nsresult LogAddCOMPtr(void * aPtr, nsISupports aObject);
+  nsresult LogReleaseCOMPtr(void * aPtr, nsISupports aObject);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsITransfer.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,33 @@
+module org.eclipse.swt.internal.mozilla.nsITransfer;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.prtime;
+
+import org.eclipse.swt.internal.mozilla.nsIWebProgressListener2;
+import org.eclipse.swt.internal.mozilla.nsIURI;
+import org.eclipse.swt.internal.mozilla.nsICancelable;
+import org.eclipse.swt.internal.mozilla.nsIMIMEInfo;
+import org.eclipse.swt.internal.mozilla.nsILocalFile;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_ITRANSFER_IID_STR = "23c51569-e9a1-4a92-adeb-3723db82ef7c";
+
+const nsIID NS_ITRANSFER_IID= 
+  {0x23c51569, 0xe9a1, 0x4a92, 
+    [ 0xad, 0xeb, 0x37, 0x23, 0xdb, 0x82, 0xef, 0x7c ]};
+
+interface nsITransfer : nsIWebProgressListener2 {
+
+  static const char[] IID_STR = NS_ITRANSFER_IID_STR;
+  static const nsIID IID = NS_ITRANSFER_IID;
+
+extern(System):
+  nsresult Init(nsIURI aSource, nsIURI aTarget, nsAString * aDisplayName, nsIMIMEInfo aMIMEInfo, PRTime startTime, nsILocalFile aTempFile, nsICancelable aCancelable);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIURI.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,50 @@
+module org.eclipse.swt.internal.mozilla.nsIURI;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_IURI_IID_STR = "07a22cc0-0ce5-11d3-9331-00104ba0fd40";
+
+const nsIID NS_IURI_IID= 
+  {0x07a22cc0, 0x0ce5, 0x11d3, 
+    [ 0x93, 0x31, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40 ]};
+
+interface nsIURI : nsISupports {
+
+  static const char[] IID_STR = NS_IURI_IID_STR;
+  static const nsIID IID = NS_IURI_IID;
+
+extern(System):
+  nsresult GetSpec(nsACString * aSpec);
+  nsresult SetSpec(nsACString * aSpec);
+  nsresult GetPrePath(nsACString * aPrePath);
+  nsresult GetScheme(nsACString * aScheme);
+  nsresult SetScheme(nsACString * aScheme);
+  nsresult GetUserPass(nsACString * aUserPass);
+  nsresult SetUserPass(nsACString * aUserPass);
+  nsresult GetUsername(nsACString * aUsername);
+  nsresult SetUsername(nsACString * aUsername);
+  nsresult GetPassword(nsACString * aPassword);
+  nsresult SetPassword(nsACString * aPassword);
+  nsresult GetHostPort(nsACString * aHostPort);
+  nsresult SetHostPort(nsACString * aHostPort);
+  nsresult GetHost(nsACString * aHost);
+  nsresult SetHost(nsACString * aHost);
+  nsresult GetPort(PRInt32 *aPort);
+  nsresult SetPort(PRInt32 aPort);
+  nsresult GetPath(nsACString * aPath);
+  nsresult SetPath(nsACString * aPath);
+  nsresult Equals(nsIURI other, PRBool *_retval);
+  nsresult SchemeIs(char *scheme, PRBool *_retval);
+  nsresult Clone(nsIURI *_retval);
+  nsresult Resolve(nsACString * relativePath, nsACString * _retval);
+  nsresult GetAsciiSpec(nsACString * aAsciiSpec);
+  nsresult GetAsciiHost(nsACString * aAsciiHost);
+  nsresult GetOriginCharset(nsACString * aOriginCharset);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIURIContentListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,35 @@
+module org.eclipse.swt.internal.mozilla.nsIURIContentListener;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIRequest;
+import org.eclipse.swt.internal.mozilla.nsIStreamListener;
+import org.eclipse.swt.internal.mozilla.nsIURI; 
+
+const char[] NS_IURICONTENTLISTENER_IID_STR = "94928ab3-8b63-11d3-989d-001083010e9b";
+
+const nsIID NS_IURICONTENTLISTENER_IID= 
+  {0x94928ab3, 0x8b63, 0x11d3, 
+    [ 0x98, 0x9d, 0x00, 0x10, 0x83, 0x01, 0x0e, 0x9b ]};
+
+interface nsIURIContentListener : nsISupports {
+
+  static const char[] IID_STR = NS_IURICONTENTLISTENER_IID_STR;
+  static const nsIID IID = NS_IURICONTENTLISTENER_IID;
+
+extern(System):
+  nsresult OnStartURIOpen(nsIURI aURI, PRBool *_retval);
+  nsresult DoContent(char *aContentType, PRBool aIsContentPreferred, nsIRequest aRequest, nsIStreamListener *aContentHandler, PRBool *_retval);
+  nsresult IsPreferred(char *aContentType, char **aDesiredContentType, PRBool *_retval);
+  nsresult CanHandleContent(char *aContentType, PRBool aIsContentPreferred, char **aDesiredContentType, PRBool *_retval);
+  nsresult GetLoadCookie(nsISupports  *aLoadCookie);
+  nsresult SetLoadCookie(nsISupports  aLoadCookie);
+  nsresult GetParentContentListener(nsIURIContentListener  *aParentContentListener);
+  nsresult SetParentContentListener(nsIURIContentListener  aParentContentListener);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIURL.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,42 @@
+module org.eclipse.swt.internal.mozilla.nsIURL;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsIURI;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_IURL_IID_STR = "d6116970-8034-11d3-9399-00104ba0fd40";
+
+const nsIID NS_IURL_IID= 
+  {0xd6116970, 0x8034, 0x11d3, 
+    [ 0x93, 0x99, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40 ]};
+
+interface nsIURL : nsIURI {
+
+  static const char[] IID_STR = NS_IURL_IID_STR;
+  static const nsIID IID = NS_IURL_IID;
+
+extern(System):
+  nsresult GetFilePath(nsACString * aFilePath);
+  nsresult SetFilePath(nsACString * aFilePath);
+  nsresult GetParam(nsACString * aParam);
+  nsresult SetParam(nsACString * aParam);
+  nsresult GetQuery(nsACString * aQuery);
+  nsresult SetQuery(nsACString * aQuery);
+  nsresult GetRef(nsACString * aRef);
+  nsresult SetRef(nsACString * aRef);
+  nsresult GetDirectory(nsACString * aDirectory);
+  nsresult SetDirectory(nsACString * aDirectory);
+  nsresult GetFileName(nsACString * aFileName);
+  nsresult SetFileName(nsACString * aFileName);
+  nsresult GetFileBaseName(nsACString * aFileBaseName);
+  nsresult SetFileBaseName(nsACString * aFileBaseName);
+  nsresult GetFileExtension(nsACString * aFileExtension);
+  nsresult SetFileExtension(nsACString * aFileExtension);
+  nsresult GetCommonBaseSpec(nsIURI aURIToCompare, nsACString * _retval);
+  nsresult GetRelativeSpec(nsIURI aURIToCompare, nsACString * _retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWeakReference.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,48 @@
+module org.eclipse.swt.internal.mozilla.nsIWeakReference;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+/******************************************************************************
+
+******************************************************************************/
+
+const char[] NS_IWEAKREFERENCE_IID_STR = "9188bc85-f92e-11d2-81ef-0060083a0bcf";
+
+const nsIID NS_IWEAKREFERENCE_IID= 
+  {0x9188bc85, 0xf92e, 0x11d2, 
+    [ 0x81, 0xef, 0x00, 0x60, 0x08, 0x3a, 0x0b, 0xcf ]};
+
+interface nsIWeakReference : nsISupports {
+
+  static const char[] IID_STR = NS_IWEAKREFERENCE_IID_STR;
+  static const nsIID IID = NS_IWEAKREFERENCE_IID;
+
+extern(System):
+  nsresult QueryReferent(nsIID * uuid, void * *result);
+
+}
+
+/******************************************************************************
+
+******************************************************************************/
+
+const char[] NS_ISUPPORTSWEAKREFERENCE_IID_STR = "9188bc86-f92e-11d2-81ef-0060083a0bcf";
+
+const nsIID NS_ISUPPORTSWEAKREFERENCE_IID= 
+  {0x9188bc86, 0xf92e, 0x11d2, 
+    [ 0x81, 0xef, 0x00, 0x60, 0x08, 0x3a, 0x0b, 0xcf ]};
+
+interface nsISupportsWeakReference : nsISupports {
+
+  static const char[] IID_STR = NS_ISUPPORTSWEAKREFERENCE_IID_STR;
+  static const nsIID IID = NS_ISUPPORTSWEAKREFERENCE_IID;
+
+extern(System):
+  nsresult GetWeakReference(nsIWeakReference *_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWebBrowser.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,35 @@
+module org.eclipse.swt.internal.mozilla.nsIWebBrowser;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIWebBrowserChrome; 
+import org.eclipse.swt.internal.mozilla.nsIURIContentListener;
+import org.eclipse.swt.internal.mozilla.nsIDOMWindow;
+import org.eclipse.swt.internal.mozilla.nsIWeakReference;
+
+const char[] NS_IWEBBROWSER_IID_STR = "69e5df00-7b8b-11d3-af61-00a024ffc08c";
+
+const nsIID NS_IWEBBROWSER_IID= 
+  {0x69e5df00, 0x7b8b, 0x11d3, 
+    [ 0xaf, 0x61, 0x00, 0xa0, 0x24, 0xff, 0xc0, 0x8c ]};
+
+interface nsIWebBrowser : nsISupports {
+
+  static const char[] IID_STR = NS_IWEBBROWSER_IID_STR;
+  static const nsIID IID = NS_IWEBBROWSER_IID;
+
+extern(System):
+  nsresult AddWebBrowserListener(nsIWeakReference aListener, nsIID * aIID);
+  nsresult RemoveWebBrowserListener(nsIWeakReference aListener, nsIID * aIID);
+  nsresult GetContainerWindow(nsIWebBrowserChrome  *aContainerWindow);
+  nsresult SetContainerWindow(nsIWebBrowserChrome  aContainerWindow);
+  nsresult GetParentURIContentListener(nsIURIContentListener  *aParentURIContentListener);
+  nsresult SetParentURIContentListener(nsIURIContentListener  aParentURIContentListener);
+  nsresult GetContentDOMWindow(nsIDOMWindow  *aContentDOMWindow);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWebBrowserChrome.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,65 @@
+module org.eclipse.swt.internal.mozilla.nsIWebBrowserChrome;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIWebBrowser; 
+
+const char[] NS_IWEBBROWSERCHROME_IID_STR = "ba434c60-9d52-11d3-afb0-00a024ffc08c";
+
+const nsIID NS_IWEBBROWSERCHROME_IID= 
+  {0xba434c60, 0x9d52, 0x11d3, 
+    [ 0xaf, 0xb0, 0x00, 0xa0, 0x24, 0xff, 0xc0, 0x8c ]};
+
+interface nsIWebBrowserChrome : nsISupports {
+
+  static const char[] IID_STR = NS_IWEBBROWSERCHROME_IID_STR;
+  static const nsIID IID = NS_IWEBBROWSERCHROME_IID;
+
+extern(System):
+  enum { STATUS_SCRIPT = 1U };
+  enum { STATUS_SCRIPT_DEFAULT = 2U };
+  enum { STATUS_LINK = 3U };
+
+  nsresult SetStatus(PRUint32 statusType, PRUnichar *status);
+  nsresult GetWebBrowser(nsIWebBrowser  *aWebBrowser);
+  nsresult SetWebBrowser(nsIWebBrowser  aWebBrowser);
+
+  enum { CHROME_DEFAULT = 1U };
+  enum { CHROME_WINDOW_BORDERS = 2U };
+  enum { CHROME_WINDOW_CLOSE = 4U };
+  enum { CHROME_WINDOW_RESIZE = 8U };
+  enum { CHROME_MENUBAR = 16U };
+  enum { CHROME_TOOLBAR = 32U };
+  enum { CHROME_LOCATIONBAR = 64U };
+  enum { CHROME_STATUSBAR = 128U };
+  enum { CHROME_PERSONAL_TOOLBAR = 256U };
+  enum { CHROME_SCROLLBARS = 512U };
+  enum { CHROME_TITLEBAR = 1024U };
+  enum { CHROME_EXTRA = 2048U };
+  enum { CHROME_WITH_SIZE = 4096U };
+  enum { CHROME_WITH_POSITION = 8192U };
+  enum { CHROME_WINDOW_MIN = 16384U };
+  enum { CHROME_WINDOW_POPUP = 32768U };
+  enum { CHROME_WINDOW_RAISED = 33554432U };
+  enum { CHROME_WINDOW_LOWERED = 67108864U };
+  enum { CHROME_CENTER_SCREEN = 134217728U };
+  enum { CHROME_DEPENDENT = 268435456U };
+  enum { CHROME_MODAL = 536870912U };
+  enum { CHROME_OPENAS_DIALOG = 1073741824U };
+  enum { CHROME_OPENAS_CHROME = 2147483648U };
+  enum { CHROME_ALL = 4094U };
+
+  nsresult GetChromeFlags(PRUint32 *aChromeFlags);
+  nsresult SetChromeFlags(PRUint32 aChromeFlags);
+  nsresult DestroyBrowserWindow();
+  nsresult SizeBrowserTo(PRInt32 aCX, PRInt32 aCY);
+  nsresult ShowAsModal();
+  nsresult IsWindowModal(PRBool *_retval);
+  nsresult ExitModalEventLoop(nsresult aStatus);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWebBrowserChromeFocus.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,25 @@
+module org.eclipse.swt.internal.mozilla.nsIWebBrowserChromeFocus;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+const char[] NS_IWEBBROWSERCHROMEFOCUS_IID_STR = "d2206418-1dd1-11b2-8e55-acddcd2bcfb8";
+
+const nsIID NS_IWEBBROWSERCHROMEFOCUS_IID= 
+  {0xd2206418, 0x1dd1, 0x11b2, 
+    [ 0x8e, 0x55, 0xac, 0xdd, 0xcd, 0x2b, 0xcf, 0xb8 ]};
+
+interface nsIWebBrowserChromeFocus : nsISupports {
+
+  static const char[] IID_STR = NS_IWEBBROWSERCHROMEFOCUS_IID_STR;
+  static const nsIID IID = NS_IWEBBROWSERCHROMEFOCUS_IID;
+
+extern(System):
+  nsresult FocusNextElement();
+  nsresult FocusPrevElement();
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWebBrowserFocus.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,33 @@
+module org.eclipse.swt.internal.mozilla.nsIWebBrowserFocus;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsIDOMWindow; 
+import org.eclipse.swt.internal.mozilla.nsIDOMElement;
+
+const char[] NS_IWEBBROWSERFOCUS_IID_STR = "9c5d3c58-1dd1-11b2-a1c9-f3699284657a";
+
+const nsIID NS_IWEBBROWSERFOCUS_IID= 
+  {0x9c5d3c58, 0x1dd1, 0x11b2, 
+    [ 0xa1, 0xc9, 0xf3, 0x69, 0x92, 0x84, 0x65, 0x7a ]};
+
+interface nsIWebBrowserFocus : nsISupports {
+
+  static const char[] IID_STR = NS_IWEBBROWSERFOCUS_IID_STR;
+  static const nsIID IID = NS_IWEBBROWSERFOCUS_IID;
+
+extern(System):
+  nsresult Activate();
+  nsresult Deactivate();
+  nsresult SetFocusAtFirstElement();
+  nsresult SetFocusAtLastElement();
+  nsresult GetFocusedWindow(nsIDOMWindow  *aFocusedWindow);
+  nsresult SetFocusedWindow(nsIDOMWindow  aFocusedWindow);
+  nsresult GetFocusedElement(nsIDOMElement  *aFocusedElement);
+  nsresult SetFocusedElement(nsIDOMElement  aFocusedElement);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWebNavigation.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,61 @@
+module org.eclipse.swt.internal.mozilla.nsIWebNavigation;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMDocument;
+import org.eclipse.swt.internal.mozilla.nsIInputStream;
+import org.eclipse.swt.internal.mozilla.nsISHistory; 
+import org.eclipse.swt.internal.mozilla.nsIURI; 
+
+const char[] NS_IWEBNAVIGATION_IID_STR = "f5d9e7b0-d930-11d3-b057-00a024ffc08c";
+
+const nsIID NS_IWEBNAVIGATION_IID= 
+  {0xf5d9e7b0, 0xd930, 0x11d3, 
+    [ 0xb0, 0x57, 0x00, 0xa0, 0x24, 0xff, 0xc0, 0x8c ]};
+
+interface nsIWebNavigation : nsISupports {
+
+  static const char[] IID_STR = NS_IWEBNAVIGATION_IID_STR;
+  static const nsIID IID = NS_IWEBNAVIGATION_IID;
+
+extern(System):
+  nsresult GetCanGoBack(PRBool *aCanGoBack);
+  nsresult GetCanGoForward(PRBool *aCanGoForward);
+  nsresult GoBack();
+  nsresult GoForward();
+  nsresult GotoIndex(PRInt32 index);
+
+  enum { LOAD_FLAGS_MASK = 65535U };
+  enum { LOAD_FLAGS_NONE = 0U };
+  enum { LOAD_FLAGS_IS_REFRESH = 16U };
+  enum { LOAD_FLAGS_IS_LINK = 32U };
+  enum { LOAD_FLAGS_BYPASS_HISTORY = 64U };
+  enum { LOAD_FLAGS_REPLACE_HISTORY = 128U };
+  enum { LOAD_FLAGS_BYPASS_CACHE = 256U };
+  enum { LOAD_FLAGS_BYPASS_PROXY = 512U };
+  enum { LOAD_FLAGS_CHARSET_CHANGE = 1024U };
+  enum { LOAD_FLAGS_STOP_CONTENT = 2048U };
+  enum { LOAD_FLAGS_FROM_EXTERNAL = 4096U };
+  enum { LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP = 8192U };
+  enum { LOAD_FLAGS_FIRST_LOAD = 16384U };
+
+  nsresult LoadURI(PRUnichar *aURI, PRUint32 aLoadFlags, nsIURI aReferrer, nsIInputStream aPostData, nsIInputStream aHeaders);
+  nsresult Reload(PRUint32 aReloadFlags);
+
+  enum { STOP_NETWORK = 1U };
+  enum { STOP_CONTENT = 2U };
+  enum { STOP_ALL = 3U };
+
+  nsresult Stop(PRUint32 aStopFlags);
+  nsresult GetDocument(nsIDOMDocument  *aDocument);
+  nsresult GetCurrentURI(nsIURI  *aCurrentURI);
+  nsresult GetReferringURI(nsIURI  *aReferringURI);
+  nsresult GetSessionHistory(nsISHistory  *aSessionHistory);
+  nsresult SetSessionHistory(nsISHistory  aSessionHistory);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWebNavigationInfo.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,31 @@
+module org.eclipse.swt.internal.mozilla.nsIWebNavigationInfo;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+import org.eclipse.swt.internal.mozilla.nsIWebNavigation;
+import org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+const char[] NS_IWEBNAVIGATIONINFO_IID_STR = "62a93afb-93a1-465c-84c8-0432264229de";
+
+const nsIID NS_IWEBNAVIGATIONINFO_IID= 
+  {0x62a93afb, 0x93a1, 0x465c, 
+    [ 0x84, 0xc8, 0x04, 0x32, 0x26, 0x42, 0x29, 0xde ]};
+
+interface nsIWebNavigationInfo : nsISupports {
+
+  static const char[] IID_STR = NS_IWEBNAVIGATIONINFO_IID_STR;
+  static const nsIID IID = NS_IWEBNAVIGATIONINFO_IID;
+
+extern(System):
+  enum { UNSUPPORTED = 0U };
+  enum { IMAGE = 1U };
+  enum { PLUGIN = 2U };
+  enum { OTHER = 32768U };
+
+  nsresult IsTypeSupported(nsACString * aType, nsIWebNavigation aWebNav, PRUint32 *_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWebProgress.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,41 @@
+module org.eclipse.swt.internal.mozilla.nsIWebProgress;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMWindow; 
+import org.eclipse.swt.internal.mozilla.nsIWebProgressListener; 
+
+const char[] NS_IWEBPROGRESS_IID_STR = "570f39d0-efd0-11d3-b093-00a024ffc08c";
+
+const nsIID NS_IWEBPROGRESS_IID= 
+  {0x570f39d0, 0xefd0, 0x11d3, 
+    [ 0xb0, 0x93, 0x00, 0xa0, 0x24, 0xff, 0xc0, 0x8c ]};
+
+interface nsIWebProgress : nsISupports {
+
+  static const char[] IID_STR = NS_IWEBPROGRESS_IID_STR;
+  static const nsIID IID = NS_IWEBPROGRESS_IID;
+
+extern(System):
+  enum { NOTIFY_STATE_REQUEST = 1U };
+  enum { NOTIFY_STATE_DOCUMENT = 2U };
+  enum { NOTIFY_STATE_NETWORK = 4U };
+  enum { NOTIFY_STATE_WINDOW = 8U };
+  enum { NOTIFY_STATE_ALL = 15U };
+  enum { NOTIFY_PROGRESS = 16U };
+  enum { NOTIFY_STATUS = 32U };
+  enum { NOTIFY_SECURITY = 64U };
+  enum { NOTIFY_LOCATION = 128U };
+  enum { NOTIFY_ALL = 255U };
+
+  nsresult AddProgressListener(nsIWebProgressListener aListener, PRUint32 aNotifyMask);
+  nsresult RemoveProgressListener(nsIWebProgressListener aListener);
+  nsresult GetDOMWindow(nsIDOMWindow  *aDOMWindow);
+  nsresult GetIsLoadingDocument(PRBool *aIsLoadingDocument);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWebProgressListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,49 @@
+module org.eclipse.swt.internal.mozilla.nsIWebProgressListener;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIWebProgress;
+import org.eclipse.swt.internal.mozilla.nsIRequest; 
+import org.eclipse.swt.internal.mozilla.nsIURI; 
+
+const char[] NS_IWEBPROGRESSLISTENER_IID_STR = "570f39d1-efd0-11d3-b093-00a024ffc08c";
+
+const nsIID NS_IWEBPROGRESSLISTENER_IID= 
+  {0x570f39d1, 0xefd0, 0x11d3, 
+    [ 0xb0, 0x93, 0x00, 0xa0, 0x24, 0xff, 0xc0, 0x8c ]};
+
+interface nsIWebProgressListener : nsISupports {
+
+  static const char[] IID_STR = NS_IWEBPROGRESSLISTENER_IID_STR;
+  static const nsIID IID = NS_IWEBPROGRESSLISTENER_IID;
+
+extern(System):
+  enum { STATE_START = 1U };
+  enum { STATE_REDIRECTING = 2U };
+  enum { STATE_TRANSFERRING = 4U };
+  enum { STATE_NEGOTIATING = 8U };
+  enum { STATE_STOP = 16U };
+  enum { STATE_IS_REQUEST = 65536U };
+  enum { STATE_IS_DOCUMENT = 131072U };
+  enum { STATE_IS_NETWORK = 262144U };
+  enum { STATE_IS_WINDOW = 524288U };
+  enum { STATE_RESTORING = 16777216U };
+  enum { STATE_IS_INSECURE = 4U };
+  enum { STATE_IS_BROKEN = 1U };
+  enum { STATE_IS_SECURE = 2U };
+  enum { STATE_SECURE_HIGH = 262144U };
+  enum { STATE_SECURE_MED = 65536U };
+  enum { STATE_SECURE_LOW = 131072U };
+
+  nsresult OnStateChange(nsIWebProgress aWebProgress, nsIRequest aRequest, PRUint32 aStateFlags, nsresult aStatus);
+  nsresult OnProgressChange(nsIWebProgress aWebProgress, nsIRequest aRequest, PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress);
+  nsresult OnLocationChange(nsIWebProgress aWebProgress, nsIRequest aRequest, nsIURI aLocation);
+  nsresult OnStatusChange(nsIWebProgress aWebProgress, nsIRequest aRequest, nsresult aStatus, PRUnichar *aMessage);
+  nsresult OnSecurityChange(nsIWebProgress aWebProgress, nsIRequest aRequest, PRUint32 aState);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWebProgressListener2.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,27 @@
+module org.eclipse.swt.internal.mozilla.nsIWebProgressListener2;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+
+import org.eclipse.swt.internal.mozilla.nsIWebProgressListener;
+import org.eclipse.swt.internal.mozilla.nsIWebProgress;
+import org.eclipse.swt.internal.mozilla.nsIRequest;
+
+const char[] NS_IWEBPROGRESSLISTENER2_IID_STR = "3f24610d-1e1f-4151-9d2e-239884742324";
+
+const nsIID NS_IWEBPROGRESSLISTENER2_IID= 
+  {0x3f24610d, 0x1e1f, 0x4151, 
+    [ 0x9d, 0x2e, 0x23, 0x98, 0x84, 0x74, 0x23, 0x24 ]};
+
+interface nsIWebProgressListener2 : nsIWebProgressListener {
+
+  static const char[] IID_STR = NS_IWEBPROGRESSLISTENER2_IID_STR;
+  static const nsIID IID = NS_IWEBPROGRESSLISTENER2_IID;
+
+extern(System):
+  nsresult OnProgressChange64(nsIWebProgress aWebProgress, nsIRequest aRequest, PRInt64 aCurSelfProgress, PRInt64 aMaxSelfProgress, PRInt64 aCurTotalProgress, PRInt64 aMaxTotalProgress);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWindowCreator.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,26 @@
+module org.eclipse.swt.internal.mozilla.nsIWindowCreator;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIWebBrowserChrome;
+
+const char[] NS_IWINDOWCREATOR_IID_STR = "30465632-a777-44cc-90f9-8145475ef999";
+
+const nsIID NS_IWINDOWCREATOR_IID= 
+  {0x30465632, 0xa777, 0x44cc, 
+    [ 0x90, 0xf9, 0x81, 0x45, 0x47, 0x5e, 0xf9, 0x99 ]};
+
+interface nsIWindowCreator : nsISupports {
+
+  static const char[] IID_STR = NS_IWINDOWCREATOR_IID_STR;
+  static const nsIID IID = NS_IWINDOWCREATOR_IID;
+
+extern(System):
+  nsresult CreateChromeWindow(nsIWebBrowserChrome parent, PRUint32 chromeFlags, nsIWebBrowserChrome *_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWindowCreator2.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,28 @@
+module org.eclipse.swt.internal.mozilla.nsIWindowCreator2;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+
+import org.eclipse.swt.internal.mozilla.nsIWindowCreator;
+import org.eclipse.swt.internal.mozilla.nsIURI; 
+import org.eclipse.swt.internal.mozilla.nsIWebBrowserChrome;
+
+const char[] NS_IWINDOWCREATOR2_IID_STR = "f673ec81-a4b0-11d6-964b-eb5a2bf216fc";
+
+const nsIID NS_IWINDOWCREATOR2_IID= 
+  {0xf673ec81, 0xa4b0, 0x11d6, 
+    [ 0x96, 0x4b, 0xeb, 0x5a, 0x2b, 0xf2, 0x16, 0xfc ]};
+
+interface nsIWindowCreator2 : nsIWindowCreator {
+
+  static const char[] IID_STR = NS_IWINDOWCREATOR2_IID_STR;
+  static const nsIID IID = NS_IWINDOWCREATOR2_IID;
+
+extern(System):
+  enum { PARENT_IS_LOADING_OR_RUNNING_TIMEOUT = 1U };
+  nsresult CreateChromeWindow2(nsIWebBrowserChrome parent, PRUint32 chromeFlags, PRUint32 contextFlags, nsIURI uri, PRBool *cancel, nsIWebBrowserChrome *_retval);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsIWindowWatcher.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,42 @@
+module org.eclipse.swt.internal.mozilla.nsIWindowWatcher;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.nsID;
+import org.eclipse.swt.internal.mozilla.nsISupports;
+
+import org.eclipse.swt.internal.mozilla.nsIDOMWindow;
+import org.eclipse.swt.internal.mozilla.nsIObserver; 
+import org.eclipse.swt.internal.mozilla.nsIPrompt; 
+import org.eclipse.swt.internal.mozilla.nsIAuthPrompt;
+import org.eclipse.swt.internal.mozilla.nsISimpleEnumerator;
+import org.eclipse.swt.internal.mozilla.nsIWebBrowserChrome;
+import org.eclipse.swt.internal.mozilla.nsIWindowCreator; 
+
+const char[] NS_IWINDOWWATCHER_IID_STR = "002286a8-494b-43b3-8ddd-49e3fc50622b";
+
+const nsIID NS_IWINDOWWATCHER_IID= 
+  {0x002286a8, 0x494b, 0x43b3, 
+    [ 0x8d, 0xdd, 0x49, 0xe3, 0xfc, 0x50, 0x62, 0x2b ]};
+
+interface nsIWindowWatcher : nsISupports {
+
+  static const char[] IID_STR = NS_IWINDOWWATCHER_IID_STR;
+  static const nsIID IID = NS_IWINDOWWATCHER_IID;
+
+extern(System):
+  nsresult OpenWindow(nsIDOMWindow aParent, char *aUrl, char *aName, char *aFeatures, nsISupports aArguments, nsIDOMWindow *_retval);
+  nsresult RegisterNotification(nsIObserver aObserver);
+  nsresult UnregisterNotification(nsIObserver aObserver);
+  nsresult GetWindowEnumerator(nsISimpleEnumerator *_retval);
+  nsresult GetNewPrompter(nsIDOMWindow aParent, nsIPrompt *_retval);
+  nsresult GetNewAuthPrompter(nsIDOMWindow aParent, nsIAuthPrompt *_retval);
+  nsresult SetWindowCreator(nsIWindowCreator creator);
+  nsresult GetChromeForWindow(nsIDOMWindow aWindow, nsIWebBrowserChrome *_retval);
+  nsresult GetWindowByName(PRUnichar *aTargetName, nsIDOMWindow aCurrentWindow, nsIDOMWindow *_retval);
+  nsresult GetActiveWindow(nsIDOMWindow  *aActiveWindow);
+  nsresult SetActiveWindow(nsIDOMWindow  aActiveWindow);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/nsStringAPI.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,193 @@
+module org.eclipse.swt.internal.mozilla.nsStringAPI;
+
+import java.lang.all;
+
+import Utf = tango.text.convert.Utf;
+import org.eclipse.swt.internal.mozilla.Common;
+
+extern (System):
+
+/******************************************************************************
+
+******************************************************************************/
+
+enum
+{
+    NS_STRING_CONTAINER_INIT_DEPEND = 2,
+    NS_STRING_CONTAINER_INIT_ADOPT = 4,
+    NS_STRING_CONTAINER_INIT_SUBSTRING = 8,
+}
+
+nsresult    NS_StringContainerInit ( nsStringContainer *aContainer );
+nsresult    NS_StringContainerInit2( nsStringContainer *aContainer, PRUnichar *aData, PRUint32                                      aDataLength, PRUint32 aFlags );
+void        NS_StringContainerFinish(nsStringContainer *aContainer);
+PRUint32    NS_StringGetData(nsAString *aStr, PRUnichar **aData, PRBool *aTerminated);
+PRUint32    NS_StringGetMutableData(nsAString *aStr, PRUint32 aDataLength, PRUnichar **aData);
+PRUnichar * NS_StringCloneData(nsAString *aStr);
+nsresult    NS_StringSetData(nsAString *aStr, PRUnichar *aData, PRUint32 aDataLength);
+nsresult    NS_StringSetDataRange( nsAString *aStr, PRUint32 aCutOffset, PRUint32 aCutLength,                                     PRUnichar *aData, PRUint32 aDataLength );
+nsresult    NS_StringCopy(nsAString *aDestStr, nsAString *aSrcStr);
+
+/******************************************************************************
+
+******************************************************************************/
+
+enum
+{
+    NS_CSTRING_CONTAINER_INIT_DEPEND = 2,
+    NS_CSTRING_CONTAINER_INIT_ADOPT = 4,
+    NS_CSTRING_CONTAINER_INIT_SUBSTRING = 8,
+}
+
+nsresult    NS_CStringContainerInit( nsCStringContainer *aContainer );
+nsresult    NS_CStringContainerInit2( nsCStringContainer *aContainer, char *aData, PRUint32                                          aDataLength, PRUint32 aFlags );
+void        NS_CStringContainerFinish( nsCStringContainer *aContainer );
+PRUint32    NS_CStringGetData( nsACString *aStr, char **aData, PRBool *aTerminated );
+PRUint32    NS_CStringGetMutableData( nsACString *aStr, PRUint32 aDataLength, char **aData );
+char *      NS_CStringCloneData( nsACString *aStr);
+nsresult    NS_CStringSetData( nsACString *aStr, char *aData, PRUint32 aDataLength );
+nsresult    NS_CStringSetDataRange( nsACString *aStr, PRUint32 aCutOffset, 
+                                    PRUint32 aCutLength, char *aData, PRUint32 aDataLength );
+nsresult    NS_CStringCopy( nsACString *aDestStr, nsACString *aSrcStr );
+
+/******************************************************************************
+
+******************************************************************************/
+
+enum nsCStringEncoding
+{
+    NS_CSTRING_ENCODING_ASCII,
+    NS_CSTRING_ENCODING_UTF8,
+    NS_CSTRING_ENCODING_NATIVE_FILESYSTEM,
+}
+
+nsresult    NS_CStringToUTF16( nsACString *aSource, int aSrcEncoding, nsAString *aDest );
+nsresult    NS_UTF16ToCString( nsAString *aSource, int aDestEncoding, nsACString *aDest );
+
+/******************************************************************************
+
+******************************************************************************/
+
+alias nsAString nsAString_external;
+alias nsACString nsACString_external;
+
+//alias nsAString nsEmbedString;
+//alias nsACString nsEmbedCString;
+
+struct nsAString
+{
+
+    static nsAString opCall(wchar[] s)
+    {
+        nsAString result;
+        NS_StringSetData(&result, cast(PRUnichar*)s, uint.max);
+        return result;
+    }
+
+    static wchar[] toString16( nsAString* str )
+    {
+        wchar* buffer = null;
+		PRBool terminated;
+		uint len = NS_StringGetData(str, &buffer, &terminated);
+		return buffer[0 .. len].dup;
+    }
+    
+    static char[] toString( nsAString* str )
+    {
+        return Utf.toString( nsAString.toString16( str ) );
+    }
+
+  private:
+    void *v;
+}
+
+struct nsACString
+{
+/+
+  static nsACString opCall(char[] s)
+  {
+    nsACString result;
+    NS_CStringSetData(&result, cast(char*)s, uint.max);
+    return result;
+  }
++/
+  private:
+    void *v;
+}
+
+/******************************************************************************
+
+******************************************************************************/
+
+struct nsStringContainer// : public nsAString
+{
+private:
+	void* v;
+	void* d1;
+	uint  d2;
+	void* d3;
+}
+
+struct nsCStringContainer// : public nsACString
+{
+private:
+	void* v;
+	void* d1;
+	uint  d2;
+	void* d3;
+}
+
+/******************************************************************************
+
+******************************************************************************/
+
+// import mozilla.xpcom.nsDebug;
+
+alias nsString_external     nsString;
+alias nsCString_external    nsCString;
+alias nsDependentString_external nsDependentString;
+alias nsDependentCString_external nsDependentCString;
+alias NS_ConvertASCIItoUTF16_external NS_ConvertASCIItoUTF16;
+alias NS_ConvertUTF8toUTF16_external NS_ConvertUTF8toUTF16;
+alias NS_ConvertUTF16toUTF8_external NS_ConvertUTF16toUTF8;
+alias NS_LossyConvertUTF16toASCII_external NS_LossyConvertUTF16toASCII;
+alias nsGetterCopies_external nsGetterCopies;
+alias nsCGetterCopies_external nsCGetterCopies;
+alias nsDependentSubstring_external nsDependentSubstring;
+alias nsDependentCSubstring_external nsDependentCSubstring;
+
+struct nsString_external{}
+struct nsCString_external{}
+struct nsDependentString_external{}
+struct nsDependentCString_external{}
+struct NS_ConvertASCIItoUTF16_external{}
+struct NS_ConvertUTF8toUTF16_external{}
+struct NS_ConvertUTF16toUTF8_external{}
+struct NS_LossyConvertUTF16toASCII_external{}
+
+/******************************************************************************
+
+******************************************************************************/
+
+struct nsGetterCopies_external
+{
+  private:
+	alias PRUnichar char_type;
+    nsString_external *mString;
+    char_type *mData;
+}
+
+struct nsCGetterCopies_external
+{
+  private:
+	alias char char_type;
+    nsCString_external *mString;
+    char_type *mData;
+}
+
+/******************************************************************************
+
+******************************************************************************/
+
+struct nsDependentSubstring_external{}
+struct nsDependentCSubstring_external{}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/prinrval.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,62 @@
+module org.eclipse.swt.internal.mozilla.prinrval;
+
+import java.lang.all;
+
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is the Netscape Portable Runtime (NSPR).
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998-2000
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+import org.eclipse.swt.internal.mozilla.Common;
+
+extern (System):
+
+alias PRUint32 PRIntervalTime;
+
+const PR_INTERVAL_MIN = 1000U;
+const PR_INTERVAL_MAX = 100000U;
+const PR_INTERVAL_NO_WAIT = 0U;
+const PR_INTERVAL_NO_TIMEOUT = 0xffffffffU;
+
+version(NON_XPCOM_GLUE)
+{
+    PRIntervalTime  PR_IntervalNow();
+    PRUint32        PR_TicksPerSecond();
+    PRIntervalTime  PR_SecondsToInterval(PRUint32 seconds);
+    PRIntervalTime  PR_MillisecondsToInterval(PRUint32 milli);
+    PRIntervalTime  PR_MicrosecondsToInterval(PRUint32 micro);
+    PRUint32  PR_IntervalToSeconds(PRIntervalTime ticks);
+    PRUint32  PR_IntervalToMilliseconds(PRIntervalTime ticks);
+    PRUint32  PR_IntervalToMicroseconds(PRIntervalTime ticks);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/prio.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,519 @@
+module org.eclipse.swt.internal.mozilla.prio;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.mozilla.Common;
+import org.eclipse.swt.internal.mozilla.prtime;
+import org.eclipse.swt.internal.mozilla.prinrval;
+
+extern (System):
+
+alias PRIntn PRDescIdentity;
+alias void   PRFilePrivate;
+
+struct PRFileDesc
+{
+    PRIOMethods *methods;
+    PRFilePrivate *secret;
+    PRFileDesc *lower;
+    PRFileDesc *higher;
+    void  function(PRFileDesc *fd)dtor;
+    PRDescIdentity identity;
+}
+
+enum PRTransmitFileFlags
+{
+    PR_TRANSMITFILE_KEEP_OPEN,
+    PR_TRANSMITFILE_CLOSE_SOCKET,
+}
+
+const PR_AF_INET = 2;
+const PR_AF_LOCAL = 1;
+const PR_INADDR_LOOPBACK = 0x7f000001;
+const PR_AF_UNSPEC = 0;
+
+union _N2
+{
+    PRUint8 [16]_S6_u8;
+    PRUint16 [8]_S6_u16;
+    PRUint32 [4]_S6_u32;
+    PRUint64 [2]_S6_u64;
+}
+
+struct PRIPv6Addr
+{
+	struct _N2{
+		union
+		{
+			PRUint8 [16]_S6_u8;
+			PRUint16 [8]_S6_u16;
+			PRUint32 [4]_S6_u32;
+			PRUint64 [2]_S6_u64;
+		}
+	}
+	_N2 _S6_un;
+}
+
+struct _N3
+{
+    PRUint16 family;
+    char [14]data;
+}
+
+struct _N4
+{
+    PRUint16 family;
+    PRUint16 port;
+    PRUint32 ip;
+    char [8]pad;
+}
+
+struct _N5
+{
+    PRUint16 family;
+    PRUint16 port;
+    PRUint32 flowinfo;
+    PRIPv6Addr ip;
+    PRUint32 scope_id;
+}
+
+union PRNetAddr
+{
+    struct _N3
+    {
+        PRUint16 family;
+        char [14]data;
+    }
+    _N3 raw;
+    struct _N4
+    {
+        PRUint16 family;
+        PRUint16 port;
+        PRUint32 ip;
+        char [8]pad;
+    }
+    _N4 inet;
+    struct _N5
+    {
+        PRUint16 family;
+        PRUint16 port;
+        PRUint32 flowinfo;
+        PRIPv6Addr ip;
+        PRUint32 scope_id;
+    }
+    _N5 ipv6;
+}
+
+enum PRSockOption
+{
+    PR_SockOpt_Nonblocking,
+    PR_SockOpt_Linger,
+    PR_SockOpt_Reuseaddr,
+    PR_SockOpt_Keepalive,
+    PR_SockOpt_RecvBufferSize,
+    PR_SockOpt_SendBufferSize,
+    PR_SockOpt_IpTimeToLive,
+    PR_SockOpt_IpTypeOfService,
+    PR_SockOpt_AddMember,
+    PR_SockOpt_DropMember,
+    PR_SockOpt_McastInterface,
+    PR_SockOpt_McastTimeToLive,
+    PR_SockOpt_McastLoopback,
+    PR_SockOpt_NoDelay,
+    PR_SockOpt_MaxSegment,
+    PR_SockOpt_Broadcast,
+    PR_SockOpt_Last,
+}
+
+struct PRLinger
+{
+    PRBool polarity;
+    PRIntervalTime linger;
+}
+
+struct PRMcastRequest
+{
+    PRNetAddr mcaddr;
+    PRNetAddr ifaddr;
+}
+
+union _N6
+{
+    PRUintn ip_ttl;
+    PRUintn mcast_ttl;
+    PRUintn tos;
+    PRBool non_blocking;
+    PRBool reuse_addr;
+    PRBool keep_alive;
+    PRBool mcast_loopback;
+    PRBool no_delay;
+    PRBool broadcast;
+    PRSize max_segment;
+    PRSize recv_buffer_size;
+    PRSize send_buffer_size;
+    PRLinger linger;
+    PRMcastRequest add_member;
+    PRMcastRequest drop_member;
+    PRNetAddr mcast_if;
+}
+
+struct PRSocketOptionData
+{
+    int option;
+    union _N6
+    {
+        PRUintn ip_ttl;
+        PRUintn mcast_ttl;
+        PRUintn tos;
+        PRBool non_blocking;
+        PRBool reuse_addr;
+        PRBool keep_alive;
+        PRBool mcast_loopback;
+        PRBool no_delay;
+        PRBool broadcast;
+        PRSize max_segment;
+        PRSize recv_buffer_size;
+        PRSize send_buffer_size;
+        PRLinger linger;
+        PRMcastRequest add_member;
+        PRMcastRequest drop_member;
+        PRNetAddr mcast_if;
+    }
+    _N6 value;
+}
+
+struct PRIOVec
+{
+    char *iov_base;
+    int iov_len;
+}
+
+enum PRDescType
+{
+    PR_DESC_FILE = 1,
+    PR_DESC_SOCKET_TCP,
+    PR_DESC_SOCKET_UDP,
+    PR_DESC_LAYERED,
+    PR_DESC_PIPE,
+}
+
+enum PRSeekWhence
+{
+    PR_SEEK_SET,
+    PR_SEEK_CUR,
+    PR_SEEK_END,
+}
+
+version(NON_XPCOM_GLUE){
+    int  PR_GetDescType(PRFileDesc *file);
+}
+
+alias PRStatus  function(PRFileDesc *fd)PRCloseFN;
+alias PRInt32  function(PRFileDesc *fd, void *buf, PRInt32 amount)PRReadFN;
+alias PRInt32  function(PRFileDesc *fd, void *buf, PRInt32 amount)PRWriteFN;
+alias PRInt32  function(PRFileDesc *fd)PRAvailableFN;
+alias PRInt64  function(PRFileDesc *fd)PRAvailable64FN;
+alias PRStatus  function(PRFileDesc *fd)PRFsyncFN;
+alias PROffset32  function(PRFileDesc *fd, PROffset32 offset, int how)PRSeekFN;
+alias PROffset64  function(PRFileDesc *fd, PROffset64 offset, int how)PRSeek64FN;
+alias PRStatus  function(PRFileDesc *fd, PRFileInfo *info)PRFileInfoFN;
+alias PRStatus  function(PRFileDesc *fd, PRFileInfo64 *info)PRFileInfo64FN;
+alias PRInt32  function(PRFileDesc *fd, PRIOVec *iov, PRInt32 iov_size, PRIntervalTime timeout)PRWritevFN;
+alias PRStatus  function(PRFileDesc *fd, PRNetAddr *addr, PRIntervalTime timeout)PRConnectFN;
+alias PRFileDesc * function(PRFileDesc *fd, PRNetAddr *addr, PRIntervalTime timeout)PRAcceptFN;
+alias PRStatus  function(PRFileDesc *fd, PRNetAddr *addr)PRBindFN;
+alias PRStatus  function(PRFileDesc *fd, PRIntn backlog)PRListenFN;
+alias PRStatus  function(PRFileDesc *fd, PRIntn how)PRShutdownFN;
+alias PRInt32  function(PRFileDesc *fd, void *buf, PRInt32 amount, PRIntn flags, PRIntervalTime timeout)PRRecvFN;
+alias PRInt32  function(PRFileDesc *fd, void *buf, PRInt32 amount, PRIntn flags, PRIntervalTime timeout)PRSendFN;
+alias PRInt32  function(PRFileDesc *fd, void *buf, PRInt32 amount, PRIntn flags, PRNetAddr *addr, PRIntervalTime timeout)PRRecvfromFN;
+alias PRInt32  function(PRFileDesc *fd, void *buf, PRInt32 amount, PRIntn flags, PRNetAddr *addr, PRIntervalTime timeout)PRSendtoFN;
+alias PRInt16  function(PRFileDesc *fd, PRInt16 in_flags, PRInt16 *out_flags)PRPollFN;
+alias PRInt32  function(PRFileDesc *sd, PRFileDesc **nd, PRNetAddr **raddr, void *buf, PRInt32 amount, PRIntervalTime t)PRAcceptreadFN;
+alias PRInt32  function(PRFileDesc *sd, PRFileDesc *fd, void *headers, PRInt32 hlen, int flags, PRIntervalTime t)PRTransmitfileFN;
+alias PRStatus  function(PRFileDesc *fd, PRNetAddr *addr)PRGetsocknameFN;
+alias PRStatus  function(PRFileDesc *fd, PRNetAddr *addr)PRGetpeernameFN;
+alias PRStatus  function(PRFileDesc *fd, PRSocketOptionData *data)PRGetsocketoptionFN;
+alias PRStatus  function(PRFileDesc *fd, PRSocketOptionData *data)PRSetsocketoptionFN;
+alias PRInt32  function(PRFileDesc *networkSocket, PRSendFileData *sendData, int flags, PRIntervalTime timeout)PRSendfileFN;
+alias PRStatus  function(PRFileDesc *fd, PRInt16 out_flags)PRConnectcontinueFN;
+alias PRIntn  function(PRFileDesc *fd)PRReservedFN;
+
+struct PRIOMethods
+{
+    int file_type;
+    PRCloseFN close;
+    PRReadFN read;
+    PRWriteFN write;
+    PRAvailableFN available;
+    PRAvailable64FN available64;
+    PRFsyncFN fsync;
+    PRSeekFN seek;
+    PRSeek64FN seek64;
+    PRFileInfoFN fileInfo;
+    PRFileInfo64FN fileInfo64;
+    PRWritevFN writev;
+    PRConnectFN connect;
+    PRAcceptFN accept;
+    PRBindFN bind;
+    PRListenFN listen;
+    PRShutdownFN shutdown;
+    PRRecvFN recv;
+    PRSendFN send;
+    PRRecvfromFN recvfrom;
+    PRSendtoFN sendto;
+    PRPollFN poll;
+    PRAcceptreadFN acceptread;
+    PRTransmitfileFN transmitfile;
+    PRGetsocknameFN getsockname;
+    PRGetpeernameFN getpeername;
+    PRReservedFN reserved_fn_6;
+    PRReservedFN reserved_fn_5;
+    PRGetsocketoptionFN getsocketoption;
+    PRSetsocketoptionFN setsocketoption;
+    PRSendfileFN sendfile;
+    PRConnectcontinueFN connectcontinue;
+    PRReservedFN reserved_fn_3;
+    PRReservedFN reserved_fn_2;
+    PRReservedFN reserved_fn_1;
+    PRReservedFN reserved_fn_0;
+}
+
+enum PRSpecialFD
+{
+    PR_StandardInput,
+    PR_StandardOutput,
+    PR_StandardError,
+}
+
+version(NON_XPCOM_GLUE)
+{
+    PRFileDesc *    PR_GetSpecialFD(int id);
+    PRDescIdentity  PR_GetUniqueIdentity(char *layer_name);
+    char *          PR_GetNameForIdentity(PRDescIdentity ident);
+    PRDescIdentity  PR_GetLayersIdentity(PRFileDesc *fd);
+    PRFileDesc *    PR_GetIdentitiesLayer(PRFileDesc *fd_stack, PRDescIdentity id);
+    PRIOMethods *   PR_GetDefaultIOMethods();
+    PRFileDesc *    PR_CreateIOLayerStub(PRDescIdentity ident, PRIOMethods *methods);
+    PRFileDesc *    PR_CreateIOLayer(PRFileDesc *fd);
+    PRStatus        PR_PushIOLayer(PRFileDesc *fd_stack, PRDescIdentity id, PRFileDesc *layer);
+    PRFileDesc *    PR_PopIOLayer(PRFileDesc *fd_stack, PRDescIdentity id);
+}
+
+const PR_RDONLY = 0x01;
+const PR_WRONLY = 0x02;
+const PR_RDWR = 0x04;
+const PR_CREATE_FILE = 0x08;
+const PR_APPEND = 0x10;
+const PR_TRUNCATE = 0x20;
+const PR_SYNC = 0x40;
+const PR_EXCL = 0x80;
+
+version(NON_XPCOM_GLUE) {
+    PRFileDesc * PR_Open(char *name, PRIntn flags, PRIntn mode);
+}
+
+const PR_IRWXU = 00700;
+const PR_IRUSR = 00400;
+const PR_IWUSR = 00200;
+const PR_IXUSR = 00100;
+const PR_IRWXG = 00070;
+const PR_IRGRP = 00040;
+const PR_IWGRP = 00020;
+const PR_IXGRP = 00010;
+const PR_IRWXO = 00007;
+const PR_IROTH = 00004;
+const PR_IWOTH = 00002;
+const PR_IXOTH = 00001;
+
+version(NON_XPCOM_GLUE)
+{
+    PRFileDesc *    PR_OpenFile(char *name, PRIntn flags, PRIntn mode);
+    PRStatus        PR_Close(PRFileDesc *fd);
+    PRInt32         PR_Read(PRFileDesc *fd, void *buf, PRInt32 amount);
+    PRInt32         PR_Write(PRFileDesc *fd, void *buf, PRInt32 amount);
+}
+
+const PR_MAX_IOVECTOR_SIZE = 16;
+
+version(NON_XPCOM_GLUE)
+{
+    PRInt32     PR_Writev(PRFileDesc *fd, PRIOVec *iov, PRInt32 iov_size, PRIntervalTime timeout);
+    PRStatus    PR_Delete(char *name);
+}
+
+enum PRFileType
+{
+    PR_FILE_FILE = 1,
+    PR_FILE_DIRECTORY,
+    PR_FILE_OTHER,
+}
+
+struct PRFileInfo
+{
+    int type;
+    PROffset32 size;
+    PRTime creationTime;
+    PRTime modifyTime;
+}
+
+struct PRFileInfo64
+{
+    int type;
+    PROffset64 size;
+    PRTime creationTime;
+    PRTime modifyTime;
+}
+
+version (NON_XPCOM_GLUE)
+{
+    PRStatus  PR_GetFileInfo(char *fn, PRFileInfo *info);
+    PRStatus  PR_GetFileInfo64(char *fn, PRFileInfo64 *info);
+    PRStatus  PR_GetOpenFileInfo(PRFileDesc *fd, PRFileInfo *info);
+    PRStatus  PR_GetOpenFileInfo64(PRFileDesc *fd, PRFileInfo64 *info);
+    PRStatus  PR_Rename(char *from, char *to);
+}
+
+enum PRAccessHow
+{
+    PR_ACCESS_EXISTS = 1,
+    PR_ACCESS_WRITE_OK,
+    PR_ACCESS_READ_OK,
+}
+
+version(NON_XPCOM_GLUE)
+{
+    PRStatus    PR_Access(char *name, int how);
+    PROffset32  PR_Seek(PRFileDesc *fd, PROffset32 offset, int whence);
+    PROffset64  PR_Seek64(PRFileDesc *fd, PROffset64 offset, int whence);
+    PRInt32     PR_Available(PRFileDesc *fd);
+    PRInt64     PR_Available64(PRFileDesc *fd);
+    PRStatus    PR_Sync(PRFileDesc *fd);
+}
+
+struct PRDirEntry
+{
+    char *name;
+}
+
+alias void PRDir;
+
+version(NON_XPCOM_GLUE) {
+    PRDir * PR_OpenDir(char *name);
+}
+
+enum PRDirFlags
+{
+    PR_SKIP_NONE,
+    PR_SKIP_DOT,
+    PR_SKIP_DOT_DOT,
+    PR_SKIP_BOTH,
+    PR_SKIP_HIDDEN,
+}
+
+version(NON_XPCOM_GLUE)
+{
+    PRDirEntry *    PR_ReadDir(PRDir *dir, int flags);
+    PRStatus        PR_CloseDir(PRDir *dir);
+    PRStatus        PR_MkDir(char *name, PRIntn mode);
+    PRStatus        PR_MakeDir(char *name, PRIntn mode);
+    PRStatus        PR_RmDir(char *name);
+    PRFileDesc *    PR_NewUDPSocket();
+    PRFileDesc *    PR_NewTCPSocket();
+    PRFileDesc *    PR_OpenUDPSocket(PRIntn af);
+    PRFileDesc *    PR_OpenTCPSocket(PRIntn af);
+    PRStatus        PR_Connect(PRFileDesc *fd, PRNetAddr *addr, PRIntervalTime timeout);
+    PRStatus        PR_ConnectContinue(PRFileDesc *fd, PRInt16 out_flags);
+    PRStatus        PR_GetConnectStatus(PRPollDesc *pd);
+    PRFileDesc *    PR_Accept(PRFileDesc *fd, PRNetAddr *addr, PRIntervalTime timeout);
+    PRStatus        PR_Bind(PRFileDesc *fd, PRNetAddr *addr);
+    PRStatus        PR_Listen(PRFileDesc *fd, PRIntn backlog);
+}
+
+enum PRShutdownHow
+{
+    PR_SHUTDOWN_RCV,
+    PR_SHUTDOWN_SEND,
+    PR_SHUTDOWN_BOTH,
+}
+
+version(NON_XPCOM_GLUE) {
+    PRStatus  PR_Shutdown(PRFileDesc *fd, int how);
+}
+
+const PR_MSG_PEEK = 0x2;
+
+version(NON_XPCOM_GLUE)
+{
+    PRInt32  PR_Recv(PRFileDesc *fd, void *buf, PRInt32 amount, PRIntn flags, PRIntervalTime timeout);
+    PRInt32  PR_Send(PRFileDesc *fd, void *buf, PRInt32 amount, PRIntn flags, PRIntervalTime timeout);
+    PRInt32  PR_RecvFrom(PRFileDesc *fd, void *buf, PRInt32 amount, PRIntn flags, PRNetAddr *addr, PRIntervalTime timeout);
+    PRInt32  PR_SendTo(PRFileDesc *fd, void *buf, PRInt32 amount, PRIntn flags, PRNetAddr *addr, PRIntervalTime timeout);
+    PRInt32  PR_TransmitFile(PRFileDesc *networkSocket, PRFileDesc *sourceFile, void *headers, PRInt32 hlen, int flags, PRIntervalTime timeout);
+}
+
+struct PRSendFileData
+{
+    PRFileDesc *fd;
+    PRUint32 file_offset;
+    PRSize file_nbytes;
+    void *header;
+    PRInt32 hlen;
+    void *trailer;
+    PRInt32 tlen;
+}
+
+version(NON_XPCOM_GLUE)
+{
+    PRInt32   PR_SendFile(PRFileDesc *networkSocket, PRSendFileData *sendData, int flags, PRIntervalTime timeout);
+    PRInt32   PR_AcceptRead(PRFileDesc *listenSock, PRFileDesc **acceptedSock, PRNetAddr **peerAddr, void *buf, PRInt32 amount, PRIntervalTime timeout);
+    PRStatus  PR_NewTCPSocketPair(PRFileDesc **fds);
+    PRStatus  PR_GetSockName(PRFileDesc *fd, PRNetAddr *addr);
+    PRStatus  PR_GetPeerName(PRFileDesc *fd, PRNetAddr *addr);
+    PRStatus  PR_GetSocketOption(PRFileDesc *fd, PRSocketOptionData *data);
+    PRStatus  PR_SetSocketOption(PRFileDesc *fd, PRSocketOptionData *data);
+    PRStatus  PR_SetFDInheritable(PRFileDesc *fd, PRBool inheritable);
+    PRFileDesc * PR_GetInheritedFD(char *name);
+}
+
+enum PRFileMapProtect
+{
+    PR_PROT_READONLY,
+    PR_PROT_READWRITE,
+    PR_PROT_WRITECOPY,
+}
+
+alias void PRFileMap;
+
+version(NON_XPCOM_GLUE)
+{
+    PRFileMap * PR_CreateFileMap(PRFileDesc *fd, PRInt64 size, int prot);
+    PRInt32     PR_GetMemMapAlignment();
+    void *      PR_MemMap(PRFileMap *fmap, PROffset64 offset, PRUint32 len);
+    PRStatus    PR_MemUnmap(void *addr, PRUint32 len);
+    PRStatus    PR_CloseFileMap(PRFileMap *fmap);
+    PRStatus    PR_CreatePipe(PRFileDesc **readPipe, PRFileDesc **writePipe);
+}
+
+struct PRPollDesc
+{
+    PRFileDesc *fd;
+    PRInt16 in_flags;
+    PRInt16 out_flags;
+}
+
+const PR_POLL_READ = 0x1;
+const PR_POLL_WRITE = 0x2;
+const PR_POLL_EXCEPT = 0x4;
+const PR_POLL_ERR = 0x8;
+const PR_POLL_NVAL = 0x10;
+const PR_POLL_HUP = 0x20;
+
+version(NON_XPCOM_GLUE)
+{
+    PRInt32  PR_Poll(PRPollDesc *pds, PRIntn npds, PRIntervalTime timeout);
+    PRFileDesc * PR_NewPollableEvent();
+    PRStatus  PR_DestroyPollableEvent(PRFileDesc *event);
+    PRStatus  PR_SetPollableEvent(PRFileDesc *event);
+    PRStatus  PR_WaitForPollableEvent(PRFileDesc *event);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/prlink.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,136 @@
+module org.eclipse.swt.internal.mozilla.prlink;
+
+import java.lang.all;
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is the Netscape Portable Runtime (NSPR).
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998-2000
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+import org.eclipse.swt.internal.mozilla.Common;
+
+struct PRStaticLinkTable
+{
+    char *name;
+    void  function()fp;
+}
+
+extern (System):
+
+PRStatus  PR_SetLibraryPath(char *path);
+
+char *  PR_GetLibraryPath();
+char *  PR_GetLibraryName(char *dir, char *lib);
+void    PR_FreeLibraryName(char *mem);
+
+alias void PRLibrary;
+
+PRLibrary * PR_LoadLibrary(char *name);
+
+enum PRLibSpecType
+{
+    PR_LibSpec_Pathname,
+    PR_LibSpec_MacNamedFragment,
+    PR_LibSpec_MacIndexedFragment,
+}
+
+alias void FSSpec;
+
+struct _N3
+{
+    FSSpec *fsspec;
+    char *name;
+}
+
+struct _N4
+{
+    FSSpec *fsspec;
+    PRUint32 index;
+}
+
+union _N2
+{
+    char *pathname;
+    struct _N3
+    {
+        FSSpec *fsspec;
+        char *name;
+    }
+    _N3 mac_named_fragment;
+    struct _N4
+    {
+        FSSpec *fsspec;
+        PRUint32 index;
+    }
+    _N4 mac_indexed_fragment;
+}
+
+struct PRLibSpec
+{
+    int type;
+    union _N2
+    {
+        char *pathname;
+        struct _N3
+        {
+            FSSpec *fsspec;
+            char *name;
+        }
+        _N3 mac_named_fragment;
+        struct _N4
+        {
+            FSSpec *fsspec;
+            PRUint32 index;
+        }
+        _N4 mac_indexed_fragment;
+    }
+    _N2 value;
+}
+
+const PR_LD_LAZY = 0x1;
+const PR_LD_NOW = 0x2;
+const PR_LD_GLOBAL = 0x4;
+const PR_LD_LOCAL = 0x8;
+
+PRLibrary * PR_LoadLibraryWithFlags(PRLibSpec libSpec, PRIntn flags);
+PRStatus    PR_UnloadLibrary(PRLibrary *lib);
+void *      PR_FindSymbol(PRLibrary *lib, char *name);
+
+alias void  function()PRFuncPtr;
+
+PRFuncPtr   PR_FindFunctionSymbol(PRLibrary *lib, char *name);
+void *      PR_FindSymbolAndLibrary(char *name, PRLibrary **lib);
+PRFuncPtr   PR_FindFunctionSymbolAndLibrary(char *name, PRLibrary **lib);
+PRLibrary * PR_LoadStaticLibrary(char *name, PRStaticLinkTable *table);
+char *      PR_GetLibraryFilePathname(char *name, PRFuncPtr addr);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/mozilla/prtime.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,89 @@
+module org.eclipse.swt.internal.mozilla.prtime;
+
+import java.lang.all;
+
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is the Netscape Portable Runtime (NSPR).
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998-2000
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+import org.eclipse.swt.internal.mozilla.Common;
+
+const PR_MSEC_PER_SEC = 1000U;
+const PR_USEC_PER_SEC = 1000000U;
+const PR_NSEC_PER_SEC = 1000000000U;
+const PR_USEC_PER_MSEC = 1000U;
+const PR_NSEC_PER_MSEC = 1000000U;
+
+extern (System):
+
+alias PRInt64 PRTime;
+
+struct PRTimeParameters
+{
+    PRInt32 tp_gmt_offset;
+    PRInt32 tp_dst_offset;
+}
+
+struct PRExplodedTime
+{
+    PRInt32 tm_usec;
+    PRInt32 tm_sec;
+    PRInt32 tm_min;
+    PRInt32 tm_hour;
+    PRInt32 tm_mday;
+    PRInt32 tm_month;
+    PRInt16 tm_year;
+    PRInt8 tm_wday;
+    PRInt16 tm_yday;
+    PRTimeParameters tm_params;
+}
+
+alias PRTimeParameters  function(PRExplodedTime *gmt)PRTimeParamFn;
+
+version(NON_XPCOM_GLUE)
+{
+    PRTime  PR_Now();
+    void    PR_ExplodeTime(PRTime usecs, PRTimeParamFn params, PRExplodedTime *exploded);
+    PRTime  PR_ImplodeTime(PRExplodedTime *exploded);
+    void    PR_NormalizeTime(PRExplodedTime *exploded, PRTimeParamFn params);
+
+    PRTimeParameters  PR_LocalTimeParameters(PRExplodedTime *gmt);
+    PRTimeParameters  PR_GMTParameters(PRExplodedTime *gmt);
+    PRTimeParameters  PR_USPacificTimeParameters(PRExplodedTime *gmt);
+
+    PRStatus  PR_ParseTimeString(char *string, PRBool default_to_gmt, PRTime *result);
+    PRUint32  PR_FormatTime(char *buf, int buflen, char *fmt, PRExplodedTime *tm);
+    PRUint32  PR_FormatTimeUSEnglish(char *buf, PRUint32 bufSize, char *format, PRExplodedTime *tm);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/opengl/glx/GLX.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,361 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D Programming Language:
+ *     John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+module org.eclipse.swt.internal.opengl.glx.GLX;
+
+import java.lang.all;
+
+import org.eclipse.swt.internal.Library;
+import org.eclipse.swt.internal.Platform;
+import org.eclipse.swt.internal.c.Xutil;
+import org.eclipse.swt.internal.c.glx;
+
+public class GLX : Platform {
+
+    /*
+    ** Visual Config Attributes (glXGetConfig, glXGetFBConfigAttrib)
+    */
+
+    enum {
+        GLX_USE_GL              = 1,    /* support GLX rendering */
+        GLX_BUFFER_SIZE         = 2,    /* depth of the color buffer */
+        GLX_LEVEL               = 3,    /* level in plane stacking */
+        GLX_RGBA                = 4,    /* true if RGBA mode */
+        GLX_DOUBLEBUFFER        = 5,    /* double buffering supported */
+        GLX_STEREO              = 6,    /* stereo buffering supported */
+        GLX_AUX_BUFFERS         = 7,    /* number of aux buffers */
+        GLX_RED_SIZE            = 8,    /* number of red component bits */
+        GLX_GREEN_SIZE          = 9,    /* number of green component bits */
+        GLX_BLUE_SIZE           = 10,   /* number of blue component bits */
+        GLX_ALPHA_SIZE          = 11,   /* number of alpha component bits */
+        GLX_DEPTH_SIZE          = 12,   /* number of depth bits */
+        GLX_STENCIL_SIZE        = 13,   /* number of stencil bits */
+        GLX_ACCUM_RED_SIZE      = 14,   /* number of red accum bits */
+        GLX_ACCUM_GREEN_SIZE    = 15,   /* number of green accum bits */
+        GLX_ACCUM_BLUE_SIZE     = 16,   /* number of blue accum bits */
+        GLX_ACCUM_ALPHA_SIZE    = 17,   /* number of alpha accum bits */
+    /*
+    ** FBConfig-specific attributes
+    */
+        GLX_X_VISUAL_TYPE       = 0x22,
+        GLX_CONFIG_CAVEAT       = 0x20, /* Like visual_info VISUAL_CAVEAT_EXT */
+        GLX_TRANSPARENT_TYPE    = 0x23,
+        GLX_TRANSPARENT_INDEX_VALUE = 0x24,
+        GLX_TRANSPARENT_RED_VALUE   = 0x25,
+        GLX_TRANSPARENT_GREEN_VALUE = 0x26,
+        GLX_TRANSPARENT_BLUE_VALUE  = 0x27,
+        GLX_TRANSPARENT_ALPHA_VALUE = 0x28,
+        GLX_DRAWABLE_TYPE       = 0x8010,
+        GLX_RENDER_TYPE         = 0x8011,
+        GLX_X_RENDERABLE        = 0x8012,
+        GLX_FBCONFIG_ID         = 0x8013,
+        GLX_MAX_PBUFFER_WIDTH   = 0x8016,
+        GLX_MAX_PBUFFER_HEIGHT  = 0x8017,
+        GLX_MAX_PBUFFER_PIXELS  = 0x8018,
+        GLX_VISUAL_ID           = 0x800B,
+    
+    /*
+    ** Error return values from glXGetConfig.  Success is indicated by
+    ** a value of 0.
+    */
+        GLX_BAD_SCREEN      = 1,    /* screen # is bad */
+        GLX_BAD_ATTRIBUTE   = 2,    /* attribute to get is bad */
+        GLX_NO_EXTENSION    = 3,    /* no glx extension on server */
+        GLX_BAD_VISUAL      = 4,    /* visual # not known by GLX */
+        GLX_BAD_CONTEXT     = 5,    /* returned only by import_context EXT? */
+        GLX_BAD_VALUE       = 6,    /* returned only by glXSwapIntervalSGI? */
+        GLX_BAD_ENUM        = 7,    /* unused? */
+    
+    /* FBConfig attribute values */
+    
+    /*
+    ** Generic "don't care" value for glX ChooseFBConfig attributes (except
+    ** GLX_LEVEL)
+    */
+        GLX_DONT_CARE           = 0xFFFFFFFF,
+    
+    /* GLX_RENDER_TYPE bits */
+        GLX_RGBA_BIT            = 0x00000001,
+        GLX_COLOR_INDEX_BIT     = 0x00000002,
+    
+    /* GLX_DRAWABLE_TYPE bits */
+        GLX_WINDOW_BIT          = 0x00000001,
+        GLX_PIXMAP_BIT          = 0x00000002,
+        GLX_PBUFFER_BIT         = 0x00000004,
+    
+    /* GLX_CONFIG_CAVEAT attribute values */
+        GLX_NONE                = 0x8000,
+        GLX_SLOW_CONFIG         = 0x8001,
+        GLX_NON_CONFORMANT_CONFIG   = 0x800D,
+    
+    /* GLX_X_VISUAL_TYPE attribute values */
+        GLX_TRUE_COLOR          = 0x8002,
+        GLX_DIRECT_COLOR        = 0x8003,
+        GLX_PSEUDO_COLOR        = 0x8004,
+        GLX_STATIC_COLOR        = 0x8005,
+        GLX_GRAY_SCALE          = 0x8006,
+        GLX_STATIC_GRAY         = 0x8007,
+    
+    /* GLX_TRANSPARENT_TYPE attribute values */
+    /*     GLX_NONE            0x8000 */
+        GLX_TRANSPARENT_RGB     = 0x8008,
+        GLX_TRANSPARENT_INDEX   = 0x8009,
+    
+    /* glXCreateGLXPbuffer attributes */
+        GLX_PRESERVED_CONTENTS  = 0x801B,
+        GLX_LARGEST_PBUFFER     = 0x801C,
+        GLX_PBUFFER_HEIGHT      = 0x8040,   /* New for GLX 1.3 */
+        GLX_PBUFFER_WIDTH       = 0x8041,   /* New for GLX 1.3 */
+    
+    /* glXQueryGLXPBuffer attributes */
+        GLX_WIDTH       = 0x801D,
+        GLX_HEIGHT      = 0x801E,
+        GLX_EVENT_MASK  = 0x801F,
+    
+    /* glXCreateNewContext render_type attribute values */
+        GLX_RGBA_TYPE           = 0x8014,
+        GLX_COLOR_INDEX_TYPE    = 0x8015,
+    
+    /* glXQueryContext attributes */
+    /*     GLX_FBCONFIG_ID        0x8013 */
+    /*     GLX_RENDER_TYPE        0x8011 */
+        GLX_SCREEN          = 0x800C,
+    
+    /* glXSelectEvent event mask bits */
+        GLX_PBUFFER_CLOBBER_MASK    = 0x08000000,
+    
+    /* GLXPbufferClobberEvent event_type values */
+        GLX_DAMAGED         = 0x8020,
+        GLX_SAVED           = 0x8021,
+    
+    /* GLXPbufferClobberEvent draw_type values */
+        GLX_WINDOW          = 0x8022,
+        GLX_PBUFFER         = 0x8023,
+    
+    /* GLXPbufferClobberEvent buffer_mask bits */
+        GLX_FRONT_LEFT_BUFFER_BIT   = 0x00000001,
+        GLX_FRONT_RIGHT_BUFFER_BIT  = 0x00000002,
+        GLX_BACK_LEFT_BUFFER_BIT    = 0x00000004,
+        GLX_BACK_RIGHT_BUFFER_BIT   = 0x00000008,
+        GLX_AUX_BUFFERS_BIT     = 0x00000010,
+        GLX_DEPTH_BUFFER_BIT        = 0x00000020,
+        GLX_STENCIL_BUFFER_BIT      = 0x00000040,
+        GLX_ACCUM_BUFFER_BIT        = 0x00000080,
+    
+    /*
+    ** Extension return values from glXGetConfig.  These are also
+    ** accepted as parameter values for glXChooseVisual.
+    */
+    
+        GLX_X_VISUAL_TYPE_EXT = 0x22,   /* visual_info extension type */
+        GLX_TRANSPARENT_TYPE_EXT = 0x23,    /* visual_info extension */
+        GLX_TRANSPARENT_INDEX_VALUE_EXT = 0x24, /* visual_info extension */
+        GLX_TRANSPARENT_RED_VALUE_EXT   = 0x25, /* visual_info extension */
+        GLX_TRANSPARENT_GREEN_VALUE_EXT = 0x26, /* visual_info extension */
+        GLX_TRANSPARENT_BLUE_VALUE_EXT  = 0x27, /* visual_info extension */
+        GLX_TRANSPARENT_ALPHA_VALUE_EXT = 0x28, /* visual_info extension */
+    
+    /* Property values for visual_type */
+        GLX_TRUE_COLOR_EXT  = 0x8002,
+        GLX_DIRECT_COLOR_EXT    = 0x8003,
+        GLX_PSEUDO_COLOR_EXT    = 0x8004,
+        GLX_STATIC_COLOR_EXT    = 0x8005,
+        GLX_GRAY_SCALE_EXT  = 0x8006,
+        GLX_STATIC_GRAY_EXT = 0x8007,
+    
+    /* Property values for transparent pixel */
+        GLX_NONE_EXT        = 0x8000,
+        GLX_TRANSPARENT_RGB_EXT     = 0x8008,
+        GLX_TRANSPARENT_INDEX_EXT   = 0x8009,
+    
+    /* Property values for visual_rating */
+        GLX_VISUAL_CAVEAT_EXT       = 0x20,  /* visual_rating extension type */
+        GLX_SLOW_VISUAL_EXT     = 0x8001,
+        GLX_NON_CONFORMANT_VISUAL_EXT   = 0x800D,
+    
+    /*
+    ** Names for attributes to glXGetClientString.
+    */
+        GLX_VENDOR      = 0x1,
+        GLX_VERSION     = 0x2,
+        GLX_EXTENSIONS  = 0x3,
+    
+    /*
+    ** Names for attributes to glXQueryContextInfoEXT.
+    */
+        GLX_SHARE_CONTEXT_EXT = 0x800A, /* id of share context */
+        GLX_VISUAL_ID_EXT = 0x800B, /* id of context's visual */
+        GLX_SCREEN_EXT = 0x800C,    /* screen number */
+    
+    /*
+    * GLX 1.4 
+    */
+        GLX_SAMPLE_BUFFERS = 100000,
+        GLX_SAMPLES = 100001,
+
+    /*
+    * GL bits 
+    */
+        GL_VIEWPORT = 0x0BA2
+    }
+
+    static this() {
+        org.eclipse.swt.internal.c.glx.loadLib();
+    }
+    
+    static void glGetIntegerv( uint pname, int[] params ) 
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return dwt_glGetIntegerv (pname, params.ptr );
+    }
+
+    static void glViewport( int x, int y, int width, int height ) 
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return dwt_glViewport( x, y, width, height );
+    }
+
+    static XVisualInfo* glXChooseVisual( void* dpy, int screen, int* attribList ) 
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return dwt_glXChooseVisual( dpy, screen, attribList );
+    }
+
+    static void glXCopyContext( void* dpy, void* src, void* dst, uint mask ) 
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        dwt_glXCopyContext(dpy, src, dst, mask);
+    }
+
+    static void* glXCreateContext( void* dpy, XVisualInfo* vis, void* shareList, int direct ) 
+    {
+        lock.lock();
+        scope(exit) lock.unlock();        
+        return dwt_glXCreateContext(dpy, vis, shareList, direct);
+    }
+
+    final uint glXCreateGLXPixmap( void* dpy, XVisualInfo* vis , uint pixmap ) 
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return dwt_glXCreateGLXPixmap(dpy, vis, pixmap);
+    }
+
+    static void glXDestroyContext( void* dpy, void* ctx ) 
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        dwt_glXDestroyContext(dpy, ctx);
+    }
+
+    static void glXDestroyGLXPixmap( void* dpy, uint pix ) 
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        dwt_glXDestroyGLXPixmap(dpy, pix);
+    }
+
+    static char* glXGetClientString( void* dpy, int name ) 
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return dwt_glXGetClientString(dpy, name);
+    }
+
+    static int glXGetConfig( void* dpy, XVisualInfo* vis, int attrib, int[] value ) 
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return dwt_glXGetConfig(dpy, vis, attrib, value.ptr);
+    }
+
+    static void* glXGetCurrentContext() 
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return dwt_glXGetCurrentContext();
+    }
+
+    static uint glXGetCurrentDrawable() 
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return dwt_glXGetCurrentDrawable();
+    }
+
+    static int glXIsDirect( void* dpy, void* ctx ) 
+    {
+        lock.lock();
+        scope(exit) lock.unlock();    
+        return dwt_glXIsDirect(dpy, ctx);
+    }
+
+    static int glXMakeCurrent( void* dpy, uint drawable, void* ctx) 
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return dwt_glXMakeCurrent(dpy, drawable, ctx);
+    }
+
+    static int glXQueryExtension( void* dpy, int[] errorBase, int[] eventBase) 
+    {
+        lock.lock();
+        scope(exit) lock.unlock(); 
+        return dwt_glXQueryExtension(dpy, errorBase.ptr, eventBase.ptr);
+    }
+
+    static char* glXQueryExtensionsString( void* dpy, int screen) 
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return dwt_glXQueryExtensionsString(dpy, screen);
+    }
+
+    static char* glXQueryServerString( void* dpy, int screen, int name ) 
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return dwt_glXQueryServerString(dpy, screen, name);
+    }
+
+    static int glXQueryVersion( void* dpy, int[] major, int[] minor ) 
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        return dwt_glXQueryVersion(dpy, major.ptr, minor.ptr);
+    }
+
+    static void glXSwapBuffers( void* dpy, uint drawable ) 
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        dwt_glXSwapBuffers(dpy, drawable);
+    }
+
+    static void glXWaitGL() 
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        dwt_glXWaitGL();
+    }
+
+    static void glXWaitX() 
+    {
+        lock.lock();
+        scope(exit) lock.unlock();
+        dwt_glXWaitX();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/layout/FillData.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.layout.FillData;
+
+import java.lang.all;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Control;
+
+class FillData {
+
+    int defaultWidth = -1, defaultHeight = -1;
+    int currentWhint, currentHhint, currentWidth = -1, currentHeight = -1;
+
+Point computeSize (Control control, int wHint, int hHint, bool flushCache_) {
+    if (flushCache_) flushCache();
+    if (wHint is SWT.DEFAULT && hHint is SWT.DEFAULT) {
+        if (defaultWidth is -1 || defaultHeight is -1) {
+            Point size = control.computeSize (wHint, hHint, flushCache_);
+            defaultWidth = size.x;
+            defaultHeight = size.y;
+        }
+        return new Point(defaultWidth, defaultHeight);
+    }
+    if (currentWidth is -1 || currentHeight is -1 || wHint !is currentWhint || hHint !is currentHhint) {
+        Point size = control.computeSize (wHint, hHint, flushCache_);
+        currentWhint = wHint;
+        currentHhint = hHint;
+        currentWidth = size.x;
+        currentHeight = size.y;
+    }
+    return new Point(currentWidth, currentHeight);
+}
+void flushCache () {
+    defaultWidth = defaultHeight = -1;
+    currentWidth = currentHeight = -1;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/layout/FillLayout.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,248 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.layout.FillLayout;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Layout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Scrollable;
+import org.eclipse.swt.layout.FillData;
+
+import tango.util.Convert;
+import java.lang.all;
+
+/**
+ * <code>FillLayout</code> is the simplest layout class. It lays out
+ * controls in a single row or column, forcing them to be the same size.
+ * <p>
+ * Initially, the controls will all be as tall as the tallest control,
+ * and as wide as the widest. <code>FillLayout</code> does not wrap,
+ * but you can specify margins and spacing. You might use it to
+ * lay out buttons in a task bar or tool bar, or to stack checkboxes
+ * in a <code>Group</code>. <code>FillLayout</code> can also be used
+ * when a <code>Composite</code> only has one child. For example,
+ * if a <code>Shell</code> has a single <code>Group</code> child,
+ * <code>FillLayout</code> will cause the <code>Group</code> to
+ * completely fill the <code>Shell</code> (if margins are 0).
+ * </p>
+ * <p>
+ * Example code: first a <code>FillLayout</code> is created and
+ * its type field is set, and then the layout is set into the
+ * <code>Composite</code>. Note that in a <code>FillLayout</code>,
+ * children are always the same size, and they fill all available space.
+ * <pre>
+ *      FillLayout fillLayout = new FillLayout();
+ *      fillLayout.type = SWT.VERTICAL;
+ *      shell.setLayout(fillLayout);
+ * </pre>
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: LayoutExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public final class FillLayout : Layout {
+    /**
+     * type specifies how controls will be positioned
+     * within the layout.
+     *
+     * The default value is HORIZONTAL.
+     *
+     * Possible values are: <ul>
+     *    <li>HORIZONTAL: Position the controls horizontally from left to right</li>
+     *    <li>VERTICAL: Position the controls vertically from top to bottom</li>
+     * </ul>
+     */
+    public int type = SWT.HORIZONTAL;
+
+    /**
+     * marginWidth specifies the number of pixels of horizontal margin
+     * that will be placed along the left and right edges of the layout.
+     *
+     * The default value is 0.
+     *
+     * @since 3.0
+     */
+    public int marginWidth = 0;
+
+    /**
+     * marginHeight specifies the number of pixels of vertical margin
+     * that will be placed along the top and bottom edges of the layout.
+     *
+     * The default value is 0.
+     *
+     * @since 3.0
+     */
+    public int marginHeight = 0;
+
+    /**
+     * spacing specifies the number of pixels between the edge of one cell
+     * and the edge of its neighbouring cell.
+     *
+     * The default value is 0.
+     *
+     * @since 3.0
+     */
+    public int spacing = 0;
+
+/**
+ * Constructs a new instance of this class.
+ */
+public this () {
+}
+
+/**
+ * Constructs a new instance of this class given the type.
+ *
+ * @param type the type of fill layout
+ *
+ * @since 2.0
+ */
+public this (int type) {
+    this.type = type;
+}
+
+override protected Point computeSize (Composite composite, int wHint, int hHint, bool flushCache) {
+    Control [] children = composite.getChildren ();
+    int count = children.length;
+    int maxWidth = 0, maxHeight = 0;
+    for (int i=0; i<count; i++) {
+        Control child = children [i];
+        int w = wHint, h = hHint;
+        if (count > 0) {
+            if (type is SWT.HORIZONTAL && wHint !is SWT.DEFAULT) {
+                w = Math.max (0, (wHint - (count - 1) * spacing) / count);
+            }
+            if (type is SWT.VERTICAL && hHint !is SWT.DEFAULT) {
+                h = Math.max (0, (hHint - (count - 1) * spacing) / count);
+            }
+        }
+        Point size = computeChildSize (child, w, h, flushCache);
+        maxWidth = Math.max (maxWidth, size.x);
+        maxHeight = Math.max (maxHeight, size.y);
+    }
+    int width = 0, height = 0;
+    if (type is SWT.HORIZONTAL) {
+        width = count * maxWidth;
+        if (count !is 0) width += (count - 1) * spacing;
+        height = maxHeight;
+    } else {
+        width = maxWidth;
+        height = count * maxHeight;
+        if (count !is 0) height += (count - 1) * spacing;
+    }
+    width += marginWidth * 2;
+    height += marginHeight * 2;
+    if (wHint !is SWT.DEFAULT) width = wHint;
+    if (hHint !is SWT.DEFAULT) height = hHint;
+    return new Point (width, height);
+}
+
+Point computeChildSize (Control control, int wHint, int hHint, bool flushCache) {
+    FillData data = cast(FillData)control.getLayoutData ();
+    if (data is null) {
+        data = new FillData ();
+        control.setLayoutData (data);
+    }
+    Point size = null;
+    if (wHint is SWT.DEFAULT && hHint is SWT.DEFAULT) {
+        size = data.computeSize (control, wHint, hHint, flushCache);
+    } else {
+        // TEMPORARY CODE
+        int trimX, trimY;
+        if ( auto sa = cast(Scrollable)control ) {
+            Rectangle rect = sa.computeTrim (0, 0, 0, 0);
+            trimX = rect.width;
+            trimY = rect.height;
+        } else {
+            trimX = trimY = control.getBorderWidth () * 2;
+        }
+        int w = wHint is SWT.DEFAULT ? wHint : Math.max (0, wHint - trimX);
+        int h = hHint is SWT.DEFAULT ? hHint : Math.max (0, hHint - trimY);
+        size = data.computeSize (control, w, h, flushCache);
+    }
+    return size;
+}
+
+override protected bool flushCache (Control control) {
+    Object data = control.getLayoutData();
+    if (data !is null) (cast(FillData)data).flushCache();
+    return true;
+}
+
+String getName () {
+    String string = this.classinfo.name;
+    int index = string.lastIndexOf( '.');
+    if (index is -1 ) return string;
+    return string[ index + 1 .. string.length ];
+}
+
+override protected void layout (Composite composite, bool flushCache) {
+    Rectangle rect = composite.getClientArea ();
+    Control [] children = composite.getChildren ();
+    int count = children.length;
+    if (count is 0) return;
+    int width = rect.width - marginWidth * 2;
+    int height = rect.height - marginHeight * 2;
+    if (type is SWT.HORIZONTAL) {
+        width -= (count - 1) * spacing;
+        int x = rect.x + marginWidth, extra = width % count;
+        int y = rect.y + marginHeight, cellWidth = width / count;
+        for (int i=0; i<count; i++) {
+            Control child = children [i];
+            int childWidth = cellWidth;
+            if (i is 0) {
+                childWidth += extra / 2;
+            } else {
+                if (i is count - 1) childWidth += (extra + 1) / 2;
+            }
+            child.setBounds (x, y, childWidth, height);
+            x += childWidth + spacing;
+        }
+    } else {
+        height -= (count - 1) * spacing;
+        int x = rect.x + marginWidth, cellHeight = height / count;
+        int y = rect.y + marginHeight, extra = height % count;
+        for (int i=0; i<count; i++) {
+            Control child = children [i];
+            int childHeight = cellHeight;
+            if (i is 0) {
+                childHeight += extra / 2;
+            } else {
+                if (i is count - 1) childHeight += (extra + 1) / 2;
+            }
+            child.setBounds (x, y, width, childHeight);
+            y += childHeight + spacing;
+        }
+    }
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the layout
+ */
+override public String toString () {
+    String string = getName () ~ " {";
+    string ~= "type="~((type is SWT.VERTICAL) ? "SWT.VERTICAL" : "SWT.HORIZONTAL")~" ";
+    if (marginWidth !is 0) string ~= "marginWidth="~to!(String)(marginWidth)~" ";
+    if (marginHeight !is 0) string ~= "marginHeight="~to!(String)(marginHeight)~" ";
+    if (spacing !is 0) string ~= "spacing="~to!(String)(spacing)~" ";
+    string = string.trim();
+    string ~= "}";
+    return string;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/layout/FormAttachment.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,323 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.layout.FormAttachment;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.layout.FormData;
+
+import tango.text.convert.Format;
+import java.lang.all;
+
+/**
+ * Instances of this class are used to define the edges of a control
+ * within a <code>FormLayout</code>.
+ * <p>
+ * <code>FormAttachments</code> are set into the top, bottom, left,
+ * and right fields of the <code>FormData</code> for a control.
+ * For example:
+ * <pre>
+ *      FormData data = new FormData();
+ *      data.top = new FormAttachment(0,5);
+ *      data.bottom = new FormAttachment(100,-5);
+ *      data.left = new FormAttachment(0,5);
+ *      data.right = new FormAttachment(100,-5);
+ *      button.setLayoutData(data);
+ * </pre>
+ * </p>
+ * <p>
+ * A <code>FormAttachment</code> defines where to attach the side of
+ * a control by using the equation, y = ax + b. The "a" term represents
+ * a fraction of the parent composite's width (from the left) or height
+ * (from the top). It can be defined using a numerator and denominator,
+ * or just a percentage value. If a percentage is used, the denominator
+ * is set to 100. The "b" term in the equation represents an offset, in
+ * pixels, from the attachment position. For example:
+ * <pre>
+ *      FormAttachment attach = new FormAttachment (20, -5);
+ * </pre>
+ * specifies that the side to which the <code>FormAttachment</code>
+ * object belongs will lie at 20% of the parent composite, minus 5 pixels.
+ * </p>
+ * <p>
+ * Control sides can also be attached to another control.
+ * For example:
+ * <pre>
+ *      FormAttachment attach = new FormAttachment (button, 10);
+ * </pre>
+ * specifies that the side to which the <code>FormAttachment</code>
+ * object belongs will lie in the same position as the adjacent side of
+ * the <code>button</code> control, plus 10 pixels. The control side can
+ * also be attached to the opposite side of the specified control.
+ * For example:
+ * <pre>
+ *      FormData data = new FormData ();
+ *      data.left = new FormAttachment (button, 0, SWT.LEFT);
+ * </pre>
+ * specifies that the left side of the control will lie in the same position
+ * as the left side of the <code>button</code> control. The control can also
+ * be attached in a position that will center the control on the specified
+ * control. For example:
+ * <pre>
+ *      data.left = new FormAttachment (button, 0, SWT.CENTER);
+ * </pre>
+ * specifies that the left side of the control will be positioned so that it is
+ * centered between the left and right sides of the <code>button</code> control.
+ * If the alignment is not specified, the default is to attach to the adjacent side.
+ * </p>
+ *
+ * @see FormLayout
+ * @see FormData
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 2.0
+ */
+public final class FormAttachment {
+    /**
+     * numerator specifies the numerator of the "a" term in the
+     * equation, y = ax + b, which defines the attachment.
+     */
+    public int numerator;
+
+    /**
+     * denominator specifies the denominator of the "a" term in the
+     * equation, y = ax + b, which defines the attachment.
+     *
+     * The default value is 100.
+     */
+    public int denominator = 100;
+
+    /**
+     * offset specifies the offset, in pixels, of the control side
+     * from the attachment position.
+     * If the offset is positive, then the control side is offset
+     * to the right of or below the attachment position. If it is
+     * negative, then the control side is offset to the left of or
+     * above the attachment position.
+     *
+     * This is equivalent to the "b" term in the equation y = ax + b.
+     * The default value is 0.
+     */
+    public int offset;
+
+    /**
+     * control specifies the control to which the control side is
+     * attached.
+     */
+    public Control control;
+
+    /**
+     * alignment specifies the alignment of the control side that is
+     * attached to a control.
+     * <p>
+     * For top and bottom attachments, TOP, BOTTOM and CENTER are used. For left
+     * and right attachments, LEFT, RIGHT and CENTER are used. If any other case
+     * occurs, the default will be used instead.
+     * </p>
+     *
+     * <br>Possible values are: <ul>
+     *    <li>{@link SWT#TOP}: Attach the side to the top side of the specified control.</li>
+     *    <li>{@link SWT#BOTTOM}: Attach the side to the bottom side of the specified control.</li>
+     *    <li>{@link SWT#LEFT}: Attach the side to the left side of the specified control.</li>
+     *    <li>{@link SWT#RIGHT}: Attach the side to the right side of the specified control.</li>
+     *    <li>{@link SWT#CENTER}: Attach the side at a position which will center the control on the specified control.</li>
+     *    <li>{@link SWT#DEFAULT}: Attach the side to the adjacent side of the specified control.</li>
+     * </ul>
+     */
+    public int alignment;
+
+/**
+ * Constructs a new instance of this class.
+ * Since no numerator, denominator or offset is specified,
+ * the attachment is treated as a percentage of the form.
+ * The numerator is zero, the denominator is 100 and the
+ * offset is zero.
+ *
+ * @since 3.2
+ */
+public this () {
+}
+
+/**
+ * Constructs a new instance of this class given a numerator
+ * Since no denominator or offset is specified, the default
+ * is to treat the numerator as a percentage of the form, with a
+ * denominator of 100. The offset is zero.
+ *
+ * @param numerator the percentage of the position
+ *
+ * @since 3.0
+ */
+public this (int numerator) {
+    this (numerator, 100, 0);
+}
+
+/**
+ * Constructs a new instance of this class given a numerator
+ * and an offset. Since no denominator is specified, the default
+ * is to treat the numerator as a percentage of the form, with a
+ * denominator of 100.
+ *
+ * @param numerator the percentage of the position
+ * @param offset the offset of the side from the position
+ */
+public this (int numerator, int offset) {
+    this (numerator, 100, offset);
+}
+
+/**
+ * Constructs a new instance of this class given a numerator
+ * and denominator and an offset. The position of the side is
+ * given by the fraction of the form defined by the numerator
+ * and denominator.
+ *
+ * @param numerator the numerator of the position
+ * @param denominator the denominator of the position
+ * @param offset the offset of the side from the position
+ */
+public this (int numerator, int denominator, int offset) {
+    if (denominator is 0) SWT.error (SWT.ERROR_CANNOT_BE_ZERO);
+    this.numerator = numerator;
+    this.denominator = denominator;
+    this.offset = offset;
+}
+
+/**
+ * Constructs a new instance of this class given a control.
+ * Since no alignment is specified, the default alignment is
+ * to attach the side to the adjacent side of the specified
+ * control. Since no offset is specified, an offset of 0 is
+ * used.
+ *
+ * @param control the control the side is attached to
+ */
+public this (Control control) {
+    this (control, 0, SWT.DEFAULT);
+}
+
+/**
+ * Constructs a new instance of this class given a control
+ * and an offset. Since no alignment is specified, the default
+ * alignment is to attach the side to the adjacent side of the
+ * specified control.
+ *
+ * @param control the control the side is attached to
+ * @param offset the offset of the side from the control
+ */
+public this (Control control, int offset) {
+    this (control, offset, SWT.DEFAULT);
+}
+
+/**
+ * Constructs a new instance of this class given a control,
+ * an offset and an alignment.  The possible alignment values are:
+ * <dl>
+ * <dt><b>{@link SWT#TOP}</b></dt>
+ * <dd>the side will be attached to the top side of the specified control</dd>
+ * <dt><b>{@link SWT#BOTTOM}</b></dt>
+ * <dd>the side will be attached to the bottom side of the specified control</dd>
+ * <dt><b>{@link SWT#LEFT}</b></dt>
+ * <dd>the side will be attached to the left side of the specified control</dd>
+ * <dt><b>{@link SWT#RIGHT}</b></dt>
+ * <dd>the side will be attached to the right side of the specified control</dd>
+ * <dt><b>{@link SWT#CENTER}</b></dt>
+ * <dd>the side will be centered on the same side of the specified control</dd>
+ * <dt><b>{@link SWT#DEFAULT}</b></dt>
+ * <dd>the side will be attached to the adjacent side of the specified control</dd>
+ * </dl>
+ *
+ * @param control the control the side is attached to
+ * @param offset the offset of the side from the control
+ * @param alignment the alignment of the side to the control it is attached to,
+ *      one of TOP, BOTTOM, LEFT, RIGHT, CENTER, or DEFAULT
+ */
+public this (Control control, int offset, int alignment) {
+    this.control = control;
+    this.offset = offset;
+    this.alignment = alignment;
+}
+
+FormAttachment divide (int value) {
+    return new FormAttachment (numerator, denominator * value, offset / value);
+}
+
+int gcd (int m, int n) {
+    int temp;
+    m = Math.abs (m);
+    n = Math.abs (n);
+    if (m < n) {
+        temp = m;
+        m = n;
+        n = temp;
+    }
+    while (n !is 0){
+        temp = m;
+        m = n;
+        n = temp % n;
+    }
+    return m;
+}
+
+FormAttachment minus (FormAttachment attachment) {
+    FormAttachment solution = new FormAttachment ();
+    solution.numerator = numerator * attachment.denominator - denominator * attachment.numerator;
+    solution.denominator = denominator * attachment.denominator;
+    int gcd = gcd (solution.denominator, solution.numerator);
+    solution.numerator = solution.numerator / gcd;
+    solution.denominator = solution.denominator / gcd;
+    solution.offset = offset - attachment.offset;
+    return solution;
+}
+
+FormAttachment minus (int value) {
+    return new FormAttachment (numerator, denominator, offset - value);
+}
+
+FormAttachment plus (FormAttachment attachment) {
+    FormAttachment solution = new FormAttachment ();
+    solution.numerator = numerator * attachment.denominator + denominator * attachment.numerator;
+    solution.denominator = denominator * attachment.denominator;
+    int gcd = gcd (solution.denominator, solution.numerator);
+    solution.numerator = solution.numerator / gcd;
+    solution.denominator = solution.denominator / gcd;
+    solution.offset = offset + attachment.offset;
+    return solution;
+}
+
+FormAttachment plus (int value) {
+    return new FormAttachment (numerator, denominator, offset + value);
+}
+
+int solveX (int value) {
+    if (denominator is 0) SWT.error (SWT.ERROR_CANNOT_BE_ZERO);
+    return ((numerator * value) / denominator) + offset;
+}
+
+int solveY (int value) {
+    if (numerator is 0) SWT.error (SWT.ERROR_CANNOT_BE_ZERO);
+    return (value - offset) * denominator / numerator;
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the FormAttachment
+ */
+public override String toString () {
+    String string = control !is null ? control.toString () : Format( "{}/{}", numerator, denominator );
+    return Format("{{y = ({})x + {}}", string, ( offset >= 0 ? Format(")x + {}", offset ) : Format( ")x - {}", -offset)));
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/layout/FormData.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,350 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.layout.FormData;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.layout.FormAttachment;
+
+import tango.util.Convert;
+import java.lang.all;
+
+/**
+ * Instances of this class are used to define the attachments
+ * of a control in a <code>FormLayout</code>.
+ * <p>
+ * To set a <code>FormData</code> object into a control, you use the
+ * <code>setLayoutData ()</code> method. To define attachments for the
+ * <code>FormData</code>, set the fields directly, like this:
+ * <pre>
+ *      FormData data = new FormData();
+ *      data.left = new FormAttachment(0,5);
+ *      data.right = new FormAttachment(100,-5);
+ *      button.setLayoutData(formData);
+ * </pre>
+ * </p>
+ * <p>
+ * <code>FormData</code> contains the <code>FormAttachments</code> for
+ * each edge of the control that the <code>FormLayout</code> uses to
+ * determine the size and position of the control. <code>FormData</code>
+ * objects also allow you to set the width and height of controls within
+ * a <code>FormLayout</code>.
+ * </p>
+ *
+ * @see FormLayout
+ * @see FormAttachment
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 2.0
+ */
+public final class FormData {
+    /**
+     * width specifies the preferred width in pixels. This value
+     * is the wHint passed into Control.computeSize(int, int, bool)
+     * to determine the preferred size of the control.
+     *
+     * The default value is SWT.DEFAULT.
+     *
+     * @see Control#computeSize(int, int, bool)
+     */
+    public int width = SWT.DEFAULT;
+    /**
+     * height specifies the preferred height in pixels. This value
+     * is the hHint passed into Control.computeSize(int, int, bool)
+     * to determine the preferred size of the control.
+     *
+     * The default value is SWT.DEFAULT.
+     *
+     * @see Control#computeSize(int, int, bool)
+     */
+    public int height = SWT.DEFAULT;
+    /**
+     * left specifies the attachment of the left side of
+     * the control.
+     */
+    public FormAttachment left;
+    /**
+     * right specifies the attachment of the right side of
+     * the control.
+     */
+    public FormAttachment right;
+    /**
+     * top specifies the attachment of the top of the control.
+     */
+    public FormAttachment top;
+    /**
+     * bottom specifies the attachment of the bottom of the
+     * control.
+     */
+    public FormAttachment bottom;
+
+    int cacheWidth = -1, cacheHeight = -1;
+    int defaultWhint, defaultHhint, defaultWidth = -1, defaultHeight = -1;
+    int currentWhint, currentHhint, currentWidth = -1, currentHeight = -1;
+    FormAttachment cacheLeft, cacheRight, cacheTop, cacheBottom;
+    bool isVisited, needed;
+
+/**
+ * Constructs a new instance of FormData using
+ * default values.
+ */
+public this () {
+}
+
+/**
+ * Constructs a new instance of FormData according to the parameters.
+ * A value of SWT.DEFAULT indicates that no minimum width or
+ * no minimum height is specified.
+ *
+ * @param width a minimum width for the control
+ * @param height a minimum height for the control
+ */
+public this (int width, int height) {
+    this.width = width;
+    this.height = height;
+}
+
+void computeSize (Control control, int wHint, int hHint, bool flushCache_) {
+    if (cacheWidth !is -1 && cacheHeight !is -1) return;
+    if (wHint is this.width && hHint is this.height) {
+        if (defaultWidth is -1 || defaultHeight is -1 || wHint !is defaultWhint || hHint !is defaultHhint) {
+            Point size =  control.computeSize (wHint, hHint, flushCache_);
+            defaultWhint = wHint;
+            defaultHhint = hHint;
+            defaultWidth = size.x;
+            defaultHeight = size.y;
+        }
+        cacheWidth = defaultWidth;
+        cacheHeight = defaultHeight;
+        return;
+    }
+    if (currentWidth is -1 || currentHeight is -1 || wHint !is currentWhint || hHint !is currentHhint) {
+        Point size =  control.computeSize (wHint, hHint, flushCache_);
+        currentWhint = wHint;
+        currentHhint = hHint;
+        currentWidth = size.x;
+        currentHeight = size.y;
+    }
+    cacheWidth = currentWidth;
+    cacheHeight = currentHeight;
+}
+
+void flushCache () {
+    cacheWidth = cacheHeight = -1;
+    defaultHeight = defaultWidth = -1;
+    currentHeight = currentWidth = -1;
+}
+
+int getWidth (Control control, bool flushCache) {
+    needed = true;
+    computeSize (control, width, height, flushCache);
+    return cacheWidth;
+}
+
+int getHeight (Control control, bool flushCache) {
+    computeSize (control, width, height, flushCache);
+    return cacheHeight;
+}
+
+FormAttachment getBottomAttachment (Control control, int spacing, bool flushCache) {
+    if (cacheBottom !is null) return cacheBottom;
+    if (isVisited) return cacheBottom = new FormAttachment (0, getHeight (control, flushCache));
+    if (bottom is null) {
+        if (top is null) return cacheBottom = new FormAttachment (0, getHeight (control, flushCache));
+        return cacheBottom = getTopAttachment (control, spacing, flushCache).plus (getHeight (control, flushCache));
+    }
+    Control bottomControl = bottom.control;
+    if (bottomControl !is null) {
+        if (bottomControl.isDisposed ()) {
+            bottom.control = bottomControl = null;
+        } else {
+            if (bottomControl.getParent () !is control.getParent ()) {
+                bottomControl = null;
+            }
+        }
+    }
+    if (bottomControl is null) return cacheBottom = bottom;
+    isVisited = true;
+    FormData bottomData = cast(FormData) bottomControl.getLayoutData ();
+    FormAttachment bottomAttachment = bottomData.getBottomAttachment (bottomControl, spacing, flushCache);
+    switch (bottom.alignment) {
+        case SWT.BOTTOM:
+            cacheBottom = bottomAttachment.plus (bottom.offset);
+            break;
+        case SWT.CENTER: {
+            FormAttachment topAttachment = bottomData.getTopAttachment (bottomControl, spacing, flushCache);
+            FormAttachment bottomHeight = bottomAttachment.minus (topAttachment);
+            cacheBottom = bottomAttachment.minus (bottomHeight.minus (getHeight (control, flushCache)).divide (2));
+            break;
+        }
+        default: {
+            FormAttachment topAttachment = bottomData.getTopAttachment (bottomControl, spacing, flushCache);
+            cacheBottom = topAttachment.plus (bottom.offset - spacing);
+            break;
+        }
+    }
+    isVisited = false;
+    return cacheBottom;
+}
+
+FormAttachment getLeftAttachment (Control control, int spacing, bool flushCache) {
+    if (cacheLeft !is null) return cacheLeft;
+    if (isVisited) return cacheLeft = new FormAttachment (0, 0);
+    if (left is null) {
+        if (right is null) return cacheLeft = new FormAttachment (0, 0);
+        return cacheLeft = getRightAttachment (control, spacing, flushCache).minus (getWidth (control, flushCache));
+    }
+    Control leftControl = left.control;
+    if (leftControl !is null) {
+        if (leftControl.isDisposed ()) {
+            left.control = leftControl = null;
+        } else {
+            if (leftControl.getParent () !is control.getParent ()) {
+                leftControl = null;
+            }
+        }
+    }
+    if (leftControl is null) return cacheLeft = left;
+    isVisited = true;
+    FormData leftData = cast(FormData) leftControl.getLayoutData ();
+    FormAttachment leftAttachment = leftData.getLeftAttachment (leftControl, spacing, flushCache);
+    switch (left.alignment) {
+        case SWT.LEFT:
+            cacheLeft = leftAttachment.plus (left.offset);
+            break;
+        case SWT.CENTER: {
+            FormAttachment rightAttachment = leftData.getRightAttachment (leftControl, spacing, flushCache);
+            FormAttachment leftWidth = rightAttachment.minus (leftAttachment);
+            cacheLeft = leftAttachment.plus (leftWidth.minus (getWidth (control, flushCache)).divide (2));
+            break;
+        }
+        default: {
+            FormAttachment rightAttachment = leftData.getRightAttachment (leftControl, spacing, flushCache);
+            cacheLeft = rightAttachment.plus (left.offset + spacing);
+        }
+    }
+    isVisited = false;
+    return cacheLeft;
+}
+
+String getName () {
+    String string = this.classinfo.name;
+    int index = string.lastIndexOf( '.');
+    if (index is -1 ) return string;
+    return string[ index + 1 .. string.length ];
+}
+
+FormAttachment getRightAttachment (Control control, int spacing, bool flushCache) {
+    if (cacheRight !is null) return cacheRight;
+    if (isVisited) return cacheRight = new FormAttachment (0, getWidth (control, flushCache));
+    if (right is null) {
+        if (left is null) return cacheRight = new FormAttachment (0, getWidth (control, flushCache));
+        return cacheRight = getLeftAttachment (control, spacing, flushCache).plus (getWidth (control, flushCache));
+    }
+    Control rightControl = right.control;
+    if (rightControl !is null) {
+        if (rightControl.isDisposed ()) {
+            right.control = rightControl = null;
+        } else {
+            if (rightControl.getParent () !is control.getParent ()) {
+                rightControl = null;
+            }
+        }
+    }
+    if (rightControl is null) return cacheRight = right;
+    isVisited = true;
+    FormData rightData = cast(FormData) rightControl.getLayoutData ();
+    FormAttachment rightAttachment = rightData.getRightAttachment (rightControl, spacing, flushCache);
+    switch (right.alignment) {
+        case SWT.RIGHT:
+            cacheRight = rightAttachment.plus (right.offset);
+            break;
+        case SWT.CENTER: {
+            FormAttachment leftAttachment = rightData.getLeftAttachment (rightControl, spacing, flushCache);
+            FormAttachment rightWidth = rightAttachment.minus (leftAttachment);
+            cacheRight = rightAttachment.minus (rightWidth.minus (getWidth (control, flushCache)).divide (2));
+            break;
+        }
+        default: {
+            FormAttachment leftAttachment = rightData.getLeftAttachment (rightControl, spacing, flushCache);
+            cacheRight = leftAttachment.plus (right.offset - spacing);
+            break;
+        }
+    }
+    isVisited = false;
+    return cacheRight;
+}
+
+FormAttachment getTopAttachment (Control control, int spacing, bool flushCache) {
+    if (cacheTop !is null) return cacheTop;
+    if (isVisited) return cacheTop = new FormAttachment (0, 0);
+    if (top is null) {
+        if (bottom is null) return cacheTop = new FormAttachment (0, 0);
+        return cacheTop = getBottomAttachment (control, spacing, flushCache).minus (getHeight (control, flushCache));
+    }
+    Control topControl = top.control;
+    if (topControl !is null) {
+        if (topControl.isDisposed ()) {
+            top.control = topControl = null;
+        } else {
+            if (topControl.getParent () !is control.getParent ()) {
+                topControl = null;
+            }
+        }
+    }
+    if (topControl is null) return cacheTop = top;
+    isVisited = true;
+    FormData topData = cast(FormData) topControl.getLayoutData ();
+    FormAttachment topAttachment = topData.getTopAttachment (topControl, spacing, flushCache);
+    switch (top.alignment) {
+        case SWT.TOP:
+            cacheTop = topAttachment.plus (top.offset);
+            break;
+        case SWT.CENTER: {
+            FormAttachment bottomAttachment = topData.getBottomAttachment (topControl, spacing, flushCache);
+            FormAttachment topHeight = bottomAttachment.minus (topAttachment);
+            cacheTop = topAttachment.plus (topHeight.minus (getHeight (control, flushCache)).divide (2));
+            break;
+        }
+        default: {
+            FormAttachment bottomAttachment = topData.getBottomAttachment (topControl, spacing, flushCache);
+            cacheTop = bottomAttachment.plus (top.offset + spacing);
+            break;
+        }
+    }
+    isVisited = false;
+    return cacheTop;
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the FormData object
+ */
+override public String toString () {
+    String string = getName()~" {";
+    if (width !is SWT.DEFAULT) string ~= "width="~to!(String)(width)~" ";
+    if (height !is SWT.DEFAULT) string ~= "height="~to!(String)(height)~" ";
+    if (left !is null) string ~= "left="~to!(String)(left)~" ";
+    if (right !is null) string ~= "right="~to!(String)(right)~" ";
+    if (top !is null) string ~= "top="~to!(String)(top)~" ";
+    if (bottom !is null) string ~= "bottom="~to!(String)(bottom)~" ";
+    string = string.trim();
+    string ~= "}";
+    return string;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/layout/FormLayout.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,396 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.layout.FormLayout;
+
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Layout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Scrollable;
+
+import tango.util.Convert;
+import java.lang.all;
+
+/**
+ * Instances of this class control the position and size of the
+ * children of a composite control by using <code>FormAttachments</code>
+ * to optionally configure the left, top, right and bottom edges of
+ * each child.
+ * <p>
+ * The following example code creates a <code>FormLayout</code> and then sets
+ * it into a <code>Shell</code>:
+ * <pre>
+ *      Display display = new Display ();
+ *      Shell shell = new Shell(display);
+ *      FormLayout layout = new FormLayout();
+ *      layout.marginWidth = 3;
+ *      layout.marginHeight = 3;
+ *      shell.setLayout(layout);
+ * </pre>
+ * </p>
+ * <p>
+ * To use a <code>FormLayout</code>, create a <code>FormData</code> with
+ * <code>FormAttachment</code> for each child of <code>Composite</code>.
+ * The following example code attaches <code>button1</code> to the top
+ * and left edge of the composite and <code>button2</code> to the right
+ * edge of <code>button1</code> and the top and right edges of the
+ * composite:
+ * <pre>
+ *      FormData data1 = new FormData();
+ *      data1.left = new FormAttachment(0, 0);
+ *      data1.top = new FormAttachment(0, 0);
+ *      button1.setLayoutData(data1);
+ *      FormData data2 = new FormData();
+ *      data2.left = new FormAttachment(button1);
+ *      data2.top = new FormAttachment(0, 0);
+ *      data2.right = new FormAttachment(100, 0);
+ *      button2.setLayoutData(data2);
+ * </pre>
+ * </p>
+ * <p>
+ * Each side of a child control can be attached to a position in the parent
+ * composite, or to other controls within the <code>Composite</code> by
+ * creating instances of <code>FormAttachment</code> and setting them into
+ * the top, bottom, left, and right fields of the child's <code>FormData</code>.
+ * </p>
+ * <p>
+ * If a side is not given an attachment, it is defined as not being attached
+ * to anything, causing the child to remain at its preferred size.  If a child
+ * is given no attachment on either the left or the right or top or bottom, it is
+ * automatically attached to the left and top of the composite respectively.
+ * The following code positions <code>button1</code> and <code>button2</code>
+ * but relies on default attachments:
+ * <pre>
+ *      FormData data2 = new FormData();
+ *      data2.left = new FormAttachment(button1);
+ *      data2.right = new FormAttachment(100, 0);
+ *      button2.setLayoutData(data2);
+ * </pre>
+ * </p>
+ * <p>
+ * IMPORTANT: Do not define circular attachments.  For example, do not attach
+ * the right edge of <code>button1</code> to the left edge of <code>button2</code>
+ * and then attach the left edge of <code>button2</code> to the right edge of
+ * <code>button1</code>.  This will over constrain the layout, causing undefined
+ * behavior.  The algorithm will terminate, but the results are undefined.
+ * </p>
+ *
+ * @see FormData
+ * @see FormAttachment
+ * @see <a href="http://www.eclipse.org/swt/snippets/#formlayout">FormLayout snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: LayoutExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> 
+ *
+ * @since 2.0
+ */
+public final class FormLayout : Layout {
+
+    /**
+     * marginWidth specifies the number of pixels of horizontal margin
+     * that will be placed along the left and right edges of the layout.
+     *
+     * The default value is 0.
+     */
+    public int marginWidth = 0;
+
+    /**
+     * marginHeight specifies the number of pixels of vertical margin
+     * that will be placed along the top and bottom edges of the layout.
+     *
+     * The default value is 0.
+     */
+    public int marginHeight = 0;
+
+
+    /**
+     * marginLeft specifies the number of pixels of horizontal margin
+     * that will be placed along the left edge of the layout.
+     *
+     * The default value is 0.
+     *
+     * @since 3.1
+     */
+    public int marginLeft = 0;
+
+    /**
+     * marginTop specifies the number of pixels of vertical margin
+     * that will be placed along the top edge of the layout.
+     *
+     * The default value is 0.
+     *
+     * @since 3.1
+     */
+    public int marginTop = 0;
+
+    /**
+     * marginRight specifies the number of pixels of horizontal margin
+     * that will be placed along the right edge of the layout.
+     *
+     * The default value is 0.
+     *
+     * @since 3.1
+     */
+    public int marginRight = 0;
+
+    /**
+     * marginBottom specifies the number of pixels of vertical margin
+     * that will be placed along the bottom edge of the layout.
+     *
+     * The default value is 0.
+     *
+     * @since 3.1
+     */
+    public int marginBottom = 0;
+
+    /**
+     * spacing specifies the number of pixels between the edge of one control
+     * and the edge of its neighbouring control.
+     *
+     * The default value is 0.
+     *
+     * @since 3.0
+     */
+    public int spacing = 0;
+
+/**
+ * Constructs a new instance of this class.
+ */
+public this () {
+}
+
+/*
+ * Computes the preferred height of the form with
+ * respect to the preferred height of the control.
+ *
+ * Given that the equations for top (T) and bottom (B)
+ * of the control in terms of the height of the form (X)
+ * are:
+ *      T = AX + B
+ *      B = CX + D
+ *
+ * The equation for the height of the control (H)
+ * is bottom (B) minus top (T) or (H = B - T) or:
+ *
+ *      H = (CX + D) - (AX + B)
+ *
+ * Solving for (X), the height of the form, we get:
+ *
+ *      X = (H + B - D) / (C - A)
+ *
+ * When (A = C), (C - A = 0) and the equation has no
+ * solution for X.  This is a special case meaning that
+ * the control does not constrain the height of the
+ * form.  In this case, we need to arbitrarily define
+ * the height of the form (X):
+ *
+ * Case 1: A = C, A = 0, C = 0
+ *
+ *      Let X = D, the distance from the top of the form
+ *      to the bottom edge of the control.  In this case,
+ *      the control was attached to the top of the form
+ *      and the form needs to be large enough to show the
+ *      bottom edge of the control.
+ *
+ * Case 2: A = C, A = 1, C = 1
+ *
+ *      Let X = -B, the distance from the bottom of the
+ *      form to the top edge of the control.  In this case,
+ *      the control was attached to the bottom of the form
+ *      and the only way that the control would be visible
+ *      is if the offset is negative.  If the offset is
+ *      positive, there is no possible height for the form
+ *      that will show the control as it will always be
+ *      below the bottom edge of the form.
+ *
+ * Case 3: A = C, A !is 0, C !is 0 and A !is 1, C !is 0
+ *
+ *      Let X = D / (1 - C), the distance from the top of the
+ *      form to the bottom edge of the control.  In this case,
+ *      since C is not 0 or 1, it must be a fraction, U / V.
+ *      The offset D is the distance from CX to the bottom edge
+ *      of the control.  This represents a fraction of the form
+ *      (1 - C)X. Since the height of a fraction of the form is
+ *      known, the height of the entire form can be found by setting
+ *      (1 - C)X = D.  We solve this equation for X in terms of U
+ *      and V, giving us X = (U * D) / (U - V). Similarly, if the
+ *      offset D is negative, the control is positioned above CX.
+ *      The offset -B is the distance from the top edge of the control
+ *      to CX. We can find the height of the entire form by setting
+ *      CX = -B. Solving in terms of U and V gives us X = (-B * V) / U.
+ */
+int computeHeight (Control control, FormData data, bool flushCache) {
+    FormAttachment top = data.getTopAttachment (control, spacing, flushCache);
+    FormAttachment bottom = data.getBottomAttachment (control, spacing, flushCache);
+    FormAttachment height = bottom.minus (top);
+    if (height.numerator is 0) {
+        if (bottom.numerator is 0) return bottom.offset;
+        if (bottom.numerator is bottom.denominator) return -top.offset;
+        if (bottom.offset <= 0) {
+            return -top.offset * top.denominator / bottom.numerator;
+        }
+        int divider = bottom.denominator - bottom.numerator;
+        return bottom.denominator * bottom.offset / divider;
+    }
+    return height.solveY (data.getHeight (control, flushCache));
+}
+
+override protected Point computeSize (Composite composite, int wHint, int hHint, bool flushCache) {
+    Point size = layout (composite, false, 0, 0, wHint, hHint, flushCache);
+    if (wHint !is SWT.DEFAULT) size.x = wHint;
+    if (hHint !is SWT.DEFAULT) size.y = hHint;
+    return size;
+}
+
+override protected bool flushCache (Control control) {
+    Object data = control.getLayoutData ();
+    if (data !is null) (cast(FormData) data).flushCache ();
+    return true;
+}
+
+String getName () {
+    String string = this.classinfo.name;
+    int index = string.lastIndexOf('.');
+    if (index is -1 ) return string;
+    return string[ index + 1 .. string.length ];
+}
+
+/*
+ * Computes the preferred height of the form with
+ * respect to the preferred height of the control.
+ */
+int computeWidth (Control control, FormData data, bool flushCache) {
+    FormAttachment left = data.getLeftAttachment (control, spacing, flushCache);
+    FormAttachment right = data.getRightAttachment (control, spacing, flushCache);
+    FormAttachment width = right.minus (left);
+    if (width.numerator is 0) {
+        if (right.numerator is 0) return right.offset;
+        if (right.numerator is right.denominator) return -left.offset;
+        if (right.offset <= 0) {
+            return -left.offset * left.denominator / left.numerator;
+        }
+        int divider = right.denominator - right.numerator;
+        return right.denominator * right.offset / divider;
+    }
+    return width.solveY (data.getWidth (control, flushCache));
+}
+
+override protected void layout (Composite composite, bool flushCache) {
+    Rectangle rect = composite.getClientArea ();
+    int x = rect.x + marginLeft + marginWidth;
+    int y = rect.y + marginTop + marginHeight;
+    int width = Math.max (0, rect.width - marginLeft - 2 * marginWidth - marginRight);
+    int height = Math.max (0, rect.height - marginTop - 2 * marginHeight - marginBottom);
+    layout (composite, true, x, y, width, height, flushCache);
+}
+
+Point layout (Composite composite, bool move, int x, int y, int width, int height, bool flushCache) {
+    Control [] children = composite.getChildren ();
+    for (int i=0; i<children.length; i++) {
+        Control child = children [i];
+        FormData data = cast(FormData) child.getLayoutData ();
+        if (data is null) child.setLayoutData (data = new FormData ());
+        if (flushCache) data.flushCache ();
+        data.cacheLeft = data.cacheRight = data.cacheTop = data.cacheBottom = null;
+    }
+    bool [] flush = null;
+    Rectangle [] bounds = null;
+    int w = 0, h = 0;
+    for (int i=0; i<children.length; i++) {
+        Control child = children [i];
+        FormData data = cast(FormData) child.getLayoutData ();
+        if (width !is SWT.DEFAULT) {
+            data.needed = false;
+            FormAttachment left = data.getLeftAttachment (child, spacing, flushCache);
+            FormAttachment right = data.getRightAttachment (child, spacing, flushCache);
+            int x1 = left.solveX (width), x2 = right.solveX (width);
+            if (data.height is SWT.DEFAULT && !data.needed) {
+                int trim = 0;
+                //TEMPORARY CODE
+                if ( auto sa = cast(Scrollable)child) {
+                    Rectangle rect = sa.computeTrim (0, 0, 0, 0);
+                    trim = rect.width;
+                } else {
+                    trim = child.getBorderWidth () * 2;
+                }
+                data.cacheWidth = data.cacheHeight = -1;
+                int currentWidth = Math.max (0, x2 - x1 - trim);
+                data.computeSize (child, currentWidth, data.height, flushCache);
+                if (flush is null) flush = new bool [children.length];
+                flush [i] = true;
+            }
+            w = Math.max (x2, w);
+            if (move) {
+                if (bounds is null) bounds = new Rectangle [children.length];
+                bounds [i] = new Rectangle (0, 0, 0, 0);
+                bounds [i].x = x + x1;
+                bounds [i].width = x2 - x1;
+            }
+        } else {
+            w = Math.max (computeWidth (child, data, flushCache), w);
+        }
+    }
+    for (int i=0; i<children.length; i++) {
+        Control child = children [i];
+        FormData data = cast(FormData) child.getLayoutData ();
+        if (height !is SWT.DEFAULT) {
+            int y1 = data.getTopAttachment (child, spacing, flushCache).solveX (height);
+            int y2 = data.getBottomAttachment (child, spacing, flushCache).solveX (height);
+            h = Math.max (y2, h);
+            if (move) {
+                bounds [i].y = y + y1;
+                bounds [i].height = y2 - y1;
+            }
+        } else {
+            h = Math.max (computeHeight (child, data, flushCache), h);
+        }
+    }
+    for (int i=0; i<children.length; i++) {
+        Control child = children [i];
+        FormData data = cast(FormData) child.getLayoutData ();
+        if (flush !is null && flush [i]) data.cacheWidth = data.cacheHeight = -1;
+        data.cacheLeft = data.cacheRight = data.cacheTop = data.cacheBottom = null;
+    }
+    if (move) {
+        for (int i=0; i<children.length; i++) {
+            children [i].setBounds (bounds [i]);
+        }
+    }
+    w += marginLeft + marginWidth * 2 + marginRight;
+    h += marginTop + marginHeight * 2 + marginBottom;
+    return new Point (w, h);
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the layout
+ */
+override public String toString () {
+    String string =  getName ()~" {";
+    if (marginWidth !is 0) string ~= "marginWidth="~to!(String)(marginWidth)~" ";
+    if (marginHeight !is 0) string ~= "marginHeight="~to!(String)(marginHeight)~" ";
+    if (marginLeft !is 0) string ~= "marginLeft="~to!(String)(marginLeft)~" ";
+    if (marginRight !is 0) string ~= "marginRight="~to!(String)(marginRight)~" ";
+    if (marginTop !is 0) string ~= "marginTop="~to!(String)(marginTop)~" ";
+    if (marginBottom !is 0) string ~= "marginBottom="~to!(String)(marginBottom)~" ";
+    if (spacing !is 0) string ~= "spacing="~to!(String)(spacing)~" ";
+    string = string.trim();
+    string ~= "}";
+    return string;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/layout/GridData.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,567 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.layout.GridData;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Control;
+
+import tango.util.Convert;
+import java.lang.all;
+
+/**
+ * <code>GridData</code> is the layout data object associated with
+ * <code>GridLayout</code>. To set a <code>GridData</code> object into a
+ * control, you use the <code>Control.setLayoutData(Object)</code> method.
+ * <p>
+ * There are two ways to create a <code>GridData</code> object with certain
+ * fields set. The first is to set the fields directly, like this:
+ * <pre>
+ *      GridData gridData = new GridData();
+ *      gridData.horizontalAlignment = GridData.FILL;
+ *      gridData.grabExcessHorizontalSpace = true;
+ *      button1.setLayoutData(gridData);
+ * </pre>
+ * The second is to take advantage of convenience style bits defined
+ * by <code>GridData</code>:
+ * <pre>
+ *      button1.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL));
+ * </pre>
+ * </p>
+ * <p>
+ * NOTE: Do not reuse <code>GridData</code> objects. Every control in a
+ * <code>Composite</code> that is managed by a <code>GridLayout</code>
+ * must have a unique <code>GridData</code> object. If the layout data
+ * for a control in a <code>GridLayout</code> is null at layout time,
+ * a unique <code>GridData</code> object is created for it.
+ * </p>
+ *
+ * @see GridLayout
+ * @see Control#setLayoutData
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public final class GridData {
+    /**
+     * verticalAlignment specifies how controls will be positioned
+     * vertically within a cell.
+     *
+     * The default value is CENTER.
+     *
+     * Possible values are: <ul>
+     *    <li>SWT.BEGINNING (or SWT.TOP): Position the control at the top of the cell</li>
+     *    <li>SWT.CENTER: Position the control in the vertical center of the cell</li>
+     *    <li>SWT.END (or SWT.BOTTOM): Position the control at the bottom of the cell</li>
+     *    <li>SWT.FILL: Resize the control to fill the cell vertically</li>
+     * </ul>
+     */
+    public int verticalAlignment = CENTER;
+
+    /**
+     * horizontalAlignment specifies how controls will be positioned
+     * horizontally within a cell.
+     *
+     * The default value is BEGINNING.
+     *
+     * Possible values are: <ul>
+     *    <li>SWT.BEGINNING (or SWT.LEFT): Position the control at the left of the cell</li>
+     *    <li>SWT.CENTER: Position the control in the horizontal center of the cell</li>
+     *    <li>SWT.END (or SWT.RIGHT): Position the control at the right of the cell</li>
+     *    <li>SWT.FILL: Resize the control to fill the cell horizontally</li>
+     * </ul>
+     */
+    public int horizontalAlignment = BEGINNING;
+
+    /**
+     * widthHint specifies the preferred width in pixels. This value
+     * is the wHint passed into Control.computeSize(int, int, bool)
+     * to determine the preferred size of the control.
+     *
+     * The default value is SWT.DEFAULT.
+     *
+     * @see Control#computeSize(int, int, bool)
+     */
+    public int widthHint = SWT.DEFAULT;
+
+    /**
+     * heightHint specifies the preferred height in pixels. This value
+     * is the hHint passed into Control.computeSize(int, int, bool)
+     * to determine the preferred size of the control.
+     *
+     * The default value is SWT.DEFAULT.
+     *
+     * @see Control#computeSize(int, int, bool)
+     */
+    public int heightHint = SWT.DEFAULT;
+
+    /**
+     * horizontalIndent specifies the number of pixels of indentation
+     * that will be placed along the left side of the cell.
+     *
+     * The default value is 0.
+     */
+    public int horizontalIndent = 0;
+
+    /**
+     * verticalIndent specifies the number of pixels of indentation
+     * that will be placed along the top side of the cell.
+     *
+     * The default value is 0.
+     *
+     * @since 3.1
+     */
+    public int verticalIndent = 0;
+
+    /**
+     * horizontalSpan specifies the number of column cells that the control
+     * will take up.
+     *
+     * The default value is 1.
+     */
+    public int horizontalSpan = 1;
+
+    /**
+     * verticalSpan specifies the number of row cells that the control
+     * will take up.
+     *
+     * The default value is 1.
+     */
+    public int verticalSpan = 1;
+
+    /**
+     * <p>grabExcessHorizontalSpace specifies whether the width of the cell
+     * changes depending on the size of the parent Composite.  If
+     * grabExcessHorizontalSpace is <code>true</code>, the following rules
+     * apply to the width of the cell:</p>
+     * <ul>
+     * <li>If extra horizontal space is available in the parent, the cell will
+     * grow to be wider than its preferred width.  The new width
+     * will be "preferred width + delta" where delta is the extra
+     * horizontal space divided by the number of grabbing columns.</li>
+     * <li>If there is not enough horizontal space available in the parent, the
+     * cell will shrink until it reaches its minimum width as specified by
+     * GridData.minimumWidth. The new width will be the maximum of
+     * "minimumWidth" and "preferred width - delta", where delta is
+     * the amount of space missing divided by the number of grabbing columns.</li>
+     * <li>If the parent is packed, the cell will be its preferred width
+     * as specified by GridData.widthHint.</li>
+     * <li>If the control spans multiple columns and there are no other grabbing
+     * controls in any of the spanned columns, the last column in the span will
+     * grab the extra space.  If there is at least one other grabbing control
+     * in the span, the grabbing will be spread over the columns already
+     * marked as grabExcessHorizontalSpace.</li>
+     * </ul>
+     *
+     * <p>The default value is false.</p>
+     *
+     * @see GridData#minimumWidth
+     * @see GridData#widthHint
+     */
+    public bool grabExcessHorizontalSpace = false;
+
+    /**
+     * <p>grabExcessVerticalSpace specifies whether the height of the cell
+     * changes depending on the size of the parent Composite.  If
+     * grabExcessVerticalSpace is <code>true</code>, the following rules
+     * apply to the height of the cell:</p>
+     * <ul>
+     * <li>If extra vertical space is available in the parent, the cell will
+     * grow to be taller than its preferred height.  The new height
+     * will be "preferred height + delta" where delta is the extra
+     * vertical space divided by the number of grabbing rows.</li>
+     * <li>If there is not enough vertical space available in the parent, the
+     * cell will shrink until it reaches its minimum height as specified by
+     * GridData.minimumHeight. The new height will be the maximum of
+     * "minimumHeight" and "preferred height - delta", where delta is
+     * the amount of space missing divided by the number of grabbing rows.</li>
+     * <li>If the parent is packed, the cell will be its preferred height
+     * as specified by GridData.heightHint.</li>
+     * <li>If the control spans multiple rows and there are no other grabbing
+     * controls in any of the spanned rows, the last row in the span will
+     * grab the extra space.  If there is at least one other grabbing control
+     * in the span, the grabbing will be spread over the rows already
+     * marked as grabExcessVerticalSpace.</li>
+     * </ul>
+     *
+     * <p>The default value is false.</p>
+     *
+     * @see GridData#minimumHeight
+     * @see GridData#heightHint
+     */
+    public bool grabExcessVerticalSpace = false;
+
+    /**
+     * minimumWidth specifies the minimum width in pixels.  This value
+     * applies only if grabExcessHorizontalSpace is true. A value of
+     * SWT.DEFAULT means that the minimum width will be the result
+     * of Control.computeSize(int, int, bool) where wHint is
+     * determined by GridData.widthHint.
+     *
+     * The default value is 0.
+     *
+     * @since 3.1
+     * @see Control#computeSize(int, int, bool)
+     * @see GridData#widthHint
+     */
+    public int minimumWidth = 0;
+
+    /**
+     * minimumHeight specifies the minimum height in pixels.  This value
+     * applies only if grabExcessVerticalSpace is true.  A value of
+     * SWT.DEFAULT means that the minimum height will be the result
+     * of Control.computeSize(int, int, bool) where hHint is
+     * determined by GridData.heightHint.
+     *
+     * The default value is 0.
+     *
+     * @since 3.1
+     * @see Control#computeSize(int, int, bool)
+     * @see GridData#heightHint
+     */
+    public int minimumHeight = 0;
+
+    /**
+     * exclude informs the layout to ignore this control when sizing
+     * and positioning controls.  If this value is <code>true</code>,
+     * the size and position of the control will not be managed by the
+     * layout.  If this value is <code>false</code>, the size and
+     * position of the control will be computed and assigned.
+     *
+     * The default value is <code>false</code>.
+     *
+     * @since 3.1
+     */
+    public bool exclude = false;
+
+    /**
+     * Value for horizontalAlignment or verticalAlignment.
+     * Position the control at the top or left of the cell.
+     * Not recommended. Use SWT.BEGINNING, SWT.TOP or SWT.LEFT instead.
+     */
+    public static const int BEGINNING = SWT.BEGINNING;
+
+    /**
+     * Value for horizontalAlignment or verticalAlignment.
+     * Position the control in the vertical or horizontal center of the cell
+     * Not recommended. Use SWT.CENTER instead.
+     */
+    public static const int CENTER = 2;
+
+    /**
+     * Value for horizontalAlignment or verticalAlignment.
+     * Position the control at the bottom or right of the cell
+     * Not recommended. Use SWT.END, SWT.BOTTOM or SWT.RIGHT instead.
+     */
+    public static const int END = 3;
+
+    /**
+     * Value for horizontalAlignment or verticalAlignment.
+     * Resize the control to fill the cell horizontally or vertically.
+     * Not recommended. Use SWT.FILL instead.
+     */
+    public static const int FILL = SWT.FILL;
+
+    /**
+     * Style bit for <code>new GridData(int)</code>.
+     * Position the control at the top of the cell.
+     * Not recommended. Use
+     * <code>new GridData(int, SWT.BEGINNING, bool, bool)</code>
+     * instead.
+     */
+    public static const int VERTICAL_ALIGN_BEGINNING =  1 << 1;
+
+    /**
+     * Style bit for <code>new GridData(int)</code> to position the
+     * control in the vertical center of the cell.
+     * Not recommended. Use
+     * <code>new GridData(int, SWT.CENTER, bool, bool)</code>
+     * instead.
+     */
+    public static const int VERTICAL_ALIGN_CENTER = 1 << 2;
+
+    /**
+     * Style bit for <code>new GridData(int)</code> to position the
+     * control at the bottom of the cell.
+     * Not recommended. Use
+     * <code>new GridData(int, SWT.END, bool, bool)</code>
+     * instead.
+     */
+    public static const int VERTICAL_ALIGN_END = 1 << 3;
+
+    /**
+     * Style bit for <code>new GridData(int)</code> to resize the
+     * control to fill the cell vertically.
+     * Not recommended. Use
+     * <code>new GridData(int, SWT.FILL, bool, bool)</code>
+     * instead
+     */
+    public static const int VERTICAL_ALIGN_FILL = 1 << 4;
+
+    /**
+     * Style bit for <code>new GridData(int)</code> to position the
+     * control at the left of the cell.
+     * Not recommended. Use
+     * <code>new GridData(SWT.BEGINNING, int, bool, bool)</code>
+     * instead.
+     */
+    public static const int HORIZONTAL_ALIGN_BEGINNING =  1 << 5;
+
+    /**
+     * Style bit for <code>new GridData(int)</code> to position the
+     * control in the horizontal center of the cell.
+     * Not recommended. Use
+     * <code>new GridData(SWT.CENTER, int, bool, bool)</code>
+     * instead.
+     */
+    public static const int HORIZONTAL_ALIGN_CENTER = 1 << 6;
+
+    /**
+     * Style bit for <code>new GridData(int)</code> to position the
+     * control at the right of the cell.
+     * Not recommended. Use
+     * <code>new GridData(SWT.END, int, bool, bool)</code>
+     * instead.
+     */
+    public static const int HORIZONTAL_ALIGN_END = 1 << 7;
+
+    /**
+     * Style bit for <code>new GridData(int)</code> to resize the
+     * control to fill the cell horizontally.
+     * Not recommended. Use
+     * <code>new GridData(SWT.FILL, int, bool, bool)</code>
+     * instead.
+     */
+    public static const int HORIZONTAL_ALIGN_FILL = 1 << 8;
+
+    /**
+     * Style bit for <code>new GridData(int)</code> to resize the
+     * control to fit the remaining horizontal space.
+     * Not recommended. Use
+     * <code>new GridData(int, int, true, bool)</code>
+     * instead.
+     */
+    public static const int GRAB_HORIZONTAL = 1 << 9;
+
+    /**
+     * Style bit for <code>new GridData(int)</code> to resize the
+     * control to fit the remaining vertical space.
+     * Not recommended. Use
+     * <code>new GridData(int, int, bool, true)</code>
+     * instead.
+     */
+    public static const int GRAB_VERTICAL = 1 << 10;
+
+    /**
+     * Style bit for <code>new GridData(int)</code> to resize the
+     * control to fill the cell vertically and to fit the remaining
+     * vertical space.
+     * FILL_VERTICAL = VERTICAL_ALIGN_FILL | GRAB_VERTICAL
+     * Not recommended. Use
+     * <code>new GridData(int, SWT.FILL, bool, true)</code>
+     * instead.
+     */
+    public static const int FILL_VERTICAL = VERTICAL_ALIGN_FILL | GRAB_VERTICAL;
+
+    /**
+     * Style bit for <code>new GridData(int)</code> to resize the
+     * control to fill the cell horizontally and to fit the remaining
+     * horizontal space.
+     * FILL_HORIZONTAL = HORIZONTAL_ALIGN_FILL | GRAB_HORIZONTAL
+     * Not recommended. Use
+     * <code>new GridData(SWT.FILL, int, true, bool)</code>
+     * instead.
+     */
+    public static const int FILL_HORIZONTAL = HORIZONTAL_ALIGN_FILL | GRAB_HORIZONTAL;
+
+    /**
+     * Style bit for <code>new GridData(int)</code> to resize the
+     * control to fill the cell horizontally and vertically and
+     * to fit the remaining horizontal and vertical space.
+     * FILL_BOTH = FILL_VERTICAL | FILL_HORIZONTAL
+     * Not recommended. Use
+     * <code>new GridData(SWT.FILL, SWT.FILL, true, true)</code>
+     * instead.
+     */
+    public static const int FILL_BOTH = FILL_VERTICAL | FILL_HORIZONTAL;
+
+    int cacheWidth = -1, cacheHeight = -1;
+    int defaultWhint, defaultHhint, defaultWidth = -1, defaultHeight = -1;
+    int currentWhint, currentHhint, currentWidth = -1, currentHeight = -1;
+
+/**
+ * Constructs a new instance of GridData using
+ * default values.
+ */
+public this () {
+}
+
+/**
+ * Constructs a new instance based on the GridData style.
+ * This constructor is not recommended.
+ *
+ * @param style the GridData style
+ */
+public this (int style) {
+    if ((style & VERTICAL_ALIGN_BEGINNING) !is 0) verticalAlignment = BEGINNING;
+    if ((style & VERTICAL_ALIGN_CENTER) !is 0) verticalAlignment = CENTER;
+    if ((style & VERTICAL_ALIGN_FILL) !is 0) verticalAlignment = FILL;
+    if ((style & VERTICAL_ALIGN_END) !is 0) verticalAlignment = END;
+    if ((style & HORIZONTAL_ALIGN_BEGINNING) !is 0) horizontalAlignment = BEGINNING;
+    if ((style & HORIZONTAL_ALIGN_CENTER) !is 0) horizontalAlignment = CENTER;
+    if ((style & HORIZONTAL_ALIGN_FILL) !is 0) horizontalAlignment = FILL;
+    if ((style & HORIZONTAL_ALIGN_END) !is 0) horizontalAlignment = END;
+    grabExcessHorizontalSpace = (style & GRAB_HORIZONTAL) !is 0;
+    grabExcessVerticalSpace = (style & GRAB_VERTICAL) !is 0;
+}
+
+/**
+ * Constructs a new instance of GridData according to the parameters.
+ *
+ * @param horizontalAlignment how control will be positioned horizontally within a cell,
+ *      one of: SWT.BEGINNING (or SWT.LEFT), SWT.CENTER, SWT.END (or SWT.RIGHT), or SWT.FILL
+ * @param verticalAlignment how control will be positioned vertically within a cell,
+ *      one of: SWT.BEGINNING (or SWT.TOP), SWT.CENTER, SWT.END (or SWT.BOTTOM), or SWT.FILL
+ * @param grabExcessHorizontalSpace whether cell will be made wide enough to fit the remaining horizontal space
+ * @param grabExcessVerticalSpace whether cell will be made high enough to fit the remaining vertical space
+ *
+ * @since 3.0
+ */
+public this (int horizontalAlignment, int verticalAlignment, bool grabExcessHorizontalSpace, bool grabExcessVerticalSpace) {
+    this (horizontalAlignment, verticalAlignment, grabExcessHorizontalSpace, grabExcessVerticalSpace, 1, 1);
+}
+
+/**
+ * Constructs a new instance of GridData according to the parameters.
+ *
+ * @param horizontalAlignment how control will be positioned horizontally within a cell,
+ *      one of: SWT.BEGINNING (or SWT.LEFT), SWT.CENTER, SWT.END (or SWT.RIGHT), or SWT.FILL
+ * @param verticalAlignment how control will be positioned vertically within a cell,
+ *      one of: SWT.BEGINNING (or SWT.TOP), SWT.CENTER, SWT.END (or SWT.BOTTOM), or SWT.FILL
+ * @param grabExcessHorizontalSpace whether cell will be made wide enough to fit the remaining horizontal space
+ * @param grabExcessVerticalSpace whether cell will be made high enough to fit the remaining vertical space
+ * @param horizontalSpan the number of column cells that the control will take up
+ * @param verticalSpan the number of row cells that the control will take up
+ *
+ * @since 3.0
+ */
+public this (int horizontalAlignment, int verticalAlignment, bool grabExcessHorizontalSpace, bool grabExcessVerticalSpace, int horizontalSpan, int verticalSpan) {
+    this.horizontalAlignment = horizontalAlignment;
+    this.verticalAlignment = verticalAlignment;
+    this.grabExcessHorizontalSpace = grabExcessHorizontalSpace;
+    this.grabExcessVerticalSpace = grabExcessVerticalSpace;
+    this.horizontalSpan = horizontalSpan;
+    this.verticalSpan = verticalSpan;
+}
+
+/**
+ * Constructs a new instance of GridData according to the parameters.
+ * A value of SWT.DEFAULT indicates that no minimum width or
+ * no minimum height is specified.
+ *
+ * @param width a minimum width for the column
+ * @param height a minimum height for the row
+ *
+ * @since 3.0
+ */
+public this (int width, int height) {
+    this.widthHint = width;
+    this.heightHint = height;
+}
+
+void computeSize (Control control, int wHint, int hHint, bool flushCache) {
+    if (cacheWidth !is -1 && cacheHeight !is -1) return;
+    if (wHint is this.widthHint && hHint is this.heightHint) {
+        if (defaultWidth is -1 || defaultHeight is -1 || wHint !is defaultWhint || hHint !is defaultHhint) {
+            Point size = control.computeSize (wHint, hHint, flushCache);
+            defaultWhint = wHint;
+            defaultHhint = hHint;
+            defaultWidth = size.x;
+            defaultHeight = size.y;
+        }
+        cacheWidth = defaultWidth;
+        cacheHeight = defaultHeight;
+        return;
+    }
+    if (currentWidth is -1 || currentHeight is -1 || wHint !is currentWhint || hHint !is currentHhint) {
+        Point size = control.computeSize (wHint, hHint, flushCache);
+        currentWhint = wHint;
+        currentHhint = hHint;
+        currentWidth = size.x;
+        currentHeight = size.y;
+    }
+    cacheWidth = currentWidth;
+    cacheHeight = currentHeight;
+}
+
+void flushCache () {
+    cacheWidth = cacheHeight = -1;
+    defaultWidth = defaultHeight = -1;
+    currentWidth = currentHeight = -1;
+}
+
+String getName () {
+    String string = this.classinfo.name;
+    int index = string.lastIndexOf('.');
+    if (index is -1 ) return string;
+    return string[ index + 1 .. string.length ];
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the GridData object
+ */
+override public String toString () {
+    String hAlign = "";
+    switch (horizontalAlignment) {
+        case SWT.FILL: hAlign = "SWT.FILL"; break;
+        case SWT.BEGINNING: hAlign = "SWT.BEGINNING"; break;
+        case SWT.LEFT: hAlign = "SWT.LEFT"; break;
+        case SWT.END: hAlign = "SWT.END"; break;
+        case END: hAlign = "GridData.END"; break;
+        case SWT.RIGHT: hAlign = "SWT.RIGHT"; break;
+        case SWT.CENTER: hAlign = "SWT.CENTER"; break;
+        case CENTER: hAlign = "GridData.CENTER"; break;
+        default: hAlign = "Undefined "~to!(String)(horizontalAlignment); break;
+    }
+    String vAlign = "";
+    switch (verticalAlignment) {
+        case SWT.FILL: vAlign = "SWT.FILL"; break;
+        case SWT.BEGINNING: vAlign = "SWT.BEGINNING"; break;
+        case SWT.TOP: vAlign = "SWT.TOP"; break;
+        case SWT.END: vAlign = "SWT.END"; break;
+        case END: vAlign = "GridData.END"; break;
+        case SWT.BOTTOM: vAlign = "SWT.BOTTOM"; break;
+        case SWT.CENTER: vAlign = "SWT.CENTER"; break;
+        case CENTER: vAlign = "GridData.CENTER"; break;
+        default: vAlign = "Undefined "~to!(String)(verticalAlignment); break;
+    }
+    String string = getName()~" {";
+    string ~= "horizontalAlignment="~to!(String)(hAlign)~" ";
+    if (horizontalIndent !is 0) string ~= "horizontalIndent="~to!(String)(horizontalIndent)~" ";
+    if (horizontalSpan !is 1) string ~= "horizontalSpan="~to!(String)(horizontalSpan)~" ";
+    if (grabExcessHorizontalSpace) string ~= "grabExcessHorizontalSpace="~to!(String)(grabExcessHorizontalSpace)~" ";
+    if (widthHint !is SWT.DEFAULT) string ~= "widthHint="~to!(String)(widthHint)~" ";
+    if (minimumWidth !is 0) string ~= "minimumWidth="~to!(String)(minimumWidth)~" ";
+    string ~= "verticalAlignment="~vAlign~" ";
+    if (verticalIndent !is 0) string ~= "verticalIndent="~to!(String)(verticalIndent)~" ";
+    if (verticalSpan !is 1) string ~= "verticalSpan="~to!(String)(verticalSpan)~" ";
+    if (grabExcessVerticalSpace) string ~= "grabExcessVerticalSpace="~to!(String)(grabExcessVerticalSpace)~" ";
+    if (heightHint !is SWT.DEFAULT) string ~= "heightHint="~to!(String)(heightHint)~" ";
+    if (minimumHeight !is 0) string ~= "minimumHeight="~to!(String)(minimumHeight)~" ";
+    if (exclude) string ~= "exclude="~to!(String)(exclude)~" ";
+    string = string.trim();
+    string ~= "}";
+    return string;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/layout/GridLayout.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,759 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.layout.GridLayout;
+
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Layout;
+import org.eclipse.swt.widgets.Scrollable;
+
+
+import tango.util.Convert;
+import java.lang.all;
+
+
+/**
+ * Instances of this class lay out the control children of a
+ * <code>Composite</code> in a grid.
+ * <p>
+ * <code>GridLayout</code> has a number of configuration fields, and the
+ * controls it lays out can have an associated layout data object, called
+ * <code>GridData</code>. The power of <code>GridLayout</code> lies in the
+ * ability to configure <code>GridData</code> for each control in the layout.
+ * </p>
+ * <p>
+ * The following code creates a shell managed by a <code>GridLayout</code>
+ * with 3 columns:
+ * <pre>
+ *      Display display = new Display();
+ *      Shell shell = new Shell(display);
+ *      GridLayout gridLayout = new GridLayout();
+ *      gridLayout.numColumns = 3;
+ *      shell.setLayout(gridLayout);
+ * </pre>
+ * The <code>numColumns</code> field is the most important field in a
+ * <code>GridLayout</code>. Widgets are laid out in columns from left
+ * to right, and a new row is created when <code>numColumns</code> + 1
+ * controls are added to the <code>Composite<code>.
+ * </p>
+ *
+ * @see GridData
+ * @see <a href="http://www.eclipse.org/swt/snippets/#gridlayout">GridLayout snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: LayoutExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public final class GridLayout : Layout {
+
+    /**
+     * numColumns specifies the number of cell columns in the layout.
+     * If numColumns has a value less than 1, the layout will not
+     * set the size and position of any controls.
+     *
+     * The default value is 1.
+     */
+    public int numColumns = 1;
+
+    /**
+     * makeColumnsEqualWidth specifies whether all columns in the layout
+     * will be forced to have the same width.
+     *
+     * The default value is false.
+     */
+    public bool makeColumnsEqualWidth = false;
+
+    /**
+     * marginWidth specifies the number of pixels of horizontal margin
+     * that will be placed along the left and right edges of the layout.
+     *
+     * The default value is 5.
+     */
+    public int marginWidth = 5;
+
+    /**
+     * marginHeight specifies the number of pixels of vertical margin
+     * that will be placed along the top and bottom edges of the layout.
+     *
+     * The default value is 5.
+     */
+    public int marginHeight = 5;
+
+    /**
+     * marginLeft specifies the number of pixels of horizontal margin
+     * that will be placed along the left edge of the layout.
+     *
+     * The default value is 0.
+     *
+     * @since 3.1
+     */
+    public int marginLeft = 0;
+
+    /**
+     * marginTop specifies the number of pixels of vertical margin
+     * that will be placed along the top edge of the layout.
+     *
+     * The default value is 0.
+     *
+     * @since 3.1
+     */
+    public int marginTop = 0;
+
+    /**
+     * marginRight specifies the number of pixels of horizontal margin
+     * that will be placed along the right edge of the layout.
+     *
+     * The default value is 0.
+     *
+     * @since 3.1
+     */
+    public int marginRight = 0;
+
+    /**
+     * marginBottom specifies the number of pixels of vertical margin
+     * that will be placed along the bottom edge of the layout.
+     *
+     * The default value is 0.
+     *
+     * @since 3.1
+     */
+    public int marginBottom = 0;
+
+    /**
+     * horizontalSpacing specifies the number of pixels between the right
+     * edge of one cell and the left edge of its neighbouring cell to
+     * the right.
+     *
+     * The default value is 5.
+     */
+    public int horizontalSpacing = 5;
+
+    /**
+     * verticalSpacing specifies the number of pixels between the bottom
+     * edge of one cell and the top edge of its neighbouring cell underneath.
+     *
+     * The default value is 5.
+     */
+    public int verticalSpacing = 5;
+
+/**
+ * Constructs a new instance of this class.
+ */
+public this () {}
+
+/**
+ * Constructs a new instance of this class given the
+ * number of columns, and whether or not the columns
+ * should be forced to have the same width.
+ * If numColumns has a value less than 1, the layout will not
+ * set the size and position of any controls.
+ *
+ * @param numColumns the number of columns in the grid
+ * @param makeColumnsEqualWidth whether or not the columns will have equal width
+ *
+ * @since 2.0
+ */
+public this (int numColumns, bool makeColumnsEqualWidth) {
+    this.numColumns = numColumns;
+    this.makeColumnsEqualWidth = makeColumnsEqualWidth;
+}
+
+override protected Point computeSize (Composite composite, int wHint, int hHint, bool flushCache_) {
+    Point size = layout (composite, false, 0, 0, wHint, hHint, flushCache_);
+    if (wHint !is SWT.DEFAULT) size.x = wHint;
+    if (hHint !is SWT.DEFAULT) size.y = hHint;
+    return size;
+}
+
+override protected bool flushCache (Control control) {
+    Object data = control.getLayoutData ();
+    if (data !is null) (cast(GridData) data).flushCache ();
+    return true;
+}
+
+GridData getData (Control [][] grid, int row, int column, int rowCount, int columnCount, bool first) {
+    Control control = grid [row] [column];
+    if (control !is null) {
+        GridData data = cast(GridData) control.getLayoutData ();
+        int hSpan = Math.max (1, Math.min (data.horizontalSpan, columnCount));
+        int vSpan = Math.max (1, data.verticalSpan);
+        int i = first ? row + vSpan - 1 : row - vSpan + 1;
+        int j = first ? column + hSpan - 1 : column - hSpan + 1;
+        if (0 <= i && i < rowCount) {
+            if (0 <= j && j < columnCount) {
+                if (control is grid [i][j]) return data;
+            }
+        }
+    }
+    return null;
+}
+
+override protected void layout (Composite composite, bool flushCache_) {
+    Rectangle rect = composite.getClientArea ();
+    layout (composite, true, rect.x, rect.y, rect.width, rect.height, flushCache_);
+}
+
+Point layout (Composite composite, bool move, int x, int y, int width, int height, bool flushCache_) {
+    if (numColumns < 1) {
+        return new Point (marginLeft + marginWidth * 2 + marginRight, marginTop + marginHeight * 2 + marginBottom);
+    }
+    Control [] children = composite.getChildren ();
+    int count = 0;
+    for (int i=0; i<children.length; i++) {
+        Control control = children [i];
+        GridData data = cast(GridData) control.getLayoutData ();
+        if (data is null || !data.exclude) {
+            children [count++] = children [i];
+        }
+    }
+    if (count is 0) {
+        return new Point (marginLeft + marginWidth * 2 + marginRight, marginTop + marginHeight * 2 + marginBottom);
+    }
+    for (int i=0; i<count; i++) {
+        Control child = children [i];
+        GridData data = cast(GridData) child.getLayoutData ();
+        if (data is null) child.setLayoutData (data = new GridData ());
+        if (flushCache_) data.flushCache ();
+        data.computeSize (child, data.widthHint, data.heightHint, flushCache_);
+        if (data.grabExcessHorizontalSpace && data.minimumWidth > 0) {
+            if (data.cacheWidth < data.minimumWidth) {
+                int trim = 0;
+                //TEMPORARY CODE
+                if ( auto sa = cast(Scrollable)child ) {
+                    Rectangle rect = sa.computeTrim (0, 0, 0, 0);
+                    trim = rect.width;
+                } else {
+                    trim = child.getBorderWidth () * 2;
+                }
+                data.cacheWidth = data.cacheHeight = SWT.DEFAULT;
+                data.computeSize (child, Math.max (0, data.minimumWidth - trim), data.heightHint, false);
+            }
+        }
+        if (data.grabExcessVerticalSpace && data.minimumHeight > 0) {
+            data.cacheHeight = Math.max (data.cacheHeight, data.minimumHeight);
+        }
+    }
+
+    /* Build the grid */
+    int row = 0, column = 0, rowCount = 0, columnCount = numColumns;
+    Control [][] grid = new Control [][]( 4, columnCount );
+    for (int i=0; i<count; i++) {
+        Control child = children [i];
+        GridData data = cast(GridData) child.getLayoutData ();
+        int hSpan = Math.max (1, Math.min (data.horizontalSpan, columnCount));
+        int vSpan = Math.max (1, data.verticalSpan);
+        while (true) {
+            int lastRow = row + vSpan;
+            if (lastRow >= grid.length) {
+                Control [][] newGrid = new Control[][]( lastRow + 4, columnCount );
+                SimpleType!(Control[]).arraycopy (grid, 0, newGrid, 0, grid.length);
+                grid = newGrid;
+            }
+            if (grid [row] is null) {
+                grid [row] = new Control [columnCount];
+            }
+            while (column < columnCount && grid [row] [column] !is null) {
+                column++;
+            }
+            int endCount = column + hSpan;
+            if (endCount <= columnCount) {
+                int index = column;
+                while (index < endCount && grid [row] [index] is null) {
+                    index++;
+                }
+                if (index is endCount) break;
+                column = index;
+            }
+            if (column + hSpan >= columnCount) {
+                column = 0;
+                row++;
+            }
+        }
+        for (int j=0; j<vSpan; j++) {
+            if (grid [row + j] is null) {
+                grid [row + j] = new Control [columnCount];
+            }
+            for (int k=0; k<hSpan; k++) {
+                grid [row + j] [column + k] = child;
+            }
+        }
+        rowCount = Math.max (rowCount, row + vSpan);
+        column += hSpan;
+    }
+
+    /* Column widths */
+    int availableWidth = width - horizontalSpacing * (columnCount - 1) - (marginLeft + marginWidth * 2 + marginRight);
+    int expandCount = 0;
+    int [] widths = new int [columnCount];
+    int [] minWidths = new int [columnCount];
+    bool [] expandColumn = new bool [columnCount];
+    for (int j=0; j<columnCount; j++) {
+        for (int i=0; i<rowCount; i++) {
+            GridData data = getData (grid, i, j, rowCount, columnCount, true);
+            if (data !is null) {
+                int hSpan = Math.max (1, Math.min (data.horizontalSpan, columnCount));
+                if (hSpan is 1) {
+                    int w = data.cacheWidth + data.horizontalIndent;
+                    widths [j] = Math.max (widths [j], w);
+                    if (data.grabExcessHorizontalSpace) {
+                        if (!expandColumn [j]) expandCount++;
+                        expandColumn [j] = true;
+                    }
+                    if (!data.grabExcessHorizontalSpace || data.minimumWidth !is 0) {
+                        w = !data.grabExcessHorizontalSpace || data.minimumWidth is SWT.DEFAULT ? data.cacheWidth : data.minimumWidth;
+                        w += data.horizontalIndent;
+                        minWidths [j] = Math.max (minWidths [j], w);
+                    }
+                }
+            }
+        }
+        for (int i=0; i<rowCount; i++) {
+            GridData data = getData (grid, i, j, rowCount, columnCount, false);
+            if (data !is null) {
+                int hSpan = Math.max (1, Math.min (data.horizontalSpan, columnCount));
+                if (hSpan > 1) {
+                    int spanWidth = 0, spanMinWidth = 0, spanExpandCount = 0;
+                    for (int k=0; k<hSpan; k++) {
+                        spanWidth += widths [j-k];
+                        spanMinWidth += minWidths [j-k];
+                        if (expandColumn [j-k]) spanExpandCount++;
+                    }
+                    if (data.grabExcessHorizontalSpace && spanExpandCount is 0) {
+                        expandCount++;
+                        expandColumn [j] = true;
+                    }
+                    int w = data.cacheWidth + data.horizontalIndent - spanWidth - (hSpan - 1) * horizontalSpacing;
+                    if (w > 0) {
+                        if (makeColumnsEqualWidth) {
+                            int equalWidth = (w + spanWidth) / hSpan;
+                            int remainder = (w + spanWidth) % hSpan, last = -1;
+                            for (int k = 0; k < hSpan; k++) {
+                                widths [last=j-k] = Math.max (equalWidth, widths [j-k]);
+                            }
+                            if (last > -1) widths [last] += remainder;
+                        } else {
+                            if (spanExpandCount is 0) {
+                                widths [j] += w;
+                            } else {
+                                int delta = w / spanExpandCount;
+                                int remainder = w % spanExpandCount, last = -1;
+                                for (int k = 0; k < hSpan; k++) {
+                                    if (expandColumn [j-k]) {
+                                        widths [last=j-k] += delta;
+                                    }
+                                }
+                                if (last > -1) widths [last] += remainder;
+                            }
+                        }
+                    }
+                    if (!data.grabExcessHorizontalSpace || data.minimumWidth !is 0) {
+                        w = !data.grabExcessHorizontalSpace || data.minimumWidth is SWT.DEFAULT ? data.cacheWidth : data.minimumWidth;
+                        w += data.horizontalIndent - spanMinWidth - (hSpan - 1) * horizontalSpacing;
+                        if (w > 0) {
+                            if (spanExpandCount is 0) {
+                                minWidths [j] += w;
+                            } else {
+                                int delta = w / spanExpandCount;
+                                int remainder = w % spanExpandCount, last = -1;
+                                for (int k = 0; k < hSpan; k++) {
+                                    if (expandColumn [j-k]) {
+                                        minWidths [last=j-k] += delta;
+                                    }
+                                }
+                                if (last > -1) minWidths [last] += remainder;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+    if (makeColumnsEqualWidth) {
+        int minColumnWidth = 0;
+        int columnWidth = 0;
+        for (int i=0; i<columnCount; i++) {
+            minColumnWidth = Math.max (minColumnWidth, minWidths [i]);
+            columnWidth = Math.max (columnWidth, widths [i]);
+        }
+        columnWidth = width is SWT.DEFAULT || expandCount is 0 ? columnWidth : Math.max (minColumnWidth, availableWidth / columnCount);
+        for (int i=0; i<columnCount; i++) {
+            expandColumn [i] = expandCount > 0;
+            widths [i] = columnWidth;
+        }
+    } else {
+        if (width !is SWT.DEFAULT && expandCount > 0) {
+            int totalWidth = 0;
+            for (int i=0; i<columnCount; i++) {
+                totalWidth += widths [i];
+            }
+            int c = expandCount;
+            int delta = (availableWidth - totalWidth) / c;
+            int remainder = (availableWidth - totalWidth) % c;
+            int last = -1;
+            while (totalWidth !is availableWidth) {
+                for (int j=0; j<columnCount; j++) {
+                    if (expandColumn [j]) {
+                        if (widths [j] + delta > minWidths [j]) {
+                            widths [last = j] = widths [j] + delta;
+                        } else {
+                            widths [j] = minWidths [j];
+                            expandColumn [j] = false;
+                            c--;
+                        }
+                    }
+                }
+                if (last > -1) widths [last] += remainder;
+
+                for (int j=0; j<columnCount; j++) {
+                    for (int i=0; i<rowCount; i++) {
+                        GridData data = getData (grid, i, j, rowCount, columnCount, false);
+                        if (data !is null) {
+                            int hSpan = Math.max (1, Math.min (data.horizontalSpan, columnCount));
+                            if (hSpan > 1) {
+                                if (!data.grabExcessHorizontalSpace || data.minimumWidth !is 0) {
+                                    int spanWidth = 0, spanExpandCount = 0;
+                                    for (int k=0; k<hSpan; k++) {
+                                        spanWidth += widths [j-k];
+                                        if (expandColumn [j-k]) spanExpandCount++;
+                                    }
+                                    int w = !data.grabExcessHorizontalSpace || data.minimumWidth is SWT.DEFAULT ? data.cacheWidth : data.minimumWidth;
+                                    w += data.horizontalIndent - spanWidth - (hSpan - 1) * horizontalSpacing;
+                                    if (w > 0) {
+                                        if (spanExpandCount is 0) {
+                                            widths [j] += w;
+                                        } else {
+                                            int delta2 = w / spanExpandCount;
+                                            int remainder2 = w % spanExpandCount, last2 = -1;
+                                            for (int k = 0; k < hSpan; k++) {
+                                                if (expandColumn [j-k]) {
+                                                    widths [last2=j-k] += delta2;
+                                                }
+                                            }
+                                            if (last2 > -1) widths [last2] += remainder2;
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+                if (c is 0) break;
+                totalWidth = 0;
+                for (int i=0; i<columnCount; i++) {
+                    totalWidth += widths [i];
+                }
+                delta = (availableWidth - totalWidth) / c;
+                remainder = (availableWidth - totalWidth) % c;
+                last = -1;
+            }
+        }
+    }
+
+    /* Wrapping */
+    GridData [] flush = null;
+    int flushLength = 0;
+    if (width !is SWT.DEFAULT) {
+        for (int j=0; j<columnCount; j++) {
+            for (int i=0; i<rowCount; i++) {
+                GridData data = getData (grid, i, j, rowCount, columnCount, false);
+                if (data !is null) {
+                    if (data.heightHint is SWT.DEFAULT) {
+                        Control child = grid [i][j];
+                        //TEMPORARY CODE
+                        int hSpan = Math.max (1, Math.min (data.horizontalSpan, columnCount));
+                        int currentWidth = 0;
+                        for (int k=0; k<hSpan; k++) {
+                            currentWidth += widths [j-k];
+                        }
+                        currentWidth += (hSpan - 1) * horizontalSpacing - data.horizontalIndent;
+                        if ((currentWidth !is data.cacheWidth && data.horizontalAlignment is SWT.FILL) || (data.cacheWidth > currentWidth)) {
+                            int trim = 0;
+                            if ( auto sa = cast(Scrollable)child ) {
+                                Rectangle rect = sa.computeTrim (0, 0, 0, 0);
+                                trim = rect.width;
+                            } else {
+                                trim = child.getBorderWidth () * 2;
+                            }
+                            data.cacheWidth = data.cacheHeight = SWT.DEFAULT;
+                            data.computeSize (child, Math.max (0, currentWidth - trim), data.heightHint, false);
+                            if (data.grabExcessVerticalSpace && data.minimumHeight > 0) {
+                                data.cacheHeight = Math.max (data.cacheHeight, data.minimumHeight);
+                            }
+                            if (flush is null) flush = new GridData [count];
+                            flush [flushLength++] = data;
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    /* Row heights */
+    int availableHeight = height - verticalSpacing * (rowCount - 1) - (marginTop + marginHeight * 2 + marginBottom);
+    expandCount = 0;
+    int [] heights = new int [rowCount];
+    int [] minHeights = new int [rowCount];
+    bool [] expandRow = new bool [rowCount];
+    for (int i=0; i<rowCount; i++) {
+        for (int j=0; j<columnCount; j++) {
+            GridData data = getData (grid, i, j, rowCount, columnCount, true);
+            if (data !is null) {
+                int vSpan = Math.max (1, Math.min (data.verticalSpan, rowCount));
+                if (vSpan is 1) {
+                    int h = data.cacheHeight + data.verticalIndent;
+                    heights [i] = Math.max (heights [i], h);
+                    if (data.grabExcessVerticalSpace) {
+                        if (!expandRow [i]) expandCount++;
+                        expandRow [i] = true;
+                    }
+                    if (!data.grabExcessVerticalSpace || data.minimumHeight !is 0) {
+                        h = !data.grabExcessVerticalSpace || data.minimumHeight is SWT.DEFAULT ? data.cacheHeight : data.minimumHeight;
+                        h += data.verticalIndent;
+                        minHeights [i] = Math.max (minHeights [i], h);
+                    }
+                }
+            }
+        }
+        for (int j=0; j<columnCount; j++) {
+            GridData data = getData (grid, i, j, rowCount, columnCount, false);
+            if (data !is null) {
+                int vSpan = Math.max (1, Math.min (data.verticalSpan, rowCount));
+                if (vSpan > 1) {
+                    int spanHeight = 0, spanMinHeight = 0, spanExpandCount = 0;
+                    for (int k=0; k<vSpan; k++) {
+                        spanHeight += heights [i-k];
+                        spanMinHeight += minHeights [i-k];
+                        if (expandRow [i-k]) spanExpandCount++;
+                    }
+                    if (data.grabExcessVerticalSpace && spanExpandCount is 0) {
+                        expandCount++;
+                        expandRow [i] = true;
+                    }
+                    int h = data.cacheHeight + data.verticalIndent - spanHeight - (vSpan - 1) * verticalSpacing;
+                    if (h > 0) {
+                        if (spanExpandCount is 0) {
+                            heights [i] += h;
+                        } else {
+                            int delta = h / spanExpandCount;
+                            int remainder = h % spanExpandCount, last = -1;
+                            for (int k = 0; k < vSpan; k++) {
+                                if (expandRow [i-k]) {
+                                    heights [last=i-k] += delta;
+                                }
+                            }
+                            if (last > -1) heights [last] += remainder;
+                        }
+                    }
+                    if (!data.grabExcessVerticalSpace || data.minimumHeight !is 0) {
+                        h = !data.grabExcessVerticalSpace || data.minimumHeight is SWT.DEFAULT ? data.cacheHeight : data.minimumHeight;
+                        h += data.verticalIndent - spanMinHeight - (vSpan - 1) * verticalSpacing;
+                        if (h > 0) {
+                            if (spanExpandCount is 0) {
+                                minHeights [i] += h;
+                            } else {
+                                int delta = h / spanExpandCount;
+                                int remainder = h % spanExpandCount, last = -1;
+                                for (int k = 0; k < vSpan; k++) {
+                                    if (expandRow [i-k]) {
+                                        minHeights [last=i-k] += delta;
+                                    }
+                                }
+                                if (last > -1) minHeights [last] += remainder;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+    if (height !is SWT.DEFAULT && expandCount > 0) {
+        int totalHeight = 0;
+        for (int i=0; i<rowCount; i++) {
+            totalHeight += heights [i];
+        }
+        int c = expandCount;
+        int delta = (availableHeight - totalHeight) / c;
+        int remainder = (availableHeight - totalHeight) % c;
+        int last = -1;
+        while (totalHeight !is availableHeight) {
+            for (int i=0; i<rowCount; i++) {
+                if (expandRow [i]) {
+                    if (heights [i] + delta > minHeights [i]) {
+                        heights [last = i] = heights [i] + delta;
+                    } else {
+                        heights [i] = minHeights [i];
+                        expandRow [i] = false;
+                        c--;
+                    }
+                }
+            }
+            if (last > -1) heights [last] += remainder;
+
+            for (int i=0; i<rowCount; i++) {
+                for (int j=0; j<columnCount; j++) {
+                    GridData data = getData (grid, i, j, rowCount, columnCount, false);
+                    if (data !is null) {
+                        int vSpan = Math.max (1, Math.min (data.verticalSpan, rowCount));
+                        if (vSpan > 1) {
+                            if (!data.grabExcessVerticalSpace || data.minimumHeight !is 0) {
+                                int spanHeight = 0, spanExpandCount = 0;
+                                for (int k=0; k<vSpan; k++) {
+                                    spanHeight += heights [i-k];
+                                    if (expandRow [i-k]) spanExpandCount++;
+                                }
+                                int h = !data.grabExcessVerticalSpace || data.minimumHeight is SWT.DEFAULT ? data.cacheHeight : data.minimumHeight;
+                                h += data.verticalIndent - spanHeight - (vSpan - 1) * verticalSpacing;
+                                if (h > 0) {
+                                    if (spanExpandCount is 0) {
+                                        heights [i] += h;
+                                    } else {
+                                        int delta2 = h / spanExpandCount;
+                                        int remainder2 = h % spanExpandCount, last2 = -1;
+                                        for (int k = 0; k < vSpan; k++) {
+                                            if (expandRow [i-k]) {
+                                                heights [last2=i-k] += delta2;
+                                            }
+                                        }
+                                        if (last2 > -1) heights [last2] += remainder2;
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            if (c is 0) break;
+            totalHeight = 0;
+            for (int i=0; i<rowCount; i++) {
+                totalHeight += heights [i];
+            }
+            delta = (availableHeight - totalHeight) / c;
+            remainder = (availableHeight - totalHeight) % c;
+            last = -1;
+        }
+    }
+
+    /* Position the controls */
+    if (move) {
+        int gridY = y + marginTop + marginHeight;
+        for (int i=0; i<rowCount; i++) {
+            int gridX = x + marginLeft + marginWidth;
+            for (int j=0; j<columnCount; j++) {
+                GridData data = getData (grid, i, j, rowCount, columnCount, true);
+                if (data !is null) {
+                    int hSpan = Math.max (1, Math.min (data.horizontalSpan, columnCount));
+                    int vSpan = Math.max (1, data.verticalSpan);
+                    int cellWidth = 0, cellHeight = 0;
+                    for (int k=0; k<hSpan; k++) {
+                        cellWidth += widths [j+k];
+                    }
+                    for (int k=0; k<vSpan; k++) {
+                        cellHeight += heights [i+k];
+                    }
+                    cellWidth += horizontalSpacing * (hSpan - 1);
+                    int childX = gridX + data.horizontalIndent;
+                    int childWidth = Math.min (data.cacheWidth, cellWidth);
+                    switch (data.horizontalAlignment) {
+                        case SWT.CENTER:
+                        case GridData.CENTER:
+                            childX += Math.max (0, (cellWidth - data.horizontalIndent - childWidth) / 2);
+                            break;
+                        case SWT.RIGHT:
+                        case SWT.END:
+                        case GridData.END:
+                            childX += Math.max (0, cellWidth - data.horizontalIndent - childWidth);
+                            break;
+                        case SWT.FILL:
+                            childWidth = cellWidth - data.horizontalIndent;
+                            break;
+                        default:
+                    }
+                    cellHeight += verticalSpacing * (vSpan - 1);
+                    int childY = gridY + data.verticalIndent;
+                    int childHeight = Math.min (data.cacheHeight, cellHeight);
+                    switch (data.verticalAlignment) {
+                        case SWT.CENTER:
+                        case GridData.CENTER:
+                            childY += Math.max (0, (cellHeight - data.verticalIndent - childHeight) / 2);
+                            break;
+                        case SWT.BOTTOM:
+                        case SWT.END:
+                        case GridData.END:
+                            childY += Math.max (0, cellHeight - data.verticalIndent - childHeight);
+                            break;
+                        case SWT.FILL:
+                            childHeight = cellHeight - data.verticalIndent;
+                            break;
+                        default:
+                    }
+                    Control child = grid [i][j];
+                    if (child !is null) {
+                        child.setBounds (childX, childY, childWidth, childHeight);
+                    }
+                }
+                gridX += widths [j] + horizontalSpacing;
+            }
+            gridY += heights [i] + verticalSpacing;
+        }
+    }
+
+    // clean up cache
+    for (int i = 0; i < flushLength; i++) {
+        flush [i].cacheWidth = flush [i].cacheHeight = -1;
+    }
+
+    int totalDefaultWidth = 0;
+    int totalDefaultHeight = 0;
+    for (int i=0; i<columnCount; i++) {
+        totalDefaultWidth += widths [i];
+    }
+    for (int i=0; i<rowCount; i++) {
+        totalDefaultHeight += heights [i];
+    }
+    totalDefaultWidth += horizontalSpacing * (columnCount - 1) + marginLeft + marginWidth * 2 + marginRight;
+    totalDefaultHeight += verticalSpacing * (rowCount - 1) + marginTop + marginHeight * 2 + marginBottom;
+    return new Point (totalDefaultWidth, totalDefaultHeight);
+}
+
+String getName () {
+    String string = this.classinfo.name;
+    int index = string.lastIndexOf('.');
+    if (index is -1 ) return string;
+    return string[ index + 1 .. string.length ];
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the layout
+ */
+override public String toString () {
+    String string = getName ()~" {";
+    if (numColumns !is 1) string ~= "numColumns="~to!(String)(numColumns)~" ";
+    if (makeColumnsEqualWidth) string ~= "makeColumnsEqualWidth="~to!(String)(makeColumnsEqualWidth)~" ";
+    if (marginWidth !is 0) string ~= "marginWidth="~to!(String)(marginWidth)~" ";
+    if (marginHeight !is 0) string ~= "marginHeight="~to!(String)(marginHeight)~" ";
+    if (marginLeft !is 0) string ~= "marginLeft="~to!(String)(marginLeft)~" ";
+    if (marginRight !is 0) string ~= "marginRight="~to!(String)(marginRight)~" ";
+    if (marginTop !is 0) string ~= "marginTop="~to!(String)(marginTop)~" ";
+    if (marginBottom !is 0) string ~= "marginBottom="~to!(String)(marginBottom)~" ";
+    if (horizontalSpacing !is 0) string ~= "horizontalSpacing="~to!(String)(horizontalSpacing)~" ";
+    if (verticalSpacing !is 0) string ~= "verticalSpacing="~to!(String)(verticalSpacing)~" ";
+    string = string.trim();
+    string ~= "}";
+    return string;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/layout/RowData.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,131 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.layout.RowData;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Control;
+
+import tango.util.Convert;
+import java.lang.all;
+
+/**
+ * Each control controlled by a <code>RowLayout</code> can have its initial
+ * width and height specified by setting a <code>RowData</code> object
+ * into the control.
+ * <p>
+ * The following code uses a <code>RowData</code> object to change the initial
+ * size of a <code>Button</code> in a <code>Shell</code>:
+ * <pre>
+ *      Display display = new Display();
+ *      Shell shell = new Shell(display);
+ *      shell.setLayout(new RowLayout());
+ *      Button button1 = new Button(shell, SWT.PUSH);
+ *      button1.setText("Button 1");
+ *      button1.setLayoutData(new RowData(50, 40));
+ * </pre>
+ * </p>
+ *
+ * @see RowLayout
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public final class RowData {
+    /**
+     * width specifies the desired width in pixels. This value
+     * is the wHint passed into Control.computeSize(int, int, bool)
+     * to determine the preferred size of the control.
+     *
+     * The default value is SWT.DEFAULT.
+     *
+     * @see org.eclipse.swt.widgets.Control#computeSize(int, int, bool)
+     */
+    public int width = SWT.DEFAULT;
+    /**
+     * height specifies the preferred height in pixels. This value
+     * is the hHint passed into Control.computeSize(int, int, bool)
+     * to determine the preferred size of the control.
+     *
+     * The default value is SWT.DEFAULT.
+     *
+     * @see org.eclipse.swt.widgets.Control#computeSize(int, int, bool)
+     */
+    public int height = SWT.DEFAULT;
+
+    /**
+     * exclude informs the layout to ignore this control when sizing
+     * and positioning controls.  If this value is <code>true</code>,
+     * the size and position of the control will not be managed by the
+     * layout.  If this value is <code>false</code>, the size and
+     * position of the control will be computed and assigned.
+     *
+     * The default value is <code>false</code>.
+     *
+     * @since 3.1
+     */
+    public bool exclude = false;
+
+/**
+ * Constructs a new instance of RowData using
+ * default values.
+ */
+public this () {
+}
+
+/**
+ * Constructs a new instance of RowData according to the parameters.
+ * A value of SWT.DEFAULT indicates that no minimum width or
+ * no minimum height is specified.
+ *
+ * @param width a minimum width for the control
+ * @param height a minimum height for the control
+ */
+public this (int width, int height) {
+    this.width = width;
+    this.height = height;
+}
+
+/**
+ * Constructs a new instance of RowData according to the parameter.
+ * A value of SWT.DEFAULT indicates that no minimum width or
+ * no minimum height is specified.
+ *
+ * @param point a point whose x coordinate specifies a minimum width for the control
+ * and y coordinate specifies a minimum height for the control
+ */
+public this (Point point) {
+    this (point.x, point.y);
+}
+
+String getName () {
+    String string = this.classinfo.name;
+    int index = string.lastIndexOf('.');
+    if (index is -1 ) return string;
+    return string[ index + 1 .. string.length ];
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the RowData object
+ */
+override public String toString () {
+    String string = getName ()~" {";
+    if (width !is SWT.DEFAULT) string ~= "width="~to!(String)(width)~" ";
+    if (height !is SWT.DEFAULT) string ~= "height="~to!(String)(height)~" ";
+    if (exclude) string ~= "exclude="~to!(String)(exclude)~" ";
+    string = string.trim();
+    string ~= "}";
+    return string;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/layout/RowLayout.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,515 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.layout.RowLayout;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Layout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.layout.RowData;
+import tango.util.Convert;
+import java.lang.all;
+
+
+/**
+ * Instances of this class determine the size and position of the
+ * children of a <code>Composite</code> by placing them either in
+ * horizontal rows or vertical columns within the parent <code>Composite</code>.
+ * <p>
+ * <code>RowLayout</code> aligns all controls in one row if the
+ * <code>type</code> is set to horizontal, and one column if it is
+ * set to vertical. It has the ability to wrap, and provides configurable
+ * margins and spacing. <code>RowLayout</code> has a number of configuration
+ * fields. In addition, the height and width of each control in a
+ * <code>RowLayout</code> can be specified by setting a <code>RowData</code>
+ * object into the control using <code>setLayoutData ()</code>.
+ * </p>
+ * <p>
+ * The following example code creates a <code>RowLayout</code>, sets all
+ * of its fields to non-default values, and then sets it into a
+ * <code>Shell</code>.
+ * <pre>
+ *      RowLayout rowLayout = new RowLayout();
+ *      rowLayout.wrap = false;
+ *      rowLayout.pack = false;
+ *      rowLayout.justify = true;
+ *      rowLayout.type = SWT.VERTICAL;
+ *      rowLayout.marginLeft = 5;
+ *      rowLayout.marginTop = 5;
+ *      rowLayout.marginRight = 5;
+ *      rowLayout.marginBottom = 5;
+ *      rowLayout.spacing = 0;
+ *      shell.setLayout(rowLayout);
+ * </pre>
+ * If you are using the default field values, you only need one line of code:
+ * <pre>
+ *      shell.setLayout(new RowLayout());
+ * </pre>
+ * </p>
+ *
+ * @see RowData
+ * @see <a href="http://www.eclipse.org/swt/snippets/#rowlayout">RowLayout snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: LayoutExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public final class RowLayout : Layout {
+
+    /**
+     * type specifies whether the layout places controls in rows or
+     * columns.
+     *
+     * The default value is HORIZONTAL.
+     *
+     * Possible values are: <ul>
+     *    <li>HORIZONTAL: Position the controls horizontally from left to right</li>
+     *    <li>VERTICAL: Position the controls vertically from top to bottom</li>
+     * </ul>
+     *
+     * @since 2.0
+     */
+    public int type = SWT.HORIZONTAL;
+
+    /**
+     * marginWidth specifies the number of pixels of horizontal margin
+     * that will be placed along the left and right edges of the layout.
+     *
+     * The default value is 0.
+     *
+     * @since 3.0
+     */
+    public int marginWidth = 0;
+
+    /**
+     * marginHeight specifies the number of pixels of vertical margin
+     * that will be placed along the top and bottom edges of the layout.
+     *
+     * The default value is 0.
+     *
+     * @since 3.0
+     */
+    public int marginHeight = 0;
+
+    /**
+     * spacing specifies the number of pixels between the edge of one cell
+     * and the edge of its neighbouring cell.
+     *
+     * The default value is 3.
+     */
+    public int spacing = 3;
+
+    /**
+     * wrap specifies whether a control will be wrapped to the next
+     * row if there is insufficient space on the current row.
+     *
+     * The default value is true.
+     */
+    public bool wrap = true;
+
+    /**
+     * pack specifies whether all controls in the layout take
+     * their preferred size.  If pack is false, all controls will
+     * have the same size which is the size required to accommodate the
+     * largest preferred height and the largest preferred width of all
+     * the controls in the layout.
+     *
+     * The default value is true.
+     */
+    public bool pack = true;
+
+    /**
+     * fill specifies whether the controls in a row should be
+     * all the same height for horizontal layouts, or the same
+     * width for vertical layouts.
+     *
+     * The default value is false.
+     *
+     * @since 3.0
+     */
+    public bool fill = false;
+
+    /**
+     * center specifies whether the controls in a row should be
+     * centered vertically in each cell for horizontal layouts,
+     * or centered horizontally in each cell for vertical layouts.
+     *
+     * The default value is false.
+     * 
+     * @since 3.4
+     */
+    public bool center = false;
+    
+    /**
+     * justify specifies whether the controls in a row should be
+     * fully justified, with any extra space placed between the controls.
+     *
+     * The default value is false.
+     */
+    public bool justify = false;
+
+    /**
+     * marginLeft specifies the number of pixels of horizontal margin
+     * that will be placed along the left edge of the layout.
+     *
+     * The default value is 3.
+     */
+    public int marginLeft = 3;
+
+    /**
+     * marginTop specifies the number of pixels of vertical margin
+     * that will be placed along the top edge of the layout.
+     *
+     * The default value is 3.
+     */
+    public int marginTop = 3;
+
+    /**
+     * marginRight specifies the number of pixels of horizontal margin
+     * that will be placed along the right edge of the layout.
+     *
+     * The default value is 3.
+     */
+    public int marginRight = 3;
+
+    /**
+     * marginBottom specifies the number of pixels of vertical margin
+     * that will be placed along the bottom edge of the layout.
+     *
+     * The default value is 3.
+     */
+    public int marginBottom = 3;
+
+/**
+ * Constructs a new instance of this class.
+ */
+public this () {
+}
+
+/**
+ * Constructs a new instance of this class given the type.
+ *
+ * @param type the type of row layout
+ *
+ * @since 2.0
+ */
+public this (int type) {
+    this.type = type;
+}
+
+override protected Point computeSize (Composite composite, int wHint, int hHint, bool flushCache_) {
+    Point extent;
+    if (type is SWT.HORIZONTAL) {
+        extent = layoutHorizontal (composite, false, (wHint !is SWT.DEFAULT) && wrap, wHint, flushCache_);
+    } else {
+        extent = layoutVertical (composite, false, (hHint !is SWT.DEFAULT) && wrap, hHint, flushCache_);
+    }
+    if (wHint !is SWT.DEFAULT) extent.x = wHint;
+    if (hHint !is SWT.DEFAULT) extent.y = hHint;
+    return extent;
+}
+
+Point computeSize (Control control, bool flushCache_) {
+    int wHint = SWT.DEFAULT, hHint = SWT.DEFAULT;
+    RowData data = cast(RowData) control.getLayoutData ();
+    if (data !is null) {
+        wHint = data.width;
+        hHint = data.height;
+    }
+    return control.computeSize (wHint, hHint, flushCache_);
+}
+
+override protected bool flushCache (Control control) {
+    return true;
+}
+
+String getName () {
+    String string = this.classinfo.name;
+    int index = string.lastIndexOf('.');
+    if (index is -1 ) return string;
+    return string[ index + 1 .. string.length ];
+}
+
+override protected void layout (Composite composite, bool flushCache_) {
+    Rectangle clientArea = composite.getClientArea ();
+    if (type is SWT.HORIZONTAL) {
+        layoutHorizontal (composite, true, wrap, clientArea.width, flushCache_);
+    } else {
+        layoutVertical (composite, true, wrap, clientArea.height, flushCache_);
+    }
+}
+
+Point layoutHorizontal (Composite composite, bool move, bool wrap, int width, bool flushCache_) {
+    Control [] children = composite.getChildren ();
+    int count = 0;
+    for (int i=0; i<children.length; i++) {
+        Control control = children [i];
+        RowData data = cast(RowData) control.getLayoutData ();
+        if (data is null || !data.exclude) {
+            children [count++] = children [i];
+        }
+    }
+    if (count is 0) {
+        return new Point (marginLeft + marginWidth * 2 + marginRight, marginTop + marginHeight * 2 + marginBottom);
+    }
+    int childWidth = 0, childHeight = 0, maxHeight = 0;
+    if (!pack) {
+        for (int i=0; i<count; i++) {
+            Control child = children [i];
+            Point size = computeSize (child, flushCache_);
+            childWidth = Math.max (childWidth, size.x);
+            childHeight = Math.max (childHeight, size.y);
+        }
+        maxHeight = childHeight;
+    }
+    int clientX = 0, clientY = 0;
+    if (move) {
+        Rectangle rect = composite.getClientArea ();
+        clientX = rect.x;
+        clientY = rect.y;
+    }
+    int [] wraps = null;
+    bool wrapped = false;
+    Rectangle [] bounds = null;
+    if (move && (justify || fill || center)) {
+        bounds = new Rectangle [count];
+        wraps = new int [count];
+    }
+    int maxX = 0, x = marginLeft + marginWidth, y = marginTop + marginHeight;
+    for (int i=0; i<count; i++) {
+        Control child = children [i];
+        if (pack) {
+            Point size = computeSize (child, flushCache_);
+            childWidth = size.x;
+            childHeight = size.y;
+        }
+        if (wrap && (i !is 0) && (x + childWidth > width)) {
+            wrapped = true;
+            if (move && (justify || fill || center)) wraps [i - 1] = maxHeight;
+            x = marginLeft + marginWidth;
+            y += spacing + maxHeight;
+            if (pack) maxHeight = 0;
+        }
+        if (pack || fill || center) {
+            maxHeight = Math.max (maxHeight, childHeight);
+        }
+        if (move) {
+            int childX = x + clientX, childY = y + clientY;
+            if (justify || fill || center) {
+                bounds [i] = new Rectangle (childX, childY, childWidth, childHeight);
+            } else {
+                child.setBounds (childX, childY, childWidth, childHeight);
+            }
+        }
+        x += spacing + childWidth;
+        maxX = Math.max (maxX, x);
+    }
+    maxX = Math.max (clientX + marginLeft + marginWidth, maxX - spacing);
+    if (!wrapped) maxX += marginRight + marginWidth;
+    if (move && (justify || fill || center)) {
+        int space = 0, margin = 0;
+        if (!wrapped) {
+            space = Math.max (0, (width - maxX) / (count + 1));
+            margin = Math.max (0, ((width - maxX) % (count + 1)) / 2);
+        } else {
+            if (fill || justify || center) {
+                int last = 0;
+                if (count > 0) wraps [count - 1] = maxHeight;
+                for (int i=0; i<count; i++) {
+                    if (wraps [i] !is 0) {
+                        int wrapCount = i - last + 1;
+                        if (justify) {
+                            int wrapX = 0;
+                            for (int j=last; j<=i; j++) {
+                                wrapX += bounds [j].width + spacing;
+                            }
+                            space = Math.max (0, (width - wrapX) / (wrapCount + 1));
+                            margin = Math.max (0, ((width - wrapX) % (wrapCount + 1)) / 2);
+                        }
+                        for (int j=last; j<=i; j++) {
+                            if (justify) bounds [j].x += (space * (j - last + 1)) + margin;
+                            if (fill) {
+                                bounds [j].height = wraps [i];
+                            } else {
+                                if (center) {
+                                    bounds [j].y += Math.max (0, (wraps [i] - bounds [j].height) / 2);
+                                }
+                            }
+                        }
+                        last = i + 1;
+                    }
+                }
+            }
+        }
+        for (int i=0; i<count; i++) {
+            if (!wrapped) {
+                if (justify) bounds [i].x += (space * (i + 1)) + margin;
+                if (fill) {
+                    bounds [i].height = maxHeight;
+                } else {
+                    if (center) {
+                        bounds [i].y += Math.max (0, (maxHeight - bounds [i].height) / 2);
+                    }
+                }
+            }
+            children [i].setBounds (bounds [i]);
+        }
+    }
+    return new Point (maxX, y + maxHeight + marginBottom + marginHeight);
+}
+
+Point layoutVertical (Composite composite, bool move, bool wrap, int height, bool flushCache_) {
+    Control [] children = composite.getChildren ();
+    int count = 0;
+    for (int i=0; i<children.length; i++) {
+        Control control = children [i];
+        RowData data = cast(RowData) control.getLayoutData ();
+        if (data is null || !data.exclude) {
+            children [count++] = children [i];
+        }
+    }
+    if (count is 0) {
+        return new Point (marginLeft + marginWidth * 2 + marginRight, marginTop + marginHeight * 2 + marginBottom);
+    }
+    int childWidth = 0, childHeight = 0, maxWidth = 0;
+    if (!pack) {
+        for (int i=0; i<count; i++) {
+            Control child = children [i];
+            Point size = computeSize (child, flushCache_);
+            childWidth = Math.max (childWidth, size.x);
+            childHeight = Math.max (childHeight, size.y);
+        }
+        maxWidth = childWidth;
+    }
+    int clientX = 0, clientY = 0;
+    if (move) {
+        Rectangle rect = composite.getClientArea ();
+        clientX = rect.x;
+        clientY = rect.y;
+    }
+    int [] wraps = null;
+    bool wrapped = false;
+    Rectangle [] bounds = null;
+    if (move && (justify || fill || center)) {
+        bounds = new Rectangle [count];
+        wraps = new int [count];
+    }
+    int maxY = 0, x = marginLeft + marginWidth, y = marginTop + marginHeight;
+    for (int i=0; i<count; i++) {
+        Control child = children [i];
+        if (pack) {
+            Point size = computeSize (child, flushCache_);
+            childWidth = size.x;
+            childHeight = size.y;
+        }
+        if (wrap && (i !is 0) && (y + childHeight > height)) {
+            wrapped = true;
+            if (move && (justify || fill || center)) wraps [i - 1] = maxWidth;
+            x += spacing + maxWidth;
+            y = marginTop + marginHeight;
+            if (pack) maxWidth = 0;
+        }
+        if (pack || fill || center) {
+            maxWidth = Math.max (maxWidth, childWidth);
+        }
+        if (move) {
+            int childX = x + clientX, childY = y + clientY;
+            if (justify || fill || center) {
+                bounds [i] = new Rectangle (childX, childY, childWidth, childHeight);
+            } else {
+                child.setBounds (childX, childY, childWidth, childHeight);
+            }
+        }
+        y += spacing + childHeight;
+        maxY = Math.max (maxY, y);
+    }
+    maxY = Math.max (clientY + marginTop + marginHeight, maxY - spacing);
+    if (!wrapped) maxY += marginBottom + marginHeight;
+    if (move && (justify || fill || center)) {
+        int space = 0, margin = 0;
+        if (!wrapped) {
+            space = Math.max (0, (height - maxY) / (count + 1));
+            margin = Math.max (0, ((height - maxY) % (count + 1)) / 2);
+        } else {
+            if (fill || justify || center) {
+                int last = 0;
+                if (count > 0) wraps [count - 1] = maxWidth;
+                for (int i=0; i<count; i++) {
+                    if (wraps [i] !is 0) {
+                        int wrapCount = i - last + 1;
+                        if (justify) {
+                            int wrapY = 0;
+                            for (int j=last; j<=i; j++) {
+                                wrapY += bounds [j].height + spacing;
+                            }
+                            space = Math.max (0, (height - wrapY) / (wrapCount + 1));
+                            margin = Math.max (0, ((height - wrapY) % (wrapCount + 1)) / 2);
+                        }
+                        for (int j=last; j<=i; j++) {
+                            if (justify) bounds [j].y += (space * (j - last + 1)) + margin;
+                            if (fill) {
+                                bounds [j].width = wraps [i];
+                            } else {
+                                if (center) {
+                                    bounds [j].x += Math.max (0, (wraps [i] - bounds [j].width) / 2);
+                                }
+                            }
+                        }
+                        last = i + 1;
+                    }
+                }
+            }
+        }
+        for (int i=0; i<count; i++) {
+            if (!wrapped) {
+                if (justify) bounds [i].y += (space * (i + 1)) + margin;
+                if (fill) {
+                    bounds [i].width = maxWidth;
+                } else {
+                    if (center) {
+                        bounds [i].x += Math.max (0, (maxWidth - bounds [i].width) / 2);
+                    }
+                }
+
+            }
+            children [i].setBounds (bounds [i]);
+        }
+    }
+    return new Point (x + maxWidth + marginRight + marginWidth, maxY);
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the layout
+ */
+override public String toString () {
+    String string = getName ()~" {";
+    string ~= "type="~((type !is SWT.HORIZONTAL) ? "SWT.VERTICAL" : "SWT.HORIZONTAL")~" ";
+    if (marginWidth !is 0) string ~= "marginWidth="~to!(String)(marginWidth)~" ";
+    if (marginHeight !is 0) string ~= "marginHeight="~to!(String)(marginHeight)~" ";
+    if (marginLeft !is 0) string ~= "marginLeft="~to!(String)(marginLeft)~" ";
+    if (marginTop !is 0) string ~= "marginTop="~to!(String)(marginTop)~" ";
+    if (marginRight !is 0) string ~= "marginRight="~to!(String)(marginRight)~" ";
+    if (marginBottom !is 0) string ~= "marginBottom="~to!(String)(marginBottom)~" ";
+    if (spacing !is 0) string ~= "spacing="~to!(String)(spacing)~" ";
+    string ~= "wrap="~to!(String)(wrap)~" ";
+    string ~= "pack="~to!(String)(pack)~" ";
+    string ~= "fill="~to!(String)(fill)~" ";
+    string ~= "justify="~to!(String)(justify)~" ";
+    string = string.trim();
+    string ~= "}";
+    return string;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/layout/all.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,15 @@
+module org.eclipse.swt.layout.all;
+
+import java.lang.all;
+
+public import org.eclipse.swt.layout.FillData;
+public import org.eclipse.swt.layout.FillLayout;
+public import org.eclipse.swt.layout.FormAttachment;
+public import org.eclipse.swt.layout.FormData;
+public import org.eclipse.swt.layout.FormLayout;
+public import org.eclipse.swt.layout.GridData;
+public import org.eclipse.swt.layout.GridLayout;
+public import org.eclipse.swt.layout.RowData;
+public import org.eclipse.swt.layout.RowLayout;
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/opengl/GLCanvas.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,295 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D Programming Language:
+ *     John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+
+module org.eclipse.swt.opengl.GLCanvas;
+
+import java.lang.all;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.graphics.Rectangle;
+
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.internal.c.glx;
+import org.eclipse.swt.internal.c.gdk   : GdkWindowAttr, GdkDrawable;
+import org.eclipse.swt.internal.c.Xutil : XVisualInfo;
+
+import org.eclipse.swt.internal.opengl.glx.GLX;
+
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+
+import org.eclipse.swt.opengl.GLData;
+
+/**
+ * GLCanvas is a widget capable of displaying OpenGL content.
+ * 
+ * @see GLData
+ * @see <a href="http://www.eclipse.org/swt/snippets/#opengl">OpenGL snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.2
+ */
+
+public class GLCanvas : Canvas {
+    void* context;
+    uint   xWindow;
+    GdkDrawable* glWindow;
+    XVisualInfo vinfo;
+    static const int MAX_ATTRIBUTES = 32;
+
+/**
+ * Create a GLCanvas widget using the attributes described in the GLData
+ * object provided.
+ *
+ * @param parent a composite widget
+ * @param style the bitwise OR'ing of widget styles
+ * @param data the requested attributes of the GLCanvas
+ *
+ * @exception IllegalArgumentException
+ * <ul><li>ERROR_NULL_ARGUMENT when the data is null
+ *     <li>ERROR_UNSUPPORTED_DEPTH when the requested attributes cannot be provided</ul> 
+ * </ul>
+ */
+public this (Composite parent, int style, GLData data) {
+    super (parent, style);  
+    if (data is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    int[MAX_ATTRIBUTES] glxAttrib;
+    int pos = 0;
+    glxAttrib [pos++] = GLX.GLX_RGBA;
+    if (data.doubleBuffer) glxAttrib [pos++] = GLX.GLX_DOUBLEBUFFER;
+    if (data.stereo) glxAttrib [pos++] = GLX.GLX_STEREO;
+    if (data.redSize > 0) {
+        glxAttrib [pos++] = GLX.GLX_RED_SIZE;
+        glxAttrib [pos++] = data.redSize;
+    }
+    if (data.greenSize > 0) {
+        glxAttrib [pos++] = GLX.GLX_GREEN_SIZE;
+        glxAttrib [pos++] = data.greenSize;
+    }
+    if (data.blueSize > 0) {
+        glxAttrib [pos++] = GLX.GLX_BLUE_SIZE;
+        glxAttrib [pos++] = data.blueSize;
+    }
+    if (data.alphaSize > 0) {
+        glxAttrib [pos++] = GLX.GLX_ALPHA_SIZE;
+        glxAttrib [pos++] = data.alphaSize;
+    }
+    if (data.depthSize > 0) {
+        glxAttrib [pos++] = GLX.GLX_DEPTH_SIZE;
+        glxAttrib [pos++] = data.depthSize;
+    }
+    if (data.stencilSize > 0) {
+        glxAttrib [pos++] = GLX.GLX_STENCIL_SIZE;
+        glxAttrib [pos++] = data.stencilSize;
+    }
+    if (data.accumRedSize > 0) {
+        glxAttrib [pos++] = GLX.GLX_ACCUM_RED_SIZE;
+        glxAttrib [pos++] = data.accumRedSize;
+    }
+    if (data.accumGreenSize > 0) {
+        glxAttrib [pos++] = GLX.GLX_ACCUM_GREEN_SIZE;
+        glxAttrib [pos++] = data.accumGreenSize;
+    }
+    if (data.accumBlueSize > 0) {
+        glxAttrib [pos++] = GLX.GLX_ACCUM_BLUE_SIZE;
+        glxAttrib [pos++] = data.accumBlueSize;
+    }
+    if (data.accumAlphaSize > 0) {
+        glxAttrib [pos++] = GLX.GLX_ACCUM_ALPHA_SIZE;
+        glxAttrib [pos++] = data.accumAlphaSize;
+    }
+    if (data.sampleBuffers > 0) {
+        glxAttrib [pos++] = GLX.GLX_SAMPLE_BUFFERS;
+        glxAttrib [pos++] = data.sampleBuffers;
+    }
+    if (data.samples > 0) {
+        glxAttrib [pos++] = GLX.GLX_SAMPLES;
+        glxAttrib [pos++] = data.samples;
+    }
+    glxAttrib [pos++] = 0;
+    OS.gtk_widget_realize (handle);
+    auto window = OS.GTK_WIDGET_WINDOW (handle);
+    auto xDisplay = OS.gdk_x11_drawable_get_xdisplay (window);
+    auto infoPtr = GLX.glXChooseVisual (xDisplay, OS.XDefaultScreen (xDisplay), glxAttrib.ptr);
+    if (infoPtr is null) {
+        dispose ();
+        SWT.error (SWT.ERROR_UNSUPPORTED_DEPTH);
+    }
+
+    vinfo = *infoPtr;
+    //tango.stdc.string.memmove (vinfo, infoPtr, XVisualInfo.sizeof);
+    OS.XFree (infoPtr);
+    auto screen = OS.gdk_screen_get_default ();
+    auto gdkvisual = OS.gdk_x11_screen_lookup_visual (screen, vinfo.visualid);
+    //FIXME- share lists
+    //context = GLX.glXCreateContext (xDisplay, info, share is null ? 0 : share.context, true);
+    context = GLX.glXCreateContext (xDisplay, &vinfo, null, true);
+    if (context is null) 
+        SWT.error (SWT.ERROR_NO_HANDLES);
+    GdkWindowAttr attrs;
+    attrs.width = 1;
+    attrs.height = 1;
+    attrs.event_mask = OS.GDK_KEY_PRESS_MASK | OS.GDK_KEY_RELEASE_MASK |
+        OS.GDK_FOCUS_CHANGE_MASK | OS.GDK_POINTER_MOTION_MASK |
+        OS.GDK_BUTTON_PRESS_MASK | OS.GDK_BUTTON_RELEASE_MASK |
+        OS.GDK_ENTER_NOTIFY_MASK | OS.GDK_LEAVE_NOTIFY_MASK |
+        OS.GDK_EXPOSURE_MASK | OS.GDK_VISIBILITY_NOTIFY_MASK |
+        OS.GDK_POINTER_MOTION_HINT_MASK;
+    attrs.window_type = OS.GDK_WINDOW_CHILD;
+    attrs.visual = gdkvisual;
+    glWindow = OS.gdk_window_new (window, &attrs, OS.GDK_WA_VISUAL);
+    OS.gdk_window_set_user_data ( glWindow, cast(void*) handle);
+    if ((style & SWT.NO_BACKGROUND) !is 0) 
+        OS.gdk_window_set_back_pixmap (window, null, false);
+    xWindow = OS.gdk_x11_drawable_get_xid ( glWindow );
+    OS.gdk_window_show (glWindow);
+
+    Listener listener = new class() Listener {
+        public void handleEvent (Event event) {
+            switch (event.type) {
+            case SWT.Paint:
+                /**
+                * Bug in MESA.  MESA does some nasty sort of polling to try
+                * to ensure that their buffer sizes match the current X state.
+                * This state can be updated using glViewport().
+                * FIXME: There has to be a better way of doing this.
+                */
+                int[4] viewport;
+                GLX.glGetIntegerv (GLX.GL_VIEWPORT, viewport);
+                GLX.glViewport (viewport [0],viewport [1],viewport [2],viewport [3]);
+                break;
+            case SWT.Resize:
+                Rectangle clientArea = getClientArea();
+                OS.gdk_window_move (glWindow, clientArea.x, clientArea.y);
+                OS.gdk_window_resize (glWindow, clientArea.width, clientArea.height);
+                break;
+            case SWT.Dispose:
+                auto window = OS.GTK_WIDGET_WINDOW (handle);
+                auto xDisplay = OS.gdk_x11_drawable_get_xdisplay (window);
+                if (context !is null) {
+                    if (GLX.glXGetCurrentContext () is context) {
+                        GLX.glXMakeCurrent (xDisplay, 0, null);
+                    }
+                    GLX.glXDestroyContext (xDisplay, context);
+                    context = null;
+                }
+                if (glWindow !is null) {
+                    OS.gdk_window_destroy (glWindow);
+                    glWindow = null;
+                }
+                break;
+            }
+        }
+    };
+    addListener (SWT.Resize, listener);
+    addListener (SWT.Paint, listener);
+    addListener (SWT.Dispose, listener);
+}
+
+/**
+ * Returns a GLData object describing the created context.
+ *  
+ * @return GLData description of the OpenGL context attributes
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public GLData getGLData () {
+    checkWidget ();
+    auto window = OS.GTK_WIDGET_WINDOW (handle);
+    auto xDisplay = OS.gdk_x11_drawable_get_xdisplay (window);
+    GLData data = new GLData ();
+    int [1] value;
+    GLX.glXGetConfig (xDisplay, &vinfo, GLX.GLX_DOUBLEBUFFER, value);
+    data.doubleBuffer = value [0] !is 0;
+    GLX.glXGetConfig (xDisplay, &vinfo, GLX.GLX_STEREO, value);
+    data.stereo = value [0] !is 0;
+    GLX.glXGetConfig (xDisplay, &vinfo, GLX.GLX_RED_SIZE, value);
+    data.redSize = value [0];
+    GLX.glXGetConfig (xDisplay, &vinfo, GLX.GLX_GREEN_SIZE, value);
+    data.greenSize = value [0];
+    GLX.glXGetConfig (xDisplay, &vinfo, GLX.GLX_BLUE_SIZE, value);
+    data.blueSize = value [0];
+    GLX.glXGetConfig (xDisplay, &vinfo, GLX.GLX_ALPHA_SIZE, value);
+    data.alphaSize = value [0];
+    GLX.glXGetConfig (xDisplay, &vinfo, GLX.GLX_DEPTH_SIZE, value);
+    data.depthSize = value [0];
+    GLX.glXGetConfig (xDisplay, &vinfo, GLX.GLX_STENCIL_SIZE, value);
+    data.stencilSize = value [0];
+    GLX.glXGetConfig (xDisplay, &vinfo, GLX.GLX_ACCUM_RED_SIZE, value);
+    data.accumRedSize = value [0];
+    GLX.glXGetConfig (xDisplay, &vinfo, GLX.GLX_ACCUM_GREEN_SIZE, value);
+    data.accumGreenSize = value [0];
+    GLX.glXGetConfig (xDisplay, &vinfo, GLX.GLX_ACCUM_BLUE_SIZE, value);
+    data.accumBlueSize = value [0];
+    GLX.glXGetConfig (xDisplay, &vinfo, GLX.GLX_ACCUM_ALPHA_SIZE, value);
+    data.accumAlphaSize = value [0];
+    GLX.glXGetConfig (xDisplay, &vinfo, GLX.GLX_SAMPLE_BUFFERS, value);
+    data.sampleBuffers = value [0];
+    GLX.glXGetConfig (xDisplay, &vinfo, GLX.GLX_SAMPLES, value);
+    data.samples = value [0];
+    return data;
+}
+
+/**
+ * Returns a bool indicating whether the receiver's OpenGL context
+ * is the current context.
+ *  
+ * @return true if the receiver holds the current OpenGL context,
+ * false otherwise
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool isCurrent () {
+    checkWidget ();
+    return (GLX.glXGetCurrentContext () is context);
+}
+
+/**
+ * Sets the OpenGL context associated with this GLCanvas to be the
+ * current GL context.
+ * 
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setCurrent () {
+    checkWidget ();
+    if (GLX.glXGetCurrentContext () is context) return;
+    auto window = OS.GTK_WIDGET_WINDOW (handle);
+    auto xDisplay = OS.gdk_x11_drawable_get_xdisplay (window);
+    GLX.glXMakeCurrent (xDisplay, xWindow, context);
+}
+
+/**
+ * Swaps the front and back color buffers.
+ * 
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void swapBuffers () {
+    checkWidget ();
+    auto window = OS.GTK_WIDGET_WINDOW (handle);
+    auto xDisplay = OS.gdk_x11_drawable_get_xdisplay (window);
+    GLX.glXSwapBuffers (xDisplay, xWindow);
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/opengl/GLData.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D Programming Language:
+ *     John Reimer <terminal.node@gmail.com>
+ *******************************************************************************/
+
+module org.eclipse.swt.opengl.GLData;
+
+import java.lang.all;
+
+import tango.text.Util;
+import tango.util.Convert;
+
+/**
+ * The GLData class is a device-independent description
+ * of the pixel format attributes of a GL drawable.
+ *
+ * @see GLCanvas
+ * @see <a href="http://www.eclipse.org/swt/snippets/#opengl">OpenGL snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ * 
+ * @since 3.2
+ */
+
+public class GLData {
+    /**
+     * Specifies a double-buffered surface.  During context
+     * creation, only double-buffered formats are considered
+     * when set to true. 
+     */
+    public bool doubleBuffer;
+
+    /**
+     * Specifies a stereo surface.  During context creation,
+     * only stereo formats are considered when set to true. 
+     */
+    public bool stereo;
+
+    /**
+     * The size in bits of the color buffer's red channel.
+     * During context creation, this specifies the minimum
+     * required red bits.
+     */
+    public int redSize;
+
+    /**
+     * The size in bits of the color buffer's green channel.
+     * During context creation, this specifies the minimum
+     * required green bits.
+     */
+    public int greenSize;
+
+    /**
+     * The size in bits of the color buffer's blue channel.
+     * During context creation, this specifies the minimum
+     * required blue bits.
+     */
+    public int blueSize;
+
+    /**
+     * The size in bits of the color buffer's alpha channel.
+     * During context creation, this specifies the minimum
+     * required alpha bits.
+     */
+    public int alphaSize;
+
+    /**
+     * The size in bits of the depth buffer.  During context
+     * creation, the smallest depth buffer of at least the
+     * specified value is preferred, or zero for no depth
+     * buffer.
+     */
+    public int depthSize;
+
+    /**
+     * The desired number of stencil bitplanes.  During
+     * context creation, the smallest stencil buffer of at
+     * least the specified value is preferred, or zero for
+     * no stencil buffer.
+     */
+    public int stencilSize;
+
+    /**
+     * The size in bits of the accumulation buffer's red
+     * channel. During context creation, this specifies the
+     * minimum required red bits.
+     */
+    public int accumRedSize;
+
+    /**
+     * The size in bits of the accumulation buffer's green
+     * channel. During context creation, this specifies the
+     * minimum required green bits.
+     */
+    public int accumGreenSize;
+
+    /**
+     * The size in bits of the accumulation buffer's blue
+     * channel. During context creation, this specifies the
+     * minimum required blue bits.
+     */
+    public int accumBlueSize;
+
+    /**
+     * The size in bits of the accumulation buffer's alpha
+     * channel. During context creation, this specifies the
+     * minimum required alpha bits.
+     */
+    public int accumAlphaSize;
+
+    /**
+     * The number of multisample buffers used by this context.
+     * During context creation, this specifies the minimum
+     * number of multisample buffers requested.
+     */
+    public int sampleBuffers;
+
+    /**
+     * The number of samples accepted in the multisample buffer.
+     * During creation, pixel formats with the smallest number of
+     * samples that meets or exceeds the specified minimum number
+     * are preferred.
+     */
+    public int samples;
+    
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the data
+ */
+
+    override public String toString() {
+        String string = doubleBuffer ? "doubleBuffer," : "";
+        string ~= stereo ? "stereo," : "";
+        string ~= "r:" ~     to!(String)(redSize)  ~ " g:" ~ to!(String)(greenSize) ~ 
+                  " b:" ~    to!(String)(blueSize) ~ " a:" ~ to!(String)(alphaSize) ~ "," ~
+                  "depth:" ~ to!(String)(depthSize) ~ ",stencil:" ~ to!(String)(stencilSize) ~
+                  ",accum r:" ~ to!(String)(accumRedSize) ~ "g:" ~ to!(String)(accumGreenSize) ~ 
+                  "b:" ~ to!(String)(accumBlueSize) ~ "a:" ~ to!(String)(accumAlphaSize) ~
+                  ",sampleBuffers:" ~ to!(String)(sampleBuffers) ~ ",samples:" ~ to!(String)(samples);
+        return string;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/opengl/all.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,8 @@
+module org.eclipse.swt.opengl.all;
+
+import java.lang.all;
+
+public import org.eclipse.swt.opengl.GLCanvas;
+public import org.eclipse.swt.opengl.GLData;
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/printing/PrintDialog.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,476 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.printing.PrintDialog;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.internal.LONG;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Dialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swt.printing.Printer;
+import org.eclipse.swt.printing.PrinterData;
+import java.lang.all;
+
+import tango.util.Convert;
+
+/**
+ * Instances of this class allow the user to select
+ * a printer and various print-related parameters
+ * prior to starting a print job.
+ * <p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#printing">Printing snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample, Dialog tab</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class PrintDialog : Dialog {
+    PrinterData printerData;
+    int scope_ = PrinterData.ALL_PAGES;
+    int startPage = 1, endPage = 1;
+    bool printToFile = false;
+
+    GtkPrintUnixDialog* handle;
+    int index;
+    char [] settingsData;
+
+    static const String GET_MODAL_DIALOG = "org.eclipse.swt.internal.gtk.getModalDialog";
+    static const String SET_MODAL_DIALOG = "org.eclipse.swt.internal.gtk.setModalDialog";
+    static const String ADD_IDLE_PROC_KEY = "org.eclipse.swt.internal.gtk.addIdleProc";
+    static const String REMOVE_IDLE_PROC_KEY = "org.eclipse.swt.internal.gtk.removeIdleProc";
+    static const String GET_EMISSION_PROC_KEY = "org.eclipse.swt.internal.gtk.getEmissionProc";
+/**
+ * Constructs a new instance of this class given only its parent.
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Shell parent) {
+    this (parent, SWT.PRIMARY_MODAL);
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Shell parent, int style) {
+    super (parent, parent is null? style : checkStyleBit (parent, style));
+    checkSubclass ();
+}
+
+/**
+ * Sets the printer data that will be used when the dialog
+ * is opened.
+ *
+ * @param data the data that will be used when the dialog is opened
+ *
+ * @since 3.4
+ */
+public void setPrinterData(PrinterData data) {
+    this.printerData = data;
+}
+
+/**
+ * Returns the printer data that will be used when the dialog
+ * is opened.
+ *
+ * @return the data that will be used when the dialog is opened
+ *
+ * @since 3.4
+ */
+public PrinterData getPrinterData() {
+    return printerData;
+}
+
+static int checkBits (int style, int int0, int int1, int int2, int int3, int int4, int int5) {
+    int mask = int0 | int1 | int2 | int3 | int4 | int5;
+    if ((style & mask) is 0) style |= int0;
+    if ((style & int0) !is 0) style = (style & ~mask) | int0;
+    if ((style & int1) !is 0) style = (style & ~mask) | int1;
+    if ((style & int2) !is 0) style = (style & ~mask) | int2;
+    if ((style & int3) !is 0) style = (style & ~mask) | int3;
+    if ((style & int4) !is 0) style = (style & ~mask) | int4;
+    if ((style & int5) !is 0) style = (style & ~mask) | int5;
+    return style;
+}
+
+static int checkStyleBit (Shell parent, int style) {
+    style &= ~SWT.MIRRORED;
+    if ((style & (SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT)) is 0) {
+        if (parent !is null) {
+            if ((parent.getStyle () & SWT.LEFT_TO_RIGHT) !is 0) style |= SWT.LEFT_TO_RIGHT;
+            if ((parent.getStyle () & SWT.RIGHT_TO_LEFT) !is 0) style |= SWT.RIGHT_TO_LEFT;
+        }
+    }
+    return checkBits (style, SWT.LEFT_TO_RIGHT, SWT.RIGHT_TO_LEFT, 0, 0, 0, 0);
+}
+
+/**
+ * Returns the print job scope that the user selected
+ * before pressing OK in the dialog. This will be one
+ * of the following values:
+ * <dl>
+ * <dt><code>PrinterData.ALL_PAGES</code></dt>
+ * <dd>Print all pages in the current document</dd>
+ * <dt><code>PrinterData.PAGE_RANGE</code></dt>
+ * <dd>Print the range of pages specified by startPage and endPage</dd>
+ * <dt><code>PrinterData.SELECTION</code></dt>
+ * <dd>Print the current selection</dd>
+ * </dl>
+ *
+ * @return the scope setting that the user selected
+ */
+public int getScope() {
+    return scope_;
+}
+
+/**
+ * Sets the scope of the print job. The user will see this
+ * setting when the dialog is opened. This can have one of
+ * the following values:
+ * <dl>
+ * <dt><code>PrinterData.ALL_PAGES</code></dt>
+ * <dd>Print all pages in the current document</dd>
+ * <dt><code>PrinterData.PAGE_RANGE</code></dt>
+ * <dd>Print the range of pages specified by startPage and endPage</dd>
+ * <dt><code>PrinterData.SELECTION</code></dt>
+ * <dd>Print the current selection</dd>
+ * </dl>
+ *
+ * @param scope the scope setting when the dialog is opened
+ */
+public void setScope(int scope_) {
+    this.scope_ = scope_;
+}
+
+/**
+ * Returns the start page setting that the user selected
+ * before pressing OK in the dialog.
+ * <p>
+ * This value can be from 1 to the maximum number of pages for the platform.
+ * Note that it is only valid if the scope is <code>PrinterData.PAGE_RANGE</code>.
+ * </p>
+ *
+ * @return the start page setting that the user selected
+ */
+public int getStartPage() {
+    return startPage;
+}
+
+/**
+ * Sets the start page that the user will see when the dialog
+ * is opened.
+ * <p>
+ * This value can be from 1 to the maximum number of pages for the platform.
+ * Note that it is only valid if the scope is <code>PrinterData.PAGE_RANGE</code>.
+ * </p>
+ *
+ * @param startPage the startPage setting when the dialog is opened
+ */
+public void setStartPage(int startPage) {
+    this.startPage = startPage;
+}
+
+/**
+ * Returns the end page setting that the user selected
+ * before pressing OK in the dialog.
+ * <p>
+ * This value can be from 1 to the maximum number of pages for the platform.
+ * Note that it is only valid if the scope is <code>PrinterData.PAGE_RANGE</code>.
+ * </p>
+ *
+ * @return the end page setting that the user selected
+ */
+public int getEndPage() {
+    return endPage;
+}
+
+/**
+ * Sets the end page that the user will see when the dialog
+ * is opened.
+ * <p>
+ * This value can be from 1 to the maximum number of pages for the platform.
+ * Note that it is only valid if the scope is <code>PrinterData.PAGE_RANGE</code>.
+ * </p>
+ *
+ * @param endPage the end page setting when the dialog is opened
+ */
+public void setEndPage(int endPage) {
+    this.endPage = endPage;
+}
+
+/**
+ * Returns the 'Print to file' setting that the user selected
+ * before pressing OK in the dialog.
+ *
+ * @return the 'Print to file' setting that the user selected
+ */
+public bool getPrintToFile() {
+    return printToFile;
+}
+
+/**
+ * Sets the 'Print to file' setting that the user will see
+ * when the dialog is opened.
+ *
+ * @param printToFile the 'Print to file' setting when the dialog is opened
+ */
+public void setPrintToFile(bool printToFile) {
+    this.printToFile = printToFile;
+}
+
+/**
+ * Makes the receiver visible and brings it to the front
+ * of the display.
+ *
+ * @return a printer data object describing the desired print job parameters
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public PrinterData open() {
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 10, 0)) {
+        return Printer.getDefaultPrinterData();
+    } else {
+        char* titleBytes = toStringz( getText() );
+        auto topHandle = getParent().handle;
+        while (topHandle !is null && !OS.GTK_IS_WINDOW(topHandle)) {
+            topHandle = OS.gtk_widget_get_parent(topHandle);
+        }
+        handle = cast(GtkPrintUnixDialog*)OS.gtk_print_unix_dialog_new(titleBytes, cast(GtkWindow*)topHandle);
+
+        //TODO: Not currently implemented. May need new API. For now, disable 'Current' in the dialog. (see gtk bug 344519)
+        OS.gtk_print_unix_dialog_set_current_page(handle, -1);
+
+        OS.gtk_print_unix_dialog_set_manual_capabilities(handle,
+            OS.GTK_PRINT_CAPABILITY_COLLATE | OS.GTK_PRINT_CAPABILITY_COPIES | OS.GTK_PRINT_CAPABILITY_PAGE_SET);
+
+        /* Set state into print dialog settings. */
+        auto settings = OS.gtk_print_settings_new();
+        auto page_setup = OS.gtk_page_setup_new();
+
+        if (printerData !is null) {
+            if (printerData.otherData !is null) {
+                Printer.restore(printerData.otherData, settings, page_setup);
+            }
+            /* Set values of settings from PrinterData. */
+            Printer.setScope(settings, printerData.scope_, printerData.startPage, printerData.endPage);
+            //TODO: Should we look at printToFile, or driver/name for "Print to File", or both? (see gtk bug 345590)
+            if (printerData.printToFile) {
+                char* buffer = toStringz(printerData.fileName);
+                OS.gtk_print_settings_set(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI.ptr, buffer);
+            }
+            if (printerData.driver.equals("GtkPrintBackendFile") && printerData.name.equals("Print to File")) { //$NON-NLS-1$ //$NON-NLS-2$
+                char* buffer = toStringz(printerData.fileName);
+                OS.gtk_print_settings_set(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI.ptr, buffer);
+            }
+            OS.gtk_print_settings_set_n_copies(settings, printerData.copyCount);
+            OS.gtk_print_settings_set_collate(settings, printerData.collate);
+        }
+
+        Printer.setScope(settings, scope_, startPage, endPage);
+
+        if (printToFile) {
+            char* buffer = toStringz( "Print to File" ); //$NON-NLS-1$
+            OS.gtk_print_settings_set_printer(settings, buffer);
+        }
+        OS.gtk_print_unix_dialog_set_settings(handle, settings);
+        OS.gtk_print_unix_dialog_set_page_setup(handle, page_setup);
+        OS.g_object_unref(settings);
+        OS.g_object_unref(page_setup);
+
+        PrinterData data = null;
+        //TODO: Handle 'Print Preview' (GTK_RESPONSE_APPLY).
+        Display display = getParent() !is null ? getParent().getDisplay (): Display.getCurrent ();
+
+        int signalId = 0;
+        int /*long*/ hookId = 0;
+        if ((getStyle () & SWT.RIGHT_TO_LEFT) !is 0) {
+            signalId = OS.g_signal_lookup (OS.map.ptr, OS.GTK_TYPE_WIDGET());
+            hookId = OS.g_signal_add_emission_hook (signalId, 0, cast(GSignalEmissionHook)cast(void*)(cast(LONG) display.getData (GET_EMISSION_PROC_KEY)).value, handle, null);
+        }
+        display.setData (ADD_IDLE_PROC_KEY, null);
+        Object oldModal = null;
+        if (OS.gtk_window_get_modal (handle)) {
+            oldModal = display.getData (GET_MODAL_DIALOG);
+            display.setData (SET_MODAL_DIALOG, this);
+        }
+        int response = OS.gtk_dialog_run (handle);
+        if (OS.gtk_window_get_modal (handle)) {
+            display.setData (SET_MODAL_DIALOG, oldModal);
+        }
+        if ((getStyle () & SWT.RIGHT_TO_LEFT) !is 0) {
+            OS.g_signal_remove_emission_hook (signalId, hookId);
+        }
+        if (response is OS.GTK_RESPONSE_OK) {
+            auto printer = OS.gtk_print_unix_dialog_get_selected_printer(handle);
+            if (printer !is null) {
+
+                /* Get state from print dialog. */
+                settings = OS.gtk_print_unix_dialog_get_settings(handle); // must unref
+                page_setup = OS.gtk_print_unix_dialog_get_page_setup(handle); // do not unref
+                data = Printer.printerDataFromGtkPrinter(printer);
+                int print_pages = OS.gtk_print_settings_get_print_pages(settings);
+                switch (print_pages) {
+                    case OS.GTK_PRINT_PAGES_ALL:
+                        scope_ = PrinterData.ALL_PAGES;
+                        break;
+                    case OS.GTK_PRINT_PAGES_RANGES:
+                        scope_ = PrinterData.PAGE_RANGE;
+                        int num_ranges;
+                        auto page_ranges = OS.gtk_print_settings_get_page_ranges(settings, &num_ranges);
+                        int length = num_ranges;
+                        int min = int.max, max = 0;
+                        for (int i = 0; i < length; i++) {
+                            min = Math.min(min, page_ranges[i].start + 1);
+                            max = Math.max(max, page_ranges[i].end + 1);
+                        }
+                        OS.g_free(page_ranges);
+                        startPage = min is int.max ? 1 : min;
+                        endPage = max is 0 ? 1 : max;
+                        break;
+                    case OS.GTK_PRINT_PAGES_CURRENT:
+                        //TODO: Disabled in dialog (see above). This code will not run. (see gtk bug 344519)
+                        scope_ = PrinterData.SELECTION;
+                        startPage = endPage = OS.gtk_print_unix_dialog_get_current_page(handle);
+                        break;
+                    default:
+                }
+
+                printToFile = ( data.name.equals("Print to File")); //$NON-NLS-1$
+                if (printToFile) {
+                    auto address = OS.gtk_print_settings_get(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI.ptr);
+                    data.fileName = fromStringz( address).dup;
+                }
+
+                data.scope_ = scope_;
+                data.startPage = startPage;
+                data.endPage = endPage;
+                data.printToFile = printToFile;
+                data.copyCount = OS.gtk_print_settings_get_n_copies(settings);
+                data.collate = cast(bool)OS.gtk_print_settings_get_collate(settings);
+
+                /* Save other print_settings data as key/value pairs in otherData. */
+                index = 0;
+                settingsData = new char[1024];
+                settingsData[] = '\0';
+                OS.gtk_print_settings_foreach (settings, &GtkPrintSettingsFunc, cast(void*)this );
+                index++; // extra null terminator after print_settings and before page_setup
+
+                /* Save page_setup data as key/value pairs in otherData.
+                 * Note that page_setup properties must be stored and restored in the same order.
+                 */
+                store("orientation", OS.gtk_page_setup_get_orientation(page_setup)); //$NON-NLS-1$
+                store("top_margin", OS.gtk_page_setup_get_top_margin(page_setup, OS.GTK_UNIT_MM)); //$NON-NLS-1$
+                store("bottom_margin", OS.gtk_page_setup_get_bottom_margin(page_setup, OS.GTK_UNIT_MM)); //$NON-NLS-1$
+                store("left_margin", OS.gtk_page_setup_get_left_margin(page_setup, OS.GTK_UNIT_MM)); //$NON-NLS-1$
+                store("right_margin", OS.gtk_page_setup_get_right_margin(page_setup, OS.GTK_UNIT_MM)); //$NON-NLS-1$
+                auto paper_size = OS.gtk_page_setup_get_paper_size(page_setup); //$NON-NLS-1$
+                storeBytes("paper_size_name", OS.gtk_paper_size_get_name(paper_size)); //$NON-NLS-1$
+                storeBytes("paper_size_display_name", OS.gtk_paper_size_get_display_name(paper_size)); //$NON-NLS-1$
+                storeBytes("paper_size_ppd_name", OS.gtk_paper_size_get_ppd_name(paper_size)); //$NON-NLS-1$
+                store("paper_size_width", OS.gtk_paper_size_get_width(paper_size, OS.GTK_UNIT_MM)); //$NON-NLS-1$
+                store("paper_size_height", OS.gtk_paper_size_get_height(paper_size, OS.GTK_UNIT_MM)); //$NON-NLS-1$
+                store("paper_size_is_custom", OS.gtk_paper_size_is_custom(paper_size)); //$NON-NLS-1$
+                data.otherData = settingsData;
+                OS.g_object_unref(settings);
+            }
+        }
+        display.setData (REMOVE_IDLE_PROC_KEY, null);
+        OS.gtk_widget_destroy (handle);
+        return data;
+    }
+}
+
+private static extern(C) void GtkPrintSettingsFunc (char* key, char* value, void* data) {
+    (cast(PrintDialog)data).GtkPrintSettingsMeth(key, value );
+}
+
+void GtkPrintSettingsMeth (char* key, char* value) {
+    store( fromStringz(key).dup, fromStringz(value).dup );
+}
+
+void store(String key, int value) {
+    store(key, to!(String)(value));
+}
+
+void store(String key, double value) {
+    store(key, to!(String)(value));
+}
+
+void store(String key, bool value) {
+    store(key, to!(String)(value));
+}
+
+void storeBytes(String key, char* value) {
+    store(key, fromStringz(value).dup );
+}
+
+void store(char [] key, String value) {
+    int length = key.length + 1 + value.length + 1;
+    if (index + length + 1 > settingsData.length) {
+        char [] newData = new char[settingsData.length + Math.max(length + 1, 1024)];
+        newData[] = '\0';
+        System.arraycopy (settingsData, 0, newData, 0, settingsData.length);
+        settingsData = newData;
+    }
+    System.arraycopy (key, 0, settingsData, index, key.length);
+    index += key.length + 1; // null terminated
+    System.arraycopy (value, 0, settingsData, index, value.length);
+    index += value.length + 1; // null terminated
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/printing/Printer.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,769 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.printing.Printer;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.DeviceData;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GCData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.internal.cairo.Cairo;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.printing.PrinterData;
+import java.lang.all;
+
+import tango.util.Convert;
+
+
+/**
+ * Instances of this class are used to print to a printer.
+ * Applications create a GC on a printer using <code>new GC(printer)</code>
+ * and then draw on the printer GC using the usual graphics calls.
+ * <p>
+ * A <code>Printer</code> object may be constructed by providing
+ * a <code>PrinterData</code> object which identifies the printer.
+ * A <code>PrintDialog</code> presents a print dialog to the user
+ * and returns an initialized instance of <code>PrinterData</code>.
+ * Alternatively, calling <code>new Printer()</code> will construct a
+ * printer object for the user's default printer.
+ * </p><p>
+ * Application code must explicitly invoke the <code>Printer.dispose()</code>
+ * method to release the operating system resources managed by each instance
+ * when those instances are no longer required.
+ * </p>
+ *
+ * @see PrinterData
+ * @see PrintDialog
+ * @see <a href="http://www.eclipse.org/swt/snippets/#printing">Printing snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public final class Printer : Device {
+    static PrinterData [] printerList;
+
+    PrinterData data;
+    GtkPrinter* printer;
+    GtkPrintJob* printJob;
+    GtkPrintSettings* settings;
+    void* pageSetup;
+    cairo_surface_t* surface;
+    cairo_t* cairo;
+
+    /**
+     * whether or not a GC was created for this printer
+     */
+    bool isGCCreated = false;
+    Font systemFont;
+
+    static String settingsData;
+    static int start, end;
+
+    static const String GTK_LPR_BACKEND = "GtkPrintBackendLpr"; //$NON-NLS-1$
+
+    static const bool disablePrinting = false;// System.getProperty("org.eclipse.swt.internal.gtk.disablePrinting") !is null; //$NON-NLS-1$
+
+/**
+ * Returns an array of <code>PrinterData</code> objects
+ * representing all available printers.
+ *
+ * @return the list of available printers
+ */
+public static PrinterData[] getPrinterList() {
+    printerList = new PrinterData [0];
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 10, 0) || disablePrinting) {
+        return printerList;
+    }
+    if (!OS.g_thread_supported ()) {
+        OS.g_thread_init (null);
+    }
+    OS.gtk_set_locale();
+    int argc = 0;
+    if (!OS.gtk_init_check ( &argc, null)) {
+        SWT.error (SWT.ERROR_NO_HANDLES, null, " [gtk_init_check() failed]");
+    }
+    OS.gtk_enumerate_printers(&GtkPrinterFunc_List, null, null, true);
+    return printerList;
+}
+
+private static extern(C) int GtkPrinterFunc_List (GtkPrinter* printer, void* user_data) {
+    int length_ = printerList.length;
+    PrinterData [] newList = new PrinterData [length_ + 1];
+    System.arraycopy (printerList, 0, newList, 0, length_);
+    printerList = newList;
+    printerList [length_] = printerDataFromGtkPrinter(printer);
+    /*
+    * Bug in GTK. While performing a gtk_enumerate_printers(), GTK finds all of the
+    * available printers from each backend and can hang. If a backend requires more
+    * time to gather printer info, GTK will start an event loop waiting for a done
+    * signal before continuing. For the Lpr backend, GTK does not send a done signal
+    * which means the event loop never ends. The fix is to check to see if the driver
+    * is of type Lpr, and stop the enumeration, which exits the event loop.
+    */
+    if (printerList[length_].driver.equals(GTK_LPR_BACKEND)) return 1;
+    return 0;
+}
+
+/**
+ * Returns a <code>PrinterData</code> object representing
+ * the default printer or <code>null</code> if there is no
+ * printer available on the System.
+ *
+ * @return the default printer data or null
+ *
+ * @since 2.1
+ */
+public static PrinterData getDefaultPrinterData() {
+    printerList = new PrinterData [1];
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 10, 0) || disablePrinting) {
+        return null;
+    }
+    if (!OS.g_thread_supported ()) {
+        OS.g_thread_init (null);
+    }
+    OS.gtk_set_locale();
+    int argc = 0;
+    if (!OS.gtk_init_check (&argc, null)) {
+        SWT.error (SWT.ERROR_NO_HANDLES, null, " [gtk_init_check() failed]");
+    }
+    OS.gtk_enumerate_printers(&GtkPrinterFunc_Default, null, null, true);
+    return printerList[0];
+}
+
+private static extern(C) int GtkPrinterFunc_Default (GtkPrinter* printer, void* user_data) {
+    if (OS.gtk_printer_is_default(printer)) {
+        printerList[0] = printerDataFromGtkPrinter(printer);
+        return 1;
+    } else if (OS.GTK_VERSION < OS.buildVERSION(2, 10, 12) && printerDataFromGtkPrinter(printer).driver.equals (GTK_LPR_BACKEND)) {
+        return 1;
+    }
+    return 0;
+}
+
+GtkPrinter* gtkPrinterFromPrinterData() {
+    printer = null;
+    OS.gtk_enumerate_printers(&GtkPrinterFunc_FindNamedPrinterFunc, cast(void*)this, null, true);
+    return printer;
+}
+
+private static extern(C) int GtkPrinterFunc_FindNamedPrinterFunc (GtkPrinter* printer, void* user_data) {
+    return (cast(Printer)user_data).GtkPrinterFunc_FindNamedPrinter( printer, null );
+}
+int GtkPrinterFunc_FindNamedPrinter (GtkPrinter* printer, void* user_data) {
+    PrinterData pd = printerDataFromGtkPrinter(printer);
+    if (pd.driver.equals(data.driver) && pd.name.equals(data.name)) {
+        this.printer = printer;
+        OS.g_object_ref(printer);
+        return 1;
+    } else if (OS.GTK_VERSION < OS.buildVERSION (2, 10, 12) && pd.driver.equals(GTK_LPR_BACKEND)) {
+        return 1;
+    }
+    return 0;
+}
+
+static PrinterData printerDataFromGtkPrinter(GtkPrinter*  printer) {
+    auto backend = OS.gtk_printer_get_backend(printer);
+    auto address = OS.G_OBJECT_TYPE_NAME(backend);
+    String backendType = fromStringz( address ).dup;
+
+    address = OS.gtk_printer_get_name (printer);
+    String name = fromStringz( address ).dup;
+
+    return new PrinterData (backendType, name);
+}
+
+/*
+* Restore printer settings and page_setup data from data.
+*/
+static void restore(char[] data, GtkPrintSettings* settings, GtkPageSetup* page_setup) {
+    settingsData = data;
+    start = end = 0;
+    while (end < settingsData.length && settingsData[end] !is 0) {
+        start = end;
+        while (end < settingsData.length && settingsData[end] !is 0) end++;
+        end++;
+        char [] keyBuffer = new char [end - start];
+        System.arraycopy (settingsData, start, keyBuffer, 0, keyBuffer.length);
+        start = end;
+        while (end < settingsData.length && settingsData[end] !is 0) end++;
+        end++;
+        char [] valueBuffer = new char [end - start];
+        System.arraycopy (settingsData, start, valueBuffer, 0, valueBuffer.length);
+        OS.gtk_print_settings_set(settings, keyBuffer.ptr, valueBuffer.ptr);
+        if (DEBUG) getDwtLogger().info( __FILE__, __LINE__, "{}: {}", keyBuffer, valueBuffer );
+    }
+    end++; // skip extra null terminator
+
+    /* Retrieve stored page_setup data.
+     * Note that page_setup properties must be stored (in PrintDialog) and restored (here) in the same order.
+     */
+    OS.gtk_page_setup_set_orientation(page_setup, restoreInt("orientation")); //$NON-NLS-1$
+    OS.gtk_page_setup_set_top_margin(page_setup, restoreDouble("top_margin"), OS.GTK_UNIT_MM); //$NON-NLS-1$
+    OS.gtk_page_setup_set_bottom_margin(page_setup, restoreDouble("bottom_margin"), OS.GTK_UNIT_MM); //$NON-NLS-1$
+    OS.gtk_page_setup_set_left_margin(page_setup, restoreDouble("left_margin"), OS.GTK_UNIT_MM); //$NON-NLS-1$
+    OS.gtk_page_setup_set_right_margin(page_setup, restoreDouble("right_margin"), OS.GTK_UNIT_MM); //$NON-NLS-1$
+    char [] name = restoreBytes("paper_size_name", true); //$NON-NLS-1$
+    char [] display_name = restoreBytes("paper_size_display_name", true); //$NON-NLS-1$
+    char [] ppd_name = restoreBytes("paper_size_ppd_name", true); //$NON-NLS-1$
+    double width = restoreDouble("paper_size_width"); //$NON-NLS-1$
+    double height = restoreDouble("paper_size_height"); //$NON-NLS-1$
+    bool custom = restoreBoolean("paper_size_is_custom"); //$NON-NLS-1$
+    GtkPaperSize* paper_size = null;
+    if (custom) {
+        if (ppd_name.length > 0) {
+            paper_size = OS.gtk_paper_size_new_from_ppd(ppd_name.ptr, display_name.ptr, width, height);
+        } else {
+            paper_size = OS.gtk_paper_size_new_custom(name.ptr, display_name.ptr, width, height, OS.GTK_UNIT_MM);
+        }
+    } else {
+        paper_size = OS.gtk_paper_size_new(name.ptr);
+    }
+    OS.gtk_page_setup_set_paper_size(page_setup, paper_size);
+    OS.gtk_paper_size_free(paper_size);
+}
+
+static void setScope(GtkPrintSettings* settings, int scope_, int startPage, int endPage) {
+    switch (scope_) {
+    case PrinterData.ALL_PAGES:
+        OS.gtk_print_settings_set_print_pages(settings, OS.GTK_PRINT_PAGES_ALL);
+        break;
+    case PrinterData.PAGE_RANGE:
+        OS.gtk_print_settings_set_print_pages(settings, OS.GTK_PRINT_PAGES_RANGES);
+        GtkPageRange pageRange;
+        pageRange.start = startPage - 1;
+        pageRange.end = endPage - 1;
+        OS.gtk_print_settings_set_page_ranges(settings, &pageRange, 1);
+        break;
+    case PrinterData.SELECTION:
+        //TODO: Not correctly implemented. May need new API. For now, set to ALL. (see gtk bug 344519)
+        OS.gtk_print_settings_set_print_pages(settings, OS.GTK_PRINT_PAGES_ALL);
+        break;
+    default:
+    }
+}
+
+static DeviceData checkNull (PrinterData data) {
+    if (data is null) data = new PrinterData();
+    if (data.driver is null || data.name is null) {
+        PrinterData defaultPrinter = getDefaultPrinterData();
+        if (defaultPrinter is null) SWT.error(SWT.ERROR_NO_HANDLES);
+        data.driver = defaultPrinter.driver;
+        data.name = defaultPrinter.name;
+    }
+    return data;
+}
+
+/**
+ * Constructs a new printer representing the default printer.
+ * <p>
+ * You must dispose the printer when it is no longer required.
+ * </p>
+ *
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES - if there are no valid printers
+ * </ul>
+ *
+ * @see Device#dispose
+ */
+public this() {
+    this(null);
+}
+
+/**
+ * Constructs a new printer given a <code>PrinterData</code>
+ * object representing the desired printer.
+ * <p>
+ * You must dispose the printer when it is no longer required.
+ * </p>
+ *
+ * @param data the printer data for the specified printer
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the specified printer data does not represent a valid printer
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES - if there are no valid printers
+ * </ul>
+ *
+ * @see Device#dispose
+ */
+public this(PrinterData data) {
+    super(checkNull(data));
+}
+
+static int restoreInt(String key) {
+    char [] value = restoreBytes(key, false);
+    return to!(int)( value );
+}
+
+static double restoreDouble(String key) {
+    char [] value = restoreBytes(key, false);
+    return to!(double)( value );
+}
+
+static bool restoreBoolean(String key) {
+    char [] value = restoreBytes(key, false);
+    return to!(bool)( value );
+}
+
+static String restoreBytes(String key, bool nullTerminate) {
+    //get key
+    start = end;
+    while (end < settingsData.length && settingsData[end] !is 0) end++;
+    end++;
+    char [] keyBuffer = new char [end - start];
+    System.arraycopy (settingsData, start, keyBuffer, 0, keyBuffer.length);
+
+    //get value
+    start = end;
+    while (end < settingsData.length && settingsData[end] !is 0) end++;
+    int length_ = end - start;
+    end++;
+    if (nullTerminate) length_++;
+    char [] valueBuffer = new char [length_];
+    System.arraycopy (settingsData, start, valueBuffer, 0, length_);
+
+    if (DEBUG) getDwtLogger().info( __FILE__, __LINE__,  "{}: {}", keyBuffer, valueBuffer );
+
+    return valueBuffer;
+}
+
+/**
+ * Returns a reasonable font for applications to use.
+ * On some platforms, this will match the "default font"
+ * or "system font" if such can be found.  This font
+ * should not be free'd because it was allocated by the
+ * system, not the application.
+ * <p>
+ * Typically, applications which want the default look
+ * should simply not set the font on the widgets they
+ * create. Widgets are always created with the correct
+ * default font for the class of user-interface component
+ * they represent.
+ * </p>
+ *
+ * @return a font
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public override Font getSystemFont () {
+    checkDevice ();
+    if (systemFont !is null) return systemFont;
+    auto style = OS.gtk_widget_get_default_style();
+    auto defaultFont = OS.pango_font_description_copy (OS.gtk_style_get_font_desc (style));
+    return systemFont = Font.gtk_new (this, defaultFont);
+}
+
+/**
+ * Invokes platform specific functionality to allocate a new GC handle.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Printer</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param data the platform specific GC data
+ * @return the platform specific GC handle
+ */
+public override GdkGC* internal_new_GC(GCData data) {
+    auto drawable = OS.gdk_pixmap_new(OS.GDK_ROOT_PARENT(), 1, 1, 1);
+    auto gdkGC = OS.gdk_gc_new (drawable);
+    if (gdkGC is null) SWT.error (SWT.ERROR_NO_HANDLES);
+    if (data !is null) {
+        if (isGCCreated) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+        int mask = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
+        if ((data.style & mask) is 0) {
+            data.style |= SWT.LEFT_TO_RIGHT;
+        }
+        data.device = this;
+        data.drawable = drawable;
+        data.background = getSystemColor (SWT.COLOR_WHITE).handle;
+        data.foreground = getSystemColor (SWT.COLOR_BLACK).handle;
+        data.font = getSystemFont ();
+        //TODO: We are supposed to return this in pixels, but GTK_UNIT_PIXELS is currently not implemented (gtk bug 346245)
+        data.width = cast(int)OS.gtk_page_setup_get_paper_width (pageSetup, OS.GTK_UNIT_POINTS);
+        data.height = cast(int)OS.gtk_page_setup_get_paper_height (pageSetup, OS.GTK_UNIT_POINTS);
+        if (cairo is null) SWT.error(SWT.ERROR_NO_HANDLES);
+        data.cairo = cairo;
+        isGCCreated = true;
+    }
+    return gdkGC;
+}
+
+/**
+ * Invokes platform specific functionality to dispose a GC handle.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Printer</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param hDC the platform specific GC handle
+ * @param data the platform specific GC data
+ */
+public override void internal_dispose_GC(GdkGC* gdkGC, GCData data) {
+    if (data !is null) isGCCreated = false;
+    OS.g_object_unref (gdkGC);
+    if (data !is null) {
+        if (data.drawable !is null) OS.g_object_unref (data.drawable);
+        data.drawable = null;
+        data.cairo = null;
+    }
+}
+
+/**
+ * Releases any internal state prior to destroying this printer.
+ * This method is called internally by the dispose
+ * mechanism of the <code>Device</code> class.
+ */
+protected override void release () {
+    super.release();
+
+    /* Dispose the default font */
+    if (systemFont !is null) systemFont.dispose ();
+    systemFont = null;
+}
+
+/**
+ * Starts a print job and returns true if the job started successfully
+ * and false otherwise.
+ * <p>
+ * This must be the first method called to initiate a print job,
+ * followed by any number of startPage/endPage calls, followed by
+ * endJob. Calling startPage, endPage, or endJob before startJob
+ * will result in undefined behavior.
+ * </p>
+ *
+ * @param jobName the name of the print job to start
+ * @return true if the job started successfully and false otherwise.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #startPage
+ * @see #endPage
+ * @see #endJob
+ */
+public bool startJob(String jobName) {
+    checkDevice();
+    char* buffer = toStringz(jobName);
+    printJob = OS.gtk_print_job_new (buffer, printer, settings, pageSetup);
+    if (printJob is null) return false;
+    surface = OS.gtk_print_job_get_surface(printJob, null);
+    if (surface is null) {
+        OS.g_object_unref(printJob);
+        printJob = null;
+        return false;
+    }
+    cairo = Cairo.cairo_create(surface);
+    if (cairo is null)  {
+        OS.g_object_unref(printJob);
+        printJob = null;
+        return false;
+    }
+    return true;
+}
+
+/**
+ * Destroys the printer handle.
+ * This method is called internally by the dispose
+ * mechanism of the <code>Device</code> class.
+ */
+protected override void destroy () {
+    if (printer !is null) OS.g_object_unref (printer);
+    if (settings !is null) OS.g_object_unref (settings);
+    if (pageSetup !is null) OS.g_object_unref (pageSetup);
+    if (cairo !is null) Cairo.cairo_destroy (cairo);
+    if (printJob !is null) OS.g_object_unref (printJob);
+    printer = null;
+    settings = null;
+    pageSetup = null;
+    cairo = null;
+    printJob = null;
+}
+
+/**
+ * Ends the current print job.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #startJob
+ * @see #startPage
+ * @see #endPage
+ */
+public void endJob() {
+    checkDevice();
+    if (printJob is null) return;
+    Cairo.cairo_surface_finish(surface);
+    OS.gtk_print_job_send(printJob, null, null, null );
+}
+
+/**
+ * Cancels a print job in progress.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void cancelJob() {
+    checkDevice();
+    if (printJob is null) return;
+    //TODO: Need to implement (waiting on gtk bug 339323)
+    //OS.g_object_unref(printJob);
+    //printJob = 0;
+}
+
+/**
+ * Starts a page and returns true if the page started successfully
+ * and false otherwise.
+ * <p>
+ * After calling startJob, this method may be called any number of times
+ * along with a matching endPage.
+ * </p>
+ *
+ * @return true if the page started successfully and false otherwise.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #endPage
+ * @see #startJob
+ * @see #endJob
+ */
+public bool startPage() {
+    checkDevice();
+    if (printJob is null) return false;
+    double width = OS.gtk_page_setup_get_paper_width (pageSetup, OS.GTK_UNIT_POINTS);
+    double height = OS.gtk_page_setup_get_paper_height (pageSetup, OS.GTK_UNIT_POINTS);
+    int type = Cairo.cairo_surface_get_type (surface);
+    switch (type) {
+        case Cairo.CAIRO_SURFACE_TYPE_PS:
+            Cairo.cairo_ps_surface_set_size (surface, width, height);
+            break;
+        case Cairo.CAIRO_SURFACE_TYPE_PDF:
+            Cairo.cairo_pdf_surface_set_size (surface, width, height);
+            break;
+        default:
+    }
+    return true;
+}
+
+/**
+ * Ends the current page.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #startPage
+ * @see #startJob
+ * @see #endJob
+ */
+public void endPage() {
+    checkDevice();
+    if (cairo !is null) Cairo.cairo_show_page(cairo);
+}
+
+/**
+ * Returns a point whose x coordinate is the horizontal
+ * dots per inch of the printer, and whose y coordinate
+ * is the vertical dots per inch of the printer.
+ *
+ * @return the horizontal and vertical DPI
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public override Point getDPI() {
+    checkDevice();
+    int resolution = OS.gtk_print_settings_get_resolution(settings);
+    if (DEBUG) getDwtLogger().info( __FILE__, __LINE__, "print_settings.resolution={}", resolution);
+    //TODO: Return 72 (1/72 inch = 1 point) until gtk bug 346245 is fixed
+    //TODO: Fix this: gtk_print_settings_get_resolution returns 0? (see gtk bug 346252)
+    if (true || resolution is 0) return new Point(72, 72);
+    return new Point(resolution, resolution);
+}
+
+/**
+ * Returns a rectangle describing the receiver's size and location.
+ * <p>
+ * For a printer, this is the size of the physical page, in pixels.
+ * </p>
+ *
+ * @return the bounding rectangle
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getClientArea
+ * @see #computeTrim
+ */
+public override Rectangle getBounds() {
+    checkDevice();
+    //TODO: We are supposed to return this in pixels, but GTK_UNIT_PIXELS is currently not implemented (gtk bug 346245)
+    double width = OS.gtk_page_setup_get_paper_width (pageSetup, OS.GTK_UNIT_POINTS);
+    double height = OS.gtk_page_setup_get_paper_height (pageSetup, OS.GTK_UNIT_POINTS);
+    return new Rectangle(0, 0, cast(int) width, cast(int) height);
+}
+
+/**
+ * Returns a rectangle which describes the area of the
+ * receiver which is capable of displaying data.
+ * <p>
+ * For a printer, this is the size of the printable area
+ * of the page, in pixels.
+ * </p>
+ *
+ * @return the client area
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getBounds
+ * @see #computeTrim
+ */
+public override Rectangle getClientArea() {
+    checkDevice();
+    //TODO: We are supposed to return this in pixels, but GTK_UNIT_PIXELS is currently not implemented (gtk bug 346245)
+    double width = OS.gtk_page_setup_get_page_width(pageSetup, OS.GTK_UNIT_POINTS);
+    double height = OS.gtk_page_setup_get_page_height(pageSetup, OS.GTK_UNIT_POINTS);
+    return new Rectangle(0, 0, cast(int) width, cast(int) height);
+}
+
+/**
+ * Given a <em>client area</em> (as described by the arguments),
+ * returns a rectangle, relative to the client area's coordinates,
+ * that is the client area expanded by the printer's trim (or minimum margins).
+ * <p>
+ * Most printers have a minimum margin on each edge of the paper where the
+ * printer device is unable to print.  This margin is known as the "trim."
+ * This method can be used to calculate the printer's minimum margins
+ * by passing in a client area of 0, 0, 0, 0 and then using the resulting
+ * x and y coordinates (which will be <= 0) to determine the minimum margins
+ * for the top and left edges of the paper, and the resulting width and height
+ * (offset by the resulting x and y) to determine the minimum margins for the
+ * bottom and right edges of the paper, as follows:
+ * <ul>
+ *      <li>The left trim width is -x pixels</li>
+ *      <li>The top trim height is -y pixels</li>
+ *      <li>The right trim width is (x + width) pixels</li>
+ *      <li>The bottom trim height is (y + height) pixels</li>
+ * </ul>
+ * </p>
+ *
+ * @param x the x coordinate of the client area
+ * @param y the y coordinate of the client area
+ * @param width the width of the client area
+ * @param height the height of the client area
+ * @return a rectangle, relative to the client area's coordinates, that is
+ *      the client area expanded by the printer's trim (or minimum margins)
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getBounds
+ * @see #getClientArea
+ */
+public Rectangle computeTrim(int x, int y, int width, int height) {
+    checkDevice();
+    //TODO: We are supposed to return this in pixels, but GTK_UNIT_PIXELS is currently not implemented (gtk bug 346245)
+    double printWidth = OS.gtk_page_setup_get_page_width(pageSetup, OS.GTK_UNIT_POINTS);
+    double printHeight = OS.gtk_page_setup_get_page_height(pageSetup, OS.GTK_UNIT_POINTS);
+    double paperWidth = OS.gtk_page_setup_get_paper_width (pageSetup, OS.GTK_UNIT_POINTS);
+    double paperHeight = OS.gtk_page_setup_get_paper_height (pageSetup, OS.GTK_UNIT_POINTS);
+    double printX = -OS.gtk_page_setup_get_left_margin(pageSetup, OS.GTK_UNIT_POINTS);
+    double printY = -OS.gtk_page_setup_get_top_margin(pageSetup, OS.GTK_UNIT_POINTS);
+    double hTrim = paperWidth - printWidth;
+    double vTrim = paperHeight - printHeight;
+    return new Rectangle(x + cast(int)printX, y + cast(int)printY, width + cast(int)hTrim, height + cast(int)vTrim);
+}
+
+/**
+ * Creates the printer handle.
+ * This method is called internally by the instance creation
+ * mechanism of the <code>Device</code> class.
+ * @param deviceData the device data
+ */
+protected override void create(DeviceData deviceData) {
+    this.data = cast(PrinterData)deviceData;
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 10, 0) || disablePrinting) SWT.error(SWT.ERROR_NO_HANDLES);
+    printer = gtkPrinterFromPrinterData();
+    if (printer is null) SWT.error(SWT.ERROR_NO_HANDLES);
+}
+
+/**
+ * Initializes any internal resources needed by the
+ * device.
+ * <p>
+ * This method is called after <code>create</code>.
+ * </p><p>
+ * If subclasses reimplement this method, they must
+ * call the <code>super</code> implementation.
+ * </p>
+ *
+ * @see #create
+ */
+protected override void init_() {
+    super.init_ ();
+    settings = OS.gtk_print_settings_new();
+    pageSetup = OS.gtk_page_setup_new();
+    if (data.otherData !is null) {
+        restore(data.otherData, settings, pageSetup);
+    }
+
+    /* Set values of settings from PrinterData. */
+    setScope(settings, data.scope_, data.startPage, data.endPage);
+    //TODO: Should we look at printToFile, or driver/name for "Print to File", or both? (see gtk bug 345590)
+    if (data.printToFile) {
+        char* buffer = toStringz( data.fileName );
+        OS.gtk_print_settings_set(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI.ptr, buffer);
+    }
+    if (data.driver.equals("GtkPrintBackendFile") && data.name.equals("Print to File")) { //$NON-NLS-1$ //$NON-NLS-2$
+        char* buffer = toStringz( data.fileName );
+        OS.gtk_print_settings_set(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI.ptr, buffer);
+    }
+    OS.gtk_print_settings_set_n_copies(settings, data.copyCount);
+    OS.gtk_print_settings_set_collate(settings, data.collate);
+}
+
+/**
+ * Returns a <code>PrinterData</code> object representing the
+ * target printer for this print job.
+ *
+ * @return a PrinterData object describing the receiver
+ */
+public PrinterData getPrinterData() {
+    checkDevice();
+    return data;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/printing/PrinterData.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,178 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.printing.PrinterData;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.graphics.DeviceData;
+
+import tango.text.convert.Format;
+
+
+/**
+ * Instances of this class are descriptions of a print job
+ * in terms of the printer, and the scope and type of printing
+ * that is desired. For example, the number of pages and copies
+ * can be specified, as well as whether or not the print job
+ * should go to a file.
+ * <p>
+ * Application code does <em>not</em> need to explicitly release the
+ * resources managed by each instance when those instances are no longer
+ * required, and thus no <code>dispose()</code> method is provided.
+ * </p>
+ *
+ * @see Printer
+ * @see Printer#getPrinterList
+ * @see PrintDialog#open
+ * @see <a href="http://www.eclipse.org/swt/snippets/#printing">Printing snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public final class PrinterData : DeviceData {
+
+    /**
+     * the printer driver
+     * On Windows systems, this is the name of the driver (often "winspool").
+     * On Mac OSX, this is the destination type ("Printer", "Fax", "File", or "Preview").
+     * On X/Window systems, this is the name of a display connection to the
+     * Xprt server (the default is ":1").
+     * On GTK+, this is the backend type name (eg. GtkPrintBackendCups).
+     */
+    // TODO: note that this api is not finalized for GTK+
+    public String driver;
+
+    /**
+     * the name of the printer
+     * On Windows systems, this is the name of the 'device'.
+     * On Mac OSX, X/Window systems, and GTK+, this is the printer's 'name'.
+     */
+    public String name;
+
+    /**
+     * the scope of the print job, expressed as one of the following values:
+     * <dl>
+     * <dt><code>ALL_PAGES</code></dt>
+     * <dd>Print all pages in the current document</dd>
+     * <dt><code>PAGE_RANGE</code></dt>
+     * <dd>Print the range of pages specified by startPage and endPage</dd>
+     * <dt><code>SELECTION</code></dt>
+     * <dd>Print the current selection</dd>
+     * </dl>
+     */
+    public int scope_ = ALL_PAGES;
+
+    /**
+     * the start page of a page range, used when scope is PAGE_RANGE.
+     * This value can be from 1 to the maximum number of pages for the platform.
+     */
+    public int startPage = 0;
+
+    /**
+     * the end page of a page range, used when scope is PAGE_RANGE.
+     * This value can be from 1 to the maximum number of pages for the platform.
+     */
+    public int endPage = 0;
+
+    /**
+     * whether or not the print job should go to a file
+     */
+    public bool printToFile = false;
+
+    /**
+     * the name of the file to print to if printToFile is true.
+     * Note that this field is ignored if printToFile is false.
+     */
+    public String fileName;
+
+    /**
+     * the number of copies to print.
+     * Note that this field may be controlled by the printer driver
+     * In other words, the printer itself may be capable of printing
+     * multiple copies, and if so, the value of this field will always be 1.
+     */
+    public int copyCount = 1;
+
+    /**
+     * whether or not the printer should collate the printed paper
+     * Note that this field may be controlled by the printer driver.
+     * In other words, the printer itself may be capable of doing the
+     * collation, and if so, the value of this field will always be false.
+     */
+    public bool collate = false;
+
+    /**
+     * <code>scope</code> field value indicating that
+     * all pages should be printed
+     */
+    public static const int ALL_PAGES = 0;
+
+    /**
+     * <code>scope</code> field value indicating that
+     * the range of pages specified by startPage and endPage
+     * should be printed
+     */
+    public static const int PAGE_RANGE = 1;
+
+    /**
+     * <code>scope</code> field value indicating that
+     * the current selection should be printed
+     */
+    public static const int SELECTION = 2;
+
+    /**
+     * private, platform-specific data
+     * On Windows, this contains a copy of the DEVMODE struct
+     * returned from the <code>PrintDialog</code>.
+     * On GTK, this contains a copy of the print_settings and page_setup
+     * returned from the <code>PrintDialog</code>.
+     * On OS X Carbon, this contains a copy of the PrintSettings and PageFormat
+     * returned from the <code>PrintDialog</code>.
+     * This field is not currently used on the X/Window System.
+     */
+    char [] otherData;
+
+    /**
+     * Constructs an instance of this class that can be
+     * used to print to the default printer.
+     *
+     * @see Printer#getDefaultPrinterData
+     */
+    public this() {
+    }
+
+    /**
+     * Constructs an instance of this class with the given
+     * printer driver and printer name.
+     *
+     * @param driver the printer driver for the printer
+     * @param name the name of the printer
+     *
+     * @see #driver
+     * @see #name
+     */
+    public this(String driver, String name) {
+        this.driver = driver;
+        this.name = name;
+    }
+
+    /**
+     * Returns a string containing a concise, human-readable
+     * description of the receiver.
+     *
+     * @return a string representation of the receiver
+     */
+    public override String toString() {
+        return Format( "PrinterData {{driver = {}, name = {}}", driver, name );  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/printing/all.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,9 @@
+module org.eclipse.swt.printing.all;
+
+import java.lang.all;
+
+public import org.eclipse.swt.printing.PrintDialog;
+public import org.eclipse.swt.printing.Printer;
+public import org.eclipse.swt.printing.PrinterData;
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/program/Program.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,983 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.program.Program;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.internal.Compatibility;
+import org.eclipse.swt.internal.Converter;
+import org.eclipse.swt.internal.Library;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import java.lang.all;
+
+import tango.sys.SharedLib;
+import tango.core.Exception;
+import tango.core.Array;
+import tango.text.convert.Format;
+import tango.io.device.File;
+import tango.io.stream.Lines;
+
+version( build ){
+    pragma(link, "gnomeui-2" );
+}
+
+private extern(C) {
+    alias int GnomeIconLookupResultFlags;
+    alias int GnomeIconLookupFlags;
+    GnomeIconTheme *gnome_icon_theme_new  ();
+    char *gnome_icon_lookup      (
+                GtkIconTheme *icon_theme,
+                void  *thumbnail_factory,
+                char  *file_uri,
+                char  *custom_icon,
+                void  *file_info,
+                char  *mime_type,
+                GnomeIconLookupFlags        flags,
+                GnomeIconLookupResultFlags *result);
+    int gnome_vfs_init();
+    char* gnome_icon_theme_lookup_icon(GnomeIconTheme *theme,char *icon_name,int size, GnomeIconData **icon_data, int *base_size) ;
+
+    alias void GnomeIconTheme;
+    alias void GnomeIconData;
+
+    struct GnomeVFSMimeApplication{
+        /*< public > */
+        char *id;
+        char *name;
+
+        /*< private > */
+        char *command;
+        int    can_open_multiple_files;
+        int    expects_uris;
+        GList *supported_uri_schemes;
+        int    requires_terminal;
+
+        /* Padded to avoid future breaks in ABI compatibility */
+        void * reserved1;
+
+        void * priv;
+    }
+}
+
+struct GNOME {
+    private static extern(C){
+        enum {
+            GNOME_ICON_LOOKUP_FLAGS_NONE = 0,
+            GNOME_ICON_LOOKUP_FLAGS_EMBEDDING_TEXT = 1<<0,
+            GNOME_ICON_LOOKUP_FLAGS_SHOW_SMALL_IMAGES_AS_THEMSELVES = 1<<1,
+            GNOME_ICON_LOOKUP_FLAGS_ALLOW_SVG_AS_THEMSELVES = 1<<2
+        }
+        enum {
+            GNOME_VFS_MAKE_URI_DIR_NONE = 0,
+            GNOME_VFS_MAKE_URI_DIR_HOMEDIR = 1 << 0,
+            GNOME_VFS_MAKE_URI_DIR_CURRENT = 1 << 1
+        }
+        alias int GnomeVFSMakeURIDirs;
+        enum {
+            GNOME_VFS_OK,
+            GNOME_VFS_ERROR_NOT_FOUND,
+            GNOME_VFS_ERROR_GENERIC,
+            GNOME_VFS_ERROR_INTERNAL,
+            GNOME_VFS_ERROR_BAD_PARAMETERS,
+            GNOME_VFS_ERROR_NOT_SUPPORTED,
+            GNOME_VFS_ERROR_IO,
+            GNOME_VFS_ERROR_CORRUPTED_DATA,
+            GNOME_VFS_ERROR_WRONG_FORMAT,
+            GNOME_VFS_ERROR_BAD_FILE,
+            GNOME_VFS_ERROR_TOO_BIG,
+            GNOME_VFS_ERROR_NO_SPACE,
+            GNOME_VFS_ERROR_READ_ONLY,
+            GNOME_VFS_ERROR_INVALID_URI,
+            GNOME_VFS_ERROR_NOT_OPEN,
+            GNOME_VFS_ERROR_INVALID_OPEN_MODE,
+            GNOME_VFS_ERROR_ACCESS_DENIED,
+            GNOME_VFS_ERROR_TOO_MANY_OPEN_FILES,
+            GNOME_VFS_ERROR_EOF,
+            GNOME_VFS_ERROR_NOT_A_DIRECTORY,
+            GNOME_VFS_ERROR_IN_PROGRESS,
+            GNOME_VFS_ERROR_INTERRUPTED,
+            GNOME_VFS_ERROR_FILE_EXISTS,
+            GNOME_VFS_ERROR_LOOP,
+            GNOME_VFS_ERROR_NOT_PERMITTED,
+            GNOME_VFS_ERROR_IS_DIRECTORY,
+            GNOME_VFS_ERROR_NO_MEMORY,
+            GNOME_VFS_ERROR_HOST_NOT_FOUND,
+            GNOME_VFS_ERROR_INVALID_HOST_NAME,
+            GNOME_VFS_ERROR_HOST_HAS_NO_ADDRESS,
+            GNOME_VFS_ERROR_LOGIN_FAILED,
+            GNOME_VFS_ERROR_CANCELLED,
+            GNOME_VFS_ERROR_DIRECTORY_BUSY,
+            GNOME_VFS_ERROR_DIRECTORY_NOT_EMPTY,
+            GNOME_VFS_ERROR_TOO_MANY_LINKS,
+            GNOME_VFS_ERROR_READ_ONLY_FILE_SYSTEM,
+            GNOME_VFS_ERROR_NOT_SAME_FILE_SYSTEM,
+            GNOME_VFS_ERROR_NAME_TOO_LONG,
+            GNOME_VFS_ERROR_SERVICE_NOT_AVAILABLE,
+            GNOME_VFS_ERROR_SERVICE_OBSOLETE,
+            GNOME_VFS_ERROR_PROTOCOL_ERROR,
+            GNOME_VFS_ERROR_NO_MASTER_BROWSER,
+            GNOME_VFS_ERROR_NO_DEFAULT,
+            GNOME_VFS_ERROR_NO_HANDLER,
+            GNOME_VFS_ERROR_PARSE,
+            GNOME_VFS_ERROR_LAUNCH,
+            GNOME_VFS_ERROR_TIMEOUT,
+            GNOME_VFS_ERROR_NAMESERVER,
+            GNOME_VFS_ERROR_LOCKED,
+            GNOME_VFS_ERROR_DEPRECATED_FUNCTION,
+            GNOME_VFS_ERROR_INVALID_FILENAME,
+            GNOME_VFS_ERROR_NOT_A_SYMBOLIC_LINK,
+            GNOME_VFS_NUM_ERRORS
+        }
+        alias int GnomeVFSResult;
+
+        enum {
+            GNOME_VFS_MIME_APPLICATION_ARGUMENT_TYPE_URIS,
+            GNOME_VFS_MIME_APPLICATION_ARGUMENT_TYPE_PATHS,
+            GNOME_VFS_MIME_APPLICATION_ARGUMENT_TYPE_URIS_FOR_NON_FILES
+        }
+
+        alias GtkIconTheme GnomeIconTheme;
+        alias .gnome_icon_theme_lookup_icon gnome_icon_theme_lookup_icon;
+        alias .gnome_vfs_init gnome_vfs_init;
+        alias .gnome_icon_lookup gnome_icon_lookup;
+        alias .gnome_icon_theme_new gnome_icon_theme_new;
+
+
+        GnomeVFSMimeApplication * function ( char *mime_type ) gnome_vfs_mime_get_default_application;
+        char* function(char*, int ) gnome_vfs_make_uri_from_input_with_dirs;
+        GnomeVFSResult function( GnomeVFSMimeApplication*, GList*) gnome_vfs_mime_application_launch;
+        void function(GnomeVFSMimeApplication*) gnome_vfs_mime_application_free;
+        GList* function(char*) gnome_vfs_mime_get_extensions_list;
+        void function(GList*) gnome_vfs_mime_extensions_list_free;
+        void function(GList*) gnome_vfs_mime_registered_mime_type_list_free;
+        GnomeVFSResult function(char*) gnome_vfs_url_show;
+        char* function(char*) gnome_vfs_make_uri_from_input;
+        GList* function() gnome_vfs_get_registered_mime_types;
+        char* function(char*) gnome_vfs_mime_type_from_name;
+    }
+}
+
+/**
+ * Instances of this class represent programs and
+ * their associated file extensions in the operating
+ * system.
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#program">Program snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public final class Program {
+    String name;
+    String command;
+    String iconPath;
+    Display display;
+
+    /* Gnome specific
+     * true if command expects a URI
+     * false if expects a path
+     */
+    bool gnomeExpectUri;
+
+    static int /*long*/ cdeShell;
+
+    static const String[] CDE_ICON_EXT = [ ".m.pm"[],   ".l.pm",   ".s.pm",   ".t.pm" ];
+    static const String[] CDE_MASK_EXT = [ ".m_m.bm"[], ".l_m.bm", ".s_m.bm", ".t_m.bm" ];
+    static const String DESKTOP_DATA = "Program_DESKTOP";
+    static const String ICON_THEME_DATA = "Program_GNOME_ICON_THEME";
+    static const String PREFIX_HTTP = "http://"; //$NON-NLS-1$
+    static const String PREFIX_HTTPS = "https://"; //$NON-NLS-1$
+    static const int DESKTOP_UNKNOWN = 0;
+    static const int DESKTOP_GNOME = 1;
+    static const int DESKTOP_GNOME_24 = 2;
+    static const int DESKTOP_CDE = 3;
+    static const int PREFERRED_ICON_SIZE = 16;
+
+/**
+ * Prevents uninitialized instances from being created outside the package.
+ */
+this() {
+}
+
+/* Determine the desktop for the given display. */
+static int getDesktop(Display display) {
+    if (display is null) return DESKTOP_UNKNOWN;
+    ValueWrapperInt desktopValue = cast(ValueWrapperInt)display.getData(DESKTOP_DATA);
+    if (desktopValue !is null) return desktopValue.value;
+    int desktop = DESKTOP_UNKNOWN;
+
+    /* Get the list of properties on the root window. */
+    void* xDisplay = OS.GDK_DISPLAY();
+    uint rootWindow = OS.XDefaultRootWindow(xDisplay);
+    int numProp;
+    uint* propList = OS.XListProperties(xDisplay, rootWindow, &numProp);
+    uint[] property = new uint[numProp];
+    if (propList !is null) {
+        property[ 0 .. numProp ] = propList[ 0 .. numProp ];
+        OS.XFree(propList);
+    }
+
+    /*
+     * Feature in Linux Desktop. There is currently no official way to
+     * determine whether the Gnome window manager or gnome-vfs is
+     * available. Earlier versions including Red Hat 9 and Suse 9 provide
+     * a documented Gnome specific property on the root window
+     * WIN_SUPPORTING_WM_CHECK. This property is no longer supported in newer
+     * versions such as Fedora Core 2.
+     * The workaround is to simply check that the window manager is a
+     * compliant one (property _NET_SUPPORTING_WM_CHECK) and to attempt to load
+     * our native library that depends on gnome-vfs.
+     */
+    if (desktop is DESKTOP_UNKNOWN) {
+        String gnomeName = "_NET_SUPPORTING_WM_CHECK";
+        int /*long*/ gnome = OS.XInternAtom(xDisplay, gnomeName.ptr, true);
+        if (gnome !is OS.None && (OS.GTK_VERSION >= OS.buildVERSION (2, 2, 0)) && gnome_init()) {
+            desktop = DESKTOP_GNOME;
+            int icon_theme = cast(int)GNOME.gnome_icon_theme_new();
+            display.setData(ICON_THEME_DATA, new ValueWrapperInt(icon_theme));
+            display.addListener(SWT.Dispose, new class(display) Listener {
+                Display display;
+                this( Display display ){ this.display = display; }
+                public void handleEvent(Event event) {
+                    ValueWrapperInt gnomeIconTheme = cast(ValueWrapperInt)display.getData(ICON_THEME_DATA);
+                    if (gnomeIconTheme is null) return;
+                    display.setData(ICON_THEME_DATA, null);
+                    /*
+                     * Note.  gnome_icon_theme_new uses g_object_new to allocate the
+                     * data it returns. Use g_object_unref to free the pointer it returns.
+                     */
+                    if (gnomeIconTheme.value !is 0) OS.g_object_unref( cast(void*)gnomeIconTheme.value);
+                }
+            });
+            /* Check for libgnomevfs-2 version 2.4 */
+            String buffer = "libgnomevfs-2.so.0";
+            auto libgnomevfs = SharedLib.load(buffer );
+            if (libgnomevfs !is null) {
+                buffer = "gnome_vfs_url_show";
+                void* gnome_vfs_url_show = libgnomevfs.getSymbol( buffer.ptr );
+                if (gnome_vfs_url_show !is null) {
+                    desktop = DESKTOP_GNOME_24;
+                }
+                *cast(void**)&GNOME.gnome_vfs_mime_get_default_application = libgnomevfs.getSymbol( "gnome_vfs_mime_get_default_application" );
+                *cast(void**)&GNOME.gnome_vfs_make_uri_from_input_with_dirs = libgnomevfs.getSymbol( "gnome_vfs_make_uri_from_input_with_dirs" );
+                *cast(void**)&GNOME.gnome_vfs_mime_application_launch = libgnomevfs.getSymbol( "gnome_vfs_mime_application_launch" );
+                *cast(void**)&GNOME.gnome_vfs_mime_application_free = libgnomevfs.getSymbol( "gnome_vfs_mime_application_free" );
+                *cast(void**)&GNOME.gnome_vfs_url_show = libgnomevfs.getSymbol( "gnome_vfs_url_show" );
+                *cast(void**)&GNOME.gnome_vfs_make_uri_from_input = libgnomevfs.getSymbol( "gnome_vfs_make_uri_from_input" );
+                *cast(void**)&GNOME.gnome_vfs_get_registered_mime_types = libgnomevfs.getSymbol( "gnome_vfs_get_registered_mime_types" );
+                *cast(void**)&GNOME.gnome_vfs_mime_get_extensions_list = libgnomevfs.getSymbol( "gnome_vfs_mime_get_extensions_list" );
+                *cast(void**)&GNOME.gnome_vfs_mime_extensions_list_free = libgnomevfs.getSymbol( "gnome_vfs_mime_extensions_list_free" );
+                *cast(void**)&GNOME.gnome_vfs_mime_registered_mime_type_list_free = libgnomevfs.getSymbol( "gnome_vfs_mime_registered_mime_type_list_free" );
+                *cast(void**)&GNOME.gnome_vfs_mime_type_from_name = libgnomevfs.getSymbol( "gnome_vfs_mime_type_from_name" );
+            }
+        }
+    }
+
+// PORTING CDE not supported
+/+
+    /*
+    * On CDE, the atom below may exist without DTWM running. If the atom
+    * below is defined, the CDE database exists and the available
+    * applications can be queried.
+    */
+    if (desktop is DESKTOP_UNKNOWN) {
+        String cdeName = "_DT_SM_PREFERENCES";
+        int /*long*/ cde = OS.XInternAtom(xDisplay, cdeName.ptr, true);
+        for (int index = 0; desktop is DESKTOP_UNKNOWN && index < property.length; index++) {
+            if (property[index] is OS.None) continue; /* do not match atoms that do not exist */
+            if (property[index] is cde && cde_init(display)) desktop = DESKTOP_CDE;
+        }
+    }
++/
+
+    display.setData(DESKTOP_DATA, new ValueWrapperInt(desktop));
+    return desktop;
+}
+
+// PORTING CDE not supported
+/+
+bool cde_execute(String fileName) {
+    /* Use the character encoding for the default locale */
+    char* action = toStringz(command);
+    char* ptr = cast(char*)OS.g_malloc(fileName.length+1);
+    ptr[ 0 .. fileName.length ] = fileName;
+    ptr[ fileName.length ] = 0;
+    DtActionArg args = new DtActionArg();
+    args.argClass = CDE.DtACTION_FILE;
+    args.name = ptr;
+    long actionID = CDE.DtActionInvoke(cdeShell, action, args, 1, null, null, null, 1, 0, 0);
+    OS.g_free(ptr);
+    return actionID !is 0;
+}
+
+static String cde_getAction(String dataType) {
+    String action  = null;
+    String actions = cde_getAttribute(dataType, CDE.DtDTS_DA_ACTION_LIST);
+    if (actions !is null) {
+        int index = actions.indexOf("Open");
+        if (index !is -1) {
+            action = actions.substring(index, index + 4);
+        } else {
+            index = actions.indexOf(",");
+            action = index !is -1 ? actions.substring(0, index) : actions;
+        }
+    }
+    return action;
+}
+
+static String cde_getAttribute(String dataType, String attrName) {
+    /* Use the character encoding for the default locale */
+    byte[] dataTypeBuf = Converter.wcsToMbcs(null, dataType, true);
+    byte[] attrNameBuf = Converter.wcsToMbcs(null, attrName, true);
+    byte[] optNameBuf = null;
+    int /*long*/ attrValue = CDE.DtDtsDataTypeToAttributeValue(dataTypeBuf, attrNameBuf, optNameBuf);
+    if (attrValue is 0) return null;
+    int length = OS.strlen(attrValue);
+    byte[] attrValueBuf = new byte[length];
+    OS.memmove(attrValueBuf, attrValue, length);
+    CDE.DtDtsFreeAttributeValue(attrValue);
+    /* Use the character encoding for the default locale */
+    return new String(Converter.mbcsToWcs(null, attrValueBuf));
+}
+
+static String[][ String ] cde_getDataTypeInfo() {
+    String[][ String ] dataTypeInfo;
+    int index;
+    int /*long*/ dataTypeList = CDE.DtDtsDataTypeNames();
+    if (dataTypeList !is 0) {
+        /* For each data type name in the list */
+        index = 0;
+        int /*long*/ [] dataType = new int /*long*/ [1];
+        OS.memmove(dataType, dataTypeList + (index++ * 4), 4);
+        while (dataType[0] !is 0) {
+            int length = OS.strlen(dataType[0]);
+            byte[] dataTypeBuf = new byte[length];
+            OS.memmove(dataTypeBuf, dataType[0], length);
+            /* Use the character encoding for the default locale */
+            String dataTypeName = new String(Converter.mbcsToWcs(null, dataTypeBuf));
+
+            /* The data type is valid if it is not an action, and it has an extension and an action. */
+            String extension = cde_getExtension(dataTypeName);
+            if (!CDE.DtDtsDataTypeIsAction(dataTypeBuf) &&
+                extension !is null && cde_getAction(dataTypeName) !is null) {
+                String[] exts;
+                exts ~= extension;
+                dataTypeInfo[ dataTypeName ] = exts;
+            }
+            OS.memmove(dataType, dataTypeList + (index++ * 4), 4);
+        }
+        CDE.DtDtsFreeDataTypeNames(dataTypeList);
+    }
+
+    return dataTypeInfo;
+}
+
+static String cde_getExtension(String dataType) {
+    String fileExt = cde_getAttribute(dataType, CDE.DtDTS_DA_NAME_TEMPLATE);
+    if (fileExt is null || fileExt.indexOf("%s.") is -1) return null;
+    int dot = fileExt.indexOf(".");
+    return fileExt.substring(dot);
+}
+
+/**
+ * CDE - Get Image Data
+ *
+ * This method returns the image data of the icon associated with
+ * the data type. Since CDE supports multiple sizes of icons, several
+ * attempts are made to locate an icon of the desired size and format.
+ * CDE supports the sizes: tiny, small, medium and large. The best
+ * search order is medium, large, small and then tiny. Althoug CDE supports
+ * colour and monochrome bitmaps, only colour icons are tried. (The order is
+ * defined by the  cdeIconExt and cdeMaskExt arrays above.)
+ */
+ImageData cde_getImageData() {
+    // TODO
+    return null;
+}
+
+static String cde_getMimeType(String extension) {
+    String mimeType = null;
+    String[][ String ] mimeInfo = cde_getDataTypeInfo();
+    if (mimeInfo is null) return null;
+    String[] keys = mimeInfo.keys();
+    int keyIdx = 0;
+    while (mimeType is null && keyIdx < keys.length ) {
+        String type = keys[ keyIdx ];
+        String[] mimeExts = mimeInfo[type];
+        for (int index = 0; index < mimeExts.length; index++){
+            if (extension.equals(mimeExts[index])) {
+                mimeType = type;
+                break;
+            }
+        }
+        keyIdx++;
+    }
+    return mimeType;
+}
+
+static Program cde_getProgram(Display display, String mimeType) {
+    Program program = new Program();
+    program.display = display;
+    program.name = mimeType;
+    program.command = cde_getAction(mimeType);
+    program.iconPath = cde_getAttribute(program.name, CDE.DtDTS_DA_ICON);
+    return program;
+}
+
+static bool cde_init(Display display) {
+    try {
+        Library.loadLibrary("swt-cde");
+    } catch (Throwable e) {
+        return false;
+    }
+
+    /* Use the character encoding for the default locale */
+    CDE.XtToolkitInitialize();
+    int /*long*/ xtContext = CDE.XtCreateApplicationContext ();
+    int /*long*/ xDisplay = OS.GDK_DISPLAY();
+    byte[] appName = Converter.wcsToMbcs(null, "CDE", true);
+    byte[] appClass = Converter.wcsToMbcs(null, "CDE", true);
+    int /*long*/ [] argc = [0];
+    CDE.XtDisplayInitialize(xtContext, xDisplay, appName, appClass, 0, 0, argc, 0);
+    int /*long*/ widgetClass = CDE.topLevelShellWidgetClass ();
+    cdeShell = CDE.XtAppCreateShell (appName, appClass, widgetClass, xDisplay, null, 0);
+    CDE.XtSetMappedWhenManaged (cdeShell, false);
+    CDE.XtResizeWidget (cdeShell, 10, 10, 0);
+    CDE.XtRealizeWidget (cdeShell);
+    bool initOK = CDE.DtAppInitialize(xtContext, xDisplay, cdeShell, appName, appName);
+    if (initOK) CDE.DtDbLoad();
+    return initOK;
+}
++/
+
+static String[] parseCommand(String cmd) {
+    String[] args;
+    int sIndex = 0;
+    int eIndex;
+    while (sIndex < cmd.length) {
+        /* Trim initial white space of argument. */
+        while (sIndex < cmd.length && Compatibility.isWhitespace(cmd.charAt(sIndex))) {
+            sIndex++;
+        }
+        if (sIndex < cmd.length) {
+            /* If the command is a quoted string */
+            if (cmd.charAt(sIndex) is '"' || cmd.charAt(sIndex) is '\'') {
+                /* Find the terminating quote (or end of line).
+                 * This code currently does not handle escaped characters (e.g., " a\"b").
+                 */
+                eIndex = sIndex + 1;
+                while (eIndex < cmd.length && cmd.charAt(eIndex) !is cmd.charAt(sIndex)) eIndex++;
+                if (eIndex >= cmd.length) {
+                    /* The terminating quote was not found
+                     * Add the argument as is with only one initial quote.
+                     */
+                    args ~= cmd.substring(sIndex, eIndex);
+                } else {
+                    /* Add the argument, trimming off the quotes. */
+                    args ~= cmd.substring(sIndex + 1, eIndex);
+                }
+                sIndex = eIndex + 1;
+            }
+            else {
+                /* Use white space for the delimiters. */
+                eIndex = sIndex;
+                while (eIndex < cmd.length && !Compatibility.isWhitespace( firstCodePoint( cmd[ eIndex .. $ ]))) eIndex++;
+                args ~= cmd.substring(sIndex, eIndex);
+                sIndex = eIndex + 1;
+            }
+        }
+    }
+
+    String[] strings = new String[args.length];
+    for (int index =0; index < args.length; index++) {
+        strings[index] = args[index];
+    }
+    return strings;
+}
+
+/**
+ * GNOME 2.4 - Execute the program for the given file.
+ */
+bool gnome_24_execute(String fileName) {
+    char* mimeTypeBuffer = toStringz(name);
+    auto ptr = GNOME.gnome_vfs_mime_get_default_application(mimeTypeBuffer);
+    char* fileNameBuffer = toStringz(fileName);
+    char* uri = GNOME.gnome_vfs_make_uri_from_input_with_dirs(fileNameBuffer, GNOME.GNOME_VFS_MAKE_URI_DIR_CURRENT);
+    GList* list = OS.g_list_append( null, uri);
+    int result = GNOME.gnome_vfs_mime_application_launch(ptr, list);
+    GNOME.gnome_vfs_mime_application_free(ptr);
+    OS.g_free(uri);
+    OS.g_list_free(list);
+    return result is GNOME.GNOME_VFS_OK;
+}
+
+/**
+ * GNOME 2.4 - Launch the default program for the given file.
+ */
+static bool gnome_24_launch(String fileName) {
+    char* fileNameBuffer = toStringz(fileName);
+    char* uri = GNOME.gnome_vfs_make_uri_from_input_with_dirs(fileNameBuffer, GNOME.GNOME_VFS_MAKE_URI_DIR_CURRENT);
+    int result = GNOME.gnome_vfs_url_show(uri);
+    OS.g_free(uri);
+    return (result is GNOME.GNOME_VFS_OK);
+}
+
+/**
+ * GNOME 2.2 - Execute the program for the given file.
+ */
+bool gnome_execute(String fileName) {
+    if (gnomeExpectUri) {
+        /* Convert the given path into a URL */
+        char* fileNameBuffer = toStringz(fileName);
+        char* uri = GNOME.gnome_vfs_make_uri_from_input(fileNameBuffer);
+        if (uri !is null) {
+            fileName = fromStringz( uri ).dup;
+            OS.g_free(uri);
+        }
+    }
+
+    /* Parse the command into its individual arguments. */
+    String[] args = parseCommand(command);
+    int fileArg = -1;
+    int index;
+    for (index = 0; index < args.length; index++) {
+        int j = args[index].indexOf("%f");
+        if (j !is -1) {
+            String value = args[index];
+            fileArg = index;
+            args[index] = value.substring(0, j) ~ fileName ~ value.substring(j + 2);
+        }
+    }
+
+    /* If a file name was given but the command did not have "%f" */
+    if ((fileName.length > 0) && (fileArg < 0)) {
+        String[] newArgs = new String[args.length + 1];
+        for (index = 0; index < args.length; index++) newArgs[index] = args[index];
+        newArgs[args.length] = fileName;
+        args = newArgs;
+    }
+
+    /* Execute the command. */
+    try {
+        Compatibility.exec(args);
+    } catch (IOException e) {
+        return false;
+    }
+    return true;
+}
+
+/**
+ * GNOME - Get Image Data
+ *
+ */
+ImageData gnome_getImageData() {
+    if (iconPath is null) return null;
+    try {
+        return new ImageData(iconPath);
+    } catch (Exception e) {}
+    return null;
+}
+
+/++
+ + SWT Extension
+ + This is a temporary workaround until SWT will get the real implementation.
+ +/
+static String[][ String ] gnome24_getMimeInfo() {
+    scope file = new tango.io.device.File.File ("/usr/share/mime/globs");
+    scope it = new Lines!(char)(file);
+    // process file one line at a time
+    String[][ String ] mimeInfo;
+    foreach (line; it ){
+        int colon = line.indexOf(':');
+        if( colon is line.length ){
+            continue;
+        }
+        if( line.length < colon+3 || line[colon+1 .. colon+3 ] != "*." ){
+            continue;
+        }
+        String mimeType = line[0..colon].dup;
+        String ext      = line[colon+3 .. $].dup;
+        if( auto exts = mimeType in mimeInfo ){
+            mimeInfo[ mimeType ] = *exts ~ ext;
+        }
+        else{
+            mimeInfo[ mimeType ] = [ ext ];
+        }
+    }
+    return mimeInfo;
+}
+/**
+ * GNOME - Get mime types
+ *
+ * Obtain the registered mime type information and
+ * return it in a map. The key of each entry
+ * in the map is the mime type name. The value is
+ * a vector of the associated file extensions.
+ */
+static String[][ String ] gnome_getMimeInfo() {
+    String[][ String ] mimeInfo;
+    GList* mimeList = GNOME.gnome_vfs_get_registered_mime_types();
+    GList* mimeElement = mimeList;
+    while (mimeElement !is null) {
+        char* mimePtr = cast(char*) OS.g_list_data(mimeElement);
+        String mimeTypeBuffer = fromStringz(mimePtr).dup;
+        String mimeType = mimeTypeBuffer;//new String(Converter.mbcsToWcs(null, mimeTypeBuffer));
+        GList* extensionList = GNOME.gnome_vfs_mime_get_extensions_list(mimePtr);
+        if (extensionList !is null) {
+            String[] extensions;
+            GList* extensionElement = extensionList;
+            while (extensionElement !is null) {
+                char* extensionPtr = cast(char*) OS.g_list_data(extensionElement);
+                String extensionBuffer = fromStringz(extensionPtr).dup;
+                String extension = extensionBuffer;
+                extension = '.' ~ extension;
+                extensions ~= extension;
+                extensionElement = OS.g_list_next(extensionElement);
+            }
+            GNOME.gnome_vfs_mime_extensions_list_free(extensionList);
+            if (extensions.length > 0) mimeInfo[ mimeType ] = extensions;
+        }
+        mimeElement = OS.g_list_next(mimeElement);
+    }
+    if (mimeList !is null) GNOME.gnome_vfs_mime_registered_mime_type_list_free(mimeList);
+    return mimeInfo;
+}
+
+static String gnome_getMimeType(String extension) {
+    String mimeType = null;
+    String fileName = "swt" ~ extension;
+    char* extensionBuffer = toStringz(fileName);
+    char* typeName = GNOME.gnome_vfs_mime_type_from_name(extensionBuffer);
+    if (typeName !is null) {
+        mimeType = fromStringz(typeName).dup;
+    }
+    return mimeType;
+}
+
+static Program gnome_getProgram(Display display, String mimeType) {
+    Program program = null;
+    char* mimeTypeBuffer = toStringz(mimeType);
+    GnomeVFSMimeApplication* ptr = GNOME.gnome_vfs_mime_get_default_application(mimeTypeBuffer);
+    if (ptr !is null) {
+        program = new Program();
+        program.display = display;
+        program.name = mimeType;
+        GnomeVFSMimeApplication* application = ptr;
+        String buffer = fromStringz(application.command).dup;
+        program.command = buffer;
+        program.gnomeExpectUri = application.expects_uris is GNOME.GNOME_VFS_MIME_APPLICATION_ARGUMENT_TYPE_URIS;
+
+        buffer = fromStringz( application.id) ~ \0;
+        ValueWrapperInt gnomeIconTheme = cast(ValueWrapperInt)display.getData(ICON_THEME_DATA);
+        char* icon_name = GNOME.gnome_icon_lookup( cast(GtkIconTheme*) gnomeIconTheme.value, null, null, buffer.ptr, null, mimeTypeBuffer,
+                GNOME.GNOME_ICON_LOOKUP_FLAGS_NONE, null);
+        char* path = null;
+        if (icon_name !is null) path = GNOME.gnome_icon_theme_lookup_icon(cast(GtkIconTheme*)gnomeIconTheme.value, icon_name, PREFERRED_ICON_SIZE, null, null);
+        if (path !is null) {
+            program.iconPath = fromStringz( path).dup;
+            OS.g_free(path);
+        }
+        if (icon_name !is null) OS.g_free(icon_name);
+        GNOME.gnome_vfs_mime_application_free(ptr);
+    }
+    return program;
+}
+
+static bool gnome_init() {
+    return cast(bool) GNOME.gnome_vfs_init();
+}
+
+/**
+ * Finds the program that is associated with an extension.
+ * The extension may or may not begin with a '.'.  Note that
+ * a <code>Display</code> must already exist to guarantee that
+ * this method returns an appropriate result.
+ *
+ * @param extension the program extension
+ * @return the program or <code>null</code>
+ *
+ */
+public static Program findProgram(String extension) {
+    return findProgram(Display.getCurrent(), extension);
+}
+
+/*
+ *  API: When support for multiple displays is added, this method will
+ *       become public and the original method above can be deprecated.
+ */
+static Program findProgram(Display display, String extension) {
+    // SWT extension: allow null for zero length string
+    //if (extension is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    if (extension.length is 0) return null;
+    if (extension.charAt(0) !is '.') extension = "." ~ extension;
+    int desktop = getDesktop(display);
+    String mimeType = null;
+    switch (desktop) {
+        case DESKTOP_GNOME_24:
+        case DESKTOP_GNOME: mimeType = gnome_getMimeType(extension); break;
+        //case DESKTOP_CDE: mimeType = cde_getMimeType(extension); break;
+        default:
+    }
+    if (mimeType is null) return null;
+    Program program = null;
+    switch (desktop) {
+        case DESKTOP_GNOME_24:
+        case DESKTOP_GNOME: program = gnome_getProgram(display, mimeType); break;
+        //case DESKTOP_CDE: program = cde_getProgram(display, mimeType); break;
+        default:
+    }
+    return program;
+}
+
+/**
+ * Answer all program extensions in the operating system.  Note
+ * that a <code>Display</code> must already exist to guarantee
+ * that this method returns an appropriate result.
+ *
+ * @return an array of extensions
+ */
+public static String[] getExtensions() {
+    return getExtensions(Display.getCurrent());
+}
+
+/*
+ *  API: When support for multiple displays is added, this method will
+ *       become public and the original method above can be deprecated.
+ */
+static String[] getExtensions(Display display) {
+    int desktop = getDesktop(display);
+    String[][ String ] mimeInfo = null;
+    switch (desktop) {
+        case DESKTOP_GNOME_24: mimeInfo = gnome24_getMimeInfo(); break;
+        case DESKTOP_GNOME: mimeInfo = gnome_getMimeInfo(); break;
+        //case DESKTOP_CDE: mimeInfo = cde_getDataTypeInfo(); break;
+        default:
+    }
+    if (mimeInfo is null) return null;
+
+    /* Create a unique set of the file extensions. */
+    String[] extensions;
+    String[] keys = mimeInfo.keys;
+    int keyIdx = 0;
+    while ( keyIdx < keys.length ) {
+        String mimeType = keys[ keyIdx ];
+        String[] mimeExts = mimeInfo[mimeType];
+        for (int index = 0; index < mimeExts.length; index++){
+            if (!extensions.contains(mimeExts[index])) {
+                extensions ~= mimeExts[index];
+            }
+        }
+        keyIdx++;
+    }
+
+    /* Return the list of extensions. */
+    String[] extStrings = new String[]( extensions.length );
+    for (int index = 0; index < extensions.length; index++) {
+        extStrings[index] = extensions[index];
+    }
+    return extStrings;
+}
+
+/**
+ * Answers all available programs in the operating system.  Note
+ * that a <code>Display</code> must already exist to guarantee
+ * that this method returns an appropriate result.
+ *
+ * @return an array of programs
+ */
+public static Program[] getPrograms() {
+    return getPrograms(Display.getCurrent());
+}
+
+/*
+ *  API: When support for multiple displays is added, this method will
+ *       become public and the original method above can be deprecated.
+ */
+static Program[] getPrograms(Display display) {
+    int desktop = getDesktop(display);
+    String[][ String ] mimeInfo = null;
+    switch (desktop) {
+        case DESKTOP_GNOME_24: break;
+        case DESKTOP_GNOME: mimeInfo = gnome_getMimeInfo(); break;
+        //case DESKTOP_CDE: mimeInfo = cde_getDataTypeInfo(); break;
+        default:
+    }
+    if (mimeInfo is null) return new Program[0];
+    Program[] programs;
+    String[] keys = mimeInfo.keys;
+    int keyIdx = 0;
+    while ( keyIdx < keys.length ) {
+        String mimeType = keys[ keyIdx ];
+        Program program = null;
+        switch (desktop) {
+            case DESKTOP_GNOME: program = gnome_getProgram(display, mimeType); break;
+            //case DESKTOP_CDE: program = cde_getProgram(display, mimeType); break;
+            default:
+        }
+        if (program !is null) programs ~= program;
+        keyIdx++;
+    }
+    Program[] programList = new Program[programs.length];
+    for (int index = 0; index < programList.length; index++) {
+        programList[index] = programs[index];
+    }
+    return programList;
+}
+
+/**
+ * Launches the operating system executable associated with the file or
+ * URL (http:// or https://).  If the file is an executable then the
+ * executable is launched.  Note that a <code>Display</code> must already
+ * exist to guarantee that this method returns an appropriate result.
+ *
+ * @param fileName the file or program name or URL (http:// or https://)
+ * @return <code>true</code> if the file is launched, otherwise <code>false</code>
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when fileName is null</li>
+ * </ul>
+ */
+public static bool launch(String fileName) {
+    return launch(Display.getCurrent(), fileName);
+}
+
+/*
+ *  API: When support for multiple displays is added, this method will
+ *       become public and the original method above can be deprecated.
+ */
+static bool launch (Display display, String fileName) {
+    if (fileName is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    switch (getDesktop (display)) {
+        case DESKTOP_GNOME_24:
+            if (gnome_24_launch (fileName)) return true;
+        default:
+            int index = fileName.lastIndexOf ('.');
+            if (index !is -1) {
+                String extension = fileName.substring (index);
+                Program program = Program.findProgram (display, extension);
+                if (program !is null && program.execute (fileName)) return true;
+            }
+            String lowercaseName = fileName.toLowerCase ();
+            if (lowercaseName.startsWith (PREFIX_HTTP) || lowercaseName.startsWith (PREFIX_HTTPS)) {
+                Program program = Program.findProgram (display, ".html"); //$NON-NLS-1$
+                if (program is null) {
+                    program = Program.findProgram (display, ".htm"); //$NON-NLS-1$
+                }
+                if (program !is null && program.execute (fileName)) return true;
+            }
+            break;
+    }
+    try {
+        Compatibility.exec (fileName);
+        return true;
+    } catch (IOException e) {
+        return false;
+    }
+}
+
+/**
+ * Compares the argument to the receiver, and returns true
+ * if they represent the <em>same</em> object using a class
+ * specific comparison.
+ *
+ * @param other the object to compare with this object
+ * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
+ *
+ * @see #hashCode()
+ */
+public override int opEquals(Object other) {
+    if (this is other) return true;
+    if (!(cast(Program)other)) return false;
+    Program program = cast(Program)other;
+    return display is program.display && name.equals(program.name) && command.equals(program.command);
+}
+
+/**
+ * Executes the program with the file as the single argument
+ * in the operating system.  It is the responsibility of the
+ * programmer to ensure that the file contains valid data for
+ * this program.
+ *
+ * @param fileName the file or program name
+ * @return <code>true</code> if the file is launched, otherwise <code>false</code>
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT when fileName is null</li>
+ * </ul>
+ */
+public bool execute(String fileName) {
+    if (fileName is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    int desktop = getDesktop(display);
+    switch (desktop) {
+        case DESKTOP_GNOME_24: return gnome_24_execute(fileName);
+        case DESKTOP_GNOME: return gnome_execute(fileName);
+        //case DESKTOP_CDE: return cde_execute(fileName);
+        default:
+    }
+    return false;
+}
+
+/**
+ * Returns the receiver's image data.  This is the icon
+ * that is associated with the receiver in the operating
+ * system.
+ *
+ * @return the image data for the program, may be null
+ */
+public ImageData getImageData() {
+    switch (getDesktop(display)) {
+        case DESKTOP_GNOME_24:
+        case DESKTOP_GNOME: return gnome_getImageData();
+        //case DESKTOP_CDE: return cde_getImageData();
+        default:
+    }
+    return null;
+}
+
+/**
+ * Returns the receiver's name.  This is as short and
+ * descriptive a name as possible for the program.  If
+ * the program has no descriptive name, this string may
+ * be the executable name, path or empty.
+ *
+ * @return the name of the program
+ */
+public String getName() {
+    return name;
+}
+
+/**
+ * Returns an integer hash code for the receiver. Any two
+ * objects that return <code>true</code> when passed to
+ * <code>equals</code> must return the same value for this
+ * method.
+ *
+ * @return the receiver's hash
+ *
+ * @see #equals(Object)
+ */
+public override hash_t toHash() {
+    return .toHash(name) ^ .toHash(command) ^ display.toHash();
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the program
+ */
+public String toString() {
+    return Format( "Program {{{}}", name );
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/program/all.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,7 @@
+module org.eclipse.swt.program.all;
+
+import java.lang.all;
+
+public import org.eclipse.swt.program.Program;
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/std.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,13 @@
+module org.eclipse.swt.std;
+
+public import org.eclipse.swt.SWT;
+public import org.eclipse.swt.SWTError;
+public import org.eclipse.swt.SWTException;
+public import java.lang.all;
+
+public import org.eclipse.swt.events.all;
+public import org.eclipse.swt.graphics.all;
+public import org.eclipse.swt.layout.all;
+public import org.eclipse.swt.widgets.all;
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Button.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,847 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Button;
+
+import java.lang.all;
+
+import org.eclipse.swt.widgets.Control;
+
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.ImageList;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.widgets.Decorations;
+
+
+/**
+ * Instances of this class represent a selectable user interface object that
+ * issues notification when pressed and released.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>ARROW, CHECK, PUSH, RADIO, TOGGLE, FLAT</dd>
+ * <dd>UP, DOWN, LEFT, RIGHT, CENTER</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles ARROW, CHECK, PUSH, RADIO, and TOGGLE
+ * may be specified.
+ * </p><p>
+ * Note: Only one of the styles LEFT, RIGHT, and CENTER may be specified.
+ * </p><p>
+ * Note: Only one of the styles UP, DOWN, LEFT, and RIGHT may be specified
+ * when the ARROW style is specified.
+ * </p><p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ * 
+ * @see <a href="http://www.eclipse.org/swt/snippets/#button">Button snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class Button : Control {
+
+    alias Control.computeSize computeSize;
+    alias Control.mnemonicHit mnemonicHit;
+    alias Control.mnemonicMatch mnemonicMatch;
+    alias Control.setBackgroundColor setBackgroundColor;
+    alias Control.setForegroundColor setForegroundColor;
+
+    GtkWidget* boxHandle, labelHandle, imageHandle, arrowHandle, groupHandle;
+    bool selected, grayed;
+    ImageList imageList;
+    Image image;
+    String text;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#ARROW
+ * @see SWT#CHECK
+ * @see SWT#PUSH
+ * @see SWT#RADIO
+ * @see SWT#TOGGLE
+ * @see SWT#FLAT
+ * @see SWT#LEFT
+ * @see SWT#RIGHT
+ * @see SWT#CENTER
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Composite parent, int style) {
+    super (parent, checkStyle (style));
+}
+
+static int checkStyle (int style) {
+    style = checkBits (style, SWT.PUSH, SWT.ARROW, SWT.CHECK, SWT.RADIO, SWT.TOGGLE, 0);
+    if ((style & (SWT.PUSH | SWT.TOGGLE)) !is 0) {
+        return checkBits (style, SWT.CENTER, SWT.LEFT, SWT.RIGHT, 0, 0, 0);
+    }
+    if ((style & (SWT.CHECK | SWT.RADIO)) !is 0) {
+        return checkBits (style, SWT.LEFT, SWT.RIGHT, SWT.CENTER, 0, 0, 0);
+    }
+    if ((style & SWT.ARROW) !is 0) {
+        style |= SWT.NO_FOCUS;
+        return checkBits (style, SWT.UP, SWT.DOWN, SWT.LEFT, SWT.RIGHT, 0, 0);
+    }
+    return style;
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the control is selected by the user, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * <code>widgetSelected</code> is called when the control is selected by the user.
+ * <code>widgetDefaultSelected</code> is not called.
+ * </p>
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener (SelectionListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Selection,typedListener);
+    addListener (SWT.DefaultSelection,typedListener);
+}
+
+override public Point computeSize (int wHint, int hHint, bool changed) {
+    checkWidget ();
+    if (wHint !is SWT.DEFAULT && wHint < 0) wHint = 0;
+    if (hHint !is SWT.DEFAULT && hHint < 0) hHint = 0;
+    /*
+    * Feature in GTK, GtkCheckButton and GtkRadioButton allocate
+    * only the minimum size necessary for its child. This causes the child
+    * alignment to fail. The fix is to set the child size to the size
+    * of the button.
+    */
+    forceResize ();
+    int reqWidth = -1, reqHeight = -1;
+    if ((style & (SWT.CHECK | SWT.RADIO)) !is 0) {
+        OS.gtk_widget_get_size_request (boxHandle, &reqWidth, &reqHeight);
+        OS.gtk_widget_set_size_request (boxHandle, -1, -1);
+    }
+    Point size = computeNativeSize (handle, wHint, hHint, changed);
+    if ((style & (SWT.CHECK | SWT.RADIO)) !is 0) {
+        OS.gtk_widget_set_size_request (boxHandle, reqWidth, reqHeight);
+    }
+    if (wHint !is SWT.DEFAULT || hHint !is SWT.DEFAULT) {
+        if ((OS.GTK_WIDGET_FLAGS (handle) & OS.GTK_CAN_DEFAULT) !is 0) {
+            GtkBorder border;
+            GtkBorder* buffer;
+            OS.gtk_widget_style_get1 (handle, OS.default_border.ptr, cast(int*)&buffer );
+            if (buffer !is null) {
+                border = *buffer;
+            } else {
+                /* Use the GTK+ default value of 1 for each. */
+                border.left = border.right = border.top = border.bottom = 1;
+            }
+            if (wHint !is SWT.DEFAULT) size.x += border.left + border.right;
+            if (hHint !is SWT.DEFAULT) size.y += border.top + border.bottom;
+        }
+    }
+    return size;
+}
+
+override void createHandle (int index) {
+    state |= HANDLE;
+    if ((style & (SWT.PUSH | SWT.TOGGLE)) is 0) state |= THEME_BACKGROUND;
+    int bits = SWT.ARROW | SWT.TOGGLE | SWT.CHECK | SWT.RADIO | SWT.PUSH;
+    fixedHandle = cast(GtkWidget*)OS.g_object_new (display.gtk_fixed_get_type (), null);
+    if (fixedHandle is null) error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_fixed_set_has_window (cast(GtkFixed*)fixedHandle, true);
+    switch (style & bits) {
+        case SWT.ARROW:
+            int arrow_type = OS.GTK_ARROW_UP;
+            if ((style & SWT.UP) !is 0) arrow_type = OS.GTK_ARROW_UP;
+            if ((style & SWT.DOWN) !is 0) arrow_type = OS.GTK_ARROW_DOWN;
+            if ((style & SWT.LEFT) !is 0) arrow_type = OS.GTK_ARROW_LEFT;
+            if ((style & SWT.RIGHT) !is 0) arrow_type = OS.GTK_ARROW_RIGHT;
+            handle = OS.gtk_button_new ();
+            if (handle is null) error (SWT.ERROR_NO_HANDLES);
+            arrowHandle = OS.gtk_arrow_new (arrow_type, OS.GTK_SHADOW_OUT);
+            if (arrowHandle is null) error (SWT.ERROR_NO_HANDLES);
+            break;
+        case SWT.TOGGLE:
+            handle = OS.gtk_toggle_button_new ();
+            if (handle is null) error (SWT.ERROR_NO_HANDLES);
+            break;
+        case SWT.CHECK:
+            handle = OS.gtk_check_button_new ();
+            if (handle is null) error (SWT.ERROR_NO_HANDLES);
+            break;
+        case SWT.RADIO:
+            /*
+            * Feature in GTK.  In GTK, radio button must always be part of
+            * a radio button group.  In a GTK radio group, one button is always
+            * selected.  This means that it is not possible to have a single
+            * radio button that is unselected.  This is necessary to allow
+            * applications to implement their own radio behavior or use radio
+            * buttons outside of radio groups.  The fix is to create a hidden
+            * radio button for each radio button we create and add them
+            * to the same group.  This allows the visible button to be
+            * unselected.
+            */
+            groupHandle = cast(GtkWidget*)OS.gtk_radio_button_new (null);
+            if (groupHandle is null) error (SWT.ERROR_NO_HANDLES);
+            OS.g_object_ref (groupHandle);
+            OS.gtk_object_sink (cast(GtkObject*)groupHandle);
+            handle = OS.gtk_radio_button_new ( OS.gtk_radio_button_get_group (cast(GtkRadioButton*)groupHandle));
+            if (handle is null) error (SWT.ERROR_NO_HANDLES);
+            break;
+        case SWT.PUSH:
+        default:
+            handle = OS.gtk_button_new ();
+            if (handle is null) error (SWT.ERROR_NO_HANDLES);
+            OS.GTK_WIDGET_SET_FLAGS(handle, OS.GTK_CAN_DEFAULT);
+            break;
+    }
+    if ((style & SWT.ARROW) !is 0) {
+        OS.gtk_container_add (cast(GtkContainer*)handle, arrowHandle);
+    } else {
+        boxHandle = OS.gtk_hbox_new (false, 4);
+        if (boxHandle is null) error (SWT.ERROR_NO_HANDLES);
+        labelHandle = OS.gtk_label_new_with_mnemonic (null);
+        if (labelHandle is null) error (SWT.ERROR_NO_HANDLES);
+        imageHandle = OS.gtk_image_new ();
+        if (imageHandle is null) error (SWT.ERROR_NO_HANDLES);
+        OS.gtk_container_add (cast(GtkContainer*)handle, boxHandle);
+        OS.gtk_container_add (cast(GtkContainer*)boxHandle, imageHandle);
+        OS.gtk_container_add (cast(GtkContainer*)boxHandle, labelHandle);
+    }
+    OS.gtk_container_add (cast(GtkContainer*)fixedHandle, handle);
+
+    if ((style & SWT.ARROW) !is 0) return;
+    _setAlignment (style & (SWT.LEFT | SWT.CENTER | SWT.RIGHT));
+}
+
+override void createWidget (int index) {
+    super.createWidget (index);
+    text = "";
+}
+
+override void deregister () {
+    super.deregister ();
+    if (boxHandle !is null) display.removeWidget (boxHandle);
+    if (labelHandle !is null) display.removeWidget (labelHandle);
+    if (imageHandle !is null) display.removeWidget (imageHandle);
+    if (arrowHandle !is null) display.removeWidget (arrowHandle);
+}
+
+override GtkWidget* fontHandle () {
+    if (labelHandle !is null) return labelHandle;
+    return super.fontHandle ();
+}
+
+/**
+ * Returns a value which describes the position of the
+ * text or image in the receiver. The value will be one of
+ * <code>LEFT</code>, <code>RIGHT</code> or <code>CENTER</code>
+ * unless the receiver is an <code>ARROW</code> button, in
+ * which case, the alignment will indicate the direction of
+ * the arrow (one of <code>LEFT</code>, <code>RIGHT</code>,
+ * <code>UP</code> or <code>DOWN</code>).
+ *
+ * @return the alignment
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getAlignment () {
+    checkWidget ();
+    if ((style & SWT.ARROW) !is 0) {
+        if ((style & SWT.UP) !is 0) return SWT.UP;
+        if ((style & SWT.DOWN) !is 0) return SWT.DOWN;
+        if ((style & SWT.LEFT) !is 0) return SWT.LEFT;
+        if ((style & SWT.RIGHT) !is 0) return SWT.RIGHT;
+        return SWT.UP;
+    }
+    if ((style & SWT.LEFT) !is 0) return SWT.LEFT;
+    if ((style & SWT.CENTER) !is 0) return SWT.CENTER;
+    if ((style & SWT.RIGHT) !is 0) return SWT.RIGHT;
+    return SWT.LEFT;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is grayed,
+ * and false otherwise. When the widget does not have
+ * the <code>CHECK</code> style, return false.
+ *
+ * @return the grayed state of the checkbox
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * 
+ * @since 3.4
+ */
+public bool getGrayed () {
+    checkWidget();
+    if ((style & SWT.CHECK) is 0) return false;
+    return grayed;
+}
+
+/**
+ * Returns the receiver's image if it has one, or null
+ * if it does not.
+ *
+ * @return the receiver's image
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Image getImage () {
+    checkWidget ();
+    return image;
+}
+
+override String getNameText () {
+    return getText ();
+}
+
+/**
+ * Returns <code>true</code> if the receiver is selected,
+ * and false otherwise.
+ * <p>
+ * When the receiver is of type <code>CHECK</code> or <code>RADIO</code>,
+ * it is selected when it is checked. When it is of type <code>TOGGLE</code>,
+ * it is selected when it is pushed in. If the receiver is of any other type,
+ * this method returns false.
+ *
+ * @return the selection state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool getSelection () {
+    checkWidget ();
+    if ((style & (SWT.CHECK | SWT.RADIO | SWT.TOGGLE)) is 0) return false;
+    return cast(bool)OS.gtk_toggle_button_get_active (cast(GtkToggleButton*)handle);
+}
+
+/**
+ * Returns the receiver's text, which will be an empty
+ * string if it has never been set or if the receiver is
+ * an <code>ARROW</code> button.
+ *
+ * @return the receiver's text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getText () {
+    checkWidget();
+    if ((style & SWT.ARROW) !is 0) return "";
+    return text;
+}
+
+override int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* event) {
+    auto result = super.gtk_button_press_event (widget, event);
+    if (result !is 0) return result;
+    if ((style & SWT.RADIO) !is 0) selected  = getSelection ();
+    return result;
+}
+
+override int /*long*/ gtk_clicked (GtkWidget* widget) {
+    if ((style & SWT.RADIO) !is 0) {
+        if ((parent.getStyle () & SWT.NO_RADIO_GROUP) !is 0) {
+            setSelection (!selected);
+        } else {
+            selectRadio ();
+        }
+    } else {
+        if ((style & SWT.CHECK) !is 0) {
+            if (grayed) {
+                if (OS.gtk_toggle_button_get_active (handle)) {
+                    OS.gtk_toggle_button_set_inconsistent (handle, true);
+                } else {
+                    OS.gtk_toggle_button_set_inconsistent (handle, false);
+                }
+            }
+        }
+    }
+    postEvent (SWT.Selection);
+    return 0;
+}
+
+override int /*long*/ gtk_focus_in_event (GtkWidget* widget, GdkEventFocus* event) {
+    auto result = super.gtk_focus_in_event (widget, event);
+    // widget could be disposed at this point
+    if (handle is null) return 0;
+    if ((style & SWT.PUSH) !is 0 && OS.GTK_WIDGET_HAS_DEFAULT (handle)) {
+        Decorations menuShell = menuShell ();
+        menuShell.defaultButton = this;
+    }
+    return result;
+}
+
+override int /*long*/ gtk_focus_out_event (GtkWidget* widget, GdkEventFocus* event) {
+    auto result = super.gtk_focus_out_event (widget, event);
+    // widget could be disposed at this point
+    if (handle is null) return 0;
+    if ((style & SWT.PUSH) !is 0 && !OS.GTK_WIDGET_HAS_DEFAULT (handle)) {
+        Decorations menuShell = menuShell ();
+        if (menuShell.defaultButton is this) {
+            menuShell.defaultButton = null;
+        }
+    }
+    return result;
+}
+
+override int /*long*/ gtk_key_press_event (GtkWidget* widget, GdkEventKey* event) {
+    auto result = super.gtk_key_press_event (widget, event);
+    if (result !is 0) return result;
+    if ((style & SWT.RADIO) !is 0) selected  = getSelection ();
+    return result;
+}
+
+override void hookEvents () {
+    super.hookEvents();
+    OS.g_signal_connect_closure (handle, OS.clicked.ptr, display.closures [CLICKED], false);
+    if (labelHandle !is null) {
+        OS.g_signal_connect_closure_by_id (cast(void*)labelHandle, display.signalIds [MNEMONIC_ACTIVATE], 0, display.closures [MNEMONIC_ACTIVATE], false);
+    }
+}
+
+override bool isDescribedByLabel () {
+    return false;
+}
+
+override bool mnemonicHit (wchar key) {
+    if (labelHandle is null) return false;
+    bool result = super.mnemonicHit (labelHandle, key);
+    if (result) setFocus ();
+    return result;
+}
+
+override bool mnemonicMatch (wchar key) {
+    if (labelHandle is null) return false;
+    return mnemonicMatch (labelHandle, key);
+}
+
+override void register () {
+    super.register ();
+    if (boxHandle !is null) display.addWidget (boxHandle, this);
+    if (labelHandle !is null) display.addWidget (labelHandle, this);
+    if (imageHandle !is null) display.addWidget (imageHandle, this);
+    if (arrowHandle !is null) display.addWidget (arrowHandle, this);
+}
+
+override void releaseHandle () {
+    super.releaseHandle ();
+    boxHandle = imageHandle = labelHandle = arrowHandle = null;
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    if (groupHandle !is null) OS.g_object_unref (groupHandle);
+    groupHandle = null;
+    if (imageList !is null) imageList.dispose ();
+    imageList = null;
+    image = null;
+    text = null;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is selected by the user.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener (SelectionListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Selection, listener);
+    eventTable.unhook (SWT.DefaultSelection,listener);
+}
+
+override void resizeHandle (int width, int height) {
+    super.resizeHandle (width, height);
+    /*
+    * Feature in GTK, GtkCheckButton and GtkRadioButton allocate
+    * only the minimum size necessary for its child. This causes the child
+    * alignment to fail. The fix is to set the child size to the size
+    * of the button.
+    */
+    if ((style & (SWT.CHECK | SWT.RADIO)) !is 0) {
+        OS.gtk_widget_set_size_request (boxHandle, width, -1);
+    }
+}
+
+void selectRadio () {
+    /*
+    * This code is intentionally commented.  When two groups
+    * of radio buttons with the same parent are separated by
+    * another control, the correct behavior should be that
+    * the two groups act independently.  This is consistent
+    * with radio tool and menu items.  The commented code
+    * implements this behavior.
+    */
+//  int index = 0;
+//  Control [] children = parent._getChildren ();
+//  while (index < children.length && children [index] !is this) index++;
+//  int i = index - 1;
+//  while (i >= 0 && children [i].setRadioSelection (false)) --i;
+//  int j = index + 1;
+//  while (j < children.length && children [j].setRadioSelection (false)) j++;
+//  setSelection (true);
+    Control [] children = parent._getChildren ();
+    for (int i=0; i<children.length; i++) {
+        Control child = children [i];
+        if (this !is child) child.setRadioSelection (false);
+    }
+    setSelection (true);
+}
+
+/**
+ * Controls how text, images and arrows will be displayed
+ * in the receiver. The argument should be one of
+ * <code>LEFT</code>, <code>RIGHT</code> or <code>CENTER</code>
+ * unless the receiver is an <code>ARROW</code> button, in
+ * which case, the argument indicates the direction of
+ * the arrow (one of <code>LEFT</code>, <code>RIGHT</code>,
+ * <code>UP</code> or <code>DOWN</code>).
+ *
+ * @param alignment the new alignment
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setAlignment (int alignment) {
+    checkWidget ();
+    _setAlignment (alignment);
+}
+
+void _setAlignment (int alignment) {
+    if ((style & SWT.ARROW) !is 0) {
+        if ((style & (SWT.UP | SWT.DOWN | SWT.LEFT | SWT.RIGHT)) is 0) return;
+        style &= ~(SWT.UP | SWT.DOWN | SWT.LEFT | SWT.RIGHT);
+        style |= alignment & (SWT.UP | SWT.DOWN | SWT.LEFT | SWT.RIGHT);
+        int arrow_type = OS.GTK_ARROW_UP;
+        bool isRTL = (style & SWT.RIGHT_TO_LEFT) !is 0;
+        switch (alignment) {
+            case SWT.UP: arrow_type = OS.GTK_ARROW_UP; break;
+            case SWT.DOWN: arrow_type = OS.GTK_ARROW_DOWN; break;
+            case SWT.LEFT: arrow_type = isRTL ? OS.GTK_ARROW_RIGHT : OS.GTK_ARROW_LEFT; break;
+            case SWT.RIGHT: arrow_type = isRTL ? OS.GTK_ARROW_LEFT : OS.GTK_ARROW_RIGHT; break;
+            default:
+        }
+        OS.gtk_arrow_set (cast(GtkArrow*)arrowHandle, arrow_type, OS.GTK_SHADOW_OUT);
+        return;
+    }
+    if ((alignment & (SWT.LEFT | SWT.RIGHT | SWT.CENTER)) is 0) return;
+    style &= ~(SWT.LEFT | SWT.RIGHT | SWT.CENTER);
+    style |= alignment & (SWT.LEFT | SWT.RIGHT | SWT.CENTER);
+    /* Alignment not honoured when image and text are visible */
+    bool bothVisible = OS.GTK_WIDGET_VISIBLE (labelHandle) && OS.GTK_WIDGET_VISIBLE (imageHandle);
+    if (bothVisible) {
+        if ((style & (SWT.RADIO | SWT.CHECK)) !is 0) alignment = SWT.LEFT;
+        if ((style & (SWT.PUSH | SWT.TOGGLE)) !is 0) alignment = SWT.CENTER;
+    }
+    if ((alignment & SWT.LEFT) !is 0) {
+        if (bothVisible) {
+            OS.gtk_box_set_child_packing (cast(GtkBox*)boxHandle, labelHandle, false, false, 0, OS.GTK_PACK_START);
+            OS.gtk_box_set_child_packing (cast(GtkBox*)boxHandle, imageHandle, false, false, 0, OS.GTK_PACK_START);
+        }
+        OS.gtk_misc_set_alignment (cast(GtkMisc*)labelHandle, 0.0f, 0.5f);
+        OS.gtk_label_set_justify (cast(GtkLabel*)labelHandle, OS.GTK_JUSTIFY_LEFT);
+        OS.gtk_misc_set_alignment (cast(GtkMisc*)imageHandle, 0.0f, 0.5f);
+        return;
+    }
+    if ((alignment & SWT.CENTER) !is 0) {
+        if (bothVisible) {
+            OS.gtk_box_set_child_packing (cast(GtkBox*)boxHandle, labelHandle, true, true, 0, OS.GTK_PACK_END);
+            OS.gtk_box_set_child_packing (cast(GtkBox*)boxHandle, imageHandle, true, true, 0, OS.GTK_PACK_START);
+            OS.gtk_misc_set_alignment (cast(GtkMisc*)labelHandle, 0f, 0.5f);
+            OS.gtk_misc_set_alignment (cast(GtkMisc*)imageHandle, 1f, 0.5f);
+        } else {
+            OS.gtk_misc_set_alignment (cast(GtkMisc*)labelHandle, 0.5f, 0.5f);
+            OS.gtk_label_set_justify (cast(GtkLabel*)labelHandle, OS.GTK_JUSTIFY_CENTER);
+            OS.gtk_misc_set_alignment (cast(GtkMisc*)imageHandle, 0.5f, 0.5f);
+        }
+        return;
+    }
+    if ((alignment & SWT.RIGHT) !is 0) {
+        if (bothVisible) {
+            OS.gtk_box_set_child_packing (cast(GtkBox*)boxHandle, labelHandle, false, false, 0, OS.GTK_PACK_END);
+            OS.gtk_box_set_child_packing (cast(GtkBox*)boxHandle, imageHandle, false, false, 0, OS.GTK_PACK_END);
+        }
+        OS.gtk_misc_set_alignment (cast(GtkMisc*)labelHandle, 1.0f, 0.5f);
+        OS.gtk_label_set_justify (cast(GtkLabel*)labelHandle, OS.GTK_JUSTIFY_RIGHT);
+        OS.gtk_misc_set_alignment (cast(GtkMisc*)imageHandle, 1.0f, 0.5f);
+        return;
+    }
+}
+
+override void setBackgroundColor (GdkColor* color) {
+    super.setBackgroundColor (color);
+    setBackgroundColor(fixedHandle, color);
+    if (labelHandle !is null) setBackgroundColor(labelHandle, color);
+    if (imageHandle !is null) setBackgroundColor(imageHandle, color);
+}
+
+override void setFontDescription (PangoFontDescription* font) {
+    super.setFontDescription (font);
+    if (labelHandle !is null) OS.gtk_widget_modify_font (labelHandle, font);
+    if (imageHandle !is null) OS.gtk_widget_modify_font (imageHandle, font);
+}
+
+override bool setRadioSelection (bool value) {
+    if ((style & SWT.RADIO) is 0) return false;
+    if (getSelection () !is value) {
+        setSelection (value);
+        postEvent (SWT.Selection);
+    }
+    return true;
+}
+
+override void setForegroundColor (GdkColor* color) {
+    super.setForegroundColor (color);
+    setForegroundColor (fixedHandle, color);
+    if (labelHandle !is null) setForegroundColor (labelHandle, color);
+    if (imageHandle !is null) setForegroundColor (imageHandle, color);
+}
+
+/**
+ * Sets the grayed state of the receiver.  This state change 
+ * only applies if the control was created with the SWT.CHECK
+ * style.
+ *
+ * @param grayed the new grayed state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * 
+ * @since 3.4
+ */
+public void setGrayed (bool grayed) {
+    checkWidget();
+    if ((style & SWT.CHECK) is 0) return;
+    this.grayed = grayed;
+    if (grayed && OS.gtk_toggle_button_get_active (handle)) {
+        OS.gtk_toggle_button_set_inconsistent (handle, true);
+    } else {
+        OS.gtk_toggle_button_set_inconsistent (handle, false);
+    }
+}
+
+/**
+ * Sets the receiver's image to the argument, which may be
+ * <code>null</code> indicating that no image should be displayed.
+ * <p>
+ * Note that a Button can display an image and text simultaneously
+ * on Windows (starting with XP), GTK+ and OSX.  On other platforms,
+ * a Button that has an image and text set into it will display the
+ * image or text that was set most recently.
+ * </p>
+ * @param image the image to display on the receiver (may be <code>null</code>)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setImage (Image image) {
+    checkWidget ();
+    if ((style & SWT.ARROW) !is 0) return;
+    if (imageList !is null) imageList.dispose ();
+    imageList = null;
+    if (image !is null) {
+        if (image.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
+        imageList = new ImageList ();
+        int imageIndex = imageList.add (image);
+        auto pixbuf = imageList.getPixbuf (imageIndex);
+        OS.gtk_image_set_from_pixbuf (cast(GtkImage*)imageHandle, pixbuf);
+        if (text.length is 0) OS.gtk_widget_hide (labelHandle);
+        OS.gtk_widget_show (imageHandle);
+    } else {
+        OS.gtk_image_set_from_pixbuf (cast(GtkImage*)imageHandle, null);
+        OS.gtk_widget_show (labelHandle);
+        OS.gtk_widget_hide (imageHandle);
+    }
+    this.image = image;
+    _setAlignment (style);
+}
+
+override void setOrientation () {
+    super.setOrientation ();
+    if ((style & SWT.RIGHT_TO_LEFT) !is 0) {
+        if (boxHandle !is null) OS.gtk_widget_set_direction (boxHandle, OS.GTK_TEXT_DIR_RTL);
+        if (labelHandle !is null) OS.gtk_widget_set_direction (labelHandle, OS.GTK_TEXT_DIR_RTL);
+        if (imageHandle !is null) OS.gtk_widget_set_direction (imageHandle, OS.GTK_TEXT_DIR_RTL);
+        if (arrowHandle !is null) {
+            switch (style & (SWT.LEFT | SWT.RIGHT)) {
+                case SWT.LEFT: OS.gtk_arrow_set (cast(GtkArrow*)arrowHandle, OS.GTK_ARROW_RIGHT, OS.GTK_SHADOW_OUT); break;
+                case SWT.RIGHT: OS.gtk_arrow_set (cast(GtkArrow*)arrowHandle, OS.GTK_ARROW_LEFT, OS.GTK_SHADOW_OUT); break;
+                default:
+            }
+        }
+    }
+}
+
+/**
+ * Sets the selection state of the receiver, if it is of type <code>CHECK</code>,
+ * <code>RADIO</code>, or <code>TOGGLE</code>.
+ *
+ * <p>
+ * When the receiver is of type <code>CHECK</code> or <code>RADIO</code>,
+ * it is selected when it is checked. When it is of type <code>TOGGLE</code>,
+ * it is selected when it is pushed in.
+ *
+ * @param selected the new selection state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (bool selected) {
+    checkWidget();
+    if ((style & (SWT.CHECK | SWT.RADIO | SWT.TOGGLE)) is 0) return;
+    OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCLICKED);
+    OS.gtk_toggle_button_set_active (cast(GtkToggleButton*)handle, selected);
+    if ((style & SWT.CHECK) !is 0) {
+        if (selected && grayed) {
+            OS.gtk_toggle_button_set_inconsistent (handle, true);
+        } else {
+            OS.gtk_toggle_button_set_inconsistent (handle, false);
+        }
+    }
+    if ((style & SWT.RADIO) !is 0) OS.gtk_toggle_button_set_active (cast(GtkToggleButton*)groupHandle, !selected);
+    OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCLICKED);
+}
+
+/**
+ * Sets the receiver's text.
+ * <p>
+ * This method sets the button label.  The label may include
+ * the mnemonic character but must not contain line delimiters.
+ * </p>
+ * <p>
+ * Mnemonics are indicated by an '&amp;' that causes the next
+ * character to be the mnemonic.  When the user presses a
+ * key sequence that matches the mnemonic, a selection
+ * event occurs. On most platforms, the mnemonic appears
+ * underlined but may be emphasized in a platform specific
+ * manner.  The mnemonic indicator character '&amp;' can be
+ * escaped by doubling it in the string, causing a single
+ * '&amp;' to be displayed.
+ * </p><p>
+ * Note that a Button can display an image and text simultaneously
+ * on Windows (starting with XP), GTK+ and OSX.  On other platforms,
+ * a Button that has an image and text set into it will display the
+ * image or text that was set most recently.
+ * </p>
+ * @param string the new text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setText (String string) {
+    checkWidget ();
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if ((style & SWT.ARROW) !is 0) return;
+    text = string;
+    char [] chars = fixMnemonic (string);
+    OS.gtk_label_set_text_with_mnemonic (cast(GtkLabel*)labelHandle, chars.toStringzValidPtr() );
+    if (image is null) OS.gtk_widget_hide (imageHandle);
+    OS.gtk_widget_show (labelHandle);
+    _setAlignment (style);
+}
+
+override void showWidget () {
+    super.showWidget ();
+    if (boxHandle !is null) OS.gtk_widget_show (boxHandle);
+    if (labelHandle !is null) OS.gtk_widget_show (labelHandle);
+    if (arrowHandle !is null) OS.gtk_widget_show (arrowHandle);
+}
+
+override int traversalCode (int key, GdkEventKey* event) {
+    int code = super.traversalCode (key, event);
+    if ((style & SWT.ARROW) !is 0) code &= ~(SWT.TRAVERSE_TAB_NEXT | SWT.TRAVERSE_TAB_PREVIOUS);
+    if ((style & SWT.RADIO) !is 0) code |= SWT.TRAVERSE_ARROW_NEXT | SWT.TRAVERSE_ARROW_PREVIOUS;
+    return code;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Canvas.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,419 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Canvas;
+
+import java.lang.all;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Caret;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.IME;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.Font;
+
+/**
+ * Instances of this class provide a surface for drawing
+ * arbitrary graphics.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>(none)</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * This class may be subclassed by custom control implementors
+ * who are building controls that are <em>not</em> constructed
+ * from aggregates of other controls. That is, they are either
+ * painted using SWT graphics calls or are handled by native
+ * methods.
+ * </p>
+ *
+ * @see Composite
+ * @see <a href="http://www.eclipse.org/swt/snippets/#canvas">Canvas snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class Canvas : Composite {
+
+    alias Composite.setBounds setBounds;
+
+    Caret caret;
+    IME ime;
+
+this () {}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Composite parent, int style) {
+    super (parent, checkStyle (style));
+}
+
+/**
+ * Fills the interior of the rectangle specified by the arguments,
+ * with the receiver's background.
+ *
+ * @param gc the gc where the rectangle is to be filled
+ * @param x the x coordinate of the rectangle to be filled
+ * @param y the y coordinate of the rectangle to be filled
+ * @param width the width of the rectangle to be filled
+ * @param height the height of the rectangle to be filled
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the gc is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the gc has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+override public void drawBackground (GC gc, int x, int y, int width, int height) {
+    checkWidget ();
+    if (gc is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (gc.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+    super.drawBackground (gc, x, y, width, height);
+}
+
+/**
+ * Returns the caret.
+ * <p>
+ * The caret for the control is automatically hidden
+ * and shown when the control is painted or resized,
+ * when focus is gained or lost and when an the control
+ * is scrolled.  To avoid drawing on top of the caret,
+ * the programmer must hide and show the caret when
+ * drawing in the window any other time.
+ * </p>
+ *
+ * @return the caret for the receiver, may be null
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Caret getCaret () {
+    checkWidget();
+    return caret;
+}
+
+override Point getIMCaretPos () {
+    if (caret is null) return super.getIMCaretPos ();
+    return new Point (caret.x, caret.y);
+}
+
+/**
+ * Returns the IME.
+ *
+ * @return the IME
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * 
+ * @since 3.4
+ */
+public IME getIME () {
+    checkWidget ();
+    return ime;
+}
+
+override int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* event) {
+    if (ime !is null) {
+        auto result = ime.gtk_button_press_event (widget, event);
+        if (result !is 0) return result;
+    }
+    return  super.gtk_button_press_event (widget, event);
+}
+
+override int /*long*/ gtk_commit (GtkIMContext* imcontext, char* text) {
+    if (ime !is null) {
+        auto result = ime.gtk_commit (imcontext, text);
+        if (result !is 0) return result;
+    }
+    return super.gtk_commit (imcontext, text);
+}
+
+override int /*long*/ gtk_expose_event (GtkWidget* widget, GdkEventExpose* event) {
+    if ((state & OBSCURED) !is 0) return 0;
+    bool isFocus = caret !is null && caret.isFocusCaret ();
+    if (isFocus) caret.killFocus ();
+    auto result = super.gtk_expose_event (widget, event);
+    if (isFocus) caret.setFocus ();
+    return result;
+}
+
+override int /*long*/ gtk_focus_in_event (GtkWidget* widget, GdkEventFocus* event) {
+    auto result = super.gtk_focus_in_event (widget, event);
+    if (caret !is null) caret.setFocus ();
+    return result;
+}
+
+override int /*long*/ gtk_focus_out_event (GtkWidget* widget, GdkEventFocus* event) {
+    auto result = super.gtk_focus_out_event (widget, event);
+    if (caret !is null) caret.killFocus ();
+    return result;
+}
+
+override int /*long*/ gtk_preedit_changed (GtkIMContext* imcontext) {
+    if (ime !is null) {
+        auto result = ime.gtk_preedit_changed (imcontext);
+        if (result !is 0) return result;
+    }
+    return super.gtk_preedit_changed (imcontext);
+}
+
+override void redrawWidget (int x, int y, int width, int height, bool redrawAll, bool all, bool trim) {
+    bool isFocus = caret !is null && caret.isFocusCaret ();
+    if (isFocus) caret.killFocus ();
+    super.redrawWidget (x, y, width, height, redrawAll, all, trim);
+    if (isFocus) caret.setFocus ();
+}
+
+override void releaseChildren (bool destroy) {
+    if (caret !is null) {
+        caret.release (false);
+        caret = null;
+    }
+    if (ime !is null) {
+        ime.release (false);
+        ime = null;
+    }
+    super.releaseChildren (destroy);
+}
+
+/**
+ * Scrolls a rectangular area of the receiver by first copying
+ * the source area to the destination and then causing the area
+ * of the source which is not covered by the destination to
+ * be repainted. Children that intersect the rectangle are
+ * optionally moved during the operation. In addition, outstanding
+ * paint events are flushed before the source area is copied to
+ * ensure that the contents of the canvas are drawn correctly.
+ *
+ * @param destX the x coordinate of the destination
+ * @param destY the y coordinate of the destination
+ * @param x the x coordinate of the source
+ * @param y the y coordinate of the source
+ * @param width the width of the area
+ * @param height the height of the area
+ * @param all <code>true</code>if children should be scrolled, and <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void scroll (int destX, int destY, int x, int y, int width, int height, bool all) {
+    checkWidget();
+    if (width <= 0 || height <= 0) return;
+    if ((style & SWT.MIRRORED) !is 0) {
+        int clientWidth = getClientWidth ();
+        x = clientWidth - width - x;
+        destX = clientWidth - width - destX;
+    }
+    int deltaX = destX - x, deltaY = destY - y;
+    if (deltaX is 0 && deltaY is 0) return;
+    if (!isVisible ()) return;
+    bool isFocus = caret !is null && caret.isFocusCaret ();
+    if (isFocus) caret.killFocus ();
+    auto window = paintWindow ();
+    auto visibleRegion = OS.gdk_drawable_get_visible_region (window);
+    GdkRectangle* srcRect = new GdkRectangle ();
+    srcRect.x = x;
+    srcRect.y = y;
+    srcRect.width = width;
+    srcRect.height = height;
+    auto copyRegion = OS.gdk_region_rectangle (srcRect);
+    OS.gdk_region_intersect(copyRegion, visibleRegion);
+    auto invalidateRegion = OS.gdk_region_rectangle (srcRect);
+    OS.gdk_region_subtract (invalidateRegion, visibleRegion);
+    OS.gdk_region_offset (invalidateRegion, deltaX, deltaY);
+    GdkRectangle* copyRect = new GdkRectangle();
+    OS.gdk_region_get_clipbox (copyRegion, copyRect);
+    if (copyRect.width !is 0 && copyRect.height !is 0) {
+        update ();
+    }
+    Control control = findBackgroundControl ();
+    if (control is null) control = this;
+    if (control.backgroundImage !is null) {
+        redrawWidget (x, y, width, height, false, false, false);
+        redrawWidget (destX, destY, width, height, false, false, false);
+    } else {
+//      GC gc = new GC (this);
+//      gc.copyArea (x, y, width, height, destX, destY);
+//      gc.dispose ();
+        auto gdkGC = OS.gdk_gc_new (window);
+        OS.gdk_gc_set_exposures (gdkGC, true);
+        OS.gdk_draw_drawable (window, gdkGC, window, copyRect.x, copyRect.y, copyRect.x + deltaX, copyRect.y + deltaY, copyRect.width, copyRect.height);
+        OS.g_object_unref (gdkGC);
+        bool disjoint = (destX + width < x) || (x + width < destX) || (destY + height < y) || (y + height < destY);
+        if (disjoint) {
+            GdkRectangle* rect = new GdkRectangle ();
+            rect.x = x;
+            rect.y = y;
+            rect.width = width;
+            rect.height = height;
+            OS.gdk_region_union_with_rect (invalidateRegion, rect);
+        } else {
+            GdkRectangle* rect = new GdkRectangle ();
+            if (deltaX !is 0) {
+                int newX = destX - deltaX;
+                if (deltaX < 0) newX = destX + width;
+                rect.x = newX;
+                rect.y = y;
+                rect.width = Math.abs(deltaX);
+                rect.height = height;
+                OS.gdk_region_union_with_rect (invalidateRegion, rect);
+            }
+            if (deltaY !is 0) {
+                int newY = destY - deltaY;
+                if (deltaY < 0) newY = destY + height;
+                rect.x = x;
+                rect.y = newY;
+                rect.width = width;
+                rect.height = Math.abs(deltaY);
+                OS.gdk_region_union_with_rect (invalidateRegion, rect);
+            }
+        }
+        OS.gdk_window_invalidate_region(window, invalidateRegion, all);
+        OS.gdk_region_destroy (visibleRegion);
+        OS.gdk_region_destroy (copyRegion);
+        OS.gdk_region_destroy (invalidateRegion);
+    }
+    if (all) {
+        Control [] children = _getChildren ();
+        for (int i=0; i<children.length; i++) {
+            Control child = children [i];
+            Rectangle rect = child.getBounds ();
+            if (Math.min(x + width, rect.x + rect.width) >= Math.max (x, rect.x) &&
+                Math.min(y + height, rect.y + rect.height) >= Math.max (y, rect.y)) {
+                    child.setLocation (rect.x + deltaX, rect.y + deltaY);
+            }
+        }
+    }
+    if (isFocus) caret.setFocus ();
+}
+
+override int setBounds (int x, int y, int width, int height, bool move, bool resize) {
+    bool isFocus = caret !is null && caret.isFocusCaret ();
+    if (isFocus) caret.killFocus ();
+    int result = super.setBounds (x, y, width, height, move, resize);
+    if (isFocus) caret.setFocus ();
+    return result;
+}
+
+/**
+ * Sets the receiver's caret.
+ * <p>
+ * The caret for the control is automatically hidden
+ * and shown when the control is painted or resized,
+ * when focus is gained or lost and when an the control
+ * is scrolled.  To avoid drawing on top of the caret,
+ * the programmer must hide and show the caret when
+ * drawing in the window any other time.
+ * </p>
+ * @param caret the new caret for the receiver, may be null
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the caret has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setCaret (Caret caret) {
+    checkWidget();
+    Caret newCaret = caret;
+    Caret oldCaret = this.caret;
+    this.caret = newCaret;
+    if (hasFocus ()) {
+        if (oldCaret !is null) oldCaret.killFocus ();
+        if (newCaret !is null) {
+            if (newCaret.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
+            newCaret.setFocus ();
+        }
+    }
+}
+
+override public void setFont (Font font) {
+    checkWidget();
+    if (caret !is null) caret.setFont (font);
+    super.setFont (font);
+}
+
+/**
+ * Sets the receiver's IME.
+ * 
+ * @param ime the new IME for the receiver, may be null
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the IME has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * 
+ * @since 3.4
+ */
+public void setIME (IME ime) {
+    checkWidget ();
+    if (ime !is null && ime.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
+    this.ime = ime;
+}
+
+void updateCaret () {
+    auto imHandle = imHandle ();
+    if (imHandle is null) return;
+    GdkRectangle* rect = new GdkRectangle ();
+    rect.x = caret.x;
+    rect.y = caret.y;
+    rect.width = caret.width;
+    rect.height = caret.height;
+    OS.gtk_im_context_set_cursor_location (imHandle, rect);
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Caret.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,522 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Caret;
+
+import java.lang.all;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swt.widgets.Canvas;
+
+/**
+ * Instances of this class provide an i-beam that is typically used
+ * as the insertion point for text.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>(none)</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ * 
+ * @see <a href="http://www.eclipse.org/swt/snippets/#caret">Caret snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample, Canvas tab</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class Caret : Widget {
+    Canvas parent;
+    int x, y, width, height;
+    bool isVisible_, isShowing;
+    int blinkRate;
+    Image image;
+    Font font;
+
+    static final int DEFAULT_WIDTH = 1;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Canvas parent, int style) {
+    super (parent, style);
+    this.parent = parent;
+    createWidget (0);
+}
+
+bool blinkCaret () {
+    if (!isVisible_) return true;
+    if (!isShowing) return showCaret ();
+    if (blinkRate is 0) return true;
+    return hideCaret ();
+}
+
+override void createWidget (int index) {
+    super.createWidget (index);
+    blinkRate = display.getCaretBlinkTime ();
+    isVisible_ = true;
+    if (parent.getCaret () is null) {
+        parent.setCaret (this);
+    }
+}
+
+bool drawCaret () {
+    if (parent is null) return false;
+    if (parent.isDisposed ()) return false;
+    auto window = parent.paintWindow ();
+    auto gc = OS.gdk_gc_new (window);
+    GdkColor* color = new GdkColor ();
+    color.red = 0xffff;
+    color.green = 0xffff;
+    color.blue = 0xffff;
+    auto colormap = OS.gdk_colormap_get_system ();
+    OS.gdk_colormap_alloc_color (colormap, color, true, true);
+    OS.gdk_gc_set_foreground (gc, color);
+    OS.gdk_gc_set_function (gc, OS.GDK_XOR);
+    if (image !is null && !image.isDisposed() && image.mask is null) {
+        int width; int height;
+        OS.gdk_drawable_get_size(image.pixmap, &width, &height);
+        int nX = x;
+        if ((parent.style & SWT.MIRRORED) !is 0) nX = parent.getClientWidth () - width - nX;
+        OS.gdk_draw_drawable(window, gc, image.pixmap, 0, 0, x, y, width, height);
+    } else {
+        int nWidth = width, nHeight = height;
+        if (nWidth <= 0) nWidth = DEFAULT_WIDTH;
+        int nX = x;
+        if ((parent.style & SWT.MIRRORED) !is 0) nX = parent.getClientWidth () - nWidth - nX;
+        OS.gdk_draw_rectangle (window, gc, 1, nX, y, nWidth, nHeight);
+    }
+    OS.g_object_unref (gc);
+    OS.gdk_colormap_free_colors (colormap, color, 1);
+    return true;
+}
+
+/**
+ * Returns a rectangle describing the receiver's size and location
+ * relative to its parent (or its display if its parent is null).
+ *
+ * @return the receiver's bounding rectangle
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Rectangle getBounds () {
+    checkWidget();
+    if (image !is null) {
+        Rectangle rect = image.getBounds ();
+        return new Rectangle (x, y, rect.width, rect.height);
+    } else {
+        if (width is 0) {
+            return new Rectangle (x, y, DEFAULT_WIDTH, height);
+        }
+    }
+    return new Rectangle (x, y, width, height);
+}
+
+/**
+ * Returns the font that the receiver will use to paint textual information.
+ *
+ * @return the receiver's font
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Font getFont () {
+    checkWidget();
+    if (font !is null) return font;
+    return parent.getFont ();
+}
+
+/**
+ * Returns the image that the receiver will use to paint the caret.
+ *
+ * @return the receiver's image
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Image getImage () {
+    checkWidget();
+    return image;
+}
+
+/**
+ * Returns a point describing the receiver's location relative
+ * to its parent (or its display if its parent is null).
+ *
+ * @return the receiver's location
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Point getLocation () {
+    checkWidget();
+    return new Point (x, y);
+}
+
+/**
+ * Returns the receiver's parent, which must be a <code>Canvas</code>.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Canvas getParent () {
+    checkWidget();
+    return parent;
+}
+
+/**
+ * Returns a point describing the receiver's size.
+ *
+ * @return the receiver's size
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Point getSize () {
+    checkWidget();
+    if (image !is null) {
+        Rectangle rect = image.getBounds ();
+        return new Point (rect.width, rect.height);
+    } else {
+        if (width is 0) {
+            return new Point (DEFAULT_WIDTH, height);
+        }
+    }
+    return new Point (width, height);
+}
+
+/**
+ * Returns <code>true</code> if the receiver is visible, and
+ * <code>false</code> otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, this method
+ * may still indicate that it is considered visible even though
+ * it may not actually be showing.
+ * </p>
+ *
+ * @return the receiver's visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool getVisible () {
+    checkWidget();
+    return isVisible_;
+}
+
+bool hideCaret () {
+    if (!isShowing) return true;
+    isShowing = false;
+    return drawCaret ();
+}
+
+/**
+ * Returns <code>true</code> if the receiver is visible and all
+ * of the receiver's ancestors are visible and <code>false</code>
+ * otherwise.
+ *
+ * @return the receiver's visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getVisible
+ */
+public bool isVisible () {
+    checkWidget();
+    return isVisible_ && parent.isVisible () && parent.hasFocus ();
+}
+
+bool isFocusCaret () {
+    return this is display.currentCaret;
+}
+
+void killFocus () {
+    if (display.currentCaret !is this) return;
+    display.setCurrentCaret (null);
+    if (isVisible_) hideCaret ();
+}
+
+override void releaseParent () {
+    super.releaseParent ();
+    if (this is parent.getCaret ()) parent.setCaret (null);
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    if (display.currentCaret is this) {
+        hideCaret ();
+        display.setCurrentCaret (null);
+    }
+    parent = null;
+    image = null;
+}
+
+/**
+ * Sets the receiver's size and location to the rectangular
+ * area specified by the arguments. The <code>x</code> and
+ * <code>y</code> arguments are relative to the receiver's
+ * parent (or its display if its parent is null).
+ *
+ * @param x the new x coordinate for the receiver
+ * @param y the new y coordinate for the receiver
+ * @param width the new width for the receiver
+ * @param height the new height for the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setBounds (int x, int y, int width, int height) {
+    checkWidget();
+    if (this.x is x && this.y is y && this.width is width && this.height is height) return;
+    bool isFocus = isFocusCaret ();
+    if (isFocus && isVisible_) hideCaret ();
+    this.x = x; this.y = y;
+    this.width = width; this.height = height;
+    parent.updateCaret ();
+    if (isFocus && isVisible_) showCaret ();
+}
+
+/**
+ * Sets the receiver's size and location to the rectangular
+ * area specified by the argument. The <code>x</code> and
+ * <code>y</code> fields of the rectangle are relative to
+ * the receiver's parent (or its display if its parent is null).
+ *
+ * @param rect the new bounds for the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setBounds (Rectangle rect) {
+    checkWidget();
+    if (rect is null) error (SWT.ERROR_NULL_ARGUMENT);
+    setBounds (rect.x, rect.y, rect.width, rect.height);
+}
+
+void setFocus () {
+    if (display.currentCaret is this) return;
+    display.setCurrentCaret (this);
+    if (isVisible_) showCaret ();
+}
+
+/**
+ * Sets the font that the receiver will use to paint textual information
+ * to the font specified by the argument, or to the default font for that
+ * kind of control if the argument is null.
+ *
+ * @param font the new font (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the font has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setFont (Font font) {
+    checkWidget();
+    if (font !is null && font.isDisposed ()) {
+        error (SWT.ERROR_INVALID_ARGUMENT);
+    }
+    this.font = font;
+}
+
+/**
+ * Sets the image that the receiver will use to paint the caret
+ * to the image specified by the argument, or to the default
+ * which is a filled rectangle if the argument is null
+ *
+ * @param image the new image (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setImage (Image image) {
+    checkWidget();
+    if (image !is null && image.isDisposed ()) {
+        error (SWT.ERROR_INVALID_ARGUMENT);
+    }
+    bool isFocus = isFocusCaret ();
+    if (isFocus && isVisible_) hideCaret ();
+    this.image = image;
+    if (isFocus && isVisible_) showCaret ();
+}
+
+/**
+ * Sets the receiver's location to the point specified by
+ * the arguments which are relative to the receiver's
+ * parent (or its display if its parent is null).
+ *
+ * @param x the new x coordinate for the receiver
+ * @param y the new y coordinate for the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setLocation (int x, int y) {
+    checkWidget();
+    setBounds (x, y, width, height);
+}
+
+/**
+ * Sets the receiver's location to the point specified by
+ * the argument which is relative to the receiver's
+ * parent (or its display if its parent is null).
+ *
+ * @param location the new location for the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setLocation (Point location) {
+    checkWidget();
+    if (location is null) error (SWT.ERROR_NULL_ARGUMENT);
+    setLocation (location.x, location.y);
+}
+
+/**
+ * Sets the receiver's size to the point specified by the arguments.
+ *
+ * @param width the new width for the receiver
+ * @param height the new height for the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSize (int width, int height) {
+    checkWidget();
+    setBounds (x, y, width, height);
+}
+
+/**
+ * Sets the receiver's size to the point specified by the argument.
+ *
+ * @param size the new extent for the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSize (Point size) {
+    checkWidget();
+    if (size is null) error (SWT.ERROR_NULL_ARGUMENT);
+    setSize (size.x, size.y);
+}
+
+/**
+ * Marks the receiver as visible if the argument is <code>true</code>,
+ * and marks it invisible otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, marking
+ * it visible may not actually cause it to be displayed.
+ * </p>
+ *
+ * @param visible the new visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setVisible (bool visible) {
+    checkWidget();
+    if (visible is isVisible_) return;
+    isVisible_ = visible;
+    if (!isFocusCaret ()) return;
+    if (isVisible_) {
+        showCaret ();
+    } else {
+        hideCaret ();
+    }
+}
+
+bool showCaret () {
+    if (isShowing) return true;
+    isShowing = true;
+    return drawCaret ();
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/ColorDialog.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,189 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.ColorDialog;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.graphics.PaletteData;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Dialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Display;
+
+import java.lang.all;
+
+/**
+ * Instances of this class allow the user to select a color
+ * from a predefined set of available colors.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>(none)</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ * 
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample, Dialog tab</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class ColorDialog : Dialog {
+    RGB rgb;
+/**
+ * Constructs a new instance of this class given only its parent.
+ *
+ * @param parent a composite control which will be the parent of the new instance
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Shell parent) {
+    this (parent, SWT.APPLICATION_MODAL);
+}
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Shell parent, int style) {
+    super (parent, checkStyle (parent, style));
+    checkSubclass ();
+}
+
+/**
+ * Returns the currently selected color in the receiver.
+ *
+ * @return the RGB value for the selected color, may be null
+ *
+ * @see PaletteData#getRGBs
+ */
+public RGB getRGB () {
+    return rgb;
+}
+/**
+ * Makes the receiver visible and brings it to the front
+ * of the display.
+ *
+ * @return the selected color, or null if the dialog was
+ *         cancelled, no color was selected, or an error
+ *         occurred
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public RGB open () {
+    char* buffer = toStringz(title);
+    auto handle = cast(GtkWidget*)OS.gtk_color_selection_dialog_new (buffer);
+    Display display = parent !is null ? parent.getDisplay (): Display.getCurrent ();
+    if (parent !is null) {
+        auto shellHandle = parent.topHandle ();
+        OS.gtk_window_set_transient_for (handle, shellHandle);
+        auto pixbufs = OS.gtk_window_get_icon_list (shellHandle);
+        if (pixbufs !is null) {
+            OS.gtk_window_set_icon_list (handle, pixbufs);
+            OS.g_list_free (pixbufs);
+        }
+    }
+    GtkColorSelectionDialog* dialog = cast(GtkColorSelectionDialog*)handle;
+    GdkColor color;
+    if (rgb !is null) {
+        color.red = cast(short)((rgb.red & 0xFF) | ((rgb.red & 0xFF) << 8));
+        color.green = cast(short)((rgb.green & 0xFF) | ((rgb.green & 0xFF) << 8));
+        color.blue = cast(short)((rgb.blue & 0xFF) | ((rgb.blue & 0xFF) << 8));
+        OS.gtk_color_selection_set_current_color (dialog.colorsel, &color);
+    }
+    OS.gtk_color_selection_set_has_palette (dialog.colorsel, true);
+    display.addIdleProc ();
+    Dialog oldModal = null;
+    if (OS.gtk_window_get_modal (handle)) {
+        oldModal = display.getModalDialog ();
+        display.setModalDialog (this);
+    }
+    int signalId = 0;
+    int /*long*/ hookId = 0;
+    CallbackData emissionData;
+    emissionData.display = display;
+    emissionData.data = handle;
+    if ((style & SWT.RIGHT_TO_LEFT) !is 0) {
+        signalId = OS.g_signal_lookup (OS.map.ptr, OS.GTK_TYPE_WIDGET());
+        hookId = OS.g_signal_add_emission_hook (signalId, 0, &Display.emissionFunc, &emissionData, null);
+    }
+    int response = OS.gtk_dialog_run (handle);
+    if ((style & SWT.RIGHT_TO_LEFT) !is 0) {
+        OS.g_signal_remove_emission_hook (signalId, hookId);
+    }
+    if (OS.gtk_window_get_modal (handle)) {
+        display.setModalDialog (oldModal);
+    }
+    bool success = response is OS.GTK_RESPONSE_OK;
+    if (success) {
+        OS.gtk_color_selection_get_current_color (dialog.colorsel, &color);
+        int red = (color.red >> 8) & 0xFF;
+        int green = (color.green >> 8) & 0xFF;
+        int blue = (color.blue >> 8) & 0xFF;
+        rgb = new RGB (red, green, blue);
+    }
+    display.removeIdleProc ();
+    OS.gtk_widget_destroy (handle);
+    if (!success) return null;
+    return rgb;
+}
+/**
+ * Sets the receiver's selected color to be the argument.
+ *
+ * @param rgb the new RGB value for the selected color, may be
+ *        null to let the platform select a default when
+ *        open() is called
+ * @see PaletteData#getRGBs
+ */
+public void setRGB (RGB rgb) {
+    this.rgb = rgb;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Combo.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,2232 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Combo;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.VerifyListener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.TypedListener;
+
+import java.lang.all;
+
+/**
+ * Instances of this class are controls that allow the user
+ * to choose an item from a list of items, or optionally
+ * enter a new value by typing it into an editable text
+ * field. Often, <code>Combo</code>s are used in the same place
+ * where a single selection <code>List</code> widget could
+ * be used but space is limited. A <code>Combo</code> takes
+ * less space than a <code>List</code> widget and shows
+ * similar information.
+ * <p>
+ * Note: Since <code>Combo</code>s can contain both a list
+ * and an editable text field, it is possible to confuse methods
+ * which access one versus the other (compare for example,
+ * <code>clearSelection()</code> and <code>deselectAll()</code>).
+ * The API documentation is careful to indicate either "the
+ * receiver's list" or the "the receiver's text field" to
+ * distinguish between the two cases.
+ * </p><p>
+ * Note that although this class is a subclass of <code>Composite</code>,
+ * it does not make sense to add children to it, or set a layout on it.
+ * </p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>DROP_DOWN, READ_ONLY, SIMPLE</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>DefaultSelection, Modify, Selection, Verify</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles DROP_DOWN and SIMPLE may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see List
+ * @see <a href="http://www.eclipse.org/swt/snippets/#combo">Combo snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class Combo : Composite {
+
+    alias Composite.computeSize computeSize;
+    alias Composite.createHandle createHandle;
+    alias Composite.dragDetect dragDetect;
+    alias Composite.gtk_button_press_event gtk_button_press_event;
+    alias Composite.setBackgroundColor setBackgroundColor;
+    alias Composite.setBounds setBounds;
+    alias Composite.setForegroundColor setForegroundColor;
+    alias Composite.setToolTipText setToolTipText;
+    alias Composite.translateTraversal translateTraversal;
+
+    GtkWidget* buttonHandle, entryHandle, listHandle, textRenderer, cellHandle, popupHandle;
+    int lastEventTime, visibleCount = 5;
+    GdkEventKey* gdkEventKey;
+    int fixStart = -1, fixEnd = -1;
+    String[] items;
+    bool ignoreSelect, lockText;
+
+    static const int INNER_BORDER = 2;
+
+    /**
+     * the operating system limit for the number of characters
+     * that the text field in an instance of this class can hold
+     */
+    public const static int LIMIT = 0xFFFF;
+
+    /*
+    * These values can be different on different platforms.
+    * Therefore they are not initialized in the declaration
+    * to stop the compiler from inlining.
+    */
+    //static {
+    //    LIMIT = 0xFFFF;
+    //}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#DROP_DOWN
+ * @see SWT#READ_ONLY
+ * @see SWT#SIMPLE
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Composite parent, int style) {
+    super (parent, checkStyle (style));
+}
+
+/**
+ * Adds the argument to the end of the receiver's list.
+ *
+ * @param string the new item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #add(String,int)
+ */
+public void add (String string) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    add (string, items.length);
+}
+
+/**
+ * Adds the argument to the receiver's list at the given
+ * zero-relative index.
+ * <p>
+ * Note: To add an item at the end of the list, use the
+ * result of calling <code>getItemCount()</code> as the
+ * index or use <code>add(String)</code>.
+ * </p>
+ *
+ * @param string the new item
+ * @param index the index for the item
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #add(String)
+ */
+public void add (String string, int index) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (!(0 <= index && index <= items.length)) {
+        error (SWT.ERROR_INVALID_RANGE);
+    }
+    String [] newItems = new String[]( items.length + 1 );
+    System.arraycopy (items, 0, newItems, 0, index);
+    newItems [index] = string;
+    System.arraycopy (items, index, newItems, index + 1, items.length - index);
+    items = newItems;
+    char* buffer = string.toStringzValidPtr();
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        OS.gtk_combo_box_insert_text (handle, index, buffer);
+        if ((style & SWT.RIGHT_TO_LEFT) !is 0 && popupHandle !is null) {
+            display.doSetDirectionProc( popupHandle, OS.GTK_TEXT_DIR_RTL);
+        }
+    } else {
+        /*
+        * Feature in GTK. When the list is empty and the first item
+        * is added, the combo box selects that item replacing the
+        * text in the entry field.  The fix is to avoid this by
+        * stopping the "delete" and "insert_text" signal emission.
+        */
+        ignoreSelect = lockText = true;
+        auto item = OS.gtk_list_item_new_with_label (buffer);
+        auto label = OS.gtk_bin_get_child (item);
+        setForegroundColor (label, getForegroundColor ());
+        OS.gtk_widget_modify_font (label, getFontDescription ());
+        OS.gtk_widget_set_direction (label, OS.gtk_widget_get_direction (handle));
+        OS.gtk_widget_show (item);
+        auto items = OS.g_list_append (null, item);
+        OS.gtk_list_insert_items (listHandle, items, index);
+        ignoreSelect = lockText = false;
+    }
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the receiver's text is modified, by sending
+ * it one of the messages defined in the <code>ModifyListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ModifyListener
+ * @see #removeModifyListener
+ */
+public void addModifyListener (ModifyListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Modify, typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the user changes the receiver's selection, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * <code>widgetSelected</code> is called when the user changes the combo's list selection.
+ * <code>widgetDefaultSelected</code> is typically called when ENTER is pressed the combo's text area.
+ * </p>
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener(SelectionListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Selection,typedListener);
+    addListener (SWT.DefaultSelection,typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the receiver's text is verified, by sending
+ * it one of the messages defined in the <code>VerifyListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see VerifyListener
+ * @see #removeVerifyListener
+ *
+ * @since 3.1
+ */
+public void addVerifyListener (VerifyListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Verify, typedListener);
+}
+
+static int checkStyle (int style) {
+    /*
+    * Feature in Windows.  It is not possible to create
+    * a combo box that has a border using Windows style
+    * bits.  All combo boxes draw their own border and
+    * do not use the standard Windows border styles.
+    * Therefore, no matter what style bits are specified,
+    * clear the BORDER bits so that the SWT style will
+    * match the Windows widget.
+    *
+    * The Windows behavior is currently implemented on
+    * all platforms.
+    */
+    style &= ~SWT.BORDER;
+
+    /*
+    * Even though it is legal to create this widget
+    * with scroll bars, they serve no useful purpose
+    * because they do not automatically scroll the
+    * widget's client area.  The fix is to clear
+    * the SWT style.
+    */
+    style &= ~(SWT.H_SCROLL | SWT.V_SCROLL);
+    style = checkBits (style, SWT.DROP_DOWN, SWT.SIMPLE, 0, 0, 0, 0);
+    if ((style & SWT.SIMPLE) !is 0) return style & ~SWT.READ_ONLY;
+    return style;
+}
+
+protected override void checkSubclass () {
+    if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+/**
+ * Sets the selection in the receiver's text field to an empty
+ * selection starting just before the first character. If the
+ * text field is editable, this has the effect of placing the
+ * i-beam at the start of the text.
+ * <p>
+ * Note: To clear the selected items in the receiver's list,
+ * use <code>deselectAll()</code>.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #deselectAll
+ */
+public void clearSelection () {
+    checkWidget();
+    if (entryHandle !is null) {
+        int position = OS.gtk_editable_get_position (entryHandle);
+        OS.gtk_editable_select_region (entryHandle, position, position);
+    }
+}
+
+void clearText () {
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+        if ((style & SWT.READ_ONLY) !is 0) {
+            int index = OS.gtk_combo_box_get_active (handle);
+            if (index !is -1) {
+                auto modelHandle = OS.gtk_combo_box_get_model (handle);
+                char* ptr;
+                GtkTreeIter iter;
+                OS.gtk_tree_model_iter_nth_child (modelHandle, &iter, null, index);
+                OS.gtk_tree_model_get1 (modelHandle, &iter, 0, cast(void**)&ptr );
+                if (fromStringz(ptr).length > 0) postEvent (SWT.Modify);
+                OS.g_free (ptr);
+            }
+        } else {
+            char dummy = '\0';
+            OS.gtk_entry_set_text (entryHandle, &dummy );
+        }
+        OS.gtk_combo_box_set_active (handle, -1);
+        OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    }
+}
+
+public override Point computeSize (int wHint, int hHint, bool changed) {
+    checkWidget ();
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        return computeNativeSize (handle, wHint, hHint, changed);
+    }
+    if (wHint !is SWT.DEFAULT && wHint < 0) wHint = 0;
+    if (hHint !is SWT.DEFAULT && hHint < 0) hHint = 0;
+    int w, h;
+    OS.gtk_widget_realize (entryHandle);
+    auto layout = OS.gtk_entry_get_layout (entryHandle);
+    OS.pango_layout_get_size (layout, &w, &h);
+    int xborder = INNER_BORDER, yborder = INNER_BORDER;
+    auto style = OS.gtk_widget_get_style (entryHandle);
+    xborder += OS.gtk_style_get_xthickness (style);
+    yborder += OS.gtk_style_get_ythickness (style);
+    int property;
+    OS.gtk_widget_style_get1 (entryHandle, OS.interior_focus.ptr, &property);
+    if (property is 0) {
+        OS.gtk_widget_style_get1 (entryHandle, OS.focus_line_width.ptr, &property);
+        xborder += property ;
+        yborder += property ;
+    }
+    int width = OS.PANGO_PIXELS (w ) + xborder  * 2;
+    int height = OS.PANGO_PIXELS (h ) + yborder  * 2;
+
+    GtkRequisition arrowRequesition;
+    OS.gtk_widget_size_request (buttonHandle, &arrowRequesition);
+    GtkRequisition listRequesition;
+    auto listParent = OS.gtk_widget_get_parent (listHandle);
+    OS.gtk_widget_size_request (listParent !is null ? listParent : listHandle, &listRequesition);
+
+    width = Math.max (listRequesition.width, width) + arrowRequesition.width + 4;
+    width = wHint is SWT.DEFAULT ? width : wHint;
+    height = hHint is SWT.DEFAULT ? height : hHint;
+    return new Point (width, height);
+}
+
+/**
+ * Copies the selected text.
+ * <p>
+ * The current selection is copied to the clipboard.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.1
+ */
+public void copy () {
+    checkWidget ();
+    if (entryHandle !is null) OS.gtk_editable_copy_clipboard (entryHandle);
+}
+
+override void createHandle (int index) {
+    state |= HANDLE | MENU;
+    fixedHandle = cast(GtkWidget*)OS.g_object_new (display.gtk_fixed_get_type (), null);
+    if (fixedHandle is null) error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_fixed_set_has_window (fixedHandle, true);
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        auto oldList = OS.gtk_window_list_toplevels ();
+        if ((style & SWT.READ_ONLY) !is 0) {
+            handle = OS.gtk_combo_box_new_text ();
+            if (handle is null) error (SWT.ERROR_NO_HANDLES);
+            cellHandle = OS.gtk_bin_get_child (handle);
+            if (cellHandle is null) error (SWT.ERROR_NO_HANDLES);
+        } else {
+            handle = OS.gtk_combo_box_entry_new_text ();
+            if (handle is null) error (SWT.ERROR_NO_HANDLES);
+            entryHandle = OS.gtk_bin_get_child (handle);
+            if (entryHandle is null) error (SWT.ERROR_NO_HANDLES);
+        }
+        popupHandle = findPopupHandle (oldList);
+        OS.gtk_container_add (fixedHandle, handle);
+        textRenderer = cast(GtkWidget*)OS.gtk_cell_renderer_text_new ();
+        if (textRenderer is null) error (SWT.ERROR_NO_HANDLES);
+        /*
+        * Feature in GTK. In order to make a read only combo box the same
+        * height as an editable combo box the ypad must be set to 0. In
+        * versions 2.4.x of GTK, a pad of 0 will clip some letters. The
+        * fix is to set the pad to 1.
+        */
+        int pad = 0;
+        if (OS.GTK_VERSION < OS.buildVERSION(2, 6, 0)) pad = 1;
+        OS.g_object_set1 (textRenderer, OS.ypad.ptr, pad);
+        /*
+        * Feature in GTK.  In version 2.4.9 of GTK, a warning is issued
+        * when a call to gtk_cell_layout_clear() is made. The fix is to hide
+        * the warning.
+        */
+        bool warnings = display.getWarnings ();
+        display.setWarnings (false);
+        OS.gtk_cell_layout_clear (handle);
+        display.setWarnings (warnings);
+        OS.gtk_cell_layout_pack_start (handle, textRenderer, true);
+        OS.gtk_cell_layout_set_attributes1 (handle, textRenderer, OS.text.ptr, null);
+
+        /*
+        * Feature in GTK.  There is no API to query the button
+        * handle from a combo box although it is possible to get the
+        * text field.  The button handle is needed to hook events.  The
+        * fix is to walk the combo tree and find the first child that is
+        * an instance of button.
+        */
+        display.allChildrenCollect (handle, 0);
+        if (display.allChildren !is null) {
+            auto list = display.allChildren;
+            while (list !is null) {
+                auto widget = OS.g_list_data (list);
+                if (OS.GTK_IS_BUTTON (cast(GTypeInstance*)widget)) {
+                    buttonHandle = cast(GtkWidget*)widget;
+                    break;
+                }
+                list = OS.g_list_next (list);
+            }
+            OS.g_list_free (display.allChildren);
+            display.allChildren = null;
+        }
+        /*
+        * Feature in GTK. By default, read only combo boxes
+        * process the RETURN key rather than allowing the
+        * default button to process the key. The fix is to
+        * clear the GTK_RECEIVES_DEFAULT flag.
+        */
+        if ((style & SWT.READ_ONLY) !is 0 && buttonHandle !is null) {
+            OS.GTK_WIDGET_UNSET_FLAGS (buttonHandle, OS.GTK_RECEIVES_DEFAULT);
+        }
+    } else {
+        handle = OS.gtk_combo_new ();
+        if (handle is null) error (SWT.ERROR_NO_HANDLES);
+        OS.gtk_container_add (fixedHandle, handle);
+        GtkCombo* combo = cast(GtkCombo*)handle;
+        entryHandle = combo.entry;
+        listHandle = combo.list;
+
+        if (OS.GTK_VERSION < OS.buildVERSION (2, 4, 0)) {
+            GtkWidget* parentHandle = null;
+            auto temp = listHandle;
+            while ((temp = OS.gtk_widget_get_parent(temp)) !is null) {
+                parentHandle = temp;
+            }
+            popupHandle = parentHandle;
+            if (popupHandle !is null) {
+                GtkWidget* modalGroup = getShell().modalGroup;
+                if (modalGroup !is null) {
+                    OS.gtk_window_group_add_window (modalGroup, popupHandle);
+                }
+            }
+        }
+        /*
+        * Feature in GTK.  There is no API to query the arrow
+        * handle from a combo box although it is possible to
+        * get the list and text field.  The arrow handle is needed
+        * to hook events.  The fix is to find the first child that is
+        * not the entry or list and assume this is the arrow handle.
+        */
+        auto list = OS.gtk_container_get_children (handle);
+        if (list !is null) {
+            int i = 0, count = OS.g_list_length (list);
+            while (i<count) {
+                auto childHandle = OS.g_list_nth_data (list, i);
+                if (childHandle !is entryHandle && childHandle !is listHandle) {
+                    buttonHandle = cast(GtkWidget*)childHandle;
+                    break;
+                }
+                i++;
+            }
+            OS.g_list_free (list);
+        }
+
+        bool editable = (style & SWT.READ_ONLY) is 0;
+        OS.gtk_editable_set_editable (entryHandle, editable);
+        OS.gtk_combo_disable_activate (handle);
+        OS.gtk_combo_set_case_sensitive (handle, true);
+    }
+}
+
+/**
+ * Cuts the selected text.
+ * <p>
+ * The current selection is first copied to the
+ * clipboard and then deleted from the widget.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.1
+ */
+public void cut () {
+    checkWidget ();
+    if (entryHandle !is null) OS.gtk_editable_cut_clipboard (entryHandle);
+}
+
+override void deregister () {
+    super.deregister ();
+    if (buttonHandle !is null) display.removeWidget (buttonHandle);
+    if (entryHandle !is null) display.removeWidget (entryHandle);
+    if (listHandle !is null) display.removeWidget (listHandle);
+    auto imContext = imContext ();
+    if (imContext !is null) display.removeWidget (cast(GtkWidget*)imContext);
+}
+
+override bool filterKey (int keyval, GdkEventKey* event) {
+    int time = OS.gdk_event_get_time (cast(GdkEvent*)event);
+    if (time !is lastEventTime) {
+        lastEventTime = time;
+        auto imContext = imContext ();
+        if (imContext !is null) {
+            return cast(bool)OS.gtk_im_context_filter_keypress (imContext, event);
+        }
+    }
+    gdkEventKey = event;
+    return false;
+}
+
+GtkWidget* findPopupHandle (GList* oldList) {
+    GtkWidget* hdl = null;
+    GList* currentList = OS.gtk_window_list_toplevels();
+    GList* oldFromList = oldList;
+    GList* newFromList = currentList;
+    bool isFound;
+    while (newFromList !is null) {
+        void* newToplevel = OS.g_list_data(newFromList);
+        isFound = false;
+        oldFromList = oldList;
+        while (oldFromList !is null) {
+            void* oldToplevel = OS.g_list_data(oldFromList);
+            if (newToplevel is oldToplevel) {
+                isFound = true;
+                break;
+            }
+            oldFromList = OS.g_list_next(oldFromList);
+        }
+        if (!isFound) {
+            hdl = cast(GtkWidget*)newToplevel;
+            break;
+        }
+        newFromList = OS.g_list_next(newFromList);
+    }
+    OS.g_list_free(oldList);
+    OS.g_list_free(currentList);
+    return hdl;
+}
+
+override void fixModal (GtkWidget* group, GtkWidget* modalGroup) {
+    if (popupHandle !is null) {
+        if (group !is null) {
+            OS.gtk_window_group_add_window (group, popupHandle);
+        } else {
+            if (modalGroup !is null) {
+                OS.gtk_window_group_remove_window (modalGroup, popupHandle);
+            }
+        }
+    }
+}
+
+void fixIM () {
+    /*
+    *  The IM filter has to be called one time for each key press event.
+    *  When the IM is open the key events are duplicated. The first event
+    *  is filtered by SWT and the second event is filtered by GTK.  In some
+    *  cases the GTK handler does not run (the widget is destroyed, the
+    *  application code consumes the event, etc), for these cases the IM
+    *  filter has to be called by SWT.
+    */
+    if (gdkEventKey !is null && gdkEventKey !is cast(GdkEventKey*)-1) {
+        auto imContext = imContext ();
+        if (imContext !is null) {
+            OS.gtk_im_context_filter_keypress (imContext, gdkEventKey);
+            gdkEventKey = cast(GdkEventKey*)-1;
+            return;
+        }
+    }
+    gdkEventKey = null;
+}
+
+override GtkWidget* fontHandle () {
+    if (entryHandle !is null) return entryHandle;
+    return super.fontHandle ();
+}
+
+override GtkWidget* focusHandle () {
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        if ((style & SWT.READ_ONLY) !is 0 && buttonHandle !is null) return buttonHandle;
+    }
+    if (entryHandle !is null) return entryHandle;
+    return super.focusHandle ();
+}
+
+override bool hasFocus () {
+    if (super.hasFocus ()) return true;
+    if (entryHandle !is null && OS.GTK_WIDGET_HAS_FOCUS (entryHandle)) return true;
+    if (listHandle !is null && OS.GTK_WIDGET_HAS_FOCUS (listHandle)) return true;
+    return false;
+}
+
+override void hookEvents () {
+    super.hookEvents ();
+    if (OS.GTK_VERSION >= OS.buildVERSION(2, 4, 0)) {
+        OS.g_signal_connect_closure (handle, OS.changed.ptr, display.closures [CHANGED], true);
+    }
+
+    if (entryHandle !is null) {
+        OS.g_signal_connect_closure (entryHandle, OS.changed.ptr, display.closures [CHANGED], true);
+        OS.g_signal_connect_closure (entryHandle, OS.insert_text.ptr, display.closures [INSERT_TEXT], false);
+        OS.g_signal_connect_closure (entryHandle, OS.delete_text.ptr, display.closures [DELETE_TEXT], false);
+        OS.g_signal_connect_closure (entryHandle, OS.activate.ptr, display.closures [ACTIVATE], false);
+        OS.g_signal_connect_closure (entryHandle, OS.populate_popup.ptr, display.closures [POPULATE_POPUP], false);
+    }
+    int eventMask = OS.GDK_POINTER_MOTION_MASK | OS.GDK_BUTTON_PRESS_MASK |
+        OS.GDK_BUTTON_RELEASE_MASK;
+    GtkWidget*[] handles = [ buttonHandle, entryHandle, listHandle ];
+    for (int i=0; i<handles.length; i++) {
+        auto eventHandle = handles [i];
+        if (eventHandle !is null) {
+            /* Connect the mouse signals */
+            OS.gtk_widget_add_events (eventHandle, eventMask);
+            OS.g_signal_connect_closure_by_id (eventHandle, display.signalIds [BUTTON_PRESS_EVENT], 0, display.closures [BUTTON_PRESS_EVENT], false);
+            OS.g_signal_connect_closure_by_id (eventHandle, display.signalIds [BUTTON_RELEASE_EVENT], 0, display.closures [BUTTON_RELEASE_EVENT], false);
+            OS.g_signal_connect_closure_by_id (eventHandle, display.signalIds [MOTION_NOTIFY_EVENT], 0, display.closures [MOTION_NOTIFY_EVENT], false);
+            /*
+            * Feature in GTK.  Events such as mouse move are propagated up
+            * the widget hierarchy and are seen by the parent.  This is the
+            * correct GTK behavior but not correct for SWT.  The fix is to
+            * hook a signal after and stop the propagation using a negative
+            * event number to distinguish this case.
+            */
+            OS.g_signal_connect_closure_by_id (eventHandle, display.signalIds [BUTTON_PRESS_EVENT], 0, display.closures [BUTTON_PRESS_EVENT_INVERSE], true);
+            OS.g_signal_connect_closure_by_id (eventHandle, display.signalIds [BUTTON_RELEASE_EVENT], 0, display.closures [BUTTON_RELEASE_EVENT_INVERSE], true);
+            OS.g_signal_connect_closure_by_id (eventHandle, display.signalIds [MOTION_NOTIFY_EVENT], 0, display.closures [MOTION_NOTIFY_EVENT_INVERSE], true);
+
+            /* Connect the event_after signal for both key and mouse */
+            if (eventHandle !is focusHandle ()) {
+                OS.g_signal_connect_closure_by_id (eventHandle, display.signalIds [EVENT_AFTER], 0, display.closures [EVENT_AFTER], false);
+            }
+        }
+    }
+    auto imContext = imContext ();
+    if (imContext !is null) {
+        OS.g_signal_connect_closure (imContext, OS.commit.ptr, display.closures [COMMIT], false);
+        int id = OS.g_signal_lookup (OS.commit.ptr, OS.gtk_im_context_get_type ());
+        int blockMask =  OS.G_SIGNAL_MATCH_DATA | OS.G_SIGNAL_MATCH_ID;
+        OS.g_signal_handlers_block_matched (imContext, blockMask, id, 0, null, null, entryHandle);
+    }
+}
+
+GtkIMContext* imContext () {
+    return entryHandle !is null ? OS.GTK_ENTRY_IM_CONTEXT (entryHandle) : null;
+}
+
+/**
+ * Deselects the item at the given zero-relative index in the receiver's
+ * list.  If the item at the index was already deselected, it remains
+ * deselected. Indices that are out of range are ignored.
+ *
+ * @param index the index of the item to deselect
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void deselect (int index) {
+    checkWidget();
+    if (index < 0 || index >= items.length) return;
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        if (OS.gtk_combo_box_get_active (handle) is index) {
+            clearText ();
+        }
+    } else {
+        ignoreSelect = true;
+        auto children = OS.gtk_container_get_children (listHandle);
+        auto item = OS.g_list_nth_data (children, index);
+        bool selected = OS.GTK_WIDGET_STATE (item) is OS.GTK_STATE_SELECTED;
+        if (selected) {
+            OS.gtk_list_unselect_all (listHandle);
+            OS.gtk_entry_set_text (entryHandle, "".ptr );
+        }
+        OS.g_list_free (children);
+        ignoreSelect = false;
+    }
+}
+
+/**
+ * Deselects all selected items in the receiver's list.
+ * <p>
+ * Note: To clear the selection in the receiver's text field,
+ * use <code>clearSelection()</code>.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #clearSelection
+ */
+public void deselectAll () {
+    checkWidget();
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        clearText ();
+    } else {
+        ignoreSelect = true;
+        OS.gtk_list_unselect_all (listHandle);
+        OS.gtk_entry_set_text (entryHandle, "".ptr );
+        ignoreSelect = false;
+    }
+}
+
+
+override bool dragDetect(int x, int y, bool filter, bool* consume) {
+    if (filter && entryHandle !is null) {
+        int index;
+        int trailing;
+        auto layout = OS.gtk_entry_get_layout (entryHandle);
+        OS.pango_layout_xy_to_index (layout, x * OS.PANGO_SCALE, y * OS.PANGO_SCALE, &index, &trailing);
+        auto ptr = OS.pango_layout_get_text (layout);
+        int position = cast(int)/*64*/OS.g_utf8_pointer_to_offset (ptr, ptr + index) + trailing;
+        Point selection = getSelection ();
+        if (selection.x <= position && position < selection.y) {
+            if (super.dragDetect (x, y, filter, consume)) {
+                if (consume !is null) *consume = true;
+                return true;
+            }
+        }
+        return false;
+    }
+    return super.dragDetect (x, y, filter, consume);
+}
+
+override GtkWidget* enterExitHandle () {
+    return fixedHandle;
+}
+
+override GdkDrawable* eventWindow () {
+    return paintWindow ();
+}
+
+override GdkColor* getBackgroundColor () {
+    return getBaseColor ();
+}
+
+override GdkColor* getForegroundColor () {
+    return getTextColor ();
+}
+
+/**
+ * Returns the item at the given, zero-relative index in the
+ * receiver's list. Throws an exception if the index is out
+ * of range.
+ *
+ * @param index the index of the item to return
+ * @return the item at the given index
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getItem (int index) {
+    checkWidget();
+    if (!(0 <= index && index < items.length)) {
+        error (SWT.ERROR_INVALID_RANGE);
+    }
+    return items [index];
+}
+
+/**
+ * Returns the number of items contained in the receiver's list.
+ *
+ * @return the number of items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemCount () {
+    checkWidget();
+    return items.length;
+}
+
+/**
+ * Returns the height of the area which would be used to
+ * display <em>one</em> of the items in the receiver's list.
+ *
+ * @return the height of one item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemHeight () {
+    checkWidget();
+    return fontHeight (getFontDescription (), listHandle !is null ? listHandle : handle);
+}
+
+/**
+ * Returns a (possibly empty) array of <code>String</code>s which are
+ * the items in the receiver's list.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the items in the receiver's list
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String [] getItems () {
+    checkWidget();
+    String [] result = new String[](items.length);
+    System.arraycopy (items, 0, result, 0, items.length);
+    return result;
+}
+
+/**
+ * Returns <code>true</code> if the receiver's list is visible,
+ * and <code>false</code> otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, this method
+ * may still indicate that it is considered visible even though
+ * it may not actually be showing.
+ * </p>
+ *
+ * @return the receiver's list's visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.4
+ */
+public bool getListVisible () {
+    checkWidget ();
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        return popupHandle !is null && OS.GTK_WIDGET_VISIBLE (popupHandle);
+    }
+    return false;
+}
+
+String getNameText () {
+    return getText ();
+}
+
+/**
+ * Returns the orientation of the receiver.
+ *
+ * @return the orientation style
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.1.2
+ */
+public int getOrientation () {
+    checkWidget();
+    return style & (SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT);
+}
+
+/**
+ * Returns a <code>Point</code> whose x coordinate is the
+ * character position representing the start of the selection
+ * in the receiver's text field, and whose y coordinate is the
+ * character position representing the end of the selection.
+ * An "empty" selection is indicated by the x and y coordinates
+ * having the same value.
+ * <p>
+ * Indexing is zero based.  The range of a selection is from
+ * 0..N where N is the number of characters in the widget.
+ * </p>
+ *
+ * @return a point representing the selection start and end
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Point getSelection () {
+    checkWidget ();
+    if ((style & SWT.READ_ONLY) !is 0) {
+        int length = 0;
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+            int index = OS.gtk_combo_box_get_active (handle);
+            if (index !is -1) length = getItem (index).length;
+        } else {
+            auto str = OS.gtk_entry_get_text (entryHandle);
+            if (str !is null) length = cast(int)/*64*/OS.g_utf8_strlen (str, -1);
+        }
+        return new Point (0, length);
+    }
+    int start;
+    int end;
+    if (entryHandle !is null) {
+        OS.gtk_editable_get_selection_bounds (entryHandle, &start, &end);
+    }
+    return new Point(start, end);
+}
+
+/**
+ * Returns the zero-relative index of the item which is currently
+ * selected in the receiver's list, or -1 if no item is selected.
+ *
+ * @return the index of the selected item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSelectionIndex () {
+    checkWidget();
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        return OS.gtk_combo_box_get_active (handle);
+    }
+    int index = 0, result = -1;
+    auto children = OS.gtk_container_get_children (listHandle);
+    auto temp = children;
+    while (temp !is null) {
+        auto item = OS.g_list_data (temp);
+        if (OS.GTK_WIDGET_STATE (item) is OS.GTK_STATE_SELECTED) {
+            result = index;
+            break;
+        }
+        index++;
+        temp = OS.g_list_next (temp);
+    }
+    OS.g_list_free (children);
+    return result;
+}
+
+/**
+ * Returns a string containing a copy of the contents of the
+ * receiver's text field, or an empty string if there are no
+ * contents.
+ *
+ * @return the receiver's text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getText () {
+    checkWidget();
+    if (entryHandle !is null) {
+        auto str = OS.gtk_entry_get_text (entryHandle);
+        if (str is null) return "";
+        return fromStringz(str).dup;
+    } else {
+        int index = OS.gtk_combo_box_get_active (handle);
+        return index !is -1 ? getItem (index) : "";
+    }
+}
+
+String getText (int start, int stop) {
+    /*
+    * NOTE: The current implementation uses substring ()
+    * which can reference a potentially large character
+    * array.
+    */
+    return getText ()[ start .. stop - 1];
+}
+
+/**
+ * Returns the height of the receivers's text field.
+ *
+ * @return the text height
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getTextHeight () {
+    checkWidget();
+    GtkRequisition requisition;
+    gtk_widget_size_request (handle, &requisition);
+    return OS.GTK_WIDGET_REQUISITION_HEIGHT (handle);
+}
+
+/**
+ * Returns the maximum number of characters that the receiver's
+ * text field is capable of holding. If this has not been changed
+ * by <code>setTextLimit()</code>, it will be the constant
+ * <code>Combo.LIMIT</code>.
+ *
+ * @return the text limit
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #LIMIT
+ */
+public int getTextLimit () {
+    checkWidget();
+    int limit = entryHandle !is null ? OS.gtk_entry_get_max_length (entryHandle) : 0;
+    return limit is 0 ? LIMIT : limit;
+}
+
+/**
+ * Gets the number of items that are visible in the drop
+ * down portion of the receiver's list.
+ * <p>
+ * Note: This operation is a hint and is not supported on
+ * platforms that do not have this concept.
+ * </p>
+ *
+ * @return the number of items that are visible
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public int getVisibleItemCount () {
+    checkWidget ();
+    return visibleCount;
+}
+
+override int /*long*/ gtk_activate (GtkWidget* widget) {
+    postEvent (SWT.DefaultSelection);
+    return 0;
+}
+
+override int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* event) {
+    /*
+    * Feature in GTK. Depending on where the user clicks, GTK prevents
+    * the left mouse button event from being propagated. The fix is to
+    * send the mouse event from the event_after handler.
+    */
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        GdkEventButton* gdkEvent = event;
+        if (gdkEvent.type is OS.GDK_BUTTON_PRESS && gdkEvent.button is 1 && (style & SWT.READ_ONLY) !is 0) {
+            return gtk_button_press_event(widget, event, false);
+        }
+
+    }
+    return super.gtk_button_press_event (widget, event);
+}
+
+override int gtk_changed (GtkWidget* widget) {
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        if (widget is handle) {
+            if (entryHandle is null) {
+                sendEvent(SWT.Modify);
+                if (isDisposed ()) return 0;
+            }
+            /*
+            * Feature in GTK.  GTK emits a changed signal whenever
+            * the contents of a combo box are altered by typing or
+            * by selecting an item in the list, but the event should
+            * only be sent when the list is selected. The fix is to
+            * only send out a selection event when there is a selected
+            * item.
+            *
+            * NOTE: This code relies on GTK clearing the selected
+            * item and not matching the item as the user types.
+            */
+            int index = OS.gtk_combo_box_get_active (handle);
+            if (index !is -1) postEvent (SWT.Selection);
+            return 0;
+        }
+    } else {
+        if (!ignoreSelect) {
+            auto ptr = OS.gtk_entry_get_text (entryHandle);
+            String text = fromStringz(ptr).dup;
+            for (int i = 0; i < items.length; i++) {
+                if (items [i] ==/*eq*/ text) {
+                    postEvent (SWT.Selection);
+                    break;
+                }
+            }
+        }
+    }
+    /*
+    * Feature in GTK.  When the user types, GTK positions
+    * the caret after sending the changed signal.  This
+    * means that application code that attempts to position
+    * the caret during a changed signal will fail.  The fix
+    * is to post the modify event when the user is typing.
+    */
+    bool keyPress = false;
+    auto eventPtr = OS.gtk_get_current_event ();
+    if (eventPtr !is null) {
+        GdkEventKey* gdkEvent = cast(GdkEventKey*)eventPtr;
+        switch (gdkEvent.type) {
+            case OS.GDK_KEY_PRESS:
+                keyPress = true;
+                break;
+            default:
+        }
+        OS.gdk_event_free (eventPtr);
+    }
+    if (keyPress) {
+        postEvent (SWT.Modify);
+    } else {
+        sendEvent (SWT.Modify);
+    }
+    return 0;
+}
+
+override int gtk_commit (GtkIMContext* imContext, char* text) {
+    if (text is null) return 0;
+    if (!OS.gtk_editable_get_editable (entryHandle)) return 0;
+    char [] chars = fromStringz(text);
+    if (chars.length is 0) return 0;
+    char [] newChars = sendIMKeyEvent (SWT.KeyDown, null, chars);
+    if (newChars is null) return 0;
+    /*
+    * Feature in GTK.  For a GtkEntry, during the insert-text signal,
+    * GTK allows the programmer to change only the caret location,
+    * not the selection.  If the programmer changes the selection,
+    * the new selection is lost.  The fix is to detect a selection
+    * change and set it after the insert-text signal has completed.
+    */
+    fixStart = fixEnd = -1;
+    OS.g_signal_handlers_block_matched (imContext, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCOMMIT);
+    int id = OS.g_signal_lookup (OS.commit.ptr, OS.gtk_im_context_get_type ());
+    int mask =  OS.G_SIGNAL_MATCH_DATA | OS.G_SIGNAL_MATCH_ID;
+    OS.g_signal_handlers_unblock_matched (imContext, mask, id, 0, null, null, entryHandle);
+    if (newChars is chars) {
+        OS.g_signal_emit_by_name1 (imContext, OS.commit.ptr, cast(int)text);
+    } else {
+        OS.g_signal_emit_by_name1 (imContext, OS.commit.ptr, cast(int)toStringz(newChars));
+    }
+    OS.g_signal_handlers_unblock_matched (imContext, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCOMMIT);
+    OS.g_signal_handlers_block_matched (imContext, mask, id, 0, null, null, entryHandle);
+    if (fixStart !is -1 && fixEnd !is -1) {
+        OS.gtk_editable_set_position (entryHandle, fixStart);
+        OS.gtk_editable_select_region (entryHandle, fixStart, fixEnd);
+    }
+    fixStart = fixEnd = -1;
+    return 0;
+}
+
+override int gtk_delete_text (GtkWidget* widget, int start_pos, int end_pos) {
+    if (lockText) {
+        OS.gtk_list_unselect_item (listHandle, 0);
+        OS.g_signal_stop_emission_by_name (entryHandle, OS.delete_text.ptr);
+        return 0;
+    }
+    if (!hooks (SWT.Verify) && !filters (SWT.Verify)) return 0;
+    String newText = verifyText ("", cast(int)/*64*/start_pos, cast(int)/*64*/end_pos);
+    if (newText is null) {
+        OS.g_signal_stop_emission_by_name (entryHandle, OS.delete_text.ptr);
+    } else {
+        if (newText.length > 0) {
+            int pos;
+            pos = cast(int)/*64*/end_pos;
+            OS.g_signal_handlers_block_matched (entryHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+            OS.g_signal_handlers_block_matched (entryHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udINSERT_TEXT);
+            OS.gtk_editable_insert_text (entryHandle, newText.ptr, newText.length, &pos);
+            OS.g_signal_handlers_unblock_matched (entryHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udINSERT_TEXT);
+            OS.g_signal_handlers_unblock_matched (entryHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+            OS.gtk_editable_set_position (entryHandle, pos );
+        }
+    }
+    return 0;
+}
+
+override int /*long*/ gtk_event_after (GtkWidget* widget, GdkEvent* event) {
+    /*
+    * Feature in GTK. Depending on where the user clicks, GTK prevents
+    * the left mouse button event from being propagated. The fix is to
+    * send the mouse event from the event_after handler.
+    *
+    * Feature in GTK. When the user clicks anywhere in an editable
+    * combo box, a single focus event should be issued, despite the
+    * fact that focus might switch between the drop down button and
+    * the text field. The fix is to use gtk_combo_box_set_focus_on_click ()
+    * to eat all focus events while focus is in the combo box. When the
+    * user clicks on the drop down button focus is assigned to the text
+    * field.
+    */
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        switch (event.type) {
+            case OS.GDK_BUTTON_PRESS: {
+                GdkEventButton* gdkEventButton = cast(GdkEventButton*)event;
+                if (gdkEventButton.button is 1) {
+                    if ((style & SWT.READ_ONLY) !is 0 && !sendMouseEvent (SWT.MouseDown, gdkEventButton.button, display.clickCount, 0, false, gdkEventButton.time, gdkEventButton.x_root, gdkEventButton.y_root, false, gdkEventButton.state)) {
+                        return 1;
+                    }
+                    if (OS.GTK_VERSION >= OS.buildVERSION (2, 6, 0)) {
+                        if ((style & SWT.READ_ONLY) is 0 && widget is buttonHandle) {
+                            OS.gtk_widget_grab_focus (entryHandle);
+                        }
+                    }
+                }
+                break;
+            }
+            case OS.GDK_FOCUS_CHANGE: {
+                if (OS.GTK_VERSION >= OS.buildVERSION (2, 6, 0)) {
+                    if ((style & SWT.READ_ONLY) is 0) {
+                        GdkEventFocus* gdkEventFocus = cast(GdkEventFocus*)event;
+                        if (gdkEventFocus.in_ !is 0) {
+                            OS.gtk_combo_box_set_focus_on_click (handle, false);
+                        } else {
+                            OS.gtk_combo_box_set_focus_on_click (handle, true);
+                        }
+                    }
+                }
+                break;
+            }
+            default:
+        }
+    }
+    return super.gtk_event_after(widget, event);
+}
+
+override int gtk_focus_out_event (GtkWidget* widget, GdkEventFocus* event) {
+    fixIM ();
+    return super.gtk_focus_out_event (widget, event);
+}
+
+override int gtk_insert_text (GtkEditable* widget, char* new_text, int new_text_length, int position) {
+    if (lockText) {
+        OS.gtk_list_unselect_item (listHandle, 0);
+        OS.g_signal_stop_emission_by_name (entryHandle, OS.insert_text.ptr);
+        return 0;
+    }
+    if (!hooks (SWT.Verify) && !filters (SWT.Verify)) return 0;
+    if (new_text is null || new_text_length is 0) return 0;
+    String oldText = new_text[0..new_text_length];
+    int pos;
+    pos = position;
+    if (pos is -1) {
+        auto ptr = OS.gtk_entry_get_text (entryHandle);
+        pos = fromStringz(ptr).length;
+    }
+    String newText = verifyText (oldText, pos, pos);
+    if (newText !is oldText) {
+        int newStart, newEnd;
+        OS.gtk_editable_get_selection_bounds (entryHandle, &newStart, &newEnd);
+        if (newText !is null) {
+            if (newStart !is newEnd) {
+                OS.g_signal_handlers_block_matched (entryHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udDELETE_TEXT);
+                OS.g_signal_handlers_block_matched (entryHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+                OS.gtk_editable_delete_selection (entryHandle);
+                OS.g_signal_handlers_unblock_matched (entryHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udDELETE_TEXT);
+                OS.g_signal_handlers_unblock_matched (entryHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+            }
+            OS.g_signal_handlers_block_matched (entryHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udINSERT_TEXT);
+            OS.gtk_editable_insert_text (entryHandle, newText.ptr, newText.length, &pos);
+            OS.g_signal_handlers_unblock_matched (entryHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udINSERT_TEXT);
+            newStart = newEnd = pos;
+        }
+        pos = newEnd;
+        if (newStart !is newEnd) {
+            fixStart = newStart;
+            fixEnd = newEnd;
+        }
+        position = pos;
+        OS.g_signal_stop_emission_by_name (entryHandle, OS.insert_text.ptr);
+    }
+    return 0;
+}
+
+override int gtk_key_press_event (GtkWidget* widget, GdkEventKey* event) {
+    auto result = super.gtk_key_press_event (widget, event);
+    if (result !is 0) fixIM ();
+    if (gdkEventKey is cast(GdkEventKey*)-1) result = 1;
+    gdkEventKey = null;
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0) && (style & SWT.READ_ONLY) is 0) {
+        GdkEventKey* keyEvent = cast(GdkEventKey*)event;
+        int oldIndex = OS.gtk_combo_box_get_active (handle);
+        int newIndex = oldIndex;
+        int key = keyEvent.keyval;
+        switch (key) {
+            case OS.GDK_Down:
+            case OS.GDK_KP_Down:
+                 if (oldIndex !is (items.length - 1)) {
+                    newIndex = oldIndex + 1;
+                 }
+                 break;
+            case OS.GDK_Up:
+            case OS.GDK_KP_Up:
+                if (oldIndex !is -1 && oldIndex !is 0) {
+                    newIndex = oldIndex - 1;
+                }
+                break;
+            /*
+            * Feature in GTK. In gtk_combo_box, the PageUp and PageDown keys
+            * go the first and last items in the list rather than scrolling
+            * a page at a time. The fix is to emulate this behavior for
+            * gtk_combo_box_entry.
+            */
+            case OS.GDK_Page_Up:
+            case OS.GDK_KP_Page_Up:
+                newIndex = 0;
+                break;
+            case OS.GDK_Page_Down:
+            case OS.GDK_KP_Page_Down:
+                newIndex = items.length - 1;
+                break;
+            default:
+        }
+        if (newIndex !is oldIndex) {
+            OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+            OS.gtk_combo_box_set_active (handle, newIndex);
+            OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+            return 1;
+        }
+    }
+    return result;
+}
+
+override int /*long*/ gtk_populate_popup (GtkWidget* widget, GtkWidget* menu) {
+    if ((style & SWT.RIGHT_TO_LEFT) !is 0) {
+        OS.gtk_widget_set_direction (menu, OS.GTK_TEXT_DIR_RTL);
+        display.doSetDirectionProc(menu, OS.GTK_TEXT_DIR_RTL);
+    }
+    return 0;
+}
+
+/**
+ * Searches the receiver's list starting at the first item
+ * (index 0) until an item is found that is equal to the
+ * argument, and returns the index of that item. If no item
+ * is found, returns -1.
+ *
+ * @param string the search item
+ * @return the index of the item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int indexOf (String string) {
+    checkWidget();
+    return indexOf (string, 0);
+}
+
+/**
+ * Searches the receiver's list starting at the given,
+ * zero-relative index until an item is found that is equal
+ * to the argument, and returns the index of that item. If
+ * no item is found or the starting index is out of range,
+ * returns -1.
+ *
+ * @param string the search item
+ * @param start the zero-relative index at which to begin the search
+ * @return the index of the item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int indexOf (String string, int start) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (!(0 <= start && start < items.length)) return -1;
+    for (int i=start; i<items.length; i++) {
+        if (string.equals (items [i])) return i;
+    }
+    return -1;
+}
+
+override bool isFocusHandle(GtkWidget* widget) {
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        if (buttonHandle !is null && widget is buttonHandle) return true;
+        if (entryHandle !is null && widget is entryHandle) return true;
+    }
+    return super.isFocusHandle (widget);
+}
+
+override GdkDrawable* paintWindow () {
+    auto childHandle =  entryHandle !is null ? entryHandle : handle;
+    OS.gtk_widget_realize (childHandle);
+    auto window = OS.GTK_WIDGET_WINDOW (childHandle);
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        if ((style & SWT.READ_ONLY) !is 0) return window;
+    }
+    auto children = OS.gdk_window_get_children (window);
+    if (children !is null) window = cast(GdkDrawable*)OS.g_list_data (children);
+    OS.g_list_free (children);
+    return window;
+}
+
+/**
+ * Pastes text from clipboard.
+ * <p>
+ * The selected text is deleted from the widget
+ * and new text inserted from the clipboard.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.1
+ */
+public void paste () {
+    checkWidget ();
+    if (entryHandle !is null) OS.gtk_editable_paste_clipboard (entryHandle);
+}
+
+override GtkWidget* parentingHandle() {
+    return fixedHandle;
+}
+
+override void register () {
+    super.register ();
+    if (buttonHandle !is null) display.addWidget (buttonHandle, this);
+    if (entryHandle !is null) display.addWidget (entryHandle, this);
+    if (listHandle !is null) display.addWidget (listHandle, this);
+    auto imContext = imContext ();
+    if (imContext !is null) display.addWidget (cast(GtkWidget*)imContext, this);
+}
+
+override void releaseHandle () {
+    super.releaseHandle ();
+    buttonHandle = entryHandle = listHandle = null;
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    textRenderer = null;
+    fixIM ();
+}
+
+/**
+ * Removes the item from the receiver's list at the given
+ * zero-relative index.
+ *
+ * @param index the index for the item
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void remove (int index) {
+    checkWidget();
+    if (!(0 <= index && index < items.length)) {
+        error (SWT.ERROR_INVALID_RANGE);
+    }
+    String [] oldItems = items;
+    String [] newItems = new String[]( oldItems.length - 1 );
+    System.arraycopy (oldItems, 0, newItems, 0, index);
+    System.arraycopy (oldItems, index + 1, newItems, index, oldItems.length - index - 1);
+    items = newItems;
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        if (OS.gtk_combo_box_get_active (handle) is index) clearText ();
+        OS.gtk_combo_box_remove_text (handle, index);
+    } else {
+        ignoreSelect = true;
+        auto children = OS.gtk_container_get_children (listHandle);
+        auto item = OS.g_list_nth_data (children, index);
+        bool selected = OS.GTK_WIDGET_STATE (item) is OS.GTK_STATE_SELECTED;
+        auto items = OS.g_list_append (null, item);
+        OS.gtk_list_remove_items (listHandle, items);
+        OS.g_list_free (items);
+        OS.g_list_free (children);
+        if (selected) {
+            OS.gtk_entry_set_text (entryHandle, "".ptr);
+        }
+        ignoreSelect = false;
+    }
+}
+
+/**
+ * Removes the items from the receiver's list which are
+ * between the given zero-relative start and end
+ * indices (inclusive).
+ *
+ * @param start the start of the range
+ * @param end the end of the range
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if either the start or end are not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void remove (int start, int end) {
+    checkWidget();
+    if (start > end) return;
+    if (!(0 <= start && start <= end && end < items.length)) {
+        error (SWT.ERROR_INVALID_RANGE);
+    }
+    String [] oldItems = items;
+    String [] newItems = new String[](oldItems.length - (end - start + 1));
+    System.arraycopy (oldItems, 0, newItems, 0, start);
+    System.arraycopy (oldItems, end + 1, newItems, start, oldItems.length - end - 1);
+    items = newItems;
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        int index = OS.gtk_combo_box_get_active (handle);
+        if (start <= index && index <= end) clearText();
+        for (int i = end; i >= start; i--) {
+            OS.gtk_combo_box_remove_text (handle, i);
+        }
+    } else {
+        bool selected = false;
+        ignoreSelect = true;
+        GList* items;
+        auto children = OS.gtk_container_get_children (listHandle);
+        for (int i = start; i <= end; i++) {
+            auto item = OS.g_list_nth_data (children, i);
+            selected |= OS.GTK_WIDGET_STATE (item) is OS.GTK_STATE_SELECTED;
+            items = OS.g_list_append (items, item);
+        }
+        OS.gtk_list_remove_items (listHandle, items);
+        OS.g_list_free (items);
+        OS.g_list_free (children);
+        if (selected) {
+            OS.gtk_entry_set_text (entryHandle, "".ptr );
+        }
+        ignoreSelect = false;
+    }
+}
+
+/**
+ * Searches the receiver's list starting at the first item
+ * until an item is found that is equal to the argument,
+ * and removes that item from the list.
+ *
+ * @param string the item to remove
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the string is not found in the list</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void remove (String string) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    int index = indexOf (string, 0);
+    if (index is -1) error (SWT.ERROR_INVALID_ARGUMENT);
+    remove (index);
+}
+
+/**
+ * Removes all of the items from the receiver's list and clear the
+ * contents of receiver's text field.
+ * <p>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void removeAll () {
+    checkWidget();
+    int count = items.length;
+    items = null;
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        clearText ();
+        for (int i = count - 1; i >= 0; i--) {
+            OS.gtk_combo_box_remove_text (handle, i);
+        }
+    } else {
+        ignoreSelect = true;
+        OS.gtk_list_clear_items (listHandle, 0, -1);
+        OS.gtk_entry_set_text (entryHandle, "".ptr);
+        ignoreSelect = false;
+    }
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the receiver's text is modified.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ModifyListener
+ * @see #addModifyListener
+ */
+public void removeModifyListener (ModifyListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Modify, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the user changes the receiver's selection.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener (SelectionListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Selection, listener);
+    eventTable.unhook (SWT.DefaultSelection,listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is verified.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see VerifyListener
+ * @see #addVerifyListener
+ *
+ * @since 3.1
+ */
+public void removeVerifyListener (VerifyListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Verify, listener);
+}
+
+/**
+ * Selects the item at the given zero-relative index in the receiver's
+ * list.  If the item at the index was already selected, it remains
+ * selected. Indices that are out of range are ignored.
+ *
+ * @param index the index of the item to select
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void select (int index) {
+    checkWidget();
+    if (index < 0 || index >= items.length) return;
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+        OS.gtk_combo_box_set_active (handle, index);
+        OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+        if ((style & SWT.READ_ONLY) !is 0) {
+            /*
+            * Feature in GTK. Read Only combo boxes do not get a chance to send out a
+            * Modify event in the gtk_changed callback. The fix is to send a Modify event
+            * here.
+            */
+            sendEvent (SWT.Modify);
+        }
+    } else {
+        ignoreSelect = true;
+        OS.gtk_list_select_item (listHandle, index);
+        ignoreSelect = false;
+    }
+}
+
+override void setBackgroundColor (GdkColor* color) {
+    super.setBackgroundColor (color);
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        if (entryHandle !is null) OS.gtk_widget_modify_base (entryHandle, 0, color);
+        OS.g_object_set1 (textRenderer, OS.background_gdk.ptr, cast(int)color);
+    } else {
+        OS.gtk_widget_modify_base (entryHandle, 0, color);
+        if (listHandle !is null) OS.gtk_widget_modify_base (listHandle, 0, color);
+    }
+}
+
+override int setBounds (int x, int y, int width, int height, bool move, bool resize) {
+    int newHeight = height;
+    if (resize) newHeight = Math.max (getTextHeight (), height);
+    return super.setBounds (x, y, width, newHeight, move, resize);
+}
+
+override void setFontDescription (PangoFontDescription* font) {
+    super.setFontDescription (font);
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        if (entryHandle !is null) OS.gtk_widget_modify_font (entryHandle, font);
+        OS.g_object_set1 (textRenderer, OS.font_desc.ptr, cast(int)font);
+        if ((style & SWT.READ_ONLY) !is 0) {
+            /*
+            * Bug in GTK.  Setting the font can leave the combo box with an
+            * invalid minimum size.  The fix is to temporarily change the
+            * selected item to force the combo box to resize.
+            */
+            int index = OS.gtk_combo_box_get_active (handle);
+            OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+            OS.gtk_combo_box_set_active (handle, -1);
+            OS.gtk_combo_box_set_active (handle, index);
+            OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+        }
+    } else {
+        OS.gtk_widget_modify_font (entryHandle, font);
+        if (listHandle !is null) {
+            OS.gtk_widget_modify_font (listHandle, font);
+            auto itemsList = OS.gtk_container_get_children (listHandle);
+            if (itemsList !is null) {
+                int count = OS.g_list_length (itemsList);
+                for (int i=count - 1; i>=0; i--) {
+                    auto widget = OS.gtk_bin_get_child (OS.g_list_nth_data (itemsList, i));
+                    OS.gtk_widget_modify_font (widget, font);
+                }
+                OS.g_list_free (itemsList);
+            }
+        }
+    }
+}
+
+override void setForegroundColor (GdkColor* color) {
+    super.setForegroundColor (color);
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        if (entryHandle !is null) setForegroundColor (entryHandle, color);
+        OS.g_object_set1 (textRenderer, OS.foreground_gdk.ptr, cast(int)color);
+    } else {
+        setForegroundColor (entryHandle, color);
+        if (listHandle !is null) {
+            setForegroundColor (listHandle, color);
+            auto itemsList = OS.gtk_container_get_children (listHandle);
+            if (itemsList !is null) {
+                int count = OS.g_list_length (itemsList);
+                for (int i=count - 1; i>=0; i--) {
+                    auto widget = OS.gtk_bin_get_child (OS.g_list_nth_data (itemsList, i));
+                    setForegroundColor (widget, color);
+                }
+                OS.g_list_free (itemsList);
+            }
+        }
+    }
+}
+
+/**
+ * Sets the text of the item in the receiver's list at the given
+ * zero-relative index to the string argument.
+ *
+ * @param index the index for the item
+ * @param string the new text for the item
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setItem (int index, String string) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (!(0 <= index && index < items.length)) {
+        error (SWT.ERROR_INVALID_ARGUMENT);
+    }
+    items [index] = string;
+    char* buffer = string.toStringzValidPtr();
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        OS.gtk_combo_box_remove_text (handle, index);
+        OS.gtk_combo_box_insert_text (handle, index, buffer);
+        if ((style & SWT.RIGHT_TO_LEFT) !is 0 && popupHandle !is null) {
+            display.doSetDirectionProc(popupHandle, OS.GTK_TEXT_DIR_RTL);
+        }
+    } else {
+        ignoreSelect = true;
+        auto children = OS.gtk_container_get_children (listHandle);
+        auto item = OS.g_list_nth_data (children, index);
+        auto label = OS.gtk_bin_get_child (item);
+        OS.gtk_label_set_text (label, buffer);
+        OS.g_list_free (children);
+        ignoreSelect = false;
+    }
+}
+
+/**
+ * Sets the receiver's list to be the given array of items.
+ *
+ * @param items the array of items
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if an item in the items array is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setItems (String [] items) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (items is null) error (SWT.ERROR_NULL_ARGUMENT);
+    for (int i=0; i<items.length; i++) {
+        if (items [i] is null) error (SWT.ERROR_INVALID_ARGUMENT);
+    }
+    int count = this.items.length;
+    this.items = new String[](items.length);
+    System.arraycopy (items, 0, this.items, 0, items.length);
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        clearText ();
+        for (int i = count - 1; i >= 0; i--) {
+            OS.gtk_combo_box_remove_text (handle, i);
+        }
+        for (int i = 0; i < items.length; i++) {
+            String string = items [i];
+            char* buffer = string.toStringzValidPtr();
+            OS.gtk_combo_box_insert_text (handle, i, buffer);
+            if ((style & SWT.RIGHT_TO_LEFT) !is 0 && popupHandle !is null) {
+                display.doSetDirectionProc(popupHandle, OS.GTK_TEXT_DIR_RTL);
+            }
+        }
+    } else {
+        lockText = ignoreSelect = true;
+        OS.gtk_list_clear_items (listHandle, 0, -1);
+        auto font = getFontDescription ();
+        GdkColor* color = getForegroundColor ();
+        int direction = OS.gtk_widget_get_direction (handle);
+        int i = 0;
+        while (i < items.length) {
+            String string = items [i];
+            char * buffer = string.toStringzValidPtr();
+            auto item = OS.gtk_list_item_new_with_label (buffer);
+            auto label = OS.gtk_bin_get_child (item);
+            setForegroundColor (label, color);
+            OS.gtk_widget_modify_font (label, font);
+            OS.gtk_widget_set_direction (label, direction);
+            OS.gtk_container_add (listHandle, item);
+            OS.gtk_widget_show (item);
+            i++;
+        }
+        lockText = ignoreSelect = false;
+        OS.gtk_entry_set_text (entryHandle, "".ptr);
+    }
+}
+
+/**
+ * Marks the receiver's list as visible if the argument is <code>true</code>,
+ * and marks it invisible otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, marking
+ * it visible may not actually cause it to be displayed.
+ * </p>
+ *
+ * @param visible the new visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.4
+ */
+public void setListVisible (bool visible) {
+    checkWidget ();
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        if (visible) {
+            OS.gtk_combo_box_popup (handle);
+        } else {
+            OS.gtk_combo_box_popdown (handle);
+        }
+    }
+}
+
+override void setOrientation() {
+    super.setOrientation();
+    if ((style & SWT.RIGHT_TO_LEFT) !is 0) {
+        if (listHandle !is null) OS.gtk_widget_set_direction (listHandle, OS.GTK_TEXT_DIR_RTL);
+        if (entryHandle !is null) OS.gtk_widget_set_direction (entryHandle, OS.GTK_TEXT_DIR_RTL);
+        if (cellHandle !is null) OS.gtk_widget_set_direction (cellHandle, OS.GTK_TEXT_DIR_RTL);
+    }
+}
+
+/**
+ * Sets the orientation of the receiver, which must be one
+ * of the constants <code>SWT.LEFT_TO_RIGHT</code> or <code>SWT.RIGHT_TO_LEFT</code>.
+ * <p>
+ *
+ * @param orientation new orientation style
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.1.2
+ */
+public void setOrientation (int orientation) {
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        checkWidget();
+        int flags = SWT.RIGHT_TO_LEFT | SWT.LEFT_TO_RIGHT;
+        if ((orientation & flags) is 0 || (orientation & flags) is flags) return;
+        style &= ~flags;
+        style |= orientation & flags;
+        int dir = (orientation & SWT.RIGHT_TO_LEFT) !is 0 ? OS.GTK_TEXT_DIR_RTL : OS.GTK_TEXT_DIR_LTR;
+        OS.gtk_widget_set_direction (fixedHandle, dir);
+        OS.gtk_widget_set_direction (handle, dir);
+    	if (entryHandle !is null) OS.gtk_widget_set_direction (entryHandle, dir);
+    	if (listHandle !is null) {
+            OS.gtk_widget_set_direction (listHandle, dir);
+            auto itemsList = OS.gtk_container_get_children (listHandle);
+            if (itemsList !is null) {
+                int count = OS.g_list_length (itemsList);
+                for (int i=count - 1; i>=0; i--) {
+                    auto widget = OS.gtk_bin_get_child (OS.g_list_nth_data (itemsList, i));
+                    OS.gtk_widget_set_direction (widget, dir);
+                }
+                OS.g_list_free (itemsList);
+            }
+        }
+        if (cellHandle !is null) OS.gtk_widget_set_direction (cellHandle, dir);
+        if (popupHandle !is null) display.doSetDirectionProc (popupHandle, dir);
+    }
+}
+
+/**
+ * Sets the selection in the receiver's text field to the
+ * range specified by the argument whose x coordinate is the
+ * start of the selection and whose y coordinate is the end
+ * of the selection.
+ *
+ * @param selection a point representing the new selection start and end
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (Point selection) {
+    checkWidget();
+    if (selection is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if ((style & SWT.READ_ONLY) !is 0) return;
+    if (entryHandle !is null) {
+        OS.gtk_editable_set_position (entryHandle, selection.x);
+        OS.gtk_editable_select_region (entryHandle, selection.x, selection.y);
+    }
+}
+
+/**
+ * Sets the contents of the receiver's text field to the
+ * given string.
+ * <p>
+ * Note: The text field in a <code>Combo</code> is typically
+ * only capable of displaying a single line of text. Thus,
+ * setting the text to a string containing line breaks or
+ * other special characters will probably cause it to
+ * display incorrectly.
+ * </p>
+ *
+ * @param string the new text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setText (String string) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if ((style & SWT.READ_ONLY) !is 0) {
+        int index = indexOf (string);
+        if (index is -1) return;
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+            OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+            OS.gtk_combo_box_set_active (handle, index);
+            OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+            /*
+            * Feature in GTK. Read Only combo boxes do not get a chance to send out a
+            * Modify event in the gtk_changed callback. The fix is to send a Modify event
+            * here.
+            */
+            sendEvent (SWT.Modify);
+            return;
+        }
+    }
+    /*
+    * Feature in gtk.  When text is set in gtk, separate events are fired for the deletion and
+    * insertion of the text.  This is not wrong, but is inconsistent with other platforms.  The
+    * fix is to block the firing of these events and fire them ourselves in a consistent manner.
+    */
+    if (hooks (SWT.Verify) || filters (SWT.Verify)) {
+        auto ptr = OS.gtk_entry_get_text (entryHandle);
+        string = verifyText (string, 0, cast(int)/*64*/OS.g_utf8_strlen (ptr, -1));
+        if (string is null) return;
+    }
+    auto buffer = string.toStringzValidPtr();
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    }
+    OS.g_signal_handlers_block_matched (entryHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    OS.g_signal_handlers_block_matched (entryHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udDELETE_TEXT);
+    OS.g_signal_handlers_block_matched (entryHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udINSERT_TEXT);
+    OS.gtk_entry_set_text (entryHandle, buffer);
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    }
+    OS.g_signal_handlers_unblock_matched (entryHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    OS.g_signal_handlers_unblock_matched (entryHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udDELETE_TEXT);
+    OS.g_signal_handlers_unblock_matched (entryHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udINSERT_TEXT);
+    sendEvent (SWT.Modify);
+}
+
+/**
+ * Sets the maximum number of characters that the receiver's
+ * text field is capable of holding to be the argument.
+ * <p>
+ * To reset this value to the default, use <code>setTextLimit(Combo.LIMIT)</code>.
+ * Specifying a limit value larger than <code>Combo.LIMIT</code> sets the
+ * receiver's limit to <code>Combo.LIMIT</code>.
+ * </p>
+ * @param limit new text limit
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_CANNOT_BE_ZERO - if the limit is zero</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #LIMIT
+ */
+public void setTextLimit (int limit) {
+    checkWidget();
+    if (limit is 0) error (SWT.ERROR_CANNOT_BE_ZERO);
+    if (entryHandle !is null) OS.gtk_entry_set_max_length (entryHandle, limit);
+}
+
+override void setToolTipText (Shell shell, String newString) {
+    if (entryHandle !is null) shell.setToolTipText (entryHandle, newString);
+    if (buttonHandle !is null) shell.setToolTipText (buttonHandle, newString);
+}
+
+/**
+ * Sets the number of items that are visible in the drop
+ * down portion of the receiver's list.
+ * <p>
+ * Note: This operation is a hint and is not supported on
+ * platforms that do not have this concept.
+ * </p>
+ *
+ * @param count the new number of items to be visible
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setVisibleItemCount (int count) {
+    checkWidget ();
+    if (count < 0) return;
+    visibleCount = count;
+}
+
+override bool translateTraversal (GdkEventKey* keyEvent) {
+    int key = keyEvent.keyval;
+    switch (key) {
+        case OS.GDK_KP_Enter:
+        case OS.GDK_Return: {
+            auto imContext = imContext ();
+            if (imContext !is null) {
+                char* preeditString;
+                OS.gtk_im_context_get_preedit_string (imContext, &preeditString, null, null);
+                if (preeditString !is null) {
+                    int length = fromStringz(preeditString).length;
+                    OS.g_free (preeditString);
+                    if (length !is 0) return false;
+                }
+            }
+        }
+        default:
+    }
+    return super.translateTraversal (keyEvent);
+}
+
+String verifyText (String string, int start, int end) {
+    if (string.length is 0 && start is end) return null;
+    Event event = new Event ();
+    event.text = string;
+    event.start = start;
+    event.end = end;
+    auto eventPtr = OS.gtk_get_current_event ();
+    if (eventPtr !is null) {
+        GdkEventKey* gdkEvent = cast(GdkEventKey*)eventPtr;
+        switch (gdkEvent.type) {
+            case OS.GDK_KEY_PRESS:
+                setKeyState (event, gdkEvent);
+                break;
+            default:
+        }
+        OS.gdk_event_free (eventPtr);
+    }
+    /*
+     * It is possible (but unlikely), that application
+     * code could have disposed the widget in the verify
+     * event.  If this happens, answer null to cancel
+     * the operation.
+     */
+    sendEvent (SWT.Verify, event);
+    if (!event.doit || isDisposed ()) return null;
+    return event.text;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Composite.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,1462 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Composite;
+
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Scrollable;
+import org.eclipse.swt.widgets.Layout;
+import org.eclipse.swt.widgets.Decorations;
+import org.eclipse.swt.widgets.ScrollBar;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.graphics.GCData;
+
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Region;
+import org.eclipse.swt.internal.cairo.Cairo;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.graphics.Rectangle;
+import java.lang.all;
+
+/**
+ * Instances of this class are controls which are capable
+ * of containing other controls.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>NO_BACKGROUND, NO_FOCUS, NO_MERGE_PAINTS, NO_REDRAW_RESIZE, NO_RADIO_GROUP, EMBEDDED, DOUBLE_BUFFERED</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * Note: The <code>NO_BACKGROUND</code>, <code>NO_FOCUS</code>, <code>NO_MERGE_PAINTS</code>,
+ * and <code>NO_REDRAW_RESIZE</code> styles are intended for use with <code>Canvas</code>.
+ * They can be used with <code>Composite</code> if you are drawing your own, but their
+ * behavior is undefined if they are used with subclasses of <code>Composite</code> other
+ * than <code>Canvas</code>.
+ * </p><p>
+ * Note: The <code>CENTER</code> style, although undefined for composites, has the
+ * same value as <code>EMBEDDED</code> (which is used to embed widgets from other
+ * widget toolkits into SWT).  On some operating systems (GTK, Motif), this may cause
+ * the children of this composite to be obscured.  The <code>EMBEDDED</code> style
+ * is for use by other widget toolkits and should normally never be used.
+ * </p><p>
+ * This class may be subclassed by custom control implementors
+ * who are building controls that are constructed from aggregates
+ * of other controls.
+ * </p>
+ *
+ * @see Canvas
+ * @see <a href="http://www.eclipse.org/swt/snippets/#composite">Composite snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class Composite : Scrollable {
+
+    alias Scrollable.computeSize computeSize;
+    alias Scrollable.fixStyle fixStyle;
+    alias Scrollable.forceFocus forceFocus;
+    alias Scrollable.gtk_button_press_event gtk_button_press_event;
+    alias Scrollable.moveAbove moveAbove;
+    alias Scrollable.moveBelow moveBelow;
+    alias Scrollable.setBounds setBounds;
+    alias Scrollable.translateMnemonic translateMnemonic;
+    alias Scrollable.translateTraversal translateTraversal;
+
+    public int  embeddedHandle;
+    GtkIMContext* imHandle_;
+    GtkWidget* socketHandle;
+    Layout layout_;
+    Control[] tabList;
+    int layoutCount, backgroundMode;
+
+    static const String NO_INPUT_METHOD = "org.eclipse.swt.internal.gtk.noInputMethod"; //$NON-NLS-1$
+
+this () {
+    /* Do nothing */
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a widget which will be the parent of the new instance (cannot be null)
+ * @param style the style of widget to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ *
+ * @see SWT#NO_BACKGROUND
+ * @see SWT#NO_FOCUS
+ * @see SWT#NO_MERGE_PAINTS
+ * @see SWT#NO_REDRAW_RESIZE
+ * @see SWT#NO_RADIO_GROUP
+ * @see Widget#getStyle
+ */
+public this (Composite parent, int style) {
+    super (parent, checkStyle (style));
+}
+
+static int checkStyle (int style) {
+    style &= ~SWT.TRANSPARENT;
+    return style;
+}
+
+Control [] _getChildren () {
+    auto parentHandle = parentingHandle ();
+    auto list = OS.gtk_container_get_children (cast(GtkContainer*)parentHandle);
+    if (list is null) return new Control [0];
+    int count = OS.g_list_length (list);
+    Control [] children = new Control [count];
+    int i = 0;
+    auto temp = list;
+    while (temp !is null) {
+        auto handle = cast(GtkWidget*)OS.g_list_data (temp);
+        if (handle !is null) {
+            Widget widget = display.getWidget (handle);
+            if (widget !is null && widget !is this) {
+                if (auto c = cast(Control)widget) {
+                    children [i++] = c;
+                }
+            }
+        }
+        temp = cast(GList*)OS.g_list_next (temp);
+    }
+    OS.g_list_free (list);
+    if (i is count) return children;
+    Control [] newChildren = new Control [i];
+    System.arraycopy (children, 0, newChildren, 0, i);
+    return newChildren;
+}
+
+Control [] _getTabList () {
+    if (tabList is null) return tabList;
+    int count = 0;
+    for (int i=0; i<tabList.length; i++) {
+        if (!tabList [i].isDisposed ()) count++;
+    }
+    if (count is tabList.length) return tabList;
+    Control [] newList = new Control [count];
+    int index = 0;
+    for (int i=0; i<tabList.length; i++) {
+        if (!tabList [i].isDisposed ()) {
+            newList [index++] = tabList [i];
+        }
+    }
+    tabList = newList;
+    return tabList;
+}
+
+/**
+ * Clears any data that has been cached by a Layout for all widgets that
+ * are in the parent hierarchy of the changed control up to and including the
+ * receiver.  If an ancestor does not have a layout, it is skipped.
+ *
+ * @param changed an array of controls that changed state and require a recalculation of size
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the changed array is null any of its controls are null or have been disposed</li>
+ *    <li>ERROR_INVALID_PARENT - if any control in changed is not in the widget tree of the receiver</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void changed (Control[] changed) {
+    checkWidget ();
+    if (changed is null) error (SWT.ERROR_INVALID_ARGUMENT);
+    for (int i=0; i<changed.length; i++) {
+        Control control = changed [i];
+        if (control is null) error (SWT.ERROR_INVALID_ARGUMENT);
+        if (control.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+        bool ancestor = false;
+        Composite composite = control.parent;
+        while (composite !is null) {
+            ancestor = composite is this;
+            if (ancestor) break;
+            composite = composite.parent;
+        }
+        if (!ancestor) error (SWT.ERROR_INVALID_PARENT);
+    }
+    for (int i=0; i<changed.length; i++) {
+        Control child = changed [i];
+        Composite composite = child.parent;
+        while (child !is this) {
+            if (composite.layout_ is null || !composite.layout_.flushCache (child)) {
+                composite.state |= LAYOUT_CHANGED;
+            }
+            child = composite;
+            composite = child.parent;
+        }
+    }
+}
+
+override void checkBuffered () {
+    if ((style & SWT.DOUBLE_BUFFERED) is 0 && (style & SWT.NO_BACKGROUND) !is 0) {
+        return;
+    }
+    super.checkBuffered();
+}
+
+override protected void checkSubclass () {
+    /* Do nothing - Subclassing is allowed */
+}
+
+override GtkStyle* childStyle () {
+    if (scrolledHandle !is null) return null;
+    return super.childStyle ();
+}
+
+override public Point computeSize (int wHint, int hHint, bool changed) {
+    checkWidget ();
+    if (wHint !is SWT.DEFAULT && wHint < 0) wHint = 0;
+    if (hHint !is SWT.DEFAULT && hHint < 0) hHint = 0;
+    Point size;
+    if (layout_ !is null) {
+        if (wHint is SWT.DEFAULT || hHint is SWT.DEFAULT) {
+            changed |= (state & LAYOUT_CHANGED) !is 0;
+            size = layout_.computeSize (this, wHint, hHint, changed);
+            state &= ~LAYOUT_CHANGED;
+        } else {
+            size = new Point (wHint, hHint);
+        }
+    } else {
+        size = minimumSize (wHint, hHint, changed);
+    }
+    if (size.x is 0) size.x = DEFAULT_WIDTH;
+    if (size.y is 0) size.y = DEFAULT_HEIGHT;
+    if (wHint !is SWT.DEFAULT) size.x = wHint;
+    if (hHint !is SWT.DEFAULT) size.y = hHint;
+    Rectangle trim = computeTrim (0, 0, size.x, size.y);
+    return new Point (trim.width, trim.height);
+}
+
+override Control [] computeTabList () {
+    Control result [] = super.computeTabList ();
+    if (result.length is 0) return result;
+    Control [] list = tabList !is null ? _getTabList () : _getChildren ();
+    for (int i=0; i<list.length; i++) {
+        Control child = list [i];
+        Control [] childList = child.computeTabList ();
+        if (childList.length !is 0) {
+            Control [] newResult = new Control [result.length + childList.length];
+            System.arraycopy (result, 0, newResult, 0, result.length);
+            System.arraycopy (childList, 0, newResult, result.length, childList.length);
+            result = newResult;
+        }
+    }
+    return result;
+}
+
+override void createHandle (int index) {
+    state |= HANDLE | CANVAS;
+    bool scrolled = (style & (SWT.H_SCROLL | SWT.V_SCROLL)) !is 0;
+    if (!scrolled) state |= THEME_BACKGROUND;
+    createHandle (index, true, scrolled || (style & SWT.BORDER) !is 0);
+}
+
+void createHandle (int index, bool fixed, bool scrolled) {
+    if (scrolled) {
+        if (fixed) {
+            fixedHandle = cast(GtkWidget*) OS.g_object_new (display.gtk_fixed_get_type (), null);
+            if (fixedHandle is null) error (SWT.ERROR_NO_HANDLES);
+            OS.gtk_fixed_set_has_window (cast(GtkFixed*)fixedHandle, true);
+        }
+        auto vadj = cast(GtkAdjustment*)OS.gtk_adjustment_new (0, 0, 100, 1, 10, 10);
+        if (vadj is null) error (SWT.ERROR_NO_HANDLES);
+        auto hadj = cast(GtkAdjustment*)OS.gtk_adjustment_new (0, 0, 100, 1, 10, 10);
+        if (hadj is null) error (SWT.ERROR_NO_HANDLES);
+        scrolledHandle = cast(GtkWidget*) OS.gtk_scrolled_window_new (hadj, vadj);
+        if (scrolledHandle is null) SWT.error (SWT.ERROR_NO_HANDLES);
+    }
+    handle = cast(GtkWidget*)OS.g_object_new (display.gtk_fixed_get_type (), null);
+    if (handle is null) SWT.error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_fixed_set_has_window (cast(GtkFixed*)handle, true);
+    OS.GTK_WIDGET_SET_FLAGS(handle, OS.GTK_CAN_FOCUS);
+    if ((style & SWT.EMBEDDED) is 0) {
+        if ((state & CANVAS) !is 0) {
+            /* Prevent an input method context from being created for the Browser widget */
+            if (display.getData (NO_INPUT_METHOD) is null) {
+                imHandle_ = OS.gtk_im_multicontext_new ();
+                if (imHandle_ is null) error (SWT.ERROR_NO_HANDLES);
+            }
+        }
+    }
+    if (scrolled) {
+        if (fixed) OS.gtk_container_add (cast(GtkContainer*)fixedHandle, scrolledHandle);
+        /*
+        * Force the scrolledWindow to have a single child that is
+        * not scrolled automatically.  Calling gtk_container_add()
+        * seems to add the child correctly but cause a warning.
+        */
+        bool warnings = display.getWarnings ();
+        display.setWarnings (false);
+        OS.gtk_container_add (cast(GtkContainer*)scrolledHandle, handle);
+        display.setWarnings (warnings);
+
+        int hsp = (style & SWT.H_SCROLL) !is 0 ? OS.GTK_POLICY_ALWAYS : OS.GTK_POLICY_NEVER;
+        int vsp = (style & SWT.V_SCROLL) !is 0 ? OS.GTK_POLICY_ALWAYS : OS.GTK_POLICY_NEVER;
+        OS.gtk_scrolled_window_set_policy (cast(GtkScrolledWindow*)scrolledHandle, hsp, vsp);
+        if (hasBorder ()) {
+            OS.gtk_scrolled_window_set_shadow_type (cast(GtkScrolledWindow*)scrolledHandle, OS.GTK_SHADOW_ETCHED_IN);
+        }
+    }
+    if ((style & SWT.EMBEDDED) !is 0) {
+        socketHandle = OS.gtk_socket_new ();
+        if (socketHandle is null) SWT.error (SWT.ERROR_NO_HANDLES);
+        OS.gtk_container_add (cast(GtkContainer*)handle, cast(GtkWidget*)socketHandle);
+    }
+    if ((style & SWT.NO_REDRAW_RESIZE) !is 0 && (style & SWT.RIGHT_TO_LEFT) is 0) {
+        OS.gtk_widget_set_redraw_on_allocate (handle, false);
+    }
+    /*
+    * Bug in GTK.  When a widget is double buffered and the back
+    * pixmap is null, the double buffer pixmap is filled with the
+    * background of the widget rather than the current contents of
+    * the screen.  If nothing is drawn during an expose event,
+    * the pixels are altered.  The fix is to clear double buffering
+    * when NO_BACKGROUND is set and DOUBLE_BUFFERED
+    * is not explicitly set.
+    */
+    if ((style & SWT.DOUBLE_BUFFERED) is 0 && (style & SWT.NO_BACKGROUND) !is 0) {
+        OS.gtk_widget_set_double_buffered (handle, false);
+    }
+}
+
+override void deregister () {
+    super.deregister ();
+    if (socketHandle !is null) display.removeWidget (cast(GtkWidget*)socketHandle);
+}
+
+void drawBackground (GC gc, int x, int y, int width, int height) {
+    Control control = findBackgroundControl ();
+    if (control !is null) {
+        GCData data = gc.getGCData ();
+        auto cairo = data.cairo;
+        if (cairo !is null) {
+            Cairo.cairo_save (cairo);
+            if (control.backgroundImage !is null) {
+                Point pt = display.map (this, control, 0, 0);
+                Cairo.cairo_translate (cairo, -pt.x, -pt.y);
+                x += pt.x;
+                y += pt.y;
+                auto xDisplay = OS.GDK_DISPLAY ();
+                auto xVisual = OS.gdk_x11_visual_get_xvisual (OS.gdk_visual_get_system());
+                auto drawable = control.backgroundImage.pixmap;
+                auto xDrawable = OS.GDK_PIXMAP_XID (drawable);
+                int w, h;
+                OS.gdk_drawable_get_size (cast(GdkDrawable*)drawable, &w, &h);
+                auto surface = Cairo.cairo_xlib_surface_create (xDisplay, xDrawable, xVisual, w, h);
+                if (surface is null) error (SWT.ERROR_NO_HANDLES);
+                auto pattern = Cairo.cairo_pattern_create_for_surface (surface);
+                if (pattern is null) error (SWT.ERROR_NO_HANDLES);
+                Cairo.cairo_pattern_set_extend (pattern, Cairo.CAIRO_EXTEND_REPEAT);
+                if ((data.style & SWT.MIRRORED) !is 0) {
+                    double[] matrix = [-1.0, 0, 0, 1, 0, 0 ];
+                    Cairo.cairo_pattern_set_matrix(pattern, cast(cairo_matrix_t*)matrix.ptr);
+                }
+                Cairo.cairo_set_source (cairo, pattern);
+                Cairo.cairo_surface_destroy (surface);
+                Cairo.cairo_pattern_destroy (pattern);
+            } else {
+                GdkColor* color = control.getBackgroundColor ();
+                Cairo.cairo_set_source_rgba (cairo, (color.red & 0xFFFF) / cast(float)0xFFFF, (color.green & 0xFFFF) / cast(float)0xFFFF, (color.blue & 0xFFFF) / cast(float)0xFFFF, data.alpha / cast(float)0xFF);
+            }
+            Cairo.cairo_rectangle (cairo, x, y, width, height);
+            Cairo.cairo_fill (cairo);
+            Cairo.cairo_restore (cairo);
+        } else {
+            auto gdkGC = gc.handle;
+            GdkGCValues* values = new GdkGCValues ();
+            OS.gdk_gc_get_values (gdkGC, values);
+            if (control.backgroundImage !is null) {
+                Point pt = display.map (this, control, 0, 0);
+                OS.gdk_gc_set_fill (gdkGC, OS.GDK_TILED);
+                OS.gdk_gc_set_ts_origin (gdkGC, -pt.x, -pt.y);
+                OS.gdk_gc_set_tile (gdkGC, control.backgroundImage.pixmap);
+                OS.gdk_draw_rectangle (data.drawable, gdkGC, 1, x, y, width, height);
+                OS.gdk_gc_set_fill (gdkGC, values.fill);
+                OS.gdk_gc_set_ts_origin (gdkGC, values.ts_x_origin, values.ts_y_origin);
+            } else {
+                GdkColor* color = control.getBackgroundColor ();
+                OS.gdk_gc_set_foreground (gdkGC, color);
+                OS.gdk_draw_rectangle (data.drawable, gdkGC, 1, x, y, width, height);
+                color.pixel = values.foreground.pixel;
+                OS.gdk_gc_set_foreground (gdkGC, color);
+            }
+        }
+    } else {
+        gc.fillRectangle (x, y, width, height);
+    }
+}
+
+override void enableWidget (bool enabled) {
+    if ((state & CANVAS) !is 0) return;
+    super.enableWidget (enabled);
+}
+
+Composite findDeferredControl () {
+    return layoutCount > 0 ? this : parent.findDeferredControl ();
+}
+
+override Menu [] findMenus (Control control) {
+    if (control is this) return new Menu [0];
+    Menu result [] = super.findMenus (control);
+    Control [] children = _getChildren ();
+    for (int i=0; i<children.length; i++) {
+        Control child = children [i];
+        Menu [] menuList = child.findMenus (control);
+        if (menuList.length !is 0) {
+            Menu [] newResult = new Menu [result.length + menuList.length];
+            System.arraycopy (result, 0, newResult, 0, result.length);
+            System.arraycopy (menuList, 0, newResult, result.length, menuList.length);
+            result = newResult;
+        }
+    }
+    return result;
+}
+
+override void fixChildren (Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu [] menus) {
+    super.fixChildren (newShell, oldShell, newDecorations, oldDecorations, menus);
+    Control [] children = _getChildren ();
+    for (int i=0; i<children.length; i++) {
+        children [i].fixChildren (newShell, oldShell, newDecorations, oldDecorations, menus);
+    }
+}
+
+void fixModal(GtkWidget* group, GtkWidget* modalGroup)  {
+    Control[] controls = _getChildren ();
+    for (int i = 0; i < controls.length; i++) {
+        controls[i].fixModal (group, modalGroup);
+    }
+}
+
+override void fixStyle () {
+    super.fixStyle ();
+    if (scrolledHandle is null) fixStyle (handle);
+    Control[] children = _getChildren ();
+    for (int i = 0; i < children.length; i++) {
+        children [i].fixStyle ();
+    }
+}
+
+void fixTabList (Control control) {
+    if (tabList is null) return;
+    int count = 0;
+    for (int i=0; i<tabList.length; i++) {
+        if (tabList [i] is control) count++;
+    }
+    if (count is 0) return;
+    Control [] newList = null;
+    int length = tabList.length - count;
+    if (length !is 0) {
+        newList = new Control [length];
+        int index = 0;
+        for (int i=0; i<tabList.length; i++) {
+            if (tabList [i] !is control) {
+                newList [index++] = tabList [i];
+            }
+        }
+    }
+    tabList = newList;
+}
+
+void fixZOrder () {
+    if ((state & CANVAS) !is 0) return;
+    auto parentHandle = parentingHandle ();
+    auto parentWindow = OS.GTK_WIDGET_WINDOW (cast(GtkWidget*)parentHandle);
+    if (parentWindow is null) return;
+    GObject* userData;
+    auto windowList = OS.gdk_window_get_children (parentWindow);
+    if (windowList !is null) {
+        auto windows = windowList;
+        while (windows !is null) {
+            auto window = cast(GdkDrawable*)OS.g_list_data (windows);
+            if (window !is redrawWindow) {
+                OS.gdk_window_get_user_data (window, cast(void**)&userData);
+                if (userData is null || OS.G_OBJECT_TYPE (cast(GTypeInstance*)userData) !is display.gtk_fixed_get_type ()) {
+                    OS.gdk_window_lower (window);
+                }
+            }
+            windows = cast(GList*)OS.g_list_next (windows);
+        }
+        OS.g_list_free (windowList);
+    }
+}
+
+override GtkWidget* focusHandle () {
+    if (socketHandle !is null) return socketHandle;
+    return super.focusHandle ();
+}
+
+override bool forceFocus (GtkWidget* focusHandle) {
+    if (socketHandle !is null) OS.GTK_WIDGET_SET_FLAGS (focusHandle, OS.GTK_CAN_FOCUS);
+    bool result = super.forceFocus (focusHandle);
+    if (socketHandle !is null) OS.GTK_WIDGET_UNSET_FLAGS (focusHandle, OS.GTK_CAN_FOCUS);
+    return result;
+}
+
+/**
+ * Returns the receiver's background drawing mode. This
+ * will be one of the following constants defined in class
+ * <code>SWT</code>:
+ * <code>INHERIT_NONE</code>, <code>INHERIT_DEFAULT</code>,
+ * <code>INHERTIT_FORCE</code>.
+ *
+ * @return the background mode
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT
+ *
+ * @since 3.2
+ */
+public int getBackgroundMode () {
+    checkWidget ();
+    return backgroundMode;
+}
+
+/**
+ * Returns a (possibly empty) array containing the receiver's children.
+ * Children are returned in the order that they are drawn.  The topmost
+ * control appears at the beginning of the array.  Subsequent controls
+ * draw beneath this control and appear later in the array.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of children, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return an array of children
+ *
+ * @see Control#moveAbove
+ * @see Control#moveBelow
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Control [] getChildren () {
+    checkWidget();
+    return _getChildren ();
+}
+
+int getChildrenCount () {
+    /*
+    * NOTE: The current implementation will count
+    * non-registered children.
+    */
+    auto list = OS.gtk_container_get_children (cast(GtkContainer*)handle);
+    if (list is null) return 0;
+    int count = OS.g_list_length (list);
+    OS.g_list_free (list);
+    return count;
+}
+
+override public Rectangle getClientArea () {
+    checkWidget();
+    if ((state & CANVAS) !is 0) {
+        if ((state & ZERO_WIDTH) !is 0 && (state & ZERO_HEIGHT) !is 0) {
+            return new Rectangle (0, 0, 0, 0);
+        }
+        forceResize ();
+        auto clientHandle = clientHandle ();
+        int width = (state & ZERO_WIDTH) !is 0 ? 0 : OS.GTK_WIDGET_WIDTH (clientHandle);
+        int height = (state & ZERO_HEIGHT) !is 0 ? 0 : OS.GTK_WIDGET_HEIGHT (clientHandle);
+        return new Rectangle (0, 0, width, height);
+    }
+    return super.getClientArea();
+}
+
+int getClientWidth() {
+    return (state & ZERO_WIDTH) !is 0 ? 0 : OS.GTK_WIDGET_WIDTH (clientHandle ());
+}
+
+/**
+ * Returns layout which is associated with the receiver, or
+ * null if one has not been set.
+ *
+ * @return the receiver's layout or null
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Layout getLayout () {
+    checkWidget();
+    return layout_;
+}
+
+/**
+ * Returns <code>true</code> if the receiver has deferred
+ * the performing of layout, and <code>false</code> otherwise.
+ *
+ * @return the receiver's deferred layout state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setLayoutDeferred(bool)
+ * @see #isLayoutDeferred()
+ *
+ * @since 3.1
+ */
+public bool getLayoutDeferred () {
+    checkWidget ();
+    return layoutCount > 0 ;
+}
+
+/**
+ * Gets the (possibly empty) tabbing order for the control.
+ *
+ * @return tabList the ordered list of controls representing the tab order
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setTabList
+ */
+public Control [] getTabList () {
+    checkWidget ();
+    Control [] tabList = _getTabList ();
+    if (tabList is null) {
+        int count = 0;
+        Control [] list =_getChildren ();
+        for (int i=0; i<list.length; i++) {
+            if (list [i].isTabGroup ()) count++;
+        }
+        tabList = new Control [count];
+        int index = 0;
+        for (int i=0; i<list.length; i++) {
+            if (list [i].isTabGroup ()) {
+                tabList [index++] = list [i];
+            }
+        }
+    }
+    return tabList;
+}
+
+override int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* event) {
+    auto result = super.gtk_button_press_event (widget, event);
+    if (result !is 0) return result;
+    if ((state & CANVAS) !is 0) {
+        if ((style & SWT.NO_FOCUS) is 0 && hooksKeys ()) {
+            if (event.button is 1) {
+                if (getChildrenCount () is 0) setFocus ();
+            }
+        }
+    }
+    return result;
+}
+
+override int /*long*/ gtk_expose_event (GtkWidget* widget, GdkEventExpose* eventPtr) {
+    if ((state & OBSCURED) !is 0) return 0;
+    if ((state & CANVAS) is 0) {
+        return super.gtk_expose_event (widget, eventPtr);
+    }
+    if ((style & SWT.NO_MERGE_PAINTS) is 0) {
+        return super.gtk_expose_event (widget, eventPtr);
+    }
+    if (!hooks (SWT.Paint) && !filters (SWT.Paint)) return 0;
+    GdkEventExpose* gdkEvent = eventPtr;
+    GdkRectangle* rectangles;
+    int n_rectangles;
+    OS.gdk_region_get_rectangles (gdkEvent.region, &rectangles, &n_rectangles);
+    for (int i=0; i<n_rectangles; i++) {
+        Event event = new Event ();
+        event.x = rectangles[i].x;
+        event.y = rectangles[i].y;
+        event.width = rectangles[i].width;
+        event.height = rectangles[i].height;
+        if ((style & SWT.MIRRORED) !is 0) event.x = getClientWidth () - event.width - event.x;
+        auto damageRgn = OS.gdk_region_new ();
+        OS.gdk_region_union_with_rect (damageRgn, rectangles + i );
+        GCData data = new GCData ();
+        data.damageRgn = damageRgn;
+        GC gc = event.gc = GC.gtk_new (this, data);
+        OS.gdk_gc_set_clip_region (gc.handle, damageRgn);
+        sendEvent (SWT.Paint, event);
+        gc.dispose ();
+        OS.gdk_region_destroy (damageRgn);
+        event.gc = null;
+    }
+    OS.g_free (rectangles);
+    return 0;
+}
+
+override int /*long*/ gtk_key_press_event (GtkWidget* widget, GdkEventKey* event) {
+    auto result = super.gtk_key_press_event (widget, event);
+    if (result !is 0) return result;
+    /*
+    * Feature in GTK.  The default behavior when the return key
+    * is pressed is to select the default button.  This is not the
+    * expected behavior for Composite and its subclasses.  The
+    * fix is to avoid calling the default handler.
+    */
+    if ((state & CANVAS) !is 0 && socketHandle is null) {
+        GdkEventKey* keyEvent = event;
+        int key = keyEvent.keyval;
+        switch (key) {
+            case OS.GDK_Return:
+            case OS.GDK_KP_Enter: return 1;
+            default:
+        }
+    }
+    return result;
+}
+
+override int /*long*/ gtk_focus (GtkWidget* widget, int directionType) {
+    if (widget is socketHandle) return 0;
+    return super.gtk_focus (widget, directionType);
+}
+
+override int /*long*/ gtk_focus_in_event (GtkWidget* widget, GdkEventFocus* event) {
+    int /*long*/ result = super.gtk_focus_in_event (widget, event);
+    return (state & CANVAS) !is 0 ? 1 : result;
+}
+
+override int /*long*/ gtk_focus_out_event (GtkWidget* widget, GdkEventFocus* event) {
+    auto result = super.gtk_focus_out_event (widget, event);
+    return (state & CANVAS) !is 0 ? 1 : result;
+}
+
+override int /*long*/ gtk_map (GtkWidget* widget) {
+    fixZOrder ();
+    return 0;
+}
+
+override int /*long*/ gtk_realize (GtkWidget* widget) {
+    auto result = super.gtk_realize (widget);
+    if ((style & SWT.NO_BACKGROUND) !is 0) {
+        auto window = OS.GTK_WIDGET_WINDOW (paintHandle ());
+        if (window !is null) OS.gdk_window_set_back_pixmap (window, null, false);
+    }
+    if (socketHandle !is null) {
+        embeddedHandle = OS.gtk_socket_get_id (cast(GtkSocket*)socketHandle);
+    }
+    return result;
+}
+
+override int /*long*/ gtk_scroll_child (GtkWidget* widget, int /*long*/ scrollType, int /*long*/ horizontal) {
+    /* Stop GTK scroll child signal for canvas */
+    OS.g_signal_stop_emission_by_name (widget, OS.scroll_child.ptr);
+    return 1;
+}
+
+override int /*long*/ gtk_style_set (GtkWidget* widget, int /*long*/ previousStyle) {
+    auto result = super.gtk_style_set (widget, previousStyle);
+    if ((style & SWT.NO_BACKGROUND) !is 0) {
+        auto window = OS.GTK_WIDGET_WINDOW (paintHandle ());
+        if (window !is null) OS.gdk_window_set_back_pixmap (window, null, false);
+    }
+    return result;
+}
+
+bool hasBorder () {
+    return (style & SWT.BORDER) !is 0;
+}
+
+override void hookEvents () {
+    super.hookEvents ();
+    if ((state & CANVAS) !is 0) {
+        OS.gtk_widget_add_events (handle, OS.GDK_POINTER_MOTION_HINT_MASK);
+        if (scrolledHandle !is null) {
+            OS.g_signal_connect_closure (scrolledHandle, OS.scroll_child.ptr, display.closures [SCROLL_CHILD], false);
+        }
+    }
+}
+
+bool hooksKeys () {
+    return hooks (SWT.KeyDown) || hooks (SWT.KeyUp);
+}
+
+override GtkIMContext* imHandle () {
+    return imHandle_;
+}
+
+/**
+ * Returns <code>true</code> if the receiver or any ancestor
+ * up to and including the receiver's nearest ancestor shell
+ * has deferred the performing of layouts.  Otherwise, <code>false</code>
+ * is returned.
+ *
+ * @return the receiver's deferred layout state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setLayoutDeferred(bool)
+ * @see #getLayoutDeferred()
+ *
+ * @since 3.1
+ */
+public bool isLayoutDeferred () {
+    checkWidget ();
+    return findDeferredControl () !is null;
+}
+
+override bool isTabGroup() {
+    if ((state & CANVAS) !is 0) return true;
+    return super.isTabGroup();
+}
+
+/**
+ * If the receiver has a layout, asks the layout to <em>lay out</em>
+ * (that is, set the size and location of) the receiver's children.
+ * If the receiver does not have a layout, do nothing.
+ * <p>
+ * This is equivalent to calling <code>layout(true)</code>.
+ * </p>
+ * <p>
+ * Note: Layout is different from painting. If a child is
+ * moved or resized such that an area in the parent is
+ * exposed, then the parent will paint. If no child is
+ * affected, the parent will not paint.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void layout () {
+    checkWidget ();
+    layout (true);
+}
+
+/**
+ * If the receiver has a layout, asks the layout to <em>lay out</em>
+ * (that is, set the size and location of) the receiver's children.
+ * If the argument is <code>true</code> the layout must not rely
+ * on any information it has cached about the immediate children. If it
+ * is <code>false</code> the layout may (potentially) optimize the
+ * work it is doing by assuming that none of the receiver's
+ * children has changed state since the last layout.
+ * If the receiver does not have a layout, do nothing.
+ * <p>
+ * If a child is resized as a result of a call to layout, the
+ * resize event will invoke the layout of the child.  The layout
+ * will cascade down through all child widgets in the receiver's widget
+ * tree until a child is encountered that does not resize.  Note that
+ * a layout due to a resize will not flush any cached information
+ * (same as <code>layout(false)</code>).
+ * </p>
+ * <p>
+ * Note: Layout is different from painting. If a child is
+ * moved or resized such that an area in the parent is
+ * exposed, then the parent will paint. If no child is
+ * affected, the parent will not paint.
+ * </p>
+ *
+ * @param changed <code>true</code> if the layout must flush its caches, and <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void layout (bool changed) {
+    checkWidget ();
+    if (layout_ is null) return;
+    layout (changed, false);
+}
+
+/**
+ * If the receiver has a layout, asks the layout to <em>lay out</em>
+ * (that is, set the size and location of) the receiver's children.
+ * If the changed argument is <code>true</code> the layout must not rely
+ * on any information it has cached about its children. If it
+ * is <code>false</code> the layout may (potentially) optimize the
+ * work it is doing by assuming that none of the receiver's
+ * children has changed state since the last layout.
+ * If the all argument is <code>true</code> the layout will cascade down
+ * through all child widgets in the receiver's widget tree, regardless of
+ * whether the child has changed size.  The changed argument is applied to
+ * all layouts.  If the all argument is <code>false</code>, the layout will
+ * <em>not</em> cascade down through all child widgets in the receiver's widget
+ * tree.  However, if a child is resized as a result of a call to layout, the
+ * resize event will invoke the layout of the child.  Note that
+ * a layout due to a resize will not flush any cached information
+ * (same as <code>layout(false)</code>).
+ * </p>
+ * <p>
+ * Note: Layout is different from painting. If a child is
+ * moved or resized such that an area in the parent is
+ * exposed, then the parent will paint. If no child is
+ * affected, the parent will not paint.
+ * </p>
+ *
+ * @param changed <code>true</code> if the layout must flush its caches, and <code>false</code> otherwise
+ * @param all <code>true</code> if all children in the receiver's widget tree should be laid out, and <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void layout (bool changed, bool all) {
+    checkWidget ();
+    if (layout_ is null && !all) return;
+    markLayout (changed, all);
+    updateLayout (all);
+}
+
+/**
+ * Forces a lay out (that is, sets the size and location) of all widgets that
+ * are in the parent hierarchy of the changed control up to and including the
+ * receiver.  The layouts in the hierarchy must not rely on any information
+ * cached about the changed control or any of its ancestors.  The layout may
+ * (potentially) optimize the work it is doing by assuming that none of the
+ * peers of the changed control have changed state since the last layout.
+ * If an ancestor does not have a layout, skip it.
+ * <p>
+ * Note: Layout is different from painting. If a child is
+ * moved or resized such that an area in the parent is
+ * exposed, then the parent will paint. If no child is
+ * affected, the parent will not paint.
+ * </p>
+ *
+ * @param changed a control that has had a state change which requires a recalculation of its size
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the changed array is null any of its controls are null or have been disposed</li>
+ *    <li>ERROR_INVALID_PARENT - if any control in changed is not in the widget tree of the receiver</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void layout (Control [] changed) {
+    checkWidget ();
+    if (changed is null) error (SWT.ERROR_INVALID_ARGUMENT);
+    for (int i=0; i<changed.length; i++) {
+        Control control = changed [i];
+        if (control is null) error (SWT.ERROR_INVALID_ARGUMENT);
+        if (control.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+        bool ancestor = false;
+        Composite composite = control.parent;
+        while (composite !is null) {
+            ancestor = composite is this;
+            if (ancestor) break;
+            composite = composite.parent;
+        }
+        if (!ancestor) error (SWT.ERROR_INVALID_PARENT);
+    }
+    int updateCount = 0;
+    Composite [] update = new Composite [16];
+    for (int i=0; i<changed.length; i++) {
+        Control child = changed [i];
+        Composite composite = child.parent;
+        while (child !is this) {
+            if (composite.layout_ !is null) {
+                composite.state |= LAYOUT_NEEDED;
+                if (!composite.layout_.flushCache (child)) {
+                    composite.state |= LAYOUT_CHANGED;
+                }
+            }
+            if (updateCount is update.length) {
+                Composite [] newUpdate = new Composite [update.length + 16];
+                System.arraycopy (update, 0, newUpdate, 0, update.length);
+                update = newUpdate;
+            }
+            child = update [updateCount++] = composite;
+            composite = child.parent;
+        }
+    }
+    for (int i=updateCount-1; i>=0; i--) {
+        update [i].updateLayout (false);
+    }
+}
+
+override void markLayout (bool changed, bool all) {
+    if (layout_ !is null) {
+        state |= LAYOUT_NEEDED;
+        if (changed) state |= LAYOUT_CHANGED;
+    }
+    if (all) {
+        Control [] children = _getChildren ();
+        for (int i=0; i<children.length; i++) {
+            children [i].markLayout (changed, all);
+        }
+    }
+}
+
+void moveAbove (GtkWidget* child, GtkWidget* sibling) {
+    if (child is sibling) return;
+    auto parentHandle = parentingHandle ();
+    auto fixed = cast(GtkFixed*)parentHandle;
+    GList* children = fixed.children;
+    if (children is null) return;
+    void* data;
+    GtkWidget* widget;
+    void* childData;
+    GList* childLink, siblingLink;
+    GList* temp = children;
+    while (temp !is null) {
+        data = temp.data;
+        widget = *cast(GtkWidget**) data;
+        if (child is widget) {
+            childLink = temp;
+            childData = data;
+        } else if (sibling is widget) {
+            siblingLink = temp;
+        }
+        if (childData !is null && (sibling is null || siblingLink !is null)) break;
+        temp = cast(GList*)OS.g_list_next (temp);
+    }
+    children = OS.g_list_remove_link (children, childLink);
+    if (siblingLink is null || siblingLink.prev is null) {
+        OS.g_list_free_1 (childLink);
+        children = OS.g_list_prepend (children, childData);
+    } else {
+        temp = siblingLink.prev;
+        childLink.prev =  temp;
+        temp.next = childLink;
+        childLink.next = siblingLink;
+        siblingLink.prev = childLink;
+    }
+    fixed.children = children;
+    parentHandle = cast(GtkWidget*)fixed;
+}
+
+alias Scrollable.moveBelow moveBelow;
+void moveBelow (GtkWidget* child, GtkWidget* sibling) {
+    if (child is sibling) return;
+    auto parentHandle = parentingHandle ();
+    if (sibling is null && cast(GtkWidget*)parentHandle is cast(GtkWidget*)fixedHandle) {
+        moveAbove (child, scrolledHandle !is null  ? cast(GtkWidget*)scrolledHandle : handle);
+        return;
+    }
+    auto fixed = cast(GtkFixed*)parentHandle;
+    GList* children = fixed.children;
+    if (children is null) return;
+    void* data;
+    GtkWidget* widget;
+    void* childData;
+    GList* childLink;
+    GList* siblingLink;
+    GList* temp = children;
+    while (temp !is null) {
+        data = temp.data;
+        widget = *cast(GtkWidget**) temp.data;
+        if (child is widget) {
+            childLink = temp;
+            childData = data;
+        } else if (sibling is widget) {
+            siblingLink = temp;
+        }
+        if (childData !is null && (sibling is null || siblingLink !is null)) break;
+        temp = OS.g_list_next(temp);
+    }
+    children = OS.g_list_remove_link (children, childLink);
+    if (siblingLink is null || OS.g_list_next(siblingLink) is null) {
+        OS.g_list_free_1 (childLink);
+        children = OS.g_list_append (children, childData);
+    } else {
+        temp = OS.g_list_next( siblingLink );
+        OS.g_list_set_next (childLink, temp);
+        OS.g_list_set_previous (temp, childLink);
+        OS.g_list_set_previous (childLink, siblingLink);
+        OS.g_list_set_next (siblingLink, childLink);
+    }
+    fixed.children = children;
+    parentHandle = cast(GtkWidget*)fixed;
+}
+
+void moveChildren(int oldWidth) {
+    Control[] children = _getChildren ();
+    for (int i = 0; i < children.length; i++) {
+        Control child = children[i];
+        auto topHandle = child.topHandle ();
+        int x = OS.GTK_WIDGET_X (topHandle);
+        int y = OS.GTK_WIDGET_Y (topHandle);
+        int controlWidth = (child.state & ZERO_WIDTH) !is 0 ? 0 : OS.GTK_WIDGET_WIDTH (topHandle);
+        x = oldWidth - controlWidth - x;
+        int clientWidth = getClientWidth ();
+        x = clientWidth - controlWidth - x;
+        if (child.enableWindow !is null) {
+            OS.gdk_window_move (child.enableWindow, x, y);
+        }
+        child.moveHandle (x, y);
+        /*
+        * Cause a size allocation this widget's topHandle.  Note that
+        * all calls to gtk_widget_size_allocate() must be preceded by
+        * a call to gtk_widget_size_request().
+        */
+        GtkRequisition requisition;
+        gtk_widget_size_request (topHandle, &requisition);
+        GtkAllocation allocation;
+        allocation.x = x;
+        allocation.y = y;
+        allocation.width = OS.GTK_WIDGET_WIDTH (topHandle);
+        allocation.height = OS.GTK_WIDGET_HEIGHT (topHandle);
+        OS.gtk_widget_size_allocate (topHandle, &allocation);
+        Control control = child.findBackgroundControl ();
+        if (control !is null && control.backgroundImage !is null) {
+            if (child.isVisible ()) child.redrawWidget (0, 0, 0, 0, true, true, true);
+        }
+    }
+}
+
+Point minimumSize (int wHint, int hHint, bool changed) {
+    Control [] children = _getChildren ();
+    int width = 0, height = 0;
+    for (int i=0; i<children.length; i++) {
+        Rectangle rect = children [i].getBounds ();
+        width = Math.max (width, rect.x + rect.width);
+        height = Math.max (height, rect.y + rect.height);
+    }
+    return new Point (width, height);
+}
+
+GtkWidget* parentingHandle () {
+    if ((state & CANVAS) !is 0) return handle;
+    return fixedHandle !is null ? fixedHandle : handle;
+}
+
+override void printWidget (GC gc, GdkDrawable* drawable, int depth, int x, int y) {
+    Region oldClip = new Region (gc.getDevice ());
+    Region newClip = new Region (gc.getDevice ());
+    gc.getClipping (oldClip);
+    Rectangle rect = getBounds ();
+    newClip.add (oldClip);
+    newClip.intersect (x, y, rect.width, rect.height);
+    gc.setClipping (newClip);
+    super.printWidget (gc, drawable, depth, x, y);
+    Rectangle clientRect = getClientArea ();
+    Point pt = display.map (this, parent, clientRect.x, clientRect.y);
+    clientRect.x = x + pt.x - rect.x;
+    clientRect.y = y + pt.y - rect.y;
+    newClip.intersect (clientRect);
+    gc.setClipping (newClip);
+    Control [] children = _getChildren ();
+    for (int i=children.length-1; i>=0; --i) {
+        Control child = children [i];
+        if (child.getVisible ()) {
+            Point location = child.getLocation ();
+            child.printWidget (gc, drawable, depth, x + location.x, y + location.y);
+        }
+    }
+    gc.setClipping (oldClip);
+    oldClip.dispose ();
+    newClip.dispose ();
+}
+
+override void redrawChildren () {
+    super.redrawChildren ();
+    Control [] children = _getChildren ();
+    for (int i = 0; i < children.length; i++) {
+        Control child = children [i];
+        if ((child.state & PARENT_BACKGROUND) !is 0) {
+            child.redrawWidget (0, 0, 0, 0, true, false, true);
+            child.redrawChildren ();
+        }
+    }
+}
+
+override void register () {
+    super.register ();
+    if (socketHandle !is null) display.addWidget (socketHandle, this);
+}
+
+override void releaseChildren (bool destroy) {
+    Control [] children = _getChildren ();
+    for (int i=0; i<children.length; i++) {
+        Control child = children [i];
+        if (child !is null && !child.isDisposed ()) {
+            child.release (false);
+        }
+    }
+    super.releaseChildren (destroy);
+}
+
+override void releaseHandle () {
+    super.releaseHandle ();
+    socketHandle = null;
+    embeddedHandle = 0;
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    if (imHandle_ !is null) OS.g_object_unref (imHandle_);
+    imHandle_ = null;
+    layout_ = null;
+    tabList = null;
+}
+
+void removeControl (Control control) {
+    fixTabList (control);
+}
+
+override void resizeHandle (int width, int height) {
+    super.resizeHandle (width, height);
+    if (socketHandle !is null) OS.gtk_widget_set_size_request (socketHandle, width, height);
+}
+
+/**
+ * Sets the background drawing mode to the argument which should
+ * be one of the following constants defined in class <code>SWT</code>:
+ * <code>INHERIT_NONE</code>, <code>INHERIT_DEFAULT</code>,
+ * <code>INHERIT_FORCE</code>.
+ *
+ * @param mode the new background mode
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT
+ *
+ * @since 3.2
+ */
+public void setBackgroundMode (int mode) {
+    checkWidget ();
+    backgroundMode = mode;
+    Control[] children = _getChildren ();
+    for (int i = 0; i < children.length; i++) {
+        children [i].updateBackgroundMode ();
+    }
+}
+
+override int setBounds (int x, int y, int width, int height, bool move, bool resize) {
+    int result = super.setBounds (x, y, width, height, move, resize);
+    if ((result & RESIZED) !is 0 && layout_ !is null) {
+        markLayout (false, false);
+        updateLayout (false);
+    }
+    return result;
+}
+
+override public bool setFocus () {
+    checkWidget();
+    Control [] children = _getChildren ();
+    for (int i=0; i<children.length; i++) {
+        Control child = children [i];
+        if (child.getVisible () && child.setFocus ()) return true;
+    }
+    return super.setFocus ();
+}
+
+/**
+ * Sets the layout which is associated with the receiver to be
+ * the argument which may be null.
+ *
+ * @param layout the receiver's new layout or null
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setLayout (Layout layout) {
+    checkWidget();
+    this.layout_ = layout;
+}
+
+/**
+ * If the argument is <code>true</code>, causes subsequent layout
+ * operations in the receiver or any of its children to be ignored.
+ * No layout of any kind can occur in the receiver or any of its
+ * children until the flag is set to false.
+ * Layout operations that occurred while the flag was
+ * <code>true</code> are remembered and when the flag is set to
+ * <code>false</code>, the layout operations are performed in an
+ * optimized manner.  Nested calls to this method are stacked.
+ *
+ * @param defer the new defer state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #layout(bool)
+ * @see #layout(Control[])
+ *
+ * @since 3.1
+ */
+public void setLayoutDeferred (bool defer) {
+    if (!defer) {
+        if (--layoutCount is 0) {
+            if ((state & LAYOUT_CHILD) !is 0 || (state & LAYOUT_NEEDED) !is 0) {
+                updateLayout (true);
+            }
+        }
+    } else {
+        layoutCount++;
+    }
+}
+
+override bool setScrollBarVisible (ScrollBar bar, bool visible) {
+    bool changed = super.setScrollBarVisible (bar, visible);
+    if (changed && layout_ !is null) {
+        markLayout (false, false);
+        updateLayout (false);
+    }
+    return changed;
+}
+
+override bool setTabGroupFocus (bool next) {
+    if (isTabItem ()) return setTabItemFocus (next);
+    bool takeFocus = (style & SWT.NO_FOCUS) is 0;
+    if ((state & CANVAS) !is 0) takeFocus = hooksKeys ();
+    if (socketHandle !is null) takeFocus = true;
+    if (takeFocus  && setTabItemFocus (next)) return true;
+    Control [] children = _getChildren ();
+    for (int i=0; i<children.length; i++) {
+        Control child = children [i];
+        if (child.isTabItem () && child.setTabItemFocus (next)) return true;
+    }
+    return false;
+}
+
+override bool setTabItemFocus (bool next) {
+    if (!super.setTabItemFocus (next)) return false;
+    if (socketHandle !is null) {
+        int direction = next ? OS.GTK_DIR_TAB_FORWARD : OS.GTK_DIR_TAB_BACKWARD;
+        OS.GTK_WIDGET_UNSET_FLAGS (socketHandle, OS.GTK_HAS_FOCUS);
+        OS.gtk_widget_child_focus (socketHandle, direction);
+        OS.GTK_WIDGET_SET_FLAGS (socketHandle, OS.GTK_HAS_FOCUS);
+    }
+    return true;
+}
+
+/**
+ * Sets the tabbing order for the specified controls to
+ * match the order that they occur in the argument list.
+ *
+ * @param tabList the ordered list of controls representing the tab order or null
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if a widget in the tabList is null or has been disposed</li>
+ *    <li>ERROR_INVALID_PARENT - if widget in the tabList is not in the same widget tree</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setTabList (Control [] tabList) {
+    checkWidget ();
+    if (tabList !is null) {
+        for (int i=0; i<tabList.length; i++) {
+            Control control = tabList [i];
+            if (control is null) error (SWT.ERROR_INVALID_ARGUMENT);
+            if (control.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+            if (control.parent !is this) error (SWT.ERROR_INVALID_PARENT);
+        }
+        Control [] newList = new Control [tabList.length];
+        System.arraycopy (tabList, 0, newList, 0, tabList.length);
+        tabList = newList;
+    }
+    this.tabList = tabList;
+}
+
+override void showWidget () {
+    super.showWidget ();
+    if (socketHandle !is null) {
+        OS.gtk_widget_show (socketHandle);
+        embeddedHandle = OS.gtk_socket_get_id (cast(GtkSocket*)socketHandle);
+    }
+    if (scrolledHandle is null) fixStyle (handle);
+}
+
+override bool translateMnemonic (Event event, Control control) {
+    if (super.translateMnemonic (event, control)) return true;
+    if (control !is null) {
+        Control [] children = _getChildren ();
+        for (int i=0; i<children.length; i++) {
+            Control child = children [i];
+            if (child.translateMnemonic (event, control)) return true;
+        }
+    }
+    return false;
+}
+
+override int traversalCode(int key, GdkEventKey* event) {
+    if ((state & CANVAS) !is 0) {
+        if ((style & SWT.NO_FOCUS) !is 0) return 0;
+        if (hooksKeys ()) return 0;
+    }
+    return super.traversalCode (key, event);
+}
+
+override bool translateTraversal (GdkEventKey* keyEvent) {
+    if (socketHandle !is null) return false;
+    return super.translateTraversal (keyEvent);
+}
+
+override void updateBackgroundMode () {
+    super.updateBackgroundMode ();
+    Control [] children = _getChildren ();
+    for (int i = 0; i < children.length; i++) {
+        children [i].updateBackgroundMode ();
+    }
+}
+
+override void updateLayout (bool all) {
+    Composite parent = findDeferredControl ();
+    if (parent !is null) {
+        parent.state |= LAYOUT_CHILD;
+        return;
+    }
+    if ((state & LAYOUT_NEEDED) !is 0) {
+        bool changed = (state & LAYOUT_CHANGED) !is 0;
+        state &= ~(LAYOUT_NEEDED | LAYOUT_CHANGED);
+        layout_.layout (this, changed);
+    }
+    if (all) {
+        state &= ~LAYOUT_CHILD;
+        Control [] children = _getChildren ();
+        for (int i=0; i<children.length; i++) {
+            children [i].updateLayout (all);
+        }
+    }
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Control.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,4532 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Control;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+//import org.eclipse.swt.accessibility.Accessible;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.events.HelpListener;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.MouseMoveListener;
+import org.eclipse.swt.events.MouseTrackListener;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.TraverseListener;
+import org.eclipse.swt.events.DragDetectListener;
+import org.eclipse.swt.events.MenuDetectListener;
+import org.eclipse.swt.events.MouseWheelListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.Drawable;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.GCData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.Region;
+import org.eclipse.swt.internal.Converter;
+import org.eclipse.swt.internal.SWTEventListener;
+import org.eclipse.swt.internal.accessibility.gtk.ATK;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Decorations;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Monitor;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swt.accessibility.Accessible;
+
+import tango.core.Thread;
+
+
+/**
+ * Control is the abstract superclass of all windowed user interface classes.
+ * <p>
+ * <dl>
+ * <dt><b>Styles:</b>
+ * <dd>BORDER</dd>
+ * <dd>LEFT_TO_RIGHT, RIGHT_TO_LEFT</dd>
+ * <dt><b>Events:</b>
+ * <dd>DragDetect, FocusIn, FocusOut, Help, KeyDown, KeyUp, MenuDetect, MouseDoubleClick, MouseDown, MouseEnter,
+ *     MouseExit, MouseHover, MouseUp, MouseMove, Move, Paint, Resize, Traverse</dd>
+ * </dl>
+ * </p><p>
+ * Only one of LEFT_TO_RIGHT or RIGHT_TO_LEFT may be specified.
+ * </p><p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#control">Control snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public abstract class Control : Widget, Drawable {
+
+    alias Widget.mnemonicHit mnemonicHit;
+    alias Widget.mnemonicMatch mnemonicMatch;
+    alias Widget.setForegroundColor setForegroundColor;
+    alias Widget.translateTraversal translateTraversal;
+    alias Widget.windowProc windowProc;
+
+    GtkWidget* fixedHandle;
+    GdkWindow* redrawWindow;
+    GdkWindow* enableWindow;
+    int drawCount;
+    Composite parent;
+    Cursor cursor;
+    Menu menu;
+    Image backgroundImage;
+    Font font;
+    Region region;
+    String toolTipText;
+    Object layoutData;
+    Accessible accessible;
+
+this () {
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#BORDER
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Composite parent, int style) {
+    super (parent, style);
+    this.parent = parent;
+    createWidget (0);
+}
+
+Font defaultFont () {
+    return display.getSystemFont ();
+}
+
+override void deregister () {
+    super.deregister ();
+    if (fixedHandle !is null) display.removeWidget (fixedHandle);
+    auto imHandle = imHandle ();
+    if (imHandle !is null) display.removeWidget (cast(GtkWidget*)imHandle);
+}
+
+bool drawGripper (int x, int y, int width, int height, bool vertical) {
+    auto paintHandle = paintHandle ();
+    auto window = OS.GTK_WIDGET_WINDOW (paintHandle);
+    if (window is null) return false;
+    int orientation = vertical ? OS.GTK_ORIENTATION_HORIZONTAL : OS.GTK_ORIENTATION_VERTICAL;
+    if ((style & SWT.MIRRORED) !is 0) x = getClientWidth () - width - x;
+    char dummy;
+    OS.gtk_paint_handle (OS.gtk_widget_get_style (paintHandle), window, OS.GTK_STATE_NORMAL, OS.GTK_SHADOW_OUT, null, paintHandle, &dummy, x, y, width, height, orientation);
+    return true;
+}
+
+void enableWidget (bool enabled) {
+    OS.gtk_widget_set_sensitive (handle, enabled);
+}
+
+GtkWidget* enterExitHandle () {
+    return eventHandle ();
+}
+
+GtkWidget* eventHandle () {
+    return handle;
+}
+
+GdkWindow* eventWindow () {
+    auto eventHandle = eventHandle ();
+    OS.gtk_widget_realize (eventHandle);
+    return OS.GTK_WIDGET_WINDOW (eventHandle);
+}
+
+void fixFocus (Control focusControl) {
+    Shell shell = getShell ();
+    Control control = this;
+    while (control !is shell && (control = control.parent) !is null) {
+        if (control.setFocus ()) return;
+    }
+    shell.setSavedFocus (focusControl);
+    auto focusHandle_ = shell.vboxHandle;
+    OS.GTK_WIDGET_SET_FLAGS (focusHandle_, OS.GTK_CAN_FOCUS);
+    OS.gtk_widget_grab_focus (focusHandle_);
+    OS.GTK_WIDGET_UNSET_FLAGS (focusHandle_, OS.GTK_CAN_FOCUS);
+}
+
+public void fixStyle () {
+    if (fixedHandle !is null) fixStyle (fixedHandle);
+}
+
+void fixStyle (GtkWidget* handle) {
+    /*
+    * Feature in GTK.  Some GTK themes apply a different background to
+    * the contents of a GtkNotebook.  However, in an SWT TabFolder, the
+    * children are not parented below the GtkNotebook widget, and usually
+    * have their own GtkFixed.  The fix is to look up the correct style
+    * for a child of a GtkNotebook and apply its background to any GtkFixed
+    * widgets that are direct children of an SWT TabFolder.
+    *
+    * Note that this has to be when the theme settings changes and that it
+    * should not override the application background.
+    */
+    if ((state & BACKGROUND) !is 0) return;
+    auto childStyle = parent.childStyle ();
+    if (childStyle !is null) {
+        GdkColor color;
+        OS.gtk_style_get_bg (childStyle, 0, &color);
+        OS.gtk_widget_modify_bg (handle, 0, &color);
+    }
+}
+
+GtkWidget* focusHandle () {
+    return handle;
+}
+
+GtkWidget* fontHandle () {
+    return handle;
+}
+
+bool hasFocus () {
+    return this is display.getFocusControl();
+}
+
+override void hookEvents () {
+    /* Connect the keyboard signals */
+    auto focusHandle_ = focusHandle ();
+    int focusMask = OS.GDK_KEY_PRESS_MASK | OS.GDK_KEY_RELEASE_MASK | OS.GDK_FOCUS_CHANGE_MASK;
+    OS.gtk_widget_add_events (focusHandle_, focusMask);
+    OS.g_signal_connect_closure_by_id (focusHandle_, display.signalIds [POPUP_MENU], 0, display.closures [POPUP_MENU], false);
+    OS.g_signal_connect_closure_by_id (focusHandle_, display.signalIds [SHOW_HELP], 0, display.closures [SHOW_HELP], false);
+    OS.g_signal_connect_closure_by_id (focusHandle_, display.signalIds [KEY_PRESS_EVENT], 0, display.closures [KEY_PRESS_EVENT], false);
+    OS.g_signal_connect_closure_by_id (focusHandle_, display.signalIds [KEY_RELEASE_EVENT], 0, display.closures [KEY_RELEASE_EVENT], false);
+    OS.g_signal_connect_closure_by_id (focusHandle_, display.signalIds [FOCUS], 0, display.closures [FOCUS], false);
+    OS.g_signal_connect_closure_by_id (focusHandle_, display.signalIds [FOCUS_IN_EVENT], 0, display.closures [FOCUS_IN_EVENT], false);
+    OS.g_signal_connect_closure_by_id (focusHandle_, display.signalIds [FOCUS_OUT_EVENT], 0, display.closures [FOCUS_OUT_EVENT], false);
+
+    /* Connect the mouse signals */
+    auto eventHandle = eventHandle ();
+    int eventMask = OS.GDK_POINTER_MOTION_MASK | OS.GDK_BUTTON_PRESS_MASK | OS.GDK_BUTTON_RELEASE_MASK;
+    OS.gtk_widget_add_events (eventHandle, eventMask);
+    OS.g_signal_connect_closure_by_id (eventHandle, display.signalIds [BUTTON_PRESS_EVENT], 0, display.closures [BUTTON_PRESS_EVENT], false);
+    OS.g_signal_connect_closure_by_id (eventHandle, display.signalIds [BUTTON_RELEASE_EVENT], 0, display.closures [BUTTON_RELEASE_EVENT], false);
+    OS.g_signal_connect_closure_by_id (eventHandle, display.signalIds [MOTION_NOTIFY_EVENT], 0, display.closures [MOTION_NOTIFY_EVENT], false);
+    OS.g_signal_connect_closure_by_id (eventHandle, display.signalIds [SCROLL_EVENT], 0, display.closures [SCROLL_EVENT], false);
+
+    /* Connect enter/exit signals */
+    auto enterExitHandle = enterExitHandle ();
+    int enterExitMask = OS.GDK_ENTER_NOTIFY_MASK | OS.GDK_LEAVE_NOTIFY_MASK;
+    OS.gtk_widget_add_events (enterExitHandle, enterExitMask);
+    OS.g_signal_connect_closure_by_id (enterExitHandle, display.signalIds [ENTER_NOTIFY_EVENT], 0, display.closures [ENTER_NOTIFY_EVENT], false);
+    OS.g_signal_connect_closure_by_id (enterExitHandle, display.signalIds [LEAVE_NOTIFY_EVENT], 0, display.closures [LEAVE_NOTIFY_EVENT], false);
+
+    /*
+    * Feature in GTK.  Events such as mouse move are propagate up
+    * the widget hierarchy and are seen by the parent.  This is the
+    * correct GTK behavior but not correct for SWT.  The fix is to
+    * hook a signal after and stop the propagation using a negative
+    * event number to distinguish this case.
+    *
+    * The signal is hooked to the fixedHandle to catch events sent to
+    * lightweight widgets.
+    */
+    auto blockHandle = fixedHandle !is null ? fixedHandle : eventHandle;
+    OS.g_signal_connect_closure_by_id (blockHandle, display.signalIds [BUTTON_PRESS_EVENT], 0, display.closures [BUTTON_PRESS_EVENT_INVERSE], true);
+    OS.g_signal_connect_closure_by_id (blockHandle, display.signalIds [BUTTON_RELEASE_EVENT], 0, display.closures [BUTTON_RELEASE_EVENT_INVERSE], true);
+    OS.g_signal_connect_closure_by_id (blockHandle, display.signalIds [MOTION_NOTIFY_EVENT], 0, display.closures [MOTION_NOTIFY_EVENT_INVERSE], true);
+
+    /* Connect the event_after signal for both key and mouse */
+    OS.g_signal_connect_closure_by_id (eventHandle, display.signalIds [EVENT_AFTER], 0, display.closures [EVENT_AFTER], false);
+    if (focusHandle_ !is eventHandle) {
+        OS.g_signal_connect_closure_by_id (focusHandle_, display.signalIds [EVENT_AFTER], 0, display.closures [EVENT_AFTER], false);
+    }
+
+    /* Connect the paint signal */
+    auto paintHandle = paintHandle ();
+    int paintMask = OS.GDK_EXPOSURE_MASK | OS.GDK_VISIBILITY_NOTIFY_MASK;
+    OS.gtk_widget_add_events (paintHandle, paintMask);
+    OS.g_signal_connect_closure_by_id (paintHandle, display.signalIds [EXPOSE_EVENT], 0, display.closures [EXPOSE_EVENT_INVERSE], false);
+    OS.g_signal_connect_closure_by_id (paintHandle, display.signalIds [VISIBILITY_NOTIFY_EVENT], 0, display.closures [VISIBILITY_NOTIFY_EVENT], false);
+    OS.g_signal_connect_closure_by_id (paintHandle, display.signalIds [EXPOSE_EVENT], 0, display.closures [EXPOSE_EVENT], true);
+
+    /* Connect the Input Method signals */
+    OS.g_signal_connect_closure_by_id (handle, display.signalIds [REALIZE], 0, display.closures [REALIZE], true);
+    OS.g_signal_connect_closure_by_id (handle, display.signalIds [UNREALIZE], 0, display.closures [UNREALIZE], false);
+    auto imHandle = imHandle ();
+    if (imHandle !is null) {
+        OS.g_signal_connect_closure (imHandle, OS.commit.ptr, display.closures [COMMIT], false);
+        OS.g_signal_connect_closure (imHandle, OS.preedit_changed.ptr, display.closures [PREEDIT_CHANGED], false);
+    }
+
+    OS.g_signal_connect_closure_by_id (paintHandle, display.signalIds [STYLE_SET], 0, display.closures [STYLE_SET], false);
+
+    auto topHandle_ = topHandle ();
+    OS.g_signal_connect_closure_by_id (topHandle_, display.signalIds [MAP], 0, display.closures [MAP], true);
+}
+
+override int /*long*/ hoverProc (GtkWidget* widget) {
+    int x, y;
+    int mask;
+    OS.gdk_window_get_pointer (null, &x, &y, &mask);
+    sendMouseEvent (SWT.MouseHover, 0, /*time*/0, x , y , false, mask );
+    /* Always return zero in order to cancel the hover timer */
+    return 0;
+}
+
+override GtkWidget* topHandle() {
+    if (fixedHandle !is null) return fixedHandle;
+    return super.topHandle ();
+}
+
+GtkWidget* paintHandle () {
+    auto topHandle_ = topHandle ();
+    auto paintHandle = handle;
+    while (paintHandle !is topHandle_) {
+        if ((OS.GTK_WIDGET_FLAGS (paintHandle) & OS.GTK_NO_WINDOW) is 0) break;
+        paintHandle = OS.gtk_widget_get_parent (paintHandle);
+    }
+    return paintHandle;
+}
+
+override GdkWindow* paintWindow () {
+    auto paintHandle = paintHandle ();
+    OS.gtk_widget_realize (paintHandle);
+    return OS.GTK_WIDGET_WINDOW (paintHandle);
+}
+
+/**
+ * Prints the receiver and all children.
+ *
+ * @param gc the gc where the drawing occurs
+ * @return <code>true</code> if the operation was successful and <code>false</code> otherwise
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the gc is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the gc has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.4
+ */
+public bool print (GC gc) {
+    checkWidget ();
+    if (gc is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (gc.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+    auto topHandle_ = topHandle ();
+    OS.gtk_widget_realize (topHandle_);
+    auto window = OS.GTK_WIDGET_WINDOW (topHandle_);
+    GCData data = gc.getGCData ();
+    OS.gdk_window_process_updates (window, cast(int)true);
+    printWidget (gc, data.drawable, OS.gdk_drawable_get_depth (data.drawable), 0, 0);
+    return true;
+}
+
+void printWidget (GC gc, GdkDrawable* drawable, int depth, int x, int y) {
+    bool obscured = (state & OBSCURED) !is 0;
+    state &= ~OBSCURED;
+    auto topHandle_ = topHandle ();
+    auto window = OS.GTK_WIDGET_WINDOW (topHandle_);
+    printWindow (true, this, gc.handle, drawable, depth, window, x, y);
+    if (obscured) state |= OBSCURED;
+}
+
+void printWindow (bool first, Control control, GdkGC* gc, GdkDrawable* drawable, int depth, GdkDrawable* window, int x, int y) {
+    if (OS.gdk_drawable_get_depth (window) !is depth) return;
+    GdkRectangle rect;
+    int width, height;
+    OS.gdk_drawable_get_size (window, &width, &height);
+    rect.width = width;
+    rect.height = height;
+    OS.gdk_window_begin_paint_rect (window, &rect);
+    GdkDrawable* real_drawable;
+    int x_offset, y_offset;
+    OS.gdk_window_get_internal_paint_info (window, &real_drawable, &x_offset, &y_offset);
+    void* userData;
+    OS.gdk_window_get_user_data (window, &userData);
+    if (userData !is null) {
+        GdkEventExpose* event = cast(GdkEventExpose*) OS.gdk_event_new (OS.GDK_EXPOSE);
+        event.type = OS.GDK_EXPOSE;
+        event.window = cast(GdkDrawable*)OS.g_object_ref (window);
+        event.area.width = rect.width;
+        event.area.height = rect.height;
+        event.region = OS.gdk_region_rectangle (&rect);
+        OS.gtk_widget_send_expose (userData, cast(GdkEvent*)event);
+        OS.gdk_event_free (cast(GdkEvent*)event);
+    }
+    int srcX = x_offset, srcY = y_offset;
+    int destX = x, destY = y, destWidth = width, destHeight = height;
+    if (!first) {
+        int cX, cY;
+        OS.gdk_window_get_position (window, &cX, &cY);
+        auto parentWindow = OS.gdk_window_get_parent (window);
+        int pW, pH;
+        OS.gdk_drawable_get_size (parentWindow, &pW, &pH);
+        srcX = x_offset - cX;
+        srcY = y_offset - cY;
+        destX = x - cX;
+        destY = y - cY;
+        destWidth = Math.min (cX + width, pW);
+        destHeight = Math.min (cY + height, pH);
+    }
+    OS.gdk_draw_drawable (drawable, gc, real_drawable, srcX, srcY, destX, destY, destWidth, destHeight);
+    OS.gdk_window_end_paint (window);
+    auto children = OS.gdk_window_get_children (window);
+    if (children !is null) {
+        auto windows = children;
+        while (windows !is null) {
+            auto child = cast(GdkDrawable*) OS.g_list_data (windows);
+            if (OS.gdk_window_is_visible (child)) {
+                void* data;
+                OS.gdk_window_get_user_data (child, &data);
+                if (data !is null) {
+                    Widget widget = display.findWidget ( cast(GtkWidget*) data);
+                    if (widget is null || widget is control) {
+                        int x_pos, y_pos;
+                        OS.gdk_window_get_position (child, &x_pos, &y_pos);
+                        printWindow (false, control, gc, drawable, depth, child, x + x_pos, y + y_pos);
+                    }
+                }
+            }
+            windows = OS.g_list_next (windows);
+        }
+        OS.g_list_free (children);
+    }
+}
+
+/**
+ * Returns the preferred size of the receiver.
+ * <p>
+ * The <em>preferred size</em> of a control is the size that it would
+ * best be displayed at. The width hint and height hint arguments
+ * allow the caller to ask a control questions such as "Given a particular
+ * width, how high does the control need to be to show all of the contents?"
+ * To indicate that the caller does not wish to constrain a particular
+ * dimension, the constant <code>SWT.DEFAULT</code> is passed for the hint.
+ * </p>
+ *
+ * @param wHint the width hint (can be <code>SWT.DEFAULT</code>)
+ * @param hHint the height hint (can be <code>SWT.DEFAULT</code>)
+ * @return the preferred size of the control
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Layout
+ * @see #getBorderWidth
+ * @see #getBounds
+ * @see #getSize
+ * @see #pack(bool)
+ * @see "computeTrim, getClientArea for controls that implement them"
+ */
+public Point computeSize (int wHint, int hHint) {
+    return computeSize (wHint, hHint, true);
+}
+
+Control computeTabGroup () {
+    if (isTabGroup()) return this;
+    return parent.computeTabGroup ();
+}
+
+Control[] computeTabList() {
+    if (isTabGroup()) {
+        if (getVisible() && getEnabled()) {
+            return [this];
+        }
+    }
+    return new Control[0];
+}
+
+Control computeTabRoot () {
+    Control[] tabList = parent._getTabList();
+    if (tabList !is null) {
+        int index = 0;
+        while (index < tabList.length) {
+            if (tabList [index] is this) break;
+            index++;
+        }
+        if (index is tabList.length) {
+            if (isTabGroup ()) return this;
+        }
+    }
+    return parent.computeTabRoot ();
+}
+
+void checkBuffered () {
+    style |= SWT.DOUBLE_BUFFERED;
+}
+
+void checkBackground () {
+    Shell shell = getShell ();
+    if (this is shell) return;
+    state &= ~PARENT_BACKGROUND;
+    Composite composite = parent;
+    do {
+        int mode = composite.backgroundMode;
+        if (mode !is SWT.INHERIT_NONE) {
+            if (mode is SWT.INHERIT_DEFAULT) {
+                Control control = this;
+                do {
+                    if ((control.state & THEME_BACKGROUND) is 0) {
+                        return;
+                    }
+                    control = control.parent;
+                } while (control !is composite);
+            }
+            state |= PARENT_BACKGROUND;
+            return;
+        }
+        if (composite is shell) break;
+        composite = composite.parent;
+    } while (true);
+}
+
+void checkBorder () {
+    if (getBorderWidth () is 0) style &= ~SWT.BORDER;
+}
+
+void checkMirrored () {
+    if ((style & SWT.RIGHT_TO_LEFT) !is 0) style |= SWT.MIRRORED;
+}
+
+GtkStyle* childStyle () {
+    return parent.childStyle ();
+}
+
+override void createWidget (int index) {
+    state |= DRAG_DETECT;
+    checkOrientation (parent);
+    super.createWidget (index);
+    checkBackground ();
+    if ((state & PARENT_BACKGROUND) !is 0) setBackground ();
+    checkBuffered ();
+    showWidget ();
+    setInitialBounds ();
+    setZOrder (null, false, false);
+    setRelations ();
+    checkMirrored ();
+    checkBorder ();
+}
+
+/**
+ * Returns the preferred size of the receiver.
+ * <p>
+ * The <em>preferred size</em> of a control is the size that it would
+ * best be displayed at. The width hint and height hint arguments
+ * allow the caller to ask a control questions such as "Given a particular
+ * width, how high does the control need to be to show all of the contents?"
+ * To indicate that the caller does not wish to constrain a particular
+ * dimension, the constant <code>SWT.DEFAULT</code> is passed for the hint.
+ * </p><p>
+ * If the changed flag is <code>true</code>, it indicates that the receiver's
+ * <em>contents</em> have changed, therefore any caches that a layout manager
+ * containing the control may have been keeping need to be flushed. When the
+ * control is resized, the changed flag will be <code>false</code>, so layout
+ * manager caches can be retained.
+ * </p>
+ *
+ * @param wHint the width hint (can be <code>SWT.DEFAULT</code>)
+ * @param hHint the height hint (can be <code>SWT.DEFAULT</code>)
+ * @param changed <code>true</code> if the control's contents have changed, and <code>false</code> otherwise
+ * @return the preferred size of the control.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Layout
+ * @see #getBorderWidth
+ * @see #getBounds
+ * @see #getSize
+ * @see #pack(bool)
+ * @see "computeTrim, getClientArea for controls that implement them"
+ */
+public Point computeSize (int wHint, int hHint, bool changed) {
+    checkWidget();
+    if (wHint !is SWT.DEFAULT && wHint < 0) wHint = 0;
+    if (hHint !is SWT.DEFAULT && hHint < 0) hHint = 0;
+    return computeNativeSize (handle, wHint, hHint, changed);
+}
+
+Point computeNativeSize (GtkWidget* h, int wHint, int hHint, bool changed) {
+    int width = wHint, height = hHint;
+    if (wHint is SWT.DEFAULT && hHint is SWT.DEFAULT) {
+        GtkRequisition requisition;
+        gtk_widget_size_request (h, &requisition);
+        width = OS.GTK_WIDGET_REQUISITION_WIDTH (h);
+        height = OS.GTK_WIDGET_REQUISITION_HEIGHT (h);
+    } else if (wHint is SWT.DEFAULT || hHint is SWT.DEFAULT) {
+        int reqWidth, reqHeight;
+        OS.gtk_widget_get_size_request (h, &reqWidth, &reqHeight);
+        OS.gtk_widget_set_size_request (h, wHint, hHint);
+        GtkRequisition requisition;
+        gtk_widget_size_request (h, &requisition);
+        OS.gtk_widget_set_size_request (h, reqWidth, reqHeight);
+        width = wHint is SWT.DEFAULT ? requisition.width : wHint;
+        height = hHint is SWT.DEFAULT ? requisition.height : hHint;
+    }
+    return new Point (width, height);
+}
+
+void forceResize () {
+    /*
+    * Force size allocation on all children of this widget's
+    * topHandle.  Note that all calls to gtk_widget_size_allocate()
+    * must be preceded by a call to gtk_widget_size_request().
+    */
+    auto topHandle_ = topHandle ();
+    GtkRequisition requisition;
+    gtk_widget_size_request (topHandle_, &requisition);
+    GtkAllocation allocation;
+    allocation.x = OS.GTK_WIDGET_X (topHandle_);
+    allocation.y = OS.GTK_WIDGET_Y (topHandle_);
+    allocation.width = OS.GTK_WIDGET_WIDTH (topHandle_);
+    allocation.height = OS.GTK_WIDGET_HEIGHT (topHandle_);
+    OS.gtk_widget_size_allocate (topHandle_, &allocation);
+}
+
+/**
+ * Returns the accessible object for the receiver.
+ * If this is the first time this object is requested,
+ * then the object is created and returned.
+ *
+ * @return the accessible object
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Accessible#addAccessibleListener
+ * @see Accessible#addAccessibleControlListener
+ *
+ * @since 2.0
+ */
+public Accessible getAccessible () {
+    checkWidget ();
+    if (accessible is null) {
+        accessible = Accessible.internal_new_Accessible (this);
+    }
+    return accessible;
+}
+
+/**
+ * Returns a rectangle describing the receiver's size and location
+ * relative to its parent (or its display if its parent is null),
+ * unless the receiver is a shell. In this case, the location is
+ * relative to the display.
+ *
+ * @return the receiver's bounding rectangle
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Rectangle getBounds () {
+    checkWidget();
+    auto topHandle_ = topHandle ();
+    int x = OS.GTK_WIDGET_X (topHandle_);
+    int y = OS.GTK_WIDGET_Y (topHandle_);
+    int width = (state & ZERO_WIDTH) !is 0 ? 0 : OS.GTK_WIDGET_WIDTH (topHandle_);
+    int height = (state & ZERO_HEIGHT) !is 0 ? 0 : OS.GTK_WIDGET_HEIGHT (topHandle_);
+    if ((parent.style & SWT.MIRRORED) !is 0) x = parent.getClientWidth () - width - x;
+    return new Rectangle (x, y, width, height);
+}
+
+/**
+ * Sets the receiver's size and location to the rectangular
+ * area specified by the argument. The <code>x</code> and
+ * <code>y</code> fields of the rectangle are relative to
+ * the receiver's parent (or its display if its parent is null).
+ * <p>
+ * Note: Attempting to set the width or height of the
+ * receiver to a negative number will cause that
+ * value to be set to zero instead.
+ * </p>
+ *
+ * @param rect the new bounds for the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setBounds (Rectangle rect) {
+    checkWidget ();
+    if (rect is null) error (SWT.ERROR_NULL_ARGUMENT);
+    setBounds (rect.x, rect.y, Math.max (0, rect.width), Math.max (0, rect.height), true, true);
+}
+
+/**
+ * Sets the receiver's size and location to the rectangular
+ * area specified by the arguments. The <code>x</code> and
+ * <code>y</code> arguments are relative to the receiver's
+ * parent (or its display if its parent is null), unless
+ * the receiver is a shell. In this case, the <code>x</code>
+ * and <code>y</code> arguments are relative to the display.
+ * <p>
+ * Note: Attempting to set the width or height of the
+ * receiver to a negative number will cause that
+ * value to be set to zero instead.
+ * </p>
+ *
+ * @param x the new x coordinate for the receiver
+ * @param y the new y coordinate for the receiver
+ * @param width the new width for the receiver
+ * @param height the new height for the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setBounds (int x, int y, int width, int height) {
+    checkWidget();
+    setBounds (x, y, Math.max (0, width), Math.max (0, height), true, true);
+}
+
+void markLayout (bool changed, bool all) {
+    /* Do nothing */
+}
+
+override void modifyStyle (GtkWidget* handle, GtkRcStyle* style) {
+    super.modifyStyle(handle, style);
+    /*
+    * Bug in GTK.  When changing the style of a control that
+    * has had a region set on it, the region is lost.  The
+    * fix is to set the region again.
+    */
+    if (region !is null) OS.gdk_window_shape_combine_region (OS.GTK_WIDGET_WINDOW (topHandle ()), region.handle, 0, 0);
+}
+
+void moveHandle (int x, int y) {
+    auto topHandle_ = topHandle ();
+    auto parentHandle = parent.parentingHandle ();
+    /*
+    * Feature in GTK.  Calling gtk_fixed_move() to move a child causes
+    * the whole parent to redraw.  This is a performance problem. The
+    * fix is temporarily make the parent not visible during the move.
+    *
+    * NOTE: Because every widget in SWT has an X window, the new and
+    * old bounds of the child are correctly redrawn.
+    */
+    int flags = OS.GTK_WIDGET_FLAGS (parentHandle);
+    OS.GTK_WIDGET_UNSET_FLAGS (parentHandle, OS.GTK_VISIBLE);
+    OS.gtk_fixed_move (cast(GtkFixed*)parentHandle, topHandle_, x, y);
+    if ((flags & OS.GTK_VISIBLE) !is 0) {
+        OS.GTK_WIDGET_SET_FLAGS (parentHandle, OS.GTK_VISIBLE);
+    }
+}
+
+void resizeHandle (int width, int height) {
+    auto topHandle_ = topHandle ();
+    OS.gtk_widget_set_size_request (topHandle_, width, height);
+    if (topHandle_ !is handle) OS.gtk_widget_set_size_request (handle, width, height);
+}
+
+int setBounds (int x, int y, int width, int height, bool move, bool resize) {
+    auto topHandle_ = topHandle ();
+    bool sendMove = move;
+    if ((parent.style & SWT.MIRRORED) !is 0) {
+        int clientWidth = parent.getClientWidth ();
+        int oldWidth = (state & ZERO_WIDTH) !is 0 ? 0 : OS.GTK_WIDGET_WIDTH (topHandle_);
+        int oldX = clientWidth - oldWidth - OS.GTK_WIDGET_X (topHandle_);
+        if (move) {
+            sendMove &= x !is oldX;
+            x = clientWidth - (resize ? width : oldWidth) - x;
+        } else {
+            move = true;
+            x = clientWidth - (resize ? width : oldWidth) - oldX;
+            y = OS.GTK_WIDGET_Y (topHandle_);
+        }
+    }
+    bool sameOrigin = true, sameExtent = true;
+    if (move) {
+        int oldX = OS.GTK_WIDGET_X (topHandle_);
+        int oldY = OS.GTK_WIDGET_Y (topHandle_);
+        sameOrigin = x is oldX && y is oldY;
+        if (!sameOrigin) {
+            if (enableWindow !is null) {
+                OS.gdk_window_move (enableWindow, x, y);
+            }
+            moveHandle (x, y);
+        }
+    }
+    int clientWidth = 0;
+    if (resize) {
+        int oldWidth = (state & ZERO_WIDTH) !is 0 ? 0 : OS.GTK_WIDGET_WIDTH (topHandle_);
+        int oldHeight = (state & ZERO_HEIGHT) !is 0 ? 0 : OS.GTK_WIDGET_HEIGHT (topHandle_);
+        sameExtent = width is oldWidth && height is oldHeight;
+        if (!sameExtent && (style & SWT.MIRRORED) !is 0) clientWidth = getClientWidth ();
+        if (!sameExtent && !(width is 0 && height is 0)) {
+            int newWidth = Math.max (1, width);
+            int newHeight = Math.max (1, height);
+            if (redrawWindow !is null) {
+                OS.gdk_window_resize (redrawWindow, newWidth, newHeight);
+            }
+            if (enableWindow !is null) {
+                OS.gdk_window_resize (enableWindow, newWidth, newHeight);
+            }
+            resizeHandle (newWidth, newHeight);
+        }
+    }
+    if (!sameOrigin || !sameExtent) {
+        /*
+        * Cause a size allocation this widget's topHandle.  Note that
+        * all calls to gtk_widget_size_allocate() must be preceded by
+        * a call to gtk_widget_size_request().
+        */
+        GtkRequisition requisition;
+        gtk_widget_size_request (topHandle_, &requisition);
+        GtkAllocation allocation;
+        if (move) {
+            allocation.x = x;
+            allocation.y = y;
+        } else {
+            allocation.x = OS.GTK_WIDGET_X (topHandle_);
+            allocation.y = OS.GTK_WIDGET_Y (topHandle_);
+        }
+        if (resize) {
+            allocation.width = width;
+            allocation.height = height;
+        } else {
+            allocation.width = OS.GTK_WIDGET_WIDTH (topHandle_);
+            allocation.height = OS.GTK_WIDGET_HEIGHT (topHandle_);
+        }
+        OS.gtk_widget_size_allocate (topHandle_, &allocation);
+    }
+    /*
+    * Bug in GTK.  Widgets cannot be sized smaller than 1x1.
+    * The fix is to hide zero-sized widgets and show them again
+    * when they are resized larger.
+    */
+    if (!sameExtent) {
+        state = (width is 0) ? state | ZERO_WIDTH : state & ~ZERO_WIDTH;
+        state = (height is 0) ? state | ZERO_HEIGHT : state & ~ZERO_HEIGHT;
+        if ((state & (ZERO_WIDTH | ZERO_HEIGHT)) !is 0) {
+            if (enableWindow !is null) {
+                OS.gdk_window_hide (enableWindow);
+            }
+            OS.gtk_widget_hide (topHandle_);
+        } else {
+            if ((state & HIDDEN) is 0) {
+                if (enableWindow !is null) {
+                    OS.gdk_window_show_unraised (enableWindow);
+                }
+                OS.gtk_widget_show (topHandle_);
+            }
+        }
+        if ((style & SWT.MIRRORED) !is 0) moveChildren (clientWidth);
+    }
+    int result = 0;
+    if (move && !sameOrigin) {
+        Control control = findBackgroundControl ();
+        if (control !is null && control.backgroundImage !is null) {
+            if (isVisible ()) redrawWidget (0, 0, 0, 0, true, true, true);
+        }
+        if (sendMove) sendEvent (SWT.Move);
+        result |= MOVED;
+    }
+    if (resize && !sameExtent) {
+        sendEvent (SWT.Resize);
+        result |= RESIZED;
+    }
+    return result;
+}
+
+/**
+ * Returns a point describing the receiver's location relative
+ * to its parent (or its display if its parent is null), unless
+ * the receiver is a shell. In this case, the point is
+ * relative to the display.
+ *
+ * @return the receiver's location
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Point getLocation () {
+    checkWidget();
+    auto topHandle_ = topHandle ();
+    int x = OS.GTK_WIDGET_X (topHandle_);
+    int y = OS.GTK_WIDGET_Y (topHandle_);
+    if ((parent.style & SWT.MIRRORED) !is 0) {
+        int width = (state & ZERO_WIDTH) !is 0 ? 0 : OS.GTK_WIDGET_WIDTH (topHandle_);
+        x = parent.getClientWidth () - width - x;
+    }
+    return new Point (x, y);
+}
+
+/**
+ * Sets the receiver's location to the point specified by
+ * the arguments which are relative to the receiver's
+ * parent (or its display if its parent is null), unless
+ * the receiver is a shell. In this case, the point is
+ * relative to the display.
+ *
+ * @param location the new location for the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setLocation (Point location) {
+    checkWidget ();
+    if (location is null) error (SWT.ERROR_NULL_ARGUMENT);
+    setBounds (location.x, location.y, 0, 0, true, false);
+}
+
+/**
+ * Sets the receiver's location to the point specified by
+ * the arguments which are relative to the receiver's
+ * parent (or its display if its parent is null), unless
+ * the receiver is a shell. In this case, the point is
+ * relative to the display.
+ *
+ * @param x the new x coordinate for the receiver
+ * @param y the new y coordinate for the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setLocation(int x, int y) {
+    checkWidget();
+    setBounds (x, y, 0, 0, true, false);
+}
+
+/**
+ * Returns a point describing the receiver's size. The
+ * x coordinate of the result is the width of the receiver.
+ * The y coordinate of the result is the height of the
+ * receiver.
+ *
+ * @return the receiver's size
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Point getSize () {
+    checkWidget();
+    auto topHandle_ = topHandle ();
+    int width = (state & ZERO_WIDTH) !is 0 ? 0 : OS.GTK_WIDGET_WIDTH (topHandle_);
+    int height = (state & ZERO_HEIGHT) !is 0 ? 0 : OS.GTK_WIDGET_HEIGHT (topHandle_);
+    return new Point (width, height);
+}
+
+/**
+ * Sets the receiver's size to the point specified by the argument.
+ * <p>
+ * Note: Attempting to set the width or height of the
+ * receiver to a negative number will cause them to be
+ * set to zero instead.
+ * </p>
+ *
+ * @param size the new size for the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSize (Point size) {
+    checkWidget ();
+    if (size is null) error (SWT.ERROR_NULL_ARGUMENT);
+    setBounds (0, 0, Math.max (0, size.x), Math.max (0, size.y), false, true);
+}
+
+/**
+ * Sets the shape of the control to the region specified
+ * by the argument.  When the argument is null, the
+ * default shape of the control is restored.
+ *
+ * @param region the region that defines the shape of the control (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the region has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.4
+ */
+public void setRegion (Region region) {
+    checkWidget ();
+    if (region !is null && region.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
+    auto window = OS.GTK_WIDGET_WINDOW (topHandle ());
+    auto shape_region = (region is null) ? null : region.handle;
+    OS.gdk_window_shape_combine_region (window, shape_region, 0, 0);
+    this.region = region;
+}
+
+void setRelations () {
+    auto parentHandle = parent.parentingHandle ();
+    auto list = OS.gtk_container_get_children (cast(GtkContainer*)parentHandle);
+    if (list is null) return;
+    int count = OS.g_list_length (list);
+    if (count > 1) {
+        /*
+         * the receiver is the last item in the list, so its predecessor will
+         * be the second-last item in the list
+         */
+        auto handle = cast(GtkWidget*) OS.g_list_nth_data (list, count - 2);
+        if (handle !is null) {
+            Widget widget = display.getWidget (handle);
+            if (widget !is null && widget !is this) {
+                if (auto sibling = cast(Control)widget ) {
+                    sibling.addRelation (this);
+                }
+            }
+        }
+    }
+    OS.g_list_free (list);
+}
+
+/**
+ * Sets the receiver's size to the point specified by the arguments.
+ * <p>
+ * Note: Attempting to set the width or height of the
+ * receiver to a negative number will cause that
+ * value to be set to zero instead.
+ * </p>
+ *
+ * @param width the new width for the receiver
+ * @param height the new height for the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSize (int width, int height) {
+    checkWidget();
+    setBounds (0, 0, Math.max (0, width), Math.max (0, height), false, true);
+}
+
+/*
+ * Answers a bool indicating whether a Label that precedes the receiver in
+ * a layout should be read by screen readers as the recevier's label.
+ */
+bool isDescribedByLabel () {
+    return true;
+}
+
+bool isFocusHandle (GtkWidget* widget) {
+    return widget is focusHandle ();
+}
+
+/**
+ * Moves the receiver above the specified control in the
+ * drawing order. If the argument is null, then the receiver
+ * is moved to the top of the drawing order. The control at
+ * the top of the drawing order will not be covered by other
+ * controls even if they occupy intersecting areas.
+ *
+ * @param control the sibling control (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the control has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Control#moveBelow
+ * @see Composite#getChildren
+ */
+public void moveAbove (Control control) {
+    checkWidget();
+    if (control !is null) {
+        if (control.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+        if (parent !is control.parent) return;
+    }
+    setZOrder (control, true, true);
+}
+
+/**
+ * Moves the receiver below the specified control in the
+ * drawing order. If the argument is null, then the receiver
+ * is moved to the bottom of the drawing order. The control at
+ * the bottom of the drawing order will be covered by all other
+ * controls which occupy intersecting areas.
+ *
+ * @param control the sibling control (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the control has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Control#moveAbove
+ * @see Composite#getChildren
+ */
+public void moveBelow (Control control) {
+    checkWidget();
+    if (control !is null) {
+        if (control.isDisposed ()) error(SWT.ERROR_INVALID_ARGUMENT);
+        if (parent !is control.parent) return;
+    }
+    setZOrder (control, false, true);
+}
+
+void moveChildren (int oldWidth) {
+}
+
+/**
+ * Causes the receiver to be resized to its preferred size.
+ * For a composite, this involves computing the preferred size
+ * from its layout, if there is one.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #computeSize(int, int, bool)
+ */
+public void pack () {
+    pack (true);
+}
+
+/**
+ * Causes the receiver to be resized to its preferred size.
+ * For a composite, this involves computing the preferred size
+ * from its layout, if there is one.
+ * <p>
+ * If the changed flag is <code>true</code>, it indicates that the receiver's
+ * <em>contents</em> have changed, therefore any caches that a layout manager
+ * containing the control may have been keeping need to be flushed. When the
+ * control is resized, the changed flag will be <code>false</code>, so layout
+ * manager caches can be retained.
+ * </p>
+ *
+ * @param changed whether or not the receiver's contents have changed
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #computeSize(int, int, bool)
+ */
+public void pack (bool changed) {
+    setSize (computeSize (SWT.DEFAULT, SWT.DEFAULT, changed));
+}
+
+/**
+ * Sets the layout data associated with the receiver to the argument.
+ *
+ * @param layoutData the new layout data for the receiver.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setLayoutData (Object layoutData) {
+    checkWidget();
+    this.layoutData = layoutData;
+}
+
+/**
+ * Returns a point which is the result of converting the
+ * argument, which is specified in display relative coordinates,
+ * to coordinates relative to the receiver.
+ * <p>
+ * @param x the x coordinate to be translated
+ * @param y the y coordinate to be translated
+ * @return the translated coordinates
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.1
+ */
+public Point toControl (int x, int y) {
+    checkWidget ();
+    auto window = eventWindow ();
+    int origin_x, origin_y;
+    OS.gdk_window_get_origin (window, &origin_x, &origin_y);
+    x -= origin_x ;
+    y -= origin_y ;
+    if ((style & SWT.MIRRORED) !is 0) x = getClientWidth () - x;
+    return new Point (x, y);
+}
+
+/**
+ * Returns a point which is the result of converting the
+ * argument, which is specified in display relative coordinates,
+ * to coordinates relative to the receiver.
+ * <p>
+ * @param point the point to be translated (must not be null)
+ * @return the translated coordinates
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Point toControl (Point point) {
+    checkWidget ();
+    if (point is null) error (SWT.ERROR_NULL_ARGUMENT);
+    return toControl (point.x, point.y);
+}
+
+/**
+ * Returns a point which is the result of converting the
+ * argument, which is specified in coordinates relative to
+ * the receiver, to display relative coordinates.
+ * <p>
+ * @param x the x coordinate to be translated
+ * @param y the y coordinate to be translated
+ * @return the translated coordinates
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.1
+ */
+public Point toDisplay (int x, int y) {
+    checkWidget();
+    auto window = eventWindow ();
+    int origin_x, origin_y;
+    OS.gdk_window_get_origin (window, &origin_x, &origin_y);
+    if ((style & SWT.MIRRORED) !is 0) x = getClientWidth () - x;
+    x += origin_x ;
+    y += origin_y ;
+    return new Point (x, y);
+}
+
+/**
+ * Returns a point which is the result of converting the
+ * argument, which is specified in coordinates relative to
+ * the receiver, to display relative coordinates.
+ * <p>
+ * @param point the point to be translated (must not be null)
+ * @return the translated coordinates
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Point toDisplay (Point point) {
+    checkWidget();
+    if (point is null) error (SWT.ERROR_NULL_ARGUMENT);
+    return toDisplay (point.x, point.y);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the control is moved or resized, by sending
+ * it one of the messages defined in the <code>ControlListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ControlListener
+ * @see #removeControlListener
+ */
+public void addControlListener(ControlListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Resize,typedListener);
+    addListener (SWT.Move,typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when a drag gesture occurs, by sending it
+ * one of the messages defined in the <code>DragDetectListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see DragDetectListener
+ * @see #removeDragDetectListener
+ *
+ * @since 3.3
+ */
+public void addDragDetectListener (DragDetectListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.DragDetect,typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the control gains or loses focus, by sending
+ * it one of the messages defined in the <code>FocusListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see FocusListener
+ * @see #removeFocusListener
+ */
+public void addFocusListener(FocusListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener(SWT.FocusIn,typedListener);
+    addListener(SWT.FocusOut,typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when help events are generated for the control,
+ * by sending it one of the messages defined in the
+ * <code>HelpListener</code> interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see HelpListener
+ * @see #removeHelpListener
+ */
+public void addHelpListener (HelpListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Help, typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when keys are pressed and released on the system keyboard, by sending
+ * it one of the messages defined in the <code>KeyListener</code>
+ * interface.
+ * <p>
+ * When a key listener is added to a control, the control
+ * will take part in widget traversal.  By default, all
+ * traversal keys (such as the tab key and so on) are
+ * delivered to the control.  In order for a control to take
+ * part in traversal, it should listen for traversal events.
+ * Otherwise, the user can traverse into a control but not
+ * out.  Note that native controls such as table and tree
+ * implement key traversal in the operating system.  It is
+ * not necessary to add traversal listeners for these controls,
+ * unless you want to override the default traversal.
+ * </p>
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see KeyListener
+ * @see #removeKeyListener
+ */
+public void addKeyListener(KeyListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener(SWT.KeyUp,typedListener);
+    addListener(SWT.KeyDown,typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the platform-specific context menu trigger
+ * has occurred, by sending it one of the messages defined in
+ * the <code>MenuDetectListener</code> interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see MenuDetectListener
+ * @see #removeMenuDetectListener
+ *
+ * @since 3.3
+ */
+public void addMenuDetectListener (MenuDetectListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.MenuDetect, typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when mouse buttons are pressed and released, by sending
+ * it one of the messages defined in the <code>MouseListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see MouseListener
+ * @see #removeMouseListener
+ */
+public void addMouseListener(MouseListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener(SWT.MouseDown,typedListener);
+    addListener(SWT.MouseUp,typedListener);
+    addListener(SWT.MouseDoubleClick,typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the mouse moves, by sending it one of the
+ * messages defined in the <code>MouseMoveListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see MouseMoveListener
+ * @see #removeMouseMoveListener
+ */
+public void addMouseMoveListener(MouseMoveListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener(SWT.MouseMove,typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the mouse passes or hovers over controls, by sending
+ * it one of the messages defined in the <code>MouseTrackListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see MouseTrackListener
+ * @see #removeMouseTrackListener
+ */
+public void addMouseTrackListener (MouseTrackListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.MouseEnter,typedListener);
+    addListener (SWT.MouseExit,typedListener);
+    addListener (SWT.MouseHover,typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the mouse wheel is scrolled, by sending
+ * it one of the messages defined in the
+ * <code>MouseWheelListener</code> interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see MouseWheelListener
+ * @see #removeMouseWheelListener
+ *
+ * @since 3.3
+ */
+public void addMouseWheelListener (MouseWheelListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.MouseWheel, typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the receiver needs to be painted, by sending it
+ * one of the messages defined in the <code>PaintListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see PaintListener
+ * @see #removePaintListener
+ */
+public void addPaintListener(PaintListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener(SWT.Paint,typedListener);
+}
+
+void addRelation (Control control) {
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when traversal events occur, by sending it
+ * one of the messages defined in the <code>TraverseListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see TraverseListener
+ * @see #removeTraverseListener
+ */
+public void addTraverseListener (TraverseListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Traverse,typedListener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is moved or resized.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ControlListener
+ * @see #addControlListener
+ */
+public void removeControlListener (ControlListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Move, listener);
+    eventTable.unhook (SWT.Resize, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when a drag gesture occurs.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see DragDetectListener
+ * @see #addDragDetectListener
+ *
+ * @since 3.3
+ */
+public void removeDragDetectListener(DragDetectListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.DragDetect, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control gains or loses focus.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see FocusListener
+ * @see #addFocusListener
+ */
+public void removeFocusListener(FocusListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.FocusIn, listener);
+    eventTable.unhook (SWT.FocusOut, listener);
+}
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the help events are generated for the control.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see HelpListener
+ * @see #addHelpListener
+ */
+public void removeHelpListener (HelpListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Help, listener);
+}
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when keys are pressed and released on the system keyboard.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see KeyListener
+ * @see #addKeyListener
+ */
+public void removeKeyListener(KeyListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.KeyUp, listener);
+    eventTable.unhook (SWT.KeyDown, listener);
+}
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the platform-specific context menu trigger has
+ * occurred.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see MenuDetectListener
+ * @see #addMenuDetectListener
+ *
+ * @since 3.3
+ */
+public void removeMenuDetectListener (MenuDetectListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.MenuDetect, listener);
+}
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when mouse buttons are pressed and released.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see MouseListener
+ * @see #addMouseListener
+ */
+public void removeMouseListener (MouseListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.MouseDown, listener);
+    eventTable.unhook (SWT.MouseUp, listener);
+    eventTable.unhook (SWT.MouseDoubleClick, listener);
+}
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the mouse moves.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see MouseMoveListener
+ * @see #addMouseMoveListener
+ */
+public void removeMouseMoveListener(MouseMoveListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.MouseMove, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the mouse passes or hovers over controls.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see MouseTrackListener
+ * @see #addMouseTrackListener
+ */
+public void removeMouseTrackListener(MouseTrackListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.MouseEnter, listener);
+    eventTable.unhook (SWT.MouseExit, listener);
+    eventTable.unhook (SWT.MouseHover, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the mouse wheel is scrolled.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see MouseWheelListener
+ * @see #addMouseWheelListener
+ *
+ * @since 3.3
+ */
+public void removeMouseWheelListener (MouseWheelListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.MouseWheel, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the receiver needs to be painted.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see PaintListener
+ * @see #addPaintListener
+ */
+public void removePaintListener(PaintListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook(SWT.Paint, listener);
+}
+
+/*
+ * Remove "Labelled by" relations from the receiver.
+ */
+void removeRelation () {
+    if (!isDescribedByLabel ()) return;     /* there will not be any */
+    auto accessible = OS.gtk_widget_get_accessible (handle);
+    if (accessible is null) return;
+    auto set = ATK.atk_object_ref_relation_set (accessible);
+    int count = ATK.atk_relation_set_get_n_relations (set);
+    for (int i = 0; i < count; i++) {
+        auto relation = ATK.atk_relation_set_get_relation (set, 0);
+        ATK.atk_relation_set_remove (set, relation);
+    }
+    OS.g_object_unref (set);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when traversal events occur.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see TraverseListener
+ * @see #addTraverseListener
+ */
+public void removeTraverseListener(TraverseListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Traverse, listener);
+}
+
+/**
+ * Detects a drag and drop gesture.  This method is used
+ * to detect a drag gesture when called from within a mouse
+ * down listener.
+ *
+ * <p>By default, a drag is detected when the gesture
+ * occurs anywhere within the client area of a control.
+ * Some controls, such as tables and trees, override this
+ * behavior.  In addition to the operating system specific
+ * drag gesture, they require the mouse to be inside an
+ * item.  Custom widget writers can use <code>setDragDetect</code>
+ * to disable the default detection, listen for mouse down,
+ * and then call <code>dragDetect()</code> from within the
+ * listener to conditionally detect a drag.
+ * </p>
+ *
+ * @param event the mouse down event
+ *
+ * @return <code>true</code> if the gesture occurred, and <code>false</code> otherwise.
+ *
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_NULL_ARGUMENT when the event is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see DragDetectListener
+ * @see #addDragDetectListener
+ *
+ * @see #getDragDetect
+ * @see #setDragDetect
+ *
+ * @since 3.3
+ */
+public bool dragDetect (Event event) {
+    checkWidget ();
+    if (event is null) error (SWT.ERROR_NULL_ARGUMENT);
+    return dragDetect (event.button, event.count, event.stateMask, event.x, event.y);
+}
+
+/**
+ * Detects a drag and drop gesture.  This method is used
+ * to detect a drag gesture when called from within a mouse
+ * down listener.
+ *
+ * <p>By default, a drag is detected when the gesture
+ * occurs anywhere within the client area of a control.
+ * Some controls, such as tables and trees, override this
+ * behavior.  In addition to the operating system specific
+ * drag gesture, they require the mouse to be inside an
+ * item.  Custom widget writers can use <code>setDragDetect</code>
+ * to disable the default detection, listen for mouse down,
+ * and then call <code>dragDetect()</code> from within the
+ * listener to conditionally detect a drag.
+ * </p>
+ *
+ * @param event the mouse down event
+ *
+ * @return <code>true</code> if the gesture occurred, and <code>false</code> otherwise.
+ *
+ * @exception IllegalArgumentException <ul>
+ *   <li>ERROR_NULL_ARGUMENT when the event is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see DragDetectListener
+ * @see #addDragDetectListener
+ *
+ * @see #getDragDetect
+ * @see #setDragDetect
+ *
+ * @since 3.3
+ */
+public bool dragDetect (MouseEvent event) {
+    checkWidget ();
+    if (event is null) error (SWT.ERROR_NULL_ARGUMENT);
+    return dragDetect (event.button, event.count, event.stateMask, event.x, event.y);
+}
+
+bool dragDetect (int button, int count, int stateMask, int x, int y) {
+    if (button !is 1 || count !is 1) return false;
+    if (!dragDetect (x, y, false, null)) return false;
+    return sendDragEvent (button, stateMask, x, y, true);
+}
+
+bool dragDetect (int x, int y, bool filter, bool* consume) {
+    bool quit = false, dragging = false;
+    while (!quit) {
+        GdkEvent* eventPtr;
+        while (true) {
+            eventPtr = OS.gdk_event_get ();
+            if (eventPtr !is null) {
+                break;
+            } else {
+                try {Thread.sleep(0.050);} catch (Exception ex) {}
+            }
+        }
+        switch (cast(int)OS.GDK_EVENT_TYPE (eventPtr)) {
+            case OS.GDK_MOTION_NOTIFY: {
+                GdkEventMotion* gdkMotionEvent = cast(GdkEventMotion*)eventPtr;
+                if ((gdkMotionEvent.state & OS.GDK_BUTTON1_MASK) !is 0) {
+                    if (OS.gtk_drag_check_threshold (handle, x, y, cast(int) gdkMotionEvent.x, cast(int) gdkMotionEvent.y)) {
+                        dragging = true;
+                        quit = true;
+                    }
+                } else {
+                    quit = true;
+                }
+                int newX, newY;
+                OS.gdk_window_get_pointer (gdkMotionEvent.window, &newX, &newY, null);
+                break;
+            }
+            case OS.GDK_KEY_PRESS:
+            case OS.GDK_KEY_RELEASE: {
+                GdkEventKey* gdkEvent = cast(GdkEventKey*)eventPtr;
+                if (gdkEvent.keyval is OS.GDK_Escape) quit = true;
+                break;
+            }
+            case OS.GDK_BUTTON_RELEASE:
+            case OS.GDK_BUTTON_PRESS:
+            case OS.GDK_2BUTTON_PRESS:
+            case OS.GDK_3BUTTON_PRESS: {
+                OS.gdk_event_put (eventPtr);
+                quit = true;
+                break;
+            }
+            default:
+                OS.gtk_main_do_event (eventPtr);
+        }
+        OS.gdk_event_free (eventPtr);
+    }
+    return dragging;
+}
+
+bool filterKey (int keyval, GdkEventKey* event) {
+    auto imHandle = imHandle ();
+    if (imHandle !is null) {
+        return cast(bool)OS.gtk_im_context_filter_keypress (imHandle, event);
+    }
+    return false;
+}
+
+Control findBackgroundControl () {
+    if ((state & BACKGROUND) !is 0 || backgroundImage !is null) return this;
+    return (state & PARENT_BACKGROUND) !is 0 ? parent.findBackgroundControl () : null;
+}
+
+Menu [] findMenus (Control control) {
+    if (menu !is null && this !is control) return [menu];
+    return new Menu [0];
+}
+
+void fixChildren (Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu [] menus) {
+    oldShell.fixShell (newShell, this);
+    oldDecorations.fixDecorations (newDecorations, this, menus);
+}
+
+override int /*long*/ fixedMapProc (GtkWidget* widget) {
+    OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_MAPPED);
+    auto widgetList = OS.gtk_container_get_children (cast(GtkContainer*)widget);
+    if (widgetList !is null) {
+        auto widgets = widgetList;
+        while (widgets !is null) {
+            auto child = cast(GtkWidget*)OS.g_list_data (widgets);
+            if (OS.GTK_WIDGET_VISIBLE (child) && OS.gtk_widget_get_child_visible (child) && !OS.GTK_WIDGET_MAPPED (child)) {
+                OS.gtk_widget_map (child);
+            }
+            widgets = cast(GList*)OS.g_list_next (widgets);
+        }
+        OS.g_list_free (widgetList);
+    }
+    if ((OS.GTK_WIDGET_FLAGS (widget) & OS.GTK_NO_WINDOW) is 0) {
+        OS.gdk_window_show_unraised (OS.GTK_WIDGET_WINDOW (widget));
+    }
+    return 0;
+}
+
+void fixModal(GtkWidget* group, GtkWidget* modalGroup) {
+}
+
+/**
+ * Forces the receiver to have the <em>keyboard focus</em>, causing
+ * all keyboard events to be delivered to it.
+ *
+ * @return <code>true</code> if the control got focus, and <code>false</code> if it was unable to.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setFocus
+ */
+public bool forceFocus () {
+    checkWidget();
+    if (display.focusEvent is SWT.FocusOut) return false;
+    Shell shell = getShell ();
+    shell.setSavedFocus (this);
+    if (!isEnabled () || !isVisible ()) return false;
+    shell.bringToTop (false);
+    return forceFocus (focusHandle ());
+}
+
+bool forceFocus (GtkWidget* focusHandle_) {
+    /* When the control is zero sized it must be realized */
+    OS.gtk_widget_realize (focusHandle_);
+    OS.gtk_widget_grab_focus (focusHandle_);
+    Shell shell = getShell ();
+    auto shellHandle = shell.shellHandle;
+    auto handle = OS.gtk_window_get_focus (cast(GtkWindow*)shellHandle);
+    while (handle !is null) {
+        if (handle is focusHandle_) return true;
+        Widget widget = display.getWidget (handle);
+        if (widget !is null && (null !is cast(Control)widget)) {
+            return widget is this;
+        }
+        handle = OS.gtk_widget_get_parent (handle);
+    }
+    return false;
+}
+
+/**
+ * Returns the receiver's background color.
+ *
+ * @return the background color
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Color getBackground () {
+    checkWidget();
+    Control control = findBackgroundControl ();
+    if (control is null) control = this;
+    return Color.gtk_new (display, control.getBackgroundColor ());
+}
+
+GdkColor* getBackgroundColor () {
+    return getBgColor ();
+}
+
+/**
+ * Returns the receiver's background image.
+ *
+ * @return the background image
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public Image getBackgroundImage () {
+    checkWidget ();
+    Control control = findBackgroundControl ();
+    if (control is null) control = this;
+    return control.backgroundImage;
+}
+
+GdkColor* getBgColor () {
+    auto fontHandle_ = fontHandle ();
+    OS.gtk_widget_realize (fontHandle_);
+    GdkColor* color = new GdkColor ();
+    OS.gtk_style_get_bg (OS.gtk_widget_get_style (fontHandle_), OS.GTK_STATE_NORMAL, color);
+    return color;
+}
+
+GdkColor* getBaseColor () {
+    auto fontHandle_ = fontHandle ();
+    OS.gtk_widget_realize (fontHandle_);
+    GdkColor* color = new GdkColor ();
+    OS.gtk_style_get_base (OS.gtk_widget_get_style (fontHandle_), OS.GTK_STATE_NORMAL, color);
+    return color;
+}
+
+/**
+ * Returns the receiver's border width.
+ *
+ * @return the border width
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getBorderWidth () {
+    checkWidget();
+    return 0;
+}
+
+int getClientWidth () {
+    return 0;
+}
+
+/**
+ * Returns the receiver's cursor, or null if it has not been set.
+ * <p>
+ * When the mouse pointer passes over a control its appearance
+ * is changed to match the control's cursor.
+ * </p>
+ *
+ * @return the receiver's cursor or <code>null</code>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.3
+ */
+public Cursor getCursor () {
+    checkWidget ();
+    return cursor;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is detecting
+ * drag gestures, and  <code>false</code> otherwise.
+ *
+ * @return the receiver's drag detect state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.3
+ */
+public bool getDragDetect () {
+    checkWidget ();
+    return (state & DRAG_DETECT) !is 0;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is enabled, and
+ * <code>false</code> otherwise. A disabled control is typically
+ * not selectable from the user interface and draws with an
+ * inactive or "grayed" look.
+ *
+ * @return the receiver's enabled state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #isEnabled
+ */
+public bool getEnabled () {
+    checkWidget ();
+    return (state & DISABLED) is 0;
+}
+
+/**
+ * Returns the font that the receiver will use to paint textual information.
+ *
+ * @return the receiver's font
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Font getFont () {
+    checkWidget();
+    return font !is null ? font : defaultFont ();
+}
+
+PangoFontDescription* getFontDescription () {
+    auto fontHandle_ = fontHandle ();
+    OS.gtk_widget_realize (fontHandle_);
+    return OS.gtk_style_get_font_desc (OS.gtk_widget_get_style (fontHandle_));
+}
+
+/**
+ * Returns the foreground color that the receiver will use to draw.
+ *
+ * @return the receiver's foreground color
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Color getForeground () {
+    checkWidget();
+    return Color.gtk_new (display, getForegroundColor ());
+}
+
+GdkColor* getForegroundColor () {
+    return getFgColor ();
+}
+
+GdkColor* getFgColor () {
+    auto fontHandle_ = fontHandle ();
+    OS.gtk_widget_realize (fontHandle_);
+    GdkColor* color = new GdkColor ();
+    OS.gtk_style_get_fg (OS.gtk_widget_get_style (fontHandle_), OS.GTK_STATE_NORMAL, color);
+    return color;
+}
+
+Point getIMCaretPos () {
+    return new Point (0, 0);
+}
+
+GdkColor* getTextColor () {
+    auto fontHandle_ = fontHandle ();
+    OS.gtk_widget_realize (fontHandle_);
+    GdkColor* color = new GdkColor ();
+    OS.gtk_style_get_text (OS.gtk_widget_get_style (fontHandle_), OS.GTK_STATE_NORMAL, color);
+    return color;
+}
+
+/**
+ * Returns layout data which is associated with the receiver.
+ *
+ * @return the receiver's layout data
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Object getLayoutData () {
+    checkWidget();
+    return layoutData;
+}
+
+/**
+ * Returns the receiver's pop up menu if it has one, or null
+ * if it does not. All controls may optionally have a pop up
+ * menu that is displayed when the user requests one for
+ * the control. The sequence of key strokes, button presses
+ * and/or button releases that are used to request a pop up
+ * menu is platform specific.
+ *
+ * @return the receiver's menu
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Menu getMenu () {
+    checkWidget();
+    return menu;
+}
+
+/**
+ * Returns the receiver's monitor.
+ *
+ * @return the receiver's monitor
+ *
+ * @since 3.0
+ */
+public org.eclipse.swt.widgets.Monitor.Monitor getMonitor () {
+    checkWidget();
+    org.eclipse.swt.widgets.Monitor.Monitor monitor = null;
+    auto screen = OS.gdk_screen_get_default ();
+    if (screen !is null) {
+        int monitorNumber = OS.gdk_screen_get_monitor_at_window (screen, paintWindow ());
+        GdkRectangle dest;
+        OS.gdk_screen_get_monitor_geometry (screen, monitorNumber, &dest);
+        monitor = new org.eclipse.swt.widgets.Monitor.Monitor ();
+        monitor.handle = monitorNumber;
+        monitor.x = dest.x;
+        monitor.y = dest.y;
+        monitor.width = dest.width;
+        monitor.height = dest.height;
+        Rectangle workArea = null;
+        if (monitorNumber is 0) workArea = display.getWorkArea ();
+        if (workArea !is null) {
+            monitor.clientX = workArea.x;
+            monitor.clientY = workArea.y;
+            monitor.clientWidth = workArea.width;
+            monitor.clientHeight = workArea.height;
+        } else {
+            monitor.clientX = monitor.x;
+            monitor.clientY = monitor.y;
+            monitor.clientWidth = monitor.width;
+            monitor.clientHeight = monitor.height;
+        }
+    } else {
+        monitor = display.getPrimaryMonitor ();
+    }
+    return monitor;
+}
+
+/**
+ * Returns the receiver's parent, which must be a <code>Composite</code>
+ * or null when the receiver is a shell that was created with null or
+ * a display for a parent.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Composite getParent () {
+    checkWidget();
+    return parent;
+}
+
+Control [] getPath () {
+    int count = 0;
+    Shell shell = getShell ();
+    Control control = this;
+    while (control !is shell) {
+        count++;
+        control = control.parent;
+    }
+    control = this;
+    Control [] result = new Control [count];
+    while (control !is shell) {
+        result [--count] = control;
+        control = control.parent;
+    }
+    return result;
+}
+
+/**
+ * Returns the region that defines the shape of the control,
+ * or null if the control has the default shape.
+ *
+ * @return the region that defines the shape of the shell (or null)
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.4
+ */
+public Region getRegion () {
+    checkWidget ();
+    return region;
+}
+
+/**
+ * Returns the receiver's shell. For all controls other than
+ * shells, this simply returns the control's nearest ancestor
+ * shell. Shells return themselves, even if they are children
+ * of other shells.
+ *
+ * @return the receiver's shell
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getParent
+ */
+public Shell getShell() {
+    checkWidget();
+    return _getShell();
+}
+
+Shell _getShell() {
+    return parent._getShell();
+}
+
+/**
+ * Returns the receiver's tool tip text, or null if it has
+ * not been set.
+ *
+ * @return the receiver's tool tip text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getToolTipText () {
+    checkWidget();
+    return toolTipText;
+}
+/**
+ * Returns <code>true</code> if the receiver is visible, and
+ * <code>false</code> otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, this method
+ * may still indicate that it is considered visible even though
+ * it may not actually be showing.
+ * </p>
+ *
+ * @return the receiver's visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool getVisible () {
+    checkWidget();
+    return (state & HIDDEN) is 0;
+}
+
+override int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* event) {
+    return gtk_button_press_event (widget, event, true);
+}
+
+int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* gdkEvent, bool sendMouseDown) {
+    if (gdkEvent.type is OS.GDK_3BUTTON_PRESS) return 0;
+
+    /*
+    * When a shell is created with SWT.ON_TOP and SWT.NO_FOCUS,
+    * do not activate the shell when the user clicks on the
+    * the client area or on the border or a control within the
+    * shell that does not take focus.
+    */
+    Shell shell = _getShell ();
+    if (((shell.style & SWT.ON_TOP) !is 0) && (((shell.style & SWT.NO_FOCUS) is 0) || ((style & SWT.NO_FOCUS) is 0))) {
+        shell.forceActive();
+    }
+    int /*long*/ result = 0;
+    if (gdkEvent.type is OS.GDK_BUTTON_PRESS) {
+        display.clickCount = 1;
+        auto nextEvent = OS.gdk_event_peek ();
+        if (nextEvent !is null) {
+            int eventType = OS.GDK_EVENT_TYPE (nextEvent);
+            if (eventType is OS.GDK_2BUTTON_PRESS) display.clickCount = 2;
+            if (eventType is OS.GDK_3BUTTON_PRESS) display.clickCount = 3;
+            OS.gdk_event_free (nextEvent);
+        }
+        bool dragging = false;
+        if ((state & DRAG_DETECT) !is 0 && hooks (SWT.DragDetect)) {
+            if (gdkEvent.button is 1) {
+                bool consume = false;
+                if (dragDetect (cast(int) gdkEvent.x, cast(int) gdkEvent.y, true, &consume)) {
+                    dragging = true;
+                    if (consume ) result = 1;
+                }
+                if (isDisposed ()) return 1;
+            }
+        }
+        if (sendMouseDown && !sendMouseEvent (SWT.MouseDown, gdkEvent.button, display.clickCount, 0, false, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state)) {
+            result = 1;
+        }
+        if (isDisposed ()) return 1;
+        if (dragging) {
+            sendDragEvent (gdkEvent.button, gdkEvent.state, cast(int) gdkEvent.x, cast(int) gdkEvent.y, false);
+            if (isDisposed ()) return 1;
+        }
+        /*
+        * Pop up the context menu in the button press event for widgets
+        * that have default operating system menus in order to stop the
+        * operating system from displaying the menu if necessary.
+        */
+        if ((state & MENU) !is 0) {
+            if (gdkEvent.button is 3) {
+                if (showMenu (cast(int)gdkEvent.x_root, cast(int)gdkEvent.y_root)) {
+                    result = 1;
+                }
+            }
+        }
+    } else {
+        display.clickCount = 2;
+        result = sendMouseEvent (SWT.MouseDoubleClick, gdkEvent.button, display.clickCount, 0, false, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state) ? 0 : 1;
+        if (isDisposed ()) return 1;
+    }
+    if (!shell.isDisposed ()) shell.setActiveControl (this);
+    return result;
+}
+
+override int /*long*/ gtk_button_release_event (GtkWidget* widget, GdkEventButton* gdkEvent) {
+    /*
+    * Feature in GTK.  When button 4, 5, 6, or 7 is released, GTK
+    * does not deliver a corresponding GTK event.  Button 6 and 7
+    * are mapped to buttons 4 and 5 in SWT.  The fix is to change
+    * the button number of the event to a negative number so that
+    * it gets dispatched by GTK.  SWT has been modified to look
+    * for negative button numbers.
+    */
+    int button = gdkEvent.button;
+    switch (button) {
+        case -6: button = 4; break;
+        case -7: button = 5; break;
+        default:
+    }
+    return sendMouseEvent (SWT.MouseUp, button, display.clickCount, 0, false, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state) ? 0 : 1;
+}
+
+override int /*long*/ gtk_commit (GtkIMContext* imcontext, char* text) {
+    char [] chars = fromStringz( text );
+    if (chars.length is 0) return 0;
+    sendIMKeyEvent (SWT.KeyDown, null, chars);
+    return 0;
+}
+
+override int /*long*/ gtk_enter_notify_event (GtkWidget*  widget, GdkEventCrossing* gdkEvent) {
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 12, 0)) {
+        /*
+         * Feature in GTK. Children of a shell will inherit and display the shell's
+         * tooltip if they do not have a tooltip of their own. The fix is to use the
+         * new tooltip API in GTK 2.12 to null the shell's tooltip when the control
+         * being entered does not have any tooltip text set.
+         */
+        char* buffer = null;
+        if (toolTipText !is null && toolTipText.length !is 0) {
+            char [] chars = fixMnemonic (toolTipText, false);
+            buffer = toStringz(chars);
+        }
+        auto toolHandle = getShell().handle;
+        OS.gtk_widget_set_tooltip_text (toolHandle, buffer);
+    }
+    if (display.currentControl is this) return 0;
+    if (gdkEvent.mode !is OS.GDK_CROSSING_NORMAL && gdkEvent.mode !is OS.GDK_CROSSING_UNGRAB) return 0;
+    if ((gdkEvent.state & (OS.GDK_BUTTON1_MASK | OS.GDK_BUTTON2_MASK | OS.GDK_BUTTON3_MASK)) !is 0) return 0;
+    if (display.currentControl !is null && !display.currentControl.isDisposed ()) {
+        display.removeMouseHoverTimeout (display.currentControl.handle);
+        display.currentControl.sendMouseEvent (SWT.MouseExit,  0, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state);
+    }
+    if (!isDisposed ()) {
+        display.currentControl = this;
+        return sendMouseEvent (SWT.MouseEnter, 0, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state) ? 0 : 1;
+    }
+    return 0;
+}
+
+override int /*long*/ gtk_event_after (GtkWidget*  widget, GdkEvent* gdkEvent) {
+    switch (cast(int)gdkEvent.type) {
+        case OS.GDK_BUTTON_PRESS: {
+            if (widget !is eventHandle ()) break;
+            /*
+            * Pop up the context menu in the event_after signal to allow
+            * the widget to process the button press.  This allows widgets
+            * such as GtkTreeView to select items before a menu is shown.
+            */
+            if ((state & MENU) is 0) {
+                GdkEventButton* gdkEventButton = cast(GdkEventButton*)gdkEvent;
+                if (gdkEventButton.button is 3) {
+                    showMenu (cast(int) gdkEventButton.x_root, cast(int) gdkEventButton.y_root);
+                }
+            }
+            break;
+        }
+        case OS.GDK_FOCUS_CHANGE: {
+            if (!isFocusHandle (widget)) break;
+            GdkEventFocus* gdkEventFocus = cast(GdkEventFocus*)gdkEvent;
+
+            /*
+             * Feature in GTK. The GTK combo box popup under some window managers
+             * is implemented as a GTK_MENU.  When it pops up, it causes the combo
+             * box to lose focus when focus is received for the menu.  The
+             * fix is to check the current grab handle and see if it is a GTK_MENU
+             * and ignore the focus event when the menu is both shown and hidden.
+             */
+            Display display = this.display;
+            if (gdkEventFocus.in_ !is 0) {
+                if (display.ignoreFocus) {
+                    display.ignoreFocus = false;
+                    break;
+                }
+            } else {
+                display.ignoreFocus = false;
+                auto grabHandle = OS.gtk_grab_get_current ();
+                if (grabHandle !is null) {
+                    if (OS.G_OBJECT_TYPE ( cast(GTypeInstance*)grabHandle) is OS.GTK_TYPE_MENU ()) {
+                        display.ignoreFocus = true;
+                        break;
+                    }
+                }
+            }
+
+            sendFocusEvent (gdkEventFocus.in_ !is 0 ? SWT.FocusIn : SWT.FocusOut);
+            break;
+        default:
+        }
+    }
+    return 0;
+}
+
+override int /*long*/ gtk_expose_event (GtkWidget*  widget, GdkEventExpose* gdkEvent) {
+    if ((state & OBSCURED) !is 0) return 0;
+    if (!hooks (SWT.Paint) && !filters (SWT.Paint)) return 0;
+    Event event = new Event ();
+    event.count = gdkEvent.count;
+    event.x = gdkEvent.area.x;
+    event.y = gdkEvent.area.y;
+    event.width = gdkEvent.area.width;
+    event.height = gdkEvent.area.height;
+    if ((style & SWT.MIRRORED) !is 0) event.x = getClientWidth () - event.width - event.x;
+    GCData data = new GCData ();
+    data.damageRgn = gdkEvent.region;
+    GC gc = event.gc = GC.gtk_new (this, data);
+    OS.gdk_gc_set_clip_region (gc.handle, gdkEvent.region);
+    sendEvent (SWT.Paint, event);
+    gc.dispose ();
+    event.gc = null;
+    return 0;
+}
+
+override int /*long*/ gtk_focus (GtkWidget* widget, int directionType) {
+    /* Stop GTK traversal for every widget */
+    return 1;
+}
+
+override int /*long*/ gtk_focus_in_event (GtkWidget*  widget, GdkEventFocus* event) {
+    // widget could be disposed at this point
+    if (handle !is null) {
+        Control oldControl = display.imControl;
+        if (oldControl !is this)  {
+            if (oldControl !is null && !oldControl.isDisposed ()) {
+                auto oldIMHandle = oldControl.imHandle ();
+                if (oldIMHandle !is null) OS.gtk_im_context_reset (oldIMHandle);
+            }
+        }
+        if (hooks (SWT.KeyDown) || hooks (SWT.KeyUp)) {
+            auto imHandle = imHandle ();
+            if (imHandle !is null) OS.gtk_im_context_focus_in (imHandle);
+        }
+    }
+    return 0;
+}
+
+override int /*long*/ gtk_focus_out_event (GtkWidget* widget, GdkEventFocus* event) {
+    // widget could be disposed at this point
+    if (handle !is null) {
+        if (hooks (SWT.KeyDown) || hooks (SWT.KeyUp)) {
+            auto imHandle = imHandle ();
+            if (imHandle !is null) {
+                OS.gtk_im_context_focus_out (imHandle);
+            }
+        }
+    }
+    return 0;
+}
+
+override int /*long*/ gtk_key_press_event (GtkWidget*  widget, GdkEventKey* gdkEvent) {
+    if (!hasFocus ()) return 0;
+
+    if (translateMnemonic (gdkEvent.keyval, gdkEvent)) return 1;
+    // widget could be disposed at this point
+    if (isDisposed ()) return 0;
+
+    if (filterKey (gdkEvent.keyval, gdkEvent)) return 1;
+    // widget could be disposed at this point
+    if (isDisposed ()) return 0;
+
+    if (translateTraversal (gdkEvent)) return 1;
+    // widget could be disposed at this point
+    if (isDisposed ()) return 0;
+    return super.gtk_key_press_event (widget, gdkEvent);
+}
+
+override int /*long*/ gtk_key_release_event (GtkWidget*  widget, GdkEventKey* event) {
+    if (!hasFocus ()) return 0;
+    auto imHandle = imHandle ();
+    if (imHandle !is null) {
+        if (OS.gtk_im_context_filter_keypress (imHandle, event)) return 1;
+    }
+    return super.gtk_key_release_event (widget, event);
+}
+
+override int /*long*/ gtk_leave_notify_event (GtkWidget* widget, GdkEventCrossing* gdkEvent) {
+    if (display.currentControl !is this) return 0;
+    display.removeMouseHoverTimeout (handle);
+    int result = 0;
+    if (sendLeaveNotify () || display.getCursorControl () is null) {
+        if (gdkEvent.mode !is OS.GDK_CROSSING_NORMAL && gdkEvent.mode !is OS.GDK_CROSSING_UNGRAB) return 0;
+        if ((gdkEvent.state & (OS.GDK_BUTTON1_MASK | OS.GDK_BUTTON2_MASK | OS.GDK_BUTTON3_MASK)) !is 0) return 0;
+        result = sendMouseEvent (SWT.MouseExit, 0, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state) ? 0 : 1;
+        display.currentControl = null;
+    }
+    return result;
+}
+
+override int /*long*/ gtk_mnemonic_activate (GtkWidget* widget, int /*long*/ arg1) {
+    int result = 0;
+    auto eventPtr = OS.gtk_get_current_event ();
+    if (eventPtr !is null) {
+        GdkEventKey* keyEvent = cast(GdkEventKey*)eventPtr;
+        if (keyEvent.type is OS.GDK_KEY_PRESS) {
+            Control focusControl = display.getFocusControl ();
+            auto focusHandle_ = focusControl !is null ? focusControl.focusHandle () : null;
+            if (focusHandle_ !is null) {
+                display.mnemonicControl = this;
+                OS.gtk_widget_event (focusHandle_, eventPtr);
+                display.mnemonicControl = null;
+            }
+            result = 1;
+        }
+        OS.gdk_event_free (eventPtr);
+    }
+    return result;
+}
+
+override int /*long*/ gtk_motion_notify_event (GtkWidget* widget, GdkEventMotion* gdkEvent) {
+    if (this is display.currentControl && (hooks (SWT.MouseHover) || filters (SWT.MouseHover))) {
+        display.addMouseHoverTimeout (handle);
+    }
+    double x = gdkEvent.x_root, y = gdkEvent.y_root;
+    int state = gdkEvent.state;
+    if (gdkEvent.is_hint !is 0) {
+        int pointer_x, pointer_y;
+        int mask;
+        auto window = eventWindow ();
+        OS.gdk_window_get_pointer (window, &pointer_x, &pointer_y, &mask);
+        x = pointer_x;
+        y = pointer_y;
+        state = mask;
+    }
+    int result = sendMouseEvent (SWT.MouseMove, 0, gdkEvent.time, x, y, gdkEvent.is_hint !is 0, state) ? 0 : 1;
+    return result;
+}
+
+override int /*long*/ gtk_popup_menu (GtkWidget* widget) {
+    if (!hasFocus()) return 0;
+    int x, y ;
+    OS.gdk_window_get_pointer (null, &x, &y, null);
+    return showMenu (x, y) ? 1 : 0;
+}
+
+override int /*long*/ gtk_preedit_changed (GtkIMContext* imcontext) {
+    display.showIMWindow (this);
+    return 0;
+}
+
+override int /*long*/ gtk_realize (GtkWidget* widget) {
+    auto imHandle = imHandle ();
+    if (imHandle !is null) {
+        auto window = OS.GTK_WIDGET_WINDOW (paintHandle ());
+        OS.gtk_im_context_set_client_window (imHandle, window);
+    }
+    if (backgroundImage !is null) {
+        auto window = OS.GTK_WIDGET_WINDOW (paintHandle ());
+        if (window !is null) OS.gdk_window_set_back_pixmap (window, cast(GdkPixmap*)backgroundImage.pixmap, false);
+    }
+    return 0;
+}
+
+override int /*long*/ gtk_scroll_event (GtkWidget* widget, GdkEventScroll* gdkEvent) {
+    switch (cast(int)gdkEvent.direction) {
+        case OS.GDK_SCROLL_UP:
+            return sendMouseEvent (SWT.MouseWheel, 0, 3, SWT.SCROLL_LINE, true, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state) ? 0 : 1;
+        case OS.GDK_SCROLL_DOWN:
+            return sendMouseEvent (SWT.MouseWheel, 0, -3, SWT.SCROLL_LINE, true, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state) ? 0 : 1;
+        case OS.GDK_SCROLL_LEFT:
+            return sendMouseEvent (SWT.MouseDown, 4, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state) ? 0 : 1;
+        case OS.GDK_SCROLL_RIGHT:
+            return sendMouseEvent (SWT.MouseDown, 5, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state) ? 0 : 1;
+        default:
+    }
+    return 0;
+}
+
+override int /*long*/ gtk_show_help (GtkWidget* widget, int /*long*/ helpType) {
+    if (!hasFocus ()) return 0;
+    return sendHelpEvent (helpType) ? 1 : 0;
+}
+
+override int /*long*/ gtk_style_set (GtkWidget* widget, int /*long*/ previousStyle) {
+    if (backgroundImage !is null) {
+        setBackgroundPixmap (backgroundImage.pixmap);
+    }
+    return 0;
+}
+
+override int /*long*/ gtk_unrealize (GtkWidget* widget) {
+    auto imHandle = imHandle ();
+    if (imHandle !is null) OS.gtk_im_context_set_client_window (imHandle, null);
+    return 0;
+}
+
+override int /*long*/ gtk_visibility_notify_event (GtkWidget* widget, GdkEventVisibility* gdkEvent) {
+    auto paintWindow = paintWindow();
+    auto window = gdkEvent.window;
+    if (window is paintWindow) {
+        if (gdkEvent.state is OS.GDK_VISIBILITY_FULLY_OBSCURED) {
+            state |= OBSCURED;
+        } else {
+            if ((state & OBSCURED) !is 0) {
+                int width, height;
+                OS.gdk_drawable_get_size (cast(GdkDrawable*)window, &width, &height);
+                GdkRectangle rect;
+                rect.width = width;
+                rect.height = height;
+                OS.gdk_window_invalidate_rect (window, &rect, false);
+            }
+            state &= ~OBSCURED;
+        }
+    }
+    return 0;
+}
+
+/*no override*/ void gtk_widget_size_request (GtkWidget* widget, GtkRequisition* requisition) {
+    OS.gtk_widget_size_request (widget, requisition);
+}
+
+/**
+ * Invokes platform specific functionality to allocate a new GC handle.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Control</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param data the platform specific GC data
+ * @return the platform specific GC handle
+ */
+public GdkGC* internal_new_GC (GCData data) {
+    checkWidget ();
+    auto window = paintWindow ();
+    if (window is null) SWT.error (SWT.ERROR_NO_HANDLES);
+    auto gdkGC = OS.gdk_gc_new (cast(GdkDrawable*)window);
+    if (gdkGC is null) error (SWT.ERROR_NO_HANDLES);
+    if (data !is null) {
+        int mask = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
+        if ((data.style & mask) is 0) {
+            data.style |= style & (mask | SWT.MIRRORED);
+        } else {
+            if ((data.style & SWT.RIGHT_TO_LEFT) !is 0) {
+                data.style |= SWT.MIRRORED;
+            }
+        }
+        data.drawable = cast(GdkDrawable*)window;
+        data.device = display;
+        data.foreground = getForegroundColor ();
+        Control control = findBackgroundControl ();
+        if (control is null) control = this;
+        data.background = control.getBackgroundColor ();
+        data.font = font !is null ? font : defaultFont ();
+    }
+    return gdkGC;
+}
+
+GtkIMContext* imHandle () {
+    return null;
+}
+
+/**
+ * Invokes platform specific functionality to dispose a GC handle.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Control</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param hDC the platform specific GC handle
+ * @param data the platform specific GC data
+ */
+public void internal_dispose_GC (GdkGC* gdkGC, GCData data) {
+    checkWidget ();
+    OS.g_object_unref (gdkGC);
+}
+
+/**
+ * Returns <code>true</code> if the underlying operating
+ * system supports this reparenting, otherwise <code>false</code>
+ *
+ * @return <code>true</code> if the widget can be reparented, otherwise <code>false</code>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool isReparentable () {
+    checkWidget();
+    return true;
+}
+bool isShowing () {
+    /*
+    * This is not complete.  Need to check if the
+    * widget is obscurred by a parent or sibling.
+    */
+    if (!isVisible ()) return false;
+    Control control = this;
+    while (control !is null) {
+        Point size = control.getSize ();
+        if (size.x is 0 || size.y is 0) {
+            return false;
+        }
+        control = control.parent;
+    }
+    return true;
+}
+bool isTabGroup () {
+    Control [] tabList = parent._getTabList ();
+    if (tabList !is null) {
+        for (int i=0; i<tabList.length; i++) {
+            if (tabList [i] is this) return true;
+        }
+    }
+    int code = traversalCode (0, null);
+    if ((code & (SWT.TRAVERSE_ARROW_PREVIOUS | SWT.TRAVERSE_ARROW_NEXT)) !is 0) return false;
+    return (code & (SWT.TRAVERSE_TAB_PREVIOUS | SWT.TRAVERSE_TAB_NEXT)) !is 0;
+}
+bool isTabItem () {
+    Control [] tabList = parent._getTabList ();
+    if (tabList !is null) {
+        for (int i=0; i<tabList.length; i++) {
+            if (tabList [i] is this) return false;
+        }
+    }
+    int code = traversalCode (0, null);
+    return (code & (SWT.TRAVERSE_ARROW_PREVIOUS | SWT.TRAVERSE_ARROW_NEXT)) !is 0;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is enabled and all
+ * ancestors up to and including the receiver's nearest ancestor
+ * shell are enabled.  Otherwise, <code>false</code> is returned.
+ * A disabled control is typically not selectable from the user
+ * interface and draws with an inactive or "grayed" look.
+ *
+ * @return the receiver's enabled state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getEnabled
+ */
+public bool isEnabled () {
+    checkWidget ();
+    return getEnabled () && parent.isEnabled ();
+}
+
+bool isFocusAncestor (Control control) {
+    while (control !is null && control !is this && !( null !is cast(Shell)control )) {
+        control = control.parent;
+    }
+    return control is this;
+}
+
+/**
+ * Returns <code>true</code> if the receiver has the user-interface
+ * focus, and <code>false</code> otherwise.
+ *
+ * @return the receiver's focus state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool isFocusControl () {
+    checkWidget();
+    Control focusControl = display.focusControl;
+    if (focusControl !is null && !focusControl.isDisposed ()) {
+        return this is focusControl;
+    }
+    return hasFocus ();
+}
+
+/**
+ * Returns <code>true</code> if the receiver is visible and all
+ * ancestors up to and including the receiver's nearest ancestor
+ * shell are visible. Otherwise, <code>false</code> is returned.
+ *
+ * @return the receiver's visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getVisible
+ */
+public bool isVisible () {
+    checkWidget();
+    return getVisible () && parent.isVisible ();
+}
+
+Decorations menuShell () {
+    return parent.menuShell ();
+}
+
+bool mnemonicHit (wchar key) {
+    return false;
+}
+
+bool mnemonicMatch (wchar key) {
+    return false;
+}
+
+override void register () {
+    super.register ();
+    if (fixedHandle !is null) display.addWidget (fixedHandle, this);
+    auto imHandle = imHandle ();
+    if (imHandle !is null) display.addWidget (cast(GtkWidget*)imHandle, this);
+}
+
+/**
+ * Causes the entire bounds of the receiver to be marked
+ * as needing to be redrawn. The next time a paint request
+ * is processed, the control will be completely painted,
+ * including the background.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #update()
+ * @see PaintListener
+ * @see SWT#Paint
+ * @see SWT#NO_BACKGROUND
+ * @see SWT#NO_REDRAW_RESIZE
+ * @see SWT#NO_MERGE_PAINTS
+ * @see SWT#DOUBLE_BUFFERED
+ */
+public void redraw () {
+    checkWidget();
+    redraw (false);
+}
+
+void redraw (bool all) {
+//  checkWidget();
+    if (!OS.GTK_WIDGET_VISIBLE (topHandle ())) return;
+    redrawWidget (0, 0, 0, 0, true, all, false);
+}
+
+/**
+ * Causes the rectangular area of the receiver specified by
+ * the arguments to be marked as needing to be redrawn.
+ * The next time a paint request is processed, that area of
+ * the receiver will be painted, including the background.
+ * If the <code>all</code> flag is <code>true</code>, any
+ * children of the receiver which intersect with the specified
+ * area will also paint their intersecting areas. If the
+ * <code>all</code> flag is <code>false</code>, the children
+ * will not be painted.
+ *
+ * @param x the x coordinate of the area to draw
+ * @param y the y coordinate of the area to draw
+ * @param width the width of the area to draw
+ * @param height the height of the area to draw
+ * @param all <code>true</code> if children should redraw, and <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #update()
+ * @see PaintListener
+ * @see SWT#Paint
+ * @see SWT#NO_BACKGROUND
+ * @see SWT#NO_REDRAW_RESIZE
+ * @see SWT#NO_MERGE_PAINTS
+ * @see SWT#DOUBLE_BUFFERED
+ */
+public void redraw (int x, int y, int width, int height, bool all) {
+    checkWidget();
+    if (!OS.GTK_WIDGET_VISIBLE (topHandle ())) return;
+    if ((style & SWT.MIRRORED) !is 0) x = getClientWidth () - width - x;
+    redrawWidget (x, y, width, height, false, all, false);
+}
+
+void redrawChildren () {
+}
+
+void redrawWidget (int x, int y, int width, int height, bool redrawAll, bool all, bool trim) {
+    if ((OS.GTK_WIDGET_FLAGS (handle) & OS.GTK_REALIZED) is 0) return;
+    auto window = paintWindow ();
+    GdkRectangle rect;
+    if (redrawAll) {
+        int w, h;
+        OS.gdk_drawable_get_size (cast(GdkDrawable*)window, &w, &h);
+        rect.width = w;
+        rect.height = h;
+    } else {
+        rect.x = x;
+        rect.y = y;
+        rect.width = width;
+        rect.height = height;
+    }
+    OS.gdk_window_invalidate_rect (window, &rect, all);
+}
+
+override void release (bool destroy) {
+    Control next = null, previous = null;
+    if (destroy && parent !is null) {
+        Control[] children = parent._getChildren ();
+        int index = 0;
+        while (index < children.length) {
+            if (children [index] is this) break;
+            index++;
+        }
+        if (0 < index && (index + 1) < children.length) {
+            next = children [index + 1];
+            previous = children [index - 1];
+        }
+    }
+    super.release (destroy);
+    if (destroy) {
+        if (previous !is null) previous.addRelation (next);
+    }
+}
+
+override void releaseHandle () {
+    super.releaseHandle ();
+    fixedHandle = null;
+    parent = null;
+}
+
+override void releaseParent () {
+    parent.removeControl (this);
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    if (display.currentControl is this) display.currentControl = null;
+    display.removeMouseHoverTimeout (handle);
+    auto imHandle = imHandle ();
+    if (imHandle !is null) {
+        OS.gtk_im_context_reset (imHandle);
+        OS.gtk_im_context_set_client_window (imHandle, null);
+    }
+    if (enableWindow !is null) {
+        OS.gdk_window_set_user_data (enableWindow, null);
+        OS.gdk_window_destroy (enableWindow);
+        enableWindow = null;
+    }
+    redrawWindow = null;
+    if (menu !is null && !menu.isDisposed ()) {
+        menu.dispose ();
+    }
+    menu = null;
+    cursor = null;
+    toolTipText = null;
+    layoutData = null;
+    accessible = null;
+    region = null;
+}
+
+bool sendDragEvent (int button, int stateMask, int x, int y, bool isStateMask) {
+    Event event = new Event ();
+    event.button = button;
+    event.x = x;
+    event.y = y;
+    if ((style & SWT.MIRRORED) !is 0) event.x = getClientWidth () - event.x;
+    if (isStateMask) {
+        event.stateMask = stateMask;
+    } else {
+        setInputState (event, stateMask);
+    }
+    postEvent (SWT.DragDetect, event);
+    if (isDisposed ()) return false;
+    return event.doit;
+}
+
+void sendFocusEvent (int type) {
+    Shell shell = _getShell ();
+    Display display = this.display;
+    display.focusControl = this;
+    display.focusEvent = type;
+    sendEvent (type);
+    display.focusControl = null;
+    display.focusEvent = SWT.None;
+    /*
+    * It is possible that the shell may be
+    * disposed at this point.  If this happens
+    * don't send the activate and deactivate
+    * events.
+    */
+    if (!shell.isDisposed ()) {
+        switch (type) {
+            case SWT.FocusIn:
+                shell.setActiveControl (this);
+                break;
+            case SWT.FocusOut:
+                if (shell !is display.activeShell) {
+                    shell.setActiveControl (null);
+                }
+                break;
+            default:
+        }
+    }
+}
+
+bool sendHelpEvent (int /*long*/ helpType) {
+    Control control = this;
+    while (control !is null) {
+        if (control.hooks (SWT.Help)) {
+            control.postEvent (SWT.Help);
+            return true;
+        }
+        control = control.parent;
+    }
+    return false;
+}
+
+bool sendLeaveNotify() {
+    return false;
+}
+
+bool sendMouseEvent (int type, int button, int time, double x, double y, bool is_hint, int state) {
+    return sendMouseEvent (type, button, 0, 0, false, time, x, y, is_hint, state);
+}
+
+bool sendMouseEvent (int type, int button, int count, int detail, bool send, int time, double x, double y, bool is_hint, int state) {
+    if (!hooks (type) && !filters (type)) return true;
+    Event event = new Event ();
+    event.time = time;
+    event.button = button;
+    event.detail = detail;
+    event.count = count;
+    if (is_hint) {
+        event.x = cast(int)x;
+        event.y = cast(int)y;
+    } else {
+        auto window = eventWindow ();
+        int origin_x, origin_y;
+        OS.gdk_window_get_origin (window, &origin_x, &origin_y);
+        event.x = cast(int)x - origin_x;
+        event.y = cast(int)y - origin_y;
+    }
+    if ((style & SWT.MIRRORED) !is 0) event.x = getClientWidth () - event.x;
+    setInputState (event, state);
+    if (send) {
+        sendEvent (type, event);
+        if (isDisposed ()) return false;
+    } else {
+        postEvent (type, event);
+    }
+    return event.doit;
+}
+
+void setBackground () {
+    if ((state & PARENT_BACKGROUND) !is 0 && (state & BACKGROUND) is 0 && backgroundImage is null) {
+        setParentBackground ();
+    } else {
+        setWidgetBackground ();
+    }
+    redrawWidget (0, 0, 0, 0, true, false, false);
+}
+
+/**
+ * Sets the receiver's background color to the color specified
+ * by the argument, or to the default system color for the control
+ * if the argument is null.
+ * <p>
+ * Note: This operation is a hint and may be overridden by the platform.
+ * For example, on Windows the background of a Button cannot be changed.
+ * </p>
+ * @param color the new color (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setBackground (Color color) {
+    checkWidget();
+    if (((state & BACKGROUND) is 0) && color is null) return;
+    GdkColor* gdkColor = null;
+    if (color !is null) {
+        if (color.isDisposed ()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+        gdkColor = color.handle;
+    }
+    bool set = false;
+    if (gdkColor is null) {
+        auto style = OS.gtk_widget_get_modifier_style (handle);
+        set = (OS.gtk_rc_style_get_color_flags (style, OS.GTK_STATE_NORMAL) & OS.GTK_RC_BG) !is 0;
+    } else {
+        GdkColor* oldColor = getBackgroundColor ();
+        set = oldColor.pixel !is gdkColor.pixel;
+    }
+    if (set) {
+        if (color is null) {
+            state &= ~BACKGROUND;
+        } else {
+            state |= BACKGROUND;
+        }
+        setBackgroundColor (gdkColor);
+        redrawChildren ();
+    }
+}
+
+void setBackgroundColor (GtkWidget* handle, GdkColor* color) {
+    int index = OS.GTK_STATE_NORMAL;
+    auto style = OS.gtk_widget_get_modifier_style (handle);
+    auto ptr = OS.gtk_rc_style_get_bg_pixmap_name (style, index);
+    if (ptr !is null) OS.g_free (ptr);
+    String name = color is null ? "<parent>" : "<none>" ;
+    ptr = cast(char*)OS.g_malloc (name.length+1);
+    ptr[ 0 .. name.length ] = name;
+    ptr[ name.length ] = '\0';
+    OS.gtk_rc_style_set_bg_pixmap_name (style, index, ptr);
+    OS.gtk_rc_style_set_bg (style, index, color);
+    int flags = OS.gtk_rc_style_get_color_flags (style, index);
+    flags = (color is null) ? flags & ~OS.GTK_RC_BG : flags | OS.GTK_RC_BG;
+    OS.gtk_rc_style_set_color_flags (style, index, flags);
+    modifyStyle (handle, style);
+}
+
+void setBackgroundColor (GdkColor* color) {
+    setBackgroundColor (handle, color);
+}
+
+/**
+ * Sets the receiver's background image to the image specified
+ * by the argument, or to the default system color for the control
+ * if the argument is null.  The background image is tiled to fill
+ * the available space.
+ * <p>
+ * Note: This operation is a hint and may be overridden by the platform.
+ * For example, on Windows the background of a Button cannot be changed.
+ * </p>
+ * @param image the new image (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument is not a bitmap</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setBackgroundImage (Image image) {
+    checkWidget ();
+    if (image !is null && image.isDisposed ()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+    if (image is backgroundImage) return;
+    this.backgroundImage = image;
+    if (backgroundImage !is null) {
+        setBackgroundPixmap (backgroundImage.pixmap);
+        redrawWidget (0, 0, 0, 0, true, false, false);
+    } else {
+        setWidgetBackground ();
+    }
+    redrawChildren ();
+}
+
+void setBackgroundPixmap (GdkDrawable* pixmap) {
+    auto window = OS.GTK_WIDGET_WINDOW (paintHandle ());
+    if (window !is null) OS.gdk_window_set_back_pixmap (window, cast(GdkPixmap*)backgroundImage.pixmap, false);
+}
+
+/**
+ * If the argument is <code>true</code>, causes the receiver to have
+ * all mouse events delivered to it until the method is called with
+ * <code>false</code> as the argument.  Note that on some platforms,
+ * a mouse button must currently be down for capture to be assigned.
+ *
+ * @param capture <code>true</code> to capture the mouse, and <code>false</code> to release it
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setCapture (bool capture) {
+    checkWidget();
+    /* FIXME !!!!! */
+    /*
+    if (capture) {
+        OS.gtk_widget_grab_focus (handle);
+    } else {
+        OS.gtk_widget_grab_default (handle);
+    }
+    */
+}
+/**
+ * Sets the receiver's cursor to the cursor specified by the
+ * argument, or to the default cursor for that kind of control
+ * if the argument is null.
+ * <p>
+ * When the mouse pointer passes over a control its appearance
+ * is changed to match the control's cursor.
+ * </p>
+ *
+ * @param cursor the new cursor (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setCursor (Cursor cursor) {
+    checkWidget();
+    if (cursor !is null && cursor.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+    this.cursor = cursor;
+    gtk_setCursor (cursor !is null ? cursor.handle : null);
+}
+
+void gtk_setCursor (GdkCursor* cursor) {
+    auto window = eventWindow ();
+    if (window !is null) {
+        OS.gdk_window_set_cursor (window, cursor);
+        if (!OS.GDK_WINDOWING_X11 ()) {
+            OS.gdk_flush ();
+        } else {
+            auto xDisplay = OS.GDK_DISPLAY ();
+            OS.XFlush (xDisplay);
+        }
+    }
+}
+
+/**
+ * Sets the receiver's drag detect state. If the argument is
+ * <code>true</code>, the receiver will detect drag gestures,
+ * otherwise these gestures will be ignored.
+ *
+ * @param dragDetect the new drag detect state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.3
+ */
+public void setDragDetect (bool dragDetect) {
+    checkWidget ();
+    if (dragDetect) {
+        state |= DRAG_DETECT;
+    } else {
+        state &= ~DRAG_DETECT;
+    }
+}
+
+/**
+ * Enables the receiver if the argument is <code>true</code>,
+ * and disables it otherwise. A disabled control is typically
+ * not selectable from the user interface and draws with an
+ * inactive or "grayed" look.
+ *
+ * @param enabled the new enabled state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setEnabled (bool enabled) {
+    checkWidget();
+    if (((state & DISABLED) is 0) is enabled) return;
+    Control control = null;
+    bool fixFocus_ = false;
+    if (!enabled) {
+        if (display.focusEvent !is SWT.FocusOut) {
+            control = display.getFocusControl ();
+            fixFocus_ = isFocusAncestor (control);
+        }
+    }
+    if (enabled) {
+        state &= ~DISABLED;
+    } else {
+        state |= DISABLED;
+    }
+    enableWidget (enabled);
+    if (isDisposed ()) return;
+    if (enabled) {
+        if (enableWindow !is null) {
+            OS.gdk_window_set_user_data (enableWindow, null);
+            OS.gdk_window_destroy (enableWindow);
+            enableWindow = null;
+        }
+    } else {
+        OS.gtk_widget_realize (handle);
+        auto parentHandle = parent.eventHandle ();
+        auto window = parent.eventWindow();
+        auto topHandle_ = topHandle ();
+        GdkWindowAttr attributes;
+        attributes.x = OS.GTK_WIDGET_X (topHandle_);
+        attributes.y = OS.GTK_WIDGET_Y (topHandle_);
+        attributes.width = (state & ZERO_WIDTH) !is 0 ? 0 : OS.GTK_WIDGET_WIDTH (topHandle_);
+        attributes.height = (state & ZERO_HEIGHT) !is 0 ? 0 : OS.GTK_WIDGET_HEIGHT (topHandle_);
+        attributes.event_mask = (0xFFFFFFFF & ~OS.ExposureMask);
+        attributes.wclass = OS.GDK_INPUT_ONLY;
+        attributes.window_type = OS.GDK_WINDOW_CHILD;
+        enableWindow = OS.gdk_window_new (window, &attributes, OS.GDK_WA_X | OS.GDK_WA_Y);
+        if (enableWindow !is null) {
+            OS.gdk_window_set_user_data (enableWindow, parentHandle);
+            if (!OS.GDK_WINDOWING_X11 ()) {
+                OS.gdk_window_raise (enableWindow);
+            } else {
+                auto topWindow = OS.GTK_WIDGET_WINDOW (topHandle_);
+                auto xDisplay = OS.gdk_x11_drawable_get_xdisplay (cast(GdkDrawable*)topWindow);
+                auto xWindow = OS.gdk_x11_drawable_get_xid (cast(GdkDrawable*)enableWindow);
+                int xScreen = OS.XDefaultScreen (xDisplay);
+                int flags = OS.CWStackMode | OS.CWSibling;
+                XWindowChanges changes;
+                changes.sibling = OS.gdk_x11_drawable_get_xid (cast(GdkDrawable*)topWindow);
+                changes.stack_mode = OS.Above;
+                OS.XReconfigureWMWindow (xDisplay, xWindow, xScreen, flags, &changes);
+            }
+            if (OS.GTK_WIDGET_VISIBLE (topHandle_)) OS.gdk_window_show_unraised (enableWindow);
+        }
+    }
+    if (fixFocus_) fixFocus (control);
+}
+
+/**
+ * Causes the receiver to have the <em>keyboard focus</em>,
+ * such that all keyboard events will be delivered to it.  Focus
+ * reassignment will respect applicable platform constraints.
+ *
+ * @return <code>true</code> if the control got focus, and <code>false</code> if it was unable to.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #forceFocus
+ */
+public bool setFocus () {
+    checkWidget();
+    if ((style & SWT.NO_FOCUS) !is 0) return false;
+    return forceFocus ();
+}
+
+/**
+ * Sets the font that the receiver will use to paint textual information
+ * to the font specified by the argument, or to the default font for that
+ * kind of control if the argument is null.
+ *
+ * @param font the new font (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setFont (Font font) {
+    checkWidget();
+    if (((state & FONT) is 0) && font is null) return;
+    this.font = font;
+    PangoFontDescription* fontDesc;
+    if (font is null) {
+        fontDesc = defaultFont ().handle;
+    } else {
+        if (font.isDisposed ()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+        fontDesc = font.handle;
+    }
+    if (font is null) {
+        state &= ~FONT;
+    } else {
+        state |= FONT;
+    }
+    setFontDescription (fontDesc);
+}
+
+void setFontDescription (PangoFontDescription* font) {
+    OS.gtk_widget_modify_font (handle, font);
+}
+
+/**
+ * Sets the receiver's foreground color to the color specified
+ * by the argument, or to the default system color for the control
+ * if the argument is null.
+ * <p>
+ * Note: This operation is a hint and may be overridden by the platform.
+ * </p>
+ * @param color the new color (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setForeground (Color color) {
+    checkWidget();
+    if (((state & FOREGROUND) is 0) && color is null) return;
+    GdkColor* gdkColor = null;
+    if (color !is null) {
+        if (color.isDisposed ()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+        gdkColor = color.handle;
+    }
+    bool set = false;
+    if (gdkColor is null) {
+        auto style = OS.gtk_widget_get_modifier_style (handle);
+        set = (OS.gtk_rc_style_get_color_flags (style, OS.GTK_STATE_NORMAL) & OS.GTK_RC_FG) !is 0;
+    } else {
+        GdkColor* oldColor = getForegroundColor ();
+        set = oldColor.pixel !is gdkColor.pixel;
+    }
+    if (set) {
+        if (color is null) {
+            state &= ~FOREGROUND;
+        } else {
+            state |= FOREGROUND;
+        }
+        setForegroundColor (gdkColor);
+    }
+}
+
+void setForegroundColor (GdkColor* color) {
+    setForegroundColor (handle, color);
+}
+
+void setInitialBounds () {
+    if ((state & ZERO_WIDTH) !is 0 && (state & ZERO_HEIGHT) !is 0) {
+        /*
+        * Feature in GTK.  On creation, each widget's allocation is
+        * initialized to a position of (-1, -1) until the widget is
+        * first sized.  The fix is to set the value to (0, 0) as
+        * expected by SWT.
+        */
+        auto topHandle_ = topHandle ();
+        if ((parent.style & SWT.MIRRORED) !is 0) {
+            OS.GTK_WIDGET_SET_X (topHandle_, parent.getClientWidth ());
+        } else {
+            OS.GTK_WIDGET_SET_X (topHandle_, 0);
+        }
+        OS.GTK_WIDGET_SET_Y (topHandle_, 0);
+    } else {
+        resizeHandle (1, 1);
+        forceResize ();
+    }
+}
+
+/**
+ * Sets the receiver's pop up menu to the argument.
+ * All controls may optionally have a pop up
+ * menu that is displayed when the user requests one for
+ * the control. The sequence of key strokes, button presses
+ * and/or button releases that are used to request a pop up
+ * menu is platform specific.
+ * <p>
+ * Note: Disposing of a control that has a pop up menu will
+ * dispose of the menu.  To avoid this behavior, set the
+ * menu to null before the control is disposed.
+ * </p>
+ *
+ * @param menu the new pop up menu
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_MENU_NOT_POP_UP - the menu is not a pop up menu</li>
+ *    <li>ERROR_INVALID_PARENT - if the menu is not in the same widget tree</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the menu has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMenu (Menu menu) {
+    checkWidget();
+    if (menu !is null) {
+        if ((menu.style & SWT.POP_UP) is 0) {
+            error (SWT.ERROR_MENU_NOT_POP_UP);
+        }
+        if (menu.parent !is menuShell ()) {
+            error (SWT.ERROR_INVALID_PARENT);
+        }
+    }
+    this.menu = menu;
+}
+
+override void setOrientation () {
+    if ((style & SWT.RIGHT_TO_LEFT) !is 0) {
+        if (handle !is null) OS.gtk_widget_set_direction (handle, OS.GTK_TEXT_DIR_RTL);
+        if (fixedHandle !is null) OS.gtk_widget_set_direction (fixedHandle, OS.GTK_TEXT_DIR_RTL);
+    }
+}
+
+/**
+ * Changes the parent of the widget to be the one provided if
+ * the underlying operating system supports this feature.
+ * Returns <code>true</code> if the parent is successfully changed.
+ *
+ * @param parent the new parent for the control.
+ * @return <code>true</code> if the parent is changed and <code>false</code> otherwise.
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is <code>null</code></li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *  </ul>
+ */
+public bool setParent (Composite parent) {
+    checkWidget ();
+    if (parent is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    if (parent.isDisposed()) SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+    if (this.parent is parent) return true;
+    if (!isReparentable ()) return false;
+    auto topHandle_ = topHandle ();
+    int x = OS.GTK_WIDGET_X (topHandle_);
+    int width = (state & ZERO_WIDTH) !is 0 ? 0 : OS.GTK_WIDGET_WIDTH (topHandle_);
+    if ((this.parent.style & SWT.MIRRORED) !is 0) {
+        x =  this.parent.getClientWidth () - width - x;
+    }
+    if ((parent.style & SWT.MIRRORED) !is 0) {
+        x = parent.getClientWidth () - width - x;
+    }
+    int y = OS.GTK_WIDGET_Y (topHandle_);
+    releaseParent ();
+    Shell newShell = parent.getShell (), oldShell = getShell ();
+    Decorations newDecorations = parent.menuShell (), oldDecorations = menuShell ();
+    Menu [] menus = oldShell.findMenus (this);
+    if (oldShell !is newShell || oldDecorations !is newDecorations) {
+        fixChildren (newShell, oldShell, newDecorations, oldDecorations, menus);
+        newDecorations.fixAccelGroup ();
+        oldDecorations.fixAccelGroup ();
+    }
+    auto newParent = parent.parentingHandle();
+    OS.gtk_widget_reparent (topHandle_, newParent);
+    OS.gtk_fixed_move (cast(GtkFixed*)newParent, topHandle_, x, y);
+    this.parent = parent;
+    setZOrder (null, false, true);
+    return true;
+}
+
+void setParentBackground () {
+    setBackgroundColor (handle, null);
+    if (fixedHandle !is null) setBackgroundColor (fixedHandle, null);
+}
+
+void setParentWindow (GtkWidget* widget) {
+}
+
+bool setRadioSelection (bool value) {
+    return false;
+}
+
+/**
+ * If the argument is <code>false</code>, causes subsequent drawing
+ * operations in the receiver to be ignored. No drawing of any kind
+ * can occur in the receiver until the flag is set to true.
+ * Graphics operations that occurred while the flag was
+ * <code>false</code> are lost. When the flag is set to <code>true</code>,
+ * the entire widget is marked as needing to be redrawn.  Nested calls
+ * to this method are stacked.
+ * <p>
+ * Note: This operation is a hint and may not be supported on some
+ * platforms or for some widgets.
+ * </p>
+ *
+ * @param redraw the new redraw state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #redraw(int, int, int, int, bool)
+ * @see #update()
+ */
+public void setRedraw (bool redraw) {
+    checkWidget();
+    if (redraw) {
+        if (--drawCount is 0) {
+            if (redrawWindow !is null) {
+                auto window = paintWindow ();
+                /* Explicitly hiding the window avoids flicker on GTK+ >= 2.6 */
+                OS.gdk_window_hide (redrawWindow);
+                OS.gdk_window_destroy (redrawWindow);
+                OS.gdk_window_set_events (window, OS.gtk_widget_get_events (paintHandle ()));
+                redrawWindow = null;
+            }
+        }
+    } else {
+        if (drawCount++ is 0) {
+            if ((OS.GTK_WIDGET_FLAGS (handle) & OS.GTK_REALIZED) !is 0) {
+                auto window = paintWindow ();
+                Rectangle rect = getBounds ();
+                GdkWindowAttr attributes;
+                attributes.width = rect.width;
+                attributes.height = rect.height;
+                attributes.event_mask = OS.GDK_EXPOSURE_MASK;
+                attributes.window_type = OS.GDK_WINDOW_CHILD;
+                redrawWindow = OS.gdk_window_new (window, &attributes, 0);
+                if (redrawWindow !is null) {
+                    int mouseMask = OS.GDK_BUTTON_PRESS_MASK | OS.GDK_BUTTON_RELEASE_MASK |
+                        OS.GDK_ENTER_NOTIFY_MASK | OS.GDK_LEAVE_NOTIFY_MASK |
+                        OS.GDK_POINTER_MOTION_MASK | OS.GDK_POINTER_MOTION_HINT_MASK |
+                        OS.GDK_BUTTON_MOTION_MASK | OS.GDK_BUTTON1_MOTION_MASK |
+                        OS.GDK_BUTTON2_MOTION_MASK | OS.GDK_BUTTON3_MOTION_MASK;
+                    OS.gdk_window_set_events (window, OS.gdk_window_get_events (window) & ~mouseMask);
+                    OS.gdk_window_set_back_pixmap (redrawWindow, null, false);
+                    OS.gdk_window_show (redrawWindow);
+                }
+            }
+        }
+    }
+}
+
+bool setTabGroupFocus (bool next) {
+    return setTabItemFocus (next);
+}
+bool setTabItemFocus (bool next) {
+    if (!isShowing ()) return false;
+    return forceFocus ();
+}
+
+/**
+ * Sets the receiver's tool tip text to the argument, which
+ * may be null indicating that no tool tip text should be shown.
+ *
+ * @param str the new tool tip text (or null)
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setToolTipText (String str) {
+    checkWidget();
+    setToolTipText (_getShell (), str);
+    toolTipText = str;
+}
+
+void setToolTipText (Shell shell, String newString) {
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 12, 0)) {
+        /*
+        * Feature in GTK.  In order to prevent children widgets
+        * from inheriting their parent's tooltip, the tooltip is
+        * a set on a shell only. In order to force the shell tooltip
+        * to update when a new tip string is set, the existing string
+        * in the tooltip is set to null, followed by running a query.
+        * The real tip text can then be set.
+        *
+        * Note that this will only run if the control for which the
+        * tooltip is being set is the current control (i.e. the control
+        * under the pointer).
+        */
+        if (display.currentControl is this) {
+            shell.setToolTipText (shell.handle, eventHandle (), newString);
+        }
+    } else {
+        shell.setToolTipText (eventHandle (), newString);
+    }
+}
+
+/**
+ * Marks the receiver as visible if the argument is <code>true</code>,
+ * and marks it invisible otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, marking
+ * it visible may not actually cause it to be displayed.
+ * </p>
+ *
+ * @param visible the new visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setVisible (bool visible) {
+    checkWidget();
+    if (((state & HIDDEN) is 0) is visible) return;
+    auto topHandle_ = topHandle();
+    if (visible) {
+        /*
+        * It is possible (but unlikely), that application
+        * code could have disposed the widget in the show
+        * event.  If this happens, just return.
+        */
+        sendEvent (SWT.Show);
+        if (isDisposed ()) return;
+        state &= ~HIDDEN;
+        if ((state & (ZERO_WIDTH | ZERO_HEIGHT)) is 0) {
+            if (enableWindow !is null) OS.gdk_window_show_unraised (enableWindow);
+            OS.gtk_widget_show (topHandle_);
+        }
+    } else {
+        /*
+        * Bug in GTK.  Invoking gtk_widget_hide() on a widget that has
+        * focus causes a focus_out_event to be sent. If the client disposes
+        * the widget inside the event, GTK GP's.  The fix is to reassign focus
+        * before hiding the widget.
+        *
+        * NOTE: In order to stop the same widget from taking focus,
+        * temporarily clear and set the GTK_VISIBLE flag.
+        */
+        Control control = null;
+        bool fixFocus_ = false;
+        if (display.focusEvent !is SWT.FocusOut) {
+            control = display.getFocusControl ();
+            fixFocus_ = isFocusAncestor (control);
+        }
+        state |= HIDDEN;
+        if (fixFocus_) {
+            OS.GTK_WIDGET_UNSET_FLAGS (topHandle_, OS.GTK_VISIBLE);
+            fixFocus (control);
+            if (isDisposed ()) return;
+            OS.GTK_WIDGET_SET_FLAGS (topHandle_, OS.GTK_VISIBLE);
+        }
+        OS.gtk_widget_hide (topHandle_);
+        if (isDisposed ()) return;
+        if (enableWindow !is null) OS.gdk_window_hide (enableWindow);
+        sendEvent (SWT.Hide);
+    }
+}
+
+void setZOrder (Control sibling, bool above, bool fixRelations) {
+     setZOrder (sibling, above, fixRelations, true);
+}
+
+void setZOrder (Control sibling, bool above, bool fixRelations, bool fixChildren) {
+    int index = 0, siblingIndex = 0, oldNextIndex = -1;
+    Control[] children = null;
+    if (fixRelations) {
+        /* determine the receiver's and sibling's indexes in the parent */
+        children = parent._getChildren ();
+        while (index < children.length) {
+            if (children [index] is this) break;
+            index++;
+        }
+        if (sibling !is null) {
+            while (siblingIndex < children.length) {
+                if (children [siblingIndex] is sibling) break;
+                siblingIndex++;
+            }
+        }
+        /* remove "Labelled by" relationships that will no longer be valid */
+        removeRelation ();
+        if (index + 1 < children.length) {
+            oldNextIndex = index + 1;
+            children [oldNextIndex].removeRelation ();
+        }
+        if (sibling !is null) {
+            if (above) {
+                sibling.removeRelation ();
+            } else {
+                if (siblingIndex + 1 < children.length) {
+                    children [siblingIndex + 1].removeRelation ();
+                }
+            }
+        }
+    }
+
+    auto topHandle_ = topHandle ();
+    auto siblingHandle = sibling !is null ? sibling.topHandle () : null;
+    auto window = OS.GTK_WIDGET_WINDOW (topHandle_);
+    if (window !is null) {
+        GdkWindow* siblingWindow;
+        if (sibling !is null) {
+            if (above && sibling.enableWindow !is null) {
+                siblingWindow = enableWindow;
+            } else {
+                siblingWindow = OS.GTK_WIDGET_WINDOW (siblingHandle);
+            }
+        }
+        auto redrawWindow = fixChildren ? parent.redrawWindow : null;
+        if (!OS.GDK_WINDOWING_X11 () || (siblingWindow is null && (!above || redrawWindow is null))) {
+            if (above) {
+                OS.gdk_window_raise (window);
+                if (redrawWindow !is null) OS.gdk_window_raise (redrawWindow);
+                if (enableWindow !is null) OS.gdk_window_raise (enableWindow);
+            } else {
+                if (enableWindow !is null) OS.gdk_window_lower (enableWindow);
+                OS.gdk_window_lower (window);
+            }
+        } else {
+            XWindowChanges changes;
+            changes.sibling = OS.gdk_x11_drawable_get_xid (cast(GdkDrawable*)(siblingWindow !is null ? siblingWindow : redrawWindow));
+            changes.stack_mode = above ? OS.Above : OS.Below;
+            if (redrawWindow !is null && siblingWindow is null) changes.stack_mode = OS.Below;
+            auto xDisplay = OS.gdk_x11_drawable_get_xdisplay (cast(GdkDrawable*)window);
+            auto xWindow = OS.gdk_x11_drawable_get_xid (cast(GdkDrawable*)window);
+            int xScreen = OS.XDefaultScreen (xDisplay);
+            int flags = OS.CWStackMode | OS.CWSibling;
+            /*
+            * Feature in X. If the receiver is a top level, XConfigureWindow ()
+            * will fail (with a BadMatch error) for top level shells because top
+            * level shells are reparented by the window manager and do not share
+            * the same X window parent.  This is the correct behavior but it is
+            * unexpected.  The fix is to use XReconfigureWMWindow () instead.
+            * When the receiver is not a top level shell, XReconfigureWMWindow ()
+            * behaves the same as XConfigureWindow ().
+            */
+            OS.XReconfigureWMWindow (xDisplay, xWindow, xScreen, flags, &changes);
+            if (enableWindow !is null) {
+                changes.sibling = OS.gdk_x11_drawable_get_xid (cast(GdkDrawable*)window);
+                changes.stack_mode = OS.Above;
+                xWindow = OS.gdk_x11_drawable_get_xid (cast(GdkDrawable*)enableWindow);
+                OS.XReconfigureWMWindow (xDisplay, xWindow, xScreen, flags, &changes);
+            }
+        }
+    }
+    if (fixChildren) {
+        if (above) {
+            parent.moveAbove (topHandle_, siblingHandle);
+        } else {
+            parent.moveBelow (topHandle_, siblingHandle);
+        }
+    }
+    /*  Make sure that the parent internal windows are on the bottom of the stack   */
+    if (!above && fixChildren)  parent.fixZOrder ();
+
+    if (fixRelations) {
+        /* determine the receiver's new index in the parent */
+        if (sibling !is null) {
+            if (above) {
+                index = siblingIndex - (index < siblingIndex ? 1 : 0);
+            } else {
+                index = siblingIndex + (siblingIndex < index ? 1 : 0);
+            }
+        } else {
+            if (above) {
+                index = 0;
+            } else {
+                index = children.length - 1;
+            }
+        }
+
+        /* add new "Labelled by" relations as needed */
+        children = parent._getChildren ();
+        if (0 < index) {
+            children [index - 1].addRelation (this);
+        }
+        if (index + 1 < children.length) {
+            addRelation (children [index + 1]);
+        }
+        if (oldNextIndex !is -1) {
+            if (oldNextIndex <= index) oldNextIndex--;
+            /* the last two conditions below ensure that duplicate relations are not hooked */
+            if (0 < oldNextIndex && oldNextIndex !is index && oldNextIndex !is index + 1) {
+                children [oldNextIndex - 1].addRelation (children [oldNextIndex]);
+            }
+        }
+    }
+}
+
+void setWidgetBackground  () {
+    if (fixedHandle !is null) {
+        auto style = OS.gtk_widget_get_modifier_style (fixedHandle);
+        modifyStyle (fixedHandle, style);
+    }
+    auto style = OS.gtk_widget_get_modifier_style (handle);
+    modifyStyle (handle, style);
+}
+
+bool showMenu (int x, int y) {
+    Event event = new Event ();
+    event.x = x;
+    event.y = y;
+    sendEvent (SWT.MenuDetect, event);
+    if (event.doit) {
+        if (menu !is null && !menu.isDisposed ()) {
+            bool hooksKeys = hooks (SWT.KeyDown) || hooks (SWT.KeyUp);
+            menu.createIMMenu (hooksKeys ? imHandle() : null);
+            if (event.x !is x || event.y !is y) {
+                menu.setLocation (event.x, event.y);
+            }
+            menu.setVisible (true);
+            return true;
+        }
+    }
+    return false;
+}
+
+void showWidget () {
+    // Comment this line to disable zero-sized widgets
+    state |= ZERO_WIDTH | ZERO_HEIGHT;
+    auto topHandle_ = topHandle ();
+    auto parentHandle = parent.parentingHandle ();
+    parent.setParentWindow (topHandle_);
+    OS.gtk_container_add (cast(GtkContainer*)parentHandle, topHandle_);
+    if (handle !is null && handle !is topHandle_) OS.gtk_widget_show (handle);
+    if ((state & (ZERO_WIDTH | ZERO_HEIGHT)) is 0) {
+        if (fixedHandle !is null) OS.gtk_widget_show (fixedHandle);
+    }
+    if (fixedHandle !is null) fixStyle (fixedHandle);
+}
+
+void sort (int [] items) {
+    /* Shell Sort from K&R, pg 108 */
+    int length = items.length;
+    for (int gap=length/2; gap>0; gap/=2) {
+        for (int i=gap; i<length; i++) {
+            for (int j=i-gap; j>=0; j-=gap) {
+                if (items [j] <= items [j + gap]) {
+                    int swap = items [j];
+                    items [j] = items [j + gap];
+                    items [j + gap] = swap;
+                }
+            }
+        }
+    }
+}
+
+/**
+ * Based on the argument, perform one of the expected platform
+ * traversal action. The argument should be one of the constants:
+ * <code>SWT.TRAVERSE_ESCAPE</code>, <code>SWT.TRAVERSE_RETURN</code>,
+ * <code>SWT.TRAVERSE_TAB_NEXT</code>, <code>SWT.TRAVERSE_TAB_PREVIOUS</code>,
+ * <code>SWT.TRAVERSE_ARROW_NEXT</code> and <code>SWT.TRAVERSE_ARROW_PREVIOUS</code>.
+ *
+ * @param traversal the type of traversal
+ * @return true if the traversal succeeded
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool traverse (int traversal) {
+    checkWidget ();
+    Event event = new Event ();
+    event.doit = true;
+    event.detail = traversal;
+    return traverse (event);
+}
+
+bool translateMnemonic (Event event, Control control) {
+    if (control is this) return false;
+    if (!isVisible () || !isEnabled ()) return false;
+    event.doit = this is display.mnemonicControl || mnemonicMatch (event.character);
+    return traverse (event);
+}
+
+bool translateMnemonic (int keyval, GdkEventKey* gdkEvent) {
+    int key = OS.gdk_keyval_to_unicode (keyval);
+    if (key < 0x20) return false;
+    if (gdkEvent.state is 0) {
+        int code = traversalCode (keyval, gdkEvent);
+        if ((code & SWT.TRAVERSE_MNEMONIC) is 0) return false;
+    } else {
+        Shell shell = _getShell ();
+        int mask = OS.GDK_CONTROL_MASK | OS.GDK_SHIFT_MASK | OS.GDK_MOD1_MASK;
+        if ((gdkEvent.state & mask) !is OS.gtk_window_get_mnemonic_modifier (cast(GtkWindow*)shell.shellHandle)) return false;
+    }
+    Decorations shell = menuShell ();
+    if (shell.isVisible () && shell.isEnabled ()) {
+        Event event = new Event ();
+        event.detail = SWT.TRAVERSE_MNEMONIC;
+        if (setKeyState (event, gdkEvent)) {
+            return translateMnemonic (event, null) || shell.translateMnemonic (event, this);
+        }
+    }
+    return false;
+}
+
+bool translateTraversal (GdkEventKey* keyEvent) {
+    int detail = SWT.TRAVERSE_NONE;
+    int key = keyEvent.keyval;
+    int code = traversalCode (key, keyEvent);
+    bool all = false;
+    switch (key) {
+        case OS.GDK_Escape: {
+            all = true;
+            detail = SWT.TRAVERSE_ESCAPE;
+            break;
+        }
+        case OS.GDK_KP_Enter:
+        case OS.GDK_Return: {
+            all = true;
+            detail = SWT.TRAVERSE_RETURN;
+            break;
+        }
+        case OS.GDK_ISO_Left_Tab:
+        case OS.GDK_Tab: {
+            bool next = (keyEvent.state & OS.GDK_SHIFT_MASK) is 0;
+            detail = next ? SWT.TRAVERSE_TAB_NEXT : SWT.TRAVERSE_TAB_PREVIOUS;
+            break;
+        }
+        case OS.GDK_Up:
+        case OS.GDK_Left:
+        case OS.GDK_Down:
+        case OS.GDK_Right: {
+            bool next = key is OS.GDK_Down || key is OS.GDK_Right;
+            if (parent !is null && (parent.style & SWT.MIRRORED) !is 0) {
+                if (key is OS.GDK_Left || key is OS.GDK_Right) next = !next;
+            }
+            detail = next ? SWT.TRAVERSE_ARROW_NEXT : SWT.TRAVERSE_ARROW_PREVIOUS;
+            break;
+        }
+        case OS.GDK_Page_Up:
+        case OS.GDK_Page_Down: {
+            all = true;
+            if ((keyEvent.state & OS.GDK_CONTROL_MASK) is 0) return false;
+            detail = key is OS.GDK_Page_Down ? SWT.TRAVERSE_PAGE_NEXT : SWT.TRAVERSE_PAGE_PREVIOUS;
+            break;
+        }
+        default:
+            return false;
+    }
+    Event event = new Event ();
+    event.doit = (code & detail) !is 0;
+    event.detail = detail;
+    event.time = keyEvent.time;
+    if (!setKeyState (event, keyEvent)) return false;
+    Shell shell = getShell ();
+    Control control = this;
+    do {
+        if (control.traverse (event)) return true;
+        if (!event.doit && control.hooks (SWT.Traverse)) return false;
+        if (control is shell) return false;
+        control = control.parent;
+    } while (all && control !is null);
+    return false;
+}
+
+int traversalCode (int key, GdkEventKey* event) {
+    int code = SWT.TRAVERSE_RETURN | SWT.TRAVERSE_TAB_NEXT |  SWT.TRAVERSE_TAB_PREVIOUS | SWT.TRAVERSE_PAGE_NEXT | SWT.TRAVERSE_PAGE_PREVIOUS;
+    Shell shell = getShell ();
+    if (shell.parent !is null) code |= SWT.TRAVERSE_ESCAPE;
+    return code;
+}
+
+bool traverse (Event event) {
+    /*
+    * It is possible (but unlikely), that application
+    * code could have disposed the widget in the traverse
+    * event.  If this happens, return true to stop further
+    * event processing.
+    */
+    sendEvent (SWT.Traverse, event);
+    if (isDisposed ()) return true;
+    if (!event.doit) return false;
+    switch (event.detail) {
+        case SWT.TRAVERSE_NONE:         return true;
+        case SWT.TRAVERSE_ESCAPE:           return traverseEscape ();
+        case SWT.TRAVERSE_RETURN:           return traverseReturn ();
+        case SWT.TRAVERSE_TAB_NEXT:     return traverseGroup (true);
+        case SWT.TRAVERSE_TAB_PREVIOUS: return traverseGroup (false);
+        case SWT.TRAVERSE_ARROW_NEXT:       return traverseItem (true);
+        case SWT.TRAVERSE_ARROW_PREVIOUS:   return traverseItem (false);
+        case SWT.TRAVERSE_MNEMONIC:     return traverseMnemonic (event.character);
+        case SWT.TRAVERSE_PAGE_NEXT:        return traversePage (true);
+        case SWT.TRAVERSE_PAGE_PREVIOUS:    return traversePage (false);
+        default:
+    }
+    return false;
+}
+
+bool traverseEscape () {
+    return false;
+}
+
+bool traverseGroup (bool next) {
+    Control root = computeTabRoot ();
+    Control group = computeTabGroup ();
+    Control [] list = root.computeTabList ();
+    int length = list.length;
+    int index = 0;
+    while (index < length) {
+        if (list [index] is group) break;
+        index++;
+    }
+    /*
+    * It is possible (but unlikely), that application
+    * code could have disposed the widget in focus in
+    * or out events.  Ensure that a disposed widget is
+    * not accessed.
+    */
+    if (index is length) return false;
+    int start = index, offset = (next) ? 1 : -1;
+    while ((index = ((index + offset + length) % length)) !is start) {
+        Control control = list [index];
+        if (!control.isDisposed () && control.setTabGroupFocus (next)) {
+            return true;
+        }
+    }
+    if (group.isDisposed ()) return false;
+    return group.setTabGroupFocus (next);
+}
+
+bool traverseItem (bool next) {
+    Control [] children = parent._getChildren ();
+    int length = children.length;
+    int index = 0;
+    while (index < length) {
+        if (children [index] is this) break;
+        index++;
+    }
+    /*
+    * It is possible (but unlikely), that application
+    * code could have disposed the widget in focus in
+    * or out events.  Ensure that a disposed widget is
+    * not accessed.
+    */
+    if (index is length) return false;
+    int start = index, offset = (next) ? 1 : -1;
+    while ((index = (index + offset + length) % length) !is start) {
+        Control child = children [index];
+        if (!child.isDisposed () && child.isTabItem ()) {
+            if (child.setTabItemFocus (next)) return true;
+        }
+    }
+    return false;
+}
+
+bool traverseReturn () {
+    return false;
+}
+
+bool traversePage (bool next) {
+    return false;
+}
+
+bool traverseMnemonic (char key) {
+    return mnemonicHit (key);
+}
+
+/**
+ * Forces all outstanding paint requests for the widget
+ * to be processed before this method returns. If there
+ * are no outstanding paint request, this method does
+ * nothing.
+ * <p>
+ * Note: This method does not cause a redraw.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #redraw()
+ * @see #redraw(int, int, int, int, bool)
+ * @see PaintListener
+ * @see SWT#Paint
+ */
+public void update () {
+    checkWidget ();
+    update (false, true);
+}
+
+void update (bool all, bool flush) {
+//  checkWidget();
+    if (!OS.GTK_WIDGET_VISIBLE (topHandle ())) return;
+    if ((OS.GTK_WIDGET_FLAGS (handle) & OS.GTK_REALIZED) is 0) return;
+    auto window = paintWindow ();
+    if (flush) display.flushExposes (window, all);
+    OS.gdk_window_process_updates (window, all);
+    OS.gdk_flush ();
+}
+
+void updateBackgroundMode () {
+    int oldState = state & PARENT_BACKGROUND;
+    checkBackground ();
+    if (oldState !is (state & PARENT_BACKGROUND)) {
+        setBackground ();
+    }
+}
+
+void updateLayout (bool all) {
+    /* Do nothing */
+}
+
+override int /*long*/ windowProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
+    switch (cast(int)/*64*/user_data) {
+        case EXPOSE_EVENT_INVERSE: {
+            if ((OS.GTK_VERSION <  OS.buildVERSION (2, 8, 0)) && ((state & OBSCURED) is 0)) {
+                Control control = findBackgroundControl ();
+                if (control !is null && control.backgroundImage !is null) {
+                    GdkEventExpose* gdkEvent = cast(GdkEventExpose*)arg0;
+                    auto paintWindow = paintWindow();
+                    auto window = gdkEvent.window;
+                    if (window !is paintWindow) break;
+                    auto gdkGC = OS.gdk_gc_new (cast(GdkDrawable*)window);
+                    OS.gdk_gc_set_clip_region (gdkGC, gdkEvent.region);
+                    int dest_x, dest_y;
+                    OS.gtk_widget_translate_coordinates (paintHandle (), control.paintHandle (), 0, 0, &dest_x, &dest_y);
+                    OS.gdk_gc_set_fill (gdkGC, OS.GDK_TILED);
+                    OS.gdk_gc_set_ts_origin (gdkGC, -dest_x, -dest_y);
+                    OS.gdk_gc_set_tile (gdkGC, cast(GdkPixmap*)control.backgroundImage.pixmap);
+                    OS.gdk_draw_rectangle (cast(GdkDrawable*)window, gdkGC, 1, gdkEvent.area.x, gdkEvent.area.y, gdkEvent.area.width, gdkEvent.area.height);
+                    OS.g_object_unref (gdkGC);
+                }
+            }
+            break;
+        default:
+        }
+    }
+    return super.windowProc (handle, arg0, user_data);
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/CoolBar.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,1208 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.CoolBar;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.CoolItem;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Listener;
+
+import java.lang.all;
+
+/**
+ * Instances of this class provide an area for dynamically
+ * positioning the items they contain.
+ * <p>
+ * The item children that may be added to instances of this class
+ * must be of type <code>CoolItem</code>.
+ * </p><p>
+ * Note that although this class is a subclass of <code>Composite</code>,
+ * it does not make sense to add <code>Control</code> children to it,
+ * or set a layout on it.
+ * </p><p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>FLAT, HORIZONTAL, VERTICAL</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * </p><p>
+ * Note: Only one of the styles HORIZONTAL and VERTICAL may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ * 
+ * @see <a href="http://www.eclipse.org/swt/snippets/#coolbar">CoolBar snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class CoolBar : Composite {
+
+    alias Composite.computeSize computeSize;
+    alias Composite.setCursor setCursor;
+
+    CoolItem[][] items;
+    CoolItem[] originalItems;
+    Cursor hoverCursor, dragCursor, cursor;
+    CoolItem dragging = null;
+    int mouseXOffset, itemXOffset;
+    bool isLocked = false;
+    bool inDispose = false;
+    static const int ROW_SPACING = 2;
+    static const int CLICK_DISTANCE = 3;
+    static const int DEFAULT_COOLBAR_WIDTH = 0;
+    static const int DEFAULT_COOLBAR_HEIGHT = 0;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Composite parent, int style) {
+    super (parent, checkStyle(style));
+    if ((style & SWT.VERTICAL) !is 0) {
+        this.style |= SWT.VERTICAL;
+        hoverCursor = new Cursor(display, SWT.CURSOR_SIZENS);
+    } else {
+        this.style |= SWT.HORIZONTAL;
+        hoverCursor = new Cursor(display, SWT.CURSOR_SIZEWE);
+    }
+    dragCursor = new Cursor(display, SWT.CURSOR_SIZEALL);
+    Listener listener = new class () Listener {
+        public void handleEvent(Event event) {
+            switch (event.type) {
+                case SWT.Dispose:           onDispose(event);           break;
+                case SWT.MouseDown:         onMouseDown(event);         break;
+                case SWT.MouseExit:         onMouseExit();              break;
+                case SWT.MouseMove:         onMouseMove(event);         break;
+                case SWT.MouseUp:           onMouseUp(event);           break;
+                case SWT.MouseDoubleClick:  onMouseDoubleClick(event);  break;
+                case SWT.Paint:             onPaint(event);             break;
+                case SWT.Resize:            onResize();                 break;
+                default:
+            }
+        }
+    };
+    int[] events = [
+        SWT.Dispose,
+        SWT.MouseDown,
+        SWT.MouseExit,
+        SWT.MouseMove,
+        SWT.MouseUp,
+        SWT.MouseDoubleClick,
+        SWT.Paint,
+        SWT.Resize
+    ];
+    for (int i = 0; i < events.length; i++) {
+        addListener(events[i], listener);
+    }
+}
+static int checkStyle (int style) {
+    style |= SWT.NO_FOCUS;
+    return (style | SWT.NO_REDRAW_RESIZE) & ~(SWT.V_SCROLL | SWT.H_SCROLL);
+}
+void _setCursor (Cursor cursor) {
+    if (this.cursor !is null) return;
+    super.setCursor (cursor);
+}
+protected override void checkSubclass () {
+    if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+public override Point computeSize (int wHint, int hHint, bool changed) {
+    checkWidget();
+    int width = 0, height = 0;
+    wrapItems((style & SWT.VERTICAL) !is 0 ? hHint : wHint);
+    bool flat = (style & SWT.FLAT) !is 0;
+    for (int row = 0; row < items.length; row++) {
+        int rowWidth = 0, rowHeight = 0;
+        for (int i = 0; i < items[row].length; i++) {
+            CoolItem item = items[row][i];
+            rowWidth += item.preferredWidth;
+            rowHeight = Math.max(rowHeight, item.preferredHeight);
+        }
+        height += rowHeight;
+        if (!flat && row > 0) height += ROW_SPACING;
+        width = Math.max(width, rowWidth);
+    }
+    wrapItems(getWidth());
+    if (width is 0) width = DEFAULT_COOLBAR_WIDTH;
+    if (height is 0) height = DEFAULT_COOLBAR_HEIGHT;
+    if (wHint !is SWT.DEFAULT) width = wHint;
+    if (hHint !is SWT.DEFAULT) height = hHint;
+    Rectangle trim = computeTrim(0, 0, width, height);
+    return fixPoint(trim.width, trim.height);
+}
+CoolItem getGrabbedItem(int x, int y) {
+    for (int row = 0; row < items.length; row++) {
+        for (int i = 0; i < items[row].length; i++) {
+            CoolItem item = items[row][i];
+            Rectangle bounds = item.internalGetBounds();
+            bounds.width = CoolItem.MINIMUM_WIDTH;
+            if (bounds.x > x) break;
+            if (bounds.y > y) return null;
+            if (bounds.contains(x, y)) {
+                return item;
+            }
+        }
+    }
+    return null;
+}
+/**
+ * Returns the item that is currently displayed at the given,
+ * zero-relative index. Throws an exception if the index is
+ * out of range.
+ *
+ * @param index the visual index of the item to return
+ * @return the item at the given visual index
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public CoolItem getItem (int index) {
+    checkWidget();
+    if (index < 0) error (SWT.ERROR_INVALID_RANGE);
+    for (int row = 0; row < items.length; row++) {
+        if (items[row].length > index) {
+            return items[row][index];
+        } else {
+            index -= items[row].length;
+        }
+    }
+    error (SWT.ERROR_INVALID_RANGE);
+    return null;
+}
+/**
+ * Returns the number of items contained in the receiver.
+ *
+ * @return the number of items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemCount () {
+    checkWidget();
+    return originalItems.length;
+}
+/**
+ * Returns an array of <code>CoolItem</code>s in the order
+ * in which they are currently being displayed.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the receiver's items in their current visual order
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public CoolItem [] getItems () {
+    checkWidget();
+    CoolItem [] result = new CoolItem [getItemCount()];
+    int offset = 0;
+    for (int row = 0; row < items.length; row++) {
+        System.arraycopy(items[row], 0, result, offset, items[row].length);
+        offset += items[row].length;
+    }
+    return result;
+}
+Point findItem (CoolItem item) {
+    for (int row = 0; row < items.length; row++) {
+        for (int i = 0; i < items[row].length; i++) {
+            if (items[row][i] ==/*eq*/ item ) return new Point(i, row);
+        }
+    }
+    return new Point(-1, -1);
+}
+void fixEvent (Event event) {
+    if ((style & SWT.VERTICAL) !is 0) {
+        int tmp = event.x;
+        event.x = event.y;
+        event.y = tmp;
+    }
+}
+Rectangle fixRectangle (int x, int y, int width, int height) {
+    if ((style & SWT.VERTICAL) !is 0) {
+        return new Rectangle(y, x, height, width);
+    }
+    return new Rectangle(x, y, width, height);
+}
+Point fixPoint (int x, int y) {
+    if ((style & SWT.VERTICAL) !is 0) {
+        return new Point(y, x);
+    }
+    return new Point(x, y);
+}
+/**
+ * Searches the receiver's items in the order they are currently
+ * being displayed, starting at the first item (index 0), until
+ * an item is found that is equal to the argument, and returns
+ * the index of that item. If no item is found, returns -1.
+ *
+ * @param item the search item
+ * @return the visual order index of the search item, or -1 if the item is not found
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the item is disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int indexOf (CoolItem item) {
+    checkWidget();
+    if (item is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (item.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
+    int answer = 0;
+    for (int row = 0; row < items.length; row++) {
+        for (int i = 0; i < items[row].length; i++) {
+            if (items[row][i] ==/*eq*/ item) {
+                return answer;
+            } else {
+                answer++;
+            }
+        }
+    }
+    return -1;
+}
+/**
+ * Insert the item into the row. Adjust the x and width values
+ * appropriately.
+ */
+void insertItemIntoRow(CoolItem item, int rowIndex, int x_root) {
+    int barWidth = getWidth();
+    int rowY = items[rowIndex][0].internalGetBounds().y;
+    int x = Math.max(0, Math.abs(x_root - toDisplay(new Point(0, 0)).x));
+
+    /* Find the insertion index and add the item. */
+    int index;
+    for (index = 0; index < items[rowIndex].length; index++) {
+        if (x < items[rowIndex][index].internalGetBounds().x) break;
+    }
+    if (index is 0) {
+        item.wrap = true;
+        items[rowIndex][0].wrap = false;
+    }
+    int oldLength = items[rowIndex].length;
+    CoolItem[] newRow = new CoolItem[oldLength + 1];
+    System.arraycopy(items[rowIndex], 0, newRow, 0, index);
+    newRow[index] = item;
+    System.arraycopy(items[rowIndex], index, newRow, index + 1, oldLength - index);
+    items[rowIndex] = newRow;
+
+    /* Adjust the width of the item to the left. */
+    if (index > 0) {
+        CoolItem left = items[rowIndex][index - 1];
+        Rectangle leftBounds = left.internalGetBounds();
+        int newWidth = x - leftBounds.x;
+        if (newWidth < left.internalGetMinimumWidth()) {
+            x += left.internalGetMinimumWidth() - newWidth;
+            newWidth = left.internalGetMinimumWidth();
+        }
+        left.setBounds(leftBounds.x, leftBounds.y, newWidth, leftBounds.height);
+        left.requestedWidth = newWidth;
+    }
+
+    /* Set the item's bounds. */
+    int width = 0, height = item.internalGetBounds().height;
+    if (index < items[rowIndex].length - 1) {
+        CoolItem right = items[rowIndex][index + 1];
+        width = right.internalGetBounds().x - x;
+        if (width < right.internalGetMinimumWidth()) {
+            moveRight(right, right.internalGetMinimumWidth() - width);
+            width = right.internalGetBounds().x - x;
+        }
+        item.setBounds(x, rowY, width, height);
+        if (width < item.internalGetMinimumWidth()) moveLeft(item, item.internalGetMinimumWidth() - width);
+    } else {
+        width = Math.max(item.internalGetMinimumWidth(), barWidth - x);
+        item.setBounds(x, rowY, width, height);
+        if (x + width > barWidth) moveLeft(item, x + width - barWidth);
+    }
+    Rectangle bounds = item.internalGetBounds();
+    item.requestedWidth = bounds.width;
+    internalRedraw(bounds.x, bounds.y, item.internalGetMinimumWidth(), bounds.height);
+}
+void internalRedraw (int x, int y, int width, int height) {
+    if ((style & SWT.VERTICAL) !is 0) {
+        redraw (y, x, height, width, false);
+    } else {
+        redraw (x, y, width, height, false);
+    }
+}
+void createItem (CoolItem item, int index) {
+    int itemCount = getItemCount(), row = 0;
+    if (!(0 <= index && index <= itemCount)) error (SWT.ERROR_INVALID_RANGE);
+    if (items.length is 0) {
+        items = new CoolItem[][]( 1,1 );
+        items[0][0] = item;
+    } else {
+        int i = index;
+        /* find the row to insert into */
+        if (index < itemCount) {
+            while (i > items[row].length) {
+                i -= items[row].length;
+                row++;
+            }
+        } else {
+            row = items.length - 1;
+            i = items[row].length;
+        }
+
+        // Set the last item in the row to the preferred size
+        // and add the new one just to it's right
+        int lastIndex = items[row].length - 1;
+        CoolItem lastItem = items[row][lastIndex];
+        if (lastItem.ideal) {
+            Rectangle bounds = lastItem.internalGetBounds();
+            bounds.width = lastItem.preferredWidth;
+            bounds.height = lastItem.preferredHeight;
+            lastItem.requestedWidth = lastItem.preferredWidth;
+            lastItem.setBounds(bounds.x, bounds.y, bounds.width, bounds.height);
+        }
+        if (i is 0) {
+            item.wrap = true;
+            items[row][0].wrap = false;
+        }
+        int oldLength = items[row].length;
+        CoolItem[] newRow = new CoolItem[oldLength + 1];
+        System.arraycopy(items[row], 0, newRow, 0, i);
+        newRow[i] = item;
+        System.arraycopy(items[row], i, newRow, i + 1, oldLength - i);
+        items[row] = newRow;
+    }
+    item.requestedWidth = CoolItem.MINIMUM_WIDTH;
+
+    int length = originalItems.length;
+    CoolItem [] newOriginals = new CoolItem [length + 1];
+    System.arraycopy (originalItems, 0, newOriginals, 0, index);
+    System.arraycopy (originalItems, index, newOriginals, index + 1, length - index);
+    newOriginals [index] = item;
+    originalItems = newOriginals;
+    layoutItems();
+
+}
+void destroyItem(CoolItem item) {
+    if (inDispose) return;
+    int row = findItem(item).y;
+    if (row is -1) return;
+    Rectangle bounds = item.internalGetBounds();
+    removeItemFromRow(item, row, true);
+
+    int index = 0;
+    while (index < originalItems.length) {
+        if (originalItems [index] is item) break;
+        index++;
+    }
+    int length = originalItems.length - 1;
+    CoolItem [] newOriginals = new CoolItem [length];
+    System.arraycopy (originalItems, 0, newOriginals, 0, index);
+    System.arraycopy (originalItems, index + 1, newOriginals, index, length - index);
+    originalItems = newOriginals;
+
+    internalRedraw(bounds.x, bounds.y, CoolItem.MINIMUM_WIDTH, bounds.height);
+    relayout();
+}
+void moveDown(CoolItem item, int x_root) {
+    int oldRowIndex = findItem(item).y;
+    bool resize = false;
+    if (items[oldRowIndex].length is 1) {
+        resize = true;
+        /* If this is the only item in the bottom row, don't move it. */
+        if (oldRowIndex is items.length - 1) return;
+    }
+    int newRowIndex = (items[oldRowIndex].length is 1) ? oldRowIndex : oldRowIndex + 1;
+    removeItemFromRow(item, oldRowIndex, false);
+    Rectangle old = item.internalGetBounds();
+    internalRedraw(old.x, old.y, CoolItem.MINIMUM_WIDTH, old.height);
+    if (newRowIndex is items.length) {
+        /* Create a new bottom row for the item. */
+        CoolItem[][] newRows = new CoolItem[][](items.length + 1);
+        SimpleType!(CoolItem[]).arraycopy(items, 0, newRows, 0, items.length);
+        int row = items.length;
+        newRows[row] = new CoolItem[1];
+        newRows[row][0] = item;
+        items = newRows;
+        resize = true;
+        item.wrap = true;
+    } else {
+        insertItemIntoRow(item, newRowIndex, x_root);
+    }
+    if (resize) {
+        relayout();
+    } else {
+        layoutItems();
+    }
+}
+void moveLeft(CoolItem item, int pixels) {
+    Point point = findItem(item);
+    int row = point.y;
+    int index = point.x;
+    if (index is 0) return;
+    Rectangle bounds = item.internalGetBounds();
+    int minSpaceOnLeft = 0;
+    for (int i = 0; i < index; i++) {
+        minSpaceOnLeft += items[row][i].internalGetMinimumWidth();
+    }
+    int x = Math.max(minSpaceOnLeft, bounds.x - pixels);
+    CoolItem left = items[row][index - 1];
+    Rectangle leftBounds = left.internalGetBounds();
+    if (leftBounds.x + left.internalGetMinimumWidth() > x) {
+        int shift = leftBounds.x + left.internalGetMinimumWidth() - x;
+        moveLeft(left, shift);
+        leftBounds = left.internalGetBounds();
+    }
+    int leftWidth = Math.max(left.internalGetMinimumWidth(), leftBounds.width - pixels);
+    left.setBounds(leftBounds.x, leftBounds.y, leftWidth, leftBounds.height);
+    left.requestedWidth = leftWidth;
+    int width = bounds.width + (bounds.x - x);
+    item.setBounds(x, bounds.y, width, bounds.height);
+    item.requestedWidth = width;
+
+    int damagedWidth = bounds.x - x + CoolItem.MINIMUM_WIDTH;
+    if (damagedWidth > CoolItem.MINIMUM_WIDTH) {
+        internalRedraw(x, bounds.y, damagedWidth, bounds.height);
+    }
+}
+void moveRight(CoolItem item, int pixels) {
+    Point point = findItem(item);
+    int row = point.y;
+    int index = point.x;
+    if (index is 0) return;
+    Rectangle bounds = item.internalGetBounds();
+    int minSpaceOnRight = 0;
+    for (int i = index; i < items[row].length; i++) {
+        minSpaceOnRight += items[row][i].internalGetMinimumWidth();
+    }
+    int max = getWidth() - minSpaceOnRight;
+    int x = Math.min(max, bounds.x + pixels);
+    int width = 0;
+    if (index + 1 is items[row].length) {
+        width = getWidth() - x;
+    } else {
+        CoolItem right = items[row][index + 1];
+        Rectangle rightBounds = right.internalGetBounds();
+        if (x + item.internalGetMinimumWidth() > rightBounds.x) {
+            int shift = x + item.internalGetMinimumWidth() - rightBounds.x;
+            moveRight(right, shift);
+            rightBounds = right.internalGetBounds();
+        }
+        width = rightBounds.x - x;
+    }
+    item.setBounds(x, bounds.y, width, bounds.height);
+    item.requestedWidth = width;
+    CoolItem left = items[row][index - 1];
+    Rectangle leftBounds = left.internalGetBounds();
+    int leftWidth = x - leftBounds.x;
+    left.setBounds(leftBounds.x, leftBounds.y, leftWidth, leftBounds.height);
+    left.requestedWidth = leftWidth;
+
+    int damagedWidth = x - bounds.x + CoolItem.MINIMUM_WIDTH + CoolItem.MARGIN_WIDTH;
+    if (x - bounds.x > 0) {
+        internalRedraw(bounds.x - CoolItem.MARGIN_WIDTH, bounds.y, damagedWidth, bounds.height);
+    }
+}
+void moveUp(CoolItem item, int x_root) {
+    Point point = findItem(item);
+    int oldRowIndex = point.y;
+    bool resize = false;
+    if (items[oldRowIndex].length is 1) {
+        resize = true;
+        /* If this is the only item in the top row, don't move it. */
+        if (oldRowIndex is 0) return;
+    }
+    removeItemFromRow(item, oldRowIndex, false);
+    Rectangle old = item.internalGetBounds();
+    internalRedraw(old.x, old.y, CoolItem.MINIMUM_WIDTH, old.height);
+    int newRowIndex = Math.max(0, oldRowIndex - 1);
+    if (oldRowIndex is 0) {
+        /* Create a new top row for the item. */
+        CoolItem[][] newRows = new CoolItem[][]( items.length + 1 );
+        SimpleType!(CoolItem[]).arraycopy(items, 0, newRows, 1, items.length);
+        newRows[0] = new CoolItem[1];
+        newRows[0][0] = item;
+        items = newRows;
+        resize = true;
+        item.wrap = true;
+    } else {
+        insertItemIntoRow(item, newRowIndex, x_root);
+    }
+    if (resize) {
+        relayout();
+    } else {
+        layoutItems();
+    }
+}
+void onDispose(Event event) {
+    /*
+     * Usually when an item is disposed, destroyItem will change the size of the items array
+     * and reset the bounds of all the remaining cool items.
+     * Since the whole cool bar is being disposed, this is not necessary.  For speed
+     * the inDispose flag is used to skip over this part of the item dispose.
+     */
+    if (inDispose) return;
+    inDispose = true;
+    notifyListeners(SWT.Dispose, event);
+    event.type = SWT.None;
+    for (int i = 0; i < items.length; i++) {
+        for (int j = 0; j < items[i].length; j++) {
+            items[i][j].dispose();
+        }
+    }
+    hoverCursor.dispose();
+    dragCursor.dispose();
+    cursor = null;
+}
+void onMouseDown(Event event) {
+    if (isLocked || event.button !is 1) return;
+    fixEvent(event);
+    dragging = getGrabbedItem(event.x, event.y);
+    if (dragging !is null) {
+        mouseXOffset = event.x;
+        itemXOffset = mouseXOffset - dragging.internalGetBounds().x;
+        _setCursor(dragCursor);
+    }
+    fixEvent(event);
+}
+void onMouseExit() {
+    if (dragging is null) _setCursor(null);
+}
+void onMouseMove(Event event) {
+    if (isLocked) return;
+    fixEvent(event);
+    CoolItem grabbed = getGrabbedItem(event.x, event.y);
+    if (dragging !is null) {
+        int left_root = toDisplay(new Point(event.x - itemXOffset, event.y)).x;
+        Rectangle bounds = dragging.internalGetBounds();
+        if (event.y < bounds.y) {
+            moveUp(dragging, left_root);
+        } else if (event.y > bounds.y + bounds.height){
+            moveDown(dragging, left_root);
+        } else if (event.x < mouseXOffset) {
+            int distance = Math.min(mouseXOffset, bounds.x + itemXOffset) - event.x;
+            if (distance > 0) moveLeft(dragging, distance);
+        } else if (event.x > mouseXOffset) {
+            int distance = event.x - Math.max(mouseXOffset, bounds.x + itemXOffset);
+            if (distance > 0) moveRight(dragging, distance);
+        }
+        mouseXOffset = event.x;
+    } else {
+        if (grabbed !is null) {
+            _setCursor(hoverCursor);
+        } else {
+            _setCursor(null);
+        }
+    }
+    fixEvent(event);
+}
+void onMouseUp(Event event) {
+    _setCursor(null);
+    dragging = null;
+}
+void onMouseDoubleClick(Event event) {
+    if (isLocked) return;
+    dragging = null;
+    fixEvent(event);
+    CoolItem target = getGrabbedItem(event.x, event.y);
+    if (target is null) {
+        _setCursor(null);
+    } else {
+        Point location = findItem(target);
+        int row = location.y;
+        int index = location.x;
+        if (items[row].length > 1) {
+            Rectangle  bounds = target.internalGetBounds();
+            int maxSize = getWidth ();
+            for (int i = 0; i < items[row].length; i++) {
+                if (i !is index) {
+                    maxSize -= items[row][i].internalGetMinimumWidth();
+                }
+            }
+            if (bounds.width is maxSize) {
+                /* The item is at its maximum width. It should be resized to its minimum width. */
+                int distance = bounds.width - target.internalGetMinimumWidth();
+                if (index + 1 < items[row].length) {
+                    /* There is an item to the right. Maximize it. */
+                    CoolItem right = items[row][index + 1];
+                    moveLeft(right, distance);
+                } else {
+                    /* There is no item to the right. Move the item all the way right. */
+                    moveRight(target, distance);
+                }
+            } else if (bounds.width < target.preferredWidth) {
+                /* The item is less than its preferredWidth. Resize to preferredWidth. */
+                int distance = target.preferredWidth - bounds.width;
+                if (index + 1 < items[row].length) {
+                    CoolItem right = items[row][index + 1];
+                    moveRight(right, distance);
+                    distance = target.preferredWidth - target.internalGetBounds().width;
+                }
+                if (distance > 0) {
+                    moveLeft(target, distance);
+                }
+            } else {
+                /* The item is at its minimum width. Maximize it. */
+                for (int i = 0; i < items[row].length; i++) {
+                    if (i !is index) {
+                        CoolItem item = items[row][i];
+                        item.requestedWidth = Math.max(item.internalGetMinimumWidth(), CoolItem.MINIMUM_WIDTH);
+                    }
+                }
+                target.requestedWidth = maxSize;
+                layoutItems();
+            }
+            _setCursor(hoverCursor);
+        }
+    }
+    fixEvent(event);
+}
+void onPaint(Event event) {
+    GC gc = event.gc;
+    if (items.length is 0) return;
+    Color shadowColor = display.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW);
+    Color highlightColor = display.getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW);
+    bool vertical = (style & SWT.VERTICAL) !is 0;
+    bool flat = (style & SWT.FLAT) !is 0;
+    int stopX = getWidth();
+    Rectangle rect;
+    Rectangle clipping = gc.getClipping();
+    for (int row = 0; row < items.length; row++) {
+        Rectangle bounds = new Rectangle(0, 0, 0, 0);
+        for (int i = 0; i < items[row].length; i++) {
+            bounds = items[row][i].internalGetBounds();
+            rect = fixRectangle(bounds.x, bounds.y, bounds.width, bounds.height);
+            if (!clipping.intersects(rect)) continue;
+            bool nativeGripper = false;
+
+            /* Draw gripper. */
+            if (!isLocked) {
+                rect = fixRectangle(bounds.x, bounds.y, CoolItem.MINIMUM_WIDTH, bounds.height);
+                if (!flat)  nativeGripper = drawGripper(rect.x, rect.y, rect.width, rect.height, vertical);
+                if (!nativeGripper) {
+                    int grabberTrim = 2;
+                    int grabberHeight = bounds.height - (2 * grabberTrim) - 1;
+                    gc.setForeground(shadowColor);
+                    rect = fixRectangle(
+                            bounds.x + CoolItem.MARGIN_WIDTH,
+                            bounds.y + grabberTrim,
+                            2,
+                            grabberHeight);
+                    gc.drawRectangle(rect);
+                    gc.setForeground(highlightColor);
+                    rect = fixRectangle(
+                            bounds.x + CoolItem.MARGIN_WIDTH,
+                            bounds.y + grabberTrim + 1,
+                            bounds.x + CoolItem.MARGIN_WIDTH,
+                            bounds.y + grabberTrim + grabberHeight - 1);
+                    gc.drawLine(rect.x, rect.y, rect.width, rect.height);
+                    rect = fixRectangle(
+                            bounds.x + CoolItem.MARGIN_WIDTH,
+                            bounds.y + grabberTrim,
+                            bounds.x + CoolItem.MARGIN_WIDTH + 1,
+                            bounds.y + grabberTrim);
+                    gc.drawLine(rect.x, rect.y, rect.width, rect.height);
+                }
+            }
+
+            /* Draw separator. */
+            if (!flat && !nativeGripper && i !is 0) {
+                gc.setForeground(shadowColor);
+                rect = fixRectangle(bounds.x, bounds.y, bounds.x, bounds.y + bounds.height - 1);
+                gc.drawLine(rect.x, rect.y, rect.width, rect.height);
+                gc.setForeground(highlightColor);
+                rect = fixRectangle(bounds.x + 1, bounds.y, bounds.x + 1, bounds.y + bounds.height - 1);
+                gc.drawLine(rect.x, rect.y, rect.width, rect.height);
+            }
+        }
+        if (!flat && row + 1 < items.length) {
+            /* Draw row separator. */
+            int separatorY = bounds.y + bounds.height;
+            gc.setForeground(shadowColor);
+            rect = fixRectangle(0, separatorY, stopX, separatorY);
+            gc.drawLine(rect.x, rect.y, rect.width, rect.height);
+            gc.setForeground(highlightColor);
+            rect = fixRectangle(0, separatorY + 1, stopX, separatorY + 1);
+            gc.drawLine(rect.x, rect.y, rect.width, rect.height);
+        }
+    }
+}
+void onResize () {
+    layoutItems ();
+}
+override void removeControl (Control control) {
+    super.removeControl (control);
+    CoolItem [] items = getItems ();
+    for (int i=0; i<items.length; i++) {
+        CoolItem item = items [i];
+        if (item.control is control) item.setControl (null);
+    }
+}
+/**
+ * Remove the item from the row. Adjust the x and width values
+ * appropriately.
+ */
+void removeItemFromRow(CoolItem item, int rowIndex, bool disposed) {
+    int index = findItem(item).x;
+    int newLength = items[rowIndex].length - 1;
+    Rectangle itemBounds = item.internalGetBounds();
+    item.wrap = false;
+    if (newLength > 0) {
+        CoolItem[] newRow = new CoolItem[newLength];
+        System.arraycopy(items[rowIndex], 0, newRow, 0, index);
+        System.arraycopy(items[rowIndex], index + 1, newRow, index, newRow.length - index);
+        items[rowIndex] = newRow;
+        items[rowIndex][0].wrap = true;
+    } else {
+        CoolItem[][] newRows = new CoolItem[][]( items.length - 1 );
+        SimpleType!(CoolItem[]).arraycopy(items, 0, newRows, 0, rowIndex);
+        SimpleType!(CoolItem[]).arraycopy(items, rowIndex + 1, newRows, rowIndex, newRows.length - rowIndex);
+        items = newRows;
+        return;
+    }
+    if (!disposed) {
+        if (index is 0) {
+            CoolItem first = items[rowIndex][0];
+            Rectangle bounds = first.internalGetBounds();
+            int width = bounds.x + bounds.width;
+            first.setBounds(0, bounds.y, width, bounds.height);
+            first.requestedWidth = width;
+            internalRedraw(bounds.x, bounds.y, CoolItem.MINIMUM_WIDTH, bounds.height);
+        } else {
+            CoolItem previous = items[rowIndex][index - 1];
+            Rectangle bounds = previous.internalGetBounds();
+            int width = bounds.width + itemBounds.width;
+            previous.setBounds(bounds.x, bounds.y, width, bounds.height);
+            previous.requestedWidth = width;
+        }
+    }
+}
+/**
+ * Return the height of the bar after it has
+ * been properly laid out for the given width.
+ */
+int layoutItems () {
+    int y = 0, width;
+    if ((style&SWT.VERTICAL) !is 0) {
+        width = getClientArea().height;
+    } else {
+        width = getClientArea().width;
+    }
+    wrapItems(width);
+    int rowSpacing = (style & SWT.FLAT) !is 0 ? 0 : ROW_SPACING;
+    for (int row = 0; row < items.length; row++) {
+        int count = items[row].length;
+        int x = 0;
+
+        /* determine the height and the available width for the row */
+        int rowHeight = 0;
+        int available = width;
+        for (int i = 0; i < count; i++) {
+            CoolItem item = items[row][i];
+            rowHeight = Math.max(rowHeight, item.internalGetBounds().height);
+            available -= item.internalGetMinimumWidth();
+        }
+        if (row > 0) y += rowSpacing;
+
+        /* lay the items out */
+        for (int i = 0; i < count; i++) {
+            CoolItem child = items[row][i];
+            int newWidth = available + child.internalGetMinimumWidth();
+            if (i + 1 < count) {
+                newWidth = Math.min(newWidth, child.requestedWidth);
+                available -= (newWidth - child.internalGetMinimumWidth());
+            }
+            Rectangle oldBounds = child.internalGetBounds();
+            Rectangle newBounds = new Rectangle(x, y, newWidth, rowHeight);
+            if ( oldBounds !=/*eq*/ newBounds) {
+                child.setBounds(newBounds.x, newBounds.y, newBounds.width, newBounds.height);
+                Rectangle damage = new Rectangle(0, 0, 0, 0);
+                /* Cases are in descending order from most area to redraw to least. */
+                if (oldBounds.y !is newBounds.y) {
+                    damage = newBounds;
+                    damage.add(oldBounds);
+                    /* Redraw the row separator as well. */
+                    damage.y -= rowSpacing;
+                    damage.height += 2 * rowSpacing;
+                } else if (oldBounds.height !is newBounds.height) {
+                    /*
+                     * Draw from the bottom of the gripper to the bottom of the new area.
+                     * (Bottom of the gripper is -3 from the bottom of the item).
+                     */
+                    damage.y = newBounds.y + Math.min(oldBounds.height, newBounds.height) - 3;
+                    damage.height = newBounds.y + newBounds.height + rowSpacing;
+                    damage.x = oldBounds.x - CoolItem.MARGIN_WIDTH;
+                    damage.width = oldBounds.width + CoolItem.MARGIN_WIDTH;
+                } else if (oldBounds.x !is newBounds.x) {
+                    /* Redraw only the difference between the separators. */
+                    damage.x = Math.min(oldBounds.x, newBounds.x);
+                    damage.width = Math.abs(oldBounds.x - newBounds.x) + CoolItem.MINIMUM_WIDTH;
+                    damage.y = oldBounds.y;
+                    damage.height = oldBounds.height;
+                }
+                internalRedraw(damage.x, damage.y, damage.width, damage.height);
+            }
+            x += newWidth;
+        }
+        y += rowHeight;
+    }
+    return y;
+}
+void relayout() {
+    Point size = getSize();
+    int height = layoutItems();
+    if ((style & SWT.VERTICAL) !is 0) {
+        Rectangle trim = computeTrim (0, 0, height, 0);
+        if (height !is size.x) super.setSize(trim.width, size.y);
+    } else {
+        Rectangle trim = computeTrim (0, 0, 0, height);
+        if (height !is size.y) super.setSize(size.x, trim.height);
+    }
+}
+/**
+ * Returns an array of zero-relative ints that map
+ * the creation order of the receiver's items to the
+ * order in which they are currently being displayed.
+ * <p>
+ * Specifically, the indices of the returned array represent
+ * the current visual order of the items, and the contents
+ * of the array represent the creation order of the items.
+ * </p><p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the current visual order of the receiver's items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int[] getItemOrder () {
+    checkWidget ();
+    int count = getItemCount ();
+    int [] indices = new int [count];
+    count = 0;
+    for (int i = 0; i < items.length; i++) {
+        for (int j = 0; j < items[i].length; j++) {
+            CoolItem item = items[i][j];
+            int index = 0;
+            while (index<originalItems.length) {
+                if (originalItems [index] is item) break;
+                index++;
+            }
+            if (index is originalItems.length) error (SWT.ERROR_CANNOT_GET_ITEM);
+            indices [count++] = index;
+        }
+    }
+    return indices;
+}
+void setItemOrder (int[] itemOrder) {
+    // SWT extension: allow null for zero length string
+    //if (itemOrder is null) error(SWT.ERROR_NULL_ARGUMENT);
+    int count = originalItems.length;
+    if (itemOrder.length !is count) error(SWT.ERROR_INVALID_ARGUMENT);
+
+    /* Ensure that itemOrder does not contain any duplicates. */
+    bool [] set = new bool [count];
+    for (int i = 0; i < set.length; i++) set [i] = false;
+    for (int i = 0; i < itemOrder.length; i++) {
+        if (itemOrder [i] < 0 || itemOrder [i] >= count) error (SWT.ERROR_INVALID_ARGUMENT);
+        if (set [itemOrder [i]]) error (SWT.ERROR_INVALID_ARGUMENT);
+        set [itemOrder [i]] = true;
+    }
+
+    CoolItem[] row = new CoolItem[count];
+    for (int i = 0; i < count; i++) {
+        row[i] = originalItems[itemOrder[i]];
+    }
+    items = new CoolItem[][](1,count);
+    items[0] = row;
+}
+/**
+ * Returns an array of points whose x and y coordinates describe
+ * the widths and heights (respectively) of the items in the receiver
+ * in the order in which they are currently being displayed.
+ *
+ * @return the receiver's item sizes in their current visual order
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Point[] getItemSizes () {
+    checkWidget();
+    CoolItem[] items = getItems();
+    Point[] sizes = new Point[items.length];
+    for (int i = 0; i < items.length; i++) {
+        sizes[i] = items[i].getSize();
+    }
+    return sizes;
+}
+void setItemSizes (Point[] sizes) {
+    // SWT extension: allow null for zero length string
+    //if (sizes is null) error(SWT.ERROR_NULL_ARGUMENT);
+    CoolItem[] items = getItems();
+    if (sizes.length !is items.length) error(SWT.ERROR_INVALID_ARGUMENT);
+    for (int i = 0; i < items.length; i++) {
+        items[i].setSize(sizes[i]);
+    }
+}
+/**
+ * Returns whether or not the receiver is 'locked'. When a coolbar
+ * is locked, its items cannot be repositioned.
+ *
+ * @return true if the coolbar is locked, false otherwise
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ */
+public bool getLocked () {
+    checkWidget ();
+    return isLocked;
+}
+int getWidth () {
+    if ((style & SWT.VERTICAL) !is 0) return getSize().y;
+    return getSize().x;
+}
+/**
+ * Returns an array of ints that describe the zero-relative
+ * indices of any item(s) in the receiver that will begin on
+ * a new row. The 0th visible item always begins the first row,
+ * therefore it does not count as a wrap index.
+ *
+ * @return an array containing the receiver's wrap indices, or an empty array if all items are in one row
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int[] getWrapIndices () {
+    checkWidget();
+    if (items.length <= 1) return null;
+    int[] wrapIndices = new int[]( items.length - 1 );
+    int i = 0, nextWrap = items[0].length;
+    for (int row = 1; row < items.length; row++) {
+        if (items[row][0].wrap) wrapIndices[i++] = nextWrap;
+        nextWrap += items[row].length;
+    }
+    if (i !is wrapIndices.length) {
+        int[] tmp = new int[i];
+        System.arraycopy(wrapIndices, 0, tmp, 0, i);
+        return tmp;
+    }
+    return wrapIndices;
+}
+/**
+ * Sets whether or not the receiver is 'locked'. When a coolbar
+ * is locked, its items cannot be repositioned.
+ *
+ * @param locked lock the coolbar if true, otherwise unlock the coolbar
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ */
+public void setLocked (bool locked) {
+    checkWidget ();
+    if (isLocked !is locked) {
+        redraw();
+    }
+    isLocked = locked;
+
+}
+/**
+ * Sets the indices of all item(s) in the receiver that will
+ * begin on a new row. The indices are given in the order in
+ * which they are currently being displayed. The 0th item
+ * always begins the first row, therefore it does not count
+ * as a wrap index. If indices is null or empty, the items
+ * will be placed on one line.
+ *
+ * @param indices an array of wrap indices, or null
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setWrapIndices (int[] indices) {
+    checkWidget();
+    if (indices is null) indices = new int[0];
+    int count = originalItems.length;
+    for (int i=0; i<indices.length; i++) {
+        if (indices[i] < 0 || indices[i] >= count) {
+            error (SWT.ERROR_INVALID_ARGUMENT);
+        }
+    }
+    for (int i=0; i<originalItems.length; i++) {
+        originalItems[i].wrap = false;
+    }
+    for (int i=0; i<indices.length; i++) {
+        int index = indices[i];
+        for (int row = 0; row < items.length; row++) {
+            if (items[row].length > index) {
+                items[row][index].wrap = true;
+                break;
+            } else {
+                index -= items[row].length;
+            }
+        }
+    }
+    relayout();
+}
+public override void setCursor (Cursor cursor) {
+    checkWidget ();
+    super.setCursor (this.cursor = cursor);
+}
+/**
+ * Sets the receiver's item order, wrap indices, and item sizes
+ * all at once. This method is typically used to restore the
+ * displayed state of the receiver to a previously stored state.
+ * <p>
+ * The item order is the order in which the items in the receiver
+ * should be displayed, given in terms of the zero-relative ordering
+ * of when the items were added.
+ * </p><p>
+ * The wrap indices are the indices of all item(s) in the receiver
+ * that will begin on a new row. The indices are given in the order
+ * specified by the item order. The 0th item always begins the first
+ * row, therefore it does not count as a wrap index. If wrap indices
+ * is null or empty, the items will be placed on one line.
+ * </p><p>
+ * The sizes are specified in an array of points whose x and y
+ * coordinates describe the new widths and heights (respectively)
+ * of the receiver's items in the order specified by the item order.
+ * </p>
+ *
+ * @param itemOrder an array of indices that describe the new order to display the items in
+ * @param wrapIndices an array of wrap indices, or null
+ * @param sizes an array containing the new sizes for each of the receiver's items in visual order
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if item order or sizes is not the same length as the number of items</li>
+ * </ul>
+ */
+public void setItemLayout (int[] itemOrder, int[] wrapIndices, Point[] sizes) {
+    checkWidget();
+    setItemOrder(itemOrder);
+    setWrapIndices(wrapIndices);
+    setItemSizes(sizes);
+    relayout();
+}
+void wrapItems (int maxWidth) {
+    int itemCount = originalItems.length;
+    if (itemCount < 2) return;
+    CoolItem[] itemsVisual = new CoolItem[itemCount];
+    int start = 0;
+    for (int row = 0; row < items.length; row++) {
+        System.arraycopy(items[row], 0, itemsVisual, start, items[row].length);
+        start += items[row].length;
+    }
+    CoolItem[][] newItems = new CoolItem[][](itemCount);
+    int rowCount = 0, rowWidth =  0;
+    start = 0;
+    for (int i = 0; i < itemCount; i++) {
+        CoolItem item = itemsVisual[i];
+        int itemWidth = item.internalGetMinimumWidth();
+        if ((i > 0 && item.wrap) || (maxWidth !is SWT.DEFAULT && rowWidth + itemWidth > maxWidth)) {
+            if (i is start) {
+                newItems[rowCount] = new CoolItem[1];
+                newItems[rowCount][0] = item;
+                start = i + 1;
+                rowWidth = 0;
+            } else {
+                int count = i - start;
+                newItems[rowCount] = new CoolItem[count];
+                System.arraycopy(itemsVisual, start, newItems[rowCount], 0, count);
+                start = i;
+                rowWidth = itemWidth;
+            }
+            rowCount++;
+        } else {
+            rowWidth += itemWidth;
+        }
+    }
+    if (start < itemCount) {
+        int count = itemCount - start;
+        newItems[rowCount] = new CoolItem[count];
+        System.arraycopy(itemsVisual, start, newItems[rowCount], 0, count);
+        rowCount++;
+    }
+    if (newItems.length !is rowCount) {
+        CoolItem[][] tmp = new CoolItem[][](rowCount);
+        SimpleType!(CoolItem[]).arraycopy(newItems, 0, tmp, 0, rowCount);
+        items = tmp;
+    } else {
+        items = newItems;
+    }
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/CoolItem.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,674 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.CoolItem;
+
+import java.lang.all;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.PaletteData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.CoolBar;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.swt.widgets.Listener;
+
+/**
+ * Instances of this class are selectable user interface
+ * objects that represent the dynamically positionable
+ * areas of a <code>CoolBar</code>.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>DROP_DOWN</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ * 
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class CoolItem : Item {
+    Control control;
+    CoolBar parent;
+    bool ideal;
+    int preferredWidth, preferredHeight, minimumWidth, minimumHeight, requestedWidth;
+    Rectangle itemBounds;
+
+    static const int MARGIN_WIDTH = 4;
+    static const int GRABBER_WIDTH = 2;
+    static const int MINIMUM_WIDTH = (2 * MARGIN_WIDTH) + GRABBER_WIDTH;
+
+    private int CHEVRON_HORIZONTAL_TRIM = -1;           //platform dependent values
+    private int CHEVRON_VERTICAL_TRIM = -1;
+    private static const int CHEVRON_LEFT_MARGIN = 2;
+    private static const int CHEVRON_IMAGE_WIDTH = 8;   //Width to draw the double arrow
+
+    ToolBar chevron;
+    bool wrap;
+    Image arrowImage = null;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>CoolBar</code>) and a style value
+ * describing its behavior and appearance. The item is added
+ * to the end of the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#DROP_DOWN
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (CoolBar parent, int style) {
+    super(parent, style);
+    itemBounds = new Rectangle(0, 0, 0, 0);
+    this.parent = parent;
+    parent.createItem (this, parent.getItemCount());
+    calculateChevronTrim ();
+}
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>CoolBar</code>), a style value
+ * describing its behavior and appearance, and the index
+ * at which to place it in the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ * @param index the zero-relative index at which to store the receiver in its parent
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the parent (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#DROP_DOWN
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (CoolBar parent, int style, int index) {
+    super(parent, style);
+    itemBounds = new Rectangle(0, 0, 0, 0);
+    this.parent = parent;
+    parent.createItem (this, index);
+    calculateChevronTrim ();
+}
+/**
+ * Adds the listener to the collection of listeners that will
+ * be notified when the control is selected by the user, by sending it one
+ * of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * If <code>widgetSelected</code> is called when the mouse is over
+ * the drop-down arrow (or 'chevron') portion of the cool item,
+ * the event object detail field contains the value <code>SWT.ARROW</code>,
+ * and the x and y fields in the event object represent the point at
+ * the bottom left of the chevron, where the menu should be popped up.
+ * <code>widgetDefaultSelected</code> is not called.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the control is selected by the user
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ *
+ * @since 2.0
+ */
+public void addSelectionListener(SelectionListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Selection,typedListener);
+    addListener (SWT.DefaultSelection,typedListener);
+}
+protected override void checkSubclass () {
+    if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+/*
+ * Find the trim size of the Toolbar widget in the current platform.
+ */
+void calculateChevronTrim () {
+    ToolBar tb = new ToolBar (parent, SWT.FLAT);
+    ToolItem ti = new ToolItem (tb, SWT.PUSH);
+    Image image = new Image (display, 1, 1);
+    ti.setImage (image);
+    Point size = tb.computeSize (SWT.DEFAULT, SWT.DEFAULT);
+    size = parent.fixPoint(size.x, size.y);
+    CHEVRON_HORIZONTAL_TRIM = size.x - 1;
+    CHEVRON_VERTICAL_TRIM = size.y - 1;
+    tb.dispose ();
+    ti.dispose ();
+    image.dispose ();
+}
+/**
+ * Returns the preferred size of the receiver.
+ * <p>
+ * The <em>preferred size</em> of a <code>CoolItem</code> is the size that
+ * it would best be displayed at. The width hint and height hint arguments
+ * allow the caller to ask the instance questions such as "Given a particular
+ * width, how high does it need to be to show all of the contents?"
+ * To indicate that the caller does not wish to constrain a particular
+ * dimension, the constant <code>SWT.DEFAULT</code> is passed for the hint.
+ * </p>
+ *
+ * @param wHint the width hint (can be <code>SWT.DEFAULT</code>)
+ * @param hHint the height hint (can be <code>SWT.DEFAULT</code>)
+ * @return the preferred size
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Layout
+ * @see #getBounds
+ * @see #getSize
+ * @see Control#getBorderWidth
+ * @see Scrollable#computeTrim
+ * @see Scrollable#getClientArea
+ */
+public Point computeSize (int wHint, int hHint) {
+    checkWidget();
+    int width = wHint, height = hHint;
+    if (wHint is SWT.DEFAULT) width = 32;
+    if (hHint is SWT.DEFAULT) height = 32;
+    if ((parent.style & SWT.VERTICAL) !is 0) {
+        height += MINIMUM_WIDTH;
+    } else {
+        width += MINIMUM_WIDTH;
+    }
+    return new Point (width, height);
+}
+public override void dispose () {
+    if (isDisposed()) return;
+
+    /*
+     * Must call parent.destroyItem() before super.dispose(), since it needs to
+     * query the bounds to properly remove the item.
+     */
+    parent.destroyItem(this);
+    super.dispose ();
+    parent = null;
+    control = null;
+
+    /*
+     * Although the parent for the chevron is the CoolBar (CoolItem can not be the parent)
+     * it has to be disposed with the item
+     */
+    if (chevron !is null && !chevron.isDisposed()) chevron.dispose();
+    chevron = null;
+    if (arrowImage !is null && !arrowImage.isDisposed()) arrowImage.dispose();
+    arrowImage = null;
+}
+
+Image createArrowImage (int width, int height) {
+    Point point = parent.fixPoint(width, height);
+    width = point.x;
+    height = point.y;
+    Color foreground = parent.getForeground ();
+    Color black = display.getSystemColor (SWT.COLOR_BLACK);
+    Color background = parent.getBackground ();
+
+    PaletteData palette = new PaletteData ( [foreground.getRGB(), background.getRGB(), black.getRGB() ] );
+    ImageData imageData = new ImageData (width, height, 4, palette);
+    imageData.transparentPixel = 1;
+    Image image = new Image (display, imageData);
+
+    GC gc = new GC (image, parent.getStyle() & SWT.RIGHT_TO_LEFT);
+    gc.setBackground (background);
+    gc.fillRectangle (0, 0, width, height);
+    gc.setForeground (black);
+
+    int startX = 0 ;
+    if ((parent.style & SWT.VERTICAL) !is 0) {
+        startX = width - CHEVRON_IMAGE_WIDTH;
+    }
+    int startY = height / 6;
+    int step = 2;
+    gc.drawLine (startX, startY, startX + step, startY + step);
+    gc.drawLine (startX, startY + (2 * step), startX + step, startY + step);
+    startX++;
+    gc.drawLine (startX, startY, startX + step, startY + step);
+    gc.drawLine (startX, startY + (2 * step), startX + step, startY + step);
+    startX += 3;
+    gc.drawLine (startX, startY, startX + step, startY + step);
+    gc.drawLine (startX, startY + (2 * step), startX + step, startY + step);
+    startX++;
+    gc.drawLine (startX, startY, startX + step, startY + step);
+    gc.drawLine (startX, startY + (2 * step), startX + step, startY + step);
+    gc.dispose ();
+    return image;
+}
+/**
+ * Returns a rectangle describing the receiver's size and location
+ * relative to its parent.
+ *
+ * @return the receiver's bounding rectangle
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Rectangle getBounds () {
+    checkWidget();
+    return parent.fixRectangle(itemBounds.x, itemBounds.y, itemBounds.width, itemBounds.height);
+}
+Rectangle internalGetBounds () {
+    return new Rectangle(itemBounds.x, itemBounds.y, itemBounds.width, itemBounds.height);
+}
+/**
+ * Returns the control that is associated with the receiver.
+ *
+ * @return the control that is contained by the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Control getControl () {
+    checkWidget();
+    return control;
+}
+/**
+ * Returns the minimum size that the cool item can
+ * be resized to using the cool item's gripper.
+ *
+ * @return a point containing the minimum width and height of the cool item, in pixels
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ */
+public Point getMinimumSize () {
+    checkWidget();
+    return parent.fixPoint(minimumWidth, minimumHeight);
+}
+/**
+ * Returns the receiver's parent, which must be a <code>CoolBar</code>.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public CoolBar getParent () {
+    checkWidget();
+    return parent;
+}
+/**
+ * Returns a point describing the receiver's ideal size.
+ * The x coordinate of the result is the ideal width of the receiver.
+ * The y coordinate of the result is the ideal height of the receiver.
+ *
+ * @return the receiver's ideal size
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Point getPreferredSize () {
+    checkWidget();
+    return parent.fixPoint(preferredWidth, preferredHeight);
+}
+/**
+ * Returns a point describing the receiver's size. The
+ * x coordinate of the result is the width of the receiver.
+ * The y coordinate of the result is the height of the
+ * receiver.
+ *
+ * @return the receiver's size
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Point getSize () {
+    checkWidget();
+    return parent.fixPoint(itemBounds.width, itemBounds.height);
+}
+int internalGetMinimumWidth () {
+    int width = minimumWidth + MINIMUM_WIDTH;
+    if ((style & SWT.DROP_DOWN) !is 0 && width < preferredWidth) {
+        width += CHEVRON_IMAGE_WIDTH + CHEVRON_HORIZONTAL_TRIM + CHEVRON_LEFT_MARGIN;
+    }
+    return width;
+}
+/*
+ *  Called when the chevron is selected.
+ */
+void onSelection (Event ev) {
+    Rectangle bounds = chevron.getBounds();
+    Event event = new Event();
+    event.detail = SWT.ARROW;
+    if ((parent.style & SWT.VERTICAL) !is 0) {
+        event.x = bounds.x + bounds.width;
+        event.y = bounds.y;
+    } else {
+        event.x = bounds.x;
+        event.y = bounds.y + bounds.height;
+    }
+    postEvent (SWT.Selection, event);
+}
+/**
+ * Removes the listener from the collection of listeners that
+ * will be notified when the control is selected by the user.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ *
+ * @since 2.0
+ */
+public void removeSelectionListener(SelectionListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Selection, listener);
+    eventTable.unhook (SWT.DefaultSelection,listener);
+}
+void setBounds (int x, int y, int width, int height) {
+    itemBounds.x = x;
+    itemBounds.y = y;
+    itemBounds.width = width;
+    itemBounds.height = height;
+    if (control !is null) {
+        int controlWidth = width - MINIMUM_WIDTH;
+        if ((style & SWT.DROP_DOWN) !is 0 && width < preferredWidth) {
+            controlWidth -= CHEVRON_IMAGE_WIDTH + CHEVRON_HORIZONTAL_TRIM + CHEVRON_LEFT_MARGIN;
+        }
+        control.setBounds (parent.fixRectangle(x + MINIMUM_WIDTH,   y, controlWidth, height));
+    }
+    updateChevron();
+}
+/**
+ * Sets the control that is associated with the receiver
+ * to the argument.
+ *
+ * @param control the new control that will be contained by the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the control has been disposed</li>
+ *    <li>ERROR_INVALID_PARENT - if the control is not in the same widget tree</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setControl (Control control) {
+    checkWidget();
+    if (control !is null) {
+        if (control.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
+        if (control.parent !is parent) error (SWT.ERROR_INVALID_PARENT);
+    }
+    this.control = control;
+    if (control !is null) {
+        int controlWidth = itemBounds.width - MINIMUM_WIDTH;
+        if ((style & SWT.DROP_DOWN) !is 0 && itemBounds.width < preferredWidth) {
+            controlWidth -= CHEVRON_IMAGE_WIDTH + CHEVRON_HORIZONTAL_TRIM + CHEVRON_LEFT_MARGIN;
+        }
+        control.setBounds (parent.fixRectangle(itemBounds.x + MINIMUM_WIDTH, itemBounds.y, controlWidth, itemBounds.height));
+    }
+}
+/**
+ * Sets the minimum size that the cool item can be resized to
+ * using the cool item's gripper, to the point specified by the arguments.
+ *
+ * @param width the minimum width of the cool item, in pixels
+ * @param height the minimum height of the cool item, in pixels
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ */
+public void setMinimumSize (int width, int height) {
+    checkWidget ();
+    Point point = parent.fixPoint(width, height);
+    minimumWidth = point.x;
+    minimumHeight = point.y;
+}
+/**
+ * Sets the minimum size that the cool item can be resized to
+ * using the cool item's gripper, to the point specified by the argument.
+ *
+ * @param size a point representing the minimum width and height of the cool item, in pixels
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ */
+public void setMinimumSize (Point size) {
+    checkWidget ();
+    if (size is null) error(SWT.ERROR_NULL_ARGUMENT);
+    setMinimumSize(size.x, size.y);
+}
+/**
+ * Sets the receiver's ideal size to the point specified by the arguments.
+ *
+ * @param width the new ideal width for the receiver
+ * @param height the new ideal height for the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setPreferredSize (int width, int height) {
+    checkWidget();
+    ideal = true;
+    Point point = parent.fixPoint(width, height);
+    preferredWidth = Math.max (point.x, MINIMUM_WIDTH);
+    preferredHeight = point.y;
+}
+/**
+ * Sets the receiver's ideal size to the point specified by the argument.
+ *
+ * @param size the new ideal size for the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setPreferredSize (Point size) {
+    checkWidget();
+    if (size is null) error(SWT.ERROR_NULL_ARGUMENT);
+    setPreferredSize(size.x, size.y);
+}
+/**
+ * Sets the receiver's size to the point specified by the arguments.
+ * <p>
+ * Note: Attempting to set the width or height of the
+ * receiver to a negative number will cause that
+ * value to be set to zero instead.
+ * </p>
+ *
+ * @param width the new width for the receiver
+ * @param height the new height for the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSize (int width, int height) {
+    checkWidget();
+    Point point = parent.fixPoint(width, height);
+    width = Math.max(point.x, minimumWidth + MINIMUM_WIDTH);
+    height = point.y;
+    if (!ideal) {
+        preferredWidth = width;
+        preferredHeight = height;
+    }
+    itemBounds.width = requestedWidth = width;
+    itemBounds.height = height;
+    if (control !is null) {
+        int controlWidth = width - MINIMUM_WIDTH;
+        if ((style & SWT.DROP_DOWN) !is 0 && width < preferredWidth) {
+            controlWidth -= CHEVRON_IMAGE_WIDTH + CHEVRON_HORIZONTAL_TRIM + CHEVRON_LEFT_MARGIN;
+        }
+        control.setSize(parent.fixPoint(controlWidth, height));
+    }
+    parent.relayout();
+    updateChevron();
+}
+/**
+ * Sets the receiver's size to the point specified by the argument.
+ * <p>
+ * Note: Attempting to set the width or height of the
+ * receiver to a negative number will cause them to be
+ * set to zero instead.
+ * </p>
+ *
+ * @param size the new size for the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSize (Point size) {
+    checkWidget();
+    if (size is null) error (SWT.ERROR_NULL_ARGUMENT);
+    setSize (size.x, size.y);
+}
+void updateChevron() {
+    if (control !is null) {
+        int width = itemBounds.width;
+        if ((style & SWT.DROP_DOWN) !is 0 && width < preferredWidth) {
+            if (chevron is null) {
+                chevron = new ToolBar (parent, SWT.FLAT | SWT.NO_FOCUS);
+                ToolItem toolItem = new ToolItem (chevron, SWT.PUSH);
+                toolItem.addListener (SWT.Selection, new class () Listener {
+                    public void handleEvent (Event event) {
+                        this.outer.onSelection (event);
+                    }
+                });
+            }
+            int controlHeight, currentImageHeight = 0;
+            if ((parent.style & SWT.VERTICAL) !is 0) {
+                controlHeight = control.getSize ().x;
+                if (arrowImage !is null) currentImageHeight = arrowImage.getBounds().width;
+            } else {
+                controlHeight = control.getSize ().y;
+                if (arrowImage !is null) currentImageHeight = arrowImage.getBounds().height;
+            }
+            int height = Math.min (controlHeight, itemBounds.height);
+            int imageHeight = Math.max(1, height - CHEVRON_VERTICAL_TRIM);
+            if (currentImageHeight !is imageHeight) {
+                Image image = createArrowImage (CHEVRON_IMAGE_WIDTH, imageHeight);
+                chevron.getItem (0).setImage (image);
+                if (arrowImage !is null) arrowImage.dispose ();
+                arrowImage = image;
+            }
+            chevron.setBackground (parent.getBackground());
+            chevron.setBounds (parent.fixRectangle (
+                itemBounds.x + width - CHEVRON_LEFT_MARGIN - CHEVRON_IMAGE_WIDTH - CHEVRON_HORIZONTAL_TRIM,
+                itemBounds.y,
+                CHEVRON_IMAGE_WIDTH + CHEVRON_HORIZONTAL_TRIM,
+                height));
+            chevron.setVisible(true);
+        } else {
+            if (chevron !is null) {
+                chevron.setVisible(false);
+            }
+        }
+    }
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/DateTime.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,1370 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.DateTime;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.internal.Compatibility;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.TypedListener;
+
+import tango.text.convert.Format;
+import tango.util.Convert;
+import java.lang.all;
+
+static import tango.text.Util;
+//static import tango.text.locale.Core;
+static import tango.time.Time;
+static import tango.time.WallClock;
+static import tango.time.chrono.Gregorian;
+static import tango.time.chrono.Calendar;
+
+
+private class Calendar{
+    enum {
+        AM,
+        PM
+    }
+    enum {
+        AM_PM,
+        HOUR,
+        MINUTE,
+        SECOND,
+        MONTH,
+        YEAR,
+        DAY_OF_MONTH,
+        DAY_SELECTED,
+        MONTH_CHANGED,
+        HOUR_OF_DAY,
+    }
+    private static const int[] MONTH_DAYS = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];
+    static private Calendar instance;
+
+    private int second;
+    private int minute;
+    private int hour;
+    private int dayofmonth;
+    private int month;
+    private int year;
+
+    static Calendar getInstance(){
+        if( instance is null ){
+            synchronized {
+                if( instance is null ){
+                    instance = new Calendar;
+                }
+            }
+        }
+        return instance;
+    }
+
+    public this(){
+        tango.time.Time.Time time = tango.time.WallClock.WallClock.now();
+        tango.time.Time.TimeSpan span = time.time.span;
+        this.second = span.seconds % 60;
+        this.minute = span.minutes % 60;
+        this.hour   = span.hours;
+        auto greg = tango.time.chrono.Gregorian.Gregorian.generic;
+        this.dayofmonth = greg.getDayOfMonth( time );
+        this.month      = greg.getMonth( time );
+        this.year       = greg.getYear( time );
+    }
+    int getActualMaximum(int field){
+        switch( field ){
+        case YEAR:
+            return 2100;
+        case MONTH:
+            return MONTH_DAYS.length -1;
+        case DAY_OF_MONTH:
+            return MONTH_DAYS[month];
+        case HOUR:
+            return 11;
+        case HOUR_OF_DAY:
+            return 23;
+        case MINUTE:
+            return 59;
+        case SECOND:
+            return 59;
+        case AM_PM:
+            return PM;
+        default: assert( false, Format( "no matching switch case for field {}.", field ));
+        }
+    }
+
+    int getActualMinimum(int field){
+        switch( field ){
+        case YEAR:
+            return 1900;
+        case MONTH:
+            return 0;
+        case DAY_OF_MONTH:
+            return 1;
+        case HOUR:
+        case HOUR_OF_DAY:
+            return 0;
+        case MINUTE:
+            return 0;
+        case SECOND:
+            return 0;
+        case AM_PM:
+            return AM;
+        default: assert( false, Format( "no matching switch case for field {}.", field ));
+        }
+    }
+
+    int getMaximum(int field){
+        switch( field ){
+        case YEAR:
+            return 2100;
+        case MONTH:
+            return 11;
+        case DAY_OF_MONTH:
+            return 31;
+        case HOUR:
+            return 11;
+        case HOUR_OF_DAY:
+            return 23;
+        case MINUTE:
+            return 59;
+        case SECOND:
+            return 59;
+        case AM_PM:
+            return PM;
+        default: assert( false, Format( "no matching switch case for field {}.", field ));
+        }
+    }
+
+    int getMinimum(int field){
+        switch( field ){
+        case YEAR:
+            return 1900;
+        case MONTH:
+            return 0;
+        case DAY_OF_MONTH:
+            return 1;
+        case HOUR:
+        case HOUR_OF_DAY:
+            return 0;
+        case MINUTE:
+            return 0;
+        case SECOND:
+            return 0;
+        case AM_PM:
+            return AM;
+        default: assert( false, Format( "no matching switch case for field {}.", field ));
+        }
+    }
+    int get(int field){
+        switch( field ){
+        case YEAR:
+            return year;
+        case MONTH:
+            return month;
+        case DAY_OF_MONTH:
+            return dayofmonth;
+        case HOUR:
+            return hour;
+        case HOUR_OF_DAY:
+            return hour % 12;
+        case MINUTE:
+            return minute;
+        case SECOND:
+            return second;
+        case AM_PM:
+            return ( hour < 12 ) ? AM : PM;
+        default: assert( false, Format( "no matching switch case for field {}.", field ));
+        }
+    }
+    void set( int year, int month, int day ){
+        this.year = year;
+        this.month = month;
+        this.dayofmonth = day;
+    }
+    void set(int field, int value){
+        switch( field ){
+        case YEAR:
+            year = value;
+            break;
+        case MONTH:
+            assert( value >= 0 && value < 12 );
+            month = value;
+            break;
+        case DAY_OF_MONTH:
+            assert( value > 0 && value <= getActualMaximum( DAY_OF_MONTH ) );
+            dayofmonth = value;
+            break;
+        case HOUR:
+            assert( value >= 0 && value < 12 );
+            hour = value;
+            break;
+        case HOUR_OF_DAY:
+            assert( value >= 0 && value < 24 );
+            hour = value;
+            break;
+        case MINUTE:
+            assert( value >= 0 && value < 60 );
+            minute = value;
+            break;
+        case SECOND:
+            assert( value >= 0 && value < 60 );
+            second = value;
+            break;
+        case AM_PM:
+            if( get(field) is AM ){
+                if( value is AM ){
+                    return;
+                }
+                else{
+                    hour += 12;
+                }
+            }
+            else{ // PM
+                if( value is AM ){
+                    hour -= 12;
+                }
+                else{
+                    return;
+                }
+            }
+            break;
+        default: assert( false, Format( "no matching switch case for field {}.", field ));
+        }
+    }
+
+    void roll(int field, int value){
+        switch( field ){
+        case YEAR:
+            year = value;
+            break;
+        case MONTH:
+            month += value;
+            month %= 12;
+            break;
+        case DAY_OF_MONTH:
+            dayofmonth += value;
+            dayofmonth %= getActualMaximum( DAY_OF_MONTH );
+            break;
+        case HOUR:
+        case HOUR_OF_DAY:
+            hour += value;
+            hour %= 24;
+            break;
+        case MINUTE:
+            minute += value;
+            minute %= 60;
+            break;
+        case SECOND:
+            second += value;
+            second %= 60;
+            break;
+        case AM_PM:
+            set( AM_PM, get( AM_PM ) is AM ? PM : AM );
+            break;
+        default: assert( false, Format( "no matching switch case for field {}.", field ));
+        }
+    }
+}
+
+
+private class DateFormatSymbols {
+    private const String[] ampm = [ "AM"[], "PM" ];
+    String[] getAmPmStrings(){
+        return ampm;
+    }
+}
+
+
+/**
+ * Instances of this class are selectable user interface
+ * objects that allow the user to enter and modify date
+ * or time values.
+ * <p>
+ * Note that although this class is a subclass of <code>Composite</code>,
+ * it does not make sense to add children to it, or set a layout on it.
+ * </p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>DATE, TIME, CALENDAR, SHORT, MEDIUM, LONG</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles DATE, TIME, or CALENDAR may be specified,
+ * and only one of the styles SHORT, MEDIUM, or LONG may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#datetime">DateTime snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.3
+ */
+public class DateTime : Composite {
+    int day, month, year, hours, minutes, seconds;
+
+    static const int MIN_YEAR = 1752; // Gregorian switchover in North America: September 19, 1752
+    static const int MAX_YEAR = 9999;
+
+    /* Emulated DATE and TIME variables */
+    Calendar calendar;
+    DateFormatSymbols formatSymbols;
+    Button down, up;
+    Text text;
+    String format;
+    Point[] fieldIndices;
+    int[] fieldNames;
+    int fieldCount, currentField = 0, characterCount = 0;
+    bool ignoreVerify = false;
+    static const String DEFAULT_SHORT_DATE_FORMAT = "MM/YYYY";
+    static const String DEFAULT_MEDIUM_DATE_FORMAT = "MM/DD/YYYY";
+    static const String DEFAULT_LONG_DATE_FORMAT = "MM/DD/YYYY";
+    static const String DEFAULT_SHORT_TIME_FORMAT = "HH:MM AM";
+    static const String DEFAULT_MEDIUM_TIME_FORMAT = "HH:MM:SS AM";
+    static const String DEFAULT_LONG_TIME_FORMAT = "HH:MM:SS AM";
+
+
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#DATE
+ * @see SWT#TIME
+ * @see SWT#CALENDAR
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Composite parent, int style) {
+    super (parent, checkStyle (style));
+    if ((this.style & SWT.CALENDAR) is 0) {
+        /* SWT.DATE and SWT.TIME */
+        calendar = Calendar.getInstance();
+        formatSymbols = new DateFormatSymbols();
+
+        text = new Text(this, SWT.SINGLE);
+        /* disable the native drag and drop for the date/time text field */
+        OS.gtk_drag_dest_unset(text.handle);
+        if ((this.style & SWT.DATE) !is 0) {
+            setFormat((this.style & SWT.SHORT) !is 0 ? DEFAULT_SHORT_DATE_FORMAT : (this.style & SWT.LONG) !is 0 ? DEFAULT_LONG_DATE_FORMAT : DEFAULT_MEDIUM_DATE_FORMAT);
+        } else { // SWT.TIME
+            setFormat((this.style & SWT.SHORT) !is 0 ? DEFAULT_SHORT_TIME_FORMAT : (this.style & SWT.LONG) !is 0 ? DEFAULT_LONG_TIME_FORMAT : DEFAULT_MEDIUM_TIME_FORMAT);
+        }
+        text.setText(getFormattedString(this.style));
+        Listener listener = new class () Listener {
+            public void handleEvent(Event event) {
+                switch(event.type) {
+                    case SWT.KeyDown: onKeyDown(event); break;
+                    case SWT.FocusIn: onFocusIn(event); break;
+                    case SWT.FocusOut: onFocusOut(event); break;
+                    case SWT.MouseDown: onMouseClick(event); break;
+                    case SWT.MouseUp: onMouseClick(event); break;
+                    case SWT.Verify: onVerify(event); break;
+                    default:
+                }
+            }
+        };
+        text.addListener(SWT.KeyDown, listener);
+        text.addListener(SWT.FocusIn, listener);
+        text.addListener(SWT.FocusOut, listener);
+        text.addListener(SWT.MouseDown, listener);
+        text.addListener(SWT.MouseUp, listener);
+        text.addListener(SWT.Verify, listener);
+        up = new Button(this, SWT.ARROW | SWT.UP);
+        //up.setToolTipText(SWT.getMessage ("SWT_Up")); //$NON-NLS-1$
+        down = new Button(this, SWT.ARROW | SWT.DOWN);
+        //down.setToolTipText(SWT.getMessage ("SWT_Down")); //$NON-NLS-1$
+        up.addListener(SWT.Selection, new class() Listener {
+            public void handleEvent(Event event) {
+                incrementField(+1);
+                text.setFocus();
+            }
+        });
+        down.addListener(SWT.Selection, new class() Listener {
+            public void handleEvent(Event event) {
+                incrementField(-1);
+                text.setFocus();
+            }
+        });
+        addListener(SWT.Resize, new class() Listener {
+            public void handleEvent(Event event) {
+                onResize(event);
+            }
+        });
+    }
+}
+
+static int checkStyle (int style) {
+    /*
+    * Even though it is legal to create this widget
+    * with scroll bars, they serve no useful purpose
+    * because they do not automatically scroll the
+    * widget's client area.  The fix is to clear
+    * the SWT style.
+    */
+    style &= ~(SWT.H_SCROLL | SWT.V_SCROLL);
+    style = checkBits (style, SWT.DATE, SWT.TIME, SWT.CALENDAR, 0, 0, 0);
+    return checkBits (style, SWT.MEDIUM, SWT.SHORT, SWT.LONG, 0, 0, 0);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the control is selected by the user, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * <code>widgetSelected</code> is called when the user changes the control's value.
+ * <code>widgetDefaultSelected</code> is not called.
+ * </p>
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener (SelectionListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Selection, typedListener);
+    addListener (SWT.DefaultSelection, typedListener);
+}
+
+protected void checkSubclass () {
+    if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+public Point computeSize (int wHint, int hHint, bool changed) {
+    checkWidget ();
+    int width = 0, height = 0;
+    if (wHint is SWT.DEFAULT || hHint is SWT.DEFAULT) {
+        if ((style & SWT.CALENDAR) !is 0) {
+            // TODO: CALENDAR computeSize
+            width = 300;
+            height = 200;
+        } else {
+            /* SWT.DATE and SWT.TIME */
+            GC gc = new GC(text);
+            Point textSize = gc.stringExtent(getComputeSizeString(style));
+            gc.dispose();
+            Rectangle trim = text.computeTrim(0, 0, textSize.x, textSize.y);
+            Point buttonSize = up.computeSize(SWT.DEFAULT, SWT.DEFAULT, changed);
+            width = trim.width + buttonSize.x;
+            height = Math.max(trim.height, buttonSize.y);
+        }
+    }
+    if (width is 0) width = DEFAULT_WIDTH;
+    if (height is 0) height = DEFAULT_HEIGHT;
+    if (wHint !is SWT.DEFAULT) width = wHint;
+    if (hHint !is SWT.DEFAULT) height = hHint;
+    int border = getBorderWidth ();
+    width += border * 2; height += border * 2;
+    return new Point (width, height);
+}
+
+void createHandle (int index) {
+    if ((style & SWT.CALENDAR) !is 0) {
+        state |= HANDLE;
+        fixedHandle = cast(GtkWidget*)OS.g_object_new (display.gtk_fixed_get_type (), null);
+        if (fixedHandle is null) error (SWT.ERROR_NO_HANDLES);
+        OS.gtk_fixed_set_has_window (fixedHandle, true);
+        handle = cast(GtkWidget*)OS.gtk_calendar_new ();
+        if (handle is null) error (SWT.ERROR_NO_HANDLES);
+        OS.gtk_container_add (fixedHandle, handle);
+        if (OS.GTK_VERSION >= OS.buildVERSION(2, 4, 0)) {
+            OS.gtk_calendar_set_display_options(handle, OS.GTK_CALENDAR_SHOW_HEADING | OS.GTK_CALENDAR_SHOW_DAY_NAMES);
+        } else {
+            OS.gtk_calendar_display_options(handle, OS.GTK_CALENDAR_SHOW_HEADING | OS.GTK_CALENDAR_SHOW_DAY_NAMES);
+        }
+    } else {
+        super.createHandle(index);
+    }
+}
+
+void createWidget (int index) {
+    super.createWidget (index);
+    if ((style & SWT.CALENDAR) !is 0) {
+        getDate();
+    }
+}
+
+void commitCurrentField() {
+    if (characterCount > 0) {
+        characterCount = 0;
+        int fieldName = fieldNames[currentField];
+        int start = fieldIndices[currentField].x;
+        int end = fieldIndices[currentField].y;
+        String value = text.getText(start, end - 1);
+        int s = value.lastIndexOf(' ');
+        if (s !is -1) value = value.substring(s + 1);
+        int newValue = unformattedIntValue(fieldName, value, characterCount is 0, calendar.getActualMaximum(fieldName));
+        if (newValue !is -1) setTextField(fieldName, newValue, true, true);
+    }
+}
+
+String formattedStringValue(int fieldName, int value, bool adjust) {
+    if (fieldName is Calendar.AM_PM) {
+        String[] ampm = formatSymbols.getAmPmStrings();
+        return ampm[value];
+    }
+    if (adjust) {
+        if (fieldName is Calendar.HOUR && value is 0) {
+            return to!(String)(12);
+        }
+        if (fieldName is Calendar.MONTH) {
+            return to!(String)(value + 1);
+        }
+    }
+    return to!(String)(value);
+}
+
+String getComputeSizeString(int style) {
+    if ((style & SWT.DATE) !is 0) {
+        return (style & SWT.SHORT) !is 0 ? DEFAULT_SHORT_DATE_FORMAT : (style & SWT.LONG) !is 0 ? DEFAULT_LONG_DATE_FORMAT : DEFAULT_MEDIUM_DATE_FORMAT;
+    }
+    // SWT.TIME
+    return (style & SWT.SHORT) !is 0 ? DEFAULT_SHORT_TIME_FORMAT : (style & SWT.LONG) !is 0 ? DEFAULT_LONG_TIME_FORMAT : DEFAULT_MEDIUM_TIME_FORMAT;
+}
+
+int getFieldIndex(int fieldName) {
+    for (int i = 0; i < fieldCount; i++) {
+        if (fieldNames[i] is fieldName) {
+            return i;
+        }
+    }
+    return -1;
+}
+
+String getFormattedString(int style) {
+    if ((style & SWT.TIME) !is 0) {
+        String[] ampm = formatSymbols.getAmPmStrings();
+        int h = calendar.get(Calendar.HOUR); if (h is 0) h = 12;
+        int m = calendar.get(Calendar.MINUTE);
+        int s = calendar.get(Calendar.SECOND);
+        int a = calendar.get(Calendar.AM_PM);
+        if ((style & SWT.SHORT) !is 0) return "" ~ (h < 10 ? " " : "") ~ to!(String)(h) ~ ":" ~ (m < 10 ? "0" : "") ~ to!(String)(m) ~ " " ~ ampm[a];
+        return "" ~ (h < 10 ? " " : "") ~ to!(String)(h) ~ ":" ~ (m < 10 ? "0" : "") ~ to!(String)(m) ~ ":" ~ (s < 10 ? "0" : "") ~ to!(String)(s) ~ " " ~ ampm[a];
+    }
+    /* SWT.DATE */
+    int y = calendar.get(Calendar.YEAR);
+    int m = calendar.get(Calendar.MONTH) + 1;
+    int d = calendar.get(Calendar.DAY_OF_MONTH);
+    if ((style & SWT.SHORT) !is 0) return "" ~ (m < 10 ? " " : "") ~ to!(String)(m) ~ "/" ~ to!(String)(y);
+    return "" ~ (m < 10 ? " " : "") ~ to!(String)(m) ~ "/" ~ (d < 10 ? " " : "") ~ to!(String)(d) ~ "/" ~ to!(String)(y);
+}
+
+void getDate() {
+    uint y;
+    uint m;
+    uint d;
+    OS.gtk_calendar_get_date(handle, &y, &m, &d);
+    year = y;
+    month = m;
+    day = d;
+}
+
+/**
+ * Returns the receiver's date, or day of the month.
+ * <p>
+ * The first day of the month is 1, and the last day depends on the month and year.
+ * </p>
+ *
+ * @return a positive integer beginning with 1
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getDay () {
+    checkWidget ();
+    if ((style & SWT.CALENDAR) !is 0) {
+        getDate();
+        return day;
+    } else {
+        return calendar.get(Calendar.DAY_OF_MONTH);
+    }
+}
+
+/**
+ * Returns the receiver's hours.
+ * <p>
+ * Hours is an integer between 0 and 23.
+ * </p>
+ *
+ * @return an integer between 0 and 23
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getHours () {
+    checkWidget ();
+    if ((style & SWT.CALENDAR) !is 0) {
+        return hours;
+    } else {
+        return calendar.get(Calendar.HOUR_OF_DAY);
+    }
+}
+
+/**
+ * Returns the receiver's minutes.
+ * <p>
+ * Minutes is an integer between 0 and 59.
+ * </p>
+ *
+ * @return an integer between 0 and 59
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getMinutes () {
+    checkWidget ();
+    if ((style & SWT.CALENDAR) !is 0) {
+        return minutes;
+    } else {
+        return calendar.get(Calendar.MINUTE);
+    }
+}
+
+/**
+ * Returns the receiver's month.
+ * <p>
+ * The first month of the year is 0, and the last month is 11.
+ * </p>
+ *
+ * @return an integer between 0 and 11
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getMonth () {
+    checkWidget ();
+    if ((style & SWT.CALENDAR) !is 0) {
+        getDate();
+        return month;
+    } else {
+        return calendar.get(Calendar.MONTH);
+    }
+}
+
+String getNameText() {
+    if((style & SWT.TIME) !is 0){
+        return Format( "{}:{}:{}", getHours(), getMinutes(), getSeconds() );
+    }
+    else{
+        return Format( "{}/{}/{}", (getMonth() + 1), getDay(), getYear() );
+    }
+}
+
+/**
+ * Returns the receiver's seconds.
+ * <p>
+ * Seconds is an integer between 0 and 59.
+ * </p>
+ *
+ * @return an integer between 0 and 59
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSeconds () {
+    checkWidget ();
+    if ((style & SWT.CALENDAR) !is 0) {
+        return seconds;
+    } else {
+        return calendar.get(Calendar.SECOND);
+    }
+}
+
+/**
+ * Returns the receiver's year.
+ * <p>
+ * The first year is 1752 and the last year is 9999.
+ * </p>
+ *
+ * @return an integer between 1752 and 9999
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getYear () {
+    checkWidget ();
+    if ((style & SWT.CALENDAR) !is 0) {
+        getDate();
+        return year;
+    } else {
+        return calendar.get(Calendar.YEAR);
+    }
+}
+
+override int gtk_day_selected (GtkWidget* widget) {
+    sendSelectionEvent ();
+    return 0;
+}
+
+override int gtk_month_changed (GtkWidget* widget) {
+    sendSelectionEvent ();
+    return 0;
+}
+
+void hookEvents () {
+    super.hookEvents();
+    if ((style & SWT.CALENDAR) !is 0) {
+        OS.g_signal_connect_closure (handle, OS.day_selected.ptr, display.closures [DAY_SELECTED], false);
+        OS.g_signal_connect_closure (handle, OS.month_changed.ptr, display.closures [MONTH_CHANGED], false);
+    }
+}
+
+bool isValid(int fieldName, int value) {
+    Calendar validCalendar;
+    if ((style & SWT.CALENDAR) !is 0) {
+        validCalendar = Calendar.getInstance();
+        validCalendar.set(Calendar.YEAR, year);
+        validCalendar.set(Calendar.MONTH, month);
+    } else {
+        validCalendar = calendar;
+    }
+    int min = validCalendar.getActualMinimum(fieldName);
+    int max = validCalendar.getActualMaximum(fieldName);
+    return value >= min && value <= max;
+}
+
+bool isValid(int year, int month, int day) {
+    Calendar valid = Calendar.getInstance();
+    valid.set(year, month, day);
+    return valid.get(Calendar.YEAR) is year && valid.get(Calendar.MONTH) is month && valid.get(Calendar.DAY_OF_MONTH) is day;
+}
+
+void incrementField(int amount) {
+    int fieldName = fieldNames[currentField];
+    int value = calendar.get(fieldName);
+    if (fieldName is Calendar.HOUR) {
+        int max = calendar.getMaximum(Calendar.HOUR);
+        int min = calendar.getMinimum(Calendar.HOUR);
+        if ((value is max && amount is 1) || (value is min && amount is -1)) {
+            int temp = currentField;
+            currentField = getFieldIndex(Calendar.AM_PM);
+            setTextField(Calendar.AM_PM, (calendar.get(Calendar.AM_PM) + 1) % 2, true, true);
+            currentField = temp;
+        }
+    }
+    setTextField(fieldName, value + amount, true, true);
+}
+
+void onKeyDown(Event event) {
+    int fieldName;
+    switch (event.keyCode) {
+        case SWT.ARROW_RIGHT:
+        case SWT.KEYPAD_DIVIDE:
+            // a right arrow or a valid separator navigates to the field on the right, with wraping
+            selectField((currentField + 1) % fieldCount);
+            break;
+        case SWT.ARROW_LEFT:
+            // navigate to the field on the left, with wrapping
+            int index = currentField - 1;
+            selectField(index < 0 ? fieldCount - 1 : index);
+            break;
+        case SWT.ARROW_UP:
+        case SWT.KEYPAD_ADD:
+            // set the value of the current field to value + 1, with wrapping
+            commitCurrentField();
+            incrementField(+1);
+            break;
+        case SWT.ARROW_DOWN:
+        case SWT.KEYPAD_SUBTRACT:
+            // set the value of the current field to value - 1, with wrapping
+            commitCurrentField();
+            incrementField(-1);
+            break;
+        case SWT.HOME:
+            // set the value of the current field to its minimum
+            fieldName = fieldNames[currentField];
+            setTextField(fieldName, calendar.getActualMinimum(fieldName), true, true);
+            break;
+        case SWT.END:
+            // set the value of the current field to its maximum
+            fieldName = fieldNames[currentField];
+            setTextField(fieldName, calendar.getActualMaximum(fieldName), true, true);
+            break;
+        default:
+            switch (event.character) {
+                case '/':
+                case ':':
+                case '-':
+                case '.':
+                    // a valid separator navigates to the field on the right, with wraping
+                    selectField((currentField + 1) % fieldCount);
+                    break;
+                default:
+            }
+    }
+}
+
+void onFocusIn(Event event) {
+    selectField(currentField);
+}
+
+void onFocusOut(Event event) {
+    commitCurrentField();
+}
+
+void onMouseClick(Event event) {
+    if (event.button !is 1) return;
+    Point sel = text.getSelection();
+    for (int i = 0; i < fieldCount; i++) {
+        if (sel.x >= fieldIndices[i].x && sel.x <= fieldIndices[i].y) {
+            currentField = i;
+            break;
+        }
+    }
+    selectField(currentField);
+}
+
+void onResize(Event event) {
+    Rectangle rect = getClientArea ();
+    int width = rect.width;
+    int height = rect.height;
+    Point buttonSize = up.computeSize(SWT.DEFAULT, height);
+    int buttonHeight = buttonSize.y / 2;
+    text.setBounds(0, 0, width - buttonSize.x, height);
+    up.setBounds(width - buttonSize.x, 0, buttonSize.x, buttonHeight);
+    down.setBounds(width - buttonSize.x, buttonHeight, buttonSize.x, buttonHeight);
+}
+
+void onVerify(Event event) {
+    if (ignoreVerify) return;
+    event.doit = false;
+    int fieldName = fieldNames[currentField];
+    int start = fieldIndices[currentField].x;
+    int end = fieldIndices[currentField].y;
+    int length_ = end - start;
+    String newText = event.text;
+    if (fieldName is Calendar.AM_PM) {
+        String[] ampm = formatSymbols.getAmPmStrings();
+        if (newText.equalsIgnoreCase(ampm[Calendar.AM].substring(0, 1)) || newText.equalsIgnoreCase(ampm[Calendar.AM])) {
+            setTextField(fieldName, Calendar.AM, true, false);
+        } else if (newText.equalsIgnoreCase(ampm[Calendar.PM].substring(0, 1)) || newText.equalsIgnoreCase(ampm[Calendar.PM])) {
+            setTextField(fieldName, Calendar.PM, true, false);
+        }
+        return;
+    }
+    if (characterCount > 0) {
+        try {
+            to!(int)(newText);
+        } catch (ConversionException ex) {
+            return;
+        }
+        String value = text.getText(start, end - 1);
+        int s = value.lastIndexOf(' ');
+        if (s !is -1) value = value.substring(s + 1);
+        newText = value ~ newText;
+    }
+    int newTextLength = newText.length;
+    bool first = characterCount is 0;
+    characterCount = (newTextLength < length_) ? newTextLength : 0;
+    int max = calendar.getActualMaximum(fieldName);
+    int min = calendar.getActualMinimum(fieldName);
+    int newValue = unformattedIntValue(fieldName, newText, characterCount is 0, max);
+    if (newValue is -1) {
+        characterCount = 0;
+        return;
+    }
+    if (first && newValue is 0 && length_ > 1) {
+        setTextField(fieldName, newValue, false, false);
+    } else if (min <= newValue && newValue <= max) {
+        setTextField(fieldName, newValue, characterCount is 0, characterCount is 0);
+    } else {
+        if (newTextLength >= length_) {
+            newText = newText.substring(newTextLength - length_ + 1);
+            newValue = unformattedIntValue(fieldName, newText, characterCount is 0, max);
+            if (newValue !is -1) {
+                characterCount = length_ - 1;
+                if (min <= newValue && newValue <= max) {
+                    setTextField(fieldName, newValue, characterCount is 0, true);
+                }
+            }
+        }
+    }
+}
+
+void releaseWidget () {
+    super.releaseWidget();
+    //TODO: need to do anything here?
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is selected by the user.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener (SelectionListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Selection, listener);
+    eventTable.unhook (SWT.DefaultSelection, listener);
+}
+
+void selectField(int index) {
+    if (index !is currentField) {
+        commitCurrentField();
+    }
+    final int start = fieldIndices[index].x;
+    final int end = fieldIndices[index].y;
+    Point pt = text.getSelection();
+    if (index is currentField && start is pt.x && end is pt.y) return;
+    currentField = index;
+    display.asyncExec(new class( start, end ) Runnable {
+        int start, end;
+        this( int start, int end ){
+            this.start = start; this.end = end;
+        }
+        public void run() {
+            if (!text.isDisposed()) {
+                String value = text.getText(start, end - 1);
+                int s = value.lastIndexOf(' ');
+                if (s is -1 ) s = start;
+                else s = start + s + 1;
+                text.setSelection(s, end);
+            }
+        }
+    });
+}
+
+void sendSelectionEvent () {
+    uint y;
+    uint m;
+    uint d;
+    OS.gtk_calendar_get_date(handle, &y, &m, &d);
+    //TODO: hours, minutes, seconds?
+    if (d !is day ||
+        m !is month ||
+        y !is year) {
+        year = y;
+        month = m;
+        day = d;
+        postEvent (SWT.Selection);
+    }
+}
+
+public void setBackground(Color color) {
+    checkWidget();
+    super.setBackground(color);
+    if (text !is null) text.setBackground(color);
+}
+
+public void setFont(Font font) {
+    checkWidget();
+    super.setFont(font);
+    if (text !is null) text.setFont(font);
+    redraw();
+}
+
+public void setForeground(Color color) {
+    checkWidget();
+    super.setForeground(color);
+    if (text !is null) text.setForeground(color);
+}
+
+/*public*/ void setFormat(String string) {
+    checkWidget();
+    // TODO: this needs to be locale sensitive
+    fieldCount = (style & SWT.DATE) !is 0 ? ((style & SWT.SHORT) !is 0 ? 2 : 3) : ((style & SWT.SHORT) !is 0 ? 3 : 4);
+    fieldIndices = new Point[fieldCount];
+    fieldNames = new int[fieldCount];
+    if ((style & SWT.DATE) !is 0) {
+        fieldNames[0] = Calendar.MONTH;
+        fieldIndices[0] = new Point(0, 2);
+        if ((style & SWT.SHORT) !is 0) {
+            fieldNames[1] = Calendar.YEAR;
+            fieldIndices[1] = new Point(3, 7);
+        } else {
+            fieldNames[1] = Calendar.DAY_OF_MONTH;
+            fieldIndices[1] = new Point(3, 5);
+            fieldNames[2] = Calendar.YEAR;
+            fieldIndices[2] = new Point(6, 10);
+        }
+    } else { /* SWT.TIME */
+        fieldNames[0] = Calendar.HOUR;
+        fieldIndices[0] = new Point(0, 2);
+        fieldNames[1] = Calendar.MINUTE;
+        fieldIndices[1] = new Point(3, 5);
+        if ((style & SWT.SHORT) !is 0) {
+            fieldNames[2] = Calendar.AM_PM;
+            fieldIndices[2] = new Point(6, 8);
+        } else {
+            fieldNames[2] = Calendar.SECOND;
+            fieldIndices[2] = new Point(6, 8);
+            fieldNames[3] = Calendar.AM_PM;
+            fieldIndices[3] = new Point(9, 11);
+        }
+    }
+}
+
+void setField(int fieldName, int value) {
+    if (calendar.get(fieldName) is value) return;
+    if (fieldName is Calendar.AM_PM) {
+        calendar.roll(Calendar.HOUR_OF_DAY, 12); // TODO: needs more work for setFormat and locale
+    }
+    calendar.set(fieldName, value);
+    postEvent(SWT.Selection);
+}
+
+void setTextField(int fieldName, int value, bool commit, bool adjust) {
+    if (commit) {
+        int max = calendar.getActualMaximum(fieldName);
+        int min = calendar.getActualMinimum(fieldName);
+        if (fieldName is Calendar.YEAR) {
+            max = MAX_YEAR;
+            min = MIN_YEAR;
+            /* Special case: convert 1 or 2-digit years into reasonable 4-digit years. */
+            int currentYear = Calendar.getInstance().get(Calendar.YEAR);
+            int currentCentury = (currentYear / 100) * 100;
+            if (value < (currentYear + 30) % 100) value += currentCentury;
+            else if (value < 100) value += currentCentury - 100;
+        }
+        if (value > max) value = min; // wrap
+        if (value < min) value = max; // wrap
+    }
+    int start = fieldIndices[currentField].x;
+    int end = fieldIndices[currentField].y;
+    text.setSelection(start, end);
+    String newValue = formattedStringValue(fieldName, value, adjust);
+    StringBuffer buffer = new StringBuffer(newValue);
+    /* Convert leading 0's into spaces. */
+    int prependCount = end - start - buffer.length();
+    for (int i = 0; i < prependCount; i++) {
+        switch (fieldName) {
+        case Calendar.MINUTE:
+        case Calendar.SECOND:
+            buffer.insert(0, 0);
+        break;
+        default:
+            buffer.insert(0, ' ');
+        break;
+        }
+    }
+    newValue = buffer.toString();
+    ignoreVerify = true;
+    text.insert(newValue);
+    ignoreVerify = false;
+    selectField(currentField);
+    if (commit) setField(fieldName, value);
+}
+
+/**
+ * Sets the receiver's year, month, and day in a single operation.
+ * <p>
+ * This is the recommended way to set the date, because setting the year,
+ * month, and day separately may result in invalid intermediate dates.
+ * </p>
+ *
+ * @param year an integer between 1752 and 9999
+ * @param month an integer between 0 and 11
+ * @param day a positive integer beginning with 1
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.4
+ */
+public void setDate (int year, int month, int day) {
+    checkWidget ();
+    if (!isValid(year, month, day)) return;
+    if ((style & SWT.CALENDAR) !is 0) {
+        this.year = year;
+        this.month = month;
+        this.day = day;
+        OS.gtk_calendar_select_month(handle, month, year);
+        OS.gtk_calendar_select_day(handle, day);
+    } else {
+        calendar.set(Calendar.YEAR, year);
+        calendar.set(Calendar.MONTH, month);
+        calendar.set(Calendar.DAY_OF_MONTH, day);
+        updateControl();
+    }
+}
+
+/**
+ * Sets the receiver's date, or day of the month, to the specified day.
+ * <p>
+ * The first day of the month is 1, and the last day depends on the month and year.
+ * </p>
+ *
+ * @param day a positive integer beginning with 1
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setDay (int day) {
+    checkWidget ();
+    if (!isValid(Calendar.DAY_OF_MONTH, day)) return;
+    if ((style & SWT.CALENDAR) !is 0) {
+        this.day = day;
+        OS.gtk_calendar_select_day(handle, day);
+    } else {
+        calendar.set(Calendar.DAY_OF_MONTH, day);
+        updateControl();
+    }
+}
+
+/**
+ * Sets the receiver's hours.
+ * <p>
+ * Hours is an integer between 0 and 23.
+ * </p>
+ *
+ * @param hours an integer between 0 and 23
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setHours (int hours) {
+    checkWidget ();
+    if (!isValid(Calendar.HOUR_OF_DAY, hours)) return;
+    if ((style & SWT.CALENDAR) !is 0) {
+        this.hours = hours;
+    } else {
+        calendar.set(Calendar.HOUR_OF_DAY, hours);
+        updateControl();
+    }
+}
+
+/**
+ * Sets the receiver's minutes.
+ * <p>
+ * Minutes is an integer between 0 and 59.
+ * </p>
+ *
+ * @param minutes an integer between 0 and 59
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMinutes (int minutes) {
+    checkWidget ();
+    if (!isValid(Calendar.MINUTE, minutes)) return;
+    if ((style & SWT.CALENDAR) !is 0) {
+        this.minutes = minutes;
+    } else {
+        calendar.set(Calendar.MINUTE, minutes);
+        updateControl();
+    }
+}
+
+/**
+ * Sets the receiver's month.
+ * <p>
+ * The first month of the year is 0, and the last month is 11.
+ * </p>
+ *
+ * @param month an integer between 0 and 11
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMonth (int month) {
+    checkWidget ();
+    if (!isValid(Calendar.MONTH, month)) return;
+    if ((style & SWT.CALENDAR) !is 0) {
+        this.month = month;
+        OS.gtk_calendar_select_month(handle, month, year);
+    } else {
+        calendar.set(Calendar.MONTH, month);
+        updateControl();
+    }
+}
+
+/**
+ * Sets the receiver's seconds.
+ * <p>
+ * Seconds is an integer between 0 and 59.
+ * </p>
+ *
+ * @param seconds an integer between 0 and 59
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSeconds (int seconds) {
+    checkWidget ();
+    if (!isValid(Calendar.SECOND, seconds)) return;
+    if ((style & SWT.CALENDAR) !is 0) {
+        this.seconds = seconds;
+    } else {
+        calendar.set(Calendar.SECOND, seconds);
+        updateControl();
+    }
+}
+
+/**
+ * Sets the receiver's hours, minutes, and seconds in a single operation.
+ *
+ * @param hours an integer between 0 and 23
+ * @param minutes an integer between 0 and 59
+ * @param seconds an integer between 0 and 59
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.4
+ */
+public void setTime (int hours, int minutes, int seconds) {
+    checkWidget ();
+    if (!isValid(Calendar.HOUR_OF_DAY, hours)) return;
+    if (!isValid(Calendar.MINUTE, minutes)) return;
+    if (!isValid(Calendar.SECOND, seconds)) return;
+    if ((style & SWT.CALENDAR) !is 0) {
+        this.hours = hours;
+        this.minutes = minutes;
+        this.seconds = seconds;
+    } else {
+        calendar.set(Calendar.HOUR_OF_DAY, hours);
+        calendar.set(Calendar.MINUTE, minutes);
+        calendar.set(Calendar.SECOND, seconds);
+        updateControl();
+    }
+}
+
+/**
+ * Sets the receiver's year.
+ * <p>
+ * The first year is 1752 and the last year is 9999.
+ * </p>
+ *
+ * @param year an integer between 1752 and 9999
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setYear (int year) {
+    checkWidget ();
+    //if (!isValid(Calendar.YEAR, year)) return;
+    if (year < MIN_YEAR || year > MAX_YEAR) return;
+    if ((style & SWT.CALENDAR) !is 0) {
+        this.year = year;
+        OS.gtk_calendar_select_month(handle, month, year);
+    } else {
+        calendar.set(Calendar.YEAR, year);
+        updateControl();
+    }
+}
+
+int unformattedIntValue(int fieldName, String newText, bool adjust, int max) {
+    int newValue;
+    try {
+        newValue = to!(int)(newText);
+    } catch (ConversionException ex) {
+        return -1;
+    }
+    if (fieldName is Calendar.MONTH && adjust) {
+        newValue--;
+        if (newValue is -1) newValue = max;
+    }
+    if (fieldName is Calendar.HOUR && adjust) {
+        if (newValue is 12) newValue = 0; // TODO: needs more work for setFormat and locale
+    }
+    return newValue;
+}
+
+public void updateControl() {
+    if (text !is null) {
+        String string = getFormattedString(style);
+        ignoreVerify = true;
+        text.setText(string);
+        ignoreVerify = false;
+    }
+    redraw();
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Decorations.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,767 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Decorations;
+
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Composite;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.gtk.OS;
+//import org.eclipse.swt.graphics.;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swt.widgets.Button;
+import java.lang.all;
+
+/**
+ * Instances of this class provide the appearance and
+ * behavior of <code>Shells</code>, but are not top
+ * level shells or dialogs. Class <code>Shell</code>
+ * shares a significant amount of code with this class,
+ * and is a subclass.
+ * <p>
+ * IMPORTANT: This class was intended to be abstract and
+ * should <em>never</em> be referenced or instantiated.
+ * Instead, the class <code>Shell</code> should be used.
+ * </p>
+ * <p>
+ * Instances are always displayed in one of the maximized,
+ * minimized or normal states:
+ * <ul>
+ * <li>
+ * When an instance is marked as <em>maximized</em>, the
+ * window manager will typically resize it to fill the
+ * entire visible area of the display, and the instance
+ * is usually put in a state where it can not be resized
+ * (even if it has style <code>RESIZE</code>) until it is
+ * no longer maximized.
+ * </li><li>
+ * When an instance is in the <em>normal</em> state (neither
+ * maximized or minimized), its appearance is controlled by
+ * the style constants which were specified when it was created
+ * and the restrictions of the window manager (see below).
+ * </li><li>
+ * When an instance has been marked as <em>minimized</em>,
+ * its contents (client area) will usually not be visible,
+ * and depending on the window manager, it may be
+ * "iconified" (that is, replaced on the desktop by a small
+ * simplified representation of itself), relocated to a
+ * distinguished area of the screen, or hidden. Combinations
+ * of these changes are also possible.
+ * </li>
+ * </ul>
+ * </p>
+ * Note: The styles supported by this class must be treated
+ * as <em>HINT</em>s, since the window manager for the
+ * desktop on which the instance is visible has ultimate
+ * control over the appearance and behavior of decorations.
+ * For example, some window managers only support resizable
+ * windows and will always assume the RESIZE style, even if
+ * it is not set.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>BORDER, CLOSE, MIN, MAX, NO_TRIM, RESIZE, TITLE, ON_TOP, TOOL</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * Class <code>SWT</code> provides two "convenience constants"
+ * for the most commonly required style combinations:
+ * <dl>
+ * <dt><code>SHELL_TRIM</code></dt>
+ * <dd>
+ * the result of combining the constants which are required
+ * to produce a typical application top level shell: (that
+ * is, <code>CLOSE | TITLE | MIN | MAX | RESIZE</code>)
+ * </dd>
+ * <dt><code>DIALOG_TRIM</code></dt>
+ * <dd>
+ * the result of combining the constants which are required
+ * to produce a typical application dialog shell: (that
+ * is, <code>TITLE | CLOSE | BORDER</code>)
+ * </dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ *
+ * @see #getMinimized
+ * @see #getMaximized
+ * @see Shell
+ * @see SWT
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class Decorations : Canvas {
+
+    alias Canvas.sort sort;
+
+    String text;
+    Image image;
+    Image [] images;
+    bool minimized, maximized;
+    Menu menuBar;
+    Menu [] menus;
+    Control savedFocus;
+    Button defaultButton, saveDefault;
+    GtkAccelGroup* accelGroup;
+    GtkWidget* vboxHandle;
+
+this () {
+    /* Do nothing */
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#BORDER
+ * @see SWT#CLOSE
+ * @see SWT#MIN
+ * @see SWT#MAX
+ * @see SWT#RESIZE
+ * @see SWT#TITLE
+ * @see SWT#NO_TRIM
+ * @see SWT#SHELL_TRIM
+ * @see SWT#DIALOG_TRIM
+ * @see SWT#ON_TOP
+ * @see SWT#TOOL
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Composite parent, int style) {
+    super (parent, checkStyle (style));
+}
+
+static int checkStyle (int style) {
+    if ((style & SWT.NO_TRIM) !is 0) {
+        style &= ~(SWT.CLOSE | SWT.TITLE | SWT.MIN | SWT.MAX | SWT.RESIZE | SWT.BORDER);
+    }
+    if ((style & (SWT.MENU | SWT.MIN | SWT.MAX | SWT.CLOSE)) !is 0) {
+        style |= SWT.TITLE;
+    }
+    return style;
+}
+
+override protected void checkSubclass () {
+    if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+void _setImages (Image [] images) {
+    if (images !is null && images.length > 1) {
+        Image [] bestImages = new Image [images.length];
+        System.arraycopy (images, 0, bestImages, 0, images.length);
+        sort (bestImages);
+        images = bestImages;
+    }
+    GList* pixbufs;
+    if (images !is null) {
+        for (int i = 0; i < images.length; i++) {
+            Image image = images [i];
+            auto pixbuf = Display.createPixbuf (image);
+            pixbufs = OS.g_list_append (pixbufs, pixbuf);
+        }
+    }
+    OS.gtk_window_set_icon_list (cast(GtkWindow*)topHandle (), pixbufs);
+    GList* data;
+    auto temp = pixbufs;
+    while (temp !is null) {
+        data = *cast(GList**)temp;
+        OS.g_object_unref (data);
+        temp = cast(GList*)OS.g_list_next (temp);
+    }
+    if (pixbufs !is null) OS.g_list_free (pixbufs);
+}
+
+void addMenu (Menu menu) {
+    if (menus is null) menus = new Menu [4];
+    for (int i=0; i<menus.length; i++) {
+        if (menus [i] is null) {
+            menus [i] = menu;
+            return;
+        }
+    }
+    Menu [] newMenus = new Menu [menus.length + 4];
+    newMenus [menus.length] = menu;
+    System.arraycopy (menus, 0, newMenus, 0, menus.length);
+    menus = newMenus;
+}
+
+int compare (ImageData data1, ImageData data2) {
+    if (data1.width is data2.width && data1.height is data2.height) {
+        int transparent1 = data1.getTransparencyType ();
+        int transparent2 = data2.getTransparencyType ();
+        if (transparent1 is SWT.TRANSPARENCY_ALPHA) return -1;
+        if (transparent2 is SWT.TRANSPARENCY_ALPHA) return 1;
+        if (transparent1 is SWT.TRANSPARENCY_MASK) return -1;
+        if (transparent2 is SWT.TRANSPARENCY_MASK) return 1;
+        if (transparent1 is SWT.TRANSPARENCY_PIXEL) return -1;
+        if (transparent2 is SWT.TRANSPARENCY_PIXEL) return 1;
+        return 0;
+    }
+    return data1.width > data2.width || data1.height > data2.height ? -1 : 1;
+}
+
+override Control computeTabGroup () {
+    return this;
+}
+
+override Control computeTabRoot () {
+    return this;
+}
+
+void createAccelGroup () {
+    if (accelGroup !is null) return;
+    accelGroup = OS.gtk_accel_group_new ();
+    if (accelGroup is null) SWT.error (SWT.ERROR_NO_HANDLES);
+    //FIXME - what should we do for Decorations
+    auto shellHandle = topHandle ();
+    OS.gtk_window_add_accel_group (cast(GtkWindow*)shellHandle, accelGroup);
+}
+
+override void createWidget (int index) {
+    super.createWidget (index);
+    text = "";
+}
+
+void destroyAccelGroup () {
+    if (accelGroup is null) return;
+    auto shellHandle = topHandle ();
+    OS.gtk_window_remove_accel_group (cast(GtkWindow*)shellHandle, accelGroup);
+    //TEMPORARY CODE
+//  OS.g_object_unref (accelGroup);
+    accelGroup = null;
+}
+
+void fixAccelGroup () {
+    if (menuBar is null) return;
+    destroyAccelGroup ();
+    createAccelGroup ();
+    menuBar.addAccelerators (accelGroup);
+}
+
+void fixDecorations (Decorations newDecorations, Control control, Menu [] menus) {
+    if (this is newDecorations) return;
+    if (control is savedFocus) savedFocus = null;
+    if (control is defaultButton) defaultButton = null;
+    if (control is saveDefault) saveDefault = null;
+    if (menus is null) return;
+    Menu menu = control.menu;
+    if (menu !is null) {
+        int index = 0;
+        while (index <menus.length) {
+            if (menus [index] is menu) {
+                control.setMenu (null);
+                return;
+            }
+            index++;
+        }
+        menu.fixMenus (newDecorations);
+    }
+}
+
+/**
+ * Returns the receiver's default button if one had
+ * previously been set, otherwise returns null.
+ *
+ * @return the default button or null
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setDefaultButton(Button)
+ */
+public Button getDefaultButton () {
+    checkWidget();
+    return defaultButton !is null ? defaultButton : saveDefault;
+}
+
+/**
+ * Returns the receiver's image if it had previously been
+ * set using <code>setImage()</code>. The image is typically
+ * displayed by the window manager when the instance is
+ * marked as iconified, and may also be displayed somewhere
+ * in the trim when the instance is in normal or maximized
+ * states.
+ * <p>
+ * Note: This method will return null if called before
+ * <code>setImage()</code> is called. It does not provide
+ * access to a window manager provided, "default" image
+ * even if one exists.
+ * </p>
+ *
+ * @return the image
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Image getImage () {
+    checkWidget ();
+    return image;
+}
+
+/**
+ * Returns the receiver's images if they had previously been
+ * set using <code>setImages()</code>. Images are typically
+ * displayed by the window manager when the instance is
+ * marked as iconified, and may also be displayed somewhere
+ * in the trim when the instance is in normal or maximized
+ * states. Depending where the icon is displayed, the platform
+ * chooses the icon with the "best" attributes.  It is expected
+ * that the array will contain the same icon rendered at different
+ * sizes, with different depth and transparency attributes.
+ *
+ * <p>
+ * Note: This method will return an empty array if called before
+ * <code>setImages()</code> is called. It does not provide
+ * access to a window manager provided, "default" image
+ * even if one exists.
+ * </p>
+ *
+ * @return the images
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public Image [] getImages () {
+    checkWidget ();
+    if (images is null) return new Image [0];
+    Image [] result = new Image [images.length];
+    System.arraycopy (images, 0, result, 0, images.length);
+    return result;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is currently
+ * maximized, and false otherwise.
+ * <p>
+ *
+ * @return the maximized state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setMaximized
+ */
+public bool getMaximized () {
+    checkWidget();
+    return maximized;
+}
+
+/**
+ * Returns the receiver's menu bar if one had previously
+ * been set, otherwise returns null.
+ *
+ * @return the menu bar or null
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Menu getMenuBar () {
+    checkWidget();
+    return menuBar;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is currently
+ * minimized, and false otherwise.
+ * <p>
+ *
+ * @return the minimized state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setMinimized
+ */
+public bool getMinimized () {
+    checkWidget();
+    return minimized;
+}
+
+override String getNameText () {
+    return getText ();
+}
+
+/**
+ * Returns the receiver's text, which is the string that the
+ * window manager will typically display as the receiver's
+ * <em>title</em>. If the text has not previously been set,
+ * returns an empty string.
+ *
+ * @return the text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getText () {
+    checkWidget();
+    return text;
+}
+
+override public bool isReparentable () {
+    checkWidget ();
+    return false;
+}
+
+override bool isTabGroup () {
+    return true;
+}
+
+override bool isTabItem () {
+    return false;
+}
+
+override Decorations menuShell () {
+    return this;
+}
+
+void removeMenu (Menu menu) {
+    if (menus is null) return;
+    for (int i=0; i<menus.length; i++) {
+        if (menus [i] is menu) {
+            menus [i] = null;
+            return;
+        }
+    }
+}
+
+override void releaseChildren (bool destroy) {
+    if (menuBar !is null) {
+        menuBar.release (false);
+        menuBar = null;
+    }
+    super.releaseChildren (destroy);
+    if (menus !is null) {
+        for (int i=0; i<menus.length; i++) {
+            Menu menu = menus [i];
+            if (menu !is null && !menu.isDisposed ()) {
+                menu.dispose ();
+            }
+        }
+        menus = null;
+    }
+}
+
+override void releaseHandle () {
+    super.releaseHandle ();
+    vboxHandle = null;
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    image = null;
+    images = null;
+    savedFocus = null;
+    defaultButton = saveDefault = null;
+}
+
+bool restoreFocus () {
+    if (savedFocus !is null && savedFocus.isDisposed ()) savedFocus = null;
+    bool restored = savedFocus !is null && savedFocus.setFocus ();
+    savedFocus = null;
+    /*
+    * This code is intentionally commented.  When no widget
+    * has been given focus, some platforms give focus to the
+    * default button.  Motif doesn't do this.
+    */
+//  if (restored) return true;
+//  if (defaultButton !is null && !defaultButton.isDisposed ()) {
+//      if (defaultButton.setFocus ()) return true;
+//  }
+//  return false;
+    return restored;
+}
+
+/**
+ * If the argument is not null, sets the receiver's default
+ * button to the argument, and if the argument is null, sets
+ * the receiver's default button to the first button which
+ * was set as the receiver's default button (called the
+ * <em>saved default button</em>). If no default button had
+ * previously been set, or the saved default button was
+ * disposed, the receiver's default button will be set to
+ * null.
+ * <p>
+ * The default button is the button that is selected when
+ * the receiver is active and the user presses ENTER.
+ * </p>
+ *
+ * @param button the new default button
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the button has been disposed</li>
+ *    <li>ERROR_INVALID_PARENT - if the control is not in the same widget tree</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setDefaultButton (Button button) {
+    checkWidget();
+    GtkWidget* buttonHandle;
+    if (button !is null) {
+        if (button.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+        if (button.menuShell () !is this) error (SWT.ERROR_INVALID_PARENT);
+        buttonHandle = button.handle;
+    }
+    saveDefault = defaultButton = button;
+    OS.gtk_window_set_default (cast(GtkWindow*)topHandle (), buttonHandle);
+}
+
+/**
+ * Sets the receiver's image to the argument, which may
+ * be null. The image is typically displayed by the window
+ * manager when the instance is marked as iconified, and
+ * may also be displayed somewhere in the trim when the
+ * instance is in normal or maximized states.
+ *
+ * @param image the new image (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setImage (Image image) {
+    checkWidget ();
+    this.image = image;
+    _setImages (image !is null ? [image] : null);
+}
+
+/**
+ * Sets the receiver's images to the argument, which may
+ * be an empty array. Images are typically displayed by the
+ * window manager when the instance is marked as iconified,
+ * and may also be displayed somewhere in the trim when the
+ * instance is in normal or maximized states. Depending where
+ * the icon is displayed, the platform chooses the icon with
+ * the "best" attributes. It is expected that the array will
+ * contain the same icon rendered at different sizes, with
+ * different depth and transparency attributes.
+ *
+ * @param images the new image array
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if one of the images is null or has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setImages (Image [] images) {
+    checkWidget ();
+    // SWT extension: allow null for zero length string
+    //if (images is null) error (SWT.ERROR_INVALID_ARGUMENT);
+    for (int i = 0; i < images.length; i++) {
+        if (images [i] is null || images [i].isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+    }
+    this.images = images;
+    _setImages (images);
+}
+
+/**
+ * Sets the maximized state of the receiver.
+ * If the argument is <code>true</code> causes the receiver
+ * to switch to the maximized state, and if the argument is
+ * <code>false</code> and the receiver was previously maximized,
+ * causes the receiver to switch back to either the minimized
+ * or normal states.
+ * <p>
+ * Note: The result of intermixing calls to <code>setMaximized(true)</code>
+ * and <code>setMinimized(true)</code> will vary by platform. Typically,
+ * the behavior will match the platform user's expectations, but not
+ * always. This should be avoided if possible.
+ * </p>
+ *
+ * @param maximized the new maximized state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setMinimized
+ */
+public void setMaximized (bool maximized) {
+    checkWidget();
+    this.maximized = maximized;
+}
+
+/**
+ * Sets the receiver's menu bar to the argument, which
+ * may be null.
+ *
+ * @param menu the new menu bar
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the menu has been disposed</li>
+ *    <li>ERROR_INVALID_PARENT - if the menu is not in the same widget tree</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMenuBar (Menu menu) {
+    checkWidget();
+    if (menuBar is menu) return;
+    if (menu !is null) {
+        if ((menu.style & SWT.BAR) is 0) error (SWT.ERROR_MENU_NOT_BAR);
+        if (menu.parent !is this) error (SWT.ERROR_INVALID_PARENT);
+    }
+    menuBar = menu;
+}
+
+/**
+ * Sets the minimized stated of the receiver.
+ * If the argument is <code>true</code> causes the receiver
+ * to switch to the minimized state, and if the argument is
+ * <code>false</code> and the receiver was previously minimized,
+ * causes the receiver to switch back to either the maximized
+ * or normal states.
+ * <p>
+ * Note: The result of intermixing calls to <code>setMaximized(true)</code>
+ * and <code>setMinimized(true)</code> will vary by platform. Typically,
+ * the behavior will match the platform user's expectations, but not
+ * always. This should be avoided if possible.
+ * </p>
+ *
+ * @param minimized the new maximized state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setMaximized
+ */
+public void setMinimized (bool minimized) {
+    checkWidget();
+    this.minimized = minimized;
+}
+
+void setSavedFocus (Control control) {
+    if (this is control) return;
+    savedFocus = control;
+}
+
+/**
+ * Sets the receiver's text, which is the string that the
+ * window manager will typically display as the receiver's
+ * <em>title</em>, to the argument, which must not be null.
+ *
+ * @param string the new text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setText (String string) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    text = string;
+}
+
+void sort (Image [] images) {
+    /* Shell Sort from K&R, pg 108 */
+    int length = images.length;
+    if (length <= 1) return;
+    ImageData [] datas = new ImageData [length];
+    for (int i = 0; i < length; i++) {
+        datas [i] = images [i].getImageData ();
+    }
+    for (int gap=length/2; gap>0; gap/=2) {
+        for (int i=gap; i<length; i++) {
+            for (int j=i-gap; j>=0; j-=gap) {
+                if (compare (datas [j], datas [j + gap]) >= 0) {
+                    Image swap = images [j];
+                    images [j] = images [j + gap];
+                    images [j + gap] = swap;
+                    ImageData swapData = datas [j];
+                    datas [j] = datas [j + gap];
+                    datas [j + gap] = swapData;
+                }
+            }
+        }
+    }
+}
+
+override bool traverseItem (bool next) {
+    return false;
+}
+
+override bool traverseReturn () {
+    Button button = defaultButton !is null ? defaultButton: saveDefault;
+    if (button is null || button.isDisposed ()) return false;
+    /*
+    * Bug in GTK.  When a default button that is disabled is
+    * activated using the Enter key, GTK GP's.  The fix is to
+    * detect this case and stop GTK from processing the Enter
+    * key.
+    */
+    if (!button.isVisible () || !button.isEnabled ()) return true;
+    auto shellHandle = _getShell ().topHandle ();
+    return cast(bool)OS.gtk_window_activate_default (cast(GtkWindow*)shellHandle);
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Dialog.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,272 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Dialog;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Widget;
+
+/**
+ * This class is the abstract superclass of the classes
+ * that represent the built in platform dialogs.
+ * A <code>Dialog</code> typically contains other widgets
+ * that are not accessible. A <code>Dialog</code> is not
+ * a <code>Widget</code>.
+ * <p>
+ * This class can also be used as the abstract superclass
+ * for user-designed dialogs. Such dialogs usually consist
+ * of a Shell with child widgets. The basic template for a
+ * user-defined dialog typically looks something like this:
+ * <pre><code>
+ * public class MyDialog extends Dialog {
+ *  Object result;
+ *
+ *  public MyDialog (Shell parent, int style) {
+ *      super (parent, style);
+ *  }
+ *  public MyDialog (Shell parent) {
+ *      this (parent, 0); // your default style bits go here (not the Shell's style bits)
+ *  }
+ *  public Object open () {
+ *      Shell parent = getParent();
+ *      Shell shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
+ *      shell.setText(getText());
+ *      // Your code goes here (widget creation, set result, etc).
+ *      shell.open();
+ *      Display display = parent.getDisplay();
+ *      while (!shell.isDisposed()) {
+ *          if (!display.readAndDispatch()) display.sleep();
+ *      }
+ *      return result;
+ *  }
+ * }
+ * </pre></code>
+ * <p>
+ * Note: The <em>modality</em> styles supported by this class
+ * are treated as <em>HINT</em>s, because not all are supported
+ * by every subclass on every platform. If a modality style is
+ * not supported, it is "upgraded" to a more restrictive modality
+ * style that is supported.  For example, if <code>PRIMARY_MODAL</code>
+ * is not supported by a particular dialog, it would be upgraded to
+ * <code>APPLICATION_MODAL</code>. In addition, as is the case
+ * for shells, the window manager for the desktop on which the
+ * instance is visible has ultimate control over the appearance
+ * and behavior of the instance, including its modality.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>APPLICATION_MODAL, PRIMARY_MODAL, SYSTEM_MODAL</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles APPLICATION_MODAL, PRIMARY_MODAL,
+ * and SYSTEM_MODAL may be specified.
+ * </p>
+ *
+ * @see Shell
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public abstract class Dialog {
+    int style;
+    Shell parent;
+    String title;
+
+/**
+ * Constructs a new instance of this class given only its
+ * parent.
+ *
+ * @param parent a shell which will be the parent of the new instance
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ */
+public this (Shell parent) {
+    this (parent, SWT.PRIMARY_MODAL);
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ *
+ * @param parent a shell which will be the parent of the new instance
+ * @param style the style of dialog to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ *
+ * @see SWT#PRIMARY_MODAL
+ * @see SWT#APPLICATION_MODAL
+ * @see SWT#SYSTEM_MODAL
+ */
+public this (Shell parent, int style) {
+    checkParent (parent);
+    this.parent = parent;
+    this.style = style;
+    title = "";
+}
+
+/**
+ * Checks that this class can be subclassed.
+ * <p>
+ * IMPORTANT: See the comment in <code>Widget.checkSubclass()</code>.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see Widget#checkSubclass
+ */
+protected void checkSubclass () {
+    //PORTING_TODO: implement Display.isValidClass and Class?
+    /+if (!Display.isValidClass (getClass ())) {
+        error (SWT.ERROR_INVALID_SUBCLASS);
+    }+/
+}
+
+/**
+ * Throws an exception if the specified widget can not be
+ * used as a parent for the receiver.
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the parent is disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ */
+void checkParent (Shell parent) {
+    if (parent is null) error (SWT.ERROR_NULL_ARGUMENT);
+    parent.checkWidget ();
+}
+
+static int checkStyle (Shell parent, int style) {
+    if ((style & (SWT.PRIMARY_MODAL | SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL)) is 0) {
+        style |= SWT.APPLICATION_MODAL;
+    }
+    style &= ~SWT.MIRRORED;
+    if ((style & (SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT)) is 0) {
+        if (parent !is null) {
+            if ((parent.style & SWT.LEFT_TO_RIGHT) !is 0) style |= SWT.LEFT_TO_RIGHT;
+            if ((parent.style & SWT.RIGHT_TO_LEFT) !is 0) style |= SWT.RIGHT_TO_LEFT;
+        }
+    }
+    return Widget.checkBits (style, SWT.LEFT_TO_RIGHT, SWT.RIGHT_TO_LEFT, 0, 0, 0, 0);
+}
+
+/**
+ * Does whatever dialog specific cleanup is required, and then
+ * uses the code in <code>SWTError.error</code> to handle the error.
+ *
+ * @param code the descriptive error code
+ *
+ * @see SWT#error(int)
+ */
+void error (int code) {
+    SWT.error(code);
+}
+
+/**
+ * Returns the receiver's parent, which must be a <code>Shell</code>
+ * or null.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Shell getParent () {
+    return parent;
+}
+
+/**
+ * Returns the receiver's style information.
+ * <p>
+ * Note that, the value which is returned by this method <em>may
+ * not match</em> the value which was provided to the constructor
+ * when the receiver was created.
+ * </p>
+ *
+ * @return the style bits
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getStyle () {
+    return style;
+}
+
+/**
+ * Returns the receiver's text, which is the string that the
+ * window manager will typically display as the receiver's
+ * <em>title</em>. If the text has not previously been set,
+ * returns an empty string.
+ *
+ * @return the text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getText () {
+    return title;
+}
+
+/**
+ * Sets the receiver's text, which is the string that the
+ * window manager will typically display as the receiver's
+ * <em>title</em>, to the argument, which must not be null.
+ *
+ * @param string the new text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setText (String string) {
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    title = string;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/DirectoryDialog.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,333 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.DirectoryDialog;
+
+import java.lang.all;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Dialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Display;
+
+static import tango.io.model.IFile;
+static import tango.text.Util;
+
+/**
+ * Instances of this class allow the user to navigate
+ * the file system and select a directory.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>(none)</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#directorydialog">DirectoryDialog snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample, Dialog tab</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class DirectoryDialog : Dialog {
+    String message = "", filterPath = "";
+    static const String SEPARATOR = tango.io.model.IFile.FileConst.PathSeparatorString;
+
+/**
+ * Constructs a new instance of this class given only its parent.
+ *
+ * @param parent a shell which will be the parent of the new instance
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ */
+public this (Shell parent) {
+    this (parent, SWT.APPLICATION_MODAL);
+}
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a shell which will be the parent of the new instance
+ * @param style the style of dialog to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ */
+public this (Shell parent, int style) {
+    super (parent, checkStyle (parent, style));
+    checkSubclass ();
+}
+/**
+ * Returns the path which the dialog will use to filter
+ * the directories it shows.
+ *
+ * @return the filter path
+ *
+ * @see #setFilterPath
+ */
+public String getFilterPath () {
+    return filterPath;
+}
+/**
+ * Returns the dialog's message, which is a description of
+ * the purpose for which it was opened. This message will be
+ * visible on the dialog while it is open.
+ *
+ * @return the message
+ */
+public String getMessage () {
+    return message;
+}
+/**
+ * Makes the dialog visible and brings it to the front
+ * of the display.
+ *
+ * @return a string describing the absolute path of the selected directory,
+ *         or null if the dialog was cancelled or an error occurred
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the dialog has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the dialog</li>
+ * </ul>
+ */
+public String open () {
+    bool useChooserDialog = OS.GTK_VERSION >= OS.buildVERSION (2, 4, 10);
+    if (useChooserDialog) {
+        return openChooserDialog ();
+    } else {
+        return openClassicDialog ();
+    }
+}
+String openChooserDialog () {
+    char* titleBytes = toStringz(title);
+    auto shellHandle = parent.topHandle ();
+    auto handle = OS.gtk_file_chooser_dialog_new2 (
+        titleBytes,
+        shellHandle,
+        OS.GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
+        OS.GTK_STOCK_CANCEL (), OS.GTK_RESPONSE_CANCEL,
+        OS.GTK_STOCK_OK (), OS.GTK_RESPONSE_OK );
+    auto pixbufs = OS.gtk_window_get_icon_list (shellHandle);
+    if (pixbufs !is null) {
+        OS.gtk_window_set_icon_list (handle, pixbufs);
+        OS.g_list_free (pixbufs);
+    }
+    if (filterPath !is null && filterPath.length > 0) {
+        String p;
+        /* filename must be a full path */
+        if ( filterPath[ 0 .. SEPARATOR.length ] != SEPARATOR ) {
+            p ~= SEPARATOR;
+            p ~= filterPath;
+        }
+        else{
+            p = filterPath;
+        }
+        char* buffer = toStringz(p);
+        /*
+        * Bug in GTK. GtkFileChooser may crash on GTK versions 2.4.10 to 2.6
+        * when setting a file name that is not a true canonical path.
+        * The fix is to use the canonical path.
+        */
+        char* ptr = OS.realpath (buffer, null);
+        if (ptr !is null) {
+            OS.gtk_file_chooser_set_current_folder (handle, ptr);
+            OS.g_free (ptr);
+        }
+    }
+    if (message.length > 0) {
+        char* buffer = toStringz(message);
+        auto box = OS.gtk_hbox_new (false, 0);
+        if (box is null) error (SWT.ERROR_NO_HANDLES);
+        auto label = OS.gtk_label_new (buffer);
+        if (label is null) error (SWT.ERROR_NO_HANDLES);
+        OS.gtk_container_add (box, label);
+        OS.gtk_widget_show (label);
+        OS.gtk_label_set_line_wrap (label, true);
+        OS.gtk_label_set_justify (label, OS.GTK_JUSTIFY_CENTER);
+        OS.gtk_file_chooser_set_extra_widget (handle, box);
+    }
+    String answer = null;
+    Display display = parent !is null ? parent.getDisplay (): Display.getCurrent ();
+    display.addIdleProc ();
+    Dialog oldModal = null;
+    if (OS.gtk_window_get_modal (handle)) {
+        oldModal = display.getModalDialog ();
+        display.setModalDialog (this);
+    }
+    int signalId = 0;
+    int /*long*/ hookId = 0;
+    CallbackData emissionData;
+    emissionData.display = display;
+    emissionData.data = handle;
+    if ((style & SWT.RIGHT_TO_LEFT) !is 0) {
+        signalId = OS.g_signal_lookup (OS.map.ptr, OS.GTK_TYPE_WIDGET());
+        hookId = OS.g_signal_add_emission_hook (signalId, 0, &Display.emissionFunc, &emissionData, null);
+    }
+    int response = OS.gtk_dialog_run (handle);
+    if ((style & SWT.RIGHT_TO_LEFT) !is 0) {
+        OS.g_signal_remove_emission_hook (signalId, hookId);
+    }
+    if (OS.gtk_window_get_modal (handle)) {
+        display.setModalDialog (oldModal);
+    }
+    if (response is OS.GTK_RESPONSE_OK) {
+        auto path = OS.gtk_file_chooser_get_filename (handle);
+        if (path !is null) {
+            uint items_written;
+            auto utf8Ptr = OS.g_filename_to_utf8 (path, -1, null, &items_written, null);
+            OS.g_free (path);
+            if (utf8Ptr !is null) {
+                answer = utf8Ptr[ 0 .. items_written ].dup;
+                filterPath = answer;
+                OS.g_free (utf8Ptr);
+            }
+        }
+    }
+    display.removeIdleProc ();
+    OS.gtk_widget_destroy (handle);
+    return answer;
+}
+String openClassicDialog () {
+    char* titleBytes = toStringz(title);
+    auto handle = OS.gtk_file_selection_new (titleBytes);
+    if (parent !is null) {
+        auto shellHandle = parent.topHandle ();
+        OS.gtk_window_set_transient_for (handle, shellHandle);
+        auto pixbufs = OS.gtk_window_get_icon_list (shellHandle);
+        if (pixbufs !is null) {
+            OS.gtk_window_set_icon_list (handle, pixbufs);
+            OS.g_list_free (pixbufs);
+        }
+    }
+    String answer = null;
+    if (filterPath !is null) {
+        String path = filterPath;
+        if (path.length > 0 && path[ $-1 .. $ ] != SEPARATOR ) {
+            path ~= SEPARATOR;
+        }
+        char* fileNamePtr = OS.g_filename_from_utf8 (toStringz(path), -1, null, null, null);
+        OS.gtk_file_selection_set_filename (handle, fileNamePtr);
+        OS.g_free (fileNamePtr);
+    }
+    GtkFileSelection* selection = cast(GtkFileSelection*)handle;
+    OS.gtk_file_selection_hide_fileop_buttons (handle);
+    auto fileListParent = OS.gtk_widget_get_parent (selection.file_list);
+    OS.gtk_widget_hide (selection.file_list);
+    OS.gtk_widget_hide (fileListParent);
+    if (message.length > 0) {
+        auto labelHandle = OS.gtk_label_new (toStringz(message));
+        OS.gtk_label_set_line_wrap (labelHandle, true);
+        OS.gtk_misc_set_alignment (labelHandle, 0.0f, 0.0f);
+        OS.gtk_container_add (selection.main_vbox, labelHandle);
+        OS.gtk_box_set_child_packing (
+            selection.main_vbox, labelHandle, false, false, 0, OS.GTK_PACK_START);
+        OS.gtk_widget_show (labelHandle);
+    }
+    Display display = parent !is null ? parent.getDisplay (): Display.getCurrent ();
+    display.addIdleProc ();
+    Dialog oldModal = null;
+    if (OS.gtk_window_get_modal (handle)) {
+        oldModal = display.getModalDialog ();
+        display.setModalDialog (this);
+    }
+    int signalId = 0;
+    int /*long*/ hookId = 0;
+    CallbackData emissionData;
+    emissionData.display = display;
+    emissionData.data = handle;
+    if ((style & SWT.RIGHT_TO_LEFT) !is 0) {
+        signalId = OS.g_signal_lookup (OS.map.ptr, OS.GTK_TYPE_WIDGET());
+        hookId = OS.g_signal_add_emission_hook (signalId, 0, &Display.emissionFunc, &emissionData, null);
+    }
+    int response = OS.gtk_dialog_run (handle);
+    if ((style & SWT.RIGHT_TO_LEFT) !is 0) {
+        OS.g_signal_remove_emission_hook (signalId, hookId);
+    }
+    if (OS.gtk_window_get_modal (handle)) {
+        display.setModalDialog (oldModal);
+    }
+    if (response is OS.GTK_RESPONSE_OK) {
+        char* fileNamePtr = OS.gtk_file_selection_get_filename (handle);
+        uint items_written;
+        char* utf8Ptr = OS.g_filename_to_utf8 (fileNamePtr, -1, null, &items_written, null);
+        if (utf8Ptr !is null) {
+            String osAnswer = utf8Ptr[ 0 .. items_written ];
+            if (osAnswer.length !is 0) {
+                /* remove trailing separator, unless root directory */
+                if ( osAnswer != SEPARATOR && osAnswer[ $-1 .. $ ] == SEPARATOR ) {
+                    osAnswer = osAnswer[ 0 .. $ - 1 ];
+                }
+                answer = filterPath = osAnswer.dup;
+            }
+            OS.g_free (utf8Ptr);
+        }
+    }
+    display.removeIdleProc ();
+    OS.gtk_widget_destroy (handle);
+    return answer;
+}
+/**
+ * Sets the path that the dialog will use to filter
+ * the directories it shows to the argument, which may
+ * be null. If the string is null, then the operating
+ * system's default filter path will be used.
+ * <p>
+ * Note that the path string is platform dependent.
+ * For convenience, either '/' or '\' can be used
+ * as a path separator.
+ * </p>
+ *
+ * @param string the filter path
+ */
+public void setFilterPath (String string) {
+    filterPath = string.dup;
+}
+/**
+ * Sets the dialog's message, which is a description of
+ * the purpose for which it was opened. This message will be
+ * visible on the dialog while it is open.
+ *
+ * @param string the message
+ *
+ */
+public void setMessage (String string) {
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    message = string.dup;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Display.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,4244 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Display;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.DeviceData;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GCData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.PaletteData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.Resource;
+import org.eclipse.swt.internal.Compatibility;
+import org.eclipse.swt.internal.Converter;
+import org.eclipse.swt.internal.Lock;
+import org.eclipse.swt.internal.LONG;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Caret;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Dialog;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.EventTable;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Monitor;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Synchronizer;
+import org.eclipse.swt.widgets.Tray;
+import org.eclipse.swt.widgets.Widget;
+
+import tango.stdc.string;
+import java.lang.all;
+
+import tango.core.Thread;
+
+/**
+ * Instances of this class are responsible for managing the
+ * connection between SWT and the underlying operating
+ * system. Their most important function is to implement
+ * the SWT event loop in terms of the platform event model.
+ * They also provide various methods for accessing information
+ * about the operating system, and have overall control over
+ * the operating system resources which SWT allocates.
+ * <p>
+ * Applications which are built with SWT will <em>almost always</em>
+ * require only a single display. In particular, some platforms
+ * which SWT supports will not allow more than one <em>active</em>
+ * display. In other words, some platforms do not support
+ * creating a new display if one already exists that has not been
+ * sent the <code>dispose()</code> message.
+ * <p>
+ * In SWT, the thread which creates a <code>Display</code>
+ * instance is distinguished as the <em>user-interface thread</em>
+ * for that display.
+ * </p>
+ * The user-interface thread for a particular display has the
+ * following special attributes:
+ * <ul>
+ * <li>
+ * The event loop for that display must be run from the thread.
+ * </li>
+ * <li>
+ * Some SWT API methods (notably, most of the public methods in
+ * <code>Widget</code> and its subclasses), may only be called
+ * from the thread. (To support multi-threaded user-interface
+ * applications, class <code>Display</code> provides inter-thread
+ * communication methods which allow threads other than the
+ * user-interface thread to request that it perform operations
+ * on their behalf.)
+ * </li>
+ * <li>
+ * The thread is not allowed to construct other
+ * <code>Display</code>s until that display has been disposed.
+ * (Note that, this is in addition to the restriction mentioned
+ * above concerning platform support for multiple displays. Thus,
+ * the only way to have multiple simultaneously active displays,
+ * even on platforms which support it, is to have multiple threads.)
+ * </li>
+ * </ul>
+ * Enforcing these attributes allows SWT to be implemented directly
+ * on the underlying operating system's event model. This has
+ * numerous benefits including smaller footprint, better use of
+ * resources, safer memory management, clearer program logic,
+ * better performance, and fewer overall operating system threads
+ * required. The down side however, is that care must be taken
+ * (only) when constructing multi-threaded applications to use the
+ * inter-thread communication mechanisms which this class provides
+ * when required.
+ * </p><p>
+ * All SWT API methods which may only be called from the user-interface
+ * thread are distinguished in their documentation by indicating that
+ * they throw the "<code>ERROR_THREAD_INVALID_ACCESS</code>"
+ * SWT exception.
+ * </p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>(none)</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Close, Dispose, Settings</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ * @see #syncExec
+ * @see #asyncExec
+ * @see #wake
+ * @see #readAndDispatch
+ * @see #sleep
+ * @see Device#dispose
+ * @see <a href="http://www.eclipse.org/swt/snippets/#display">Display snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class Display : Device {
+
+    /* Events Dispatching and Callback */
+    int gdkEventCount;
+    GdkEvent* [] gdkEvents;
+    Widget [] gdkEventWidgets;
+    int [] dispatchEvents;
+    Event [] eventQueue;
+    GPollFD[] fds;
+    int allocated_nfds;
+    bool wake_state;
+    int max_priority, timeout;
+    void*/*Callback*/ eventCallback, filterCallback;
+
+    CallbackData*[int] windowProcCallbackDatas; // to prevent GC from collect
+
+    CallbackData  filterProcCallbackData;
+    EventTable eventTable, filterTable;
+    static String APP_NAME = "SWT"; //$NON-NLS-1$
+    static const String DISPATCH_EVENT_KEY = "org.eclipse.swt.internal.gtk.dispatchEvent";
+    static const String ADD_WIDGET_KEY = "org.eclipse.swt.internal.addWidget";
+    GClosure*[] closures;
+    int [] signalIds;
+
+    /* Widget Table */
+    int [] indexTable;
+    int freeSlot;
+    GtkWidget* lastHandle;
+    Widget lastWidget;
+    Widget [] widgetTable;
+    const static int GROW_SIZE = 1024;
+    static int SWT_OBJECT_INDEX;
+    static int SWT_OBJECT_INDEX1;
+    static int SWT_OBJECT_INDEX2;
+
+    /* Modality */
+    Shell [] modalShells;
+    Dialog modalDialog;
+    static final String GET_MODAL_DIALOG = "org.eclipse.swt.internal.gtk.getModalDialog"; //$NON-NLS-1$
+    static final String SET_MODAL_DIALOG = "org.eclipse.swt.internal.gtk.setModalDialog"; //$NON-NLS-1$
+
+    /* Focus */
+    int focusEvent;
+    Control focusControl;
+    Shell activeShell;
+    bool activePending;
+    bool ignoreActivate, ignoreFocus;
+
+    /* Input method resources */
+    Control imControl;
+    GtkWindow* preeditWindow;
+    GtkLabel* preeditLabel;
+
+    /* Sync/Async Widget Communication */
+    Synchronizer synchronizer;
+    Thread thread;
+
+    /* Display Shutdown */
+    Runnable [] disposeList;
+
+    /* System Tray */
+    Tray tray;
+
+    /* Timers */
+    int [] timerIds;
+    Runnable [] timerList;
+    CallbackData timerProcCallbackData;
+
+    /* Caret */
+    Caret currentCaret;
+    int caretId;
+    CallbackData caretProcCallbackData;
+
+    /* Mnemonics */
+    Control mnemonicControl;
+
+    /* Mouse hover */
+    int mouseHoverId;
+    GtkWidget* mouseHoverHandle;
+    CallbackData mouseHoverProcCallbackData;
+
+    /* Menu position callback */
+
+    /* Tooltip size allocate callback */
+
+    /* Shell map callback */
+    CallbackData shellMapProcCallbackData;
+    GClosure* shellMapProcClosure;
+
+    /* Idle proc callback */
+    CallbackData idleProcCallbackData;
+    int idleHandle;
+    static const String ADD_IDLE_PROC_KEY = "org.eclipse.swt.internal.gtk.addIdleProc";
+    static const String REMOVE_IDLE_PROC_KEY = "org.eclipse.swt.internal.gtk.removeIdleProc";
+    Object idleLock;
+    bool idleNeeded;
+
+    /* GtkTreeView callbacks */
+    int[] treeSelection;
+    int treeSelectionLength;
+
+    /* Set direction callback */
+    CallbackData setDirectionProcCallbackData;
+    static const String GET_DIRECTION_PROC_KEY = "org.eclipse.swt.internal.gtk.getDirectionProc"; //$NON-NLS-1$
+
+    /* Set emissionProc callback */
+    CallbackData emissionProcCallbackData;
+    static const String GET_EMISSION_PROC_KEY = "org.eclipse.swt.internal.gtk.getEmissionProc"; //$NON-NLS-1$
+
+    /* Get all children callback */
+    CallbackData allChildrenProcCallbackData;
+    GList* allChildren;
+
+    CallbackData cellDataProcCallbackData;
+
+    /* Settings callbacks */
+    GtkWidget* shellHandle;
+    bool settingsChanged, runSettingsFld;
+    CallbackData styleSetProcCallbackData;
+
+    /* Entry focus behaviour */
+    bool entrySelectOnFocus;
+
+    /* Enter/Exit events */
+    Control currentControl;
+
+    /* Flush exposes */
+    int /*long*/ checkIfEventProc;
+    void*/*Callback*/ checkIfEventCallback;
+    GdkWindow* flushWindow;
+    bool flushAll;
+    GdkRectangle* flushRect;
+    XExposeEvent* exposeEvent;
+    XVisibilityEvent* visibilityEvent;
+    //int /*long*/ [] flushData = new int /*long*/ [1];
+
+    /* System Resources */
+    Font systemFont;
+    Image errorImage, infoImage, questionImage, warningImage;
+    Cursor [] cursors;
+    Resource [] resources;
+    static const int RESOURCE_SIZE = 1 + 4 + SWT.CURSOR_HAND + 1;
+
+    /* Colors */
+    GdkColor* COLOR_WIDGET_DARK_SHADOW, COLOR_WIDGET_NORMAL_SHADOW, COLOR_WIDGET_LIGHT_SHADOW;
+    GdkColor* COLOR_WIDGET_HIGHLIGHT_SHADOW, COLOR_WIDGET_BACKGROUND, COLOR_WIDGET_FOREGROUND, COLOR_WIDGET_BORDER;
+    GdkColor* COLOR_LIST_FOREGROUND, COLOR_LIST_BACKGROUND, COLOR_LIST_SELECTION, COLOR_LIST_SELECTION_TEXT;
+    GdkColor* COLOR_INFO_BACKGROUND, COLOR_INFO_FOREGROUND;
+    GdkColor* COLOR_TITLE_FOREGROUND, COLOR_TITLE_BACKGROUND, COLOR_TITLE_BACKGROUND_GRADIENT;
+    GdkColor* COLOR_TITLE_INACTIVE_FOREGROUND, COLOR_TITLE_INACTIVE_BACKGROUND, COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT;
+
+    /* Popup Menus */
+    Menu [] popups;
+
+    /* Click count*/
+    int clickCount = 1;
+
+    /* Timestamp of the Last Received Events */
+    int lastEventTime, lastUserEventTime;
+
+    /* Fixed Subclass */
+    static int /*long*/ fixed_type;
+    static int /*long*/ fixed_info_ptr;
+    static extern(C) void function(GtkWidget* handle, GtkAllocation* allocation) oldFixedSizeAllocateProc;
+
+
+    /* Renderer Subclass */
+    static int /*long*/ text_renderer_type, pixbuf_renderer_type, toggle_renderer_type;
+    static int /*long*/ text_renderer_info_ptr, pixbuf_renderer_info_ptr, toggle_renderer_info_ptr;
+
+    /* Key Mappings */
+    static const int [] [] KeyTable = [
+
+        /* Keyboard and Mouse Masks */
+        [OS.GDK_Alt_L,      SWT.ALT],
+        [OS.GDK_Alt_R,      SWT.ALT],
+        [OS.GDK_Meta_L, SWT.ALT],
+        [OS.GDK_Meta_R, SWT.ALT],
+        [OS.GDK_Shift_L,        SWT.SHIFT],
+        [OS.GDK_Shift_R,        SWT.SHIFT],
+        [OS.GDK_Control_L,  SWT.CONTROL],
+        [OS.GDK_Control_R,  SWT.CONTROL],
+//      [OS.GDK_????,       SWT.COMMAND],
+//      [OS.GDK_????,       SWT.COMMAND],
+
+        /* Non-Numeric Keypad Keys */
+        [OS.GDK_Up,                     SWT.ARROW_UP],
+        [OS.GDK_KP_Up,                  SWT.ARROW_UP],
+        [OS.GDK_Down,                   SWT.ARROW_DOWN],
+        [OS.GDK_KP_Down,            SWT.ARROW_DOWN],
+        [OS.GDK_Left,                       SWT.ARROW_LEFT],
+        [OS.GDK_KP_Left,                SWT.ARROW_LEFT],
+        [OS.GDK_Right,                  SWT.ARROW_RIGHT],
+        [OS.GDK_KP_Right,               SWT.ARROW_RIGHT],
+        [OS.GDK_Page_Up,                SWT.PAGE_UP],
+        [OS.GDK_KP_Page_Up,     SWT.PAGE_UP],
+        [OS.GDK_Page_Down,          SWT.PAGE_DOWN],
+        [OS.GDK_KP_Page_Down,   SWT.PAGE_DOWN],
+        [OS.GDK_Home,                   SWT.HOME],
+        [OS.GDK_KP_Home,            SWT.HOME],
+        [OS.GDK_End,                        SWT.END],
+        [OS.GDK_KP_End,             SWT.END],
+        [OS.GDK_Insert,                 SWT.INSERT],
+        [OS.GDK_KP_Insert,          SWT.INSERT],
+
+        /* Virtual and Ascii Keys */
+        [OS.GDK_BackSpace,      SWT.BS],
+        [OS.GDK_Return,             SWT.CR],
+        [OS.GDK_Delete,             SWT.DEL],
+        [OS.GDK_KP_Delete,      SWT.DEL],
+        [OS.GDK_Escape,         SWT.ESC],
+        [OS.GDK_Linefeed,           SWT.LF],
+        [OS.GDK_Tab,                    SWT.TAB],
+        [OS.GDK_ISO_Left_Tab,   SWT.TAB],
+
+        /* Functions Keys */
+        [OS.GDK_F1,     SWT.F1],
+        [OS.GDK_F2,     SWT.F2],
+        [OS.GDK_F3,     SWT.F3],
+        [OS.GDK_F4,     SWT.F4],
+        [OS.GDK_F5,     SWT.F5],
+        [OS.GDK_F6,     SWT.F6],
+        [OS.GDK_F7,     SWT.F7],
+        [OS.GDK_F8,     SWT.F8],
+        [OS.GDK_F9,     SWT.F9],
+        [OS.GDK_F10,        SWT.F10],
+        [OS.GDK_F11,        SWT.F11],
+        [OS.GDK_F12,        SWT.F12],
+        [OS.GDK_F13,        SWT.F13],
+        [OS.GDK_F14,        SWT.F14],
+        [OS.GDK_F15,        SWT.F15],
+
+        /* Numeric Keypad Keys */
+        [OS.GDK_KP_Multiply,        SWT.KEYPAD_MULTIPLY],
+        [OS.GDK_KP_Add,         SWT.KEYPAD_ADD],
+        [OS.GDK_KP_Enter,           SWT.KEYPAD_CR],
+        [OS.GDK_KP_Subtract,    SWT.KEYPAD_SUBTRACT],
+        [OS.GDK_KP_Decimal, SWT.KEYPAD_DECIMAL],
+        [OS.GDK_KP_Divide,      SWT.KEYPAD_DIVIDE],
+        [OS.GDK_KP_0,           SWT.KEYPAD_0],
+        [OS.GDK_KP_1,           SWT.KEYPAD_1],
+        [OS.GDK_KP_2,           SWT.KEYPAD_2],
+        [OS.GDK_KP_3,           SWT.KEYPAD_3],
+        [OS.GDK_KP_4,           SWT.KEYPAD_4],
+        [OS.GDK_KP_5,           SWT.KEYPAD_5],
+        [OS.GDK_KP_6,           SWT.KEYPAD_6],
+        [OS.GDK_KP_7,           SWT.KEYPAD_7],
+        [OS.GDK_KP_8,           SWT.KEYPAD_8],
+        [OS.GDK_KP_9,           SWT.KEYPAD_9],
+        [OS.GDK_KP_Equal,   SWT.KEYPAD_EQUAL],
+
+        /* Other keys */
+        [OS.GDK_Caps_Lock,      SWT.CAPS_LOCK],
+        [OS.GDK_Num_Lock,       SWT.NUM_LOCK],
+        [OS.GDK_Scroll_Lock,        SWT.SCROLL_LOCK],
+        [OS.GDK_Pause,              SWT.PAUSE],
+        [OS.GDK_Break,              SWT.BREAK],
+        [OS.GDK_Print,                  SWT.PRINT_SCREEN],
+        [OS.GDK_Help,                   SWT.HELP],
+
+    ];
+
+    /* Multiple Displays. */
+    static Display Default;
+    static Display [] Displays;
+
+    /* Package name */
+    static const String PACKAGE_PREFIX = "org.eclipse.swt.widgets.";
+    /* This code is intentionally commented.
+     * ".class" can not be used on CLDC.
+     */
+//  static {
+//      String name = Display.class.getName ();
+//      int index = name.lastIndexOf ('.');
+//      PACKAGE_NAME = name.substring (0, index + 1);
+//  }
+
+    static this() {
+        Displays = new Display [4];
+        initDeviceFinder();
+        SWT_OBJECT_INDEX = OS.g_quark_from_string ("SWT_OBJECT_INDEX");
+        SWT_OBJECT_INDEX1 = OS.g_quark_from_string ("SWT_OBJECT_INDEX1");
+        SWT_OBJECT_INDEX2 = OS.g_quark_from_string ("SWT_OBJECT_INDEX2");
+    }
+
+    /* GTK Version */
+    static const int MAJOR = 2;
+    static const int MINOR = 0;
+    static const int MICRO = 6;
+
+    /* Display Data */
+    Object data;
+    String [] keys;
+    Object [] values;
+
+    /* Initial Guesses for Shell Trimmings. */
+    int borderTrimWidth = 4, borderTrimHeight = 4;
+    int resizeTrimWidth = 6, resizeTrimHeight = 6;
+    int titleBorderTrimWidth = 5, titleBorderTrimHeight = 28;
+    int titleResizeTrimWidth = 6, titleResizeTrimHeight = 29;
+    int titleTrimWidth = 0, titleTrimHeight = 23;
+    bool ignoreTrim;
+
+    /* Window Manager */
+    String windowManager;
+
+    /*
+    * TEMPORARY CODE.  Install the runnable that
+    * gets the current display. This code will
+    * be removed in the future.
+    */
+    private static void initDeviceFinder(){
+        DeviceFinder = new class() Runnable {
+            public void run () {
+                Device device = getCurrent ();
+                if (device is null) {
+                    device = getDefault ();
+                }
+                setDevice (device);
+            }
+        };
+    }
+
+/*
+* TEMPORARY CODE.
+*/
+static void setDevice (Device device) {
+    CurrentDevice = device;
+}
+
+/**
+ * Constructs a new instance of this class.
+ * <p>
+ * Note: The resulting display is marked as the <em>current</em>
+ * display. If this is the first display which has been
+ * constructed since the application started, it is also
+ * marked as the <em>default</em> display.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if called from a thread that already created an existing display</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see #getCurrent
+ * @see #getDefault
+ * @see Widget#checkSubclass
+ * @see Shell
+ */
+public this () {
+    this (null);
+}
+
+/**
+ * Constructs a new instance of this class using the parameter.
+ *
+ * @param data the device data
+ */
+public this (DeviceData data) {
+    super (data);
+    synchronizer = new Synchronizer (this);
+    idleLock = new Object();
+    flushRect = new GdkRectangle ();
+    exposeEvent = new XExposeEvent ();
+    visibilityEvent = new XVisibilityEvent ();
+    cursors = new Cursor [SWT.CURSOR_HAND + 1];
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when an event of the given type occurs anywhere
+ * in a widget. The event type is one of the event constants
+ * defined in class <code>SWT</code>. When the event does occur,
+ * the listener is notified by sending it the <code>handleEvent()</code>
+ * message.
+ * <p>
+ * Setting the type of an event to <code>SWT.None</code> from
+ * within the <code>handleEvent()</code> method can be used to
+ * change the event type and stop subsequent Java listeners
+ * from running. Because event filters run before other listeners,
+ * event filters can both block other listeners and set arbitrary
+ * fields within an event. For this reason, event filters are both
+ * powerful and dangerous. They should generally be avoided for
+ * performance, debugging and code maintenance reasons.
+ * </p>
+ *
+ * @param eventType the type of event to listen for
+ * @param listener the listener which should be notified when the event occurs
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see Listener
+ * @see SWT
+ * @see #removeFilter
+ * @see #removeListener
+ *
+ * @since 3.0
+ */
+public void addFilter (int eventType, Listener listener) {
+    checkDevice ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (filterTable is null) filterTable = new EventTable ();
+    filterTable.hook (eventType, listener);
+}
+
+void addGdkEvent (GdkEvent* event) {
+    if (gdkEvents is null) {
+        int length = GROW_SIZE;
+        gdkEvents.length = length;
+        gdkEventWidgets.length = length;
+        gdkEventCount = 0;
+    }
+    if (gdkEventCount is gdkEvents.length) {
+        int length = gdkEventCount + GROW_SIZE;
+        GdkEvent* [] newEvents = new GdkEvent* [length];
+        SimpleType!(GdkEvent*).arraycopy (gdkEvents, 0, newEvents, 0, gdkEventCount);
+        gdkEvents = newEvents;
+        Widget [] newWidgets = new Widget [length];
+        System.arraycopy (gdkEventWidgets, 0, newWidgets, 0, gdkEventCount);
+        gdkEventWidgets = newWidgets;
+    }
+    Widget widget = null;
+    GtkWidget* handle = OS.gtk_get_event_widget (event);
+    if (handle !is null) {
+        do {
+            widget = getWidget (handle);
+        } while (widget is null && (handle = OS.gtk_widget_get_parent (handle)) !is null);
+    }
+    gdkEvents [gdkEventCount] = event;
+    gdkEventWidgets [gdkEventCount] = widget;
+    gdkEventCount++;
+}
+
+void addIdleProc() {
+    synchronized (idleLock){
+        this.idleNeeded = true;
+        if (idleHandle is 0) {
+            idleProcCallbackData.display = this;
+            idleProcCallbackData.data = null;
+            idleHandle = OS.g_idle_add ( &idleProcFunc, &idleProcCallbackData );
+        }
+    }
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when an event of the given type occurs. The event
+ * type is one of the event constants defined in class <code>SWT</code>.
+ * When the event does occur in the display, the listener is notified by
+ * sending it the <code>handleEvent()</code> message.
+ *
+ * @param eventType the type of event to listen for
+ * @param listener the listener which should be notified when the event occurs
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see Listener
+ * @see SWT
+ * @see #removeListener
+ *
+ * @since 2.0
+ */
+public void addListener (int eventType, Listener listener) {
+    checkDevice ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) eventTable = new EventTable ();
+    eventTable.hook (eventType, listener);
+}
+
+void allChildrenCollect( GtkWidget* widget, int recurse ){
+    allChildrenProcCallbackData.display = this;
+    allChildrenProcCallbackData.data = cast(void*)recurse;
+    OS.gtk_container_forall (cast(GtkContainer*)widget, cast(GtkCallback)&allChildrenProcFunc, &allChildrenProcCallbackData);
+}
+private static extern(C) int /*long*/ allChildrenProcFunc (GtkWidget* handle, void* user_data) {
+    version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Display {}:", __LINE__ ).flush;
+    CallbackData* cbdata = cast(CallbackData*)user_data;
+    return cbdata.display.allChildrenProc( cast(GtkWidget*)handle, cast(int)cbdata.data );
+}
+int /*long*/ allChildrenProc (GtkWidget* widget, int /*long*/ recurse) {
+    allChildren = OS.g_list_append (allChildren, widget);
+    if (recurse !is 0 && OS.GTK_IS_CONTAINER (cast(GTypeInstance*)widget)) {
+        allChildrenProcCallbackData.display = this;
+        allChildrenProcCallbackData.data = cast(void*)recurse;
+        OS.gtk_container_forall (cast(GtkContainer*)widget, cast(GtkCallback)&allChildrenProcFunc, &allChildrenProcCallbackData);
+    }
+    return 0;
+}
+
+void addMouseHoverTimeout (GtkWidget* handle) {
+    if (mouseHoverId !is 0) OS.gtk_timeout_remove (mouseHoverId);
+    mouseHoverProcCallbackData.display = this;
+    mouseHoverProcCallbackData.data = cast(void*)handle;
+    mouseHoverId = OS.gtk_timeout_add (400, &mouseHoverProcFunc, &mouseHoverProcCallbackData);
+    mouseHoverHandle = handle;
+}
+
+void addPopup (Menu menu) {
+    if (popups is null) popups = new Menu [4];
+    int length = popups.length;
+    for (int i=0; i<length; i++) {
+        if (popups [i] is menu) return;
+    }
+    int index = 0;
+    while (index < length) {
+        if (popups [index] is null) break;
+        index++;
+    }
+    if (index is length) {
+        Menu [] newPopups = new Menu [length + 4];
+        System.arraycopy (popups, 0, newPopups, 0, length);
+        popups = newPopups;
+    }
+    popups [index] = menu;
+}
+
+void addWidget (GtkWidget* handle, Widget widget) {
+    if (handle is null) return;
+    if (freeSlot is -1) {
+        int len = (freeSlot = indexTable.length) + GROW_SIZE;
+        int[] newIndexTable = new int[len];
+        Widget[] newWidgetTable = new Widget [len];
+        System.arraycopy (indexTable, 0, newIndexTable, 0, freeSlot);
+        System.arraycopy (widgetTable, 0, newWidgetTable, 0, freeSlot);
+        for (int i = freeSlot; i < len - 1; i++) {
+            newIndexTable[i] = i + 1;
+        }
+        newIndexTable[len - 1] = -1;
+        indexTable = newIndexTable;
+        widgetTable = newWidgetTable;
+    }
+    int index = freeSlot + 1;
+    OS.g_object_set_qdata (cast(GObject*)handle, SWT_OBJECT_INDEX, cast(void*)index);
+    int oldSlot = freeSlot;
+    freeSlot = indexTable[oldSlot];
+    indexTable [oldSlot] = -2;
+    widgetTable [oldSlot] = widget;
+}
+
+/**
+ * Causes the <code>run()</code> method of the runnable to
+ * be invoked by the user-interface thread at the next
+ * reasonable opportunity. The caller of this method continues
+ * to run in parallel, and is not notified when the
+ * runnable has completed.  Specifying <code>null</code> as the
+ * runnable simply wakes the user-interface thread when run.
+ * <p>
+ * Note that at the time the runnable is invoked, widgets
+ * that have the receiver as their display may have been
+ * disposed. Therefore, it is necessary to check for this
+ * case inside the runnable before accessing the widget.
+ * </p>
+ *
+ * @param runnable code to run on the user-interface thread or <code>null</code>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #syncExec
+ */
+public void asyncExec (Runnable runnable) {
+    synchronized (Device.classinfo) {
+        if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED);
+        synchronized (idleLock) {
+            if (idleNeeded && idleHandle is 0) {
+                //NOTE: calling unlocked function in OS
+                idleHandle = OS.g_idle_add (&idleProcFunc, cast(void*) this);
+            }
+        }
+        synchronizer.asyncExec (runnable);
+    }
+}
+
+/**
+ * Causes the system hardware to emit a short sound
+ * (if it supports this capability).
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void beep () {
+    if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS);
+    OS.gdk_beep();
+    if (!OS.GDK_WINDOWING_X11 ()) {
+        OS.gdk_flush ();
+    } else {
+        void* xDisplay = OS.GDK_DISPLAY ();
+        OS.XFlush (xDisplay);
+    }
+}
+
+void doCellDataProc( GtkWidget* widget, GtkTreeViewColumn *tree_column, GtkCellRenderer *cell_renderer ){
+    cellDataProcCallbackData.display = this;
+    cellDataProcCallbackData.data = widget;
+    OS.gtk_tree_view_column_set_cell_data_func ( tree_column, cell_renderer, &cellDataProcFunc, &cellDataProcCallbackData, null );
+}
+
+private static extern(C) void cellDataProcFunc (
+    GtkTreeViewColumn *tree_column,
+    GtkCellRenderer *cell,
+    GtkTreeModel *tree_model,
+    GtkTreeIter *iter,
+    void* data)
+{
+    version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Display {}:", __LINE__ ).flush;
+    CallbackData* cbdata = cast(CallbackData*)data;
+    return cbdata.display.cellDataProc( tree_column, cell, tree_model, iter, cbdata.data );
+}
+
+void cellDataProc(
+    GtkTreeViewColumn *tree_column,
+    GtkCellRenderer *cell,
+    GtkTreeModel *tree_model,
+    GtkTreeIter *iter,
+    void* data)
+{
+    Widget widget = getWidget (cast(GtkWidget*)data);
+    if (widget is null) return;
+    widget.cellDataProc (tree_column, cell, tree_model, iter, data);
+}
+
+protected override void checkDevice () {
+    if (thread is null) error (SWT.ERROR_WIDGET_DISPOSED);
+    if (thread !is Thread.getThis ()) error (SWT.ERROR_THREAD_INVALID_ACCESS);
+    if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED);
+}
+
+static void checkDisplay (Thread thread, bool multiple) {
+    synchronized (Device.classinfo) {
+        for (int i=0; i<Displays.length; i++) {
+            if (Displays [i] !is null) {
+                if (!multiple) SWT.error (SWT.ERROR_NOT_IMPLEMENTED, null, " [multiple displays]"); //$NON-NLS-1$
+                if (Displays [i].thread is thread) SWT.error (SWT.ERROR_THREAD_INVALID_ACCESS);
+            }
+        }
+    }
+}
+
+private static extern(C) int checkIfEventProcFunc (void* display, XEvent* xEvent, char* userData) {
+    version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Display {}:", __LINE__ ).flush;
+    auto disp = cast(Display)userData;
+    return disp.checkIfEventProcMeth( display, xEvent );
+}
+
+int checkIfEventProcMeth (void* display, XEvent* xEvent) {
+    int type = xEvent.type;
+    switch (type) {
+        case OS.VisibilityNotify:
+        case OS.Expose:
+        case OS.GraphicsExpose:
+            break;
+        default:
+            return 0;
+    }
+    GdkWindow* window = OS.gdk_window_lookup ( xEvent.xany.window );
+    if (window is null) return 0;
+    if (flushWindow !is null) {
+        if (flushAll) {
+            auto tempWindow = window;
+            do {
+                if (tempWindow is flushWindow) break;
+            } while ((tempWindow = OS.gdk_window_get_parent (tempWindow)) !is null);
+            if (tempWindow !is flushWindow) return 0;
+        } else {
+            if (window !is flushWindow) return 0;
+        }
+    }
+    *exposeEvent = *cast(XExposeEvent*)xEvent;
+    switch (type) {
+        case OS.Expose:
+        case OS.GraphicsExpose: {
+            flushRect.x = exposeEvent.x;
+            flushRect.y = exposeEvent.y;
+            flushRect.width = exposeEvent.width;
+            flushRect.height = exposeEvent.height;
+            OS.gdk_window_invalidate_rect (window, flushRect, true);
+            exposeEvent.type = -1;
+            memmove (xEvent, exposeEvent, XExposeEvent.sizeof);
+            break;
+        }
+        case OS.VisibilityNotify: {
+            memmove (visibilityEvent, xEvent, XVisibilityEvent.sizeof);
+            GtkWidget* handle;
+            OS.gdk_window_get_user_data (window, cast(void**) & handle);
+            Widget widget = handle !is null ? getWidget (handle) : null;
+            if (auto control = cast(Control)widget ) {
+                if (window is control.paintWindow ()) {
+                    if (visibilityEvent.state is OS.VisibilityFullyObscured) {
+                        control.state |= Widget.OBSCURED;
+                    } else {
+                        control.state &= ~Widget.OBSCURED;
+                    }
+                }
+            }
+            break;
+        default:
+        }
+    }
+    return 0;
+}
+
+/**
+ * Checks that this class can be subclassed.
+ * <p>
+ * IMPORTANT: See the comment in <code>Widget.checkSubclass()</code>.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see Widget#checkSubclass
+ */
+protected void checkSubclass () {
+//PORTING_TODO  if (!isValidClass (getClass ())) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+void clearModal (Shell shell) {
+    if (modalShells is null) return;
+    int index = 0, length_ = modalShells.length;
+    while (index < length_) {
+        if (modalShells [index] is shell) break;
+        if (modalShells [index] is null) return;
+        index++;
+    }
+    if (index is length_) return;
+    System.arraycopy (modalShells, index + 1, modalShells, index, --length_ - index);
+    modalShells [length_] = null;
+    if (index is 0 && modalShells [0] is null) modalShells = null;
+    Shell [] shells = getShells ();
+    for (int i=0; i<shells.length; i++) shells [i].updateModal ();
+}
+
+/**
+ * Requests that the connection between SWT and the underlying
+ * operating system be closed.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see Device#dispose
+ *
+ * @since 2.0
+ */
+public void close () {
+    checkDevice ();
+    Event event = new Event ();
+    sendEvent (SWT.Close, event);
+    if (event.doit) dispose ();
+}
+
+/**
+ * Creates the device in the operating system.  If the device
+ * does not have a handle, this method may do nothing depending
+ * on the device.
+ * <p>
+ * This method is called before <code>init</code>.
+ * </p>
+ *
+ * @param data the DeviceData which describes the receiver
+ *
+ * @see #init
+ */
+protected override void create (DeviceData data) {
+    checkSubclass ();
+    checkDisplay(thread = Thread.getThis (), false);
+    createDisplay (data);
+    register (this);
+    if (Default is null) Default = this;
+}
+
+private static extern(C) int XErrorHandler( void*, XErrorEvent* ){
+    getDwtLogger().error ( __FILE__, __LINE__, "*** XError" );
+    byte* p;
+    *p = 3;
+    return 0;
+}
+
+void createDisplay (DeviceData data) {
+    /* Required for g_main_context_wakeup */
+    if (!OS.g_thread_supported ()) {
+        OS.g_thread_init (null);
+    }
+    OS.gtk_set_locale();
+    int cnt = 2;
+    char*[] args = [ "name".ptr, "--sync".ptr, null ];
+    char** a = args.ptr;
+    if (!OS.gtk_init_check (&cnt, &a )) {
+    }
+    assert( cnt is 1 );
+    if (OS.GDK_WINDOWING_X11 ()) xDisplay = cast(void*) OS.GDK_DISPLAY ();
+
+    OS.XSetErrorHandler( &Display.XErrorHandler );
+    char* ptr = OS.gtk_check_version (MAJOR, MINOR, MICRO);
+    if (ptr !is null) {
+        char [] buffer = fromStringz(ptr);
+        getDwtLogger().warn (__FILE__, __LINE__,"***WARNING: {}", buffer );
+        getDwtLogger().warn (__FILE__, __LINE__,"***WARNING: SWT requires GTK {}.{}.{}", MAJOR, MINOR, MICRO );
+        int major = OS.gtk_major_version (), minor = OS.gtk_minor_version (), micro = OS.gtk_micro_version ();
+        getDwtLogger().warn (__FILE__, __LINE__,"***WARNING: Detected: {}.{}.{}", major, minor, micro);
+    }
+    if (fixed_type is 0) {
+        GTypeInfo* fixed_info = new GTypeInfo ();
+        fixed_info.class_size = GtkFixedClass.sizeof;
+        fixed_info.class_init = & fixedClassInitProcFunc;
+        fixed_info.instance_size = GtkFixed.sizeof;
+        fixed_type = OS.g_type_register_static (OS.GTK_TYPE_FIXED (), "SwtFixed".ptr, fixed_info, 0);
+    }
+    if (text_renderer_type is 0) {
+        GTypeInfo* renderer_info = new GTypeInfo ();
+        renderer_info.class_size = GtkCellRendererTextClass.sizeof;
+        renderer_info.class_init = & rendererClassInitProcFunc;
+        renderer_info.instance_size = GtkCellRendererText.sizeof;
+        text_renderer_type = OS.g_type_register_static (OS.GTK_TYPE_CELL_RENDERER_TEXT (), "SwtTextRenderer".ptr, renderer_info, 0);
+    }
+    if (pixbuf_renderer_type is 0) {
+        GTypeInfo* renderer_info = new GTypeInfo ();
+        renderer_info.class_size = GtkCellRendererPixbufClass.sizeof;
+        renderer_info.class_init = & rendererClassInitProcFunc;
+        renderer_info.instance_size = GtkCellRendererPixbuf.sizeof;
+        pixbuf_renderer_type = OS.g_type_register_static (OS.GTK_TYPE_CELL_RENDERER_PIXBUF (), "SwtPixbufRenderer".ptr, renderer_info, 0);
+    }
+    if (toggle_renderer_type is 0) {
+        GTypeInfo* renderer_info = new GTypeInfo ();
+        renderer_info.class_size = GtkCellRendererToggleClass.sizeof;
+        renderer_info.class_init = & rendererClassInitProcFunc;
+        renderer_info.instance_size = GtkCellRendererToggle.sizeof;
+        toggle_renderer_type = OS.g_type_register_static (OS.GTK_TYPE_CELL_RENDERER_TOGGLE (), "SwtToggleRenderer".ptr, renderer_info, 0);
+    }
+
+    OS.gtk_widget_set_default_direction (OS.GTK_TEXT_DIR_LTR);
+    OS.gdk_rgb_init ();
+    char* p = toStringz(APP_NAME);
+    OS.g_set_prgname (p);
+    OS.gdk_set_program_class (p);
+    OS.gtk_rc_parse_string ("style \"swt-flat\" { GtkToolbar::shadow-type = none } widget \"*.swt-toolbar-flat\" style : highest \"swt-flat\"".ptr);
+
+    /* Initialize the hidden shell */
+    shellHandle = OS.gtk_window_new (OS.GTK_WINDOW_TOPLEVEL);
+    if (shellHandle is null) SWT.error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_widget_realize (shellHandle);
+
+    /* Initialize the filter and event callback */
+    OS.gdk_event_handler_set (&eventProcFunc, cast(void*)this, null);
+    //filterProcCallbackData.display = this;
+    //filterProcCallbackData.data = null;
+    //OS.gdk_window_add_filter  (null, &filterProcFunc, cast(void*)&filterProcCallbackData );
+    doWindowAddFilter( &filterProcCallbackData, null, null );
+}
+
+/*
+ * Used by Shell
+ */
+package void doWindowAddFilter( CallbackData* cbdata, GdkWindow* window, GtkWidget* widget ){
+    cbdata.display = this;
+    cbdata.data = widget;
+    OS.gdk_window_add_filter (window, &filterProcFunc, cbdata );
+}
+
+package void doWindowRemoveFilter( CallbackData* cbdata, GdkWindow* window, GtkWidget* widget ){
+    cbdata.display = this;
+    cbdata.data = widget;
+    OS.gdk_window_remove_filter(window, &filterProcFunc, cbdata );
+}
+
+Image createImage (String name) {
+    auto style = OS.gtk_widget_get_default_style ();
+    String buffer = name;
+    auto pixbuf = OS.gtk_icon_set_render_icon (
+        OS.gtk_icon_factory_lookup_default (buffer.ptr), style,
+        OS.GTK_TEXT_DIR_NONE,
+        OS.GTK_STATE_NORMAL,
+        OS.GTK_ICON_SIZE_DIALOG, null, null );
+    if (pixbuf is null) return null;
+    int width = OS.gdk_pixbuf_get_width (pixbuf);
+    int height = OS.gdk_pixbuf_get_height (pixbuf);
+    int stride = OS.gdk_pixbuf_get_rowstride (pixbuf);
+    bool hasAlpha = cast(bool)OS.gdk_pixbuf_get_has_alpha (pixbuf);
+    char* pixels = OS.gdk_pixbuf_get_pixels (pixbuf);
+    byte [] data = new byte [stride * height];
+    memmove (data.ptr, pixels, data.length);
+    OS.g_object_unref (pixbuf);
+    ImageData imageData = null;
+    if (hasAlpha) {
+        PaletteData palette = new PaletteData (0xFF000000, 0xFF0000, 0xFF00);
+        imageData = new ImageData (width, height, 32, palette);
+        byte [] alpha = new byte [stride * height];
+        for (int y=0; y<height; y++) {
+            for (int x=0; x<width; x++) {
+                alpha [y*width+x] = data [y*stride+x*4+3];
+                data [y*stride+x*4+3] = 0;
+            }
+        }
+        imageData.setAlphas (0, 0, width * height, alpha, 0);
+    } else {
+        PaletteData palette = new PaletteData (0xFF0000, 0xFF00, 0xFF);
+        imageData = new ImageData (width, height, 24, palette);
+    }
+    imageData.data = data;
+    imageData.bytesPerLine = stride;
+    return new Image (this, imageData);
+}
+
+static GdkPixbuf* createPixbuf(Image image) {
+    int w, h;
+    OS.gdk_drawable_get_size (image.pixmap, &w, &h);
+    auto colormap = OS.gdk_colormap_get_system ();
+    GdkPixbuf* pixbuf;
+    bool hasMask = image.mask !is null && OS.gdk_drawable_get_depth (image.mask) is 1;
+    if (hasMask) {
+        pixbuf = OS.gdk_pixbuf_new (OS.GDK_COLORSPACE_RGB, true, 8, w, h );
+        if (pixbuf is null) SWT.error (SWT.ERROR_NO_HANDLES);
+        OS.gdk_pixbuf_get_from_drawable (pixbuf, image.pixmap, colormap, 0, 0, 0, 0, w, h);
+        auto maskPixbuf = OS.gdk_pixbuf_new(OS.GDK_COLORSPACE_RGB, false, 8, w, h);
+        if (maskPixbuf is null) SWT.error (SWT.ERROR_NO_HANDLES);
+        OS.gdk_pixbuf_get_from_drawable(maskPixbuf, image.mask, null, 0, 0, 0, 0, w, h);
+        int stride = OS.gdk_pixbuf_get_rowstride(pixbuf);
+        auto pixels = OS.gdk_pixbuf_get_pixels(pixbuf);
+        byte[] line = new byte[stride];
+        int maskStride = OS.gdk_pixbuf_get_rowstride(maskPixbuf);
+        auto maskPixels = OS.gdk_pixbuf_get_pixels(maskPixbuf);
+        byte[] maskLine = new byte[maskStride];
+        for (int y=0; y<h; y++) {
+            auto offset = pixels + (y * stride);
+            memmove(line.ptr, offset, stride);
+            auto maskOffset = maskPixels + (y * maskStride);
+            memmove(maskLine.ptr, maskOffset, maskStride);
+            for (int x=0; x<w; x++) {
+                if (maskLine[x * 3] is 0) {
+                    line[x * 4 + 3] = 0;
+                }
+            }
+            memmove(offset, line.ptr, stride);
+        }
+        OS.g_object_unref(maskPixbuf);
+    } else {
+        ImageData data = image.getImageData ();
+        bool hasAlpha = data.getTransparencyType () is SWT.TRANSPARENCY_ALPHA;
+        pixbuf = OS.gdk_pixbuf_new (OS.GDK_COLORSPACE_RGB, hasAlpha, 8, w, h);
+        if (pixbuf is null) SWT.error (SWT.ERROR_NO_HANDLES);
+        OS.gdk_pixbuf_get_from_drawable (pixbuf, image.pixmap, colormap, 0, 0, 0, 0, w, h);
+        if (hasAlpha) {
+            byte [] alpha = data.alphaData;
+            int stride = OS.gdk_pixbuf_get_rowstride (pixbuf);
+            auto pixels = OS.gdk_pixbuf_get_pixels (pixbuf);
+            byte [] line = new byte [stride];
+            for (int y = 0; y < h; y++) {
+                auto offset = pixels + (y * stride);
+                memmove (line.ptr, offset, stride);
+                for (int x = 0; x < w; x++) {
+                    line [x*4+3] = alpha [y*w+x];
+                }
+                memmove (offset, line.ptr, stride);
+            }
+        }
+    }
+    return pixbuf;
+}
+
+static void deregister (Display display) {
+    synchronized (Device.classinfo) {
+        for (int i=0; i<Displays.length; i++) {
+            if (display is Displays [i]) Displays [i] = null;
+        }
+    }
+}
+
+/**
+ * Destroys the device in the operating system and releases
+ * the device's handle.  If the device does not have a handle,
+ * this method may do nothing depending on the device.
+ * <p>
+ * This method is called after <code>release</code>.
+ * </p>
+ * @see Device#dispose
+ * @see #release
+ */
+protected override void destroy () {
+    if (this is Default) Default = null;
+    deregister (this);
+    destroyDisplay ();
+}
+
+void destroyDisplay () {
+}
+
+static extern(C) int /*long*/ emissionFunc (GSignalInvocationHint* ihint, uint n_param_values, GValue* param_values, void* data) {
+    auto cb = cast(CallbackData*)data;
+    return cb.display.emissionProc( ihint, n_param_values, param_values, cb.data );
+}
+
+int /*long*/ emissionProc (GSignalInvocationHint* ihint, uint n_param_values, GValue* param_values, void* data) {
+    if (OS.gtk_widget_get_toplevel (OS.g_value_peek_pointer(param_values)) is data) {
+        OS.gtk_widget_set_direction (OS.g_value_peek_pointer(param_values), OS.GTK_TEXT_DIR_RTL);
+    }
+    return 1;
+}
+
+/**
+ * Returns the display which the given thread is the
+ * user-interface thread for, or null if the given thread
+ * is not a user-interface thread for any display.  Specifying
+ * <code>null</code> as the thread will return <code>null</code>
+ * for the display.
+ *
+ * @param thread the user-interface thread
+ * @return the display for the given thread
+ */
+public static Display findDisplay (Thread thread) {
+    synchronized (Device.classinfo) {
+        for (int i=0; i<Displays.length; i++) {
+            Display display = Displays [i];
+            if (display !is null && display.thread is thread) {
+                return display;
+            }
+        }
+        return null;
+    }
+}
+
+/**
+ * Causes the <code>run()</code> method of the runnable to
+ * be invoked by the user-interface thread just before the
+ * receiver is disposed.  Specifying a <code>null</code> runnable
+ * is ignored.
+ *
+ * @param runnable code to run at dispose time.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void disposeExec (Runnable runnable) {
+    checkDevice ();
+    if (disposeList is null) disposeList = new Runnable [4];
+    for (int i=0; i<disposeList.length; i++) {
+        if (disposeList [i] is null) {
+            disposeList [i] = runnable;
+            return;
+        }
+    }
+    Runnable [] newDisposeList = new Runnable [disposeList.length + 4];
+    SimpleType!(Runnable).arraycopy (disposeList, 0, newDisposeList, 0, disposeList.length);
+    newDisposeList [disposeList.length] = runnable;
+    disposeList = newDisposeList;
+}
+
+/**
+ * Does whatever display specific cleanup is required, and then
+ * uses the code in <code>SWTError.error</code> to handle the error.
+ *
+ * @param code the descriptive error code
+ *
+ * @see SWTError#error
+ */
+void error (int code) {
+    SWT.error (code);
+}
+
+private static extern(C) void eventProcFunc (GdkEvent* event, void* data) {
+    version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Display {}:", __LINE__ ).flush;
+    Display disp = cast(Display)data;
+    disp.eventProcMeth(event);
+}
+void eventProcMeth (GdkEvent* event) {
+    /*
+    * Use gdk_event_get_time() rather than event.time or
+    * gtk_get_current_event_time().  If the event does not
+    * have a time stamp, then the field will contain garbage.
+    * Note that calling gtk_get_current_event_time() from
+    * outside of gtk_main_do_event() seems to always
+    * return zero.
+    */
+    int time = OS.gdk_event_get_time (event);
+    if (time !is 0) lastEventTime = time;
+
+    int eventType = OS.GDK_EVENT_TYPE (event);
+    switch (eventType) {
+        case OS.GDK_BUTTON_PRESS:
+        case OS.GDK_KEY_PRESS:
+            lastUserEventTime = time;
+        default:
+    }
+    bool dispatch = true;
+    if (dispatchEvents !is null) {
+        dispatch = false;
+        for (int i = 0; i < dispatchEvents.length; i++) {
+            if (eventType is dispatchEvents [i]) {
+                dispatch = true;
+                break;
+            }
+        }
+    }
+    if (!dispatch) {
+        addGdkEvent (OS.gdk_event_copy (event));
+        return 0;
+    }
+    OS.gtk_main_do_event (event);
+    if (dispatchEvents is null) putGdkEvents ();
+    return 0;
+}
+
+/**
+ * Given the operating system handle for a widget, returns
+ * the instance of the <code>Widget</code> subclass which
+ * represents it in the currently running application, if
+ * such exists, or null if no matching widget can be found.
+ * <p>
+ * <b>IMPORTANT:</b> This method should not be called from
+ * application code. The arguments are platform-specific.
+ * </p>
+ *
+ * @param handle the handle for the widget
+ * @return the SWT widget that the handle represents
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Widget findWidget (GtkWidget* handle) {
+    checkDevice ();
+    return getWidget (handle);
+}
+
+/**
+ * Given the operating system handle for a widget,
+ * and widget-specific id, returns the instance of
+ * the <code>Widget</code> subclass which represents
+ * the handle/id pair in the currently running application,
+ * if such exists, or null if no matching widget can be found.
+ * <p>
+ * <b>IMPORTANT:</b> This method should not be called from
+ * application code. The arguments are platform-specific.
+ * </p>
+ *
+ * @param handle the handle for the widget
+ * @param id the id for the subwidget (usually an item)
+ * @return the SWT widget that the handle/id pair represents
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public Widget findWidget (GtkWidget* handle, int id) {
+    checkDevice ();
+    return null;
+}
+
+/**
+ * Given a widget and a widget-specific id, returns the
+ * instance of the <code>Widget</code> subclass which represents
+ * the widget/id pair in the currently running application,
+ * if such exists, or null if no matching widget can be found.
+ *
+ * @param widget the widget
+ * @param id the id for the subwidget (usually an item)
+ * @return the SWT subwidget (usually an item) that the widget/id pair represents
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.3
+ */
+public Widget findWidget (Widget widget, int /*long*/ id) {
+    checkDevice ();
+    return null;
+}
+
+private static extern(C) void fixedClassInitProcFunc (void* g_class, void* class_data) {
+    version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Display {}:", __LINE__ ).flush;
+    GtkWidgetClass* klass = cast(GtkWidgetClass*)g_class;
+    klass.map = &fixedMapProcFunc;
+    oldFixedSizeAllocateProc = klass.size_allocate;
+    klass.size_allocate = &fixedSizeAllocateProc;
+}
+
+private static extern(C)  void fixedMapProcFunc (GtkWidget * handle) {
+    version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Display {}:", __LINE__ ).flush;
+    Display display = getCurrent ();
+    Widget widget = display.getWidget (handle);
+    if (widget !is null) widget.fixedMapProc (handle);
+}
+
+private static extern(C) static void fixedSizeAllocateProc (GtkWidget* handle, GtkAllocation* allocation) {
+    Display display = getCurrent ();
+    Widget widget = display.getWidget (handle);
+    if (widget !is null) return widget.fixedSizeAllocateProc (handle, allocation);
+    return oldFixedSizeAllocateProc(handle, allocation);
+}
+
+private static extern(C) void rendererClassInitProcFunc (void* g_class, void* class_data) {
+    version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Display {}:", __LINE__ ).flush;
+    GtkCellRendererClass* klass = cast(GtkCellRendererClass*)g_class;
+    klass.render = &rendererRenderProcFunc;
+    klass.get_size = &rendererGetSizeProcFunc;
+
+}
+private static extern(C) void rendererGetSizeProcFunc(
+    GtkCellRenderer      *cell,
+    GtkWidget            *handle,
+    GdkRectangle         *cell_area,
+    int                  *x_offset,
+    int                  *y_offset,
+    int                  *width,
+    int                  *height)
+{
+    version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Display {}:", __LINE__ ).flush;
+    Display display = getCurrent ();
+    Widget widget = display.getWidget (handle);
+    if (widget !is null) widget.rendererGetSizeProc (cell, handle, cell_area, x_offset, y_offset, width, height);
+}
+private static extern(C) void rendererRenderProcFunc(GtkCellRenderer * cell, GdkDrawable * window, GtkWidget * handle, GdkRectangle *background_area, GdkRectangle *cell_area, GdkRectangle *expose_area, int flags){
+    version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Display {}:", __LINE__ ).flush;
+    Display display = getCurrent ();
+    Widget widget = display.getWidget (handle);
+    if (widget !is null) widget.rendererRenderProc (cell, window, handle, background_area, cell_area, expose_area, flags);
+}
+
+void flushExposes (GdkWindow* window, bool all) {
+    OS.gdk_flush ();
+    OS.gdk_flush ();
+    if (OS.GDK_WINDOWING_X11 ()) {
+        this.flushWindow = window;
+        this.flushAll = all;
+        auto xDisplay = OS.GDK_DISPLAY ();
+        auto xEvent = cast(XEvent*)OS.g_malloc (XEvent.sizeof);
+        OS.XCheckIfEvent (xDisplay, xEvent, &checkIfEventProcFunc, cast(char*)this );
+        OS.g_free (xEvent);
+        this.flushWindow = null;
+    }
+}
+
+/**
+ * Returns the currently active <code>Shell</code>, or null
+ * if no shell belonging to the currently running application
+ * is active.
+ *
+ * @return the active shell or null
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Shell getActiveShell () {
+    checkDevice ();
+    return activeShell;
+}
+
+/**
+ * Returns a rectangle describing the receiver's size and location. Note that
+ * on multi-monitor systems the origin can be negative.
+ *
+ * @return the bounding rectangle
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public override Rectangle getBounds () {
+    checkDevice ();
+    return new Rectangle (0, 0, OS.gdk_screen_width (), OS.gdk_screen_height ());
+}
+
+/**
+ * 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.
+ *
+ * @return the current display
+ */
+public static Display getCurrent () {
+    return findDisplay (Thread.getThis ());
+}
+
+int getCaretBlinkTime () {
+//  checkDevice ();
+    auto settings = OS.gtk_settings_get_default ();
+    if (settings is null) return 500;
+    int  buffer;
+    OS.g_object_get1 (settings, OS.gtk_cursor_blink.ptr, &buffer );
+    if (buffer  is 0) return 0;
+    OS.g_object_get1 (settings, OS.gtk_cursor_blink_time.ptr, &buffer);
+    if (buffer  is 0) return 500;
+    /*
+    * By experimentation, GTK application don't use the whole
+    * blink cycle time.  Instead, they divide up the time, using
+    * an effective blink rate of about 1/2 the total time.
+    */
+    return buffer / 2;
+}
+
+/**
+ * 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.
+ *
+ * @return the control under the cursor
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Control getCursorControl () {
+    checkDevice();
+    int x, y;
+    GtkWidget* handle;
+    GtkWidget* user_data;
+    auto window = OS.gdk_window_at_pointer (&x, &y);
+    if (window !is null) {
+        OS.gdk_window_get_user_data (window, cast(void**)&user_data);
+        handle = user_data;
+    } else {
+        /*
+        * Feature in GTK. gdk_window_at_pointer() will not return a window
+        * if the pointer is over a foreign embedded window. The fix is to use
+        * XQueryPointer to find the containing GDK window.
+        */
+        if (!OS.GDK_WINDOWING_X11 ()) return null;
+        OS.gdk_error_trap_push ();
+        int unusedInt;
+        uint unusedUInt;
+        uint unusedPtr;
+        uint buffer;
+        uint xWindow, xParent = OS.XDefaultRootWindow (xDisplay);
+        do {
+            if (OS.XQueryPointer (xDisplay, xParent, &unusedPtr, &buffer, &unusedInt, &unusedInt, &unusedInt, &unusedInt, &unusedUInt) is 0) {
+                handle = null;
+                break;
+            }
+            if ((xWindow = buffer) !is 0) {
+                xParent = xWindow;
+                auto gdkWindow = OS.gdk_window_lookup (xWindow);
+                if (gdkWindow !is null) {
+                    OS.gdk_window_get_user_data (gdkWindow, cast(void**)&user_data);
+                    if (user_data !is null) handle = user_data;
+                }
+            }
+        } while (xWindow !is 0);
+        OS.gdk_error_trap_pop ();
+    }
+    if (handle is null) return null;
+    do {
+        Widget widget = getWidget (handle);
+        if (widget !is null && (null !is cast(Control)widget)) {
+            Control control = cast(Control) widget;
+            if (control.isEnabled ()) return control;
+        }
+    } while ((handle = OS.gtk_widget_get_parent (handle)) !is null);
+    return null;
+}
+
+bool filterEvent (Event event) {
+    if (filterTable !is null) filterTable.sendEvent (event);
+    return false;
+}
+
+bool filters (int eventType) {
+    if (filterTable is null) return false;
+    return filterTable.hooks (eventType);
+}
+
+private static extern(C) int filterProcFunc (GdkXEvent* xEvent, GdkEvent* gdkEvent, void* data) {
+    version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Display {}:", __LINE__ ).flush;
+    auto callbackdata = cast(CallbackData*)data;
+    auto disp = callbackdata.display;
+    if( disp is null ) return 0;
+    auto res =  disp.filterProcMeth(xEvent,gdkEvent,callbackdata);
+    return res;
+}
+
+int filterProcMeth (GdkXEvent* xEvent, GdkEvent* gdkEvent, CallbackData* callbackData) {
+    if( callbackData.data is null ){
+        /*
+         * Feature in GTK.  When button 4, 5, 6, or 7 is released, GTK
+         * does not deliver a corresponding GTK event.  Button 6 and 7
+         * are mapped to buttons 4 and 5 in SWT.  The fix is to change
+         * the button number of the event to a negative number so that
+         * it gets dispatched by GTK.  SWT has been modified to look
+         * for negative button numbers.
+         */
+        XButtonEvent* mouseEvent = cast(XButtonEvent*) xEvent;
+        if (mouseEvent.type is OS.ButtonRelease) {
+            switch (mouseEvent.button) {
+                case 6:
+                case 7:
+                    mouseEvent.button = -mouseEvent.button;
+                    break;
+                default:
+            }
+        }
+    }
+    Widget widget = getWidget (cast(GtkWidget*)callbackData.data);
+    if (widget is null) return 0;
+    return widget.filterProc (cast(XEvent*)xEvent, gdkEvent, callbackData.data);
+}
+
+/**
+ * Returns the location of the on-screen pointer relative
+ * to the top left corner of the screen.
+ *
+ * @return the cursor location
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Point getCursorLocation () {
+    checkDevice ();
+    int x, y;
+    OS.gdk_window_get_pointer (null, &x, &y, null);
+    return new Point (x, y);
+}
+
+/**
+ * Returns an array containing the recommended cursor sizes.
+ *
+ * @return the array of cursor sizes
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public Point [] getCursorSizes () {
+    checkDevice ();
+    return [new Point (16, 16), new Point (32, 32)];
+}
+
+/**
+ * Returns the application defined property of the receiver
+ * with the specified name, or null if it has not been set.
+ * <p>
+ * Applications may have associated arbitrary objects with the
+ * receiver in this fashion. If the objects stored in the
+ * properties need to be notified when the display is disposed
+ * of, it is the application's responsibility to provide a
+ * <code>disposeExec()</code> handler which does so.
+ * </p>
+ *
+ * @param key the name of the property
+ * @return the value of the property or null if it has not been set
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #setData(String, Object)
+ * @see #disposeExec(Runnable)
+ */
+public Object getData (String key) {
+    checkDevice ();
+    // SWT extension: allow null for zero length string
+    //if (key is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (key.equals (DISPATCH_EVENT_KEY)) {
+        return new ArrayWrapperInt(dispatchEvents);
+    }
+    if (key.equals (GET_MODAL_DIALOG)) {
+        return modalDialog;
+    }
+    if (key.equals (GET_DIRECTION_PROC_KEY)) {
+        return new LONG (cast(int) &setDirectionProcFunc);
+    }
+    if (key.equals (GET_EMISSION_PROC_KEY)) {
+        return new LONG (cast(int) &emissionFunc);
+    }
+    if (keys is null) return null;
+    for (int i=0; i<keys.length; i++) {
+        if (keys [i].equals(key)) return values [i];
+    }
+    return null;
+}
+
+/**
+ * Returns the application defined, display specific data
+ * associated with the receiver, or null if it has not been
+ * set. The <em>display specific data</em> is a single,
+ * unnamed field that is stored with every display.
+ * <p>
+ * Applications may put arbitrary objects in this field. If
+ * the object stored in the display specific data needs to
+ * be notified when the display is disposed of, it is the
+ * application's responsibility to provide a
+ * <code>disposeExec()</code> handler which does so.
+ * </p>
+ *
+ * @return the display specific data
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #setData(Object)
+ * @see #disposeExec(Runnable)
+ */
+public Object getData () {
+    checkDevice ();
+    return data;
+}
+
+/**
+ * Returns a point whose x coordinate is the horizontal
+ * dots per inch of the display, and whose y coordinate
+ * is the vertical dots per inch of the display.
+ *
+ * @return the horizontal and vertical DPI
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public override Point getDPI () {
+    checkDevice ();
+    int widthMM = OS.gdk_screen_width_mm ();
+    int width = OS.gdk_screen_width ();
+    int dpi = Compatibility.round (254 * width, widthMM * 10);
+    return new Point (dpi, dpi);
+}
+
+int /*long*/ gtk_fixed_get_type () {
+    return fixed_type;
+}
+
+int /*long*/ gtk_cell_renderer_text_get_type () {
+    return text_renderer_type;
+}
+
+int /*long*/ gtk_cell_renderer_pixbuf_get_type () {
+    return pixbuf_renderer_type;
+}
+
+int /*long*/ gtk_cell_renderer_toggle_get_type () {
+    return toggle_renderer_type;
+}
+
+/**
+ * Returns the default display. One is created (making the
+ * thread that invokes this method its user-interface thread)
+ * if it did not already exist.
+ *
+ * @return the default display
+ */
+public static Display getDefault () {
+    synchronized (Device.classinfo) {
+        if (Default is null) Default = new Display ();
+        return Default;
+    }
+}
+
+// /+static bool isValidClass (Class clazz) {
+// //PORTING_TODO   String name = clazz.getName ();
+// //PORTING_TODO   int index = name.lastIndexOf ('.');
+// //PORTING_TODO   return name.substring (0, index + 1)==/*eq*/ PACKAGE_PREFIX;
+//     return true;
+// }+/
+
+/**
+ * Returns the button dismissal alignment, one of <code>LEFT</code> or <code>RIGHT</code>.
+ * The button dismissal alignment is the ordering that should be used when positioning the
+ * default dismissal button for a dialog.  For example, in a dialog that contains an OK and
+ * CANCEL button, on platforms where the button dismissal alignment is <code>LEFT</code>, the
+ * button ordering should be OK/CANCEL.  When button dismissal alignment is <code>RIGHT</code>,
+ * the button ordering should be CANCEL/OK.
+ *
+ * @return the button dismissal order
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 2.1
+ */
+public int getDismissalAlignment () {
+    checkDevice ();
+    return SWT.RIGHT;
+}
+
+/**
+ * Returns the longest duration, in milliseconds, between
+ * two mouse button clicks that will be considered a
+ * <em>double click</em> by the underlying operating system.
+ *
+ * @return the double click time
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getDoubleClickTime () {
+    checkDevice ();
+    auto settings = OS.gtk_settings_get_default ();
+    int buffer;
+    OS.g_object_get1 (settings, OS.gtk_double_click_time.ptr, &buffer);
+    return buffer;
+}
+
+/**
+ * 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 the control under the cursor
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Control getFocusControl () {
+    checkDevice ();
+    if (focusControl !is null && !focusControl.isDisposed ()) {
+        return focusControl;
+    }
+    if (activeShell is null) return null;
+    auto shellHandle = activeShell.shellHandle;
+    auto handle = OS.gtk_window_get_focus (cast(GtkWindow*)shellHandle);
+    if (handle is null) return null;
+    do {
+        Widget widget = getWidget (handle);
+        if (widget !is null && (null !is cast(Control)widget)) {
+            Control control = cast(Control) widget;
+            return control.isEnabled () ? control : null;
+        }
+    } while ((handle = OS.gtk_widget_get_parent (handle)) !is null);
+    return null;
+}
+
+/**
+ * Returns true when the high contrast mode is enabled.
+ * Otherwise, false is returned.
+ * <p>
+ * Note: This operation is a hint and is not supported on
+ * platforms that do not have this concept.
+ * </p>
+ *
+ * @return the high contrast mode
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public bool getHighContrast () {
+    checkDevice ();
+    return false;
+}
+
+public override int getDepth () {
+    checkDevice ();
+    auto visual = OS.gdk_visual_get_system();
+    return visual.depth;
+}
+
+/**
+ * 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.
+ *
+ * @return the maximum icon depth
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see Device#getDepth
+ */
+public int getIconDepth () {
+    checkDevice ();
+    return getDepth ();
+}
+
+/**
+ * Returns an array containing the recommended icon sizes.
+ *
+ * @return the array of icon sizes
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see Decorations#setImages(Image[])
+ *
+ * @since 3.0
+ */
+public Point [] getIconSizes () {
+    checkDevice ();
+    return [new Point (16, 16), new Point (32, 32)];
+}
+
+int getLastEventTime () {
+    return lastEventTime;
+}
+
+int getMessageCount () {
+    return synchronizer.getMessageCount ();
+}
+
+Dialog getModalDialog () {
+    return modalDialog;
+}
+
+/**
+ * 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.
+ */
+Rectangle getWorkArea() {
+    auto atom = OS.gdk_atom_intern ("_NET_WORKAREA".ptr, true);
+    if (atom is null/*OS.GDK_NONE*/) return null;
+    void* actualType;
+    int actualFormat;
+    int actualLength;
+    char* data;
+    if (!OS.gdk_property_get (cast(GdkDrawable*)OS.GDK_ROOT_PARENT (), atom, null/*OS.GDK_NONE*/, 0, 16, 0, &actualType, &actualFormat, &actualLength, &data)) {
+        return null;
+    }
+    Rectangle result = null;
+    if (data !is null) {
+        if (actualLength is 16) {
+            int[] values = (cast(int*)data)[0..4];
+            result = new Rectangle (values [0],values [1],values [2],values [3]);
+        } else if (actualLength is 32) {
+            long[] values = (cast(long*)data)[0..4];
+            result = new Rectangle (cast(int)values [0],cast(int)values [1],cast(int)values [2],cast(int)values [3]);
+        }
+        OS.g_free (data);
+    }
+    return result;
+}
+
+/**
+ * Returns an array of monitors attached to the device.
+ *
+ * @return the array of monitors
+ *
+ * @since 3.0
+ */
+public org.eclipse.swt.widgets.Monitor.Monitor [] getMonitors () {
+    checkDevice ();
+    org.eclipse.swt.widgets.Monitor.Monitor [] monitors = null;
+    Rectangle workArea = getWorkArea();
+    auto screen = OS.gdk_screen_get_default ();
+    if (screen !is null) {
+        int monitorCount = OS.gdk_screen_get_n_monitors (screen);
+        if (monitorCount > 0) {
+            monitors = new org.eclipse.swt.widgets.Monitor.Monitor [monitorCount];
+            GdkRectangle* dest = new GdkRectangle ();
+            for (int i = 0; i < monitorCount; i++) {
+                OS.gdk_screen_get_monitor_geometry (screen, i, dest);
+                auto monitor = new org.eclipse.swt.widgets.Monitor.Monitor ();
+                monitor.handle = i;
+                monitor.x = dest.x;
+                monitor.y = dest.y;
+                monitor.width = dest.width;
+                monitor.height = dest.height;
+                if (i is 0 && workArea !is null) {
+                    monitor.clientX = workArea.x;
+                    monitor.clientY = workArea.y;
+                    monitor.clientWidth = workArea.width;
+                    monitor.clientHeight = workArea.height;
+                } else {
+                    monitor.clientX = monitor.x;
+                    monitor.clientY = monitor.y;
+                    monitor.clientWidth = monitor.width;
+                    monitor.clientHeight = monitor.height;
+                }
+                monitors [i] = monitor;
+            }
+        }
+    }
+    if (monitors is null) {
+        /* No multimonitor support detected, default to one monitor */
+        auto monitor = new org.eclipse.swt.widgets.Monitor.Monitor ();
+        Rectangle bounds = getBounds ();
+        monitor.x = bounds.x;
+        monitor.y = bounds.y;
+        monitor.width = bounds.width;
+        monitor.height = bounds.height;
+        if (workArea !is null) {
+            monitor.clientX = workArea.x;
+            monitor.clientY = workArea.y;
+            monitor.clientWidth = workArea.width;
+            monitor.clientHeight = workArea.height;
+        } else {
+            monitor.clientX = monitor.x;
+            monitor.clientY = monitor.y;
+            monitor.clientWidth = monitor.width;
+            monitor.clientHeight = monitor.height;
+        }
+        monitors = [ monitor ];
+    }
+    return monitors;
+}
+
+/**
+ * Returns the primary monitor for that device.
+ *
+ * @return the primary monitor
+ *
+ * @since 3.0
+ */
+public org.eclipse.swt.widgets.Monitor.Monitor getPrimaryMonitor () {
+    checkDevice ();
+    auto monitors = getMonitors ();
+    return monitors [0];
+}
+
+/**
+ * Returns a (possibly empty) array containing all shells which have
+ * not been disposed and have the receiver as their display.
+ *
+ * @return the receiver's shells
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Shell [] getShells () {
+    checkDevice ();
+    int index = 0;
+    Shell [] result = new Shell [16];
+    for (int i = 0; i < widgetTable.length; i++) {
+        Widget widget = widgetTable [i];
+        if (widget !is null && (null !is cast(Shell)widget)) {
+            int j = 0;
+            while (j < index) {
+                if (result [j] is widget) break;
+                j++;
+            }
+            if (j is index) {
+                if (index is result.length) {
+                    Shell [] newResult = new Shell [index + 16];
+                    System.arraycopy (result, 0, newResult, 0, index);
+                    result = newResult;
+                }
+                result [index++] = cast(Shell) widget;
+            }
+        }
+    }
+    if (index is result.length) return result;
+    Shell [] newResult = new Shell [index];
+    System.arraycopy (result, 0, newResult, 0, index);
+    return newResult;
+}
+
+/**
+ * Gets the synchronizer used by the display.
+ *
+ * @return the receiver's synchronizer
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.4
+ */
+public Synchronizer getSynchronizer () {
+    checkDevice ();
+    return synchronizer;
+}
+
+/**
+ * Returns the thread that has invoked <code>syncExec</code>
+ * or null if no such runnable is currently being invoked by
+ * the user-interface thread.
+ * <p>
+ * Note: If a runnable invoked by asyncExec is currently
+ * running, this method will return null.
+ * </p>
+ *
+ * @return the receiver's sync-interface thread
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Thread getSyncThread () {
+    synchronized (Device.classinfo) {
+        if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED);
+        return synchronizer.syncThread;
+    }
+}
+
+/**
+ * Returns the matching standard color for the given
+ * constant, which should be one of the color constants
+ * specified in class <code>SWT</code>. Any value other
+ * than one of the SWT color constants which is passed
+ * in will result in the color black. This color should
+ * not be free'd because it was allocated by the system,
+ * not the application.
+ *
+ * @param id the color constant
+ * @return the matching color
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see SWT
+ */
+public override Color getSystemColor (int id) {
+    checkDevice ();
+    GdkColor* gdkColor = null;
+    switch (id) {
+        case SWT.COLOR_INFO_FOREGROUND:                     gdkColor = COLOR_INFO_FOREGROUND; break;
+        case SWT.COLOR_INFO_BACKGROUND:                     gdkColor = COLOR_INFO_BACKGROUND; break;
+        case SWT.COLOR_TITLE_FOREGROUND:                    gdkColor = COLOR_TITLE_FOREGROUND; break;
+        case SWT.COLOR_TITLE_BACKGROUND:                    gdkColor = COLOR_TITLE_BACKGROUND; break;
+        case SWT.COLOR_TITLE_BACKGROUND_GRADIENT:           gdkColor = COLOR_TITLE_BACKGROUND_GRADIENT; break;
+        case SWT.COLOR_TITLE_INACTIVE_FOREGROUND:           gdkColor = COLOR_TITLE_INACTIVE_FOREGROUND; break;
+        case SWT.COLOR_TITLE_INACTIVE_BACKGROUND:           gdkColor = COLOR_TITLE_INACTIVE_BACKGROUND; break;
+        case SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT:  gdkColor = COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT; break;
+        case SWT.COLOR_WIDGET_DARK_SHADOW:                  gdkColor = COLOR_WIDGET_DARK_SHADOW; break;
+        case SWT.COLOR_WIDGET_NORMAL_SHADOW:                gdkColor = COLOR_WIDGET_NORMAL_SHADOW; break;
+        case SWT.COLOR_WIDGET_LIGHT_SHADOW:                 gdkColor = COLOR_WIDGET_LIGHT_SHADOW; break;
+        case SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW:             gdkColor = COLOR_WIDGET_HIGHLIGHT_SHADOW; break;
+        case SWT.COLOR_WIDGET_BACKGROUND:                   gdkColor = COLOR_WIDGET_BACKGROUND; break;
+        case SWT.COLOR_WIDGET_FOREGROUND:                   gdkColor = COLOR_WIDGET_FOREGROUND; break;
+        case SWT.COLOR_WIDGET_BORDER:                       gdkColor = COLOR_WIDGET_BORDER; break;
+        case SWT.COLOR_LIST_FOREGROUND:                     gdkColor = COLOR_LIST_FOREGROUND; break;
+        case SWT.COLOR_LIST_BACKGROUND:                     gdkColor = COLOR_LIST_BACKGROUND; break;
+        case SWT.COLOR_LIST_SELECTION:                      gdkColor = COLOR_LIST_SELECTION; break;
+        case SWT.COLOR_LIST_SELECTION_TEXT:                 gdkColor = COLOR_LIST_SELECTION_TEXT; break;
+        default:
+            return super.getSystemColor (id);
+    }
+    if (gdkColor is null) return super.getSystemColor (SWT.COLOR_BLACK);
+    return Color.gtk_new (this, gdkColor);
+}
+
+/**
+ * Returns the matching standard platform cursor for the given
+ * constant, which should be one of the cursor constants
+ * specified in class <code>SWT</code>. This cursor should
+ * not be free'd because it was allocated by the system,
+ * not the application.  A value of <code>null</code> will
+ * be returned if the supplied constant is not an SWT cursor
+ * constant.
+ *
+ * @param id the SWT cursor constant
+ * @return the corresponding cursor or <code>null</code>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see SWT#CURSOR_ARROW
+ * @see SWT#CURSOR_WAIT
+ * @see SWT#CURSOR_CROSS
+ * @see SWT#CURSOR_APPSTARTING
+ * @see SWT#CURSOR_HELP
+ * @see SWT#CURSOR_SIZEALL
+ * @see SWT#CURSOR_SIZENESW
+ * @see SWT#CURSOR_SIZENS
+ * @see SWT#CURSOR_SIZENWSE
+ * @see SWT#CURSOR_SIZEWE
+ * @see SWT#CURSOR_SIZEN
+ * @see SWT#CURSOR_SIZES
+ * @see SWT#CURSOR_SIZEE
+ * @see SWT#CURSOR_SIZEW
+ * @see SWT#CURSOR_SIZENE
+ * @see SWT#CURSOR_SIZESE
+ * @see SWT#CURSOR_SIZESW
+ * @see SWT#CURSOR_SIZENW
+ * @see SWT#CURSOR_UPARROW
+ * @see SWT#CURSOR_IBEAM
+ * @see SWT#CURSOR_NO
+ * @see SWT#CURSOR_HAND
+ *
+ * @since 3.0
+ */
+public Cursor getSystemCursor (int id) {
+    checkDevice ();
+    if (!(0 <= id && id < cursors.length)) return null;
+    if (cursors [id] is null) {
+        cursors [id] = new Cursor (this, id);
+    }
+    return cursors [id];
+}
+
+/**
+ * Returns the matching standard platform image for the given
+ * constant, which should be one of the icon constants
+ * specified in class <code>SWT</code>. This image should
+ * not be free'd because it was allocated by the system,
+ * not the application.  A value of <code>null</code> will
+ * be returned either if the supplied constant is not an
+ * SWT icon constant or if the platform does not define an
+ * image that corresponds to the constant.
+ *
+ * @param id the SWT icon constant
+ * @return the corresponding image or <code>null</code>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see SWT#ICON_ERROR
+ * @see SWT#ICON_INFORMATION
+ * @see SWT#ICON_QUESTION
+ * @see SWT#ICON_WARNING
+ * @see SWT#ICON_WORKING
+ *
+ * @since 3.0
+ */
+public Image getSystemImage (int id) {
+    checkDevice ();
+    switch (id) {
+        case SWT.ICON_ERROR:
+            if (errorImage is null) {
+                errorImage = createImage ("gtk-dialog-error"); //$NON-NLS-1$
+            }
+            return errorImage;
+        case SWT.ICON_INFORMATION:
+        case SWT.ICON_WORKING:
+            if (infoImage is null) {
+                infoImage = createImage ("gtk-dialog-info"); //$NON-NLS-1$
+            }
+            return infoImage;
+        case SWT.ICON_QUESTION:
+            if (questionImage is null) {
+                questionImage = createImage ("gtk-dialog-question"); //$NON-NLS-1$
+            }
+            return questionImage;
+        case SWT.ICON_WARNING:
+            if (warningImage is null) {
+                warningImage = createImage ("gtk-dialog-warning"); //$NON-NLS-1$
+            }
+            return warningImage;
+        default:
+    }
+    return null;
+}
+
+void initializeSystemColors () {
+    GdkColor* gdkColor;
+
+    /* Get Tooltip resources */
+    auto tooltipShellHandle = OS.gtk_window_new (OS.GTK_WINDOW_POPUP);
+    if (tooltipShellHandle is null) SWT.error (SWT.ERROR_NO_HANDLES);
+//  byte[] gtk_tooltips = Converter.wcsToMbcs (null, "gtk-tooltips", true);
+    OS.gtk_widget_set_name (tooltipShellHandle, "gtk-tooltips".ptr );
+    OS.gtk_widget_realize (tooltipShellHandle);
+    auto tooltipStyle = OS.gtk_widget_get_style (tooltipShellHandle);
+    gdkColor = new GdkColor();
+    OS.gtk_style_get_fg (tooltipStyle, OS.GTK_STATE_NORMAL, gdkColor);
+    COLOR_INFO_FOREGROUND = gdkColor;
+    gdkColor = new GdkColor();
+    OS.gtk_style_get_bg (tooltipStyle, OS.GTK_STATE_NORMAL, gdkColor);
+    COLOR_INFO_BACKGROUND = gdkColor;
+    OS.gtk_widget_destroy (tooltipShellHandle);
+
+    /* Get Shell resources */
+    auto style = OS.gtk_widget_get_style (shellHandle);
+    gdkColor = new GdkColor();
+    OS.gtk_style_get_black (style, gdkColor);
+    COLOR_WIDGET_DARK_SHADOW = gdkColor;
+    gdkColor = new GdkColor();
+    OS.gtk_style_get_dark (style, OS.GTK_STATE_NORMAL, gdkColor);
+    COLOR_WIDGET_NORMAL_SHADOW = gdkColor;
+    gdkColor = new GdkColor();
+    OS.gtk_style_get_bg (style, OS.GTK_STATE_NORMAL, gdkColor);
+    COLOR_WIDGET_LIGHT_SHADOW = gdkColor;
+    gdkColor = new GdkColor();
+    OS.gtk_style_get_light (style, OS.GTK_STATE_NORMAL, gdkColor);
+    COLOR_WIDGET_HIGHLIGHT_SHADOW = gdkColor;
+    gdkColor = new GdkColor();
+    OS.gtk_style_get_fg (style, OS.GTK_STATE_NORMAL, gdkColor);
+    COLOR_WIDGET_FOREGROUND = gdkColor;
+    gdkColor = new GdkColor();
+    OS.gtk_style_get_bg (style, OS.GTK_STATE_NORMAL, gdkColor);
+    COLOR_WIDGET_BACKGROUND = gdkColor;
+    //gdkColor = new GdkColor();
+    //OS.gtk_style_get_text (style, OS.GTK_STATE_NORMAL, gdkColor);
+    //COLOR_TEXT_FOREGROUND = gdkColor;
+    //gdkColor = new GdkColor();
+    //OS.gtk_style_get_base (style, OS.GTK_STATE_NORMAL, gdkColor);
+    //COLOR_TEXT_BACKGROUND = gdkColor;
+    gdkColor = new GdkColor();
+    OS.gtk_style_get_text (style, OS.GTK_STATE_NORMAL, gdkColor);
+    COLOR_LIST_FOREGROUND = gdkColor;
+    gdkColor = new GdkColor();
+    OS.gtk_style_get_base (style, OS.GTK_STATE_NORMAL, gdkColor);
+    COLOR_LIST_BACKGROUND = gdkColor;
+    gdkColor = new GdkColor();
+    OS.gtk_style_get_text (style, OS.GTK_STATE_SELECTED, gdkColor);
+    COLOR_LIST_SELECTION_TEXT = gdkColor;
+    gdkColor = new GdkColor();
+    OS.gtk_style_get_base (style, OS.GTK_STATE_SELECTED, gdkColor);
+    COLOR_LIST_SELECTION = gdkColor;
+    gdkColor = new GdkColor();
+    OS.gtk_style_get_bg (style, OS.GTK_STATE_SELECTED, gdkColor);
+    COLOR_TITLE_BACKGROUND = gdkColor;
+    gdkColor = new GdkColor();
+    OS.gtk_style_get_fg (style, OS.GTK_STATE_SELECTED, gdkColor);
+    COLOR_TITLE_FOREGROUND = gdkColor;
+    gdkColor = new GdkColor();
+    OS.gtk_style_get_light (style, OS.GTK_STATE_SELECTED, gdkColor);
+    COLOR_TITLE_BACKGROUND_GRADIENT = gdkColor;
+    gdkColor = new GdkColor();
+    OS.gtk_style_get_bg (style, OS.GTK_STATE_INSENSITIVE, gdkColor);
+    COLOR_TITLE_INACTIVE_BACKGROUND = gdkColor;
+    gdkColor = new GdkColor();
+    OS.gtk_style_get_fg (style, OS.GTK_STATE_INSENSITIVE, gdkColor);
+    COLOR_TITLE_INACTIVE_FOREGROUND = gdkColor;
+    gdkColor = new GdkColor();
+    OS.gtk_style_get_light (style, OS.GTK_STATE_INSENSITIVE, gdkColor);
+    COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT = gdkColor;
+}
+
+/**
+ * Returns a reasonable font for applications to use.
+ * On some platforms, this will match the "default font"
+ * or "system font" if such can be found.  This font
+ * should not be free'd because it was allocated by the
+ * system, not the application.
+ * <p>
+ * Typically, applications which want the default look
+ * should simply not set the font on the widgets they
+ * create. Widgets are always created with the correct
+ * default font for the class of user-interface component
+ * they represent.
+ * </p>
+ *
+ * @return a font
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public override Font getSystemFont () {
+    checkDevice ();
+    if (systemFont !is null) return systemFont;
+    auto style = OS.gtk_widget_get_style (shellHandle);
+    auto defaultFont = OS.pango_font_description_copy (OS.gtk_style_get_font_desc (style));
+    return systemFont = Font.gtk_new (this, defaultFont);
+}
+
+/**
+ * Returns the single instance of the system tray or null
+ * when there is no system tray available for the platform.
+ *
+ * @return the system tray or <code>null</code>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public Tray getSystemTray () {
+    checkDevice ();
+    if (tray !is null) return tray;
+    return tray = new Tray (this, SWT.NONE);
+}
+
+/**
+ * Returns the user-interface thread for the receiver.
+ *
+ * @return the receiver's user-interface thread
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Thread getThread () {
+    synchronized (Device.classinfo) {
+        if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED);
+        return thread;
+    }
+}
+
+Widget getWidget (GtkWidget* handle) {
+    if (handle is null) return null;
+    if (lastWidget !is null && lastHandle is handle) return lastWidget;
+    auto index = cast(int) OS.g_object_get_qdata ( cast(GObject*)handle, SWT_OBJECT_INDEX) - 1;
+    if (0 <= index && index < widgetTable.length) {
+        lastHandle = handle;
+        return lastWidget = widgetTable [cast(int)/*64*/index];
+    }
+    return null;
+}
+
+private static extern(C) int idleProcFunc (void* data) {
+    version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Display {}:", __LINE__ ).flush;
+    auto dbdata = cast(CallbackData*)data;
+    return dbdata.display.idleProc();
+}
+private int idleProc () {
+    bool result = runAsyncMessages (false);
+    if (!result) {
+        synchronized (idleLock) {
+            idleHandle = 0;
+        }
+    }
+    return result ? 1 : 0;
+    return 0;
+}
+
+/**
+ * Initializes any internal resources needed by the
+ * device.
+ * <p>
+ * This method is called after <code>create</code>.
+ * </p>
+ *
+ * @see #create
+ */
+protected override void init_ () {
+    super.init_ ();
+    initializeCallbacks ();
+    initializeSystemColors ();
+    initializeSystemSettings ();
+    initializeWidgetTable ();
+    initializeWindowManager ();
+}
+
+void initializeCallbacks () {
+    closures = new GClosure* [Widget.LAST_SIGNAL];
+    signalIds = new int [Widget.LAST_SIGNAL];
+
+    /* Cache signals for GtkWidget */
+    signalIds [Widget.BUTTON_PRESS_EVENT] = OS.g_signal_lookup (OS.button_press_event.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.BUTTON_RELEASE_EVENT] = OS.g_signal_lookup (OS.button_release_event.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.CONFIGURE_EVENT] = OS.g_signal_lookup (OS.configure_event.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.DELETE_EVENT] = OS.g_signal_lookup (OS.delete_event.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.ENTER_NOTIFY_EVENT] = OS.g_signal_lookup (OS.enter_notify_event.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.EVENT] = OS.g_signal_lookup (OS.event.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.EVENT_AFTER] = OS.g_signal_lookup (OS.event_after.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.EXPOSE_EVENT] = OS.g_signal_lookup (OS.expose_event.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.FOCUS] = OS.g_signal_lookup (OS.focus.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.FOCUS_IN_EVENT] = OS.g_signal_lookup (OS.focus_in_event.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.FOCUS_OUT_EVENT] = OS.g_signal_lookup (OS.focus_out_event.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.GRAB_FOCUS] = OS.g_signal_lookup (OS.grab_focus.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.HIDE] = OS.g_signal_lookup (OS.hide.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.KEY_PRESS_EVENT] = OS.g_signal_lookup (OS.key_press_event.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.KEY_RELEASE_EVENT] = OS.g_signal_lookup (OS.key_release_event.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.LEAVE_NOTIFY_EVENT] = OS.g_signal_lookup (OS.leave_notify_event.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.MAP] = OS.g_signal_lookup (OS.map.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.MAP_EVENT] = OS.g_signal_lookup (OS.map_event.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.MNEMONIC_ACTIVATE] = OS.g_signal_lookup (OS.mnemonic_activate.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.MOTION_NOTIFY_EVENT] = OS.g_signal_lookup (OS.motion_notify_event.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.POPUP_MENU] = OS.g_signal_lookup (OS.popup_menu.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.REALIZE] = OS.g_signal_lookup (OS.realize.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.SCROLL_EVENT] = OS.g_signal_lookup (OS.scroll_event.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.SHOW] = OS.g_signal_lookup (OS.show.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.SHOW_HELP] = OS.g_signal_lookup (OS.show_help.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.SIZE_ALLOCATE] = OS.g_signal_lookup (OS.size_allocate.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.STYLE_SET] = OS.g_signal_lookup (OS.style_set.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.UNMAP] = OS.g_signal_lookup (OS.unmap.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.UNMAP_EVENT] = OS.g_signal_lookup (OS.unmap_event.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.UNREALIZE] = OS.g_signal_lookup (OS.realize.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.VISIBILITY_NOTIFY_EVENT] = OS.g_signal_lookup (OS.visibility_notify_event.ptr, OS.GTK_TYPE_WIDGET ());
+    signalIds [Widget.WINDOW_STATE_EVENT] = OS.g_signal_lookup (OS.window_state_event.ptr, OS.GTK_TYPE_WIDGET ());
+
+    GClosure* do_cclosure_new( GCallback cb, int value, int notify ){
+        CallbackData* res= new CallbackData;
+        res.display = this;
+        res.data = cast(void*)value;
+        windowProcCallbackDatas[ value ] = res;
+        return OS.g_cclosure_new( cb, cast(void*)res, cast(GClosureNotify)notify );
+    }
+
+    GCallback windowProc2 = cast(GCallback)&windowProcFunc2;
+    closures [Widget.ACTIVATE] = do_cclosure_new (windowProc2, Widget.ACTIVATE, 0);
+    closures [Widget.ACTIVATE_INVERSE] = do_cclosure_new (windowProc2, Widget.ACTIVATE_INVERSE, 0);
+    closures [Widget.CHANGED] = do_cclosure_new (windowProc2, Widget.CHANGED, 0);
+    closures [Widget.CLICKED] = do_cclosure_new (windowProc2, Widget.CLICKED, 0);
+    closures [Widget.DAY_SELECTED] = do_cclosure_new (windowProc2, Widget.DAY_SELECTED, 0);
+    closures [Widget.HIDE] = do_cclosure_new (windowProc2, Widget.HIDE, 0);
+    closures [Widget.GRAB_FOCUS] = do_cclosure_new (windowProc2, Widget.GRAB_FOCUS, 0);
+    closures [Widget.MAP] = do_cclosure_new (windowProc2, Widget.MAP, 0);
+    closures [Widget.MONTH_CHANGED] = do_cclosure_new (windowProc2, Widget.MONTH_CHANGED, 0);
+    closures [Widget.OUTPUT] = do_cclosure_new (windowProc2, Widget.OUTPUT, 0);
+    closures [Widget.POPUP_MENU] = do_cclosure_new (windowProc2, Widget.POPUP_MENU, 0);
+    closures [Widget.PREEDIT_CHANGED] = do_cclosure_new (windowProc2, Widget.PREEDIT_CHANGED, 0);
+    closures [Widget.REALIZE] = do_cclosure_new (windowProc2, Widget.REALIZE, 0);
+    closures [Widget.SELECT] = do_cclosure_new (windowProc2, Widget.SELECT, 0);
+    closures [Widget.SHOW] = do_cclosure_new (windowProc2, Widget.SHOW, 0);
+    closures [Widget.VALUE_CHANGED] = do_cclosure_new (windowProc2, Widget.VALUE_CHANGED, 0);
+    closures [Widget.UNMAP] = do_cclosure_new (windowProc2, Widget.UNMAP, 0);
+    closures [Widget.UNREALIZE] = do_cclosure_new (windowProc2, Widget.UNREALIZE, 0);
+
+    GCallback windowProc3 = cast(GCallback)&windowProcFunc3;
+    closures [Widget.BUTTON_PRESS_EVENT] = do_cclosure_new (windowProc3, Widget.BUTTON_PRESS_EVENT, 0);
+    closures [Widget.BUTTON_PRESS_EVENT_INVERSE] = do_cclosure_new (windowProc3, Widget.BUTTON_PRESS_EVENT_INVERSE, 0);
+    closures [Widget.BUTTON_RELEASE_EVENT] = do_cclosure_new (windowProc3, Widget.BUTTON_RELEASE_EVENT, 0);
+    closures [Widget.BUTTON_RELEASE_EVENT_INVERSE] = do_cclosure_new (windowProc3, Widget.BUTTON_RELEASE_EVENT_INVERSE, 0);
+    closures [Widget.COMMIT] = do_cclosure_new (windowProc3, Widget.COMMIT, 0);
+    closures [Widget.CONFIGURE_EVENT] = do_cclosure_new (windowProc3, Widget.CONFIGURE_EVENT, 0);
+    closures [Widget.DELETE_EVENT] = do_cclosure_new (windowProc3, Widget.DELETE_EVENT, 0);
+    closures [Widget.ENTER_NOTIFY_EVENT] = do_cclosure_new (windowProc3, Widget.ENTER_NOTIFY_EVENT, 0);
+    closures [Widget.EVENT] = do_cclosure_new (windowProc3, Widget.EVENT, 0);
+    closures [Widget.EVENT_AFTER] = do_cclosure_new (windowProc3, Widget.EVENT_AFTER, 0);
+    closures [Widget.EXPOSE_EVENT] = do_cclosure_new (windowProc3, Widget.EXPOSE_EVENT, 0);
+    closures [Widget.EXPOSE_EVENT_INVERSE] = do_cclosure_new (windowProc3, Widget.EXPOSE_EVENT_INVERSE, 0);
+    closures [Widget.FOCUS] = do_cclosure_new (windowProc3, Widget.FOCUS, 0);
+    closures [Widget.FOCUS_IN_EVENT] = do_cclosure_new (windowProc3, Widget.FOCUS_IN_EVENT, 0);
+    closures [Widget.FOCUS_OUT_EVENT] = do_cclosure_new (windowProc3, Widget.FOCUS_OUT_EVENT, 0);
+    closures [Widget.KEY_PRESS_EVENT] = do_cclosure_new (windowProc3, Widget.KEY_PRESS_EVENT, 0);
+    closures [Widget.KEY_RELEASE_EVENT] = do_cclosure_new (windowProc3, Widget.KEY_RELEASE_EVENT, 0);
+    closures [Widget.INPUT] = do_cclosure_new (windowProc3, Widget.INPUT, 0);
+    closures [Widget.LEAVE_NOTIFY_EVENT] = do_cclosure_new (windowProc3, Widget.LEAVE_NOTIFY_EVENT, 0);
+    closures [Widget.MAP_EVENT] = do_cclosure_new (windowProc3, Widget.MAP_EVENT, 0);
+    closures [Widget.MNEMONIC_ACTIVATE] = do_cclosure_new (windowProc3, Widget.MNEMONIC_ACTIVATE, 0);
+    closures [Widget.MOTION_NOTIFY_EVENT] = do_cclosure_new (windowProc3, Widget.MOTION_NOTIFY_EVENT, 0);
+    closures [Widget.MOTION_NOTIFY_EVENT_INVERSE] = do_cclosure_new (windowProc3, Widget.MOTION_NOTIFY_EVENT_INVERSE, 0);
+    closures [Widget.MOVE_FOCUS] = do_cclosure_new (windowProc3, Widget.MOVE_FOCUS, 0);
+    closures [Widget.POPULATE_POPUP] = do_cclosure_new (windowProc3, Widget.POPULATE_POPUP, 0);
+    closures [Widget.SCROLL_EVENT] = do_cclosure_new (windowProc3, Widget.SCROLL_EVENT, 0);
+    closures [Widget.SHOW_HELP] = do_cclosure_new (windowProc3, Widget.SHOW_HELP, 0);
+    closures [Widget.SIZE_ALLOCATE] = do_cclosure_new (windowProc3, Widget.SIZE_ALLOCATE, 0);
+    closures [Widget.STYLE_SET] = do_cclosure_new (windowProc3, Widget.STYLE_SET, 0);
+    closures [Widget.TOGGLED] = do_cclosure_new (windowProc3, Widget.TOGGLED, 0);
+    closures [Widget.UNMAP_EVENT] = do_cclosure_new (windowProc3, Widget.UNMAP_EVENT, 0);
+    closures [Widget.VISIBILITY_NOTIFY_EVENT] = do_cclosure_new (windowProc3, Widget.VISIBILITY_NOTIFY_EVENT, 0);
+    closures [Widget.WINDOW_STATE_EVENT] = do_cclosure_new (windowProc3, Widget.WINDOW_STATE_EVENT, 0);
+
+    GCallback windowProc4 = cast(GCallback)&windowProcFunc4;
+    closures [Widget.DELETE_RANGE] = do_cclosure_new (windowProc4, Widget.DELETE_RANGE, 0);
+    closures [Widget.DELETE_TEXT] = do_cclosure_new (windowProc4, Widget.DELETE_TEXT, 0);
+    closures [Widget.ROW_ACTIVATED] = do_cclosure_new (windowProc4, Widget.ROW_ACTIVATED, 0);
+    closures [Widget.SCROLL_CHILD] = do_cclosure_new (windowProc4, Widget.SCROLL_CHILD, 0);
+    closures [Widget.SWITCH_PAGE] = do_cclosure_new (windowProc4, Widget.SWITCH_PAGE, 0);
+    closures [Widget.TEST_COLLAPSE_ROW] = do_cclosure_new (windowProc4, Widget.TEST_COLLAPSE_ROW, 0);
+    closures [Widget.TEST_EXPAND_ROW] = do_cclosure_new (windowProc4, Widget.TEST_EXPAND_ROW, 0);
+
+    GCallback windowProc5 = cast(GCallback)&windowProcFunc5;
+    closures [Widget.CHANGE_VALUE] = do_cclosure_new (windowProc5, Widget.CHANGE_VALUE, 0);
+    closures [Widget.EXPAND_COLLAPSE_CURSOR_ROW] = do_cclosure_new (windowProc5, Widget.EXPAND_COLLAPSE_CURSOR_ROW, 0);
+    closures [Widget.INSERT_TEXT] = do_cclosure_new (windowProc5, Widget.INSERT_TEXT, 0);
+    closures [Widget.TEXT_BUFFER_INSERT_TEXT] = do_cclosure_new (windowProc5, Widget.TEXT_BUFFER_INSERT_TEXT, 0);
+
+    for (int i = 0; i < Widget.LAST_SIGNAL; i++) {
+        if (closures [i] !is null) OS.g_closure_ref (closures [i]);
+    }
+    shellMapProcCallbackData.display = this;
+    shellMapProcCallbackData.data = null;
+    shellMapProcClosure = OS.g_cclosure_new (cast(GCallback)&shellMapProcFunc, &shellMapProcCallbackData, cast(GClosureNotify)0);
+    OS.g_closure_ref (shellMapProcClosure);
+}
+
+void* getWindowProcUserData( int value ){
+    return windowProcCallbackDatas[ value ];
+
+}
+
+void initializeSystemSettings () {
+    styleSetProcCallbackData.display = this;
+    styleSetProcCallbackData.data = null;
+    OS.g_signal_connect (shellHandle, OS.style_set.ptr, cast(GCallback)&styleSetProcFunc, &styleSetProcCallbackData);
+
+    /*
+    * Feature in GTK.  Despite the fact that the
+    * gtk-entry-select-on-focus property is a global
+    * setting, it is initialized when the GtkEntry
+    * is initialized.  This means that it cannot be
+    * accessed before a GtkEntry is created.  The
+    * fix is to for the initializaion by creating
+    * a temporary GtkEntry.
+    */
+    auto entry = OS.gtk_entry_new ();
+    OS.gtk_widget_destroy (entry);
+    int buffer2;
+    auto settings = OS.gtk_settings_get_default ();
+    OS.g_object_get1 (settings, OS.gtk_entry_select_on_focus.ptr, &buffer2);
+    entrySelectOnFocus = buffer2 !is 0;
+}
+
+void initializeWidgetTable () {
+    indexTable = new int [GROW_SIZE];
+    widgetTable = new Widget [GROW_SIZE];
+    for (int i=0; i<GROW_SIZE-1; i++) indexTable [i] = i + 1;
+    indexTable [GROW_SIZE - 1] = -1;
+}
+
+void initializeWindowManager () {
+    /* Get the window manager name */
+    windowManager = ""; //$NON-NLS-1$
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 2, 0)) {
+        auto screen = OS.gdk_screen_get_default ();
+        if (screen !is null) {
+            auto ptr2 = OS.gdk_x11_screen_get_window_manager_name (screen);
+            windowManager = fromStringz( ptr2 );
+        }
+    }
+}
+
+/**
+ * Invokes platform specific functionality to dispose a GC handle.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Display</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param hDC the platform specific GC handle
+ * @param data the platform specific GC data
+ */
+public override void internal_dispose_GC (GdkGC* gdkGC, GCData data) {
+    OS.g_object_unref (gdkGC);
+}
+
+/**
+ * Invokes platform specific functionality to allocate a new GC handle.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Display</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param data the platform specific GC data
+ * @return the platform specific GC handle
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ * @exception SWTError <ul>
+ *    <li>ERROR_NO_HANDLES if a handle could not be obtained for gc creation</li>
+ * </ul>
+ */
+public override GdkGC* internal_new_GC (GCData data) {
+    if (isDisposed()) SWT.error(SWT.ERROR_DEVICE_DISPOSED);
+    auto root = cast(GdkDrawable *) OS.GDK_ROOT_PARENT ();
+    auto gdkGC = OS.gdk_gc_new (root);
+    if (gdkGC is null) SWT.error (SWT.ERROR_NO_HANDLES);
+    OS.gdk_gc_set_subwindow (gdkGC, OS.GDK_INCLUDE_INFERIORS);
+    if (data !is null) {
+        int mask = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
+        if ((data.style & mask) is 0) {
+            data.style |= SWT.LEFT_TO_RIGHT;
+        }
+        data.device = this;
+        data.drawable = root;
+        data.background = getSystemColor (SWT.COLOR_WHITE).handle;
+        data.foreground = getSystemColor (SWT.COLOR_BLACK).handle;
+        data.font = getSystemFont ();
+    }
+    return gdkGC;
+    return null;
+}
+
+bool isValidThread () {
+    return thread is Thread.getThis ();
+}
+
+/**
+ * Maps a point from one coordinate system to another.
+ * When the control is null, coordinates are mapped to
+ * the display.
+ * <p>
+ * NOTE: On right-to-left platforms where the coordinate
+ * systems are mirrored, special care needs to be taken
+ * when mapping coordinates from one control to another
+ * to ensure the result is correctly mirrored.
+ *
+ * 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.
+ * </p>
+ *
+ * @param from the source <code>Control</code> or <code>null</code>
+ * @param to the destination <code>Control</code> or <code>null</code>
+ * @param point to be mapped
+ * @return point with mapped coordinates
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 2.1.2
+ */
+public Point map (Control from, Control to, Point point) {
+    checkDevice ();
+    if (point is null) error (SWT.ERROR_NULL_ARGUMENT);
+    return map (from, to, point.x, point.y);
+}
+
+/**
+ * Maps a point from one coordinate system to another.
+ * When the control is null, coordinates are mapped to
+ * the display.
+ * <p>
+ * NOTE: On right-to-left platforms where the coordinate
+ * systems are mirrored, special care needs to be taken
+ * when mapping coordinates from one control to another
+ * to ensure the result is correctly mirrored.
+ *
+ * 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.
+ * </p>
+ *
+ * @param from the source <code>Control</code> or <code>null</code>
+ * @param to the destination <code>Control</code> or <code>null</code>
+ * @param x coordinates to be mapped
+ * @param y coordinates to be mapped
+ * @return point with mapped coordinates
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 2.1.2
+ */
+public Point map (Control from, Control to, int x, int y) {
+    checkDevice ();
+    if (from !is null && from.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
+    if (to !is null && to.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
+    Point point = new Point (x, y);
+    if (from is to) return point;
+    if (from !is null) {
+        auto window = from.eventWindow ();
+        int origin_x, origin_y;
+        OS.gdk_window_get_origin (window, &origin_x, &origin_y);
+        if ((from.style & SWT.MIRRORED) !is 0) point.x = from.getClientWidth () - point.x;
+        point.x += origin_x;
+        point.y += origin_y;
+    }
+    if (to !is null) {
+        auto window = to.eventWindow ();
+        int origin_x, origin_y;
+        OS.gdk_window_get_origin (window, &origin_x, &origin_y);
+        point.x -= origin_x;
+        point.y -= origin_y;
+        if ((to.style & SWT.MIRRORED) !is 0) point.x = to.getClientWidth () - point.x;
+    }
+    return point;
+}
+
+/**
+ * Maps a point from one coordinate system to another.
+ * When the control is null, coordinates are mapped to
+ * the display.
+ * <p>
+ * NOTE: On right-to-left platforms where the coordinate
+ * systems are mirrored, special care needs to be taken
+ * when mapping coordinates from one control to another
+ * to ensure the result is correctly mirrored.
+ *
+ * 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.
+ * </p>
+ *
+ * @param from the source <code>Control</code> or <code>null</code>
+ * @param to the destination <code>Control</code> or <code>null</code>
+ * @param rectangle to be mapped
+ * @return rectangle with mapped coordinates
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the rectangle is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 2.1.2
+ */
+public Rectangle map (Control from, Control to, Rectangle rectangle) {
+    checkDevice();
+    if (rectangle is null) error (SWT.ERROR_NULL_ARGUMENT);
+    return map (from, to, rectangle.x, rectangle.y, rectangle.width, rectangle.height);
+}
+
+static wchar mbcsToWcs (wchar ch) {
+    int key = ch & 0xFFFF;
+    if (key <= 0x7F) return ch;
+    char [] buffer;
+    if (key <= 0xFF) {
+        buffer = new char [1];
+        buffer [0] = cast(char) key;
+    } else {
+        buffer = new char [2];
+        buffer [0] = cast(char) ((key >> 8) & 0xFF);
+        buffer [1] = cast(char) (key & 0xFF);
+    }
+    wchar [] result = Converter.mbcsToWcs (null, buffer);
+    if (result.length is 0) return 0;
+    return result [0];
+}
+
+
+package void doMenuPositionProc( GtkMenu* window, bool hasLocation ){
+    /*
+    * Bug in GTK.  The timestamp passed into gtk_menu_popup is used
+    * to perform an X pointer grab.  It cannot be zero, else the grab
+    * will fail.  The fix is to ensure that the timestamp of the last
+    * event processed is used.
+    */
+    OS.gtk_menu_popup (window, null, null,
+        hasLocation ? &menuPositionProcFunc : null,
+        cast(void*)this, 0, getLastEventTime() );
+}
+
+private static extern(C) void menuPositionProcFunc (GtkMenu* menu, int* x, int* y, int* push_in, void* user_data) {
+    version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Display {}:", __LINE__ ).flush;
+    auto display = cast(Display)user_data;
+    display.menuPositionProc( menu, x, y, push_in, null );
+}
+
+void menuPositionProc (GtkMenu* menu, int* x, int* y, int* push_in, void* user_data) {
+    Widget widget = getWidget (cast(GtkWidget*)menu);
+    if (widget is null) return 0;
+    widget.menuPositionProc (menu, x, y, push_in, user_data);
+}
+
+/**
+ * Maps a point from one coordinate system to another.
+ * When the control is null, coordinates are mapped to
+ * the display.
+ * <p>
+ * NOTE: On right-to-left platforms where the coordinate
+ * systems are mirrored, special care needs to be taken
+ * when mapping coordinates from one control to another
+ * to ensure the result is correctly mirrored.
+ *
+ * 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.
+ * </p>
+ *
+ * @param from the source <code>Control</code> or <code>null</code>
+ * @param to the destination <code>Control</code> or <code>null</code>
+ * @param x coordinates to be mapped
+ * @param y coordinates to be mapped
+ * @param width coordinates to be mapped
+ * @param height coordinates to be mapped
+ * @return rectangle with mapped coordinates
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 2.1.2
+ */
+public Rectangle map (Control from, Control to, int x, int y, int width, int height) {
+    checkDevice();
+    if (from !is null && from.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
+    if (to !is null && to.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
+    Rectangle rect = new Rectangle (x, y, width, height);
+    if (from is to) return rect;
+    bool fromRTL = false, toRTL = false;
+    if (from !is null) {
+        auto window = from.eventWindow ();
+        int origin_x, origin_y;
+        OS.gdk_window_get_origin (window, &origin_x, &origin_y);
+        fromRTL = (from.style & SWT.MIRRORED) !is 0;
+        if (fromRTL) rect.x = from.getClientWidth() - rect.x;
+        rect.x += origin_x;
+        rect.y += origin_y;
+    }
+    if (to !is null) {
+        auto window = to.eventWindow ();
+        int origin_x, origin_y;
+        OS.gdk_window_get_origin (window, &origin_x, &origin_y);
+        rect.x -= origin_x;
+        rect.y -= origin_y;
+        toRTL = (to.style & SWT.MIRRORED) !is 0;
+        if (toRTL) rect.x = to.getClientWidth () - rect.x;
+    }
+    if (fromRTL !is toRTL) rect.x -= rect.width;
+    return rect;
+}
+
+private static extern(C) int /*long*/ mouseHoverProcFunc ( void* user_data) {
+    version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Display {}:", __LINE__ ).flush;
+    CallbackData* cbdata = cast(CallbackData*)user_data;
+    return cbdata.display.mouseHoverProc( cast(GtkWidget*)cbdata.data );
+}
+int /*long*/ mouseHoverProc (GtkWidget* handle) {
+    Widget widget = getWidget (handle);
+    if (widget is null) return 0;
+    return widget.hoverProc (handle);
+}
+
+/**
+ * Generate a low level system event.
+ *
+ * <code>post</code> is 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.
+ * <p>
+ * 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.
+ * </p>
+ * <p>
+ * <b>Event Types:</b>
+ * <p>KeyDown, KeyUp
+ * <p>The following fields in the <code>Event</code> apply:
+ * <ul>
+ * <li>(in) type KeyDown or KeyUp</li>
+ * <p> Either one of:
+ * <li>(in) character a character that corresponds to a keyboard key</li>
+ * <li>(in) keyCode the key code of the key that was typed,
+ *          as defined by the key code constants in class <code>SWT</code></li>
+ * </ul>
+ * <p>MouseDown, MouseUp</p>
+ * <p>The following fields in the <code>Event</code> apply:
+ * <ul>
+ * <li>(in) type MouseDown or MouseUp
+ * <li>(in) button the button that is pressed or released
+ * </ul>
+ * <p>MouseMove</p>
+ * <p>The following fields in the <code>Event</code> apply:
+ * <ul>
+ * <li>(in) type MouseMove
+ * <li>(in) x the x coordinate to move the mouse pointer to in screen coordinates
+ * <li>(in) y the y coordinate to move the mouse pointer to in screen coordinates
+ * </ul>
+ * </dl>
+ *
+ * @param event the event to be generated
+ *
+ * @return true if the event was generated or false otherwise
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the event is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ *
+ */
+public bool post (Event event) {
+    synchronized (Device.classinfo) {
+        if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED);
+        if (event is null) error (SWT.ERROR_NULL_ARGUMENT);
+        if (!OS.GDK_WINDOWING_X11()) return false;
+        auto xDisplay = OS.GDK_DISPLAY ();
+        int type = event.type;
+        switch (type) {
+            case SWT.KeyDown:
+            case SWT.KeyUp: {
+                int keyCode = 0;
+                auto keysym = untranslateKey (event.keyCode);
+                if (keysym !is 0) keyCode = OS.XKeysymToKeycode (xDisplay, keysym);
+                if (keyCode is 0) {
+                    char key = event.character;
+                    switch (key) {
+                        case SWT.BS: keysym = OS.GDK_BackSpace; break;
+                        case SWT.CR: keysym = OS.GDK_Return; break;
+                        case SWT.DEL: keysym = OS.GDK_Delete; break;
+                        case SWT.ESC: keysym = OS.GDK_Escape; break;
+                        case SWT.TAB: keysym = OS.GDK_Tab; break;
+                        case SWT.LF: keysym = OS.GDK_Linefeed; break;
+                        default:
+                            keysym = key;
+                    }
+                    keyCode = OS.XKeysymToKeycode (xDisplay, keysym);
+                    if (keyCode is 0) return false;
+                }
+                OS.XTestFakeKeyEvent (xDisplay, keyCode, type is SWT.KeyDown, 0);
+                return true;
+            }
+            case SWT.MouseDown:
+            case SWT.MouseMove:
+            case SWT.MouseUp: {
+                if (type is SWT.MouseMove) {
+                    OS.XTestFakeMotionEvent (xDisplay, -1, event.x, event.y, 0);
+                } else {
+                    int button = event.button;
+                    switch (button) {
+                        case 1:
+                        case 2:
+                        case 3: break;
+                        case 4: button = 6; break;
+                        case 5: button = 7; break;
+                        default: return false;
+                    }
+                    OS.XTestFakeButtonEvent (xDisplay, button, type is SWT.MouseDown, 0);
+                }
+                return true;
+        default:
+            }
+            /*
+            * This code is intentionally commented. After posting a
+            * mouse wheel event the system may respond unpredictably
+            * to subsequent mouse actions.
+            */
+//          case SWT.MouseWheel: {
+//              if (event.count is 0) return false;
+//              int button = event.count < 0 ? 5 : 4;
+//              OS.XTestFakeButtonEvent (xDisplay, button, type is SWT.MouseWheel, 0);
+//          }
+        }
+        return false;
+    }
+}
+
+void postEvent (Event event) {
+    /*
+    * Place the event at the end of the event queue.
+    * This code is always called in the Display's
+    * thread so it must be re-enterant but does not
+    * need to be synchronized.
+    */
+    if (eventQueue is null) eventQueue = new Event [4];
+    int index = 0;
+    int length = eventQueue.length;
+    while (index < length) {
+        if (eventQueue [index] is null) break;
+        index++;
+    }
+    if (index is length) {
+        Event [] newQueue = new Event [length + 4];
+        System.arraycopy (eventQueue, 0, newQueue, 0, length);
+        eventQueue = newQueue;
+    }
+    eventQueue [index] = event;
+}
+
+void putGdkEvents () {
+    if (gdkEventCount !is 0) {
+        for (int i = 0; i < gdkEventCount; i++) {
+            auto event = gdkEvents [i];
+            Widget widget = gdkEventWidgets [i];
+            if (widget is null || !widget.isDisposed ()) {
+                OS.gdk_event_put (event);
+            }
+            OS.gdk_event_free (event);
+            gdkEvents [i] = null;
+            gdkEventWidgets [i] = null;
+        }
+        gdkEventCount = 0;
+    }
+}
+
+/**
+ * Reads an event from the operating system's event queue,
+ * dispatches it appropriately, and returns <code>true</code>
+ * if there is potentially more work to do, or <code>false</code>
+ * if the caller can sleep until another event is placed on
+ * the event queue.
+ * <p>
+ * In addition to checking the system event queue, this method also
+ * checks if any inter-thread messages (created by <code>syncExec()</code>
+ * or <code>asyncExec()</code>) are waiting to be processed, and if
+ * so handles them before returning.
+ * </p>
+ *
+ * @return <code>false</code> if the caller can sleep upon return from this method
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_FAILED_EXEC - if an exception occurred while running an inter-thread message</li>
+ * </ul>
+ *
+ * @see #sleep
+ * @see #wake
+ */
+public bool readAndDispatch () {
+    checkDevice ();
+    bool events = false;
+    events |= runSettings ();
+    events |= runPopups ();
+    events |= cast(bool)OS.g_main_context_iteration (null, false);
+    if (events) {
+        runDeferredEvents ();
+        return true;
+    }
+    return runAsyncMessages (false);
+}
+
+static void register (Display display) {
+    synchronized (Device.classinfo) {
+        for (int i=0; i<Displays.length; i++) {
+            if (Displays [i] is null) {
+                Displays [i] = display;
+                return;
+            }
+        }
+        Display [] newDisplays = new Display [Displays.length + 4];
+        System.arraycopy (Displays, 0, newDisplays, 0, Displays.length);
+        newDisplays [Displays.length] = display;
+        Displays = newDisplays;
+    }
+}
+
+/**
+ * Releases any internal resources back to the operating
+ * system and clears all fields except the device handle.
+ * <p>
+ * Disposes all shells which are currently open on the display.
+ * After this method has been invoked, all related related shells
+ * will answer <code>true</code> when sent the message
+ * <code>isDisposed()</code>.
+ * </p><p>
+ * When a device is destroyed, resources that were acquired
+ * on behalf of the programmer need to be returned to the
+ * operating system.  For example, if the device allocated a
+ * font to be used as the system font, this font would be
+ * freed in <code>release</code>.  Also,to assist the garbage
+ * collector and minimize the amount of memory that is not
+ * reclaimed when the programmer keeps a reference to a
+ * disposed device, all fields except the handle are zero'd.
+ * The handle is needed by <code>destroy</code>.
+ * </p>
+ * This method is called before <code>destroy</code>.
+ *
+ * @see Device#dispose
+ * @see #destroy
+ */
+protected override void release () {
+    sendEvent (SWT.Dispose, new Event ());
+    Shell [] shells = getShells ();
+    for (int i=0; i<shells.length; i++) {
+        Shell shell = shells [i];
+        if (!shell.isDisposed ())  shell.dispose ();
+    }
+    if (tray !is null) tray.dispose ();
+    tray = null;
+    while (readAndDispatch ()) {}
+    if (disposeList !is null) {
+        for (int i=0; i<disposeList.length; i++) {
+            if (disposeList [i] !is null) disposeList [i].run ();
+        }
+    }
+    disposeList = null;
+    synchronizer.releaseSynchronizer ();
+    synchronizer = null;
+    releaseDisplay ();
+    super.release ();
+}
+
+void releaseDisplay () {
+
+    /* Dispose xfilter callback */
+    OS.gdk_window_remove_filter(null, &filterProcFunc, null);
+
+    /* Dispose checkIfEvent callback */
+
+    /* Dispose preedit window */
+    if (preeditWindow !is null) OS.gtk_widget_destroy ( &preeditWindow.bin.container.widget);
+    imControl = null;
+
+    /* Dispose the menu callback */
+
+    /* Dispose the tooltip map callback */
+
+    /* Dispose the shell map callback */
+
+    /* Dispose the run async messages callback */
+    if (idleHandle !is 0) OS.g_source_remove (idleHandle);
+    idleHandle = 0;
+
+    /* Dispose GtkTreeView callbacks */
+
+    /* Dispose the set direction callback */
+
+    /* Dispose the emission proc callback */
+
+    /* Dispose the set direction callback */
+
+    /* Dispose the caret callback */
+    if (caretId !is 0) OS.gtk_timeout_remove (caretId);
+    caretId = 0;
+
+    /* Release closures */
+    for (int i = 0; i < Widget.LAST_SIGNAL; i++) {
+        if (closures [i] !is null) OS.g_closure_unref (closures [i]);
+    }
+    if (shellMapProcClosure !is null) OS.g_closure_unref (shellMapProcClosure);
+
+    /* Dispose the timer callback */
+    if (timerIds !is null) {
+        for (int i=0; i<timerIds.length; i++) {
+            if (timerIds [i] !is 0) OS.gtk_timeout_remove (timerIds [i]);
+        }
+    }
+    timerIds = null;
+    timerList = null;
+
+    /* Dispose mouse hover callback */
+    if (mouseHoverId !is 0) OS.gtk_timeout_remove (mouseHoverId);
+    mouseHoverId = 0;
+    mouseHoverHandle = null;
+
+    /* Dispose the default font */
+    if (systemFont !is null) systemFont.dispose ();
+    systemFont = null;
+
+    /* Dispose the System Images */
+    if (errorImage !is null) errorImage.dispose();
+    if (infoImage !is null) infoImage.dispose();
+    if (questionImage !is null) questionImage.dispose();
+    if (warningImage !is null) warningImage.dispose();
+    errorImage = infoImage = questionImage = warningImage = null;
+
+    /* Release the System Cursors */
+    for (int i = 0; i < cursors.length; i++) {
+        if (cursors [i] !is null) cursors [i].dispose ();
+    }
+    cursors = null;
+
+    /* Release Acquired Resources */
+    if (resources !is null) {
+        for (int i=0; i<resources.length; i++) {
+            if (resources [i] !is null) resources [i].dispose ();
+        }
+        resources = null;
+    }
+
+    /* Release the System Colors */
+    COLOR_WIDGET_DARK_SHADOW = COLOR_WIDGET_NORMAL_SHADOW = COLOR_WIDGET_LIGHT_SHADOW =
+    COLOR_WIDGET_HIGHLIGHT_SHADOW = COLOR_WIDGET_BACKGROUND = COLOR_WIDGET_BORDER =
+    COLOR_LIST_FOREGROUND = COLOR_LIST_BACKGROUND = COLOR_LIST_SELECTION = COLOR_LIST_SELECTION_TEXT =
+    COLOR_WIDGET_FOREGROUND = COLOR_TITLE_FOREGROUND = COLOR_TITLE_BACKGROUND = COLOR_TITLE_BACKGROUND_GRADIENT =
+    COLOR_TITLE_INACTIVE_FOREGROUND = COLOR_TITLE_INACTIVE_BACKGROUND = COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT =
+    COLOR_INFO_BACKGROUND = COLOR_INFO_FOREGROUND = null;
+
+    /* Dispose the event callback */
+    OS.gdk_event_handler_set (null, null, null);
+
+    /* Dispose the hidden shell */
+    if (shellHandle !is null) OS.gtk_widget_destroy (shellHandle);
+    shellHandle = null;
+
+    /* Dispose the settings callback */
+
+    /* Release the sleep resources */
+    max_priority = 0;
+    timeout = 0;
+    if (fds !is null) OS.g_free (fds.ptr);
+    fds = null;
+
+    /* Release references */
+    popups = null;
+    thread = null;
+    lastWidget = activeShell = null;
+    //flushData = null;
+    closures = null;
+    indexTable = signalIds = treeSelection = null;
+    widgetTable = modalShells = null;
+    data = null;
+    values = null;
+    keys = null;
+    windowManager = null;
+    eventTable = filterTable = null;
+    modalDialog = null;
+    flushRect = null;
+    exposeEvent = null;
+    visibilityEvent = null;
+    idleLock = null;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when an event of the given type occurs anywhere in
+ * a widget. The event type is one of the event constants defined
+ * in class <code>SWT</code>.
+ *
+ * @param eventType the type of event to listen for
+ * @param listener the listener which should no longer be notified when the event occurs
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Listener
+ * @see SWT
+ * @see #addFilter
+ * @see #addListener
+ *
+ * @since 3.0
+ */
+public void removeFilter (int eventType, Listener listener) {
+    checkDevice ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (filterTable is null) return;
+    filterTable.unhook (eventType, listener);
+    if (filterTable.size () is 0) filterTable = null;
+}
+
+GdkEvent* removeGdkEvent () {
+    if (gdkEventCount is 0) return null;
+    auto event = gdkEvents [0];
+    --gdkEventCount;
+    SimpleType!(GdkEvent*).arraycopy (gdkEvents, 1, gdkEvents, 0, gdkEventCount);
+    System.arraycopy (gdkEventWidgets, 1, gdkEventWidgets, 0, gdkEventCount);
+    gdkEvents [gdkEventCount] = null;
+    gdkEventWidgets [gdkEventCount] = null;
+    if (gdkEventCount is 0) {
+        gdkEvents = null;
+        gdkEventWidgets = null;
+    }
+    return event;
+}
+
+void removeIdleProc () {
+    synchronized (idleLock) {
+        if (idleHandle !is 0) OS.g_source_remove (idleHandle);
+        idleNeeded = false;
+        idleHandle = 0;
+    }
+}
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when an event of the given type occurs. The event type
+ * is one of the event constants defined in class <code>SWT</code>.
+ *
+ * @param eventType the type of event to listen for
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see Listener
+ * @see SWT
+ * @see #addListener
+ *
+ * @since 2.0
+ */
+public void removeListener (int eventType, Listener listener) {
+    checkDevice ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (eventType, listener);
+}
+
+void removeMouseHoverTimeout (void* handle) {
+    if (handle !is mouseHoverHandle) return;
+    if (mouseHoverId !is 0) OS.gtk_timeout_remove (mouseHoverId);
+    mouseHoverId = 0;
+    mouseHoverHandle = null;
+}
+
+void removePopup (Menu menu) {
+    if (popups is null) return;
+    for (int i=0; i<popups.length; i++) {
+        if (popups [i] is menu) {
+            popups [i] = null;
+            return;
+        }
+    }
+}
+
+Widget removeWidget (GtkWidget* handle) {
+    if (handle is null) return null;
+    lastWidget = null;
+    Widget widget = null;
+    int index = cast(int)/*64*/ OS.g_object_get_qdata (cast(GObject*)handle, SWT_OBJECT_INDEX) - 1;
+    if (0 <= index && index < widgetTable.length) {
+        widget = widgetTable [index];
+        widgetTable [index] = null;
+        indexTable [index] = freeSlot;
+        freeSlot = index;
+        OS.g_object_set_qdata (cast(GObject*)handle, SWT_OBJECT_INDEX, null);
+    }
+    return widget;
+}
+
+bool runAsyncMessages (bool all) {
+    return synchronizer.runAsyncMessages (all);
+}
+
+bool runDeferredEvents () {
+    /*
+    * Run deferred events.  This code is always
+    * called in the Display's thread so it must
+    * be re-enterant but need not be synchronized.
+    */
+    while (eventQueue !is null) {
+
+        /* Take an event off the queue */
+        Event event = eventQueue [0];
+        if (event is null) break;
+        int len = eventQueue.length;
+        System.arraycopy (eventQueue, 1, eventQueue, 0, --len);
+        eventQueue [len] = null;
+
+        /* Run the event */
+        Widget widget = event.widget;
+        if (widget !is null && !widget.isDisposed ()) {
+            Widget item = event.item;
+            if (item is null || !item.isDisposed ()) {
+                widget.sendEvent (event);
+            }
+        }
+
+        /*
+        * At this point, the event queue could
+        * be null due to a recursive invokation
+        * when running the event.
+        */
+    }
+
+    /* Clear the queue */
+    eventQueue = null;
+    return true;
+}
+
+bool runPopups () {
+    if (popups is null) return false;
+    bool result = false;
+    while (popups !is null) {
+        Menu menu = popups [0];
+        if (menu is null) break;
+        int len = popups.length;
+        System.arraycopy (popups, 1, popups, 0, --len);
+        popups [len] = null;
+        runDeferredEvents ();
+        if (!menu.isDisposed ()) menu._setVisible (true);
+        result = true;
+    }
+    popups = null;
+    return result;
+}
+
+bool runSettings () {
+    if (!runSettingsFld) return false;
+    runSettingsFld = false;
+    saveResources ();
+    initializeSystemColors ();
+    sendEvent (SWT.Settings, null);
+    Shell [] shells = getShells ();
+    for (int i=0; i<shells.length; i++) {
+        Shell shell = shells [i];
+        if (!shell.isDisposed ()) {
+            shell.fixStyle ();
+            shell.redraw (true);
+            shell.layout (true, true);
+        }
+    }
+    return true;
+}
+
+/**
+ * On platforms which support it, sets the application name
+ * to be the argument. On Motif, for example, this can be used
+ * to set the name used for resource lookup.  Specifying
+ * <code>null</code> for the name clears it.
+ *
+ * @param name the new app name or <code>null</code>
+ */
+public static void setAppName (String name) {
+    APP_NAME = name;
+}
+
+/**
+ * Sets the location of the on-screen pointer relative to the top left corner
+ * of the screen.  <b>Note: It is typically considered bad practice for a
+ * program to move the on-screen pointer location.</b>
+ *
+ * @param x the new x coordinate for the cursor
+ * @param y the new y coordinate for the cursor
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 2.1
+ */
+public void setCursorLocation (int x, int y) {
+    checkDevice ();
+    if (OS.GDK_WINDOWING_X11 ()) {
+        auto xDisplay = OS.GDK_DISPLAY ();
+        auto xWindow = OS.XDefaultRootWindow (xDisplay);
+        OS.XWarpPointer (xDisplay, OS.None, xWindow, 0, 0, 0, 0, x, y);
+    }
+}
+
+/**
+ * Sets the location of the on-screen pointer relative to the top left corner
+ * of the screen.  <b>Note: It is typically considered bad practice for a
+ * program to move the on-screen pointer location.</b>
+ *
+ * @param point new position
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_NULL_ARGUMENT - if the point is null
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 2.0
+ */
+public void setCursorLocation (Point point) {
+    checkDevice ();
+    if (point is null) error (SWT.ERROR_NULL_ARGUMENT);
+    setCursorLocation (point.x, point.y);
+}
+
+/**
+ * Sets the application defined property of the receiver
+ * with the specified name to the given argument.
+ * <p>
+ * Applications may have associated arbitrary objects with the
+ * receiver in this fashion. If the objects stored in the
+ * properties need to be notified when the display is disposed
+ * of, it is the application's responsibility provide a
+ * <code>disposeExec()</code> handler which does so.
+ * </p>
+ *
+ * @param key the name of the property
+ * @param value the new value for the property
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getData(String)
+ * @see #disposeExec(Runnable)
+ */
+public void setData (String key, Object value) {
+    checkDevice ();
+    // SWT extension: allow null for zero length string
+    //if (key is null) error (SWT.ERROR_NULL_ARGUMENT);
+
+    if (key.equals (DISPATCH_EVENT_KEY)) {
+        ArrayWrapperInt wrappedValue;
+        if (value is null || (null !is (wrappedValue=cast(ArrayWrapperInt)value))) {
+            dispatchEvents = wrappedValue.array;
+            if (value is null) putGdkEvents ();
+            return;
+        }
+    }
+    if (key.equals (SET_MODAL_DIALOG)) {
+        setModalDialog (cast(Dialog) data);
+        return;
+    }
+
+    if (key.equals (ADD_WIDGET_KEY)) {
+        auto wrap = cast(ArrayWrapperObject) value;
+        if( wrap is null ) SWT.error(SWT.ERROR_INVALID_ARGUMENT, null, " []");
+        Object [] data = wrap.array;
+        auto handle = (cast(LONG) data [0]).value;
+        Widget widget = cast(Widget) data [1];
+        if (widget !is null) {
+            addWidget (cast(GtkWidget*)handle, widget);
+        } else {
+            removeWidget (cast(GtkWidget*)handle);
+        }
+    }
+
+    if (key==/*eq*/ ADD_IDLE_PROC_KEY) {
+        addIdleProc ();
+        return;
+    }
+    if (key==/*eq*/ REMOVE_IDLE_PROC_KEY) {
+        removeIdleProc ();
+        return;
+    }
+
+    /* Remove the key/value pair */
+    if (value is null) {
+        if (keys is null) return;
+        int index = 0;
+        while (index < keys.length && keys [index]!=/*!eq*/ key) index++;
+        if (index is keys.length) return;
+        if (keys.length is 1) {
+            keys = null;
+            values = null;
+        } else {
+            String [] newKeys = new String [keys.length - 1];
+            Object [] newValues = new Object [values.length - 1];
+            System.arraycopy (keys, 0, newKeys, 0, index);
+            System.arraycopy (keys, index + 1, newKeys, index, newKeys.length - index);
+            System.arraycopy (values, 0, newValues, 0, index);
+            System.arraycopy (values, index + 1, newValues, index, newValues.length - index);
+            keys = newKeys;
+            values = newValues;
+        }
+        return;
+    }
+
+    /* Add the key/value pair */
+    if (keys is null) {
+        keys = [key];
+        values = [value];
+        return;
+    }
+    for (int i=0; i<keys.length; i++) {
+        if (keys [i]==/*eq*/ key) {
+            values [i] = value;
+            return;
+        }
+    }
+    String [] newKeys = new String [keys.length + 1];
+    Object [] newValues = new Object [values.length + 1];
+    System.arraycopy (keys, 0, newKeys, 0, keys.length);
+    System.arraycopy (values, 0, newValues, 0, values.length);
+    newKeys [keys.length] = key;
+    newValues [values.length] = value;
+    keys = newKeys;
+    values = newValues;
+}
+
+/**
+ * Sets the application defined, display specific data
+ * associated with the receiver, to the argument.
+ * The <em>display specific data</em> is a single,
+ * unnamed field that is stored with every display.
+ * <p>
+ * Applications may put arbitrary objects in this field. If
+ * the object stored in the display specific data needs to
+ * be notified when the display is disposed of, it is the
+ * application's responsibility provide a
+ * <code>disposeExec()</code> handler which does so.
+ * </p>
+ *
+ * @param data the new display specific data
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getData()
+ * @see #disposeExec(Runnable)
+ */
+public void setData (Object data) {
+    checkDevice ();
+    this.data = data;
+}
+
+
+void doSetDirectionProc( GtkWidget* widget, int direction ){
+    setDirectionProcCallbackData.display = this;
+    setDirectionProcCallbackData.data = cast(void*)direction;
+    OS.gtk_container_forall (cast(GtkContainer*)widget, cast(GtkCallback)&setDirectionProcFunc, &setDirectionProcCallbackData);
+}
+
+package static extern(C) int /*long*/ setDirectionProcFunc (GtkWidget* widget, void* data) {
+    version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Display {}:", __LINE__ ).flush;
+    CallbackData* cbdata = cast(CallbackData*)data;
+    return cbdata.display.setDirectionProc( widget, cast(int)cbdata.data );
+}
+int /*long*/ setDirectionProc (GtkWidget* widget, int /*long*/ direction) {
+    OS.gtk_widget_set_direction (widget,  direction);
+    if (OS.GTK_IS_MENU_ITEM (widget)) {
+        auto submenu = OS.gtk_menu_item_get_submenu (widget);
+        if (submenu !is null) {
+            OS.gtk_widget_set_direction (submenu, cast(int)/*64*/ direction);
+            OS.gtk_container_forall (cast(GtkContainer*)submenu, cast(GtkCallback)&setDirectionProcFunc, cast(void*)direction);
+        }
+    }
+    if (OS.GTK_IS_CONTAINER (cast(GTypeInstance*)widget)) {
+        OS.gtk_container_forall (cast(GtkContainer*)widget, cast(GtkCallback)&setDirectionProcFunc, cast(void*)direction);
+    }
+    return 0;
+}
+
+void setModalDialog (Dialog modalDailog) {
+    this.modalDialog = modalDailog;
+    Shell [] shells = getShells ();
+    for (int i=0; i<shells.length; i++) shells [i].updateModal ();
+}
+
+void setModalShell (Shell shell) {
+    if (modalShells is null) modalShells = new Shell [4];
+    int index = 0, length = modalShells.length;
+    while (index < length) {
+        if (modalShells [index] is shell) return;
+        if (modalShells [index] is null) break;
+        index++;
+    }
+    if (index is length) {
+        Shell [] newModalShells = new Shell [length + 4];
+        System.arraycopy (modalShells, 0, newModalShells, 0, length);
+        modalShells = newModalShells;
+    }
+    modalShells [index] = shell;
+    Shell [] shells = getShells ();
+    for (int i=0; i<shells.length; i++) shells [i].updateModal ();
+}
+
+/**
+ * Sets the synchronizer used by the display to be
+ * the argument, which can not be null.
+ *
+ * @param synchronizer the new synchronizer for the display (must not be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the synchronizer is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_FAILED_EXEC - if an exception occurred while running an inter-thread message</li>
+ * </ul>
+ */
+public void setSynchronizer (Synchronizer synchronizer) {
+    checkDevice ();
+    if (synchronizer is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (synchronizer is this.synchronizer) return;
+    Synchronizer oldSynchronizer;
+    synchronized (Device.classinfo) {
+        oldSynchronizer = this.synchronizer;
+        this.synchronizer = synchronizer;
+    }
+    if (oldSynchronizer !is null) {
+        oldSynchronizer.runAsyncMessages(true);
+    }
+}
+
+void showIMWindow (Control control) {
+    imControl = control;
+    if (preeditWindow is null) {
+        preeditWindow = cast(GtkWindow*)OS.gtk_window_new (OS.GTK_WINDOW_POPUP);
+        if (preeditWindow is null) error (SWT.ERROR_NO_HANDLES);
+        preeditLabel = cast(GtkLabel*) OS.gtk_label_new (null);
+        if (preeditLabel is null) error (SWT.ERROR_NO_HANDLES);
+        OS.gtk_container_add (cast(GtkContainer*)preeditWindow, cast(GtkWidget*) preeditLabel);
+        OS.gtk_widget_show (cast(GtkWidget*)preeditLabel);
+    }
+    char* preeditString;
+    PangoAttrList* pangoAttrs;
+    auto imHandle = control.imHandle ();
+    OS.gtk_im_context_get_preedit_string (imHandle, &preeditString, &pangoAttrs, null);
+    if (preeditString !is null && strlen (preeditString) > 0) {
+        Control widget = control.findBackgroundControl ();
+        if (widget is null) widget = control;
+        OS.gtk_widget_modify_bg (cast(GtkWidget*)preeditWindow, OS.GTK_STATE_NORMAL, widget.getBackgroundColor ());
+        widget.setForegroundColor (cast(GtkWidget*)preeditLabel, control.getForegroundColor());
+        OS.gtk_widget_modify_font (cast(GtkWidget*)preeditLabel, control.getFontDescription ());
+        if (pangoAttrs !is null) OS.gtk_label_set_attributes (preeditLabel, pangoAttrs);
+        OS.gtk_label_set_text (preeditLabel, preeditString);
+        Point point = control.toDisplay (control.getIMCaretPos ());
+        OS.gtk_window_move (preeditWindow, point.x, point.y);
+        GtkRequisition requisition;
+        OS.gtk_widget_size_request (cast(GtkWidget*)preeditLabel, &requisition);
+        OS.gtk_window_resize (preeditWindow, requisition.width, requisition.height);
+        OS.gtk_widget_show (cast(GtkWidget*)preeditWindow);
+    } else {
+        OS.gtk_widget_hide (cast(GtkWidget*)preeditWindow);
+    }
+    if (preeditString !is null) OS.g_free (preeditString);
+    if (pangoAttrs !is null) OS.pango_attr_list_unref (pangoAttrs);
+}
+
+/**
+ * Causes the user-interface thread to <em>sleep</em> (that is,
+ * to be put in a state where it does not consume CPU cycles)
+ * until an event is received or it is otherwise awakened.
+ *
+ * @return <code>true</code> if an event requiring dispatching was placed on the queue.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #wake
+ */
+public bool sleep () {
+    checkDevice ();
+    if (gdkEventCount is 0) {
+        gdkEvents = null;
+        gdkEventWidgets = null;
+    }
+    if (settingsChanged) {
+        settingsChanged = false;
+        runSettingsFld = true;
+        return false;
+    }
+    if (getMessageCount () !is 0) return true;
+    if (fds is null) {
+        allocated_nfds = 2;
+        GPollFD* ptr = cast(GPollFD*) OS.g_malloc( GPollFD.sizeof * allocated_nfds );
+        fds = ptr[ 0 .. allocated_nfds ];
+    }
+    max_priority = timeout = 0;
+    auto context = OS.g_main_context_default ();
+    bool result = false;
+    do {
+        if (OS.g_main_context_acquire (context)) {
+            result = cast(bool)OS.g_main_context_prepare (context, &max_priority);
+            int nfds;
+            while ((nfds = OS.g_main_context_query (context, max_priority, &timeout, fds.ptr, allocated_nfds)) > allocated_nfds) {
+                OS.g_free (fds.ptr);
+                allocated_nfds = nfds;
+                GPollFD* ptr = cast(GPollFD*) OS.g_malloc( GPollFD.sizeof * allocated_nfds );
+                fds = ptr[ 0 .. allocated_nfds ];
+            }
+            GPollFunc poll = OS.g_main_context_get_poll_func (context);
+            if (poll !is null) {
+                if (nfds > 0 || timeout !is 0) {
+                    /*
+                    * Bug in GTK. For some reason, g_main_context_wakeup() may
+                    * fail to wake up the UI thread from the polling function.
+                    * The fix is to sleep for a maximum of 50 milliseconds.
+                    */
+                    if (timeout < 0) timeout = 50;
+
+                    /* Exit the OS lock to allow other threads to enter GTK */
+                    Lock lock = OS.lock;
+                    int count = lock.lock ();
+                    for (int i = 0; i < count; i++) lock.unlock ();
+                    try {
+                        wake_state = false;
+                        poll( fds.ptr, nfds, timeout);
+                    } finally {
+                        for (int i = 0; i < count; i++) lock.lock ();
+                        lock.unlock ();
+                    }
+                }
+            }
+            OS.g_main_context_check (context, max_priority, fds.ptr, nfds);
+            OS.g_main_context_release (context);
+        }
+    } while (!result && getMessageCount () is 0 && !wake_state);
+    wake_state = false;
+    return true;
+}
+
+/**
+ * Causes the <code>run()</code> method of the runnable to
+ * be invoked by the user-interface thread after the specified
+ * number of milliseconds have elapsed. If milliseconds is less
+ * than zero, the runnable is not executed.
+ * <p>
+ * Note that at the time the runnable is invoked, widgets
+ * that have the receiver as their display may have been
+ * disposed. Therefore, it is necessary to check for this
+ * case inside the runnable before accessing the widget.
+ * </p>
+ *
+ * @param milliseconds the delay before running the runnable
+ * @param runnable code to run on the user-interface thread
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the runnable is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #asyncExec
+ */
+public void timerExec (int milliseconds, Runnable runnable) {
+    checkDevice ();
+    if (runnable is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (timerList is null) timerList = new Runnable [4];
+    if (timerIds is null) timerIds = new int [4];
+    int index = 0;
+    while (index < timerList.length) {
+        if (timerList [index] is runnable) break;
+        index++;
+    }
+    if (index !is timerList.length) {
+        OS.gtk_timeout_remove (timerIds [index]);
+        timerList [index] = null;
+        timerIds [index] = 0;
+        if (milliseconds < 0) return;
+    } else {
+        if (milliseconds < 0) return;
+        index = 0;
+        while (index < timerList.length) {
+            if (timerList [index] is null) break;
+            index++;
+        }
+        if (index is timerList.length) {
+            Runnable [] newTimerList = new Runnable [timerList.length + 4];
+            SimpleType!(Runnable).arraycopy (timerList, 0, newTimerList, 0, timerList.length);
+            timerList = newTimerList;
+            int [] newTimerIds = new int [timerIds.length + 4];
+            System.arraycopy (timerIds, 0, newTimerIds, 0, timerIds.length);
+            timerIds = newTimerIds;
+        }
+    }
+    timerProcCallbackData.display = this;
+    timerProcCallbackData.data = cast(void*)index;
+    int timerId = OS.gtk_timeout_add (milliseconds, &timerProcFunc, &timerProcCallbackData);
+    if (timerId !is 0) {
+        timerIds [index] = timerId;
+        timerList [index] = runnable;
+    }
+}
+
+
+private static extern(C) int timerProcFunc ( void * data ) {
+    version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Display {}:", __LINE__ ).flush;
+    CallbackData* cbdata = cast( CallbackData* ) data;
+    return cbdata.display.timerProc( cast(int) cbdata.data );
+}
+
+int /*long*/ timerProc (int /*long*/ i) {
+    if (timerList is null) return 0;
+    int index = cast(int)/*64*/i;
+    if (0 <= index && index < timerList.length) {
+        Runnable runnable = timerList [index];
+        timerList [index] = null;
+        timerIds [index] = 0;
+        if (runnable !is null) runnable.run ();
+    }
+    return 0;
+}
+
+private static extern(C) int caretProcFunc ( void * data ) {
+    version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Display {}:", __LINE__ ).flush;
+    CallbackData* cbdata = cast( CallbackData* ) data;
+    return cbdata.display.caretProc( cast(int) cbdata.data );
+}
+int /*long*/ caretProc (int /*long*/ clientData) {
+    caretId = 0;
+    if (currentCaret is null) {
+        return 0;
+    }
+    if (currentCaret.blinkCaret()) {
+        int blinkRate = currentCaret.blinkRate;
+        if (blinkRate is 0) return 0;
+        caretProcCallbackData.display = this;
+        caretProcCallbackData.data = cast(void*)0;
+        caretId = OS.gtk_timeout_add (blinkRate, &caretProcFunc, &caretProcCallbackData);
+    } else {
+        currentCaret = null;
+    }
+    return 0;
+}
+
+
+package int doSizeAllocateConnect( CallbackData* cbdata, GtkWidget* window, GtkWidget* widget ){
+    cbdata.display = this;
+    cbdata.data = cast(void*)widget;
+    return OS.g_signal_connect (cast(void*)window, OS.size_allocate.ptr, cast(GCallback)&sizeAllocateProcFunc, cast(void*)&cbdata);
+}
+
+private static extern(C) void sizeAllocateProcFunc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
+    version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Display {}:", __LINE__ ).flush;
+    auto cbdata = cast(CallbackData*)user_data;
+    cbdata.display.sizeAllocateProc( cast(GtkWidget*)handle, arg0, cast(int)cbdata.data );
+}
+
+void sizeAllocateProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
+    Widget widget = getWidget ( cast(GtkWidget*)user_data);
+    if (widget is null) return 0;
+    widget.sizeAllocateProc (handle, arg0, user_data);
+}
+
+
+package int doSizeRequestConnect( CallbackData* cbdata, GtkWidget* window, GtkWidget* widget ){
+    cbdata.display = this;
+    cbdata.data = cast(void*)widget;
+    return OS.g_signal_connect (cast(void*)window, OS.size_request.ptr, cast(GCallback)&sizeRequestProcFunc, cast(void*)&cbdata );
+}
+
+private static extern(C) void  sizeRequestProcFunc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
+    version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Display {}:", __LINE__ ).flush;
+    auto cbdata = cast(CallbackData*)user_data;
+    cbdata.display.sizeRequestProcMeth( cast(GtkWidget*)handle, arg0, cast(int)cbdata.data );
+}
+
+int /*long*/ sizeRequestProcMeth (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
+    Widget widget = getWidget (cast(GtkWidget*)user_data);
+    if (widget is null) return 0;
+    return widget.sizeRequestProc (handle, arg0, user_data);
+}
+
+package void doTreeSelectionProcConnect( CallbackData* cbdata, GtkWidget* widget, GtkTreeSelection* selection ){
+    cbdata.display = this;
+    cbdata.data = cast(void*)widget;
+    OS.gtk_tree_selection_selected_foreach (selection, &treeSelectionProcFunc, widget);
+}
+
+private static extern(C) void  treeSelectionProcFunc (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, void* data) {
+    version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Display {}:", __LINE__ ).flush;
+    auto cbdata = cast(CallbackData*)data;
+    cbdata.display.treeSelectionProcMeth( model, path, iter, cbdata.data );
+}
+
+void treeSelectionProcMeth (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, void* data) {
+    Widget widget = getWidget (cast(GtkWidget*)data);
+    if (widget is null) return 0;
+    widget.treeSelectionProc (model, path, iter, treeSelection, treeSelectionLength++);
+}
+
+void saveResources () {
+    int resourceCount = 0;
+    if (resources is null) {
+        resources = new Resource [RESOURCE_SIZE];
+    } else {
+        resourceCount = resources.length;
+        Resource [] newResources = new Resource [resourceCount + RESOURCE_SIZE];
+        System.arraycopy (resources, 0, newResources, 0, resourceCount);
+        resources = newResources;
+    }
+    if (systemFont !is null) {
+        resources [resourceCount++] = systemFont;
+        systemFont = null;
+    }
+    if (errorImage !is null) resources [resourceCount++] = errorImage;
+    if (infoImage !is null) resources [resourceCount++] = infoImage;
+    if (questionImage !is null) resources [resourceCount++] = questionImage;
+    if (warningImage !is null) resources [resourceCount++] = warningImage;
+    errorImage = infoImage = questionImage = warningImage = null;
+    for (int i=0; i<cursors.length; i++) {
+        if (cursors [i] !is null) resources [resourceCount++] = cursors [i];
+        cursors [i] = null;
+    }
+    if (resourceCount < RESOURCE_SIZE) {
+        Resource [] newResources = new Resource [resourceCount];
+        System.arraycopy (resources, 0, newResources, 0, resourceCount);
+        resources = newResources;
+    }
+}
+
+void sendEvent (int eventType, Event event) {
+    if (eventTable is null && filterTable is null) {
+        return;
+    }
+    if (event is null) event = new Event ();
+    event.display = this;
+    event.type = eventType;
+    if (event.time is 0) event.time = getLastEventTime ();
+    if (!filterEvent (event)) {
+        if (eventTable !is null) eventTable.sendEvent (event);
+    }
+}
+
+void setCurrentCaret (Caret caret) {
+    if (caretId !is 0) OS.gtk_timeout_remove(caretId);
+    caretId = 0;
+    currentCaret = caret;
+    if (caret is null) return;
+    int blinkRate = currentCaret.blinkRate;
+    caretProcCallbackData.display = this;
+    caretProcCallbackData.data = cast(void*)0;
+    caretId = OS.gtk_timeout_add (blinkRate, &caretProcFunc, &caretProcCallbackData);
+}
+
+private static extern(C) int /*long*/ shellMapProcFunc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) {
+    version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Display {}:", __LINE__ ).flush;
+    auto cbdata = cast(CallbackData*)user_data;
+    return cbdata.display.shellMapProc( cast(GtkWidget*)handle, arg0, cast(int)cbdata.data );
+}
+
+int /*long*/ shellMapProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
+    Widget widget = getWidget (cast(GtkWidget*)handle);
+    if (widget is null) return 0;
+    return widget.shellMapProc (handle, arg0, user_data);
+}
+
+private static extern(C) int /*long*/ styleSetProcFunc (int /*long*/ gobject, int /*long*/ arg1, int /*long*/ user_data) {
+    version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Display {}:", __LINE__ ).flush;
+    auto cbdata = cast(CallbackData*)user_data;
+    return cbdata.display.styleSetProcMeth( gobject, arg1, cast(int)cbdata.data );
+}
+int /*long*/ styleSetProcMeth (int /*long*/ gobject, int /*long*/ arg1, int /*long*/ user_data) {
+    settingsChanged = true;
+    return 0;
+}
+
+/**
+ * Causes the <code>run()</code> method of the runnable to
+ * be invoked by the user-interface thread at the next
+ * reasonable opportunity. The thread which calls this method
+ * is suspended until the runnable completes.  Specifying <code>null</code>
+ * as the runnable simply wakes the user-interface thread.
+ * <p>
+ * Note that at the time the runnable is invoked, widgets
+ * that have the receiver as their display may have been
+ * disposed. Therefore, it is necessary to check for this
+ * case inside the runnable before accessing the widget.
+ * </p>
+ *
+ * @param runnable code to run on the user-interface thread or <code>null</code>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_FAILED_EXEC - if an exception occurred when executing the runnable</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #asyncExec
+ */
+public void syncExec (Runnable runnable) {
+    Synchronizer synchronizer;
+    synchronized (Device.classinfo) {
+        if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED);
+        synchronizer = this.synchronizer;
+        synchronized (idleLock) {
+            if (idleNeeded && idleHandle is 0) {
+                //NOTE: calling unlocked function in OS
+            idleProcCallbackData.display = this;
+            idleProcCallbackData.data = cast(void*)0;
+            //PORTING_TODO: was _g_idle_add, calling directly
+            idleHandle = OS.g_idle_add (&idleProcFunc, &idleProcCallbackData);
+            }
+        }
+    }
+    synchronizer.syncExec (runnable);
+}
+
+static int translateKey (int key) {
+    for (int i=0; i<KeyTable.length; i++) {
+        if (KeyTable [i] [0] is key) return KeyTable [i] [1];
+    }
+    return 0;
+}
+
+static int untranslateKey (int key) {
+    for (int i=0; i<KeyTable.length; i++) {
+        if (KeyTable [i] [1] is key) return KeyTable [i] [0];
+    }
+    return 0;
+}
+
+/**
+ * Forces all outstanding paint requests for the display
+ * to be processed before this method returns.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see Control#update()
+ */
+public void update () {
+    checkDevice ();
+    flushExposes (null, true);
+    OS.gdk_window_process_all_updates ();
+}
+
+/**
+ * If the receiver's user-interface thread was <code>sleep</code>ing,
+ * causes it to be awakened and start running again. Note that this
+ * method may be called from any thread.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #sleep
+ */
+public void wake () {
+    synchronized (Device.classinfo) {
+        if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED);
+        if (thread is Thread.getThis ()) return;
+        wakeThread ();
+    }
+}
+
+void wakeThread () {
+    OS.g_main_context_wakeup (null);
+    wake_state = true;
+}
+
+static dchar wcsToMbcs (char ch) {
+    //PORTING_TODO not sure about this
+    int key = ch & 0xFFFF;
+    if (key <= 0x7F) return ch;
+    char [] buffer = Converter.wcsToMbcs (null,[ch], false);
+    if (buffer.length is 1) return '\0';
+    if (buffer.length is 2) {
+        return cast(char) (((buffer [0] & 0xFF) << 8) | (buffer [1] & 0xFF));
+    }
+    return '\0';
+}
+
+private static extern(C) int /*long*/ windowProcFunc2 (GtkWidget* handle, int /*long*/ user_data) {
+    version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Display {}:", __LINE__ ).flush;
+    CallbackData* cbdata = cast(CallbackData*)user_data;
+    return cbdata.display.windowProc( handle, cast(int)cbdata.data );
+}
+int /*long*/ windowProc (GtkWidget* handle, int /*long*/ user_data) {
+    Widget widget = getWidget (handle);
+    if (widget is null) return 0;
+    return widget.windowProc (handle, user_data);
+}
+
+private static extern(C) int /*long*/ windowProcFunc3 (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) {
+    version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Display {}:", __LINE__ ).flush;
+    CallbackData* cbdata = cast(CallbackData*)user_data;
+    return cbdata.display.windowProc( cast(GtkWidget*)handle, arg0, cast(int)cbdata.data );
+}
+int /*long*/ windowProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
+    Widget widget = getWidget (handle);
+    if (widget is null) return 0;
+    return widget.windowProc (handle, arg0, user_data);
+}
+
+private static extern(C) int /*long*/ windowProcFunc4 (int /*long*/ handle, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ user_data) {
+    version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Display {}:", __LINE__ ).flush;
+    CallbackData* cbdata = cast(CallbackData*)user_data;
+    return cbdata.display.windowProc( cast(GtkWidget*)handle, arg0, arg1, cast(int)cbdata.data );
+}
+int /*long*/ windowProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ user_data) {
+    Widget widget = getWidget (handle);
+    if (widget is null) return 0;
+    return widget.windowProc (handle, arg0, arg1, user_data);
+}
+
+private static extern(C) int /*long*/ windowProcFunc5 (int /*long*/ handle, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ arg2, int /*long*/ user_data) {
+    version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Display {}:", __LINE__ ).flush;
+    CallbackData* cbdata = cast(CallbackData*)user_data;
+    return cbdata.display.windowProc( cast(GtkWidget*)handle, arg0, arg1, arg2, cast(int)cbdata.data );
+}
+int /*long*/ windowProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ arg2, int /*long*/ user_data) {
+    Widget widget = getWidget (handle);
+    if (widget is null) return 0;
+    return widget.windowProc (handle, arg0, arg1, arg2, user_data);
+}
+
+package int doWindowTimerAdd( CallbackData* cbdata, int delay, GtkWidget* widget ){
+    OS.g_object_set_data(cast(GObject*)widget, Display.classinfo.name.ptr, cast(void*)this);
+    return OS.gtk_timeout_add (delay, &windowTimerProcFunc, widget);
+}
+private static extern(C) int /*long*/ windowTimerProcFunc (void* user_data) {
+    version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Display {}:", __LINE__ ).flush;
+    Display d = cast(Display) OS.g_object_get_data(cast(GObject*)user_data, Display.classinfo.name.ptr );
+    return d.windowTimerProc( cast(GtkWidget*)user_data );
+}
+
+int /*long*/ windowTimerProc (GtkWidget* handle) {
+    Widget widget = getWidget (handle);
+    if (widget is null) return 0;
+    return widget.timerProc (handle);
+}
+
+}
+
+package struct CallbackData {
+    Display display;
+    void* data;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Event.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,232 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Event;
+
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Rectangle;
+
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swt.widgets.Display;
+
+import tango.text.convert.Format;
+import java.lang.all;
+
+
+/**
+ * Instances of this class provide a description of a particular
+ * event which occurred within SWT. The SWT <em>untyped listener</em>
+ * API uses these instances for all event dispatching.
+ * <p>
+ * Note: For a given event, only the fields which are appropriate
+ * will be filled in. The contents of the fields which are not used
+ * by the event are unspecified.
+ * </p>
+ *
+ * @see Listener
+ * @see org.eclipse.swt.events.TypedEvent
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample, Listeners</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public class Event {
+
+    /**
+     * the display where the event occurred
+     *
+     * @since 2.0
+     */
+    public Display display;
+
+    /**
+     * the widget that issued the event
+     */
+    public Widget widget;
+
+    /**
+     * the type of event, as defined by the event type constants
+     * in class <code>SWT</code>
+     *
+     * @see org.eclipse.swt.SWT
+     */
+    public int type;
+
+    /**
+     * the event specific detail field, as defined by the detail constants
+     * in class <code>SWT</code>
+     *
+     * @see org.eclipse.swt.SWT
+     */
+    public int detail;
+
+    /**
+     * the item that the event occurred in (can be null)
+     */
+    public Widget item;
+
+    /**
+     * the index of the item where the event occurred
+     *
+     * @since 3.2
+     */
+    public int index;
+
+    /**
+     * the graphics context to use when painting
+     * that is configured to use the colors, font and
+     * damaged region of the control.  It is valid
+     * only during the paint and must not be disposed
+     */
+    public GC gc;
+
+    /**
+     * depending on the event type, the x offset of the bounding
+     * rectangle of the region that requires painting or the
+     * widget-relative, x coordinate of the pointer at the
+     * time the mouse button was pressed or released
+     */
+    public int x;
+
+    /**
+     * depending on the event type, the y offset of the bounding
+     * rectangle of the  region that requires painting or the
+     * widget-relative, y coordinate of the pointer at the
+     * time the mouse button was pressed or released
+     */
+    public int y;
+
+    /**
+     * the width of the bounding rectangle of the
+     * region that requires painting
+     */
+    public int width;
+
+    /**
+     * the height of the bounding rectangle of the
+     * region that requires painting
+     */
+    public int height;
+
+    /**
+     * depending on the event type, the number of following
+     * paint events which are pending which may always be zero
+     * on some platforms or the number of lines or pages to
+     * scroll using the mouse wheel
+     */
+    public int count;
+
+    /**
+     * the time that the event occurred.
+     *
+     * NOTE: This field is an unsigned integer and should
+     * be AND'ed with 0xFFFFFFFFL so that it can be treated
+     * as a signed long.
+     */
+    public int time;
+
+    /**
+     * the button that was pressed or released; 1 for the
+     * first button, 2 for the second button, and 3 for the
+     * third button, etc.
+     */
+    public int button;
+
+    /**
+     * depending on the event, the character represented by the key
+     * that was typed.  This is the final character that results
+     * after all modifiers have been applied.  For example, when the
+     * user types Ctrl+A, the character value is 0x01 (ASCII SOH).
+     * It is important that applications do not attempt to modify the
+     * character value based on a stateMask (such as SWT.CTRL) or the
+     * resulting character will not be correct.
+     */
+    public wchar character = '\0';
+
+    /**
+     * depending on the event, the key code of the key that was typed,
+     * as defined by the key code constants in class <code>SWT</code>.
+     * When the character field of the event is ambiguous, this field
+     * contains the unaffected value of the original character.  For
+     * example, typing Ctrl+M or Enter both result in the character '\r'
+     * but the keyCode field will also contain '\r' when Enter was typed
+     * and 'm' when Ctrl+M was typed.
+     *
+     * @see org.eclipse.swt.SWT
+     */
+    public int keyCode;
+
+    /**
+     * depending on the event, the state of the keyboard modifier
+     * keys and mouse masks at the time the event was generated.
+     *
+     * @see org.eclipse.swt.SWT
+     */
+    public int stateMask;
+
+    /**
+     * depending on the event, the range of text being modified.
+     * Setting these fields only has effect during ImeComposition 
+     * events.
+     */
+    public int start, end;
+
+    /**
+     * depending on the event, the new text that will be inserted.
+     * Setting this field will change the text that is about to
+     * be inserted or deleted.
+     */
+    public String text;
+
+    /**
+     * depending on the event, a flag indicating whether the operation
+     * should be allowed.  Setting this field to false will cancel the
+     * operation.
+     */
+    public bool doit = true;
+
+    /**
+     * a field for application use
+     */
+    public Object data;
+
+/**
+ * Gets the bounds.
+ *
+ * @return a rectangle that is the bounds.
+ */
+public Rectangle getBounds () {
+    return new Rectangle (x, y, width, height);
+}
+
+/**
+ * Sets the bounds.
+ *
+ * @param rect the new rectangle
+ */
+public void setBounds (Rectangle rect) {
+    this.x = rect.x;
+    this.y = rect.y;
+    this.width = rect.width;
+    this.height = rect.height;
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+override public String toString () {
+    return Format( "Event {{type={} {} time={} data={} x={} y={} width={} height={} detail={}}",
+        type, widget, time, data, x, y, width, height, detail );  //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/EventTable.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,161 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.EventTable;
+
+import java.lang.all;
+
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.internal.SWTEventListener;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.SWTEventListener;
+
+/**
+ * Instances of this class implement a simple
+ * look up mechanism that maps an event type
+ * to a listener.  Multiple listeners for the
+ * same event type are supported.
+ */
+
+class EventTable {
+    int [] types;
+    Listener [] listeners;
+    int level;
+    static final int GROW_SIZE = 4;
+    
+public Listener [] getListeners (int eventType) {
+    if (types is null) return new Listener [0];
+    int count = 0;
+    for (int i=0; i<types.length; i++) {
+        if (types [i] is eventType) count++;
+    }
+    if (count is 0) return new Listener [0];
+    Listener [] result = new Listener [count];
+    count = 0;
+    for (int i=0; i<types.length; i++) {
+        if (types [i] is eventType) {
+            result [count++] = listeners [i];
+        }
+    }
+    return result;
+}
+
+public void hook (int eventType, Listener listener) {
+    if (types is null) types = new int [GROW_SIZE];
+    if (listeners is null) listeners = new Listener [GROW_SIZE];
+    int length = types.length, index = length - 1;
+    while (index >= 0) {
+        if (types [index] !is 0) break;
+        --index;
+    }
+    index++;
+    if (index is length) {
+        int [] newTypes = new int [length + GROW_SIZE];
+        System.arraycopy (types, 0, newTypes, 0, length);
+        types = newTypes;
+        Listener [] newListeners = new Listener [length + GROW_SIZE];
+        SimpleType!(Listener).arraycopy (listeners, 0, newListeners, 0, length);
+        listeners = newListeners;
+    }
+    types [index] = eventType;
+    listeners [index] = listener;
+}
+
+public bool hooks (int eventType) {
+    if (types is null) return false;
+    for (int i=0; i<types.length; i++) {
+        if (types [i] is eventType) return true;
+    }
+    return false;
+}
+
+public void sendEvent (Event event) {
+    if (types is null) return;
+    level += level >= 0 ? 1 : -1;
+    try {
+        for (int i=0; i<types.length; i++) {
+            if (event.type is SWT.None) return;
+            if (types [i] is event.type) {
+                Listener listener = listeners [i];
+                if (listener !is null) listener.handleEvent (event);
+            }
+        }
+    } finally {
+        bool compact = level < 0;
+        level -= level >= 0 ? 1 : -1;
+        if (compact && level is 0) {
+            int index = 0;
+            for (int i=0; i<types.length; i++) {
+                if (types [i] !is 0) {
+                    types [index] = types [i];
+                    listeners [index] = listeners [i];
+                    index++;
+                }
+            }
+            for (int i=index; i<types.length; i++) {
+                types [i] = 0;
+                listeners [i] = null;
+            }
+        }
+    }
+}
+
+public int size () {
+    if (types is null) return 0;
+    int count = 0;
+    for (int i=0; i<types.length; i++) {
+        if (types [i] !is 0) count++;
+    }
+    return count;
+}
+
+void remove (int index) {
+    if (level is 0) {
+        int end = types.length - 1;
+        System.arraycopy (types, index + 1, types, index, end - index);
+        SimpleType!(Listener).arraycopy (listeners, index + 1, listeners, index, end - index);
+        index = end;
+    } else {
+        if (level > 0) level = -level;
+    }
+    types [index] = 0;
+    listeners [index] = null;
+}
+
+public void unhook (int eventType, Listener listener) {
+    if (types is null) return;
+    for (int i=0; i<types.length; i++) {
+        if (types [i] is eventType && listeners [i] is listener) {
+            remove (i);
+            return;
+        }
+    }
+}
+
+public void unhook (int eventType, SWTEventListener listener) {
+    if (types is null) return;
+    for (int i=0; i<types.length; i++) {
+        if (types [i] is eventType) {
+            if ( auto typedListener = cast(TypedListener) listeners [i] ) {
+                if (typedListener.getEventListener () is listener) {
+                    remove (i);
+                    return;
+                }
+            }
+        }
+    }
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/ExpandBar.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,721 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.ExpandBar;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.events.ExpandAdapter;
+import org.eclipse.swt.events.ExpandEvent;
+import org.eclipse.swt.events.ExpandListener;
+import org.eclipse.swt.graphics.FontMetrics;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.GCData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.ExpandItem;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.ScrollBar;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Control;
+import java.lang.all;
+
+/**
+ * Instances of this class support the layout of selectable
+ * expand bar items.
+ * <p>
+ * The item children that may be added to instances of this class
+ * must be of type <code>ExpandItem</code>.
+ * </p><p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>V_SCROLL</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Expand, Collapse</dd>
+ * </dl>
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see ExpandItem
+ * @see ExpandEvent
+ * @see ExpandListener
+ * @see ExpandAdapter
+ * @see <a href="http://www.eclipse.org/swt/snippets/#expandbar">ExpandBar snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.2
+ */
+public class ExpandBar : Composite {
+
+    alias Composite.computeSize computeSize;
+    alias Composite.createHandle createHandle;
+    alias Composite.forceFocus forceFocus;
+    alias Composite.setBounds setBounds;
+    alias Composite.setForegroundColor setForegroundColor;
+
+    ExpandItem [] items;
+    ExpandItem lastFocus;
+    int itemCount;
+    int spacing;
+    int yCurrentScroll;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Composite parent, int style) {
+    super (parent, style);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when an item in the receiver is expanded or collapsed
+ * by sending it one of the messages defined in the <code>ExpandListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ExpandListener
+ * @see #removeExpandListener
+ */
+public void addExpandListener (ExpandListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Expand, typedListener);
+    addListener (SWT.Collapse, typedListener);
+}
+
+protected override void checkSubclass () {
+    if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+public override Point computeSize (int wHint, int hHint, bool changed) {
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        if (wHint !is SWT.DEFAULT && wHint < 0) wHint = 0;
+        if (hHint !is SWT.DEFAULT && hHint < 0) hHint = 0;
+        Point size = computeNativeSize (handle, wHint, hHint, changed);
+        int border = OS.gtk_container_get_border_width (handle);
+        size.x += 2 * border;
+        size.y += 2 * border;
+        return size;
+    } else {
+        int height = 0, width = 0;
+        if (wHint is SWT.DEFAULT || hHint is SWT.DEFAULT) {
+            if (itemCount > 0) {
+                height += spacing;
+                GC gc = new GC (this);
+                for (int i = 0; i < itemCount; i++) {
+                    ExpandItem item = items [i];
+                    height += item.getHeaderHeight ();
+                    if (item.expanded) height += item.height;
+                    height += spacing;
+                    width = Math.max (width, item.getPreferredWidth (gc));
+                }
+                gc.dispose ();
+            }
+        }
+        if (width is 0) width = DEFAULT_WIDTH;
+        if (height is 0) height = DEFAULT_HEIGHT;
+        if (wHint !is SWT.DEFAULT) width = wHint;
+        if (hHint !is SWT.DEFAULT) height = hHint;
+        return new Point (width, height);
+    }
+}
+
+override void createHandle (int index) {
+    state |= HANDLE;
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        fixedHandle = cast(GtkWidget*)OS.g_object_new (display.gtk_fixed_get_type (), null);
+        if (fixedHandle is null) error (SWT.ERROR_NO_HANDLES);
+        OS.gtk_fixed_set_has_window (fixedHandle, true);
+        handle = cast(GtkWidget*)OS.gtk_vbox_new (false, 0);
+        if (handle is null) error (SWT.ERROR_NO_HANDLES);
+        if ((style & SWT.V_SCROLL) !is 0) {
+            scrolledHandle = cast(GtkWidget*)OS.gtk_scrolled_window_new (null, null);
+            if (scrolledHandle is null) error (SWT.ERROR_NO_HANDLES);
+            int vsp = (style & SWT.V_SCROLL) !is 0 ? OS.GTK_POLICY_AUTOMATIC : OS.GTK_POLICY_NEVER;
+            OS.gtk_scrolled_window_set_policy (scrolledHandle, OS.GTK_POLICY_NEVER, vsp);
+            OS.gtk_container_add (fixedHandle, scrolledHandle);
+            OS.gtk_scrolled_window_add_with_viewport (scrolledHandle, handle);
+        } else {
+            OS.gtk_container_add (fixedHandle, handle);
+        }
+        OS.gtk_container_set_border_width (handle, 0);
+    } else {
+        auto topHandle = cast(GtkWidget*)OS.g_object_new (display.gtk_fixed_get_type (), null);
+        if (topHandle is null) error (SWT.ERROR_NO_HANDLES);
+        OS.gtk_fixed_set_has_window (topHandle, true);
+        if ((style & SWT.V_SCROLL) !is 0) {
+            fixedHandle = topHandle;
+            scrolledHandle = cast(GtkWidget*)OS.gtk_scrolled_window_new (null, null);
+            if (scrolledHandle is null) error (SWT.ERROR_NO_HANDLES);
+            handle = cast(GtkWidget*)OS.g_object_new (display.gtk_fixed_get_type (), null);
+            if (handle is null) error (SWT.ERROR_NO_HANDLES);
+            OS.gtk_fixed_set_has_window (handle, true);
+            OS.gtk_container_add (fixedHandle, scrolledHandle);
+
+            /*
+            * Force the scrolledWindow to have a single child that is
+            * not scrolled automatically.  Calling gtk_container_add()
+            * seems to add the child correctly but cause a warning.
+            */
+            bool warnings = display.getWarnings ();
+            display.setWarnings (false);
+            OS.gtk_container_add (scrolledHandle, handle);
+            display.setWarnings (warnings);
+        } else {
+            handle = topHandle;
+        }
+        OS.GTK_WIDGET_SET_FLAGS (handle, OS.GTK_CAN_FOCUS);
+    }
+}
+
+void createItem (ExpandItem item, int style, int index) {
+    if (!(0 <= index && index <= itemCount)) error (SWT.ERROR_INVALID_RANGE);
+    if (itemCount is items.length) {
+        ExpandItem [] newItems = new ExpandItem [itemCount + 4];
+        System.arraycopy (items, 0, newItems, 0, items.length);
+        items = newItems;
+    }
+    System.arraycopy (items, index, items, index + 1, itemCount - index);
+    items [index] = item;
+    itemCount++;
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 4, 0)) {
+        if (lastFocus is null) lastFocus = item;
+    }
+    item.width = Math.max (0, getClientArea ().width - spacing * 2);
+    layoutItems (index, true);
+}
+
+override void createWidget (int index) {
+    super.createWidget (index);
+    items = new ExpandItem [4];
+}
+
+void destroyItem (ExpandItem item) {
+    int index = 0;
+    while (index < itemCount) {
+        if (items [index] is item) break;
+        index++;
+    }
+    if (index is itemCount) return;
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 4, 0)) {
+        if (item is lastFocus) {
+            int focusIndex = index > 0 ? index - 1 : 1;
+            if (focusIndex < itemCount) {
+                lastFocus = items [focusIndex];
+                lastFocus.redraw ();
+            } else {
+                lastFocus = null;
+            }
+        }
+    }
+    System.arraycopy (items, index + 1, items, index, --itemCount - index);
+    items [itemCount] = null;
+    item.redraw ();
+    layoutItems (index, true);
+}
+
+override GtkWidget* eventHandle () {
+    return OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0) ? fixedHandle : handle;
+}
+
+override bool forceFocus (GtkWidget* focusHandle) {
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        if (lastFocus !is null && lastFocus.setFocus ()) return true;
+        for (int i = 0; i < itemCount; i++) {
+            ExpandItem item = items [i];
+            if (item.setFocus ()) return true;
+        }
+    }
+    return super.forceFocus (focusHandle);
+}
+
+override bool hasFocus () {
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        for (int i=0; i<itemCount; i++) {
+            ExpandItem item = items [i];
+            if (item.hasFocus ()) return true;
+        }
+    }
+    return super.hasFocus();
+}
+
+int getBandHeight () {
+    if (font is null) return ExpandItem.CHEVRON_SIZE;
+    GC gc = new GC (this);
+    FontMetrics metrics = gc.getFontMetrics ();
+    gc.dispose ();
+    return Math.max (ExpandItem.CHEVRON_SIZE, metrics.getHeight ());
+}
+
+override GdkColor* getForegroundColor () {
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 4, 0)) {
+        if ((state & FOREGROUND) is 0) {
+            return display.getSystemColor (SWT.COLOR_TITLE_FOREGROUND).handle;
+        }
+    }
+    return super.getForegroundColor ();
+}
+
+/**
+ * Returns the item at the given, zero-relative index in the
+ * receiver. Throws an exception if the index is out of range.
+ *
+ * @param index the index of the item to return
+ * @return the item at the given index
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public ExpandItem getItem (int index) {
+    checkWidget();
+    if (!(0 <= index && index < itemCount)) error (SWT.ERROR_INVALID_RANGE);
+    return items [index];
+}
+
+/**
+ * Returns the number of items contained in the receiver.
+ *
+ * @return the number of items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemCount () {
+    checkWidget();
+    return itemCount;
+}
+
+/**
+ * Returns an array of <code>ExpandItem</code>s which are the items
+ * in the receiver.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the items in the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public ExpandItem [] getItems () {
+    checkWidget ();
+    ExpandItem [] result = new ExpandItem [itemCount];
+    System.arraycopy (items, 0, result, 0, itemCount);
+    return result;
+}
+
+/**
+ * Returns the receiver's spacing.
+ *
+ * @return the spacing
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSpacing () {
+    checkWidget ();
+    return spacing;
+}
+
+override int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* gdkEvent) {
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 4, 0)) {
+        int x = cast(int)gdkEvent.x;
+        int y = cast(int)gdkEvent.y;
+        for (int i = 0; i < itemCount; i++) {
+            ExpandItem item = items[i];
+            bool hover = item.x <= x && x < (item.x + item.width) && item.y <= y && y < (item.y + getBandHeight ());
+            if (hover && item !is lastFocus) {
+                lastFocus.redraw ();
+                lastFocus = item;
+                lastFocus.redraw ();
+                forceFocus ();
+                break;
+            }
+        }
+    }
+    return super.gtk_button_press_event (widget, gdkEvent);
+}
+
+override int /*long*/ gtk_button_release_event (GtkWidget* widget, GdkEventButton* gdkEvent) {
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 4, 0)) {
+        if (lastFocus !is null) {
+            int x = cast(int)gdkEvent.x;
+            int y = cast(int)gdkEvent.y;
+            bool hover = lastFocus.x <= x && x < (lastFocus.x + lastFocus.width) && lastFocus.y <= y && y < (lastFocus.y + getBandHeight ());
+            if (hover) {
+                Event ev = new Event ();
+                ev.item = lastFocus;
+                notifyListeners (lastFocus.expanded ? SWT.Collapse : SWT.Expand, ev);
+                lastFocus.expanded = !lastFocus.expanded;
+                showItem (lastFocus);
+            }
+        }
+    }
+    return super.gtk_button_release_event (widget, gdkEvent);
+}
+
+override int /*long*/ gtk_expose_event (GtkWidget* widget, GdkEventExpose* gdkEvent) {
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 4, 0)) {
+        GCData data = new GCData ();
+        data.damageRgn = gdkEvent.region;
+        GC gc = GC.gtk_new (this, data);
+        OS.gdk_gc_set_clip_region (gc.handle, gdkEvent.region);
+        bool hasFocus = isFocusControl ();
+        for (int i = 0; i < itemCount; i++) {
+            ExpandItem item = items [i];
+            item.drawItem (gc, hasFocus && item is lastFocus);
+        }
+        gc.dispose ();
+    }
+    return super.gtk_expose_event (widget, gdkEvent);
+}
+
+override int /*long*/ gtk_focus_in_event (GtkWidget* widget, GdkEventFocus* event) {
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 4, 0)) {
+        if (lastFocus !is null) lastFocus.redraw ();
+    }
+    return super.gtk_focus_in_event(widget, event);
+}
+
+override int /*long*/ gtk_focus_out_event (GtkWidget* widget, GdkEventFocus* event) {
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 4, 0)) {
+        if (lastFocus !is null) lastFocus.redraw ();
+    }
+    return super.gtk_focus_out_event (widget, event);
+}
+
+override int /*long*/ gtk_key_press_event (GtkWidget* widget, GdkEventKey* gdkEvent) {
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        if (!hasFocus ()) return 0;
+        auto result = super.gtk_key_press_event (widget, gdkEvent);
+        if (result !is 0) return result;
+        int index = 0;
+        while (index < itemCount) {
+            if (items [index].hasFocus ()) break;
+            index++;
+        }
+        bool next = false;
+        switch (gdkEvent.keyval) {
+            case OS.GDK_Up:
+            case OS.GDK_Left: next = false; break;
+            case OS.GDK_Down:
+            case OS.GDK_Right: next = true; break;
+            default: return result;
+        }
+        int start = index, offset = next ? 1 : -1;
+        while ((index = (index + offset + itemCount) % itemCount) !is start) {
+            ExpandItem item = items [index];
+            if (item.setFocus ()) return result;
+        }
+        return result;
+    } else {
+        if (lastFocus !is null) {
+            switch (gdkEvent.keyval) {
+                case OS.GDK_Return:
+                case OS.GDK_space:
+                    Event ev = new Event ();
+                    ev.item = lastFocus;
+                    sendEvent (lastFocus.expanded ? SWT.Collapse :SWT.Expand, ev);
+                    lastFocus.expanded = !lastFocus.expanded;
+                    showItem (lastFocus);
+                    break;
+                case OS.GDK_Up:
+                case OS.GDK_KP_Up: {
+                    int focusIndex = indexOf (lastFocus);
+                    if (focusIndex > 0) {
+                        lastFocus.redraw ();
+                        lastFocus = items [focusIndex - 1];
+                        lastFocus.redraw ();
+                    }
+                    break;
+                }
+                case OS.GDK_Down:
+                case OS.GDK_KP_Down: {
+                    int focusIndex = indexOf (lastFocus);
+                    if (focusIndex < itemCount - 1) {
+                        lastFocus.redraw ();
+                        lastFocus = items [focusIndex + 1];
+                        lastFocus.redraw ();
+                    }
+                    break;
+                }
+                default:
+            }
+        }
+    }
+    return super.gtk_key_press_event (widget, gdkEvent);
+}
+
+/**
+ * Searches the receiver's list starting at the first item
+ * (index 0) until an item is found that is equal to the
+ * argument, and returns the index of that item. If no item
+ * is found, returns -1.
+ *
+ * @param item the search item
+ * @return the index of the item
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int indexOf (ExpandItem item) {
+    checkWidget();
+    if (item is null) error (SWT.ERROR_NULL_ARGUMENT);
+    for (int i = 0; i < itemCount; i++) {
+        if (items [i] is item) return i;
+    }
+    return -1;
+}
+
+void layoutItems (int index, bool setScrollbar_) {
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        for (int i = 0; i < itemCount; i++) {
+            ExpandItem item = items [i];
+            if (item !is null) item.resizeControl (yCurrentScroll);
+        }
+    } else {
+        if (index < itemCount) {
+            int y = spacing - yCurrentScroll;
+            for (int i = 0; i < index; i++) {
+                ExpandItem item = items [i];
+                if (item.expanded) y += item.height;
+                y += item.getHeaderHeight() + spacing;
+            }
+            for (int i = index; i < itemCount; i++) {
+                ExpandItem item = items [i];
+                item.setBounds (spacing, y, 0, 0, true, false);
+                if (item.expanded) y += item.height;
+                y += item.getHeaderHeight() + spacing;
+            }
+        }
+        if (setScrollbar_) setScrollbar ();
+    }
+}
+
+override GtkWidget* parentingHandle () {
+    return OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0) ? fixedHandle : handle;
+}
+
+override void releaseChildren (bool destroy) {
+    for (int i = 0; i < itemCount; i++) {
+        ExpandItem item = items [i];
+        if (item !is null && !item.isDisposed ()) {
+            item.release (false);
+        }
+    }
+    super.releaseChildren (destroy);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when items in the receiver are expanded or collapsed.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ExpandListener
+ * @see #addExpandListener
+ */
+public void removeExpandListener (ExpandListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Expand, listener);
+    eventTable.unhook (SWT.Collapse, listener);
+}
+
+override int setBounds (int x, int y, int width, int height, bool move, bool resize) {
+    int result = super.setBounds (x, y, width, height, move, resize);
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 4, 0)) {
+        if (resize) {
+            if ((style & SWT.V_SCROLL) !is 0) {
+                setScrollbar ();
+            } else {
+                for (int i = 0; i < itemCount; i++) {
+                    ExpandItem item = items [i];
+                    int newWidth = Math.max (0, getClientArea ().width - spacing * 2);
+                    if (item.width !is newWidth) {
+                        item.setBounds (0, 0, newWidth, item.height, false, true);
+                    }
+                }
+            }
+        }
+    }
+    return result;
+}
+
+override void setFontDescription (PangoFontDescription* font) {
+    super.setFontDescription (font);
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        for (int i = 0; i < itemCount; i++) {
+            items[i].setFontDescription (font);
+        }
+        layoutItems (0, true);
+    }
+}
+
+override void setForegroundColor (GdkColor* color) {
+    super.setForegroundColor (color);
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        for (int i = 0; i < itemCount; i++) {
+            items[i].setForegroundColor (color);
+        }
+    }
+}
+
+void setScrollbar () {
+    if (itemCount is 0) return;
+    if ((style & SWT.V_SCROLL) is 0) return;
+    int height = getClientArea ().height;
+    ExpandItem item = items [itemCount - 1];
+    int maxHeight = item.y + getBandHeight () + spacing;
+    if (item.expanded) maxHeight += item.height;
+    auto adjustmentHandle = OS.gtk_scrolled_window_get_vadjustment (scrolledHandle);
+    yCurrentScroll = cast(int)adjustmentHandle.value;
+
+    //claim bottom free space
+    if (yCurrentScroll > 0 && height > maxHeight) {
+        yCurrentScroll = Math.max (0, yCurrentScroll + maxHeight - height);
+        layoutItems (0, false);
+    }
+    maxHeight += yCurrentScroll;
+    adjustmentHandle.value = Math.min (yCurrentScroll, maxHeight);
+    adjustmentHandle.upper = maxHeight;
+    adjustmentHandle.page_size = height;
+    OS.gtk_adjustment_changed (adjustmentHandle);
+    int policy = maxHeight > height ? OS.GTK_POLICY_ALWAYS : OS.GTK_POLICY_NEVER;
+    OS.gtk_scrolled_window_set_policy (scrolledHandle, OS.GTK_POLICY_NEVER, policy);
+    int width = OS.GTK_WIDGET_WIDTH (fixedHandle) - spacing * 2;
+    if (policy is OS.GTK_POLICY_ALWAYS) {
+        auto vHandle = OS.GTK_SCROLLED_WINDOW_VSCROLLBAR (scrolledHandle);
+        GtkRequisition requisition;
+        OS.gtk_widget_size_request (vHandle, &requisition);
+        width -= requisition.width;
+    }
+    width = Math.max (0,  width);
+    for (int i = 0; i < itemCount; i++) {
+        ExpandItem item2 = items[i];
+        item2.setBounds (0, 0, width, item2.height, false, true);
+    }
+}
+
+/**
+ * Sets the receiver's spacing. Spacing specifies the number of pixels allocated around
+ * each item.
+ * 
+ * @param spacing the spacing around each item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSpacing (int spacing) {
+    checkWidget ();
+    if (spacing < 0) return;
+    if (spacing is this.spacing) return;
+    this.spacing = spacing;
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        OS.gtk_box_set_spacing (handle, spacing);
+        OS.gtk_container_set_border_width (handle, spacing);
+    } else {
+        if ((style & SWT.V_SCROLL) is 0) {
+            int width = Math.max (0, getClientArea ().width - spacing * 2);
+            for (int i = 0; i < itemCount; i++) {
+                ExpandItem item = items [i];
+                if (item.width !is width) item.setBounds (0, 0, width, item.height, false, true);
+            }
+        }
+        layoutItems (0, true);
+        redraw ();
+    }
+}
+
+void showItem (ExpandItem item) {
+    Control control = item.control;
+    if (control !is null && !control.isDisposed ()) {
+        control.setVisible (item.expanded);
+    }
+    item.redraw ();
+    int index = indexOf (item);
+    layoutItems (index + 1, true);
+}
+
+override void updateScrollBarValue (ScrollBar bar) {
+    yCurrentScroll = bar.getSelection();
+    layoutItems (0, false);
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/ExpandItem.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,636 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.ExpandItem;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.internal.Converter;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.ExpandBar;
+import org.eclipse.swt.widgets.ImageList;
+import org.eclipse.swt.widgets.Event;
+
+
+/**
+ * Instances of this class represent a selectable user interface object
+ * that represents a expandable item in a expand bar.
+ * <p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>(none)</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see ExpandBar
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.2
+ */
+public class ExpandItem : Item {
+
+    alias Item.setForegroundColor setForegroundColor;
+    alias Item.windowProc windowProc;
+
+    ExpandBar parent;
+    Control control;
+    ImageList imageList;
+    GtkWidget* clientHandle, boxHandle, labelHandle, imageHandle;
+    bool expanded;
+    int x, y, width, height;
+    int imageHeight, imageWidth;
+    static final int TEXT_INSET = 6;
+    static final int BORDER = 1;
+    static final int CHEVRON_SIZE = 24;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (ExpandBar parent, int style) {
+    super (parent, style);
+    this.parent = parent;
+    createWidget (parent.getItemCount ());
+}
+
+/**
+ * Constructs a new instance of this class given its parent, a
+ * style value describing its behavior and appearance, and the index
+ * at which to place it in the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ * @param index the zero-relative index to store the receiver in its parent
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the parent (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (ExpandBar parent, int style, int index) {
+    super (parent, style);
+    this.parent = parent;
+    createWidget (index);
+}
+
+protected override void checkSubclass () {
+    if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+override void createHandle (int index) {
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        state |= HANDLE;
+        handle = OS.gtk_expander_new (null);
+        if (handle is null) error (SWT.ERROR_NO_HANDLES);
+        clientHandle = cast(GtkWidget*)OS.g_object_new (display.gtk_fixed_get_type (), null);
+        if (clientHandle is null) error (SWT.ERROR_NO_HANDLES);
+        OS.gtk_container_add (handle, clientHandle);
+        boxHandle = cast(GtkWidget*)OS.gtk_hbox_new (false, 4);
+        if (boxHandle is null) error (SWT.ERROR_NO_HANDLES);
+        labelHandle = cast(GtkWidget*)OS.gtk_label_new (null);
+        if (labelHandle is null) error (SWT.ERROR_NO_HANDLES);
+        imageHandle = cast(GtkWidget*)OS.gtk_image_new ();
+        if (imageHandle is null) error (SWT.ERROR_NO_HANDLES);
+        OS.gtk_container_add (boxHandle, imageHandle);
+        OS.gtk_container_add (boxHandle, labelHandle);
+        OS.gtk_expander_set_label_widget (handle, boxHandle);
+        OS.GTK_WIDGET_SET_FLAGS (handle, OS.GTK_CAN_FOCUS);
+    }
+}
+
+override void createWidget (int index) {
+    super.createWidget (index);
+    showWidget (index);
+    parent.createItem (this, style, index);
+}
+
+override void deregister() {
+    super.deregister();
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        display.removeWidget (clientHandle);
+        display.removeWidget (boxHandle);
+        display.removeWidget (labelHandle);
+        display.removeWidget (imageHandle);
+    }
+}
+
+override void destroyWidget () {
+    parent.destroyItem (this);
+    super.destroyWidget ();
+}
+
+void drawChevron (GC gc, int x, int y) {
+    int [] polyline1, polyline2;
+    if (expanded) {
+        int px = x + 4 + 5;
+        int py = y + 4 + 7;
+        polyline1 = [
+                px,py, px+1,py, px+1,py-1, px+2,py-1, px+2,py-2, px+3,py-2, px+3,py-3,
+                px+3,py-2, px+4,py-2, px+4,py-1, px+5,py-1, px+5,py, px+6,py];
+        py += 4;
+        polyline2 = [
+                px,py, px+1,py, px+1,py-1, px+2,py-1, px+2,py-2, px+3,py-2, px+3,py-3,
+                px+3,py-2, px+4,py-2, px+4,py-1,  px+5,py-1, px+5,py, px+6,py];
+    } else {
+        int px = x + 4 + 5;
+        int py = y + 4 + 4;
+        polyline1 = [
+                px,py, px+1,py, px+1,py+1, px+2,py+1, px+2,py+2, px+3,py+2, px+3,py+3,
+                px+3,py+2, px+4,py+2, px+4,py+1,  px+5,py+1, px+5,py, px+6,py];
+        py += 4;
+        polyline2 = [
+                px,py, px+1,py, px+1,py+1, px+2,py+1, px+2,py+2, px+3,py+2, px+3,py+3,
+                px+3,py+2, px+4,py+2, px+4,py+1,  px+5,py+1, px+5,py, px+6,py];
+    }
+    gc.setForeground (display.getSystemColor (SWT.COLOR_TITLE_FOREGROUND));
+    gc.drawPolyline (polyline1);
+    gc.drawPolyline (polyline2);
+}
+
+void drawItem (GC gc, bool drawFocus) {
+    int headerHeight = parent.getBandHeight ();
+    Display display = getDisplay ();
+    gc.setForeground (display.getSystemColor (SWT.COLOR_TITLE_BACKGROUND));
+    gc.setBackground (display.getSystemColor (SWT.COLOR_TITLE_BACKGROUND_GRADIENT));
+    gc.fillGradientRectangle (x, y, width, headerHeight, true);
+    if (expanded) {
+        gc.setForeground (display.getSystemColor (SWT.COLOR_TITLE_BACKGROUND_GRADIENT));
+        gc.drawLine (x, y + headerHeight, x, y + headerHeight + height - 1);
+        gc.drawLine (x, y + headerHeight + height - 1, x + width - 1, y + headerHeight + height - 1);
+        gc.drawLine (x + width - 1, y + headerHeight + height - 1, x + width - 1, y + headerHeight);
+    }
+    int drawX = x;
+    if (image !is null) {
+        drawX += ExpandItem.TEXT_INSET;
+        if (imageHeight > headerHeight) {
+            gc.drawImage (image, drawX, y + headerHeight - imageHeight);
+        } else {
+            gc.drawImage (image, drawX, y + (headerHeight - imageHeight) / 2);
+        }
+        drawX += imageWidth;
+    }
+    if (text.length > 0) {
+        drawX += ExpandItem.TEXT_INSET;
+        Point size = gc.stringExtent (text);
+        gc.setForeground (parent.getForeground ());
+        gc.drawString (text, drawX, y + (headerHeight - size.y) / 2, true);
+    }
+    int chevronSize = ExpandItem.CHEVRON_SIZE;
+    drawChevron (gc, x + width - chevronSize, y + (headerHeight - chevronSize) / 2);
+    if (drawFocus) {
+        gc.drawFocus (x + 1, y + 1, width - 2, headerHeight - 2);
+    }
+}
+
+/**
+ * Returns the control that is shown when the item is expanded.
+ * If no control has been set, return <code>null</code>.
+ *
+ * @return the control
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Control getControl () {
+    checkWidget ();
+    return control;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is expanded,
+ * and false otherwise.
+ *
+ * @return the expanded state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool getExpanded () {
+    checkWidget ();
+    return expanded;
+}
+
+/**
+ * Returns the height of the receiver's header
+ *
+ * @return the height of the header
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getHeaderHeight () {
+    checkWidget ();
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        return OS.GTK_WIDGET_HEIGHT (handle) - (expanded ? height : 0);
+    }
+    return Math.max (parent.getBandHeight (), imageHeight);
+}
+
+/**
+ * Gets the height of the receiver.
+ *
+ * @return the height
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getHeight () {
+    checkWidget ();
+    return height;
+}
+
+/**
+ * Returns the receiver's parent, which must be a <code>ExpandBar</code>.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public ExpandBar getParent () {
+    checkWidget();
+    return parent;
+}
+
+int getPreferredWidth (GC gc) {
+    int width = ExpandItem.TEXT_INSET * 2 + ExpandItem.CHEVRON_SIZE;
+    if (image !is null) {
+        width += ExpandItem.TEXT_INSET + imageWidth;
+    }
+    if (text.length > 0) {
+        width += gc.stringExtent (text).x;
+    }
+    return width;
+}
+
+override int /*long*/ gtk_activate (GtkWidget* widget) {
+    Event event = new Event ();
+    event.item = this;
+    int type = OS.gtk_expander_get_expanded (handle) ? SWT.Collapse : SWT.Expand;
+    parent.sendEvent (type, event);
+    return 0;
+}
+
+override int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* event) {
+    setFocus ();
+    return 0;
+}
+
+override int /*long*/ gtk_focus_out_event (GtkWidget* widget, GdkEventFocus* event) {
+    OS.GTK_WIDGET_UNSET_FLAGS (handle, OS.GTK_CAN_FOCUS);
+    parent.lastFocus = this;
+    return 0;
+}
+
+override int /*long*/ gtk_size_allocate (GtkWidget* widget, int /*long*/ allocation) {
+    parent.layoutItems (0, false);
+    return 0;
+}
+
+override int /*long*/ gtk_enter_notify_event (GtkWidget* widget, GdkEventCrossing* event) {
+    parent.gtk_enter_notify_event(widget, event);
+    return 0;
+}
+
+bool hasFocus () {
+    return OS.GTK_WIDGET_HAS_FOCUS (handle);
+}
+
+override void hookEvents () {
+    super.hookEvents ();
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        OS.g_signal_connect_closure (handle, OS.activate.ptr, display.closures [ACTIVATE], false);
+        OS.g_signal_connect_closure (handle, OS.activate.ptr, display.closures [ACTIVATE_INVERSE], true);
+        OS.g_signal_connect_closure_by_id (handle, display.signalIds [BUTTON_PRESS_EVENT], 0, display.closures [BUTTON_PRESS_EVENT], false);
+        OS.g_signal_connect_closure_by_id (handle, display.signalIds [FOCUS_OUT_EVENT], 0, display.closures [FOCUS_OUT_EVENT], false);
+        OS.g_signal_connect_closure (clientHandle, OS.size_allocate.ptr, display.closures [SIZE_ALLOCATE], true);
+        OS.g_signal_connect_closure_by_id (handle, display.signalIds [ENTER_NOTIFY_EVENT], 0, display.closures [ENTER_NOTIFY_EVENT], false);
+    }
+}
+
+void redraw () {
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 4, 0)) {
+        int headerHeight = parent.getBandHeight ();
+        if (imageHeight > headerHeight) {
+            parent.redraw (x + ExpandItem.TEXT_INSET, y + headerHeight - imageHeight, imageWidth, imageHeight, false);
+        }
+        parent.redraw (x, y, width, headerHeight + height, false);
+    }
+}
+
+override void register () {
+    super.register ();
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        display.addWidget (clientHandle, this);
+        display.addWidget (boxHandle, this);
+        display.addWidget (labelHandle, this);
+        display.addWidget (imageHandle, this);
+    }
+}
+
+override void releaseHandle () {
+    super.releaseHandle ();
+    clientHandle = boxHandle = labelHandle = imageHandle = null;
+    parent = null;
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    if (imageList !is null) imageList.dispose ();
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        if (parent.lastFocus is this) parent.lastFocus = null;
+    }
+    imageList = null;
+    control = null;
+}
+
+void resizeControl (int yScroll) {
+    if (control !is null && !control.isDisposed ()) {
+        bool visible =cast(bool) OS.gtk_expander_get_expanded (handle);
+        if (visible) {
+            int x = OS.GTK_WIDGET_X (clientHandle);
+            int y = OS.GTK_WIDGET_Y (clientHandle);
+            if (x !is -1 && y !is -1) {
+                int width = OS.GTK_WIDGET_WIDTH (clientHandle);
+                int height = OS.GTK_WIDGET_HEIGHT (clientHandle);
+                int property;
+                OS.gtk_widget_style_get1 (handle, OS.focus_line_width.ptr, &property);
+                y += property * 2;
+                height -= property * 2;
+                control.setBounds (x, y - yScroll, width, Math.max (0, height), true, true);
+            }
+        }
+        control.setVisible (visible);
+    }
+}
+
+void setBounds (int x, int y, int width, int height, bool move, bool size) {
+    redraw ();
+    int headerHeight = parent.getBandHeight ();
+    if (move) {
+        if (imageHeight > headerHeight) {
+            y += (imageHeight - headerHeight);
+        }
+        this.x = x;
+        this.y = y;
+        redraw ();
+    }
+    if (size) {
+        this.width = width;
+        this.height = height;
+        redraw ();
+    }
+    if (control !is null && !control.isDisposed ()) {
+        if (move) control.setLocation (x + BORDER, y + headerHeight);
+        if (size) control.setSize (Math.max (0, width - 2 * BORDER), Math.max (0, height - BORDER));
+    }
+}
+
+/**
+ * Sets the control that is shown when the item is expanded.
+ *
+ * @param control the new control (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the control has been disposed</li>
+ *    <li>ERROR_INVALID_PARENT - if the control is not in the same widget tree</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setControl (Control control) {
+    checkWidget ();
+    if (control !is null) {
+        if (control.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+        if (control.parent !is parent) error (SWT.ERROR_INVALID_PARENT);
+    }
+    if (this.control is control) return;
+    this.control = control;
+    if (control !is null) {
+        control.setVisible (expanded);
+        if (OS.GTK_VERSION < OS.buildVERSION (2, 4, 0)) {
+            int headerHeight = parent.getBandHeight ();
+            control.setBounds (x + BORDER, y + headerHeight, Math.max (0, width - 2 * BORDER), Math.max (0, height - BORDER));
+        }
+    }
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        parent.layoutItems (0, true);
+    }
+}
+
+/**
+ * Sets the expanded state of the receiver.
+ *
+ * @param expanded the new expanded state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setExpanded (bool expanded) {
+    checkWidget ();
+    this.expanded = expanded;
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        OS.gtk_expander_set_expanded (handle, expanded);
+        parent.layoutItems (0, true);
+    } else {
+        parent.showItem (this);
+    }
+}
+
+bool setFocus () {
+    if (!OS.gtk_widget_get_child_visible (handle)) return false;
+    OS.GTK_WIDGET_SET_FLAGS (handle, OS.GTK_CAN_FOCUS);
+    OS.gtk_widget_grab_focus (handle);
+    bool result = cast(bool)OS.gtk_widget_is_focus (handle);
+    if (!result) OS.GTK_WIDGET_UNSET_FLAGS (handle, OS.GTK_CAN_FOCUS);
+    return result;
+}
+
+void setFontDescription (PangoFontDescription* font) {
+    OS.gtk_widget_modify_font (handle, font);
+    if (labelHandle !is null) OS.gtk_widget_modify_font (labelHandle, font);
+    if (imageHandle !is null) OS.gtk_widget_modify_font (imageHandle, font);
+}
+
+alias Item.setForegroundColor setForegroundColor;
+void setForegroundColor (GdkColor* color) {
+    setForegroundColor (handle, color);
+    if (labelHandle !is null) setForegroundColor (labelHandle, color);
+    if (imageHandle !is null) setForegroundColor (imageHandle, color);
+}
+
+/**
+ * Sets the height of the receiver. This is height of the item when it is expanded,
+ * excluding the height of the header.
+ *
+ * @param height the new height
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setHeight (int height) {
+    checkWidget ();
+    if (height < 0) return;
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        this.height = height;
+        OS.gtk_widget_set_size_request (clientHandle, -1, height);
+        parent.layoutItems (0, false);
+    } else {
+        setBounds (0, 0, width, height, false, true);
+        if (expanded) parent.layoutItems (parent.indexOf (this) + 1, true);
+    }
+}
+
+public override void setImage (Image image) {
+    super.setImage (image);
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        if (imageList !is null) imageList.dispose ();
+        imageList = null;
+        if (image !is null) {
+            if (image.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+            imageList = new ImageList ();
+            int imageIndex = imageList.add (image);
+            auto pixbuf = imageList.getPixbuf (imageIndex);
+            OS.gtk_image_set_from_pixbuf (imageHandle, pixbuf);
+            if (text.length is 0) OS.gtk_widget_hide (labelHandle);
+            OS.gtk_widget_show (imageHandle);
+        } else {
+            OS.gtk_image_set_from_pixbuf (imageHandle, null);
+            OS.gtk_widget_show (labelHandle);
+            OS.gtk_widget_hide (imageHandle);
+        }
+    } else {
+        int oldImageHeight = imageHeight;
+        if (image !is null) {
+            Rectangle bounds = image.getBounds ();
+            imageHeight = bounds.height;
+            imageWidth = bounds.width;
+        } else {
+            imageHeight = imageWidth = 0;
+        }
+        if (oldImageHeight !is imageHeight) {
+            parent.layoutItems (parent.indexOf (this), true);
+        } else {
+            redraw ();
+        }
+    }
+}
+
+void setOrientation() {
+    super.setOrientation ();
+    if ((parent.style & SWT.RIGHT_TO_LEFT) !is 0) {
+        OS.gtk_widget_set_direction (handle, OS.GTK_TEXT_DIR_RTL);
+        display.doSetDirectionProc(handle, OS.GTK_TEXT_DIR_RTL);
+    }
+}
+
+public override void setText (String string) {
+    super.setText (string);
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        OS.gtk_label_set_text (labelHandle, toStringz(string));
+    } else {
+        redraw ();
+    }
+}
+
+void showWidget (int index) {
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+        OS.gtk_widget_show (handle);
+        OS.gtk_widget_show (clientHandle);
+        OS.gtk_container_add (parent.handle, handle);
+        OS.gtk_box_set_child_packing (parent.handle, handle, false, false, 0, OS.GTK_PACK_START);
+        if (boxHandle !is null) OS.gtk_widget_show (boxHandle);
+        if (labelHandle !is null) OS.gtk_widget_show (labelHandle);
+    }
+}
+
+override int /*long*/ windowProc (GtkWidget* handle, int /*long*/ user_data) {
+    switch (cast(int)/*64*/user_data) {
+        case ACTIVATE_INVERSE: {
+            expanded = cast(bool)OS.gtk_expander_get_expanded (handle);
+            parent.layoutItems (0, false);
+            return 0;
+        }
+        default:
+    }
+    return super.windowProc (handle, user_data);
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/FileDialog.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,682 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.FileDialog;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Dialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Display;
+import java.lang.all;
+
+static import tango.io.model.IFile;
+static import tango.text.Util;
+
+/**
+ * Instances of this class allow the user to navigate
+ * the file system and select or enter a file name.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>SAVE, OPEN, MULTI</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles SAVE and OPEN may be specified.
+ * </p><p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#filedialog">FileDialog snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample, Dialog tab</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class FileDialog : Dialog {
+    String [] filterNames;
+    String [] filterExtensions;
+    String filterPath = "";
+    String fileName = "";
+    String[] fileNames;
+    String fullPath = "";
+    int filterIndex = -1;
+    bool overwrite = false;
+    GtkWidget* handle;
+    static final char SEPARATOR = tango.io.model.IFile.FileConst.PathSeparatorChar;
+    static final char EXTENSION_SEPARATOR = ';';
+
+/**
+ * Constructs a new instance of this class given only its parent.
+ *
+ * @param parent a shell which will be the parent of the new instance
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ */
+public this (Shell parent) {
+    this (parent, SWT.APPLICATION_MODAL);
+}
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a shell which will be the parent of the new instance
+ * @param style the style of dialog to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ */
+public this (Shell parent, int style) {
+    super (parent, checkStyle (parent, style));
+    checkSubclass ();
+}
+String computeResultChooserDialog () {
+    /* MULTI is only valid if the native dialog's action is Open */
+    fullPath = null;
+    if ((style & (SWT.SAVE | SWT.MULTI)) is SWT.MULTI) {
+        auto list = OS.gtk_file_chooser_get_filenames (handle);
+        int listLength = OS.g_slist_length (list);
+        fileNames = new String [listLength];
+        auto current = list;
+        int writePos = 0;
+        for (int i = 0; i < listLength; i++) {
+            auto name = cast(char*)OS.g_slist_data (current);
+            uint items_written;
+            char* utf8Ptr = OS.g_filename_to_utf8 (name, -1, null, &items_written, null);
+            OS.g_free (name);
+            if (utf8Ptr !is null) {
+                fullPath = utf8Ptr[ 0 .. items_written ].dup;
+                int start = tango.text.Util.locatePrior( fullPath, SEPARATOR);
+                if( start is fullPath.length ) start = -1;
+                fileNames [writePos++] = fullPath[ start + 1 .. $ ].dup;
+                OS.g_free (utf8Ptr);
+            }
+            current = OS.g_slist_next (current);
+        }
+        if (writePos !is 0 && writePos !is listLength) {
+            String [] validFileNames = new String [writePos];
+            System.arraycopy (fileNames, 0, validFileNames, 0, writePos);
+            fileNames = validFileNames;
+        }
+        OS.g_slist_free (list);
+    } else {
+        auto path = OS.gtk_file_chooser_get_filename (handle);
+        if (path !is null) {
+            uint items_written;
+            auto utf8Ptr = OS.g_filename_to_utf8 (path, -1, null, &items_written, null);
+            OS.g_free (path);
+            if (utf8Ptr !is null) {
+                fullPath = utf8Ptr[ 0 .. items_written ].dup;
+                fileNames = new String [1];
+                int start = tango.text.Util.locatePrior( fullPath, SEPARATOR);
+                if( start == fullPath.length ) start = -1;
+                fileNames[0] = fullPath[ start + 1 .. $ ];
+                OS.g_free (utf8Ptr);
+            }
+        }
+    }
+    filterIndex = -1;
+    auto filter = OS.gtk_file_chooser_get_filter (handle);
+    if (filter !is null) {
+        auto filterNamePtr = OS.gtk_file_filter_get_name (filter);
+        if (filterNamePtr !is null) {
+            String filterName = fromStringz(filterNamePtr).dup;
+            //OS.g_free (filterNamePtr); //GTK owns this pointer - do not free
+            for (int i = 0; i < filterExtensions.length; i++) {
+                if (filterNames.length > 0) {
+                    if (filterNames[i].equals(filterName)) {
+                        filterIndex = i;
+                        break;
+                    }
+                } else {
+                    if (filterExtensions[i].equals(filterName)) {
+                        filterIndex = i;
+                        break;
+                    }
+                }
+            }
+        }
+    }
+    if (fullPath !is null) {
+        int separatorIndex = tango.text.Util.locatePrior( fullPath, SEPARATOR);
+        if( separatorIndex is fullPath.length ) separatorIndex = -1;
+        fileName = fullPath[separatorIndex + 1 .. $ ];
+        filterPath = fullPath[0 .. separatorIndex ];
+    }
+    return fullPath;
+}
+String computeResultClassicDialog () {
+    filterIndex = -1;
+    GtkFileSelection* selection = cast(GtkFileSelection*)handle;
+    auto entry = selection.selection_entry;
+    auto entryText = OS.gtk_entry_get_text (entry);
+    String txt = fromStringz( entryText );
+    if (txt.length is 0) {
+        auto fileList = selection.file_list;
+        auto listSelection = OS.gtk_tree_view_get_selection (fileList);
+        void* model;
+        auto selectedList = OS.gtk_tree_selection_get_selected_rows (listSelection, &model);
+        if (selectedList is null) return null;
+        int listLength = OS.g_list_length (selectedList);
+        if (listLength is 0) {
+            OS.g_list_free (selectedList);
+            return null;
+        }
+        auto path = OS.g_list_nth_data (selectedList, 0);
+        char* ptr;
+        GtkTreeIter iter;
+        if (OS.gtk_tree_model_get_iter (&model, &iter, path)) {
+            OS.gtk_tree_model_get1 (&model, &iter, 0, cast(void**)&ptr);
+        }
+        for (int i = 0; i < listLength; i++) {
+            OS.gtk_tree_path_free (OS.g_list_nth_data (selectedList, i));
+        }
+        OS.g_list_free (selectedList);
+        if (ptr is null) return null;
+        OS.gtk_entry_set_text (entry, ptr);
+        OS.g_free (ptr);
+    }
+
+    auto fileNamePtr = OS.gtk_file_selection_get_filename (handle);
+    uint items_written;
+    auto utf8Ptr = OS.g_filename_to_utf8 (fileNamePtr, -1, null, &items_written, null);
+    String osAnswer = utf8Ptr[ 0 .. items_written ].dup;
+    OS.g_free (utf8Ptr);
+
+    if (osAnswer.length is 0) return null;
+    int separatorIndex = tango.text.Util.locatePrior( osAnswer, SEPARATOR);
+    if (separatorIndex is osAnswer.length ) separatorIndex = -1;
+    if (separatorIndex+1 is osAnswer.length ) return null;
+
+    String answer = fullPath = osAnswer;
+    fileName = fullPath[ separatorIndex+1 .. $ ];
+    filterPath = fullPath[ 0 .. separatorIndex ];
+    if ((style & SWT.MULTI) is 0) {
+        fileNames = [ fileName ];
+    } else {
+        auto namesPtr = OS.gtk_file_selection_get_selections (handle);
+        auto namesPtr1 = namesPtr;
+        char* namePtr = namesPtr1[0];
+        int length_ = 0;
+        while (namePtr !is null) {
+            length_++;
+            namePtr = namesPtr1[length_];
+        }
+        fileNames = new String[](length_);
+        for (int i = 0; i < length_; i++) {
+            utf8Ptr = OS.g_filename_to_utf8 (namesPtr [i], -1, null, &items_written, null);
+            String name = utf8Ptr[ 0 .. items_written ].dup;
+            int start = tango.text.Util.locatePrior( name, SEPARATOR);
+            if( start == name.length ) start = -1;
+            fileNames [i] = name[ start + 1 .. $ ].dup;
+            OS.g_free (utf8Ptr);
+        }
+        OS.g_strfreev (namesPtr);
+    }
+    return answer;
+}
+/**
+ * Returns the path of the first file that was
+ * selected in the dialog relative to the filter path, or an
+ * empty string if no such file has been selected.
+ *
+ * @return the relative path of the file
+ */
+public String getFileName () {
+    return fileName;
+}
+/**
+ * Returns a (possibly empty) array with the paths of all files
+ * that were selected in the dialog relative to the filter path.
+ *
+ * @return the relative paths of the files
+ */
+public String [] getFileNames () {
+    return fileNames;
+}
+/**
+ * Returns the file extensions which the dialog will
+ * use to filter the files it shows.
+ *
+ * @return the file extensions filter
+ */
+public String [] getFilterExtensions () {
+    return filterExtensions;
+}
+/**
+ * Get the 0-based index of the file extension filter
+ * which was selected by the user, or -1 if no filter
+ * was selected.
+ * <p>
+ * This is an index into the FilterExtensions array and
+ * the FilterNames array.
+ * </p>
+ *
+ * @return index the file extension filter index
+ *
+ * @see #getFilterExtensions
+ * @see #getFilterNames
+ *
+ * @since 3.4
+ */
+public int getFilterIndex () {
+    return filterIndex;
+}
+/**
+ * Returns the names that describe the filter extensions
+ * which the dialog will use to filter the files it shows.
+ *
+ * @return the list of filter names
+ */
+public String [] getFilterNames () {
+    return filterNames;
+}
+/**
+ * Returns the directory path that the dialog will use, or an empty
+ * string if this is not set.  File names in this path will appear
+ * in the dialog, filtered according to the filter extensions.
+ *
+ * @return the directory path string
+ *
+ * @see #setFilterExtensions
+ */
+public String getFilterPath () {
+    return filterPath;
+}
+/**
+ * Returns the flag that the dialog will use to
+ * determine whether to prompt the user for file
+ * overwrite if the selected file already exists.
+ *
+ * @return true if the dialog will prompt for file overwrite, false otherwise
+ *
+ * @since 3.4
+ */
+public bool getOverwrite () {
+    return overwrite;
+}
+/**
+ * Makes the dialog visible and brings it to the front
+ * of the display.
+ *
+ * @return a string describing the absolute path of the first selected file,
+ *         or null if the dialog was cancelled or an error occurred
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the dialog has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the dialog</li>
+ * </ul>
+ */
+public String open () {
+    bool useChooserDialog = OS.GTK_VERSION >= OS.buildVERSION (2, 4, 10);
+    if (useChooserDialog) {
+        return openChooserDialog ();
+    } else {
+        return openClassicDialog ();
+    }
+}
+String openChooserDialog () {
+    char* titleBytes = toStringz( title );
+    int action = (style & SWT.SAVE) !is 0 ?
+        OS.GTK_FILE_CHOOSER_ACTION_SAVE :
+        OS.GTK_FILE_CHOOSER_ACTION_OPEN;
+    auto shellHandle = parent.topHandle ();
+    handle = OS.gtk_file_chooser_dialog_new2 (
+        titleBytes,
+        shellHandle,
+        action,
+        OS.GTK_STOCK_CANCEL (), OS.GTK_RESPONSE_CANCEL,
+        OS.GTK_STOCK_OK (), OS.GTK_RESPONSE_OK);
+    auto pixbufs = OS.gtk_window_get_icon_list (shellHandle);
+    if (pixbufs !is null) {
+        OS.gtk_window_set_icon_list (handle, pixbufs);
+        OS.g_list_free (pixbufs);
+    }
+    presetChooserDialog ();
+    Display display = parent !is null ? parent.getDisplay (): Display.getCurrent ();
+    display.addIdleProc ();
+    String answer = null;
+    Dialog oldModal = null;
+    if (OS.gtk_window_get_modal (handle)) {
+        oldModal = display.getModalDialog ();
+        display.setModalDialog (this);
+    }
+    uint signalId = 0;
+    uint /*long*/ hookId = 0;
+    CallbackData emissionData;
+    emissionData.display = display;
+    if ((style & SWT.RIGHT_TO_LEFT) !is 0) {
+        signalId = OS.g_signal_lookup (OS.map.ptr, OS.GTK_TYPE_WIDGET());
+        emissionData.data = handle;
+        hookId = OS.g_signal_add_emission_hook (signalId, 0, &Display.emissionFunc, &emissionData, null);
+    }
+    int response = OS.gtk_dialog_run (handle);
+    if ((style & SWT.RIGHT_TO_LEFT) !is 0) {
+        OS.g_signal_remove_emission_hook (signalId, hookId);
+    }
+    if (OS.gtk_window_get_modal (handle)) {
+        display.setModalDialog (oldModal);
+    }
+    if (response is OS.GTK_RESPONSE_OK) {
+        answer = computeResultChooserDialog ();
+    }
+    display.removeIdleProc ();
+    OS.gtk_widget_destroy (handle);
+    return answer;
+}
+String openClassicDialog () {
+    char* titleBytes = toStringz( title );
+    handle = OS.gtk_file_selection_new (titleBytes);
+    if (parent !is null) {
+        auto shellHandle = parent.topHandle ();
+        OS.gtk_window_set_transient_for (handle, shellHandle);
+        auto pixbufs = OS.gtk_window_get_icon_list (shellHandle);
+        if (pixbufs !is null) {
+            OS.gtk_window_set_icon_list (handle, pixbufs);
+            OS.g_list_free (pixbufs);
+        }
+    }
+    presetClassicDialog ();
+    Display display = parent !is null ? parent.getDisplay (): Display.getCurrent ();
+    display.addIdleProc ();
+    String answer = null;
+    Dialog oldModal = null;
+    if (OS.gtk_window_get_modal (handle)) {
+        oldModal = display.getModalDialog ();
+        display.setModalDialog (this);
+    }
+    int signalId = 0;
+    int /*long*/ hookId = 0;
+    CallbackData emissionData;
+    emissionData.display = display;
+    if ((style & SWT.RIGHT_TO_LEFT) !is 0) {
+        signalId = OS.g_signal_lookup (OS.map.ptr, OS.GTK_TYPE_WIDGET());
+        emissionData.data = handle;
+        hookId = OS.g_signal_add_emission_hook (signalId, 0, &Display.emissionFunc, &emissionData, null);
+    }
+    int response = OS.gtk_dialog_run (handle);
+    if ((style & SWT.RIGHT_TO_LEFT) !is 0) {
+        OS.g_signal_remove_emission_hook (signalId, hookId);
+    }
+    if (OS.gtk_window_get_modal (handle)) {
+        display.setModalDialog (oldModal);
+    }
+    if (response is OS.GTK_RESPONSE_OK) {
+        answer = computeResultClassicDialog ();
+    }
+    display.removeIdleProc ();
+    OS.gtk_widget_destroy (handle);
+    return answer;
+}
+void presetChooserDialog () {
+    /* MULTI is only valid if the native dialog's action is Open */
+    if ((style & (SWT.SAVE | SWT.MULTI)) is SWT.MULTI) {
+        OS.gtk_file_chooser_set_select_multiple (handle, true);
+    }
+    if (filterPath is null) filterPath = "";
+    if (fileName is null) fileName = "";
+    if (filterPath.length > 0) {
+        StringBuffer stringBuffer = new StringBuffer();
+        /* filename must be a full path */
+        if (filterPath[0] !is SEPARATOR) {
+            stringBuffer.append (SEPARATOR);
+        }
+        stringBuffer.append (filterPath);
+        if (fileName.length > 0 && (style & SWT.SAVE) is 0) {
+            if (filterPath[filterPath.length - 1 ] !is SEPARATOR) {
+                stringBuffer.append (SEPARATOR);
+            }
+            stringBuffer.append (fileName);
+        char* buffer = toStringz( stringBuffer.toString ());
+            /*
+            * Bug in GTK. GtkFileChooser may crash on GTK versions 2.4.10 to 2.6
+            * when setting a file name that is not a true canonical path.
+            * The fix is to use the canonical path.
+            */
+        auto ptr = OS.realpath (buffer, null);
+        if (ptr !is null) {
+                OS.gtk_file_chooser_set_filename (handle, ptr);
+                OS.g_free (ptr);
+            }
+        } else {
+            char* buffer = toStringz( stringBuffer.toString () );
+            /*
+            * Bug in GTK. GtkFileChooser may crash on GTK versions 2.4.10 to 2.6
+            * when setting a file name that is not a true canonical path.
+            * The fix is to use the canonical path.
+            */
+            auto ptr = OS.realpath (buffer, null);
+            if (ptr !is null) {
+                OS.gtk_file_chooser_set_current_folder (handle, ptr);
+                OS.g_free (ptr);
+            }
+        }
+    } else {
+        if (fileName.length > 0) {
+            if (fileName[0] is SEPARATOR) {
+                char* buffer = toStringz(fileName);
+
+                /*
+                * Bug in GTK. GtkFileChooser may crash on GTK versions 2.4.10 to 2.6
+                * when setting a file name that is not a true canonical path.
+                * The fix is to use the canonical path.
+                */
+                auto ptr = OS.realpath (buffer, null);
+                if (ptr !is null) {
+                    OS.gtk_file_chooser_set_filename (handle, ptr);
+                    OS.g_free (ptr);
+                }
+            }
+        }
+    }
+    if ((style & SWT.SAVE) !is 0 && fileName.length > 0) {
+        char* buffer = toStringz(fileName);
+        OS.gtk_file_chooser_set_current_name (handle, buffer);
+    }
+    if ((style & SWT.SAVE) !is 0) {
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 8, 0)) {
+            OS.gtk_file_chooser_set_do_overwrite_confirmation (handle, overwrite);
+        }
+    }
+
+    /* Set the extension filters */
+    if (filterNames is null) filterNames = null;
+    if (filterExtensions is null) filterExtensions = null;
+    GtkFileFilter* initialFilter = null;
+    for (int i = 0; i < filterExtensions.length; i++) {
+        if (filterExtensions [i] !is null) {
+            auto filter = OS.gtk_file_filter_new ();
+            if (filterNames.length > i && filterNames [i] !is null) {
+                char* name = toStringz(filterNames [i]);
+                OS.gtk_file_filter_set_name (filter, name);
+            } else {
+                char* name = toStringz(filterExtensions [i]);
+                OS.gtk_file_filter_set_name (filter, name);
+            }
+            int start = 0;
+            int index = tango.text.Util.locate( filterExtensions [i], EXTENSION_SEPARATOR );
+            while (index !is filterExtensions [i].length ) {
+                String current = filterExtensions [i][ start .. index ];
+                char* filterString = toStringz(current);
+                OS.gtk_file_filter_add_pattern (filter, filterString);
+                start = index + 1;
+                index = tango.text.Util.locate( filterExtensions [i], EXTENSION_SEPARATOR, start);
+            }
+            String current = filterExtensions [i][ start .. $ ];
+            char* filterString = toStringz(current);
+            OS.gtk_file_filter_add_pattern (filter, filterString);
+            OS.gtk_file_chooser_add_filter (handle, filter);
+            if (i is filterIndex) {
+                initialFilter = filter;
+            }
+        }
+    }
+    if (initialFilter !is null) {
+        OS.gtk_file_chooser_set_filter(handle, initialFilter);
+    }
+    fullPath = null;
+    fileNames = null;
+}
+void presetClassicDialog () {
+    OS.gtk_file_selection_set_select_multiple(handle, (style & SWT.MULTI) !is 0);
+
+    /* Calculate the fully-specified file name and convert to bytes */
+    StringBuffer stringBuffer = new StringBuffer();
+    if (filterPath is null) {
+        filterPath = "";
+    } else {
+        if (filterPath.length > 0) {
+            stringBuffer.append (filterPath);
+            if (filterPath[filterPath.length - 1] !is SEPARATOR) {
+                stringBuffer.append (SEPARATOR);
+            }
+        }
+    }
+    if (fileName is null) {
+        fileName = "";
+    } else {
+        stringBuffer.append (fileName);
+    }
+    fullPath = stringBuffer.toString ();
+    auto fileNamePtr = OS.g_filename_from_utf8 (toStringz( fullPath ), -1, null, null, null);
+    OS.gtk_file_selection_set_filename (handle, fileNamePtr);
+    OS.g_free (fileNamePtr);
+
+    if (filterNames is null) filterNames = null;
+    if (filterExtensions is null) filterExtensions = null;
+    fullPath = null;
+    fileNames = null;
+}
+/**
+ * Set the initial filename which the dialog will
+ * select by default when opened to the argument,
+ * which may be null.  The name will be prefixed with
+ * the filter path when one is supplied.
+ *
+ * @param string the file name
+ */
+public void setFileName (String string) {
+    fileName = string;
+}
+/**
+ * Set the file extensions which the dialog will
+ * use to filter the files it shows to the argument,
+ * which may be null.
+ * <p>
+ * The strings are platform specific. For example, on
+ * some platforms, an extension filter string is typically
+ * of the form "*.extension", where "*.*" matches all files.
+ * For filters with multiple extensions, use semicolon as
+ * a separator, e.g. "*.jpg;*.png".
+ * </p>
+ *
+ * @param extensions the file extension filter
+ *
+ * @see #setFilterNames to specify the user-friendly
+ * names corresponding to the extensions
+ */
+public void setFilterExtensions (String [] extensions) {
+    filterExtensions = extensions;
+}
+/**
+ * Set the 0-based index of the file extension filter
+ * which the dialog will use initially to filter the files
+ * it shows to the argument.
+ * <p>
+ * This is an index into the FilterExtensions array and
+ * the FilterNames array.
+ * </p>
+ *
+ * @param index the file extension filter index
+ *
+ * @see #setFilterExtensions
+ * @see #setFilterNames
+ *
+ * @since 3.4
+ */
+public void setFilterIndex (int index) {
+    filterIndex = index;
+}
+/**
+ * Sets the names that describe the filter extensions
+ * which the dialog will use to filter the files it shows
+ * to the argument, which may be null.
+ * <p>
+ * Each name is a user-friendly short description shown for
+ * its corresponding filter. The <code>names</code> array must
+ * be the same length as the <code>extensions</code> array.
+ * </p>
+ *
+ * @param names the list of filter names, or null for no filter names
+ *
+ * @see #setFilterExtensions
+ */
+public void setFilterNames (String [] names) {
+    filterNames = names;
+}
+/**
+ * Sets the directory path that the dialog will use
+ * to the argument, which may be null. File names in this
+ * path will appear in the dialog, filtered according
+ * to the filter extensions. If the string is null,
+ * then the operating system's default filter path
+ * will be used.
+ * <p>
+ * Note that the path string is platform dependent.
+ * For convenience, either '/' or '\' can be used
+ * as a path separator.
+ * </p>
+ *
+ * @param string the directory path
+ *
+ * @see #setFilterExtensions
+ */
+public void setFilterPath (String string) {
+    filterPath = string;
+}
+
+/**
+ * Sets the flag that the dialog will use to
+ * determine whether to prompt the user for file
+ * overwrite if the selected file already exists.
+ *
+ * @param overwrite true if the dialog will prompt for file overwrite, false otherwise
+ *
+ * @since 3.4
+ */
+public void setOverwrite (bool overwrite) {
+    this.overwrite = overwrite;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/FontDialog.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,247 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.FontDialog;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.PaletteData;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Dialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Display;
+
+import java.lang.all;
+
+/**
+ * Instances of this class allow the user to select a font
+ * from all available fonts in the system.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>(none)</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ * 
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample, Dialog tab</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class FontDialog : Dialog {
+    FontData fontData;
+    RGB rgb;
+/**
+ * Constructs a new instance of this class given only its parent.
+ *
+ * @param parent a shell which will be the parent of the new instance
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ */
+public this (Shell parent) {
+    this (parent, SWT.APPLICATION_MODAL);
+}
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a shell which will be the parent of the new instance
+ * @param style the style of dialog to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ */
+public this (Shell parent, int style) {
+    super (parent, checkStyle (parent, style));
+    checkSubclass ();
+}
+
+/**
+ * Returns a FontData object describing the font that was
+ * selected in the dialog, or null if none is available.
+ *
+ * @return the FontData for the selected font, or null
+ * @deprecated use #getFontList ()
+ */
+public FontData getFontData () {
+    return fontData;
+}
+
+/**
+ * Returns a FontData set describing the font that was
+ * selected in the dialog, or null if none is available.
+ *
+ * @return the FontData for the selected font, or null
+ * @since 2.1.1
+ */
+public FontData [] getFontList () {
+    if (fontData is null) return null;
+    FontData [] result = new FontData [1];
+    result [0] = fontData;
+    return result;
+}
+
+/**
+ * Returns an RGB describing the color that was selected
+ * in the dialog, or null if none is available.
+ *
+ * @return the RGB value for the selected color, or null
+ *
+ * @see PaletteData#getRGBs
+ *
+ * @since 2.1
+ */
+public RGB getRGB () {
+    return rgb;
+}
+
+/**
+ * Makes the dialog visible and brings it to the front
+ * of the display.
+ *
+ * @return a FontData object describing the font that was selected,
+ *         or null if the dialog was cancelled or an error occurred
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the dialog has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the dialog</li>
+ * </ul>
+ */
+public FontData open () {
+    GtkWidget* handle;
+    char* titleBytes;
+    titleBytes = toStringz(title);
+    Display display = parent !is null ? parent.getDisplay (): Display.getCurrent ();
+    handle = OS.gtk_font_selection_dialog_new (titleBytes);
+    if (parent !is null) {
+        auto shellHandle = parent.topHandle ();
+        OS.gtk_window_set_transient_for(handle, shellHandle);
+        auto pixbufs = OS.gtk_window_get_icon_list (shellHandle);
+        if (pixbufs !is null) {
+            OS.gtk_window_set_icon_list (handle, pixbufs);
+            OS.g_list_free (pixbufs);
+        }
+    }
+    if (fontData !is null) {
+        Font font = new Font (display, fontData);
+        auto fontName = OS.pango_font_description_to_string (font.handle);
+        font.dispose();
+        OS.gtk_font_selection_dialog_set_font_name (handle, fontName);
+        OS.g_free (fontName);
+    }
+    display.addIdleProc ();
+    Dialog oldModal = null;
+    if (OS.gtk_window_get_modal (handle)) {
+        oldModal = display.getModalDialog ();
+        display.setModalDialog (this);
+    }
+    int signalId = 0;
+    int /*long*/ hookId = 0;
+    CallbackData emissionData;
+    emissionData.display = display;
+    emissionData.data = handle;
+    if ((style & SWT.RIGHT_TO_LEFT) !is 0) {
+        signalId = OS.g_signal_lookup (OS.map.ptr, OS.GTK_TYPE_WIDGET());
+        hookId = OS.g_signal_add_emission_hook (signalId, 0, &Display.emissionFunc, &emissionData, null);
+    }
+    int response = OS.gtk_dialog_run (handle);
+    if ((style & SWT.RIGHT_TO_LEFT) !is 0) {
+        OS.g_signal_remove_emission_hook (signalId, hookId);
+    }
+    if (OS.gtk_window_get_modal (handle)) {
+        display.setModalDialog (oldModal);
+    }
+    bool success = response is OS.GTK_RESPONSE_OK;
+    if (success) {
+        auto fontName = OS.gtk_font_selection_dialog_get_font_name (handle);
+        auto fontDesc = OS.pango_font_description_from_string (fontName);
+        OS.g_free (fontName);
+        Font font = Font.gtk_new (display, fontDesc);
+        fontData = font.getFontData () [0];
+        OS.pango_font_description_free (fontDesc);
+    }
+    display.removeIdleProc ();
+    OS.gtk_widget_destroy(handle);
+    if (!success) return null;
+    return fontData;
+}
+/**
+ * Sets a FontData object describing the font to be
+ * selected by default in the dialog, or null to let
+ * the platform choose one.
+ *
+ * @param fontData the FontData to use initially, or null
+ * @deprecated use #setFontList (FontData [])
+ */
+public void setFontData (FontData fontData) {
+    this.fontData = fontData;
+}
+
+/**
+ * Sets the set of FontData objects describing the font to
+ * be selected by default in the dialog, or null to let
+ * the platform choose one.
+ *
+ * @param fontData the set of FontData objects to use initially, or null
+ *        to let the platform select a default when open() is called
+ *
+ * @see Font#getFontData
+ *
+ * @since 2.1.1
+ */
+public void setFontList (FontData [] fontData) {
+    if (fontData !is null && fontData.length > 0) {
+        this.fontData = fontData [0];
+    } else {
+        this.fontData = null;
+    }
+}
+/**
+ * Sets the RGB describing the color to be selected by default
+ * in the dialog, or null to let the platform choose one.
+ *
+ * @param rgb the RGB value to use initially, or null to let
+ *        the platform select a default when open() is called
+ *
+ * @see PaletteData#getRGBs
+ *
+ * @since 2.1
+ */
+public void setRGB (RGB rgb) {
+    this.rgb = rgb;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Group.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,302 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Group;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+
+
+/**
+ * Instances of this class provide an etched border
+ * with an optional title.
+ * <p>
+ * Shadow styles are hints and may not be honoured
+ * by the platform.  To create a group with the
+ * default shadow style for the platform, do not
+ * specify a shadow style.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>SHADOW_ETCHED_IN, SHADOW_ETCHED_OUT, SHADOW_IN, SHADOW_OUT, SHADOW_NONE</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the above styles may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ * 
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class Group : Composite {
+
+    alias Composite.computeSize computeSize;
+    alias Composite.createHandle createHandle;
+    alias Composite.mnemonicHit mnemonicHit;
+    alias Composite.mnemonicMatch mnemonicMatch;
+    alias Composite.setBackgroundColor setBackgroundColor;
+    alias Composite.setForegroundColor setForegroundColor;
+
+    GtkWidget* clientHandle_, labelHandle;
+    String text = "";
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#SHADOW_ETCHED_IN
+ * @see SWT#SHADOW_ETCHED_OUT
+ * @see SWT#SHADOW_IN
+ * @see SWT#SHADOW_OUT
+ * @see SWT#SHADOW_NONE
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Composite parent, int style) {
+    super (parent, checkStyle (style));
+}
+
+static int checkStyle (int style) {
+    style |= SWT.NO_FOCUS;
+    /*
+    * Even though it is legal to create this widget
+    * with scroll bars, they serve no useful purpose
+    * because they do not automatically scroll the
+    * widget's client area.  The fix is to clear
+    * the SWT style.
+    */
+    return style & ~(SWT.H_SCROLL | SWT.V_SCROLL);
+}
+
+protected override void checkSubclass () {
+    if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+override GtkWidget* clientHandle () {
+    return clientHandle_;
+}
+
+public override Point computeSize (int wHint, int hHint, bool changed) {
+    Point size = super.computeSize(wHint, hHint, changed);
+    int width = computeNativeSize (handle, SWT.DEFAULT, SWT.DEFAULT, false).x;
+    size.x = Math.max (size.x, width);
+    return size;
+}
+public override Rectangle computeTrim (int x, int y, int width, int height) {
+    checkWidget();
+    forceResize ();
+    int clientX = OS.GTK_WIDGET_X (clientHandle_);
+    int clientY = OS.GTK_WIDGET_Y (clientHandle_);
+    x -= clientX;
+    y -= clientY;
+    width += clientX + clientX;
+    height += clientX + clientY;
+    return new Rectangle (x, y, width, height);
+}
+
+override void createHandle(int index) {
+    state |= HANDLE | THEME_BACKGROUND;
+    fixedHandle = cast(GtkWidget*)OS.g_object_new (display.gtk_fixed_get_type (), null);
+    if (fixedHandle is null) error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_fixed_set_has_window (cast(GtkFixed*)fixedHandle, true);
+    handle = OS.gtk_frame_new (null);
+    if (handle is null) error (SWT.ERROR_NO_HANDLES);
+    labelHandle = cast(GtkWidget*)OS.gtk_label_new (null);
+    if (labelHandle is null) error (SWT.ERROR_NO_HANDLES);
+    OS.g_object_ref (labelHandle);
+    OS.gtk_object_sink (cast(GtkObject*)labelHandle);
+    clientHandle_ = cast(GtkWidget*)OS.g_object_new (display.gtk_fixed_get_type (), null);
+    if (clientHandle_ is null) error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_container_add (cast(GtkContainer*)fixedHandle, handle);
+    OS.gtk_container_add (cast(GtkContainer*)handle, clientHandle_);
+    if ((style & SWT.SHADOW_IN) !is 0) {
+        OS.gtk_frame_set_shadow_type (cast(GtkFrame*)handle, OS.GTK_SHADOW_IN);
+    }
+    if ((style & SWT.SHADOW_OUT) !is 0) {
+        OS.gtk_frame_set_shadow_type (cast(GtkFrame*)handle, OS.GTK_SHADOW_OUT);
+    }
+    if ((style & SWT.SHADOW_ETCHED_IN) !is 0) {
+        OS.gtk_frame_set_shadow_type (cast(GtkFrame*)handle, OS.GTK_SHADOW_ETCHED_IN);
+    }
+    if ((style & SWT.SHADOW_ETCHED_OUT) !is 0) {
+        OS.gtk_frame_set_shadow_type (cast(GtkFrame*)handle, OS.GTK_SHADOW_ETCHED_OUT);
+    }
+}
+
+override void deregister () {
+    super.deregister ();
+    display.removeWidget (clientHandle_);
+    display.removeWidget (labelHandle);
+}
+
+override void enableWidget (bool enabled) {
+    OS.gtk_widget_set_sensitive (labelHandle, enabled);
+}
+
+override GtkWidget* eventHandle () {
+    return fixedHandle;
+}
+
+override String getNameText () {
+    return getText ();
+}
+
+/**
+ * Returns the receiver's text, which is the string that the
+ * is used as the <em>title</em>. If the text has not previously
+ * been set, returns an empty string.
+ *
+ * @return the text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getText () {
+    checkWidget();
+    return text;
+}
+
+override void hookEvents () {
+    super.hookEvents();
+    if (labelHandle !is null) {
+        OS.g_signal_connect_closure_by_id (labelHandle, display.signalIds [MNEMONIC_ACTIVATE], 0, display.closures [MNEMONIC_ACTIVATE], false);
+    }
+}
+
+override bool mnemonicHit (wchar key) {
+    if (labelHandle is null) return false;
+    bool result = super.mnemonicHit (labelHandle, key);
+    if (result) setFocus ();
+    return result;
+}
+
+override bool mnemonicMatch (wchar key) {
+    if (labelHandle is null) return false;
+    return mnemonicMatch (labelHandle, key);
+}
+
+override GtkWidget* parentingHandle() {
+    return fixedHandle;
+}
+
+override void register () {
+    super.register ();
+    display.addWidget (clientHandle_, this);
+    display.addWidget (labelHandle, this);
+}
+
+override void releaseHandle () {
+    super.releaseHandle ();
+    clientHandle_ = labelHandle = null;
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    if (labelHandle !is null) OS.g_object_unref (labelHandle);
+    text = null;
+}
+
+override void setBackgroundColor (GdkColor* color) {
+    super.setBackgroundColor (color);
+    setBackgroundColor(fixedHandle, color);
+}
+
+override void setFontDescription (PangoFontDescription* font) {
+    super.setFontDescription (font);
+    OS.gtk_widget_modify_font (labelHandle, font);
+}
+
+override void setForegroundColor (GdkColor* color) {
+    super.setForegroundColor (color);
+    setForegroundColor (labelHandle, color);
+}
+
+override void setOrientation () {
+    super.setOrientation ();
+    if ((style & SWT.RIGHT_TO_LEFT) !is 0) {
+        OS.gtk_widget_set_direction (labelHandle, OS.GTK_TEXT_DIR_RTL);
+    }
+}
+
+/**
+ * Sets the receiver's text, which is the string that will
+ * be displayed as the receiver's <em>title</em>, to the argument,
+ * which may not be null. The string may include the mnemonic character.
+ * </p>
+ * Mnemonics are indicated by an '&amp;' that causes the next
+ * character to be the mnemonic.  When the user presses a
+ * key sequence that matches the mnemonic, focus is assigned
+ * to the first child of the group. On most platforms, the
+ * mnemonic appears underlined but may be emphasised in a
+ * platform specific manner.  The mnemonic indicator character
+ * '&amp;' can be escaped by doubling it in the string, causing
+ * a single '&amp;' to be displayed.
+ * </p>
+ * @param string the new text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setText (String string) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    text = string;
+    char [] chars = fixMnemonic (string);
+    OS.gtk_label_set_text_with_mnemonic (cast(GtkLabel*)labelHandle, chars.toStringzValidPtr());
+    if (string.length !is 0) {
+        if (OS.gtk_frame_get_label_widget (cast(GtkFrame*)handle) is null) {
+            OS.gtk_frame_set_label_widget (cast(GtkFrame*)handle, labelHandle);
+        }
+    } else {
+        OS.gtk_frame_set_label_widget (cast(GtkFrame*)handle, null);
+    }
+}
+
+override void showWidget () {
+    super.showWidget ();
+    if (clientHandle_ !is null) OS.gtk_widget_show (clientHandle_);
+    if (labelHandle !is null) OS.gtk_widget_show (labelHandle);
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/IME.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,432 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+module org.eclipse.swt.widgets.IME;
+
+import java.lang.all;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.TextStyle;
+import org.eclipse.swt.internal.Converter;
+import org.eclipse.swt.internal.gtk.OS;
+
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Event;
+
+/**
+ * Instances of this class represent input method editors.
+ * These are typically in-line pre-edit text areas that allow
+ * the user to compose characters from Far Eastern languages
+ * such as Japanese, Chinese or Korean.
+ *
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>(none)</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>ImeComposition</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.4
+ */
+public class IME : Widget {
+    Canvas parent;
+    int caretOffset;
+    int startOffset;
+    int commitCount;
+    String text;
+    int [] ranges;
+    TextStyle [] styles;
+    bool inComposition;
+
+/**
+ * Prevents uninitialized instances from being created outside the package.
+ */
+this () {
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a canvas control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Canvas parent, int style) {
+    super (parent, style);
+    this.parent = parent;
+    createWidget ();
+}
+
+void createWidget () {
+    text = "";
+    startOffset = -1;
+    if (parent.getIME () is null) {
+        parent.setIME (this);
+    }
+}
+
+/**
+ * Returns the offset of the caret from the start of the document.
+ * The caret is within the current composition.
+ *
+ * @return the caret offset
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getCaretOffset () {
+    checkWidget ();
+    return startOffset + caretOffset;
+}
+
+/**
+ * Returns the commit count of the composition.  This is the
+ * number of characters that have been composed.  When the
+ * commit count is equal to the length of the composition
+ * text, then the in-line edit operation is complete.
+ *
+ * @return the commit count
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see IME#getText
+ */
+public int getCommitCount () {
+    checkWidget ();
+    return commitCount;
+}
+
+/**
+ * Returns the offset of the composition from the start of the document.
+ * This is the start offset of the composition within the document and
+ * in not changed by the input method editor itself during the in-line edit
+ * session.
+ *
+ * @return the offset of the composition
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getCompositionOffset () {
+    checkWidget ();
+    return startOffset;
+}
+
+/**
+ * Returns the ranges for the style that should be applied during the
+ * in-line edit session.
+ * <p>
+ * The ranges array contains start and end pairs.  Each pair refers to
+ * the corresponding style in the styles array.  For example, the pair
+ * that starts at ranges[n] and ends at ranges[n+1] uses the style
+ * at styles[n/2] returned by <code>getStyles()</code>.
+ * </p>
+ * @return the ranges for the styles
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see IME#getStyles
+ */
+public int [] getRanges () {
+    checkWidget ();
+    if (ranges is null) return new int [0];
+    int [] result = new int [ranges.length];
+    for (int i = 0; i < result.length; i++) {
+        result [i] = ranges [i] + startOffset;
+    }
+    return result;
+}
+
+/**
+ * Returns the styles for the ranges.
+ * <p>
+ * The ranges array contains start and end pairs.  Each pair refers to
+ * the corresponding style in the styles array.  For example, the pair
+ * that starts at ranges[n] and ends at ranges[n+1] uses the style
+ * at styles[n/2].
+ * </p>
+ *
+ * @return the ranges for the styles
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see IME#getRanges
+ */
+public TextStyle [] getStyles () {
+    checkWidget ();
+    if (styles is null) return new TextStyle [0];
+    TextStyle [] result = new TextStyle [styles.length];
+    System.arraycopy (styles, 0, result, 0, styles.length);
+    return result;
+}
+
+/**
+ * Returns the composition text.
+ * <p>
+ * The text for an IME is the characters in the widget that
+ * are in the current composition. When the commit count is
+ * equal to the length of the composition text, then the
+ * in-line edit operation is complete.
+ * </p>
+ *
+ * @return the widget text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getText () {
+    checkWidget ();
+    return text;
+}
+
+/**
+ * Returns <code>true</code> if the caret should be wide, and
+ * <code>false</code> otherwise.  In some languages, for example
+ * Korean, the caret is typically widened to the width of the
+ * current character in the in-line edit session.
+ *
+ * @return the wide caret state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool getWideCaret () {
+    checkWidget ();
+    return false;
+}
+
+override int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* event) {
+    if (!isInlineEnabled ()) return 0;
+    auto imHandle_ = imHandle ();
+    if (imHandle_ !is null) OS.gtk_im_context_reset (imHandle_);
+    return 0;
+}
+
+override int /*long*/ gtk_commit (GtkIMContext* imcontext, char* textPtr) {
+    if (!isInlineEnabled ()) return 0;
+    bool doit = true;
+    ranges = null;
+    styles = null;
+    caretOffset = commitCount = 0;
+    if (textPtr !is null && inComposition) {
+        int length = OS.strlen (textPtr);
+        if (length !is 0) {
+            char [] chars = fromStringz(textPtr).dup;
+            Event event = new Event();
+            event.detail = SWT.COMPOSITION_CHANGED;
+            event.start = startOffset;
+            event.end = startOffset + text.length;
+            event.text = text = chars !is null ? chars : "";
+            commitCount = text.length;
+            sendEvent (SWT.ImeComposition, event);
+            doit = event.doit;
+            text = "";
+            startOffset = -1;
+            commitCount = 0;
+        }
+    }
+    inComposition = false;
+    return doit ? 0 : 1;
+}
+
+override int /*long*/ gtk_preedit_changed (GtkIMContext* imcontext) {
+    if (!isInlineEnabled ()) return 0;
+    ranges = null;
+    styles = null;
+    commitCount = 0;
+    auto imHandle_ = imHandle ();
+    char* preeditString;
+    void* pangoAttrs;
+    int cursorPos;
+    OS.gtk_im_context_get_preedit_string (imHandle_, &preeditString, &pangoAttrs, &cursorPos);
+    caretOffset = cursorPos ;
+    char [] chars = null;
+    if (preeditString !is null) {
+        int length = OS.strlen (preeditString);
+        chars = fromStringz(preeditString).dup;
+        if (pangoAttrs !is null) {
+            int count = 0;
+            auto iterator = OS.pango_attr_list_get_iterator (pangoAttrs );
+            while (OS.pango_attr_iterator_next (iterator)) count++;
+            OS.pango_attr_iterator_destroy (iterator);
+            ranges = new int [count * 2];
+            styles = new TextStyle [count];
+            iterator = OS.pango_attr_list_get_iterator (pangoAttrs );
+            PangoAttrColor* attrColor;
+            PangoAttrInt* attrInt;
+            int start;
+            int end;
+            for (int i = 0; i < count; i++) {
+                OS.pango_attr_iterator_range (iterator, &start, &end);
+                ranges [i * 2] = cast(int)/*64*/OS.g_utf8_pointer_to_offset (preeditString, preeditString + start);
+                ranges [i * 2 + 1] = cast(int)/*64*/OS.g_utf8_pointer_to_offset (preeditString, preeditString + end) - 1;
+                styles [i] = new TextStyle (null, null, null);
+                auto attr = OS.pango_attr_iterator_get (iterator, OS.PANGO_ATTR_FOREGROUND);
+                if (attr !is null) {
+                    attrColor = cast(PangoAttrColor*) attr;
+                    GdkColor* color = new GdkColor ();
+                    color.red = attrColor.color.red;
+                    color.green = attrColor.color.green;
+                    color.blue = attrColor.color.blue;
+                    styles [i].foreground = Color.gtk_new (display, color);
+                }
+                attr = OS.pango_attr_iterator_get (iterator, OS.PANGO_ATTR_BACKGROUND);
+                if (attr !is null) {
+                    attrColor = cast(PangoAttrColor*) attr;
+                    GdkColor* color = new GdkColor ();
+                    color.red = attrColor.color.red;
+                    color.green = attrColor.color.green;
+                    color.blue = attrColor.color.blue;
+                    styles [i].background = Color.gtk_new (display, color);
+                }
+                attr = OS.pango_attr_iterator_get (iterator, OS.PANGO_ATTR_UNDERLINE);
+                if (attr !is null) {
+                    attrInt = cast(PangoAttrInt*) attr;
+                    styles [i].underline = attrInt.value !is OS.PANGO_UNDERLINE_NONE;;
+                    styles [i].underlineStyle = SWT.UNDERLINE_SINGLE;
+                    switch (attrInt.value) {
+                        case OS.PANGO_UNDERLINE_DOUBLE:
+                            styles [i].underlineStyle = SWT.UNDERLINE_DOUBLE;
+                            break;
+                        case OS.PANGO_UNDERLINE_ERROR:
+                            styles [i].underlineStyle = SWT.UNDERLINE_ERROR;
+                            break;
+                    }
+                    if (styles [i].underline) {
+                        attr = OS.pango_attr_iterator_get(iterator, OS.PANGO_ATTR_UNDERLINE_COLOR);
+                        if (attr !is null) {
+                            attrColor = cast(PangoAttrColor*) attr;
+                            GdkColor* color = new GdkColor;
+                            color.red = attrColor.color.red;
+                            color.green = attrColor.color.green;
+                            color.blue = attrColor.color.blue;
+                            styles [i].underlineColor = Color.gtk_new (display, color);
+                        }
+                    }
+                }
+                OS.pango_attr_iterator_next (iterator);
+            }
+            OS.pango_attr_iterator_destroy (iterator);
+            OS.pango_attr_list_unref (pangoAttrs);
+        }
+        OS.g_free (preeditString);
+    }
+    if (chars !is null) {
+        if (text.length is 0) startOffset = -1;
+        int end = startOffset + text.length;
+        if (startOffset is -1) {
+            Event event = new Event ();
+            event.detail = SWT.COMPOSITION_SELECTION;
+            sendEvent (SWT.ImeComposition, event);
+            startOffset = event.start;
+            end = event.end;
+        }
+        inComposition = true;
+        Event event = new Event ();
+        event.detail = SWT.COMPOSITION_CHANGED;
+        event.start = startOffset;
+        event.end = end;
+        event.text = text = chars !is null ? chars : "";
+        sendEvent (SWT.ImeComposition, event);
+    }
+    return 1;
+}
+
+GtkIMContext* imHandle () {
+    return parent.imHandle ();
+}
+
+bool isInlineEnabled () {
+    return hooks (SWT.ImeComposition);
+}
+
+void releaseParent () {
+    super.releaseParent ();
+    if (this is parent.getIME ()) parent.setIME (null);
+}
+
+void releaseWidget () {
+    super.releaseWidget ();
+    parent = null;
+    text = null;
+    styles = null;
+    ranges = null;
+}
+
+/**
+ * Sets the offset of the composition from the start of the document.
+ * This is the start offset of the composition within the document and
+ * in not changed by the input method editor itself during the in-line edit
+ * session but may need to be changed by clients of the IME.  For example,
+ * if during an in-line edit operation, a text editor inserts characters
+ * above the IME, then the IME must be informed that the composition
+ * offset has changed.
+ *
+ * @return the offset of the composition
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setCompositionOffset (int offset) {
+    checkWidget ();
+    if (offset < 0) return;
+    if (startOffset !is -1) {
+        startOffset = offset;
+    }
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/ImageList.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,158 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.ImageList;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+
+
+class ImageList {
+    GdkPixbuf* [] pixbufs;
+    int width = -1, height = -1;
+    Image [] images;
+
+public this() {
+    images = new Image [4];
+    pixbufs = new GdkPixbuf*[4];
+}
+
+public int add (Image image) {
+    int index = 0;
+    while (index < images.length) {
+        if (images [index] !is null) {
+            if (images [index].isDisposed ()) {
+                OS.g_object_unref (pixbufs [index]);
+                images [index] = null;
+                pixbufs [index] = null;
+            }
+        }
+        if (images [index] is null) break;
+        index++;
+    }
+    if (index is images.length) {
+        Image [] newImages = new Image [images.length + 4];
+        System.arraycopy (images, 0, newImages, 0, images.length);
+        images = newImages;
+        pixbufs.length = pixbufs.length + 4;
+    }
+    set (index, image);
+    return index;
+}
+
+public void dispose () {
+    if (pixbufs is null) return;
+    for (int index=0; index<pixbufs.length; index++) {
+        if (pixbufs [index] !is null) OS.g_object_unref (pixbufs [index]);
+    }
+    images = null;
+    pixbufs = null;
+}
+
+public Image get (int index) {
+    return images [index];
+}
+
+GdkPixbuf* getPixbuf (int index) {
+    return pixbufs [index];
+}
+
+public int indexOf (Image image) {
+    if (image is null) return -1;
+    for (int index=0; index<images.length; index++) {
+        if (image is images [index]) return index;
+    }
+    return -1;
+}
+
+int indexOf (GdkPixbuf* pixbuf) {
+    if (pixbuf is null) return -1;
+    for (int index=0; index<images.length; index++) {
+        if (pixbuf is pixbufs [index]) return index;
+    }
+    return -1;
+}
+
+public bool isDisposed () {
+    return images is null;
+}
+
+public void put (int index, Image image) {
+    int count = images.length;
+    if (!(0 <= index && index < count)) return;
+    if (image !is null) {
+        set (index, image);
+    } else {
+        images [index] = null;
+        if (pixbufs [index] !is null) OS.g_object_unref (pixbufs [index]);
+        pixbufs [index] = null;
+    }
+}
+
+public void remove (Image image) {
+    if (image is null) return;
+    for (int index=0; index<images.length; index++) {
+        if (image is images [index]){
+            OS.g_object_unref (pixbufs [index]);
+            images [index] = null;
+            pixbufs [index] = null;
+        }
+    }
+}
+
+void set (int index, Image image) {
+    int w, h;
+    OS.gdk_drawable_get_size (image.pixmap, &w, &h);
+    auto pixbuf = Display.createPixbuf (image);
+    if (width is -1 || height is -1) {
+        width = w;
+        height = h;
+    }
+    if (w !is width || h !is height) {
+        auto scaledPixbuf = OS.gdk_pixbuf_scale_simple(pixbuf, width, height, OS.GDK_INTERP_BILINEAR);
+        OS.g_object_unref (pixbuf);
+        pixbuf = scaledPixbuf;
+    }
+    auto oldPixbuf = pixbufs [index];
+    if (oldPixbuf !is null) {
+        if (images [index] is image) {
+            OS.gdk_pixbuf_copy_area (pixbuf, 0, 0, width, height, oldPixbuf, 0, 0);
+            OS.g_object_unref (pixbuf);
+            pixbuf = oldPixbuf;
+        } else {
+            OS.g_object_unref (oldPixbuf);
+        }
+    }
+    pixbufs [index] = pixbuf;
+    images [index] = image;
+}
+
+public int size () {
+    int result = 0;
+    for (int index=0; index<images.length; index++) {
+        if (images [index] !is null) {
+            if (images [index].isDisposed ()) {
+                OS.g_object_unref (pixbufs [index]);
+                images [index] = null;
+                pixbufs [index] = null;
+            }
+            if (images [index] !is null) result++;
+        }
+    }
+    return result;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Item.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,189 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Item;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * This class is the abstract superclass of all non-windowed
+ * user interface objects that occur within specific controls.
+ * For example, a tree will contain tree items.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>(none)</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ *
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+
+public abstract class Item : Widget {
+    String text;
+    Image image;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * The item is added to the end of the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a widget which will be the parent of the new instance (cannot be null)
+ * @param style the style of item to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#getStyle
+ */
+public this (Widget parent, int style) {
+    super (parent, style);
+    text = "";
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance,
+ * and the index at which to place it in the items maintained
+ * by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a widget which will be the parent of the new instance (cannot be null)
+ * @param style the style of item to construct
+ * @param index the zero-relative index at which to store the receiver in its parent
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the parent (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#getStyle
+ */
+public this (Widget parent, int style, int index) {
+    this (parent, style);
+}
+
+protected override void checkSubclass () {
+    /* Do Nothing - Subclassing is allowed */
+}
+
+/**
+ * Returns the receiver's image if it has one, or null
+ * if it does not.
+ *
+ * @return the receiver's image
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Image getImage () {
+    checkWidget ();
+    return image;
+}
+
+override String getNameText () {
+    return getText ();
+}
+
+/**
+ * Returns the receiver's text, which will be an empty
+ * string if it has never been set.
+ *
+ * @return the receiver's text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getText () {
+    checkWidget();
+    return text;
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    text = null;
+    image = null;
+}
+
+/**
+ * Sets the receiver's image to the argument, which may be
+ * null indicating that no image should be displayed.
+ *
+ * @param image the image to display on the receiver (may be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setImage (Image image) {
+    checkWidget ();
+    if (image !is null && image.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
+    this.image = image;
+}
+
+/**
+ * Sets the receiver's text.
+ *
+ * @param string the new text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setText (String string) {
+    checkWidget ();
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    text = string.dup;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Label.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,589 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Label;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.ImageList;
+
+import java.lang.all;
+
+/**
+ * Instances of this class represent a non-selectable
+ * user interface object that displays a string or image.
+ * When SEPARATOR is specified, displays a single
+ * vertical or horizontal line.
+ * <p>
+ * Shadow styles are hints and may not be honoured
+ * by the platform.  To create a separator label
+ * with the default shadow style for the platform,
+ * do not specify a shadow style.
+ * </p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>SEPARATOR, HORIZONTAL, VERTICAL</dd>
+ * <dd>SHADOW_IN, SHADOW_OUT, SHADOW_NONE</dd>
+ * <dd>CENTER, LEFT, RIGHT, WRAP</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of SHADOW_IN, SHADOW_OUT and SHADOW_NONE may be specified.
+ * SHADOW_NONE is a HINT. Only one of HORIZONTAL and VERTICAL may be specified.
+ * Only one of CENTER, LEFT and RIGHT may be specified.
+ * </p><p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#label">Label snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class Label : Control {
+
+    alias Control.computeSize computeSize;
+    alias Control.mnemonicHit mnemonicHit;
+    alias Control.mnemonicMatch mnemonicMatch;
+    alias Control.setBackgroundColor setBackgroundColor;
+    alias Control.setBounds setBounds;
+    alias Control.setForegroundColor setForegroundColor;
+
+    GtkWidget* frameHandle, labelHandle, imageHandle;
+    ImageList imageList;
+    Image image;
+    String text;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#SEPARATOR
+ * @see SWT#HORIZONTAL
+ * @see SWT#VERTICAL
+ * @see SWT#SHADOW_IN
+ * @see SWT#SHADOW_OUT
+ * @see SWT#SHADOW_NONE
+ * @see SWT#CENTER
+ * @see SWT#LEFT
+ * @see SWT#RIGHT
+ * @see SWT#WRAP
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Composite parent, int style) {
+    super (parent, checkStyle (style));
+}
+
+static int checkStyle (int style) {
+    style |= SWT.NO_FOCUS;
+    if ((style & SWT.SEPARATOR) !is 0) {
+        style = checkBits (style, SWT.VERTICAL, SWT.HORIZONTAL, 0, 0, 0, 0);
+        return checkBits (style, SWT.SHADOW_OUT, SWT.SHADOW_IN, SWT.SHADOW_NONE, 0, 0, 0);
+    }
+    return checkBits (style, SWT.LEFT, SWT.CENTER, SWT.RIGHT, 0, 0, 0);
+}
+
+override void addRelation (Control control) {
+    if (!control.isDescribedByLabel ()) return;
+    if (labelHandle is null) return;
+    auto accessible = OS.gtk_widget_get_accessible (labelHandle);
+    auto controlAccessible = OS.gtk_widget_get_accessible (control.handle);
+    if (accessible !is null && controlAccessible !is null) {
+        OS.atk_object_add_relationship (controlAccessible, OS.ATK_RELATION_LABELLED_BY, accessible);
+    }
+}
+
+public override Point computeSize (int wHint, int hHint, bool changed) {
+    checkWidget ();
+    if (wHint !is SWT.DEFAULT && wHint < 0) wHint = 0;
+    if (hHint !is SWT.DEFAULT && hHint < 0) hHint = 0;
+    if ((style & SWT.SEPARATOR) !is 0) {
+        if ((style & SWT.HORIZONTAL) !is 0) {
+            if (wHint is SWT.DEFAULT) wHint = DEFAULT_WIDTH;
+        } else {
+            if (hHint is SWT.DEFAULT) hHint = DEFAULT_HEIGHT;
+        }
+    }
+    bool fixWrap = labelHandle !is null && (style & SWT.WRAP) !is 0;
+    if (fixWrap || frameHandle !is null) forceResize ();
+    int labelWidth, labelHeight;
+    if (fixWrap) {
+        OS.gtk_widget_get_size_request (labelHandle, &labelWidth, &labelHeight);
+        OS.gtk_widget_set_size_request (labelHandle, wHint, hHint);
+    }
+    Point size;
+    if (frameHandle !is null) {
+        int reqWidth, reqHeight;
+        OS.gtk_widget_get_size_request (handle, &reqWidth, &reqHeight);
+        OS.gtk_widget_set_size_request (handle, wHint, hHint);
+        size = computeNativeSize (frameHandle, -1, -1, changed);
+        OS.gtk_widget_set_size_request (handle, reqWidth, reqHeight);
+    } else {
+        size = computeNativeSize (handle, wHint, hHint, changed);
+    }
+    if (fixWrap) {
+        OS.gtk_widget_set_size_request (labelHandle, labelWidth, labelHeight);
+    }
+    /*
+    * Feature in GTK.  Instead of using the font height to determine
+    * the preferred height of the widget, GTK uses the text metrics.
+    * The fix is to ensure that the preferred height is at least as
+    * tall as the font height.
+    *
+    * NOTE: This work around does not fix the case when there are
+    * muliple lines of text.
+    */
+    if (hHint is SWT.DEFAULT && labelHandle !is null) {
+        auto layout = OS.gtk_label_get_layout (cast(GtkLabel*)labelHandle);
+        auto context = OS.pango_layout_get_context (layout);
+        auto lang = OS.pango_context_get_language (context);
+        auto font = getFontDescription ();
+        auto metrics = OS.pango_context_get_metrics (context, font, lang);
+        int ascent = OS.PANGO_PIXELS (OS.pango_font_metrics_get_ascent (metrics));
+        int descent = OS.PANGO_PIXELS (OS.pango_font_metrics_get_descent (metrics));
+        OS.pango_font_metrics_unref (metrics);
+        int fontHeight = ascent + descent;
+        int  buffer;
+        OS.g_object_get1 (labelHandle, OS.ypad.ptr, &buffer);
+        fontHeight += 2 * buffer;
+        if (frameHandle !is null) {
+            auto style = OS.gtk_widget_get_style (frameHandle);
+            fontHeight += 2 * OS.gtk_style_get_ythickness (style);
+            fontHeight += 2 * OS.gtk_container_get_border_width (cast(GtkContainer*)frameHandle);
+        }
+        size.y = Math.max (size.y, fontHeight);
+    }
+    return size;
+}
+
+override void createHandle (int index) {
+    state |= HANDLE | THEME_BACKGROUND;
+    fixedHandle = cast(GtkWidget*)OS.g_object_new (display.gtk_fixed_get_type (), null);
+    if (fixedHandle is null) error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_fixed_set_has_window (cast(GtkFixed*)fixedHandle, true);
+    if ((style & SWT.SEPARATOR) !is 0) {
+        if ((style & SWT.HORIZONTAL)!is 0) {
+            handle = OS.gtk_hseparator_new ();
+        } else {
+            handle = OS.gtk_vseparator_new ();
+        }
+        if (handle is null) error (SWT.ERROR_NO_HANDLES);
+    } else {
+        handle = OS.gtk_hbox_new (false, 0);
+        if (handle is null) error (SWT.ERROR_NO_HANDLES);
+        labelHandle = OS.gtk_label_new_with_mnemonic (null);
+        if (labelHandle is null) error (SWT.ERROR_NO_HANDLES);
+        imageHandle = OS.gtk_image_new ();
+        if (imageHandle is null) error (SWT.ERROR_NO_HANDLES);
+        OS.gtk_container_add (cast(GtkContainer*)handle, labelHandle);
+        OS.gtk_container_add (cast(GtkContainer*)handle, imageHandle);
+    }
+    if ((style & SWT.BORDER) !is 0) {
+        frameHandle = OS.gtk_frame_new (null);
+        if (frameHandle is null) error (SWT.ERROR_NO_HANDLES);
+        OS.gtk_container_add (cast(GtkContainer*)fixedHandle, frameHandle);
+        OS.gtk_container_add (cast(GtkContainer*)frameHandle, handle);
+        OS.gtk_frame_set_shadow_type (cast(GtkFrame*)frameHandle, OS.GTK_SHADOW_ETCHED_IN);
+    } else {
+        OS.gtk_container_add (cast(GtkContainer*)fixedHandle, handle);
+    }
+    if ((style & SWT.SEPARATOR) !is 0) return;
+    if ((style & SWT.WRAP) !is 0) {
+        OS.gtk_label_set_line_wrap (labelHandle, true);
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 10, 0)) {
+            OS.gtk_label_set_line_wrap_mode (labelHandle, OS.PANGO_WRAP_WORD_CHAR);
+        }
+    }
+    setAlignment ();
+}
+
+override void createWidget (int index) {
+    super.createWidget (index);
+    text = "";
+}
+
+override void deregister () {
+    super.deregister ();
+    if (frameHandle !is null) display.removeWidget (frameHandle);
+    if (labelHandle !is null) display.removeWidget (labelHandle);
+    if (imageHandle !is null) display.removeWidget (imageHandle);
+}
+
+override GtkWidget* eventHandle () {
+    return fixedHandle;
+}
+
+/**
+ * Returns a value which describes the position of the
+ * text or image in the receiver. The value will be one of
+ * <code>LEFT</code>, <code>RIGHT</code> or <code>CENTER</code>
+ * unless the receiver is a <code>SEPARATOR</code> label, in
+ * which case, <code>NONE</code> is returned.
+ *
+ * @return the alignment
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getAlignment () {
+    checkWidget ();
+    if ((style & SWT.SEPARATOR) !is 0) return 0;
+    if ((style & SWT.LEFT) !is 0) return SWT.LEFT;
+    if ((style & SWT.CENTER) !is 0) return SWT.CENTER;
+    if ((style & SWT.RIGHT) !is 0) return SWT.RIGHT;
+    return SWT.LEFT;
+}
+
+public override int getBorderWidth () {
+    checkWidget();
+    if (frameHandle !is null) {
+        return OS.gtk_style_get_xthickness (OS.gtk_widget_get_style (frameHandle));
+    }
+    return 0;
+}
+
+/**
+ * Returns the receiver's image if it has one, or null
+ * if it does not.
+ *
+ * @return the receiver's image
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Image getImage () {
+    checkWidget ();
+    return image;
+}
+
+override String getNameText () {
+    return getText ();
+}
+
+/**
+ * Returns the receiver's text, which will be an empty
+ * string if it has never been set or if the receiver is
+ * a <code>SEPARATOR</code> label.
+ *
+ * @return the receiver's text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getText () {
+    checkWidget ();
+    if ((style & SWT.SEPARATOR) !is 0) return "";
+    return text;
+}
+
+override void hookEvents () {
+    super.hookEvents();
+    if (labelHandle !is null) {
+        OS.g_signal_connect_closure_by_id (labelHandle, display.signalIds [MNEMONIC_ACTIVATE], 0, display.closures [MNEMONIC_ACTIVATE], false);
+    }
+}
+
+override bool isDescribedByLabel () {
+    return false;
+}
+
+override bool mnemonicHit (wchar key) {
+    if (labelHandle is null) return false;
+    bool result = super.mnemonicHit (labelHandle, key);
+    if (result) {
+        Composite control = this.parent;
+        while (control !is null) {
+            Control [] children = control._getChildren ();
+            int index = 0;
+            while (index < children.length) {
+                if (children [index] is this) break;
+                index++;
+            }
+            index++;
+            if (index < children.length) {
+                if (children [index].setFocus ()) return result;
+            }
+            control = control.parent;
+        }
+    }
+    return result;
+}
+
+override bool mnemonicMatch (wchar key) {
+    if (labelHandle is null) return false;
+    return mnemonicMatch (labelHandle, key);
+}
+
+override void register () {
+    super.register ();
+    if (frameHandle !is null) display.addWidget (frameHandle, this);
+    if (labelHandle !is null) display.addWidget (labelHandle, this);
+    if (imageHandle !is null) display.addWidget (imageHandle, this);
+}
+
+override void releaseHandle () {
+    super.releaseHandle ();
+    frameHandle = imageHandle = labelHandle = null;
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    if (imageList !is null) imageList.dispose ();
+    imageList = null;
+    image = null;
+    text = null;
+}
+
+override void resizeHandle (int width, int height) {
+    OS.gtk_widget_set_size_request (fixedHandle, width, height);
+    OS.gtk_widget_set_size_request (frameHandle !is null ? frameHandle : handle, width, height);
+}
+
+/**
+ * Controls how text and images will be displayed in the receiver.
+ * The argument should be one of <code>LEFT</code>, <code>RIGHT</code>
+ * or <code>CENTER</code>.  If the receiver is a <code>SEPARATOR</code>
+ * label, the argument is ignored and the alignment is not changed.
+ *
+ * @param alignment the new alignment
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setAlignment (int alignment) {
+    checkWidget ();
+    if ((style & SWT.SEPARATOR) !is 0) return;
+    if ((alignment & (SWT.LEFT | SWT.RIGHT | SWT.CENTER)) is 0) return;
+    style &= ~(SWT.LEFT | SWT.RIGHT | SWT.CENTER);
+    style |= alignment & (SWT.LEFT | SWT.RIGHT | SWT.CENTER);
+    setAlignment ();
+}
+
+void setAlignment () {
+    bool isRTL = (style & SWT.RIGHT_TO_LEFT) !is 0;
+    if (text !is null && text.length !is 0) {
+        if (OS.GTK_VERSION >= OS.buildVERSION(2, 4, 0)) {
+            auto layout = OS.gtk_label_get_layout (labelHandle);
+            auto linePtr = OS.pango_layout_get_line (layout, 0);
+            int resolved_dir = OS.pango_layout_line_get_resolved_dir (linePtr);
+            if (resolved_dir is OS.PANGO_DIRECTION_RTL) {
+                isRTL = !isRTL;
+            }
+        }
+    }
+    if ((style & SWT.LEFT) !is 0) {
+        OS.gtk_misc_set_alignment (cast(GtkMisc*)labelHandle, 0.0f, 0.0f);
+        OS.gtk_label_set_justify (cast(GtkLabel*)labelHandle, isRTL ? OS.GTK_JUSTIFY_RIGHT : OS.GTK_JUSTIFY_LEFT);
+        OS.gtk_misc_set_alignment (cast(GtkMisc*)imageHandle, 0.0f, 0.5f);
+        return;
+    }
+    if ((style & SWT.CENTER) !is 0) {
+        OS.gtk_misc_set_alignment (cast(GtkMisc*)labelHandle, 0.5f, 0.0f);
+        OS.gtk_label_set_justify (cast(GtkLabel*)labelHandle, OS.GTK_JUSTIFY_CENTER);
+        OS.gtk_misc_set_alignment (cast(GtkMisc*)imageHandle, 0.5f, 0.5f);
+        return;
+    }
+    if ((style & SWT.RIGHT) !is 0) {
+        OS.gtk_misc_set_alignment (cast(GtkMisc*)labelHandle, 1.0f, 0.0f);
+        OS.gtk_label_set_justify (cast(GtkLabel*)labelHandle, isRTL ? OS.GTK_JUSTIFY_LEFT : OS.GTK_JUSTIFY_RIGHT);
+        OS.gtk_misc_set_alignment (cast(GtkMisc*)imageHandle, 1.0f, 0.5f);
+        return;
+    }
+}
+
+override void setBackgroundColor (GdkColor* color) {
+    super.setBackgroundColor (color);
+    setBackgroundColor(fixedHandle, color);
+    if (labelHandle !is null) setBackgroundColor(labelHandle, color);
+    if (imageHandle !is null) setBackgroundColor(imageHandle, color);
+}
+
+override int setBounds (int x, int y, int width, int height, bool move, bool resize) {
+    /*
+    * Bug in GTK.  For some reason, when the label is
+    * wrappable and its container is resized, it does not
+    * cause the label to be wrapped.  The fix is to
+    * determine the size that will wrap the label
+    * and expilictly set that size to force the label
+    * to wrap.
+    *
+    * This part of the fix causes the label to be
+    * resized to the preferred size but it still
+    * won't draw properly.
+    */
+    bool fixWrap = resize && labelHandle !is null && (style & SWT.WRAP) !is 0;
+    if (fixWrap) OS.gtk_widget_set_size_request (labelHandle, -1, -1);
+    int result = super.setBounds (x, y, width, height, move, resize);
+    /*
+    * Bug in GTK.  For some reason, when the label is
+    * wrappable and its container is resized, it does not
+    * cause the label to be wrapped.  The fix is to
+    * determine the size that will wrap the label
+    * and expilictly set that size to force the label
+    * to wrap.
+    *
+    * This part of the fix forces the label to be
+    * resized so that it will draw wrapped.
+    */
+    if (fixWrap) {
+        int labelWidth = OS.GTK_WIDGET_WIDTH (handle);
+        int labelHeight = OS.GTK_WIDGET_HEIGHT (handle);
+        OS.gtk_widget_set_size_request (labelHandle, labelWidth, labelHeight);
+        /*
+        * Bug in GTK.  Setting the size request should invalidate the label's
+        * layout, but it does not.  The fix is to resize the label directly.
+        */
+        GtkRequisition requisition;
+        OS.gtk_widget_size_request (labelHandle, &requisition);
+        GtkAllocation allocation;
+        allocation.x = OS.GTK_WIDGET_X (labelHandle);
+        allocation.y = OS.GTK_WIDGET_Y (labelHandle);
+        allocation.width = labelWidth;
+        allocation.height = labelHeight;
+        OS.gtk_widget_size_allocate (labelHandle, &allocation);
+    }
+    return result;
+}
+
+override void setFontDescription (PangoFontDescription* font) {
+    super.setFontDescription (font);
+    if (labelHandle !is null) OS.gtk_widget_modify_font (labelHandle, font);
+    if (imageHandle !is null) OS.gtk_widget_modify_font (imageHandle, font);
+}
+
+override void setForegroundColor (GdkColor* color) {
+    super.setForegroundColor (color);
+    setForegroundColor (fixedHandle, color);
+    if (labelHandle !is null) setForegroundColor (labelHandle, color);
+    if (imageHandle !is null) setForegroundColor (imageHandle, color);
+}
+
+override void setOrientation () {
+    super.setOrientation ();
+    if ((style & SWT.RIGHT_TO_LEFT) !is 0) {
+        if (labelHandle !is null) OS.gtk_widget_set_direction (labelHandle, OS.GTK_TEXT_DIR_RTL);
+        if (imageHandle !is null) OS.gtk_widget_set_direction (imageHandle, OS.GTK_TEXT_DIR_RTL);
+    }
+}
+
+/**
+ * Sets the receiver's image to the argument, which may be
+ * null indicating that no image should be displayed.
+ *
+ * @param image the image to display on the receiver (may be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setImage (Image image) {
+    checkWidget ();
+    if ((style & SWT.SEPARATOR) !is 0) return;
+    this.image = image;
+    if (imageList !is null) imageList.dispose ();
+    imageList = null;
+    if (image !is null) {
+        imageList = new ImageList ();
+        int imageIndex = imageList.add (image);
+        auto pixbuf = imageList.getPixbuf (imageIndex);
+        OS.gtk_image_set_from_pixbuf (cast(GtkImage*)imageHandle, pixbuf);
+        OS.gtk_widget_hide (labelHandle);
+        OS.gtk_widget_show (imageHandle);
+    } else {
+        OS.gtk_image_set_from_pixbuf (cast(GtkImage*)imageHandle, null);
+        OS.gtk_widget_show (labelHandle);
+        OS.gtk_widget_hide (imageHandle);
+    }
+}
+
+/**
+ * Sets the receiver's text.
+ * <p>
+ * This method sets the widget label.  The label may include
+ * the mnemonic character and line delimiters.
+ * </p>
+ * <p>
+ * Mnemonics are indicated by an '&amp;' that causes the next
+ * character to be the mnemonic.  When the user presses a
+ * key sequence that matches the mnemonic, focus is assigned
+ * to the control that follows the label. On most platforms,
+ * the mnemonic appears underlined but may be emphasised in a
+ * platform specific manner.  The mnemonic indicator character
+ * '&amp;' can be escaped by doubling it in the string, causing
+ * a single '&amp;' to be displayed.
+ * </p>
+ *
+ * @param string the new text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setText (String string) {
+    checkWidget ();
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if ((style & SWT.SEPARATOR) !is 0) return;
+    text = string;
+    char [] chars = fixMnemonic (string);
+    OS.gtk_label_set_text_with_mnemonic (cast(GtkLabel*)labelHandle, chars.toStringzValidPtr());
+    OS.gtk_widget_hide (imageHandle);
+    OS.gtk_widget_show (labelHandle);
+    setAlignment ();
+}
+
+override void showWidget () {
+    super.showWidget ();
+    if (frameHandle !is null) OS.gtk_widget_show (frameHandle);
+    if (labelHandle !is null) OS.gtk_widget_show (labelHandle);
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Layout.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Layout;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * A layout controls the position and size
+ * of the children of a composite widget.
+ * This class is the abstract base class for
+ * layouts.
+ *
+ * @see Composite#setLayout(Layout)
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public abstract class Layout {
+
+/**
+ * Computes and returns the size of the specified
+ * composite's client area according to this layout.
+ * <p>
+ * This method computes the size that the client area
+ * of the composite must be in order to position all
+ * children at their preferred size inside the
+ * composite according to the layout algorithm
+ * encoded by this layout.
+ * </p>
+ * <p>
+ * When a width or height hint is supplied, it is
+ * used to constrain the result. For example, if a
+ * width hint is provided that is less than the
+ * width of the client area, the layout may choose
+ * to wrap and increase height, clip, overlap, or
+ * otherwise constrain the children.
+ * </p>
+ *
+ * @param composite a composite widget using this layout
+ * @param wHint width (<code>SWT.DEFAULT</code> for preferred size)
+ * @param hHint height (<code>SWT.DEFAULT</code> for preferred size)
+ * @param flushCache <code>true</code> means flush cached layout values
+ * @return a point containing the computed size (width, height)
+ *
+ * @see #layout
+ * @see Control#getBorderWidth
+ * @see Control#getBounds
+ * @see Control#getSize
+ * @see Control#pack(boolean)
+ * @see "computeTrim, getClientArea for controls that implement them"
+ */
+abstract Point computeSize (Composite composite, int wHint, int hHint, bool flushCache);
+
+/**
+ * Instruct the layout to flush any cached values
+ * associated with the control specified in the argument
+ * <code>control</code>.
+ *
+ * @param control a control managed by this layout
+ * @return true if the Layout has flushed all cached information associated with control
+ *
+ * @since 3.1
+ */
+bool flushCache (Control control) {
+    return false;
+}
+
+/**
+ * Lays out the children of the specified composite
+ * according to this layout.
+ * <p>
+ * This method positions and sizes the children of a
+ * composite using the layout algorithm encoded by this
+ * layout. Children of the composite are positioned in
+ * the client area of the composite. The position of
+ * the composite is not altered by this method.
+ * </p>
+ * <p>
+ * When the flush cache hint is true, the layout is
+ * instructed to flush any cached values associated
+ * with the children. Typically, a layout will cache
+ * the preferred sizes of the children to avoid the
+ * expense of computing these values each time the
+ * widget is laid out.
+ * </p>
+ * <p>
+ * When layout is triggered explicitly by the programmer
+ * the flush cache hint is true. When layout is triggered
+ * by a resize, either caused by the programmer or by the
+ * user, the hint is false.
+ * </p>
+ *
+ * @param composite a composite widget using this layout
+ * @param flushCache <code>true</code> means flush cached layout values
+ */
+abstract void layout (Composite composite, bool flushCache);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Link.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,772 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Link;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.accessibility.ACC;
+import org.eclipse.swt.accessibility.Accessible;
+import org.eclipse.swt.accessibility.AccessibleAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlEvent;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.GCData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.TextLayout;
+import org.eclipse.swt.graphics.TextStyle;
+import org.eclipse.swt.internal.gtk.OS;
+
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.widgets.Event;
+import java.lang.all;
+
+import tango.text.Unicode;
+
+
+/**
+ * Instances of this class represent a selectable
+ * user interface object that displays a text with
+ * links.
+ * <p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>(none)</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#link">Link snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ * 
+ * @since 3.1
+ */
+public class Link : Control {
+
+    alias Control.computeSize computeSize;
+    alias Control.fixStyle fixStyle;
+    alias Control.setBounds setBounds;
+
+    String text;
+    TextLayout layout;
+    Color linkColor, disabledColor;
+    Point [] offsets;
+    Point selection;
+    String [] ids;
+    int [] mnemonics;
+    int focusIndex;
+
+    static RGB LINK_FOREGROUND;
+    static RGB LINK_DISABLED_FOREGROUND;
+
+    static void static_this(){
+        if( LINK_FOREGROUND is null ){
+            LINK_FOREGROUND = new RGB (0, 51, 153);
+        }
+        if( LINK_DISABLED_FOREGROUND is null ){
+            LINK_DISABLED_FOREGROUND = new RGB (172, 168, 153);
+        }
+    }
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Composite parent, int style) {
+    static_this();
+    super (parent, style);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the control is selected by the user, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * <code>widgetSelected</code> is called when the control is selected by the user.
+ * <code>widgetDefaultSelected</code> is not called.
+ * </p>
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener (SelectionListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Selection, typedListener);
+    addListener (SWT.DefaultSelection, typedListener);
+}
+
+public override Point computeSize (int wHint, int hHint, bool changed) {
+    checkWidget ();
+    if (wHint !is SWT.DEFAULT && wHint < 0) wHint = 0;
+    if (hHint !is SWT.DEFAULT && hHint < 0) hHint = 0;
+    int width, height;
+    int layoutWidth = layout.getWidth ();
+    //TEMPORARY CODE
+    if (wHint is 0) {
+        layout.setWidth (1);
+        Rectangle rect = layout.getBounds ();
+        width = 0;
+        height = rect.height;
+    } else {
+        layout.setWidth (wHint);
+        Rectangle rect = layout.getBounds ();
+        width = rect.width;
+        height = rect.height;
+    }
+    layout.setWidth (layoutWidth);
+    if (wHint !is SWT.DEFAULT) width = wHint;
+    if (hHint !is SWT.DEFAULT) height = hHint;
+    int border = getBorderWidth ();
+    width += border * 2;
+    height += border * 2;
+    return new Point (width, height);
+}
+
+override void createHandle(int index) {
+    state |= HANDLE | THEME_BACKGROUND;
+    handle = cast(GtkWidget*)OS.g_object_new (display.gtk_fixed_get_type (), null);
+    if (handle is null) SWT.error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_fixed_set_has_window (handle, true);
+    OS.GTK_WIDGET_SET_FLAGS (handle, OS.GTK_CAN_FOCUS);
+    layout = new TextLayout (display);
+    layout.setOrientation((style & SWT.RIGHT_TO_LEFT) !is 0? SWT.RIGHT_TO_LEFT : SWT.LEFT_TO_RIGHT);
+    linkColor = new Color (display, LINK_FOREGROUND);
+    disabledColor = new Color (display, LINK_DISABLED_FOREGROUND);
+    offsets = null;
+    ids = null;
+    mnemonics = null;
+    selection = new Point (-1, -1);
+    focusIndex = -1;
+}
+
+override void createWidget (int index) {
+    super.createWidget (index);
+    layout.setFont (getFont ());
+    text = "";
+    initAccessible ();
+}
+
+override void enableWidget (bool enabled) {
+    super.enableWidget (enabled);
+    if (isDisposed ()) return;
+    TextStyle linkStyle = new TextStyle (null, enabled ? linkColor : disabledColor, null);
+    linkStyle.underline = true;
+    for (int i = 0; i < offsets.length; i++) {
+        Point point = offsets [i];
+        layout.setStyle (linkStyle, point.x, point.y);
+    }
+    redraw ();
+}
+
+override void fixStyle () {
+    fixStyle (handle);
+}
+
+void initAccessible () {
+    Accessible accessible = getAccessible ();
+    accessible.addAccessibleListener (new class () AccessibleAdapter {
+        public void getName (AccessibleEvent e) {
+            e.result = parse (text);
+        }
+    });
+
+    accessible.addAccessibleControlListener (new class () AccessibleControlAdapter {
+        public void getChildAtPoint (AccessibleControlEvent e) {
+            e.childID = ACC.CHILDID_SELF;
+        }
+
+        public void getLocation (AccessibleControlEvent e) {
+            Rectangle rect = display.map (getParent (), null, getBounds ());
+            e.x = rect.x;
+            e.y = rect.y;
+            e.width = rect.width;
+            e.height = rect.height;
+        }
+
+        public void getChildCount (AccessibleControlEvent e) {
+            e.detail = 0;
+        }
+
+        public void getRole (AccessibleControlEvent e) {
+            e.detail = ACC.ROLE_LINK;
+        }
+
+        public void getState (AccessibleControlEvent e) {
+            e.detail = ACC.STATE_FOCUSABLE;
+            if (hasFocus ()) e.detail |= ACC.STATE_FOCUSED;
+        }
+
+        public void getDefaultAction (AccessibleControlEvent e) {
+            e.result = SWT.getMessage ("SWT_Press"); //$NON-NLS-1$
+        }
+
+        public void getSelection (AccessibleControlEvent e) {
+            if (hasFocus ()) e.childID = ACC.CHILDID_SELF;
+        }
+
+        public void getFocus (AccessibleControlEvent e) {
+            if (hasFocus ()) e.childID = ACC.CHILDID_SELF;
+        }
+    });
+}
+
+override String getNameText () {
+    return getText ();
+}
+
+Rectangle [] getRectangles (int linkIndex) {
+    int lineCount = layout.getLineCount ();
+    Rectangle [] rects = new Rectangle [lineCount];
+    int [] lineOffsets = layout.getLineOffsets ();
+    Point point = offsets [linkIndex];
+    int lineStart = 1;
+    while (point.x > lineOffsets [lineStart]) lineStart++;
+    int lineEnd = 1;
+    while (point.y > lineOffsets [lineEnd]) lineEnd++;
+    int index = 0;
+    if (lineStart is lineEnd) {
+        rects [index++] = layout.getBounds (point.x, point.y);
+    } else {
+        rects [index++] = layout.getBounds (point.x, lineOffsets [lineStart]-1);
+        rects [index++] = layout.getBounds (lineOffsets [lineEnd-1], point.y);
+        if (lineEnd - lineStart > 1) {
+            for (int i = lineStart; i < lineEnd - 1; i++) {
+                rects [index++] = layout.getLineBounds (i);
+            }
+        }
+    }
+    if (rects.length !is index) {
+        Rectangle [] tmp = new Rectangle [index];
+        System.arraycopy (rects, 0, tmp, 0, index);
+        rects = tmp;
+    }
+    return rects;
+}
+
+int getClientWidth () {
+    return (state & ZERO_WIDTH) !is 0 ? 0 : OS.GTK_WIDGET_WIDTH (handle);
+}
+
+/**
+ * Returns the receiver's text, which will be an empty
+ * string if it has never been set.
+ *
+ * @return the receiver's text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getText () {
+    checkWidget ();
+    return text;
+}
+
+override int gtk_button_press_event (GtkWidget* widget, GdkEventButton* gdkEvent) {
+    int /*long*/ result = super.gtk_button_press_event (widget, gdkEvent);
+    if (result !is 0) return result;
+    if (gdkEvent.button is 1 && gdkEvent.type is OS.GDK_BUTTON_PRESS) {
+        if (focusIndex !is -1) setFocus ();
+        int x = cast(int) gdkEvent.x;
+        int y = cast(int) gdkEvent.y;
+        if ((style & SWT.MIRRORED) !is 0) x = getClientWidth () - x;
+        int offset = layout.getOffset (x, y, null);
+        int oldSelectionX = selection.x;
+        int oldSelectionY = selection.y;
+        selection.x = offset;
+        selection.y = -1;
+        if (oldSelectionX !is -1 && oldSelectionY !is -1) {
+            if (oldSelectionX > oldSelectionY) {
+                int temp = oldSelectionX;
+                oldSelectionX = oldSelectionY;
+                oldSelectionY = temp;
+            }
+            Rectangle rect = layout.getBounds (oldSelectionX, oldSelectionY);
+            redraw (rect.x, rect.y, rect.width, rect.height, false);
+        }
+        for (int j = 0; j < offsets.length; j++) {
+            Rectangle [] rects = getRectangles (j);
+            for (int i = 0; i < rects.length; i++) {
+                Rectangle rect = rects [i];
+                if (rect.contains (x, y)) {
+                    focusIndex = j;
+                    redraw ();
+                    return result;
+                }
+            }
+        }
+    }
+    return result;
+}
+
+override int /*long*/ gtk_button_release_event (GtkWidget* widget, GdkEventButton* gdkEvent) {
+    int /*long*/ result = super.gtk_button_release_event (widget, gdkEvent);
+    if (result !is 0) return result;
+    if (focusIndex is -1) return result;
+    if (gdkEvent.button is 1) {
+        int x = cast(int) gdkEvent.x;
+        int y = cast(int) gdkEvent.y;
+        if ((style & SWT.MIRRORED) !is 0) x = getClientWidth () - x;
+        Rectangle [] rects = getRectangles (focusIndex);
+        for (int i = 0; i < rects.length; i++) {
+            Rectangle rect = rects [i];
+            if (rect.contains (x, y)) {
+                Event ev = new Event ();
+                ev.text = ids [focusIndex];
+                sendEvent (SWT.Selection, ev);
+                return result;
+            }
+        }
+    }
+    return result;
+}
+
+override int /*long*/ gtk_event_after (GtkWidget* widget, GdkEvent* event) {
+    int /*long*/ result = super.gtk_event_after (widget, event);
+    switch (event.type) {
+        case OS.GDK_FOCUS_CHANGE:
+            redraw ();
+            break;
+        default:
+    }
+    return result;
+}
+
+override int /*long*/ gtk_expose_event (GtkWidget* widget, GdkEventExpose* gdkEvent) {
+    if ((state & OBSCURED) !is 0) return 0;
+    GCData data = new GCData ();
+    data.damageRgn = gdkEvent.region;
+    GC gc = GC.gtk_new (this, data);
+    OS.gdk_gc_set_clip_region (gc.handle, gdkEvent.region);
+    int selStart = selection.x;
+    int selEnd = selection.y;
+    if (selStart > selEnd) {
+        selStart = selection.y;
+        selEnd = selection.x;
+    }
+    // temporary code to disable text selection
+    selStart = selEnd = -1;
+    if ((state & DISABLED) !is 0) gc.setForeground (disabledColor);
+    layout.draw (gc, 0, 0, selStart, selEnd, null, null);
+    if (hasFocus () && focusIndex !is -1) {
+        Rectangle [] rects = getRectangles (focusIndex);
+        for (int i = 0; i < rects.length; i++) {
+            Rectangle rect = rects [i];
+            gc.drawFocus (rect.x, rect.y, rect.width, rect.height);
+        }
+    }
+    if (hooks (SWT.Paint) || filters (SWT.Paint)) {
+        Event event = new Event ();
+        event.count = gdkEvent.count;
+        event.x = gdkEvent.area.x;
+        event.y = gdkEvent.area.y;
+        event.width = gdkEvent.area.width;
+        event.height = gdkEvent.area.height;
+        if ((style & SWT.MIRRORED) !is 0) event.x = getClientWidth () - event.width - event.x;
+        event.gc = gc;
+        sendEvent (SWT.Paint, event);
+        event.gc = null;
+    }
+    gc.dispose ();
+    return 0;
+}
+
+override int /*long*/ gtk_key_press_event (GtkWidget* widget, GdkEventKey* gdkEvent) {
+    int /*long*/ result = super.gtk_key_press_event (widget, gdkEvent);
+    if (result !is 0) return result;
+    if (focusIndex is -1) return result;
+    switch (gdkEvent.keyval) {
+        case OS.GDK_Return:
+        case OS.GDK_KP_Enter:
+        case OS.GDK_space:
+            Event event = new Event ();
+            event.text = ids [focusIndex];
+            sendEvent (SWT.Selection, event);
+            break;
+        case OS.GDK_Tab:
+            if (focusIndex < offsets.length - 1) {
+                focusIndex++;
+                redraw ();
+            }
+            break;
+        case OS.GDK_ISO_Left_Tab:
+            if (focusIndex > 0) {
+                focusIndex--;
+                redraw ();
+            }
+            break;
+        default:
+    }
+    return result;
+}
+
+override int /*long*/ gtk_motion_notify_event (GtkWidget* widget, GdkEventMotion* gdkEvent) {
+    int /*long*/ result = super.gtk_motion_notify_event (widget, gdkEvent);
+    if (result !is 0) return result;
+    int x = cast(int) gdkEvent.x;
+    int y = cast(int) gdkEvent.y;
+    if ((style & SWT.MIRRORED) !is 0) x = getClientWidth () - x;
+    if ((gdkEvent.state & OS.GDK_BUTTON1_MASK) !is 0) {
+        int oldSelection = selection.y;
+        selection.y = layout.getOffset (x, y, null);
+        if (selection.y !is oldSelection) {
+            int newSelection = selection.y;
+            if (oldSelection > newSelection) {
+                int temp = oldSelection;
+                oldSelection = newSelection;
+                newSelection = temp;
+            }
+            Rectangle rect = layout.getBounds (oldSelection, newSelection);
+            redraw (rect.x, rect.y, rect.width, rect.height, false);
+        }
+    } else {
+        for (int j = 0; j < offsets.length; j++) {
+            Rectangle [] rects = getRectangles (j);
+            for (int i = 0; i < rects.length; i++) {
+                Rectangle rect = rects [i];
+                if (rect.contains (x, y)) {
+                    setCursor (display.getSystemCursor (SWT.CURSOR_HAND));
+                    return result;
+                }
+            }
+        }
+        setCursor (null);
+    }
+    return result;
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    if (layout !is null) layout.dispose ();
+    layout = null;
+    if (linkColor !is null)  linkColor.dispose ();
+    linkColor = null;
+    if (disabledColor !is null) disabledColor.dispose ();
+    disabledColor = null;
+    offsets = null;
+    ids = null;
+    mnemonics = null;
+    text = null;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is selected by the user.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener (SelectionListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Selection, listener);
+    eventTable.unhook (SWT.DefaultSelection, listener);
+}
+
+String parse (String string) {
+    int length_ = string.length;
+    offsets = new Point[]( length_ / 4 );
+    ids = new String[]( length_ / 4 );
+    mnemonics = new int[] ( length_ / 4 + 1 );
+    StringBuffer result = new StringBuffer ();
+    char [] buffer = string.dup;
+
+    int index = 0, state = 0, linkIndex = 0;
+    int start = 0, tagStart = 0, linkStart = 0, endtagStart = 0, refStart = 0;
+    while (index < length_) {
+        int increment;
+        dchar c = CharacterFirstToLower (buffer [index .. $ ], increment );
+
+        switch (state) {
+            case 0:
+                if (c is '<') {
+                    tagStart = index;
+                    state++;
+                }
+                break;
+            case 1:
+                if (c is 'a') state++;
+                break;
+            case 2:
+                switch (c) {
+                    case 'h':
+                        state = 7;
+                        break;
+                    case '>':
+                        linkStart = index  + 1;
+                        state++;
+                        break;
+                    default:
+                        if (tango.text.Unicode.isWhitespace(c)) break;
+                        else state = 13;
+                }
+                break;
+            case 3:
+                if (c is '<') {
+                    endtagStart = index;
+                    state++;
+                }
+                break;
+            case 4:
+                state = c is '/' ? state + 1 : 3;
+                break;
+            case 5:
+                state = c is 'a' ? state + 1 : 3;
+                break;
+            case 6:
+                if (c is '>') {
+                    mnemonics [linkIndex] = parseMnemonics (buffer, start, tagStart, result);
+                    int offset = result.length ();
+                    parseMnemonics (buffer, linkStart, endtagStart, result);
+                    offsets [linkIndex] = new Point (offset, result.length () - 1);
+                    if (ids [linkIndex] is null) {
+                        ids [linkIndex] = buffer[ linkStart .. endtagStart ].dup;
+                    }
+                    linkIndex++;
+                    start = tagStart = linkStart = endtagStart = refStart = index + 1;
+                    state = 0;
+                } else {
+                    state = 3;
+                }
+                break;
+            case 7:
+                state = c is 'r' ? state + 1 : 0;
+                break;
+            case 8:
+                state = c is 'e' ? state + 1 : 0;
+                break;
+            case 9:
+                state = c is 'f' ? state + 1 : 0;
+                break;
+            case 10:
+                state = c is '=' ? state + 1 : 0;
+                break;
+            case 11:
+                if (c is '"') {
+                    state++;
+                    refStart = index + 1;
+                } else {
+                    state = 0;
+                }
+                break;
+            case 12:
+                if (c is '"') {
+                    ids[linkIndex] = buffer[ refStart .. index ].dup;
+                    state = 2;
+                }
+                break;
+            case 13:
+                if (tango.text.Unicode.isWhitespace (c)) {
+                    state = 0;
+                } else if (c is '='){
+                    state++;
+                }
+                break;
+            case 14:
+                state = c is '"' ? state + 1 : 0;
+                break;
+            case 15:
+                if (c is '"') state = 2;
+                break;
+            default:
+                state = 0;
+                break;
+        }
+        index+=increment;
+    }
+    if (start < length_) {
+        int tmp = parseMnemonics (buffer, start, tagStart, result);
+        int mnemonic = parseMnemonics (buffer, Math.max (tagStart, linkStart), length_, result);
+        if (mnemonic is -1) mnemonic = tmp;
+        mnemonics [linkIndex] = mnemonic;
+    } else {
+        mnemonics [linkIndex] = -1;
+    }
+    if (offsets.length !is linkIndex) {
+        Point [] newOffsets = new Point [linkIndex];
+        System.arraycopy (offsets, 0, newOffsets, 0, linkIndex);
+        offsets = newOffsets;
+        String [] newIDs = new String [linkIndex];
+        System.arraycopy (ids, 0, newIDs, 0, linkIndex);
+        ids = newIDs;
+        int [] newMnemonics = new int [linkIndex + 1];
+        System.arraycopy (mnemonics, 0, newMnemonics, 0, linkIndex + 1);
+        mnemonics = newMnemonics;
+    }
+    return result.toString ();
+}
+
+int parseMnemonics (char[] buffer, int start, int end, StringBuffer result) {
+    int mnemonic = -1, index = start;
+    while (index < end) {
+        int incr = 1;
+        if ( buffer[index] is '&') {
+            if (index + 1 < end && buffer [index + 1] is '&') {
+                result.append (buffer [index]);
+                index++;
+            } else {
+                mnemonic = result.length();
+            }
+        } else {
+            result.append ( firstCodePointStr( buffer [index .. $ ], incr ));
+        }
+        index+=incr;
+    }
+    return mnemonic;
+}
+
+override int setBounds(int x, int y, int width, int height, bool move, bool resize) {
+    int result = super.setBounds (x, y, width,height, move, resize);
+    if ((result & RESIZED) !is 0) {
+        layout.setWidth (width > 0 ? width : -1);
+        redraw ();
+    }
+    return result;
+}
+
+override void setFontDescription (PangoFontDescription* font) {
+    super.setFontDescription (font);
+    layout.setFont (Font.gtk_new (display, font));
+}
+
+/**
+ * Sets the receiver's text.
+ * <p>
+ * The string can contain both regular text and hyperlinks.  A hyperlink
+ * is delimited by an anchor tag, &lt;A&gt; and &lt;/A&gt;.  Within an
+ * anchor, a single HREF attribute is supported.  When a hyperlink is
+ * selected, the text field of the selection event contains either the
+ * text of the hyperlink or the value of its HREF, if one was specified.
+ * In the rare case of identical hyperlinks within the same string, the
+ * HREF tag can be used to distinguish between them.  The string may
+ * include the mnemonic character and line delimiters.
+ * </p>
+ *
+ * @param string the new text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setText (String string) {
+    checkWidget ();
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (string.equals(text)) return;
+    text = string;
+    layout.setText (parse (string));
+    focusIndex = offsets.length > 0 ? 0 : -1;
+    selection.x = selection.y = -1;
+    bool enabled = (state & DISABLED) is 0;
+    TextStyle linkStyle = new TextStyle (null, enabled ? linkColor : disabledColor, null);
+    linkStyle.underline = true;
+    int [] bidiSegments = new int [offsets.length*2];
+    for (int i = 0; i < offsets.length; i++) {
+        Point point = offsets [i];
+        layout.setStyle (linkStyle, point.x, point.y);
+        bidiSegments[i*2] = point.x;
+        bidiSegments[i*2+1] = point.y+1;
+    }
+    layout.setSegments (bidiSegments);
+    TextStyle mnemonicStyle = new TextStyle (null, null, null);
+    mnemonicStyle.underline = true;
+    for (int i = 0; i < mnemonics.length; i++) {
+        int mnemonic  = mnemonics [i];
+        if (mnemonic !is -1) {
+            layout.setStyle (mnemonicStyle, mnemonic, mnemonic);
+        }
+    }
+    redraw ();
+}
+
+override void showWidget () {
+    super.showWidget ();
+    fixStyle (handle);
+}
+
+override int traversalCode (int key, GdkEventKey* event) {
+    if (offsets.length is 0) return 0;
+    int bits = super.traversalCode (key, event);
+    if (key is OS.GDK_Tab && focusIndex < offsets.length - 1) {
+        return bits & ~SWT.TRAVERSE_TAB_NEXT;
+    }
+    if (key is OS.GDK_ISO_Left_Tab && focusIndex > 0) {
+        return bits & ~SWT.TRAVERSE_TAB_PREVIOUS;
+    }
+    return bits;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/List.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,1562 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.List;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Scrollable;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.widgets.Display;
+import java.lang.all;
+
+import tango.text.convert.Integer;
+
+/**
+ * Instances of this class represent a selectable user interface
+ * object that displays a list of strings and issues notification
+ * when a string is selected.  A list may be single or multi select.
+ * <p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>SINGLE, MULTI</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection, DefaultSelection</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of SINGLE and MULTI may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#list">List snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class List : Scrollable {
+
+    alias Scrollable.computeSize computeSize;
+    alias Scrollable.dragDetect dragDetect;
+    alias Scrollable.setBackgroundColor setBackgroundColor;
+    alias Scrollable.setBounds setBounds;
+
+    GtkWidget* modelHandle;
+
+    static final int TEXT_COLUMN = 0;
+    CallbackData treeSelectionProcCallbackData;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#SINGLE
+ * @see SWT#MULTI
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Composite parent, int style) {
+    super (parent, checkStyle (style));
+}
+
+/**
+ * Adds the argument to the end of the receiver's list.
+ *
+ * @param string the new item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #add(String,int)
+ */
+public void add (String string) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    char* buffer = string.toStringzValidPtr();
+    GtkTreeIter iter;
+    OS.gtk_list_store_append (cast(GtkListStore*)modelHandle, &iter);
+    OS.gtk_list_store_set1 (cast(GtkListStore*)modelHandle, &iter, TEXT_COLUMN, buffer);
+}
+
+/**
+ * Adds the argument to the receiver's list at the given
+ * zero-relative index.
+ * <p>
+ * Note: To add an item at the end of the list, use the
+ * result of calling <code>getItemCount()</code> as the
+ * index or use <code>add(String)</code>.
+ * </p>
+ *
+ * @param string the new item
+ * @param index the index for the item
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #add(String)
+ */
+public void add (String string, int index) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    int count = OS.gtk_tree_model_iter_n_children (cast(GtkTreeStore*)modelHandle, null);
+    if (!(0 <= index && index <= count)) {
+        error (SWT.ERROR_INVALID_RANGE);
+    }
+    char* buffer = string.toStringzValidPtr();
+    GtkTreeIter iter;
+    /*
+    * Feature in GTK.  It is much faster to append to a list store
+    * than to insert at the end using gtk_list_store_insert().
+    */
+    if (index is count) {
+        OS.gtk_list_store_append (cast(GtkListStore*)modelHandle, &iter);
+    } else {
+        OS.gtk_list_store_insert (cast(GtkListStore*)modelHandle, &iter, index);
+    }
+    OS.gtk_list_store_set1 (cast(GtkListStore*)modelHandle, &iter, TEXT_COLUMN, buffer);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the user changes the receiver's selection, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * <code>widgetSelected</code> is called when the selection changes.
+ * <code>widgetDefaultSelected</code> is typically called when an item is double-clicked.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the user changes the receiver's selection
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener(SelectionListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Selection,typedListener);
+    addListener (SWT.DefaultSelection,typedListener);
+}
+
+static int checkStyle (int style) {
+    return checkBits (style, SWT.SINGLE, SWT.MULTI, 0, 0, 0, 0);
+}
+
+override void createHandle (int index) {
+    state |= HANDLE;
+    fixedHandle = cast(GtkWidget*)OS.g_object_new (display.gtk_fixed_get_type (), null);
+    if (fixedHandle is null) error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_fixed_set_has_window (cast(GtkFixed*)fixedHandle, true);
+    scrolledHandle = cast(GtkWidget*)OS.gtk_scrolled_window_new (null, null);
+    if (scrolledHandle is null) error (SWT.ERROR_NO_HANDLES);
+    /*
+    * Columns:
+    * 0 - text
+    */
+    auto types = [OS.G_TYPE_STRING ()];
+    modelHandle = cast(GtkWidget*)OS.gtk_list_store_newv (types.length, cast(uint*)types.ptr);
+    if (modelHandle is null) error (SWT.ERROR_NO_HANDLES);
+    handle = OS.gtk_tree_view_new_with_model (modelHandle);
+    if (handle is null) error (SWT.ERROR_NO_HANDLES);
+    auto textRenderer = OS.gtk_cell_renderer_text_new ();
+    if (textRenderer is null) error (SWT.ERROR_NO_HANDLES);
+    auto columnHandle = OS.gtk_tree_view_column_new ();
+    if (columnHandle is null) error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_tree_view_column_pack_start (cast(GtkTreeViewColumn*)columnHandle, textRenderer, true);
+    OS.gtk_tree_view_column_add_attribute (cast(GtkTreeViewColumn*)columnHandle, textRenderer, OS.text.ptr, TEXT_COLUMN);
+    OS.gtk_tree_view_insert_column (cast(GtkTreeView*)handle, columnHandle, index);
+    OS.gtk_container_add (cast(GtkContainer*)fixedHandle, scrolledHandle);
+    OS.gtk_container_add (cast(GtkContainer*)scrolledHandle, handle);
+
+    int mode = (style & SWT.MULTI) !is 0 ? OS.GTK_SELECTION_MULTIPLE : OS.GTK_SELECTION_BROWSE;
+    auto selectionHandle = OS.gtk_tree_view_get_selection (cast(GtkTreeView*)handle);
+    OS.gtk_tree_selection_set_mode (selectionHandle, mode);
+    OS.gtk_tree_view_set_headers_visible (cast(GtkTreeView*)handle, false);
+    int hsp = (style & SWT.H_SCROLL) !is 0 ? OS.GTK_POLICY_AUTOMATIC : OS.GTK_POLICY_NEVER;
+    int vsp = (style & SWT.V_SCROLL) !is 0 ? OS.GTK_POLICY_AUTOMATIC : OS.GTK_POLICY_NEVER;
+    OS.gtk_scrolled_window_set_policy (cast(GtkScrolledWindow*)scrolledHandle, hsp, vsp);
+    if ((style & SWT.BORDER) !is 0) OS.gtk_scrolled_window_set_shadow_type (cast(GtkScrolledWindow*)scrolledHandle, OS.GTK_SHADOW_ETCHED_IN);
+    /*
+    * Bug in GTK. When a treeview is the child of an override shell,
+    * and if the user has ever invokes the interactive search field,
+    * and the treeview is disposed on a focus out event, it segment
+    * faults. The fix is to disable the search field in an override
+    * shell.
+    */
+    if ((getShell ().style & SWT.ON_TOP) !is 0) {
+        /*
+        * Bug in GTK. Until GTK 2.6.5, calling gtk_tree_view_set_enable_search(FALSE)
+        * would prevent the user from being able to type in text to search the tree.
+        * After 2.6.5, GTK introduced Ctrl+F as being the key binding for interactive
+        * search. This meant that even if FALSE was passed to enable_search, the user
+        * can still bring up the search pop up using the keybinding. GTK also introduced
+        * the notion of passing a -1 to gtk_set_search_column to disable searching
+        * (including the search key binding).  The fix is to use the right calls
+        * for the right version.
+        */
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 6, 5)) {
+            OS.gtk_tree_view_set_search_column (cast(GtkTreeView*)handle, -1);
+        } else {
+            OS.gtk_tree_view_set_enable_search (cast(GtkTreeView*)handle, false);
+        }
+    }
+}
+
+public override Point computeSize (int wHint, int hHint, bool changed) {
+    checkWidget ();
+    if (wHint !is SWT.DEFAULT && wHint < 0) wHint = 0;
+    if (hHint !is SWT.DEFAULT && hHint < 0) hHint = 0;
+    Point size = computeNativeSize (handle, wHint, hHint, changed);
+    Rectangle trim = computeTrim (0, 0, size.x, size.y);
+    size.x = trim.width;
+    size.y = trim.height;
+    return size;
+}
+
+override void deregister() {
+    super.deregister ();
+    display.removeWidget (cast(GtkWidget*)OS.gtk_tree_view_get_selection (cast(GtkTreeView*)handle));
+}
+
+/**
+ * Deselects the item at the given zero-relative index in the receiver.
+ * If the item at the index was already deselected, it remains
+ * deselected. Indices that are out of range are ignored.
+ *
+ * @param index the index of the item to deselect
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void deselect (int index) {
+    checkWidget();
+    if (!(0 <= index && index < OS.gtk_tree_model_iter_n_children (cast(GtkTreeStore*)modelHandle, null)))  return;
+    GtkTreeIter iter;
+    auto selection = OS.gtk_tree_view_get_selection (cast(GtkTreeView*)handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    OS.gtk_tree_model_iter_nth_child (cast(GtkTreeStore*)modelHandle, &iter, null, index);
+    OS.gtk_tree_selection_unselect_iter (selection, &iter);
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+}
+
+/**
+ * Deselects the items at the given zero-relative indices in the receiver.
+ * If the item at the given zero-relative index in the receiver
+ * is selected, it is deselected.  If the item at the index
+ * was not selected, it remains deselected.  The range of the
+ * indices is inclusive. Indices that are out of range are ignored.
+ *
+ * @param start the start index of the items to deselect
+ * @param end the end index of the items to deselect
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void deselect (int start, int end) {
+    checkWidget();
+    if (start < 0 && end < 0) return;
+    int count = OS.gtk_tree_model_iter_n_children (cast(GtkTreeStore*)modelHandle, null);
+    if (start >= count && end >= count) return;
+    start = Math.min (count - 1, Math.max (0, start));
+    end = Math.min (count - 1, Math.max (0, end));
+    GtkTreeIter iter;
+    auto selection = OS.gtk_tree_view_get_selection (cast(GtkTreeView*)handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    for (int index=start; index<=end; index++) {
+        OS.gtk_tree_model_iter_nth_child (cast(GtkTreeStore*)modelHandle, &iter, null, index);
+        OS.gtk_tree_selection_unselect_iter (selection, &iter);
+    }
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+}
+
+/**
+ * Deselects the items at the given zero-relative indices in the receiver.
+ * If the item at the given zero-relative index in the receiver
+ * is selected, it is deselected.  If the item at the index
+ * was not selected, it remains deselected. Indices that are out
+ * of range and duplicate indices are ignored.
+ *
+ * @param indices the array of indices for the items to deselect
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void deselect (int [] indices) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (indices is null) error (SWT.ERROR_NULL_ARGUMENT);
+    GtkTreeIter iter;
+    int count = OS.gtk_tree_model_iter_n_children (cast(GtkTreeStore*)modelHandle, null);
+    auto selection = OS.gtk_tree_view_get_selection (cast(GtkTreeView*)handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    for (int i=0; i<indices.length; i++) {
+        int index = indices [i];
+        if (index < 0 || index > count - 1) continue;
+        OS.gtk_tree_model_iter_nth_child (cast(GtkTreeStore*)modelHandle, &iter, null, index);
+        OS.gtk_tree_selection_unselect_iter (selection, &iter);
+    }
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+}
+
+/**
+ * Deselects all selected items in the receiver.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void deselectAll () {
+    checkWidget();
+    auto selection = OS.gtk_tree_view_get_selection (cast(GtkTreeView*)handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    OS.gtk_tree_selection_unselect_all (selection);
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+}
+
+override bool dragDetect (int x, int y, bool filter, bool* consume) {
+    bool selected = false;
+    if (filter) {
+        GtkTreePath* path;
+        if (OS.gtk_tree_view_get_path_at_pos (cast(GtkTreeView*)handle, x, y, &path, null, null, null)) {
+            if (path !is null) {
+                auto selection = OS.gtk_tree_view_get_selection (cast(GtkTreeView*)handle);
+                if (OS.gtk_tree_selection_path_is_selected (selection, path)) selected = true;
+                OS.gtk_tree_path_free (path);
+            }
+        } else {
+            return false;
+        }
+    }
+    bool dragDetect = super.dragDetect (x, y, filter, consume);
+    if (dragDetect && selected && consume !is null) *consume = true;
+    return dragDetect;
+}
+
+override GdkDrawable* eventWindow () {
+    return paintWindow ();
+}
+
+override GdkColor* getBackgroundColor () {
+    return getBaseColor ();
+}
+
+/**
+ * Returns the zero-relative index of the item which currently
+ * has the focus in the receiver, or -1 if no item has focus.
+ *
+ * @return the index of the selected item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getFocusIndex () {
+    checkWidget();
+    GtkTreePath * path;
+    OS.gtk_tree_view_get_cursor (cast(GtkTreeView*)handle, &path, null);
+    if (path is null) return -1;
+    int* indices = OS.gtk_tree_path_get_indices (path);
+    int index;
+    if (indices !is null) index = indices[0];
+    OS.gtk_tree_path_free (path);
+    return index;
+}
+
+GdkColor* getForegroundColor () {
+    return getTextColor ();
+}
+
+/**
+ * Returns the item at the given, zero-relative index in the
+ * receiver. Throws an exception if the index is out of range.
+ *
+ * @param index the index of the item to return
+ * @return the item at the given index
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getItem (int index) {
+    checkWidget();
+    if (!(0 <= index && index < OS.gtk_tree_model_iter_n_children (cast(GtkTreeStore*)modelHandle, null)))  {
+        error (SWT.ERROR_INVALID_RANGE);
+    }
+    char* ptr;
+    GtkTreeIter iter;
+    OS.gtk_tree_model_iter_nth_child (cast(GtkTreeStore*)modelHandle, &iter, null, index);
+    OS.gtk_tree_model_get1 (cast(GtkTreeStore*)modelHandle, &iter, 0, cast(void**)&ptr );
+    if (ptr is null) return null;
+    String res = fromStringz( ptr ).dup;
+    OS.g_free (ptr);
+    return res;
+}
+
+/**
+ * Returns the number of items contained in the receiver.
+ *
+ * @return the number of items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemCount () {
+    checkWidget();
+    return OS.gtk_tree_model_iter_n_children (cast(GtkTreeStore*)modelHandle, null);
+}
+
+/**
+ * Returns the height of the area which would be used to
+ * display <em>one</em> of the items in the list.
+ *
+ * @return the height of one item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemHeight () {
+    checkWidget();
+    int itemCount = OS.gtk_tree_model_iter_n_children (cast(GtkTreeStore*)modelHandle, null);
+    auto column = OS.gtk_tree_view_get_column (cast(GtkTreeView*)handle, 0);
+    if (itemCount is 0) {
+        int w, h;
+        OS.gtk_tree_view_column_cell_get_size (cast(GtkTreeViewColumn*)column, null, null, null, &w, &h);
+        return h;
+    } else {
+        GtkTreeIter iter;
+        OS.gtk_tree_model_get_iter_first (cast(GtkTreeStore*)modelHandle, &iter);
+        OS.gtk_tree_view_column_cell_set_cell_data (cast(GtkTreeViewColumn*)column, modelHandle, &iter, false, false);
+        int w, h;
+        OS.gtk_tree_view_column_cell_get_size (cast(GtkTreeViewColumn*)column, null, null, null, &w, &h);
+        return h;
+    }
+}
+
+/**
+ * Returns a (possibly empty) array of <code>String</code>s which
+ * are the items in the receiver.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the items in the receiver's list
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String [] getItems () {
+    checkWidget();
+    int count = OS.gtk_tree_model_iter_n_children (cast(GtkTreeStore*)modelHandle, null);
+    char* ptr;
+    String [] result = new String[]( count );
+    GtkTreeIter iter;
+    for (int index=0; index<count; index++) {
+        OS.gtk_tree_model_iter_nth_child (cast(GtkTreeStore*)modelHandle, &iter, null, index);
+        OS.gtk_tree_model_get1 (cast(GtkTreeStore*)modelHandle, &iter, 0, cast(void**)&ptr);
+        if (ptr !is null) {
+            String res = fromStringz( ptr ).dup;
+            OS.g_free (ptr);
+            result [index] = res;
+        }
+    }
+    return result;
+}
+
+/**
+ * Returns an array of <code>String</code>s that are currently
+ * selected in the receiver.  The order of the items is unspecified.
+ * An empty array indicates that no items are selected.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its selection, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ * @return an array representing the selection
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String [] getSelection () {
+    checkWidget();
+    int [] indices = getSelectionIndices ();
+    String [] result = new String[](indices.length);
+    for (int i=0; i<indices.length; i++) {
+        result [i] = getItem (indices [i]);
+    }
+    return result;
+}
+
+/**
+ * Returns the number of selected items contained in the receiver.
+ *
+ * @return the number of selected items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSelectionCount () {
+    checkWidget();
+    auto selection = OS.gtk_tree_view_get_selection (cast(GtkTreeView*)handle);
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 2, 0)) {
+        display.treeSelectionLength = 0;
+        display.treeSelection = null;
+        display.doTreeSelectionProcConnect( &treeSelectionProcCallbackData, handle, selection );
+        return display.treeSelectionLength;
+    }
+    return OS.gtk_tree_selection_count_selected_rows (selection);
+}
+
+/**
+ * Returns the zero-relative index of the item which is currently
+ * selected in the receiver, or -1 if no item is selected.
+ *
+ * @return the index of the selected item or -1
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSelectionIndex () {
+    checkWidget();
+    auto selection = OS.gtk_tree_view_get_selection (cast(GtkTreeView*)handle);
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 2, 0)) {
+        int itemCount = OS.gtk_tree_model_iter_n_children (cast(GtkTreeStore*)modelHandle, null);
+        display.treeSelectionLength  = 0;
+        display.treeSelection = new int [itemCount];
+        display.doTreeSelectionProcConnect( &treeSelectionProcCallbackData, handle, selection );
+        if (display.treeSelectionLength is 0) return -1;
+        return display.treeSelection [0];
+    }
+    /*
+    * Bug in GTK.  gtk_tree_selection_get_selected_rows() segmentation faults
+    * in versions smaller than 2.2.4 if the model is NULL.  The fix is
+    * to give a valid pointer instead.
+    */
+    int dummy;
+    int* model = OS.GTK_VERSION < OS.buildVERSION (2, 2, 4) ? &dummy : null;
+    auto list = OS.gtk_tree_selection_get_selected_rows (selection, cast(void**)model);
+    if (list !is null) {
+        int count = OS.g_list_length (list);
+        int index;
+        for (int i=0; i<count; i++) {
+            auto data = OS.g_list_nth_data (list, i);
+            auto indices = OS.gtk_tree_path_get_indices (data);
+            if (indices !is null) {
+                index = indices[0];
+                break;
+            }
+        }
+        OS.g_list_free (list);
+        return index;
+    }
+    return -1;
+}
+
+/**
+ * Returns the zero-relative indices of the items which are currently
+ * selected in the receiver.  The order of the indices is unspecified.
+ * The array is empty if no items are selected.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its selection, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ * @return the array of indices of the selected items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int [] getSelectionIndices () {
+    checkWidget();
+    auto selection = OS.gtk_tree_view_get_selection (cast(GtkTreeView*)handle);
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 2, 0)) {
+        int itemCount = OS.gtk_tree_model_iter_n_children (cast(GtkTreeStore*)modelHandle, null);
+        display.treeSelectionLength  = 0;
+        display.treeSelection = new int [itemCount];
+        display.doTreeSelectionProcConnect( &treeSelectionProcCallbackData, handle, selection );
+        if (display.treeSelectionLength is display.treeSelection.length) return display.treeSelection;
+        int [] result = new int [display.treeSelectionLength];
+        System.arraycopy (display.treeSelection, 0, result, 0, display.treeSelectionLength);
+        return result;
+    }
+    /*
+    * Bug in GTK.  gtk_tree_selection_get_selected_rows() segmentation faults
+    * in versions smaller than 2.2.4 if the model is NULL.  The fix is
+    * to give a valid pointer instead.
+    */
+    int dummy;
+    int* model = OS.GTK_VERSION < OS.buildVERSION (2, 2, 4) ? &dummy : null;
+    auto list = OS.gtk_tree_selection_get_selected_rows (selection, cast(void**)model);
+    if (list !is null) {
+        int count = OS.g_list_length (list);
+        int [] treeSelection = new int [count];
+        int len = 0;
+        for (int i=0; i<count; i++) {
+            auto data = OS.g_list_nth_data (list, i);
+            auto indices = OS.gtk_tree_path_get_indices (data);
+            if (indices !is null) {
+                treeSelection [len] = indices [0];
+                len++;
+            }
+        }
+        OS.g_list_free (list);
+        int [] result = treeSelection[0..len].dup;
+        return result;
+    }
+    return [0];
+}
+
+/**
+ * Returns the zero-relative index of the item which is currently
+ * at the top of the receiver. This index can change when items are
+ * scrolled or new items are added or removed.
+ *
+ * @return the index of the top item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getTopIndex () {
+    checkWidget();
+    GtkTreePath* path;
+    OS.gtk_widget_realize (handle);
+    if (!OS.gtk_tree_view_get_path_at_pos (cast(GtkTreeView*)handle, 1, 1, &path, null, null, null)) return 0;
+    if (path is null) return 0;
+    auto indices = OS.gtk_tree_path_get_indices (path);
+    int index;
+    if (indices !is null) index = indices[0];
+    OS.gtk_tree_path_free (path);
+    return index;
+}
+
+override int /*long*/ gtk_changed (GtkWidget* widget) {
+    postEvent (SWT.Selection);
+    return 0;
+}
+
+override int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* gdkEvent) {
+    auto result = super.gtk_button_press_event (widget, gdkEvent);
+    if (result !is 0) return result;
+    /*
+    * Feature in GTK.  In a multi-select list view, when multiple items are already
+    * selected, the selection state of the item is toggled and the previous selection
+    * is cleared. This is not the desired behaviour when bringing up a popup menu.
+    * Also, when an item is reselected with the right button, the tree view issues
+    * an unwanted selection event. The workaround is to detect that case and not
+    * run the default handler when the item is already part of the current selection.
+    */
+    int button = gdkEvent.button;
+    if (button is 3 && gdkEvent.type is OS.GDK_BUTTON_PRESS) {
+        GtkTreePath* path;
+        if (OS.gtk_tree_view_get_path_at_pos (cast(GtkTreeView*)handle, cast(int)gdkEvent.x, cast(int)gdkEvent.y, &path, null, null, null)) {
+            if (path !is null) {
+                auto selection = OS.gtk_tree_view_get_selection (cast(GtkTreeView*)handle);
+                if (OS.gtk_tree_selection_path_is_selected (selection, path)) result = 1;
+                OS.gtk_tree_path_free (path);
+            }
+        }
+    }
+
+    /*
+    * Feature in GTK.  When the user clicks in a single selection GtkTreeView
+    * and there are no selected items, the first item is selected automatically
+    * before the click is processed, causing two selection events.  The is fix
+    * is the set the cursor item to be same as the clicked item to stop the
+    * widget from automatically selecting the first item.
+    */
+    if ((style & SWT.SINGLE) !is 0 && getSelectionCount () is 0) {
+        GtkTreePath* path;
+        if (OS.gtk_tree_view_get_path_at_pos (cast(GtkTreeView*)handle, cast(int)gdkEvent.x, cast(int)gdkEvent.y, &path, null, null, null)) {
+            if (path  !is null) {
+                auto selection = OS.gtk_tree_view_get_selection (cast(GtkTreeView*)handle);
+                OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+                OS.gtk_tree_view_set_cursor (cast(GtkTreeView*)handle, path, null, false);
+                OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+                OS.gtk_tree_path_free (path);
+            }
+        }
+    }
+    /*
+    * Bug in GTK. GTK segments fault, if the GtkTreeView widget is
+    * not in focus and all items in the widget are disposed before
+    * it finishes processing a button press.  The fix is to give
+    * focus to the widget before it starts processing the event.
+    */
+    if (!OS.GTK_WIDGET_HAS_FOCUS (handle)) {
+        OS.gtk_widget_grab_focus (handle);
+    }
+    return result;
+}
+
+override int /*long*/ gtk_key_press_event (GtkWidget* widget, GdkEventKey* keyEvent) {
+    auto result = super.gtk_key_press_event (widget, keyEvent);
+    if (result !is 0) return result;
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 2 ,0)) {
+        /*
+        * Feature in GTK 2.0.x.  When an item is default selected using
+        * the return key, GTK does not issue notification. The fix is
+        * to issue this notification when the return key is pressed.
+        */
+        int key = keyEvent.keyval;
+        switch (key) {
+            case OS.GDK_Return:
+            case OS.GDK_KP_Enter: {
+                postEvent (SWT.DefaultSelection);
+                break;
+            }
+            default:
+        }
+    }
+    return result;
+}
+
+override int /*long*/ gtk_popup_menu (GtkWidget* widget) {
+    auto result = super.gtk_popup_menu (widget);
+    /*
+    * Bug in GTK.  The context menu for the typeahead in GtkTreeViewer
+    * opens in the bottom right corner of the screen when Shift+F10
+    * is pressed and the typeahead window was not visible.  The fix is
+    * to prevent the context menu from opening by stopping the default
+    * handler.
+    *
+    * NOTE: The bug only happens in GTK 2.6.5 and lower.
+    */
+    return OS.GTK_VERSION < OS.buildVERSION (2, 6, 5) ? 1 : result;
+}
+
+override void gtk_row_activated (GtkTreeView* tree, GtkTreePath* path, GtkTreeViewColumn* column){
+    postEvent (SWT.DefaultSelection);
+}
+
+override void hookEvents () {
+    super.hookEvents();
+    auto selection = OS.gtk_tree_view_get_selection(cast(GtkTreeView*)handle);
+    OS.g_signal_connect_closure (selection, OS.changed.ptr, display.closures [CHANGED], false);
+    OS.g_signal_connect_closure (handle, OS.row_activated.ptr, display.closures [ROW_ACTIVATED], false);
+}
+
+/**
+ * Gets the index of an item.
+ * <p>
+ * The list is searched starting at 0 until an
+ * item is found that is equal to the search item.
+ * If no item is found, -1 is returned.  Indexing
+ * is zero based.
+ *
+ * @param string the search item
+ * @return the index of the item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int indexOf (String string) {
+    checkWidget();
+    return indexOf (string, 0);
+}
+
+/**
+ * Searches the receiver's list starting at the given,
+ * zero-relative index until an item is found that is equal
+ * to the argument, and returns the index of that item. If
+ * no item is found or the starting index is out of range,
+ * returns -1.
+ *
+ * @param string the search item
+ * @param start the zero-relative index at which to start the search
+ * @return the index of the item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int indexOf (String string, int start) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    String [] items = getItems ();
+    for (int i=start; i<items.length; i++) {
+        if (items [i].equals (string)) return i;
+    }
+    return -1;
+}
+
+/**
+ * Returns <code>true</code> if the item is selected,
+ * and <code>false</code> otherwise.  Indices out of
+ * range are ignored.
+ *
+ * @param index the index of the item
+ * @return the selection state of the item at the index
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool isSelected (int index) {
+    checkWidget();
+    auto selection = OS.gtk_tree_view_get_selection (cast(GtkTreeView*)handle);
+    char* buffer = toStringz(tango.text.convert.Integer.toString(index));
+    auto path = OS.gtk_tree_path_new_from_string (buffer);
+    bool answer = cast(bool)OS.gtk_tree_selection_path_is_selected (selection, path);
+    OS.gtk_tree_path_free (path);
+    return answer;
+}
+
+override GdkDrawable* paintWindow () {
+    OS.gtk_widget_realize (handle);
+    return OS.gtk_tree_view_get_bin_window (cast(GtkTreeView*)handle);
+}
+
+override void register () {
+    super.register ();
+    display.addWidget (cast(GtkWidget*)OS.gtk_tree_view_get_selection (cast(GtkTreeView*)handle), this);
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    if (modelHandle !is null) OS.g_object_unref (modelHandle);
+    modelHandle = null;
+}
+
+/**
+ * Removes the item from the receiver at the given
+ * zero-relative index.
+ *
+ * @param index the index for the item
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void remove (int index) {
+    checkWidget();
+    if (!(0 <= index && index < OS.gtk_tree_model_iter_n_children (cast(GtkTreeStore*)modelHandle, null)))  {
+        error (SWT.ERROR_INVALID_RANGE);
+    }
+    GtkTreeIter iter;
+    OS.gtk_tree_model_iter_nth_child (cast(GtkTreeStore*)modelHandle, &iter, null, index);
+    auto selection = OS.gtk_tree_view_get_selection (cast(GtkTreeView*)handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    OS.gtk_list_store_remove (cast(GtkListStore*)modelHandle, &iter);
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+}
+
+/**
+ * Removes the items from the receiver which are
+ * between the given zero-relative start and end
+ * indices (inclusive).
+ *
+ * @param start the start of the range
+ * @param end the end of the range
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if either the start or end are not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void remove (int start, int end) {
+    checkWidget();
+    if (start > end) return;
+    int count =  OS.gtk_tree_model_iter_n_children (cast(GtkTreeStore*)modelHandle, null);
+    if (!(0 <= start && start <= end && end < count)) {
+        error (SWT.ERROR_INVALID_RANGE);
+    }
+    GtkTreeIter iter;
+    auto selection = OS.gtk_tree_view_get_selection (cast(GtkTreeView*)handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    for (int index=end; index>=start; index--) {
+        OS.gtk_tree_model_iter_nth_child (cast(GtkTreeStore*)modelHandle, &iter, null, index);
+        OS.gtk_list_store_remove (cast(GtkListStore*)modelHandle, &iter);
+    }
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+}
+
+/**
+ * Searches the receiver's list starting at the first item
+ * until an item is found that is equal to the argument,
+ * and removes that item from the list.
+ *
+ * @param string the item to remove
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the string is not found in the list</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void remove (String string) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    int index = indexOf (string, 0);
+    if (index is -1) error (SWT.ERROR_INVALID_ARGUMENT);
+    remove (index);
+}
+
+/**
+ * Removes the items from the receiver at the given
+ * zero-relative indices.
+ *
+ * @param indices the array of indices of the items
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void remove (int [] indices) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (indices is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (indices.length is 0) return;
+    int [] newIndices = new int []( indices.length );
+    System.arraycopy (indices, 0, newIndices, 0, indices.length);
+    sort (newIndices);
+    int start = newIndices [newIndices.length - 1], end = newIndices [0];
+    int count = getItemCount();
+    if (!(0 <= start && start <= end && end < count)) {
+        error (SWT.ERROR_INVALID_RANGE);
+    }
+    GtkTreeIter iter;
+    auto selection = OS.gtk_tree_view_get_selection (cast(GtkTreeView*)handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    int last = -1;
+    for (int i=0; i<newIndices.length; i++) {
+        int index = newIndices [i];
+        if (index !is last) {
+            OS.gtk_tree_model_iter_nth_child (cast(GtkTreeStore*)modelHandle, &iter, null, index);
+            OS.gtk_list_store_remove (cast(GtkListStore*)modelHandle, &iter);
+            last = index;
+        }
+    }
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+}
+
+/**
+ * Removes all of the items from the receiver.
+ * <p>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void removeAll () {
+    checkWidget();
+    auto selection = OS.gtk_tree_view_get_selection (cast(GtkTreeView*)handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    OS.gtk_list_store_clear (cast(GtkListStore*)modelHandle);
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the user changes the receiver's selection.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener(SelectionListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Selection, listener);
+    eventTable.unhook (SWT.DefaultSelection,listener);
+}
+
+/**
+ * Selects the item at the given zero-relative index in the receiver's
+ * list.  If the item at the index was already selected, it remains
+ * selected. Indices that are out of range are ignored.
+ *
+ * @param index the index of the item to select
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void select (int index) {
+    checkWidget();
+    if (!(0 <= index && index < OS.gtk_tree_model_iter_n_children (cast(GtkTreeStore*)modelHandle, null)))  return;
+    GtkTreeIter iter;
+    auto selection = OS.gtk_tree_view_get_selection (cast(GtkTreeView*)handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    OS.gtk_tree_model_iter_nth_child (cast(GtkTreeStore*)modelHandle, &iter, null, index);
+    OS.gtk_tree_selection_select_iter (selection, &iter);
+    if ((style & SWT.SINGLE) !is 0) {
+        auto path = OS.gtk_tree_model_get_path (cast(GtkTreeStore*)modelHandle, &iter);
+        OS.gtk_tree_view_set_cursor (cast(GtkTreeView*)handle, path, null, false);
+        OS.gtk_tree_path_free (path);
+    }
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+}
+
+/**
+ * Selects the items in the range specified by the given zero-relative
+ * indices in the receiver. The range of indices is inclusive.
+ * The current selection is not cleared before the new items are selected.
+ * <p>
+ * If an item in the given range is not selected, it is selected.
+ * If an item in the given range was already selected, it remains selected.
+ * Indices that are out of range are ignored and no items will be selected
+ * if start is greater than end.
+ * If the receiver is single-select and there is more than one item in the
+ * given range, then all indices are ignored.
+ *
+ * @param start the start of the range
+ * @param end the end of the range
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see List#setSelection(int,int)
+ */
+public void select (int start, int end) {
+    checkWidget ();
+    if (end < 0 || start > end || ((style & SWT.SINGLE) !is 0 && start !is end)) return;
+    int count = OS.gtk_tree_model_iter_n_children (cast(GtkTreeStore*)modelHandle, null);
+    if (count is 0 || start >= count) return;
+    start = Math.max (0, start);
+    end = Math.min (end, count - 1);
+    GtkTreeIter iter;
+    auto selection = OS.gtk_tree_view_get_selection (cast(GtkTreeView*)handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    for (int index=start; index<=end; index++) {
+        OS.gtk_tree_model_iter_nth_child (cast(GtkTreeStore*)modelHandle, &iter, null, index);
+        OS.gtk_tree_selection_select_iter (selection, &iter);
+        if ((style & SWT.SINGLE) !is 0) {
+            auto path = OS.gtk_tree_model_get_path (cast(GtkTreeStore*)modelHandle, &iter);
+            OS.gtk_tree_view_set_cursor (cast(GtkTreeView*)handle, path, null, false);
+            OS.gtk_tree_path_free (path);
+        }
+    }
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+}
+
+/**
+ * Selects the items at the given zero-relative indices in the receiver.
+ * The current selection is not cleared before the new items are selected.
+ * <p>
+ * If the item at a given index is not selected, it is selected.
+ * If the item at a given index was already selected, it remains selected.
+ * Indices that are out of range and duplicate indices are ignored.
+ * If the receiver is single-select and multiple indices are specified,
+ * then all indices are ignored.
+ *
+ * @param indices the array of indices for the items to select
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see List#setSelection(int[])
+ */
+public void select (int [] indices) {
+    checkWidget ();
+    // SWT extension: allow null for zero length string
+    //if (indices is null) error (SWT.ERROR_NULL_ARGUMENT);
+    int length = indices.length;
+    if (length is 0 || ((style & SWT.SINGLE) !is 0 && length > 1)) return;
+    GtkTreeIter iter;
+    int count = OS.gtk_tree_model_iter_n_children (cast(GtkTreeStore*)modelHandle, null);
+    auto selection = OS.gtk_tree_view_get_selection (cast(GtkTreeView*)handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    for (int i=0; i<length; i++) {
+        int index = indices [i];
+        if (!(0 <= index && index < count)) continue;
+        OS.gtk_tree_model_iter_nth_child (cast(GtkTreeStore*)modelHandle, &iter, null, index);
+        OS.gtk_tree_selection_select_iter (selection, &iter);
+        if ((style & SWT.SINGLE) !is 0) {
+            auto path = OS.gtk_tree_model_get_path (cast(GtkTreeStore*)modelHandle, &iter);
+            OS.gtk_tree_view_set_cursor (cast(GtkTreeView*)handle, path, null, false);
+            OS.gtk_tree_path_free (path);
+        }
+    }
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+}
+
+/**
+ * Selects all of the items in the receiver.
+ * <p>
+ * If the receiver is single-select, do nothing.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void selectAll () {
+    checkWidget();
+    if ((style & SWT.SINGLE) !is 0) return;
+    auto selection = OS.gtk_tree_view_get_selection (cast(GtkTreeView*)handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    OS.gtk_tree_selection_select_all (selection);
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+}
+
+void selectFocusIndex (int index) {
+    /*
+    * Note that this method both selects and sets the focus to the
+    * specified index, so any previous selection in the list will be lost.
+    * gtk does not provide a way to just set focus to a specified list item.
+    */
+    int count = OS.gtk_tree_model_iter_n_children (cast(GtkTreeStore*)modelHandle, null);
+    if (!(0 <= index && index < count))  return;
+    GtkTreeIter iter;
+    OS.gtk_tree_model_iter_nth_child (cast(GtkTreeStore*)modelHandle, &iter, null, index);
+    auto path = OS.gtk_tree_model_get_path (cast(GtkTreeStore*)modelHandle, &iter);
+    auto selection = OS.gtk_tree_view_get_selection (cast(GtkTreeView*)handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    OS.gtk_tree_view_set_cursor (cast(GtkTreeView*)handle, path, null, false);
+    /*
+    * Bug in GTK. For some reason, when an event loop is run from
+    * within a key pressed handler and a dialog is displayed that
+    * contains a GtkTreeView,  gtk_tree_view_set_cursor() does
+    * not set the cursor or select the item.  The fix is to select the
+    * item with gtk_tree_selection_select_iter() as well.
+    *
+    * NOTE: This happens in GTK 2.2.1 and is fixed in GTK 2.2.4.
+    */
+    OS.gtk_tree_selection_select_iter (selection, &iter);
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    OS.gtk_tree_path_free (path);
+}
+
+override void setBackgroundColor (GdkColor* color) {
+    super.setBackgroundColor (color);
+    OS.gtk_widget_modify_base (handle, 0, color);
+}
+
+override int setBounds (int x, int y, int width, int height, bool move, bool resize) {
+    int result = super.setBounds (x, y, width, height, move, resize);
+    /*
+    * Bug on GTK.  The tree view sometimes does not get a paint
+    * event or resizes to a one pixel square when resized in a new
+    * shell that is not visible after any event loop has been run.  The
+    * problem is intermittent. It doesn't seem to happen the first time
+    * a new shell is created. The fix is to ensure the tree view is realized
+    * after it has been resized.
+    */
+    OS.gtk_widget_realize (handle);
+    /*
+    * Bug in GTK.  An empty GtkTreeView fails to repaint the focus rectangle
+    * correctly when resized on versions before 2.6.0.  The fix is to force
+    * the widget to redraw.
+    */
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 6, 0) && OS.gtk_tree_model_iter_n_children (cast(GtkTreeStore*)modelHandle, null) is 0) {
+        redraw (false);
+    }
+    return result;
+}
+
+/**
+ * Sets the text of the item in the receiver's list at the given
+ * zero-relative index to the string argument.
+ *
+ * @param index the index for the item
+ * @param string the new text for the item
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setItem (int index, String string) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (!(0 <= index && index < OS.gtk_tree_model_iter_n_children (cast(GtkTreeStore*)modelHandle, null)))  {
+        error (SWT.ERROR_INVALID_RANGE);
+    }
+    GtkTreeIter iter;
+    OS.gtk_tree_model_iter_nth_child (cast(GtkTreeStore*)modelHandle, &iter, null, index);
+    char* buffer = string.toStringzValidPtr();
+    OS.gtk_list_store_set1 (cast(GtkListStore*)modelHandle, &iter, TEXT_COLUMN, buffer);
+}
+
+/**
+ * Sets the receiver's items to be the given array of items.
+ *
+ * @param items the array of items
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if an item in the items array is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setItems (String [] items) {
+    checkWidget();
+    // SWT extension, allow null a null length list.
+    //if (items is null) error (SWT.ERROR_NULL_ARGUMENT);
+    for (int i=0; i<items.length; i++) {
+        if (items [i] is null) error (SWT.ERROR_INVALID_ARGUMENT);
+    }
+    auto selection = OS.gtk_tree_view_get_selection (cast(GtkTreeView*)handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    OS.gtk_list_store_clear (cast(GtkListStore*)modelHandle);
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    GtkTreeIter iter;
+    for (int i=0; i<items.length; i++) {
+        String string = items [i];
+        char* buffer = toStringz(string);
+        OS.gtk_list_store_append (cast(GtkListStore*)modelHandle, &iter);
+        OS.gtk_list_store_set1 (cast(GtkListStore*)modelHandle, &iter, TEXT_COLUMN, buffer);
+    }
+}
+
+/**
+ * Selects the item at the given zero-relative index in the receiver.
+ * If the item at the index was already selected, it remains selected.
+ * The current selection is first cleared, then the new item is selected.
+ * Indices that are out of range are ignored.
+ *
+ * @param index the index of the item to select
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @see List#deselectAll()
+ * @see List#select(int)
+ */
+public void setSelection (int index) {
+    checkWidget ();
+    deselectAll ();
+    selectFocusIndex (index);
+    showSelection ();
+}
+
+/**
+ * Selects the items in the range specified by the given zero-relative
+ * indices in the receiver. The range of indices is inclusive.
+ * The current selection is cleared before the new items are selected.
+ * <p>
+ * Indices that are out of range are ignored and no items will be selected
+ * if start is greater than end.
+ * If the receiver is single-select and there is more than one item in the
+ * given range, then all indices are ignored.
+ *
+ * @param start the start index of the items to select
+ * @param end the end index of the items to select
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see List#deselectAll()
+ * @see List#select(int,int)
+ */
+public void setSelection (int start, int end) {
+    checkWidget ();
+    deselectAll ();
+    if (end < 0 || start > end || ((style & SWT.SINGLE) !is 0 && start !is end)) return;
+    int count = OS.gtk_tree_model_iter_n_children (cast(GtkTreeStore*)modelHandle, null);
+    if (count is 0 || start >= count) return;
+    start = Math.max (0, start);
+    end = Math.min (end, count - 1);
+    selectFocusIndex (start);
+    if ((style & SWT.MULTI) !is 0) {
+        select (start, end);
+    }
+    showSelection ();
+}
+
+/**
+ * Selects the items at the given zero-relative indices in the receiver.
+ * The current selection is cleared before the new items are selected.
+ * <p>
+ * Indices that are out of range and duplicate indices are ignored.
+ * If the receiver is single-select and multiple indices are specified,
+ * then all indices are ignored.
+ *
+ * @param indices the indices of the items to select
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see List#deselectAll()
+ * @see List#select(int[])
+ */
+public void setSelection(int[] indices) {
+    checkWidget ();
+    // SWT extension: allow null for zero length string
+    //if (indices is null) error (SWT.ERROR_NULL_ARGUMENT);
+    deselectAll ();
+    int length = indices.length;
+    if (length is 0 || ((style & SWT.SINGLE) !is 0 && length > 1)) return;
+    selectFocusIndex (indices [0]);
+    if ((style & SWT.MULTI) !is 0) {
+        select (indices);
+    }
+    showSelection ();
+}
+
+/**
+ * Sets the receiver's selection to be the given array of items.
+ * The current selection is cleared before the new items are selected.
+ * <p>
+ * Items that are not in the receiver are ignored.
+ * If the receiver is single-select and multiple items are specified,
+ * then all items are ignored.
+ *
+ * @param items the array of items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see List#deselectAll()
+ * @see List#select(int[])
+ * @see List#setSelection(int[])
+ */
+public void setSelection (String [] items) {
+    checkWidget ();
+    // SWT extension: allow null for zero length string
+    //if (items is null) error (SWT.ERROR_NULL_ARGUMENT);
+    deselectAll ();
+    int length = items.length;
+    if (length is 0 || ((style & SWT.SINGLE) !is 0 && length > 1)) return;
+    bool first = true;
+    for (int i = 0; i < length; i++) {
+        int index = 0;
+        String string = items [i];
+        if (string !is null) {
+            while ((index = indexOf (string, index)) !is -1) {
+                if ((style & SWT.MULTI) !is 0) {
+                    if (first) {
+                        first = false;
+                        selectFocusIndex (index);
+                    } else {
+                        select (index);
+                    }
+                } else {
+                    selectFocusIndex (index);
+                    break;
+                }
+                index++;
+            }
+        }
+    }
+    showSelection ();
+}
+
+/**
+ * Sets the zero-relative index of the item which is currently
+ * at the top of the receiver. This index can change when items
+ * are scrolled or new items are added and removed.
+ *
+ * @param index the index of the top item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setTopIndex (int index) {
+    checkWidget();
+    if (!(0 <= index && index < OS.gtk_tree_model_iter_n_children (cast(GtkTreeStore*)modelHandle, null))) return;
+    GtkTreeIter iter;
+    OS.gtk_tree_model_iter_nth_child (cast(GtkTreeStore*)modelHandle, &iter, null, index);
+    auto path = OS.gtk_tree_model_get_path (cast(GtkTreeStore*)modelHandle, &iter);
+    OS.gtk_tree_view_scroll_to_cell (cast(GtkTreeView*)handle, path, null, true, 0, 0);
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 8, 0)) {
+        /*
+        * Bug in GTK.  According to the documentation, gtk_tree_view_scroll_to_cell
+        * should vertically scroll the cell to the top if use_align is true and row_align is 0.
+        * However, prior to version 2.8 it does not scroll at all.  The fix is to determine
+        * the new location and use gtk_tree_view_scroll_to_point.
+        * If the widget is a pinhead, calling gtk_tree_view_scroll_to_point
+        * will have no effect. Therefore, it is still neccessary to call
+        * gtk_tree_view_scroll_to_cell.
+        */
+        OS.gtk_widget_realize (handle);
+        GdkRectangle cellRect;
+        OS.gtk_tree_view_get_cell_area (cast(GtkTreeView*)handle, path, null, &cellRect);
+        int tx, ty;
+        OS.gtk_tree_view_widget_to_tree_coords(cast(GtkTreeView*)handle, cellRect.x, cellRect.y, &tx, &ty);
+        OS.gtk_tree_view_scroll_to_point (cast(GtkTreeView*)handle, -1, ty);
+    }
+    OS.gtk_tree_path_free (path);
+}
+
+/**
+ * Shows the selection.  If the selection is already showing in the receiver,
+ * this method simply returns.  Otherwise, the items are scrolled until
+ * the selection is visible.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void showSelection () {
+    checkWidget();
+    int index = getSelectionIndex ();
+    if (index is -1) return;
+    GtkTreeIter iter;
+    OS.gtk_tree_model_iter_nth_child (cast(GtkTreeStore*)modelHandle, &iter, null, index);
+    auto path = OS.gtk_tree_model_get_path (cast(GtkTreeStore*)modelHandle, &iter);
+    /*
+    * This code intentionally commented.
+    * Bug in GTK.  According to the documentation, gtk_tree_view_scroll_to_cell
+    * should scroll the minimum amount to show the cell if use_align is false.
+    * However, what actually happens is the cell is scrolled to the top.
+    * The fix is to determine the new location and use gtk_tree_view_scroll_to_point.
+    * If the widget is a pinhead, calling gtk_tree_view_scroll_to_point
+    * will have no effect. Therefore, it is still neccessary to
+    * call gtk_tree_view_scroll_to_cell.
+    */
+//  OS.gtk_tree_view_scroll_to_cell (handle, path, 0, false, 0, 0);
+    OS.gtk_widget_realize (handle);
+    GdkRectangle visibleRect;
+    OS.gtk_tree_view_get_visible_rect (cast(GtkTreeView*)handle, &visibleRect);
+    GdkRectangle cellRect;
+    OS.gtk_tree_view_get_cell_area (cast(GtkTreeView*)handle, path, null, &cellRect);
+    int tx, ty;
+    OS.gtk_tree_view_widget_to_tree_coords(cast(GtkTreeView*)handle, cellRect.x, cellRect.y, &tx, &ty);
+    if (ty < visibleRect.y ) {
+        OS.gtk_tree_view_scroll_to_cell (cast(GtkTreeView*)handle, path, null, true, 0f, 0f);
+        OS.gtk_tree_view_scroll_to_point (cast(GtkTreeView*)handle, -1, ty);
+    } else {
+        int height = Math.min (visibleRect.height, cellRect.height);
+        if (ty + height > visibleRect.y + visibleRect.height) {
+            OS.gtk_tree_view_scroll_to_cell (cast(GtkTreeView*)handle, path, null, true, 1f, 0f);
+            ty += cellRect.height - visibleRect.height;
+            OS.gtk_tree_view_scroll_to_point (cast(GtkTreeView*)handle, -1, ty);
+        }
+    }
+    OS.gtk_tree_path_free (path);
+}
+
+override void treeSelectionProc (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, int[] selection, int length_) {
+    if (selection !is null) {
+        auto indices = OS.gtk_tree_path_get_indices (path);
+        if (indices !is null) {
+            selection [length_] = indices[0];
+        }
+    }
+    return 0;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Listener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Listener;
+
+import java.lang.all;
+
+import org.eclipse.swt.widgets.Event;
+
+import tango.core.Traits;
+import tango.core.Tuple;
+
+/**
+ * Implementers of <code>Listener</code> provide a simple
+ * <code>handleEvent()</code> method that is used internally
+ * by SWT to dispatch events.
+ * <p>
+ * After creating an instance of a class that implements this interface
+ * it can be added to a widget using the
+ * <code>addListener(int eventType, Listener handler)</code> method and
+ * removed using the
+ * <code>removeListener (int eventType, Listener handler)</code> method.
+ * When the specified event occurs, <code>handleEvent(...)</code> will
+ * be sent to the instance.
+ * </p>
+ * <p>
+ * Classes which implement this interface are described within SWT as
+ * providing the <em>untyped listener</em> API. Typically, widgets will
+ * also provide a higher-level <em>typed listener</em> API, that is based
+ * on the standard <code>java.util.EventListener</code> pattern.
+ * </p>
+ * <p>
+ * Note that, since all internal SWT event dispatching is based on untyped
+ * listeners, it is simple to build subsets of SWT for use on memory
+ * constrained, small footprint devices, by removing the classes and
+ * methods which implement the typed listener API.
+ * </p>
+ *
+ * @see Widget#addListener
+ * @see java.util.EventListener
+ * @see org.eclipse.swt.events
+ */
+public interface Listener {
+
+/**
+ * Sent when an event that the receiver has registered for occurs.
+ *
+ * @param event the event which occurred
+ */
+void handleEvent (Event event);
+}
+
+
+/// Helper class for the dgListener template function
+private class _DgListenerT(Dg,T...) : Listener {
+
+    alias ParameterTupleOf!(Dg) DgArgs;
+    static assert( is(DgArgs == Tuple!(Event,T)),
+                "Delegate args not correct: delegate args: ("~DgArgs.stringof~") vs. passed args: ("~Tuple!(Event,T).stringof~")" );
+
+    Dg dg;
+    T  t;
+
+    private this( Dg dg, T t ){
+        this.dg = dg;
+        static if( T.length > 0 ){
+            this.t = t;
+        }
+    }
+
+    void handleEvent( Event e ){
+        dg(e,t);
+    }
+}
+
+/++
+ + dgListener creates a class implementing the Listener interface and delegating the call to
+ + handleEvent to the users delegate. This template function will store also additional parameters.
+ +
+ + Examle of usage:
+ + ---
+ + void handleTextEvent (Event e, int inset ) {
+ +     // ...
+ + }
+ + text.addListener (SWT.FocusOut, dgListener( &handleTextEvent, inset ));
+ + ---
+ +/
+Listener dgListener( Dg, T... )( Dg dg, T args ){
+    return new _DgListenerT!( Dg, T )( dg, args );
+}
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Menu.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,990 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Menu;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.events.MenuListener;
+import org.eclipse.swt.events.HelpListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.ImageList;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Decorations;
+import org.eclipse.swt.widgets.Shell;
+import java.lang.all;
+
+/**
+ * Instances of this class are user interface objects that contain
+ * menu items.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>BAR, DROP_DOWN, POP_UP, NO_RADIO_GROUP</dd>
+ * <dd>LEFT_TO_RIGHT, RIGHT_TO_LEFT</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Help, Hide, Show </dd>
+ * </dl>
+ * <p>
+ * Note: Only one of BAR, DROP_DOWN and POP_UP may be specified.
+ * Only one of LEFT_TO_RIGHT or RIGHT_TO_LEFT may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#menu">Menu snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class Menu : Widget {
+    int x, y;
+    bool hasLocation;
+    MenuItem cascade, selectedItem;
+    Decorations parent;
+    GtkWidget* imItem;
+    GtkWidget* imSeparator;
+    GtkIMContext* imHandle;
+    ImageList imageList;
+
+/**
+ * Constructs a new instance of this class given its parent,
+ * and sets the style for the instance so that the instance
+ * will be a popup menu on the given parent's shell.
+ * <p>
+ * After constructing a menu, it can be set into its parent
+ * using <code>parent.setMenu(menu)</code>.  In this case, the parent may
+ * be any control in the same widget tree as the parent.
+ * </p>
+ *
+ * @param parent a control which will be the parent of the new instance (cannot be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#POP_UP
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Control parent) {
+    this (checkNull (parent).menuShell (), SWT.POP_UP);
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Decorations</code>) and a style value
+ * describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p><p>
+ * After constructing a menu or menuBar, it can be set into its parent
+ * using <code>parent.setMenu(menu)</code> or <code>parent.setMenuBar(menuBar)</code>.
+ * </p>
+ *
+ * @param parent a decorations control which will be the parent of the new instance (cannot be null)
+ * @param style the style of menu to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#BAR
+ * @see SWT#DROP_DOWN
+ * @see SWT#POP_UP
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Decorations parent, int style) {
+    super (parent, checkStyle (style));
+    this.parent = parent;
+    createWidget (0);
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Menu</code>) and sets the style
+ * for the instance so that the instance will be a drop-down
+ * menu on the given parent's parent.
+ * <p>
+ * After constructing a drop-down menu, it can be set into its parentMenu
+ * using <code>parentMenu.setMenu(menu)</code>.
+ * </p>
+ *
+ * @param parentMenu a menu which will be the parent of the new instance (cannot be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#DROP_DOWN
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Menu parentMenu) {
+    this (checkNull (parentMenu).parent, SWT.DROP_DOWN);
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>MenuItem</code>) and sets the style
+ * for the instance so that the instance will be a drop-down
+ * menu on the given parent's parent menu.
+ * <p>
+ * After constructing a drop-down menu, it can be set into its parentItem
+ * using <code>parentItem.setMenu(menu)</code>.
+ * </p>
+ *
+ * @param parentItem a menu item which will be the parent of the new instance (cannot be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#DROP_DOWN
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (MenuItem parentItem) {
+    this (checkNull (parentItem).parent);
+}
+
+static Control checkNull (Control control) {
+    if (control is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    return control;
+}
+
+static Menu checkNull (Menu menu) {
+    if (menu is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    return menu;
+}
+
+static MenuItem checkNull (MenuItem item) {
+    if (item is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    return item;
+}
+
+static int checkStyle (int style) {
+    return checkBits (style, SWT.POP_UP, SWT.BAR, SWT.DROP_DOWN, 0, 0, 0);
+}
+
+void _setVisible (bool visible) {
+    if (visible is OS.GTK_WIDGET_MAPPED (handle)) return;
+    if (visible) {
+        sendEvent (SWT.Show);
+        if (getItemCount () !is 0) {
+            if ((OS.GTK_VERSION >=  OS.buildVERSION (2, 8, 0))) {
+                /*
+                * Feature in GTK. ON_TOP shells will send out
+                * SWT.Deactivate whenever a context menu is shown.
+                * The fix is to prevent the menu from taking focus
+                * when it is being shown in an ON_TOP shell.
+                */
+                if ((parent._getShell ().style & SWT.ON_TOP) !is 0) {
+                    OS.gtk_menu_shell_set_take_focus (cast(GtkMenuShell*)handle, false);
+                }
+            }
+            /*
+            * Bug in GTK.  The timestamp passed into gtk_menu_popup is used
+            * to perform an X pointer grab.  It cannot be zero, else the grab
+            * will fail.  The fix is to ensure that the timestamp of the last
+            * event processed is used.
+            */
+            getDisplay().doMenuPositionProc( cast(GtkMenu*)handle, hasLocation );
+        } else {
+            sendEvent (SWT.Hide);
+        }
+    } else {
+        OS.gtk_menu_popdown (cast(GtkMenu*)handle);
+    }
+}
+
+void addAccelerators (GtkAccelGroup* accelGroup) {
+    MenuItem [] items = getItems ();
+    for (int i = 0; i < items.length; i++) {
+        MenuItem item = items[i];
+        item.addAccelerators (accelGroup);
+    }
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when menus are hidden or shown, by sending it
+ * one of the messages defined in the <code>MenuListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see MenuListener
+ * @see #removeMenuListener
+ */
+public void addMenuListener (MenuListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Hide,typedListener);
+    addListener (SWT.Show,typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when help events are generated for the control,
+ * by sending it one of the messages defined in the
+ * <code>HelpListener</code> interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see HelpListener
+ * @see #removeHelpListener
+ */
+public void addHelpListener (HelpListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Help, typedListener);
+}
+
+override void createHandle (int index) {
+    state |= HANDLE;
+    if ((style & SWT.BAR) !is 0) {
+        handle = OS.gtk_menu_bar_new ();
+        if (handle is null) error (SWT.ERROR_NO_HANDLES);
+        auto vboxHandle = parent.vboxHandle;
+        OS.gtk_container_add (cast(GtkContainer*)vboxHandle, handle);
+        OS.gtk_box_set_child_packing (cast(GtkBox*)vboxHandle, handle, false, true, 0, OS.GTK_PACK_START);
+    } else {
+        handle = OS.gtk_menu_new ();
+        if (handle is null) error (SWT.ERROR_NO_HANDLES);
+    }
+}
+
+void createIMMenu (GtkIMContext* imHandle) {
+    if (this.imHandle is imHandle) return;
+    this.imHandle = imHandle;
+    if (imHandle is null) {
+        if (imItem !is null) {
+            OS.gtk_widget_destroy (imItem);
+            imItem = null;
+        }
+        if (imSeparator !is null) {
+            OS.gtk_widget_destroy (imSeparator);
+            imSeparator = null;
+        }
+        return;
+    }
+    if (imSeparator is null) {
+        imSeparator = OS.gtk_separator_menu_item_new ();
+        OS.gtk_widget_show (imSeparator);
+        OS.gtk_menu_shell_insert (cast(GtkMenuShell*)handle, imSeparator, -1);
+    }
+    if (imItem is null) {
+        char* buffer = toStringz( SWT.getMessage("SWT_InputMethods"));
+        imItem = OS.gtk_image_menu_item_new_with_label (buffer);
+        OS.gtk_widget_show (imItem);
+        OS.gtk_menu_shell_insert (cast(GtkMenuShell*)handle, imItem, -1);
+    }
+    auto imSubmenu = OS.gtk_menu_new ();
+    OS.gtk_im_multicontext_append_menuitems (cast(GtkIMMulticontext*)imHandle, cast(GtkMenuShell*)imSubmenu);
+    OS.gtk_menu_item_set_submenu (cast(GtkMenuItem*)imItem, imSubmenu);
+}
+
+override void createWidget (int index) {
+    checkOrientation (parent);
+    super.createWidget (index);
+    parent.addMenu (this);
+}
+
+void fixMenus (Decorations newParent) {
+    MenuItem [] items = getItems ();
+    for (int i=0; i<items.length; i++) {
+        items [i].fixMenus (newParent);
+    }
+    parent.removeMenu (this);
+    newParent.addMenu (this);
+    this.parent = newParent;
+}
+
+/*public*/ Rectangle getBounds () {
+    checkWidget();
+    if (!OS.GTK_WIDGET_MAPPED (handle)) {
+        return new Rectangle (0, 0, 0, 0);
+    }
+    auto window = OS.GTK_WIDGET_WINDOW (handle);
+    int origin_x, origin_y;
+    OS.gdk_window_get_origin (window, &origin_x, &origin_y);
+    int x = origin_x + OS.GTK_WIDGET_X (handle);
+    int y = origin_y + OS.GTK_WIDGET_Y (handle);
+    int width = OS.GTK_WIDGET_WIDTH (handle);
+    int height = OS.GTK_WIDGET_HEIGHT (handle);
+    return new Rectangle (x, y, width, height);
+}
+
+/**
+ * Returns the default menu item or null if none has
+ * been previously set.
+ *
+ * @return the default menu item.
+ *
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public MenuItem getDefaultItem () {
+    checkWidget();
+    return null;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is enabled, and
+ * <code>false</code> otherwise. A disabled menu is typically
+ * not selectable from the user interface and draws with an
+ * inactive or "grayed" look.
+ *
+ * @return the receiver's enabled state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #isEnabled
+ */
+public bool getEnabled () {
+    checkWidget();
+    return OS.GTK_WIDGET_SENSITIVE (handle);
+}
+
+/**
+ * Returns the item at the given, zero-relative index in the
+ * receiver. Throws an exception if the index is out of range.
+ *
+ * @param index the index of the item to return
+ * @return the item at the given index
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public MenuItem getItem (int index) {
+    checkWidget();
+    auto list = OS.gtk_container_get_children (cast(GtkContainer*)handle);
+    if (list is null) error (SWT.ERROR_CANNOT_GET_ITEM);
+    int count = OS.g_list_length (list);
+    if (imSeparator !is null) count--;
+    if (imItem !is null) count--;
+    if (!(0 <= index && index < count)) error (SWT.ERROR_INVALID_RANGE);
+    auto data = cast(GtkWidget*)OS.g_list_nth_data (list, index);
+    OS.g_list_free (list);
+    if (data is null) error (SWT.ERROR_CANNOT_GET_ITEM);
+    return cast(MenuItem) display.getWidget (data);
+}
+
+/**
+ * Returns the number of items contained in the receiver.
+ *
+ * @return the number of items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemCount () {
+    checkWidget();
+    auto list = OS.gtk_container_get_children (cast(GtkContainer*)handle);
+    if (list is null) return 0;
+    int count = OS.g_list_length (list);
+    OS.g_list_free (list);
+    if (imSeparator !is null) count--;
+    if (imItem !is null) count--;
+    return count;
+}
+
+/**
+ * Returns a (possibly empty) array of <code>MenuItem</code>s which
+ * are the items in the receiver.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the items in the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public MenuItem [] getItems () {
+    checkWidget();
+    auto list = OS.gtk_container_get_children (cast(GtkContainer*)handle);
+    if (list is null) return new MenuItem [0];
+    int count = OS.g_list_length (list);
+    if (imSeparator !is null) count--;
+    if (imItem !is null) count--;
+    MenuItem [] items = new MenuItem [count];
+    int index = 0;
+    for (int i=0; i<count; i++) {
+        auto data = cast(GtkWidget*)OS.g_list_nth_data (list, i);
+        MenuItem item = cast(MenuItem) display.getWidget (data);
+        if (item !is null) items [index++] = item;
+    }
+    OS.g_list_free (list);
+    if (index !is items.length) {
+        MenuItem [] newItems = new MenuItem[index];
+        System.arraycopy(items, 0, newItems, 0, index);
+        items = newItems;
+    }
+    return items;
+}
+
+override String getNameText () {
+    String result = "";
+    MenuItem [] items = getItems ();
+    int length_ = items.length;
+    if (length_ > 0) {
+        for (int i=0; i<length_-1; i++) {
+            result = result ~ items [i].getNameText() ~ ", ";
+        }
+        result = result ~ items [length_-1].getNameText ();
+    }
+    return result;
+}
+
+/**
+ * Returns the receiver's parent, which must be a <code>Decorations</code>.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Decorations getParent () {
+    checkWidget();
+    return parent;
+}
+
+/**
+ * Returns the receiver's parent item, which must be a
+ * <code>MenuItem</code> or null when the receiver is a
+ * root.
+ *
+ * @return the receiver's parent item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public MenuItem getParentItem () {
+    checkWidget();
+    return cascade;
+}
+
+/**
+ * Returns the receiver's parent item, which must be a
+ * <code>Menu</code> or null when the receiver is a
+ * root.
+ *
+ * @return the receiver's parent item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Menu getParentMenu () {
+    checkWidget();
+    if (cascade is null) return null;
+    return cascade.getParent ();
+}
+
+/**
+ * Returns the receiver's shell. For all controls other than
+ * shells, this simply returns the control's nearest ancestor
+ * shell. Shells return themselves, even if they are children
+ * of other shells.
+ *
+ * @return the receiver's shell
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getParent
+ */
+public Shell getShell () {
+    checkWidget();
+    return parent.getShell ();
+}
+
+/**
+ * Returns <code>true</code> if the receiver is visible, and
+ * <code>false</code> otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, this method
+ * may still indicate that it is considered visible even though
+ * it may not actually be showing.
+ * </p>
+ *
+ * @return the receiver's visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool getVisible () {
+    checkWidget();
+    if ((style & SWT.POP_UP) !is 0) {
+        Menu [] popups = display.popups;
+        if (popups !is null) {
+            for (int i=0; i<popups.length; i++) {
+                if (popups [i] is this) return true;
+            }
+        }
+    }
+    return OS.GTK_WIDGET_MAPPED (handle);
+}
+
+override int /*long*/ gtk_hide (GtkWidget* widget) {
+    if ((style & SWT.POP_UP) !is 0) {
+        display.activeShell = getShell ();
+    }
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 6, 0)) {
+        sendEvent (SWT.Hide);
+    } else {
+        /*
+        * Bug in GTK.  In GTK 2.4 and earlier
+        * a crash could occur if a menu item
+        * was disposed within gtk_hide.  The
+        * workaroud is to post the event instead
+        * of send it on these platforms
+        */
+        postEvent (SWT.Hide);
+    }
+    return 0;
+}
+
+override int /*long*/ gtk_show (GtkWidget* widget) {
+    if ((style & SWT.POP_UP) !is 0) {
+        display.activeShell = getShell ();
+        return 0;
+    }
+    sendEvent (SWT.Show);
+    return 0;
+}
+
+
+override int /*long*/ gtk_show_help (GtkWidget* widget, int /*long*/ helpType) {
+    if (sendHelpEvent (helpType)) {
+        OS.gtk_menu_shell_deactivate (cast(GtkMenuShell*)handle);
+        return 1;
+    }
+    return 0;
+}
+
+override void hookEvents () {
+    super.hookEvents ();
+    OS.g_signal_connect_closure_by_id (handle, display.signalIds [SHOW], 0, display.closures [SHOW], false);
+    OS.g_signal_connect_closure_by_id (handle, display.signalIds [HIDE], 0, display.closures [HIDE], false);
+    OS.g_signal_connect_closure_by_id (handle, display.signalIds [SHOW_HELP], 0, display.closures [SHOW_HELP], false);
+}
+
+/**
+ * Searches the receiver's list starting at the first item
+ * (index 0) until an item is found that is equal to the
+ * argument, and returns the index of that item. If no item
+ * is found, returns -1.
+ *
+ * @param item the search item
+ * @return the index of the item
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int indexOf (MenuItem item) {
+    checkWidget();
+    if (item is null) error (SWT.ERROR_NULL_ARGUMENT);
+    MenuItem [] items = getItems ();
+    for (int i=0; i<items.length; i++) {
+        if (items [i] is item) return i;
+    }
+    return -1;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is enabled and all
+ * of the receiver's ancestors are enabled, and <code>false</code>
+ * otherwise. A disabled menu is typically not selectable from the
+ * user interface and draws with an inactive or "grayed" look.
+ *
+ * @return the receiver's enabled state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getEnabled
+ */
+public bool isEnabled () {
+    checkWidget();
+    Menu parentMenu = getParentMenu ();
+    if (parentMenu is null) {
+        return getEnabled () && parent.isEnabled ();
+    }
+    return getEnabled () && parentMenu.isEnabled ();
+}
+
+/**
+ * Returns <code>true</code> if the receiver is visible and all
+ * of the receiver's ancestors are visible and <code>false</code>
+ * otherwise.
+ *
+ * @return the receiver's visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getVisible
+ */
+public bool isVisible () {
+    checkWidget();
+    return getVisible ();
+}
+
+override void menuPositionProc (GtkMenu* menu, int* x, int* y, int* push_in, void* user_data) {
+    /*
+    * Feature in GTK.  The menu position function sets the position of the
+    * top-left pixel of the menu.  If the menu would be off-screen, GTK will
+    * add a scroll arrow at the bottom and position the first menu entry at
+    * the specified position.  The fix is to flip the menu location to be
+    * completely inside the screen.
+    *
+    * NOTE: This code doesn't work for multiple monitors.
+    */
+    GtkRequisition requisition;
+    OS.gtk_widget_size_request (cast(GtkWidget*)menu, &requisition);
+    int screenHeight = OS.gdk_screen_height ();
+    int reqy = this.y;
+    if (reqy + requisition.height > screenHeight) {
+        reqy = Math.max (0, reqy - requisition.height);
+    }
+    int screenWidth = OS.gdk_screen_width ();
+    int reqx = this.x;
+    if ((style & SWT.RIGHT_TO_LEFT) !is 0) {
+        if (reqx - requisition.width >= 0) reqx -= requisition.width;
+    } else {
+        if (reqx + requisition.width > screenWidth) reqx -= requisition.width;
+    }
+    if (x !is null) *x = reqx;
+    if (y !is null) *y = reqy;
+    if (push_in !is null) *push_in = 1;
+}
+
+override void releaseChildren (bool destroy) {
+    MenuItem [] items = getItems ();
+    for (int i=0; i<items.length; i++) {
+        MenuItem item = items [i];
+        if (item !is null && !item.isDisposed ()) {
+            item.release (false);
+        }
+    }
+    super.releaseChildren (destroy);
+}
+
+override void releaseParent () {
+    super.releaseParent ();
+    if (cascade !is null) cascade.setMenu (null);
+    if ((style & SWT.BAR) !is 0 && this is parent.menuBar) {
+        parent.setMenuBar (null);
+    }  else {
+        if ((style & SWT.POP_UP) !is 0) {
+            display.removePopup (this);
+        }
+    }
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    if (parent !is null) parent.removeMenu (this);
+    parent = null;
+    cascade = null;
+    imItem = null;
+    imSeparator = null;
+    imHandle = null;
+    if (imageList !is null) imageList.dispose ();
+    imageList = null;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the menu events are generated for the control.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see MenuListener
+ * @see #addMenuListener
+ */
+public void removeMenuListener (MenuListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Hide, listener);
+    eventTable.unhook (SWT.Show, listener);
+}
+
+void removeAccelerators (GtkAccelGroup* accelGroup) {
+    MenuItem [] items = getItems ();
+    for (int i = 0; i < items.length; i++) {
+        MenuItem item = items[i];
+        item.removeAccelerators (accelGroup);
+    }
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the help events are generated for the control.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see HelpListener
+ * @see #addHelpListener
+ */
+public void removeHelpListener (HelpListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Help, listener);
+}
+
+bool sendHelpEvent (int /*long*/ helpType) {
+    if (selectedItem !is null && !selectedItem.isDisposed()) {
+        if (selectedItem.hooks (SWT.Help)) {
+            selectedItem.postEvent (SWT.Help);
+            return true;
+        }
+    }
+    if (hooks (SWT.Help)) {
+        postEvent (SWT.Help);
+        return true;
+    }
+    return parent.sendHelpEvent (helpType);
+}
+
+/**
+ * Sets the default menu item to the argument or removes
+ * the default emphasis when the argument is <code>null</code>.
+ *
+ * @param item the default menu item or null
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the menu item has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setDefaultItem (MenuItem item) {
+    checkWidget();
+}
+
+/**
+ * Enables the receiver if the argument is <code>true</code>,
+ * and disables it otherwise. A disabled menu is typically
+ * not selectable from the user interface and draws with an
+ * inactive or "grayed" look.
+ *
+ * @param enabled the new enabled state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setEnabled (bool enabled) {
+    checkWidget();
+    if (enabled) {
+        OS.GTK_WIDGET_SET_FLAGS (handle, OS.GTK_SENSITIVE);
+    } else {
+        OS.GTK_WIDGET_UNSET_FLAGS (handle, OS.GTK_SENSITIVE);
+    }
+}
+
+/**
+ * Sets the location of the receiver, which must be a popup,
+ * to the point specified by the arguments which are relative
+ * to the display.
+ * <p>
+ * Note that this is different from most widgets where the
+ * location of the widget is relative to the parent.
+ * </p><p>
+ * Note that the platform window manager ultimately has control
+ * over the location of popup menus.
+ * </p>
+ *
+ * @param x the new x coordinate for the receiver
+ * @param y the new y coordinate for the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setLocation (int x, int y) {
+    checkWidget();
+    if ((style & (SWT.BAR | SWT.DROP_DOWN)) !is 0) return;
+    this.x = x;
+    this.y = y;
+    hasLocation = true;
+}
+
+/**
+ * Sets the location of the receiver, which must be a popup,
+ * to the point specified by the argument which is relative
+ * to the display.
+ * <p>
+ * Note that this is different from most widgets where the
+ * location of the widget is relative to the parent.
+ * </p><p>
+ * Note that the platform window manager ultimately has control
+ * over the location of popup menus.
+ * </p>
+ *
+ * @param location the new location for the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.1
+ */
+public void setLocation (Point location) {
+    checkWidget();
+    if (location is null) error (SWT.ERROR_NULL_ARGUMENT);
+    setLocation (location.x, location.y);
+}
+
+override void setOrientation() {
+    if ((parent.style & SWT.RIGHT_TO_LEFT) !is 0) {
+        if (handle !is null) OS.gtk_widget_set_direction (handle, OS.GTK_TEXT_DIR_RTL);
+    }
+}
+
+/**
+ * Marks the receiver as visible if the argument is <code>true</code>,
+ * and marks it invisible otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, marking
+ * it visible may not actually cause it to be displayed.
+ * </p>
+ *
+ * @param visible the new visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setVisible (bool visible) {
+    checkWidget();
+    if ((style & (SWT.BAR | SWT.DROP_DOWN)) !is 0) return;
+    if (visible) {
+        display.addPopup (this);
+    } else {
+        display.removePopup (this);
+        _setVisible (false);
+    }
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/MenuItem.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,892 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.MenuItem;
+
+
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.Decorations;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.ImageList;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.events.ArmListener;
+import org.eclipse.swt.events.HelpListener;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Display;
+
+import java.lang.all;
+
+/**
+ * Instances of this class represent a selectable user interface object
+ * that issues notification when pressed and released.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>CHECK, CASCADE, PUSH, RADIO, SEPARATOR</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Arm, Help, Selection</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles CHECK, CASCADE, PUSH, RADIO and SEPARATOR
+ * may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class MenuItem : Item {
+    Menu parent, menu;
+    GtkAccelGroup* groupHandle;
+    int accelerator;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Menu</code>) and a style value
+ * describing its behavior and appearance. The item is added
+ * to the end of the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a menu control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#CHECK
+ * @see SWT#CASCADE
+ * @see SWT#PUSH
+ * @see SWT#RADIO
+ * @see SWT#SEPARATOR
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Menu parent, int style) {
+    super (parent, checkStyle (style));
+    this.parent = parent;
+    createWidget (parent.getItemCount ());
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Menu</code>), a style value
+ * describing its behavior and appearance, and the index
+ * at which to place it in the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a menu control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ * @param index the zero-relative index to store the receiver in its parent
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the parent (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#CHECK
+ * @see SWT#CASCADE
+ * @see SWT#PUSH
+ * @see SWT#RADIO
+ * @see SWT#SEPARATOR
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Menu parent, int style, int index) {
+    super (parent, checkStyle (style));
+    this.parent = parent;
+    int count = parent.getItemCount ();
+    if (!(0 <= index && index <= count)) {
+        error (SWT.ERROR_INVALID_RANGE);
+    }
+    createWidget (index);
+}
+
+void addAccelerator (GtkAccelGroup* accelGroup) {
+    updateAccelerator (accelGroup, true);
+}
+
+void addAccelerators (GtkAccelGroup* accelGroup) {
+    addAccelerator (accelGroup);
+    if (menu !is null) menu.addAccelerators (accelGroup);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the arm events are generated for the control, by sending
+ * it one of the messages defined in the <code>ArmListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ArmListener
+ * @see #removeArmListener
+ */
+public void addArmListener (ArmListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Arm, typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the help events are generated for the control, by sending
+ * it one of the messages defined in the <code>HelpListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see HelpListener
+ * @see #removeHelpListener
+ */
+public void addHelpListener (HelpListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Help, typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the menu item is selected by the user, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * When <code>widgetSelected</code> is called, the stateMask field of the event object is valid.
+ * <code>widgetDefaultSelected</code> is not called.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the menu item is selected by the user
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener (SelectionListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener(listener);
+    addListener (SWT.Selection,typedListener);
+    addListener (SWT.DefaultSelection,typedListener);
+}
+
+static int checkStyle (int style) {
+    return checkBits (style, SWT.PUSH, SWT.CHECK, SWT.RADIO, SWT.SEPARATOR, SWT.CASCADE, 0);
+}
+
+protected override void checkSubclass () {
+    if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+override void createHandle (int index) {
+    state |= HANDLE;
+    char [] buffer = "\0";
+    int bits = SWT.CHECK | SWT.RADIO | SWT.PUSH | SWT.SEPARATOR;
+    switch (style & bits) {
+        case SWT.SEPARATOR:
+            handle = OS.gtk_separator_menu_item_new ();
+            break;
+        case SWT.RADIO:
+            /*
+            * Feature in GTK.  In GTK, radio button must always be part of
+            * a radio button group.  In a GTK radio group, one button is always
+            * selected.  This means that it is not possible to have a single
+            * radio button that is unselected.  This is necessary to allow
+            * applications to implement their own radio behavior or use radio
+            * buttons outside of radio groups.  The fix is to create a hidden
+            * radio button for each radio button we create and add them
+            * to the same group.  This allows the visible button to be
+            * unselected.
+            */
+            groupHandle = cast(GtkAccelGroup*) OS.gtk_radio_menu_item_new (null);
+            if (groupHandle is null) error (SWT.ERROR_NO_HANDLES);
+            OS.g_object_ref (groupHandle);
+            OS.gtk_object_sink (cast(GtkObject*)groupHandle);
+            auto group = OS.gtk_radio_menu_item_get_group (cast(GtkRadioMenuItem*) groupHandle);
+            handle = OS.gtk_radio_menu_item_new_with_label (group, buffer.ptr);
+            break;
+        case SWT.CHECK:
+            handle = OS.gtk_check_menu_item_new_with_label (buffer.ptr);
+            break;
+        case SWT.PUSH:
+        default:
+            handle = OS.gtk_image_menu_item_new_with_label (buffer.ptr);
+            break;
+    }
+    if (handle is null) error (SWT.ERROR_NO_HANDLES);
+    if ((style & SWT.SEPARATOR) is 0) {
+        auto label = OS.gtk_bin_get_child (cast(GtkBin*)handle);
+        OS.gtk_accel_label_set_accel_widget (cast(GtkAccelLabel*)label, null);
+    }
+    auto parentHandle = parent.handle;
+    bool enabled = OS.GTK_WIDGET_SENSITIVE (parentHandle);
+    if (!enabled) OS.GTK_WIDGET_SET_FLAGS (parentHandle, OS.GTK_SENSITIVE);
+    OS.gtk_menu_shell_insert (cast(GtkMenuShell*)parentHandle, handle, index);
+    if (!enabled) OS.GTK_WIDGET_UNSET_FLAGS (parentHandle, OS.GTK_SENSITIVE);
+    OS.gtk_widget_show (handle);
+}
+
+void fixMenus (Decorations newParent) {
+    if (menu !is null) menu.fixMenus (newParent);
+}
+
+/**
+ * Returns the widget accelerator.  An accelerator is the bit-wise
+ * OR of zero or more modifier masks and a key. Examples:
+ * <code>SWT.CONTROL | SWT.SHIFT | 'T', SWT.ALT | SWT.F2</code>.
+ * The default value is zero, indicating that the menu item does
+ * not have an accelerator.
+ *
+ * @return the accelerator or 0
+ *
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getAccelerator () {
+    checkWidget();
+    return accelerator;
+}
+
+GtkAccelGroup* getAccelGroup () {
+    Menu menu = parent;
+    while (menu !is null && menu.cascade !is null) {
+        menu = menu.cascade.parent;
+    }
+    if (menu is null) return null;
+    Decorations shell = menu.parent;
+    return shell.menuBar is menu ? shell.accelGroup : null;
+}
+
+/*public*/ Rectangle getBounds () {
+    checkWidget();
+    if (!OS.GTK_WIDGET_MAPPED (handle)) {
+        return new Rectangle (0, 0, 0, 0);
+    }
+    int x = OS.GTK_WIDGET_X (handle);
+    int y = OS.GTK_WIDGET_Y (handle);
+    int width = OS.GTK_WIDGET_WIDTH (handle);
+    int height = OS.GTK_WIDGET_HEIGHT (handle);
+    return new Rectangle (x, y, width, height);
+}
+
+/**
+ * Returns <code>true</code> if the receiver is enabled, and
+ * <code>false</code> otherwise. A disabled menu item is typically
+ * not selectable from the user interface and draws with an
+ * inactive or "grayed" look.
+ *
+ * @return the receiver's enabled state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #isEnabled
+ */
+public bool getEnabled () {
+    checkWidget();
+    return OS.GTK_WIDGET_SENSITIVE (handle);
+}
+
+/**
+ * Returns the receiver's cascade menu if it has one or null
+ * if it does not. Only <code>CASCADE</code> menu items can have
+ * a pull down menu. The sequence of key strokes, button presses
+ * and/or button releases that are used to request a pull down
+ * menu is platform specific.
+ *
+ * @return the receiver's menu
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Menu getMenu () {
+    checkWidget();
+    return menu;
+}
+
+String getNameText () {
+    if ((style & SWT.SEPARATOR) !is 0) return "|";
+    return super.getNameText ();
+}
+
+/**
+ * Returns the receiver's parent, which must be a <code>Menu</code>.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Menu getParent () {
+    checkWidget();
+    return parent;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is selected,
+ * and false otherwise.
+ * <p>
+ * When the receiver is of type <code>CHECK</code> or <code>RADIO</code>,
+ * it is selected when it is checked.
+ *
+ * @return the selection state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool getSelection () {
+    checkWidget();
+    if ((style & (SWT.CHECK | SWT.RADIO)) is 0) return false;
+    return cast(bool)OS.gtk_check_menu_item_get_active(cast(GtkCheckMenuItem*)handle);
+}
+
+override int /*long*/ gtk_activate (GtkWidget* widget) {
+    if ((style & SWT.CASCADE) !is 0 && menu !is null) return 0;
+    /*
+    * Bug in GTK.  When an ancestor menu is disabled and
+    * the user types an accelerator key, GTK delivers the
+    * the activate signal even though the menu item cannot
+    * be invoked using the mouse.  The fix is to ignore
+    * activate signals when an ancestor menu is disabled.
+    */
+    if (!isEnabled ()) return 0;
+    Event event = new Event ();
+    auto ptr = OS.gtk_get_current_event ();
+    if (ptr !is null) {
+        GdkEvent* gdkEvent = ptr;
+        switch (gdkEvent.type) {
+            case OS.GDK_KEY_PRESS:
+            case OS.GDK_KEY_RELEASE:
+            case OS.GDK_BUTTON_PRESS:
+            case OS.GDK_2BUTTON_PRESS:
+            case OS.GDK_BUTTON_RELEASE: {
+                int state;
+                OS.gdk_event_get_state (ptr, &state);
+                setInputState (event, state);
+                break;
+            }
+            default:
+        }
+        OS.gdk_event_free (ptr);
+    }
+    if ((style & SWT.RADIO) !is 0) {
+        if ((parent.getStyle () & SWT.NO_RADIO_GROUP) is 0) {
+            selectRadio ();
+        }
+    }
+    postEvent (SWT.Selection, event);
+    return 0;
+}
+
+override int /*long*/ gtk_select (int /*long*/ item) {
+    parent.selectedItem = this;
+    sendEvent (SWT.Arm);
+    return 0;
+}
+
+override int /*long*/ gtk_show_help (GtkWidget* widget, int /*long*/ helpType) {
+    bool handled = hooks (SWT.Help);
+    if (handled) {
+        postEvent (SWT.Help);
+    } else {
+        handled = parent.sendHelpEvent (helpType);
+    }
+    if (handled) {
+        OS.gtk_menu_shell_deactivate (cast(GtkMenuShell*)parent.handle);
+        return 1;
+    }
+    return 0;
+}
+
+override void hookEvents () {
+    super.hookEvents ();
+    OS.g_signal_connect_closure (handle, OS.activate.ptr, display.closures [ACTIVATE], false);
+    OS.g_signal_connect_closure (handle, OS.select.ptr, display.closures [SELECT], false);
+    OS.g_signal_connect_closure_by_id (handle, display.signalIds [SHOW_HELP], 0, display.closures [SHOW_HELP], false);
+}
+
+/**
+ * Returns <code>true</code> if the receiver is enabled and all
+ * of the receiver's ancestors are enabled, and <code>false</code>
+ * otherwise. A disabled menu item is typically not selectable from the
+ * user interface and draws with an inactive or "grayed" look.
+ *
+ * @return the receiver's enabled state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getEnabled
+ */
+public bool isEnabled () {
+    return getEnabled () && parent.isEnabled ();
+}
+
+override void releaseChildren (bool destroy) {
+    if (menu !is null) {
+        menu.release (false);
+        menu = null;
+    }
+    super.releaseChildren (destroy);
+}
+
+override void releaseParent () {
+    super.releaseParent ();
+    if (menu !is null) {
+        if (menu.selectedItem is this) menu.selectedItem = null;
+        menu.dispose ();
+    }
+    menu = null;
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    auto accelGroup = getAccelGroup ();
+    if (accelGroup !is null) removeAccelerator (accelGroup);
+    if (groupHandle !is null) OS.g_object_unref (groupHandle);
+    groupHandle = null;
+    accelerator = 0;
+    parent = null;
+}
+
+void removeAccelerator (GtkAccelGroup* accelGroup) {
+    updateAccelerator (accelGroup, false);
+}
+
+void removeAccelerators (GtkAccelGroup* accelGroup) {
+    removeAccelerator (accelGroup);
+    if (menu !is null) menu.removeAccelerators (accelGroup);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the arm events are generated for the control.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ArmListener
+ * @see #addArmListener
+ */
+public void removeArmListener (ArmListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Arm, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the help events are generated for the control.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see HelpListener
+ * @see #addHelpListener
+ */
+public void removeHelpListener (HelpListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Help, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is selected by the user.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener (SelectionListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Selection, listener);
+    eventTable.unhook (SWT.DefaultSelection,listener);
+}
+void selectRadio () {
+    int index = 0;
+    MenuItem [] items = parent.getItems ();
+    while (index < items.length && items [index] !is this) index++;
+    int i = index - 1;
+    while (i >= 0 && items [i].setRadioSelection (false)) --i;
+    int j = index + 1;
+    while (j < items.length && items [j].setRadioSelection (false)) j++;
+    setSelection (true);
+}
+/**
+ * Sets the widget accelerator.  An accelerator is the bit-wise
+ * OR of zero or more modifier masks and a key. Examples:
+ * <code>SWT.MOD1 | SWT.MOD2 | 'T', SWT.MOD3 | SWT.F2</code>.
+ * <code>SWT.CONTROL | SWT.SHIFT | 'T', SWT.ALT | SWT.F2</code>.
+ * The default value is zero, indicating that the menu item does
+ * not have an accelerator.
+ *
+ * @param accelerator an integer that is the bit-wise OR of masks and a key
+ *
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setAccelerator (int accelerator) {
+    checkWidget();
+    if (this.accelerator is accelerator) return;
+    auto accelGroup = getAccelGroup ();
+    if (accelGroup !is null) removeAccelerator (accelGroup);
+    this.accelerator = accelerator;
+    if (accelGroup !is null) addAccelerator (accelGroup);
+}
+
+/**
+ * Enables the receiver if the argument is <code>true</code>,
+ * and disables it otherwise. A disabled menu item is typically
+ * not selectable from the user interface and draws with an
+ * inactive or "grayed" look.
+ *
+ * @param enabled the new enabled state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setEnabled (bool enabled) {
+    checkWidget();
+    if (OS.GTK_WIDGET_SENSITIVE (handle) is enabled) return;
+    auto accelGroup = getAccelGroup ();
+    if (accelGroup !is null) removeAccelerator (accelGroup);
+    OS.gtk_widget_set_sensitive (handle, enabled);
+    if (accelGroup !is null) addAccelerator (accelGroup);
+}
+
+/**
+ * Sets the image the receiver will display to the argument.
+ * <p>
+ * Note: This operation is a hint and is not supported on
+ * platforms that do not have this concept (for example, Windows NT).
+ * </p>
+ *
+ * @param image the image to display
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public override void setImage (Image image) {
+    checkWidget();
+    if ((style & SWT.SEPARATOR) !is 0) return;
+    super.setImage (image);
+    if (!OS.GTK_IS_IMAGE_MENU_ITEM (cast(GTypeInstance*)handle)) return;
+    if (image !is null) {
+        ImageList imageList = parent.imageList;
+        if (imageList is null) imageList = parent.imageList = new ImageList ();
+        int imageIndex = imageList.indexOf (image);
+        if (imageIndex is -1) {
+            imageIndex = imageList.add (image);
+        } else {
+            imageList.put (imageIndex, image);
+        }
+        auto pixbuf = imageList.getPixbuf (imageIndex);
+        auto imageHandle = OS.gtk_image_new_from_pixbuf (pixbuf);
+        OS.gtk_image_menu_item_set_image (cast(GtkImageMenuItem*)handle, imageHandle);
+        OS.gtk_widget_show (imageHandle);
+    } else {
+        OS.gtk_image_menu_item_set_image (cast(GtkImageMenuItem*)handle, null);
+    }
+}
+
+/**
+ * Sets the receiver's pull down menu to the argument.
+ * Only <code>CASCADE</code> menu items can have a
+ * pull down menu. The sequence of key strokes, button presses
+ * and/or button releases that are used to request a pull down
+ * menu is platform specific.
+ * <p>
+ * Note: Disposing of a menu item that has a pull down menu
+ * will dispose of the menu.  To avoid this behavior, set the
+ * menu to null before the menu item is disposed.
+ * </p>
+ *
+ * @param menu the new pull down menu
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_MENU_NOT_DROP_DOWN - if the menu is not a drop down menu</li>
+ *    <li>ERROR_MENUITEM_NOT_CASCADE - if the menu item is not a <code>CASCADE</code></li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the menu has been disposed</li>
+ *    <li>ERROR_INVALID_PARENT - if the menu is not in the same widget tree</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMenu (Menu menu) {
+    checkWidget ();
+
+    /* Check to make sure the new menu is valid */
+    if ((style & SWT.CASCADE) is 0) {
+        error (SWT.ERROR_MENUITEM_NOT_CASCADE);
+    }
+    if (menu !is null) {
+        if ((menu.style & SWT.DROP_DOWN) is 0) {
+            error (SWT.ERROR_MENU_NOT_DROP_DOWN);
+        }
+        if (menu.parent !is parent.parent) {
+            error (SWT.ERROR_INVALID_PARENT);
+        }
+    }
+
+    /* Assign the new menu */
+    Menu oldMenu = this.menu;
+    if (oldMenu is menu) return;
+    auto accelGroup = getAccelGroup ();
+    if (accelGroup !is null) removeAccelerators (accelGroup);
+    if (oldMenu !is null) {
+        oldMenu.cascade = null;
+        /*
+        * Add a reference to the menu we are about
+        * to replace or GTK will destroy it.
+        */
+        OS.g_object_ref (oldMenu.handle);
+        OS.gtk_menu_item_remove_submenu (cast(GtkMenuItem*)handle);
+    }
+    if ((this.menu = menu) !is null) {
+        menu.cascade = this;
+        OS.gtk_menu_item_set_submenu (cast(GtkMenuItem*)handle, menu.handle);
+    }
+    if (accelGroup !is null) addAccelerators (accelGroup);
+}
+
+override void setOrientation() {
+    if ((parent.style & SWT.RIGHT_TO_LEFT) !is 0) {
+        if (handle !is null) {
+            OS.gtk_widget_set_direction (handle, OS.GTK_TEXT_DIR_RTL);
+            OS.gtk_container_forall (cast(GtkContainer*)handle, cast(GtkCallback)&Display.setDirectionProcFunc, cast(void*)OS.GTK_TEXT_DIR_RTL);
+        }
+    }
+}
+
+bool setRadioSelection (bool value) {
+    if ((style & SWT.RADIO) is 0) return false;
+    if (getSelection () !is value) {
+        setSelection (value);
+        postEvent (SWT.Selection);
+    }
+    return true;
+}
+
+/**
+ * Sets the selection state of the receiver.
+ * <p>
+ * When the receiver is of type <code>CHECK</code> or <code>RADIO</code>,
+ * it is selected when it is checked.
+ *
+ * @param selected the new selection state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (bool selected) {
+    checkWidget();
+    if ((style & (SWT.CHECK | SWT.RADIO)) is 0) return;
+    OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udACTIVATE);
+    OS.gtk_check_menu_item_set_active (cast(GtkCheckMenuItem*)handle, selected);
+    if ((style & SWT.RADIO) !is 0) OS.gtk_check_menu_item_set_active (cast(GtkCheckMenuItem*)groupHandle, !selected);
+    OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udACTIVATE);
+}
+
+/**
+ * Sets the receiver's text. The string may include
+ * the mnemonic character and accelerator text.
+ * <p>
+ * Mnemonics are indicated by an '&amp;' that causes the next
+ * character to be the mnemonic.  When the user presses a
+ * key sequence that matches the mnemonic, a selection
+ * event occurs. On most platforms, the mnemonic appears
+ * underlined but may be emphasised in a platform specific
+ * manner.  The mnemonic indicator character '&amp;' can be
+ * escaped by doubling it in the string, causing a single
+ * '&amp;' to be displayed.
+ * </p>
+ * <p>
+ * Accelerator text is indicated by the '\t' character.
+ * On platforms that support accelerator text, the text
+ * that follows the '\t' character is displayed to the user,
+ * typically indicating the key stroke that will cause
+ * the item to become selected.  On most platforms, the
+ * accelerator text appears right aligned in the menu.
+ * Setting the accelerator text does not install the
+ * accelerator key sequence. The accelerator key sequence
+ * is installed using #setAccelerator.
+ * </p>
+ *
+ * @param string the new text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setAccelerator
+ */
+public override void setText (String string) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if ((style & SWT.SEPARATOR) !is 0) return;
+    if (text.equals(string)) return;
+    super.setText (string);
+    String accelString = "";
+    int index = string.indexOf ('\t');
+    if (index !is -1) {
+        bool isRTL = (parent.style & SWT.RIGHT_TO_LEFT) !is 0;
+        accelString = (isRTL? "" : "  ") ~ string.substring (index+1, string.length) ~ (isRTL? "  " : "");
+        string = string.substring (0, index);
+    }
+    char [] chars = fixMnemonic (string);
+    auto label = OS.gtk_bin_get_child (cast(GtkBin*)handle);
+    OS.gtk_label_set_text_with_mnemonic (cast(GtkLabel*)label, chars.toStringzValidPtr() );
+
+    auto ptr = cast(char*)OS.g_malloc (accelString.length + 1);
+    ptr[ 0 .. accelString.length ] = accelString;
+    ptr[ accelString.length ] = '\0';
+
+    auto oldPtr = OS.GTK_ACCEL_LABEL_GET_ACCEL_STRING (cast(GtkAccelLabel*)label);
+    OS.GTK_ACCEL_LABEL_SET_ACCEL_STRING (cast(GtkAccelLabel*)label, ptr);
+    if (oldPtr !is null) OS.g_free (oldPtr);
+}
+
+void updateAccelerator (GtkAccelGroup* accelGroup, bool add) {
+    if (accelerator is 0 || !getEnabled ()) return;
+    if ((accelerator & SWT.COMMAND) !is 0) return;
+    int mask = 0;
+    if ((accelerator & SWT.ALT) !is 0) mask |= OS.GDK_MOD1_MASK;
+    if ((accelerator & SWT.SHIFT) !is 0) mask |= OS.GDK_SHIFT_MASK;
+    if ((accelerator & SWT.CONTROL) !is 0) mask |= OS.GDK_CONTROL_MASK;
+    int keysym = accelerator & SWT.KEY_MASK;
+    int newKey = Display.untranslateKey (keysym);
+    if (newKey !is 0) {
+        keysym = newKey;
+    } else {
+        switch (keysym) {
+            case '\r': keysym = OS.GDK_Return; break;
+            default: keysym = Display.wcsToMbcs (cast(char) keysym);
+        }
+    }
+    /* When accel_key is zero, it causes GTK warnings */
+    if (keysym !is 0) {
+        if (add) {
+            OS.gtk_widget_add_accelerator (handle, OS.activate.ptr, accelGroup, keysym, mask, OS.GTK_ACCEL_VISIBLE);
+        } else {
+            OS.gtk_widget_remove_accelerator (handle, accelGroup, keysym, mask);
+        }
+    }
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/MessageBox.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,271 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.MessageBox;
+
+import java.lang.all;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Dialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Display;
+
+
+/**
+ * Instances of this class are used to inform or warn the user.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>ICON_ERROR, ICON_INFORMATION, ICON_QUESTION, ICON_WARNING, ICON_WORKING</dd>
+ * <dd>OK, OK | CANCEL</dd>
+ * <dd>YES | NO, YES | NO | CANCEL</dd>
+ * <dd>RETRY | CANCEL</dd>
+ * <dd>ABORT | RETRY | IGNORE</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles ICON_ERROR, ICON_INFORMATION, ICON_QUESTION,
+ * ICON_WARNING and ICON_WORKING may be specified.
+ * </p><p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample, Dialog tab</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class MessageBox : Dialog {
+
+    alias Dialog.checkStyle checkStyle;
+
+    String message = "";
+    GtkWidget* handle;
+    private bool allowNullParent = false;
+/**
+ * Constructs a new instance of this class given only its parent.
+ *
+ * @param parent a shell which will be the parent of the new instance
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ */
+public this (Shell parent) {
+    this (parent, SWT.OK | SWT.ICON_INFORMATION | SWT.APPLICATION_MODAL);
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ *
+ * @param parent a shell which will be the parent of the new instance
+ * @param style the style of dialog to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ */
+public this (Shell parent, int style) {
+    super (parent, checkStyle (parent, checkStyle (style)));
+    checkSubclass ();
+}
+
+/++
+ + SWT extension, a MessageBox with no parent
+ +/
+public this (int style) {
+    allowNullParent = true;
+    super (parent, checkStyle (parent, checkStyle (style)));
+    checkSubclass ();
+}
+// PORT
+// actually, the parent can be null
+override void checkParent (Shell parent){
+    if( !allowNullParent ){
+        super.checkParent( parent );
+    }
+}
+
+/**
+ * Returns the dialog's message, or an empty string if it does not have one.
+ * The message is a description of the purpose for which the dialog was opened.
+ * This message will be visible in the dialog while it is open.
+ *
+ * @return the message
+ */
+public String getMessage () {
+    return message;
+}
+
+/**
+ * Sets the dialog's message, which is a description of
+ * the purpose for which it was opened. This message will be
+ * visible on the dialog while it is open.
+ *
+ * @param string the message
+ *
+ */
+public void setMessage (String string) {
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    message = string;
+}
+
+/**
+ * Makes the dialog visible and brings it to the front
+ * of the display.
+ *
+ * @return the ID of the button that was selected to dismiss the
+ *         message box (e.g. SWT.OK, SWT.CANCEL, etc.)
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the dialog has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the dialog</li>
+ * </ul>
+ */
+public int open () {
+    GtkWidget* parentHandle = (parent !is null) ? parent.topHandle() : null;
+    int dialogFlags = OS.GTK_DIALOG_DESTROY_WITH_PARENT;
+    if ((style & (SWT.PRIMARY_MODAL | SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL)) !is 0) {
+        dialogFlags |= OS.GTK_DIALOG_MODAL;
+    }
+    int messageType = OS.GTK_MESSAGE_INFO;
+    if ((style & (SWT.ICON_WARNING)) !is 0)  messageType = OS.GTK_MESSAGE_WARNING;
+    if ((style & (SWT.ICON_QUESTION)) !is 0) messageType = OS.GTK_MESSAGE_QUESTION;
+    if ((style & (SWT.ICON_ERROR)) !is 0)    messageType = OS.GTK_MESSAGE_ERROR;
+
+    char* buffer = toStringz( fixPercent (message));
+    handle = cast(GtkWidget*)OS.gtk_message_dialog_new(parentHandle, dialogFlags, messageType, 0, buffer);
+    if (handle is null) SWT.error(SWT.ERROR_NO_HANDLES);
+    if (parentHandle !is null) {
+        auto pixbufs = OS.gtk_window_get_icon_list (parentHandle);
+        if (pixbufs !is null) {
+            OS.gtk_window_set_icon_list (handle, pixbufs);
+            OS.g_list_free (pixbufs);
+        }
+    }
+    createButtons();
+    buffer = toStringz(title);
+    OS.gtk_window_set_title(handle,buffer);
+    Display display = parent !is null ? parent.getDisplay (): Display.getCurrent ();
+    display.addIdleProc ();
+    Dialog oldModal = null;
+    if (OS.gtk_window_get_modal (handle)) {
+        oldModal = display.getModalDialog ();
+        display.setModalDialog (this);
+    }
+    int signalId = 0;
+    int /*long*/ hookId = 0;
+    CallbackData emissionData;
+    emissionData.display = display;
+    emissionData.data = handle;
+    if ((style & SWT.RIGHT_TO_LEFT) !is 0) {
+        signalId = OS.g_signal_lookup (OS.map.ptr, OS.GTK_TYPE_WIDGET());
+        hookId = OS.g_signal_add_emission_hook (signalId, 0, &Display.emissionFunc, &emissionData, null);
+    }
+    int response = OS.gtk_dialog_run (handle);
+    if ((style & SWT.RIGHT_TO_LEFT) !is 0) {
+        OS.g_signal_remove_emission_hook (signalId, hookId);
+    }
+    if (OS.gtk_window_get_modal (handle)) {
+        display.setModalDialog (oldModal);
+    }
+    display.removeIdleProc ();
+    OS.gtk_widget_destroy (handle);
+    return response;
+}
+
+private void createButtons() {
+    if ((style & SWT.OK) !is 0) OS.gtk_dialog_add_button(handle, "gtk-ok".ptr, SWT.OK);
+    if ((style & SWT.CANCEL) !is 0) OS.gtk_dialog_add_button(handle, "gtk-cancel".ptr, SWT.CANCEL);
+    if ((style & SWT.YES) !is 0) OS.gtk_dialog_add_button(handle, "gtk-yes".ptr, SWT.YES);
+    if ((style & SWT.NO) !is 0) OS.gtk_dialog_add_button(handle, "gtk-no".ptr, SWT.NO);
+    if ((style & SWT.ABORT) !is 0) OS.gtk_dialog_add_button(handle, toStringz( SWT.getMessage("SWT_Abort")), SWT.ABORT);
+    if ((style & SWT.RETRY) !is 0) OS.gtk_dialog_add_button(handle, toStringz( SWT.getMessage("SWT_Retry")), SWT.RETRY);
+    if ((style & SWT.IGNORE) !is 0) OS.gtk_dialog_add_button(handle, toStringz( SWT.getMessage("SWT_Ignore")), SWT.IGNORE);
+}
+
+private static int checkStyle (int style) {
+    int mask = (SWT.YES | SWT.NO | SWT.OK | SWT.CANCEL | SWT.ABORT | SWT.RETRY | SWT.IGNORE);
+    int bits = style & mask;
+    if (bits is SWT.OK || bits is SWT.CANCEL || bits is (SWT.OK | SWT.CANCEL)) return style;
+    if (bits is SWT.YES || bits is SWT.NO || bits is (SWT.YES | SWT.NO) || bits is (SWT.YES | SWT.NO | SWT.CANCEL)) return style;
+    if (bits is (SWT.RETRY | SWT.CANCEL) || bits is (SWT.ABORT | SWT.RETRY | SWT.IGNORE)) return style;
+    style = (style & ~mask) | SWT.OK;
+    return style;
+}
+
+char[] fixPercent (String string) {
+    int i = 0, j = 0;
+    char [] result = new String( string.length * 2 );
+    while (i < string.length) {
+        switch (string [i]) {
+            case '%':
+                result [j++] = '%';
+                break;
+            default:
+        }
+        result [j++] = string [i++];
+    }
+    return result[ 0 .. j ];
+}
+
+
+/++
+ + SWT extension
+ +/
+public static int showMessageBox(String str, String title, Shell shell, int style) {
+    MessageBox msgBox = (shell is null ) ? new MessageBox( style ) : new MessageBox(shell, style);
+    msgBox.setMessage(str);
+    if(title !is null){
+        msgBox.setText(title);
+    }
+    return msgBox.open();
+}
+
+/// SWT extension
+public static int showInfo(String str, String title = null, Shell shell = null) {
+    return showMessageBox( str, title, shell, SWT.OK | SWT.ICON_INFORMATION );
+}
+/// SWT extension
+alias showInfo showInformation;
+
+/// SWT extension
+public static int showWarning(String str, String title = null, Shell shell = null) {
+    return showMessageBox( str, title, shell, SWT.OK | SWT.ICON_WARNING );
+}
+/// SWT extension
+public static int showError(String str, String title = null, Shell shell = null) {
+    return showMessageBox( str, title, shell, SWT.OK | SWT.ICON_ERROR );
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Monitor.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Monitor;
+
+import java.lang.all;
+
+import org.eclipse.swt.graphics.Rectangle;
+
+/**
+ * Instances of this class are descriptions of monitors.
+ *
+ * @see Display
+ * @see <a href="http://www.eclipse.org/swt/snippets/#monitor">Monitor snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.0
+ */
+public final class Monitor {
+    int /*long*/ handle;
+    int x, y, width, height;
+    int clientX, clientY, clientWidth, clientHeight;
+
+/**
+ * Prevents uninitialized instances from being created outside the package.
+ */
+this () {
+}
+
+/**
+ * Compares the argument to the receiver, and returns true
+ * if they represent the <em>same</em> object using a class
+ * specific comparison.
+ *
+ * @param object the object to compare with this object
+ * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
+ *
+ * @see #hashCode()
+ */
+public override int opEquals (Object object) {
+    if (object is this) return true;
+    if ( auto mon = cast(org.eclipse.swt.widgets.Monitor.Monitor)object ){
+       return handle is mon.handle;
+    }
+    return false;
+}
+
+/**
+ * Returns a rectangle describing the receiver's size and location
+ * relative to its device. Note that on multi-monitor systems the
+ * origin can be negative.
+ *
+ * @return the receiver's bounding rectangle
+ */
+public Rectangle getBounds () {
+    return new Rectangle (x, y, width, height);
+}
+
+/**
+ * Returns a rectangle which describes the area of the
+ * receiver which is capable of displaying data.
+ *
+ * @return the client area
+ */
+public Rectangle getClientArea () {
+    return new Rectangle (clientX, clientY, clientWidth, clientHeight);
+}
+
+/**
+ * Returns an integer hash code for the receiver. Any two
+ * objects that return <code>true</code> when passed to
+ * <code>equals</code> must return the same value for this
+ * method.
+ *
+ * @return the receiver's hash
+ *
+ * @see #equals(Object)
+ */
+public override hash_t toHash() {
+    return cast(hash_t)handle;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/ProgressBar.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,312 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.ProgressBar;
+
+import java.lang.all;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.internal.gtk.OS;
+
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+
+
+/**
+ * Instances of the receiver represent an unselectable
+ * user interface object that is used to display progress,
+ * typically in the form of a bar.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>SMOOTH, HORIZONTAL, VERTICAL, INDETERMINATE</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles HORIZONTAL and VERTICAL may be specified.
+ * </p><p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#progressbar">ProgressBar snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class ProgressBar : Control {
+    CallbackData callbackData;
+    int timerId, minimum = 0, maximum = 100, selection = 0;
+    static const int DELAY = 100;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#SMOOTH
+ * @see SWT#HORIZONTAL
+ * @see SWT#VERTICAL
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Composite parent, int style) {
+    super (parent, checkStyle(style));
+}
+
+static int checkStyle (int style) {
+    style |= SWT.NO_FOCUS;
+    return checkBits (style, SWT.HORIZONTAL, SWT.VERTICAL, 0, 0, 0, 0);
+}
+
+override void createHandle (int index) {
+    state |= HANDLE;
+    fixedHandle = cast(GtkWidget*)OS.g_object_new (display.gtk_fixed_get_type (), null);
+    if (fixedHandle is null) error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_fixed_set_has_window (fixedHandle, true);
+    handle = OS.gtk_progress_bar_new ();
+    if (handle is null) error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_container_add (fixedHandle, handle);
+    int orientation = ((style & SWT.VERTICAL) !is 0 ) ? OS.GTK_PROGRESS_BOTTOM_TO_TOP : OS.GTK_PROGRESS_LEFT_TO_RIGHT;
+    OS.gtk_progress_bar_set_orientation (handle, orientation);
+    if ((style & SWT.INDETERMINATE) !is 0) {
+        timerId = display.doWindowTimerAdd( &callbackData, DELAY, handle );
+    }
+}
+
+/**
+ * Returns the maximum value which the receiver will allow.
+ *
+ * @return the maximum
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getMaximum () {
+    checkWidget ();
+    return maximum;
+}
+
+/**
+ * Returns the minimum value which the receiver will allow.
+ *
+ * @return the minimum
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getMinimum () {
+    checkWidget ();
+    return minimum;
+}
+
+/**
+ * Returns the single 'selection' that is the receiver's position.
+ *
+ * @return the selection
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSelection () {
+    checkWidget ();
+    return selection;
+}
+
+/**
+ * Returns the state of the receiver. The value will be one of:
+ * <ul>
+ *  <li>{@link SWT#NORMAL}</li>
+ *  <li>{@link SWT#ERROR}</li>
+ *  <li>{@link SWT#PAUSED}</li>
+ * </ul>
+ *
+ * @return the state 
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * 
+ * @since 3.4
+ */
+public int getState () {
+    checkWidget ();
+    return SWT.NORMAL;
+}
+
+override int gtk_realize (GtkWidget* widget) {
+    int result = super.gtk_realize (widget);
+    if (result !is 0) return result;
+    /*
+    * Bug in GTK.  When a progress bar has been unrealized after being
+    * realized at least once, gtk_progress_bar_set_fraction() GP's.  The
+    * fix is to update the progress bar state only when realized and restore
+    * the state when the progress bar becomes realized.
+    */
+    updateBar (selection, minimum, maximum);
+    return 0;
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    if (timerId !is 0) OS.gtk_timeout_remove (timerId);
+    timerId = 0;
+}
+
+override void setParentBackground () {
+    /*
+    * Bug in GTK.  For some reason, some theme managers will crash
+    * when the progress bar is inheriting the background from a parent.
+    * The fix is to stop inheriting the background. This is acceptable
+    * since progress bars do not use the inherited background.
+    */
+}
+
+/**
+ * Sets the maximum value that the receiver will allow.  This new
+ * value will be ignored if it is not greater than the receiver's current
+ * minimum value.  If the new maximum is applied then the receiver's
+ * selection value will be adjusted if necessary to fall within its new range.
+ *
+ * @param value the new maximum, which must be greater than the current minimum
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMaximum (int value) {
+    checkWidget ();
+    if (value <= minimum) return;
+    maximum = value;
+    selection = Math.min (selection, maximum);
+    updateBar (selection, minimum, maximum);
+}
+
+/**
+ * Sets the minimum value that the receiver will allow.  This new
+ * value will be ignored if it is negative or is not less than the receiver's
+ * current maximum value.  If the new minimum is applied then the receiver's
+ * selection value will be adjusted if necessary to fall within its new range.
+ *
+ * @param value the new minimum, which must be nonnegative and less than the current maximum
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMinimum (int value) {
+    checkWidget ();
+    if (value < 0 || value >= maximum) return;
+    minimum = value;
+    selection = Math.max (selection, minimum);
+    updateBar (selection, minimum, maximum);
+}
+
+/**
+ * Sets the single 'selection' that is the receiver's
+ * position to the argument which must be greater than or equal
+ * to zero.
+ *
+ * @param value the new selection (must be zero or greater)
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (int value) {
+    checkWidget ();
+    selection = Math.max (minimum, Math.min (maximum, value));
+    updateBar (selection, minimum, maximum);
+}
+
+/**
+ * Sets the state of the receiver. The state must be one of these values:
+ * <ul>
+ *  <li>{@link SWT#NORMAL}</li>
+ *  <li>{@link SWT#ERROR}</li>
+ *  <li>{@link SWT#PAUSED}</li>
+ * </ul>
+ *
+ * @param state the new state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * 
+ * @since 3.4
+ */
+public void setState (int state) {
+    checkWidget ();
+    //NOT IMPLEMENTED
+}
+
+override int /*long*/ timerProc (GtkWidget* widget) {
+    if (isVisible ()) OS.gtk_progress_bar_pulse (handle);
+    return 1;
+}
+
+void updateBar (int selection, int minimum, int maximum) {
+   /*
+    * Bug in GTK.  When a progress bar has been unrealized after being
+    * realized at least once, gtk_progress_bar_set_fraction() GP's.  The
+    * fix is to update the progress bar state only when realized and restore
+    * the state when the progress bar becomes realized.
+    */
+    if ((OS.GTK_WIDGET_FLAGS (handle) & OS.GTK_REALIZED) is 0) return;
+
+    double fraction = minimum is maximum ? 1 : cast(double)(selection - minimum) / (maximum - minimum);
+    OS.gtk_progress_bar_set_fraction (handle, fraction);
+    /*
+    * Feature in GTK.  The progress bar does
+    * not redraw right away when a value is
+    * changed.  This is not strictly incorrect
+    * but unexpected.  The fix is to force all
+    * outstanding redraws to be delivered.
+    */
+    auto window = paintWindow ();
+    OS.gdk_window_process_updates (window, false);
+    OS.gdk_flush ();
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/RunnableLock.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.RunnableLock;
+
+import java.lang.all;
+
+import tango.core.Thread;
+import tango.core.Exception;
+import tango.core.sync.Condition;
+import tango.core.sync.Mutex;
+
+/**
+ * Instances of this class are used to ensure that an
+ * application cannot interfere with the locking mechanism
+ * used to implement asynchronous and synchronous communication
+ * between widgets and background threads.
+ */
+
+class RunnableLock : Mutex {
+    Runnable runnable;
+    Thread thread;
+    Exception throwable;
+
+    Condition cond;
+
+this (Runnable runnable) {
+    this.runnable = runnable;
+    this.cond = new Condition(this);
+}
+
+bool done () {
+    return runnable is null || throwable !is null;
+}
+
+void run () {
+    if (runnable !is null) runnable.run ();
+    runnable = null;
+}
+
+void notifyAll(){
+    cond.notifyAll();
+}
+void wait(){
+    cond.wait();
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Sash.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,448 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Sash;
+
+import java.lang.all;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.internal.gtk.OS;
+
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.widgets.Event;
+
+/**
+ * Instances of the receiver represent a selectable user interface object
+ * that allows the user to drag a rubber banded outline of the sash within
+ * the parent control.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>HORIZONTAL, VERTICAL, SMOOTH</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles HORIZONTAL and VERTICAL may be specified.
+ * </p><p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#sash">Sash snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class Sash : Control {
+
+    alias Control.computeSize computeSize;
+    alias Control.setCursor setCursor;
+
+    bool dragging;
+    int startX, startY, lastX, lastY;
+    GtkWidget* defaultCursor;
+
+    private final static int INCREMENT = 1;
+    private final static int PAGE_INCREMENT = 9;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#HORIZONTAL
+ * @see SWT#VERTICAL
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Composite parent, int style) {
+    super (parent, checkStyle (style));
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the control is selected by the user, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * When <code>widgetSelected</code> is called, the x, y, width, and height fields of the event object are valid.
+ * If the receiver is being dragged, the event object detail field contains the value <code>SWT.DRAG</code>.
+ * <code>widgetDefaultSelected</code> is not called.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the control is selected by the user
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener (SelectionListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Selection,typedListener);
+    addListener (SWT.DefaultSelection,typedListener);
+}
+
+static int checkStyle (int style) {
+    return checkBits (style, SWT.HORIZONTAL, SWT.VERTICAL, 0, 0, 0, 0);
+}
+
+public override Point computeSize (int wHint, int hHint, bool changed) {
+    checkWidget ();
+    if (wHint !is SWT.DEFAULT && wHint < 0) wHint = 0;
+    if (hHint !is SWT.DEFAULT && hHint < 0) hHint = 0;
+    int border = getBorderWidth ();
+    int width = border * 2, height = border * 2;
+    if ((style & SWT.HORIZONTAL) !is 0) {
+        width += DEFAULT_WIDTH;  height += 3;
+    } else {
+        width += 3; height += DEFAULT_HEIGHT;
+    }
+    if (wHint !is SWT.DEFAULT) width = wHint + (border * 2);
+    if (hHint !is SWT.DEFAULT) height = hHint + (border * 2);
+    return new Point (width, height);
+}
+
+override void createHandle (int index) {
+    state |= HANDLE | THEME_BACKGROUND;
+    handle = cast(GtkWidget*)OS.g_object_new (display.gtk_fixed_get_type (), null);
+    if (handle is null) error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_fixed_set_has_window (handle, true);
+    OS.GTK_WIDGET_SET_FLAGS (handle, OS.GTK_CAN_FOCUS);
+    int type = (style & SWT.VERTICAL) !is 0 ? OS.GDK_SB_H_DOUBLE_ARROW : OS.GDK_SB_V_DOUBLE_ARROW;
+    defaultCursor = cast(GtkWidget*)OS.gdk_cursor_new (type);
+}
+
+void drawBand (int x, int y, int width, int height) {
+    if ((style & SWT.SMOOTH) !is 0) return;
+    auto window = OS.GTK_WIDGET_WINDOW (parent.paintHandle());
+    if (window is null) return;
+    char [] bits = cast(String)[ cast(byte)-86, 85, -86, 85, -86, 85, -86, 85 ];
+    auto stipplePixmap = OS.gdk_bitmap_create_from_data (cast(GdkDrawable*)window, bits.ptr, 8, 8);
+    auto gc = OS.gdk_gc_new (window);
+    auto colormap = OS.gdk_colormap_get_system();
+    GdkColor color;
+    OS.gdk_color_white (colormap, &color);
+    OS.gdk_gc_set_foreground (gc, &color);
+    OS.gdk_gc_set_stipple (gc, stipplePixmap);
+    OS.gdk_gc_set_subwindow (gc, OS.GDK_INCLUDE_INFERIORS);
+    OS.gdk_gc_set_fill (gc, OS.GDK_STIPPLED);
+    OS.gdk_gc_set_function (gc, OS.GDK_XOR);
+    OS.gdk_draw_rectangle (window, gc, 1, x, y, width, height);
+    OS.g_object_unref (stipplePixmap);
+    OS.g_object_unref (gc);
+}
+
+override int gtk_button_press_event (GtkWidget* widget, GdkEventButton* gdkEvent) {
+    auto result = super.gtk_button_press_event (widget, gdkEvent);
+    if (result !is 0) return result;
+    int button = gdkEvent.button;
+    if (button !is 1) return 0;
+    if (gdkEvent.type is OS.GDK_2BUTTON_PRESS) return 0;
+    if (gdkEvent.type is OS.GDK_3BUTTON_PRESS) return 0;
+    auto window = OS.GTK_WIDGET_WINDOW (widget);
+    int origin_x, origin_y;
+    OS.gdk_window_get_origin (window, &origin_x, &origin_y);
+    startX = cast(int) (gdkEvent.x_root - origin_x );
+    startY = cast(int) (gdkEvent.y_root - origin_y );
+    int x = OS.GTK_WIDGET_X (handle);
+    int y = OS.GTK_WIDGET_Y (handle);
+    int width = OS.GTK_WIDGET_WIDTH (handle);
+    int height = OS.GTK_WIDGET_HEIGHT (handle);
+    lastX = x;
+    lastY = y;
+    Event event = new Event ();
+    event.time = gdkEvent.time;
+    event.x = lastX;
+    event.y = lastY;
+    event.width = width;
+    event.height = height;
+    if ((style & SWT.SMOOTH) is 0) {
+        event.detail = SWT.DRAG;
+    }
+    if ((parent.style & SWT.MIRRORED) !is 0) event.x = parent.getClientWidth () - width  - event.x;
+    sendEvent (SWT.Selection, event);
+    if (isDisposed ()) return 0;
+    if (event.doit) {
+        dragging = true;
+        lastX = event.x;
+        lastY = event.y;
+        if ((parent.style & SWT.MIRRORED) !is 0) lastX = parent.getClientWidth () - width  - lastX;
+        parent.update (true, (style & SWT.SMOOTH) is 0);
+        drawBand (lastX, event.y, width, height);
+        if ((style & SWT.SMOOTH) !is 0) {
+            setBounds (event.x, event.y, width, height);
+            // widget could be disposed at this point
+        }
+    }
+    return result;
+}
+
+override int gtk_button_release_event (GtkWidget* widget, GdkEventButton* gdkEvent) {
+    auto result = super.gtk_button_release_event (widget, gdkEvent);
+    if (result !is 0) return result;
+    int button = gdkEvent.button;
+    if (button !is 1) return 0;
+    if (!dragging) return 0;
+    dragging = false;
+    int width = OS.GTK_WIDGET_WIDTH (handle);
+    int height = OS.GTK_WIDGET_HEIGHT (handle);
+    Event event = new Event ();
+    event.time = gdkEvent.time;
+    event.x = lastX;
+    event.y = lastY;
+    event.width = width;
+    event.height = height;
+    drawBand (lastX, lastY, width, height);
+    if ((parent.style & SWT.MIRRORED) !is 0) event.x = parent.getClientWidth () - width  - event.x;
+    sendEvent (SWT.Selection, event);
+    if (isDisposed ()) return result;
+    if (event.doit) {
+        if ((style & SWT.SMOOTH) !is 0) {
+            setBounds (event.x, event.y, width, height);
+            // widget could be disposed at this point
+        }
+    }
+    return result;
+}
+
+override int gtk_focus_in_event (GtkWidget* widget, GdkEventFocus* event) {
+    auto result = super.gtk_focus_in_event (widget, event);
+    if (result !is 0) return result;
+    // widget could be disposed at this point
+    if (handle !is null) {
+            lastX = OS.GTK_WIDGET_X (handle);
+            lastY = OS.GTK_WIDGET_Y (handle);
+    }
+    return 0;
+}
+
+override int gtk_key_press_event (GtkWidget* widget, GdkEventKey* gdkEvent) {
+    auto result = super.gtk_key_press_event (widget, gdkEvent);
+    if (result !is 0) return result;
+    int keyval = gdkEvent.keyval;
+    switch (keyval) {
+        case OS.GDK_Left:
+        case OS.GDK_Right:
+        case OS.GDK_Up:
+        case OS.GDK_Down:
+            int xChange = 0, yChange = 0;
+            int stepSize = PAGE_INCREMENT;
+            if ((gdkEvent.state & OS.GDK_CONTROL_MASK) !is 0) stepSize = INCREMENT;
+            if ((style & SWT.VERTICAL) !is 0) {
+                if (keyval is OS.GDK_Up || keyval is OS.GDK_Down) break;
+                xChange = keyval is OS.GDK_Left ? -stepSize : stepSize;
+            } else {
+                if (keyval is OS.GDK_Left ||keyval is OS.GDK_Right) break;
+                yChange = keyval is OS.GDK_Up ? -stepSize : stepSize;
+            }
+
+            int width = OS.GTK_WIDGET_WIDTH (handle);
+            int height = OS.GTK_WIDGET_HEIGHT (handle);
+            int parentBorder = 0;
+            int parentWidth = OS.GTK_WIDGET_WIDTH (parent.handle);
+            int parentHeight = OS.GTK_WIDGET_HEIGHT (parent.handle);
+            int newX = lastX, newY = lastY;
+            if ((style & SWT.VERTICAL) !is 0) {
+                newX = Math.min (Math.max (0, lastX + xChange - parentBorder - startX), parentWidth - width);
+            } else {
+                newY = Math.min (Math.max (0, lastY + yChange - parentBorder - startY), parentHeight - height);
+            }
+            if (newX is lastX && newY is lastY) return result;
+
+            /* Ensure that the pointer image does not change */
+            auto window = OS.GTK_WIDGET_WINDOW (handle);
+            int grabMask = OS.GDK_POINTER_MOTION_MASK | OS.GDK_BUTTON_RELEASE_MASK;
+            auto gdkCursor = cursor !is null ? cursor.handle : cast(GdkCursor*)defaultCursor;
+            int ptrGrabResult = OS.gdk_pointer_grab (window, false, grabMask, window, gdkCursor, OS.GDK_CURRENT_TIME);
+
+            /* The event must be sent because its doit flag is used. */
+            Event event = new Event ();
+            event.time = gdkEvent.time;
+            event.x = newX;
+            event.y = newY;
+            event.width = width;
+            event.height = height;
+            if ((parent.style & SWT.MIRRORED) !is 0) event.x = parent.getClientWidth () - width  - event.x;
+            sendEvent (SWT.Selection, event);
+            if (ptrGrabResult is OS.GDK_GRAB_SUCCESS) OS.gdk_pointer_ungrab (OS.GDK_CURRENT_TIME);
+            if (isDisposed ()) break;
+
+            if (event.doit) {
+                lastX = event.x;
+                lastY = event.y;
+                if ((parent.style & SWT.MIRRORED) !is 0) lastX = parent.getClientWidth () - width  - lastX;
+                if ((style & SWT.SMOOTH) !is 0) {
+                    setBounds (event.x, event.y, width, height);
+                    if (isDisposed ()) break;
+                }
+                int cursorX = event.x, cursorY = event.y;
+                if ((style & SWT.VERTICAL) !is 0) {
+                    cursorY += height / 2;
+                } else {
+                    cursorX += width / 2;
+                }
+                display.setCursorLocation (parent.toDisplay (cursorX, cursorY));
+            }
+            break;
+        default:
+    }
+
+    return result;
+}
+
+override int gtk_motion_notify_event (GtkWidget* widget, GdkEventMotion* gdkEvent) {
+    auto result = super.gtk_motion_notify_event (widget, gdkEvent);
+    if (result !is 0) return result;
+    if (!dragging) return 0;
+    int eventX, eventY, eventState;
+    if (gdkEvent.is_hint !is 0) {
+        int pointer_x, pointer_y, mask;
+        OS.gdk_window_get_pointer (gdkEvent.window, &pointer_x, &pointer_y, &mask);
+        eventX = pointer_x ;
+        eventY = pointer_y ;
+        eventState = mask ;
+    } else {
+        int origin_x, origin_y;
+        OS.gdk_window_get_origin (gdkEvent.window, &origin_x, &origin_y);
+        eventX = cast(int) (gdkEvent.x_root - origin_x );
+        eventY = cast(int) (gdkEvent.y_root - origin_y );
+        eventState = gdkEvent.state;
+    }
+    if ((eventState & OS.GDK_BUTTON1_MASK) is 0) return 0;
+    int x = OS.GTK_WIDGET_X (handle);
+    int y = OS.GTK_WIDGET_Y (handle);
+    int width = OS.GTK_WIDGET_WIDTH (handle);
+    int height = OS.GTK_WIDGET_HEIGHT (handle);
+    int parentBorder = 0;
+    int parentWidth = OS.GTK_WIDGET_WIDTH (parent.handle);
+    int parentHeight = OS.GTK_WIDGET_HEIGHT (parent.handle);
+    int newX = lastX, newY = lastY;
+    if ((style & SWT.VERTICAL) !is 0) {
+        newX = Math.min (Math.max (0, eventX + x - startX - parentBorder), parentWidth - width);
+    } else {
+        newY = Math.min (Math.max (0, eventY + y - startY - parentBorder), parentHeight - height);
+    }
+    if (newX is lastX && newY is lastY) return 0;
+    drawBand (lastX, lastY, width, height);
+
+    Event event = new Event ();
+    event.time = gdkEvent.time;
+    event.x = newX;
+    event.y = newY;
+    event.width = width;
+    event.height = height;
+    if ((style & SWT.SMOOTH) is 0) {
+        event.detail = SWT.DRAG;
+    }
+    if ((parent.style & SWT.MIRRORED) !is 0) event.x = parent.getClientWidth() - width  - event.x;
+    sendEvent (SWT.Selection, event);
+    if (isDisposed ()) return 0;
+    if (event.doit) {
+        lastX = event.x;
+        lastY = event.y;
+        if ((parent.style & SWT.MIRRORED) !is 0) lastX = parent.getClientWidth () - width  - lastX;
+    }
+    parent.update (true, (style & SWT.SMOOTH) is 0);
+    drawBand (lastX, lastY, width, height);
+    if ((style & SWT.SMOOTH) !is 0) {
+        setBounds (event.x, lastY, width, height);
+        // widget could be disposed at this point
+    }
+    return result;
+}
+
+override int gtk_realize (GtkWidget* widget) {
+    gtk_setCursor (cursor !is null ? cursor.handle : null);
+    return super.gtk_realize (widget);
+}
+
+override void hookEvents () {
+    super.hookEvents ();
+    OS.gtk_widget_add_events (handle, OS.GDK_POINTER_MOTION_HINT_MASK);
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    if (defaultCursor !is null) OS.gdk_cursor_destroy (cast(GdkCursor*)defaultCursor);
+    defaultCursor = null;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is selected by the user.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener(SelectionListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Selection, listener);
+    eventTable.unhook (SWT.DefaultSelection,listener);
+}
+
+override void gtk_setCursor (GdkCursor* cursor) {
+    super.gtk_setCursor (cursor !is null ? cursor : cast(GdkCursor*)defaultCursor);
+}
+
+override int traversalCode (int key, GdkEventKey* event) {
+    return 0;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Scale.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,376 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Scale;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.events.SelectionListener;
+
+/**
+ * Instances of the receiver represent a selectable user
+ * interface object that present a range of continuous
+ * numeric values.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>HORIZONTAL, VERTICAL</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles HORIZONTAL and VERTICAL may be specified.
+ * </p><p>
+ * <p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#scale">Scale snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class Scale : Control {
+
+    alias Control.computeSize computeSize;
+
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#HORIZONTAL
+ * @see SWT#VERTICAL
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Composite parent, int style) {
+    super (parent, checkStyle (style));
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the user changes the receiver's value, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * <code>widgetSelected</code> is called when the user changes the receiver's value.
+ * <code>widgetDefaultSelected</code> is not called.
+ * </p>
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ */
+public void addSelectionListener (SelectionListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Selection,typedListener);
+    addListener (SWT.DefaultSelection,typedListener);
+}
+
+static int checkStyle (int style) {
+    return checkBits (style, SWT.HORIZONTAL, SWT.VERTICAL, 0, 0, 0, 0);
+}
+
+public override Point computeSize (int wHint, int hHint, bool changed) {
+    checkWidget();
+    if (wHint !is SWT.DEFAULT && wHint < 0) wHint = 0;
+    if (hHint !is SWT.DEFAULT && hHint < 0) hHint = 0;
+    Point size = computeNativeSize(handle, wHint, hHint, changed);
+    if ((style & SWT.HORIZONTAL) !is 0) {
+        if (wHint is SWT.DEFAULT) size.x = 2 * size.x;
+    } else {
+        if (hHint is SWT.DEFAULT) size.y = 2 * size.y;
+    }
+    return size;
+}
+
+override void createHandle (int index) {
+    state |= HANDLE | THEME_BACKGROUND;
+    fixedHandle = cast(GtkWidget*)OS.g_object_new (display.gtk_fixed_get_type (), null);
+    if (fixedHandle is null) error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_fixed_set_has_window (cast(GtkFixed*)fixedHandle, true);
+    auto hAdjustment = OS.gtk_adjustment_new (0, 0, 100, 1, 10, 0);
+    if (hAdjustment is null) error (SWT.ERROR_NO_HANDLES);
+    if ((style & SWT.HORIZONTAL) !is 0) {
+        handle = cast(GtkWidget*)OS.gtk_hscale_new (cast(GtkAdjustment*)hAdjustment);
+    } else {
+        handle = cast(GtkWidget*)OS.gtk_vscale_new (cast(GtkAdjustment*)hAdjustment);
+    }
+    if (handle is null) error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_container_add (cast(GtkContainer*)fixedHandle, handle);
+    OS.gtk_scale_set_digits (cast(GtkScale*)handle, 0);
+    OS.gtk_scale_set_draw_value (cast(GtkScale*)handle, false);
+}
+
+override void hookEvents () {
+    super.hookEvents ();
+    OS.g_signal_connect_closure (handle, OS.value_changed.ptr, display.closures [VALUE_CHANGED], false);
+}
+
+/**
+ * Returns the amount that the receiver's value will be
+ * modified by when the up/down (or right/left) arrows
+ * are pressed.
+ *
+ * @return the increment
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getIncrement () {
+    checkWidget ();
+    auto hAdjustment = OS.gtk_range_get_adjustment (cast(GtkRange*)handle);
+    return cast(int) hAdjustment.step_increment;
+}
+
+/**
+ * Returns the maximum value which the receiver will allow.
+ *
+ * @return the maximum
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getMaximum () {
+    checkWidget ();
+    auto hAdjustment = OS.gtk_range_get_adjustment (cast(GtkRange*)handle);
+    return cast(int) hAdjustment.upper;
+}
+
+/**
+ * Returns the minimum value which the receiver will allow.
+ *
+ * @return the minimum
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getMinimum () {
+    checkWidget ();
+    auto hAdjustment = OS.gtk_range_get_adjustment (cast(GtkRange*)handle);
+    return cast(int) hAdjustment.lower;
+}
+
+/**
+ * Returns the amount that the receiver's value will be
+ * modified by when the page increment/decrement areas
+ * are selected.
+ *
+ * @return the page increment
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getPageIncrement () {
+    checkWidget ();
+    auto hAdjustment = OS.gtk_range_get_adjustment (cast(GtkRange*)handle);
+    return cast(int) hAdjustment.page_increment;
+}
+
+/**
+ * Returns the 'selection', which is the receiver's position.
+ *
+ * @return the selection
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSelection () {
+    checkWidget ();
+    auto hAdjustment = OS.gtk_range_get_adjustment (cast(GtkRange*)handle);
+    return cast(int) hAdjustment.value;
+}
+
+int /*long*/ gtk_value_changed (int /*long*/ adjustment) {
+    postEvent (SWT.Selection);
+    return 0;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the user changes the receiver's value.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener (SelectionListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Selection, listener);
+    eventTable.unhook (SWT.DefaultSelection,listener);
+}
+
+/**
+ * Sets the amount that the receiver's value will be
+ * modified by when the up/down (or right/left) arrows
+ * are pressed to the argument, which must be at least
+ * one.
+ *
+ * @param increment the new increment (must be greater than zero)
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setIncrement (int value) {
+    checkWidget ();
+    if (value < 1) return;
+    OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+    OS.gtk_range_set_increments (cast(GtkRange*)handle, value, getPageIncrement ());
+    OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+}
+
+/**
+ * Sets the maximum value that the receiver will allow.  This new
+ * value will be ignored if it is not greater than the receiver's current
+ * minimum value.  If the new maximum is applied then the receiver's
+ * selection value will be adjusted if necessary to fall within its new range.
+ *
+ * @param value the new maximum, which must be greater than the current minimum
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMaximum (int value) {
+    checkWidget ();
+    int minimum = getMinimum();
+    if (value <= minimum) return;
+    OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+    OS.gtk_range_set_range (cast(GtkRange*)handle, minimum, value);
+    OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+}
+
+/**
+ * Sets the minimum value that the receiver will allow.  This new
+ * value will be ignored if it is negative or is not less than the receiver's
+ * current maximum value.  If the new minimum is applied then the receiver's
+ * selection value will be adjusted if necessary to fall within its new range.
+ *
+ * @param value the new minimum, which must be nonnegative and less than the current maximum
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMinimum (int value) {
+    checkWidget ();
+    if (value < 0) return;
+    int maximum = getMaximum ();
+    if (value >= maximum) return;
+    OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+    OS.gtk_range_set_range (cast(GtkRange*)handle, value, maximum);
+    OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+}
+
+/**
+ * Sets the amount that the receiver's value will be
+ * modified by when the page increment/decrement areas
+ * are selected to the argument, which must be at least
+ * one.
+ *
+ * @param pageIncrement the page increment (must be greater than zero)
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setPageIncrement (int value) {
+    checkWidget ();
+    if (value < 1) return;
+    OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+    OS.gtk_range_set_increments (cast(GtkRange*)handle, getIncrement (), value);
+    OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+}
+
+/**
+ * Sets the 'selection', which is the receiver's value,
+ * to the argument which must be greater than or equal to zero.
+ *
+ * @param value the new selection (must be zero or greater)
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (int value) {
+    checkWidget ();
+    OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+    OS.gtk_range_set_value (cast(GtkRange*)handle, value);
+    OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/ScrollBar.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,747 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.ScrollBar;
+
+import java.lang.all;
+
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Scrollable;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Scrollable;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.TypedListener;
+
+
+/**
+ * Instances of this class are selectable user interface
+ * objects that represent a range of positive, numeric values.
+ * <p>
+ * At any given moment, a given scroll bar will have a
+ * single 'selection' that is considered to be its
+ * value, which is constrained to be within the range of
+ * values the scroll bar represents (that is, between its
+ * <em>minimum</em> and <em>maximum</em> values).
+ * </p><p>
+ * Typically, scroll bars will be made up of five areas:
+ * <ol>
+ * <li>an arrow button for decrementing the value</li>
+ * <li>a page decrement area for decrementing the value by a larger amount</li>
+ * <li>a <em>thumb</em> for modifying the value by mouse dragging</li>
+ * <li>a page increment area for incrementing the value by a larger amount</li>
+ * <li>an arrow button for incrementing the value</li>
+ * </ol>
+ * Based on their style, scroll bars are either <code>HORIZONTAL</code>
+ * (which have a left facing button for decrementing the value and a
+ * right facing button for incrementing it) or <code>VERTICAL</code>
+ * (which have an upward facing button for decrementing the value
+ * and a downward facing buttons for incrementing it).
+ * </p><p>
+ * On some platforms, the size of the scroll bar's thumb can be
+ * varied relative to the magnitude of the range of values it
+ * represents (that is, relative to the difference between its
+ * maximum and minimum values). Typically, this is used to
+ * indicate some proportional value such as the ratio of the
+ * visible area of a document to the total amount of space that
+ * it would take to display it. SWT supports setting the thumb
+ * size even if the underlying platform does not, but in this
+ * case the appearance of the scroll bar will not change.
+ * </p><p>
+ * Scroll bars are created by specifying either <code>H_SCROLL</code>,
+ * <code>V_SCROLL</code> or both when creating a <code>Scrollable</code>.
+ * They are accessed from the <code>Scrollable</code> using
+ * <code>getHorizontalBar</code> and <code>getVerticalBar</code>.
+ * </p><p>
+ * Note: Scroll bars are not Controls.  On some platforms, scroll bars
+ * that appear as part of some standard controls such as a text or list
+ * have no operating system resources and are not children of the control.
+ * For this reason, scroll bars are treated specially.  To create a control
+ * that looks like a scroll bar but has operating system resources, use
+ * <code>Slider</code>.
+ * </p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>HORIZONTAL, VERTICAL</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles HORIZONTAL and VERTICAL may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see Slider
+ * @see Scrollable
+ * @see Scrollable#getHorizontalBar
+ * @see Scrollable#getVerticalBar
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class ScrollBar : Widget {
+    Scrollable parent;
+    GtkAdjustment* adjustmentHandle;
+    int detail;
+    bool dragSent;
+
+this () {
+}
+
+/**
+* Creates a new instance of the widget.
+*/
+this (Scrollable parent, int style) {
+    super (parent, checkStyle (style));
+    this.parent = parent;
+    createWidget (0);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the user changes the receiver's value, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * When <code>widgetSelected</code> is called, the event object detail field contains one of the following values:
+ * <code>SWT.NONE</code> - for the end of a drag.
+ * <code>SWT.DRAG</code>.
+ * <code>SWT.HOME</code>.
+ * <code>SWT.END</code>.
+ * <code>SWT.ARROW_DOWN</code>.
+ * <code>SWT.ARROW_UP</code>.
+ * <code>SWT.PAGE_DOWN</code>.
+ * <code>SWT.PAGE_UP</code>.
+ * <code>widgetDefaultSelected</code> is not called.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the user changes the receiver's value
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener (SelectionListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Selection,typedListener);
+    addListener (SWT.DefaultSelection,typedListener);
+}
+
+static int checkStyle (int style) {
+    return checkBits (style, SWT.HORIZONTAL, SWT.VERTICAL, 0, 0, 0, 0);
+}
+
+override void deregister () {
+    super.deregister ();
+    if (adjustmentHandle !is null) display.removeWidget (cast(GtkWidget*)adjustmentHandle);
+}
+
+void destroyHandle () {
+    super.destroyWidget ();
+}
+
+void destroyWidget () {
+    parent.destroyScrollBar (this);
+    releaseHandle ();
+    //parent.sendEvent (SWT.Resize);
+}
+
+/**
+ * Returns <code>true</code> if the receiver is enabled, and
+ * <code>false</code> otherwise. A disabled control is typically
+ * not selectable from the user interface and draws with an
+ * inactive or "grayed" look.
+ *
+ * @return the receiver's enabled state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #isEnabled
+ */
+public bool getEnabled () {
+    checkWidget ();
+    if (handle !is null) return OS.GTK_WIDGET_SENSITIVE (handle);
+    return true;
+}
+
+/**
+ * Returns the amount that the receiver's value will be
+ * modified by when the up/down (or right/left) arrows
+ * are pressed.
+ *
+ * @return the increment
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getIncrement () {
+    checkWidget ();
+    return cast(int)adjustmentHandle.step_increment;
+}
+
+/**
+ * Returns the maximum value which the receiver will allow.
+ *
+ * @return the maximum
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getMaximum () {
+    checkWidget ();
+    return cast(int)adjustmentHandle.upper;
+}
+
+/**
+ * Returns the minimum value which the receiver will allow.
+ *
+ * @return the minimum
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getMinimum () {
+    checkWidget ();
+    return cast(int)adjustmentHandle.lower;
+}
+
+/**
+ * Returns the amount that the receiver's value will be
+ * modified by when the page increment/decrement areas
+ * are selected.
+ *
+ * @return the page increment
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getPageIncrement () {
+    checkWidget ();
+    return cast(int)adjustmentHandle.page_increment;
+}
+
+/**
+ * Returns the receiver's parent, which must be a Scrollable.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Scrollable getParent () {
+    checkWidget ();
+    return parent;
+}
+
+/**
+ * Returns the single 'selection' that is the receiver's value.
+ *
+ * @return the selection
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSelection () {
+    checkWidget ();
+    return cast(int)adjustmentHandle.value;
+}
+
+/**
+ * Returns a point describing the receiver's size. The
+ * x coordinate of the result is the width of the receiver.
+ * The y coordinate of the result is the height of the
+ * receiver.
+ *
+ * @return the receiver's size
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Point getSize () {
+    checkWidget ();
+    if (handle is null) return new Point (0,0);
+    GtkRequisition requisition;
+    OS.gtk_widget_size_request (handle, &requisition);
+    return new Point (requisition.width, requisition.height);
+}
+
+/**
+ * Returns the size of the receiver's thumb relative to the
+ * difference between its maximum and minimum values.
+ *
+ * @return the thumb value
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ScrollBar
+ */
+public int getThumb () {
+    checkWidget ();
+    return cast(int)adjustmentHandle.page_size;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is visible, and
+ * <code>false</code> otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, this method
+ * may still indicate that it is considered visible even though
+ * it may not actually be showing.
+ * </p>
+ *
+ * @return the receiver's visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool getVisible () {
+    checkWidget ();
+    auto scrolledHandle = parent.scrolledHandle;
+    int hsp, vsp;
+    OS.gtk_scrolled_window_get_policy (scrolledHandle, &hsp, &vsp);
+    if ((style & SWT.HORIZONTAL) !is 0) {
+        return hsp !is OS.GTK_POLICY_NEVER;
+    } else {
+        return vsp !is OS.GTK_POLICY_NEVER;
+    }
+}
+
+override int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* eventPtr) {
+    auto result = super.gtk_button_press_event (widget, eventPtr);
+    if (result !is 0) return result;
+    detail = OS.GTK_SCROLL_NONE;
+    dragSent = false;
+    return result;
+}
+
+override int /*long*/ gtk_change_value (GtkWidget* widget, int /*long*/ scroll, int /*long*/ value1, int /*long*/ value2) {
+    detail = scroll;
+    return 0;
+}
+
+override int /*long*/ gtk_value_changed (int /*long*/ adjustment) {
+    Event event = new Event ();
+    dragSent = detail is OS.GTK_SCROLL_JUMP;
+    switch (detail) {
+        case OS.GTK_SCROLL_NONE:            event.detail = SWT.NONE; break;
+        case OS.GTK_SCROLL_JUMP:            event.detail = SWT.DRAG; break;
+        case OS.GTK_SCROLL_START:           event.detail = SWT.HOME; break;
+        case OS.GTK_SCROLL_END:             event.detail = SWT.END; break;
+        case OS.GTK_SCROLL_PAGE_DOWN:
+        case OS.GTK_SCROLL_PAGE_RIGHT:
+        case OS.GTK_SCROLL_PAGE_FORWARD:    event.detail = SWT.PAGE_DOWN; break;
+        case OS.GTK_SCROLL_PAGE_UP:
+        case OS.GTK_SCROLL_PAGE_LEFT:
+        case OS.GTK_SCROLL_PAGE_BACKWARD:   event.detail = SWT.PAGE_UP; break;
+        case OS.GTK_SCROLL_STEP_DOWN:
+        case OS.GTK_SCROLL_STEP_RIGHT:
+        case OS.GTK_SCROLL_STEP_FORWARD:    event.detail = SWT.ARROW_DOWN; break;
+        case OS.GTK_SCROLL_STEP_UP:
+        case OS.GTK_SCROLL_STEP_LEFT:
+        case OS.GTK_SCROLL_STEP_BACKWARD:   event.detail = SWT.ARROW_UP; break;
+        default:
+    }
+    detail = OS.GTK_SCROLL_NONE;
+    if (!dragSent) detail = OS.GTK_SCROLL_NONE;
+    postEvent (SWT.Selection, event);
+    parent.updateScrollBarValue (this);
+    return 0;
+}
+
+override int /*long*/ gtk_event_after (GtkWidget* widget, GdkEvent* gdkEvent) {
+    switch (gdkEvent.type) {
+        case OS.GDK_BUTTON_RELEASE: {
+            GdkEventButton* gdkEventButton = cast(GdkEventButton*)gdkEvent;
+            if (gdkEventButton.button is 1 && detail is SWT.DRAG) {
+                if (!dragSent) {
+                    Event event = new Event ();
+                    event.detail = SWT.DRAG;
+                    postEvent (SWT.Selection, event);
+                }
+                postEvent (SWT.Selection);
+            }
+            detail = OS.GTK_SCROLL_NONE;
+            dragSent = false;
+            break;
+        }
+        default:
+    }
+    return super.gtk_event_after (widget, gdkEvent);
+}
+
+override void hookEvents () {
+    super.hookEvents ();
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 6, 0)) {
+        OS.g_signal_connect_closure (handle, OS.change_value.ptr, display.closures [CHANGE_VALUE], false);
+    }
+    OS.g_signal_connect_closure (adjustmentHandle, OS.value_changed.ptr, display.closures [VALUE_CHANGED], false);
+    OS.g_signal_connect_closure_by_id (handle, display.signalIds [EVENT_AFTER], 0, display.closures [EVENT_AFTER], false);
+    OS.g_signal_connect_closure_by_id (handle, display.signalIds [BUTTON_PRESS_EVENT], 0, display.closures [BUTTON_PRESS_EVENT], false);
+}
+
+/**
+ * Returns <code>true</code> if the receiver is enabled and all
+ * of the receiver's ancestors are enabled, and <code>false</code>
+ * otherwise. A disabled control is typically not selectable from the
+ * user interface and draws with an inactive or "grayed" look.
+ *
+ * @return the receiver's enabled state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getEnabled
+ */
+public bool isEnabled () {
+    checkWidget ();
+    return getEnabled () && getParent ().getEnabled ();
+}
+
+/**
+ * Returns <code>true</code> if the receiver is visible and all
+ * of the receiver's ancestors are visible and <code>false</code>
+ * otherwise.
+ *
+ * @return the receiver's visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getVisible
+ */
+public bool isVisible () {
+    checkWidget ();
+    return getVisible () && getParent ().isVisible ();
+}
+
+override void register () {
+    super.register ();
+    if (adjustmentHandle !is null) display.addWidget (cast(GtkWidget*)adjustmentHandle, this);
+}
+
+void releaseHandle () {
+    super.releaseHandle ();
+    parent = null;
+}
+
+override void releaseParent () {
+    super.releaseParent ();
+    if (parent.horizontalBar is this) parent.horizontalBar = null;
+    if (parent.verticalBar is this) parent.verticalBar = null;
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    //parent = null;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the user changes the receiver's value.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener (SelectionListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Selection, listener);
+    eventTable.unhook (SWT.DefaultSelection,listener);
+}
+
+/**
+ * Enables the receiver if the argument is <code>true</code>,
+ * and disables it otherwise. A disabled control is typically
+ * not selectable from the user interface and draws with an
+ * inactive or "grayed" look.
+ *
+ * @param enabled the new enabled state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setEnabled (bool enabled) {
+    checkWidget ();
+    if (handle !is null) OS.gtk_widget_set_sensitive (handle, enabled);
+}
+
+/**
+ * Sets the amount that the receiver's value will be
+ * modified by when the up/down (or right/left) arrows
+ * are pressed to the argument, which must be at least
+ * one.
+ *
+ * @param value the new increment (must be greater than zero)
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setIncrement (int value) {
+    checkWidget ();
+    if (value < 1) return;
+    adjustmentHandle.step_increment = cast(float) value;
+    OS.g_signal_handlers_block_matched (adjustmentHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+    OS.gtk_adjustment_changed (adjustmentHandle);
+    OS.g_signal_handlers_unblock_matched (adjustmentHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+}
+
+/**
+ * Sets the maximum. If this value is negative or less than or
+ * equal to the minimum, the value is ignored. If necessary, first
+ * the thumb and then the selection are adjusted to fit within the
+ * new range.
+ *
+ * @param value the new maximum
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMaximum (int value) {
+    checkWidget ();
+    int minimum = cast(int)adjustmentHandle.lower;
+    if (value <= minimum) return;
+    adjustmentHandle.upper = value;
+    adjustmentHandle.page_size = Math.min (adjustmentHandle.page_size, value - minimum);
+    adjustmentHandle.value = Math.min (adjustmentHandle.value, (value - adjustmentHandle.page_size));
+    OS.g_signal_handlers_block_matched (adjustmentHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+    OS.gtk_adjustment_changed (adjustmentHandle);
+    OS.g_signal_handlers_unblock_matched (adjustmentHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+}
+
+/**
+ * Sets the minimum value. If this value is negative or greater
+ * than or equal to the maximum, the value is ignored. If necessary,
+ * first the thumb and then the selection are adjusted to fit within
+ * the new range.
+ *
+ * @param value the new minimum
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMinimum (int value) {
+    checkWidget ();
+    if (value < 0) return;
+    int maximum = cast(int)adjustmentHandle.upper;
+    if (value >= maximum) return;
+    adjustmentHandle.lower = value;
+    adjustmentHandle.page_size = Math.min (adjustmentHandle.page_size, maximum - value);
+    adjustmentHandle.value = Math.max (adjustmentHandle.value, value);
+    OS.g_signal_handlers_block_matched (adjustmentHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+    OS.gtk_adjustment_changed (adjustmentHandle);
+    OS.g_signal_handlers_unblock_matched (adjustmentHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+}
+
+void setOrientation () {
+    super.setOrientation ();
+    if ((parent.style & SWT.MIRRORED) !is 0) {
+        if ((parent.state & CANVAS) !is 0) {
+            if ((style & SWT.HORIZONTAL) !is 0) {
+                OS.gtk_range_set_inverted (handle, true);
+            }
+        }
+    }
+}
+
+/**
+ * Sets the amount that the receiver's value will be
+ * modified by when the page increment/decrement areas
+ * are selected to the argument, which must be at least
+ * one.
+ *
+ * @param value the page increment (must be greater than zero)
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setPageIncrement (int value) {
+    checkWidget ();
+    if (value < 1) return;
+    adjustmentHandle.page_increment = cast(float) value;
+    OS.g_signal_handlers_block_matched (adjustmentHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+    OS.gtk_adjustment_changed (adjustmentHandle);
+    OS.g_signal_handlers_unblock_matched (adjustmentHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+}
+
+/**
+ * Sets the single <em>selection</em> that is the receiver's
+ * value to the argument which must be greater than or equal
+ * to zero.
+ *
+ * @param selection the new selection (must be zero or greater)
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (int value) {
+    checkWidget ();
+    value = Math.min (value, getMaximum() - getThumb());
+    OS.g_signal_handlers_block_matched (adjustmentHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+    OS.gtk_adjustment_set_value (adjustmentHandle, value);
+    OS.g_signal_handlers_unblock_matched (adjustmentHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+}
+
+/**
+ * Sets the size of the receiver's thumb relative to the
+ * difference between its maximum and minimum values.  This new
+ * value will be ignored if it is less than one, and will be
+ * clamped if it exceeds the receiver's current range.
+ *
+ * @param value the new thumb value, which must be at least one and not
+ * larger than the size of the current range
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setThumb (int value) {
+    checkWidget ();
+    if (value < 1) return;
+    value = Math.min (value, cast(int)(adjustmentHandle.upper - adjustmentHandle.lower));
+    adjustmentHandle.page_size = cast(double) value;
+    adjustmentHandle.value = Math.min (adjustmentHandle.value, (adjustmentHandle.upper - value));
+    OS.g_signal_handlers_block_matched (adjustmentHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+    OS.gtk_adjustment_changed (adjustmentHandle);
+    OS.g_signal_handlers_unblock_matched (adjustmentHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+}
+
+/**
+ * Sets the receiver's selection, minimum value, maximum
+ * value, thumb, increment and page increment all at once.
+ * <p>
+ * Note: This is similar to setting the values individually
+ * using the appropriate methods, but may be implemented in a
+ * more efficient fashion on some platforms.
+ * </p>
+ *
+ * @param selection the new selection value
+ * @param minimum the new minimum value
+ * @param maximum the new maximum value
+ * @param thumb the new thumb value
+ * @param increment the new increment value
+ * @param pageIncrement the new pageIncrement value
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setValues (int selection, int minimum, int maximum, int thumb, int increment, int pageIncrement) {
+    checkWidget ();
+    if (minimum < 0) return;
+    if (maximum < 0) return;
+    if (thumb < 1) return;
+    if (increment < 1) return;
+    if (pageIncrement < 1) return;
+    thumb = Math.min (thumb, maximum - minimum);
+    adjustmentHandle.lower = minimum;
+    adjustmentHandle.upper = maximum;
+    adjustmentHandle.step_increment = increment;
+    adjustmentHandle.page_increment = pageIncrement;
+    adjustmentHandle.page_size = thumb;
+    adjustmentHandle.value = Math.min (Math.max (selection, minimum), maximum - thumb);
+    OS.g_signal_handlers_block_matched (adjustmentHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+    OS.gtk_adjustment_changed (adjustmentHandle);
+    OS.gtk_adjustment_value_changed (adjustmentHandle);
+    OS.g_signal_handlers_unblock_matched (adjustmentHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+}
+
+/**
+ * Marks the receiver as visible if the argument is <code>true</code>,
+ * and marks it invisible otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, marking
+ * it visible may not actually cause it to be displayed.
+ * </p>
+ *
+ * @param visible the new visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setVisible (bool visible) {
+    checkWidget ();
+    if (parent.setScrollBarVisible (this, visible)) {
+        sendEvent (visible ? SWT.Show : SWT.Hide);
+        parent.sendEvent (SWT.Resize);
+    }
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Scrollable.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,392 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Scrollable;
+
+import java.lang.all;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.ScrollBar;
+import org.eclipse.swt.widgets.Widget;
+
+import tango.stdc.string;
+
+/**
+ * This class is the abstract superclass of all classes which
+ * represent controls that have standard scroll bars.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>H_SCROLL, V_SCROLL</dd>
+ * <dt><b>Events:</b>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public abstract class Scrollable : Control {
+    GtkWidget* scrolledHandle;
+    ScrollBar horizontalBar, verticalBar;
+
+/**
+ * Prevents uninitialized instances from being created outside the package.
+ */
+this () {}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#H_SCROLL
+ * @see SWT#V_SCROLL
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Composite parent, int style) {
+    super (parent, style);
+}
+
+GtkWidget* clientHandle () {
+    return handle;
+}
+
+/**
+ * Given a desired <em>client area</em> for the receiver
+ * (as described by the arguments), returns the bounding
+ * rectangle which would be required to produce that client
+ * area.
+ * <p>
+ * In other words, it returns a rectangle such that, if the
+ * receiver's bounds were set to that rectangle, the area
+ * of the receiver which is capable of displaying data
+ * (that is, not covered by the "trimmings") would be the
+ * rectangle described by the arguments (relative to the
+ * receiver's parent).
+ * </p>
+ *
+ * @param x the desired x coordinate of the client area
+ * @param y the desired y coordinate of the client area
+ * @param width the desired width of the client area
+ * @param height the desired height of the client area
+ * @return the required bounds to produce the given client area
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getClientArea
+ */
+public Rectangle computeTrim (int x, int y, int width, int height) {
+    checkWidget();
+    int border = 0;
+    if (fixedHandle !is null) border += OS.gtk_container_get_border_width (cast(GtkContainer*)fixedHandle);
+    if (scrolledHandle !is null) border += OS.gtk_container_get_border_width (cast(GtkContainer*)scrolledHandle);
+    int trimX = x - border, trimY = y - border;
+    int trimWidth = width + (border * 2), trimHeight = height + (border * 2);
+    trimHeight += hScrollBarWidth ();
+    trimWidth  += vScrollBarWidth ();
+    if (scrolledHandle !is null) {
+        if (OS.gtk_scrolled_window_get_shadow_type (cast(GtkScrolledWindow*)scrolledHandle) !is OS.GTK_SHADOW_NONE) {
+            auto style = OS.gtk_widget_get_style (cast(GtkWidget*)scrolledHandle);
+            int xthickness = OS.gtk_style_get_xthickness (style);
+            int ythickness = OS.gtk_style_get_ythickness (style);
+            trimX -= xthickness;
+            trimY -= ythickness;
+            trimWidth += xthickness * 2;
+            trimHeight += ythickness * 2;
+        }
+    }
+    return new Rectangle (trimX, trimY, trimWidth, trimHeight);
+}
+
+ScrollBar createScrollBar (int style) {
+    if (scrolledHandle is null) return null;
+    ScrollBar bar = new ScrollBar ();
+    bar.parent = this;
+    bar.style = style;
+    bar.display = display;
+    bar.state |= HANDLE;
+    if ((style & SWT.H_SCROLL) !is 0) {
+        bar.handle = OS.GTK_SCROLLED_WINDOW_HSCROLLBAR (cast(GtkScrolledWindow*)scrolledHandle);
+        bar.adjustmentHandle = OS.gtk_scrolled_window_get_hadjustment (cast(GtkScrolledWindow*)scrolledHandle);
+    } else {
+        bar.handle = OS.GTK_SCROLLED_WINDOW_VSCROLLBAR (cast(GtkScrolledWindow*)scrolledHandle);
+        bar.adjustmentHandle = OS.gtk_scrolled_window_get_vadjustment (cast(GtkScrolledWindow*)scrolledHandle);
+    }
+    bar.setOrientation();
+    bar.hookEvents ();
+    bar.register ();
+    return bar;
+}
+
+override void createWidget (int index) {
+    super.createWidget (index);
+    if ((style & SWT.H_SCROLL) !is 0) horizontalBar = createScrollBar (SWT.H_SCROLL);
+    if ((style & SWT.V_SCROLL) !is 0) verticalBar = createScrollBar (SWT.V_SCROLL);
+}
+
+override void deregister () {
+    super.deregister ();
+    if (scrolledHandle !is null) display.removeWidget (cast(GtkWidget*)scrolledHandle);
+}
+
+void destroyScrollBar (ScrollBar bar) {
+    setScrollBarVisible (bar, false);
+    //This code is intentionally commented
+    //bar.destroyHandle ();
+}
+
+public override int getBorderWidth () {
+    checkWidget();
+    int border = 0;
+    if (fixedHandle !is null) border += OS.gtk_container_get_border_width (cast(GtkContainer*)fixedHandle);
+    if (scrolledHandle !is null) {
+        border += OS.gtk_container_get_border_width (cast(GtkContainer*)scrolledHandle);
+        if (OS.gtk_scrolled_window_get_shadow_type (cast(GtkScrolledWindow*)scrolledHandle) !is OS.GTK_SHADOW_NONE) {
+            border += OS.gtk_style_get_xthickness (OS.gtk_widget_get_style (cast(GtkWidget*)scrolledHandle));
+        }
+    }
+    return border;
+}
+
+/**
+ * Returns a rectangle which describes the area of the
+ * receiver which is capable of displaying data (that is,
+ * not covered by the "trimmings").
+ *
+ * @return the client area
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #computeTrim
+ */
+public Rectangle getClientArea () {
+    checkWidget ();
+    forceResize ();
+    auto clientHandle = clientHandle ();
+    int x = OS.GTK_WIDGET_X (clientHandle);
+    int y = OS.GTK_WIDGET_Y (clientHandle);
+    int width = (state & ZERO_WIDTH) !is 0 ? 0 : OS.GTK_WIDGET_WIDTH (clientHandle);
+    int height = (state & ZERO_HEIGHT) !is 0 ? 0 : OS.GTK_WIDGET_HEIGHT (clientHandle);
+    return new Rectangle (x, y, width, height);
+}
+/**
+ * Returns the receiver's horizontal scroll bar if it has
+ * one, and null if it does not.
+ *
+ * @return the horizontal scroll bar (or null)
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public ScrollBar getHorizontalBar () {
+    checkWidget ();
+    return horizontalBar;
+}
+/**
+ * Returns the receiver's vertical scroll bar if it has
+ * one, and null if it does not.
+ *
+ * @return the vertical scroll bar (or null)
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public ScrollBar getVerticalBar () {
+    checkWidget ();
+    return verticalBar;
+}
+
+override int /*long*/ gtk_scroll_event (GtkWidget* widget, GdkEventScroll* eventPtr) {
+    auto result = super.gtk_scroll_event (widget, eventPtr);
+
+    /*
+    * Feature in GTK.  Scrolled windows do not scroll if the scrollbars
+    * are hidden.  This is not a bug, but is inconsistent with other platforms.
+    * The fix is to set the adjustment values directly.
+    */
+    if ((state & CANVAS) !is 0) {
+        ScrollBar scrollBar;
+        GdkEventScroll* gdkEvent = new GdkEventScroll ();
+        memmove (gdkEvent, eventPtr, GdkEventScroll.sizeof);
+        if (gdkEvent.direction is OS.GDK_SCROLL_UP || gdkEvent.direction is OS.GDK_SCROLL_DOWN) {
+            scrollBar = verticalBar;
+        } else {
+            scrollBar = horizontalBar;
+        }
+        if (scrollBar !is null && !OS.GTK_WIDGET_VISIBLE (scrollBar.handle) && scrollBar.getEnabled()) {
+            GtkAdjustment* adjustment = scrollBar.adjustmentHandle;
+            /* Calculate wheel delta to match GTK+ 2.4 and higher */
+            int wheel_delta = cast(int) Math.pow(adjustment.page_size, 2.0 / 3.0);
+            if (gdkEvent.direction is OS.GDK_SCROLL_UP || gdkEvent.direction is OS.GDK_SCROLL_LEFT)
+                wheel_delta = -wheel_delta;
+            int value = cast(int) Math.max(adjustment.lower,
+                    Math.min(adjustment.upper - adjustment.page_size, adjustment.value + wheel_delta));
+            OS.gtk_adjustment_set_value (scrollBar.adjustmentHandle, value);
+            return 1;
+        }
+    }
+    return result;
+}
+
+int hScrollBarWidth() {
+    if (horizontalBar is null) return 0;
+    auto hBarHandle = OS.GTK_SCROLLED_WINDOW_HSCROLLBAR(cast(GtkScrolledWindow*)scrolledHandle);
+    if (hBarHandle is null) return 0;
+    GtkRequisition requisition;
+    OS.gtk_widget_size_request(cast(GtkWidget*)hBarHandle, &requisition);
+    int spacing = OS.GTK_SCROLLED_WINDOW_SCROLLBAR_SPACING(cast(GtkScrolledWindow*)scrolledHandle);
+    return requisition.height + spacing;
+}
+
+override bool sendLeaveNotify () {
+    return scrolledHandle !is null;
+}
+
+override void setOrientation () {
+    super.setOrientation ();
+    if ((style & SWT.RIGHT_TO_LEFT) !is 0) {
+        if (scrolledHandle !is null) {
+            OS.gtk_widget_set_direction (cast(GtkWidget*)scrolledHandle, OS.GTK_TEXT_DIR_RTL);
+        }
+    }
+}
+
+bool setScrollBarVisible (ScrollBar bar, bool visible) {
+    if (scrolledHandle is null) return false;
+    int hsp, vsp;
+    OS.gtk_scrolled_window_get_policy (cast(GtkScrolledWindow*)scrolledHandle, &hsp, &vsp);
+    int policy = visible ? OS.GTK_POLICY_ALWAYS : OS.GTK_POLICY_NEVER;
+    if ((bar.style & SWT.HORIZONTAL) !is 0) {
+        if (hsp is policy) return false;
+        hsp = policy;
+    } else {
+        if (vsp is policy) return false;
+        vsp = policy;
+    }
+    OS.gtk_scrolled_window_set_policy (cast(GtkScrolledWindow*)scrolledHandle, hsp, vsp);
+    return true;
+}
+
+void redrawBackgroundImage () {
+}
+
+override void redrawWidget (int x, int y, int width, int height, bool redrawAll, bool all, bool trim) {
+    super.redrawWidget (x, y, width, height, redrawAll, all, trim);
+    if ((OS.GTK_WIDGET_FLAGS (handle) & OS.GTK_REALIZED) is 0) return;
+    if (!trim) return;
+    auto topHandle_ = topHandle (), paintHandle_ = paintHandle ();
+    if (topHandle_ is paintHandle_) return;
+    auto window = OS.GTK_WIDGET_WINDOW (topHandle_);
+    GdkRectangle* rect = new GdkRectangle ();
+    if (redrawAll) {
+        rect.width = OS.GTK_WIDGET_WIDTH (topHandle_);
+        rect.height = OS.GTK_WIDGET_HEIGHT (topHandle_);
+    } else {
+        int destX, destY;
+        OS.gtk_widget_translate_coordinates (cast(GtkWidget*)paintHandle_, topHandle_, x, y, &destX, &destY);
+        rect.x = destX;
+        rect.y = destY;
+        rect.width = width;
+        rect.height = height;
+    }
+    OS.gdk_window_invalidate_rect (window, rect, all);
+}
+
+override void register () {
+    super.register ();
+    if (scrolledHandle !is null) display.addWidget (cast(GtkWidget*)scrolledHandle, this);
+}
+
+override void releaseHandle () {
+    super.releaseHandle ();
+    scrolledHandle = null;
+}
+
+override void releaseChildren (bool destroy) {
+    if (horizontalBar !is null) {
+        horizontalBar.release (false);
+        horizontalBar = null;
+    }
+    if (verticalBar !is null) {
+        verticalBar.release (false);
+        verticalBar = null;
+    }
+    super.releaseChildren (destroy);
+}
+
+override void resizeHandle (int width, int height) {
+    if (fixedHandle !is null) OS.gtk_widget_set_size_request (cast(GtkWidget*)fixedHandle, width, height);
+    OS.gtk_widget_set_size_request (scrolledHandle !is null ? cast(GtkWidget*)scrolledHandle : handle, width, height);
+}
+
+override void showWidget () {
+    super.showWidget ();
+    if (scrolledHandle !is null) OS.gtk_widget_show (cast(GtkWidget*)scrolledHandle);
+}
+
+override GtkWidget* topHandle () {
+    if (fixedHandle !is null) return fixedHandle;
+    if (scrolledHandle !is null) return scrolledHandle;
+    return super.topHandle ();
+}
+
+void updateScrollBarValue (ScrollBar bar) {
+    redrawBackgroundImage ();
+}
+
+int vScrollBarWidth() {
+    if (verticalBar is null) return 0;
+    auto vBarHandle = OS.GTK_SCROLLED_WINDOW_VSCROLLBAR(cast(GtkScrolledWindow*)scrolledHandle);
+    if (vBarHandle is null) return 0;
+    GtkRequisition requisition;
+    OS.gtk_widget_size_request (cast(GtkWidget*)vBarHandle, &requisition);
+    int spacing = OS.GTK_SCROLLED_WINDOW_SCROLLBAR_SPACING(cast(GtkScrolledWindow*)scrolledHandle);
+    return requisition.width + spacing;
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Shell.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,2120 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Shell;
+
+import java.lang.all;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.internal.c.gtk;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.events.ShellListener;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.Region;
+import org.eclipse.swt.internal.Converter;
+import org.eclipse.swt.internal.SWTEventListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Decorations;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.EventTable;
+import org.eclipse.swt.widgets.Layout;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Monitor;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.widgets.Widget;
+
+import Unicode = tango.text.Unicode;
+
+/**
+ * Instances of this class represent the "windows"
+ * which the desktop or "window manager" is managing.
+ * Instances that do not have a parent (that is, they
+ * are built using the constructor, which takes a
+ * <code>Display</code> as the argument) are described
+ * as <em>top level</em> shells. Instances that do have
+ * a parent are described as <em>secondary</em> or
+ * <em>dialog</em> shells.
+ * <p>
+ * Instances are always displayed in one of the maximized,
+ * minimized or normal states:
+ * <ul>
+ * <li>
+ * When an instance is marked as <em>maximized</em>, the
+ * window manager will typically resize it to fill the
+ * entire visible area of the display, and the instance
+ * is usually put in a state where it can not be resized
+ * (even if it has style <code>RESIZE</code>) until it is
+ * no longer maximized.
+ * </li><li>
+ * When an instance is in the <em>normal</em> state (neither
+ * maximized or minimized), its appearance is controlled by
+ * the style constants which were specified when it was created
+ * and the restrictions of the window manager (see below).
+ * </li><li>
+ * When an instance has been marked as <em>minimized</em>,
+ * its contents (client area) will usually not be visible,
+ * and depending on the window manager, it may be
+ * "iconified" (that is, replaced on the desktop by a small
+ * simplified representation of itself), relocated to a
+ * distinguished area of the screen, or hidden. Combinations
+ * of these changes are also possible.
+ * </li>
+ * </ul>
+ * </p><p>
+ * The <em>modality</em> of an instance may be specified using
+ * style bits. The modality style bits are used to determine
+ * whether input is blocked for other shells on the display.
+ * The <code>PRIMARY_MODAL</code> style allows an instance to block
+ * input to its parent. The <code>APPLICATION_MODAL</code> style
+ * allows an instance to block input to every other shell in the
+ * display. The <code>SYSTEM_MODAL</code> style allows an instance
+ * to block input to all shells, including shells belonging to
+ * different applications.
+ * </p><p>
+ * Note: The styles supported by this class are treated
+ * as <em>HINT</em>s, since the window manager for the
+ * desktop on which the instance is visible has ultimate
+ * control over the appearance and behavior of decorations
+ * and modality. For example, some window managers only
+ * support resizable windows and will always assume the
+ * RESIZE style, even if it is not set. In addition, if a
+ * modality style is not supported, it is "upgraded" to a
+ * more restrictive modality style that is supported. For
+ * example, if <code>PRIMARY_MODAL</code> is not supported,
+ * it would be upgraded to <code>APPLICATION_MODAL</code>.
+ * A modality style may also be "downgraded" to a less
+ * restrictive style. For example, most operating systems
+ * no longer support <code>SYSTEM_MODAL</code> because
+ * it can freeze up the desktop, so this is typically
+ * downgraded to <code>APPLICATION_MODAL</code>.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>BORDER, CLOSE, MIN, MAX, NO_TRIM, RESIZE, TITLE, ON_TOP, TOOL</dd>
+ * <dd>APPLICATION_MODAL, MODELESS, PRIMARY_MODAL, SYSTEM_MODAL</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Activate, Close, Deactivate, Deiconify, Iconify</dd>
+ * </dl>
+ * Class <code>SWT</code> provides two "convenience constants"
+ * for the most commonly required style combinations:
+ * <dl>
+ * <dt><code>SHELL_TRIM</code></dt>
+ * <dd>
+ * the result of combining the constants which are required
+ * to produce a typical application top level shell: (that
+ * is, <code>CLOSE | TITLE | MIN | MAX | RESIZE</code>)
+ * </dd>
+ * <dt><code>DIALOG_TRIM</code></dt>
+ * <dd>
+ * the result of combining the constants which are required
+ * to produce a typical application dialog shell: (that
+ * is, <code>TITLE | CLOSE | BORDER</code>)
+ * </dd>
+ * </dl>
+ * </p>
+ * <p>
+ * Note: Only one of the styles APPLICATION_MODAL, MODELESS,
+ * PRIMARY_MODAL and SYSTEM_MODAL may be specified.
+ * </p><p>
+ * IMPORTANT: This class is not intended to be subclassed.
+ * </p>
+ *
+ * @see Decorations
+ * @see SWT
+ * @see <a href="http://www.eclipse.org/swt/snippets/#shell">Shell snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class Shell : Decorations {
+
+    alias Decorations.createHandle createHandle;
+    alias Decorations.fixStyle fixStyle;
+    alias Decorations.setBounds setBounds;
+    alias Decorations.setCursor setCursor;
+    alias Decorations.setToolTipText setToolTipText;
+    alias Decorations.setZOrder setZOrder;
+
+    GtkWidget* shellHandle, tooltipsHandle, tooltipWindow, group, modalGroup;
+    bool mapped, moved, resized, opened, fullScreen, showWithParent;
+
+    int oldX, oldY, oldWidth, oldHeight;
+    int minWidth, minHeight;
+    Control lastActive;
+    CallbackData filterProcCallbackData;
+    CallbackData sizeAllocateProcCallbackData;
+    CallbackData sizeRequestProcCallbackData;
+
+    static const int MAXIMUM_TRIM = 128;
+
+/**
+ * Constructs a new instance of this class. This is equivalent
+ * to calling <code>Shell((Display) null)</code>.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ */
+public this () {
+    this (cast(Display) null);
+}
+/**
+ * Constructs a new instance of this class given only the style
+ * value describing its behavior and appearance. This is equivalent
+ * to calling <code>Shell((Display) null, style)</code>.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param style the style of control to construct
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#BORDER
+ * @see SWT#CLOSE
+ * @see SWT#MIN
+ * @see SWT#MAX
+ * @see SWT#RESIZE
+ * @see SWT#TITLE
+ * @see SWT#NO_TRIM
+ * @see SWT#SHELL_TRIM
+ * @see SWT#DIALOG_TRIM
+ * @see SWT#MODELESS
+ * @see SWT#PRIMARY_MODAL
+ * @see SWT#APPLICATION_MODAL
+ * @see SWT#SYSTEM_MODAL
+ */
+public this (int style) {
+    this (cast(Display) null, style);
+}
+
+/**
+ * Constructs a new instance of this class given only the display
+ * to create it on. It is created with style <code>SWT.SHELL_TRIM</code>.
+ * <p>
+ * Note: Currently, null can be passed in for the display argument.
+ * This has the effect of creating the shell on the currently active
+ * display if there is one. If there is no current display, the
+ * shell is created on a "default" display. <b>Passing in null as
+ * the display argument is not considered to be good coding style,
+ * and may not be supported in a future release of SWT.</b>
+ * </p>
+ *
+ * @param display the display to create the shell on
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ */
+public this (Display display) {
+    this (display, SWT.SHELL_TRIM);
+}
+/**
+ * Constructs a new instance of this class given the display
+ * to create it on and a style value describing its behavior
+ * and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p><p>
+ * Note: Currently, null can be passed in for the display argument.
+ * This has the effect of creating the shell on the currently active
+ * display if there is one. If there is no current display, the
+ * shell is created on a "default" display. <b>Passing in null as
+ * the display argument is not considered to be good coding style,
+ * and may not be supported in a future release of SWT.</b>
+ * </p>
+ *
+ * @param display the display to create the shell on
+ * @param style the style of control to construct
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#BORDER
+ * @see SWT#CLOSE
+ * @see SWT#MIN
+ * @see SWT#MAX
+ * @see SWT#RESIZE
+ * @see SWT#TITLE
+ * @see SWT#NO_TRIM
+ * @see SWT#SHELL_TRIM
+ * @see SWT#DIALOG_TRIM
+ * @see SWT#MODELESS
+ * @see SWT#PRIMARY_MODAL
+ * @see SWT#APPLICATION_MODAL
+ * @see SWT#SYSTEM_MODAL
+ */
+public this (Display display, int style) {
+    this (display, null, style, null, false);
+}
+
+this (Display display, Shell parent, int style, GtkWidget* handle, bool embedded) {
+    super ();
+    checkSubclass ();
+    if (display is null) display = Display.getCurrent ();
+    if (display is null) display = Display.getDefault ();
+    if (!display.isValidThread ()) {
+        error (SWT.ERROR_THREAD_INVALID_ACCESS);
+    }
+    if (parent !is null && parent.isDisposed ()) {
+        error (SWT.ERROR_INVALID_ARGUMENT);
+    }
+    this.style = checkStyle (style);
+    this.parent = parent;
+    this.display = display;
+    if (handle !is null) {
+        if (embedded) {
+            this.handle = handle;
+        } else {
+            shellHandle = handle;
+            state |= FOREIGN_HANDLE;
+        }
+    }
+    createWidget (0);
+}
+
+/**
+ * Constructs a new instance of this class given only its
+ * parent. It is created with style <code>SWT.DIALOG_TRIM</code>.
+ * <p>
+ * Note: Currently, null can be passed in for the parent.
+ * This has the effect of creating the shell on the currently active
+ * display if there is one. If there is no current display, the
+ * shell is created on a "default" display. <b>Passing in null as
+ * the parent is not considered to be good coding style,
+ * and may not be supported in a future release of SWT.</b>
+ * </p>
+ *
+ * @param parent a shell which will be the parent of the new instance
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the parent is disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ */
+public this (Shell parent) {
+    this (parent, SWT.DIALOG_TRIM);
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p><p>
+ * Note: Currently, null can be passed in for the parent.
+ * This has the effect of creating the shell on the currently active
+ * display if there is one. If there is no current display, the
+ * shell is created on a "default" display. <b>Passing in null as
+ * the parent is not considered to be good coding style,
+ * and may not be supported in a future release of SWT.</b>
+ * </p>
+ *
+ * @param parent a shell which will be the parent of the new instance
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the parent is disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#BORDER
+ * @see SWT#CLOSE
+ * @see SWT#MIN
+ * @see SWT#MAX
+ * @see SWT#RESIZE
+ * @see SWT#TITLE
+ * @see SWT#NO_TRIM
+ * @see SWT#SHELL_TRIM
+ * @see SWT#DIALOG_TRIM
+ * @see SWT#ON_TOP
+ * @see SWT#TOOL
+ * @see SWT#MODELESS
+ * @see SWT#PRIMARY_MODAL
+ * @see SWT#APPLICATION_MODAL
+ * @see SWT#SYSTEM_MODAL
+ */
+public this (Shell parent, int style) {
+    this (parent !is null ? parent.display : null, parent, style, null, false);
+}
+
+public static Shell gtk_new (Display display, GtkWidget* handle) {
+    return new Shell (display, null, SWT.NO_TRIM, handle, true);
+}
+
+/**  
+ * Invokes platform specific functionality to allocate a new shell
+ * that is not embedded.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Shell</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param display the display for the shell
+ * @param handle the handle for the shell
+ * @return a new shell object containing the specified display and handle
+ * 
+ * @since 3.3
+ */
+public static Shell internal_new (Display display, GtkWidget* handle) {
+    return new Shell (display, null, SWT.NO_TRIM, handle, false);
+}
+
+static int checkStyle (int style) {
+    style = Decorations.checkStyle (style);
+    style &= ~SWT.TRANSPARENT;
+    if ((style & SWT.ON_TOP) !is 0) style &= ~SWT.SHELL_TRIM;
+    int mask = SWT.SYSTEM_MODAL | SWT.APPLICATION_MODAL | SWT.PRIMARY_MODAL;
+    int bits = style & ~mask;
+    if ((style & SWT.SYSTEM_MODAL) !is 0) return bits | SWT.SYSTEM_MODAL;
+    if ((style & SWT.APPLICATION_MODAL) !is 0) return bits | SWT.APPLICATION_MODAL;
+    if ((style & SWT.PRIMARY_MODAL) !is 0) return bits | SWT.PRIMARY_MODAL;
+    return bits;
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when operations are performed on the receiver,
+ * by sending the listener one of the messages defined in the
+ * <code>ShellListener</code> interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ShellListener
+ * @see #removeShellListener
+ */
+public void addShellListener (ShellListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Close,typedListener);
+    addListener (SWT.Iconify,typedListener);
+    addListener (SWT.Deiconify,typedListener);
+    addListener (SWT.Activate, typedListener);
+    addListener (SWT.Deactivate, typedListener);
+}
+
+void adjustTrim () {
+    if (display.ignoreTrim) return;
+    int width = OS.GTK_WIDGET_WIDTH (shellHandle);
+    int height = OS.GTK_WIDGET_HEIGHT (shellHandle);
+    auto window = OS.GTK_WIDGET_WINDOW (shellHandle);
+    GdkRectangle* rect = new GdkRectangle ();
+    OS.gdk_window_get_frame_extents (window, rect);
+    int trimWidth = Math.max (0, rect.width - width);
+    int trimHeight = Math.max (0, rect.height - height);
+    /*
+    * Bug in GTK.  gdk_window_get_frame_extents() fails for various window
+    * managers, causing a large incorrect value to be returned as the trim.
+    * The fix is to ignore the returned trim values if they are too large.
+    */
+    if (trimWidth > MAXIMUM_TRIM || trimHeight > MAXIMUM_TRIM) {
+        display.ignoreTrim = true;
+        return;
+    }
+    bool hasTitle = false, hasResize = false, hasBorder = false;
+    if ((style & SWT.NO_TRIM) is 0) {
+        hasTitle = (style & (SWT.MIN | SWT.MAX | SWT.TITLE | SWT.MENU)) !is 0;
+        hasResize = (style & SWT.RESIZE) !is 0;
+        hasBorder = (style & SWT.BORDER) !is 0;
+    }
+    if (hasTitle) {
+        if (hasResize)  {
+            display.titleResizeTrimWidth = trimWidth;
+            display.titleResizeTrimHeight = trimHeight;
+            return;
+        }
+        if (hasBorder) {
+            display.titleBorderTrimWidth = trimWidth;
+            display.titleBorderTrimHeight = trimHeight;
+            return;
+        }
+        display.titleTrimWidth = trimWidth;
+        display.titleTrimHeight = trimHeight;
+        return;
+    }
+    if (hasResize) {
+        display.resizeTrimWidth = trimWidth;
+        display.resizeTrimHeight = trimHeight;
+        return;
+    }
+    if (hasBorder) {
+        display.borderTrimWidth = trimWidth;
+        display.borderTrimHeight = trimHeight;
+        return;
+    }
+}
+
+void bringToTop (bool force) {
+    if (!OS.GTK_WIDGET_VISIBLE (shellHandle)) return;
+    Display display = this.display;
+    Shell activeShell = display.activeShell;
+    if (activeShell is this) return;
+    if (!force) {
+        if (activeShell is null) return;
+        if (!display.activePending) {
+            auto focusHandle = OS.gtk_window_get_focus (cast(GtkWindow*)activeShell.shellHandle);
+            if (focusHandle !is null && !OS.GTK_WIDGET_HAS_FOCUS (focusHandle)) return;
+        }
+    }
+    /*
+    * Bug in GTK.  When a shell that is not managed by the window
+    * manage is given focus, GTK gets stuck in "focus follows pointer"
+    * mode when the pointer is within the shell and its parent when
+    * the shell is hidden or disposed. The fix is to use XSetInputFocus()
+    * to assign focus when ever the active shell has not managed by
+    * the window manager.
+    *
+    * NOTE: This bug is fixed in GTK+ 2.6.8 and above.
+    */
+    bool xFocus = false;
+    if (activeShell !is null) {
+        if (OS.GTK_VERSION < OS.buildVERSION (2, 6, 8)) {
+            xFocus = activeShell.isUndecorated ();
+        }
+        display.activeShell = null;
+        display.activePending = true;
+    }
+    /*
+    * Feature in GTK.  When the shell is an override redirect
+    * window, gdk_window_focus() does not give focus to the
+    * window.  The fix is to use XSetInputFocus() to force
+    * the focus.
+    */
+    auto window = OS.GTK_WIDGET_WINDOW (shellHandle);
+    if ((xFocus || (style & SWT.ON_TOP) !is 0) && OS.GDK_WINDOWING_X11 ()) {
+        auto xDisplay = OS.gdk_x11_drawable_get_xdisplay (window);
+        auto xWindow = OS.gdk_x11_drawable_get_xid (window);
+        OS.gdk_error_trap_push ();
+        /* Use CurrentTime instead of the last event time to ensure that the shell becomes active */
+        OS.XSetInputFocus (xDisplay, xWindow, OS.RevertToParent, OS.CurrentTime);
+        OS.gdk_error_trap_pop ();
+    } else {
+        /*
+        * Bug in metacity.  Calling gdk_window_focus() with a timestamp more
+        * recent than the last user interaction time can cause windows not
+        * to come forward in versions > 2.10.0.  The fix is to use the last
+        * user event time.
+        */
+        if ( Unicode.toLower( display.windowManager ) ==/*eq*/ "metacity") {
+            OS.gdk_window_focus (window, display.lastUserEventTime);
+        } else {
+            OS.gdk_window_focus (window, OS.GDK_CURRENT_TIME);
+        }
+    }
+    display.activeShell = this;
+    display.activePending = true;
+}
+
+override void checkBorder () {
+    /* Do nothing */
+}
+
+override void checkOpen () {
+    if (!opened) resized = false;
+}
+
+override GtkStyle* childStyle () {
+    return null;
+}
+
+/**
+ * Requests that the window manager close the receiver in
+ * the same way it would be closed when the user clicks on
+ * the "close box" or performs some other platform specific
+ * key or mouse combination that indicates the window
+ * should be removed.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT#Close
+ * @see #dispose
+ */
+public void close () {
+    checkWidget ();
+    closeWidget ();
+}
+
+void closeWidget () {
+    Event event = new Event ();
+    sendEvent (SWT.Close, event);
+    if (event.doit && !isDisposed ()) dispose ();
+}
+
+override public Rectangle computeTrim (int x, int y, int width, int height) {
+    checkWidget();
+    Rectangle trim = super.computeTrim (x, y, width, height);
+    int border = 0;
+    if ((style & (SWT.NO_TRIM | SWT.BORDER | SWT.SHELL_TRIM)) is 0) {
+        border = OS.gtk_container_get_border_width (cast(GtkContainer*)shellHandle);
+    }
+    int trimWidth = trimWidth (), trimHeight = trimHeight ();
+    trim.x -= (trimWidth / 2) + border;
+    trim.y -= trimHeight - (trimWidth / 2) + border;
+    trim.width += trimWidth + border * 2;
+    trim.height += trimHeight + border * 2;
+    if (menuBar !is null) {
+        forceResize ();
+        int menuBarHeight = OS.GTK_WIDGET_HEIGHT (menuBar.handle);
+        trim.y -= menuBarHeight;
+        trim.height += menuBarHeight;
+    }
+    return trim;
+}
+
+override void createHandle (int index) {
+    state |= HANDLE | CANVAS;
+    if (shellHandle is null) {
+        if (handle is null) {
+            int type = OS.GTK_WINDOW_TOPLEVEL;
+            if ((style & SWT.ON_TOP) !is 0) type = OS.GTK_WINDOW_POPUP;
+            shellHandle = cast(GtkWidget*)OS.gtk_window_new (type);
+        } else {
+            shellHandle = cast(GtkWidget*) OS.gtk_plug_new (cast(uint)handle);
+        }
+        if (shellHandle is null) error (SWT.ERROR_NO_HANDLES);
+        if (parent !is null) {
+            OS.gtk_window_set_transient_for (cast(GtkWindow*)shellHandle, cast(GtkWindow*)parent.topHandle ());
+            OS.gtk_window_set_destroy_with_parent (cast(GtkWindow*)shellHandle, true);
+            if (!isUndecorated ()) {
+                OS.gtk_window_set_type_hint (cast(GtkWindow*)shellHandle, OS.GDK_WINDOW_TYPE_HINT_DIALOG);
+            } else {
+                if (OS.GTK_VERSION >= OS.buildVERSION (2, 2, 0)) {
+                    OS.gtk_window_set_skip_taskbar_hint (cast(GtkWindow*)shellHandle, true);
+                }
+            }
+        }
+        /*
+        * Feature in GTK.  The window size must be set when the window
+        * is created or it will not be allowed to be resized smaller that the
+        * initial size by the user.  The fix is to set the size to zero.
+        */
+        if ((style & SWT.RESIZE) !is 0) {
+            OS.gtk_widget_set_size_request (shellHandle, 0, 0);
+            OS.gtk_window_set_resizable (cast(GtkWindow*)shellHandle, true);
+        } else {
+            OS.gtk_window_set_resizable (cast(GtkWindow*)shellHandle, false);
+        }
+        vboxHandle = OS.gtk_vbox_new (false, 0);
+        if (vboxHandle is null) error (SWT.ERROR_NO_HANDLES);
+        createHandle (index, false, true);
+        OS.gtk_container_add (cast(GtkContainer*)vboxHandle, scrolledHandle);
+        OS.gtk_box_set_child_packing (cast(GtkBox*)vboxHandle, scrolledHandle, true, true, 0, OS.GTK_PACK_END);
+        String dummy = "a";
+        OS.gtk_window_set_title (cast(GtkWindow*)shellHandle, dummy.ptr );
+        if ((style & (SWT.NO_TRIM | SWT.BORDER | SWT.SHELL_TRIM)) is 0) {
+            OS.gtk_container_set_border_width (cast(GtkContainer*)shellHandle, 1);
+            GdkColor* color = new GdkColor ();
+            OS.gtk_style_get_black (OS.gtk_widget_get_style (shellHandle), color);
+            OS.gtk_widget_modify_bg (shellHandle,  OS.GTK_STATE_NORMAL, color);
+        }
+    } else {
+        vboxHandle = OS.gtk_bin_get_child (cast(GtkBin*)shellHandle);
+        if (vboxHandle is null) error (SWT.ERROR_NO_HANDLES);
+        auto children = OS.gtk_container_get_children (cast(GtkContainer*)vboxHandle);
+        if (OS.g_list_length (children) > 0) {
+            scrolledHandle = cast(GtkWidget*)OS.g_list_data (children);
+        }
+        OS.g_list_free (children);
+        if (scrolledHandle is null) error (SWT.ERROR_NO_HANDLES);
+        handle = OS.gtk_bin_get_child (cast(GtkBin*)scrolledHandle);
+        if (handle is null) error (SWT.ERROR_NO_HANDLES);
+    }
+    group = cast(GtkWidget*) OS.gtk_window_group_new ();
+    if (group is null) error (SWT.ERROR_NO_HANDLES);
+    /*
+    * Feature in GTK.  Realizing the shell triggers a size allocate event,
+    * which may be confused for a resize event from the window manager if
+    * received too late.  The fix is to realize the window during creation
+    * to avoid confusion.
+    */
+    OS.gtk_widget_realize (shellHandle);
+}
+
+override int /*long*/ filterProc ( XEvent* xEvent, GdkEvent* gdkEvent, void* data2) {
+    int eventType = OS.X_EVENT_TYPE (xEvent);
+    if (eventType !is OS.FocusOut && eventType !is OS.FocusIn) return 0;
+    XFocusChangeEvent* xFocusEvent = cast(XFocusChangeEvent*)xEvent;
+    switch (eventType) {
+        case OS.FocusIn:
+            if (xFocusEvent.mode is OS.NotifyNormal || xFocusEvent.mode is OS.NotifyWhileGrabbed) {
+                switch (xFocusEvent.detail) {
+                    case OS.NotifyNonlinear:
+                    case OS.NotifyNonlinearVirtual:
+                    case OS.NotifyAncestor:
+                        if (tooltipsHandle !is null) OS.gtk_tooltips_enable (cast(GtkTooltips*)tooltipsHandle);
+                        display.activeShell = this;
+                        display.activePending = false;
+                        sendEvent (SWT.Activate);
+                        break;
+                    default:
+                }
+            }
+            break;
+        case OS.FocusOut:
+            if (xFocusEvent.mode is OS.NotifyNormal || xFocusEvent.mode is OS.NotifyWhileGrabbed) {
+                switch (xFocusEvent.detail) {
+                    case OS.NotifyNonlinear:
+                    case OS.NotifyNonlinearVirtual:
+                    case OS.NotifyVirtual:
+                        if (tooltipsHandle !is null) OS.gtk_tooltips_disable (cast(GtkTooltips*)tooltipsHandle);
+                        Display display = this.display;
+                        sendEvent (SWT.Deactivate);
+                        setActiveControl (null);
+                        if (display.activeShell is this) {
+                            display.activeShell = null;
+                            display.activePending = false;
+                        }
+                        break;
+                    default:
+                }
+            }
+            break;
+        default:
+    }
+    return 0;
+}
+
+override Control findBackgroundControl () {
+    return (state & BACKGROUND) !is 0 || backgroundImage !is null ? this : null;
+}
+
+override Composite findDeferredControl () {
+    return layoutCount > 0 ? this : null;
+}
+
+override bool hasBorder () {
+    return false;
+}
+
+override void hookEvents () {
+    super.hookEvents ();
+    OS.g_signal_connect_closure_by_id (shellHandle, display.signalIds [KEY_PRESS_EVENT], 0, display.closures [KEY_PRESS_EVENT], false);
+    OS.g_signal_connect_closure_by_id (shellHandle, display.signalIds [WINDOW_STATE_EVENT], 0, display.closures [WINDOW_STATE_EVENT], false);
+    OS.g_signal_connect_closure_by_id (shellHandle, display.signalIds [SIZE_ALLOCATE], 0, display.closures [SIZE_ALLOCATE], false);
+    OS.g_signal_connect_closure_by_id (shellHandle, display.signalIds [CONFIGURE_EVENT], 0, display.closures [CONFIGURE_EVENT], false);
+    OS.g_signal_connect_closure_by_id (shellHandle, display.signalIds [DELETE_EVENT], 0, display.closures [DELETE_EVENT], false);
+    OS.g_signal_connect_closure_by_id (shellHandle, display.signalIds [MAP_EVENT], 0, display.shellMapProcClosure, false);
+    OS.g_signal_connect_closure_by_id (shellHandle, display.signalIds [ENTER_NOTIFY_EVENT], 0, display.closures [ENTER_NOTIFY_EVENT], false);
+    OS.g_signal_connect_closure (shellHandle, OS.move_focus.ptr, display.closures [MOVE_FOCUS], false);
+    auto window = OS.GTK_WIDGET_WINDOW (shellHandle);
+    display.doWindowAddFilter( &filterProcCallbackData, window, shellHandle );
+    //OS.gdk_window_add_filter  (window, display.filterProc, shellHandle);
+}
+
+override public bool isEnabled () {
+    checkWidget ();
+    return getEnabled ();
+}
+
+bool isUndecorated () {
+    return
+        (style & (SWT.SHELL_TRIM | SWT.BORDER)) is SWT.NONE ||
+        (style & (SWT.NO_TRIM | SWT.ON_TOP)) !is 0;
+}
+
+override public bool isVisible () {
+    checkWidget();
+    return getVisible ();
+}
+
+override void register () {
+    super.register ();
+    display.addWidget (shellHandle, this);
+}
+
+override void releaseParent () {
+    /* Do nothing */
+}
+
+override GtkWidget* topHandle () {
+    return shellHandle;
+}
+
+void fixActiveShell () {
+    if (display.activeShell is this) {
+        Shell shell = null;
+        if (parent !is null && parent.isVisible ()) shell = parent.getShell ();
+        if (shell is null && isUndecorated ()) {
+            Shell [] shells = display.getShells ();
+            for (int i = 0; i < shells.length; i++) {
+                if (shells [i] !is null && shells [i].isVisible ()) {
+                    shell = shells [i];
+                    break;
+                }
+            }
+        }
+        if (shell !is null) shell.bringToTop (false);
+    }
+}
+
+void fixShell (Shell newShell, Control control) {
+    if (this is newShell) return;
+    if (control is lastActive) setActiveControl (null);
+    String toolTipText = control.toolTipText;
+    if (toolTipText !is null) {
+        control.setToolTipText (this, null);
+        control.setToolTipText (newShell, toolTipText);
+    }
+}
+
+override void fixedSizeAllocateProc(GtkWidget* widget, GtkAllocation* allocationPtr) {
+    int clientWidth = 0;
+    if ((style & SWT.MIRRORED) !is 0) clientWidth = getClientWidth ();
+    super.fixedSizeAllocateProc (widget, allocationPtr);
+    if ((style & SWT.MIRRORED) !is 0) moveChildren (clientWidth);
+}
+
+override void fixStyle (GtkWidget* handle) {
+}
+
+override void forceResize () {
+    forceResize (OS.GTK_WIDGET_WIDTH (vboxHandle), OS.GTK_WIDGET_HEIGHT (vboxHandle));
+}
+
+void forceResize (int width, int height) {
+    GtkRequisition requisition;
+    OS.gtk_widget_size_request (vboxHandle, &requisition);
+    GtkAllocation allocation;
+    int border = OS.gtk_container_get_border_width (cast(GtkContainer*)shellHandle);
+    allocation.x = border;
+    allocation.y = border;
+    allocation.width = width;
+    allocation.height = height;
+    OS.gtk_widget_size_allocate (cast(GtkWidget*)vboxHandle, &allocation);
+}
+
+/**
+ * Returns the receiver's alpha value. The alpha value
+ * is between 0 (transparent) and 255 (opaque).
+ *
+ * @return the alpha value
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * 
+ * @since 3.4
+ */
+public int getAlpha () {
+    checkWidget ();
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 12, 0)) {
+        if (OS.gtk_widget_is_composited (shellHandle)) {
+            return cast(int) (OS.gtk_window_get_opacity (shellHandle) * 255);
+        }
+    }
+    return 255;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is currently
+ * in fullscreen state, and false otherwise. 
+ * <p>
+ *
+ * @return the fullscreen state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.4
+ */
+public bool getFullScreen () {
+    checkWidget();
+    return fullScreen;
+}
+
+override public Point getLocation () {
+    checkWidget ();
+    int x, y;
+    OS.gtk_window_get_position (cast(GtkWindow*)shellHandle, &x,&y);
+    return new Point (x, y);
+}
+
+public bool getMaximized () {
+    checkWidget();
+    return !fullScreen && super.getMaximized ();
+}
+
+/**
+ * Returns a point describing the minimum receiver's size. The
+ * x coordinate of the result is the minimum width of the receiver.
+ * The y coordinate of the result is the minimum height of the
+ * receiver.
+ *
+ * @return the receiver's size
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public Point getMinimumSize () {
+    checkWidget ();
+    int width = Math.max (1, minWidth + trimWidth ());
+    int height = Math.max (1, minHeight + trimHeight ());
+    return new Point (width, height);
+}
+
+Shell getModalShell () {
+    Shell shell = null;
+    Shell [] modalShells = display.modalShells;
+    if (modalShells !is null) {
+        int bits = SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL;
+        int index = modalShells.length;
+        while (--index >= 0) {
+            Shell modal = modalShells [index];
+            if (modal !is null) {
+                if ((modal.style & bits) !is 0) {
+                    Control control = this;
+                    while (control !is null) {
+                        if (control is modal) break;
+                        control = control.parent;
+                    }
+                    if (control !is modal) return modal;
+                    break;
+                }
+                if ((modal.style & SWT.PRIMARY_MODAL) !is 0) {
+                    if (shell is null) shell = getShell ();
+                    if (modal.parent is shell) return modal;
+                }
+            }
+        }
+    }
+    return null;
+}
+
+override public Point getSize () {
+    checkWidget ();
+    int width = OS.GTK_WIDGET_WIDTH (vboxHandle);
+    int height = OS.GTK_WIDGET_HEIGHT (vboxHandle);
+    int border = 0;
+    if ((style & (SWT.NO_TRIM | SWT.BORDER | SWT.SHELL_TRIM)) is 0) {
+        border = OS.gtk_container_get_border_width (cast(GtkContainer*)shellHandle);
+    }
+    return new Point (width + trimWidth () + 2*border, height + trimHeight () + 2*border);
+}
+
+override public bool getVisible () {
+    checkWidget();
+    return OS.GTK_WIDGET_VISIBLE (shellHandle);
+}
+
+/**
+ * Returns the region that defines the shape of the shell,
+ * or null if the shell has the default shape.
+ *
+ * @return the region that defines the shape of the shell (or null)
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ *
+ */
+public Region getRegion () {
+    /* This method is needed for @since 3.0 Javadoc */
+    checkWidget ();
+    return region;
+}
+
+/**
+ * Returns the receiver's input method editor mode. This
+ * will be the result of bitwise OR'ing together one or
+ * more of the following constants defined in class
+ * <code>SWT</code>:
+ * <code>NONE</code>, <code>ROMAN</code>, <code>DBCS</code>,
+ * <code>PHONETIC</code>, <code>NATIVE</code>, <code>ALPHA</code>.
+ *
+ * @return the IME mode
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT
+ */
+public int getImeInputMode () {
+    checkWidget();
+    return SWT.NONE;
+}
+
+override Shell _getShell () {
+    return this;
+}
+/**
+ * Returns an array containing all shells which are
+ * descendants of the receiver.
+ * <p>
+ * @return the dialog shells
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Shell [] getShells () {
+    checkWidget();
+    int count = 0;
+    Shell [] shells = display.getShells ();
+    for (int i=0; i<shells.length; i++) {
+        Control shell = shells [i];
+        do {
+            shell = shell.getParent ();
+        } while (shell !is null && shell !is this);
+        if (shell is this) count++;
+    }
+    int index = 0;
+    Shell [] result = new Shell [count];
+    for (int i=0; i<shells.length; i++) {
+        Control shell = shells [i];
+        do {
+            shell = shell.getParent ();
+        } while (shell !is null && shell !is this);
+        if (shell is this) {
+            result [index++] = shells [i];
+        }
+    }
+    return result;
+}
+
+override int /*long*/ gtk_configure_event (GtkWidget* widget, int /*long*/ event) {
+    int x, y;
+    OS.gtk_window_get_position (cast(GtkWindow*)shellHandle, &x, &y);
+    if (!moved || oldX !is x || oldY !is y) {
+        moved = true;
+        oldX = x;
+        oldY = y;
+        sendEvent (SWT.Move);
+        // widget could be disposed at this point
+    }
+    return 0;
+}
+
+override int /*long*/ gtk_delete_event (GtkWidget* widget, int /*long*/ event) {
+    if (isEnabled()) closeWidget ();
+    return 1;
+}
+
+override int /*long*/ gtk_enter_notify_event (GtkWidget* widget, GdkEventCrossing* event) {
+    if (widget !is shellHandle) {
+        return super.gtk_enter_notify_event (widget, event);
+    }
+    return 0;
+}
+
+override int /*long*/ gtk_focus (GtkWidget* widget, int directionType) {
+    switch (cast(int)/*64*/directionType) {
+        case OS.GTK_DIR_TAB_FORWARD:
+        case OS.GTK_DIR_TAB_BACKWARD:
+            Control control = display.getFocusControl ();
+            if (control !is null) {
+                if ((control.state & CANVAS) !is 0 && (control.style & SWT.EMBEDDED) !is 0) {
+                    int traversal = directionType is OS.GTK_DIR_TAB_FORWARD ? SWT.TRAVERSE_TAB_NEXT : SWT.TRAVERSE_TAB_PREVIOUS;
+                    control.traverse (traversal);
+                    return 1;
+                }
+            }
+            break;
+        default:
+    }
+    return super.gtk_focus (widget, directionType);
+}
+
+override int /*long*/ gtk_move_focus (GtkWidget* widget, int directionType) {
+    Control control = display.getFocusControl ();
+    if (control !is null) {
+        auto focusHandle = control.focusHandle ();
+        OS.gtk_widget_child_focus (focusHandle, directionType);
+    }
+    OS.g_signal_stop_emission_by_name (shellHandle, OS.move_focus.ptr );
+    return 1;
+}
+
+override int /*long*/ gtk_key_press_event (GtkWidget* widget, GdkEventKey* event) {
+    /* Stop menu mnemonics when the shell is disabled */
+    if (widget is shellHandle) {
+        return (state & DISABLED) !is 0 ? 1 : 0;
+    }
+    return super.gtk_key_press_event (widget, event);
+}
+
+override int /*long*/ gtk_size_allocate (GtkWidget* widget, int /*long*/ allocation) {
+    int width = OS.GTK_WIDGET_WIDTH (shellHandle);
+    int height = OS.GTK_WIDGET_HEIGHT (shellHandle);
+    if (!resized || oldWidth !is width || oldHeight !is height) {
+        oldWidth = width;
+        oldHeight = height;
+        resizeBounds (width, height, true);
+    }
+    return 0;
+}
+
+override int /*long*/ gtk_realize (GtkWidget* widget) {
+    auto result = super.gtk_realize (widget);
+    auto window = OS.GTK_WIDGET_WINDOW (shellHandle);
+    if ((style & SWT.SHELL_TRIM) !is SWT.SHELL_TRIM) {
+        int decorations = 0;
+        if ((style & SWT.NO_TRIM) is 0) {
+            if ((style & SWT.MIN) !is 0) decorations |= OS.GDK_DECOR_MINIMIZE;
+            if ((style & SWT.MAX) !is 0) decorations |= OS.GDK_DECOR_MAXIMIZE;
+            if ((style & SWT.RESIZE) !is 0) decorations |= OS.GDK_DECOR_RESIZEH;
+            if ((style & SWT.BORDER) !is 0) decorations |= OS.GDK_DECOR_BORDER;
+            if ((style & SWT.MENU) !is 0) decorations |= OS.GDK_DECOR_MENU;
+            if ((style & SWT.TITLE) !is 0) decorations |= OS.GDK_DECOR_TITLE;
+            /*
+            * Feature in GTK.  Under some Window Managers (Sawmill), in order
+            * to get any border at all from the window manager it is necessary to
+            * set GDK_DECOR_BORDER.  The fix is to force these bits when any
+            * kind of border is requested.
+            */
+            if ((style & SWT.RESIZE) !is 0) decorations |= OS.GDK_DECOR_BORDER;
+        }
+        OS.gdk_window_set_decorations (window, decorations);
+    }
+    if ((style & SWT.ON_TOP) !is 0) {
+        OS.gdk_window_set_override_redirect (window, true);
+    }
+    return result;
+}
+
+override int /*long*/ gtk_window_state_event (GtkWidget* widget, GdkEventWindowState* event) {
+    minimized = (event.new_window_state & OS.GDK_WINDOW_STATE_ICONIFIED) !is 0;
+    maximized = (event.new_window_state & OS.GDK_WINDOW_STATE_MAXIMIZED) !is 0;
+    fullScreen = (event.new_window_state & OS.GDK_WINDOW_STATE_FULLSCREEN) !is 0;
+    if ((event.changed_mask & OS.GDK_WINDOW_STATE_ICONIFIED) !is 0) {
+        if (minimized) {
+            sendEvent (SWT.Iconify);
+        } else {
+            sendEvent (SWT.Deiconify);
+        }
+        updateMinimized (minimized);
+    }
+    return 0;
+}
+
+/**
+ * Moves the receiver to the top of the drawing order for
+ * the display on which it was created (so that all other
+ * shells on that display, which are not the receiver's
+ * children will be drawn behind it), marks it visible,
+ * sets the focus and asks the window manager to make the
+ * shell active.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Control#moveAbove
+ * @see Control#setFocus
+ * @see Control#setVisible
+ * @see Display#getActiveShell
+ * @see Decorations#setDefaultButton(Button)
+ * @see Shell#setActive
+ * @see Shell#forceActive
+ */
+public void open () {
+    checkWidget ();
+    bringToTop (false);
+    setVisible (true);
+    if (isDisposed ()) return;
+    if (!restoreFocus () && !traverseGroup (true)) setFocus ();
+}
+
+public bool print (GC gc) {
+    checkWidget ();
+    if (gc is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (gc.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+    return false;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when operations are performed on the receiver.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ShellListener
+ * @see #addShellListener
+ */
+public void removeShellListener (ShellListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Close, listener);
+    eventTable.unhook (SWT.Iconify,listener);
+    eventTable.unhook (SWT.Deiconify,listener);
+    eventTable.unhook (SWT.Activate, listener);
+    eventTable.unhook (SWT.Deactivate, listener);
+}
+
+/**
+ * If the receiver is visible, moves it to the top of the
+ * drawing order for the display on which it was created
+ * (so that all other shells on that display, which are not
+ * the receiver's children will be drawn behind it) and asks
+ * the window manager to make the shell active
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ * @see Control#moveAbove
+ * @see Control#setFocus
+ * @see Control#setVisible
+ * @see Display#getActiveShell
+ * @see Decorations#setDefaultButton(Button)
+ * @see Shell#open
+ * @see Shell#setActive
+ */
+public void setActive () {
+    checkWidget ();
+    bringToTop (false);
+}
+
+void setActiveControl (Control control) {
+    if (control !is null && control.isDisposed ()) control = null;
+    if (lastActive !is null && lastActive.isDisposed ()) lastActive = null;
+    if (lastActive is control) return;
+
+    /*
+    * Compute the list of controls to be activated and
+    * deactivated by finding the first common parent
+    * control.
+    */
+    Control [] activate = (control is null) ? new Control[0] : control.getPath ();
+    Control [] deactivate = (lastActive is null) ? new Control[0] : lastActive.getPath ();
+    lastActive = control;
+    int index = 0, length = Math.min (activate.length, deactivate.length);
+    while (index < length) {
+        if (activate [index] !is deactivate [index]) break;
+        index++;
+    }
+
+    /*
+    * It is possible (but unlikely), that application
+    * code could have destroyed some of the widgets. If
+    * this happens, keep processing those widgets that
+    * are not disposed.
+    */
+    for (int i=deactivate.length-1; i>=index; --i) {
+        if (!deactivate [i].isDisposed ()) {
+            deactivate [i].sendEvent (SWT.Deactivate);
+        }
+    }
+    for (int i=activate.length-1; i>=index; --i) {
+        if (!activate [i].isDisposed ()) {
+            activate [i].sendEvent (SWT.Activate);
+        }
+    }
+}
+
+/**
+ * Sets the receiver's alpha value which must be
+ * between 0 (transparent) and 255 (opaque).
+ * <p>
+ * This operation requires the operating system's advanced
+ * widgets subsystem which may not be available on some
+ * platforms.
+ * </p>
+ * @param alpha the alpha value
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * 
+ * @since 3.4
+ */
+public void setAlpha (int alpha) {
+    checkWidget ();
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 12, 0)) {
+        if (OS.gtk_widget_is_composited (shellHandle)) {
+            alpha &= 0xFF;
+            OS.gtk_window_set_opacity (shellHandle, alpha / 255f);
+        }
+    }
+}
+
+void resizeBounds (int width, int height, bool notify) {
+    if (redrawWindow !is null) {
+        OS.gdk_window_resize (redrawWindow, width, height);
+    }
+    if (enableWindow !is null) {
+        OS.gdk_window_resize (enableWindow, width, height);
+    }
+    int border = OS.gtk_container_get_border_width (cast(GtkContainer*)shellHandle);
+    int boxWidth = width - 2*border;
+    int boxHeight = height - 2*border;
+    OS.gtk_widget_set_size_request (vboxHandle, boxWidth, boxHeight);
+    forceResize (boxWidth, boxHeight);
+    if (notify) {
+        resized = true;
+        sendEvent (SWT.Resize);
+        if (isDisposed ()) return;
+        if (layout_ !is null) {
+            markLayout (false, false);
+            updateLayout (false);
+        }
+    }
+}
+
+override int setBounds (int x, int y, int width, int height, bool move, bool resize) {
+    if (fullScreen) setFullScreen (false);
+    /*
+    * Bug in GTK.  When either of the location or size of
+    * a shell is changed while the shell is maximized, the
+    * shell is moved to (0, 0).  The fix is to explicitly
+    * unmaximize the shell before setting the bounds to
+    * anything different from the current bounds.
+    */
+    if (getMaximized ()) {
+        Rectangle rect = getBounds ();
+        bool sameOrigin = !move || (rect.x is x && rect.y is y);
+        bool sameExtent = !resize || (rect.width is width && rect.height is height);
+        if (sameOrigin && sameExtent) return 0;
+        setMaximized (false);
+    }
+    int result = 0;
+    if (move) {
+        int x_pos, y_pos;
+        OS.gtk_window_get_position (cast(GtkWindow*)shellHandle, &x_pos, &y_pos);
+        OS.gtk_window_move (cast(GtkWindow*)shellHandle, x, y);
+        if (x_pos !is x || y_pos !is y) {
+            moved = true;
+            oldX = x;
+            oldY = y;
+            sendEvent (SWT.Move);
+            if (isDisposed ()) return 0;
+            result |= MOVED;
+        }
+    }
+    if (resize) {
+        width = Math.max (1, Math.max (minWidth, width - trimWidth ()));
+        height = Math.max (1, Math.max (minHeight, height - trimHeight ()));
+        if ((style & SWT.RESIZE) !is 0) OS.gtk_window_resize (cast(GtkWindow*)shellHandle, width, height);
+        bool changed = width !is oldWidth || height !is oldHeight;
+        if (changed) {
+            oldWidth = width;
+            oldHeight = height;
+            result |= RESIZED;
+        }
+        resizeBounds (width, height, changed);
+    }
+    return result;
+}
+
+override void gtk_setCursor (GdkCursor* cursor) {
+    if (enableWindow !is null) {
+        OS.gdk_window_set_cursor (cast(GdkDrawable*)enableWindow, cursor);
+        if (!OS.GDK_WINDOWING_X11 ()) {
+            OS.gdk_flush ();
+        } else {
+            auto xDisplay = OS.GDK_DISPLAY ();
+            OS.XFlush (xDisplay);
+        }
+    }
+    super.gtk_setCursor (cursor);
+}
+
+public override void setEnabled (bool enabled) {
+    checkWidget();
+    if (((state & DISABLED) is 0) is enabled) return;
+    Display display = this.display;
+    Control control = null;
+    bool fixFocus_ = false;
+    if (!enabled) {
+        if (display.focusEvent !is SWT.FocusOut) {
+            control = display.getFocusControl ();
+            fixFocus_ = isFocusAncestor (control);
+        }
+    }
+    if (enabled) {
+        state &= ~DISABLED;
+    } else {
+        state |= DISABLED;
+    }
+    enableWidget (enabled);
+    if (isDisposed ()) return;
+    if (enabled) {
+        if (enableWindow !is null) {
+            OS.gdk_window_set_user_data (enableWindow, null);
+            OS.gdk_window_destroy (enableWindow);
+            enableWindow = null;
+        }
+    } else {
+        auto parentHandle = shellHandle;
+        OS.gtk_widget_realize (parentHandle);
+        auto window = OS.GTK_WIDGET_WINDOW (parentHandle);
+        Rectangle rect = getBounds ();
+        GdkWindowAttr* attributes = new GdkWindowAttr ();
+        attributes.width = rect.width;
+        attributes.height = rect.height;
+        attributes.event_mask = (0xFFFFFFFF & ~OS.ExposureMask);
+        attributes.wclass = OS.GDK_INPUT_ONLY;
+        attributes.window_type = OS.GDK_WINDOW_CHILD;
+        enableWindow = OS.gdk_window_new (window, attributes, 0);
+        if (enableWindow !is null) {
+            if (cursor !is null) {
+                OS.gdk_window_set_cursor (enableWindow, cursor.handle);
+                if (!OS.GDK_WINDOWING_X11 ()) {
+                    OS.gdk_flush ();
+                } else {
+                    auto xDisplay = OS.GDK_DISPLAY ();
+                    OS.XFlush (xDisplay);
+                }
+            }
+            OS.gdk_window_set_user_data (enableWindow, parentHandle);
+            OS.gdk_window_show (enableWindow);
+        }
+    }
+    if (fixFocus_) fixFocus (control);
+    if (enabled && display.activeShell is this) {
+        if (!restoreFocus ()) traverseGroup (false);
+    }
+}
+
+/**
+ * Sets the full screen state of the receiver.
+ * If the argument is <code>true</code> causes the receiver
+ * to switch to the full screen state, and if the argument is
+ * <code>false</code> and the receiver was previously switched
+ * into full screen state, causes the receiver to switch back
+ * to either the maximmized or normal states.
+ * <p>
+ * Note: The result of intermixing calls to <code>setFullScreen(true)</code>, 
+ * <code>setMaximized(true)</code> and <code>setMinimized(true)</code> will 
+ * vary by platform. Typically, the behavior will match the platform user's 
+ * expectations, but not always. This should be avoided if possible.
+ * </p>
+ * 
+ * @param fullScreen the new fullscreen state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.4
+ */
+public void setFullScreen (bool fullScreen) {
+    checkWidget();
+    if (fullScreen) {
+        OS.gtk_window_fullscreen (shellHandle);
+    } else {
+        OS.gtk_window_unfullscreen (shellHandle);
+        if (maximized) {
+            setMaximized (true);
+        }
+    }
+    this.fullScreen = fullScreen;
+}
+
+/**
+ * Sets the input method editor mode to the argument which
+ * should be the result of bitwise OR'ing together one or more
+ * of the following constants defined in class <code>SWT</code>:
+ * <code>NONE</code>, <code>ROMAN</code>, <code>DBCS</code>,
+ * <code>PHONETIC</code>, <code>NATIVE</code>, <code>ALPHA</code>.
+ *
+ * @param mode the new IME mode
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT
+ */
+public void setImeInputMode (int mode) {
+    checkWidget();
+}
+
+override void setInitialBounds () {
+    if ((state & FOREIGN_HANDLE) !is 0) return;
+    org.eclipse.swt.widgets.Monitor.Monitor monitor = getMonitor ();
+    Rectangle rect = monitor.getClientArea ();
+    int width = rect.width * 5 / 8;
+    int height = rect.height * 5 / 8;
+    if ((style & SWT.RESIZE) !is 0) {
+        OS.gtk_window_resize (cast(GtkWindow*)shellHandle, width, height);
+    }
+    resizeBounds (width, height, false);
+}
+
+public override void setMaximized (bool maximized) {
+    checkWidget();
+    super.setMaximized (maximized);
+    if (maximized) {
+        OS.gtk_window_maximize (cast(GtkWindow*)shellHandle);
+    } else {
+        OS.gtk_window_unmaximize (cast(GtkWindow*)shellHandle);
+    }
+}
+
+public override void setMenuBar (Menu menu) {
+    checkWidget();
+    if (menuBar is menu) return;
+    bool both = menu !is null && menuBar !is null;
+    if (menu !is null) {
+        if ((menu.style & SWT.BAR) is 0) error (SWT.ERROR_MENU_NOT_BAR);
+        if (menu.parent !is this) error (SWT.ERROR_INVALID_PARENT);
+    }
+    if (menuBar !is null) {
+        auto menuHandle = menuBar.handle;
+        OS.gtk_widget_hide (menuHandle);
+        destroyAccelGroup ();
+    }
+    menuBar = menu;
+    if (menuBar !is null) {
+        auto menuHandle = menu.handle;
+        OS.gtk_widget_show (menuHandle);
+        createAccelGroup ();
+        menuBar.addAccelerators (accelGroup);
+    }
+    int width = OS.GTK_WIDGET_WIDTH (vboxHandle);
+    int height = OS.GTK_WIDGET_HEIGHT (vboxHandle);
+    resizeBounds (width, height, !both);
+}
+
+public override void setMinimized (bool minimized) {
+    checkWidget();
+    if (this.minimized is minimized) return;
+    super.setMinimized (minimized);
+    if (minimized) {
+        OS.gtk_window_iconify (cast(GtkWindow*)shellHandle);
+    } else {
+        OS.gtk_window_deiconify (cast(GtkWindow*)shellHandle);
+        bringToTop (false);
+    }
+}
+
+/**
+ * Sets the receiver's minimum size to the size specified by the arguments.
+ * If the new minimum size is larger than the current size of the receiver,
+ * the receiver is resized to the new minimum size.
+ *
+ * @param width the new minimum width for the receiver
+ * @param height the new minimum height for the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void setMinimumSize (int width, int height) {
+    checkWidget ();
+    GdkGeometry* geometry = new GdkGeometry ();
+    minWidth = geometry.min_width = Math.max (width, trimWidth ()) - trimWidth ();
+    minHeight = geometry.min_height = Math.max (height, trimHeight ()) - trimHeight ();
+    OS.gtk_window_set_geometry_hints (cast(GtkWindow*)shellHandle, null, geometry, OS.GDK_HINT_MIN_SIZE);
+}
+
+/**
+ * Sets the receiver's minimum size to the size specified by the argument.
+ * If the new minimum size is larger than the current size of the receiver,
+ * the receiver is resized to the new minimum size.
+ *
+ * @param size the new minimum size for the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void setMinimumSize (Point size) {
+    checkWidget ();
+    if (size is null) error (SWT.ERROR_NULL_ARGUMENT);
+    setMinimumSize (size.x, size.y);
+}
+
+/**
+ * Sets the shape of the shell to the region specified
+ * by the argument.  When the argument is null, the
+ * default shape of the shell is restored.  The shell
+ * must be created with the style SWT.NO_TRIM in order
+ * to specify a region.
+ *
+ * @param region the region that defines the shape of the shell (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the region has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ *
+ */
+public void setRegion (Region region) {
+    checkWidget ();
+    if ((style & SWT.NO_TRIM) is 0) return;
+    super.setRegion (region);
+}
+
+/*
+ * Shells are never labelled by other widgets, so no initialization is needed.
+ */
+override void setRelations() {
+}
+
+public override void setText (String string) {
+    super.setText (string);
+
+    /*
+    * GTK bug 82013.  For some reason, if the title string
+    * is less than 7 bytes long and is not terminated by
+    * a space, some window managers occasionally draw
+    * garbage after the last character in  the title.
+    * The fix is to pad the title.
+    */
+    int length_ = string.length;
+    char [] chars = new char [Math.max (6, length_) + 1];
+    chars = string[ 0 .. length_];
+    for (int i=length_; i<chars.length; i++)  chars [i] = ' ';
+    OS.gtk_window_set_title (cast(GtkWindow*)shellHandle, toStringz( chars ) );
+}
+
+public override void setVisible (bool visible) {
+    checkWidget();
+    int mask = SWT.PRIMARY_MODAL | SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL;
+    if ((style & mask) !is 0) {
+        if (visible) {
+            display.setModalShell (this);
+            OS.gtk_window_set_modal (shellHandle, true);
+        } else {
+            display.clearModal (this);
+            OS.gtk_window_set_modal (shellHandle, false);
+        }
+    } else {
+        updateModal ();
+    }
+    showWithParent = visible;
+    if ((OS.GTK_WIDGET_MAPPED (shellHandle) is visible)) return;
+    if (visible) {
+        sendEvent (SWT.Show);
+        if (isDisposed ()) return;
+
+        /*
+        * In order to ensure that the shell is visible
+        * and fully painted, dispatch events such as
+        * GDK_MAP and GDK_CONFIGURE, until the GDK_MAP
+        * event for the shell is received.
+        *
+        * Note that if the parent is minimized or withdrawn
+        * from the desktop, this should not be done since
+        * the shell not will be mapped until the parent is
+        * unminimized or shown on the desktop.
+        */
+        OS.gtk_widget_show (shellHandle);
+        if (enableWindow !is null) OS.gdk_window_raise (enableWindow);
+        if (!OS.GTK_IS_PLUG (cast(GTypeInstance*)shellHandle)) {
+            mapped = false;
+            if (isDisposed ()) return;
+            display.dispatchEvents = [
+                OS.GDK_EXPOSE,
+                OS.GDK_FOCUS_CHANGE,
+                OS.GDK_CONFIGURE,
+                OS.GDK_MAP,
+                OS.GDK_UNMAP,
+                OS.GDK_NO_EXPOSE
+            ];
+            Display display = this.display;
+            display.putGdkEvents();
+            bool iconic = false;
+            Shell shell = parent !is null ? parent.getShell() : null;
+            do {
+                OS.g_main_context_iteration (null, false);
+                if (isDisposed ()) break;
+                iconic = minimized || (shell !is null && shell.minimized);
+            } while (!mapped && !iconic);
+            display.dispatchEvents = null;
+            if (isDisposed ()) return;
+            if (!iconic) {
+                update (true, true);
+                if (isDisposed ()) return;
+                adjustTrim ();
+            }
+        }
+        mapped = true;
+
+        if ((style & mask) !is 0) {
+            OS.gdk_pointer_ungrab (OS.GDK_CURRENT_TIME);
+        }
+        opened = true;
+        if (!moved) {
+            moved = true;
+            Point location = getLocation();
+            oldX = location.x;
+            oldY = location.y;
+            sendEvent (SWT.Move);
+            if (isDisposed ()) return;
+        }
+        if (!resized) {
+            resized = true;
+            Point size = getSize ();
+            oldWidth = size.x - trimWidth ();
+            oldHeight = size.y - trimHeight ();
+            sendEvent (SWT.Resize);
+            if (isDisposed ()) return;
+            if (layout_ !is null) {
+                markLayout (false, false);
+                updateLayout (false);
+            }
+        }
+    } else {
+        fixActiveShell ();
+        OS.gtk_widget_hide (shellHandle);
+        sendEvent (SWT.Hide);
+    }
+}
+
+override void setZOrder (Control sibling, bool above, bool fixRelations) {
+    /*
+    * Bug in GTK+.  Changing the toplevel window Z-order causes
+    * X to send a resize event.  Before the shell is mapped, these
+    * resize events always have a size of 200x200, causing extra
+    * layout work to occur.  The fix is to modify the Z-order only
+    * if the shell has already been mapped at least once.
+    */
+    /* Shells are never included in labelled-by relations */
+    if (mapped) setZOrder (sibling, above, false, false);
+}
+
+override int /*long*/ shellMapProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
+    mapped = true;
+    display.dispatchEvents = null;
+    return 0;
+}
+
+void showWidget () {
+    if ((state & FOREIGN_HANDLE) !is 0) return;
+    OS.gtk_container_add (cast(GtkContainer*)shellHandle, vboxHandle);
+    if (scrolledHandle !is null) OS.gtk_widget_show (scrolledHandle);
+    if (handle !is null) OS.gtk_widget_show (handle);
+    if (vboxHandle !is null) OS.gtk_widget_show (vboxHandle);
+}
+
+override int /*long*/ sizeAllocateProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
+    int offset = 16;
+    int x, y;
+    OS.gdk_window_get_pointer (null, &x, &y, null);
+    y += offset;
+    auto screen = OS.gdk_screen_get_default ();
+    if (screen !is null) {
+        int monitorNumber = OS.gdk_screen_get_monitor_at_point (screen, x, y);
+        GdkRectangle* dest = new GdkRectangle ();
+        OS.gdk_screen_get_monitor_geometry (screen, monitorNumber, dest);
+        int width = OS.GTK_WIDGET_WIDTH (handle);
+        int height = OS.GTK_WIDGET_HEIGHT (handle);
+        if (x + width > dest.x + dest.width) {
+            x = (dest.x + dest.width) - width;
+        }
+        if (y + height > dest.y + dest.height) {
+            y = (dest.y + dest.height) - height;
+        }
+    }
+    OS.gtk_window_move (cast(GtkWindow*)handle, x, y);
+    return 0;
+}
+
+override int /*long*/ sizeRequestProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
+    OS.gtk_widget_hide (handle);
+    return 0;
+}
+
+override bool traverseEscape () {
+    if (parent is null) return false;
+    if (!isVisible () || !isEnabled ()) return false;
+    close ();
+    return true;
+}
+int trimHeight () {
+    if ((style & SWT.NO_TRIM) !is 0) return 0;
+    if (fullScreen) return 0;
+    bool hasTitle = false, hasResize = false, hasBorder = false;
+    hasTitle = (style & (SWT.MIN | SWT.MAX | SWT.TITLE | SWT.MENU)) !is 0;
+    hasResize = (style & SWT.RESIZE) !is 0;
+    hasBorder = (style & SWT.BORDER) !is 0;
+    if (hasTitle) {
+        if (hasResize) return display.titleResizeTrimHeight;
+        if (hasBorder) return display.titleBorderTrimHeight;
+        return display.titleTrimHeight;
+    }
+    if (hasResize) return display.resizeTrimHeight;
+    if (hasBorder) return display.borderTrimHeight;
+    return 0;
+}
+
+int trimWidth () {
+    if ((style & SWT.NO_TRIM) !is 0) return 0;
+    if (fullScreen) return 0;
+    bool hasTitle = false, hasResize = false, hasBorder = false;
+    hasTitle = (style & (SWT.MIN | SWT.MAX | SWT.TITLE | SWT.MENU)) !is 0;
+    hasResize = (style & SWT.RESIZE) !is 0;
+    hasBorder = (style & SWT.BORDER) !is 0;
+    if (hasTitle) {
+        if (hasResize) return display.titleResizeTrimWidth;
+        if (hasBorder) return display.titleBorderTrimWidth;
+        return display.titleTrimWidth;
+    }
+    if (hasResize) return display.resizeTrimWidth;
+    if (hasBorder) return display.borderTrimWidth;
+    return 0;
+}
+
+void updateModal () {
+    GtkWidget* group = null;
+    if (display.getModalDialog () is null) {
+        Shell modal = getModalShell ();
+        int mask = SWT.PRIMARY_MODAL | SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL;
+        Composite shell = null;
+        if (modal is null) {
+            if ((style & mask) !is 0) shell = this;
+        } else {
+            shell = modal;
+        }
+        while (shell !is null) {
+            if ((shell.style & mask) is 0) {
+                group = shell.getShell ().group;
+                break;
+            }
+            shell = shell.parent;
+        }
+    }
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 10, 0) && group is null) {
+        /*
+        * Feature in GTK. Starting with GTK version 2.10, GTK
+        * doesn't assign windows to a default group. The fix is to
+        * get the handle of the default group and add windows to the
+        * group.
+        */
+        group = cast(GtkWidget*)OS.gtk_window_get_group(null);
+    }
+    if (group !is null) {
+        OS.gtk_window_group_add_window (group, shellHandle);
+    } else {
+        if (modalGroup !is null) {
+            OS.gtk_window_group_remove_window (modalGroup, shellHandle);
+        }
+    }
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 4, 0)) {
+        fixModal (group, modalGroup);
+    }
+    modalGroup = group;
+}
+
+void updateMinimized (bool minimized) {
+    Shell[] shells = getShells ();
+    for (int i = 0; i < shells.length; i++) {
+        bool update = false;
+        Shell shell = shells[i];
+        while (shell !is null && shell !is this && !shell.isUndecorated ()) {
+            shell = cast(Shell) shell.getParent ();
+        }
+        if (shell !is null && shell !is this) update = true;
+        if (update) {
+            if (minimized) {
+                if (shells[i].isVisible ()) {
+                    shells[i].showWithParent = true;
+                    OS.gtk_widget_hide(shells[i].shellHandle);
+                }
+            } else {
+                if (shells[i].showWithParent) {
+                    shells[i].showWithParent = false;
+                    OS.gtk_widget_show(shells[i].shellHandle);
+                }
+            }
+        }
+    }
+}
+
+override void deregister () {
+    super.deregister ();
+    display.removeWidget (shellHandle);
+}
+
+override public void dispose () {
+    /*
+    * Note:  It is valid to attempt to dispose a widget
+    * more than once.  If this happens, fail silently.
+    */
+    if (isDisposed()) return;
+    fixActiveShell ();
+    OS.gtk_widget_hide (shellHandle);
+    super.dispose ();
+}
+
+/**
+ * If the receiver is visible, moves it to the top of the
+ * drawing order for the display on which it was created
+ * (so that all other shells on that display, which are not
+ * the receiver's children will be drawn behind it) and forces
+ * the window manager to make the shell active.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ * @see Control#moveAbove
+ * @see Control#setFocus
+ * @see Control#setVisible
+ * @see Display#getActiveShell
+ * @see Decorations#setDefaultButton(Button)
+ * @see Shell#open
+ * @see Shell#setActive
+ */
+public void forceActive () {
+    checkWidget ();
+    bringToTop (true);
+}
+
+override public Rectangle getBounds () {
+    checkWidget ();
+    int x, y ;
+    OS.gtk_window_get_position (cast(GtkWindow*)shellHandle, &x, &y);
+    int width = OS.GTK_WIDGET_WIDTH (vboxHandle);
+    int height = OS.GTK_WIDGET_HEIGHT (vboxHandle);
+    int border = 0;
+    if ((style & (SWT.NO_TRIM | SWT.BORDER | SWT.SHELL_TRIM)) is 0) {
+        border = OS.gtk_container_get_border_width (cast(GtkContainer*)shellHandle);
+    }
+    return new Rectangle (x, y, width + trimWidth () + 2*border, height + trimHeight () + 2*border);
+}
+
+override void releaseHandle () {
+    super.releaseHandle ();
+    shellHandle = null;
+}
+
+override void releaseChildren (bool destroy) {
+    Shell [] shells = getShells ();
+    for (int i=0; i<shells.length; i++) {
+        Shell shell = shells [i];
+        if (shell !is null && !shell.isDisposed ()) {
+            shell.release (false);
+        }
+    }
+    super.releaseChildren (destroy);
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    destroyAccelGroup ();
+    display.clearModal (this);
+    if (display.activeShell is this) display.activeShell = null;
+    if (tooltipsHandle !is null) OS.g_object_unref (tooltipsHandle);
+    tooltipsHandle = null;
+    if (group !is null) OS.g_object_unref (group);
+    group = modalGroup = null;
+    auto window = OS.GTK_WIDGET_WINDOW (shellHandle);
+    display.doWindowRemoveFilter( &filterProcCallbackData, window, shellHandle );
+
+    lastActive = null;
+}
+
+void setToolTipText (GtkWidget* tipWidget, String string) {
+    setToolTipText (tipWidget, tipWidget, string);
+}
+
+void setToolTipText (GtkWidget* rootWidget, GtkWidget* tipWidget, String string) {
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 12, 0)) {
+        char * buffer = null;
+        if (string !is null && string.length > 0) {
+            char [] chars = fixMnemonic (string, false);
+            buffer = toStringz( chars );
+        }
+        OS.gtk_widget_set_tooltip_text (rootWidget, null);
+        /*
+        * Bug in GTK. In GTK 2.12, due to a miscalculation of window
+        * coordinates, using gtk_tooltip_trigger_tooltip_query ()
+        * to update an existing a tooltip will result in the tooltip
+        * being displayed at a wrong position. The fix is to send out
+        * 2 fake GDK_MOTION_NOTIFY events (to mimic the GTK call) which
+        * contain the proper x and y coordinates.
+        */
+        GdkEvent* eventPtr = null;
+        auto tipWindow = OS.GTK_WIDGET_WINDOW (rootWidget);
+        if (tipWindow !is null) {
+            int x, y;
+            auto window = OS.gdk_window_at_pointer (&x, &y);
+            void* user_data;
+            if( window !is null ) OS.gdk_window_get_user_data (window, &user_data);
+            if (tipWidget is user_data ) {
+                eventPtr = OS.gdk_event_new (OS.GDK_MOTION_NOTIFY);
+                eventPtr.type = OS.GDK_MOTION_NOTIFY;
+                eventPtr.motion.window = cast(GdkDrawable*)OS.g_object_ref (tipWindow);
+                eventPtr.motion.x = x;
+                eventPtr.motion.y = y;
+                OS.gdk_window_get_origin (window, &x, &y);
+                eventPtr.motion.x_root = eventPtr.motion.x + x;
+                eventPtr.motion.y_root = eventPtr.motion.y + y;
+                OS.gtk_main_do_event (eventPtr);
+            }
+        }
+        OS.gtk_widget_set_tooltip_text (rootWidget, buffer);
+        if (eventPtr !is null) {
+            OS.gtk_main_do_event (eventPtr);
+            OS.gdk_event_free (eventPtr);
+        }
+    } else {
+        char* buffer = null;
+        if (string !is null && string.length > 0) {
+            char [] chars = fixMnemonic (string, false);
+            buffer = toStringz( chars );
+        }
+        if (tooltipsHandle is null) {
+            tooltipsHandle = cast(GtkWidget*)OS.gtk_tooltips_new ();
+            if (tooltipsHandle is null) error (SWT.ERROR_NO_HANDLES);
+            OS.g_object_ref (tooltipsHandle);
+            OS.gtk_object_sink (cast(GtkObject*)tooltipsHandle);
+        }
+
+        /*
+        * Feature in GTK.  There is no API to position a tooltip.
+        * The fix is to connect to the size_allocate signal for
+        * the tooltip window and position it before it is mapped.
+        *
+        * Bug in Solaris-GTK.  Invoking gtk_tooltips_force_window()
+        * can cause a crash in older versions of GTK.  The fix is
+        * to avoid this call if the GTK version is older than 2.2.x.
+        */
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 2, 1)) {
+            OS.gtk_tooltips_force_window (cast(GtkTooltips*)tooltipsHandle);
+        }
+        auto tipWindow = OS.GTK_TOOLTIPS_TIP_WINDOW (cast(GtkTooltips*)tooltipsHandle);
+        if (tipWindow !is null && tipWindow !is tooltipWindow) {
+            display.doSizeAllocateConnect( &sizeAllocateProcCallbackData, tipWindow, shellHandle );
+            tooltipWindow = tipWindow;
+        }
+
+        /*
+        * Bug in GTK.  If the cursor is inside the window when a new
+        * tooltip is set and the old tooltip is hidden, the new tooltip
+        * is not displayed until the mouse re-enters the window.  The
+        * fix is force the new tooltip to be active.
+        */
+        bool set = true;
+        if (tipWindow !is null) {
+            if ((OS.GTK_WIDGET_FLAGS (tipWidget) & (OS.GTK_REALIZED | OS.GTK_VISIBLE)) !is 0) {
+                int  x, y;
+                auto window = OS.gdk_window_at_pointer (&x, &y);
+                if (window !is null) {
+                    GtkWidget* user_data;
+                    OS.gdk_window_get_user_data (window, cast(void**)&user_data);
+                    if (tipWidget is user_data) {
+                        /*
+                        * Feature in GTK.  Calling gtk_tooltips_set_tip() positions and
+                        * shows the tooltip.  If the tooltip is already visible, moving
+                        * it to a new location in the size_allocate signal causes flashing.
+                        * The fix is to hide the tip window in the size_request signal
+                        * and before the new tooltip is forced to be active.
+                        */
+                        set = false;
+                        int handler_id = display.doSizeRequestConnect( &sizeRequestProcCallbackData, tipWindow, shellHandle );
+                        OS.gtk_tooltips_set_tip (cast(GtkTooltips*)tooltipsHandle, tipWidget, buffer, null);
+                        OS.gtk_widget_hide (tipWindow);
+                        auto data = OS.gtk_tooltips_data_get (tipWidget);
+                        OS.GTK_TOOLTIPS_SET_ACTIVE (cast(GtkTooltips*)tooltipsHandle, cast(GtkTooltipsData*)data);
+                        OS.gtk_tooltips_set_tip (cast(GtkTooltips*)tooltipsHandle, tipWidget, buffer, null);
+                        if (handler_id !is 0) OS.g_signal_handler_disconnect (tipWindow, handler_id);
+                    }
+                }
+            }
+        }
+        if (set) OS.gtk_tooltips_set_tip (cast(GtkTooltips*)tooltipsHandle, tipWidget, buffer, null);
+    }
+
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Slider.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,598 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Slider;
+
+import java.lang.all;
+
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.events.SelectionListener;
+
+/**
+ * Instances of this class are selectable user interface
+ * objects that represent a range of positive, numeric values.
+ * <p>
+ * At any given moment, a given slider will have a
+ * single 'selection' that is considered to be its
+ * value, which is constrained to be within the range of
+ * values the slider represents (that is, between its
+ * <em>minimum</em> and <em>maximum</em> values).
+ * </p><p>
+ * Typically, sliders will be made up of five areas:
+ * <ol>
+ * <li>an arrow button for decrementing the value</li>
+ * <li>a page decrement area for decrementing the value by a larger amount</li>
+ * <li>a <em>thumb</em> for modifying the value by mouse dragging</li>
+ * <li>a page increment area for incrementing the value by a larger amount</li>
+ * <li>an arrow button for incrementing the value</li>
+ * </ol>
+ * Based on their style, sliders are either <code>HORIZONTAL</code>
+ * (which have a left facing button for decrementing the value and a
+ * right facing button for incrementing it) or <code>VERTICAL</code>
+ * (which have an upward facing button for decrementing the value
+ * and a downward facing buttons for incrementing it).
+ * </p><p>
+ * On some platforms, the size of the slider's thumb can be
+ * varied relative to the magnitude of the range of values it
+ * represents (that is, relative to the difference between its
+ * maximum and minimum values). Typically, this is used to
+ * indicate some proportional value such as the ratio of the
+ * visible area of a document to the total amount of space that
+ * it would take to display it. SWT supports setting the thumb
+ * size even if the underlying platform does not, but in this
+ * case the appearance of the slider will not change.
+ * </p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>HORIZONTAL, VERTICAL</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles HORIZONTAL and VERTICAL may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see ScrollBar
+ * @see <a href="http://www.eclipse.org/swt/snippets/#slider">Slider snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class Slider : Control {
+
+    alias Control.computeSize computeSize;
+
+    int detail;
+    bool dragSent;
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#HORIZONTAL
+ * @see SWT#VERTICAL
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Composite parent, int style) {
+    super (parent, checkStyle (style));
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the user changes the receiver's value, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * When <code>widgetSelected</code> is called, the event object detail field contains one of the following values:
+ * <code>SWT.NONE</code> - for the end of a drag.
+ * <code>SWT.DRAG</code>.
+ * <code>SWT.HOME</code>.
+ * <code>SWT.END</code>.
+ * <code>SWT.ARROW_DOWN</code>.
+ * <code>SWT.ARROW_UP</code>.
+ * <code>SWT.PAGE_DOWN</code>.
+ * <code>SWT.PAGE_UP</code>.
+ * <code>widgetDefaultSelected</code> is not called.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the user changes the receiver's value
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener (SelectionListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Selection,typedListener);
+    addListener (SWT.DefaultSelection,typedListener);
+}
+
+static int checkStyle (int style) {
+    return checkBits (style, SWT.HORIZONTAL, SWT.VERTICAL, 0, 0, 0, 0);
+}
+
+override void createHandle (int index) {
+    state |= HANDLE;
+    fixedHandle = cast(GtkWidget*)OS.g_object_new (display.gtk_fixed_get_type (), null);
+    if (fixedHandle is null) error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_fixed_set_has_window (fixedHandle, true);
+    auto hAdjustment = OS.gtk_adjustment_new (0, 0, 100, 1, 10, 10);
+    if (hAdjustment is null) error (SWT.ERROR_NO_HANDLES);
+    if ((style & SWT.HORIZONTAL) !is 0) {
+        handle = cast(GtkWidget*)OS.gtk_hscrollbar_new (hAdjustment);
+    } else {
+        handle = cast(GtkWidget*)OS.gtk_vscrollbar_new (hAdjustment);
+    }
+    if (handle is null) error (SWT.ERROR_NO_HANDLES);
+    /*
+    * Bug in GTK. In GTK 2.10, the buttons on either end of
+    * a horizontal slider are created taller then the slider bar
+    * when the GTK_CAN_FOCUS flag is set. The fix is not to set
+    * the flag for horizontal bars in all versions of 2.10. Note
+    * that a bug has been logged with GTK about this issue.
+    * (http://bugzilla.gnome.org/show_bug.cgi?id=475909)
+    */
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 10, 0) || (style & SWT.VERTICAL) !is 0) {
+        OS.GTK_WIDGET_SET_FLAGS (handle, OS.GTK_CAN_FOCUS);
+    }
+    OS.gtk_container_add (fixedHandle, handle);
+}
+
+override int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* event) {
+    auto result = super.gtk_button_press_event (widget, event);
+    if (result !is 0) return result;
+    detail = OS.GTK_SCROLL_NONE;
+    dragSent = false;
+    return result;
+}
+
+override int /*long*/ gtk_change_value (GtkWidget* widget, int /*long*/ scroll, int /*long*/ value1, int /*long*/ value2) {
+    detail = cast(int)/*64*/scroll;
+    return 0;
+}
+
+override int /*long*/ gtk_value_changed (int /*long*/ adjustment) {
+    Event event = new Event ();
+    dragSent = detail is OS.GTK_SCROLL_JUMP;
+    switch (detail) {
+        case OS.GTK_SCROLL_NONE:            event.detail = SWT.NONE; break;
+        case OS.GTK_SCROLL_JUMP:            event.detail = SWT.DRAG; break;
+        case OS.GTK_SCROLL_START:           event.detail = SWT.HOME; break;
+        case OS.GTK_SCROLL_END:             event.detail = SWT.END; break;
+        case OS.GTK_SCROLL_PAGE_DOWN:
+        case OS.GTK_SCROLL_PAGE_RIGHT:
+        case OS.GTK_SCROLL_PAGE_FORWARD:    event.detail = SWT.PAGE_DOWN; break;
+        case OS.GTK_SCROLL_PAGE_UP:
+        case OS.GTK_SCROLL_PAGE_LEFT:
+        case OS.GTK_SCROLL_PAGE_BACKWARD:   event.detail = SWT.PAGE_UP; break;
+        case OS.GTK_SCROLL_STEP_DOWN:
+        case OS.GTK_SCROLL_STEP_RIGHT:
+        case OS.GTK_SCROLL_STEP_FORWARD:    event.detail = SWT.ARROW_DOWN; break;
+        case OS.GTK_SCROLL_STEP_UP:
+        case OS.GTK_SCROLL_STEP_LEFT:
+        case OS.GTK_SCROLL_STEP_BACKWARD:   event.detail = SWT.ARROW_UP; break;
+        default:
+    }
+    if (!dragSent) detail = OS.GTK_SCROLL_NONE;
+    postEvent (SWT.Selection, event);
+    return 0;
+}
+
+override int /*long*/ gtk_event_after (GtkWidget* widget, GdkEvent* gdkEvent) {
+    switch (gdkEvent.type) {
+        case OS.GDK_BUTTON_RELEASE: {
+            GdkEventButton* gdkEventButton = cast(GdkEventButton*)gdkEvent;
+            if (gdkEventButton.button is 1 && detail is SWT.DRAG) {
+                if (!dragSent) {
+                    Event event = new Event ();
+                    event.detail = SWT.DRAG;
+                    postEvent (SWT.Selection, event);
+                }
+                postEvent (SWT.Selection);
+            }
+            detail = OS.GTK_SCROLL_NONE;
+            dragSent = false;
+            break;
+        default:
+        }
+    }
+    return super.gtk_event_after (widget, gdkEvent);
+}
+
+override void hookEvents () {
+    super.hookEvents ();
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 6, 0)) {
+        OS.g_signal_connect_closure (handle, OS.change_value.ptr, display.closures [CHANGE_VALUE], false);
+    }
+    OS.g_signal_connect_closure (handle, OS.value_changed.ptr, display.closures [VALUE_CHANGED], false);
+}
+
+override void register () {
+    super.register ();
+    auto hAdjustment = OS.gtk_range_get_adjustment (cast(GtkRange*)handle);
+    display.addWidget (cast(GtkWidget*)hAdjustment, this);
+}
+
+override void deregister () {
+    super.deregister ();
+    auto hAdjustment = OS.gtk_range_get_adjustment (cast(GtkRange*)handle);
+    display.removeWidget (cast(GtkWidget*)hAdjustment);
+}
+
+override public Point computeSize (int wHint, int hHint, bool changed) {
+    checkWidget();
+    if (wHint !is SWT.DEFAULT && wHint < 0) wHint = 0;
+    if (hHint !is SWT.DEFAULT && hHint < 0) hHint = 0;
+    Point size = computeNativeSize(handle, wHint, hHint, changed);
+    if ((style & SWT.HORIZONTAL) !is 0) {
+        if (wHint is SWT.DEFAULT) size.x = 2 * size.x;
+    } else {
+        if (hHint is SWT.DEFAULT) size.y = 2 * size.y;
+    }
+    return size;
+}
+
+/**
+ * Returns the amount that the receiver's value will be
+ * modified by when the up/down (or right/left) arrows
+ * are pressed.
+ *
+ * @return the increment
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getIncrement () {
+    checkWidget ();
+    auto hAdjustment = OS.gtk_range_get_adjustment (cast(GtkRange*)handle);
+    return cast(int) hAdjustment.step_increment;
+}
+
+/**
+ * Returns the maximum value which the receiver will allow.
+ *
+ * @return the maximum
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getMaximum () {
+    checkWidget ();
+    auto hAdjustment = OS.gtk_range_get_adjustment (cast(GtkRange*)handle);
+    return cast(int) hAdjustment.upper;
+}
+
+/**
+ * Returns the minimum value which the receiver will allow.
+ *
+ * @return the minimum
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getMinimum () {
+    checkWidget ();
+    auto hAdjustment = OS.gtk_range_get_adjustment (cast(GtkRange*)handle);
+    return cast(int) hAdjustment.lower;
+}
+
+/**
+ * Returns the amount that the receiver's value will be
+ * modified by when the page increment/decrement areas
+ * are selected.
+ *
+ * @return the page increment
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getPageIncrement () {
+    checkWidget ();
+    auto hAdjustment = OS.gtk_range_get_adjustment (cast(GtkRange*)handle);
+    return cast(int) hAdjustment.page_increment;
+}
+
+/**
+ * Returns the 'selection', which is the receiver's value.
+ *
+ * @return the selection
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSelection () {
+    checkWidget ();
+    auto hAdjustment = OS.gtk_range_get_adjustment (cast(GtkRange*)handle);
+    return cast(int) hAdjustment.value;
+}
+
+/**
+ * Returns the size of the receiver's thumb relative to the
+ * difference between its maximum and minimum values.
+ *
+ * @return the thumb value
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getThumb () {
+    checkWidget ();
+    auto hAdjustment = OS.gtk_range_get_adjustment (cast(GtkRange*)handle);
+    return cast(int) hAdjustment.page_size;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the user changes the receiver's value.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener (SelectionListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Selection, listener);
+    eventTable.unhook (SWT.DefaultSelection,listener);
+}
+
+/**
+ * Sets the amount that the receiver's value will be
+ * modified by when the up/down (or right/left) arrows
+ * are pressed to the argument, which must be at least
+ * one.
+ *
+ * @param value the new increment (must be greater than zero)
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setIncrement (int value) {
+    checkWidget ();
+    if (value < 1) return;
+    OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+    OS.gtk_range_set_increments (cast(GtkRange*)handle, value, getPageIncrement ());
+    OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+}
+
+/**
+ * Sets the maximum. If this value is negative or less than or
+ * equal to the minimum, the value is ignored. If necessary, first
+ * the thumb and then the selection are adjusted to fit within the
+ * new range.
+ *
+ * @param value the new maximum, which must be greater than the current minimum
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMaximum (int value) {
+    checkWidget ();
+    auto adjustment = OS.gtk_range_get_adjustment (cast(GtkRange*)handle);
+    int minimum = cast(int) adjustment.lower;
+    if (value <= minimum) return;
+    adjustment.upper = value;
+    adjustment.page_size = Math.min (cast(int)adjustment.page_size, value - minimum);
+    adjustment.value = Math.min (cast(int)adjustment.value, cast(int)(value - adjustment.page_size));
+    OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+    OS.gtk_adjustment_changed (adjustment);
+    OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+}
+
+/**
+ * Sets the minimum value. If this value is negative or greater
+ * than or equal to the maximum, the value is ignored. If necessary,
+ * first the thumb and then the selection are adjusted to fit within
+ * the new range.
+ *
+ * @param value the new minimum
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMinimum (int value) {
+    checkWidget ();
+    if (value < 0) return;
+    auto adjustment = OS.gtk_range_get_adjustment (cast(GtkRange*)handle);
+    int maximum = cast(int) adjustment.upper;
+    if (value >= maximum) return;
+    adjustment.lower = value;
+    adjustment.page_size = Math.min (cast(int)adjustment.page_size, maximum - value);
+    adjustment.value = Math.max (cast(int)adjustment.value, value);
+    OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+    OS.gtk_adjustment_changed (adjustment);
+    OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+}
+
+override void setOrientation () {
+    super.setOrientation ();
+    if ((style & SWT.RIGHT_TO_LEFT) !is 0) {
+        if ((style & SWT.HORIZONTAL) !is 0) {
+            OS.gtk_range_set_inverted (cast(GtkRange*)handle, true);
+        }
+    }
+}
+
+/**
+ * Sets the amount that the receiver's value will be
+ * modified by when the page increment/decrement areas
+ * are selected to the argument, which must be at least
+ * one.
+ *
+ * @param value the page increment (must be greater than zero)
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setPageIncrement (int value) {
+    checkWidget ();
+    if (value < 1) return;
+    OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+    OS.gtk_range_set_increments (cast(GtkRange*)handle, getIncrement (), value);
+    OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+}
+
+/**
+ * Sets the 'selection', which is the receiver's
+ * value, to the argument which must be greater than or equal
+ * to zero.
+ *
+ * @param value the new selection (must be zero or greater)
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (int value) {
+    checkWidget ();
+    OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+    OS.gtk_range_set_value (cast(GtkRange*)handle, value);
+    OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+}
+
+/**
+ * Sets the size of the receiver's thumb relative to the
+ * difference between its maximum and minimum values.  This new
+ * value will be ignored if it is less than one, and will be
+ * clamped if it exceeds the receiver's current range.
+ *
+ * @param value the new thumb value, which must be at least one and not
+ * larger than the size of the current range
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setThumb (int value) {
+    checkWidget ();
+    if (value < 1) return;
+    auto adjustment = OS.gtk_range_get_adjustment (cast(GtkRange*)handle);
+    value = cast(int) Math.min (value, cast(int)(adjustment.upper - adjustment.lower));
+    adjustment.page_size = cast(double) value;
+    adjustment.value = Math.min (cast(int)adjustment.value, cast(int)(adjustment.upper - value));
+    OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+    OS.gtk_adjustment_changed (adjustment);
+    OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+}
+
+/**
+ * Sets the receiver's selection, minimum value, maximum
+ * value, thumb, increment and page increment all at once.
+ * <p>
+ * Note: This is similar to setting the values individually
+ * using the appropriate methods, but may be implemented in a
+ * more efficient fashion on some platforms.
+ * </p>
+ *
+ * @param selection the new selection value
+ * @param minimum the new minimum value
+ * @param maximum the new maximum value
+ * @param thumb the new thumb value
+ * @param increment the new increment value
+ * @param pageIncrement the new pageIncrement value
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setValues (int selection, int minimum, int maximum, int thumb, int increment, int pageIncrement) {
+    checkWidget ();
+    if (minimum < 0) return;
+    if (maximum < 0) return;
+    if (thumb < 1) return;
+    if (increment < 1) return;
+    if (pageIncrement < 1) return;
+    thumb = Math.min (thumb, maximum - minimum);
+    auto adjustment = OS.gtk_range_get_adjustment (cast(GtkRange*)handle);
+    adjustment.value = Math.min (Math.max (selection, minimum), maximum - thumb);
+    adjustment.lower = cast(double) minimum;
+    adjustment.upper = cast(double) maximum;
+    adjustment.page_size = cast(double) thumb;
+    adjustment.step_increment = cast(double) increment;
+    adjustment.page_increment = cast(double) pageIncrement;
+    OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+    OS.gtk_adjustment_changed (adjustment);
+    OS.gtk_adjustment_value_changed (adjustment);
+    OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Spinner.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,1163 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Spinner;
+
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.VerifyListener;
+
+import tango.util.Convert;
+import java.lang.all;
+
+/**
+ * Instances of this class are selectable user interface
+ * objects that allow the user to enter and modify numeric
+ * values.
+ * <p>
+ * Note that although this class is a subclass of <code>Composite</code>,
+ * it does not make sense to add children to it, or set a layout on it.
+ * </p><p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>READ_ONLY, WRAP</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection, Modify, Verify</dd>
+ * </dl>
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#spinner">Spinner snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ * 
+ * @since 3.1
+ */
+public class Spinner : Composite {
+
+    alias Composite.computeSize computeSize;
+    alias Composite.createHandle createHandle;
+    alias Composite.setBackgroundColor setBackgroundColor;
+    alias Composite.setCursor setCursor;
+    alias Composite.translateTraversal translateTraversal;
+
+    static final int INNER_BORDER = 2;
+    static final int MIN_ARROW_WIDTH = 6;
+    int lastEventTime = 0;
+    GdkEventKey* gdkEventKey;
+    int fixStart = -1, fixEnd = -1;
+
+    /**
+     * the operating system limit for the number of characters
+     * that the text field in an instance of this class can hold
+     * 
+     * @since 3.4
+     */
+    public const static int LIMIT = 0x7FFFFFFF;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#READ_ONLY
+ * @see SWT#WRAP
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Composite parent, int style) {
+    super (parent, checkStyle (style));
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the receiver's text is modified, by sending
+ * it one of the messages defined in the <code>ModifyListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ModifyListener
+ * @see #removeModifyListener
+ */
+public void addModifyListener (ModifyListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Modify, typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the control is selected by the user, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * <code>widgetSelected</code> is not called for texts.
+ * <code>widgetDefaultSelected</code> is typically called when ENTER is pressed in a single-line text.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the control is selected by the user
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener(SelectionListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener(listener);
+    addListener(SWT.Selection,typedListener);
+    addListener(SWT.DefaultSelection,typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the receiver's text is verified, by sending
+ * it one of the messages defined in the <code>VerifyListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see VerifyListener
+ * @see #removeVerifyListener
+ */
+void addVerifyListener (VerifyListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Verify, typedListener);
+}
+
+static int checkStyle (int style) {
+    /*
+    * Even though it is legal to create this widget
+    * with scroll bars, they serve no useful purpose
+    * because they do not automatically scroll the
+    * widget's client area.  The fix is to clear
+    * the SWT style.
+    */
+    return style & ~(SWT.H_SCROLL | SWT.V_SCROLL);
+}
+
+protected override void checkSubclass () {
+    if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+public override Point computeSize (int wHint, int hHint, bool changed) {
+    checkWidget ();
+    if (wHint !is SWT.DEFAULT && wHint < 0) wHint = 0;
+    if (hHint !is SWT.DEFAULT && hHint < 0) hHint = 0;
+    int[1] w, h;
+    OS.gtk_widget_realize (handle);
+    auto layout = OS.gtk_entry_get_layout (cast(GtkEntry*)handle);
+    auto adjustment = OS.gtk_spin_button_get_adjustment (cast(GtkSpinButton*)handle);
+    int digits = OS.gtk_spin_button_get_digits (cast(GtkSpinButton*)handle);
+    for (int i = 0; i < digits; i++) adjustment.upper *= 10;
+    String string = to!(String)( (cast(int) adjustment.upper) );
+    if (digits > 0) {
+        //PROTING_TODO: Efficiency
+        String buffer = string ~ getDecimalSeparator ();
+        int count = digits - string.length;
+        while (count >= 0) {
+            buffer ~= "0";
+            count--;
+        }
+        string = buffer;
+    }
+    char [] buffer1 = string;
+    auto ptr = OS.pango_layout_get_text (layout);
+    String buffer2 = fromStringz( ptr ).dup;
+    OS.pango_layout_set_text (layout, buffer1.ptr, buffer1.length);
+    OS.pango_layout_get_size (layout, w.ptr, h.ptr);
+    OS.pango_layout_set_text (layout, buffer2.ptr, buffer2.length);
+    int width = OS.PANGO_PIXELS (w [0]);
+    int height = OS.PANGO_PIXELS (h [0]);
+    width = wHint is SWT.DEFAULT ? width : wHint;
+    height = hHint is SWT.DEFAULT ? height : hHint;
+    Rectangle trim = computeTrim (0, 0, width, height);
+    return new Point (trim.width, trim.height);
+}
+
+override public Rectangle computeTrim (int x, int y, int width, int height) {
+    checkWidget ();
+    int xborder = 0, yborder = 0;
+    auto style = OS.gtk_widget_get_style (handle);
+    if ((this.style & SWT.BORDER) !is 0) {
+        xborder += OS.gtk_style_get_xthickness (style);
+        yborder += OS.gtk_style_get_ythickness (style);
+    }
+    xborder += INNER_BORDER;
+    yborder += INNER_BORDER;
+    int property;
+    OS.gtk_widget_style_get1 (handle, OS.interior_focus.ptr, &property);
+    if (property is 0) {
+        OS.gtk_widget_style_get1 (handle, OS.focus_line_width.ptr, &property);
+        xborder += property;
+        yborder += property;
+    }
+    auto fontDesc = OS.gtk_style_get_font_desc (style);
+    int fontSize = OS.pango_font_description_get_size (fontDesc);
+    int arrowSize = Math.max (OS.PANGO_PIXELS (fontSize), MIN_ARROW_WIDTH);
+    arrowSize = arrowSize - arrowSize % 2;
+    Rectangle trim = super.computeTrim (x, y, width, height);
+    trim.x -= xborder;
+    trim.y -= yborder;
+    trim.width += 2 * xborder;
+    trim.height += 2 * yborder;
+    trim.width += arrowSize + (2 * OS.gtk_style_get_xthickness (style));
+    return new Rectangle (trim.x, trim.y, trim.width, trim.height);
+}
+
+/**
+ * Copies the selected text.
+ * <p>
+ * The current selection is copied to the clipboard.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void copy () {
+    checkWidget ();
+    OS.gtk_editable_copy_clipboard (cast(GtkEditable*)handle);
+}
+
+override void createHandle (int index) {
+    state |= HANDLE | MENU;
+    fixedHandle = cast(GtkWidget*)OS.g_object_new (display.gtk_fixed_get_type (), null);
+    if (fixedHandle is null) error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_fixed_set_has_window (cast(GtkFixed*)fixedHandle, true);
+    auto adjustment = OS.gtk_adjustment_new (0, 0, 100, 1, 10, 0);
+    if (adjustment is null) error (SWT.ERROR_NO_HANDLES);
+    handle = cast(GtkWidget*)OS.gtk_spin_button_new (cast(GtkAdjustment*)adjustment, 1, 0);
+    if (handle is null) error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_container_add (cast(GtkContainer*)fixedHandle, handle);
+    OS.gtk_editable_set_editable (cast(GtkEditable*)handle, (style & SWT.READ_ONLY) is 0);
+    OS.gtk_entry_set_has_frame (cast(GtkEntry*)handle, (style & SWT.BORDER) !is 0);
+    OS.gtk_spin_button_set_wrap (cast(GtkSpinButton*)handle, (style & SWT.WRAP) !is 0);
+}
+
+/**
+ * Cuts the selected text.
+ * <p>
+ * The current selection is first copied to the
+ * clipboard and then deleted from the widget.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void cut () {
+    checkWidget ();
+    OS.gtk_editable_cut_clipboard (cast(GtkEditable*)handle);
+}
+
+override void deregister () {
+    super.deregister ();
+    auto imContext = imContext ();
+    if (imContext !is null) display.removeWidget (cast(GtkWidget*)imContext);
+}
+
+override GdkDrawable* eventWindow () {
+    return paintWindow ();
+}
+
+override GtkWidget* enterExitHandle () {
+    return fixedHandle;
+}
+
+override bool filterKey (int keyval, GdkEventKey* event) {
+    int time = OS.gdk_event_get_time (cast(GdkEvent*)event);
+    if (time !is lastEventTime) {
+        lastEventTime = time;
+        auto imContext = imContext ();
+        if (imContext !is null) {
+            return cast(bool)OS.gtk_im_context_filter_keypress (imContext, event);
+        }
+    }
+    gdkEventKey = event;
+    return false;
+}
+
+void fixIM () {
+    /*
+    *  The IM filter has to be called one time for each key press event.
+    *  When the IM is open the key events are duplicated. The first event
+    *  is filtered by SWT and the second event is filtered by GTK.  In some
+    *  cases the GTK handler does not run (the widget is destroyed, the
+    *  application code consumes the event, etc), for these cases the IM
+    *  filter has to be called by SWT.
+    */
+    if (gdkEventKey !is null && gdkEventKey !is cast(GdkEventKey*)-1) {
+        auto imContext = imContext ();
+        if (imContext !is null) {
+            OS.gtk_im_context_filter_keypress (imContext, gdkEventKey);
+            gdkEventKey = cast(GdkEventKey*)-1;
+            return;
+        }
+    }
+    gdkEventKey = null;
+}
+
+override GdkColor* getBackgroundColor () {
+    return getBaseColor ();
+}
+
+public override int getBorderWidth () {
+    checkWidget();
+    auto style = OS.gtk_widget_get_style (handle);
+    if ((this.style & SWT.BORDER) !is 0) {
+         return OS.gtk_style_get_xthickness (style);
+    }
+    return 0;
+}
+
+override GdkColor* getForegroundColor () {
+    return getTextColor ();
+}
+
+/**
+ * Returns the amount that the receiver's value will be
+ * modified by when the up/down arrows are pressed.
+ *
+ * @return the increment
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getIncrement () {
+    checkWidget ();
+    auto adjustment = OS.gtk_spin_button_get_adjustment (cast(GtkSpinButton*)handle);
+    int digits = OS.gtk_spin_button_get_digits (cast(GtkSpinButton*)handle);
+    auto value = adjustment.step_increment;
+    for (int i = 0; i < digits; i++) value *= 10;
+    return cast(int) (value > 0 ? value + 0.5 : value - 0.5);
+}
+
+/**
+ * Returns the maximum value which the receiver will allow.
+ *
+ * @return the maximum
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getMaximum () {
+    checkWidget ();
+    auto adjustment = OS.gtk_spin_button_get_adjustment (cast(GtkSpinButton*)handle);
+    int digits = OS.gtk_spin_button_get_digits (cast(GtkSpinButton*)handle);
+    auto value = adjustment.upper;
+    for (int i = 0; i < digits; i++) value *= 10;
+    return cast(int) (value > 0 ? value + 0.5 : value - 0.5);
+}
+
+/**
+ * Returns the minimum value which the receiver will allow.
+ *
+ * @return the minimum
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getMinimum () {
+    checkWidget ();
+    auto adjustment = OS.gtk_spin_button_get_adjustment (cast(GtkSpinButton*)handle);
+    int digits = OS.gtk_spin_button_get_digits (cast(GtkSpinButton*)handle);
+    auto value = adjustment.lower;
+    for (int i = 0; i < digits; i++) value *= 10;
+    return cast(int) (value > 0 ? value + 0.5 : value - 0.5);
+}
+
+/**
+ * Returns the amount that the receiver's position will be
+ * modified by when the page up/down keys are pressed.
+ *
+ * @return the page increment
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getPageIncrement () {
+    checkWidget ();
+    auto adjustment = OS.gtk_spin_button_get_adjustment (cast(GtkSpinButton*)handle);
+    int digits = OS.gtk_spin_button_get_digits (cast(GtkSpinButton*)handle);
+    auto value = adjustment.page_increment;
+    for (int i = 0; i < digits; i++) value *= 10;
+    return cast(int) (value > 0 ? value + 0.5 : value - 0.5);
+}
+
+/**
+ * Returns the <em>selection</em>, which is the receiver's position.
+ *
+ * @return the selection
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSelection () {
+    checkWidget ();
+    auto adjustment = OS.gtk_spin_button_get_adjustment (cast(GtkSpinButton*)handle);
+    int digits = OS.gtk_spin_button_get_digits (cast(GtkSpinButton*)handle);
+    auto value = adjustment.value;
+    for (int i = 0; i < digits; i++) value *= 10;
+    return cast(int) (value > 0 ? value + 0.5 : value - 0.5);
+}
+
+/**
+ * Returns a string containing a copy of the contents of the
+ * receiver's text field, or an empty string if there are no
+ * contents.
+ *
+ * @return the receiver's text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * 
+ * @since 3.4
+ */
+public String getText () {
+    checkWidget ();
+    auto str = OS.gtk_entry_get_text (handle);
+    return fromStringz(str).dup;
+}
+
+/**
+ * Returns the maximum number of characters that the receiver's
+ * text field is capable of holding. If this has not been changed
+ * by <code>setTextLimit()</code>, it will be the constant
+ * <code>Spinner.LIMIT</code>.
+ * 
+ * @return the text limit
+ * 
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #LIMIT
+ * 
+ * @since 3.4
+ */
+public int getTextLimit () {
+    checkWidget ();
+    int limit = OS.gtk_entry_get_max_length (handle);
+    return limit is 0 ? 0xFFFF : limit;
+}
+
+/**
+ * Returns the number of decimal places used by the receiver.
+ *
+ * @return the digits
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getDigits () {
+    checkWidget ();
+    return OS.gtk_spin_button_get_digits (cast(GtkSpinButton*)handle);
+}
+
+String getDecimalSeparator () {
+    auto ptr = OS.localeconv_decimal_point ();
+    return fromStringz( ptr ).dup;
+}
+
+override int /*long*/ gtk_activate (GtkWidget* widget) {
+    postEvent (SWT.DefaultSelection);
+    return 0;
+}
+
+override int /*long*/ gtk_changed (GtkWidget* widget) {
+    auto str = OS.gtk_entry_get_text (cast(GtkEntry*)handle);
+    int length = tango.stdc.string.strlen (str);
+    if (length > 0) {
+        char* endptr;
+        double value = OS.g_strtod (str, &endptr);
+        if (endptr is str + length) {
+            auto adjustment = OS.gtk_spin_button_get_adjustment (cast(GtkSpinButton*)handle);
+            if (value !is adjustment.value && adjustment.lower <= value && value <= adjustment.upper) {
+                OS.gtk_spin_button_update (cast(GtkSpinButton*)handle);
+            }
+        }
+    }
+
+    /*
+    * Feature in GTK.  When the user types, GTK positions
+    * the caret after sending the changed signal.  This
+    * means that application code that attempts to position
+    * the caret during a changed signal will fail.  The fix
+    * is to post the modify event when the user is typing.
+    */
+    bool keyPress = false;
+    auto eventPtr = OS.gtk_get_current_event ();
+    if (eventPtr !is null) {
+        GdkEventKey* gdkEvent = cast(GdkEventKey*)eventPtr;
+        switch (gdkEvent.type) {
+            case OS.GDK_KEY_PRESS:
+                keyPress = true;
+                break;
+            default:
+        }
+        OS.gdk_event_free (eventPtr);
+    }
+    if (keyPress) {
+        postEvent (SWT.Modify);
+    } else {
+        sendEvent (SWT.Modify);
+    }
+    return 0;
+}
+
+int /*long*/ gtk_commit (GtkIMContext* imContext, char* text) {
+    if (text is null) return 0;
+    if (!OS.gtk_editable_get_editable (cast(GtkEditable*)handle)) return 0;
+    char [] chars = fromStringz( text ).dup;
+    if (chars.length is 0) return 0;
+    char [] newChars = sendIMKeyEvent (SWT.KeyDown, null, chars);
+    if (newChars is null) return 0;
+    /*
+    * Feature in GTK.  For a GtkEntry, during the insert-text signal,
+    * GTK allows the programmer to change only the caret location,
+    * not the selection.  If the programmer changes the selection,
+    * the new selection is lost.  The fix is to detect a selection
+    * change and set it after the insert-text signal has completed.
+    */
+    fixStart = fixEnd = -1;
+    OS.g_signal_handlers_block_matched (imContext, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCOMMIT);
+    int id = OS.g_signal_lookup (OS.commit.ptr, OS.gtk_im_context_get_type ());
+    int mask =  OS.G_SIGNAL_MATCH_DATA | OS.G_SIGNAL_MATCH_ID;
+    OS.g_signal_handlers_unblock_matched (imContext, mask, id, 0, null, null, cast(void*)handle);
+    if (newChars is chars) {
+        OS.g_signal_emit_by_name1 (imContext, OS.commit.ptr, cast(int)text);
+    } else {
+        OS.g_signal_emit_by_name1 (imContext, OS.commit.ptr, cast(int)toStringz(newChars));
+    }
+    OS.g_signal_handlers_unblock_matched (imContext, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCOMMIT);
+    OS.g_signal_handlers_block_matched (imContext, mask, id, 0, null, null, cast(void*)handle);
+    if (fixStart !is -1 && fixEnd !is -1) {
+        OS.gtk_editable_set_position (cast(GtkEditable*)handle, fixStart);
+        OS.gtk_editable_select_region (cast(GtkEditable*)handle, fixStart, fixEnd);
+    }
+    fixStart = fixEnd = -1;
+    return 0;
+}
+
+override int /*long*/ gtk_delete_text (GtkWidget* widget, int start_pos, int end_pos) {
+    if (!hooks (SWT.Verify) && !filters (SWT.Verify)) return 0;
+    String newText = verifyText ("", cast(int)/*64*/start_pos, cast(int)/*64*/end_pos);
+    if (newText is null) {
+        OS.g_signal_stop_emission_by_name (handle, OS.delete_text.ptr);
+    } else {
+        if (newText.length > 0) {
+            int pos;
+            pos = cast(int)/*64*/end_pos;
+            OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+            OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udINSERT_TEXT);
+            OS.gtk_editable_insert_text (cast(GtkEditable*)handle, newText.ptr, newText.length, &pos);
+            OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udINSERT_TEXT);
+            OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+            OS.gtk_editable_set_position (cast(GtkEditable*)handle, pos);
+        }
+    }
+    return 0;
+}
+
+override int /*long*/ gtk_event_after (GtkWidget* widget, GdkEvent* gdkEvent) {
+    if (cursor !is null) gtk_setCursor (cursor.handle);
+    return super.gtk_event_after (widget, gdkEvent);
+}
+
+override int /*long*/ gtk_focus_out_event (GtkWidget* widget, GdkEventFocus* event) {
+    fixIM ();
+    return super.gtk_focus_out_event (widget, event);
+}
+
+override int /*long*/ gtk_insert_text (GtkEditable* widget, char* new_text, int new_text_length, int position) {
+//  if (!hooks (SWT.Verify) && !filters (SWT.Verify)) return 0;
+    if (new_text is null || new_text_length is 0) return 0;
+    String oldText = new_text[ 0 .. new_text_length ].dup;
+    int pos;
+    pos = position;
+    if (pos is -1) {
+        auto ptr = OS.gtk_entry_get_text (cast(GtkEntry*)handle);
+        pos = cast(int)/*64*/OS.g_utf8_strlen (ptr, -1);
+    }
+    String newText = verifyText (oldText, pos, pos);
+    if (newText !is oldText) {
+        int newStart, newEnd;
+        OS.gtk_editable_get_selection_bounds (cast(GtkEditable*)handle, &newStart, &newEnd);
+        if (newText !is null) {
+            if (newStart !is newEnd) {
+                OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udDELETE_TEXT);
+                OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+                OS.gtk_editable_delete_selection (cast(GtkEditable*)handle);
+                OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udDELETE_TEXT);
+                OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+            }
+            OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udINSERT_TEXT);
+            OS.gtk_editable_insert_text (cast(GtkEditable*)handle, newText.ptr, newText.length, &pos);
+            OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udINSERT_TEXT);
+            newStart = newEnd = pos;
+        }
+        pos = newEnd;
+        if (newStart !is newEnd ) {
+            fixStart = newStart ;
+            fixEnd = newEnd ;
+        }
+        position = pos;
+        OS.g_signal_stop_emission_by_name (handle, OS.insert_text.ptr);
+    }
+    return 0;
+}
+
+override int /*long*/ gtk_key_press_event (GtkWidget* widget, GdkEventKey* event) {
+    auto result = super.gtk_key_press_event (widget, event);
+    if (result !is 0) fixIM ();
+    if (gdkEventKey is cast(GdkEventKey*)-1) result = 1;
+    gdkEventKey = null;
+    return result;
+}
+
+override int /*long*/ gtk_populate_popup (GtkWidget* widget, GtkWidget* menu) {
+    if ((style & SWT.RIGHT_TO_LEFT) !is 0) {
+        OS.gtk_widget_set_direction (menu, OS.GTK_TEXT_DIR_RTL);
+        display.doSetDirectionProc( menu, OS.GTK_TEXT_DIR_RTL);
+    }
+    return 0;
+}
+
+override int /*long*/ gtk_value_changed (int  adjustment) {
+    postEvent (SWT.Selection);
+    return 0;
+}
+
+override void hookEvents () {
+    super.hookEvents();
+    OS.g_signal_connect_closure (handle, OS.changed.ptr, display.closures [CHANGED], true);
+    OS.g_signal_connect_closure (handle, OS.insert_text.ptr, display.closures [INSERT_TEXT], false);
+    OS.g_signal_connect_closure (handle, OS.delete_text.ptr, display.closures [DELETE_TEXT], false);
+    OS.g_signal_connect_closure (handle, OS.value_changed.ptr, display.closures [VALUE_CHANGED], false);
+    OS.g_signal_connect_closure (handle, OS.activate.ptr, display.closures [ACTIVATE], false);
+    OS.g_signal_connect_closure (handle, OS.populate_popup.ptr, display.closures [POPULATE_POPUP], false);
+    auto imContext = imContext ();
+    if (imContext !is null) {
+        OS.g_signal_connect_closure (imContext, OS.commit.ptr, display.closures [COMMIT], false);
+        int id = OS.g_signal_lookup (OS.commit.ptr, OS.gtk_im_context_get_type ());
+        int mask =  OS.G_SIGNAL_MATCH_DATA | OS.G_SIGNAL_MATCH_ID;
+        OS.g_signal_handlers_block_matched (imContext, mask, id, 0, null, null, cast(void*)handle);
+    }
+}
+
+GtkIMContext* imContext () {
+    return OS.GTK_ENTRY_IM_CONTEXT (cast(GtkEntry*)handle);
+}
+
+override GdkDrawable* paintWindow () {
+    auto window = super.paintWindow ();
+    auto children = OS.gdk_window_get_children (window);
+    if (children !is null) window = cast(GdkDrawable*)OS.g_list_data (children);
+    OS.g_list_free (children);
+    return window;
+}
+
+/**
+ * Pastes text from clipboard.
+ * <p>
+ * The selected text is deleted from the widget
+ * and new text inserted from the clipboard.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void paste () {
+    checkWidget ();
+    OS.gtk_editable_paste_clipboard (cast(GtkEditable*)handle);
+}
+
+override void register () {
+    super.register ();
+    auto imContext = imContext ();
+    if (imContext !is null) display.addWidget (cast(GtkWidget*)imContext, this);
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    fixIM ();
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the receiver's text is modified.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ModifyListener
+ * @see #addModifyListener
+ */
+public void removeModifyListener (ModifyListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Modify, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is selected by the user.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener(SelectionListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook(SWT.Selection, listener);
+    eventTable.unhook(SWT.DefaultSelection,listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is verified.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see VerifyListener
+ * @see #addVerifyListener
+ */
+void removeVerifyListener (VerifyListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Verify, listener);
+}
+
+override void setBackgroundColor (GdkColor* color) {
+    super.setBackgroundColor (color);
+    OS.gtk_widget_modify_base (handle, 0, color);
+}
+
+override void gtk_setCursor (GdkCursor* cursor) {
+    GdkCursor* defaultCursor;
+    if (cursor is null) defaultCursor = OS.gdk_cursor_new (OS.GDK_XTERM);
+    super.gtk_setCursor (cursor !is null ? cursor : defaultCursor);
+    if (cursor is null) OS.gdk_cursor_destroy (defaultCursor);
+}
+
+override void setFontDescription (PangoFontDescription* font) {
+    super.setFontDescription (font);
+}
+
+/**
+ * Sets the amount that the receiver's value will be
+ * modified by when the up/down arrows are pressed to
+ * the argument, which must be at least one.
+ *
+ * @param value the new increment (must be greater than zero)
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setIncrement (int value) {
+    checkWidget ();
+    if (value < 1) return;
+    auto adjustment = OS.gtk_spin_button_get_adjustment (cast(GtkSpinButton*)handle);
+    double newValue = value;
+    int digits = OS.gtk_spin_button_get_digits (cast(GtkSpinButton*)handle);
+    for (int i = 0; i < digits; i++) newValue /= 10;
+    OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+    OS.gtk_spin_button_set_increments (cast(GtkSpinButton*)handle, newValue, adjustment.page_increment);
+    OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+}
+
+/**
+ * Sets the maximum value that the receiver will allow.  This new
+ * value will be ignored if it is not greater than the receiver's current
+ * minimum value.  If the new maximum is applied then the receiver's
+ * selection value will be adjusted if necessary to fall within its new range.
+ *
+ * @param value the new maximum, which must be greater than the current minimum
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMaximum (int value) {
+    checkWidget ();
+    auto adjustment = OS.gtk_spin_button_get_adjustment (cast(GtkSpinButton*)handle);
+    double newValue = value;
+    int digits = OS.gtk_spin_button_get_digits (cast(GtkSpinButton*)handle);
+    for (int i = 0; i < digits; i++) newValue /= 10;
+    if (newValue <= adjustment.lower) return;
+    OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+    OS.gtk_spin_button_set_range (cast(GtkSpinButton*)handle, adjustment.lower, newValue);
+    OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+}
+
+/**
+ * Sets the minimum value that the receiver will allow.  This new
+ * value will be ignored if it is not less than the receiver's
+ * current maximum value.  If the new minimum is applied then the receiver's
+ * selection value will be adjusted if necessary to fall within its new range.
+ *
+ * @param value the new minimum, which must be less than the current maximum
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMinimum (int value) {
+    checkWidget ();
+    auto adjustment = OS.gtk_spin_button_get_adjustment (cast(GtkSpinButton*)handle);
+    double newValue = value;
+    int digits = OS.gtk_spin_button_get_digits (cast(GtkSpinButton*)handle);
+    for (int i = 0; i < digits; i++) newValue /= 10;
+    if (newValue >= adjustment.upper) return;
+    OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+    OS.gtk_spin_button_set_range (cast(GtkSpinButton*)handle, newValue, adjustment.upper);
+    OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+}
+
+/**
+ * Sets the amount that the receiver's position will be
+ * modified by when the page up/down keys are pressed
+ * to the argument, which must be at least one.
+ *
+ * @param value the page increment (must be greater than zero)
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setPageIncrement (int value) {
+    checkWidget ();
+    if (value < 1) return;
+    auto adjustment = OS.gtk_spin_button_get_adjustment (cast(GtkSpinButton*)handle);
+    double newValue = value;
+    int digits = OS.gtk_spin_button_get_digits (cast(GtkSpinButton*)handle);
+    for (int i = 0; i < digits; i++) newValue /= 10;
+    OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+    OS.gtk_spin_button_set_increments (cast(GtkSpinButton*)handle, adjustment.step_increment, newValue);
+    OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+}
+
+/**
+ * Sets the <em>selection</em>, which is the receiver's
+ * position, to the argument. If the argument is not within
+ * the range specified by minimum and maximum, it will be
+ * adjusted to fall within this range.
+ *
+ * @param value the new selection (must be zero or greater)
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (int value) {
+    checkWidget ();
+    double newValue = value;
+    int digits = OS.gtk_spin_button_get_digits (cast(GtkSpinButton*)handle);
+    for (int i = 0; i < digits; i++) newValue /= 10;
+    OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+    OS.gtk_spin_button_set_value (cast(GtkSpinButton*)handle, newValue);
+    OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+}
+
+/**
+ * Sets the maximum number of characters that the receiver's
+ * text field is capable of holding to be the argument.
+ * <p>
+ * To reset this value to the default, use <code>setTextLimit(Spinner.LIMIT)</code>.
+ * Specifying a limit value larger than <code>Spinner.LIMIT</code> sets the
+ * receiver's limit to <code>Spinner.LIMIT</code>.
+ * </p>
+ * @param limit new text limit
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_CANNOT_BE_ZERO - if the limit is zero</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * 
+ * @see #LIMIT
+ * 
+ * @since 3.4
+ */
+public void setTextLimit (int limit) {
+    checkWidget ();
+    if (limit is 0) error (SWT.ERROR_CANNOT_BE_ZERO);
+    OS.gtk_entry_set_max_length (handle, limit);
+}
+
+/**
+ * Sets the number of decimal places used by the receiver.
+ * <p>
+ * The digit setting is used to allow for floating point values in the receiver.
+ * For example, to set the selection to a floating point value of 1.37 call setDigits() with
+ * a value of 2 and setSelection() with a value of 137. Similarly, if getDigits() has a value
+ * of 2 and getSelection() returns 137 this should be interpreted as 1.37. This applies to all
+ * numeric APIs.
+ * </p>
+ *
+ * @param value the new digits (must be greater than or equal to zero)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the value is less than zero</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setDigits (int value) {
+    checkWidget ();
+    if (value < 0) error (SWT.ERROR_INVALID_ARGUMENT);
+    int digits = OS.gtk_spin_button_get_digits (cast(GtkSpinButton*)handle);
+    if (value is digits) return;
+    auto adjustment = OS.gtk_spin_button_get_adjustment (cast(GtkSpinButton*)handle);
+    int diff = Math.abs (value - digits);
+    int factor = 1;
+    for (int i = 0; i < diff; i++) factor *= 10;
+    if (digits > value) {
+        adjustment.value *= factor;
+        adjustment.upper *= factor;
+        adjustment.lower *= factor;
+        adjustment.step_increment *= factor;
+        adjustment.page_increment *= factor;
+    } else {
+        adjustment.value /= factor;
+        adjustment.upper /= factor;
+        adjustment.lower /= factor;
+        adjustment.step_increment /= factor;
+        adjustment.page_increment /= factor;
+    }
+    OS.gtk_spin_button_set_digits (cast(GtkSpinButton*)handle, value);
+}
+
+/**
+ * Sets the receiver's selection, minimum value, maximum
+ * value, digits, increment and page increment all at once.
+ * <p>
+ * Note: This is similar to setting the values individually
+ * using the appropriate methods, but may be implemented in a
+ * more efficient fashion on some platforms.
+ * </p>
+ *
+ * @param selection the new selection value
+ * @param minimum the new minimum value
+ * @param maximum the new maximum value
+ * @param digits the new digits value
+ * @param increment the new increment value
+ * @param pageIncrement the new pageIncrement value
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setValues (int selection, int minimum, int maximum, int digits, int increment, int pageIncrement) {
+    checkWidget ();
+    if (maximum <= minimum) return;
+    if (digits < 0) return;
+    if (increment < 1) return;
+    if (pageIncrement < 1) return;
+    selection = Math.min (Math.max (minimum, selection), maximum);
+    double factor = 1;
+    for (int i = 0; i < digits; i++) factor *= 10;
+    OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+    OS.gtk_spin_button_set_range (cast(GtkSpinButton*)handle, minimum / factor, maximum / factor);
+    OS.gtk_spin_button_set_increments (cast(GtkSpinButton*)handle, increment / factor, pageIncrement / factor);
+    OS.gtk_spin_button_set_value (cast(GtkSpinButton*)handle, selection / factor);
+    OS.gtk_spin_button_set_digits (cast(GtkSpinButton*)handle, digits);
+    OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udVALUE_CHANGED);
+}
+
+override bool translateTraversal (GdkEventKey* keyEvent) {
+    int key = keyEvent.keyval;
+    switch (key) {
+        case OS.GDK_KP_Enter:
+        case OS.GDK_Return: {
+            auto imContext =  imContext ();
+            if (imContext !is null) {
+                char* preeditString;
+                OS.gtk_im_context_get_preedit_string (imContext, &preeditString, null, null);
+                if (preeditString !is null) {
+                    int length = tango.stdc.string.strlen (preeditString);
+                    OS.g_free (preeditString);
+                    if (length !is 0) return false;
+                }
+            }
+        default:
+        }
+    }
+    return super.translateTraversal (keyEvent);
+}
+
+String verifyText (String string, int start, int end) {
+    if (string.length is 0 && start is end) return null;
+    Event event = new Event ();
+    event.text = string;
+    event.start = start;
+    event.end = end;
+    auto eventPtr = OS.gtk_get_current_event ();
+    if (eventPtr !is null) {
+        GdkEventKey* gdkEvent = cast(GdkEventKey*)eventPtr;
+        switch (gdkEvent.type) {
+            case OS.GDK_KEY_PRESS:
+                setKeyState (event, gdkEvent);
+                break;
+            default:
+        }
+        OS.gdk_event_free (eventPtr);
+    }
+    int index = 0;
+    if (OS.gtk_spin_button_get_digits (cast(GtkSpinButton*)handle) > 0) {
+        String decimalSeparator = getDecimalSeparator ();
+        index = string.indexOf( decimalSeparator );
+        if (index !is -1 ) {
+            string = string.substring( 0, index ) ~ string.substring( index + 1 );
+        }
+        index = 0;
+    }
+    if (string.length  > 0) {
+        auto adjustment = OS.gtk_spin_button_get_adjustment (handle);
+        if (adjustment.lower < 0 && string.charAt (0) is '-') index++;
+    }
+    while (index < string.length) {
+        if (!CharacterIsDigit (string.charAt(index))) break;
+        index++;
+    }
+    event.doit = index is string.length;
+    /*
+     * It is possible (but unlikely), that application
+     * code could have disposed the widget in the verify
+     * event.  If this happens, answer null to cancel
+     * the operation.
+     */
+    sendEvent (SWT.Verify, event);
+    if (!event.doit || isDisposed ()) return null;
+    return event.text;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Synchronizer.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,201 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Synchronizer;
+
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.RunnableLock;
+import org.eclipse.swt.internal.Compatibility;
+import java.lang.all;
+
+import org.eclipse.swt.SWT;
+import tango.core.Thread;
+import org.eclipse.swt.graphics.Device;
+import tango.core.Exception;
+
+/**
+ * Instances of this class provide synchronization support
+ * for displays. A default instance is created automatically
+ * for each display, and this instance is sufficient for almost
+ * all applications.
+ * <p>
+ * <b>IMPORTANT:</b> Typical application code <em>never</em>
+ * needs to deal with this class. It is provided only to
+ * allow applications which require non-standard
+ * synchronization behavior to plug in the support they
+ * require. <em>Subclasses which override the methods in
+ * this class must ensure that the superclass methods are
+ * invoked in their implementations</em>
+ * </p>
+ *
+ * @see Display#setSynchronizer
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class Synchronizer {
+    Display display;
+    int messageCount;
+    RunnableLock [] messages;
+    Object messageLock;
+    Thread syncThread;
+    static final int GROW_SIZE = 4;
+    static final int MESSAGE_LIMIT = 64;
+
+/**
+ * Constructs a new instance of this class.
+ *
+ * @param display the display to create the synchronizer on
+ */
+public this (Display display) {
+    this.display = display;
+    messageLock = new Object ();
+}
+
+void addLast (RunnableLock lock) {
+    bool wake = false;
+    synchronized (messageLock) {
+        if (messages is null) messages = new RunnableLock [GROW_SIZE];
+        if (messageCount is messages.length) {
+            RunnableLock[] newMessages = new RunnableLock [messageCount + GROW_SIZE];
+            System.arraycopy (messages, 0, newMessages, 0, messageCount);
+            messages = newMessages;
+        }
+        messages [messageCount++] = lock;
+        wake = messageCount is 1;
+    }
+    if (wake) display.wakeThread ();
+}
+
+/**
+ * Causes the <code>run()</code> method of the runnable to
+ * be invoked by the user-interface thread at the next
+ * reasonable opportunity. The caller of this method continues
+ * to run in parallel, and is not notified when the
+ * runnable has completed.
+ *
+ * @param runnable code to run on the user-interface thread.
+ *
+ * @see #syncExec
+ */
+public void asyncExec (Runnable runnable) {
+    if (runnable is null) {
+        display.wake ();
+        return;
+    }
+    addLast (new RunnableLock (runnable));
+}
+
+int getMessageCount () {
+    synchronized (messageLock) {
+        return messageCount;
+    }
+}
+
+void releaseSynchronizer () {
+    display = null;
+    messages = null;
+    messageLock = null;
+    syncThread = null;
+}
+
+RunnableLock removeFirst () {
+    synchronized (messageLock) {
+        if (messageCount is 0) return null;
+        RunnableLock lock = messages [0];
+        System.arraycopy (messages, 1, messages, 0, --messageCount);
+        messages [messageCount] = null;
+        if (messageCount is 0) {
+            if (messages.length > MESSAGE_LIMIT) messages = null;
+        }
+        return lock;
+    }
+}
+
+bool runAsyncMessages () {
+    return runAsyncMessages (false);
+}
+
+bool runAsyncMessages (bool all) {
+    bool run = false;
+    do {
+        RunnableLock lock = removeFirst ();
+        if (lock is null) return run;
+        run = true;
+        synchronized (lock) {
+            syncThread = lock.thread;
+            try {
+                lock.run ();
+            } catch (Exception t) {
+                lock.throwable = t;
+                SWT.error (SWT.ERROR_FAILED_EXEC, t);
+            } finally {
+                syncThread = null;
+                lock.notifyAll ();
+            }
+        }
+    } while (all);
+    return run;
+}
+
+/**
+ * Causes the <code>run()</code> method of the runnable to
+ * be invoked by the user-interface thread at the next
+ * reasonable opportunity. The thread which calls this method
+ * is suspended until the runnable completes.
+ *
+ * @param runnable code to run on the user-interface thread.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_FAILED_EXEC - if an exception occurred when executing the runnable</li>
+ * </ul>
+ *
+ * @see #asyncExec
+ */
+public void syncExec (Runnable runnable) {
+    RunnableLock lock = null;
+    synchronized (Device.classinfo) {
+        if (display is null || display.isDisposed ()) SWT.error (SWT.ERROR_DEVICE_DISPOSED);
+        if (!display.isValidThread ()) {
+            if (runnable is null) {
+                display.wake ();
+                return;
+            }
+            lock = new RunnableLock (runnable);
+            /*
+             * Only remember the syncThread for syncExec.
+             */
+            lock.thread = Thread.getThis();
+            addLast (lock);
+        }
+    }
+    if (lock is null) {
+        if (runnable !is null) runnable.run ();
+        return;
+    }
+    synchronized (lock) {
+        bool interrupted = false;
+        while (!lock.done ()) {
+            try {
+                lock.wait ();
+            } catch (SyncException e) {
+                interrupted = true;
+            }
+        }
+        if (interrupted) {
+            Compatibility.interrupt();
+        }
+        if (lock.throwable !is null) {
+            SWT.error (SWT.ERROR_FAILED_EXEC, lock.throwable);
+        }
+    }
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/TabFolder.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,749 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.TabFolder;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.TabItem;
+import org.eclipse.swt.widgets.ImageList;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.widgets.Event;
+import java.lang.all;
+
+/**
+ * Instances of this class implement the notebook user interface
+ * metaphor.  It allows the user to select a notebook page from
+ * set of pages.
+ * <p>
+ * The item children that may be added to instances of this class
+ * must be of type <code>TabItem</code>.
+ * <code>Control</code> children are created and then set into a
+ * tab item using <code>TabItem#setControl</code>.
+ * </p><p>
+ * Note that although this class is a subclass of <code>Composite</code>,
+ * it does not make sense to set a layout on it.
+ * </p><p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>TOP, BOTTOM</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles TOP and BOTTOM may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#tabfolder">TabFolder, TabItem snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class TabFolder : Composite {
+
+    alias Composite.computeSize computeSize;
+    alias Composite.createHandle createHandle;
+    alias Composite.mnemonicHit mnemonicHit;
+    alias Composite.mnemonicMatch mnemonicMatch;
+    alias Composite.setBounds setBounds;
+    alias Composite.setForegroundColor setForegroundColor;
+
+    TabItem [] items;
+    ImageList imageList;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Composite parent, int style) {
+    super (parent, checkStyle (style));
+}
+
+static int checkStyle (int style) {
+    style = checkBits (style, SWT.TOP, SWT.BOTTOM, 0, 0, 0, 0);
+    /*
+    * Even though it is legal to create this widget
+    * with scroll bars, they serve no useful purpose
+    * because they do not automatically scroll the
+    * widget's client area.  The fix is to clear
+    * the SWT style.
+    */
+    return style & ~(SWT.H_SCROLL | SWT.V_SCROLL);
+}
+
+protected override void checkSubclass () {
+    if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+override GtkStyle* childStyle () {
+    auto rcStyle = OS.gtk_widget_get_modifier_style (handle);
+    if ((OS.gtk_rc_style_get_color_flags (rcStyle, 0) & OS.GTK_RC_BG) !is 0) return null;
+    OS.gtk_widget_realize (handle);
+    return OS.gtk_widget_get_style (handle);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the user changes the receiver's selection, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * When <code>widgetSelected</code> is called, the item field of the event object is valid.
+ * <code>widgetDefaultSelected</code> is not called.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the user changes the receiver's selection
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener(SelectionListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener(listener);
+    addListener(SWT.Selection,typedListener);
+    addListener(SWT.DefaultSelection,typedListener);
+}
+
+override GtkWidget* clientHandle () {
+    int index = OS.gtk_notebook_get_current_page (handle);
+    if (index !is -1 && items [index] !is null) {
+        return items [index].pageHandle;
+    }
+    return handle;
+}
+
+public override Point computeSize (int wHint, int hHint, bool changed) {
+    checkWidget ();
+    Point size = super.computeSize (wHint, hHint, changed);
+    if (wHint !is SWT.DEFAULT && wHint < 0) wHint = 0;
+    if (hHint !is SWT.DEFAULT && hHint < 0) hHint = 0;
+    bool scrollable = cast(bool)OS.gtk_notebook_get_scrollable (handle);
+    OS.gtk_notebook_set_scrollable (handle, false);
+    Point notebookSize = computeNativeSize (handle, wHint, hHint, changed);
+    OS.gtk_notebook_set_scrollable (handle, scrollable);
+    size.x = Math.max (notebookSize.x, size.x);
+    size.y = Math.max (notebookSize.y, size.y);
+    return size;
+}
+
+public override Rectangle computeTrim (int x, int y, int width, int height) {
+    checkWidget();
+    forceResize ();
+    auto clientHandle = clientHandle ();
+    int clientX = OS.GTK_WIDGET_X (clientHandle);
+    int clientY = OS.GTK_WIDGET_Y (clientHandle);
+    x -= clientX;
+    y -= clientY;
+    width +=  clientX + clientX;
+    if ((style & SWT.BOTTOM) !is 0) {
+        int parentHeight = OS.GTK_WIDGET_HEIGHT (handle);
+        int clientHeight = OS.GTK_WIDGET_HEIGHT (clientHandle);
+        height += parentHeight - clientHeight;
+    } else {
+        height +=  clientX + clientY;
+    }
+    return new Rectangle (x, y, width, height);
+}
+
+override void createHandle (int index) {
+    state |= HANDLE;
+    fixedHandle = cast(GtkWidget*)OS.g_object_new (display.gtk_fixed_get_type (), null);
+    if (fixedHandle is null) error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_fixed_set_has_window (fixedHandle, true);
+    handle = cast(GtkWidget*)OS.gtk_notebook_new ();
+    if (handle is null) error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_container_add (fixedHandle, handle);
+    OS.gtk_notebook_set_scrollable (handle, true);
+    OS.gtk_notebook_set_show_tabs (handle, true);
+    if ((style & SWT.BOTTOM) !is 0) {
+        OS.gtk_notebook_set_tab_pos (handle, OS.GTK_POS_BOTTOM);
+    }
+}
+
+override void createWidget (int index) {
+    super.createWidget(index);
+    items = new TabItem [4];
+}
+
+void createItem (TabItem item, int index) {
+    auto list = OS.gtk_container_get_children (handle);
+    int itemCount = 0;
+    if (list !is null) {
+        itemCount = OS.g_list_length (list);
+        OS.g_list_free (list);
+    }
+    if (!(0 <= index && index <= itemCount)) error (SWT.ERROR_INVALID_RANGE);
+    if (itemCount is items.length) {
+        TabItem [] newItems = new TabItem [items.length + 4];
+        System.arraycopy (items, 0, newItems, 0, items.length);
+        items = newItems;
+    }
+    auto boxHandle = OS.gtk_hbox_new (false, 0);
+    if (boxHandle is null) error (SWT.ERROR_NO_HANDLES);
+    auto labelHandle = OS.gtk_label_new_with_mnemonic (null);
+    if (labelHandle is null) error (SWT.ERROR_NO_HANDLES);
+    auto imageHandle = OS.gtk_image_new ();
+    if (imageHandle is null) error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_container_add (boxHandle, imageHandle);
+    OS.gtk_container_add (boxHandle, labelHandle);
+    auto pageHandle = cast(GtkWidget*)OS.g_object_new (display.gtk_fixed_get_type (), null);
+    if (pageHandle is null) error (SWT.ERROR_NO_HANDLES);
+    OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udSWITCH_PAGE);
+    OS.gtk_notebook_insert_page (handle, pageHandle, boxHandle, index);
+    OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udSWITCH_PAGE);
+    OS.gtk_widget_show (boxHandle);
+    OS.gtk_widget_show (labelHandle);
+    OS.gtk_widget_show (pageHandle);
+    item.state |= HANDLE;
+    item.handle = boxHandle;
+    item.labelHandle = labelHandle;
+    item.imageHandle = imageHandle;
+    item.pageHandle = pageHandle;
+    System.arraycopy (items, index, items, index + 1, itemCount++ - index);
+    items [index] = item;
+    if ((state & FOREGROUND) !is 0) {
+        item.setForegroundColor (getForegroundColor());
+    }
+    if ((state & FONT) !is 0) {
+        item.setFontDescription (getFontDescription());
+    }
+    if (itemCount is 1) {
+        OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udSWITCH_PAGE);
+        OS.gtk_notebook_set_current_page (handle, 0);
+        OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udSWITCH_PAGE);
+        Event event = new Event();
+        event.item = items[0];
+        sendEvent (SWT.Selection, event);
+        // the widget could be destroyed at this point
+    }
+}
+
+void destroyItem (TabItem item) {
+    int index = 0;
+    int itemCount = getItemCount();
+    while (index < itemCount) {
+        if (items [index] is item) break;
+        index++;
+    }
+    if (index is itemCount) error (SWT.ERROR_ITEM_NOT_REMOVED);
+    int oldIndex = OS.gtk_notebook_get_current_page (handle);
+    OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udSWITCH_PAGE);
+    OS.gtk_notebook_remove_page (handle, index);
+    OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udSWITCH_PAGE);
+    System.arraycopy (items, index + 1, items, index, --itemCount - index);
+    items [itemCount] = null;
+    if (index is oldIndex) {
+        int newIndex = OS.gtk_notebook_get_current_page (handle);
+        if (newIndex !is -1) {
+            Control control = items [newIndex].getControl ();
+            if (control !is null && !control.isDisposed ()) {
+                control.setBounds (getClientArea());
+                control.setVisible (true);
+            }
+            Event event = new Event ();
+            event.item = items [newIndex];
+            sendEvent (SWT.Selection, event);
+            // the widget could be destroyed at this point
+        }
+    }
+}
+
+override GtkWidget* eventHandle () {
+    return handle;
+}
+
+/**
+ * Returns the item at the given, zero-relative index in the
+ * receiver. Throws an exception if the index is out of range.
+ *
+ * @param index the index of the item to return
+ * @return the item at the given index
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TabItem getItem (int index) {
+    checkWidget();
+    if (!(0 <= index && index < getItemCount())) error (SWT.ERROR_INVALID_RANGE);
+    auto list = OS.gtk_container_get_children (handle);
+    if (list is null) error (SWT.ERROR_CANNOT_GET_ITEM);
+    int itemCount = OS.g_list_length (list);
+    OS.g_list_free (list);
+    if (!(0 <= index && index < itemCount)) error (SWT.ERROR_CANNOT_GET_ITEM);
+    return items [index];
+}
+
+/**
+ * Returns the tab item at the given point in the receiver
+ * or null if no such item exists. The point is in the
+ * coordinate system of the receiver.
+ *
+ * @param point the point used to locate the item
+ * @return the tab item at the given point, or null if the point is not in a tab item
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * 
+ * @since 3.4
+ */
+public TabItem getItem(Point point) {
+    checkWidget();
+    if (point is null) error (SWT.ERROR_NULL_ARGUMENT);
+    auto list = OS.gtk_container_get_children (handle);
+    if (list is null) return null;
+    int itemCount = OS.g_list_length (list);
+    OS.g_list_free (list);
+    for (int i = 0; i < itemCount; i++) {
+        TabItem item = items[i];
+        Rectangle rect = item.getBounds();
+        if (rect.contains(point)) return item;
+    }
+    return null;
+}
+
+/**
+ * Returns the number of items contained in the receiver.
+ *
+ * @return the number of items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemCount () {
+    checkWidget();
+    auto list = OS.gtk_container_get_children (handle);
+    if (list is null) return 0;
+    int itemCount = OS.g_list_length (list);
+    OS.g_list_free (list);
+    return itemCount;
+}
+
+/**
+ * Returns an array of <code>TabItem</code>s which are the items
+ * in the receiver.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the items in the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TabItem [] getItems () {
+    checkWidget();
+    int count = getItemCount ();
+    TabItem [] result = new TabItem [count];
+    System.arraycopy (items, 0, result, 0, count);
+    return result;
+}
+
+/**
+ * Returns an array of <code>TabItem</code>s that are currently
+ * selected in the receiver. An empty array indicates that no
+ * items are selected.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its selection, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ * @return an array representing the selection
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TabItem [] getSelection () {
+    checkWidget();
+    int index = OS.gtk_notebook_get_current_page (handle);
+    if (index is -1) return new TabItem [0];
+    return [ items [index] ];
+}
+
+/**
+ * Returns the zero-relative index of the item which is currently
+ * selected in the receiver, or -1 if no item is selected.
+ *
+ * @return the index of the selected item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSelectionIndex () {
+    checkWidget();
+    return OS.gtk_notebook_get_current_page (handle);
+}
+
+override int gtk_focus (GtkWidget* widget, int /*long*/ directionType) {
+    return 0;
+}
+
+override int gtk_switch_page (GtkWidget* widget, int /*long*/ page, int /*long*/ page_num) {
+    int index = OS.gtk_notebook_get_current_page (handle);
+    if (index !is -1) {
+        Control control = items [index].getControl ();
+        if (control !is null && !control.isDisposed ()) {
+            control.setVisible (false);
+        }
+    }
+    TabItem item = items [cast(int)/*64*/page_num];
+    Control control = item.getControl ();
+    if (control !is null && !control.isDisposed ()) {
+        control.setBounds(getClientArea());
+        control.setVisible (true);
+    }
+    Event event = new Event();
+    event.item = item;
+    postEvent(SWT.Selection, event);
+    return 0;
+}
+
+override void hookEvents () {
+    super.hookEvents ();
+    OS.g_signal_connect_closure (handle, OS.switch_page.ptr, display.closures [SWITCH_PAGE], false);
+}
+
+/**
+ * Searches the receiver's list starting at the first item
+ * (index 0) until an item is found that is equal to the
+ * argument, and returns the index of that item. If no item
+ * is found, returns -1.
+ *
+ * @param item the search item
+ * @return the index of the item
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int indexOf (TabItem item) {
+    checkWidget();
+    if (item is null) error (SWT.ERROR_NULL_ARGUMENT);
+    auto list = OS.gtk_container_get_children (handle);
+    if (list is null) return -1;
+    int count = OS.g_list_length (list);
+    OS.g_list_free (list);
+    for (int i=0; i<count; i++) {
+        if (items [i] is item) return i;
+    }
+    return -1;
+}
+
+override Point minimumSize (int wHint, int hHint, bool flushCache) {
+    Control [] children = _getChildren ();
+    int width = 0, height = 0;
+    for (int i=0; i<children.length; i++) {
+        Control child = children [i];
+        int index = 0;
+        int count = 0;
+        auto list = OS.gtk_container_get_children (handle);
+        if (list !is null) {
+            count = OS.g_list_length (list);
+            OS.g_list_free (list);
+        }
+        while (index < count) {
+            if (items [index].control is child) break;
+            index++;
+        }
+        if (index is count) {
+            Rectangle rect = child.getBounds ();
+            width = Math.max (width, rect.x + rect.width);
+            height = Math.max (height, rect.y + rect.height);
+        } else {
+            Point size = child.computeSize (wHint, hHint, flushCache);
+            width = Math.max (width, size.x);
+            height = Math.max (height, size.y);
+        }
+    }
+    return new Point (width, height);
+}
+
+override bool mnemonicHit (wchar key) {
+    int itemCount = getItemCount ();
+    for (int i=0; i<itemCount; i++) {
+        auto labelHandle = items [i].labelHandle;
+        if (labelHandle !is null && mnemonicHit (labelHandle, key)) return true;
+    }
+    return false;
+}
+
+override bool mnemonicMatch (wchar key) {
+    int itemCount = getItemCount ();
+    for (int i=0; i<itemCount; i++) {
+        auto labelHandle = items [i].labelHandle;
+        if (labelHandle !is null && mnemonicHit (labelHandle, key)) return true;
+    }
+    return false;
+}
+
+override void releaseChildren (bool destroy) {
+    if (items !is null) {
+        for (int i=0; i<items.length; i++) {
+            TabItem item = items [i];
+            if (item !is null && !item.isDisposed ()) {
+                item.release (false);
+            }
+        }
+        items = null;
+    }
+    super.releaseChildren (destroy);
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    if (imageList !is null) imageList.dispose ();
+    imageList = null;
+}
+
+override void removeControl (Control control) {
+    super.removeControl (control);
+    int count = getItemCount ();
+    for (int i=0; i<count; i++) {
+        TabItem item = items [i];
+        if (item.control is control) item.setControl (null);
+    }
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the user changes the receiver's selection.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener (SelectionListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Selection, listener);
+    eventTable.unhook (SWT.DefaultSelection,listener);
+}
+
+override int setBounds (int x, int y, int width, int height, bool move, bool resize) {
+    int result = super.setBounds (x, y, width, height, move, resize);
+    if ((result & RESIZED) !is 0) {
+        int index = getSelectionIndex ();
+        if (index !is -1) {
+            TabItem item = items [index];
+            Control control = item.control;
+            if (control !is null && !control.isDisposed ()) {
+                control.setBounds (getClientArea ());
+            }
+        }
+    }
+    return result;
+}
+
+override void setFontDescription (PangoFontDescription* font) {
+    super.setFontDescription (font);
+    TabItem [] items = getItems ();
+    for (int i = 0; i < items.length; i++) {
+        if (items[i] !is null) {
+            items[i].setFontDescription (font);
+        }
+    }
+}
+
+override void setForegroundColor (GdkColor* color) {
+    super.setForegroundColor (color);
+    TabItem [] items = getItems ();
+    for (int i = 0; i < items.length; i++) {
+        if (items[i] !is null) {
+            items[i].setForegroundColor (color);
+        }
+    }
+}
+
+/**
+ * Selects the item at the given zero-relative index in the receiver.
+ * If the item at the index was already selected, it remains selected.
+ * The current selection is first cleared, then the new items are
+ * selected. Indices that are out of range are ignored.
+ *
+ * @param index the index of the item to select
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (int index) {
+    checkWidget ();
+    if (!(0 <= index && index < getItemCount ())) return;
+    setSelection (index, false);
+}
+
+void setSelection (int index, bool notify) {
+    if (index < 0) return;
+    int oldIndex = OS.gtk_notebook_get_current_page (handle);
+    if (oldIndex is index) return;
+    if (oldIndex !is -1) {
+        TabItem item = items [oldIndex];
+        Control control = item.control;
+        if (control !is null && !control.isDisposed ()) {
+            control.setVisible (false);
+        }
+    }
+    OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udSWITCH_PAGE);
+    OS.gtk_notebook_set_current_page (handle, index);
+    OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udSWITCH_PAGE);
+    int newIndex = OS.gtk_notebook_get_current_page (handle);
+    if (newIndex !is -1) {
+        TabItem item = items [newIndex];
+        Control control = item.control;
+        if (control !is null && !control.isDisposed ()) {
+            control.setBounds (getClientArea ());
+            control.setVisible (true);
+        }
+        if (notify) {
+            Event event = new Event ();
+            event.item = item;
+            sendEvent (SWT.Selection, event);
+        }
+    }
+}
+
+/**
+ * Sets the receiver's selection to the given item.
+ * The current selected is first cleared, then the new item is
+ * selected.
+ *
+ * @param item the item to select
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setSelection (TabItem item) {
+    if (item is null) error (SWT.ERROR_NULL_ARGUMENT);
+    setSelection( [item] );
+}
+
+/**
+ * Sets the receiver's selection to be the given array of items.
+ * The current selected is first cleared, then the new items are
+ * selected.
+ *
+ * @param items the array of items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (TabItem [] items) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (items is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (items.length is 0) {
+        setSelection (-1, false);
+    } else {
+        for (int i=items.length-1; i>=0; --i) {
+            int index = indexOf (items [i]);
+            if (index !is -1) setSelection (index, false);
+        }
+    }
+}
+
+override bool traversePage (bool next) {
+    if (next) {
+        OS.gtk_notebook_next_page (handle);
+    } else {
+        OS.gtk_notebook_prev_page (handle);
+    }
+    return true;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/TabItem.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,384 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.TabItem;
+
+import java.lang.all;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.TabFolder;
+import org.eclipse.swt.widgets.ImageList;
+
+/**
+ * Instances of this class represent a selectable user interface object
+ * corresponding to a tab for a page in a tab folder.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>(none)</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#tabfolder">TabFolder, TabItem snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class TabItem : Item {
+
+    alias Item.setForegroundColor setForegroundColor;
+
+    GtkWidget* labelHandle, imageHandle, pageHandle;
+    Control control;
+    TabFolder parent;
+    String toolTipText;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>TabFolder</code>) and a style value
+ * describing its behavior and appearance. The item is added
+ * to the end of the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (TabFolder parent, int style) {
+    super (parent, style);
+    this.parent = parent;
+    createWidget (parent.getItemCount ());
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>TabFolder</code>), a style value
+ * describing its behavior and appearance, and the index
+ * at which to place it in the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ * @param index the zero-relative index to store the receiver in its parent
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the parent (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (TabFolder parent, int style, int index) {
+    super (parent, style);
+    this.parent = parent;
+    createWidget (index);
+}
+
+protected override void checkSubclass () {
+    if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+override void createWidget (int index) {
+    parent.createItem (this, index);
+    setOrientation ();
+    hookEvents ();
+    register ();
+    text = "";
+}
+
+override void deregister() {
+    super.deregister ();
+    if (labelHandle !is null) display.removeWidget (labelHandle);
+}
+
+override void destroyWidget () {
+    parent.destroyItem (this);
+    releaseHandle ();
+}
+
+/**
+ * Returns a rectangle describing the receiver's size and location
+ * relative to its parent.
+ *
+ * @return the receiver's bounding rectangle
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * 
+ * @since 3.4
+ */
+public Rectangle getBounds () {
+    checkWidget();
+    int x = OS.GTK_WIDGET_X (handle);
+    int y = OS.GTK_WIDGET_Y (handle);
+    int width = (state & ZERO_WIDTH) !is 0 ? 0 : OS.GTK_WIDGET_WIDTH (handle);
+    int height = (state & ZERO_HEIGHT) !is 0 ? 0 : OS.GTK_WIDGET_HEIGHT (handle);
+    if ((parent.style & SWT.MIRRORED) !is 0) x = parent.getClientWidth () - width - x;
+    return new Rectangle (x, y, width, height);
+}
+
+/**
+ * Returns the control that is used to fill the client area of
+ * the tab folder when the user selects the tab item.  If no
+ * control has been set, return <code>null</code>.
+ * <p>
+ * @return the control
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Control getControl () {
+    checkWidget ();
+    return control;
+}
+
+/**
+ * Returns the receiver's parent, which must be a <code>TabFolder</code>.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TabFolder getParent () {
+    checkWidget ();
+    return parent;
+}
+
+/**
+ * Returns the receiver's tool tip text, or null if it has
+ * not been set.
+ *
+ * @return the receiver's tool tip text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getToolTipText () {
+    checkWidget ();
+    return toolTipText;
+}
+
+override int gtk_enter_notify_event (GtkWidget* widget, GdkEventCrossing* event) {
+    parent.gtk_enter_notify_event (widget, event);
+    return 0;
+}
+
+override int gtk_mnemonic_activate (GtkWidget* widget, int /*long*/ arg1) {
+    return parent.gtk_mnemonic_activate (widget, arg1);
+}
+
+override void hookEvents () {
+    super.hookEvents ();
+    if (labelHandle !is null) OS.g_signal_connect_closure_by_id (labelHandle, display.signalIds [MNEMONIC_ACTIVATE], 0, display.closures [MNEMONIC_ACTIVATE], false);
+    OS.g_signal_connect_closure_by_id (handle, display.signalIds [ENTER_NOTIFY_EVENT], 0, display.closures [ENTER_NOTIFY_EVENT], false);
+}
+
+override void register () {
+    super.register ();
+    if (labelHandle !is null) display.addWidget (labelHandle, this);
+}
+
+override void releaseHandle () {
+    super.releaseHandle ();
+    pageHandle = labelHandle = imageHandle = null;
+    parent = null;
+}
+
+override void releaseParent () {
+    super.releaseParent ();
+    int index = parent.indexOf (this);
+    if (index is parent.getSelectionIndex ()) {
+        if (control !is null) control.setVisible (false);
+    }
+}
+
+/**
+ * Sets the control that is used to fill the client area of
+ * the tab folder when the user selects the tab item.
+ * <p>
+ * @param control the new control (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the control has been disposed</li>
+ *    <li>ERROR_INVALID_PARENT - if the control is not in the same widget tree</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setControl (Control control) {
+    checkWidget ();
+    if (control !is null) {
+        if (control.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+        if (control.parent !is parent) error (SWT.ERROR_INVALID_PARENT);
+    }
+    Control oldControl = this.control, newControl = control;
+    this.control = control;
+    int index = parent.indexOf (this);
+    if (index !is parent.getSelectionIndex ()) {
+        if (newControl !is null) newControl.setVisible (false);
+        return;
+    }
+    if (newControl !is null) {
+        newControl.setBounds (parent.getClientArea ());
+        newControl.setVisible (true);
+    }
+    if (oldControl !is null) oldControl.setVisible (false);
+}
+
+void setFontDescription (PangoFontDescription* font) {
+    OS.gtk_widget_modify_font (labelHandle, font);
+    OS.gtk_widget_modify_font (imageHandle, font);
+}
+
+void setForegroundColor (GdkColor* color) {
+    /* Don't set the color in vbox handle (it doesn't draw) */
+    setForegroundColor (labelHandle, color);
+    setForegroundColor (imageHandle, color);
+}
+
+public override void setImage (Image image) {
+    checkWidget ();
+    super.setImage (image);
+    if (image !is null) {
+        ImageList imageList = parent.imageList;
+        if (imageList is null) imageList = parent.imageList = new ImageList ();
+        int imageIndex = imageList.indexOf (image);
+        if (imageIndex is -1) {
+            imageIndex = imageList.add (image);
+        } else {
+            imageList.put (imageIndex, image);
+        }
+        auto pixbuf = imageList.getPixbuf (imageIndex);
+        OS.gtk_image_set_from_pixbuf (imageHandle, pixbuf);
+        OS.gtk_widget_show (imageHandle);
+    } else {
+        OS.gtk_image_set_from_pixbuf (imageHandle, null);
+        OS.gtk_widget_hide (imageHandle);
+    }
+}
+
+override void setOrientation () {
+    if ((parent.style & SWT.RIGHT_TO_LEFT) !is 0) {
+        if (handle !is null) OS.gtk_widget_set_direction (handle, OS.GTK_TEXT_DIR_RTL);
+        if (labelHandle !is null) OS.gtk_widget_set_direction (labelHandle, OS.GTK_TEXT_DIR_RTL);
+        if (imageHandle !is null) OS.gtk_widget_set_direction (imageHandle, OS.GTK_TEXT_DIR_RTL);
+        if (pageHandle !is null) OS.gtk_widget_set_direction (pageHandle, OS.GTK_TEXT_DIR_RTL);
+    }
+}
+
+/**
+ * Sets the receiver's text.  The string may include
+ * the mnemonic character.
+ * </p>
+ * <p>
+ * Mnemonics are indicated by an '&amp;' that causes the next
+ * character to be the mnemonic.  When the user presses a
+ * key sequence that matches the mnemonic, a selection
+ * event occurs. On most platforms, the mnemonic appears
+ * underlined but may be emphasised in a platform specific
+ * manner.  The mnemonic indicator character '&amp;' can be
+ * escaped by doubling it in the string, causing a single
+ * '&amp;' to be displayed.
+ * </p>
+ *
+ * @param string the new text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ */
+public override void setText (String string) {
+    checkWidget ();
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    super.setText (string);
+    char [] chars = fixMnemonic (string);
+    OS.gtk_label_set_text_with_mnemonic (labelHandle, chars.toStringzValidPtr() );
+    if (string.length !is 0) {
+        OS.gtk_widget_show (labelHandle);
+    } else {
+        OS.gtk_widget_hide (labelHandle);
+    }
+}
+
+/**
+ * Sets the receiver's tool tip text to the argument, which
+ * may be null indicating that no tool tip text should be shown.
+ *
+ * @param string the new tool tip text (or null)
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setToolTipText (String string) {
+    checkWidget ();
+    toolTipText = string;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Table.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,3478 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Table;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.ImageList;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Decorations;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.ScrollBar;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.TypedListener;
+import java.lang.all;
+
+import tango.util.Convert;
+
+/**
+ * Instances of this class implement a selectable user interface
+ * object that displays a list of images and strings and issues
+ * notification when selected.
+ * <p>
+ * The item children that may be added to instances of this class
+ * must be of type <code>TableItem</code>.
+ * </p><p>
+ * Style <code>VIRTUAL</code> is used to create a <code>Table</code> whose
+ * <code>TableItem</code>s are to be populated by the client on an on-demand basis
+ * instead of up-front.  This can provide significant performance improvements for
+ * tables that are very large or for which <code>TableItem</code> population is
+ * expensive (for example, retrieving values from an external source).
+ * </p><p>
+ * Here is an example of using a <code>Table</code> with style <code>VIRTUAL</code>:
+ * <code><pre>
+ *  final Table table = new Table (parent, SWT.VIRTUAL | SWT.BORDER);
+ *  table.setItemCount (1000000);
+ *  table.addListener (SWT.SetData, new Listener () {
+ *      public void handleEvent (Event event) {
+ *          TableItem item = (TableItem) event.item;
+ *          int index = table.indexOf (item);
+ *          item.setText ("Item " + index);
+ *          System.out.println (item.getText ());
+ *      }
+ *  });
+ * </pre></code>
+ * </p><p>
+ * Note that although this class is a subclass of <code>Composite</code>,
+ * it does not normally make sense to add <code>Control</code> children to
+ * it, or set a layout on it, unless implementing something like a cell
+ * editor.
+ * </p><p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>SINGLE, MULTI, CHECK, FULL_SELECTION, HIDE_SELECTION, VIRTUAL, NO_SCROLL</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection, DefaultSelection, SetData, MeasureItem, EraseItem, PaintItem</dd>
+ * </dl>
+ * </p><p>
+ * Note: Only one of the styles SINGLE, and MULTI may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#table">Table, TableItem, TableColumn snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class Table : Composite {
+
+    alias Composite.computeSize computeSize;
+    alias Composite.createHandle createHandle;
+    alias Composite.dragDetect dragDetect;
+    alias Composite.mnemonicHit mnemonicHit;
+    alias Composite.mnemonicMatch mnemonicMatch;
+    alias Composite.setBackgroundColor setBackgroundColor;
+    alias Composite.setBounds setBounds;
+
+    CallbackData treeSelectionCallbackData;
+    GtkWidget* modelHandle, checkRenderer;
+    int itemCount, columnCount, lastIndexOf, sortDirection;
+    GtkWidget* ignoreCell;
+    TableItem [] items;
+    TableColumn [] columns;
+    TableItem currentItem;
+    TableColumn sortColumn;
+    ImageList imageList, headerImageList;
+    bool firstCustomDraw;
+    int drawState, drawFlags;
+    GdkColor* drawForeground;
+    bool ownerDraw, ignoreSize;
+
+    static const int CHECKED_COLUMN = 0;
+    static const int GRAYED_COLUMN = 1;
+    static const int FOREGROUND_COLUMN = 2;
+    static const int BACKGROUND_COLUMN = 3;
+    static const int FONT_COLUMN = 4;
+    static const int FIRST_COLUMN = FONT_COLUMN + 1;
+    static const int CELL_PIXBUF = 0;
+    static const int CELL_TEXT = 1;
+    static const int CELL_FOREGROUND = 2;
+    static const int CELL_BACKGROUND = 3;
+    static const int CELL_FONT = 4;
+    static const int CELL_TYPES = CELL_FONT + 1;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#SINGLE
+ * @see SWT#MULTI
+ * @see SWT#CHECK
+ * @see SWT#FULL_SELECTION
+ * @see SWT#HIDE_SELECTION
+ * @see SWT#VIRTUAL
+ * @see SWT#NO_SCROLL
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Composite parent, int style) {
+    super (parent, checkStyle (style));
+}
+
+override void _addListener (int eventType, Listener listener) {
+    super._addListener (eventType, listener);
+    if (!ownerDraw) {
+        switch (eventType) {
+            case SWT.MeasureItem:
+            case SWT.EraseItem:
+            case SWT.PaintItem:
+                ownerDraw = true;
+                recreateRenderers ();
+                break;
+            default:
+        }
+    }
+}
+
+TableItem _getItem (int index) {
+    if ((style & SWT.VIRTUAL) is 0) return items [index];
+    if (items [index] !is null) return items [index];
+    return items [index] = new TableItem (this, SWT.NONE, index, false);
+}
+
+static int checkStyle (int style) {
+    /*
+    * Feature in Windows.  Even when WS_HSCROLL or
+    * WS_VSCROLL is not specified, Windows creates
+    * trees and tables with scroll bars.  The fix
+    * is to set H_SCROLL and V_SCROLL.
+    *
+    * NOTE: This code appears on all platforms so that
+    * applications have consistent scroll bar behavior.
+    */
+    if ((style & SWT.NO_SCROLL) is 0) {
+        style |= SWT.H_SCROLL | SWT.V_SCROLL;
+    }
+    /* GTK is always FULL_SELECTION */
+    style |= SWT.FULL_SELECTION;
+    return checkBits (style, SWT.SINGLE, SWT.MULTI, 0, 0, 0, 0);
+}
+
+override void cellDataProc (
+    GtkTreeViewColumn *tree_column,
+    GtkCellRenderer *cell,
+    GtkTreeModel *tree_model,
+    GtkTreeIter *iter,
+    void* data)
+{
+    if (cell is cast(GtkCellRenderer*)ignoreCell) return;
+    auto path = OS.gtk_tree_model_get_path (tree_model, iter);
+    auto index = OS.gtk_tree_path_get_indices (path);
+    TableItem item = _getItem (index[0]);
+    OS.gtk_tree_path_free (path);
+    if (item !is null) OS.g_object_set_qdata (cast(GObject*)cell, Display.SWT_OBJECT_INDEX2, item.handle);
+    bool isPixbuf = OS.GTK_IS_CELL_RENDERER_PIXBUF (cast(GTypeInstance*)cell);
+    if (!(isPixbuf || OS.GTK_IS_CELL_RENDERER_TEXT (cast(GTypeInstance*)cell))) return;
+    int modelIndex = -1;
+    bool customDraw = false;
+    if (columnCount is 0) {
+        modelIndex = Table.FIRST_COLUMN;
+        customDraw = firstCustomDraw;
+    } else {
+        TableColumn column = cast(TableColumn) display.getWidget (cast(GtkWidget*)tree_column);
+        if (column !is null) {
+            modelIndex = column.modelIndex;
+            customDraw = column.customDraw;
+        }
+    }
+    if (modelIndex is -1) return 0;
+    bool setData = false;
+    if ((style & SWT.VIRTUAL) !is 0) {
+        /*
+        * Feature in GTK.  On GTK before 2.4, fixed_height_mode is not
+        * supported, and the tree asks for the data of all items.  The
+        * fix is to only provide the data if the row is visible.
+        */
+        if (OS.GTK_VERSION < OS.buildVERSION (2, 3, 2)) {
+            OS.gtk_widget_realize (handle);
+            GdkRectangle visible;
+            OS.gtk_tree_view_get_visible_rect (handle, &visible);
+            GdkRectangle area;
+            path = OS.gtk_tree_model_get_path (tree_model, iter);
+            OS.gtk_tree_view_get_cell_area (handle, path, tree_column, &area);
+            OS.gtk_tree_path_free (path);
+            if (area.y + area.height < 0 || area.y + visible.y > visible.y + visible.height) {
+                /* Give an image from the image list to make sure the row has
+                * the correct height.
+                */
+                if (imageList !is null && imageList.pixbufs.length > 0) {
+                    if (isPixbuf) OS.g_object_set1 (cell, OS.pixbuf.ptr, cast(int)imageList.pixbufs [0] );
+                }
+                return 0;
+            }
+        }
+        if (!item.cached) {
+            lastIndexOf = index[0];
+            setData = checkData (item);
+        }
+    }
+    void* ptr;
+    if (setData) {
+        if (isPixbuf) {
+            OS.gtk_tree_model_get1 (tree_model, iter, modelIndex + CELL_PIXBUF, &ptr);
+            OS.g_object_set1 (cell, OS.pixbuf.ptr, cast(int)ptr);
+        } else {
+            OS.gtk_tree_model_get1 (tree_model, iter, modelIndex + CELL_TEXT, &ptr);
+            if (ptr !is null) {
+                OS.g_object_set1 (cell, OS.text.ptr, cast(int)ptr);
+                OS.g_free (ptr);
+            }
+        }
+    }
+    if (customDraw) {
+        /*
+        * Bug on GTK. Gtk renders the background on top of the checkbox and pixbuf.
+        * This only happens in version 2.2.1 and earlier. The fix is not to set the background.
+        */
+        if (OS.GTK_VERSION > OS.buildVERSION (2, 2, 1)) {
+            if (!ownerDraw) {
+                ptr = null;
+                OS.gtk_tree_model_get1 (tree_model, iter, modelIndex + CELL_BACKGROUND, &ptr);
+                if (ptr !is null) {
+                    OS.g_object_set1 (cell, OS.cell_background_gdk.ptr, cast(int)ptr);
+                }
+            }
+        }
+        if (!isPixbuf) {
+            ptr = null;
+            OS.gtk_tree_model_get1 (tree_model, iter, modelIndex + CELL_FOREGROUND, &ptr);
+            if (ptr !is null) {
+                OS.g_object_set1 (cell, OS.foreground_gdk.ptr, cast(int)ptr);
+            }
+            ptr = null;
+            OS.gtk_tree_model_get1 (tree_model, iter, modelIndex + CELL_FONT, &ptr);
+            if (ptr !is null) {
+                OS.g_object_set1 (cell, OS.font_desc.ptr, cast(int)ptr);
+            }
+        }
+    }
+    if (setData) {
+        ignoreCell = cast(GtkWidget*)cell;
+        setScrollWidth (tree_column, item);
+        ignoreCell = null;
+    }
+    return;
+}
+
+bool checkData (TableItem item) {
+    if (item.cached) return true;
+    if ((style & SWT.VIRTUAL) !is 0) {
+        item.cached = true;
+        Event event = new Event ();
+        event.item = item;
+        event.index = indexOf (item);
+        int mask = OS.G_SIGNAL_MATCH_DATA | OS.G_SIGNAL_MATCH_ID;
+        int signal_id = OS.g_signal_lookup (OS.row_changed.ptr, OS.gtk_tree_model_get_type ());
+        OS.g_signal_handlers_block_matched (modelHandle, mask, signal_id, 0, null, null, handle);
+        currentItem = item;
+        sendEvent (SWT.SetData, event);
+        //widget could be disposed at this point
+        currentItem = null;
+        if (isDisposed ()) return false;
+        OS.g_signal_handlers_unblock_matched (modelHandle, mask, signal_id, 0, null, null, handle);
+        if (item.isDisposed ()) return false;
+    }
+    return true;
+}
+
+protected override void checkSubclass () {
+    if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the user changes the receiver's selection, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * When <code>widgetSelected</code> is called, the item field of the event object is valid.
+ * If the receiver has the <code>SWT.CHECK</code> style and the check selection changes,
+ * the event object detail field contains the value <code>SWT.CHECK</code>.
+ * <code>widgetDefaultSelected</code> is typically called when an item is double-clicked.
+ * The item field of the event object is valid for default selection, but the detail field is not used.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the user changes the receiver's selection
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener (SelectionListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Selection, typedListener);
+    addListener (SWT.DefaultSelection, typedListener);
+}
+
+int calculateWidth (GtkTreeViewColumn* column, GtkTreeIter* iter) {
+    OS.gtk_tree_view_column_cell_set_cell_data (column, modelHandle, iter, false, false);
+    /*
+    * Bug in GTK.  The width calculated by gtk_tree_view_column_cell_get_size()
+    * always grows in size regardless of the text or images in the table.
+    * The fix is to determine the column width from the cell renderers.
+    */
+    // Code intentionally commented
+    //int [] width = new int [1];
+    //OS.gtk_tree_view_column_cell_get_size (column, null, null, null, width, null);
+    //return width [0];
+
+    int width = 0;
+    int w;
+    OS.gtk_widget_style_get1(handle, OS.focus_line_width.ptr, &w );
+    width += 2 * w;
+    auto list = OS.gtk_tree_view_column_get_cell_renderers (column);
+    if (list is null) return 0;
+    auto temp = list;
+    while (temp !is null) {
+        auto renderer = OS.g_list_data (temp);
+        if (renderer !is null) {
+            OS.gtk_cell_renderer_get_size (renderer, handle, null, null, null, &w, null);
+            width += w;
+        }
+        temp = OS.g_list_next (temp);
+    }
+    OS.g_list_free (list);
+    return width;
+}
+
+/**
+ * Clears the item at the given zero-relative index in the receiver.
+ * The text, icon and other attributes of the item are set to the default
+ * value.  If the table was created with the <code>SWT.VIRTUAL</code> style,
+ * these attributes are requested again as needed.
+ *
+ * @param index the index of the item to clear
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT#VIRTUAL
+ * @see SWT#SetData
+ *
+ * @since 3.0
+ */
+public void clear (int index) {
+    checkWidget ();
+    if (!(0 <= index && index < itemCount)) {
+        error(SWT.ERROR_INVALID_RANGE);
+    }
+    TableItem item = items [index];
+    if (item !is null) item.clear ();
+}
+
+/**
+ * Removes the items from the receiver which are between the given
+ * zero-relative start and end indices (inclusive).  The text, icon
+ * and other attributes of the items are set to their default values.
+ * If the table was created with the <code>SWT.VIRTUAL</code> style,
+ * these attributes are requested again as needed.
+ *
+ * @param start the start index of the item to clear
+ * @param end the end index of the item to clear
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if either the start or end are not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT#VIRTUAL
+ * @see SWT#SetData
+ *
+ * @since 3.0
+ */
+public void clear (int start, int end) {
+    checkWidget ();
+    if (start > end) return;
+    if (!(0 <= start && start <= end && end < itemCount)) {
+        error (SWT.ERROR_INVALID_RANGE);
+    }
+    if (start is 0 && end is itemCount - 1) {
+        clearAll();
+    } else {
+        for (int i=start; i<=end; i++) {
+            TableItem item = items [i];
+            if (item !is null) item.clear();
+        }
+    }
+}
+
+/**
+ * Clears the items at the given zero-relative indices in the receiver.
+ * The text, icon and other attributes of the items are set to their default
+ * values.  If the table was created with the <code>SWT.VIRTUAL</code> style,
+ * these attributes are requested again as needed.
+ *
+ * @param indices the array of indices of the items
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT#VIRTUAL
+ * @see SWT#SetData
+ *
+ * @since 3.0
+ */
+public void clear (int [] indices) {
+    checkWidget ();
+    // SWT extension: allow null for zero length string
+    //if (indices is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (indices.length is 0) return;
+    for (int i=0; i<indices.length; i++) {
+        if (!(0 <= indices [i] && indices [i] < itemCount)) {
+            error (SWT.ERROR_INVALID_RANGE);
+        }
+    }
+    for (int i=0; i<indices.length; i++) {
+        TableItem item = items [indices [i]];
+        if (item !is null) item.clear();
+    }
+}
+
+/**
+ * Clears all the items in the receiver. The text, icon and other
+ * attributes of the items are set to their default values. If the
+ * table was created with the <code>SWT.VIRTUAL</code> style, these
+ * attributes are requested again as needed.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT#VIRTUAL
+ * @see SWT#SetData
+ *
+ * @since 3.0
+ */
+public void clearAll () {
+    checkWidget ();
+    for (int i=0; i<itemCount; i++) {
+        TableItem item = items [i];
+        if (item !is null) item.clear();
+    }
+}
+
+public override Point computeSize (int wHint, int hHint, bool changed) {
+    checkWidget ();
+    if (wHint !is SWT.DEFAULT && wHint < 0) wHint = 0;
+    if (hHint !is SWT.DEFAULT && hHint < 0) hHint = 0;
+    Point size = computeNativeSize (handle, wHint, hHint, changed);
+    Rectangle trim = computeTrim (0, 0, size.x, size.y);
+    size.x = trim.width;
+    size.y = trim.height;
+    return size;
+}
+
+void createColumn (TableColumn column, int index) {
+    int modelIndex = FIRST_COLUMN;
+    if (columnCount !is 0) {
+        int modelLength = OS.gtk_tree_model_get_n_columns (modelHandle);
+        bool [] usedColumns = new bool [modelLength];
+        for (int i=0; i<columnCount; i++) {
+            int columnIndex = columns [i].modelIndex;
+            for (int j = 0; j < CELL_TYPES; j++) {
+                usedColumns [columnIndex + j] = true;
+            }
+        }
+        while (modelIndex < modelLength) {
+            if (!usedColumns [modelIndex]) break;
+            modelIndex++;
+        }
+        if (modelIndex is modelLength) {
+            auto oldModel = modelHandle;
+            auto types = getColumnTypes (columnCount + 4); // grow by 4 rows at a time
+            auto newModel = OS.gtk_list_store_newv (types.length, types.ptr);
+            if (newModel is null) error (SWT.ERROR_NO_HANDLES);
+            void* ptr;
+            for (int i=0; i<itemCount; i++) {
+                GtkTreeIter* newItem = cast(GtkTreeIter*)OS.g_malloc( GtkTreeIter.sizeof );
+                if (newItem is null) error (SWT.ERROR_NO_HANDLES);
+                OS.gtk_list_store_append (newModel, newItem);
+                TableItem item = items [i];
+                if (item !is null) {
+                    auto oldItem = item.handle;
+                    for (int j=0; j<modelLength; j++) {
+                        OS.gtk_tree_model_get1 (oldModel, oldItem, j, &ptr);
+                        OS.gtk_list_store_set1 (newModel, newItem, j, ptr);
+                        if (types [j] is OS.G_TYPE_STRING ()) OS.g_free ((ptr));
+                    }
+                    OS.gtk_list_store_remove (oldModel, oldItem);
+                    OS.g_free (oldItem);
+                    item.handle = cast(GtkWidget*)newItem;
+                } else {
+                    OS.g_free (newItem);
+                }
+            }
+            OS.gtk_tree_view_set_model (handle, newModel);
+            OS.g_object_unref (oldModel);
+            modelHandle = cast(GtkWidget*)newModel;
+        }
+    }
+    auto columnHandle = OS.gtk_tree_view_column_new ();
+    if (columnHandle is null) error (SWT.ERROR_NO_HANDLES);
+    if (index is 0 && columnCount > 0) {
+        TableColumn checkColumn = columns [0];
+        createRenderers (cast(GtkTreeViewColumn*)checkColumn.handle, checkColumn.modelIndex, false, checkColumn.style);
+    }
+    createRenderers ( columnHandle, modelIndex, index is 0, column is null ? 0 : column.style);
+    /*
+    * Use GTK_TREE_VIEW_COLUMN_GROW_ONLY on GTK versions < 2.3.2
+    * because fixed_height_mode is not supported.
+    */
+    bool useVirtual = (style & SWT.VIRTUAL) !is 0 && OS.GTK_VERSION >= OS.buildVERSION (2, 3, 2);
+    if (!useVirtual && columnCount is 0) {
+        OS.gtk_tree_view_column_set_sizing (columnHandle, OS.GTK_TREE_VIEW_COLUMN_GROW_ONLY);
+    } else {
+        OS.gtk_tree_view_column_set_sizing (columnHandle, OS.GTK_TREE_VIEW_COLUMN_FIXED);
+        if (columnCount !is 0) OS.gtk_tree_view_column_set_visible (columnHandle, false);
+    }
+    OS.gtk_tree_view_column_set_resizable (columnHandle, true);
+    OS.gtk_tree_view_column_set_clickable (columnHandle, true);
+    OS.gtk_tree_view_column_set_min_width (columnHandle, 0);
+    OS.gtk_tree_view_insert_column (handle, columnHandle, index);
+    if (column !is null) {
+        column.handle = cast(GtkWidget*)columnHandle;
+        column.modelIndex = modelIndex;
+    }
+    /* Disable searching when using VIRTUAL */
+    if ((style & SWT.VIRTUAL) !is 0) {
+        /*
+        * Bug in GTK. Until GTK 2.6.5, calling gtk_tree_view_set_enable_search(FALSE)
+        * would prevent the user from being able to type in text to search the tree.
+        * After 2.6.5, GTK introduced Ctrl+F as being the key binding for interactive
+        * search. This meant that even if FALSE was passed to enable_search, the user
+        * can still bring up the search pop up using the keybinding. GTK also introduced
+        * the notion of passing a -1 to gtk_set_search_column to disable searching
+        * (including the search key binding).  The fix is to use the right calls
+        * for the right version.
+        */
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 6, 5)) {
+            OS.gtk_tree_view_set_search_column (handle, -1);
+        } else {
+            OS.gtk_tree_view_set_enable_search (handle, false);
+        }
+    } else {
+        /* Set the search column whenever the model changes */
+        int firstColumn = columnCount is 0 ? FIRST_COLUMN : columns [0].modelIndex;
+        OS.gtk_tree_view_set_search_column (handle, firstColumn + CELL_TEXT);
+    }
+}
+
+override void createHandle (int index) {
+    state |= HANDLE;
+    fixedHandle = cast(GtkWidget*)OS.g_object_new (display.gtk_fixed_get_type (), null);
+    if (fixedHandle is null) error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_fixed_set_has_window (fixedHandle, true);
+    scrolledHandle = cast(GtkWidget*)OS.gtk_scrolled_window_new (null, null);
+    if (scrolledHandle is null) error (SWT.ERROR_NO_HANDLES);
+    auto types = getColumnTypes (1);
+    modelHandle = cast(GtkWidget*)OS.gtk_list_store_newv (types.length, types.ptr);
+    if (modelHandle is null) error (SWT.ERROR_NO_HANDLES);
+    handle = cast(GtkWidget*)OS.gtk_tree_view_new_with_model (modelHandle);
+    if (handle is null) error (SWT.ERROR_NO_HANDLES);
+    if ((style & SWT.CHECK) !is 0) {
+        checkRenderer = cast(GtkWidget*)OS.gtk_cell_renderer_toggle_new ();
+        if (checkRenderer is null) error (SWT.ERROR_NO_HANDLES);
+        OS.g_object_ref (checkRenderer);
+    }
+    createColumn (null, 0);
+    OS.gtk_container_add (fixedHandle, scrolledHandle);
+    OS.gtk_container_add (scrolledHandle, handle);
+
+    int mode = (style & SWT.MULTI) !is 0 ? OS.GTK_SELECTION_MULTIPLE : OS.GTK_SELECTION_BROWSE;
+    auto selectionHandle = OS.gtk_tree_view_get_selection (handle);
+    OS.gtk_tree_selection_set_mode (selectionHandle, mode);
+    OS.gtk_tree_view_set_headers_visible (handle, false);
+    int hsp = (style & SWT.H_SCROLL) !is 0 ? OS.GTK_POLICY_AUTOMATIC : OS.GTK_POLICY_NEVER;
+    int vsp = (style & SWT.V_SCROLL) !is 0 ? OS.GTK_POLICY_AUTOMATIC : OS.GTK_POLICY_NEVER;
+    OS.gtk_scrolled_window_set_policy (scrolledHandle, hsp, vsp);
+    if ((style & SWT.BORDER) !is 0) OS.gtk_scrolled_window_set_shadow_type (scrolledHandle, OS.GTK_SHADOW_ETCHED_IN);
+    /* Disable searching when using VIRTUAL */
+    if ((style & SWT.VIRTUAL) !is 0) {
+        /* The fixed_height_mode property only exists in GTK 2.3.2 and greater */
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 3, 2)) {
+            OS.g_object_set1 (handle, OS.fixed_height_mode.ptr, true);
+        }
+        /*
+        * Bug in GTK. Until GTK 2.6.5, calling gtk_tree_view_set_enable_search(FALSE)
+        * would prevent the user from being able to type in text to search the tree.
+        * After 2.6.5, GTK introduced Ctrl+F as being the key binding for interactive
+        * search. This meant that even if FALSE was passed to enable_search, the user
+        * can still bring up the search pop up using the keybinding. GTK also introduced
+        * the notion of passing a -1 to gtk_set_search_column to disable searching
+        * (including the search key binding).  The fix is to use the right calls
+        * for the right version.
+        */
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 6, 5)) {
+            OS.gtk_tree_view_set_search_column (handle, -1);
+        } else {
+            OS.gtk_tree_view_set_enable_search (handle, false);
+        }
+    }
+}
+
+void createItem (TableColumn column, int index) {
+    if (!(0 <= index && index <= columnCount)) error (SWT.ERROR_INVALID_RANGE);
+    if (columnCount is 0) {
+        column.handle = cast(GtkWidget*)OS.gtk_tree_view_get_column (handle, 0);
+        OS.gtk_tree_view_column_set_sizing (column.handle, OS.GTK_TREE_VIEW_COLUMN_FIXED);
+        OS.gtk_tree_view_column_set_visible (column.handle, false);
+        column.modelIndex = FIRST_COLUMN;
+        createRenderers (cast(GtkTreeViewColumn*)column.handle, column.modelIndex, true, column.style);
+        column.customDraw = firstCustomDraw;
+        firstCustomDraw = false;
+    } else {
+        createColumn (column, index);
+    }
+    auto boxHandle = OS.gtk_hbox_new (false, 3);
+    if (boxHandle is null) error (SWT.ERROR_NO_HANDLES);
+    auto labelHandle = OS.gtk_label_new_with_mnemonic (null);
+    if (labelHandle is null) error (SWT.ERROR_NO_HANDLES);
+    auto imageHandle = OS.gtk_image_new ();
+    if (imageHandle is null) error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_container_add (boxHandle, imageHandle);
+    OS.gtk_container_add (boxHandle, labelHandle);
+    OS.gtk_widget_show (boxHandle);
+    OS.gtk_widget_show (labelHandle);
+    column.labelHandle = labelHandle;
+    column.imageHandle = imageHandle;
+    OS.gtk_tree_view_column_set_widget (column.handle, boxHandle);
+    auto widget = OS.gtk_widget_get_parent (boxHandle);
+    while (widget !is handle) {
+        if (OS.GTK_IS_BUTTON (cast(GTypeInstance*)widget)) {
+            column.buttonHandle = widget;
+            break;
+        }
+        widget = OS.gtk_widget_get_parent (widget);
+    }
+    if (columnCount is columns.length) {
+        TableColumn [] newColumns = new TableColumn [columns.length + 4];
+        System.arraycopy (columns, 0, newColumns, 0, columns.length);
+        columns = newColumns;
+    }
+    System.arraycopy (columns, index, columns, index + 1, columnCount++ - index);
+    columns [index] = column;
+    if ((state & FONT) !is 0) {
+        column.setFontDescription (getFontDescription ());
+    }
+    if (columnCount >= 1) {
+        for (int i=0; i<itemCount; i++) {
+            TableItem item = items [i];
+            if (item !is null) {
+                Font [] cellFont = item.cellFont;
+                if (cellFont !is null) {
+                    Font [] temp = new Font [columnCount];
+                    System.arraycopy (cellFont, 0, temp, 0, index);
+                    System.arraycopy (cellFont, index, temp, index+1, columnCount-index-1);
+                    item.cellFont = temp;
+                }
+            }
+        }
+    }
+}
+
+void createItem (TableItem item, int index) {
+    if (!(0 <= index && index <= itemCount)) error (SWT.ERROR_INVALID_RANGE);
+    if (itemCount is items.length) {
+        int length = drawCount is 0 ? items.length + 4 : Math.max (4, items.length * 3 / 2);
+        TableItem [] newItems = new TableItem [length];
+        System.arraycopy (items, 0, newItems, 0, items.length);
+        items = newItems;
+    }
+    item.handle = cast(GtkWidget*) OS.g_malloc( GtkTreeIter.sizeof );
+    if (item.handle is null) error (SWT.ERROR_NO_HANDLES);
+    /*
+    * Feature in GTK.  It is much faster to append to a list store
+    * than to insert at the end using gtk_list_store_insert().
+    */
+    if (index is itemCount) {
+        OS.gtk_list_store_append (modelHandle, item.handle);
+    } else {
+        OS.gtk_list_store_insert (modelHandle, item.handle, index);
+    }
+    System.arraycopy (items, index, items, index + 1, itemCount++ - index);
+    items [index] = item;
+}
+
+void createRenderers (GtkTreeViewColumn* columnHandle, int modelIndex, bool check, int columnStyle) {
+    OS.gtk_tree_view_column_clear (columnHandle);
+    if ((style & SWT.CHECK) !is 0 && check) {
+        OS.gtk_tree_view_column_pack_start (columnHandle, checkRenderer, false);
+        OS.gtk_tree_view_column_add_attribute (columnHandle, checkRenderer, OS.active.ptr, CHECKED_COLUMN);
+        /*
+        * Feature in GTK. The inconsistent property only exists in GTK 2.2.x.
+        */
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 2, 0)) {
+            OS.gtk_tree_view_column_add_attribute (columnHandle, checkRenderer, OS.inconsistent.ptr, GRAYED_COLUMN);
+        }
+        /*
+        * Bug in GTK. GTK renders the background on top of the checkbox.
+        * This only happens in version 2.2.1 and earlier. The fix is not to set the background.
+        */
+        if (OS.GTK_VERSION > OS.buildVERSION (2, 2, 1)) {
+            if (!ownerDraw) OS.gtk_tree_view_column_add_attribute (columnHandle, checkRenderer, OS.cell_background_gdk.ptr, BACKGROUND_COLUMN);
+        }
+        if (ownerDraw) {
+            display.doCellDataProc( handle, cast(GtkTreeViewColumn*)columnHandle, cast(GtkCellRenderer*)checkRenderer );
+            OS.g_object_set_qdata (cast(GObject*)checkRenderer, Display.SWT_OBJECT_INDEX1, columnHandle);
+        }
+    }
+    auto pixbufRenderer = ownerDraw ? cast(GtkCellRenderer*)OS.g_object_new (display.gtk_cell_renderer_pixbuf_get_type (), null) : OS.gtk_cell_renderer_pixbuf_new ();
+    if (pixbufRenderer is null) error (SWT.ERROR_NO_HANDLES);
+    auto textRenderer = ownerDraw ? cast(GtkCellRenderer*)OS.g_object_new (display.gtk_cell_renderer_text_get_type (), null) : OS.gtk_cell_renderer_text_new ();
+    if (textRenderer is null) error (SWT.ERROR_NO_HANDLES);
+
+    if (ownerDraw) {
+        OS.g_object_set_qdata (cast(GObject*)pixbufRenderer, Display.SWT_OBJECT_INDEX1, columnHandle);
+        OS.g_object_set_qdata (cast(GObject*)textRenderer, Display.SWT_OBJECT_INDEX1, columnHandle);
+    }
+
+    /*
+    * Feature in GTK.  When a tree view column contains only one activatable
+    * cell renderer such as a toggle renderer, mouse clicks anywhere in a cell
+    * activate that renderer. The workaround is to set a second cell renderer
+    * to be activatable.
+    */
+    if ((style & SWT.CHECK) !is 0 && check) {
+        OS.g_object_set1 (pixbufRenderer, OS.mode.ptr, OS.GTK_CELL_RENDERER_MODE_ACTIVATABLE);
+    }
+
+    /* Set alignment */
+    if ((columnStyle & SWT.RIGHT) !is 0) {
+        OS.g_object_set1_float(textRenderer, OS.xalign.ptr, 1.0f );
+        OS.gtk_tree_view_column_pack_end (columnHandle, textRenderer, true);
+        OS.gtk_tree_view_column_pack_end (columnHandle, pixbufRenderer, false);
+        OS.gtk_tree_view_column_set_alignment (columnHandle, 1f);
+    } else if ((columnStyle & SWT.CENTER) !is 0) {
+        OS.g_object_set1_float(textRenderer, OS.xalign.ptr, 0.5f );
+        OS.gtk_tree_view_column_pack_start (columnHandle, pixbufRenderer, false);
+        OS.gtk_tree_view_column_pack_end (columnHandle, textRenderer, true);
+        OS.gtk_tree_view_column_set_alignment (columnHandle, 0.5f);
+    } else {
+        OS.gtk_tree_view_column_pack_start (columnHandle, pixbufRenderer, false);
+        OS.gtk_tree_view_column_pack_start (columnHandle, textRenderer, true);
+        OS.gtk_tree_view_column_set_alignment (columnHandle, 0f);
+    }
+
+    /* Add attributes */
+    OS.gtk_tree_view_column_add_attribute (columnHandle, pixbufRenderer, OS.pixbuf.ptr, modelIndex + CELL_PIXBUF);
+    /*
+     * Bug on GTK. Gtk renders the background on top of the pixbuf.
+     * This only happens in version 2.2.1 and earlier. The fix is not to set the background.
+     */
+    if (OS.GTK_VERSION > OS.buildVERSION (2, 2, 1)) {
+        if (!ownerDraw) {
+            OS.gtk_tree_view_column_add_attribute (columnHandle, pixbufRenderer, OS.cell_background_gdk.ptr, BACKGROUND_COLUMN);
+            OS.gtk_tree_view_column_add_attribute (columnHandle, textRenderer, OS.cell_background_gdk.ptr, BACKGROUND_COLUMN);
+        }
+    }
+    OS.gtk_tree_view_column_add_attribute (columnHandle, textRenderer, OS.text.ptr, modelIndex + CELL_TEXT);
+    OS.gtk_tree_view_column_add_attribute (columnHandle, textRenderer, OS.foreground_gdk.ptr, FOREGROUND_COLUMN);
+    OS.gtk_tree_view_column_add_attribute (columnHandle, textRenderer, OS.font_desc.ptr, FONT_COLUMN);
+
+    bool customDraw = firstCustomDraw;
+    if (columnCount !is 0) {
+        for (int i=0; i<columnCount; i++) {
+            if (columns [i].handle is cast(GtkWidget*)columnHandle) {
+                customDraw = columns [i].customDraw;
+                break;
+            }
+        }
+    }
+    if ((style & SWT.VIRTUAL) !is 0 || customDraw || ownerDraw) {
+        display.doCellDataProc( handle, cast(GtkTreeViewColumn*)columnHandle, cast(GtkCellRenderer*)textRenderer );
+        display.doCellDataProc( handle, cast(GtkTreeViewColumn*)columnHandle, cast(GtkCellRenderer*)pixbufRenderer );
+    }
+}
+
+override void createWidget (int index) {
+    super.createWidget (index);
+    items = new TableItem [4];
+    columns = new TableColumn [4];
+    itemCount = columnCount = 0;
+}
+
+GdkColor* defaultBackground () {
+    return display.COLOR_LIST_BACKGROUND;
+}
+
+GdkColor* defaultForeground () {
+    return display.COLOR_LIST_FOREGROUND;
+}
+
+override void deregister () {
+    super.deregister ();
+    display.removeWidget ( cast(GtkWidget*)OS.gtk_tree_view_get_selection (handle));
+    if (checkRenderer !is null) display.removeWidget (checkRenderer);
+}
+
+/**
+ * Deselects the item at the given zero-relative index in the receiver.
+ * If the item at the index was already deselected, it remains
+ * deselected. Indices that are out of range are ignored.
+ *
+ * @param index the index of the item to deselect
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void deselect (int index) {
+    checkWidget();
+    if (index < 0 || index >= itemCount) return;
+    bool fixColumn = showFirstColumn ();
+    auto selection = OS.gtk_tree_view_get_selection (handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    OS.gtk_tree_selection_unselect_iter (selection, _getItem (index).handle);
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    if (fixColumn) hideFirstColumn ();
+}
+
+/**
+ * Deselects the items at the given zero-relative indices in the receiver.
+ * If the item at the given zero-relative index in the receiver
+ * is selected, it is deselected.  If the item at the index
+ * was not selected, it remains deselected.  The range of the
+ * indices is inclusive. Indices that are out of range are ignored.
+ *
+ * @param start the start index of the items to deselect
+ * @param end the end index of the items to deselect
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void deselect (int start, int end) {
+    checkWidget();
+    bool fixColumn = showFirstColumn ();
+    auto selection = OS.gtk_tree_view_get_selection (handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    for (int index=start; index<=end; index++) {
+        if (index < 0 || index >= itemCount) continue;
+        OS.gtk_tree_selection_unselect_iter (selection, _getItem (index).handle);
+    }
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    if (fixColumn) hideFirstColumn ();
+}
+
+/**
+ * Deselects the items at the given zero-relative indices in the receiver.
+ * If the item at the given zero-relative index in the receiver
+ * is selected, it is deselected.  If the item at the index
+ * was not selected, it remains deselected. Indices that are out
+ * of range and duplicate indices are ignored.
+ *
+ * @param indices the array of indices for the items to deselect
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void deselect (int [] indices) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (indices is null) error (SWT.ERROR_NULL_ARGUMENT);
+    bool fixColumn = showFirstColumn ();
+    auto selection = OS.gtk_tree_view_get_selection (handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    for (int i=0; i<indices.length; i++) {
+        int index = indices[i];
+        if (index < 0 || index >= itemCount) continue;
+        OS.gtk_tree_selection_unselect_iter (selection, _getItem (index).handle);
+    }
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    if (fixColumn) hideFirstColumn ();
+}
+
+/**
+ * Deselects all selected items in the receiver.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void deselectAll () {
+    checkWidget();
+    bool fixColumn = showFirstColumn ();
+    auto selection = OS.gtk_tree_view_get_selection (handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    OS.gtk_tree_selection_unselect_all (selection);
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    if (fixColumn) hideFirstColumn ();
+}
+
+void destroyItem (TableColumn column) {
+    int index = 0;
+    while (index < columnCount) {
+        if (columns [index] is column) break;
+        index++;
+    }
+    if (index is columnCount) return;
+    auto columnHandle = column.handle;
+    if (columnCount is 1) {
+        firstCustomDraw = column.customDraw;
+    }
+    System.arraycopy (columns, index + 1, columns, index, --columnCount - index);
+    columns [columnCount] = null;
+    OS.gtk_tree_view_remove_column (handle, columnHandle);
+    if (columnCount is 0) {
+        auto oldModel = modelHandle;
+        auto types = getColumnTypes (1);
+        auto newModel = OS.gtk_list_store_newv (types.length, types.ptr);
+        if (newModel is null) error (SWT.ERROR_NO_HANDLES);
+        void* ptr;
+        for (int i=0; i<itemCount; i++) {
+            GtkTreeIter* newItem = cast(GtkTreeIter*) OS.g_malloc( GtkTreeIter.sizeof );
+            if (newItem is null) error (SWT.ERROR_NO_HANDLES);
+            OS.gtk_list_store_append (newModel, newItem);
+            TableItem item = items [i];
+            if (item !is null) {
+                auto oldItem = item.handle;
+                for (int j=0; j<FIRST_COLUMN; j++) {
+                    OS.gtk_tree_model_get1 (oldModel, oldItem, j, &ptr);
+                    OS.gtk_list_store_set1 (newModel, newItem, j, ptr);
+                }
+                OS.gtk_tree_model_get1 (oldModel, oldItem, column.modelIndex + CELL_PIXBUF, &ptr);
+                OS.gtk_list_store_set1 (newModel, newItem, FIRST_COLUMN + CELL_PIXBUF, ptr);
+                OS.gtk_tree_model_get1 (oldModel, oldItem, column.modelIndex + CELL_TEXT, &ptr);
+                OS.gtk_list_store_set1 (newModel, newItem, FIRST_COLUMN + CELL_TEXT, ptr );
+                OS.g_free (ptr);
+                OS.gtk_tree_model_get1 (oldModel, oldItem, column.modelIndex + CELL_FOREGROUND, &ptr);
+                OS.gtk_list_store_set1 (newModel, newItem, FIRST_COLUMN + CELL_FOREGROUND, ptr);
+                OS.gtk_tree_model_get1 (oldModel, oldItem, column.modelIndex + CELL_BACKGROUND, &ptr);
+                OS.gtk_list_store_set1 (newModel, newItem, FIRST_COLUMN + CELL_BACKGROUND, ptr);
+                OS.gtk_tree_model_get1 (oldModel, oldItem, column.modelIndex + CELL_FONT, &ptr);
+                OS.gtk_list_store_set1 (newModel, newItem, FIRST_COLUMN + CELL_FONT, ptr);
+                OS.gtk_list_store_remove (oldModel, oldItem);
+                OS.g_free (oldItem);
+                item.handle = cast(GtkWidget*) newItem;
+            } else {
+                OS.g_free( newItem );
+            }
+        }
+        OS.gtk_tree_view_set_model (handle, newModel);
+        OS.g_object_unref (oldModel);
+        modelHandle = cast(GtkWidget*)newModel;
+        createColumn (null, 0);
+    } else {
+        for (int i=0; i<itemCount; i++) {
+            TableItem item = items [i];
+            if (item !is null) {
+                auto iter = item.handle;
+                int modelIndex = column.modelIndex;
+                OS.gtk_list_store_set1 (modelHandle, iter, modelIndex + CELL_PIXBUF, null);
+                OS.gtk_list_store_set1 (modelHandle, iter, modelIndex + CELL_TEXT, null);
+                OS.gtk_list_store_set1 (modelHandle, iter, modelIndex + CELL_FOREGROUND, null);
+                OS.gtk_list_store_set1 (modelHandle, iter, modelIndex + CELL_BACKGROUND, null);
+                OS.gtk_list_store_set1 (modelHandle, iter, modelIndex + CELL_FONT, null);
+
+                Font [] cellFont = item.cellFont;
+                if (cellFont !is null) {
+                    if (columnCount is 0) {
+                        item.cellFont = null;
+                    } else {
+                        Font [] temp = new Font [columnCount];
+                        System.arraycopy (cellFont, 0, temp, 0, index);
+                        System.arraycopy (cellFont, index + 1, temp, index, columnCount - index);
+                        item.cellFont = temp;
+                    }
+                }
+            }
+        }
+        if (index is 0) {
+            TableColumn checkColumn = columns [0];
+            createRenderers (cast(GtkTreeViewColumn*)checkColumn.handle, checkColumn.modelIndex, true, checkColumn.style);
+        }
+    }
+    /* Disable searching when using VIRTUAL */
+    if ((style & SWT.VIRTUAL) !is 0) {
+        /*
+        * Bug in GTK. Until GTK 2.6.5, calling gtk_tree_view_set_enable_search(FALSE)
+        * would prevent the user from being able to type in text to search the tree.
+        * After 2.6.5, GTK introduced Ctrl+F as being the key binding for interactive
+        * search. This meant that even if FALSE was passed to enable_search, the user
+        * can still bring up the search pop up using the keybinding. GTK also introduced
+        * the notion of passing a -1 to gtk_set_search_column to disable searching
+        * (including the search key binding).  The fix is to use the right calls
+        * for the right version.
+        */
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 6, 5)) {
+            OS.gtk_tree_view_set_search_column (handle, -1);
+        } else {
+            OS.gtk_tree_view_set_enable_search (handle, false);
+        }
+    } else {
+        /* Set the search column whenever the model changes */
+        int firstColumn = columnCount is 0 ? FIRST_COLUMN : columns [0].modelIndex;
+        OS.gtk_tree_view_set_search_column (handle, firstColumn + CELL_TEXT);
+    }
+}
+
+void destroyItem (TableItem item) {
+    int index = 0;
+    while (index < itemCount) {
+        if (items [index] is item) break;
+        index++;
+    }
+    if (index is itemCount) return;
+    auto selection = OS.gtk_tree_view_get_selection (handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    OS.gtk_list_store_remove (modelHandle, item.handle);
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    System.arraycopy (items, index + 1, items, index, --itemCount - index);
+    items [itemCount] = null;
+    if (itemCount is 0) resetCustomDraw ();
+}
+
+override bool dragDetect (int x, int y, bool filter, bool* consume) {
+    bool selected = false;
+    if (filter) {
+        GtkTreeViewColumn * path;
+        if (OS.gtk_tree_view_get_path_at_pos (handle, x, y, cast(void**)&path, null, null, null)) {
+            if (path !is null) {
+                auto selection = OS.gtk_tree_view_get_selection (handle);
+                if (OS.gtk_tree_selection_path_is_selected (selection, path)) selected = true;
+                OS.gtk_tree_path_free (path);
+            }
+        } else {
+            return false;
+        }
+    }
+    bool dragDetect = super.dragDetect (x, y, filter, consume);
+    if (dragDetect && selected && consume !is null) consume[0] = true;
+    return dragDetect;
+}
+
+override GdkDrawable* eventWindow () {
+    return paintWindow ();
+}
+
+override void fixChildren (Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu [] menus) {
+    super.fixChildren (newShell, oldShell, newDecorations, oldDecorations, menus);
+    for (int i=0; i<columnCount; i++) {
+        TableColumn column = columns [i];
+        if (column.toolTipText !is null) {
+            column.setToolTipText(oldShell, null);
+            column.setToolTipText(newShell, column.toolTipText);
+        }
+    }
+}
+
+override GdkColor* getBackgroundColor () {
+    return getBaseColor ();
+}
+
+public override Rectangle getClientArea () {
+    checkWidget ();
+    forceResize ();
+    OS.gtk_widget_realize (handle);
+    auto fixedWindow = OS.GTK_WIDGET_WINDOW (fixedHandle);
+    auto binWindow = OS.gtk_tree_view_get_bin_window (handle);
+    int binX, binY;
+    OS.gdk_window_get_origin (binWindow, &binX, &binY);
+    int fixedX, fixedY;
+    OS.gdk_window_get_origin (fixedWindow, &fixedX, &fixedY);
+    auto clientHandle = clientHandle ();
+    int width = (state & ZERO_WIDTH) !is 0 ? 0 : OS.GTK_WIDGET_WIDTH (clientHandle);
+    int height = (state & ZERO_HEIGHT) !is 0 ? 0 : OS.GTK_WIDGET_HEIGHT (clientHandle);
+    return new Rectangle (fixedX - binX, fixedY - binY, width, height);
+}
+
+int getClientWidth () {
+    int w, h;
+    OS.gtk_widget_realize (handle);
+    OS.gdk_drawable_get_size(OS.gtk_tree_view_get_bin_window(handle), &w, &h);
+    return w;
+}
+
+/**
+ * Returns the column at the given, zero-relative index in the
+ * receiver. Throws an exception if the index is out of range.
+ * Columns are returned in the order that they were created.
+ * If no <code>TableColumn</code>s were created by the programmer,
+ * this method will throw <code>ERROR_INVALID_RANGE</code> despite
+ * the fact that a single column of data may be visible in the table.
+ * This occurs when the programmer uses the table like a list, adding
+ * items but never creating a column.
+ *
+ * @param index the index of the column to return
+ * @return the column at the given index
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Table#getColumnOrder()
+ * @see Table#setColumnOrder(int[])
+ * @see TableColumn#getMoveable()
+ * @see TableColumn#setMoveable(bool)
+ * @see SWT#Move
+ */
+public TableColumn getColumn (int index) {
+    checkWidget();
+    if (!(0 <= index && index < columnCount)) error (SWT.ERROR_INVALID_RANGE);
+    return columns [index];
+}
+
+/**
+ * Returns the number of columns contained in the receiver.
+ * If no <code>TableColumn</code>s were created by the programmer,
+ * this value is zero, despite the fact that visually, one column
+ * of items may be visible. This occurs when the programmer uses
+ * the table like a list, adding items but never creating a column.
+ *
+ * @return the number of columns
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getColumnCount () {
+    checkWidget();
+    return columnCount;
+}
+
+uint[] getColumnTypes (int columnCount) {
+    uint[] types = new uint [FIRST_COLUMN + (columnCount * CELL_TYPES)];
+    // per row data
+    types [CHECKED_COLUMN] = OS.G_TYPE_BOOLEAN ();
+    types [GRAYED_COLUMN] = OS.G_TYPE_BOOLEAN ();
+    types [FOREGROUND_COLUMN] = OS.GDK_TYPE_COLOR ();
+    types [BACKGROUND_COLUMN] = OS.GDK_TYPE_COLOR ();
+    types [FONT_COLUMN] = OS.PANGO_TYPE_FONT_DESCRIPTION ();
+    // per cell data
+    for (int i=FIRST_COLUMN; i<types.length; i+=CELL_TYPES) {
+        types [i + CELL_PIXBUF] = OS.GDK_TYPE_PIXBUF ();
+        types [i + CELL_TEXT] = OS.G_TYPE_STRING ();
+        types [i + CELL_FOREGROUND] = OS.GDK_TYPE_COLOR ();
+        types [i + CELL_BACKGROUND] = OS.GDK_TYPE_COLOR ();
+        types [i + CELL_FONT] = OS.PANGO_TYPE_FONT_DESCRIPTION ();
+    }
+    return types;
+}
+
+/**
+ * Returns an array of zero-relative integers that map
+ * the creation order of the receiver's items to the
+ * order in which they are currently being displayed.
+ * <p>
+ * Specifically, the indices of the returned array represent
+ * the current visual order of the items, and the contents
+ * of the array represent the creation order of the items.
+ * </p><p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the current visual order of the receiver's items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Table#setColumnOrder(int[])
+ * @see TableColumn#getMoveable()
+ * @see TableColumn#setMoveable(bool)
+ * @see SWT#Move
+ *
+ * @since 3.1
+ */
+public int [] getColumnOrder () {
+    checkWidget ();
+    if (columnCount is 0) return new int [0];
+    auto list = OS.gtk_tree_view_get_columns (handle);
+    if (list is null) return new int [0];
+    int  i = 0, count = OS.g_list_length (list);
+    int [] order = new int [count];
+    auto temp = list;
+    while (temp !is null) {
+        auto column = OS.g_list_data (temp);
+        if (column !is null) {
+            for (int j=0; j<columnCount; j++) {
+                if (columns [j].handle is column) {
+                    order [i++] = j;
+                    break;
+                }
+            }
+        }
+        temp = OS.g_list_next (temp);
+    }
+    OS.g_list_free (list);
+    return order;
+}
+
+/**
+ * Returns an array of <code>TableColumn</code>s which are the
+ * columns in the receiver.  Columns are returned in the order
+ * that they were created.  If no <code>TableColumn</code>s were
+ * created by the programmer, the array is empty, despite the fact
+ * that visually, one column of items may be visible. This occurs
+ * when the programmer uses the table like a list, adding items but
+ * never creating a column.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the items in the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Table#getColumnOrder()
+ * @see Table#setColumnOrder(int[])
+ * @see TableColumn#getMoveable()
+ * @see TableColumn#setMoveable(bool)
+ * @see SWT#Move
+ */
+public TableColumn [] getColumns () {
+    checkWidget();
+    TableColumn [] result = new TableColumn [columnCount];
+    System.arraycopy (columns, 0, result, 0, columnCount);
+    return result;
+}
+
+TableItem getFocusItem () {
+    GtkTreeViewColumn * path;
+    OS.gtk_tree_view_get_cursor (handle, cast(void**)&path, null);
+    if (path is null) return null;
+    TableItem item = null;
+    auto indices = OS.gtk_tree_path_get_indices (path);
+    if (indices !is null) {
+        item = _getItem (indices [0]);
+    }
+    OS.gtk_tree_path_free (path);
+    return item;
+}
+
+override GdkColor* getForegroundColor () {
+    return getTextColor ();
+}
+
+/**
+ * Returns the width in pixels of a grid line.
+ *
+ * @return the width of a grid line in pixels
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getGridLineWidth () {
+    checkWidget();
+    return 0;
+}
+
+/**
+ * Returns the height of the receiver's header
+ *
+ * @return the height of the header or zero if the header is not visible
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ */
+public int getHeaderHeight () {
+    checkWidget ();
+    if (!OS.gtk_tree_view_get_headers_visible (handle)) return 0;
+    if (columnCount > 0) {
+        GtkRequisition requisition;
+        int height = 0;
+        for (int i=0; i<columnCount; i++) {
+            auto buttonHandle = columns [i].buttonHandle;
+            if (buttonHandle !is null) {
+                OS.gtk_widget_size_request (buttonHandle, &requisition);
+                height = Math.max (height, requisition.height);
+            }
+        }
+        return height;
+    }
+    OS.gtk_widget_realize (handle);
+    auto fixedWindow = OS.GTK_WIDGET_WINDOW (fixedHandle);
+    auto binWindow = OS.gtk_tree_view_get_bin_window (handle);
+    int binY;
+    OS.gdk_window_get_origin (binWindow, null, &binY);
+    int fixedY;
+    OS.gdk_window_get_origin (fixedWindow, null, &fixedY);
+    return binY - fixedY;
+}
+
+/**
+ * Returns <code>true</code> if the receiver's header is visible,
+ * and <code>false</code> otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, this method
+ * may still indicate that it is considered visible even though
+ * it may not actually be showing.
+ * </p>
+ *
+ * @return the receiver's header's visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool getHeaderVisible () {
+    checkWidget();
+    return cast(bool) OS.gtk_tree_view_get_headers_visible (handle);
+}
+
+/**
+ * Returns the item at the given, zero-relative index in the
+ * receiver. Throws an exception if the index is out of range.
+ *
+ * @param index the index of the item to return
+ * @return the item at the given index
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TableItem getItem (int index) {
+    checkWidget();
+    if (!(0 <= index && index < itemCount)) error (SWT.ERROR_INVALID_RANGE);
+    return _getItem (index);
+}
+
+/**
+ * Returns the item at the given point in the receiver
+ * or null if no such item exists. The point is in the
+ * coordinate system of the receiver.
+ * <p>
+ * The item that is returned represents an item that could be selected by the user.
+ * For example, if selection only occurs in items in the first column, then null is
+ * returned if the point is outside of the item.
+ * Note that the SWT.FULL_SELECTION style hint, which specifies the selection policy,
+ * determines the extent of the selection.
+ * </p>
+ *
+ * @param point the point used to locate the item
+ * @return the item at the given point, or null if the point is not in a selectable item
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TableItem getItem (Point point) {
+    checkWidget();
+    if (point is null) error (SWT.ERROR_NULL_ARGUMENT);
+    void* path;
+    OS.gtk_widget_realize (handle);
+    if (!OS.gtk_tree_view_get_path_at_pos (handle, point.x, point.y, &path, null, null, null)) return null;
+    if (path is null) return null;
+    auto indices = OS.gtk_tree_path_get_indices (path );
+    TableItem item = null;
+    if (indices !is null) {
+        item = _getItem (indices [0]);
+    }
+    OS.gtk_tree_path_free (path );
+    return item;
+}
+
+/**
+ * Returns the number of items contained in the receiver.
+ *
+ * @return the number of items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemCount () {
+    checkWidget ();
+    return itemCount;
+}
+
+/**
+ * Returns the height of the area which would be used to
+ * display <em>one</em> of the items in the receiver.
+ *
+ * @return the height of one item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemHeight () {
+    checkWidget();
+    if (itemCount is 0) {
+        auto column = OS.gtk_tree_view_get_column (handle, 0);
+        int w, h;
+        ignoreSize = true;
+        OS.gtk_tree_view_column_cell_get_size (column, null, null, null, &w, &h);
+        ignoreSize = false;
+        return h;
+    } else {
+        int height = 0;
+        GtkTreeIter* iter = cast(GtkTreeIter*) OS.g_malloc( GtkTreeIter.sizeof );
+        OS.gtk_tree_model_get_iter_first (modelHandle, iter);
+        int columnCount = Math.max (1, this.columnCount);
+        for (int i=0; i<columnCount; i++) {
+            auto column = OS.gtk_tree_view_get_column (handle, i);
+            OS.gtk_tree_view_column_cell_set_cell_data (column, modelHandle, iter, false, false);
+            int w, h;
+            OS.gtk_tree_view_column_cell_get_size (column, null, null, null, &w, &h);
+            height = Math.max (height, h );
+        }
+        OS.g_free(iter);
+        return height;
+    }
+}
+
+/**
+ * Returns a (possibly empty) array of <code>TableItem</code>s which
+ * are the items in the receiver.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the items in the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TableItem [] getItems () {
+    checkWidget();
+    TableItem [] result = new TableItem [itemCount];
+    if ((style & SWT.VIRTUAL) !is 0) {
+        for (int i=0; i<itemCount; i++) {
+            result [i] = _getItem (i);
+        }
+    } else {
+        System.arraycopy (items, 0, result, 0, itemCount);
+    }
+    return result;
+}
+
+/**
+ * Returns <code>true</code> if the receiver's lines are visible,
+ * and <code>false</code> otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, this method
+ * may still indicate that it is considered visible even though
+ * it may not actually be showing.
+ * </p>
+ *
+ * @return the visibility state of the lines
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool getLinesVisible() {
+    checkWidget();
+    return cast(bool)OS.gtk_tree_view_get_rules_hint (handle);
+}
+
+GtkCellRendererPixbuf* getPixbufRenderer (GtkTreeViewColumn* column) {
+    auto list = OS.gtk_tree_view_column_get_cell_renderers (column);
+    if (list is null) return null;
+    int count = OS.g_list_length (list);
+    GtkCellRendererPixbuf* pixbufRenderer;
+    int i = 0;
+    while (i < count) {
+        auto renderer = OS.g_list_nth_data (list, i);
+         if (OS.GTK_IS_CELL_RENDERER_PIXBUF (cast(GTypeInstance*)renderer)) {
+            pixbufRenderer = cast(GtkCellRendererPixbuf*)renderer;
+            break;
+        }
+        i++;
+    }
+    OS.g_list_free (list);
+    return pixbufRenderer;
+}
+
+/**
+ * Returns an array of <code>TableItem</code>s that are currently
+ * selected in the receiver. The order of the items is unspecified.
+ * An empty array indicates that no items are selected.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its selection, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ * @return an array representing the selection
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TableItem [] getSelection () {
+    checkWidget();
+    auto selection = OS.gtk_tree_view_get_selection (handle);
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 2, 0)) {
+        display.treeSelectionLength  = 0;
+        display.treeSelection = new int [itemCount];
+        display.doTreeSelectionProcConnect( &treeSelectionCallbackData, handle, selection );
+        TableItem [] result = new TableItem [display.treeSelectionLength];
+        for (int i=0; i<result.length; i++) result [i] = _getItem (display.treeSelection [i]);
+        return result;
+    }
+    /*
+    * Bug in GTK.  gtk_tree_selection_get_selected_rows() segmentation faults
+    * in versions smaller than 2.2.4 if the model is NULL.  The fix is
+    * to give a valid pointer instead.
+    */
+    int dummy;
+    void* model = OS.GTK_VERSION < OS.buildVERSION (2, 2, 4) ? &dummy : null;
+    auto list = OS.gtk_tree_selection_get_selected_rows (selection, &model);
+    if (list !is null) {
+        int count = OS.g_list_length (list);
+        int [] treeSelection = new int [count];
+        int length_ = 0;
+        for (int i=0; i<count; i++) {
+            auto data = OS.g_list_nth_data (list, i);
+            auto indices = OS.gtk_tree_path_get_indices (data);
+            if (indices !is null) {
+                treeSelection [length_] = indices [0];
+                length_++;
+            }
+        }
+        OS.g_list_free (list);
+        TableItem [] result = new TableItem [length_];
+        for (int i=0; i<result.length; i++) result [i] = _getItem (treeSelection [i]);
+        return result;
+    }
+    return null;
+}
+
+/**
+ * Returns the number of selected items contained in the receiver.
+ *
+ * @return the number of selected items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSelectionCount () {
+    checkWidget();
+    auto selection = OS.gtk_tree_view_get_selection (handle);
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 2, 0)) {
+        display.treeSelectionLength = 0;
+        display.treeSelection = null;
+        display.doTreeSelectionProcConnect( &treeSelectionCallbackData, handle, selection );
+        return display.treeSelectionLength;
+    }
+    return OS.gtk_tree_selection_count_selected_rows (selection);
+}
+
+/**
+ * Returns the zero-relative index of the item which is currently
+ * selected in the receiver, or -1 if no item is selected.
+ *
+ * @return the index of the selected item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSelectionIndex () {
+    checkWidget();
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 2, 0)) {
+        display.treeSelectionLength  = 0;
+        display.treeSelection = new int [itemCount];
+        auto selection = OS.gtk_tree_view_get_selection (handle);
+        display.doTreeSelectionProcConnect( &treeSelectionCallbackData, handle, selection );
+        if (display.treeSelectionLength is 0) return -1;
+        return display.treeSelection [0];
+    }
+    auto selection = OS.gtk_tree_view_get_selection (handle);
+    /*
+    * Bug in GTK.  gtk_tree_selection_get_selected_rows() segmentation faults
+    * in versions smaller than 2.2.4 if the model is NULL.  The fix is
+    * to give a valid pointer instead.
+    */
+    int dummy;
+    void* model = OS.GTK_VERSION < OS.buildVERSION (2, 2, 4) ? &dummy : null;
+    auto list = OS.gtk_tree_selection_get_selected_rows (selection, &model);
+    if (list !is null) {
+        int count = OS.g_list_length (list);
+        int index;
+        for (int i=0; i<count; i++) {
+            auto data = OS.g_list_nth_data (list, i);
+            auto indices = OS.gtk_tree_path_get_indices (data);
+            if (indices !is null) {
+                index = indices[0];
+                break;
+            }
+        }
+        OS.g_list_free (list);
+        return index;
+    }
+    return -1;
+}
+
+/**
+ * Returns the zero-relative indices of the items which are currently
+ * selected in the receiver. The order of the indices is unspecified.
+ * The array is empty if no items are selected.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its selection, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ * @return the array of indices of the selected items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int [] getSelectionIndices () {
+    checkWidget();
+    auto selection = OS.gtk_tree_view_get_selection (handle);
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 2, 0)) {
+        display.treeSelectionLength  = 0;
+        display.treeSelection = new int [itemCount];
+        display.doTreeSelectionProcConnect( &treeSelectionCallbackData, handle, selection );
+        if (display.treeSelectionLength is display.treeSelection.length) return display.treeSelection;
+        int [] result = new int [display.treeSelectionLength];
+        System.arraycopy (display.treeSelection, 0, result, 0, display.treeSelectionLength);
+        return result;
+    }
+    /*
+    * Bug in GTK.  gtk_tree_selection_get_selected_rows() segmentation faults
+    * in versions smaller than 2.2.4 if the model is NULL.  The fix is
+    * to give a valid pointer instead.
+    */
+    int dummy;
+    void* model = OS.GTK_VERSION < OS.buildVERSION (2, 2, 4) ? &dummy : null;
+    auto list = OS.gtk_tree_selection_get_selected_rows (selection, &model);
+    if (list !is null) {
+        int count = OS.g_list_length (list);
+        int [] treeSelection = new int [count];
+        int length_ = 0;
+        for (int i=0; i<count; i++) {
+            auto data = OS.g_list_nth_data (list, i);
+            auto indices = OS.gtk_tree_path_get_indices (data);
+            if (indices !is null) {
+                treeSelection [length_] = indices [0];
+                length_++;
+            }
+        }
+        OS.g_list_free (list);
+        int [] result = new int [length_];
+        System.arraycopy (treeSelection, 0, result, 0, length_);
+        return result;
+    }
+    return null;
+}
+
+/**
+ * Returns the column which shows the sort indicator for
+ * the receiver. The value may be null if no column shows
+ * the sort indicator.
+ *
+ * @return the sort indicator
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setSortColumn(TableColumn)
+ *
+ * @since 3.2
+ */
+public TableColumn getSortColumn () {
+    checkWidget ();
+    return sortColumn;
+}
+
+/**
+ * Returns the direction of the sort indicator for the receiver.
+ * The value will be one of <code>UP</code>, <code>DOWN</code>
+ * or <code>NONE</code>.
+ *
+ * @return the sort direction
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setSortDirectioncast(int)
+ *
+ * @since 3.2
+ */
+public int getSortDirection () {
+    checkWidget ();
+    return sortDirection;
+}
+
+GtkCellRendererText* getTextRenderer (GtkTreeViewColumn* column) {
+    auto list = OS.gtk_tree_view_column_get_cell_renderers (column);
+    if (list is null) return null;
+    int count = OS.g_list_length (list);
+    GtkCellRendererText* textRenderer;
+    int i = 0;
+    while (i < count) {
+        auto renderer = OS.g_list_nth_data (list, i);
+         if (OS.GTK_IS_CELL_RENDERER_TEXT (cast(GTypeInstance*)renderer)) {
+            textRenderer = cast(GtkCellRendererText*)renderer;
+            break;
+        }
+        i++;
+    }
+    OS.g_list_free (list);
+    return textRenderer;
+}
+
+/**
+ * Returns the zero-relative index of the item which is currently
+ * at the top of the receiver. This index can change when items are
+ * scrolled or new items are added or removed.
+ *
+ * @return the index of the top item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getTopIndex () {
+    checkWidget();
+    void* path;
+    OS.gtk_widget_realize (handle);
+    if (!OS.gtk_tree_view_get_path_at_pos (handle, 1, 1, &path, null, null, null)) return 0;
+    if (path is null) return 0;
+    auto indices = OS.gtk_tree_path_get_indices (path);
+    int index;
+    if (indices !is null) index = indices[0];
+    OS.gtk_tree_path_free (path);
+    return index;
+}
+
+override int gtk_button_press_event (GtkWidget* widget, GdkEventButton* gdkEvent) {
+    if (gdkEvent.window !is OS.gtk_tree_view_get_bin_window (handle)) return 0;
+    auto result = super.gtk_button_press_event (widget, gdkEvent);
+    if (result !is 0) return result;
+    /*
+    * Feature in GTK.  In a multi-select table view, when multiple items are already
+    * selected, the selection state of the item is toggled and the previous selection
+    * is cleared. This is not the desired behaviour when bringing up a popup menu.
+    * Also, when an item is reselected with the right button, the tree view issues
+    * an unwanted selection event. The workaround is to detect that case and not
+    * run the default handler when the item is already part of the current selection.
+    */
+    int button = gdkEvent.button;
+    if (button is 3 && gdkEvent.type is OS.GDK_BUTTON_PRESS) {
+        void* path;
+        if (OS.gtk_tree_view_get_path_at_pos (handle, cast(int)gdkEvent.x, cast(int)gdkEvent.y, &path, null, null, null)) {
+            if (path !is null) {
+                auto selection = OS.gtk_tree_view_get_selection (handle);
+                if (OS.gtk_tree_selection_path_is_selected (selection, path)) result = 1;
+                OS.gtk_tree_path_free (path);
+            }
+        }
+    }
+
+    /*
+    * Feature in GTK.  When the user clicks in a single selection GtkTreeView
+    * and there are no selected items, the first item is selected automatically
+    * before the click is processed, causing two selection events.  The is fix
+    * is the set the cursor item to be same as the clicked item to stop the
+    * widget from automatically selecting the first item.
+    */
+    if ((style & SWT.SINGLE) !is 0 && getSelectionCount () is 0) {
+        void* path;
+        if (OS.gtk_tree_view_get_path_at_pos (handle, cast(int)gdkEvent.x, cast(int)gdkEvent.y, &path, null, null, null)) {
+            if (path !is null) {
+                auto selection = OS.gtk_tree_view_get_selection (handle);
+                OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+                OS.gtk_tree_view_set_cursor (handle, path, null, false);
+                OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+                OS.gtk_tree_path_free (path);
+            }
+        }
+    }
+    /*
+    * Bug in GTK. GTK segments fault, if the GtkTreeView widget is
+    * not in focus and all items in the widget are disposed before
+    * it finishes processing a button press.  The fix is to give
+    * focus to the widget before it starts processing the event.
+    */
+    if (!OS.GTK_WIDGET_HAS_FOCUS (handle)) {
+        OS.gtk_widget_grab_focus (handle);
+    }
+    return result;
+}
+
+override int gtk_button_release_event (GtkWidget* widget, GdkEventButton* event) {
+    auto window = OS.GDK_EVENT_WINDOW (event);
+    if (window !is OS.gtk_tree_view_get_bin_window (handle)) return 0;
+    return super.gtk_button_release_event (widget, event);
+}
+
+override int gtk_changed (GtkWidget* widget) {
+    TableItem item = getFocusItem ();
+    if (item !is null) {
+        Event event = new Event ();
+        event.item = item;
+        postEvent (SWT.Selection, event);
+    }
+    return 0;
+}
+
+override int gtk_key_press_event (GtkWidget* widget, GdkEventKey* keyEvent) {
+    auto result = super.gtk_key_press_event (widget, keyEvent);
+    if (result !is 0) return result;
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 2 ,0)) {
+        /*
+        * Feature in GTK 2.0.x.  When an item is default selected using
+        * the return key, GTK does not issue notification. The fix is
+        * to issue this notification when the return key is pressed.
+        */
+        int key = keyEvent.keyval;
+        switch (key) {
+            case OS.GDK_Return:
+            case OS.GDK_KP_Enter: {
+                Event event = new Event ();
+                event.item = getFocusItem ();
+                postEvent (SWT.DefaultSelection, event);
+                break;
+            }
+            default:
+        }
+    }
+    return result;
+}
+
+override int gtk_popup_menu (GtkWidget* widget) {
+    auto result = super.gtk_popup_menu (widget);
+    /*
+    * Bug in GTK.  The context menu for the typeahead in GtkTreeViewer
+    * opens in the bottom right corner of the screen when Shift+F10
+    * is pressed and the typeahead window was not visible.  The fix is
+    * to prevent the context menu from opening by stopping the default
+    * handler.
+    *
+    * NOTE: The bug only happens in GTK 2.6.5 and lower.
+    */
+    return OS.GTK_VERSION < OS.buildVERSION (2, 6, 5) ? 1 : result;
+}
+
+override int gtk_motion_notify_event (GtkWidget* widget, GdkEventMotion* event) {
+    auto window = OS.GDK_EVENT_WINDOW (event);
+    if (window !is OS.gtk_tree_view_get_bin_window (handle)) return 0;
+    return super.gtk_motion_notify_event (widget, event);
+}
+
+override void gtk_row_activated (GtkTreeView* tree, GtkTreePath* path, GtkTreeViewColumn* column) {
+    TableItem item = null;
+    auto indices = OS.gtk_tree_path_get_indices (path);
+    if (indices !is null) {
+        item = _getItem (indices [0]);
+    }
+    Event event = new Event ();
+    event.item = item;
+    postEvent (SWT.DefaultSelection, event);
+}
+
+override int gtk_toggled (int /*long*/ renderer, char* pathStr) {
+    auto path = OS.gtk_tree_path_new_from_string (pathStr);
+    if (path is null) return 0;
+    auto indices = OS.gtk_tree_path_get_indices (path);
+    if (indices !is null) {
+        TableItem item = _getItem (indices [0]);
+        item.setChecked (!item.getChecked ());
+        Event event = new Event ();
+        event.detail = SWT.CHECK;
+        event.item = item;
+        postEvent (SWT.Selection, event);
+    }
+    OS.gtk_tree_path_free (path);
+    return 0;
+}
+
+override void gtk_widget_size_request (GtkWidget* widget, GtkRequisition* requisition) {
+    /*
+     * Bug in GTK.  For some reason, gtk_widget_size_request() fails
+     * to include the height of the tree view items when there are
+     * no columns visible.  The fix is to temporarily make one column
+     * visible.
+     */
+    if (columnCount is 0) {
+        super.gtk_widget_size_request (widget, requisition);
+        return;
+    }
+    auto columns = OS.gtk_tree_view_get_columns (handle), list = columns;
+    bool fixVisible = columns !is null;
+    while (list !is null) {
+        auto column = OS.g_list_data (list);
+        if (OS.gtk_tree_view_column_get_visible (column)) {
+            fixVisible = false;
+            break;
+        }
+        list = OS.g_list_next (list);
+    }
+    void* columnHandle;
+    if (fixVisible) {
+        columnHandle = OS.g_list_data (columns);
+        OS.gtk_tree_view_column_set_visible (columnHandle, true);
+    }
+    super.gtk_widget_size_request (widget, requisition);
+    if (fixVisible) {
+        OS.gtk_tree_view_column_set_visible (columnHandle, false);
+    }
+    if (columns !is null) OS.g_list_free (columns);
+}
+
+void hideFirstColumn () {
+    auto firstColumn = OS.gtk_tree_view_get_column (handle, 0);
+    OS.gtk_tree_view_column_set_visible (firstColumn, false);
+}
+
+override void hookEvents () {
+    super.hookEvents ();
+    auto selection = OS.gtk_tree_view_get_selection(handle);
+    OS.g_signal_connect_closure (selection, OS.changed.ptr, display.closures [CHANGED], false);
+    OS.g_signal_connect_closure (handle, OS.row_activated.ptr, display.closures [ROW_ACTIVATED], false);
+    if (checkRenderer !is null) {
+        OS.g_signal_connect_closure (checkRenderer, OS.toggled.ptr, display.closures [TOGGLED], false);
+    }
+}
+
+/**
+ * Searches the receiver's list starting at the first column
+ * (index 0) until a column is found that is equal to the
+ * argument, and returns the index of that column. If no column
+ * is found, returns -1.
+ *
+ * @param column the search column
+ * @return the index of the column
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the column is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int indexOf (TableColumn column) {
+    checkWidget();
+    if (column is null) error (SWT.ERROR_NULL_ARGUMENT);
+    for (int i=0; i<columnCount; i++) {
+        if (columns [i] is column) return i;
+    }
+    return -1;
+}
+
+/**
+ * Searches the receiver's list starting at the first item
+ * (index 0) until an item is found that is equal to the
+ * argument, and returns the index of that item. If no item
+ * is found, returns -1.
+ *
+ * @param item the search item
+ * @return the index of the item
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int indexOf (TableItem item) {
+    checkWidget();
+    if (item is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (1 <= lastIndexOf && lastIndexOf < itemCount - 1) {
+        if (items [lastIndexOf] is item) return lastIndexOf;
+        if (items [lastIndexOf + 1] is item) return ++lastIndexOf;
+        if (items [lastIndexOf - 1] is item) return --lastIndexOf;
+    }
+    if (lastIndexOf < itemCount / 2) {
+        for (int i=0; i<itemCount; i++) {
+            if (items [i] is item) return lastIndexOf = i;
+        }
+    } else {
+        for (int i=itemCount - 1; i>=0; --i) {
+            if (items [i] is item) return lastIndexOf = i;
+        }
+    }
+    return -1;
+}
+
+/**
+ * Returns <code>true</code> if the item is selected,
+ * and <code>false</code> otherwise.  Indices out of
+ * range are ignored.
+ *
+ * @param index the index of the item
+ * @return the selection state of the item at the index
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool isSelected (int index) {
+    checkWidget();
+    auto selection = OS.gtk_tree_view_get_selection (handle);
+    char* buffer = toStringz( to!(String)(index));
+    auto path = OS.gtk_tree_path_new_from_string (buffer);
+    bool answer = cast(bool)OS.gtk_tree_selection_path_is_selected (selection, path);
+    OS.gtk_tree_path_free (path);
+    return answer;
+}
+
+override bool mnemonicHit (wchar key) {
+    for (int i=0; i<columnCount; i++) {
+        auto labelHandle = columns [i].labelHandle;
+        if (labelHandle !is null && mnemonicHit (labelHandle, key)) return true;
+    }
+    return false;
+}
+
+override bool mnemonicMatch (wchar key) {
+    for (int i=0; i<columnCount; i++) {
+        auto labelHandle = columns [i].labelHandle;
+        if (labelHandle !is null && mnemonicMatch (labelHandle, key)) return true;
+    }
+    return false;
+}
+
+override GdkDrawable* paintWindow () {
+    OS.gtk_widget_realize (handle);
+    return OS.gtk_tree_view_get_bin_window (handle);
+}
+
+void recreateRenderers () {
+    if (checkRenderer !is null) {
+        display.removeWidget (checkRenderer);
+        OS.g_object_unref (checkRenderer);
+        checkRenderer = ownerDraw ? cast(GtkWidget*)OS.g_object_new (display.gtk_cell_renderer_toggle_get_type(), null) : cast(GtkWidget*)OS.gtk_cell_renderer_toggle_new ();
+        if (checkRenderer is null) error (SWT.ERROR_NO_HANDLES);
+        OS.g_object_ref (checkRenderer);
+        display.addWidget (checkRenderer, this);
+        OS.g_signal_connect_closure (checkRenderer, OS.toggled.ptr, display.closures [TOGGLED], false);
+    }
+    if (columnCount is 0) {
+        createRenderers (OS.gtk_tree_view_get_column (handle, 0), Table.FIRST_COLUMN, true, 0);
+    } else {
+        for (int i = 0; i < columnCount; i++) {
+            TableColumn column = columns [i];
+            createRenderers (cast(GtkTreeViewColumn*)column.handle, column.modelIndex, i is 0, column.style);
+        }
+    }
+}
+
+override void redrawBackgroundImage () {
+    Control control = findBackgroundControl ();
+    if (control !is null && control.backgroundImage !is null) {
+        redrawWidget (0, 0, 0, 0, true, false, false);
+    }
+}
+
+override void register () {
+    super.register ();
+    display.addWidget ( cast(GtkWidget*)OS.gtk_tree_view_get_selection (handle), this);
+    if (checkRenderer !is null) display.addWidget (checkRenderer, this);
+}
+
+override void releaseChildren (bool destroy) {
+    if (items !is null) {
+        for (int i=0; i<itemCount; i++) {
+            TableItem item = items [i];
+            if (item !is null && !item.isDisposed ()) {
+                item.release (false);
+            }
+        }
+        items = null;
+    }
+    if (columns !is null) {
+        for (int i=0; i<columnCount; i++) {
+            TableColumn column = columns [i];
+            if (column !is null && !column.isDisposed ()) {
+                column.release (false);
+            }
+        }
+        columns = null;
+    }
+    super.releaseChildren (destroy);
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    if (modelHandle !is null) OS.g_object_unref (modelHandle);
+    modelHandle = null;
+    if (checkRenderer !is null) OS.g_object_unref (checkRenderer);
+    checkRenderer = null;
+    if (imageList !is null) imageList.dispose ();
+    if (headerImageList !is null) headerImageList.dispose ();
+    imageList = headerImageList = null;
+    currentItem = null;
+}
+
+/**
+ * Removes the item from the receiver at the given
+ * zero-relative index.
+ *
+ * @param index the index for the item
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void remove (int index) {
+    checkWidget();
+    if (!(0 <= index && index < itemCount)) error (SWT.ERROR_ITEM_NOT_REMOVED);
+    GtkTreeIter iter;
+    TableItem item = items [index];
+    bool disposed = false;
+    if (item !is null) {
+        disposed = item.isDisposed ();
+        if (!disposed) {
+            iter = *cast(GtkTreeIter*)item.handle;
+            item.release (false);
+        }
+    } else {
+        OS.gtk_tree_model_iter_nth_child (modelHandle, &iter, null, index);
+    }
+    if (!disposed) {
+        auto selection = OS.gtk_tree_view_get_selection (handle);
+        OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+        OS.gtk_list_store_remove (modelHandle, &iter);
+        OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+        System.arraycopy (items, index + 1, items, index, --itemCount - index);
+        items [itemCount] = null;
+    }
+}
+
+/**
+ * Removes the items from the receiver which are
+ * between the given zero-relative start and end
+ * indices (inclusive).
+ *
+ * @param start the start of the range
+ * @param end the end of the range
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if either the start or end are not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void remove (int start, int end) {
+    checkWidget();
+    if (start > end) return;
+    if (!(0 <= start && start <= end && end < itemCount)) {
+        error (SWT.ERROR_INVALID_RANGE);
+    }
+    auto selection = OS.gtk_tree_view_get_selection (handle);
+    GtkTreeIter iter;
+    OS.gtk_tree_model_iter_nth_child (modelHandle, &iter, null, start);
+    int index = start;
+    while (index <= end) {
+        TableItem item = items [index];
+        if (item !is null && !item.isDisposed ()) item.release (false);
+        OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+        OS.gtk_list_store_remove (modelHandle, &iter);
+        OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+        index++;
+    }
+    System.arraycopy (items, index, items, start, itemCount - index);
+    for (int i=itemCount-(index-start); i<itemCount; i++) items [i] = null;
+    itemCount = itemCount - (index - start);
+}
+
+/**
+ * Removes the items from the receiver's list at the given
+ * zero-relative indices.
+ *
+ * @param indices the array of indices of the items
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void remove (int [] indices) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (indices is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (indices.length is 0) return;
+    int [] newIndices = new int [indices.length];
+    System.arraycopy (indices, 0, newIndices, 0, indices.length);
+    sort (newIndices);
+    int start = newIndices [newIndices.length - 1], end = newIndices [0];
+    if (!(0 <= start && start <= end && end < itemCount)) {
+        error (SWT.ERROR_INVALID_RANGE);
+    }
+    auto selection = OS.gtk_tree_view_get_selection (handle);
+    int last = -1;
+    GtkTreeIter iter;
+    for (int i=0; i<newIndices.length; i++) {
+        int index = newIndices [i];
+        if (index !is last) {
+            TableItem item = items [index];
+            bool disposed = false;
+            if (item !is null) {
+                disposed = item.isDisposed ();
+                if (!disposed) {
+                    iter = *cast(GtkTreeIter*) item.handle;
+                    item.release (false);
+                }
+            } else {
+                OS.gtk_tree_model_iter_nth_child (modelHandle, &iter, null, index);
+            }
+            if (!disposed) {
+                OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+                OS.gtk_list_store_remove (modelHandle, &iter);
+                OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+                System.arraycopy (items, index + 1, items, index, --itemCount - index);
+                items [itemCount] = null;
+            }
+            last = index;
+        }
+    }
+}
+
+/**
+ * Removes all of the items from the receiver.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void removeAll () {
+    checkWidget();
+    int index = itemCount - 1;
+    while (index >= 0) {
+        TableItem item = items [index];
+        if (item !is null && !item.isDisposed ()) item.release (false);
+        --index;
+    }
+    items = new TableItem [4];
+    itemCount = 0;
+    auto selection = OS.gtk_tree_view_get_selection (handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    OS.gtk_list_store_clear (modelHandle);
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+
+    resetCustomDraw ();
+    /* Disable searching when using VIRTUAL */
+    if ((style & SWT.VIRTUAL) !is 0) {
+        /*
+        * Bug in GTK. Until GTK 2.6.5, calling gtk_tree_view_set_enable_search(FALSE)
+        * would prevent the user from being able to type in text to search the tree.
+        * After 2.6.5, GTK introduced Ctrl+F as being the key binding for interactive
+        * search. This meant that even if FALSE was passed to enable_search, the user
+        * can still bring up the search pop up using the keybinding. GTK also introduced
+        * the notion of passing a -1 to gtk_set_search_column to disable searching
+        * (including the search key binding).  The fix is to use the right calls
+        * for the right version.
+        */
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 6, 5)){
+            OS.gtk_tree_view_set_search_column (handle, -1);
+        } else {
+            OS.gtk_tree_view_set_enable_search (handle, false);
+        }
+    } else {
+        /* Set the search column whenever the model changes */
+        int firstColumn = columnCount is 0 ? FIRST_COLUMN : columns [0].modelIndex;
+        OS.gtk_tree_view_set_search_column (handle, firstColumn + CELL_TEXT);
+    }
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the user changes the receiver's selection.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener(SelectionListener)
+ */
+public void removeSelectionListener(SelectionListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Selection, listener);
+    eventTable.unhook (SWT.DefaultSelection,listener);
+}
+
+override void rendererGetSizeProc (
+    GtkCellRenderer      *cell,
+    GtkWidget            *widget,
+    GdkRectangle         *cell_area,
+    int                  *x_offset,
+    int                  *y_offset,
+    int                  *width,
+    int                  *height)
+{
+    auto g_class = OS.g_type_class_peek_parent (OS.G_OBJECT_GET_CLASS (cell));
+    GtkCellRendererClass* klass = cast(GtkCellRendererClass*)g_class;
+    klass.get_size( cell, handle, cell_area, x_offset, y_offset, width, height);
+    if (!ignoreSize && OS.GTK_IS_CELL_RENDERER_TEXT (cell)) {
+        auto iter = OS.g_object_get_qdata (cast(GObject*)cell, Display.SWT_OBJECT_INDEX2);
+        TableItem item = null;
+        if (iter !is null) {
+            auto path = OS.gtk_tree_model_get_path (modelHandle, iter);
+            auto buffer = OS.gtk_tree_path_get_indices (path);
+            int index = buffer [0];
+            item = _getItem (index);
+            OS.gtk_tree_path_free (path);
+        }
+        if (item !is null) {
+            int columnIndex = 0;
+            if (columnCount > 0) {
+                auto columnHandle = OS.g_object_get_qdata (cast(GObject*)cell, Display.SWT_OBJECT_INDEX1);
+                for (int i = 0; i < columnCount; i++) {
+                    if (columns [i].handle is columnHandle) {
+                        columnIndex = i;
+                        break;
+                    }
+                }
+            }
+            if (hooks (SWT.MeasureItem)) {
+                int contentWidth, contentHeight;
+                if (width !is null) contentWidth = *width;
+                if (height !is null) contentHeight = *height;
+                Image image = item.getImage (columnIndex);
+                int imageWidth = 0;
+                if (image !is null) {
+                    Rectangle bounds = image.getBounds ();
+                    imageWidth = bounds.width;
+                }
+                contentWidth += imageWidth;
+                GC gc = new GC (this);
+                gc.setFont (item.getFont (columnIndex));
+                Event event = new Event ();
+                event.item = item;
+                event.index = columnIndex;
+                event.gc = gc;
+                event.width = contentWidth;
+                event.height = contentHeight;
+                sendEvent (SWT.MeasureItem, event);
+                gc.dispose ();
+                contentWidth = event.width - imageWidth;
+                if (contentHeight < event.height) contentHeight = event.height;
+                if (width !is null) *width = contentWidth;
+                if (height !is null) *height = contentHeight;
+            }
+        }
+    }
+}
+
+override void rendererRenderProc (
+    GtkCellRenderer * cell,
+    GdkDrawable * window,
+    GtkWidget * widget,
+    GdkRectangle *background_area,
+    GdkRectangle *cell_area,
+    GdkRectangle *expose_area,
+    int flags)
+{
+    TableItem item = null;
+    auto iter = OS.g_object_get_qdata (cast(GObject*)cell, Display.SWT_OBJECT_INDEX2);
+    if (iter !is null) {
+        auto path = OS.gtk_tree_model_get_path (modelHandle, iter);
+        auto buffer = OS.gtk_tree_path_get_indices (path);
+        int index = buffer [0];
+        item = _getItem (index);
+        OS.gtk_tree_path_free (path);
+    }
+    auto columnHandle = OS.g_object_get_qdata (cast(GObject*)cell, Display.SWT_OBJECT_INDEX1);
+    int columnIndex = 0;
+    if (columnCount > 0) {
+        for (int i = 0; i < columnCount; i++) {
+            if (columns [i].handle is columnHandle) {
+                columnIndex = i;
+                break;
+            }
+        }
+    }
+    if (item !is null) {
+        if (OS.GTK_IS_CELL_RENDERER_TOGGLE (cell) || (OS.GTK_IS_CELL_RENDERER_PIXBUF (cell) && (columnIndex !is 0 || (style & SWT.CHECK) is 0))) {
+            drawFlags = cast(int)/*64*/flags;
+            drawState = SWT.FOREGROUND;
+            void* ptr;
+            OS.gtk_tree_model_get1 (modelHandle, item.handle, Table.BACKGROUND_COLUMN, &ptr);
+            if (ptr is null) {
+                int modelIndex = columnCount is 0 ? Table.FIRST_COLUMN : columns [columnIndex].modelIndex;
+                OS.gtk_tree_model_get1 (modelHandle, item.handle, modelIndex + Table.CELL_BACKGROUND, &ptr);
+            }
+            if (ptr !is null) drawState |= SWT.BACKGROUND;
+            if ((flags & OS.GTK_CELL_RENDERER_SELECTED) !is 0) drawState |= SWT.SELECTED;
+            if ((flags & OS.GTK_CELL_RENDERER_FOCUSED) !is 0) drawState |= SWT.FOCUSED;
+
+            GdkRectangle rect;
+            auto path = OS.gtk_tree_model_get_path (modelHandle, iter);
+            OS.gtk_tree_view_get_background_area (handle, path, columnHandle, &rect);
+            OS.gtk_tree_path_free (path);
+
+            if ((drawState & SWT.SELECTED) is 0) {
+                Control control = findBackgroundControl ();
+                if (control !is null && control.backgroundImage !is null) {
+                    OS.gdk_window_clear_area (window, rect.x, rect.y, rect.width, rect.height);
+                }
+            }
+
+            if (hooks (SWT.EraseItem)) {
+                bool wasSelected = false;
+                if ((drawState & SWT.SELECTED) !is 0) {
+                    wasSelected = true;
+                    OS.gdk_window_clear_area (window, rect.x, rect.y, rect.width, rect.height);
+                }
+                GC gc = new GC (this);
+                if ((drawState & SWT.SELECTED) !is 0) {
+                    gc.setBackground (display.getSystemColor (SWT.COLOR_LIST_SELECTION));
+                    gc.setForeground (display.getSystemColor (SWT.COLOR_LIST_SELECTION_TEXT));
+                } else {
+                    gc.setBackground (item.getBackground (columnIndex));
+                    gc.setForeground (item.getForeground (columnIndex));
+                }
+                gc.setFont (item.getFont (columnIndex));
+                if ((style & SWT.MIRRORED) !is 0) rect.x = getClientWidth () - rect.width - rect.x;
+                gc.setClipping (rect.x, rect.y, rect.width, rect.height);
+                Event event = new Event ();
+                event.item = item;
+                event.index = columnIndex;
+                event.gc = gc;
+                event.x = rect.x;
+                event.y = rect.y;
+                event.width = rect.width;
+                event.height = rect.height;
+                event.detail = drawState;
+                sendEvent (SWT.EraseItem, event);
+                drawForeground = null;
+                drawState = event.doit ? event.detail : 0;
+                drawFlags &= ~(OS.GTK_CELL_RENDERER_FOCUSED | OS.GTK_CELL_RENDERER_SELECTED);
+                if ((drawState & SWT.SELECTED) !is 0) drawFlags |= OS.GTK_CELL_RENDERER_SELECTED;
+                if ((drawState & SWT.FOCUSED) !is 0) drawFlags |= OS.GTK_CELL_RENDERER_FOCUSED;
+                if ((drawState & SWT.SELECTED) !is 0) {
+                    auto style = OS.gtk_widget_get_style (widget);
+                    //TODO - parity and sorted
+                    OS.gtk_paint_flat_box (style, window, OS.GTK_STATE_SELECTED, OS.GTK_SHADOW_NONE, &rect, widget, "cell_odd".ptr, rect.x, rect.y, rect.width, rect.height);
+                } else {
+                    if (wasSelected) drawForeground = gc.getForeground ().handle;
+                }
+                gc.dispose();
+            }
+        }
+    }
+    int /*long*/ result = 0;
+    if ((drawState & SWT.BACKGROUND) !is 0 && (drawState & SWT.SELECTED) is 0) {
+        GC gc = new GC (this);
+        gc.setBackground (item.getBackground (columnIndex));
+        gc.fillRectangle (background_area.x, background_area.y, background_area.width, background_area.height);
+        gc.dispose ();
+    }
+    if ((drawState & SWT.FOREGROUND) !is 0 || OS.GTK_IS_CELL_RENDERER_TOGGLE (cell)) {
+        auto g_class = OS.g_type_class_peek_parent (OS.G_OBJECT_GET_CLASS (cell));
+        GtkCellRendererClass* klass = cast(GtkCellRendererClass*)g_class;
+        if (drawForeground !is null && OS.GTK_IS_CELL_RENDERER_TEXT (cell)) {
+            OS.g_object_set1 (cell, OS.foreground_gdk.ptr, cast(int)drawForeground);
+        }
+        klass.render( cell, window, widget, background_area, cell_area, expose_area, drawFlags);
+    }
+    if (item !is null) {
+        if (OS.GTK_IS_CELL_RENDERER_TEXT (cell)) {
+            if (hooks (SWT.PaintItem)) {
+                GdkRectangle rect;
+                auto path = OS.gtk_tree_model_get_path (modelHandle, iter);
+                OS.gtk_tree_view_get_background_area (handle, path, columnHandle, &rect);
+                OS.gtk_tree_path_free (path);
+                ignoreSize = true;
+                int contentX, contentWidth;
+                OS.gtk_cell_renderer_get_size (cell, handle, null, null, null, &contentWidth, null);
+                OS.gtk_tree_view_column_cell_get_position (columnHandle, cell, &contentX, null);
+                ignoreSize = false;
+                Image image = item.getImage (columnIndex);
+                int imageWidth = 0;
+                if (image !is null) {
+                    Rectangle bounds = image.getBounds ();
+                    imageWidth = bounds.width;
+                }
+                contentX -= imageWidth;
+                contentWidth += imageWidth;
+                GC gc = new GC (this);
+                if ((drawState & SWT.SELECTED) !is 0) {
+                    gc.setBackground (display.getSystemColor (SWT.COLOR_LIST_SELECTION));
+                    gc.setForeground (display.getSystemColor (SWT.COLOR_LIST_SELECTION_TEXT));
+                } else {
+                    gc.setBackground (item.getBackground (columnIndex));
+                    Color foreground = drawForeground !is null ? Color.gtk_new (display, drawForeground) : item.getForeground (columnIndex);
+                    gc.setForeground (foreground);
+                }
+                gc.setFont (item.getFont (columnIndex));
+                if ((style & SWT.MIRRORED) !is 0) rect.x = getClientWidth () - rect.width - rect.x;
+                gc.setClipping (rect.x, rect.y, rect.width, rect.height);
+                Event event = new Event ();
+                event.item = item;
+                event.index = columnIndex;
+                event.gc = gc;
+                event.x = rect.x + contentX;
+                event.y = rect.y;
+                event.width = contentWidth;
+                event.height = rect.height;
+                event.detail = drawState;
+                sendEvent (SWT.PaintItem, event);
+                gc.dispose();
+            }
+        }
+    }
+}
+
+void resetCustomDraw () {
+    if ((style & SWT.VIRTUAL) !is 0 || ownerDraw) return;
+    int end = Math.max (1, columnCount);
+    for (int i=0; i<end; i++) {
+        bool customDraw = columnCount !is 0 ? columns [i].customDraw : firstCustomDraw;
+        if (customDraw) {
+            auto column = OS.gtk_tree_view_get_column (handle, i);
+            auto textRenderer = getTextRenderer (column);
+            display.doCellDataProc( null, cast(GtkTreeViewColumn*)column, cast(GtkCellRenderer*)textRenderer );
+            if (columnCount !is 0) columns [i].customDraw = false;
+        }
+    }
+    firstCustomDraw = false;
+}
+
+/**
+ * Selects the item at the given zero-relative index in the receiver.
+ * If the item at the index was already selected, it remains
+ * selected. Indices that are out of range are ignored.
+ *
+ * @param index the index of the item to select
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void select (int index) {
+    checkWidget();
+    if (!(0 <= index && index < itemCount))  return;
+    bool fixColumn = showFirstColumn ();
+    auto selection = OS.gtk_tree_view_get_selection (handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    TableItem item = _getItem (index);
+    OS.gtk_tree_selection_select_iter (selection, item.handle);
+    if ((style & SWT.SINGLE) !is 0) {
+        auto path = OS.gtk_tree_model_get_path (modelHandle, item.handle);
+        OS.gtk_tree_view_set_cursor (handle, path, null, false);
+        OS.gtk_tree_path_free (path);
+    }
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    if (fixColumn) hideFirstColumn ();
+}
+
+/**
+ * Selects the items in the range specified by the given zero-relative
+ * indices in the receiver. The range of indices is inclusive.
+ * The current selection is not cleared before the new items are selected.
+ * <p>
+ * If an item in the given range is not selected, it is selected.
+ * If an item in the given range was already selected, it remains selected.
+ * Indices that are out of range are ignored and no items will be selected
+ * if start is greater than end.
+ * If the receiver is single-select and there is more than one item in the
+ * given range, then all indices are ignored.
+ * </p>
+ *
+ * @param start the start of the range
+ * @param end the end of the range
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Table#setSelection(int,int)
+ */
+public void select (int start, int end) {
+    checkWidget ();
+    if (end < 0 || start > end || ((style & SWT.SINGLE) !is 0 && start !is end)) return;
+    if (itemCount is 0 || start >= itemCount) return;
+    start = Math.max (0, start);
+    end = Math.min (end, itemCount - 1);
+    bool fixColumn = showFirstColumn ();
+    auto selection = OS.gtk_tree_view_get_selection (handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    for (int index=start; index<=end; index++) {
+        TableItem item = _getItem (index);
+        OS.gtk_tree_selection_select_iter (selection, item.handle);
+        if ((style & SWT.SINGLE) !is 0) {
+            auto path = OS.gtk_tree_model_get_path (modelHandle, item.handle);
+            OS.gtk_tree_view_set_cursor (handle, path, null, false);
+            OS.gtk_tree_path_free (path);
+        }
+    }
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    if (fixColumn) hideFirstColumn ();
+}
+
+/**
+ * Selects the items at the given zero-relative indices in the receiver.
+ * The current selection is not cleared before the new items are selected.
+ * <p>
+ * If the item at a given index is not selected, it is selected.
+ * If the item at a given index was already selected, it remains selected.
+ * Indices that are out of range and duplicate indices are ignored.
+ * If the receiver is single-select and multiple indices are specified,
+ * then all indices are ignored.
+ * </p>
+ *
+ * @param indices the array of indices for the items to select
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Table#setSelection(int[])
+ */
+public void select (int [] indices) {
+    checkWidget ();
+    // SWT extension: allow null for zero length string
+    //if (indices is null) error (SWT.ERROR_NULL_ARGUMENT);
+    int length = indices.length;
+    if (length is 0 || ((style & SWT.SINGLE) !is 0 && length > 1)) return;
+    bool fixColumn = showFirstColumn ();
+    auto selection = OS.gtk_tree_view_get_selection (handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    for (int i=0; i<length; i++) {
+        int index = indices [i];
+        if (!(0 <= index && index < itemCount)) continue;
+        TableItem item = _getItem (index);
+        OS.gtk_tree_selection_select_iter (selection, item.handle);
+        if ((style & SWT.SINGLE) !is 0) {
+            auto path = OS.gtk_tree_model_get_path (modelHandle, item.handle);
+            OS.gtk_tree_view_set_cursor (handle, path, null, false);
+            OS.gtk_tree_path_free (path);
+        }
+    }
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    if (fixColumn) hideFirstColumn ();
+}
+
+/**
+ * Selects all of the items in the receiver.
+ * <p>
+ * If the receiver is single-select, do nothing.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void selectAll () {
+    checkWidget();
+    if ((style & SWT.SINGLE) !is 0) return;
+    bool fixColumn = showFirstColumn ();
+    auto selection = OS.gtk_tree_view_get_selection (handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    OS.gtk_tree_selection_select_all (selection);
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    if (fixColumn) hideFirstColumn ();
+}
+
+void selectFocusIndex (int index) {
+    /*
+    * Note that this method both selects and sets the focus to the
+    * specified index, so any previous selection in the list will be lost.
+    * gtk does not provide a way to just set focus to a specified list item.
+    */
+    if (!(0 <= index && index < itemCount))  return;
+    TableItem item = _getItem (index);
+    auto path = OS.gtk_tree_model_get_path (modelHandle, item.handle);
+    auto selection = OS.gtk_tree_view_get_selection (handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    OS.gtk_tree_view_set_cursor (handle, path, null, false);
+    /*
+    * Bug in GTK. For some reason, when an event loop is run from
+    * within a key pressed handler and a dialog is displayed that
+    * contains a GtkTreeView,  gtk_tree_view_set_cursor() does
+    * not set the cursor or select the item.  The fix is to select the
+    * item with gtk_tree_selection_select_iter() as well.
+    *
+    * NOTE: This happens in GTK 2.2.1 and is fixed in GTK 2.2.4.
+    */
+    OS.gtk_tree_selection_select_iter (selection, item.handle);
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    OS.gtk_tree_path_free (path);
+}
+
+override void setBackgroundColor (GdkColor* color) {
+    super.setBackgroundColor (color);
+    OS.gtk_widget_modify_base (handle, 0, color);
+}
+
+override void setBackgroundPixmap (GdkPixmap* pixmap) {
+    super.setBackgroundPixmap (pixmap);
+    auto window = paintWindow ();
+    if (window !is null) OS.gdk_window_set_back_pixmap (window, null, true);
+}
+
+override int setBounds (int x, int y, int width, int height, bool move, bool resize) {
+    int result = super.setBounds (x, y, width, height, move, resize);
+    /*
+    * Bug on GTK.  The tree view sometimes does not get a paint
+    * event or resizes to a one pixel square when resized in a new
+    * shell that is not visible after any event loop has been run.  The
+    * problem is intermittent. It doesn't seem to happen the first time
+    * a new shell is created. The fix is to ensure the tree view is realized
+    * after it has been resized.
+    */
+    OS.gtk_widget_realize (handle);
+    /*
+    * Bug in GTK.  An empty GtkTreeView fails to repaint the focus rectangle
+    * correctly when resized on versions before 2.6.0.  The fix is to force
+    * the widget to redraw.
+    */
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 6, 0) && itemCount is 0) redraw (false);
+    return result;
+}
+
+/**
+ * Sets the order that the items in the receiver should
+ * be displayed in to the given argument which is described
+ * in terms of the zero-relative ordering of when the items
+ * were added.
+ *
+ * @param order the new order to display the items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the item order is not the same length as the number of items</li>
+ * </ul>
+ *
+ * @see Table#getColumnOrder()
+ * @see TableColumn#getMoveable()
+ * @see TableColumn#setMoveable(bool)
+ * @see SWT#Move
+ *
+ * @since 3.1
+ */
+public void setColumnOrder (int [] order) {
+    checkWidget ();
+    // SWT extension: allow null for zero length string
+    //if (order is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (columnCount is 0) {
+        if (order.length > 0) error (SWT.ERROR_INVALID_ARGUMENT);
+        return;
+    }
+    if (order.length !is columnCount) error (SWT.ERROR_INVALID_ARGUMENT);
+    bool [] seen = new bool [columnCount];
+    for (int i = 0; i<order.length; i++) {
+        int index = order [i];
+        if (index < 0 || index >= columnCount) error (SWT.ERROR_INVALID_RANGE);
+        if (seen [index]) error (SWT.ERROR_INVALID_ARGUMENT);
+        seen [index] = true;
+    }
+    for (int i=0; i<order.length; i++) {
+        auto column = columns [order [i]].handle;
+        auto baseColumn = i is 0 ? null : columns [order [i-1]].handle;
+        OS.gtk_tree_view_move_column_after (handle, column, baseColumn);
+    }
+}
+
+override void setFontDescription (PangoFontDescription* font) {
+    super.setFontDescription (font);
+    TableColumn[] columns = getColumns ();
+    for (int i = 0; i < columns.length; i++) {
+        if (columns[i] !is null) {
+            columns[i].setFontDescription (font);
+        }
+    }
+}
+
+/**
+ * Marks the receiver's header as visible if the argument is <code>true</code>,
+ * and marks it invisible otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, marking
+ * it visible may not actually cause it to be displayed.
+ * </p>
+ *
+ * @param show the new visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setHeaderVisible (bool show) {
+    checkWidget ();
+    OS.gtk_tree_view_set_headers_visible (handle, show);
+}
+
+/**
+ * Sets the number of items contained in the receiver.
+ *
+ * @param count the number of items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setItemCount (int count) {
+    checkWidget ();
+    count = Math.max (0, count);
+    if (count is itemCount) return;
+    bool isVirtual = (style & SWT.VIRTUAL) !is 0;
+    if (!isVirtual) setRedraw (false);
+    remove (count, itemCount - 1);
+    int length = Math.max (4, (count + 3) / 4 * 4);
+    TableItem [] newItems = new TableItem [length];
+    System.arraycopy (items, 0, newItems, 0, itemCount);
+    items = newItems;
+    if (isVirtual) {
+        GtkTreeIter iter;
+        for (int i=itemCount; i<count; i++) {
+            OS.gtk_list_store_append (modelHandle, &iter);
+        }
+        itemCount = count;
+    } else {
+        for (int i=itemCount; i<count; i++) {
+            new TableItem (this, SWT.NONE, i, true);
+        }
+    }
+    if (!isVirtual) setRedraw (true);
+}
+
+/**
+ * Marks the receiver's lines as visible if the argument is <code>true</code>,
+ * and marks it invisible otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, marking
+ * it visible may not actually cause it to be displayed.
+ * </p>
+ *
+ * @param show the new visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setLinesVisible (bool show) {
+    checkWidget();
+    OS.gtk_tree_view_set_rules_hint (handle, show);
+}
+
+override void setParentBackground () {
+    super.setParentBackground ();
+    auto window = paintWindow ();
+    if (window !is null) OS.gdk_window_set_back_pixmap (window, null, true);
+}
+
+override void setParentWindow (GtkWidget* widget) {
+    auto window = eventWindow ();
+    OS.gtk_widget_set_parent_window (widget, window);
+}
+
+override public void setRedraw (bool redraw) {
+    checkWidget();
+    super.setRedraw (redraw);
+    if (redraw && drawCount is 0) {
+        /* Resize the item array to match the item count */
+        if (items.length > 4 && items.length - itemCount > 3) {
+            int length = Math.max (4, (itemCount + 3) / 4 * 4);
+            TableItem [] newItems = new TableItem [length];
+            System.arraycopy (items, 0, newItems, 0, itemCount);
+            items = newItems;
+        }
+    }
+}
+
+void setScrollWidth (GtkTreeViewColumn* column, TableItem item) {
+    if (columnCount !is 0 || currentItem is item) return;
+    /*
+    * Use GTK_TREE_VIEW_COLUMN_GROW_ONLY on GTK versions < 2.3.2
+    * because fixed_height_mode is not supported.
+    */
+    if (((style & SWT.VIRTUAL) !is 0) && OS.GTK_VERSION < OS.buildVERSION (2, 3, 2)) return;
+    int width = OS.gtk_tree_view_column_get_fixed_width (column);
+    int itemWidth = calculateWidth (column, cast(GtkTreeIter*)item.handle);
+    if (width < itemWidth) {
+        OS.gtk_tree_view_column_set_fixed_width (column, itemWidth);
+    }
+}
+
+/**
+ * Sets the column used by the sort indicator for the receiver. A null
+ * value will clear the sort indicator.  The current sort column is cleared
+ * before the new column is set.
+ *
+ * @param column the column used by the sort indicator or <code>null</code>
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the column is disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setSortColumn (TableColumn column) {
+    checkWidget ();
+    if (column !is null && column.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+    if (sortColumn !is null && !sortColumn.isDisposed()) {
+        OS.gtk_tree_view_column_set_sort_indicator (sortColumn.handle, false);
+    }
+    sortColumn = column;
+    if (sortColumn !is null && sortDirection !is SWT.NONE) {
+        OS.gtk_tree_view_column_set_sort_indicator (sortColumn.handle, true);
+        OS.gtk_tree_view_column_set_sort_order (sortColumn.handle, sortDirection is SWT.DOWN ? 0 : 1);
+    }
+}
+
+/**
+ * Sets the direction of the sort indicator for the receiver. The value
+ * can be one of <code>UP</code>, <code>DOWN</code> or <code>NONE</code>.
+ *
+ * @param direction the direction of the sort indicator
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setSortDirection  (int direction) {
+    checkWidget ();
+    if (direction !is SWT.UP && direction !is SWT.DOWN && direction !is SWT.NONE) return;
+    sortDirection = direction;
+    if (sortColumn is null || sortColumn.isDisposed ()) return;
+    if (sortDirection is SWT.NONE) {
+        OS.gtk_tree_view_column_set_sort_indicator (sortColumn.handle, false);
+    } else {
+        OS.gtk_tree_view_column_set_sort_indicator (sortColumn.handle, true);
+        OS.gtk_tree_view_column_set_sort_order (sortColumn.handle, sortDirection is SWT.DOWN ? 0 : 1);
+    }
+}
+
+/**
+ * Selects the item at the given zero-relative index in the receiver.
+ * The current selection is first cleared, then the new item is selected.
+ *
+ * @param index the index of the item to select
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Table#deselectAll()
+ * @see Table#selectcast(int)
+ */
+public void setSelection (int index) {
+    checkWidget ();
+    bool fixColumn = showFirstColumn ();
+    deselectAll ();
+    selectFocusIndex (index);
+    showSelection ();
+    if (fixColumn) hideFirstColumn ();
+}
+
+/**
+ * Selects the items in the range specified by the given zero-relative
+ * indices in the receiver. The range of indices is inclusive.
+ * The current selection is cleared before the new items are selected.
+ * <p>
+ * Indices that are out of range are ignored and no items will be selected
+ * if start is greater than end.
+ * If the receiver is single-select and there is more than one item in the
+ * given range, then all indices are ignored.
+ * </p>
+ *
+ * @param start the start index of the items to select
+ * @param end the end index of the items to select
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Table#deselectAll()
+ * @see Table#select(int,int)
+ */
+public void setSelection (int start, int end) {
+    checkWidget ();
+    deselectAll();
+    if (end < 0 || start > end || ((style & SWT.SINGLE) !is 0 && start !is end)) return;
+    if (itemCount is 0 || start >= itemCount) return;
+    bool fixColumn = showFirstColumn ();
+    start = Math.max (0, start);
+    end = Math.min (end, itemCount - 1);
+    selectFocusIndex (start);
+    if ((style & SWT.MULTI) !is 0) {
+        select (start, end);
+    }
+    showSelection ();
+    if (fixColumn) hideFirstColumn ();
+}
+
+/**
+ * Selects the items at the given zero-relative indices in the receiver.
+ * The current selection is cleared before the new items are selected.
+ * <p>
+ * Indices that are out of range and duplicate indices are ignored.
+ * If the receiver is single-select and multiple indices are specified,
+ * then all indices are ignored.
+ * </p>
+ *
+ * @param indices the indices of the items to select
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Table#deselectAll()
+ * @see Table#select(int[])
+ */
+public void setSelection (int [] indices) {
+    checkWidget ();
+    // SWT extension: allow null for zero length string
+    //if (indices is null) error (SWT.ERROR_NULL_ARGUMENT);
+    deselectAll ();
+    int length = indices.length;
+    if (length is 0 || ((style & SWT.SINGLE) !is 0 && length > 1)) return;
+    bool fixColumn = showFirstColumn ();
+    selectFocusIndex (indices [0]);
+    if ((style & SWT.MULTI) !is 0) {
+        select (indices);
+    }
+    showSelection ();
+    if (fixColumn) hideFirstColumn ();
+}
+
+/**
+ * Sets the receiver's selection to the given item.
+ * The current selection is cleared before the new item is selected.
+ * <p>
+ * If the item is not in the receiver, then it is ignored.
+ * </p>
+ *
+ * @param item the item to select
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setSelection (TableItem item) {
+    if (item is null) error (SWT.ERROR_NULL_ARGUMENT);
+    setSelection ( [item] );
+}
+
+
+/**
+ * Sets the receiver's selection to be the given array of items.
+ * The current selection is cleared before the new items are selected.
+ * <p>
+ * Items that are not in the receiver are ignored.
+ * If the receiver is single-select and multiple items are specified,
+ * then all items are ignored.
+ * </p>
+ *
+ * @param items the array of items
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if one of the items has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Table#deselectAll()
+ * @see Table#select(int[])
+ * @see Table#setSelection(int[])
+ */
+public void setSelection (TableItem [] items) {
+    checkWidget ();
+    // SWT extension: allow null for zero length string
+    //if (items is null) error (SWT.ERROR_NULL_ARGUMENT);
+    bool fixColumn = showFirstColumn ();
+    deselectAll ();
+    int length = items.length;
+    if (!(length is 0 || ((style & SWT.SINGLE) !is 0 && length > 1))) {
+        bool first = true;
+        for (int i = 0; i < length; i++) {
+            int index = indexOf (items [i]);
+            if (index !is -1) {
+                if (first) {
+                    first = false;
+                    selectFocusIndex (index);
+                } else {
+                    select (index);
+                }
+            }
+        }
+        showSelection ();
+    }
+    if (fixColumn) hideFirstColumn ();
+}
+
+/**
+ * Sets the zero-relative index of the item which is currently
+ * at the top of the receiver. This index can change when items
+ * are scrolled or new items are added and removed.
+ *
+ * @param index the index of the top item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setTopIndex (int index) {
+    checkWidget();
+    if (!(0 <= index && index < itemCount)) return;
+    auto path = OS.gtk_tree_model_get_path (modelHandle, _getItem (index).handle);
+    OS.gtk_tree_view_scroll_to_cell (handle, path, null, true, 0f, 0f);
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 8, 0)) {
+        /*
+        * Bug in GTK.  According to the documentation, gtk_tree_view_scroll_to_cell
+        * should vertically scroll the cell to the top if use_align is true and row_align is 0.
+        * However, prior to version 2.8 it does not scroll at all.  The fix is to determine
+        * the new location and use gtk_tree_view_scroll_to_point.
+        * If the widget is a pinhead, calling gtk_tree_view_scroll_to_point
+        * will have no effect. Therefore, it is still neccessary to call
+        * gtk_tree_view_scroll_to_cell.
+        */
+        OS.gtk_widget_realize (handle);
+        GdkRectangle cellRect;
+        OS.gtk_tree_view_get_cell_area (handle, path, null, &cellRect);
+        int tx, ty;
+        OS.gtk_tree_view_widget_to_tree_coords(handle, cellRect.x, cellRect.y, &tx, &ty);
+        OS.gtk_tree_view_scroll_to_point (handle, -1, ty);
+    }
+    OS.gtk_tree_path_free (path);
+}
+
+/**
+ * Shows the column.  If the column is already showing in the receiver,
+ * this method simply returns.  Otherwise, the columns are scrolled until
+ * the column is visible.
+ *
+ * @param column the column to be shown
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the column is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the column has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void showColumn (TableColumn column) {
+    checkWidget ();
+    if (column is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (column.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
+    if (column.parent !is this) return;
+    /*
+    * This code is intentionally commented. According to the
+    * documentation, gtk_tree_view_scroll_to_cell should scroll the
+    * minimum amount to show the column but instead it scrolls strangely.
+    */
+    //OS.gtk_tree_view_scroll_to_cell (handle, 0, column.handle, false, 0, 0);
+    OS.gtk_widget_realize (handle);
+    GdkRectangle cellRect;
+    OS.gtk_tree_view_get_cell_area (handle, null, column.handle, &cellRect);
+    GdkRectangle visibleRect;
+    OS.gtk_tree_view_get_visible_rect (handle, &visibleRect);
+    if (cellRect.x < visibleRect.x) {
+        OS.gtk_tree_view_scroll_to_point (handle, cellRect.x, -1);
+    } else {
+        int width = Math.min (visibleRect.width, cellRect.width);
+        if (cellRect.x + width > visibleRect.x + visibleRect.width) {
+            int tree_x = cellRect.x + width - visibleRect.width;
+            OS.gtk_tree_view_scroll_to_point (handle, tree_x, -1);
+        }
+    }
+}
+
+bool showFirstColumn () {
+    /*
+    * Bug in GTK.  If no columns are visible, changing the selection
+    * will fail.  The fix is to temporarily make a column visible.
+    */
+    int columnCount = Math.max (1, this.columnCount);
+    for (int i=0; i<columnCount; i++) {
+        auto column = OS.gtk_tree_view_get_column (handle, i);
+        if (OS.gtk_tree_view_column_get_visible (column)) return false;
+    }
+    auto firstColumn = OS.gtk_tree_view_get_column (handle, 0);
+    OS.gtk_tree_view_column_set_visible (firstColumn, true);
+    return true;
+}
+
+/**
+ * Shows the item.  If the item is already showing in the receiver,
+ * this method simply returns.  Otherwise, the items are scrolled until
+ * the item is visible.
+ *
+ * @param item the item to be shown
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Table#showSelection()
+ */
+public void showItem (TableItem item) {
+    checkWidget ();
+    if (item is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (item.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
+    if (item.parent !is this) return;
+    showItem (cast(GtkTreeIter*)item.handle);
+}
+
+void showItem (GtkTreeIter* iter) {
+    auto path = OS.gtk_tree_model_get_path (modelHandle, iter);
+    /*
+    * This code intentionally commented.
+    * Bug in GTK.  According to the documentation, gtk_tree_view_scroll_to_cell
+    * should scroll the minimum amount to show the cell if use_align is false.
+    * However, what actually happens is the cell is scrolled to the top.
+    * The fix is to determine the new location and use gtk_tree_view_scroll_to_point.
+    * If the widget is a pinhead, calling gtk_tree_view_scroll_to_point
+    * will have no effect. Therefore, it is still neccessary to
+    * call gtk_tree_view_scroll_to_cell.
+    */
+//  OS.gtk_tree_view_scroll_to_cell (handle, path, 0, false, 0, 0);
+    OS.gtk_widget_realize (handle);
+    GdkRectangle visibleRect;
+    OS.gtk_tree_view_get_visible_rect (handle, &visibleRect);
+    GdkRectangle cellRect;
+    OS.gtk_tree_view_get_cell_area (handle, path, null, &cellRect);
+    int tx, ty;
+    OS.gtk_tree_view_widget_to_tree_coords(handle, cellRect.x, cellRect.y, &tx, &ty);
+    if (ty < visibleRect.y ) {
+        OS.gtk_tree_view_scroll_to_cell (handle, path, null, true, 0f, 0f);
+        OS.gtk_tree_view_scroll_to_point (handle, -1, ty);
+    } else {
+        int height = Math.min (visibleRect.height, cellRect.height);
+        if (ty + height > visibleRect.y + visibleRect.height) {
+            OS.gtk_tree_view_scroll_to_cell (handle, path, null, true, 1f, 0f);
+            ty += cellRect.height - visibleRect.height;
+            OS.gtk_tree_view_scroll_to_point (handle, -1, ty);
+        }
+    }
+    OS.gtk_tree_path_free (path);
+}
+
+/**
+ * Shows the selection.  If the selection is already showing in the receiver,
+ * this method simply returns.  Otherwise, the items are scrolled until
+ * the selection is visible.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Table#showItem(TableItem)
+ */
+public void showSelection () {
+    checkWidget();
+    TableItem [] selection = getSelection ();
+    if (selection.length is 0) return;
+    TableItem item = selection [0];
+    showItem (cast(GtkTreeIter*)item.handle);
+}
+
+override void treeSelectionProc (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, int[] selection, int length_) {
+    if (selection !is null) {
+        auto indices = OS.gtk_tree_path_get_indices (path);
+        if (indices !is null) {
+            selection [length_] = indices [0];
+        }
+    }
+}
+
+override void updateScrollBarValue (ScrollBar bar) {
+    super.updateScrollBarValue (bar);
+    /*
+    *  Bug in GTK. Scrolling changes the XWindow position
+    * and makes the child widgets appear to scroll even
+    * though when queried their position is unchanged.
+    * The fix is to queue a resize event for each child to
+    * force the position to be corrected.
+    */
+    auto parentHandle = parentingHandle ();
+    auto list = OS.gtk_container_get_children (parentHandle);
+    if (list is null) return;
+    auto temp = list;
+    while (temp !is null) {
+        auto widget = OS.g_list_data (temp);
+        if (widget !is null) OS.gtk_widget_queue_resize  (widget);
+        temp = OS.g_list_next (temp);
+    }
+    OS.g_list_free (list);
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/TableColumn.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,686 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.TableColumn;
+
+import java.lang.all;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.ImageList;
+
+
+/**
+ * Instances of this class represent a column in a table widget.
+ * <p><dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>LEFT, RIGHT, CENTER</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd> Move, Resize, Selection</dd>
+ * </dl>
+ * </p><p>
+ * Note: Only one of the styles LEFT, RIGHT and CENTER may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#table">Table, TableItem, TableColumn snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class TableColumn : Item {
+    GtkWidget* labelHandle, imageHandle, buttonHandle;
+    Table parent;
+    int modelIndex, lastButton, lastTime, lastX, lastWidth;
+    bool customDraw, useFixedWidth;
+    String toolTipText;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Table</code>) and a style value
+ * describing its behavior and appearance. The item is added
+ * to the end of the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#LEFT
+ * @see SWT#RIGHT
+ * @see SWT#CENTER
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Table parent, int style) {
+    super (parent, checkStyle (style));
+    this.parent = parent;
+    createWidget (parent.getColumnCount ());
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Table</code>), a style value
+ * describing its behavior and appearance, and the index
+ * at which to place it in the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ * <p>
+ * Note that due to a restriction on some platforms, the first column
+ * is always left aligned.
+ * </p>
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ * @param index the zero-relative index to store the receiver in its parent
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the parent (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#LEFT
+ * @see SWT#RIGHT
+ * @see SWT#CENTER
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Table parent, int style, int index) {
+    super (parent, checkStyle (style));
+    this.parent = parent;
+    createWidget (index);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the control is moved or resized, by sending
+ * it one of the messages defined in the <code>ControlListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ControlListener
+ * @see #removeControlListener
+ */
+public void addControlListener(ControlListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Resize,typedListener);
+    addListener (SWT.Move,typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the control is selected by the user, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * <code>widgetSelected</code> is called when the column header is selected.
+ * <code>widgetDefaultSelected</code> is not called.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the control is selected by the user
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener (SelectionListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Selection,typedListener);
+    addListener (SWT.DefaultSelection,typedListener);
+}
+
+static int checkStyle (int style) {
+    return checkBits (style, SWT.LEFT, SWT.CENTER, SWT.RIGHT, 0, 0, 0);
+}
+
+protected override void checkSubclass () {
+    if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+override void createWidget (int index) {
+    parent.createItem (this, index);
+    setOrientation ();
+    hookEvents ();
+    register ();
+    text = "";
+}
+
+override void deregister() {
+    super.deregister ();
+    display.removeWidget (handle);
+    if (buttonHandle !is null) display.removeWidget (buttonHandle);
+    if (labelHandle !is null) display.removeWidget (labelHandle);
+}
+
+override void destroyWidget () {
+    parent.destroyItem (this);
+    releaseHandle ();
+}
+
+/**
+ * Returns a value which describes the position of the
+ * text or image in the receiver. The value will be one of
+ * <code>LEFT</code>, <code>RIGHT</code> or <code>CENTER</code>.
+ *
+ * @return the alignment
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getAlignment () {
+    checkWidget();
+    if ((style & SWT.LEFT) !is 0) return SWT.LEFT;
+    if ((style & SWT.CENTER) !is 0) return SWT.CENTER;
+    if ((style & SWT.RIGHT) !is 0) return SWT.RIGHT;
+    return SWT.LEFT;
+}
+
+/**
+ * Gets the moveable attribute. A column that is
+ * not moveable cannot be reordered by the user
+ * by dragging the header but may be reordered
+ * by the programmer.
+ *
+ * @return the moveable attribute
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Table#getColumnOrder()
+ * @see Table#setColumnOrder(int[])
+ * @see TableColumn#setMoveable(bool)
+ * @see SWT#Move
+ *
+ * @since 3.1
+ */
+public bool getMoveable() {
+    checkWidget();
+    return cast(bool)OS.gtk_tree_view_column_get_reorderable (handle);
+}
+
+/**
+ * Returns the receiver's parent, which must be a <code>Table</code>.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Table getParent () {
+    checkWidget();
+    return parent;
+}
+
+/**
+ * Gets the resizable attribute. A column that is
+ * not resizable cannot be dragged by the user but
+ * may be resized by the programmer.
+ *
+ * @return the resizable attribute
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool getResizable () {
+    checkWidget();
+    return cast(bool)OS.gtk_tree_view_column_get_resizable (handle);
+}
+
+/**
+ * Returns the receiver's tool tip text, or null if it has
+ * not been set.
+ *
+ * @return the receiver's tool tip text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public String getToolTipText () {
+    checkWidget();
+    return toolTipText;
+}
+
+/**
+ * Gets the width of the receiver.
+ *
+ * @return the width
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getWidth () {
+    checkWidget();
+    if (!OS.gtk_tree_view_column_get_visible (handle)) {
+        return 0;
+    }
+    if (useFixedWidth) return OS.gtk_tree_view_column_get_fixed_width (handle);
+    return OS.gtk_tree_view_column_get_width (handle);
+}
+
+override int gtk_clicked (GtkWidget* widget) {
+    /*
+    * There is no API to get a double click on a table column.  Normally, when
+    * the mouse is double clicked, this is indicated by GDK_2BUTTON_PRESS
+    * but the table column sends the click signal on button release.  The fix is to
+    * test for double click by remembering the last click time and mouse button
+    * and testing for the double click interval.
+    */
+    bool doubleClick = false;
+    bool postEvent_ = true;
+    auto eventPtr = OS.gtk_get_current_event ();
+    if (eventPtr !is null) {
+        GdkEventButton* gdkEvent = cast(GdkEventButton*)eventPtr;
+        switch (gdkEvent.type) {
+            case OS.GDK_BUTTON_RELEASE: {
+                int clickTime = display.getDoubleClickTime ();
+                int eventTime = gdkEvent.time, eventButton = gdkEvent.button;
+                if (lastButton is eventButton && lastTime !is 0 && Math.abs (lastTime - eventTime) <= clickTime) {
+                    doubleClick = true;
+                }
+                lastTime = eventTime is 0 ? 1: eventTime;
+                lastButton = eventButton;
+                break;
+            }
+            case OS.GDK_MOTION_NOTIFY: {
+                /*
+                * Bug in GTK.  Dragging a column in a GtkTreeView causes a clicked
+                * signal to be emitted even though the mouse button was never released.
+                * The fix to ignore the signal if the current GDK event is a motion notify.
+                * The GTK bug was fixed in version 2.6
+                */
+                if (OS.GTK_VERSION < OS.buildVERSION (2, 6, 0)) postEvent_ = false;
+                break;
+            }
+            default:
+        }
+        OS.gdk_event_free (eventPtr);
+    }
+    if (postEvent_) postEvent (doubleClick ? SWT.DefaultSelection : SWT.Selection);
+    return 0;
+}
+
+override int gtk_mnemonic_activate (GtkWidget* widget, int /*long*/ arg1) {
+    return parent.gtk_mnemonic_activate (widget, arg1);
+}
+
+override int gtk_size_allocate (GtkWidget* widget, int /*long*/ allocation) {
+    useFixedWidth = false;
+    int x = OS.GTK_WIDGET_X (widget);
+    int width = OS.GTK_WIDGET_WIDTH (widget);
+    if (x !is lastX) {
+        lastX = x;
+        sendEvent (SWT.Move);
+    }
+    if (width !is lastWidth) {
+        lastWidth = width;
+        sendEvent (SWT.Resize);
+    }
+    return 0;
+}
+
+override void hookEvents () {
+    super.hookEvents ();
+    OS.g_signal_connect_closure (handle, OS.clicked.ptr, display.closures [CLICKED], false);
+    if (buttonHandle !is null) OS.g_signal_connect_closure_by_id (buttonHandle, display.signalIds [SIZE_ALLOCATE], 0, display.closures [SIZE_ALLOCATE], false);
+    if (labelHandle !is null) OS.g_signal_connect_closure_by_id (labelHandle, display.signalIds [MNEMONIC_ACTIVATE], 0, display.closures [MNEMONIC_ACTIVATE], false);
+}
+
+/**
+ * Causes the receiver to be resized to its preferred size.
+ * For a composite, this involves computing the preferred size
+ * from its layout, if there is one.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ */
+public void pack () {
+    checkWidget();
+    int width = 0;
+    if (buttonHandle !is null) {
+        GtkRequisition requisition;
+        OS.gtk_widget_size_request (buttonHandle, &requisition);
+        width = requisition.width;
+    }
+    if ((parent.style & SWT.VIRTUAL) !is 0) {
+        for (int i=0; i<parent.items.length; i++) {
+            TableItem item = parent.items [i];
+            if (item !is null && item.cached) {
+                width = Math.max (width, parent.calculateWidth ( cast(GtkTreeViewColumn*)handle, cast(GtkTreeIter*)item.handle));
+            }
+        }
+    } else {
+        GtkTreeIter iter;
+        if (OS.gtk_tree_model_get_iter_first (parent.modelHandle, &iter)) {
+            do {
+                width = Math.max (width, parent.calculateWidth (cast(GtkTreeViewColumn*)handle, &iter));
+            } while (OS.gtk_tree_model_iter_next(parent.modelHandle, &iter));
+        }
+    }
+    setWidth(width);
+}
+
+override void register () {
+    super.register ();
+    display.addWidget (handle, this);
+    if (buttonHandle !is null) display.addWidget (buttonHandle, this);
+    if (labelHandle !is null) display.addWidget (labelHandle, this);
+}
+
+override void releaseHandle () {
+    super.releaseHandle ();
+    handle = buttonHandle = labelHandle = imageHandle = null;
+    modelIndex = -1;
+    parent = null;
+}
+
+override void releaseParent () {
+    super.releaseParent ();
+    if (parent.sortColumn is this) {
+        parent.sortColumn = null;
+    }
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is moved or resized.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ControlListener
+ * @see #addControlListener
+ */
+public void removeControlListener (ControlListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Move, listener);
+    eventTable.unhook (SWT.Resize, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is selected by the user.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener(SelectionListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Selection, listener);
+    eventTable.unhook (SWT.DefaultSelection,listener);
+}
+
+/**
+ * Controls how text and images will be displayed in the receiver.
+ * The argument should be one of <code>LEFT</code>, <code>RIGHT</code>
+ * or <code>CENTER</code>.
+ * <p>
+ * Note that due to a restriction on some platforms, the first column
+ * is always left aligned.
+ * </p>
+ * @param alignment the new alignment
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setAlignment (int alignment) {
+    checkWidget();
+    if ((alignment & (SWT.LEFT | SWT.RIGHT | SWT.CENTER)) is 0) return;
+    int index = parent.indexOf (this);
+    if (index is -1 || index is 0) return;
+    style &= ~(SWT.LEFT | SWT.RIGHT | SWT.CENTER);
+    style |= alignment & (SWT.LEFT | SWT.RIGHT | SWT.CENTER);
+    parent.createRenderers ( cast(GtkTreeViewColumn*)handle, modelIndex, index is 0, style);
+}
+
+void setFontDescription (PangoFontDescription* font) {
+    OS.gtk_widget_modify_font (labelHandle, font);
+    OS.gtk_widget_modify_font (imageHandle, font);
+}
+
+public override void setImage (Image image) {
+    checkWidget ();
+    super.setImage (image);
+    if (image !is null) {
+        ImageList headerImageList = parent.headerImageList;
+        if (headerImageList is null) {
+            headerImageList = parent.headerImageList = new ImageList ();
+        }
+        int imageIndex = headerImageList.indexOf (image);
+        if (imageIndex is -1) imageIndex = headerImageList.add (image);
+        auto pixbuf = headerImageList.getPixbuf (imageIndex);
+        OS.gtk_image_set_from_pixbuf (imageHandle, pixbuf);
+        OS.gtk_widget_show (imageHandle);
+    } else {
+        OS.gtk_image_set_from_pixbuf (imageHandle, null);
+        OS.gtk_widget_hide (imageHandle);
+    }
+}
+
+/**
+ * Sets the resizable attribute.  A column that is
+ * resizable can be resized by the user dragging the
+ * edge of the header.  A column that is not resizable
+ * cannot be dragged by the user but may be resized
+ * by the programmer.
+ *
+ * @param resizable the resize attribute
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setResizable (bool resizable) {
+    checkWidget();
+    OS.gtk_tree_view_column_set_resizable (handle, resizable);
+}
+
+/**
+ * Sets the moveable attribute.  A column that is
+ * moveable can be reordered by the user by dragging
+ * the header. A column that is not moveable cannot be
+ * dragged by the user but may be reordered
+ * by the programmer.
+ *
+ * @param moveable the moveable attribute
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Table#setColumnOrder(int[])
+ * @see Table#getColumnOrder()
+ * @see TableColumn#getMoveable()
+ * @see SWT#Move
+ *
+ * @since 3.1
+ */
+public void setMoveable (bool moveable) {
+    checkWidget();
+    OS.gtk_tree_view_column_set_reorderable (handle, moveable);
+}
+
+override void setOrientation() {
+    if ((parent.style & SWT.RIGHT_TO_LEFT) !is 0) {
+        if (buttonHandle !is null) {
+            OS.gtk_widget_set_direction (buttonHandle, OS.GTK_TEXT_DIR_RTL);
+            display.doSetDirectionProc( buttonHandle, OS.GTK_TEXT_DIR_RTL);
+        }
+    }
+}
+
+public override void setText (String string) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    super.setText (string);
+    char [] chars = fixMnemonic (string);
+    OS.gtk_label_set_text_with_mnemonic (labelHandle, chars.toStringzValidPtr() );
+    if (string.length !is 0) {
+        OS.gtk_widget_show (labelHandle);
+    } else {
+        OS.gtk_widget_hide (labelHandle);
+    }
+}
+
+/**
+ * Sets the receiver's tool tip text to the argument, which
+ * may be null indicating that no tool tip text should be shown.
+ *
+ * @param string the new tool tip text (or null)
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setToolTipText (String string) {
+    checkWidget();
+    Shell shell = parent._getShell ();
+    setToolTipText (shell, string);
+    toolTipText = string;
+}
+
+void setToolTipText (Shell shell, String newString) {
+    shell.setToolTipText (buttonHandle, newString);
+}
+
+/**
+ * Sets the width of the receiver.
+ *
+ * @param width the new width
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setWidth (int width) {
+    checkWidget();
+    if (width < 0) return;
+    if (width is lastWidth) return;
+    if (width > 0) {
+        useFixedWidth = true;
+        OS.gtk_tree_view_column_set_fixed_width (handle, width);
+    }
+    /*
+     * Bug in GTK.  For some reason, calling gtk_tree_view_column_set_visible()
+     * when the parent is not realized fails to show the column. The fix is to
+     * ensure that the table has been realized.
+     */
+    if (width !is 0) OS.gtk_widget_realize (parent.handle);
+    OS.gtk_tree_view_column_set_visible (handle, width !is 0);
+    lastWidth = width;
+    sendEvent (SWT.Resize);
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/TableItem.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,1324 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.TableItem;
+
+import java.lang.all;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.ImageList;
+import org.eclipse.swt.widgets.TreeItem;
+
+
+/**
+ * Instances of this class represent a selectable user interface object
+ * that represents an item in a table.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>(none)</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#table">Table, TableItem, TableColumn snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class TableItem : Item {
+    Table parent;
+    Font font;
+    Font[] cellFont;
+    bool cached, grayed;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Table</code>), a style value
+ * describing its behavior and appearance, and the index
+ * at which to place it in the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ * @param index the zero-relative index to store the receiver in its parent
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the parent (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Table parent, int style, int index) {
+    this (parent, style, index, true);
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Table</code>) and a style value
+ * describing its behavior and appearance. The item is added
+ * to the end of the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Table parent, int style) {
+    this (parent, style, checkNull (parent).getItemCount (), true);
+}
+
+
+this (Table parent, int style, int index, bool create) {
+    super (parent, style);
+    this.parent = parent;
+    if (create) {
+        parent.createItem (this, index);
+    } else {
+        handle = cast(GtkWidget*)OS.g_malloc (GtkTreeIter.sizeof);
+        OS.gtk_tree_model_iter_nth_child (parent.modelHandle, handle, null, index);
+    }
+}
+
+static Table checkNull (Table control) {
+    if (control is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    return control;
+}
+
+Color _getBackground () {
+    void* ptr;
+    OS.gtk_tree_model_get1 (parent.modelHandle, handle, Table.BACKGROUND_COLUMN, &ptr);
+    if (ptr is null) return parent.getBackground ();
+    GdkColor* gdkColor = new GdkColor ();
+    *gdkColor = *cast(GdkColor*) ptr;
+    return Color.gtk_new (display, gdkColor);
+}
+
+Color _getBackground (int index) {
+    int count = Math.max (1, parent.columnCount);
+    if (0 > index || index > count - 1) return _getBackground ();
+    void* ptr;
+    int modelIndex = parent.columnCount is 0 ? Table.FIRST_COLUMN : parent.columns [index].modelIndex;
+    OS.gtk_tree_model_get1 (parent.modelHandle, handle, modelIndex + Table.CELL_BACKGROUND, &ptr);
+    if (ptr is null) return _getBackground ();
+    GdkColor* gdkColor = new GdkColor ();
+    *gdkColor = *cast(GdkColor*) ptr;
+    return Color.gtk_new (display, gdkColor);
+}
+
+bool _getChecked () {
+    void* ptr;
+    OS.gtk_tree_model_get1 (parent.modelHandle, handle, Table.CHECKED_COLUMN, &ptr);
+    return ptr !is null;
+}
+
+Color _getForeground () {
+    void* ptr;
+    OS.gtk_tree_model_get1 (parent.modelHandle, handle, Table.FOREGROUND_COLUMN, &ptr);
+    if (ptr is null) return parent.getForeground ();
+    GdkColor* gdkColor = new GdkColor ();
+    *gdkColor = *cast(GdkColor*) ptr;
+    return Color.gtk_new (display, gdkColor);
+}
+
+Color _getForeground (int index) {
+    int count = Math.max (1, parent.columnCount);
+    if (0 > index || index > count - 1) return _getForeground ();
+    void* ptr;
+    int modelIndex =  parent.columnCount is 0 ? Table.FIRST_COLUMN : parent.columns [index].modelIndex;
+    OS.gtk_tree_model_get1 (parent.modelHandle, handle, modelIndex + Table.CELL_FOREGROUND, &ptr);
+    if (ptr is null) return _getForeground ();
+    GdkColor* gdkColor = new GdkColor ();
+    *gdkColor = *cast(GdkColor*) ptr;
+    return Color.gtk_new (display, gdkColor);
+}
+
+Image _getImage (int index) {
+    int count = Math.max (1, parent.getColumnCount ());
+    if (0 > index || index > count - 1) return null;
+    void* ptr;
+    int modelIndex = parent.columnCount is 0 ? Table.FIRST_COLUMN : parent.columns [index].modelIndex;
+    OS.gtk_tree_model_get1 (parent.modelHandle, handle, modelIndex + Table.CELL_PIXBUF, &ptr);
+    if (ptr is null) return null;
+    ImageList imageList = parent.imageList;
+    int imageIndex = imageList.indexOf (ptr);
+    if (imageIndex is -1) return null;
+    return imageList.get (imageIndex);
+}
+
+String _getText (int index) {
+    int count = Math.max (1, parent.getColumnCount ());
+    if (0 > index || index > count - 1) return "";
+    void* ptr;
+    int modelIndex = parent.columnCount is 0 ? Table.FIRST_COLUMN : parent.columns [index].modelIndex;
+    OS.gtk_tree_model_get1 (parent.modelHandle, handle, modelIndex + Table.CELL_TEXT, &ptr);
+    if (ptr is null) return "";
+    char[] buffer = fromStringz( cast(char*)ptr).dup;
+    OS.g_free (ptr);
+    return buffer;
+}
+
+protected override void checkSubclass () {
+    if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+void clear () {
+    if (parent.currentItem is this) return;
+    if (cached || (parent.style & SWT.VIRTUAL) is 0) {
+        int columnCount = OS.gtk_tree_model_get_n_columns (parent.modelHandle);
+        for (int i=0; i<columnCount; i++) {
+            OS.gtk_list_store_set1 (parent.modelHandle, handle, i, null);
+        }
+        /*
+        * Bug in GTK.  When using fixed-height-mode,
+        * row changes do not cause the row to be repainted.  The fix is to
+        * invalidate the row when it is cleared.
+        */
+        if ((parent.style & SWT.VIRTUAL) !is 0) {
+            if (OS.GTK_VERSION >= OS.buildVERSION (2, 3, 2) && OS.GTK_VERSION < OS.buildVERSION (2, 6, 3)) {
+                redraw ();
+            }
+        }
+    }
+    cached = false;
+    font = null;
+    cellFont = null;
+}
+
+override void destroyWidget () {
+    parent.destroyItem (this);
+    releaseHandle ();
+}
+
+/**
+ * Returns the receiver's background color.
+ *
+ * @return the background color
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ */
+public Color getBackground () {
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    return _getBackground ();
+}
+
+/**
+ * Returns a rectangle describing the receiver's size and location
+ * relative to its parent.
+ *
+ * @return the receiver's bounding rectangle
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public Rectangle getBounds () {
+    // TODO fully test on early and later versions of GTK
+    // shifted a bit too far right on later versions of GTK - however, old Tree also had this problem
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    auto parentHandle = parent.handle;
+    auto column = OS.gtk_tree_view_get_column (parentHandle, 0);
+    if (column is null) return new Rectangle (0, 0, 0, 0);
+    auto textRenderer = parent.getTextRenderer (column);
+    auto pixbufRenderer = parent.getPixbufRenderer (column);
+    if (textRenderer is null || pixbufRenderer is null)  return new Rectangle (0, 0, 0, 0);
+
+    auto path = OS.gtk_tree_model_get_path (parent.modelHandle, handle);
+    OS.gtk_widget_realize (parentHandle);
+
+    bool isExpander = OS.gtk_tree_model_iter_n_children (parent.modelHandle, handle) > 0;
+    bool isExpanded = cast(bool)OS.gtk_tree_view_row_expanded (parentHandle, path);
+    OS.gtk_tree_view_column_cell_set_cell_data (column, parent.modelHandle, handle, isExpander, isExpanded);
+
+    GdkRectangle rect;
+    OS.gtk_tree_view_get_cell_area (parentHandle, path, column, &rect);
+    OS.gtk_tree_path_free (path);
+    if ((parent.getStyle () & SWT.MIRRORED) !is 0) rect.x = parent.getClientWidth () - rect.width - rect.x;
+    int right = rect.x + rect.width;
+
+    int x, w;
+    parent.ignoreSize = true;
+    OS.gtk_cell_renderer_get_size (textRenderer, parentHandle, null, null, null, &w, null);
+    parent.ignoreSize = false;
+    rect.width = w;
+    int buffer;
+    if (OS.gtk_tree_view_get_expander_column (parentHandle) is column) {
+        OS.gtk_widget_style_get1 (parentHandle, OS.expander_size.ptr, &buffer);
+        rect.x += buffer + TreeItem.EXPANDER_EXTRA_PADDING;
+    }
+    OS.gtk_widget_style_get1 (parentHandle, OS.horizontal_separator.ptr, &buffer);
+    int horizontalSeparator = buffer;
+    rect.x += horizontalSeparator;
+
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 1, 3)) {
+        OS.gtk_tree_view_column_cell_get_position (column, textRenderer, &x, null);
+        rect.x += x;
+    } else {
+        if ((parent.style & SWT.CHECK) !is 0) {
+            OS.gtk_cell_renderer_get_size (parent.checkRenderer, parentHandle, null, null, null, &w, null);
+            rect.x += w + horizontalSeparator;
+        }
+        OS.gtk_cell_renderer_get_size (pixbufRenderer, parentHandle, null, null, null, &w, null);
+        rect.x += w + horizontalSeparator;
+    }
+    if (parent.columnCount > 0) {
+        if (rect.x + rect.width > right) {
+            rect.width = Math.max (0, right - rect.x);
+        }
+    }
+    int width = OS.gtk_tree_view_column_get_visible (column) ? rect.width + 1 : 0;
+    return new Rectangle (rect.x, rect.y, width, rect.height + 1);
+}
+
+/**
+ * Returns the background color at the given column index in the receiver.
+ *
+ * @param index the column index
+ * @return the background color
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public Color getBackground (int index) {
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    return _getBackground (index);
+}
+
+/**
+ * Returns a rectangle describing the receiver's size and location
+ * relative to its parent at a column in the table.
+ *
+ * @param index the index that specifies the column
+ * @return the receiver's bounding column rectangle
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Rectangle getBounds (int index) {
+    checkWidget();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    auto parentHandle = parent.handle;
+    GtkTreeViewColumn* column;
+    if (index >= 0 && index < parent.columnCount) {
+        column = cast(GtkTreeViewColumn*)parent.columns [index].handle;
+    } else {
+        column = OS.gtk_tree_view_get_column (parentHandle, index);
+    }
+    if (column is null) return new Rectangle (0, 0, 0, 0);
+    auto path = OS.gtk_tree_model_get_path (parent.modelHandle, handle);
+    OS.gtk_widget_realize (parentHandle);
+    GdkRectangle rect;
+    OS.gtk_tree_view_get_cell_area (parentHandle, path, column, &rect);
+    OS.gtk_tree_path_free (path);
+    if ((parent.getStyle () & SWT.MIRRORED) !is 0) rect.x = parent.getClientWidth () - rect.width - rect.x;
+
+    if (index is 0 && (parent.style & SWT.CHECK) !is 0) {
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 1, 3)) {
+            int x, w;
+            OS.gtk_tree_view_column_cell_get_position (column, parent.checkRenderer, &x, &w);
+            rect.x += x + w;
+            rect.width -= x + w;
+        } else {
+            int w;
+            OS.gtk_cell_renderer_get_size (parent.checkRenderer, parentHandle, null, null, null, &w, null);
+            int buffer;
+            OS.gtk_widget_style_get1 (parentHandle, OS.horizontal_separator.ptr, &buffer);
+            rect.x += w + buffer;
+            rect.width -= w + buffer;
+        }
+    }
+    int width = OS.gtk_tree_view_column_get_visible (column) ? rect.width + 1 : 0;
+    return new Rectangle (rect.x, rect.y, width, rect.height + 1);
+}
+
+/**
+ * Returns <code>true</code> if the receiver is checked,
+ * and false otherwise.  When the parent does not have
+ * the <code>CHECK</code> style, return false.
+ *
+ * @return the checked state of the checkbox
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool getChecked () {
+    checkWidget();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    if ((parent.style & SWT.CHECK) is 0) return false;
+    return _getChecked ();
+}
+
+/**
+ * Returns the font that the receiver will use to paint textual information for this item.
+ *
+ * @return the receiver's font
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public Font getFont () {
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    return font !is null ? font : parent.getFont ();
+}
+
+/**
+ * Returns the font that the receiver will use to paint textual information
+ * for the specified cell in this item.
+ *
+ * @param index the column index
+ * @return the receiver's font
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public Font getFont (int index) {
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    int count = Math.max (1, parent.columnCount);
+    if (0 > index || index > count - 1) return getFont ();
+    if (cellFont is null || cellFont [index] is null) return getFont ();
+    return cellFont [index];
+}
+
+/**
+ * Returns the foreground color that the receiver will use to draw.
+ *
+ * @return the receiver's foreground color
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ */
+public Color getForeground () {
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    return _getForeground ();
+}
+
+/**
+ *
+ * Returns the foreground color at the given column index in the receiver.
+ *
+ * @param index the column index
+ * @return the foreground color
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public Color getForeground (int index) {
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    return _getForeground (index);
+}
+
+/**
+ * Returns <code>true</code> if the receiver is grayed,
+ * and false otherwise. When the parent does not have
+ * the <code>CHECK</code> style, return false.
+ *
+ * @return the grayed state of the checkbox
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool getGrayed () {
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    if ((parent.style & SWT.CHECK) is 0) return false;
+    return grayed;
+}
+
+public override Image getImage () {
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    return getImage (0);
+}
+
+/**
+ * Returns the image stored at the given column index in the receiver,
+ * or null if the image has not been set or if the column does not exist.
+ *
+ * @param index the column index
+ * @return the image stored at the given column index in the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Image getImage (int index) {
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    return _getImage (index);
+}
+
+/**
+ * Returns a rectangle describing the size and location
+ * relative to its parent of an image at a column in the
+ * table.  An empty rectangle is returned if index exceeds
+ * the index of the table's last column.
+ *
+ * @param index the index that specifies the column
+ * @return the receiver's bounding image rectangle
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Rectangle getImageBounds (int index) {
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    auto parentHandle = parent.handle;
+    GtkTreeViewColumn* column;
+    if (index >= 0 && index < parent.columnCount) {
+        column = cast(GtkTreeViewColumn*)parent.columns [index].handle;
+    } else {
+        column = OS.gtk_tree_view_get_column (parentHandle, index);
+    }
+    if (column is null) return new Rectangle (0, 0, 0, 0);
+    auto pixbufRenderer = parent.getPixbufRenderer (column);
+    if (pixbufRenderer is null)  return new Rectangle (0, 0, 0, 0);
+    GdkRectangle rect;
+    auto path = OS.gtk_tree_model_get_path (parent.modelHandle, handle);
+    OS.gtk_widget_realize (parentHandle);
+    OS.gtk_tree_view_get_cell_area (parentHandle, path, column, &rect);
+    OS.gtk_tree_path_free (path);
+    if ((parent.getStyle () & SWT.MIRRORED) !is 0) rect.x = parent.getClientWidth () - rect.width - rect.x;
+    /*
+    * The OS call gtk_cell_renderer_get_size() provides the width of image to be drawn
+    * by the cell renderer.  If there is no image in the cell, the width is zero.  If the table contains
+    * images of varying widths, gtk_cell_renderer_get_size() will return the width of the image,
+    * not the width of the area in which the image is drawn.
+    * New API was added in GTK 2.1.3 for determining the full width of the renderer area.
+    * For earlier versions of GTK, the result is only correct if all rows have images of the same
+    * width.
+    */
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 1, 3)) {
+        int x, w;
+        OS.gtk_tree_view_column_cell_get_position (column, pixbufRenderer, &x, &w);
+        rect.x += x;
+        rect.width = w;
+    } else {
+        int w;
+        OS.gtk_tree_view_column_cell_set_cell_data (column, parent.modelHandle, handle, false, false);
+        OS.gtk_cell_renderer_get_size (pixbufRenderer, parentHandle, null, null, null, &w, null);
+        rect.width = w;
+    }
+    int width = OS.gtk_tree_view_column_get_visible (column) ? rect.width : 0;
+    return new Rectangle (rect.x, rect.y, width, rect.height + 1);
+}
+
+/**
+ * Gets the image indent.
+ *
+ * @return the indent
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getImageIndent () {
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    /* Image indent is not supported on GTK */
+    return 0;
+}
+
+override String getNameText () {
+    if ((parent.style & SWT.VIRTUAL) !is 0) {
+        if (!cached) return "*virtual*"; //$NON-NLS-1$
+    }
+    return super.getNameText ();
+}
+
+/**
+ * Returns the receiver's parent, which must be a <code>Table</code>.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Table getParent () {
+    checkWidget ();
+    return parent;
+}
+
+public override String getText () {
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    return getText (0);
+}
+
+/**
+ * Returns the text stored at the given column index in the receiver,
+ * or empty string if the text has not been set.
+ *
+ * @param index the column index
+ * @return the text stored at the given column index in the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getText (int index) {
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    return _getText (index);
+}
+
+/**
+ * Returns a rectangle describing the size and location
+ * relative to its parent of the text at a column in the
+ * table.  An empty rectangle is returned if index exceeds
+ * the index of the table's last column.
+ *
+ * @param index the index that specifies the column
+ * @return the receiver's bounding text rectangle
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.3
+ */
+public Rectangle getTextBounds (int index) {
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    int count = Math.max (1, parent.getColumnCount ());
+    if (0 > index || index > count - 1) return new Rectangle (0, 0, 0, 0);
+    // TODO fully test on early and later versions of GTK
+    // shifted a bit too far right on later versions of GTK - however, old Tree also had this problem
+    auto parentHandle = parent.handle;
+    GtkTreeViewColumn* column;
+    if (index >= 0 && index < parent.columnCount) {
+        column = cast(GtkTreeViewColumn*)parent.columns [index].handle;
+    } else {
+        column = OS.gtk_tree_view_get_column (parentHandle, index);
+    }
+    if (column is null) return new Rectangle (0, 0, 0, 0);
+    auto textRenderer = parent.getTextRenderer (column);
+    auto pixbufRenderer = parent.getPixbufRenderer (column);
+    if (textRenderer is null || pixbufRenderer is null)  return new Rectangle (0, 0, 0, 0);
+
+    auto path = OS.gtk_tree_model_get_path (parent.modelHandle, handle);
+    OS.gtk_widget_realize (parentHandle);
+
+    bool isExpander = OS.gtk_tree_model_iter_n_children (parent.modelHandle, handle) > 0;
+    bool isExpanded = cast(bool)OS.gtk_tree_view_row_expanded (parentHandle, path);
+    OS.gtk_tree_view_column_cell_set_cell_data (column, parent.modelHandle, handle, isExpander, isExpanded);
+
+    GdkRectangle rect;
+    OS.gtk_tree_view_get_cell_area (parentHandle, path, column, &rect);
+    OS.gtk_tree_path_free (path);
+    if ((parent.getStyle () & SWT.MIRRORED) !is 0) rect.x = parent.getClientWidth () - rect.width - rect.x;
+    int right = rect.x + rect.width;
+
+    int x, w;
+    parent.ignoreSize = true;
+    OS.gtk_cell_renderer_get_size (textRenderer, parentHandle, null, null, null, &w, null);
+    parent.ignoreSize = false;
+    int buffer;
+    if (OS.gtk_tree_view_get_expander_column (parentHandle) is column) {
+        OS.gtk_widget_style_get1 (parentHandle, OS.expander_size.ptr, &buffer);
+        rect.x += buffer + TreeItem.EXPANDER_EXTRA_PADDING;
+    }
+    OS.gtk_widget_style_get1 (parentHandle, OS.horizontal_separator.ptr, &buffer);
+    int horizontalSeparator = buffer;
+    rect.x += horizontalSeparator;
+
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 1, 3)) {
+        OS.gtk_tree_view_column_cell_get_position (column, textRenderer, &x, null);
+        rect.x += x;
+    } else {
+        if ((parent.style & SWT.CHECK) !is 0) {
+            OS.gtk_cell_renderer_get_size (parent.checkRenderer, parentHandle, null, null, null, &w, null);
+            rect.x += w + horizontalSeparator;
+        }
+        OS.gtk_cell_renderer_get_size (pixbufRenderer, parentHandle, null, null, null, &w, null);
+        rect.x += w + horizontalSeparator;
+    }
+    if (parent.columnCount > 0) {
+        if (rect.x + rect.width > right) {
+            rect.width = Math.max (0, right - rect.x);
+        }
+    }
+    int width = OS.gtk_tree_view_column_get_visible (column) ? rect.width + 1 : 0;
+    return new Rectangle (rect.x, rect.y, width, rect.height + 1);
+}
+
+void redraw () {
+    if ((OS.GTK_WIDGET_FLAGS (parent.handle) & OS.GTK_REALIZED) !is 0) {
+        auto parentHandle = parent.handle;
+        auto path = OS.gtk_tree_model_get_path (parent.modelHandle, handle);
+        GdkRectangle rect;
+        OS.gtk_tree_view_get_cell_area (parentHandle, path, null, &rect);
+        OS.gtk_tree_path_free (path);
+        auto window = OS.gtk_tree_view_get_bin_window (parentHandle);
+        rect.x = 0;
+        int w, h;
+        OS.gdk_drawable_get_size (window, &w, &h);
+        rect.width = w;
+        OS.gdk_window_invalidate_rect (window, &rect, false);
+    }
+}
+
+override void releaseHandle () {
+    if (handle !is null) OS.g_free (handle);
+    handle = null;
+    super.releaseHandle ();
+    parent = null;
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    font = null;
+    cellFont = null;
+}
+
+/**
+ * Sets the receiver's background color to the color specified
+ * by the argument, or to the default system color for the item
+ * if the argument is null.
+ *
+ * @param color the new color (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ */
+public void setBackground (Color color) {
+    checkWidget ();
+    if (color !is null && color.isDisposed ()) {
+        SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (_getBackground ().opEquals (color)) return;
+    GdkColor* gdkColor = color !is null ? color.handle : null;
+    OS.gtk_list_store_set1 (parent.modelHandle, handle, Table.BACKGROUND_COLUMN, gdkColor);
+    /*
+    * Bug in GTK.  When using fixed-height-mode,
+    * row changes do not cause the row to be repainted.  The fix is to
+    * invalidate the row when it is cleared.
+    */
+    if ((parent.style & SWT.VIRTUAL) !is 0) {
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 3, 2) && OS.GTK_VERSION < OS.buildVERSION (2, 6, 3)) {
+            redraw ();
+        }
+    }
+    cached = true;
+}
+
+/**
+ * Sets the background color at the given column index in the receiver
+ * to the color specified by the argument, or to the default system color for the item
+ * if the argument is null.
+ *
+ * @param index the column index
+ * @param color the new color (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setBackground (int index, Color color) {
+    checkWidget ();
+    if (color !is null && color.isDisposed ()) {
+        SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (_getBackground (index).opEquals (color)) return;
+    int count = Math.max (1, parent.getColumnCount ());
+    if (0 > index || index > count - 1) return;
+    int modelIndex = parent.columnCount is 0 ? Table.FIRST_COLUMN : parent.columns [index].modelIndex;
+    GdkColor* gdkColor = color !is null ? color.handle : null;
+    OS.gtk_list_store_set1 (parent.modelHandle, handle, modelIndex + Table.CELL_BACKGROUND, gdkColor);
+    /*
+    * Bug in GTK.  When using fixed-height-mode,
+    * row changes do not cause the row to be repainted.  The fix is to
+    * invalidate the row when it is cleared.
+    */
+    if ((parent.style & SWT.VIRTUAL) !is 0) {
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 3, 2) && OS.GTK_VERSION < OS.buildVERSION (2, 6, 3)) {
+            redraw ();
+        }
+    }
+    cached = true;
+
+    if (color !is null) {
+        bool customDraw = (parent.columnCount is 0)  ? parent.firstCustomDraw : parent.columns [index].customDraw;
+        if (!customDraw) {
+            if ((parent.style & SWT.VIRTUAL) is 0) {
+                auto parentHandle = parent.handle;
+                GtkTreeViewColumn* column;
+                if (parent.columnCount > 0) {
+                    column = cast(GtkTreeViewColumn*)parent.columns [index].handle;
+                } else {
+                    column = OS.gtk_tree_view_get_column (parentHandle, index);
+                }
+                if (column is null) return;
+                auto textRenderer = parent.getTextRenderer (column);
+                auto imageRenderer = parent.getPixbufRenderer (column);
+                display.doCellDataProc( parentHandle, column, cast(GtkCellRenderer*)textRenderer );
+                display.doCellDataProc( parentHandle, column, cast(GtkCellRenderer*)imageRenderer );
+            }
+            if (parent.columnCount is 0) {
+                parent.firstCustomDraw = true;
+            } else {
+                parent.columns [index].customDraw = true;
+            }
+        }
+    }
+}
+
+/**
+ * Sets the checked state of the checkbox for this item.  This state change
+ * only applies if the Table was created with the SWT.CHECK style.
+ *
+ * @param checked the new checked state of the checkbox
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setChecked (bool checked) {
+    checkWidget();
+    if ((parent.style & SWT.CHECK) is 0) return;
+    if (_getChecked () is checked) return;
+    OS.gtk_list_store_set1 (parent.modelHandle, handle, Table.CHECKED_COLUMN, cast(void*)cast(int)checked);
+    /*
+    * GTK+'s "inconsistent" state does not match SWT's concept of grayed.  To
+    * show checked+grayed differently from unchecked+grayed, we must toggle the
+    * grayed state on check and uncheck.
+    */
+    OS.gtk_list_store_set1 (parent.modelHandle, handle, Table.GRAYED_COLUMN, cast(void*)cast(int)( !checked ? false : grayed));
+    cached = true;
+}
+
+/**
+ * Sets the font that the receiver will use to paint textual information
+ * for this item to the font specified by the argument, or to the default font
+ * for that kind of control if the argument is null.
+ *
+ * @param font the new font (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setFont (Font font){
+    checkWidget ();
+    if (font !is null && font.isDisposed ()) {
+        SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+    }
+    Font oldFont = this.font;
+    if (oldFont is font) return;
+    this.font = font;
+    if (oldFont !is null && oldFont.opEquals (font)) return;
+    auto fontHandle = font !is null ? font.handle : null;
+    OS.gtk_list_store_set1 (parent.modelHandle, handle, Table.FONT_COLUMN, fontHandle);
+    /*
+    * Bug in GTK.  When using fixed-height-mode,
+    * row changes do not cause the row to be repainted.  The fix is to
+    * invalidate the row when it is cleared.
+    */
+    if ((parent.style & SWT.VIRTUAL) !is 0) {
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 3, 2) && OS.GTK_VERSION < OS.buildVERSION (2, 6, 3)) {
+            redraw ();
+        }
+    }
+    cached = true;
+}
+
+/**
+ * Sets the font that the receiver will use to paint textual information
+ * for the specified cell in this item to the font specified by the
+ * argument, or to the default font for that kind of control if the
+ * argument is null.
+ *
+ * @param index the column index
+ * @param font the new font (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setFont (int index, Font font) {
+    checkWidget ();
+    if (font !is null && font.isDisposed ()) {
+        SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+    }
+    int count = Math.max (1, parent.getColumnCount ());
+    if (0 > index || index > count - 1) return;
+    if (cellFont is null) {
+        if (font is null) return;
+        cellFont = new Font [count];
+    }
+    Font oldFont = cellFont [index];
+    if (oldFont is font) return;
+    cellFont [index] = font;
+    if (oldFont !is null && oldFont.opEquals (font)) return;
+
+    int modelIndex = parent.columnCount is 0 ? Table.FIRST_COLUMN : parent.columns [index].modelIndex;
+    auto fontHandle  = font !is null ? font.handle : null;
+    OS.gtk_list_store_set1 (parent.modelHandle, handle, modelIndex + Table.CELL_FONT, fontHandle);
+    /*
+    * Bug in GTK.  When using fixed-height-mode,
+    * row changes do not cause the row to be repainted.  The fix is to
+    * invalidate the row when it is cleared.
+    */
+    if ((parent.style & SWT.VIRTUAL) !is 0) {
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 3, 2) && OS.GTK_VERSION < OS.buildVERSION (2, 6, 3)) {
+            redraw ();
+        }
+    }
+    cached = true;
+
+    if (font !is null) {
+        bool customDraw = (parent.columnCount is 0)  ? parent.firstCustomDraw : parent.columns [index].customDraw;
+        if (!customDraw) {
+            if ((parent.style & SWT.VIRTUAL) is 0) {
+                auto parentHandle = parent.handle;
+                GtkTreeViewColumn* column;
+                if (parent.columnCount > 0) {
+                    column = cast(GtkTreeViewColumn*)parent.columns [index].handle;
+                } else {
+                    column = OS.gtk_tree_view_get_column (parentHandle, index);
+                }
+                if (column is null) return;
+                auto textRenderer = parent.getTextRenderer (column);
+                auto imageRenderer = parent.getPixbufRenderer (column);
+                display.doCellDataProc( parentHandle, column, cast(GtkCellRenderer*)textRenderer );
+                display.doCellDataProc( parentHandle, column, cast(GtkCellRenderer*)imageRenderer );
+            }
+            if (parent.columnCount is 0) {
+                parent.firstCustomDraw = true;
+            } else {
+                parent.columns [index].customDraw = true;
+            }
+        }
+    }
+}
+
+/**
+ * Sets the receiver's foreground color to the color specified
+ * by the argument, or to the default system color for the item
+ * if the argument is null.
+ *
+ * @param color the new color (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ */
+public void setForeground (Color color){
+    checkWidget ();
+    if (color !is null && color.isDisposed ()) {
+        SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (_getForeground ().opEquals (color)) return;
+    GdkColor* gdkColor = color !is null ? color.handle : null;
+    OS.gtk_list_store_set1 (parent.modelHandle, handle, Table.FOREGROUND_COLUMN, gdkColor);
+    /*
+    * Bug in GTK.  When using fixed-height-mode,
+    * row changes do not cause the row to be repainted.  The fix is to
+    * invalidate the row when it is cleared.
+    */
+    if ((parent.style & SWT.VIRTUAL) !is 0) {
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 3, 2) && OS.GTK_VERSION < OS.buildVERSION (2, 6, 3)) {
+            redraw ();
+        }
+    }
+    cached = true;
+}
+
+/**
+ * Sets the foreground color at the given column index in the receiver
+ * to the color specified by the argument, or to the default system color for the item
+ * if the argument is null.
+ *
+ * @param index the column index
+ * @param color the new color (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setForeground (int index, Color color){
+    checkWidget ();
+    if (color !is null && color.isDisposed ()) {
+        SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (_getForeground (index).opEquals (color)) return;
+    int count = Math.max (1, parent.getColumnCount ());
+    if (0 > index || index > count - 1) return;
+    int modelIndex = parent.columnCount is 0 ? Table.FIRST_COLUMN : parent.columns [index].modelIndex;
+    GdkColor* gdkColor = color !is null ? color.handle : null;
+    OS.gtk_list_store_set1 (parent.modelHandle, handle, modelIndex + Table.CELL_FOREGROUND, gdkColor);
+    /*
+    * Bug in GTK.  When using fixed-height-mode,
+    * row changes do not cause the row to be repainted.  The fix is to
+    * invalidate the row when it is cleared.
+    */
+    if ((parent.style & SWT.VIRTUAL) !is 0) {
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 3, 2) && OS.GTK_VERSION < OS.buildVERSION (2, 6, 3)) {
+            redraw ();
+        }
+    }
+    cached = true;
+
+    if (color !is null) {
+        bool customDraw = (parent.columnCount is 0)  ? parent.firstCustomDraw : parent.columns [index].customDraw;
+        if (!customDraw) {
+            if ((parent.style & SWT.VIRTUAL) is 0) {
+                auto parentHandle = parent.handle;
+                GtkTreeViewColumn* column;
+                if (parent.columnCount > 0) {
+                    column = cast(GtkTreeViewColumn*)parent.columns [index].handle;
+                } else {
+                    column = OS.gtk_tree_view_get_column (parentHandle, index);
+                }
+                if (column is null) return;
+                auto textRenderer = parent.getTextRenderer (column);
+                auto imageRenderer = parent.getPixbufRenderer (column);
+                display.doCellDataProc( parentHandle, column, cast(GtkCellRenderer*)textRenderer );
+                display.doCellDataProc( parentHandle, column, cast(GtkCellRenderer*)imageRenderer );
+            }
+            if (parent.columnCount is 0) {
+                parent.firstCustomDraw = true;
+            } else {
+                parent.columns [index].customDraw = true;
+            }
+        }
+    }
+}
+
+/**
+ * Sets the grayed state of the checkbox for this item.  This state change
+ * only applies if the Table was created with the SWT.CHECK style.
+ *
+ * @param grayed the new grayed state of the checkbox;
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setGrayed (bool grayed) {
+    checkWidget();
+    if ((parent.style & SWT.CHECK) is 0) return;
+    if (this.grayed is grayed) return;
+    this.grayed = grayed;
+    /*
+    * GTK+'s "inconsistent" state does not match SWT's concept of grayed.
+    * Render checked+grayed as "inconsistent", unchecked+grayed as blank.
+    */
+    void* ptr;
+    OS.gtk_tree_model_get1 (parent.modelHandle, handle, Table.CHECKED_COLUMN, &ptr);
+    OS.gtk_list_store_set1 (parent.modelHandle, handle, Table.GRAYED_COLUMN, cast(void*)cast(int)( ptr is null ? false : grayed));
+    cached = true;
+}
+
+/**
+ * Sets the receiver's image at a column.
+ *
+ * @param index the column index
+ * @param image the new image
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setImage (int index, Image image) {
+    checkWidget ();
+    if (image !is null && image.isDisposed ()) {
+        error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (image !is null && image.type is SWT.ICON) {
+        if (image.opEquals (_getImage (index))) return;
+    }
+    int count = Math.max (1, parent.getColumnCount ());
+    if (0 > index || index > count - 1) return;
+    void* pixbuf;
+    if (image !is null) {
+        ImageList imageList = parent.imageList;
+        if (imageList is null) imageList = parent.imageList = new ImageList ();
+        int imageIndex = imageList.indexOf (image);
+        if (imageIndex is -1) imageIndex = imageList.add (image);
+        pixbuf = imageList.getPixbuf (imageIndex);
+    }
+    int modelIndex = parent.columnCount is 0 ? Table.FIRST_COLUMN : parent.columns [index].modelIndex;
+    OS.gtk_list_store_set1 (parent.modelHandle, handle, modelIndex + Table.CELL_PIXBUF, pixbuf);
+    /*
+    * Bug in GTK.  When using fixed-height-mode,
+    * row changes do not cause the row to be repainted.  The fix is to
+    * invalidate the row when it is cleared.
+    */
+    if ((parent.style & SWT.VIRTUAL) !is 0) {
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 3, 2) && OS.GTK_VERSION < OS.buildVERSION (2, 6, 3)) {
+            redraw ();
+        }
+    }
+    /*
+     * Bug in GTK.  When in fixed height mode, GTK does not recalculate the cell renderer width
+     * when the image is changed in the model.  The fix is to force it to recalculate the width if
+     * more space is required.
+     */
+    if ((parent.style & SWT.VIRTUAL) !is 0 && parent.currentItem is null) {
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 3, 2)) {
+            if (image !is null) {
+                auto parentHandle = parent.handle;
+                auto column = OS.gtk_tree_view_get_column (parentHandle, index);
+                int w;
+                auto pixbufRenderer = parent.getPixbufRenderer(column);
+                OS.gtk_tree_view_column_cell_get_position (column, pixbufRenderer, null, &w);
+                if (w < image.getBounds().width) {
+                    /*
+                    * There is no direct way to clear the cell renderer width so we
+                    * are relying on the fact that it is done as part of modifying
+                    * the style.
+                    */
+                    auto style = OS.gtk_widget_get_modifier_style (parentHandle);
+                    parent.modifyStyle (parentHandle, style);
+                }
+            }
+        }
+    }
+    cached = true;
+}
+
+public override void setImage (Image image) {
+    checkWidget ();
+    setImage (0, image);
+}
+
+/**
+ * Sets the image for multiple columns in the table.
+ *
+ * @param images the array of new images
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if one of the images has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setImage (Image [] images) {
+    checkWidget ();
+    for (int i=0; i<images.length; i++) {
+        setImage (i, images [i]);
+    }
+}
+
+/**
+ * Sets the indent of the first column's image, expressed in terms of the image's width.
+ *
+ * @param indent the new indent
+ *
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @deprecated this functionality is not supported on most platforms
+ */
+public void setImageIndent (int indent) {
+    checkWidget ();
+    if (indent < 0) return;
+    /* Image indent is not supported on GTK */
+    cached = true;
+}
+
+/**
+ * Sets the receiver's text at a column
+ *
+ * @param index the column index
+ * @param string the new text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setText (int index, String string) {
+    checkWidget ();
+    if (_getText (index).equals (string)) return;
+    int count = Math.max (1, parent.getColumnCount ());
+    if (0 > index || index > count - 1) return;
+    char* buffer = toStringz( string );
+    int modelIndex = parent.columnCount is 0 ? Table.FIRST_COLUMN : parent.columns [index].modelIndex;
+    OS.gtk_list_store_set1 (parent.modelHandle, handle, modelIndex + Table.CELL_TEXT, buffer);
+    /*
+    * Bug in GTK.  When using fixed-height-mode,
+    * row changes do not cause the row to be repainted.  The fix is to
+    * invalidate the row when it is cleared.
+    */
+    if ((parent.style & SWT.VIRTUAL) !is 0) {
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 3, 2) && OS.GTK_VERSION < OS.buildVERSION (2, 6, 3)) {
+            redraw ();
+        }
+    }
+    cached = true;
+}
+
+public override void setText (String string) {
+    checkWidget ();
+    setText (0, string);
+}
+
+/**
+ * Sets the text for multiple columns in the table.
+ *
+ * @param strings the array of new strings
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setText (String [] strings) {
+    checkWidget ();
+    for (int i=0; i<strings.length; i++) {
+        String string = strings [i];
+        if (string !is null) setText (i, string);
+    }
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Text.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,2059 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Text;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.VerifyListener;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Scrollable;
+import org.eclipse.swt.widgets.Composite;
+
+static import tango.stdc.string;
+
+/**
+ * Instances of this class are selectable user interface
+ * objects that allow the user to enter and modify text.
+ * Text controls can be either single or multi-line.
+ * When a text control is created with a border, the
+ * operating system includes a platform specific inset
+ * around the contents of the control.  When created
+ * without a border, an effort is made to remove the
+ * inset such that the preferred size of the control
+ * is the same size as the contents.
+ * <p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>CANCEL, CENTER, LEFT, MULTI, PASSWORD, SEARCH, SINGLE, RIGHT, READ_ONLY, WRAP</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>DefaultSelection, Modify, Verify</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles MULTI and SINGLE may be specified,
+ * and only one of the styles LEFT, CENTER, and RIGHT may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#text">Text snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class Text : Scrollable {
+
+    alias Scrollable.computeSize computeSize;
+    alias Scrollable.dragDetect dragDetect;
+    alias Scrollable.setBackgroundColor setBackgroundColor;
+    alias Scrollable.setCursor setCursor;
+    alias Scrollable.setOrientation setOrientation;
+    alias Scrollable.translateTraversal translateTraversal;
+
+    GtkTextBuffer* bufferHandle;
+    int tabs = 8, lastEventTime = 0;
+    GdkEventKey* gdkEventKey;
+    int fixStart = -1, fixEnd = -1;
+    bool doubleClick;
+    String message = "";
+
+    static const int INNER_BORDER = 2;
+    //static const int ITER_SIZEOF = GtkTextIter.sizeof;
+
+    /**
+    * The maximum number of characters that can be entered
+    * into a text widget.
+    * <p>
+    * Note that this value is platform dependent, based upon
+    * the native widget implementation.
+    * </p>
+    */
+    public const static int LIMIT = 0x7FFFFFFF;
+    /**
+    * The delimiter used by multi-line text widgets.  When text
+    * is queried and from the widget, it will be delimited using
+    * this delimiter.
+    */
+    public const static String DELIMITER = "\n";
+    /*
+    * These values can be different on different platforms.
+    * Therefore they are not initialized in the declaration
+    * to stop the compiler from inlining.
+    */
+    // <keinfarbton> avoid static ctor
+    //static {
+    //    LIMIT = 0x7FFFFFFF;
+    //    DELIMITER = "\n";
+    //}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#SINGLE
+ * @see SWT#MULTI
+ * @see SWT#READ_ONLY
+ * @see SWT#WRAP
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Composite parent, int style) {
+    super (parent, checkStyle (style));
+}
+
+static int checkStyle (int style) {
+    if ((style & SWT.SEARCH) !is 0) {
+        style |= SWT.SINGLE | SWT.BORDER;
+        style &= ~SWT.PASSWORD;
+    }
+    style &= ~SWT.SEARCH;
+    if ((style & SWT.SINGLE) !is 0 && (style & SWT.MULTI) !is 0) {
+        style &= ~SWT.MULTI;
+    }
+    style = checkBits (style, SWT.LEFT, SWT.CENTER, SWT.RIGHT, 0, 0, 0);
+    if ((style & SWT.SINGLE) !is 0) style &= ~(SWT.H_SCROLL | SWT.V_SCROLL | SWT.WRAP);
+    if ((style & SWT.WRAP) !is 0) {
+        style |= SWT.MULTI;
+        style &= ~SWT.H_SCROLL;
+    }
+    if ((style & SWT.MULTI) !is 0) style &= ~SWT.PASSWORD;
+    if ((style & (SWT.SINGLE | SWT.MULTI)) !is 0) return style;
+    if ((style & (SWT.H_SCROLL | SWT.V_SCROLL)) !is 0) return style | SWT.MULTI;
+    return style | SWT.SINGLE;
+}
+
+override void createHandle (int index) {
+    state |= HANDLE | MENU;
+    fixedHandle = cast(GtkWidget*) OS.g_object_new (display.gtk_fixed_get_type (), null);
+    if (fixedHandle is null) error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_fixed_set_has_window (cast(GtkFixed*)fixedHandle, true);
+    if ((style & SWT.SINGLE) !is 0) {
+        handle = OS.gtk_entry_new ();
+        if (handle is null) error (SWT.ERROR_NO_HANDLES);
+        OS.gtk_container_add (cast(GtkContainer*)fixedHandle, handle);
+        OS.gtk_editable_set_editable (cast(GtkEditable*)handle, (style & SWT.READ_ONLY) is 0);
+        OS.gtk_entry_set_has_frame (cast(GtkEntry*)handle, (style & SWT.BORDER) !is 0);
+        OS.gtk_entry_set_visibility (cast(GtkEntry*)handle, (style & SWT.PASSWORD) is 0);
+        float alignment = 0.0f;
+        if ((style & SWT.CENTER) !is 0) alignment = 0.5f;
+        if ((style & SWT.RIGHT) !is 0) alignment = 1.0f;
+        if (alignment > 0.0f) {
+            OS.gtk_entry_set_alignment (cast(GtkEntry*)handle, alignment);
+        }
+    } else {
+        scrolledHandle = cast(GtkWidget*) OS.gtk_scrolled_window_new (null, null);
+        if (scrolledHandle is null) error (SWT.ERROR_NO_HANDLES);
+        handle = OS.gtk_text_view_new ();
+        if (handle is null) error (SWT.ERROR_NO_HANDLES);
+        bufferHandle = OS.gtk_text_view_get_buffer (cast(GtkTextView*)handle);
+        if (bufferHandle is null) error (SWT.ERROR_NO_HANDLES);
+        OS.gtk_container_add (cast(GtkContainer*)fixedHandle, scrolledHandle);
+        OS.gtk_container_add (cast(GtkContainer*)scrolledHandle, handle);
+        OS.gtk_text_view_set_editable (cast(GtkTextView*)handle, (style & SWT.READ_ONLY) is 0);
+        if ((style & SWT.WRAP) !is 0) OS.gtk_text_view_set_wrap_mode (cast(GtkTextView*)handle, OS.GTK_WRAP_WORD_CHAR);
+        int hsp = (style & SWT.H_SCROLL) !is 0 ? OS.GTK_POLICY_ALWAYS : OS.GTK_POLICY_NEVER;
+        int vsp = (style & SWT.V_SCROLL) !is 0 ? OS.GTK_POLICY_ALWAYS : OS.GTK_POLICY_NEVER;
+        OS.gtk_scrolled_window_set_policy (cast(GtkScrolledWindow*)scrolledHandle, hsp, vsp);
+        if ((style & SWT.BORDER) !is 0) {
+            OS.gtk_scrolled_window_set_shadow_type (cast(GtkScrolledWindow*)scrolledHandle, OS.GTK_SHADOW_ETCHED_IN);
+        }
+        int just = OS.GTK_JUSTIFY_LEFT;
+        if ((style & SWT.CENTER) !is 0) just = OS.GTK_JUSTIFY_CENTER;
+        if ((style & SWT.RIGHT) !is 0) just = OS.GTK_JUSTIFY_RIGHT;
+        OS.gtk_text_view_set_justification (cast(GtkTextView*)handle, just);
+    }
+}
+
+override void createWidget (int index) {
+    super.createWidget (index);
+    doubleClick = true;
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the receiver's text is modified, by sending
+ * it one of the messages defined in the <code>ModifyListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ModifyListener
+ * @see #removeModifyListener
+ */
+public void addModifyListener (ModifyListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Modify, typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the control is selected by the user, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * <code>widgetSelected</code> is not called for texts.
+ * <code>widgetDefaultSelected</code> is typically called when ENTER is pressed in a single-line text,
+ * or when ENTER is pressed in a search text. If the receiver has the <code>SWT.SEARCH | SWT.CANCEL</code> style
+ * and the user cancels the search, the event object detail field contains the value <code>SWT.CANCEL</code>.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the control is selected by the user
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener(SelectionListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener(listener);
+    addListener(SWT.Selection,typedListener);
+    addListener(SWT.DefaultSelection,typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the receiver's text is verified, by sending
+ * it one of the messages defined in the <code>VerifyListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see VerifyListener
+ * @see #removeVerifyListener
+ */
+public void addVerifyListener (VerifyListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Verify, typedListener);
+}
+
+/**
+ * Appends a string.
+ * <p>
+ * The new text is appended to the text at
+ * the end of the widget.
+ * </p>
+ *
+ * @param string the string to be appended
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void append (String string) {
+    checkWidget ();
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if ((style & SWT.SINGLE) !is 0) {
+        int dummy = -1;
+        OS.gtk_editable_insert_text (cast(GtkEditable*)handle, string.ptr, string.length, &dummy );
+        OS.gtk_editable_set_position (cast(GtkEditable*)handle, -1);
+    } else {
+        GtkTextIter position;
+        OS.gtk_text_buffer_get_end_iter (bufferHandle, &position);
+        OS.gtk_text_buffer_insert (bufferHandle, &position, string.ptr, string.length);
+        OS.gtk_text_buffer_place_cursor (bufferHandle, &position);
+        auto mark = OS.gtk_text_buffer_get_insert (bufferHandle);
+        OS.gtk_text_view_scroll_mark_onscreen (cast(GtkTextView*)handle, mark);
+    }
+}
+
+/**
+ * Clears the selection.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void clearSelection () {
+    checkWidget ();
+    if ((style & SWT.SINGLE) !is 0) {
+        int position = OS.gtk_editable_get_position (cast(GtkEditable*)handle);
+        OS.gtk_editable_select_region (cast(GtkEditable*)handle, position, position);
+    } else {
+        GtkTextIter position;
+        auto insertMark = OS.gtk_text_buffer_get_insert (bufferHandle);
+        auto selectionMark = OS.gtk_text_buffer_get_selection_bound (bufferHandle);
+        OS.gtk_text_buffer_get_iter_at_mark (bufferHandle, &position, insertMark);
+        OS.gtk_text_buffer_move_mark (bufferHandle, selectionMark, &position);
+        OS.gtk_text_buffer_move_mark (bufferHandle, insertMark, &position);
+    }
+}
+
+override public Point computeSize (int wHint, int hHint, bool changed) {
+    checkWidget ();
+    if (wHint !is SWT.DEFAULT && wHint < 0) wHint = 0;
+    if (hHint !is SWT.DEFAULT && hHint < 0) hHint = 0;
+    int w , h;
+    if ((style & SWT.SINGLE) !is 0) {
+        OS.gtk_widget_realize (handle);
+        auto layout = OS.gtk_entry_get_layout (cast(GtkEntry*)handle);
+        OS.pango_layout_get_size (layout, &w, &h);
+    } else {
+        GtkTextIter start;
+        GtkTextIter end;
+        OS.gtk_text_buffer_get_bounds (bufferHandle, &start, &end);
+        auto text = OS.gtk_text_buffer_get_text (bufferHandle, &start, &end, true);
+        auto layout = OS.gtk_widget_create_pango_layout (handle, text);
+        OS.g_free (text);
+        OS.pango_layout_set_width (layout, wHint * OS.PANGO_SCALE);
+        OS.pango_layout_get_size (layout, &w, &h);
+        OS.g_object_unref (layout);
+    }
+    int width = OS.PANGO_PIXELS (w);
+    int height = OS.PANGO_PIXELS (h);
+    //This code is intentionally commented
+//  if ((style & SWT.SEARCH) !is 0 && message.length () !is 0) {
+//      GC gc = new GC (this);
+//      Point size = gc.stringExtent (message);
+//      width = Math.max (width, size.x);
+//      gc.dispose ();
+//  }
+    if (width is 0) width = DEFAULT_WIDTH;
+    if (height is 0) height = DEFAULT_HEIGHT;
+    width = wHint is SWT.DEFAULT ? width : wHint;
+    height = hHint is SWT.DEFAULT ? height : hHint;
+    Rectangle trim = computeTrim (0, 0, width, height);
+    return new Point (trim.width, trim.height);
+}
+
+override public Rectangle computeTrim (int x, int y, int width, int height) {
+    checkWidget ();
+    Rectangle trim = super.computeTrim (x, y, width, height);
+    int xborder = 0, yborder = 0;
+    if ((style & SWT.SINGLE) !is 0) {
+        if ((style & SWT.BORDER) !is 0) {
+            auto style = OS.gtk_widget_get_style (handle);
+            xborder += OS.gtk_style_get_xthickness (style);
+            yborder += OS.gtk_style_get_ythickness (style);
+        }
+        xborder += INNER_BORDER;
+        yborder += INNER_BORDER;
+    } else {
+        int borderWidth = OS.gtk_container_get_border_width (cast(GtkContainer*)handle);
+        xborder += borderWidth;
+        yborder += borderWidth;
+    }
+    int property;
+    OS.gtk_widget_style_get1 (handle, OS.interior_focus.ptr, &property);
+    if (property is 0) {
+        OS.gtk_widget_style_get1 (handle, OS.focus_line_width.ptr, &property);
+        xborder += property;
+        yborder += property;
+    }
+    trim.x -= xborder;
+    trim.y -= yborder;
+    trim.width += 2 * xborder;
+    trim.height += 2 * yborder;
+    return new Rectangle (trim.x, trim.y, trim.width, trim.height);
+}
+
+/**
+ * Copies the selected text.
+ * <p>
+ * The current selection is copied to the clipboard.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void copy () {
+    checkWidget ();
+    if ((style & SWT.SINGLE) !is 0) {
+        OS.gtk_editable_copy_clipboard (cast(GtkEditable*)handle);
+    } else {
+        auto clipboard = OS.gtk_clipboard_get (cast(void*)OS.GDK_NONE);
+        OS.gtk_text_buffer_copy_clipboard (bufferHandle, clipboard);
+    }
+}
+
+/**
+ * Cuts the selected text.
+ * <p>
+ * The current selection is first copied to the
+ * clipboard and then deleted from the widget.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void cut () {
+    checkWidget ();
+    if ((style & SWT.SINGLE) !is 0) {
+        OS.gtk_editable_cut_clipboard (cast(GtkEditable*)handle);
+    } else {
+        auto clipboard = OS.gtk_clipboard_get (cast(void*)OS.GDK_NONE);
+        OS.gtk_text_buffer_cut_clipboard (bufferHandle, clipboard, OS.gtk_text_view_get_editable (cast(GtkTextView*)handle));
+    }
+}
+
+override void deregister () {
+    super.deregister ();
+    if (bufferHandle !is null) display.removeWidget (cast(GtkWidget*)bufferHandle);
+    auto imContext = imContext ();
+    if (imContext !is null) display.removeWidget (cast(GtkWidget*)imContext);
+}
+
+override bool dragDetect (int x, int y, bool filter, bool* consume) {
+    if (filter) {
+        int start = 0, end = 0;
+        if ((style & SWT.SINGLE) !is 0) {
+            int s, e;
+            OS.gtk_editable_get_selection_bounds (cast(GtkEditable*)handle, &s, &e);
+            start = s;
+            end = e;
+        } else {
+            GtkTextIter s;
+            GtkTextIter e;
+            OS.gtk_text_buffer_get_selection_bounds (bufferHandle, &s, &e);
+            start = OS.gtk_text_iter_get_offset (&s);
+            end = OS.gtk_text_iter_get_offset (&e);
+        }
+        if (start !is end) {
+            if (end < start) {
+                int temp = end;
+                end = start;
+                start = temp;
+            }
+            int position = -1;
+            if ((style & SWT.SINGLE) !is 0) {
+                int index;
+                int trailing;
+                auto layout = OS.gtk_entry_get_layout (cast(GtkEntry*)handle);
+                OS.pango_layout_xy_to_index (layout, x * OS.PANGO_SCALE, y * OS.PANGO_SCALE, &index, &trailing);
+                auto ptr = OS.pango_layout_get_text (layout);
+                position = cast(int)/*64*/OS.g_utf8_pointer_to_offset (ptr, ptr + index) + trailing;
+            } else {
+                GtkTextIter p;
+                OS.gtk_text_view_get_iter_at_location (cast(GtkTextView*)handle, &p, x, y);
+                position = OS.gtk_text_iter_get_offset (&p);
+            }
+            if (start <= position && position < end) {
+                if (super.dragDetect (x, y, filter, consume)) {
+                    if (consume !is null) consume [0] = true;
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+    return super.dragDetect (x, y, filter, consume);
+}
+
+override GdkDrawable* eventWindow () {
+    return paintWindow ();
+}
+
+override bool filterKey (int keyval, GdkEventKey* event) {
+    int time = OS.gdk_event_get_time (cast(GdkEvent*)event);
+    if (time !is lastEventTime) {
+        lastEventTime = time;
+        auto imContext = imContext ();
+        if (imContext !is null) {
+            return cast(bool)OS.gtk_im_context_filter_keypress (imContext, event);
+        }
+    }
+    gdkEventKey = event;
+    return false;
+}
+
+void fixIM () {
+    /*
+    *  The IM filter has to be called one time for each key press event.
+    *  When the IM is open the key events are duplicated. The first event
+    *  is filtered by SWT and the second event is filtered by GTK.  In some
+    *  cases the GTK handler does not run (the widget is destroyed, the
+    *  application code consumes the event, etc), for these cases the IM
+    *  filter has to be called by SWT.
+    */
+    if (gdkEventKey !is null && gdkEventKey !is cast(GdkEventKey*)-1) {
+        auto imContext = imContext ();
+        if (imContext !is null) {
+            OS.gtk_im_context_filter_keypress (imContext, gdkEventKey);
+            gdkEventKey = cast(GdkEventKey*)-1;
+            return;
+        }
+    }
+    gdkEventKey = null;
+}
+
+override GdkColor* getBackgroundColor () {
+    return getBaseColor ();
+}
+
+public override int getBorderWidth () {
+    checkWidget();
+    if ((style & SWT.MULTI) !is 0) return super.getBorderWidth ();
+    auto style = OS.gtk_widget_get_style (handle);
+    if ((this.style & SWT.BORDER) !is 0) {
+         return OS.gtk_style_get_xthickness (style);
+    }
+    return 0;
+}
+
+/**
+ * Returns the line number of the caret.
+ * <p>
+ * The line number of the caret is returned.
+ * </p>
+ *
+ * @return the line number
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getCaretLineNumber () {
+    checkWidget ();
+    if ((style & SWT.SINGLE) !is 0) return 1;
+    GtkTextIter position;
+    auto mark = OS.gtk_text_buffer_get_insert (bufferHandle);
+    OS.gtk_text_buffer_get_iter_at_mark (bufferHandle, &position, mark);
+    return OS.gtk_text_iter_get_line (&position);
+}
+
+/**
+ * Returns a point describing the receiver's location relative
+ * to its parent (or its display if its parent is null).
+ * <p>
+ * The location of the caret is returned.
+ * </p>
+ *
+ * @return a point, the location of the caret
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Point getCaretLocation () {
+    checkWidget ();
+    if ((style & SWT.SINGLE) !is 0) {
+        int index = OS.gtk_editable_get_position (cast(GtkEditable*)handle);
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 6, 0)) {
+            index = OS.gtk_entry_text_index_to_layout_index (cast(GtkEntry*)handle, index);
+        }
+        int offset_x, offset_y;
+        OS.gtk_entry_get_layout_offsets (cast(GtkEntry*)handle, &offset_x, &offset_y);
+        auto layout = OS.gtk_entry_get_layout (cast(GtkEntry*)handle);
+        PangoRectangle pos;
+        OS.pango_layout_index_to_pos (layout, index, &pos);
+        int x = offset_x + OS.PANGO_PIXELS (pos.x) - getBorderWidth ();
+        int y = offset_y + OS.PANGO_PIXELS (pos.y);
+        return new Point (x, y);
+    }
+    GtkTextIter position;
+    auto mark = OS.gtk_text_buffer_get_insert (bufferHandle);
+    OS.gtk_text_buffer_get_iter_at_mark (bufferHandle, &position, mark);
+    GdkRectangle rect;
+    OS.gtk_text_view_get_iter_location (cast(GtkTextView*)handle, &position, &rect);
+    int x;
+    int y;
+    OS.gtk_text_view_buffer_to_window_coords (cast(GtkTextView*)handle, OS.GTK_TEXT_WINDOW_TEXT, rect.x, rect.y, &x, &y);
+    return new Point (x, y);
+}
+
+/**
+ * Returns the character position of the caret.
+ * <p>
+ * Indexing is zero based.
+ * </p>
+ *
+ * @return the position of the caret
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getCaretPosition () {
+    checkWidget ();
+    if ((style & SWT.SINGLE) !is 0)  {
+        return OS.gtk_editable_get_position (cast(GtkEditable*)handle);
+    }
+    GtkTextIter position;
+    auto mark = OS.gtk_text_buffer_get_insert (bufferHandle);
+    OS.gtk_text_buffer_get_iter_at_mark (bufferHandle, &position, mark);
+    return OS.gtk_text_iter_get_offset (&position);
+}
+
+/**
+ * Returns the number of characters.
+ *
+ * @return number of characters in the widget
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getCharCount () {
+    checkWidget ();
+    if ((style & SWT.SINGLE) !is 0) {
+        auto ptr = OS.gtk_entry_get_text (cast(GtkEntry*)handle);
+        return cast(int)/*64*/OS.g_utf8_strlen (ptr, -1);
+    }
+    return OS.gtk_text_buffer_get_char_count (bufferHandle);
+}
+
+/**
+ * Returns the double click enabled flag.
+ * <p>
+ * The double click flag enables or disables the
+ * default action of the text widget when the user
+ * double clicks.
+ * </p>
+ *
+ * @return whether or not double click is enabled
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool getDoubleClickEnabled () {
+    checkWidget ();
+    return doubleClick;
+}
+
+/**
+ * Returns the echo character.
+ * <p>
+ * The echo character is the character that is
+ * displayed when the user enters text or the
+ * text is changed by the programmer.
+ * </p>
+ *
+ * @return the echo character
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setEchoChar
+ */
+public char getEchoChar () {
+    checkWidget ();
+    if ((style & SWT.SINGLE) !is 0) {
+        if (!OS.gtk_entry_get_visibility (cast(GtkEntry*)handle)) {
+            return OS.gtk_entry_get_invisible_char (cast(GtkEntry*)handle);
+        }
+    }
+    return '\0';
+}
+
+/**
+ * Returns the editable state.
+ *
+ * @return whether or not the receiver is editable
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool getEditable () {
+    checkWidget ();
+    if ((style & SWT.SINGLE) !is 0) {
+        return cast(bool)OS.gtk_editable_get_editable (cast(GtkEditable*)handle);
+    }
+    return cast(bool)OS.gtk_text_view_get_editable (cast(GtkTextView*)handle);
+}
+
+override GdkColor* getForegroundColor () {
+    return getTextColor ();
+}
+
+/**
+ * Returns the number of lines.
+ *
+ * @return the number of lines in the widget
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getLineCount () {
+    checkWidget ();
+    if ((style & SWT.SINGLE) !is 0) return 1;
+    return OS.gtk_text_buffer_get_line_count (bufferHandle);
+}
+
+/**
+ * Returns the line delimiter.
+ *
+ * @return a string that is the line delimiter
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #DELIMITER
+ */
+public String getLineDelimiter () {
+    checkWidget ();
+    return "\n";
+}
+
+/**
+ * Returns the height of a line.
+ *
+ * @return the height of a row of text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getLineHeight () {
+    checkWidget ();
+    return fontHeight (getFontDescription (), handle);
+}
+
+/**
+ * Returns the widget message. When the widget is created
+ * with the style <code>SWT.SEARCH</code>, the message text
+ * is displayed as a hint for the user, indicating the
+ * purpose of the field.
+ * <p>
+ * Note: This operation is a <em>HINT</em> and is not
+ * supported on platforms that do not have this concept.
+ * </p>
+ *
+ * @return the widget message
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.3
+ */
+public String getMessage () {
+    checkWidget ();
+    return message;
+}
+
+/**
+ * Returns the orientation of the receiver, which will be one of the
+ * constants <code>SWT.LEFT_TO_RIGHT</code> or <code>SWT.RIGHT_TO_LEFT</code>.
+ *
+ * @return the orientation style
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.1.2
+ */
+public int getOrientation () {
+    checkWidget();
+    return style & (SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT);
+}
+
+/*public*/ int getPosition (Point point) {
+    checkWidget ();
+    if (point is null) error (SWT.ERROR_NULL_ARGUMENT);
+    int position = -1;
+    if ((style & SWT.SINGLE) !is 0) {
+        int index;
+        int trailing;
+        auto layout = OS.gtk_entry_get_layout (cast(GtkEntry*)handle);
+        OS.pango_layout_xy_to_index (layout, point.x * OS.PANGO_SCALE, point.y * OS.PANGO_SCALE, &index, &trailing);
+        auto ptr = OS.pango_layout_get_text (layout);
+        position = cast(int)/*64*/OS.g_utf8_pointer_to_offset (ptr, ptr + index) + trailing;
+    } else {
+        GtkTextIter p;
+        OS.gtk_text_view_get_iter_at_location (cast(GtkTextView*)handle, &p, point.x, point.y);
+        position = OS.gtk_text_iter_get_offset (&p);
+    }
+    return position;
+}
+
+/**
+ * Returns a <code>Point</code> whose x coordinate is the
+ * character position representing the start of the selected
+ * text, and whose y coordinate is the character position
+ * representing the end of the selection. An "empty" selection
+ * is indicated by the x and y coordinates having the same value.
+ * <p>
+ * Indexing is zero based.  The range of a selection is from
+ * 0..N where N is the number of characters in the widget.
+ * </p>
+ *
+ * @return a point representing the selection start and end
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Point getSelection () {
+    checkWidget ();
+    if ((style & SWT.SINGLE) !is 0) {
+        int start;
+        int end;
+        OS.gtk_editable_get_selection_bounds (cast(GtkEditable*)handle, &start, &end);
+        return new Point (start, end);
+    }
+    GtkTextIter start;
+    GtkTextIter end;
+    OS.gtk_text_buffer_get_selection_bounds (bufferHandle, &start, &end);
+    return new Point (OS.gtk_text_iter_get_offset (&start), OS.gtk_text_iter_get_offset (&end));
+}
+
+/**
+ * Returns the number of selected characters.
+ *
+ * @return the number of selected characters.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSelectionCount () {
+    checkWidget ();
+    Point selection = getSelection ();
+    return Math.abs (selection.y - selection.x);
+}
+
+/**
+ * Gets the selected text, or an empty string if there is no current selection.
+ *
+ * @return the selected text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getSelectionText () {
+    checkWidget ();
+    Point selection = getSelection ();
+    return getText ()[ selection.x .. selection.y ];
+}
+
+/**
+ * Returns the number of tabs.
+ * <p>
+ * Tab stop spacing is specified in terms of the
+ * space (' ') character.  The width of a single
+ * tab stop is the pixel width of the spaces.
+ * </p>
+ *
+ * @return the number of tab characters
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getTabs () {
+    checkWidget ();
+    return tabs;
+}
+
+int getTabWidth (int tabs) {
+    auto layout = OS.gtk_widget_create_pango_layout (handle, " ".ptr );
+    int width;
+    int height;
+    OS.pango_layout_get_size (layout, &width, &height);
+    OS.g_object_unref (layout);
+    return width * tabs;
+}
+
+/**
+ * Returns the widget text.
+ * <p>
+ * The text for a text widget is the characters in the widget, or
+ * an empty string if this has never been set.
+ * </p>
+ *
+ * @return the widget text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getText () {
+    checkWidget ();
+    char* address;
+    if ((style & SWT.SINGLE) !is 0) {
+        address = OS.gtk_entry_get_text (cast(GtkEntry*)handle);
+    } else {
+        GtkTextIter start;
+        GtkTextIter end;
+        OS.gtk_text_buffer_get_bounds (bufferHandle, &start, &end);
+        address = OS.gtk_text_buffer_get_text (bufferHandle, &start, &end, true);
+    }
+    if (address is null) return "";
+    String res = fromStringz( address ).dup;
+    if ((style & SWT.MULTI) !is 0) OS.g_free (address);
+    return res;
+}
+
+/**
+ * Returns a range of text.  Returns an empty string if the
+ * start of the range is greater than the end.
+ * <p>
+ * Indexing is zero based.  The range of
+ * a selection is from 0..N-1 where N is
+ * the number of characters in the widget.
+ * </p>
+ *
+ * @param start the start of the range
+ * @param end the end of the range
+ * @return the range of text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getText (int start, int end) {
+    checkWidget ();
+    if (!(start <= end && 0 <= end)) return "";
+    start = Math.max (0, start);
+    char* address;
+    if ((style & SWT.SINGLE) !is 0) {
+        address = OS.gtk_editable_get_chars (cast(GtkEditable*)handle, start, end + 1);
+    } else {
+        int length = OS.gtk_text_buffer_get_char_count (bufferHandle);
+        end = Math.min (end, length - 1);
+        GtkTextIter startIter;
+        GtkTextIter endIter;
+        OS.gtk_text_buffer_get_iter_at_offset (bufferHandle, &startIter, start);
+        OS.gtk_text_buffer_get_iter_at_offset (bufferHandle, &endIter, end + 1);
+        address = OS.gtk_text_buffer_get_text (bufferHandle, &startIter, &endIter, true);
+    }
+    if (address is null) error (SWT.ERROR_CANNOT_GET_TEXT);
+    String res = fromStringz( address ).dup;
+    OS.g_free (address);
+    return res;
+}
+
+/**
+ * Returns the maximum number of characters that the receiver is capable of holding.
+ * <p>
+ * If this has not been changed by <code>setTextLimit()</code>,
+ * it will be the constant <code>Text.LIMIT</code>.
+ * </p>
+ *
+ * @return the text limit
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #LIMIT
+ */
+public int getTextLimit () {
+    checkWidget ();
+    if ((style & SWT.MULTI) !is 0) return LIMIT;
+    int limit = OS.gtk_entry_get_max_length (cast(GtkEntry*)handle);
+    return limit is 0 ? 0xFFFF : limit;
+}
+
+/**
+ * Returns the zero-relative index of the line which is currently
+ * at the top of the receiver.
+ * <p>
+ * This index can change when lines are scrolled or new lines are added or removed.
+ * </p>
+ *
+ * @return the index of the top line
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getTopIndex () {
+    checkWidget ();
+    if ((style & SWT.SINGLE) !is 0) return 0;
+    GtkTextIter position;
+    GdkRectangle rect;
+    OS.gtk_text_view_get_visible_rect (cast(GtkTextView*)handle, &rect);
+    OS.gtk_text_view_get_line_at_y (cast(GtkTextView*)handle, &position, rect.y, null);
+    return OS.gtk_text_iter_get_line (&position);
+}
+
+/**
+ * Returns the top pixel.
+ * <p>
+ * The top pixel is the pixel position of the line
+ * that is currently at the top of the widget.  On
+ * some platforms, a text widget can be scrolled by
+ * pixels instead of lines so that a partial line
+ * is displayed at the top of the widget.
+ * </p><p>
+ * The top pixel changes when the widget is scrolled.
+ * The top pixel does not include the widget trimming.
+ * </p>
+ *
+ * @return the pixel position of the top line
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getTopPixel () {
+    checkWidget ();
+    if ((style & SWT.SINGLE) !is 0) return 0;
+    GtkTextIter position;
+    GdkRectangle rect;
+    OS.gtk_text_view_get_visible_rect (cast(GtkTextView*)handle, &rect);
+    int lineTop;
+    OS.gtk_text_view_get_line_at_y (cast(GtkTextView*)handle, &position, rect.y, &lineTop);
+    return lineTop;
+}
+
+override int /*long*/ gtk_activate (GtkWidget* widget) {
+    postEvent (SWT.DefaultSelection);
+    return 0;
+}
+
+override int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* gdkEvent) {
+    auto result = super.gtk_button_press_event (widget, gdkEvent);
+    if (result !is 0) return result;
+    if (!doubleClick) {
+        switch (gdkEvent.type) {
+            case OS.GDK_2BUTTON_PRESS:
+            case OS.GDK_3BUTTON_PRESS:
+                return 1;
+            default:
+        }
+    }
+    return result;
+}
+
+
+override int /*long*/ gtk_changed (GtkWidget* widget) {
+    /*
+    * Feature in GTK.  When the user types, GTK positions
+    * the caret after sending the changed signal.  This
+    * means that application code that attempts to position
+    * the caret during a changed signal will fail.  The fix
+    * is to post the modify event when the user is typing.
+    */
+    bool keyPress = false;
+    auto eventPtr = OS.gtk_get_current_event ();
+    if (eventPtr !is null) {
+        GdkEventKey* gdkEvent = cast(GdkEventKey*)eventPtr;
+        switch (gdkEvent.type) {
+            case OS.GDK_KEY_PRESS:
+                keyPress = true;
+                break;
+            default:
+        }
+        OS.gdk_event_free (eventPtr);
+    }
+    if (keyPress) {
+        postEvent (SWT.Modify);
+    } else {
+        sendEvent (SWT.Modify);
+    }
+    return 0;
+}
+
+override int /*long*/ gtk_commit (GtkIMContext* imcontext, char* text) {
+    if (text is null) return 0;
+    if ((style & SWT.SINGLE) !is 0) {
+        if (!OS.gtk_editable_get_editable (cast(GtkEditable*)handle)) return 0;
+    }
+    char [] chars = fromStringz( text ).dup;
+    if (chars.length is 0) return 0;
+    char [] newChars = sendIMKeyEvent (SWT.KeyDown, null, chars);
+    if (newChars is null) return 0;
+    /*
+     * Feature in GTK.  For a GtkEntry, during the insert-text signal,
+     * GTK allows the programmer to change only the caret location,
+     * not the selection.  If the programmer changes the selection,
+     * the new selection is lost.  The fix is to detect a selection
+     * change and set it after the insert-text signal has completed.
+     */
+    fixStart = fixEnd = -1;
+    OS.g_signal_handlers_block_matched (imContext, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCOMMIT);
+    int id = OS.g_signal_lookup (OS.commit.ptr, OS.gtk_im_context_get_type ());
+    int mask =  OS.G_SIGNAL_MATCH_DATA | OS.G_SIGNAL_MATCH_ID;
+    OS.g_signal_handlers_unblock_matched (imContext, mask, id, 0, null, null, cast(void*)handle);
+    if (newChars is chars) {
+        OS.g_signal_emit_by_name1 (imContext, OS.commit.ptr, cast(int)text);
+    } else {
+        OS.g_signal_emit_by_name1 (imContext, OS.commit.ptr, cast(int)toStringz(newChars) );
+    }
+    OS.g_signal_handlers_unblock_matched (imContext, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCOMMIT );
+    OS.g_signal_handlers_block_matched (imContext, mask, id, 0, null, null, cast(void*)handle);
+    if ((style & SWT.SINGLE) !is 0) {
+        if (fixStart !is -1 && fixEnd !is -1) {
+            OS.gtk_editable_set_position (cast(GtkEditable*)handle, fixStart);
+            OS.gtk_editable_select_region (cast(GtkEditable*)handle, fixStart, fixEnd);
+        }
+    }
+    fixStart = fixEnd = -1;
+    return 0;
+}
+
+override int /*long*/ gtk_delete_range (GtkWidget* widget, int /*long*/ iter1, int /*long*/ iter2) {
+    if (!hooks (SWT.Verify) && !filters (SWT.Verify)) return 0;
+    GtkTextIter startIter = *cast(GtkTextIter*)iter1;
+    GtkTextIter endIter = *cast(GtkTextIter*)iter2;
+    int start = OS.gtk_text_iter_get_offset (&startIter);
+    int end = OS.gtk_text_iter_get_offset (&endIter);
+    String newText = verifyText ("", start, end);
+    if (newText is null) {
+        /* Remember the selection when the text was deleted */
+        OS.gtk_text_buffer_get_selection_bounds (bufferHandle, &startIter, &endIter);
+        start = OS.gtk_text_iter_get_offset (&startIter);
+        end = OS.gtk_text_iter_get_offset (&endIter);
+        if (start !is end) {
+            fixStart = start;
+            fixEnd = end;
+        }
+        OS.g_signal_stop_emission_by_name (bufferHandle, OS.delete_range.ptr);
+    } else {
+        if (newText.length > 0) {
+            OS.g_signal_handlers_block_matched (bufferHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+            OS.g_signal_handlers_block_matched (bufferHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udDELETE_RANGE);
+            OS.gtk_text_buffer_delete (bufferHandle, &startIter, &endIter);
+            OS.g_signal_handlers_unblock_matched (bufferHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udDELETE_RANGE);
+            OS.g_signal_handlers_unblock_matched (bufferHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+            OS.g_signal_handlers_block_matched (bufferHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udTEXT_BUFFER_INSERT_TEXT);
+            OS.gtk_text_buffer_insert (bufferHandle, &startIter, newText.ptr, newText.length);
+            OS.g_signal_handlers_unblock_matched (bufferHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udTEXT_BUFFER_INSERT_TEXT);
+            OS.g_signal_stop_emission_by_name (bufferHandle, OS.delete_range.ptr);
+        }
+    }
+    return 0;
+}
+
+override int /*long*/ gtk_delete_text (GtkWidget* widget, int /*long*/ start_pos, int /*long*/ end_pos) {
+    if (!hooks (SWT.Verify) && !filters (SWT.Verify)) return 0;
+    String newText = verifyText ("", cast(int)/*64*/start_pos, cast(int)/*64*/end_pos);
+    if (newText is null) {
+        /* Remember the selection when the text was deleted */
+        int newStart, newEnd;
+        OS.gtk_editable_get_selection_bounds (cast(GtkEditable*)handle, &newStart, &newEnd);
+        if (newStart !is newEnd) {
+            fixStart = newStart;
+            fixEnd = newEnd;
+        }
+        OS.g_signal_stop_emission_by_name (handle, OS.delete_text.ptr);
+    } else {
+        if (newText.length > 0) {
+            int pos;
+            pos = cast(int)/*64*/end_pos;
+            OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+            OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udINSERT_TEXT);
+            OS.gtk_editable_insert_text (cast(GtkEditable*)handle, newText.ptr, newText.length, &pos);
+            OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udINSERT_TEXT);
+            OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+            OS.gtk_editable_set_position (cast(GtkEditable*)handle, pos);
+        }
+    }
+    return 0;
+}
+
+override int /*long*/ gtk_event_after (GtkWidget* widget, GdkEvent* event) {
+    if (cursor !is null) gtk_setCursor (cursor.handle);
+    /*
+    * Feature in GTK.  The gtk-entry-select-on-focus property is a global
+    * setting.  Return it to its default value after the GtkEntry has done
+    * its focus in processing so that other widgets (such as the combo)
+    * use the correct value.
+    */
+    if ((style & SWT.SINGLE) !is 0 && display.entrySelectOnFocus) {
+        switch (event.type) {
+            case OS.GDK_FOCUS_CHANGE:
+                GdkEventFocus* gdkEventFocus = cast(GdkEventFocus*)event;
+                if (gdkEventFocus.in_ is 0) {
+                    auto settings = OS.gtk_settings_get_default ();
+                    OS.g_object_set1 (settings, OS.gtk_entry_select_on_focus.ptr, true );
+                }
+                break;
+            default:
+        }
+    }
+    return super.gtk_event_after (widget, event);
+}
+
+override int /*long*/ gtk_focus_out_event (GtkWidget* widget, GdkEventFocus* event) {
+    fixIM ();
+    return super.gtk_focus_out_event (widget, event);
+}
+
+override int /*long*/ gtk_grab_focus (GtkWidget* widget) {
+    auto result = super.gtk_grab_focus (widget);
+    /*
+    * Feature in GTK.  GtkEntry widgets select their text on focus in,
+    * clearing the previous selection.  This behavior is controlled by
+    * the gtk-entry-select-on-focus property.  The fix is to disable
+    * this property when a GtkEntry is given focus and restore it after
+    * the entry has done focus in processing.
+    */
+    if ((style & SWT.SINGLE) !is 0 && display.entrySelectOnFocus) {
+        auto settings = OS.gtk_settings_get_default ();
+        OS.g_object_set1 (settings, OS.gtk_entry_select_on_focus.ptr, false );
+    }
+    return result;
+}
+
+override int /*long*/ gtk_insert_text (GtkEditable* widget, char* new_text, int new_text_length, int position) {
+    if (!hooks (SWT.Verify) && !filters (SWT.Verify)) return 0;
+    if (new_text is null || new_text_length is 0) return 0;
+    String oldText = (cast(char*)new_text)[ 0 .. new_text_length ].dup;
+    int pos;
+    pos = *cast(int*)position;
+    if (pos is -1) {
+        auto ptr = OS.gtk_entry_get_text (cast(GtkEntry*)handle);
+        pos = cast(int)/*64*/OS.g_utf8_strlen (ptr, -1);
+    }
+    /* Use the selection when the text was deleted */
+    int start = pos, end = pos;
+    if (fixStart !is -1 && fixEnd !is -1) {
+        start = pos = fixStart;
+        end = fixEnd;
+        fixStart = fixEnd = -1;
+    }
+    String newText = verifyText (oldText, start, end);
+    if (newText !is oldText) {
+        int newStart, newEnd;
+        OS.gtk_editable_get_selection_bounds (cast(GtkEditable*)handle, &newStart, &newEnd);
+        if (newText !is null) {
+            if (newStart !is newEnd) {
+                OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udDELETE_TEXT);
+                OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+                OS.gtk_editable_delete_selection (cast(GtkEditable*)handle);
+                OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udDELETE_TEXT);
+                OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+            }
+            OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udINSERT_TEXT);
+            OS.gtk_editable_insert_text (cast(GtkEditable*)handle, newText.ptr, newText.length, &pos);
+            OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udINSERT_TEXT);
+            newStart = newEnd = pos;
+        }
+        pos  = newEnd;
+        if (newStart !is newEnd) {
+            fixStart = newStart;
+            fixEnd = newEnd;
+        }
+        *cast(int*)position = pos;
+        OS.g_signal_stop_emission_by_name (handle, OS.insert_text.ptr);
+    }
+    return 0;
+}
+
+override int /*long*/ gtk_key_press_event (GtkWidget* widget, GdkEventKey* event) {
+    auto result = super.gtk_key_press_event (widget, event);
+    if (result !is 0) fixIM ();
+    if (gdkEventKey is cast(GdkEventKey*)-1) result = 1;
+    gdkEventKey = null;
+    return result;
+}
+
+override int /*long*/ gtk_populate_popup (GtkWidget* widget, GtkWidget* menu) {
+    if ((style & SWT.RIGHT_TO_LEFT) !is 0) {
+        OS.gtk_widget_set_direction (menu, OS.GTK_TEXT_DIR_RTL);
+        display.doSetDirectionProc (menu, OS.GTK_TEXT_DIR_RTL);
+    }
+    return 0;
+}
+
+override int /*long*/ gtk_text_buffer_insert_text (GtkTextBuffer *widget, GtkTextIter *iter, char *text, int len) {
+    if (!hooks (SWT.Verify) && !filters (SWT.Verify)) return 0;
+    GtkTextIter position = *iter;
+    /* Use the selection when the text was deleted */
+    int start = OS.gtk_text_iter_get_offset (&position), end = start;
+    if (fixStart !is -1 && fixEnd !is -1) {
+        start = fixStart;
+        end = fixEnd;
+        fixStart = fixEnd = -1;
+    }
+    String oldText = text[ 0 .. len ];
+    String newText = verifyText (oldText, start, end);
+    if (newText is null) {
+        OS.g_signal_stop_emission_by_name (bufferHandle, OS.insert_text.ptr);
+    } else {
+        if (newText !is oldText) {
+            OS.g_signal_handlers_block_matched (bufferHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udTEXT_BUFFER_INSERT_TEXT);
+            OS.gtk_text_buffer_insert (bufferHandle, iter, newText.ptr, newText.length);
+            OS.g_signal_handlers_unblock_matched (bufferHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udTEXT_BUFFER_INSERT_TEXT);
+            OS.g_signal_stop_emission_by_name (bufferHandle, OS.insert_text.ptr);
+        }
+    }
+    return 0;
+}
+
+override void hookEvents () {
+    super.hookEvents();
+    if ((style & SWT.SINGLE) !is 0) {
+        OS.g_signal_connect_closure (handle, OS.changed.ptr, display.closures [CHANGED], true);
+        OS.g_signal_connect_closure (handle, OS.insert_text.ptr, display.closures [INSERT_TEXT], false);
+        OS.g_signal_connect_closure (handle, OS.delete_text.ptr, display.closures [DELETE_TEXT], false);
+        OS.g_signal_connect_closure (handle, OS.activate.ptr, display.closures [ACTIVATE], false);
+        OS.g_signal_connect_closure (handle, OS.grab_focus.ptr, display.closures [GRAB_FOCUS], false);
+        OS.g_signal_connect_closure (handle, OS.populate_popup.ptr, display.closures [POPULATE_POPUP], false);
+    } else {
+        OS.g_signal_connect_closure (bufferHandle, OS.changed.ptr, display.closures [CHANGED], false);
+        OS.g_signal_connect_closure (bufferHandle, OS.insert_text.ptr, display.closures [TEXT_BUFFER_INSERT_TEXT], false);
+        OS.g_signal_connect_closure (bufferHandle, OS.delete_range.ptr, display.closures [DELETE_RANGE], false);
+        OS.g_signal_connect_closure (handle, OS.populate_popup.ptr, display.closures [POPULATE_POPUP], false);
+    }
+    auto imContext = imContext ();
+    if (imContext !is null) {
+        OS.g_signal_connect_closure (imContext, OS.commit.ptr, display.closures [COMMIT], false);
+        int id = OS.g_signal_lookup (OS.commit.ptr, OS.gtk_im_context_get_type ());
+        int mask =  OS.G_SIGNAL_MATCH_DATA | OS.G_SIGNAL_MATCH_ID;
+        OS.g_signal_handlers_block_matched (imContext, mask, id, 0, null, null, cast(void*)handle);
+    }
+}
+
+GtkIMContext* imContext () {
+    if ((style & SWT.SINGLE) !is 0) {
+        return OS.gtk_editable_get_editable (handle) ? OS.GTK_ENTRY_IM_CONTEXT (handle) : null;
+    }
+    return OS.GTK_TEXTVIEW_IM_CONTEXT (cast(GtkTextView*)handle);
+}
+
+/**
+ * Inserts a string.
+ * <p>
+ * The old selection is replaced with the new text.
+ * </p>
+ *
+ * @param string the string
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void insert (String string) {
+    checkWidget ();
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if ((style & SWT.SINGLE) !is 0) {
+        int start, end;
+        OS.gtk_editable_get_selection_bounds (cast(GtkEditable*)handle, &start, &end);
+        OS.gtk_editable_delete_selection (cast(GtkEditable*)handle);
+        OS.gtk_editable_insert_text (cast(GtkEditable*)handle, string.ptr, string.length, &start);
+        OS.gtk_editable_set_position (cast(GtkEditable*)handle, start);
+    } else {
+        GtkTextIter start;
+        GtkTextIter end;
+        if (OS.gtk_text_buffer_get_selection_bounds (bufferHandle, &start, &end)) {
+            OS.gtk_text_buffer_delete (bufferHandle, &start, &end);
+        }
+        OS.gtk_text_buffer_insert (bufferHandle, &start, string.ptr, string.length);
+        OS.gtk_text_buffer_place_cursor (bufferHandle, &start);
+        auto mark = OS.gtk_text_buffer_get_insert (bufferHandle);
+        OS.gtk_text_view_scroll_mark_onscreen (cast(GtkTextView*)handle, mark);
+    }
+}
+
+override GdkDrawable* paintWindow () {
+    if ((style & SWT.SINGLE) !is 0) {
+        auto window = super.paintWindow ();
+        auto children = OS.gdk_window_get_children (window);
+        if (children !is null) window = cast(GdkDrawable*) OS.g_list_data (children);
+        OS.g_list_free (children);
+        return window;
+    }
+    OS.gtk_widget_realize (handle);
+    return OS.gtk_text_view_get_window (cast(GtkTextView*)handle, OS.GTK_TEXT_WINDOW_TEXT);
+}
+
+/**
+ * Pastes text from clipboard.
+ * <p>
+ * The selected text is deleted from the widget
+ * and new text inserted from the clipboard.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void paste () {
+    checkWidget ();
+    if ((style & SWT.SINGLE) !is 0) {
+        OS.gtk_editable_paste_clipboard (cast(GtkEditable*)handle);
+    } else {
+        auto clipboard = OS.gtk_clipboard_get (cast(void*)OS.GDK_NONE);
+        OS.gtk_text_buffer_paste_clipboard (bufferHandle, clipboard, null, OS.gtk_text_view_get_editable (cast(GtkTextView*)handle));
+    }
+}
+
+override void register () {
+    super.register ();
+    if (bufferHandle !is null) display.addWidget (cast(GtkWidget*)bufferHandle, this);
+    auto imContext = imContext ();
+    if (imContext !is null) display.addWidget (cast(GtkWidget*)imContext, this);
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    fixIM ();
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 6, 0)) {
+        /*
+        * Bug in GTK.  Any text copied into the clipboard will be lost when
+        * the GtkTextView is destroyed.  The fix is to paste the contents as
+        * the widget is being destroyed to reference the text buffer, keeping
+        * it around until ownership of the clipboard is lost.
+        */
+        if ((style & SWT.MULTI) !is 0) {
+            auto clipboard = OS.gtk_clipboard_get (cast(void*)OS.GDK_NONE);
+            OS.gtk_text_buffer_paste_clipboard (bufferHandle, clipboard, null, OS.gtk_text_view_get_editable (cast(GtkTextView*)handle));
+        }
+    }
+    message = null;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the receiver's text is modified.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ModifyListener
+ * @see #addModifyListener
+ */
+public void removeModifyListener (ModifyListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Modify, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is selected by the user.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener(SelectionListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook(SWT.Selection, listener);
+    eventTable.unhook(SWT.DefaultSelection,listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is verified.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see VerifyListener
+ * @see #addVerifyListener
+ */
+public void removeVerifyListener (VerifyListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Verify, listener);
+}
+
+/**
+ * Selects all the text in the receiver.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void selectAll () {
+    checkWidget ();
+    if ((style & SWT.SINGLE) !is 0) {
+        OS.gtk_editable_select_region (cast(GtkEditable*)handle, 0, -1);
+    } else {
+        GtkTextIter start;
+        GtkTextIter end;
+        OS.gtk_text_buffer_get_iter_at_offset (bufferHandle, &start, 0);
+        OS.gtk_text_buffer_get_end_iter (bufferHandle, &end);
+        auto insertMark = OS.gtk_text_buffer_get_insert (bufferHandle);
+        auto selectionMark = OS.gtk_text_buffer_get_selection_bound (bufferHandle);
+        OS.gtk_text_buffer_move_mark (bufferHandle, selectionMark, &start);
+        OS.gtk_text_buffer_move_mark (bufferHandle, insertMark, &end);
+    }
+}
+
+override void setBackgroundColor (GdkColor* color) {
+    super.setBackgroundColor (color);
+    OS.gtk_widget_modify_base (handle, 0, color);
+}
+
+override void gtk_setCursor (GdkCursor* cursor) {
+    GdkCursor* defaultCursor;
+    if (cursor is null) defaultCursor = OS.gdk_cursor_new (OS.GDK_XTERM);
+    super.gtk_setCursor (cursor !is null ? cursor : defaultCursor);
+    if (cursor is null) OS.gdk_cursor_destroy (defaultCursor);
+}
+
+/**
+ * Sets the double click enabled flag.
+ * <p>
+ * The double click flag enables or disables the
+ * default action of the text widget when the user
+ * double clicks.
+ * </p><p>
+ * Note: This operation is a hint and is not supported on
+ * platforms that do not have this concept.
+ * </p>
+ *
+ * @param doubleClick the new double click flag
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setDoubleClickEnabled (bool doubleClick) {
+    checkWidget ();
+    this.doubleClick = doubleClick;
+}
+
+/**
+ * Sets the echo character.
+ * <p>
+ * The echo character is the character that is
+ * displayed when the user enters text or the
+ * text is changed by the programmer. Setting
+ * the echo character to '\0' clears the echo
+ * character and redraws the original text.
+ * If for any reason the echo character is invalid,
+ * or if the platform does not allow modification
+ * of the echo character, the default echo character
+ * for the platform is used.
+ * </p>
+ *
+ * @param echo the new echo character
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setEchoChar (char echo) {
+    checkWidget ();
+    if ((style & SWT.SINGLE) !is 0) {
+        OS.gtk_entry_set_visibility (cast(GtkEntry*)handle, echo is '\0');
+        OS.gtk_entry_set_invisible_char (cast(GtkEntry*)handle, echo);
+    }
+}
+
+/**
+ * Sets the editable state.
+ *
+ * @param editable the new editable state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setEditable (bool editable) {
+    checkWidget ();
+    style &= ~SWT.READ_ONLY;
+    if (!editable) style |= SWT.READ_ONLY;
+    if ((style & SWT.SINGLE) !is 0) {
+        OS.gtk_editable_set_editable (cast(GtkEditable*)handle, editable);
+    } else {
+        OS.gtk_text_view_set_editable (cast(GtkTextView*)handle, editable);
+    }
+}
+
+override void setFontDescription (PangoFontDescription* font) {
+    super.setFontDescription (font);
+    setTabStops (tabs);
+}
+
+/**
+ * Sets the widget message. When the widget is created
+ * with the style <code>SWT.SEARCH</code>, the message text
+ * is displayed as a hint for the user, indicating the
+ * purpose of the field.
+ * <p>
+ * Note: This operation is a <em>HINT</em> and is not
+ * supported on platforms that do not have this concept.
+ * </p>
+ *
+ * @param message the new message
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the message is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.3
+ */
+public void setMessage (String message) {
+    checkWidget ();
+    // SWT extension: allow null for zero length string
+    //if (message is null) error (SWT.ERROR_NULL_ARGUMENT);
+    this.message = message;
+}
+
+/**
+ * Sets the orientation of the receiver, which must be one
+ * of the constants <code>SWT.LEFT_TO_RIGHT</code> or <code>SWT.RIGHT_TO_LEFT</code>.
+ * <p>
+ * Note: This operation is a hint and is not supported on
+ * platforms that do not have this concept.
+ * </p>
+ *
+ * @param orientation new orientation style
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.1.2
+ */
+public void setOrientation (int orientation) {
+    checkWidget();
+}
+
+/**
+ * Sets the selection.
+ * <p>
+ * Indexing is zero based.  The range of
+ * a selection is from 0..N where N is
+ * the number of characters in the widget.
+ * </p><p>
+ * Text selections are specified in terms of
+ * caret positions.  In a text widget that
+ * contains N characters, there are N+1 caret
+ * positions, ranging from 0..N.  This differs
+ * from other functions that address character
+ * position such as getText () that use the
+ * regular array indexing rules.
+ * </p>
+ *
+ * @param start new caret position
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (int start) {
+    checkWidget ();
+    if ((style & SWT.SINGLE) !is 0) {
+        OS.gtk_editable_set_position (cast(GtkEditable*)handle, start);
+    } else {
+        GtkTextIter position;
+        OS.gtk_text_buffer_get_iter_at_offset (bufferHandle, &position, start);
+        OS.gtk_text_buffer_place_cursor (bufferHandle, &position);
+        auto mark = OS.gtk_text_buffer_get_insert (bufferHandle);
+        OS.gtk_text_view_scroll_mark_onscreen (cast(GtkTextView*)handle, mark);
+    }
+}
+
+/**
+ * Sets the selection to the range specified
+ * by the given start and end indices.
+ * <p>
+ * Indexing is zero based.  The range of
+ * a selection is from 0..N where N is
+ * the number of characters in the widget.
+ * </p><p>
+ * Text selections are specified in terms of
+ * caret positions.  In a text widget that
+ * contains N characters, there are N+1 caret
+ * positions, ranging from 0..N.  This differs
+ * from other functions that address character
+ * position such as getText () that use the
+ * usual array indexing rules.
+ * </p>
+ *
+ * @param start the start of the range
+ * @param end the end of the range
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (int start, int end) {
+    checkWidget ();
+    if ((style & SWT.SINGLE) !is 0) {
+        OS.gtk_editable_set_position (cast(GtkEditable*)handle, start);
+        OS.gtk_editable_select_region (cast(GtkEditable*)handle, start, end);
+    } else {
+        GtkTextIter startIter;
+        GtkTextIter endIter;
+        OS.gtk_text_buffer_get_iter_at_offset (bufferHandle, &startIter, start);
+        OS.gtk_text_buffer_get_iter_at_offset (bufferHandle, &endIter, end);
+        auto insertMark = OS.gtk_text_buffer_get_insert (bufferHandle);
+        auto selectionMark = OS.gtk_text_buffer_get_selection_bound (bufferHandle);
+        OS.gtk_text_buffer_move_mark (bufferHandle, selectionMark, &startIter);
+        OS.gtk_text_buffer_move_mark (bufferHandle, insertMark, &endIter);
+    }
+}
+
+/**
+ * Sets the selection to the range specified
+ * by the given point, where the x coordinate
+ * represents the start index and the y coordinate
+ * represents the end index.
+ * <p>
+ * Indexing is zero based.  The range of
+ * a selection is from 0..N where N is
+ * the number of characters in the widget.
+ * </p><p>
+ * Text selections are specified in terms of
+ * caret positions.  In a text widget that
+ * contains N characters, there are N+1 caret
+ * positions, ranging from 0..N.  This differs
+ * from other functions that address character
+ * position such as getText () that use the
+ * usual array indexing rules.
+ * </p>
+ *
+ * @param selection the point
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (Point selection) {
+    checkWidget ();
+    if (selection is null) error (SWT.ERROR_NULL_ARGUMENT);
+    setSelection (selection.x, selection.y);
+}
+
+/**
+ * Sets the number of tabs.
+ * <p>
+ * Tab stop spacing is specified in terms of the
+ * space (' ') character.  The width of a single
+ * tab stop is the pixel width of the spaces.
+ * </p>
+ *
+ * @param tabs the number of tabs
+ *
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setTabs (int tabs) {
+    checkWidget ();
+    if (tabs < 0) return;
+    setTabStops (this.tabs = tabs);
+}
+
+void setTabStops (int tabs) {
+    if ((style & SWT.SINGLE) !is 0) return;
+    int tabWidth = getTabWidth (tabs);
+    auto tabArray = OS.pango_tab_array_new (1, false);
+    OS.pango_tab_array_set_tab (tabArray, 0, OS.PANGO_TAB_LEFT, tabWidth);
+    OS.gtk_text_view_set_tabs (cast(GtkTextView*)handle, tabArray);
+    OS.pango_tab_array_free (tabArray);
+}
+
+/**
+ * Sets the contents of the receiver to the given string. If the receiver has style
+ * SINGLE and the argument contains multiple lines of text, the result of this
+ * operation is undefined and may vary from platform to platform.
+ *
+ * @param string the new text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setText (String string) {
+    checkWidget ();
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    /*
+    * Feature in gtk.  When text is set in gtk, separate events are fired for the deletion and
+    * insertion of the text.  This is not wrong, but is inconsistent with other platforms.  The
+    * fix is to block the firing of these events and fire them ourselves in a consistent manner.
+    */
+    if (hooks (SWT.Verify) || filters (SWT.Verify)) {
+        string = verifyText (string, 0, getCharCount ());
+        if (string is null) return;
+    }
+    if ((style & SWT.SINGLE) !is 0) {
+        OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+        OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udDELETE_TEXT);
+        OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udINSERT_TEXT);
+        OS.gtk_entry_set_text (cast(GtkEntry*)handle, toStringz(string) );
+        OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+        OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udDELETE_TEXT);
+        OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udINSERT_TEXT);
+    } else {
+        GtkTextIter position;
+        OS.g_signal_handlers_block_matched (bufferHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+        OS.g_signal_handlers_block_matched (bufferHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udDELETE_RANGE);
+        OS.g_signal_handlers_block_matched (bufferHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udTEXT_BUFFER_INSERT_TEXT);
+        OS.gtk_text_buffer_set_text (bufferHandle, string.ptr, string.length);
+        OS.g_signal_handlers_unblock_matched (bufferHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+        OS.g_signal_handlers_unblock_matched (bufferHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udDELETE_RANGE);
+        OS.g_signal_handlers_unblock_matched (bufferHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udTEXT_BUFFER_INSERT_TEXT);
+        OS.gtk_text_buffer_get_iter_at_offset (bufferHandle, &position, 0);
+        OS.gtk_text_buffer_place_cursor (bufferHandle, &position);
+        auto mark = OS.gtk_text_buffer_get_insert (bufferHandle);
+        OS.gtk_text_view_scroll_mark_onscreen (cast(GtkTextView*)handle, mark);
+    }
+    sendEvent (SWT.Modify);
+}
+
+/**
+ * Sets the maximum number of characters that the receiver
+ * is capable of holding to be the argument.
+ * <p>
+ * Instead of trying to set the text limit to zero, consider
+ * creating a read-only text widget.
+ * </p><p>
+ * To reset this value to the default, use <code>setTextLimit(Text.LIMIT)</code>.
+ * Specifying a limit value larger than <code>Text.LIMIT</code> sets the
+ * receiver's limit to <code>Text.LIMIT</code>.
+ * </p>
+ *
+ * @param limit new text limit
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_CANNOT_BE_ZERO - if the limit is zero</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #LIMIT
+ */
+public void setTextLimit (int limit) {
+    checkWidget ();
+    if (limit is 0) error (SWT.ERROR_CANNOT_BE_ZERO);
+    if ((style & SWT.SINGLE) !is 0) OS.gtk_entry_set_max_length (cast(GtkEntry*)handle, limit);
+}
+
+/**
+ * Sets the zero-relative index of the line which is currently
+ * at the top of the receiver. This index can change when lines
+ * are scrolled or new lines are added and removed.
+ *
+ * @param index the index of the top item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setTopIndex (int index) {
+    checkWidget ();
+    if ((style & SWT.SINGLE) !is 0) return;
+    GtkTextIter position;
+    OS.gtk_text_buffer_get_iter_at_line (bufferHandle, &position, index);
+    OS.gtk_text_view_scroll_to_iter (cast(GtkTextView*)handle, &position, 0, true, 0, 0);
+}
+
+/**
+ * Shows the selection.
+ * <p>
+ * If the selection is already showing
+ * in the receiver, this method simply returns.  Otherwise,
+ * lines are scrolled until the selection is visible.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void showSelection () {
+    checkWidget ();
+    if ((style & SWT.SINGLE) !is 0) return;
+    auto mark = OS.gtk_text_buffer_get_selection_bound (bufferHandle);
+    OS.gtk_text_view_scroll_mark_onscreen (cast(GtkTextView*)handle, mark);
+    mark = OS.gtk_text_buffer_get_insert (bufferHandle);
+    OS.gtk_text_view_scroll_mark_onscreen (cast(GtkTextView*)handle, mark);
+}
+
+override bool translateTraversal (GdkEventKey* keyEvent) {
+    int key = keyEvent.keyval;
+    switch (key) {
+        case OS.GDK_KP_Enter:
+        case OS.GDK_Return: {
+            auto imContext =  imContext ();
+            if (imContext !is null) {
+                char* preeditString;
+                OS.gtk_im_context_get_preedit_string (imContext, &preeditString, null, null);
+                if (preeditString !is null) {
+                    int length = tango.stdc.string.strlen (preeditString);
+                    OS.g_free (preeditString);
+                    if (length !is 0) return false;
+                }
+            }
+            default:
+        }
+    }
+    return super.translateTraversal (keyEvent);
+}
+
+override int traversalCode (int key, GdkEventKey* event) {
+    int bits = super.traversalCode (key, event);
+    if ((style & SWT.READ_ONLY) !is 0)  return bits;
+    if ((style & SWT.MULTI) !is 0) {
+        bits &= ~SWT.TRAVERSE_RETURN;
+        if (key is OS.GDK_Tab && event !is null) {
+            bool next = (event.state & OS.GDK_SHIFT_MASK) is 0;
+            if (next && (event.state & OS.GDK_CONTROL_MASK) is 0) {
+                bits &= ~(SWT.TRAVERSE_TAB_NEXT | SWT.TRAVERSE_TAB_PREVIOUS);
+            }
+        }
+    }
+    return bits;
+}
+
+String verifyText (String string, int start, int end) {
+    if (string.length is 0 && start is end) return null;
+    Event event = new Event ();
+    event.text = string;
+    event.start = start;
+    event.end = end;
+    auto eventPtr = OS.gtk_get_current_event ();
+    if (eventPtr !is null) {
+        GdkEventKey* gdkEvent = cast(GdkEventKey*)eventPtr;
+        switch (gdkEvent.type) {
+            case OS.GDK_KEY_PRESS:
+                setKeyState (event, gdkEvent);
+                break;
+            default:
+        }
+        OS.gdk_event_free (eventPtr);
+    }
+    /*
+     * It is possible (but unlikely), that application
+     * code could have disposed the widget in the verify
+     * event.  If this happens, answer null to cancel
+     * the operation.
+     */
+    sendEvent (SWT.Verify, event);
+    if (!event.doit || isDisposed ()) return null;
+    return event.text;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/ToolBar.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,482 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.ToolBar;
+
+import java.lang.all;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.ImageList;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Decorations;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swt.widgets.Event;
+
+/**
+ * Instances of this class support the layout of selectable
+ * tool bar items.
+ * <p>
+ * The item children that may be added to instances of this class
+ * must be of type <code>ToolItem</code>.
+ * </p><p>
+ * Note that although this class is a subclass of <code>Composite</code>,
+ * it does not make sense to add <code>Control</code> children to it,
+ * or set a layout on it.
+ * </p><p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>FLAT, WRAP, RIGHT, HORIZONTAL, VERTICAL, SHADOW_OUT</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles HORIZONTAL and VERTICAL may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#toolbar">ToolBar, ToolItem snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class ToolBar : Composite {
+
+    alias Composite.computeSize computeSize;
+    alias Composite.createHandle createHandle;
+    alias Composite.forceFocus forceFocus;
+    alias Composite.mnemonicHit mnemonicHit;
+    alias Composite.mnemonicMatch mnemonicMatch;
+    alias Composite.setBounds setBounds;
+    alias Composite.setForegroundColor setForegroundColor;
+    alias Composite.setToolTipText setToolTipText;
+
+    ToolItem lastFocus;
+    ImageList imageList;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#FLAT
+ * @see SWT#WRAP
+ * @see SWT#RIGHT
+ * @see SWT#HORIZONTAL
+ * @see SWT#SHADOW_OUT
+ * @see SWT#VERTICAL
+ * @see Widget#checkSubclass()
+ * @see Widget#getStyle()
+ */
+public this (Composite parent, int style) {
+    super (parent, checkStyle (style));
+    /*
+    * Ensure that either of HORIZONTAL or VERTICAL is set.
+    * NOTE: HORIZONTAL and VERTICAL have the same values
+    * as H_SCROLL and V_SCROLL so it is necessary to first
+    * clear these bits to avoid scroll bars and then reset
+    * the bits using the original style supplied by the
+    * programmer.
+    */
+    if ((style & SWT.VERTICAL) !is 0) {
+        this.style |= SWT.VERTICAL;
+    } else {
+        this.style |= SWT.HORIZONTAL;
+    }
+    int orientation = (style & SWT.VERTICAL) !is 0 ? OS.GTK_ORIENTATION_VERTICAL : OS.GTK_ORIENTATION_HORIZONTAL;
+    OS.gtk_toolbar_set_orientation (handle, orientation);
+}
+
+static int checkStyle (int style) {
+    /*
+    * Feature in GTK.  It is not possible to create
+    * a toolbar that wraps.  Therefore, no matter what
+    * style bits are specified, clear the WRAP bits so
+    * that the style matches the behavior.
+    */
+    if ((style & SWT.WRAP) !is 0) style &= ~SWT.WRAP;
+    /*
+    * Even though it is legal to create this widget
+    * with scroll bars, they serve no useful purpose
+    * because they do not automatically scroll the
+    * widget's client area.  The fix is to clear
+    * the SWT style.
+    */
+    return style & ~(SWT.H_SCROLL | SWT.V_SCROLL);
+}
+
+protected override void checkSubclass () {
+    if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+override void createHandle (int index) {
+    state |= HANDLE | THEME_BACKGROUND;
+    fixedHandle = cast(GtkWidget*)OS.g_object_new (display.gtk_fixed_get_type (), null);
+    if (fixedHandle is null) error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_fixed_set_has_window (fixedHandle, true);
+    handle = cast(GtkWidget*)OS.gtk_toolbar_new ();
+    if (handle is null) error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_container_add (fixedHandle, handle);
+    if ((style & SWT.FLAT) !is 0) {
+        OS.gtk_widget_set_name (handle, "swt-toolbar-flat".ptr );
+    }
+}
+
+public override Point computeSize (int wHint, int hHint, bool changed) {
+    checkWidget ();
+    if (wHint !is SWT.DEFAULT && wHint < 0) wHint = 0;
+    if (hHint !is SWT.DEFAULT && hHint < 0) hHint = 0;
+    return computeNativeSize (handle, wHint, hHint, changed);
+}
+
+override GtkWidget* eventHandle () {
+    return fixedHandle;
+}
+
+override GtkWidget* enterExitHandle() {
+    return handle;
+}
+
+override void fixChildren (Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu [] menus) {
+    super.fixChildren (newShell, oldShell, newDecorations, oldDecorations, menus);
+    ToolItem [] items = getItems ();
+    if (toolTipText is null) {
+        for (int i = 0; i < items.length; i++) {
+            ToolItem item = items [i];
+            if (item.toolTipText !is null) {
+                item.setToolTipText(oldShell, null);
+                item.setToolTipText(newShell, item.toolTipText);
+            }
+        }
+    }
+}
+
+override bool forceFocus (GtkWidget* focusHandle) {
+    if (lastFocus !is null && lastFocus.setFocus ()) return true;
+    ToolItem [] items = getItems ();
+    for (int i = 0; i < items.length; i++) {
+        ToolItem item = items [i];
+        if (item.setFocus ()) return true;
+    }
+    return super.forceFocus (focusHandle);
+}
+
+/**
+ * Returns the item at the given, zero-relative index in the
+ * receiver. Throws an exception if the index is out of range.
+ *
+ * @param index the index of the item to return
+ * @return the item at the given index
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public ToolItem getItem (int index) {
+    checkWidget();
+    if (!(0 <= index && index < getItemCount())) error (SWT.ERROR_INVALID_RANGE);
+    return getItems()[index];
+}
+
+/**
+ * Returns the item at the given point in the receiver
+ * or null if no such item exists. The point is in the
+ * coordinate system of the receiver.
+ *
+ * @param point the point used to locate the item
+ * @return the item at the given point
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public ToolItem getItem (Point point) {
+    checkWidget();
+    if (point is null) error (SWT.ERROR_NULL_ARGUMENT);
+    ToolItem[] items = getItems();
+    for (int i=0; i<items.length; i++) {
+        if (items[i].getBounds().contains(point)) return items[i];
+    }
+    return null;
+}
+
+/**
+ * Returns the number of items contained in the receiver.
+ *
+ * @return the number of items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemCount () {
+    checkWidget();
+    auto list = OS.gtk_container_get_children (handle);
+    if (list is null) return 0;
+    int itemCount = OS.g_list_length (list);
+    OS.g_list_free (list);
+    return itemCount;
+}
+
+/**
+ * Returns an array of <code>ToolItem</code>s which are the items
+ * in the receiver.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the items in the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public ToolItem [] getItems () {
+    checkWidget();
+    auto list = OS.gtk_container_get_children (handle);
+    if (list is null) return new ToolItem [0];
+    int count = OS.g_list_length (list);
+    ToolItem [] result = new ToolItem [count];
+    for (int i=0; i<count; i++) {
+        auto data = OS.g_list_nth_data (list, i);
+        Widget widget = display.getWidget (cast(GtkWidget*)data);
+        result [i] = cast(ToolItem) widget;
+    }
+    OS.g_list_free (list);
+    return result;
+}
+
+/**
+ * Returns the number of rows in the receiver. When
+ * the receiver has the <code>WRAP</code> style, the
+ * number of rows can be greater than one.  Otherwise,
+ * the number of rows is always one.
+ *
+ * @return the number of items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getRowCount () {
+    checkWidget();
+     /* On GTK, toolbars cannot wrap */
+    return 1;
+}
+
+override int /*long*/ gtk_key_press_event (GtkWidget* widget, GdkEventKey* gdkEvent) {
+    if (!hasFocus ()) return 0;
+    auto result = super.gtk_key_press_event (widget, gdkEvent);
+    if (result !is 0) return result;
+    ToolItem [] items = getItems ();
+    int length = items.length;
+    int index = 0;
+    while (index < length) {
+        if (items [index].hasFocus ()) break;
+        index++;
+    }
+    bool next = false;
+    switch (gdkEvent.keyval) {
+        case OS.GDK_Up:
+        case OS.GDK_Left: next = false; break;
+        case OS.GDK_Down: {
+            if (0 <= index && index < length) {
+                ToolItem item = items [index];
+                if ((item.style & SWT.DROP_DOWN) !is 0) {
+                    Event event = new Event ();
+                    event.detail = SWT.ARROW;
+                    auto topHandle = item.topHandle ();
+                    event.x = OS.GTK_WIDGET_X (topHandle);
+                    event.y = OS.GTK_WIDGET_Y (topHandle) + OS.GTK_WIDGET_HEIGHT (topHandle);
+                    if ((style & SWT.MIRRORED) !is 0) event.x = getClientWidth() - OS.GTK_WIDGET_WIDTH(topHandle) - event.x;
+                    item.postEvent (SWT.Selection, event);
+                    return result;
+                }
+            }
+            //FALL THROUGH
+        }
+        case OS.GDK_Right: next = true; break;
+        default: return result;
+    }
+    if ((style & SWT.MIRRORED) !is 0) next= !next;
+    int start = index, offset = next ? 1 : -1;
+    while ((index = (index + offset + length) % length) !is start) {
+        ToolItem item = items [index];
+        if (item.setFocus ()) return result;
+    }
+    return result;
+}
+
+override bool hasFocus () {
+    ToolItem [] items = getItems ();
+    for (int i=0; i<items.length; i++) {
+        ToolItem item = items [i];
+        if (item.hasFocus ()) return true;
+    }
+    return super.hasFocus();
+}
+
+/**
+ * Searches the receiver's list starting at the first item
+ * (index 0) until an item is found that is equal to the
+ * argument, and returns the index of that item. If no item
+ * is found, returns -1.
+ *
+ * @param item the search item
+ * @return the index of the item
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the tool item is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the tool item has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int indexOf (ToolItem item) {
+    checkWidget();
+    if (item is null) error (SWT.ERROR_NULL_ARGUMENT);
+    ToolItem [] items = getItems ();
+    for (int i=0; i<items.length; i++) {
+        if (item is items[i]) return i;
+    }
+    return -1;
+}
+
+override bool mnemonicHit (wchar key) {
+    ToolItem [] items = getItems ();
+    for (int i=0; i<items.length; i++) {
+        auto labelHandle = items [i].labelHandle;
+        if (labelHandle !is null && mnemonicHit (labelHandle, key)) return true;
+    }
+    return false;
+}
+
+override bool mnemonicMatch (wchar key) {
+    ToolItem [] items = getItems ();
+    for (int i=0; i<items.length; i++) {
+        auto labelHandle = items [i].labelHandle;
+        if (labelHandle !is null && mnemonicMatch (labelHandle, key)) return true;
+    }
+    return false;
+}
+
+void relayout () {
+    ToolItem [] items = getItems ();
+    for (int i=0; i<items.length; i++) {
+        ToolItem item = items [i];
+        if (item !is null) item.resizeControl ();
+    }
+}
+
+override void releaseChildren (bool destroy) {
+    ToolItem [] items = getItems ();
+    for (int i=0; i<items.length; i++) {
+        ToolItem item = items [i];
+        if (item !is null && !item.isDisposed ()) {
+            item.release (false);
+        }
+    }
+    super.releaseChildren (destroy);
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    if (imageList !is null) imageList.dispose ();
+    imageList = null;
+}
+
+override void removeControl (Control control) {
+    super.removeControl (control);
+    ToolItem [] items = getItems ();
+    for (int i=0; i<items.length; i++) {
+        ToolItem item = items [i];
+        if (item.control is control) item.setControl (null);
+    }
+}
+
+override int setBounds (int x, int y, int width, int height, bool move, bool resize) {
+    int result = super.setBounds (x, y, width, height, move, resize);
+    if ((result & RESIZED) !is 0) relayout ();
+    return result;
+}
+
+override void setFontDescription (PangoFontDescription* font) {
+    super.setFontDescription (font);
+    ToolItem [] items = getItems ();
+    for (int i = 0; i < items.length; i++) {
+        items[i].setFontDescription (font);
+    }
+    relayout ();
+}
+
+override void setForegroundColor (GdkColor* color) {
+    super.setForegroundColor (color);
+    ToolItem [] items = getItems ();
+    for (int i = 0; i < items.length; i++) {
+        items[i].setForegroundColor (color);
+    }
+}
+
+public override void setToolTipText (String string) {
+    checkWidget();
+    super.setToolTipText (string);
+    Shell shell = _getShell ();
+    ToolItem [] items = getItems ();
+    for (int i = 0; i < items.length; i++) {
+        String newString = string !is null ? null : items [i].toolTipText;
+        shell.setToolTipText (items [i].handle, newString);
+    }
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/ToolItem.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,1054 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.ToolItem;
+
+import java.lang.all;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.ImageList;
+
+/**
+ * Instances of this class represent a selectable user interface object
+ * that represents a button in a tool bar.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>PUSH, CHECK, RADIO, SEPARATOR, DROP_DOWN</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles CHECK, PUSH, RADIO, SEPARATOR and DROP_DOWN
+ * may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#toolbar">ToolBar, ToolItem snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class ToolItem : Item {
+
+    alias Item.setForegroundColor setForegroundColor;
+
+    GtkWidget* boxHandle, arrowHandle, arrowBoxHandle, separatorHandle, labelHandle, imageHandle;
+    ToolBar parent;
+    Control control;
+    Image hotImage, disabledImage;
+    String toolTipText;
+    bool drawHotImage;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>ToolBar</code>) and a style value
+ * describing its behavior and appearance. The item is added
+ * to the end of the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#PUSH
+ * @see SWT#CHECK
+ * @see SWT#RADIO
+ * @see SWT#SEPARATOR
+ * @see SWT#DROP_DOWN
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (ToolBar parent, int style) {
+    super (parent, checkStyle (style));
+    this.parent = parent;
+    createWidget (parent.getItemCount ());
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>ToolBar</code>), a style value
+ * describing its behavior and appearance, and the index
+ * at which to place it in the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ * @param index the zero-relative index to store the receiver in its parent
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the parent (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#PUSH
+ * @see SWT#CHECK
+ * @see SWT#RADIO
+ * @see SWT#SEPARATOR
+ * @see SWT#DROP_DOWN
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (ToolBar parent, int style, int index) {
+    super (parent, checkStyle (style));
+    this.parent = parent;
+    int count = parent.getItemCount ();
+    if (!(0 <= index && index <= count)) {
+        error (SWT.ERROR_INVALID_RANGE);
+    }
+    createWidget (index);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the control is selected by the user, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * When <code>widgetSelected</code> is called when the mouse is over the arrow portion of a drop-down tool,
+ * the event object detail field contains the value <code>SWT.ARROW</code>.
+ * <code>widgetDefaultSelected</code> is not called.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the control is selected by the user,
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener(SelectionListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Selection,typedListener);
+    addListener (SWT.DefaultSelection,typedListener);
+}
+
+static int checkStyle (int style) {
+    return checkBits (style, SWT.PUSH, SWT.CHECK, SWT.RADIO, SWT.SEPARATOR, SWT.DROP_DOWN, 0);
+}
+
+protected override void checkSubclass () {
+    if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+override void createHandle (int index) {
+    state |= HANDLE;
+    if ((style & SWT.SEPARATOR) is 0) {
+        boxHandle = cast(GtkWidget*)((parent.style & SWT.RIGHT) !is 0 ? OS.gtk_hbox_new (false, 0) : OS.gtk_vbox_new (false, 0));
+        if (boxHandle is null) error (SWT.ERROR_NO_HANDLES);
+        labelHandle = OS.gtk_label_new_with_mnemonic (null);
+        if (labelHandle is null) error (SWT.ERROR_NO_HANDLES);
+        imageHandle = OS.gtk_image_new ();
+        if (imageHandle is null) error (SWT.ERROR_NO_HANDLES);
+        OS.gtk_container_add (boxHandle, imageHandle);
+        OS.gtk_container_add (boxHandle, labelHandle);
+        if ((parent.style & SWT.VERTICAL) !is 0) {
+            // Align text and images to the left
+            OS.gtk_box_set_child_packing (boxHandle, imageHandle, false, false, 0, OS.GTK_PACK_START);
+            OS.gtk_box_set_child_packing (boxHandle, labelHandle, false, false, 2, OS.GTK_PACK_START);
+        }
+    }
+    int bits = SWT.SEPARATOR | SWT.RADIO | SWT.CHECK | SWT.PUSH | SWT.DROP_DOWN;
+    switch (style & bits) {
+        case SWT.SEPARATOR:
+            handle = cast(GtkWidget*)OS.gtk_hbox_new (false, 0);
+            if (handle is null) error (SWT.ERROR_NO_HANDLES);
+            bool isVertical = (parent.style & SWT.VERTICAL) !is 0;
+            separatorHandle = isVertical ? OS.gtk_hseparator_new() : OS.gtk_vseparator_new();
+            if (separatorHandle is null) error (SWT.ERROR_NO_HANDLES);
+            OS.gtk_widget_set_size_request (separatorHandle, isVertical ? 15 : 6, isVertical ? 6 : 15);
+            OS.gtk_widget_set_size_request (handle, isVertical ? 15 : 6, isVertical ? 6 : 15);
+            OS.gtk_container_add (handle, separatorHandle);
+            break;
+        case SWT.DROP_DOWN:
+            handle = OS.gtk_button_new ();
+            if (handle is null) error (SWT.ERROR_NO_HANDLES);
+            arrowBoxHandle = cast(GtkWidget*)OS.gtk_hbox_new (false, 0);
+            if (arrowBoxHandle is null) error(SWT.ERROR_NO_HANDLES);
+            arrowHandle = OS.gtk_arrow_new (OS.GTK_ARROW_DOWN, OS.GTK_SHADOW_NONE);
+            if (arrowHandle is null) error (SWT.ERROR_NO_HANDLES);
+            OS.gtk_widget_set_size_request (arrowHandle, 8, 6);
+            OS.gtk_container_add (handle, arrowBoxHandle);
+            OS.gtk_container_add (arrowBoxHandle, boxHandle);
+            OS.gtk_container_add (arrowBoxHandle, arrowHandle);
+            break;
+        case SWT.RADIO:
+            /*
+            * This code is intentionally commented.  Because GTK
+            * enforces radio behavior in a button group a radio group
+            * is not created for each set of contiguous buttons, each
+            * radio button will not draw unpressed.  The fix is to use
+            * toggle buttons instead.
+            */
+//          handle = OS.gtk_radio_button_new (0);
+//          if (handle is 0) error (SWT.ERROR_NO_HANDLES);
+//          OS.gtk_toggle_button_set_mode (handle, false);
+//          OS.gtk_container_add (handle, boxHandle);
+//          break;
+        case SWT.CHECK:
+            handle = OS.gtk_toggle_button_new ();
+            if (handle is null) error (SWT.ERROR_NO_HANDLES);
+            OS.gtk_toggle_button_set_mode (handle, false);
+            OS.gtk_container_add (handle, boxHandle);
+            break;
+        case SWT.PUSH:
+        default:
+            handle = OS.gtk_button_new ();
+            if (handle is null) error (SWT.ERROR_NO_HANDLES);
+            OS.gtk_container_add (handle, boxHandle);
+            break;
+    }
+    if ((style & SWT.SEPARATOR) is 0) {
+        int relief;
+        OS.gtk_widget_style_get1 (parent.handle, OS.button_relief.ptr, &relief);
+        OS.gtk_button_set_relief (handle, relief );
+    }
+    OS.GTK_WIDGET_UNSET_FLAGS (handle, OS.GTK_CAN_FOCUS);
+//  This code is intentionally commented.
+//  int /*long*/ fontHandle = parent.fontHandle ();
+//  GdkColor color = new GdkColor ();
+//  int /*long*/ style = OS.gtk_widget_get_style (fontHandle);
+//  OS.gtk_style_get_fg (style, OS.GTK_STATE_NORMAL, color);
+//  int /*long*/ font = OS.gtk_style_get_font_desc (style);
+//  setForegroundColor (color);
+//  setFontDescription (font);
+    if ((parent.state & FOREGROUND) !is 0) {
+        setForegroundColor (parent.getForegroundColor());
+    }
+    if ((parent.state & FONT) !is 0) {
+        setFontDescription (parent.getFontDescription());
+    }
+}
+
+override void createWidget (int index) {
+    super.createWidget (index);
+    showWidget (index);
+    parent.relayout ();
+}
+
+override void deregister() {
+    super.deregister ();
+    if (labelHandle !is null) display.removeWidget (labelHandle);
+}
+
+public override void dispose () {
+    if (isDisposed ()) return;
+    ToolBar parent = this.parent;
+    super.dispose ();
+    parent.relayout ();
+}
+
+/**
+ * Returns a rectangle describing the receiver's size and location
+ * relative to its parent.
+ *
+ * @return the receiver's bounding rectangle
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Rectangle getBounds () {
+    checkWidget();
+    parent.forceResize ();
+    auto topHandle = topHandle ();
+    int x, y, width, height;
+    /*
+    * Bug in GTK.  Toolbar items are only allocated their minimum size
+    * in versions before 2.4.0.  The fix is to use the total size
+    * available minus any borders.
+    */
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 4, 0) && control !is null && !control.isDisposed ()) {
+        int border = OS.gtk_container_get_border_width (parent.handle);
+        int shadow;
+        OS.gtk_widget_style_get1 (parent.handle, "shadow_type".ptr, &shadow);
+        if (shadow !is OS.GTK_SHADOW_NONE) {
+            border += OS.gtk_style_get_xthickness (OS.gtk_widget_get_style (parent.handle));
+        }
+        if ((parent.style & SWT.VERTICAL) !is 0) {
+            x = border;
+            y = OS.GTK_WIDGET_Y (topHandle) + border;
+            width = OS.GTK_WIDGET_WIDTH (parent.handle) - border*2;
+            height = OS.GTK_WIDGET_HEIGHT (topHandle);
+        } else {
+            x = OS.GTK_WIDGET_X (topHandle) + border;
+            y = border;
+            width = OS.GTK_WIDGET_WIDTH (topHandle);
+            height = OS.GTK_WIDGET_HEIGHT (parent.handle) - border*2;
+        }
+    } else {
+        x = OS.GTK_WIDGET_X (topHandle);
+        y = OS.GTK_WIDGET_Y (topHandle);
+        width = OS.GTK_WIDGET_WIDTH (topHandle);
+        height = OS.GTK_WIDGET_HEIGHT (topHandle);
+    }
+    if ((parent.style & SWT.MIRRORED) !is 0) x = parent.getClientWidth () - width - x;
+    if ((style & SWT.SEPARATOR) !is 0 && control !is null) height = Math.max (height, 23);
+    return new Rectangle (x, y, width, height);
+}
+
+/**
+ * Returns the control that is used to fill the bounds of
+ * the item when the item is a <code>SEPARATOR</code>.
+ *
+ * @return the control
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Control getControl () {
+    checkWidget();
+    return control;
+}
+
+/**
+ * Returns the receiver's disabled image if it has one, or null
+ * if it does not.
+ * <p>
+ * The disabled image is displayed when the receiver is disabled.
+ * </p>
+ *
+ * @return the receiver's disabled image
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Image getDisabledImage () {
+    checkWidget();
+    return disabledImage;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is enabled, and
+ * <code>false</code> otherwise. A disabled control is typically
+ * not selectable from the user interface and draws with an
+ * inactive or "grayed" look.
+ *
+ * @return the receiver's enabled state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #isEnabled
+ */
+public bool getEnabled () {
+    checkWidget();
+    auto topHandle = topHandle ();
+    return OS.GTK_WIDGET_SENSITIVE (topHandle);
+}
+
+/**
+ * Returns the receiver's hot image if it has one, or null
+ * if it does not.
+ * <p>
+ * The hot image is displayed when the mouse enters the receiver.
+ * </p>
+ *
+ * @return the receiver's hot image
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Image getHotImage () {
+    checkWidget();
+    return hotImage;
+}
+
+/**
+ * Returns the receiver's parent, which must be a <code>ToolBar</code>.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public ToolBar getParent () {
+    checkWidget();
+    if (parent is null) error (SWT.ERROR_WIDGET_DISPOSED);
+    return parent;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is selected,
+ * and false otherwise.
+ * <p>
+ * When the receiver is of type <code>CHECK</code> or <code>RADIO</code>,
+ * it is selected when it is checked (which some platforms draw as a
+ * pushed in button). If the receiver is of any other type, this method
+ * returns false.
+ * </p>
+ *
+ * @return the selection state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool getSelection () {
+    checkWidget();
+    if ((style & (SWT.CHECK | SWT.RADIO)) is 0) return false;
+    return cast(bool)OS.gtk_toggle_button_get_active (handle);
+}
+
+/**
+ * Returns the receiver's tool tip text, or null if it has not been set.
+ *
+ * @return the receiver's tool tip text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getToolTipText () {
+    checkWidget();
+    return toolTipText;
+}
+
+/**
+ * Gets the width of the receiver.
+ *
+ * @return the width
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getWidth () {
+    checkWidget();
+    parent.forceResize ();
+    auto topHandle = topHandle ();
+    return OS.GTK_WIDGET_WIDTH (topHandle);
+}
+
+override int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* gdkEvent) {
+    double x = gdkEvent.x;
+    gdkEvent.x += OS.GTK_WIDGET_X (handle);
+    double y = gdkEvent.y;
+    gdkEvent.y += OS.GTK_WIDGET_Y (handle);
+    auto result = parent.gtk_button_press_event (widget, gdkEvent);
+    gdkEvent.x = x;
+    gdkEvent.y = y;
+    return result;
+}
+
+override int /*long*/ gtk_button_release_event (GtkWidget* widget, GdkEventButton* gdkEvent) {
+    double x = gdkEvent.x;
+    gdkEvent.x += OS.GTK_WIDGET_X (handle);
+    double y = gdkEvent.y;
+    gdkEvent.y += OS.GTK_WIDGET_Y (handle);
+    auto result = parent.gtk_button_release_event (widget, gdkEvent);
+    gdkEvent.x = x;
+    gdkEvent.y = y;
+    return result;
+}
+
+override int /*long*/ gtk_clicked (GtkWidget* widget) {
+    Event event = new Event ();
+    if ((style & SWT.DROP_DOWN) !is 0) {
+        auto eventPtr = OS.gtk_get_current_event ();
+        if (eventPtr !is null) {
+            GdkEvent* gdkEvent = cast(GdkEvent*)eventPtr;
+            switch (gdkEvent.type) {
+                case OS.GDK_BUTTON_PRESS:
+                case OS.GDK_2BUTTON_PRESS:
+                case OS.GDK_BUTTON_RELEASE: {
+                    double x_win;
+                    double y_win;
+                    OS.gdk_event_get_coords (eventPtr, &x_win, &y_win);
+                    int x = OS.GTK_WIDGET_X (arrowHandle) - OS.GTK_WIDGET_X (handle);
+                    int width = OS.GTK_WIDGET_WIDTH (arrowHandle);
+                    if ((((parent.style & SWT.RIGHT_TO_LEFT) is 0) && x <= cast(int)x_win)
+                        || (((parent.style & SWT.RIGHT_TO_LEFT) !is 0) && cast(int)x_win <= x + width)) {
+                        event.detail = SWT.ARROW;
+                        auto topHandle = topHandle ();
+                        event.x = OS.GTK_WIDGET_X (topHandle);
+                        if ((parent.style & SWT.MIRRORED) !is 0) event.x = parent.getClientWidth () - OS.GTK_WIDGET_WIDTH (topHandle) - event.x;
+                        event.y = OS.GTK_WIDGET_Y (topHandle) + OS.GTK_WIDGET_HEIGHT (topHandle);
+                    }
+                    break;
+                }
+                default:
+            }
+            OS.gdk_event_free (eventPtr);
+        }
+    }
+    if ((style & SWT.RADIO) !is 0) {
+        if ((parent.getStyle () & SWT.NO_RADIO_GROUP) is 0) {
+            selectRadio ();
+        }
+    }
+    postEvent (SWT.Selection, event);
+    return 0;
+}
+
+override int /*long*/ gtk_enter_notify_event (GtkWidget* widget, GdkEventCrossing* event) {
+    parent.gtk_enter_notify_event (widget, event);
+    drawHotImage = (parent.style & SWT.FLAT) !is 0 && hotImage !is null;
+    if (drawHotImage && imageHandle !is null) {
+        ImageList imageList = parent.imageList;
+        if (imageList !is null) {
+            int index = imageList.indexOf (hotImage);
+            if (index !is -1) {
+                auto pixbuf = imageList.getPixbuf (index);
+                OS.gtk_image_set_from_pixbuf (imageHandle, pixbuf);
+            }
+        }
+    }
+    return 0;
+}
+
+override int /*long*/ gtk_event_after (GtkWidget* widget, GdkEvent* gdkEvent) {
+    switch (gdkEvent.type) {
+        case OS.GDK_BUTTON_PRESS: {
+            GdkEventButton* gdkEventButton = cast(GdkEventButton*)gdkEvent;
+            if (gdkEventButton.button is 3) {
+                parent.showMenu (cast(int) gdkEventButton.x_root, cast(int) gdkEventButton.y_root);
+            }
+            break;
+        default:
+        }
+    }
+    return 0;
+}
+
+override int /*long*/ gtk_focus_out_event (GtkWidget* widget, GdkEventFocus* event) {
+    OS.GTK_WIDGET_UNSET_FLAGS (handle, OS.GTK_CAN_FOCUS);
+    parent.lastFocus = this;
+    return 0;
+}
+
+override int /*long*/ gtk_leave_notify_event (GtkWidget* widget, GdkEventCrossing* event) {
+    parent.gtk_leave_notify_event (widget, event);
+    if (drawHotImage) {
+        drawHotImage = false;
+        if (imageHandle !is null && image !is null) {
+            ImageList imageList = parent.imageList;
+            if (imageList !is null) {
+                int index = imageList.indexOf (image);
+                if (index !is -1) {
+                    auto pixbuf = imageList.getPixbuf (index);
+                    OS.gtk_image_set_from_pixbuf (imageHandle, pixbuf);
+                }
+            }
+        }
+    }
+    return 0;
+}
+
+override int /*long*/ gtk_map (GtkWidget* widget) {
+    parent.fixZOrder ();
+    return 0;
+}
+
+override int /*long*/ gtk_mnemonic_activate (GtkWidget* widget, int /*long*/ arg1) {
+    return parent.gtk_mnemonic_activate (widget, arg1);
+}
+
+bool hasFocus () {
+    return OS.GTK_WIDGET_HAS_FOCUS (handle);
+}
+
+override void hookEvents () {
+    super.hookEvents ();
+    if ((style & SWT.SEPARATOR) !is 0) return;
+    OS.g_signal_connect_closure (handle, OS.clicked.ptr, display.closures [CLICKED], false);
+    OS.g_signal_connect_closure_by_id (handle, display.signalIds [ENTER_NOTIFY_EVENT], 0, display.closures [ENTER_NOTIFY_EVENT], false);
+    OS.g_signal_connect_closure_by_id (handle, display.signalIds [LEAVE_NOTIFY_EVENT], 0, display.closures [LEAVE_NOTIFY_EVENT], false);
+    if (labelHandle !is null) OS.g_signal_connect_closure_by_id (labelHandle, display.signalIds [MNEMONIC_ACTIVATE], 0, display.closures [MNEMONIC_ACTIVATE], false);
+
+    OS.g_signal_connect_closure_by_id (handle, display.signalIds [FOCUS_OUT_EVENT], 0, display.closures [FOCUS_OUT_EVENT], false);
+
+    /*
+    * Feature in GTK.  Usually, GTK widgets propagate all events to their
+    * parent when they are done their own processing.  However, in contrast
+    * to other widgets, the buttons that make up the tool items, do not propagate
+    * the mouse up/down events. It is interesting to note that they DO propagate
+    * mouse motion events.  The fix is to explicitly forward mouse up/down events
+    * to the parent.
+    */
+    int mask =
+        OS.GDK_EXPOSURE_MASK | OS.GDK_POINTER_MOTION_MASK |
+        OS.GDK_BUTTON_PRESS_MASK | OS.GDK_BUTTON_RELEASE_MASK |
+        OS.GDK_ENTER_NOTIFY_MASK | OS.GDK_LEAVE_NOTIFY_MASK |
+        OS.GDK_KEY_PRESS_MASK | OS.GDK_KEY_RELEASE_MASK |
+        OS.GDK_FOCUS_CHANGE_MASK;
+    OS.gtk_widget_add_events (handle, mask);
+    OS.g_signal_connect_closure_by_id (handle, display.signalIds [BUTTON_PRESS_EVENT], 0, display.closures [BUTTON_PRESS_EVENT], false);
+    OS.g_signal_connect_closure_by_id (handle, display.signalIds [BUTTON_RELEASE_EVENT], 0, display.closures [BUTTON_RELEASE_EVENT], false);
+    OS.g_signal_connect_closure_by_id (handle, display.signalIds [EVENT_AFTER], 0, display.closures[EVENT_AFTER], false);
+
+    auto topHandle = topHandle ();
+    OS.g_signal_connect_closure_by_id (topHandle, display.signalIds [MAP], 0, display.closures [MAP], true);
+}
+
+/**
+ * Returns <code>true</code> if the receiver is enabled and all
+ * of the receiver's ancestors are enabled, and <code>false</code>
+ * otherwise. A disabled control is typically not selectable from the
+ * user interface and draws with an inactive or "grayed" look.
+ *
+ * @return the receiver's enabled state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getEnabled
+ */
+public bool isEnabled () {
+    checkWidget();
+    return getEnabled () && parent.isEnabled ();
+}
+
+override void register () {
+    super.register ();
+    if (labelHandle !is null) display.addWidget (labelHandle, this);
+}
+
+override void releaseHandle () {
+    super.releaseHandle ();
+    boxHandle = arrowHandle = separatorHandle = labelHandle = imageHandle = null;
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    if (parent.lastFocus is this) parent.lastFocus = null;
+    parent = null;
+    control = null;
+    hotImage = disabledImage = null;
+    toolTipText = null;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is selected by the user.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener(SelectionListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Selection, listener);
+    eventTable.unhook (SWT.DefaultSelection,listener);
+}
+
+void resizeControl () {
+    if (control !is null && !control.isDisposed ()) {
+        if (separatorHandle !is null) OS.gtk_widget_hide (separatorHandle);
+        /*
+        * Set the size and location of the control
+        * separately to minimize flashing in the
+        * case where the control does not resize
+        * to the size that was requested.  This
+        * case can occur when the control is a
+        * combo box.
+        */
+        Rectangle itemRect = getBounds ();
+        control.setSize (itemRect.width, itemRect.height);
+        OS.gtk_widget_set_size_request (handle, itemRect.width, itemRect.height);
+        Rectangle rect = control.getBounds ();
+        rect.x = itemRect.x + (itemRect.width - rect.width) / 2;
+        rect.y = itemRect.y + (itemRect.height - rect.height) / 2;
+        control.setLocation (rect.x, rect.y);
+    } else {
+        if (separatorHandle !is null) OS.gtk_widget_show (separatorHandle);
+    }
+}
+
+void selectRadio () {
+    int index = 0;
+    ToolItem [] items = parent.getItems ();
+    while (index < items.length && items [index] !is this) index++;
+    int i = index - 1;
+    while (i >= 0 && items [i].setRadioSelection (false)) --i;
+    int j = index + 1;
+    while (j < items.length && items [j].setRadioSelection (false)) j++;
+    setSelection (true);
+}
+
+/**
+ * Sets the control that is used to fill the bounds of
+ * the item when the item is a <code>SEPARATOR</code>.
+ *
+ * @param control the new control
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the control has been disposed</li>
+ *    <li>ERROR_INVALID_PARENT - if the control is not in the same widget tree</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setControl (Control control) {
+    checkWidget ();
+    if (control !is null) {
+        if (control.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
+        if (control.parent !is parent) error (SWT.ERROR_INVALID_PARENT);
+    }
+    if ((style & SWT.SEPARATOR) is 0) return;
+    if (this.control is control) return;
+    this.control = control;
+    parent.relayout ();
+}
+
+/**
+ * Sets the receiver's disabled image to the argument, which may be
+ * null indicating that no disabled image should be displayed.
+ * <p>
+ * The disabled image is displayed when the receiver is disabled.
+ * </p>
+ *
+ * @param image the disabled image to display on the receiver (may be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setDisabledImage (Image image) {
+    checkWidget();
+    if ((style & SWT.SEPARATOR) !is 0) return;
+    disabledImage = image;
+}
+
+/**
+ * Enables the receiver if the argument is <code>true</code>,
+ * and disables it otherwise.
+ * <p>
+ * A disabled control is typically
+ * not selectable from the user interface and draws with an
+ * inactive or "grayed" look.
+ * </p>
+ *
+ * @param enabled the new enabled state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setEnabled (bool enabled) {
+    checkWidget();
+    auto topHandle = topHandle ();
+    OS.gtk_widget_set_sensitive (topHandle, enabled);
+    if (enabled) {
+        /*
+        * Bug in GTK.  GtkButton requires an enter notify before it
+        * allows the button to be pressed, but events are dropped when
+        * widgets are insensitive.  The fix is to hide and show the
+        * button if the pointer is within its bounds.
+        */
+        int x, y;
+        OS.gdk_window_get_pointer (parent.paintWindow (), &x, &y, null);
+        if (getBounds ().contains (x, y)) {
+            OS.gtk_widget_hide (handle);
+            OS.gtk_widget_show (handle);
+        }
+    }
+}
+
+bool setFocus () {
+    if ((style & SWT.SEPARATOR) !is 0) return false;
+    if (!OS.gtk_widget_get_child_visible (handle)) return false;
+    OS.GTK_WIDGET_SET_FLAGS (handle, OS.GTK_CAN_FOCUS);
+    OS.gtk_widget_grab_focus (handle);
+    bool result = cast(bool)OS.gtk_widget_is_focus (handle);
+    if (!result) OS.GTK_WIDGET_UNSET_FLAGS (handle, OS.GTK_CAN_FOCUS);
+    return result;
+}
+
+void setFontDescription (PangoFontDescription* font) {
+    OS.gtk_widget_modify_font (handle, font);
+    if (labelHandle !is null) OS.gtk_widget_modify_font (labelHandle, font);
+    if (imageHandle !is null) OS.gtk_widget_modify_font (imageHandle, font);
+}
+
+alias Item.setForegroundColor setForegroundColor;
+void setForegroundColor (GdkColor* color) {
+    setForegroundColor (handle, color);
+    if (labelHandle !is null) setForegroundColor (labelHandle, color);
+    if (imageHandle !is null) setForegroundColor (imageHandle, color);
+}
+
+/**
+ * Sets the receiver's hot image to the argument, which may be
+ * null indicating that no hot image should be displayed.
+ * <p>
+ * The hot image is displayed when the mouse enters the receiver.
+ * </p>
+ *
+ * @param image the hot image to display on the receiver (may be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setHotImage (Image image) {
+    checkWidget();
+    if ((style & SWT.SEPARATOR) !is 0) return;
+    hotImage = image;
+    if (image !is null) {
+        ImageList imageList = parent.imageList;
+        if (imageList is null) imageList = parent.imageList = new ImageList ();
+        int imageIndex = imageList.indexOf (image);
+        if (imageIndex is -1) {
+            imageIndex = imageList.add (image);
+        } else {
+            imageList.put (imageIndex, image);
+        }
+    }
+}
+
+public override void setImage (Image image) {
+    checkWidget();
+    if ((style & SWT.SEPARATOR) !is 0) return;
+    super.setImage (image);
+    if (imageHandle is null) return;
+    if (image !is null) {
+        ImageList imageList = parent.imageList;
+        if (imageList is null) imageList = parent.imageList = new ImageList ();
+        int imageIndex = imageList.indexOf (image);
+        if (imageIndex is -1) {
+            imageIndex = imageList.add (image);
+        } else {
+            imageList.put (imageIndex, image);
+        }
+        auto pixbuf = imageList.getPixbuf (imageIndex);
+        OS.gtk_image_set_from_pixbuf (imageHandle, pixbuf);
+        OS.gtk_widget_show (imageHandle);
+    } else {
+        OS.gtk_image_set_from_pixbuf (imageHandle, null);
+        OS.gtk_widget_hide (imageHandle);
+    }
+    parent.relayout ();
+}
+
+void setOrientation () {
+    if ((parent.style & SWT.RIGHT_TO_LEFT) !is 0) {
+        if (handle !is null) OS.gtk_widget_set_direction (handle, OS.GTK_TEXT_DIR_RTL);
+        if (labelHandle !is null) OS.gtk_widget_set_direction (labelHandle, OS.GTK_TEXT_DIR_RTL);
+        if (imageHandle !is null) OS.gtk_widget_set_direction (imageHandle, OS.GTK_TEXT_DIR_RTL);
+        if (separatorHandle !is null) OS.gtk_widget_set_direction (separatorHandle, OS.GTK_TEXT_DIR_RTL);
+        if (arrowHandle !is null) OS.gtk_widget_set_direction (arrowHandle, OS.GTK_TEXT_DIR_RTL);
+        if (boxHandle !is null) OS.gtk_widget_set_direction (boxHandle, OS.GTK_TEXT_DIR_RTL);
+        if (arrowBoxHandle !is null) OS.gtk_widget_set_direction (arrowBoxHandle, OS.GTK_TEXT_DIR_RTL);
+    }
+}
+
+bool setRadioSelection (bool value) {
+    if ((style & SWT.RADIO) is 0) return false;
+    if (getSelection () !is value) {
+        setSelection (value);
+        postEvent (SWT.Selection);
+    }
+    return true;
+}
+
+/**
+ * Sets the selection state of the receiver.
+ * <p>
+ * When the receiver is of type <code>CHECK</code> or <code>RADIO</code>,
+ * it is selected when it is checked (which some platforms draw as a
+ * pushed in button).
+ * </p>
+ *
+ * @param selected the new selection state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (bool selected) {
+    checkWidget ();
+    if ((style & (SWT.CHECK | SWT.RADIO)) is 0) return;
+    OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCLICKED);
+    OS.gtk_toggle_button_set_active (handle, selected);
+    OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCLICKED);
+}
+
+/**
+ * Sets the receiver's text. The string may include
+ * the mnemonic character.
+ * </p>
+ * <p>
+ * Mnemonics are indicated by an '&amp;' that causes the next
+ * character to be the mnemonic.  When the user presses a
+ * key sequence that matches the mnemonic, a selection
+ * event occurs. On most platforms, the mnemonic appears
+ * underlined but may be emphasised in a platform specific
+ * manner.  The mnemonic indicator character '&amp;' can be
+ * escaped by doubling it in the string, causing a single
+ * '&amp;' to be displayed.
+ * </p>
+ *
+ * @param string the new text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public override void setText (String string) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if ((style & SWT.SEPARATOR) !is 0) return;
+    super.setText (string);
+    if (labelHandle is null) return;
+    char [] chars = fixMnemonic (string);
+    OS.gtk_label_set_text_with_mnemonic (labelHandle, chars.toStringzValidPtr());
+    if (string.length !is 0) {
+        OS.gtk_widget_show (labelHandle);
+    } else {
+        OS.gtk_widget_hide (labelHandle);
+    }
+    parent.relayout ();
+}
+
+/**
+ * Sets the receiver's tool tip text to the argument, which
+ * may be null indicating that no tool tip text should be shown.
+ *
+ * @param string the new tool tip text (or null)
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setToolTipText (String string) {
+    checkWidget();
+    if (parent.toolTipText is null) {
+        Shell shell = parent._getShell ();
+        setToolTipText (shell, string);
+    }
+    toolTipText = string;
+}
+
+void setToolTipText (Shell shell, String newString) {
+    shell.setToolTipText (handle, newString);
+}
+
+/**
+ * Sets the width of the receiver, for <code>SEPARATOR</code> ToolItems.
+ *
+ * @param width the new width
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setWidth (int width) {
+    checkWidget();
+    if ((style & SWT.SEPARATOR) is 0) return;
+    if (width < 0) return;
+    bool isVertical = (parent.style & SWT.VERTICAL) !is 0;
+    OS.gtk_widget_set_size_request (separatorHandle, width, isVertical ? 6 : 15);
+    OS.gtk_widget_set_size_request (handle, width, isVertical ? 6 : 15);
+    parent.relayout ();
+}
+
+void showWidget (int index) {
+    if (handle !is null) OS.gtk_widget_show (handle);
+    if (boxHandle !is null) OS.gtk_widget_show (boxHandle);
+    if (separatorHandle !is null) OS.gtk_widget_show (separatorHandle);
+    if (arrowBoxHandle !is null) OS.gtk_widget_show (arrowBoxHandle);
+    if (arrowHandle !is null) OS.gtk_widget_show (arrowHandle);
+    OS.gtk_toolbar_insert_widget (parent.handle, handle, null, null, index);
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/ToolTip.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,809 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.ToolTip;
+
+import java.lang.all;
+
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swt.widgets.TrayItem;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.SWT;
+//import org.eclipse.swt.internal.*;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Instances of this class represent popup windows that are used
+ * to inform or warn the user.
+ * <p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>BALLOON, ICON_ERROR, ICON_INFORMATION, ICON_WARNING</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection</dd>
+ * </dl>
+ * </p><p>
+ * Note: Only one of the styles ICON_ERROR, ICON_INFORMATION,
+ * and ICON_WARNING may be specified.
+ * </p><p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#tooltips">Tool Tips snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.2
+ */
+public class ToolTip : Widget {
+    Shell parent;
+    String text, message;
+    TrayItem item;
+    int x, y, timerId;
+    void* layoutText, layoutMessage;
+    int [] borderPolygon;
+    bool spikeAbove, autohide;
+    CallbackData timerProcCallbackData;
+
+    static final int BORDER = 5;
+    static final int PADDING = 5;
+    static final int INSET = 4;
+    static final int TIP_HEIGHT = 20;
+    static final int IMAGE_SIZE = 16;
+    static final int DELAY = 8000;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#ICON_ERROR
+ * @see SWT#ICON_INFORMATION
+ * @see SWT#ICON_WARNING
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Shell parent, int style) {
+    super (parent, checkStyle (style));
+    this.parent = parent;
+    createWidget (0);
+}
+
+static int checkStyle (int style) {
+    int mask = SWT.ICON_ERROR | SWT.ICON_INFORMATION | SWT.ICON_WARNING;
+    if ((style & mask) is 0) return style;
+    return checkBits (style, SWT.ICON_INFORMATION, SWT.ICON_WARNING, SWT.ICON_ERROR, 0, 0, 0);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the receiver is selected by the user, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * <code>widgetSelected</code> is called when the receiver is selected.
+ * <code>widgetDefaultSelected</code> is not called.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the receiver is selected by the user
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener (SelectionListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Selection,typedListener);
+    addListener (SWT.DefaultSelection,typedListener);
+}
+
+void configure () {
+    auto screen = OS.gdk_screen_get_default ();
+    OS.gtk_widget_realize (handle);
+    int monitorNumber = OS.gdk_screen_get_monitor_at_window (screen, OS.GTK_WIDGET_WINDOW (handle));
+    GdkRectangle* dest = new GdkRectangle ();
+    OS.gdk_screen_get_monitor_geometry (screen, monitorNumber, dest);
+    Point point = getSize (dest.width / 4);
+    int w = point.x;
+    int h = point.y;
+    point = getLocation ();
+    int x = point.x;
+    int y = point.y;
+    OS.gtk_window_resize (cast(GtkWindow*)handle, w, h + TIP_HEIGHT);
+    int[] polyline;
+    spikeAbove = dest.height >= y + h + TIP_HEIGHT;
+    if (dest.width >= x + w) {
+        if (dest.height >= y + h + TIP_HEIGHT) {
+            int t = TIP_HEIGHT;
+            polyline = [
+                0, 5+t, 1, 5+t, 1, 3+t, 3, 1+t,  5, 1+t, 5, t,
+                16, t, 16, 0, 35, t,
+                w-5, t, w-5, 1+t, w-3, 1+t, w-1, 3+t, w-1, 5+t, w, 5+t,
+                w, h-5+t, w-1, h-5+t, w-1, h-3+t, w-2, h-3+t, w-2, h-2+t, w-3, h-2+t, w-3, h-1+t, w-5, h-1+t, w-5, h+t,
+                5, h+t, 5, h-1+t, 3, h-1+t, 3, h-2+t, 2, h-2+t, 2, h-3+t, 1, h-3+t, 1, h-5+t, 0, h-5+t,
+                0, 5+t];
+            borderPolygon = [
+                0, 5+t, 1, 4+t, 1, 3+t, 3, 1+t,  4, 1+t, 5, t,
+                16, t, 16, 1, 35, t,
+                w-6, 0+t, w-5, 1+t, w-4, 1+t, w-2, 3+t, w-2, 4+t, w-1, 5+t,
+                w-1, h-6+t, w-2, h-5+t, w-2, h-4+t, w-4, h-2+t, w-5, h-2+t, w-6, h-1+t,
+                5, h-1+t, 4, h-2+t, 3, h-2+t, 1, h-4+t, 1, h-5+t, 0, h-6+t,
+                0, 5+t];
+            if ((parent.style & SWT.MIRRORED) !is 0) {
+                x -= w - 36;
+                polyline[12] = w-36;
+                polyline[14] = w-16;
+                polyline[16] = w-15;
+                borderPolygon[12] = w-35;
+                borderPolygon[14] = borderPolygon[16]  = w-16;
+            }
+            OS.gtk_window_move (cast(GtkWindow*)handle, Math.max(0, x - 17), y);
+        } else {
+            polyline = [
+                0, 5, 1, 5, 1, 3, 3, 1,  5, 1, 5, 0,
+                w-5, 0, w-5, 1, w-3, 1, w-1, 3, w-1, 5, w, 5,
+                w, h-5, w-1, h-5, w-1, h-3, w-2, h-3, w-2, h-2, w-3, h-2, w-3, h-1, w-5, h-1, w-5, h,
+                35, h, 16, h+TIP_HEIGHT, 16, h,
+                5, h, 5, h-1, 3, h-1, 3, h-2, 2, h-2, 2, h-3, 1, h-3, 1, h-5, 0, h-5,
+                0, 5];
+            borderPolygon = [
+                0, 5, 1, 4, 1, 3, 3, 1,  4, 1, 5, 0,
+                w-6, 0, w-5, 1, w-4, 1, w-2, 3, w-2, 4, w-1, 5,
+                w-1, h-6, w-2, h-5, w-2, h-4, w-4, h-2, w-5, h-2, w-6, h-1,
+                35, h-1, 17, h+TIP_HEIGHT-2, 17, h-1,
+                5, h-1, 4, h-2, 3, h-2, 1, h-4, 1, h-5, 0, h-6,
+                0, 5];
+            if ((parent.style & SWT.MIRRORED) !is 0) {
+                x -= w - 36;
+                polyline [42] =  polyline [44] =  w-16;
+                polyline [46] = w-35;
+                borderPolygon[36] = borderPolygon[38] = w-17;
+                borderPolygon [40] = w-35;
+            }
+            OS.gtk_window_move (cast(GtkWindow*)handle, Math.max(0, x - 17), y - h - TIP_HEIGHT);
+        }
+    } else {
+        if (dest.height >= y + h + TIP_HEIGHT) {
+            int t = TIP_HEIGHT;
+            polyline = [
+                0, 5+t, 1, 5+t, 1, 3+t, 3, 1+t,  5, 1+t, 5, t,
+                w-35, t, w-16, 0, w-16, t,
+                w-5, t, w-5, 1+t, w-3, 1+t, w-1, 3+t, w-1, 5+t, w, 5+t,
+                w, h-5+t, w-1, h-5+t, w-1, h-3+t, w-2, h-3+t, w-2, h-2+t, w-3, h-2+t, w-3, h-1+t, w-5, h-1+t, w-5, h+t,
+                5, h+t, 5, h-1+t, 3, h-1+t, 3, h-2+t, 2, h-2+t, 2, h-3+t, 1, h-3+t, 1, h-5+t, 0, h-5+t,
+                0, 5+t];
+            borderPolygon = [
+                0, 5+t, 1, 4+t, 1, 3+t, 3, 1+t,  4, 1+t, 5, t,
+                w-35, t, w-17, 2, w-17, t,
+                w-6, t, w-5, 1+t, w-4, 1+t, w-2, 3+t, w-2, 4+t, w-1, 5+t,
+                w-1, h-6+t, w-2, h-5+t, w-2, h-4+t, w-4, h-2+t, w-5, h-2+t, w-6, h-1+t,
+                5, h-1+t, 4, h-2+t, 3, h-2+t, 1, h-4+t, 1, h-5+t, 0, h-6+t,
+                0, 5+t];
+            if ((parent.style & SWT.MIRRORED) !is 0) {
+                x += w - 35;
+                polyline [12] = polyline [14] = 16;
+                polyline [16] = 35;
+                borderPolygon[12] =  borderPolygon[14] = 16;
+                borderPolygon [16] = 35;
+            }
+            OS.gtk_window_move (cast(GtkWindow*)handle, Math.min(dest.width - w, x - w + 17), y);
+        } else {
+            polyline = [
+                0, 5, 1, 5, 1, 3, 3, 1,  5, 1, 5, 0,
+                w-5, 0, w-5, 1, w-3, 1, w-1, 3, w-1, 5, w, 5,
+                w, h-5, w-1, h-5, w-1, h-3, w-2, h-3, w-2, h-2, w-3, h-2, w-3, h-1, w-5, h-1, w-5, h,
+                w-16, h, w-16, h+TIP_HEIGHT, w-35, h,
+                5, h, 5, h-1, 3, h-1, 3, h-2, 2, h-2, 2, h-3, 1, h-3, 1, h-5, 0, h-5,
+                0, 5];
+            borderPolygon = [
+                0, 5, 1, 4, 1, 3, 3, 1,  4, 1, 5, 0,
+                w-6, 0, w-5, 1, w-4, 1, w-2, 3, w-2, 4, w-1, 5,
+                w-1, h-6, w-2, h-5, w-2, h-4, w-4, h-2, w-5, h-2, w-6, h-1,
+                w-17, h-1, w-17, h+TIP_HEIGHT-2, w-36, h-1,
+                5, h-1, 4, h-2, 3, h-2, 1, h-4, 1, h-5, 0, h-6,
+                0, 5];
+            if ((parent.style & SWT.MIRRORED) !is 0) {
+                x += w - 35;
+                polyline [42] =  35;
+                polyline [44] = polyline [46] = 16;
+                borderPolygon[36] = 35;
+                borderPolygon[38] = borderPolygon [40] = 17;
+            }
+            OS.gtk_window_move (cast(GtkWindow*)handle, Math.min(dest.width - w, x - w + 17), y - h - TIP_HEIGHT);
+        }
+    }
+    auto rgn = OS.gdk_region_polygon ( cast(GdkPoint*)polyline.ptr, polyline.length / 2, OS.GDK_EVEN_ODD_RULE);
+    OS.gtk_widget_realize (handle);
+    auto window = OS.GTK_WIDGET_WINDOW (handle);
+    OS.gdk_window_shape_combine_region (window, rgn, 0, 0);
+    OS.gdk_region_destroy (rgn);
+}
+
+override void createHandle (int index) {
+    state |= HANDLE;
+    if ((style & SWT.BALLOON) !is 0) {
+        handle = OS.gtk_window_new (OS.GTK_WINDOW_POPUP);
+        Color background = display.getSystemColor (SWT.COLOR_INFO_BACKGROUND);
+        OS.gtk_widget_modify_bg (handle, OS.GTK_STATE_NORMAL, background.handle);
+        OS.gtk_widget_set_app_paintable (handle, true);
+    } else {
+        handle = cast(GtkWidget*)OS.gtk_tooltips_new ();
+        if (handle is null) SWT.error (SWT.ERROR_NO_HANDLES);
+        /*
+        * Bug in Solaris-GTK.  Invoking gtk_tooltips_force_window()
+        * can cause a crash in older versions of GTK.  The fix is
+        * to avoid this call if the GTK version is older than 2.2.x.
+        */
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 2, 1)) {
+            OS.gtk_tooltips_force_window (cast(GtkTooltips*)handle);
+        }
+        OS.g_object_ref (handle);
+        OS.gtk_object_sink (cast(GtkObject*)handle);
+    }
+}
+
+override void createWidget (int index) {
+    super.createWidget (index);
+    text = "";
+    message = "";
+    x = y = -1;
+    autohide = true;
+}
+
+override void deregister () {
+    super.deregister ();
+    if ((style & SWT.BALLOON) is 0) {
+        auto tipWindow = OS.GTK_TOOLTIPS_TIP_WINDOW (cast(GtkTooltips*)handle);
+        if (tipWindow !is null) display.removeWidget (tipWindow);
+    }
+}
+
+override void destroyWidget () {
+    auto topHandle = topHandle ();
+    releaseHandle ();
+    if (topHandle !is null && (state & HANDLE) !is 0) {
+        if ((style & SWT.BALLOON) !is 0) {
+            OS.gtk_widget_destroy (topHandle);
+        } else {
+            OS.g_object_unref (topHandle);
+        }
+    }
+}
+
+/**
+ * Returns <code>true</code> if the receiver is automatically
+ * hidden by the platform, and <code>false</code> otherwise.
+ *
+ * @return the receiver's auto hide state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ */
+public bool getAutoHide () {
+    checkWidget ();
+    return autohide;
+}
+
+Point getLocation () {
+    int x = this.x;
+    int y = this.y;
+    if (item !is null) {
+        auto itemHandle = item.handle;
+        OS.gtk_widget_realize (itemHandle);
+        auto window = OS.GTK_WIDGET_WINDOW (itemHandle);
+        int px, py;
+        OS.gdk_window_get_origin (cast(GdkWindow*)window, &px, &py);
+        x = px + OS.GTK_WIDGET_WIDTH (itemHandle) / 2;
+        y = py + OS.GTK_WIDGET_HEIGHT (itemHandle) / 2;
+    }
+    if (x is -1 || y is -1) {
+        int px, py;
+        OS.gdk_window_get_pointer (null, &px, &py, null);
+        x = px;
+        y = py;
+    }
+    return new Point(x, y);
+}
+
+/**
+ * Returns the receiver's message, which will be an empty
+ * string if it has never been set.
+ *
+ * @return the receiver's message
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getMessage () {
+    checkWidget ();
+    return message;
+}
+
+override String getNameText () {
+    return getText ();
+}
+
+/**
+ * Returns the receiver's parent, which must be a <code>Shell</code>.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Shell getParent () {
+    checkWidget ();
+    return parent;
+}
+
+Point getSize (int maxWidth) {
+    int textWidth = 0, messageWidth = 0;
+    int w, h;
+    if (layoutText !is null) {
+        OS.pango_layout_set_width (layoutText, -1);
+        OS.pango_layout_get_size (layoutText, &w, &h);
+        textWidth = OS.PANGO_PIXELS (w );
+    }
+    if (layoutMessage !is null) {
+        OS.pango_layout_set_width (layoutMessage, -1);
+        OS.pango_layout_get_size (layoutMessage, &w, &h);
+        messageWidth = OS.PANGO_PIXELS (w );
+    }
+    int messageTrim = 2 * INSET + 2 * BORDER + 2 * PADDING;
+    bool hasImage = layoutText !is null && (style & (SWT.ICON_ERROR | SWT.ICON_INFORMATION | SWT.ICON_WARNING)) !is 0;
+    int textTrim = messageTrim + (hasImage ? IMAGE_SIZE : 0);
+    int width = Math.min (maxWidth, Math.max (textWidth + textTrim, messageWidth + messageTrim));
+    int textHeight = 0, messageHeight = 0;
+    if (layoutText !is null) {
+        OS.pango_layout_set_width (layoutText, (maxWidth - textTrim) * OS.PANGO_SCALE);
+        OS.pango_layout_get_size (layoutText, &w, &h);
+        textHeight = OS.PANGO_PIXELS (h );
+    }
+    if (layoutMessage !is null) {
+        OS.pango_layout_set_width (layoutMessage, (maxWidth - messageTrim) * OS.PANGO_SCALE);
+        OS.pango_layout_get_size (layoutMessage, &w, &h);
+        messageHeight = OS.PANGO_PIXELS (h);
+    }
+    int height = 2 * BORDER + 2 * PADDING + messageHeight;
+    if (layoutText !is null) height += Math.max (IMAGE_SIZE, textHeight) + 2 * PADDING;
+    return new Point(width, height);
+}
+
+/**
+ * Returns the receiver's text, which will be an empty
+ * string if it has never been set.
+ *
+ * @return the receiver's text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getText () {
+    checkWidget ();
+    return text;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is visible, and
+ * <code>false</code> otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, this method
+ * may still indicate that it is considered visible even though
+ * it may not actually be showing.
+ * </p>
+ *
+ * @return the receiver's visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool getVisible () {
+    checkWidget ();
+    if ((style & SWT.BALLOON) !is 0) return OS.GTK_WIDGET_VISIBLE (handle);
+    auto tipWindow = OS.GTK_TOOLTIPS_TIP_WINDOW (cast(GtkTooltips*)handle);
+    return OS.GTK_WIDGET_VISIBLE (tipWindow);
+}
+
+override int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* event) {
+    notifyListeners (SWT.Selection, new Event ());
+    setVisible (false);
+    return 0;
+}
+
+override int /*long*/ gtk_expose_event (GtkWidget* widget, GdkEventExpose* event) {
+    auto window = OS.GTK_WIDGET_WINDOW (handle);
+    auto gdkGC = cast(GdkGC*)OS.gdk_gc_new (window);
+    OS.gdk_draw_polygon (window, gdkGC, 0, cast(GdkPoint*)borderPolygon.ptr, borderPolygon.length / 2);
+    int x = BORDER + PADDING;
+    int y = BORDER + PADDING;
+    if (spikeAbove) y += TIP_HEIGHT;
+    if (layoutText !is null) {
+        String buffer = null;
+        int id = style & (SWT.ICON_ERROR | SWT.ICON_INFORMATION | SWT.ICON_WARNING);
+        switch (id) {
+            case SWT.ICON_ERROR: buffer = "gtk-dialog-error"; break;
+            case SWT.ICON_INFORMATION: buffer = "gtk-dialog-info"; break;
+            case SWT.ICON_WARNING: buffer = "gtk-dialog-warning"; break;
+            default:
+        }
+        if (buffer !is null) {
+            auto style = OS.gtk_widget_get_default_style ();
+            auto pixbuf = OS.gtk_icon_set_render_icon (
+                OS.gtk_icon_factory_lookup_default (buffer.ptr),
+                style,
+                OS.GTK_TEXT_DIR_NONE,
+                OS.GTK_STATE_NORMAL,
+                OS.GTK_ICON_SIZE_MENU,
+                null,
+                null);
+            OS.gdk_draw_pixbuf (window, gdkGC, pixbuf, 0, 0, x, y, IMAGE_SIZE, IMAGE_SIZE, OS.GDK_RGB_DITHER_NORMAL, 0, 0);
+            OS.g_object_unref (pixbuf);
+            x += IMAGE_SIZE;
+        }
+        x += INSET;
+        OS.gdk_draw_layout (window, gdkGC, x, y, layoutText);
+        int w, h;
+        OS.pango_layout_get_size (layoutText, &w, &h);
+        y += 2 * PADDING + Math.max (IMAGE_SIZE, OS.PANGO_PIXELS (h ));
+    }
+    if (layoutMessage !is null) {
+        x = BORDER + PADDING + INSET;
+        OS.gdk_draw_layout (window, gdkGC, x, y, layoutMessage);
+    }
+    OS.g_object_unref (gdkGC);
+    return 0;
+}
+
+override int /*long*/ gtk_size_allocate (GtkWidget* widget, int /*long*/ allocation) {
+    Point point = getLocation ();
+    int x = point.x;
+    int y = point.y;
+    auto screen = OS.gdk_screen_get_default ();
+    OS.gtk_widget_realize (widget);
+    int monitorNumber = OS.gdk_screen_get_monitor_at_window (screen, OS.GTK_WIDGET_WINDOW (widget));
+    GdkRectangle* dest = new GdkRectangle ();
+    OS.gdk_screen_get_monitor_geometry (screen, monitorNumber, dest);
+    int w = OS.GTK_WIDGET_WIDTH (widget);
+    int h = OS.GTK_WIDGET_HEIGHT (widget);
+    if (dest.height < y + h) y -= h;
+    if (dest.width < x + w) x -= w;
+    OS.gtk_window_move (cast(GtkWindow*)widget, x, y);
+    return 0;
+}
+
+override void hookEvents () {
+    if ((style & SWT.BALLOON) !is 0) {
+        OS.g_signal_connect_closure (handle, OS.expose_event.ptr, display.closures [EXPOSE_EVENT], false);
+        OS.gtk_widget_add_events (handle, OS.GDK_BUTTON_PRESS_MASK);
+        OS.g_signal_connect_closure (handle, OS.button_press_event.ptr, display.closures [BUTTON_PRESS_EVENT], false);
+    } else {
+        auto tipWindow = OS.GTK_TOOLTIPS_TIP_WINDOW (cast(GtkTooltips*)handle);
+        if (tipWindow !is null) {
+            OS.g_signal_connect_closure (tipWindow, OS.size_allocate.ptr, display.closures [SIZE_ALLOCATE], false);
+            OS.gtk_widget_add_events (tipWindow, OS.GDK_BUTTON_PRESS_MASK);
+            OS.g_signal_connect_closure (tipWindow, OS.button_press_event.ptr, display.closures [BUTTON_PRESS_EVENT], false);
+        }
+    }
+}
+
+/**
+ * Returns <code>true</code> if the receiver is visible and all
+ * of the receiver's ancestors are visible and <code>false</code>
+ * otherwise.
+ *
+ * @return the receiver's visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getVisible
+ */
+public bool isVisible () {
+    checkWidget ();
+    return getVisible ();
+}
+
+override void register () {
+    super.register ();
+    if ((style & SWT.BALLOON) is 0) {
+        auto tipWindow = OS.GTK_TOOLTIPS_TIP_WINDOW (cast(GtkTooltips*)handle);
+        if (tipWindow !is null) display.addWidget (tipWindow, this);
+    }
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    if (layoutText !is null) OS.g_object_unref (layoutText);
+    layoutText = null;
+    if (layoutMessage !is null) OS.g_object_unref (layoutMessage);
+    layoutMessage = null;
+    if (timerId !is 0) OS.gtk_timeout_remove(timerId);
+    timerId = 0;
+    text = null;
+    message = null;
+    borderPolygon = null;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the receiver is selected by the user.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener (SelectionListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Selection, listener);
+    eventTable.unhook (SWT.DefaultSelection, listener);
+}
+
+/**
+ * Makes the receiver hide automatically when <code>true</code>,
+ * and remain visible when <code>false</code>.
+ *
+ * @param autoHide the auto hide state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getVisible
+ * @see #setVisible
+ */
+public void setAutoHide (bool autohide) {
+    checkWidget ();
+    this.autohide = autohide;
+    //TODO - update when visible
+}
+
+/**
+ * Sets the location of the receiver, which must be a tooltip,
+ * to the point specified by the arguments which are relative
+ * to the display.
+ * <p>
+ * Note that this is different from most widgets where the
+ * location of the widget is relative to the parent.
+ * </p>
+ *
+ * @param x the new x coordinate for the receiver
+ * @param y the new y coordinate for the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setLocation (int x, int y) {
+    checkWidget ();
+    this.x = x;
+    this.y = y;
+    if ((style & SWT.BALLOON) !is 0) {
+        if (OS.GTK_WIDGET_VISIBLE (handle)) configure ();
+    } else {
+        auto tipWindow = OS.GTK_TOOLTIPS_TIP_WINDOW (cast(GtkTooltips*)handle);
+        if (OS.GTK_WIDGET_VISIBLE (tipWindow)) {
+            OS.gtk_window_move (cast(GtkWindow*)tipWindow, x, y);
+        }
+    }
+}
+
+/**
+ * Sets the location of the receiver, which must be a tooltip,
+ * to the point specified by the argument which is relative
+ * to the display.
+ * <p>
+ * Note that this is different from most widgets where the
+ * location of the widget is relative to the parent.
+ * </p><p>
+ * Note that the platform window manager ultimately has control
+ * over the location of tooltips.
+ * </p>
+ *
+ * @param location the new location for the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setLocation (Point location) {
+    checkWidget ();
+    if (location is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    setLocation (location.x, location.y);
+}
+
+/**
+ * Sets the receiver's message.
+ *
+ * @param string the new message
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMessage (String string) {
+    checkWidget ();
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    message = string;
+    if ((style & SWT.BALLOON) is 0) return;
+    if (layoutMessage !is null) OS.g_object_unref (layoutMessage);
+    layoutMessage = null;
+    if (message.length !is 0) {
+        layoutMessage = OS.gtk_widget_create_pango_layout (handle, message.toStringzValidPtr());
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+            OS.pango_layout_set_auto_dir (layoutMessage, false);
+        }
+        OS.pango_layout_set_wrap (layoutMessage, OS.PANGO_WRAP_WORD_CHAR);
+    }
+    if (OS.GTK_WIDGET_VISIBLE (handle)) configure ();
+}
+
+/**
+ * Sets the receiver's text.
+ *
+ * @param string the new text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setText (String string) {
+    checkWidget ();
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    text = string;
+    if ((style & SWT.BALLOON) is 0) return;
+    if (layoutText !is null) OS.g_object_unref (layoutText);
+    layoutText = null;
+    if (text.length !is 0) {
+        layoutText = OS.gtk_widget_create_pango_layout (handle, text.toStringzValidPtr());
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) {
+            OS.pango_layout_set_auto_dir (layoutText, false);
+        }
+        auto boldAttr = OS.pango_attr_weight_new (OS.PANGO_WEIGHT_BOLD);
+        boldAttr.start_index = 0;
+        boldAttr.end_index = text.length+1;
+        auto attrList = OS.pango_attr_list_new ();
+        OS.pango_attr_list_insert (attrList, boldAttr);
+        OS.pango_layout_set_attributes (layoutText, attrList);
+        OS.pango_attr_list_unref (attrList);
+        OS.pango_layout_set_wrap (layoutText, OS.PANGO_WRAP_WORD_CHAR);
+    }
+    if (OS.GTK_WIDGET_VISIBLE (handle)) configure ();
+}
+
+/**
+ * Marks the receiver as visible if the argument is <code>true</code>,
+ * and marks it invisible otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, marking
+ * it visible may not actually cause it to be displayed.
+ * </p>
+ *
+ * @param visible the new visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setVisible (bool visible) {
+    if (timerId !is 0) OS.gtk_timeout_remove(timerId);
+    timerId = 0;
+    if (visible) {
+        if ((style & SWT.BALLOON) !is 0) {
+            configure ();
+            OS.gtk_widget_show (handle);
+        } else {
+            auto vboxHandle = parent.vboxHandle;
+            String string = text;
+            if (text.length > 0) string ~= "\n\n";
+            string ~= message;
+            char* buffer = toStringz( string );
+            OS.gtk_tooltips_set_tip (cast(GtkTooltips*)handle, vboxHandle, buffer, null);
+            auto data = OS.gtk_tooltips_data_get (vboxHandle);
+            OS.GTK_TOOLTIPS_SET_ACTIVE (cast(GtkTooltips*)handle, data);
+            OS.gtk_tooltips_set_tip (cast(GtkTooltips*)handle, vboxHandle, buffer, null);
+        }
+        if (autohide) timerId = display.doWindowTimerAdd( &timerProcCallbackData, DELAY, handle);
+    } else {
+        if ((style & SWT.BALLOON) !is 0) {
+            OS.gtk_widget_hide (handle);
+        } else {
+            auto tipWindow = OS.GTK_TOOLTIPS_TIP_WINDOW (cast(GtkTooltips*)handle);
+            OS.gtk_widget_hide (tipWindow);
+        }
+    }
+}
+
+override int /*long*/ timerProc (GtkWidget* widget) {
+    if ((style & SWT.BALLOON) !is 0) {
+        OS.gtk_widget_hide (handle);
+    } else {
+        auto tipWindow = OS.GTK_TOOLTIPS_TIP_WINDOW (cast(GtkTooltips*)handle);
+        OS.gtk_widget_hide (tipWindow);
+    }
+    return 0;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Tracker.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,1012 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Tracker;
+
+import java.lang.all;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.widgets.Event;
+
+import tango.core.Exception;
+import tango.core.Thread;
+
+/**
+ *  Instances of this class implement rubber banding rectangles that are
+ *  drawn onto a parent <code>Composite</code> or <code>Display</code>.
+ *  These rectangles can be specified to respond to mouse and key events
+ *  by either moving or resizing themselves accordingly.  Trackers are
+ *  typically used to represent window geometries in a lightweight manner.
+ *
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>LEFT, RIGHT, UP, DOWN, RESIZE</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Move, Resize</dd>
+ * </dl>
+ * <p>
+ * Note: Rectangle move behavior is assumed unless RESIZE is specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#tracker">Tracker snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class Tracker : Widget {
+    Composite parent;
+    Cursor cursor;
+    GdkCursor* lastCursor;
+    GdkDrawable* window;
+    bool tracking, cancelled, grabbed, stippled;
+    Rectangle [] rectangles, proportions;
+    Rectangle bounds;
+    int cursorOrientation = SWT.NONE;
+    int oldX, oldY;
+
+    final static int STEPSIZE_SMALL = 1;
+    final static int STEPSIZE_LARGE = 9;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a widget which will be the parent of the new instance (cannot be null)
+ * @param style the style of widget to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#LEFT
+ * @see SWT#RIGHT
+ * @see SWT#UP
+ * @see SWT#DOWN
+ * @see SWT#RESIZE
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Composite parent, int style) {
+    super (parent, checkStyle(style));
+    this.parent = parent;
+}
+
+/**
+ * Constructs a new instance of this class given the display
+ * to create it on and a style value describing its behavior
+ * and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p><p>
+ * Note: Currently, null can be passed in for the display argument.
+ * This has the effect of creating the tracker on the currently active
+ * display if there is one. If there is no current display, the
+ * tracker is created on a "default" display. <b>Passing in null as
+ * the display argument is not considered to be good coding style,
+ * and may not be supported in a future release of SWT.</b>
+ * </p>
+ *
+ * @param display the display to create the tracker on
+ * @param style the style of control to construct
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#LEFT
+ * @see SWT#RIGHT
+ * @see SWT#UP
+ * @see SWT#DOWN
+ */
+public this (Display display, int style) {
+    if (display is null) display = Display.getCurrent ();
+    if (display is null) display = Display.getDefault ();
+    if (!display.isValidThread ()) {
+        error (SWT.ERROR_THREAD_INVALID_ACCESS);
+    }
+    this.style = checkStyle (style);
+    this.display = display;
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the control is moved or resized, by sending
+ * it one of the messages defined in the <code>ControlListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ControlListener
+ * @see #removeControlListener
+ */
+public void addControlListener(ControlListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Resize, typedListener);
+    addListener (SWT.Move, typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when keys are pressed and released on the system keyboard, by sending
+ * it one of the messages defined in the <code>KeyListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see KeyListener
+ * @see #removeKeyListener
+ */
+public void addKeyListener(KeyListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener(SWT.KeyUp,typedListener);
+    addListener(SWT.KeyDown,typedListener);
+}
+
+Point adjustMoveCursor () {
+    if (bounds is null) return null;
+    int newX = bounds.x + bounds.width / 2;
+    int newY = bounds.y;
+
+    Point point = display.map (parent, null, newX, newY);
+    display.setCursorLocation (point);
+
+    /*
+     * The call to XWarpPointer does not always place the pointer on the
+     * exact location that is specified, so do a query (below) to get the
+     * actual location of the pointer after it has been moved.
+     */
+    int actualX, actualY, state;
+    OS.gdk_window_get_pointer (cast(GdkWindow*)window, &actualX, &actualY, &state);
+    return new Point (actualX, actualY);
+}
+
+Point adjustResizeCursor () {
+    if (bounds is null) return null;
+    int newX, newY;
+
+    if ((cursorOrientation & SWT.LEFT) !is 0) {
+        newX = bounds.x;
+    } else if ((cursorOrientation & SWT.RIGHT) !is 0) {
+        newX = bounds.x + bounds.width;
+    } else {
+        newX = bounds.x + bounds.width / 2;
+    }
+
+    if ((cursorOrientation & SWT.UP) !is 0) {
+        newY = bounds.y;
+    } else if ((cursorOrientation & SWT.DOWN) !is 0) {
+        newY = bounds.y + bounds.height;
+    } else {
+        newY = bounds.y + bounds.height / 2;
+    }
+
+    Point point = display.map (parent, null, newX, newY);
+    display.setCursorLocation (point);
+
+    /*
+     * The call to XWarpPointer does not always place the pointer on the
+     * exact location that is specified, so do a query (below) to get the
+     * actual location of the pointer after it has been moved.
+     */
+    int  actualX, actualY, state;
+    OS.gdk_window_get_pointer (window, &actualX, &actualY, &state);
+    return new Point (actualX, actualY );
+}
+
+
+/**
+ * Stops displaying the tracker rectangles.  Note that this is not considered
+ * to be a cancelation by the user.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void close () {
+    checkWidget();
+    tracking = false;
+}
+
+static int checkStyle (int style) {
+    if ((style & (SWT.LEFT | SWT.RIGHT | SWT.UP | SWT.DOWN)) is 0) {
+        style |= SWT.LEFT | SWT.RIGHT | SWT.UP | SWT.DOWN;
+    }
+    return style;
+}
+
+Rectangle computeBounds () {
+    if (rectangles.length is 0) return null;
+    int xMin = rectangles [0].x;
+    int yMin = rectangles [0].y;
+    int xMax = rectangles [0].x + rectangles [0].width;
+    int yMax = rectangles [0].y + rectangles [0].height;
+
+    for (int i = 1; i < rectangles.length; i++) {
+        if (rectangles [i].x < xMin) xMin = rectangles [i].x;
+        if (rectangles [i].y < yMin) yMin = rectangles [i].y;
+        int rectRight = rectangles [i].x + rectangles [i].width;
+        if (rectRight > xMax) xMax = rectRight;
+        int rectBottom = rectangles [i].y + rectangles [i].height;
+        if (rectBottom > yMax) yMax = rectBottom;
+    }
+
+    return new Rectangle (xMin, yMin, xMax - xMin, yMax - yMin);
+}
+
+Rectangle [] computeProportions (Rectangle [] rects) {
+    Rectangle [] result = new Rectangle [rects.length];
+    bounds = computeBounds ();
+    if (bounds !is null) {
+        for (int i = 0; i < rects.length; i++) {
+            int x = 0, y = 0, width = 0, height = 0;
+            if (bounds.width !is 0) {
+                x = (rects [i].x - bounds.x) * 100 / bounds.width;
+                width = rects [i].width * 100 / bounds.width;
+            } else {
+                width = 100;
+            }
+            if (bounds.height !is 0) {
+                y = (rects [i].y - bounds.y) * 100 / bounds.height;
+                height = rects [i].height * 100 / bounds.height;
+            } else {
+                height = 100;
+            }
+            result [i] = new Rectangle (x, y, width, height);
+        }
+    }
+    return result;
+}
+
+void drawRectangles (Rectangle [] rects) {
+    auto window = OS.GDK_ROOT_PARENT ();
+    if (parent !is null) {
+        window = OS.GTK_WIDGET_WINDOW (parent.paintHandle());
+    }
+    if (window is null) return;
+    auto gc = OS.gdk_gc_new (window);
+    if (gc is null) return;
+    auto colormap = OS.gdk_colormap_get_system ();
+    GdkColor color;
+    OS.gdk_color_white (colormap, &color);
+    OS.gdk_gc_set_foreground (gc, &color);
+    OS.gdk_gc_set_subwindow (gc, OS.GDK_INCLUDE_INFERIORS);
+    OS.gdk_gc_set_function (gc, OS.GDK_XOR);
+    for (int i=0; i<rects.length; i++) {
+        Rectangle rect = rects [i];
+        int x = rect.x;
+        if (parent !is null && (parent.style & SWT.MIRRORED) !is 0) x = parent.getClientWidth () - rect.width - x;
+        OS.gdk_draw_rectangle (window, gc, 0, x, rect.y, rect.width, rect.height);
+    }
+    OS.g_object_unref (gc);
+}
+
+/**
+ * Returns the bounds that are being drawn, expressed relative to the parent
+ * widget.  If the parent is a <code>Display</code> then these are screen
+ * coordinates.
+ *
+ * @return the bounds of the Rectangles being drawn
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Rectangle [] getRectangles () {
+    checkWidget();
+    Rectangle [] result = new Rectangle [rectangles.length];
+    for (int i = 0; i < rectangles.length; i++) {
+        Rectangle current = rectangles [i];
+        result [i] = new Rectangle (current.x, current.y, current.width, current.height);
+    }
+    return result;
+}
+
+/**
+ * Returns <code>true</code> if the rectangles are drawn with a stippled line, <code>false</code> otherwise.
+ *
+ * @return the stippled effect of the rectangles
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool getStippled () {
+    checkWidget();
+    return stippled;
+}
+
+bool grab () {
+    auto cursor = this.cursor !is null ? this.cursor.handle : null;
+    int result = OS.gdk_pointer_grab (window, false, OS.GDK_POINTER_MOTION_MASK | OS.GDK_BUTTON_RELEASE_MASK, window, cursor, OS.GDK_CURRENT_TIME);
+    return result is OS.GDK_GRAB_SUCCESS;
+}
+
+override int gtk_button_release_event (GtkWidget* widget, GdkEventButton* event) {
+    return gtk_mouse (OS.GDK_BUTTON_RELEASE, widget, event);
+}
+
+override int gtk_key_press_event (GtkWidget* widget, GdkEventKey* keyEvent) {
+    auto result = super.gtk_key_press_event (widget, keyEvent);
+    if (result !is 0) return result;
+    int stepSize = ((keyEvent.state & OS.GDK_CONTROL_MASK) !is 0) ? STEPSIZE_SMALL : STEPSIZE_LARGE;
+    int xChange = 0, yChange = 0;
+    switch (keyEvent.keyval) {
+        case OS.GDK_Escape:
+            cancelled = true;
+            // fallthrough
+        case OS.GDK_Return:
+            tracking = false;
+            break;
+        case OS.GDK_Left:
+            xChange = -stepSize;
+            break;
+        case OS.GDK_Right:
+            xChange = stepSize;
+            break;
+        case OS.GDK_Up:
+            yChange = -stepSize;
+            break;
+        case OS.GDK_Down:
+            yChange = stepSize;
+            break;
+        default:
+    }
+    if (xChange !is 0 || yChange !is 0) {
+        Rectangle [] oldRectangles = rectangles;
+        Rectangle [] rectsToErase = new Rectangle [rectangles.length];
+        for (int i = 0; i < rectangles.length; i++) {
+            Rectangle current = rectangles [i];
+            rectsToErase [i] = new Rectangle (current.x, current.y, current.width, current.height);
+        }
+        Event event = new Event ();
+        event.x = oldX + xChange;
+        event.y = oldY + yChange;
+        if (parent !is null && (parent.style & SWT.MIRRORED) !is 0) {
+            event.x = parent.getClientWidth () - event.width - event.x;
+        }
+        if ((style & SWT.RESIZE) !is 0) {
+            resizeRectangles (xChange, yChange);
+            sendEvent (SWT.Resize, event);
+            /*
+            * It is possible (but unlikely) that application
+            * code could have disposed the widget in the resize
+            * event.  If this happens return false to indicate
+            * that the tracking has failed.
+            */
+            if (isDisposed ()) {
+                cancelled = true;
+                return 1;
+            }
+            bool draw = false;
+            /*
+             * It is possible that application code could have
+             * changed the rectangles in the resize event.  If this
+             * happens then only redraw the tracker if the rectangle
+             * values have changed.
+             */
+            if (rectangles !is oldRectangles) {
+                int length = rectangles.length;
+                if (length !is rectsToErase.length) {
+                    draw = true;
+                } else {
+                    for (int i = 0; i < length; i++) {
+                        if (rectangles [i] !=/*eq*/ rectsToErase [i]) {
+                            draw = true;
+                            break;
+                        }
+                    }
+                }
+            } else {
+                draw = true;
+            }
+            if (draw) {
+                drawRectangles (rectsToErase);
+                update ();
+                drawRectangles (rectangles);
+            }
+            Point cursorPos = adjustResizeCursor ();
+            if (cursorPos !is null) {
+                oldX = cursorPos.x;
+                oldY = cursorPos.y;
+            }
+        } else {
+            moveRectangles (xChange, yChange);
+            sendEvent (SWT.Move, event);
+            /*
+            * It is possible (but unlikely) that application
+            * code could have disposed the widget in the move
+            * event.  If this happens return false to indicate
+            * that the tracking has failed.
+            */
+            if (isDisposed ()) {
+                cancelled = true;
+                return 1;
+            }
+            bool draw = false;
+            /*
+             * It is possible that application code could have
+             * changed the rectangles in the move event.  If this
+             * happens then only redraw the tracker if the rectangle
+             * values have changed.
+             */
+            if (rectangles !is oldRectangles) {
+                int length = rectangles.length;
+                if (length !is rectsToErase.length) {
+                    draw = true;
+                } else {
+                    for (int i = 0; i < length; i++) {
+                        if (rectangles [i] !=/*eq*/ rectsToErase [i]) {
+                            draw = true;
+                            break;
+                        }
+                    }
+                }
+            } else {
+                draw = true;
+            }
+            if (draw) {
+                drawRectangles (rectsToErase);
+                update ();
+                drawRectangles (rectangles);
+            }
+            Point cursorPos = adjustMoveCursor ();
+            if (cursorPos !is null) {
+                oldX = cursorPos.x;
+                oldY = cursorPos.y;
+            }
+        }
+    }
+    return result;
+}
+
+override int gtk_motion_notify_event (GtkWidget* widget, GdkEventMotion* eventPtr) {
+    auto cursor = this.cursor !is null ? this.cursor.handle : null;
+    if (cursor !is lastCursor) {
+        ungrab ();
+        grabbed = grab ();
+        lastCursor = cursor;
+    }
+    return gtk_mouse (OS.GDK_MOTION_NOTIFY, widget, eventPtr);
+}
+
+private int gtk_mouse (int eventType, GtkWidget* widget, void* eventPtr) {
+    int newX, newY;
+    OS.gdk_window_get_pointer (window, &newX, &newY, null);
+    if (oldX !is newX || oldY !is newY ) {
+        Rectangle [] oldRectangles = rectangles;
+        Rectangle [] rectsToErase = new Rectangle [rectangles.length];
+        for (int i = 0; i < rectangles.length; i++) {
+            Rectangle current = rectangles [i];
+            rectsToErase [i] = new Rectangle (current.x, current.y, current.width, current.height);
+        }
+        Event event = new Event ();
+        if (parent is null) {
+            event.x = newX ;
+            event.y = newY ;
+        } else {
+            Point screenCoord = display.map (parent, null, newX , newY );
+            event.x = screenCoord.x;
+            event.y = screenCoord.y;
+        }
+        if ((style & SWT.RESIZE) !is 0) {
+            resizeRectangles (newX  - oldX, newY  - oldY);
+            sendEvent (SWT.Resize, event);
+            /*
+            * It is possible (but unlikely), that application
+            * code could have disposed the widget in the resize
+            * event.  If this happens, return false to indicate
+            * that the tracking has failed.
+            */
+            if (isDisposed ()) {
+                cancelled = true;
+                return 1;
+            }
+            bool draw = false;
+            /*
+             * It is possible that application code could have
+             * changed the rectangles in the resize event.  If this
+             * happens then only redraw the tracker if the rectangle
+             * values have changed.
+             */
+            if (rectangles !is oldRectangles) {
+                int length = rectangles.length;
+                if (length !is rectsToErase.length) {
+                    draw = true;
+                } else {
+                    for (int i = 0; i < length; i++) {
+                        if (rectangles [i] !=/*eq*/ rectsToErase [i]) {
+                            draw = true;
+                            break;
+                        }
+                    }
+                }
+            } else {
+                draw = true;
+            }
+            if (draw) {
+                drawRectangles (rectsToErase);
+                update ();
+                drawRectangles (rectangles);
+            }
+            Point cursorPos = adjustResizeCursor ();
+            if (cursorPos !is null) {
+                newX  = cursorPos.x;
+                newY  = cursorPos.y;
+            }
+        } else {
+            moveRectangles (newX  - oldX, newY  - oldY);
+            sendEvent (SWT.Move, event);
+            /*
+            * It is possible (but unlikely), that application
+            * code could have disposed the widget in the move
+            * event.  If this happens, return false to indicate
+            * that the tracking has failed.
+            */
+            if (isDisposed ()) {
+                cancelled = true;
+                return 1;
+            }
+            bool draw = false;
+            /*
+             * It is possible that application code could have
+             * changed the rectangles in the move event.  If this
+             * happens then only redraw the tracker if the rectangle
+             * values have changed.
+             */
+            if (rectangles !is oldRectangles) {
+                int length = rectangles.length;
+                if (length !is rectsToErase.length) {
+                    draw = true;
+                } else {
+                    for (int i = 0; i < length; i++) {
+                        if (rectangles [i] !=/*eq*/ rectsToErase [i]) {
+                            draw = true;
+                            break;
+                        }
+                    }
+                }
+            } else {
+                draw = true;
+            }
+            if (draw) {
+                drawRectangles (rectsToErase);
+                update ();
+                drawRectangles (rectangles);
+            }
+        }
+        oldX = newX ;
+        oldY = newY ;
+    }
+    tracking = eventType !is OS.GDK_BUTTON_RELEASE;
+    return 0;
+}
+
+void moveRectangles (int xChange, int yChange) {
+    if (bounds is null) return;
+    if (xChange < 0 && ((style & SWT.LEFT) is 0)) xChange = 0;
+    if (xChange > 0 && ((style & SWT.RIGHT) is 0)) xChange = 0;
+    if (yChange < 0 && ((style & SWT.UP) is 0)) yChange = 0;
+    if (yChange > 0 && ((style & SWT.DOWN) is 0)) yChange = 0;
+    if (xChange is 0 && yChange is 0) return;
+    if (parent !is null && (parent.style & SWT.MIRRORED) !is 0) xChange *= -1;
+    bounds.x += xChange; bounds.y += yChange;
+    for (int i = 0; i < rectangles.length; i++) {
+        rectangles [i].x += xChange;
+        rectangles [i].y += yChange;
+    }
+}
+
+/**
+ * Displays the Tracker rectangles for manipulation by the user.  Returns when
+ * the user has either finished manipulating the rectangles or has cancelled the
+ * Tracker.
+ *
+ * @return <code>true</code> if the user did not cancel the Tracker, <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool open () {
+    checkWidget();
+    window = OS.GDK_ROOT_PARENT ();
+    if (parent !is null) {
+        window = OS.GTK_WIDGET_WINDOW (parent.paintHandle());
+    }
+    if (window is null) return false;
+    cancelled = false;
+    tracking = true;
+    update ();
+    drawRectangles (rectangles);
+    int oldX, oldY, state;
+    OS.gdk_window_get_pointer (window, &oldX, &oldY, &state);
+
+    /*
+    * if exactly one of UP/DOWN is specified as a style then set the cursor
+    * orientation accordingly (the same is done for LEFT/RIGHT styles below)
+    */
+    int vStyle = style & (SWT.UP | SWT.DOWN);
+    if (vStyle is SWT.UP || vStyle is SWT.DOWN) {
+        cursorOrientation |= vStyle;
+    }
+    int hStyle = style & (SWT.LEFT | SWT.RIGHT);
+    if (hStyle is SWT.LEFT || hStyle is SWT.RIGHT) {
+        cursorOrientation |= hStyle;
+    }
+
+    int mask = OS.GDK_BUTTON1_MASK | OS.GDK_BUTTON2_MASK | OS.GDK_BUTTON3_MASK;
+    bool mouseDown = (state  & mask) !is 0;
+    if (!mouseDown) {
+        Point cursorPos = null;
+        if ((style & SWT.RESIZE) !is 0) {
+            cursorPos = adjustResizeCursor ();
+        } else {
+            cursorPos = adjustMoveCursor ();
+        }
+        if (cursorPos !is null) {
+            oldX  = cursorPos.x;
+            oldY  = cursorPos.y;
+        }
+    }
+    this.oldX = oldX ;
+    this.oldY = oldY ;
+
+    grabbed = grab ();
+    lastCursor = this.cursor !is null ? this.cursor.handle : null;
+
+    /* Tracker behaves like a Dialog with its own OS event loop. */
+    GdkEvent* gdkEvent;
+    while (tracking) {
+        if (parent !is null && parent.isDisposed ()) break;
+        GdkEvent* eventPtr;
+        while (true) {
+            eventPtr = OS.gdk_event_get ();
+            if (eventPtr !is null) {
+                break;
+            } else {
+                try { Thread.sleep(0.050); } catch (Exception ex) {}
+            }
+        }
+        gdkEvent = eventPtr;
+        auto widget = OS.gtk_get_event_widget (eventPtr);
+        switch (gdkEvent.type) {
+            case OS.GDK_MOTION_NOTIFY: gtk_motion_notify_event (widget, cast(GdkEventMotion*)eventPtr); break;
+            case OS.GDK_BUTTON_RELEASE: gtk_button_release_event (widget, cast(GdkEventButton*)eventPtr); break;
+            case OS.GDK_KEY_PRESS: gtk_key_press_event (widget, cast(GdkEventKey*)eventPtr); break;
+            case OS.GDK_KEY_RELEASE: gtk_key_release_event (widget, cast(GdkEventKey*)eventPtr); break;
+            case OS.GDK_BUTTON_PRESS:
+            case OS.GDK_2BUTTON_PRESS:
+            case OS.GDK_3BUTTON_PRESS:
+            case OS.GDK_ENTER_NOTIFY:
+            case OS.GDK_LEAVE_NOTIFY:
+                /* Do not dispatch these */
+                break;
+            case OS.GDK_EXPOSE:
+                update ();
+                drawRectangles (rectangles);
+                OS.gtk_main_do_event (eventPtr);
+                drawRectangles (rectangles);
+                break;
+            default:
+                OS.gtk_main_do_event (eventPtr);
+        }
+        OS.gdk_event_free (eventPtr);
+    }
+    if (!isDisposed ()) {
+        update ();
+        drawRectangles (rectangles);
+    }
+    ungrab ();
+    window = null;
+    return !cancelled;
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    parent = null;
+    rectangles = proportions = null;
+    bounds = null;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is moved or resized.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ControlListener
+ * @see #addControlListener
+ */
+public void removeControlListener (ControlListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Resize, listener);
+    eventTable.unhook (SWT.Move, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when keys are pressed and released on the system keyboard.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see KeyListener
+ * @see #addKeyListener
+ */
+public void removeKeyListener(KeyListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.KeyUp, listener);
+    eventTable.unhook (SWT.KeyDown, listener);
+}
+
+void resizeRectangles (int xChange, int yChange) {
+    if (bounds is null) return;
+    if (parent !is null && (parent.style & SWT.MIRRORED) !is 0) xChange *= -1;
+    /*
+    * If the cursor orientation has not been set in the orientation of
+    * this change then try to set it here.
+    */
+    if (xChange < 0 && ((style & SWT.LEFT) !is 0) && ((cursorOrientation & SWT.RIGHT) is 0)) {
+        cursorOrientation |= SWT.LEFT;
+    }
+    if (xChange > 0 && ((style & SWT.RIGHT) !is 0) && ((cursorOrientation & SWT.LEFT) is 0)) {
+        cursorOrientation |= SWT.RIGHT;
+    }
+    if (yChange < 0 && ((style & SWT.UP) !is 0) && ((cursorOrientation & SWT.DOWN) is 0)) {
+        cursorOrientation |= SWT.UP;
+    }
+    if (yChange > 0 && ((style & SWT.DOWN) !is 0) && ((cursorOrientation & SWT.UP) is 0)) {
+        cursorOrientation |= SWT.DOWN;
+    }
+
+    /*
+     * If the bounds will flip about the x or y axis then apply the adjustment
+     * up to the axis (ie.- where bounds width/height becomes 0), change the
+     * cursor's orientation accordingly, and flip each Rectangle's origin (only
+     * necessary for > 1 Rectangles)
+     */
+    if ((cursorOrientation & SWT.LEFT) !is 0) {
+        if (xChange > bounds.width) {
+            if ((style & SWT.RIGHT) is 0) return;
+            cursorOrientation |= SWT.RIGHT;
+            cursorOrientation &= ~SWT.LEFT;
+            bounds.x += bounds.width;
+            xChange -= bounds.width;
+            bounds.width = 0;
+            if (proportions.length > 1) {
+                for (int i = 0; i < proportions.length; i++) {
+                    Rectangle proportion = proportions [i];
+                    proportion.x = 100 - proportion.x - proportion.width;
+                }
+            }
+        }
+    } else if ((cursorOrientation & SWT.RIGHT) !is 0) {
+        if (bounds.width < -xChange) {
+            if ((style & SWT.LEFT) is 0) return;
+            cursorOrientation |= SWT.LEFT;
+            cursorOrientation &= ~SWT.RIGHT;
+            xChange += bounds.width;
+            bounds.width = 0;
+            if (proportions.length > 1) {
+                for (int i = 0; i < proportions.length; i++) {
+                    Rectangle proportion = proportions [i];
+                    proportion.x = 100 - proportion.x - proportion.width;
+                }
+            }
+        }
+    }
+    if ((cursorOrientation & SWT.UP) !is 0) {
+        if (yChange > bounds.height) {
+            if ((style & SWT.DOWN) is 0) return;
+            cursorOrientation |= SWT.DOWN;
+            cursorOrientation &= ~SWT.UP;
+            bounds.y += bounds.height;
+            yChange -= bounds.height;
+            bounds.height = 0;
+            if (proportions.length > 1) {
+                for (int i = 0; i < proportions.length; i++) {
+                    Rectangle proportion = proportions [i];
+                    proportion.y = 100 - proportion.y - proportion.height;
+                }
+            }
+        }
+    } else if ((cursorOrientation & SWT.DOWN) !is 0) {
+        if (bounds.height < -yChange) {
+            if ((style & SWT.UP) is 0) return;
+            cursorOrientation |= SWT.UP;
+            cursorOrientation &= ~SWT.DOWN;
+            yChange += bounds.height;
+            bounds.height = 0;
+            if (proportions.length > 1) {
+                for (int i = 0; i < proportions.length; i++) {
+                    Rectangle proportion = proportions [i];
+                    proportion.y = 100 - proportion.y - proportion.height;
+                }
+            }
+        }
+    }
+
+    // apply the bounds adjustment
+    if ((cursorOrientation & SWT.LEFT) !is 0) {
+        bounds.x += xChange;
+        bounds.width -= xChange;
+    } else if ((cursorOrientation & SWT.RIGHT) !is 0) {
+        bounds.width += xChange;
+    }
+    if ((cursorOrientation & SWT.UP) !is 0) {
+        bounds.y += yChange;
+        bounds.height -= yChange;
+    } else if ((cursorOrientation & SWT.DOWN) !is 0) {
+        bounds.height += yChange;
+    }
+
+    Rectangle [] newRects = new Rectangle [rectangles.length];
+    for (int i = 0; i < rectangles.length; i++) {
+        Rectangle proportion = proportions[i];
+        newRects[i] = new Rectangle (
+            proportion.x * bounds.width / 100 + bounds.x,
+            proportion.y * bounds.height / 100 + bounds.y,
+            proportion.width * bounds.width / 100,
+            proportion.height * bounds.height / 100);
+    }
+    rectangles = newRects;
+}
+
+/**
+ * Sets the <code>Cursor</code> of the Tracker.  If this cursor is <code>null</code>
+ * then the cursor reverts to the default.
+ *
+ * @param newCursor the new <code>Cursor</code> to display
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setCursor (Cursor value) {
+    checkWidget ();
+    cursor = value;
+}
+
+/**
+ * Specifies the rectangles that should be drawn, expressed relative to the parent
+ * widget.  If the parent is a Display then these are screen coordinates.
+ *
+ * @param rectangles the bounds of the rectangles to be drawn
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the set of rectangles contains a null rectangle</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setRectangles (Rectangle [] rectangles) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (rectangles is null) error (SWT.ERROR_NULL_ARGUMENT);
+    int length = rectangles.length;
+    this.rectangles = new Rectangle [length];
+    for (int i = 0; i < length; i++) {
+        Rectangle current = rectangles [i];
+        if (current is null) error (SWT.ERROR_NULL_ARGUMENT);
+        this.rectangles [i] = new Rectangle (current.x, current.y, current.width, current.height);
+    }
+    proportions = computeProportions (rectangles);
+}
+
+/**
+ * Changes the appearance of the line used to draw the rectangles.
+ *
+ * @param stippled <code>true</code> if rectangle should appear stippled
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setStippled (bool stippled) {
+    checkWidget();
+    this.stippled = stippled;
+}
+
+void ungrab () {
+    if (grabbed) OS.gdk_pointer_ungrab (OS.GDK_CURRENT_TIME);
+}
+
+void update () {
+    if (parent !is null) {
+        if (parent.isDisposed ()) return;
+        parent.getShell ().update ();
+    } else {
+        display.update ();
+    }
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Tray.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,155 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Tray;
+
+import java.lang.all;
+
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swt.widgets.TrayItem;
+import org.eclipse.swt.SWT;
+
+/**
+ * Instances of this class represent the system tray that is part
+ * of the task bar status area on some operating systems.
+ *
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>(none)</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see Display#getSystemTray
+ * @see <a href="http://www.eclipse.org/swt/snippets/#tray">Tray, TrayItem snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.0
+ */
+public class Tray : Widget {
+    int itemCount;
+    TrayItem [] items;
+
+this (Display display, int style) {
+    items = new TrayItem [4];
+    if (display is null) display = Display.getCurrent ();
+    if (display is null) display = Display.getDefault ();
+    if (!display.isValidThread ()) {
+        error (SWT.ERROR_THREAD_INVALID_ACCESS);
+    }
+    this.display = display;
+}
+
+void createItem (TrayItem item, int index) {
+    if (!(0 <= index && index <= itemCount)) error (SWT.ERROR_INVALID_RANGE);
+    if (itemCount is items.length) {
+        TrayItem [] newItems = new TrayItem [items.length + 4];
+        System.arraycopy (items, 0, newItems, 0, items.length);
+        items = newItems;
+    }
+    System.arraycopy (items, index, items, index + 1, itemCount++ - index);
+    items [index] = item;
+}
+
+void destroyItem (TrayItem item) {
+    int index = 0;
+    while (index < itemCount) {
+        if (items [index] is item) break;
+        index++;
+    }
+    if (index is itemCount) return;
+    System.arraycopy (items, index + 1, items, index, --itemCount - index);
+    items [itemCount] = null;
+}
+
+/**
+ * Returns the item at the given, zero-relative index in the
+ * receiver. Throws an exception if the index is out of range.
+ *
+ * @param index the index of the item to return
+ * @return the item at the given index
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TrayItem getItem (int index) {
+    checkWidget ();
+    if (!(0 <= index && index < itemCount)) error (SWT.ERROR_INVALID_RANGE);
+    return items [index];
+}
+
+/**
+ * Returns the number of items contained in the receiver.
+ *
+ * @return the number of items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemCount () {
+    checkWidget ();
+    return itemCount;
+}
+
+/**
+ * Returns an array of <code>TrayItem</code>s which are the items
+ * in the receiver.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the items in the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TrayItem [] getItems () {
+    checkWidget ();
+    TrayItem [] result = new TrayItem [itemCount];
+    System.arraycopy (items, 0, result, 0, result.length);
+    return result;
+}
+
+override void releaseChildren (bool destroy) {
+    if (items !is null) {
+        for (int i=0; i<items.length; i++) {
+            TrayItem item = items [i];
+            if (item !is null && !item.isDisposed ()) {
+                item.release (false);
+            }
+        }
+        items = null;
+    }
+    super.releaseChildren (destroy);
+}
+
+override void releaseParent () {
+    super.releaseParent ();
+    if (display.tray is this) display.tray = null;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/TrayItem.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,512 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.TrayItem;
+
+import java.lang.all;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Tray;
+import org.eclipse.swt.widgets.ToolTip;
+import org.eclipse.swt.widgets.ImageList;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.MenuDetectListener;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.Region;
+import org.eclipse.swt.internal.gtk.OS;
+
+import tango.util.Convert;
+
+/**
+ * Instances of this class represent icons that can be placed on the
+ * system tray or task bar status area.
+ * <p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>(none)</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>DefaultSelection, MenuDetect, Selection</dd>
+ * </dl>
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#tray">Tray, TrayItem snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.0
+ */
+public class TrayItem : Item {
+    Tray parent;
+    ToolTip toolTip;
+    String toolTipText;
+    GtkWidget* imageHandle;
+    GtkWidget* tooltipsHandle;
+    ImageList imageList;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Tray</code>) and a style value
+ * describing its behavior and appearance. The item is added
+ * to the end of the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Tray parent, int style) {
+    super (parent, style);
+    this.parent = parent;
+    createWidget (parent.getItemCount ());
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the platform-specific context menu trigger
+ * has occurred, by sending it one of the messages defined in
+ * the <code>MenuDetectListener</code> interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see MenuDetectListener
+ * @see #removeMenuDetectListener
+ *
+ * @since 3.3
+ */
+public void addMenuDetectListener (MenuDetectListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.MenuDetect, typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the receiver is selected by the user, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * <code>widgetSelected</code> is called when the receiver is selected
+ * <code>widgetDefaultSelected</code> is called when the receiver is double-clicked
+ * </p>
+ *
+ * @param listener the listener which should be notified when the receiver is selected by the user
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener(SelectionListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Selection, typedListener);
+    addListener (SWT.DefaultSelection, typedListener);
+}
+
+protected override void checkSubclass () {
+    if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+override void createWidget (int index) {
+    super.createWidget (index);
+    parent.createItem (this, index);
+}
+
+override void createHandle (int index) {
+    state |= HANDLE;
+    handle = OS.gtk_plug_new (0);
+    if (handle is null) error (SWT.ERROR_NO_HANDLES);
+    imageHandle = OS.gtk_image_new ();
+    if (imageHandle is null) error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_container_add (cast(GtkContainer*)handle, imageHandle);
+    OS.gtk_widget_show (handle);
+    OS.gtk_widget_show (imageHandle);
+    auto id = OS.gtk_plug_get_id (cast(GtkPlug*)handle);
+    int monitor = 0;
+    auto screen = OS.gdk_screen_get_default ();
+    if (screen !is null) {
+        monitor = OS.gdk_screen_get_number (screen);
+    }
+    auto trayAtom = OS.gdk_atom_intern (toStringz("_NET_SYSTEM_TRAY_S" ~ to!(String)(monitor)), true);
+    auto xTrayAtom = OS.gdk_x11_atom_to_xatom (trayAtom);
+    auto xDisplay = OS.GDK_DISPLAY ();
+    auto trayWindow = OS.XGetSelectionOwner (xDisplay, xTrayAtom);
+    auto messageAtom = OS.gdk_atom_intern (toStringz("_NET_SYSTEM_TRAY_OPCODE"), true);
+    auto xMessageAtom = OS.gdk_x11_atom_to_xatom (messageAtom);
+    XClientMessageEvent* event = cast(XClientMessageEvent*)OS.g_malloc (XClientMessageEvent.sizeof);;
+    event.type = OS.ClientMessage;
+    event.window = trayWindow;
+    event.message_type = xMessageAtom;
+    event.format = 32;
+    event.data.l [0] = OS.GDK_CURRENT_TIME;
+    event.data.l [1] = OS.SYSTEM_TRAY_REQUEST_DOCK;
+    event.data.l [2] = id;
+    OS.XSendEvent (xDisplay, trayWindow, false, OS.NoEventMask, cast(XEvent*) event);
+    OS.g_free (event);
+}
+
+override void deregister () {
+    super.deregister ();
+    display.removeWidget (imageHandle);
+}
+
+override void destroyWidget () {
+    parent.destroyItem (this);
+    releaseHandle ();
+}
+
+/**
+ * Returns the receiver's parent, which must be a <code>Tray</code>.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public Tray getParent () {
+    checkWidget ();
+    return parent;
+}
+
+/**
+ * Returns the receiver's tool tip, or null if it has
+ * not been set.
+ *
+ * @return the receiver's tool tip text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public ToolTip getToolTip () {
+    checkWidget ();
+    return toolTip;
+}
+
+/**
+ * Returns the receiver's tool tip text, or null if it has
+ * not been set.
+ *
+ * @return the receiver's tool tip text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getToolTipText () {
+    checkWidget ();
+    return toolTipText;
+}
+
+override int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* event) {
+    if (event.type is OS.GDK_3BUTTON_PRESS) return 0;
+    if (event.button is 3 && event.type is OS.GDK_BUTTON_PRESS) {
+        sendEvent (SWT.MenuDetect);
+        return 0;
+    }
+    if (event.type is OS.GDK_2BUTTON_PRESS) {
+        postEvent (SWT.DefaultSelection);
+    } else {
+        postEvent (SWT.Selection);
+    }
+    return 0;
+}
+
+override int /*long*/ gtk_size_allocate (GtkWidget* widget, int /*long*/ allocation) {
+    if (image !is null && image.mask !is null) {
+        if (OS.gdk_drawable_get_depth (image.mask) is 1) {
+            int xoffset = cast(int) Math.floor (OS.GTK_WIDGET_X (widget) + ((OS.GTK_WIDGET_WIDTH (widget) - OS.GTK_WIDGET_REQUISITION_WIDTH (widget)) * 0.5) + 0.5);
+            int yoffset = cast(int) Math.floor (OS.GTK_WIDGET_Y (widget) + ((OS.GTK_WIDGET_HEIGHT (widget) - OS.GTK_WIDGET_REQUISITION_HEIGHT (widget)) * 0.5) + 0.5);
+            Rectangle b = image.getBounds();
+            auto gdkImage = OS.gdk_drawable_get_image (image.mask, 0, 0, b.width, b.height);
+            if (gdkImage is null) SWT.error(SWT.ERROR_NO_HANDLES);
+            byte[] maskData = (cast(byte*)gdkImage.mem)[ 0 .. gdkImage.bpl * gdkImage.height].dup;
+            Region region = new Region (display);
+            for (int y = 0; y < b.height; y++) {
+                for (int x = 0; x < b.width; x++) {
+                    int index = (y * gdkImage.bpl) + (x >> 3);
+                    int theByte = maskData [index] & 0xFF;
+                    int mask = 1 << (x & 0x7);
+                    if ((theByte & mask) !is 0) {
+                        region.add (xoffset + x, yoffset + y, 1, 1);
+                    }
+                }
+            }
+            OS.g_object_unref (gdkImage);
+            OS.gtk_widget_realize (handle);
+            auto window = OS.GTK_WIDGET_WINDOW (handle);
+            OS.gdk_window_shape_combine_region (window, region.handle, 0, 0);
+            region.dispose ();
+        }
+    }
+    return 0;
+}
+
+override void hookEvents () {
+    int eventMask = OS.GDK_BUTTON_PRESS_MASK;
+    OS.gtk_widget_add_events (handle, eventMask);
+    OS.g_signal_connect_closure_by_id (handle, display.signalIds [BUTTON_PRESS_EVENT], 0, display.closures [BUTTON_PRESS_EVENT], false);
+    OS.g_signal_connect_closure_by_id (imageHandle, display.signalIds [SIZE_ALLOCATE], 0, display.closures [SIZE_ALLOCATE], false);
+ }
+
+/**
+ * Returns <code>true</code> if the receiver is visible and
+ * <code>false</code> otherwise.
+ *
+ * @return the receiver's visibility
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool getVisible () {
+    checkWidget ();
+    return OS.GTK_WIDGET_VISIBLE (handle);
+}
+
+override void register () {
+    super.register ();
+    display.addWidget (imageHandle, this);
+}
+
+override void releaseHandle () {
+    if (handle !is null) OS.gtk_widget_destroy (handle);
+    handle = imageHandle = null;
+    super.releaseHandle ();
+    parent = null;
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    if (tooltipsHandle !is null) OS.g_object_unref (tooltipsHandle);
+    tooltipsHandle = null;
+    if (imageList !is null) imageList.dispose ();
+    imageList = null;
+    toolTipText = null;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the platform-specific context menu trigger has
+ * occurred.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see MenuDetectListener
+ * @see #addMenuDetectListener
+ *
+ * @since 3.3
+ */
+public void removeMenuDetectListener (MenuDetectListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.MenuDetect, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the receiver is selected by the user.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener (SelectionListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Selection, listener);
+    eventTable.unhook (SWT.DefaultSelection, listener);
+}
+
+/**
+ * Sets the receiver's image.
+ *
+ * @param image the new image
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public override void setImage (Image image) {
+    checkWidget ();
+    if (image !is null && image.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+    this.image = image;
+    if (image !is null) {
+        Rectangle rect = image.getBounds ();
+        OS.gtk_widget_set_size_request (handle, rect.width, rect.height);
+        if (imageList is null) imageList = new ImageList ();
+        int imageIndex = imageList.indexOf (image);
+        if (imageIndex is -1) {
+            imageIndex = imageList.add (image);
+        } else {
+            imageList.put (imageIndex, image);
+        }
+        auto pixbuf = imageList.getPixbuf (imageIndex);
+        OS.gtk_image_set_from_pixbuf (cast(GtkImage*)imageHandle, pixbuf);
+        OS.gtk_widget_show (imageHandle);
+    } else {
+        OS.gtk_widget_set_size_request (handle, 1, 1);
+        OS.gtk_image_set_from_pixbuf (cast(GtkImage*)imageHandle, null);
+        OS.gtk_widget_hide (imageHandle);
+    }
+}
+
+/**
+ * Sets the receiver's tool tip to the argument, which
+ * may be null indicating that no tool tip should be shown.
+ *
+ * @param toolTip the new tool tip (or null)
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setToolTip (ToolTip toolTip) {
+    checkWidget ();
+    ToolTip oldTip = this.toolTip, newTip = toolTip;
+    if (oldTip !is null) oldTip.item = null;
+    this.toolTip = newTip;
+    if (newTip !is null) newTip.item = this;
+}
+
+/**
+ * Sets the receiver's tool tip text to the argument, which
+ * may be null indicating that no tool tip text should be shown.
+ *
+ * @param value the new tool tip text (or null)
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setToolTipText (String string) {
+    checkWidget ();
+    toolTipText = string;
+    char* buffer = null;
+    if (string !is null && string.length > 0) {
+        buffer = toStringz( string );
+    }
+    if (tooltipsHandle is null) {
+        tooltipsHandle = cast(GtkWidget*)OS.gtk_tooltips_new ();
+        if (tooltipsHandle is null) error (SWT.ERROR_NO_HANDLES);
+        OS.g_object_ref (cast(GObject*)tooltipsHandle);
+        OS.gtk_object_sink (cast(GtkObject*)tooltipsHandle);
+    }
+    OS.gtk_tooltips_set_tip (cast(GtkTooltips*)tooltipsHandle, handle, buffer, null);
+}
+
+/**
+ * Makes the receiver visible if the argument is <code>true</code>,
+ * and makes it invisible otherwise.
+ *
+ * @param visible the new visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setVisible (bool visible) {
+    checkWidget ();
+    if (OS.GTK_WIDGET_VISIBLE (handle) is visible) return;
+    if (visible) {
+        /*
+        * It is possible (but unlikely), that application
+        * code could have disposed the widget in the show
+        * event.  If this happens, just return.
+        */
+        sendEvent (SWT.Show);
+        if (isDisposed ()) return;
+        OS.gtk_widget_show (handle);
+    } else {
+        OS.gtk_widget_hide (handle);
+        sendEvent (SWT.Hide);
+    }
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Tree.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,3357 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Tree;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.TreeListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.ImageList;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Decorations;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.ScrollBar;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.TypedListener;
+import java.lang.all;
+
+/**
+ * Instances of this class provide a selectable user interface object
+ * that displays a hierarchy of items and issues notification when an
+ * item in the hierarchy is selected.
+ * <p>
+ * The item children that may be added to instances of this class
+ * must be of type <code>TreeItem</code>.
+ * </p><p>
+ * Style <code>VIRTUAL</code> is used to create a <code>Tree</code> whose
+ * <code>TreeItem</code>s are to be populated by the client on an on-demand basis
+ * instead of up-front.  This can provide significant performance improvements for
+ * trees that are very large or for which <code>TreeItem</code> population is
+ * expensive (for example, retrieving values from an external source).
+ * </p><p>
+ * Here is an example of using a <code>Tree</code> with style <code>VIRTUAL</code>:
+ * <code><pre>
+ *  final Tree tree = new Tree(parent, SWT.VIRTUAL | SWT.BORDER);
+ *  tree.setItemCount(20);
+ *  tree.addListener(SWT.SetData, new Listener() {
+ *      public void handleEvent(Event event) {
+ *          TreeItem item = (TreeItem)event.item;
+ *          TreeItem parentItem = item.getParentItem();
+ *          String text = null;
+ *          if (parentItem is null) {
+ *              text = "node " + tree.indexOf(item);
+ *          } else {
+ *              text = parentItem.getText() + " - " + parentItem.indexOf(item);
+ *          }
+ *          item.setText(text);
+ *          System.out.println(text);
+ *          item.setItemCount(10);
+ *      }
+ *  });
+ * </pre></code>
+ * </p><p>
+ * Note that although this class is a subclass of <code>Composite</code>,
+ * it does not normally make sense to add <code>Control</code> children to
+ * it, or set a layout on it, unless implementing something like a cell
+ * editor.
+ * </p><p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>SINGLE, MULTI, CHECK, FULL_SELECTION, VIRTUAL, NO_SCROLL</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection, DefaultSelection, Collapse, Expand, SetData, MeasureItem, EraseItem, PaintItem</dd>
+ * </dl>
+ * </p><p>
+ * Note: Only one of the styles SINGLE and MULTI may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#tree">Tree, TreeItem, TreeColumn snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class Tree : Composite {
+
+    alias Composite.computeSize computeSize;
+    alias Composite.createHandle createHandle;
+    alias Composite.dragDetect dragDetect;
+    alias Composite.mnemonicHit mnemonicHit;
+    alias Composite.mnemonicMatch mnemonicMatch;
+    alias Composite.setBackgroundColor setBackgroundColor;
+    alias Composite.setBounds setBounds;
+
+    CallbackData treeSelectionCallbackData;
+    GtkTreeStore* modelHandle;
+    GtkCellRenderer* checkRenderer;
+    int columnCount, sortDirection;
+    GtkWidget* ignoreCell;
+    TreeItem[] items;
+    TreeColumn [] columns;
+    TreeColumn sortColumn;
+    TreeItem currentItem;
+    ImageList imageList, headerImageList;
+    bool firstCustomDraw;
+    bool modelChanged;
+    bool expandAll;
+    int drawState, drawFlags;
+    GdkColor* drawForeground;
+    bool ownerDraw, ignoreSize;
+
+    static const int ID_COLUMN = 0;
+    static const int CHECKED_COLUMN = 1;
+    static const int GRAYED_COLUMN = 2;
+    static const int FOREGROUND_COLUMN = 3;
+    static const int BACKGROUND_COLUMN = 4;
+    static const int FONT_COLUMN = 5;
+    static const int FIRST_COLUMN = FONT_COLUMN + 1;
+    static const int CELL_PIXBUF = 0;
+    static const int CELL_TEXT = 1;
+    static const int CELL_FOREGROUND = 2;
+    static const int CELL_BACKGROUND = 3;
+    static const int CELL_FONT = 4;
+    static const int CELL_TYPES = CELL_FONT + 1;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#SINGLE
+ * @see SWT#MULTI
+ * @see SWT#CHECK
+ * @see SWT#FULL_SELECTION
+ * @see SWT#VIRTUAL
+ * @see SWT#NO_SCROLL
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Composite parent, int style) {
+    super (parent, checkStyle (style));
+}
+
+override void _addListener (int eventType, Listener listener) {
+    super._addListener (eventType, listener);
+    if (!ownerDraw) {
+        switch (eventType) {
+            case SWT.MeasureItem:
+            case SWT.EraseItem:
+            case SWT.PaintItem:
+                ownerDraw = true;
+                recreateRenderers ();
+                break;
+            default:
+        }
+    }
+}
+
+TreeItem _getItem (GtkTreeIter* iter) {
+    int id = getId (iter, true);
+    if (items [id] !is null) return items [id];
+    auto path = OS.gtk_tree_model_get_path (modelHandle, iter);
+    int depth = OS.gtk_tree_path_get_depth (path);
+    int [] indices = new int [depth];
+    indices[] = OS.gtk_tree_path_get_indices (path)[ 0 .. depth ];
+    GtkTreeIter* parentIter;
+    GtkTreeIter parentIterInst;
+    if (depth > 1) {
+        OS.gtk_tree_path_up (path);
+        parentIter = &parentIterInst;
+        OS.gtk_tree_model_get_iter (modelHandle, parentIter, path);
+    }
+    items [id] = new TreeItem (this, parentIter, SWT.NONE, indices [indices.length -1], false);
+    OS.gtk_tree_path_free (path);
+    return items [id];
+}
+
+TreeItem _getItem (GtkTreeIter* parentIter, int index) {
+    GtkTreeIter iter;
+    OS.gtk_tree_model_iter_nth_child(modelHandle, &iter, parentIter, index);
+    int id = getId (&iter, true);
+    if (items [id] !is null) return items [id];
+    return items [id] = new TreeItem (this, parentIter, SWT.NONE, index, false);
+}
+
+int getId (GtkTreeIter* iter, bool queryModel) {
+    if (queryModel) {
+        int value;
+        OS.gtk_tree_model_get1 (modelHandle, iter, ID_COLUMN, cast(void**)&value);
+        if (value  !is -1) return value ;
+    }
+    // find next available id
+    int id = 0;
+    while (id < items.length && items [id] !is null) id++;
+    if (id is items.length) {
+        TreeItem [] newItems = new TreeItem [items.length + 4];
+        System.arraycopy (items, 0, newItems, 0, items.length);
+        items = newItems;
+    }
+    OS.gtk_tree_store_set1 (modelHandle, iter, ID_COLUMN, cast(void*)id );
+    return id;
+}
+
+static int checkStyle (int style) {
+    /*
+    * Feature in Windows.  Even when WS_HSCROLL or
+    * WS_VSCROLL is not specified, Windows creates
+    * trees and tables with scroll bars.  The fix
+    * is to set H_SCROLL and V_SCROLL.
+    *
+    * NOTE: This code appears on all platforms so that
+    * applications have consistent scroll bar behavior.
+    */
+    if ((style & SWT.NO_SCROLL) is 0) {
+        style |= SWT.H_SCROLL | SWT.V_SCROLL;
+    }
+    /* GTK is always FULL_SELECTION */
+    style |= SWT.FULL_SELECTION;
+    return checkBits (style, SWT.SINGLE, SWT.MULTI, 0, 0, 0, 0);
+}
+
+override void cellDataProc (
+    GtkTreeViewColumn *tree_column,
+    GtkCellRenderer *cell,
+    GtkTreeModel *tree_model,
+    GtkTreeIter *iter,
+    void* data)
+{
+    if (cell is cast(GtkCellRenderer*)ignoreCell) return;
+    TreeItem item = _getItem (iter);
+    if (item !is null) OS.g_object_set_qdata (cast(GObject*)cell, Display.SWT_OBJECT_INDEX2, item.handle);
+    bool isPixbuf = OS.GTK_IS_CELL_RENDERER_PIXBUF (cell);
+    if (!(isPixbuf || OS.GTK_IS_CELL_RENDERER_TEXT (cell))) return;
+    int modelIndex = -1;
+    bool customDraw = false;
+    if (columnCount is 0) {
+        modelIndex = Tree.FIRST_COLUMN;
+        customDraw = firstCustomDraw;
+    } else {
+        TreeColumn column = cast(TreeColumn) display.getWidget (cast(GtkWidget*)tree_column);
+        if (column !is null) {
+            modelIndex = column.modelIndex;
+            customDraw = column.customDraw;
+        }
+    }
+    if (modelIndex is -1) return 0;
+    bool setData = false;
+    if ((style & SWT.VIRTUAL) !is 0) {
+        /*
+        * Feature in GTK.  On GTK before 2.4, fixed_height_mode is not
+        * supported, and the tree asks for the data of all items.  The
+        * fix is to only provide the data if the row is visible.
+        */
+        if (OS.GTK_VERSION < OS.buildVERSION (2, 3, 2)) {
+            auto path = OS.gtk_tree_model_get_path (tree_model, iter);
+            OS.gtk_widget_realize (handle);
+            GdkRectangle visible;
+            OS.gtk_tree_view_get_visible_rect (handle, &visible);
+            GdkRectangle area;
+            OS.gtk_tree_view_get_cell_area (handle, path, tree_column, &area);
+            OS.gtk_tree_path_free (path);
+            if (area.y + area.height < 0 || area.y + visible.y > visible.y + visible.height ) {
+                /* Give an image from the image list to make sure the row has
+                * the correct height.
+                */
+                if (imageList !is null && imageList.pixbufs.length > 0) {
+                    if (isPixbuf) OS.g_object_set1 (cell, OS.pixbuf.ptr, cast(int)imageList.pixbufs [0]);
+                }
+                return 0;
+            }
+        }
+        if (!item.cached) {
+            //lastIndexOf = index [0];
+            setData = checkData (item);
+        }
+    }
+    void* ptr;
+    if (setData) {
+        if (isPixbuf) {
+            ptr = null;
+            OS.gtk_tree_model_get1 (tree_model, iter, modelIndex + CELL_PIXBUF, &ptr);
+            OS.g_object_set1 (cell, OS.pixbuf.ptr, cast(int)ptr);
+        } else {
+            ptr = null;
+            OS.gtk_tree_model_get1 (tree_model, iter, modelIndex + CELL_TEXT, &ptr);
+            if (ptr !is null) {
+                OS.g_object_set1 (cell, OS.text.ptr, cast(int)ptr);
+                OS.g_free (ptr);
+            }
+        }
+    }
+    if (customDraw) {
+        /*
+         * Bug on GTK. Gtk renders the background on top of the checkbox and pixbuf.
+         * This only happens in version 2.2.1 and earlier. The fix is not to set the background.
+         */
+        if (OS.GTK_VERSION > OS.buildVERSION (2, 2, 1)) {
+            if (!ownerDraw) {
+                ptr = null;
+                OS.gtk_tree_model_get1 (tree_model, iter, modelIndex + CELL_BACKGROUND, &ptr);
+                if (ptr !is null) {
+                    OS.g_object_set1 (cell, OS.cell_background_gdk.ptr, cast(int)ptr);
+                }
+            }
+        }
+        if (!isPixbuf) {
+            ptr = null;
+            OS.gtk_tree_model_get1 (tree_model, iter, modelIndex + CELL_FOREGROUND, &ptr);
+            if (ptr !is null) {
+                OS.g_object_set1 (cell, OS.foreground_gdk.ptr, cast(int)ptr);
+            }
+            ptr = null;
+            OS.gtk_tree_model_get1 (tree_model, iter, modelIndex + CELL_FONT, &ptr);
+            if (ptr !is null) {
+                OS.g_object_set1 (cell, OS.font_desc.ptr, cast(int)ptr);
+            }
+        }
+    }
+    if (setData) {
+        ignoreCell = cast(GtkWidget*)cell;
+        setScrollWidth (tree_column, item);
+        ignoreCell = null;
+    }
+}
+
+bool checkData (TreeItem item) {
+    if (item.cached) return true;
+    if ((style & SWT.VIRTUAL) !is 0) {
+        item.cached = true;
+        TreeItem parentItem = item.getParentItem ();
+        Event event = new Event ();
+        event.item = item;
+        event.index = parentItem is null ? indexOf (item) : parentItem.indexOf (item);
+        int mask = OS.G_SIGNAL_MATCH_DATA | OS.G_SIGNAL_MATCH_ID;
+        int signal_id = OS.g_signal_lookup (OS.row_changed.ptr, OS.gtk_tree_model_get_type ());
+        OS.g_signal_handlers_block_matched (modelHandle, mask, signal_id, 0, null, null, handle);
+        currentItem = item;
+        sendEvent (SWT.SetData, event);
+        currentItem = null;
+        //widget could be disposed at this point
+        if (isDisposed ()) return false;
+        OS.g_signal_handlers_unblock_matched (modelHandle, mask, signal_id, 0, null, null, handle);
+        if (item.isDisposed ()) return false;
+    }
+    return true;
+}
+
+protected override void checkSubclass () {
+    if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the user changes the receiver's selection, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * When <code>widgetSelected</code> is called, the item field of the event object is valid.
+ * If the receiver has the <code>SWT.CHECK</code> style and the check selection changes,
+ * the event object detail field contains the value <code>SWT.CHECK</code>.
+ * <code>widgetDefaultSelected</code> is typically called when an item is double-clicked.
+ * The item field of the event object is valid for default selection, but the detail field is not used.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the user changes the receiver's selection
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener (SelectionListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Selection, typedListener);
+    addListener (SWT.DefaultSelection, typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when an item in the receiver is expanded or collapsed
+ * by sending it one of the messages defined in the <code>TreeListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see TreeListener
+ * @see #removeTreeListener
+ */
+public void addTreeListener(TreeListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Expand, typedListener);
+    addListener (SWT.Collapse, typedListener);
+}
+
+int calculateWidth (GtkTreeViewColumn *column, GtkTreeIter* iter, bool recurse) {
+    OS.gtk_tree_view_column_cell_set_cell_data (column, modelHandle, iter, false, false);
+    /*
+    * Bug in GTK.  The width calculated by gtk_tree_view_column_cell_get_size()
+    * always grows in size regardless of the text or images in the table.
+    * The fix is to determine the column width from the cell renderers.
+    */
+    // Code intentionally commented
+    //int [] width = new int [1];
+    //OS.gtk_tree_view_column_cell_get_size (column, null, null, null, width, null);
+    //return width [0];
+
+    int width = 0;
+    int w;
+    GtkTreePath* path = null;
+
+    if (OS.gtk_tree_view_get_expander_column (handle) is column) {
+        /* indent */
+        GdkRectangle rect;
+        OS.gtk_widget_realize (handle);
+        path = OS.gtk_tree_model_get_path (modelHandle, iter);
+        OS.gtk_tree_view_get_cell_area (handle, path, column, &rect);
+        width += rect.x;
+        /* expander */
+        OS.gtk_widget_style_get1 (handle, OS.expander_size.ptr, &w);
+        width += w  + TreeItem.EXPANDER_EXTRA_PADDING;
+    }
+    OS.gtk_widget_style_get1(handle, OS.focus_line_width.ptr, &w);
+    width += 2 * w ;
+    auto list = OS.gtk_tree_view_column_get_cell_renderers (column);
+    if (list is null) return 0;
+    auto temp = list;
+    while (temp !is null) {
+        auto renderer = OS.g_list_data (temp);
+        if (renderer !is null) {
+            OS.gtk_cell_renderer_get_size (renderer, handle, null, null, null, &w, null);
+            width += w ;
+        }
+        temp = OS.g_list_next (temp);
+    }
+    OS.g_list_free (list);
+
+    if (recurse) {
+        if (path is null) path = OS.gtk_tree_model_get_path (modelHandle, iter);
+        bool expanded = OS.gtk_tree_view_row_expanded (handle, path) !is 0;
+        if (expanded) {
+            GtkTreeIter childIter;
+            bool valid = OS.gtk_tree_model_iter_children (modelHandle, &childIter, iter) !is 0;
+            while (valid) {
+                width = Math.max (width, calculateWidth (column, &childIter, true));
+                valid = OS.gtk_tree_model_iter_next (modelHandle, &childIter) !is 0;
+            }
+        }
+    }
+
+    if (path !is null) OS.gtk_tree_path_free (path);
+    return width;
+}
+
+/**
+ * Clears the item at the given zero-relative index in the receiver.
+ * The text, icon and other attributes of the item are set to the default
+ * value.  If the tree was created with the <code>SWT.VIRTUAL</code> style,
+ * these attributes are requested again as needed.
+ *
+ * @param index the index of the item to clear
+ * @param all <code>true</code> if all child items of the indexed item should be
+ * cleared recursively, and <code>false</code> otherwise
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT#VIRTUAL
+ * @see SWT#SetData
+ *
+ * @since 3.2
+ */
+public void clear(int index, bool all) {
+    checkWidget ();
+    clear (null, index, all);
+}
+
+void clear (GtkTreeIter* parentIter, int index, bool all) {
+    GtkTreeIter iter;
+    OS.gtk_tree_model_iter_nth_child(modelHandle, &iter, parentIter, index);
+    int value;
+    OS.gtk_tree_model_get1 (modelHandle, &iter, ID_COLUMN, cast(void**)&value);
+    if (value  !is -1) {
+        TreeItem item = items [value ];
+        item.clear ();
+    }
+    if (all) clearAll (all, &iter);
+}
+
+/**
+ * Clears all the items in the receiver. The text, icon and other
+ * attributes of the items are set to their default values. If the
+ * tree was created with the <code>SWT.VIRTUAL</code> style, these
+ * attributes are requested again as needed.
+ *
+ * @param all <code>true</code> if all child items should be cleared
+ * recursively, and <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT#VIRTUAL
+ * @see SWT#SetData
+ *
+ * @since 3.2
+ */
+public void clearAll (bool all) {
+    checkWidget ();
+    clearAll (all, null);
+}
+void clearAll (bool all, GtkTreeIter* parentIter) {
+    int length = OS.gtk_tree_model_iter_n_children (modelHandle, parentIter);
+    if (length is 0) return;
+    GtkTreeIter iter;
+    bool valid = cast(bool)OS.gtk_tree_model_iter_children (modelHandle, &iter, parentIter);
+    int value;
+    while (valid) {
+        OS.gtk_tree_model_get1 (modelHandle, &iter, ID_COLUMN, cast(void**)&value);
+        if (value  !is -1) {
+            TreeItem item = items [value ];
+            item.clear ();
+        }
+        if (all) clearAll (all, &iter);
+        valid = cast(bool)OS.gtk_tree_model_iter_next (modelHandle, &iter);
+    }
+}
+
+public override Point computeSize (int wHint, int hHint, bool changed) {
+    checkWidget ();
+    if (wHint !is SWT.DEFAULT && wHint < 0) wHint = 0;
+    if (hHint !is SWT.DEFAULT && hHint < 0) hHint = 0;
+    Point size = computeNativeSize (handle, wHint, hHint, changed);
+    Rectangle trim = computeTrim (0, 0, size.x, size.y);
+    size.x = trim.width;
+    size.y = trim.height;
+    return size;
+}
+
+void copyModel (void* oldModel, int oldStart, void* newModel, int newStart, uint [] types, void* oldParent, void* newParent, int modelLength) {
+    GtkTreeIter iter;
+    if (OS.gtk_tree_model_iter_children (oldModel, &iter, oldParent))  {
+        GtkTreeIter*[] oldItems = new GtkTreeIter*[]( OS.gtk_tree_model_iter_n_children (oldModel, oldParent));
+        int oldIndex = 0;
+        do {
+            GtkTreeIter* newItem = cast(GtkTreeIter*)OS.g_malloc (GtkTreeIter.sizeof);
+            if (newItem is null) error (SWT.ERROR_NO_HANDLES);
+            OS.gtk_tree_store_append (newModel, newItem, newParent);
+            int index;
+            OS.gtk_tree_model_get1 (oldModel, &iter, ID_COLUMN, cast(void**)&index);
+            TreeItem item = null;
+            if (index  !is -1) {
+                item = items [index ];
+                if (item !is null) {
+                    auto oldItem = cast(GtkTreeIter*)item.handle;
+                    oldItems[oldIndex++] = oldItem;
+                    void* ptr;
+                    for (int j = 0; j < FIRST_COLUMN; j++) {
+                        OS.gtk_tree_model_get1 (oldModel, oldItem, j, &ptr);
+                        OS.gtk_tree_store_set1 (newModel, newItem, j, ptr );
+                        if (types [j] is OS.G_TYPE_STRING ()) OS.g_free ((ptr ));
+                    }
+                    for (int j= 0; j<modelLength - FIRST_COLUMN; j++) {
+                        OS.gtk_tree_model_get1 (oldModel, oldItem, oldStart + j, &ptr);
+                        OS.gtk_tree_store_set1 (newModel, newItem, newStart + j, ptr );
+                        if (types [j] is OS.G_TYPE_STRING ()) OS.g_free ((ptr ));
+                    }
+                }
+            } else {
+                OS.gtk_tree_store_set1 (newModel, newItem, ID_COLUMN, cast(void*)-1 );
+            }
+            // recurse through children
+            copyModel(oldModel, oldStart, newModel, newStart, types, &iter, newItem, modelLength);
+
+            if (item!is null) {
+                item.handle = cast(GtkWidget*)newItem;
+            } else {
+                OS.g_free (newItem);
+            }
+        } while (OS.gtk_tree_model_iter_next(oldModel, &iter));
+        for (int i = 0; i < oldItems.length; i++) {
+            auto oldItem = oldItems [i];
+            if (oldItem !is null) {
+                OS.gtk_tree_store_remove (oldModel, oldItem);
+                OS.g_free (oldItem);
+            }
+        }
+    }
+}
+
+void createColumn (TreeColumn column, int index) {
+/*
+* Bug in ATK. For some reason, ATK segments fault if
+* the GtkTreeView has a column and does not have items.
+* The fix is to insert the column only when an item is
+* created.
+*/
+
+    int modelIndex = FIRST_COLUMN;
+    if (columnCount !is 0) {
+        int modelLength = OS.gtk_tree_model_get_n_columns (modelHandle);
+        bool [] usedColumns = new bool [modelLength];
+        for (int i=0; i<columnCount; i++) {
+            int columnIndex = columns [i].modelIndex;
+            for (int j = 0; j < CELL_TYPES; j++) {
+                usedColumns [columnIndex + j] = true;
+            }
+        }
+        while (modelIndex < modelLength) {
+            if (!usedColumns [modelIndex]) break;
+            modelIndex++;
+        }
+        if (modelIndex is modelLength) {
+            auto oldModel = modelHandle;
+            uint[] types = getColumnTypes (columnCount + 4); // grow by 4 rows at a time
+            auto newModel = OS.gtk_tree_store_newv (types.length, types.ptr);
+            if (newModel is null) error (SWT.ERROR_NO_HANDLES);
+            copyModel (oldModel, FIRST_COLUMN, newModel, FIRST_COLUMN, types, null, null, modelLength);
+            OS.gtk_tree_view_set_model (handle, newModel);
+            OS.g_object_unref (oldModel);
+            modelHandle = newModel;
+        }
+    }
+    auto columnHandle = OS.gtk_tree_view_column_new ();
+    if (columnHandle is null) error (SWT.ERROR_NO_HANDLES);
+    if (index is 0 && columnCount > 0) {
+        TreeColumn checkColumn = columns [0];
+        createRenderers (cast(GtkTreeViewColumn *)checkColumn.handle, checkColumn.modelIndex, false, checkColumn.style);
+    }
+    createRenderers (columnHandle, modelIndex, index is 0, column is null ? 0 : column.style);
+    /*
+    * Use GTK_TREE_VIEW_COLUMN_GROW_ONLY on GTK versions < 2.3.2
+    * because fixed_height_mode is not supported.
+    */
+    bool useVirtual = (style & SWT.VIRTUAL) !is 0 && OS.GTK_VERSION >= OS.buildVERSION (2, 3, 2);
+    if (!useVirtual && columnCount is 0) {
+        OS.gtk_tree_view_column_set_sizing (columnHandle, OS.GTK_TREE_VIEW_COLUMN_GROW_ONLY);
+    } else {
+        OS.gtk_tree_view_column_set_sizing (columnHandle, OS.GTK_TREE_VIEW_COLUMN_FIXED);
+        if (columnCount !is 0) OS.gtk_tree_view_column_set_visible (columnHandle, false);
+    }
+    OS.gtk_tree_view_column_set_resizable (columnHandle, true);
+    OS.gtk_tree_view_column_set_clickable (columnHandle, true);
+    OS.gtk_tree_view_column_set_min_width (columnHandle, 0);
+    OS.gtk_tree_view_insert_column (handle, columnHandle, index);
+    if (column !is null) {
+        column.handle = cast(GtkWidget*)columnHandle;
+        column.modelIndex = modelIndex;
+    }
+    /* Disable searching when using VIRTUAL */
+    if ((style & SWT.VIRTUAL) !is 0) {
+        /*
+        * Bug in GTK. Until GTK 2.6.5, calling gtk_tree_view_set_enable_search(FALSE)
+        * would prevent the user from being able to type in text to search the tree.
+        * After 2.6.5, GTK introduced Ctrl+F as being the key binding for interactive
+        * search. This meant that even if FALSE was passed to enable_search, the user
+        * can still bring up the search pop up using the keybinding. GTK also introduced
+        * the notion of passing a -1 to gtk_set_search_column to disable searching
+        * (including the search key binding).  The fix is to use the right calls
+        * for the right version.
+        */
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 6, 5)) {
+            OS.gtk_tree_view_set_search_column (handle, -1);
+        } else {
+            OS.gtk_tree_view_set_enable_search (handle, false);
+        }
+    } else {
+        /* Set the search column whenever the model changes */
+        int firstColumn = columnCount is 0 ? FIRST_COLUMN : columns [0].modelIndex;
+        OS.gtk_tree_view_set_search_column (handle, firstColumn + CELL_TEXT);
+    }
+}
+
+override void createHandle (int index) {
+    state |= HANDLE;
+    fixedHandle = cast(GtkWidget*)OS.g_object_new (display.gtk_fixed_get_type (), null);
+    if (fixedHandle is null) error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_fixed_set_has_window (fixedHandle, true);
+    scrolledHandle = cast(GtkWidget*)OS.gtk_scrolled_window_new (null, null);
+    if (scrolledHandle is null) error (SWT.ERROR_NO_HANDLES);
+    uint[] types = getColumnTypes (1);
+    modelHandle = cast(GtkTreeStore*)OS.gtk_tree_store_newv (types.length, types.ptr);
+    if (modelHandle is null) error (SWT.ERROR_NO_HANDLES);
+    handle = cast(GtkWidget*)OS.gtk_tree_view_new_with_model (modelHandle);
+    if (handle is null) error (SWT.ERROR_NO_HANDLES);
+    if ((style & SWT.CHECK) !is 0) {
+        checkRenderer = cast(GtkCellRenderer*)OS.gtk_cell_renderer_toggle_new ();
+        if (checkRenderer is null) error (SWT.ERROR_NO_HANDLES);
+        OS.g_object_ref (checkRenderer);
+    }
+    createColumn (null, 0);
+    OS.gtk_container_add (fixedHandle, scrolledHandle);
+    OS.gtk_container_add (scrolledHandle, handle);
+
+    int mode = (style & SWT.MULTI) !is 0 ? OS.GTK_SELECTION_MULTIPLE : OS.GTK_SELECTION_BROWSE;
+    auto selectionHandle = OS.gtk_tree_view_get_selection (handle);
+    OS.gtk_tree_selection_set_mode (selectionHandle, mode);
+    OS.gtk_tree_view_set_headers_visible (handle, false);
+    int hsp = (style & SWT.H_SCROLL) !is 0 ? OS.GTK_POLICY_AUTOMATIC : OS.GTK_POLICY_NEVER;
+    int vsp = (style & SWT.V_SCROLL) !is 0 ? OS.GTK_POLICY_AUTOMATIC : OS.GTK_POLICY_NEVER;
+    OS.gtk_scrolled_window_set_policy (scrolledHandle, hsp, vsp);
+    if ((style & SWT.BORDER) !is 0) OS.gtk_scrolled_window_set_shadow_type (scrolledHandle, OS.GTK_SHADOW_ETCHED_IN);
+    /* Disable searching when using VIRTUAL */
+    if ((style & SWT.VIRTUAL) !is 0) {
+        /* The fixed_height_mode property only exists in GTK 2.3.2 and greater */
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 3, 2)) {
+            OS.g_object_set1 (handle, OS.fixed_height_mode.ptr, true);
+        }
+        /*
+        * Bug in GTK. Until GTK 2.6.5, calling gtk_tree_view_set_enable_search(FALSE)
+        * would prevent the user from being able to type in text to search the tree.
+        * After 2.6.5, GTK introduced Ctrl+F as being the key binding for interactive
+        * search. This meant that even if FALSE was passed to enable_search, the user
+        * can still bring up the search pop up using the keybinding. GTK also introduced
+        * the notion of passing a -1 to gtk_set_search_column to disable searching
+        * (including the search key binding).  The fix is to use the right calls
+        * for the right version.
+        */
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 6, 5)) {
+            OS.gtk_tree_view_set_search_column (handle, -1);
+        } else {
+            OS.gtk_tree_view_set_enable_search (handle, false);
+        };
+    }
+}
+
+void createItem (TreeColumn column, int index) {
+    if (!(0 <= index && index <= columnCount)) error (SWT.ERROR_INVALID_RANGE);
+    if (index is 0) {
+        // first column must be left aligned
+        column.style &= ~(SWT.LEFT | SWT.RIGHT | SWT.CENTER);
+        column.style |= SWT.LEFT;
+    }
+    if (columnCount is 0) {
+        column.handle = cast(GtkWidget*)OS.gtk_tree_view_get_column (handle, 0);
+        OS.gtk_tree_view_column_set_sizing (column.handle, OS.GTK_TREE_VIEW_COLUMN_FIXED);
+        OS.gtk_tree_view_column_set_visible (column.handle, false);
+        column.modelIndex = FIRST_COLUMN;
+        createRenderers (cast(GtkTreeViewColumn *)column.handle, column.modelIndex, true, column.style);
+        column.customDraw = firstCustomDraw;
+        firstCustomDraw = false;
+    } else {
+        createColumn (column, index);
+    }
+    auto boxHandle = OS.gtk_hbox_new (false, 3);
+    if (boxHandle is null) error (SWT.ERROR_NO_HANDLES);
+    auto labelHandle = OS.gtk_label_new_with_mnemonic (null);
+    if (labelHandle is null) error (SWT.ERROR_NO_HANDLES);
+    auto imageHandle = OS.gtk_image_new ();
+    if (imageHandle is null) error (SWT.ERROR_NO_HANDLES);
+    OS.gtk_container_add (boxHandle, imageHandle);
+    OS.gtk_container_add (boxHandle, labelHandle);
+    OS.gtk_widget_show (boxHandle);
+    OS.gtk_widget_show (labelHandle);
+    column.labelHandle = labelHandle;
+    column.imageHandle = imageHandle;
+    OS.gtk_tree_view_column_set_widget (column.handle, boxHandle);
+    auto widget = OS.gtk_widget_get_parent (boxHandle);
+    while (widget !is handle) {
+        if (OS.GTK_IS_BUTTON (widget)) {
+            column.buttonHandle = widget;
+            break;
+        }
+        widget = OS.gtk_widget_get_parent (widget);
+    }
+    if (columnCount is columns.length) {
+        TreeColumn [] newColumns = new TreeColumn [columns.length + 4];
+        System.arraycopy (columns, 0, newColumns, 0, columns.length);
+        columns = newColumns;
+    }
+    System.arraycopy (columns, index, columns, index + 1, columnCount++ - index);
+    columns [index] = column;
+    if ((state & FONT) !is 0) {
+        column.setFontDescription (getFontDescription ());
+    }
+    if (columnCount >= 1) {
+        for (int i=0; i<items.length; i++) {
+            TreeItem item = items [i];
+            if (item !is null) {
+                Font [] cellFont = item.cellFont;
+                if (cellFont !is null) {
+                    Font [] temp = new Font [columnCount];
+                    System.arraycopy (cellFont, 0, temp, 0, index);
+                    System.arraycopy (cellFont, index, temp, index+1, columnCount-index-1);
+                    item.cellFont = temp;
+                }
+            }
+        }
+    }
+}
+
+void createItem (TreeItem item, GtkTreeIter* parentIter, int index) {
+    int count = OS.gtk_tree_model_iter_n_children (modelHandle, parentIter);
+    if (index is -1) index = count;
+    if (!(0 <= index && index <= count)) error (SWT.ERROR_INVALID_RANGE);
+    item.handle = cast(GtkWidget*)OS.g_malloc (GtkTreeIter.sizeof);
+    if (item.handle is null) error(SWT.ERROR_NO_HANDLES);
+    /*
+    * Feature in GTK.  It is much faster to append to a tree store
+    * than to insert at the end using gtk_tree_store_insert().
+    */
+    if (index is count) {
+        OS.gtk_tree_store_append (modelHandle, item.handle, parentIter);
+    } else {
+        OS.gtk_tree_store_insert (modelHandle, item.handle, parentIter, index);
+    }
+    int id = getId (cast(GtkTreeIter*) item.handle, false);
+    items [id] = item;
+    modelChanged = true;
+}
+
+void createRenderers (GtkTreeViewColumn* columnHandle, int modelIndex, bool check, int columnStyle) {
+    OS.gtk_tree_view_column_clear (columnHandle);
+    if ((style & SWT.CHECK) !is 0 && check) {
+        OS.gtk_tree_view_column_pack_start (columnHandle, checkRenderer, false);
+        OS.gtk_tree_view_column_add_attribute (columnHandle, checkRenderer, OS.active.ptr, CHECKED_COLUMN);
+        /*
+        * Feature in GTK. The inconsistent property only exists in GTK 2.2.x.
+        */
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 2, 0)) {
+            OS.gtk_tree_view_column_add_attribute (columnHandle, checkRenderer, OS.inconsistent.ptr, GRAYED_COLUMN);
+        }
+        /*
+        * Bug in GTK. GTK renders the background on top of the checkbox.
+        * This only happens in version 2.2.1 and earlier. The fix is not to set the background.
+        */
+        if (OS.GTK_VERSION > OS.buildVERSION (2, 2, 1)) {
+            if (!ownerDraw) OS.gtk_tree_view_column_add_attribute (columnHandle, checkRenderer, OS.cell_background_gdk.ptr, BACKGROUND_COLUMN);
+        }
+        if (ownerDraw) {
+            display.doCellDataProc( handle, cast(GtkTreeViewColumn*)columnHandle, cast(GtkCellRenderer*)checkRenderer );
+            OS.g_object_set_qdata (cast(GObject*)checkRenderer, Display.SWT_OBJECT_INDEX1, columnHandle);
+        }
+    }
+    auto pixbufRenderer = ownerDraw ? cast(GtkCellRenderer*)OS.g_object_new (display.gtk_cell_renderer_pixbuf_get_type (), null) : OS.gtk_cell_renderer_pixbuf_new ();
+    if (pixbufRenderer is null) error (SWT.ERROR_NO_HANDLES);
+    auto textRenderer = ownerDraw ? cast(GtkCellRenderer*)OS.g_object_new (display.gtk_cell_renderer_text_get_type (), null) : OS.gtk_cell_renderer_text_new ();
+    if (textRenderer is null) error (SWT.ERROR_NO_HANDLES);
+
+    if (ownerDraw) {
+        OS.g_object_set_qdata (cast(GObject*)pixbufRenderer, Display.SWT_OBJECT_INDEX1, columnHandle);
+        OS.g_object_set_qdata (cast(GObject*)textRenderer, Display.SWT_OBJECT_INDEX1, columnHandle);
+    }
+
+    /*
+    * Feature in GTK.  When a tree view column contains only one activatable
+    * cell renderer such as a toggle renderer, mouse clicks anywhere in a cell
+    * activate that renderer. The workaround is to set a second  cell renderer
+    * to be activatable.
+    */
+    if ((style & SWT.CHECK) !is 0 && check) {
+        OS.g_object_set1 (pixbufRenderer, OS.mode.ptr, OS.GTK_CELL_RENDERER_MODE_ACTIVATABLE);
+    }
+
+    /* Set alignment */
+    if ((columnStyle & SWT.RIGHT) !is 0) {
+        OS.g_object_set1_float(textRenderer, OS.xalign.ptr, 1.0f);
+        OS.gtk_tree_view_column_pack_end (columnHandle, textRenderer, true);
+        OS.gtk_tree_view_column_pack_end (columnHandle, pixbufRenderer, false);
+        OS.gtk_tree_view_column_set_alignment (columnHandle, 1f);
+    } else if ((columnStyle & SWT.CENTER) !is 0) {
+        OS.g_object_set1_float(textRenderer, OS.xalign.ptr, 0.5f);
+        OS.gtk_tree_view_column_pack_start (columnHandle, pixbufRenderer, false);
+        OS.gtk_tree_view_column_pack_end (columnHandle, textRenderer, true);
+        OS.gtk_tree_view_column_set_alignment (columnHandle, 0.5f);
+    } else {
+        OS.gtk_tree_view_column_pack_start (columnHandle, pixbufRenderer, false);
+        OS.gtk_tree_view_column_pack_start (columnHandle, textRenderer, true);
+        OS.gtk_tree_view_column_set_alignment (columnHandle, 0f);
+    }
+
+    /* Add attributes */
+    OS.gtk_tree_view_column_add_attribute (columnHandle, pixbufRenderer, OS.pixbuf.ptr, modelIndex + CELL_PIXBUF);
+    /*
+     * Bug on GTK. Gtk renders the background on top of the pixbuf.
+     * This only happens in version 2.2.1 and earlier. The fix is not to set the background.
+     */
+    if (OS.GTK_VERSION > OS.buildVERSION (2, 2, 1)) {
+        if (!ownerDraw) {
+            OS.gtk_tree_view_column_add_attribute (columnHandle, pixbufRenderer, OS.cell_background_gdk.ptr, BACKGROUND_COLUMN);
+            OS.gtk_tree_view_column_add_attribute (columnHandle, textRenderer, OS.cell_background_gdk.ptr, BACKGROUND_COLUMN);
+        }
+    }
+    OS.gtk_tree_view_column_add_attribute (columnHandle, textRenderer, OS.text.ptr, modelIndex + CELL_TEXT);
+    OS.gtk_tree_view_column_add_attribute (columnHandle, textRenderer, OS.foreground_gdk.ptr, FOREGROUND_COLUMN);
+    OS.gtk_tree_view_column_add_attribute (columnHandle, textRenderer, OS.font_desc.ptr, FONT_COLUMN);
+
+    bool customDraw = firstCustomDraw;
+    if (columnCount !is 0) {
+        for (int i=0; i<columnCount; i++) {
+            if (columns [i].handle is cast(GtkWidget*)columnHandle) {
+                customDraw = columns [i].customDraw;
+                break;
+            }
+        }
+    }
+    if ((style & SWT.VIRTUAL) !is 0 || customDraw || ownerDraw) {
+        display.doCellDataProc( handle, cast(GtkTreeViewColumn*)columnHandle, cast(GtkCellRenderer*)textRenderer );
+        display.doCellDataProc( handle, cast(GtkTreeViewColumn*)columnHandle, cast(GtkCellRenderer*)pixbufRenderer );
+    }
+}
+
+void createWidget (int index) {
+    super.createWidget (index);
+    items = new TreeItem [4];
+    columns = new TreeColumn [4];
+    columnCount = 0;
+}
+
+GdkColor* defaultBackground () {
+    return display.COLOR_LIST_BACKGROUND;
+}
+
+GdkColor* defaultForeground () {
+    return display.COLOR_LIST_FOREGROUND;
+}
+
+override void deregister () {
+    super.deregister ();
+    display.removeWidget (cast(GtkWidget*)OS.gtk_tree_view_get_selection (handle));
+    if (checkRenderer !is null) display.removeWidget (cast(GtkWidget*)checkRenderer);
+}
+
+/**
+ * Deselects an item in the receiver.  If the item was already
+ * deselected, it remains deselected.
+ *
+ * @param item the item to be deselected
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.4
+ */
+public void deselect (TreeItem item) {
+    checkWidget ();
+    if (item is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (item.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+    bool fixColumn = showFirstColumn ();
+    auto selection = OS.gtk_tree_view_get_selection (handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    OS.gtk_tree_selection_unselect_iter (selection, item.handle);
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    if (fixColumn) hideFirstColumn ();
+}
+
+/**
+ * Deselects all selected items in the receiver.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void deselectAll() {
+    checkWidget();
+    bool fixColumn = showFirstColumn ();
+    auto selection = OS.gtk_tree_view_get_selection (handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    OS.gtk_tree_selection_unselect_all (selection);
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    if (fixColumn) hideFirstColumn ();
+}
+
+void destroyItem (TreeColumn column) {
+    int index = 0;
+    while (index < columnCount) {
+        if (columns [index] is column) break;
+        index++;
+    }
+    if (index is columnCount) return;
+    auto columnHandle = column.handle;
+    if (columnCount is 1) {
+        firstCustomDraw = column.customDraw;
+    }
+    System.arraycopy (columns, index + 1, columns, index, --columnCount - index);
+    columns [columnCount] = null;
+    OS.gtk_tree_view_remove_column (handle, columnHandle);
+    if (columnCount is 0) {
+        auto oldModel = modelHandle;
+        uint[] types = getColumnTypes (1);
+        auto newModel = OS.gtk_tree_store_newv (types.length, types.ptr);
+        if (newModel is null) error (SWT.ERROR_NO_HANDLES);
+        copyModel(oldModel, column.modelIndex, newModel, FIRST_COLUMN, types, null, null, FIRST_COLUMN + CELL_TYPES);
+        OS.gtk_tree_view_set_model (handle, newModel);
+        OS.g_object_unref (oldModel);
+        modelHandle = newModel;
+        createColumn (null, 0);
+
+    } else {
+        for (int i=0; i<items.length; i++) {
+            TreeItem item = items [i];
+            if (item !is null) {
+                auto iter = cast(GtkTreeIter*)item.handle;
+                int modelIndex = column.modelIndex;
+                OS.gtk_tree_store_set1 (modelHandle, iter, modelIndex + CELL_PIXBUF, null);
+                OS.gtk_tree_store_set1 (modelHandle, iter, modelIndex + CELL_TEXT, null);
+                OS.gtk_tree_store_set1 (modelHandle, iter, modelIndex + CELL_FOREGROUND, null);
+                OS.gtk_tree_store_set1 (modelHandle, iter, modelIndex + CELL_BACKGROUND, null);
+                OS.gtk_tree_store_set1 (modelHandle, iter, modelIndex + CELL_FONT, null);
+
+                Font [] cellFont = item.cellFont;
+                if (cellFont !is null) {
+                    if (columnCount is 0) {
+                        item.cellFont = null;
+                    } else {
+                        Font [] temp = new Font [columnCount];
+                        System.arraycopy (cellFont, 0, temp, 0, index);
+                        System.arraycopy (cellFont, index + 1, temp, index, columnCount - index);
+                        item.cellFont = temp;
+                    }
+                }
+            }
+        }
+        if (index is 0) {
+            // first column must be left aligned and must show check box
+            TreeColumn firstColumn = columns [0];
+            firstColumn.style &= ~(SWT.LEFT | SWT.RIGHT | SWT.CENTER);
+            firstColumn.style |= SWT.LEFT;
+            createRenderers (cast(GtkTreeViewColumn*)firstColumn.handle, firstColumn.modelIndex, true, firstColumn.style);
+        }
+    }
+    /* Disable searching when using VIRTUAL */
+    if ((style & SWT.VIRTUAL) !is 0) {
+        /*
+        * Bug in GTK. Until GTK 2.6.5, calling gtk_tree_view_set_enable_search(FALSE)
+        * would prevent the user from being able to type in text to search the tree.
+        * After 2.6.5, GTK introduced Ctrl+F as being the key binding for interactive
+        * search. This meant that even if FALSE was passed to enable_search, the user
+        * can still bring up the search pop up using the keybinding. GTK also introduced
+        * the notion of passing a -1 to gtk_set_search_column to disable searching
+        * (including the search key binding).  The fix is to use the right calls
+        * for the right version.
+        */
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 6, 5)) {
+            OS.gtk_tree_view_set_search_column (handle, -1);
+        } else {
+            OS.gtk_tree_view_set_enable_search (handle, false);
+        }
+    } else {
+        /* Set the search column whenever the model changes */
+        int firstColumn = columnCount is 0 ? FIRST_COLUMN : columns [0].modelIndex;
+        OS.gtk_tree_view_set_search_column (handle, firstColumn + CELL_TEXT);
+    }
+}
+
+
+void destroyItem (TreeItem item) {
+    /*
+    * Bug in GTK.  GTK segment faults when a root tree item
+    * is destroyed when the tree is expanded and the last leaf of
+    * the root is selected.  This only happens in versions earlier
+    * than 2.0.6.  The fix is to collapse the tree item being destroyed
+    * when it is a root, before it is destroyed.
+    */
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 0, 6)) {
+        int length = OS.gtk_tree_model_iter_n_children (modelHandle, null);
+        if (length > 0) {
+            GtkTreeIter iter;
+            bool valid = cast(bool)OS.gtk_tree_model_iter_children (modelHandle, &iter, null);
+            while (valid) {
+                //PORTING_TODO: is this condition reasonable?
+                if (item.handle is cast(GtkWidget*)&iter) {
+                    item.setExpanded (false);
+                    break;
+                }
+                valid = cast(bool)OS.gtk_tree_model_iter_next (modelHandle, &iter);
+            }
+        }
+    }
+    auto selection = OS.gtk_tree_view_get_selection (handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    OS.gtk_tree_store_remove (modelHandle, item.handle);
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    modelChanged = true;
+}
+
+override bool dragDetect (int x, int y, bool filter, bool * consume) {
+    bool selected = false;
+    if (filter) {
+        void* path;
+        if (OS.gtk_tree_view_get_path_at_pos (handle, x, y, &path, null, null, null)) {
+            if (path  !is null) {
+                auto selection = OS.gtk_tree_view_get_selection (handle);
+                if (OS.gtk_tree_selection_path_is_selected (selection, path )) selected = true;
+                OS.gtk_tree_path_free (path );
+            }
+        } else {
+            return false;
+        }
+    }
+    bool dragDetect = super.dragDetect (x, y, filter, consume);
+    if (dragDetect && selected && consume !is null) consume [0] = true;
+    return dragDetect;
+}
+
+override GdkDrawable* eventWindow () {
+    return paintWindow ();
+}
+
+override void fixChildren (Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu [] menus) {
+    super.fixChildren (newShell, oldShell, newDecorations, oldDecorations, menus);
+    for (int i=0; i<columnCount; i++) {
+        TreeColumn column = columns [i];
+        if (column.toolTipText !is null) {
+            column.setToolTipText(oldShell, null);
+            column.setToolTipText(newShell, column.toolTipText);
+        }
+    }
+}
+
+override GdkColor* getBackgroundColor () {
+    return getBaseColor ();
+}
+
+public override Rectangle getClientArea () {
+    checkWidget ();
+    forceResize ();
+    OS.gtk_widget_realize (handle);
+    auto fixedWindow = OS.GTK_WIDGET_WINDOW (fixedHandle);
+    auto binWindow = OS.gtk_tree_view_get_bin_window (handle);
+    int binX, binY;
+    OS.gdk_window_get_origin (binWindow, &binX, &binY);
+    int fixedX, fixedY;
+    OS.gdk_window_get_origin (fixedWindow, &fixedX, &fixedY);
+    auto clientHandle = clientHandle ();
+    int width = (state & ZERO_WIDTH) !is 0 ? 0 : OS.GTK_WIDGET_WIDTH (clientHandle);
+    int height = (state & ZERO_HEIGHT) !is 0 ? 0 : OS.GTK_WIDGET_HEIGHT (clientHandle);
+    return new Rectangle (fixedX  - binX , fixedY  - binY , width, height);
+}
+
+int getClientWidth () {
+    int w, h;
+    OS.gtk_widget_realize (handle);
+    OS.gdk_drawable_get_size(OS.gtk_tree_view_get_bin_window(handle), &w, &h);
+    return w;
+}
+
+/**
+ * Returns the column at the given, zero-relative index in the
+ * receiver. Throws an exception if the index is out of range.
+ * Columns are returned in the order that they were created.
+ * If no <code>TreeColumn</code>s were created by the programmer,
+ * this method will throw <code>ERROR_INVALID_RANGE</code> despite
+ * the fact that a single column of data may be visible in the tree.
+ * This occurs when the programmer uses the tree like a list, adding
+ * items but never creating a column.
+ *
+ * @param index the index of the column to return
+ * @return the column at the given index
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Tree#getColumnOrder()
+ * @see Tree#setColumnOrder(int[])
+ * @see TreeColumn#getMoveable()
+ * @see TreeColumn#setMoveable(bool)
+ * @see SWT#Move
+ *
+ * @since 3.1
+ */
+public TreeColumn getColumn (int index) {
+    checkWidget();
+    if (!(0 <= index && index < columnCount)) error (SWT.ERROR_INVALID_RANGE);
+    return columns [index];
+}
+
+/**
+ * Returns the number of columns contained in the receiver.
+ * If no <code>TreeColumn</code>s were created by the programmer,
+ * this value is zero, despite the fact that visually, one column
+ * of items may be visible. This occurs when the programmer uses
+ * the tree like a list, adding items but never creating a column.
+ *
+ * @return the number of columns
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public int getColumnCount () {
+    checkWidget();
+    return columnCount;
+}
+
+/**
+ * Returns an array of zero-relative integers that map
+ * the creation order of the receiver's items to the
+ * order in which they are currently being displayed.
+ * <p>
+ * Specifically, the indices of the returned array represent
+ * the current visual order of the items, and the contents
+ * of the array represent the creation order of the items.
+ * </p><p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the current visual order of the receiver's items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Tree#setColumnOrder(int[])
+ * @see TreeColumn#getMoveable()
+ * @see TreeColumn#setMoveable(bool)
+ * @see SWT#Move
+ *
+ * @since 3.2
+ */
+public int [] getColumnOrder () {
+    checkWidget ();
+    if (columnCount is 0) return null;
+    auto list = OS.gtk_tree_view_get_columns (handle);
+    if (list is null) return null;
+    int  i = 0, count = OS.g_list_length (list);
+    int [] order = new int [count];
+    auto temp = list;
+    while (temp !is null) {
+        auto column = OS.g_list_data (temp);
+        if (column !is null) {
+            for (int j=0; j<columnCount; j++) {
+                if (columns [j].handle is column) {
+                    order [i++] = j;
+                    break;
+                }
+            }
+        }
+        temp = OS.g_list_next (temp);
+    }
+    OS.g_list_free (list);
+    return order;
+}
+
+uint[] getColumnTypes (int columnCount) {
+    uint[] types = new uint [FIRST_COLUMN + (columnCount * CELL_TYPES)];
+    // per row data
+    types [ID_COLUMN] = OS.G_TYPE_INT ();
+    types [CHECKED_COLUMN] = OS.G_TYPE_BOOLEAN ();
+    types [GRAYED_COLUMN] = OS.G_TYPE_BOOLEAN ();
+    types [FOREGROUND_COLUMN] = OS.GDK_TYPE_COLOR ();
+    types [BACKGROUND_COLUMN] = OS.GDK_TYPE_COLOR ();
+    types [FONT_COLUMN] = OS.PANGO_TYPE_FONT_DESCRIPTION ();
+    // per cell data
+    for (int i=FIRST_COLUMN; i<types.length; i+=CELL_TYPES) {
+        types [i + CELL_PIXBUF] = OS.GDK_TYPE_PIXBUF ();
+        types [i + CELL_TEXT] = OS.G_TYPE_STRING ();
+        types [i + CELL_FOREGROUND] = OS.GDK_TYPE_COLOR ();
+        types [i + CELL_BACKGROUND] = OS.GDK_TYPE_COLOR ();
+        types [i + CELL_FONT] = OS.PANGO_TYPE_FONT_DESCRIPTION ();
+    }
+    return types;
+}
+
+/**
+ * Returns an array of <code>TreeColumn</code>s which are the
+ * columns in the receiver. Columns are returned in the order
+ * that they were created.  If no <code>TreeColumn</code>s were
+ * created by the programmer, the array is empty, despite the fact
+ * that visually, one column of items may be visible. This occurs
+ * when the programmer uses the tree like a list, adding items but
+ * never creating a column.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the items in the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Tree#getColumnOrder()
+ * @see Tree#setColumnOrder(int[])
+ * @see TreeColumn#getMoveable()
+ * @see TreeColumn#setMoveable(bool)
+ * @see SWT#Move
+ *
+ * @since 3.1
+ */
+public TreeColumn [] getColumns () {
+    checkWidget();
+    TreeColumn [] result = new TreeColumn [columnCount];
+    System.arraycopy (columns, 0, result, 0, columnCount);
+    return result;
+}
+
+TreeItem getFocusItem () {
+    GtkTreePath* path;
+    OS.gtk_tree_view_get_cursor (handle, &path, null);
+    if (path  is null) return null;
+    TreeItem item = null;
+    GtkTreeIter iter;
+    if (OS.gtk_tree_model_get_iter (modelHandle, &iter, path)) {
+        int index;
+        OS.gtk_tree_model_get1 (modelHandle, &iter, ID_COLUMN, cast(void**)&index);
+        if (index  !is -1) item = items [index ]; //TODO should we be creating this item when index is -1?
+    }
+    OS.gtk_tree_path_free (path );
+    return item;
+}
+
+override GdkColor* getForegroundColor () {
+    return getTextColor ();
+}
+
+/**
+ * Returns the width in pixels of a grid line.
+ *
+ * @return the width of a grid line in pixels
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public int getGridLineWidth () {
+    checkWidget();
+    return 0;
+}
+
+/**
+ * Returns the height of the receiver's header
+ *
+ * @return the height of the header or zero if the header is not visible
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public int getHeaderHeight () {
+    checkWidget ();
+    if (!OS.gtk_tree_view_get_headers_visible (handle)) return 0;
+    if (columnCount > 0) {
+        GtkRequisition requisition;
+        int height = 0;
+        for (int i=0; i<columnCount; i++) {
+            auto buttonHandle = columns [i].buttonHandle;
+            if (buttonHandle !is null) {
+                OS.gtk_widget_size_request (buttonHandle, &requisition);
+                height = Math.max (height, requisition.height);
+            }
+        }
+        return height;
+    }
+    OS.gtk_widget_realize (handle);
+    auto fixedWindow = OS.GTK_WIDGET_WINDOW (fixedHandle);
+    auto binWindow = OS.gtk_tree_view_get_bin_window (handle);
+    int binY ;
+    OS.gdk_window_get_origin (binWindow, null, &binY);
+    int fixedY;
+    OS.gdk_window_get_origin (fixedWindow, null, &fixedY);
+    return binY  - fixedY ;
+}
+
+/**
+ * Returns <code>true</code> if the receiver's header is visible,
+ * and <code>false</code> otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, this method
+ * may still indicate that it is considered visible even though
+ * it may not actually be showing.
+ * </p>
+ *
+ * @return the receiver's header's visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public bool getHeaderVisible () {
+    checkWidget();
+    return cast(bool)OS.gtk_tree_view_get_headers_visible (handle);
+}
+
+/**
+ * Returns the item at the given, zero-relative index in the
+ * receiver. Throws an exception if the index is out of range.
+ *
+ * @param index the index of the item to return
+ * @return the item at the given index
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public TreeItem getItem (int index) {
+    checkWidget();
+    if (!(0 <= index && index < OS.gtk_tree_model_iter_n_children (modelHandle, null)))  {
+        error (SWT.ERROR_INVALID_RANGE);
+    }
+    return _getItem (null, index);
+}
+
+/**
+ * Returns the item at the given point in the receiver
+ * or null if no such item exists. The point is in the
+ * coordinate system of the receiver.
+ * <p>
+ * The item that is returned represents an item that could be selected by the user.
+ * For example, if selection only occurs in items in the first column, then null is
+ * returned if the point is outside of the item.
+ * Note that the SWT.FULL_SELECTION style hint, which specifies the selection policy,
+ * determines the extent of the selection.
+ * </p>
+ *
+ * @param point the point used to locate the item
+ * @return the item at the given point, or null if the point is not in a selectable item
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TreeItem getItem (Point point) {
+    checkWidget ();
+    if (point is null) error (SWT.ERROR_NULL_ARGUMENT);
+    void* path;
+    OS.gtk_widget_realize (handle);
+    GtkTreeViewColumn* columnHandle;
+    if (!OS.gtk_tree_view_get_path_at_pos (handle, point.x, point.y, &path, &columnHandle, null, null)) return null;
+    if (path  is null) return null;
+    TreeItem item = null;
+    GtkTreeIter iter;
+    if (OS.gtk_tree_model_get_iter (modelHandle, &iter, path )) {
+        bool overExpander = false;
+        if (OS.gtk_tree_view_get_expander_column (handle) is columnHandle ) {
+            int buffer;
+            GdkRectangle rect;
+            OS.gtk_tree_view_get_cell_area (handle, path, columnHandle, &rect);
+            if (OS.GTK_VERSION < OS.buildVERSION (2, 8, 18)) {
+                OS.gtk_widget_style_get1 (handle, OS.expander_size.ptr, &buffer);
+                int expanderSize = buffer  + TreeItem.EXPANDER_EXTRA_PADDING;
+                overExpander = point.x < rect.x + expanderSize;
+            } else {
+                overExpander = point.x < rect.x;
+            }
+        }
+        if (!overExpander) {
+            item = _getItem (&iter);
+        }
+    }
+    OS.gtk_tree_path_free (path );
+    return item;
+}
+
+/**
+ * Returns the number of items contained in the receiver
+ * that are direct item children of the receiver.  The
+ * number that is returned is the number of roots in the
+ * tree.
+ *
+ * @return the number of items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemCount () {
+    checkWidget ();
+    return OS.gtk_tree_model_iter_n_children (modelHandle, null);
+}
+
+/**
+ * Returns the height of the area which would be used to
+ * display <em>one</em> of the items in the tree.
+ *
+ * @return the height of one item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemHeight () {
+    checkWidget ();
+    int itemCount = OS.gtk_tree_model_iter_n_children (modelHandle, null);
+    if (itemCount is 0) {
+        auto column = OS.gtk_tree_view_get_column (handle, 0);
+        int w, h;
+        ignoreSize = true;
+        OS.gtk_tree_view_column_cell_get_size (column, null, null, null, &w, &h);
+        ignoreSize = false;
+        return h ;
+    } else {
+        int height = 0;
+        GtkTreeIter iter;
+        OS.gtk_tree_model_get_iter_first (modelHandle, &iter);
+        int columnCount = Math.max (1, this.columnCount);
+        for (int i=0; i<columnCount; i++) {
+            auto column = OS.gtk_tree_view_get_column (handle, i);
+            OS.gtk_tree_view_column_cell_set_cell_data (column, modelHandle, &iter, false, false);
+            int w, h;
+            OS.gtk_tree_view_column_cell_get_size (column, null, null, null, &w, &h);
+            height = Math.max (height, h );
+        }
+        return height;
+    }
+}
+
+/**
+ * Returns a (possibly empty) array of items contained in the
+ * receiver that are direct item children of the receiver.  These
+ * are the roots of the tree.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TreeItem [] getItems () {
+    checkWidget();
+    return getItems (null);
+}
+
+TreeItem [] getItems (GtkTreeIter* parent) {
+    int length = OS.gtk_tree_model_iter_n_children (modelHandle, parent);
+    TreeItem[] result = new TreeItem [length];
+    if (length is 0) return result;
+    if ((style & SWT.VIRTUAL) !is 0) {
+        for (int i=0; i<length; i++) {
+            result [i] = _getItem (parent, i);
+        }
+    } else {
+        int i = 0;
+        int index;
+        GtkTreeIter iter;
+        bool valid = cast(bool)OS.gtk_tree_model_iter_children (modelHandle, &iter, parent);
+        while (valid) {
+            OS.gtk_tree_model_get1 (modelHandle, &iter, ID_COLUMN, cast(void**)&index);
+            result [i++] = items [index ];
+            valid = cast(bool)OS.gtk_tree_model_iter_next (modelHandle, &iter);
+        }
+    }
+    return result;
+}
+
+/**
+ * Returns <code>true</code> if the receiver's lines are visible,
+ * and <code>false</code> otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, this method
+ * may still indicate that it is considered visible even though
+ * it may not actually be showing.
+ * </p>
+ *
+ * @return the visibility state of the lines
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public bool getLinesVisible() {
+    checkWidget();
+    return cast(bool)OS.gtk_tree_view_get_rules_hint (handle);
+}
+
+/**
+ * Returns the receiver's parent item, which must be a
+ * <code>TreeItem</code> or null when the receiver is a
+ * root.
+ *
+ * @return the receiver's parent item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TreeItem getParentItem () {
+    checkWidget ();
+    return null;
+}
+
+GtkCellRendererPixbuf* getPixbufRenderer (GtkTreeViewColumn* column) {
+    auto list = OS.gtk_tree_view_column_get_cell_renderers (column);
+    if (list is null) return null;
+    int count = OS.g_list_length (list);
+    GtkCellRendererPixbuf* pixbufRenderer;
+    int i = 0;
+    while (i < count) {
+        auto renderer = OS.g_list_nth_data (list, i);
+        if (OS.GTK_IS_CELL_RENDERER_PIXBUF (renderer)) {
+            pixbufRenderer = cast(GtkCellRendererPixbuf*)renderer;
+            break;
+        }
+        i++;
+    }
+    OS.g_list_free (list);
+    return pixbufRenderer;
+}
+
+/**
+ * Returns an array of <code>TreeItem</code>s that are currently
+ * selected in the receiver. The order of the items is unspecified.
+ * An empty array indicates that no items are selected.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its selection, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ * @return an array representing the selection
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TreeItem[] getSelection () {
+    checkWidget();
+    auto selection = OS.gtk_tree_view_get_selection (handle);
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 2, 0)) {
+        display.treeSelectionLength  = 0;
+        display.treeSelection = new int [items.length];
+        display.doTreeSelectionProcConnect( &treeSelectionCallbackData, handle, selection );
+        TreeItem [] result = new TreeItem [display.treeSelectionLength];
+        for (int i=0; i<result.length; i++) result [i] = items [display.treeSelection [i]];
+        return result;
+    }
+    /*
+    * Bug in GTK.  gtk_tree_selection_get_selected_rows() segmentation faults
+    * in versions smaller than 2.2.4 if the model is NULL.  The fix is
+    * to give a valid pointer instead.
+    */
+    int dummy;
+    void* model = OS.GTK_VERSION < OS.buildVERSION (2, 2, 4) ? &dummy : null;
+    auto list = OS.gtk_tree_selection_get_selected_rows (selection, &model);
+    if (list !is null) {
+        int count = OS.g_list_length (list);
+        TreeItem [] treeSelection = new TreeItem [count];
+        int length_ = 0;
+        for (int i=0; i<count; i++) {
+            auto data = OS.g_list_nth_data (list, i);
+            GtkTreeIter iter;
+            if (OS.gtk_tree_model_get_iter (modelHandle, &iter, data)) {
+                treeSelection [length_] = _getItem (&iter);
+                length_++;
+            }
+        }
+        OS.g_list_free (list);
+        if (length_ < count) {
+            TreeItem [] temp = new TreeItem [length_];
+            System.arraycopy(treeSelection, 0, temp, 0, length_);
+            treeSelection = temp;
+        }
+        return treeSelection;
+    }
+    return null;
+}
+
+/**
+ * Returns the number of selected items contained in the receiver.
+ *
+ * @return the number of selected items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSelectionCount () {
+    checkWidget();
+    auto selection = OS.gtk_tree_view_get_selection (handle);
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 2, 0)) {
+        display.treeSelectionLength = 0;
+        display.treeSelection = null;
+        display.doTreeSelectionProcConnect( &treeSelectionCallbackData, handle, selection );
+        return display.treeSelectionLength;
+    }
+    return OS.gtk_tree_selection_count_selected_rows (selection);
+}
+
+/**
+ * Returns the column which shows the sort indicator for
+ * the receiver. The value may be null if no column shows
+ * the sort indicator.
+ *
+ * @return the sort indicator
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setSortColumn(TreeColumn)
+ *
+ * @since 3.2
+ */
+public TreeColumn getSortColumn () {
+    checkWidget ();
+    return sortColumn;
+}
+
+/**
+ * Returns the direction of the sort indicator for the receiver.
+ * The value will be one of <code>UP</code>, <code>DOWN</code>
+ * or <code>NONE</code>.
+ *
+ * @return the sort direction
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setSortDirection(int)
+ *
+ * @since 3.2
+ */
+public int getSortDirection () {
+    checkWidget ();
+    return sortDirection;
+}
+
+GtkCellRendererText* getTextRenderer (GtkTreeViewColumn* column) {
+    auto list = OS.gtk_tree_view_column_get_cell_renderers (column);
+    if (list is null) return null;
+    int count = OS.g_list_length (list);
+    GtkCellRendererText* textRenderer;
+    int i = 0;
+    while (i < count) {
+        auto renderer = OS.g_list_nth_data (list, i);
+         if (OS.GTK_IS_CELL_RENDERER_TEXT (renderer)) {
+            textRenderer = cast(GtkCellRendererText*)renderer;
+            break;
+        }
+        i++;
+    }
+    OS.g_list_free (list);
+    return textRenderer;
+}
+
+/**
+ * Returns the item which is currently at the top of the receiver.
+ * This item can change when items are expanded, collapsed, scrolled
+ * or new items are added or removed.
+ *
+ * @return the item at the top of the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.1
+ */
+public TreeItem getTopItem () {
+    checkWidget ();
+    void* path;
+    OS.gtk_widget_realize (handle);
+    if (!OS.gtk_tree_view_get_path_at_pos (handle, 1, 1, &path, null, null, null)) return null;
+    if (path  is null) return null;
+    TreeItem item = null;
+    GtkTreeIter iter;
+    if (OS.gtk_tree_model_get_iter (modelHandle, &iter, path )) {
+        item = _getItem (&iter);
+    }
+    OS.gtk_tree_path_free (path );
+    return item;
+}
+
+override int gtk_button_press_event (GtkWidget* widget, GdkEventButton* gdkEvent) {
+    if (gdkEvent.window !is OS.gtk_tree_view_get_bin_window (handle)) return 0;
+    auto result = super.gtk_button_press_event (widget, gdkEvent);
+    if (result !is 0) return result;
+    /*
+    * Feature in GTK.  In a multi-select tree view, when multiple items are already
+    * selected, the selection state of the item is toggled and the previous selection
+    * is cleared. This is not the desired behaviour when bringing up a popup menu.
+    * Also, when an item is reselected with the right button, the tree view issues
+    * an unwanted selection event. The workaround is to detect that case and not
+    * run the default handler when the item is already part of the current selection.
+    */
+    int button = gdkEvent.button;
+    if (button is 3 && gdkEvent.type is OS.GDK_BUTTON_PRESS) {
+        void* path;
+        if (OS.gtk_tree_view_get_path_at_pos (handle, cast(int)gdkEvent.x, cast(int)gdkEvent.y, &path, null, null, null)) {
+            if (path !is null) {
+                auto selection = OS.gtk_tree_view_get_selection (handle);
+                if (OS.gtk_tree_selection_path_is_selected (selection, path )) result = 1;
+                OS.gtk_tree_path_free (path );
+            }
+        }
+    }
+
+    /*
+    * Feature in GTK.  When the user clicks in a single selection GtkTreeView
+    * and there are no selected items, the first item is selected automatically
+    * before the click is processed, causing two selection events.  The is fix
+    * is the set the cursor item to be same as the clicked item to stop the
+    * widget from automatically selecting the first item.
+    */
+    if ((style & SWT.SINGLE) !is 0 && getSelectionCount () is 0) {
+        void* path;
+        if (OS.gtk_tree_view_get_path_at_pos (handle, cast(int)gdkEvent.x, cast(int)gdkEvent.y, &path, null, null, null)) {
+            if (path  !is null) {
+                auto selection = OS.gtk_tree_view_get_selection (handle);
+                OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+                OS.gtk_tree_view_set_cursor (handle, path , null, false);
+                OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+                OS.gtk_tree_path_free (path );
+            }
+        }
+    }
+    /*
+    * Bug in GTK. GTK segments fault, if the GtkTreeView widget is
+    * not in focus and all items in the widget are disposed before
+    * it finishes processing a button press.  The fix is to give
+    * focus to the widget before it starts processing the event.
+    */
+    if (!OS.GTK_WIDGET_HAS_FOCUS (handle)) {
+        OS.gtk_widget_grab_focus (handle);
+    }
+    return result;
+}
+
+override int gtk_button_release_event (GtkWidget* widget, GdkEventButton* event) {
+    auto window = OS.GDK_EVENT_WINDOW (event);
+    if (window !is OS.gtk_tree_view_get_bin_window (handle)) return 0;
+    return super.gtk_button_release_event (widget, event);
+}
+
+override int gtk_changed (GtkWidget* widget) {
+    TreeItem item = getFocusItem ();
+    if (item !is null) {
+        Event event = new Event ();
+        event.item = item;
+        postEvent (SWT.Selection, event);
+    }
+    return 0;
+}
+
+override int gtk_expand_collapse_cursor_row (GtkWidget* widget, int /*long*/ logical, int /*long*/ expand, int /*long*/ open_all) {
+    // FIXME - this flag is never cleared.  It should be cleared when the expand all operation completes.
+    if (expand !is 0 && open_all !is 0) expandAll = true;
+    return 0;
+}
+
+override int gtk_key_press_event (GtkWidget* widget, GdkEventKey* keyEvent) {
+    auto result = super.gtk_key_press_event (widget, keyEvent);
+    if (result !is 0) return result;
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 2 ,0)) {
+        /*
+        * Feature in GTK 2.0.x.  When an item is default selected using
+        * the return key, GTK does not issue notification. The fix is
+        * to issue this notification when the return key is pressed.
+        */
+        int key = keyEvent.keyval;
+        switch (key) {
+            case OS.GDK_Return:
+            case OS.GDK_KP_Enter: {
+                Event event = new Event ();
+                event.item = getFocusItem ();
+                postEvent (SWT.DefaultSelection, event);
+                break;
+            }
+            default:
+        }
+    }
+    return result;
+}
+
+override int gtk_motion_notify_event (GtkWidget* widget, GdkEventMotion* event) {
+    auto window = OS.GDK_EVENT_WINDOW (event);
+    if (window !is OS.gtk_tree_view_get_bin_window (handle)) return 0;
+    return super.gtk_motion_notify_event (widget, event);
+}
+
+override int gtk_popup_menu (GtkWidget* widget) {
+    auto result = super.gtk_popup_menu (widget);
+    /*
+    * Bug in GTK.  The context menu for the typeahead in GtkTreeViewer
+    * opens in the bottom right corner of the screen when Shift+F10
+    * is pressed and the typeahead window was not visible.  The fix is
+    * to prevent the context menu from opening by stopping the default
+    * handler.
+    *
+    * NOTE: The bug only happens in GTK 2.6.5 and lower.
+    */
+    return OS.GTK_VERSION < OS.buildVERSION (2, 6, 5) ? 1 : result;
+}
+
+override void gtk_row_activated (GtkTreeView* tree, GtkTreePath* path, GtkTreeViewColumn* column) {
+    if (path is null) return 0;
+    TreeItem item = null;
+    GtkTreeIter iter;
+    if (OS.gtk_tree_model_get_iter (modelHandle, &iter, path)) {
+        int index;
+        OS.gtk_tree_model_get1 (modelHandle, &iter, ID_COLUMN, cast(void**)&index);
+        item = items [index ];
+    }
+    Event event = new Event ();
+    event.item = item;
+    postEvent (SWT.DefaultSelection, event);
+    return 0;
+}
+
+override int gtk_test_collapse_row (
+    GtkTreeView *tree,
+    GtkTreeIter *iter,
+    GtkTreePath *path)
+{
+    int index ;
+    OS.gtk_tree_model_get1 (modelHandle, iter, ID_COLUMN, cast(void**)&index);
+    TreeItem item = items [index ];
+    Event event = new Event ();
+    event.item = item;
+    bool oldModelChanged = modelChanged;
+    modelChanged = false;
+    sendEvent (SWT.Collapse, event);
+    /*
+    * Bug in GTK.  Collapsing the target row during the test_collapse_row
+    * handler will cause a segmentation fault if the animation code is allowed
+    * to run.  The fix is to block the animation if the row is already
+    * collapsed.
+    */
+    bool changed = modelChanged || !OS.gtk_tree_view_row_expanded (handle, path);
+    modelChanged = oldModelChanged;
+    if (isDisposed () || item.isDisposed ()) return 1;
+    /*
+    * Bug in GTK.  Expanding or collapsing a row which has no more
+    * children causes the model state to become invalid, causing
+    * GTK to give warnings and behave strangely.  Other changes to
+    * the model can cause expansion to fail when using the multiple
+    * expansion keys (such as *).  The fix is to stop the expansion
+    * if there are model changes.
+    *
+    * Note: This callback must return 0 for the collapsing
+    * animation to occur.
+    */
+    if (changed) {
+        OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udTEST_COLLAPSE_ROW);
+        OS.gtk_tree_view_collapse_row (handle, path);
+        OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udTEST_COLLAPSE_ROW);
+        return 1;
+    }
+    return 0;
+}
+
+override int gtk_test_expand_row (
+    GtkTreeView *tree,
+    GtkTreeIter *iter,
+    GtkTreePath *path)
+{
+    int index ;
+    OS.gtk_tree_model_get1 (modelHandle, iter, ID_COLUMN, cast(void**)&index);
+    TreeItem item = items [index ];
+    Event event = new Event ();
+    event.item = item;
+    bool oldModelChanged = modelChanged;
+    modelChanged = false;
+    sendEvent (SWT.Expand, event);
+    /*
+    * Bug in GTK.  Expanding the target row during the test_expand_row
+    * handler will cause a segmentation fault if the animation code is allowed
+    * to run.  The fix is to block the animation if the row is already
+    * expanded.
+    */
+    bool changed = modelChanged || OS.gtk_tree_view_row_expanded (handle, path);
+    modelChanged = oldModelChanged;
+    if (isDisposed () || item.isDisposed ()) return 1;
+    /*
+    * Bug in GTK.  Expanding or collapsing a row which has no more
+    * children causes the model state to become invalid, causing
+    * GTK to give warnings and behave strangely.  Other changes to
+    * the model can cause expansion to fail when using the multiple
+    * expansion keys (such as *).  The fix is to stop the expansion
+    * if there are model changes.
+    *
+    * Bug in GTK.  test-expand-row does not get called for each row
+    * in an expand all operation.  The fix is to block the initial
+    * expansion and only expand a single level.
+    *
+    * Note: This callback must return 0 for the collapsing
+    * animation to occur.
+    */
+    if (changed || expandAll) {
+        OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udTEST_EXPAND_ROW);
+        OS.gtk_tree_view_expand_row (handle, path, false);
+        OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udTEST_EXPAND_ROW);
+        return 1;
+    }
+    return 0;
+}
+
+override int gtk_toggled (int /*long*/ renderer, char* pathStr) {
+    auto path = OS.gtk_tree_path_new_from_string (pathStr);
+    if (path is null) return 0;
+    TreeItem item = null;
+    GtkTreeIter iter;
+    if (OS.gtk_tree_model_get_iter (modelHandle, &iter, path)) {
+        item = _getItem (&iter);
+    }
+    OS.gtk_tree_path_free (path);
+    if (item !is null) {
+        item.setChecked (!item.getChecked ());
+        Event event = new Event ();
+        event.detail = SWT.CHECK;
+        event.item = item;
+        postEvent (SWT.Selection, event);
+    }
+    return 0;
+}
+
+override void gtk_widget_size_request (GtkWidget* widget, GtkRequisition* requisition) {
+    /*
+     * Bug in GTK.  For some reason, gtk_widget_size_request() fails
+     * to include the height of the tree view items when there are
+     * no columns visible.  The fix is to temporarily make one column
+     * visible.
+     */
+    if (columnCount is 0) {
+        super.gtk_widget_size_request (widget, requisition);
+        return;
+    }
+    auto columns = OS.gtk_tree_view_get_columns (handle), list = columns;
+    bool fixVisible = columns !is null;
+    while (list !is null) {
+        auto column = OS.g_list_data (list);
+        if (OS.gtk_tree_view_column_get_visible (column)) {
+            fixVisible = false;
+            break;
+        }
+        list = OS.g_list_next (list);
+    }
+    GtkTreeViewColumn* columnHandle;
+    if (fixVisible) {
+        columnHandle = cast(GtkTreeViewColumn*)OS.g_list_data (columns);
+        OS.gtk_tree_view_column_set_visible (columnHandle, true);
+    }
+    super.gtk_widget_size_request (widget, requisition);
+    if (fixVisible) {
+        OS.gtk_tree_view_column_set_visible (columnHandle, false);
+    }
+    if (columns !is null) OS.g_list_free (columns);
+}
+
+void hideFirstColumn () {
+    auto firstColumn = OS.gtk_tree_view_get_column (handle, 0);
+    OS.gtk_tree_view_column_set_visible (firstColumn, false);
+}
+
+override void hookEvents () {
+    super.hookEvents ();
+    auto selection = OS.gtk_tree_view_get_selection(handle);
+    OS.g_signal_connect_closure (selection, OS.changed.ptr, display.closures [CHANGED], false);
+    OS.g_signal_connect_closure (handle, OS.row_activated.ptr, display.closures [ROW_ACTIVATED], false);
+    OS.g_signal_connect_closure (handle, OS.test_expand_row.ptr, display.closures [TEST_EXPAND_ROW], false);
+    OS.g_signal_connect_closure (handle, OS.test_collapse_row.ptr, display.closures [TEST_COLLAPSE_ROW], false);
+    OS.g_signal_connect_closure (handle, OS.expand_collapse_cursor_row.ptr, display.closures [EXPAND_COLLAPSE_CURSOR_ROW], false);
+    if (checkRenderer !is null) {
+        OS.g_signal_connect_closure (checkRenderer, OS.toggled.ptr, display.closures [TOGGLED], false);
+    }
+}
+
+/**
+ * Searches the receiver's list starting at the first column
+ * (index 0) until a column is found that is equal to the
+ * argument, and returns the index of that column. If no column
+ * is found, returns -1.
+ *
+ * @param column the search column
+ * @return the index of the column
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the column is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public int indexOf (TreeColumn column) {
+    checkWidget();
+    if (column is null) error (SWT.ERROR_NULL_ARGUMENT);
+    for (int i=0; i<columnCount; i++) {
+        if (columns [i] is column) return i;
+    }
+    return -1;
+}
+
+/**
+ * Searches the receiver's list starting at the first item
+ * (index 0) until an item is found that is equal to the
+ * argument, and returns the index of that item. If no item
+ * is found, returns -1.
+ *
+ * @param item the search item
+ * @return the index of the item
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public int indexOf (TreeItem item) {
+    checkWidget();
+    if (item is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (item.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
+    int index = -1;
+    auto path = OS.gtk_tree_model_get_path (modelHandle, item.handle);
+    int depth = OS.gtk_tree_path_get_depth (path);
+    if (depth is 1) {
+        auto indices = OS.gtk_tree_path_get_indices (path);
+        if (indices !is null) {
+            index = indices[0];
+        }
+    }
+    OS.gtk_tree_path_free (path);
+    return index;
+}
+
+override bool mnemonicHit (wchar key) {
+    for (int i=0; i<columnCount; i++) {
+        auto labelHandle = columns [i].labelHandle;
+        if (labelHandle !is null && mnemonicHit (labelHandle, key)) return true;
+    }
+    return false;
+}
+
+override bool mnemonicMatch (wchar key) {
+    for (int i=0; i<columnCount; i++) {
+        auto labelHandle = columns [i].labelHandle;
+        if (labelHandle !is null && mnemonicMatch (labelHandle, key)) return true;
+    }
+    return false;
+}
+
+override GdkDrawable* paintWindow () {
+    OS.gtk_widget_realize (handle);
+    return OS.gtk_tree_view_get_bin_window (handle);
+}
+
+void recreateRenderers () {
+    if (checkRenderer !is null) {
+        display.removeWidget (cast(GtkWidget*)checkRenderer);
+        OS.g_object_unref (checkRenderer);
+        checkRenderer = ownerDraw ? cast(GtkCellRenderer*)OS.g_object_new (display.gtk_cell_renderer_toggle_get_type(), null) : OS.gtk_cell_renderer_toggle_new ();
+        if (checkRenderer is null) error (SWT.ERROR_NO_HANDLES);
+        OS.g_object_ref (checkRenderer);
+        display.addWidget (cast(GtkWidget*)checkRenderer, this);
+        OS.g_signal_connect_closure (checkRenderer, OS.toggled.ptr, display.closures [TOGGLED], false);
+    }
+    if (columnCount is 0) {
+        createRenderers (OS.gtk_tree_view_get_column (handle, 0), Tree.FIRST_COLUMN, true, 0);
+    } else {
+        for (int i = 0; i < columnCount; i++) {
+            TreeColumn column = columns [i];
+            createRenderers (cast(GtkTreeViewColumn*)column.handle, column.modelIndex, i is 0, column.style);
+        }
+    }
+}
+
+override void redrawBackgroundImage () {
+    Control control = findBackgroundControl ();
+    if (control !is null && control.backgroundImage !is null) {
+        redrawWidget (0, 0, 0, 0, true, false, false);
+    }
+}
+
+override void register () {
+    super.register ();
+    display.addWidget (cast(GtkWidget*)OS.gtk_tree_view_get_selection (handle), this);
+    if (checkRenderer !is null) display.addWidget (cast(GtkWidget*)checkRenderer, this);
+}
+
+void releaseItem (TreeItem item, bool release) {
+    int index;
+    OS.gtk_tree_model_get1 (modelHandle, item.handle, ID_COLUMN, cast(void**)&index);
+    if (index is -1) return;
+    if (release) item.release (false);
+    items [index ] = null;
+}
+
+void releaseItems (GtkTreeIter* parentIter) {
+    int index;
+    GtkTreeIter iter;
+    bool valid = cast(bool)OS.gtk_tree_model_iter_children (modelHandle, &iter, parentIter);
+    while (valid) {
+        releaseItems (&iter);
+        if (!isDisposed ()) {
+            OS.gtk_tree_model_get1 (modelHandle, &iter, ID_COLUMN, cast(void**)&index);
+            if (index  !is -1) {
+                TreeItem item = items [index ];
+                if (item !is null) releaseItem (item, true);
+            }
+        }
+        valid = cast(bool)OS.gtk_tree_model_iter_next (modelHandle, &iter);
+    }
+}
+
+override void releaseChildren (bool destroy) {
+    if (items !is null) {
+        for (int i=0; i<items.length; i++) {
+            TreeItem item = items [i];
+            if (item !is null && !item.isDisposed ()) {
+                item.release (false);
+            }
+        }
+        items = null;
+    }
+    if (columns !is null) {
+        for (int i=0; i<columnCount; i++) {
+            TreeColumn column = columns [i];
+            if (column !is null && !column.isDisposed ()) {
+                column.release (false);
+            }
+        }
+        columns = null;
+    }
+    super.releaseChildren (destroy);
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    if (modelHandle !is null) OS.g_object_unref (modelHandle);
+    modelHandle = null;
+    if (checkRenderer !is null) OS.g_object_unref (checkRenderer);
+    checkRenderer = null;
+    if (imageList !is null) imageList.dispose ();
+    if (headerImageList !is null) headerImageList.dispose ();
+    imageList = headerImageList = null;
+    currentItem = null;
+}
+
+void remove (GtkTreeIter* parentIter, int start, int end) {
+    if (start > end) return;
+    int itemCount = OS.gtk_tree_model_iter_n_children (modelHandle, parentIter);
+    if (!(0 <= start && start <= end && end < itemCount)) {
+        error (SWT.ERROR_INVALID_RANGE);
+    }
+    auto selection = OS.gtk_tree_view_get_selection (handle);
+    GtkTreeIter iter;
+    int index = start;
+    for (int i = start; i <= end; i++) {
+        OS.gtk_tree_model_iter_nth_child (modelHandle, &iter, parentIter, index);
+        int value;
+        OS.gtk_tree_model_get1 (modelHandle, &iter, ID_COLUMN, cast(void**)&value);
+        TreeItem item = value  !is -1 ? items [value ] : null;
+        if (item !is null && !item.isDisposed ()) {
+            item.dispose ();
+        } else {
+            OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+            OS.gtk_tree_store_remove (modelHandle, &iter);
+            OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+        }
+    }
+}
+
+/**
+ * Removes all of the items from the receiver.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void removeAll () {
+    checkWidget ();
+    for (int i=0; i<items.length; i++) {
+        TreeItem item = items [i];
+        if (item !is null && !item.isDisposed ()) item.release (false);
+    }
+    items = new TreeItem[4];
+    auto selection = OS.gtk_tree_view_get_selection (handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    OS.gtk_tree_store_clear (modelHandle);
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+
+    /* Disable searching when using VIRTUAL */
+    if ((style & SWT.VIRTUAL) !is 0) {
+        /*
+        * Bug in GTK. Until GTK 2.6.5, calling gtk_tree_view_set_enable_search(FALSE)
+        * would prevent the user from being able to type in text to search the tree.
+        * After 2.6.5, GTK introduced Ctrl+F as being the key binding for interactive
+        * search. This meant that even if FALSE was passed to enable_search, the user
+        * can still bring up the search pop up using the keybinding. GTK also introduced
+        * the notion of passing a -1 to gtk_set_search_column to disable searching
+        * (including the search key binding).  The fix is to use the right calls
+        * for the right version.
+        */
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 6, 5)) {
+            OS.gtk_tree_view_set_search_column (handle, -1);
+        } else {
+            OS.gtk_tree_view_set_enable_search (handle, false);
+        }
+    } else {
+        /* Set the search column whenever the model changes */
+        int firstColumn = columnCount is 0 ? FIRST_COLUMN : columns [0].modelIndex;
+        OS.gtk_tree_view_set_search_column (handle, firstColumn + CELL_TEXT);
+    }
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the user changes the receiver's selection.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener (SelectionListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    eventTable.unhook (SWT.Selection, listener);
+    eventTable.unhook (SWT.DefaultSelection, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when items in the receiver are expanded or collapsed.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see TreeListener
+ * @see #addTreeListener
+ */
+public void removeTreeListener(TreeListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Expand, listener);
+    eventTable.unhook (SWT.Collapse, listener);
+}
+
+override void rendererGetSizeProc (
+    GtkCellRenderer      *cell,
+    GtkWidget            *widget,
+    GdkRectangle         *cell_area,
+    int                  *x_offset,
+    int                  *y_offset,
+    int                  *width,
+    int                  *height)
+{
+    auto g_class = OS.g_type_class_peek_parent (OS.G_OBJECT_GET_CLASS (cell));
+    GtkCellRendererClass* klass = cast(GtkCellRendererClass*)g_class;
+    klass.get_size( cell, handle, cell_area, x_offset, y_offset, width, height);
+    if (!ignoreSize && OS.GTK_IS_CELL_RENDERER_TEXT (cell)) {
+        auto iter = cast(GtkTreeIter*)OS.g_object_get_qdata (cast(GObject*)cell, Display.SWT_OBJECT_INDEX2);
+        TreeItem item = null;
+        if (iter !is null) item = _getItem (iter);
+        if (item !is null) {
+            int columnIndex = 0;
+            if (columnCount > 0) {
+                auto columnHandle = cast(GtkTreeViewColumn*)OS.g_object_get_qdata (cast(GObject*)cell, Display.SWT_OBJECT_INDEX1);
+                for (int i = 0; i < columnCount; i++) {
+                    if (columns [i].handle is cast(GtkWidget*)columnHandle) {
+                        columnIndex = i;
+                        break;
+                    }
+                }
+            }
+            if (hooks (SWT.MeasureItem)) {
+                int contentWidth, contentHeight;
+                if (width !is null) contentWidth = *width;
+                if (height !is null) contentHeight = *height;
+                Image image = item.getImage (columnIndex);
+                int imageWidth = 0;
+                if (image !is null) {
+                    Rectangle bounds = image.getBounds ();
+                    imageWidth = bounds.width;
+                }
+                contentWidth += imageWidth;
+                GC gc = new GC (this);
+                gc.setFont (item.getFont (columnIndex));
+                Event event = new Event ();
+                event.item = item;
+                event.index = columnIndex;
+                event.gc = gc;
+                event.width = contentWidth ;
+                event.height = contentHeight ;
+                sendEvent (SWT.MeasureItem, event);
+                gc.dispose ();
+                contentWidth  = event.width - imageWidth;
+                if (contentHeight < event.height) contentHeight = event.height;
+                if (width !is null) *width = contentWidth;
+                if (height !is null) *height = contentHeight;
+            }
+        }
+    }
+}
+
+override void rendererRenderProc (
+    GtkCellRenderer * cell,
+    GdkDrawable * window,
+    GtkWidget * widget,
+    GdkRectangle *background_area,
+    GdkRectangle *cell_area,
+    GdkRectangle *expose_area,
+    int flags)
+{
+    TreeItem item = null;
+    auto iter = cast(GtkTreeIter*)OS.g_object_get_qdata (cast(GObject*)cell, Display.SWT_OBJECT_INDEX2);
+    if (iter !is null) item = _getItem (iter);
+    auto columnHandle = cast(GtkTreeViewColumn*)OS.g_object_get_qdata (cast(GObject*)cell, Display.SWT_OBJECT_INDEX1);
+    int columnIndex = 0;
+    if (columnCount > 0) {
+        for (int i = 0; i < columnCount; i++) {
+            if (columns [i].handle is cast(GtkWidget*)columnHandle) {
+                columnIndex = i;
+                break;
+            }
+        }
+    }
+    if (item !is null) {
+        if (OS.GTK_IS_CELL_RENDERER_TOGGLE (cell) || (OS.GTK_IS_CELL_RENDERER_PIXBUF (cell) && (columnIndex !is 0 || (style & SWT.CHECK) is 0))) {
+            drawFlags = cast(int)/*64*/flags;
+            drawState = SWT.FOREGROUND;
+            void* ptr;
+            OS.gtk_tree_model_get1 (modelHandle, item.handle, Tree.BACKGROUND_COLUMN, &ptr);
+            if (ptr is null) {
+                int modelIndex = columnCount is 0 ? Tree.FIRST_COLUMN : columns [columnIndex].modelIndex;
+                OS.gtk_tree_model_get1 (modelHandle, item.handle, modelIndex + Tree.CELL_BACKGROUND, &ptr);
+            }
+            if (ptr !is null) drawState |= SWT.BACKGROUND;
+            if ((flags & OS.GTK_CELL_RENDERER_SELECTED) !is 0) drawState |= SWT.SELECTED;
+            if ((flags & OS.GTK_CELL_RENDERER_FOCUSED) !is 0) drawState |= SWT.FOCUSED;
+
+            GdkRectangle rect;
+            auto path = OS.gtk_tree_model_get_path (modelHandle, iter);
+            OS.gtk_tree_view_get_background_area (handle, path, columnHandle, &rect);
+            OS.gtk_tree_path_free (path);
+
+            if ((drawState & SWT.SELECTED) is 0) {
+                Control control = findBackgroundControl ();
+                if (control !is null && control.backgroundImage !is null) {
+                    OS.gdk_window_clear_area (window, rect.x, rect.y, rect.width, rect.height);
+                }
+            }
+
+            if (hooks (SWT.EraseItem)) {
+                bool wasSelected = false;
+                if ((drawState & SWT.SELECTED) !is 0) {
+                    wasSelected = true;
+                    OS.gdk_window_clear_area (window, rect.x, rect.y, rect.width, rect.height);
+                }
+                GC gc = new GC (this);
+                if ((drawState & SWT.SELECTED) !is 0) {
+                    gc.setBackground (display.getSystemColor (SWT.COLOR_LIST_SELECTION));
+                    gc.setForeground (display.getSystemColor (SWT.COLOR_LIST_SELECTION_TEXT));
+                } else {
+                    gc.setBackground (item.getBackground (columnIndex));
+                    gc.setForeground (item.getForeground (columnIndex));
+                }
+                gc.setFont (item.getFont (columnIndex));
+                if ((style & SWT.MIRRORED) !is 0) rect.x = getClientWidth () - rect.width - rect.x;
+                gc.setClipping (rect.x, rect.y, rect.width, rect.height);
+                Event event = new Event ();
+                event.item = item;
+                event.index = columnIndex;
+                event.gc = gc;
+                event.x = rect.x;
+                event.y = rect.y;
+                event.width = rect.width;
+                event.height = rect.height;
+                event.detail = drawState;
+                sendEvent (SWT.EraseItem, event);
+                drawForeground = null;
+                drawState = event.doit ? event.detail : 0;
+                drawFlags &= ~(OS.GTK_CELL_RENDERER_FOCUSED | OS.GTK_CELL_RENDERER_SELECTED);
+                if ((drawState & SWT.SELECTED) !is 0) drawFlags |= OS.GTK_CELL_RENDERER_SELECTED;
+                if ((drawState & SWT.FOCUSED) !is 0) drawFlags |= OS.GTK_CELL_RENDERER_FOCUSED;
+                if ((drawState & SWT.SELECTED) !is 0) {
+                    auto style = OS.gtk_widget_get_style (widget);
+                    //TODO - parity and sorted
+                    OS.gtk_paint_flat_box (style, window, OS.GTK_STATE_SELECTED, OS.GTK_SHADOW_NONE, &rect, widget, "cell_odd".ptr, rect.x, rect.y, rect.width, rect.height);
+                } else {
+                    if (wasSelected) drawForeground = gc.getForeground ().handle;
+                }
+                gc.dispose();
+            }
+        }
+    }
+    int /*long*/ result = 0;
+    if ((drawState & SWT.BACKGROUND) !is 0 && (drawState & SWT.SELECTED) is 0) {
+        GC gc = new GC (this);
+        gc.setBackground (item.getBackground (columnIndex));
+        gc.fillRectangle (background_area.x, background_area.y, background_area.width, background_area.height);
+        gc.dispose ();
+    }
+    if ((drawState & SWT.FOREGROUND) !is 0 || OS.GTK_IS_CELL_RENDERER_TOGGLE (cell)) {
+        auto g_class = OS.g_type_class_peek_parent (OS.G_OBJECT_GET_CLASS (cell));
+        GtkCellRendererClass* klass = cast(GtkCellRendererClass*)g_class;
+        if (drawForeground !is null && OS.GTK_IS_CELL_RENDERER_TEXT (cell)) {
+            OS.g_object_set1 (cell, OS.foreground_gdk.ptr, cast(int)drawForeground);
+        }
+        klass.render( cell, window, handle, background_area, cell_area, expose_area, drawFlags);
+    }
+    if (item !is null) {
+        if (OS.GTK_IS_CELL_RENDERER_TEXT (cell)) {
+            if (hooks (SWT.PaintItem)) {
+                GdkRectangle rect;
+                auto path = OS.gtk_tree_model_get_path (modelHandle, iter);
+                OS.gtk_tree_view_get_cell_area (handle, path, columnHandle, &rect);
+                OS.gtk_tree_path_free (path);
+                if (OS.GTK_VERSION < OS.buildVERSION (2, 8, 18) && OS.gtk_tree_view_get_expander_column (handle) is columnHandle) {
+                    int buffer;
+                    OS.gtk_widget_style_get1 (handle, OS.expander_size.ptr, &buffer);
+                    rect.x += buffer + TreeItem.EXPANDER_EXTRA_PADDING;
+                    rect.width -= buffer + TreeItem.EXPANDER_EXTRA_PADDING;
+                    //OS.gtk_widget_style_get (handle, OS.horizontal_separator, buffer, 0);
+                    //rect.x += buffer[0];
+                    //rect.width -= buffer [0]; // TODO Is this required for some versions?
+                }
+                ignoreSize = true;
+                int contentX, contentWidth;
+                OS.gtk_cell_renderer_get_size (cell, handle, null, null, null, &contentWidth, null);
+                OS.gtk_tree_view_column_cell_get_position (columnHandle, cell, &contentX, null);
+                ignoreSize = false;
+                Image image = item.getImage (columnIndex);
+                int imageWidth = 0;
+                if (image !is null) {
+                    Rectangle bounds = image.getBounds ();
+                    imageWidth = bounds.width;
+                }
+                contentX -= imageWidth;
+                contentWidth += imageWidth;
+                GC gc = new GC (this);
+                if ((drawState & SWT.SELECTED) !is 0) {
+                    gc.setBackground (display.getSystemColor (SWT.COLOR_LIST_SELECTION));
+                    gc.setForeground (display.getSystemColor (SWT.COLOR_LIST_SELECTION_TEXT));
+                } else {
+                    gc.setBackground (item.getBackground (columnIndex));
+                    Color foreground = drawForeground !is null ? Color.gtk_new (display, drawForeground) : item.getForeground (columnIndex);
+                    gc.setForeground (foreground);
+                }
+                gc.setFont (item.getFont (columnIndex));
+                if ((style & SWT.MIRRORED) !is 0) rect.x = getClientWidth () - rect.width - rect.x;
+                gc.setClipping (rect.x, rect.y, rect.width, rect.height);
+                Event event = new Event ();
+                event.item = item;
+                event.index = columnIndex;
+                event.gc = gc;
+                event.x = rect.x + contentX;
+                event.y = rect.y;
+                event.width = contentWidth;
+                event.height = rect.height;
+                event.detail = drawState;
+                sendEvent (SWT.PaintItem, event);
+                gc.dispose();
+            }
+        }
+    }
+    return result;
+}
+
+void resetCustomDraw () {
+    if ((style & SWT.VIRTUAL) !is 0 || ownerDraw) return;
+    int end = Math.max (1, columnCount);
+    for (int i=0; i<end; i++) {
+        bool customDraw = columnCount !is 0 ? columns [i].customDraw : firstCustomDraw;
+        if (customDraw) {
+            auto column = OS.gtk_tree_view_get_column (handle, i);
+            auto textRenderer = getTextRenderer (column);
+            OS.gtk_tree_view_column_set_cell_data_func (column, textRenderer, null, null, null);
+            if (columnCount !is 0) columns [i].customDraw = false;
+        }
+    }
+    firstCustomDraw = false;
+}
+
+/**
+ * Display a mark indicating the point at which an item will be inserted.
+ * The drop insert item has a visual hint to show where a dragged item
+ * will be inserted when dropped on the tree.
+ *
+ * @param item the insert item.  Null will clear the insertion mark.
+ * @param before true places the insert mark above 'item'. false places
+ *  the insert mark below 'item'.
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setInsertMark (TreeItem item, bool before) {
+    checkWidget ();
+    if (item is null) {
+        OS.gtk_tree_view_set_drag_dest_row(handle, null, OS.GTK_TREE_VIEW_DROP_BEFORE);
+        return;
+    }
+    if (item.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
+    if (item.parent !is this) return;
+    Rectangle rect = item.getBounds();
+    void* path;
+    OS.gtk_widget_realize (handle);
+    if (!OS.gtk_tree_view_get_path_at_pos(handle, rect.x, rect.y, &path, null, null, null)) return;
+    if (path is null) return;
+    int position = before ? OS.GTK_TREE_VIEW_DROP_BEFORE : OS.GTK_TREE_VIEW_DROP_AFTER;
+    OS.gtk_tree_view_set_drag_dest_row(handle, path, position);
+    OS.gtk_tree_path_free (path );
+}
+
+void setItemCount (GtkTreeIter* parentIter, int count) {
+    int itemCount = OS.gtk_tree_model_iter_n_children (modelHandle, parentIter);
+    if (count is itemCount) return;
+    bool isVirtual = (style & SWT.VIRTUAL) !is 0;
+    if (!isVirtual) setRedraw (false);
+    remove (parentIter, count, itemCount - 1);
+    if (isVirtual) {
+        for (int i=itemCount; i<count; i++) {
+            GtkTreeIter iter;
+            OS.gtk_tree_store_append (modelHandle, &iter, parentIter);
+            OS.gtk_tree_store_set1 (modelHandle, &iter, ID_COLUMN, cast(void*)-1);
+        }
+    } else {
+        for (int i=itemCount; i<count; i++) {
+            new TreeItem (this, parentIter, SWT.NONE, i, true);
+        }
+    }
+    if (!isVirtual) setRedraw (true);
+    modelChanged = true;
+}
+
+/**
+ * Sets the number of root-level items contained in the receiver.
+ *
+ * @param count the number of items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setItemCount (int count) {
+    checkWidget ();
+    count = Math.max (0, count);
+    setItemCount (null, count);
+}
+
+/**
+ * Selects an item in the receiver.  If the item was already
+ * selected, it remains selected.
+ *
+ * @param item the item to be selected
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.4
+ */
+public void select (TreeItem item) {
+    checkWidget ();
+    if (item is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (item.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+    bool fixColumn = showFirstColumn ();
+    auto selection = OS.gtk_tree_view_get_selection (handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    OS.gtk_tree_selection_select_iter (selection, item.handle);
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    if (fixColumn) hideFirstColumn ();
+}
+
+/**
+ * Selects all of the items in the receiver.
+ * <p>
+ * If the receiver is single-select, do nothing.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void selectAll () {
+    checkWidget();
+    if ((style & SWT.SINGLE) !is 0) return;
+    bool fixColumn = showFirstColumn ();
+    auto selection = OS.gtk_tree_view_get_selection (handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    OS.gtk_tree_selection_select_all (selection);
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    if (fixColumn) hideFirstColumn ();
+}
+
+override void setBackgroundColor (GdkColor* color) {
+    super.setBackgroundColor (color);
+    OS.gtk_widget_modify_base (handle, 0, color);
+}
+
+override void setBackgroundPixmap (GdkPixmap* pixmap) {
+    super.setBackgroundPixmap (pixmap);
+    auto window = paintWindow ();
+    if (window !is null) OS.gdk_window_set_back_pixmap (window, null, true);
+}
+
+override int setBounds (int x, int y, int width, int height, bool move, bool resize) {
+    int result = super.setBounds (x, y, width, height, move, resize);
+    /*
+    * Bug on GTK.  The tree view sometimes does not get a paint
+    * event or resizes to a one pixel square when resized in a new
+    * shell that is not visible after any event loop has been run.  The
+    * problem is intermittent. It doesn't seem to happen the first time
+    * a new shell is created. The fix is to ensure the tree view is realized
+    * after it has been resized.
+    */
+    OS.gtk_widget_realize (handle);
+    /*
+    * Bug in GTK.  An empty GtkTreeView fails to repaint the focus rectangle
+    * correctly when resized on versions before 2.6.0.  The fix is to force
+    * the widget to redraw.
+    */
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 6, 0) && OS.gtk_tree_model_iter_n_children (modelHandle, null) is 0) {
+        redraw (false);
+    }
+    return result;
+}
+
+/**
+ * Sets the order that the items in the receiver should
+ * be displayed in to the given argument which is described
+ * in terms of the zero-relative ordering of when the items
+ * were added.
+ *
+ * @param order the new order to display the items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the item order is not the same length as the number of items</li>
+ * </ul>
+ *
+ * @see Tree#getColumnOrder()
+ * @see TreeColumn#getMoveable()
+ * @see TreeColumn#setMoveable(bool)
+ * @see SWT#Move
+ *
+ * @since 3.2
+ */
+public void setColumnOrder (int [] order) {
+    checkWidget ();
+    // SWT extension: allow null for zero length string
+    //if (order is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (columnCount is 0) {
+        if (order.length > 0) error (SWT.ERROR_INVALID_ARGUMENT);
+        return;
+    }
+    if (order.length !is columnCount) error (SWT.ERROR_INVALID_ARGUMENT);
+    bool [] seen = new bool [columnCount];
+    for (int i = 0; i<order.length; i++) {
+        int index = order [i];
+        if (index < 0 || index >= columnCount) error (SWT.ERROR_INVALID_RANGE);
+        if (seen [index]) error (SWT.ERROR_INVALID_ARGUMENT);
+        seen [index] = true;
+    }
+    void* baseColumn;
+    for (int i=0; i<order.length; i++) {
+        auto column = columns [order [i]].handle;
+        OS.gtk_tree_view_move_column_after (handle, column, baseColumn);
+        baseColumn = column;
+    }
+}
+
+override void setFontDescription (PangoFontDescription* font) {
+    super.setFontDescription (font);
+    TreeColumn[] columns = getColumns ();
+    for (int i = 0; i < columns.length; i++) {
+        if (columns[i] !is null) {
+            columns[i].setFontDescription (font);
+        }
+    }
+}
+
+/**
+ * Marks the receiver's header as visible if the argument is <code>true</code>,
+ * and marks it invisible otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, marking
+ * it visible may not actually cause it to be displayed.
+ * </p>
+ *
+ * @param show the new visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void setHeaderVisible (bool show) {
+    checkWidget ();
+    OS.gtk_tree_view_set_headers_visible (handle, show);
+}
+
+/**
+ * Marks the receiver's lines as visible if the argument is <code>true</code>,
+ * and marks it invisible otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, marking
+ * it visible may not actually cause it to be displayed.
+ * </p>
+ *
+ * @param show the new visibility state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void setLinesVisible (bool show) {
+    checkWidget();
+    OS.gtk_tree_view_set_rules_hint (handle, show);
+}
+
+override void setParentBackground () {
+    super.setParentBackground ();
+    auto window = paintWindow ();
+    if (window !is null) OS.gdk_window_set_back_pixmap (window, null, true);
+}
+
+override void setParentWindow (GtkWidget* widget) {
+    auto window = eventWindow ();
+    OS.gtk_widget_set_parent_window (widget, window);
+}
+
+void setScrollWidth (GtkTreeViewColumn* column, TreeItem item) {
+    if (columnCount !is 0 || currentItem is item) return;
+    /*
+    * Use GTK_TREE_VIEW_COLUMN_GROW_ONLY on GTK versions < 2.3.2
+    * because fixed_height_mode is not supported.
+    */
+    if (((style & SWT.VIRTUAL) !is 0) && OS.GTK_VERSION < OS.buildVERSION (2, 3, 2)) return;
+    int width = OS.gtk_tree_view_column_get_fixed_width (column);
+    int itemWidth = calculateWidth (column, cast(GtkTreeIter*)item.handle, true);
+    if (width < itemWidth) {
+        OS.gtk_tree_view_column_set_fixed_width (column, itemWidth);
+    }
+}
+
+/**
+ * Sets the receiver's selection to the given item.
+ * The current selection is cleared before the new item is selected.
+ * <p>
+ * If the item is not in the receiver, then it is ignored.
+ * </p>
+ *
+ * @param item the item to select
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setSelection (TreeItem item) {
+    checkWidget ();
+    if (item is null) error (SWT.ERROR_NULL_ARGUMENT);
+    setSelection ([item]);
+}
+
+/**
+ * Sets the receiver's selection to be the given array of items.
+ * The current selection is cleared before the new items are selected.
+ * <p>
+ * Items that are not in the receiver are ignored.
+ * If the receiver is single-select and multiple items are specified,
+ * then all items are ignored.
+ * </p>
+ *
+ * @param items the array of items
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if one of the items has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Tree#deselectAll()
+ */
+public void setSelection (TreeItem [] items) {
+    checkWidget ();
+    // SWT extension: allow null for zero length string
+    //if (items is null) error (SWT.ERROR_NULL_ARGUMENT);
+    deselectAll ();
+    int length = items.length;
+    if (length is 0 || ((style & SWT.SINGLE) !is 0 && length > 1)) return;
+    bool fixColumn = showFirstColumn ();
+    auto selection = OS.gtk_tree_view_get_selection (handle);
+    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    bool first = true;
+    for (int i = 0; i < length; i++) {
+        TreeItem item = items [i];
+        if (item is null) continue;
+        if (item.isDisposed ()) break;
+        if (item.parent !is this) continue;
+        auto path = OS.gtk_tree_model_get_path (modelHandle, item.handle);
+        showItem (path, false);
+        if (first) {
+            OS.gtk_tree_view_set_cursor (handle, path, null, false);
+        }
+        OS.gtk_tree_selection_select_iter (selection, item.handle);
+        OS.gtk_tree_path_free (path);
+        first = false;
+    }
+    OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
+    if (fixColumn) hideFirstColumn ();
+}
+
+/**
+ * Sets the column used by the sort indicator for the receiver. A null
+ * value will clear the sort indicator.  The current sort column is cleared
+ * before the new column is set.
+ *
+ * @param column the column used by the sort indicator or <code>null</code>
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the column is disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setSortColumn (TreeColumn column) {
+    checkWidget ();
+    if (column !is null && column.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+    if (sortColumn !is null && !sortColumn.isDisposed()) {
+        OS.gtk_tree_view_column_set_sort_indicator (sortColumn.handle, false);
+    }
+    sortColumn = column;
+    if (sortColumn !is null && sortDirection !is SWT.NONE) {
+        OS.gtk_tree_view_column_set_sort_indicator (sortColumn.handle, true);
+        OS.gtk_tree_view_column_set_sort_order (sortColumn.handle, sortDirection is SWT.DOWN ? 0 : 1);
+    }
+}
+
+/**
+ * Sets the direction of the sort indicator for the receiver. The value
+ * can be one of <code>UP</code>, <code>DOWN</code> or <code>NONE</code>.
+ *
+ * @param direction the direction of the sort indicator
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setSortDirection  (int direction) {
+    checkWidget ();
+    if (direction !is SWT.UP && direction !is SWT.DOWN && direction !is SWT.NONE) return;
+    sortDirection = direction;
+    if (sortColumn is null || sortColumn.isDisposed ()) return;
+    if (sortDirection is SWT.NONE) {
+        OS.gtk_tree_view_column_set_sort_indicator (sortColumn.handle, false);
+    } else {
+        OS.gtk_tree_view_column_set_sort_indicator (sortColumn.handle, true);
+        OS.gtk_tree_view_column_set_sort_order (sortColumn.handle, sortDirection is SWT.DOWN ? 0 : 1);
+    }
+}
+
+/**
+ * Sets the item which is currently at the top of the receiver.
+ * This item can change when items are expanded, collapsed, scrolled
+ * or new items are added or removed.
+ *
+ * @param item the item to be shown
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Tree#getTopItem()
+ *
+ * @since 2.1
+ */
+public void setTopItem (TreeItem item) {
+    if (item is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (item.isDisposed ()) error(SWT.ERROR_INVALID_ARGUMENT);
+    if (item.parent !is this) return;
+    auto path = OS.gtk_tree_model_get_path (modelHandle, item.handle);
+    showItem (path, false);
+    OS.gtk_tree_view_scroll_to_cell (handle, path, null, true, 0f, 0f);
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 8, 0)) {
+        /*
+        * Bug in GTK.  According to the documentation, gtk_tree_view_scroll_to_cell
+        * should vertically scroll the cell to the top if use_align is true and row_align is 0.
+        * However, prior to version 2.8 it does not scroll at all.  The fix is to determine
+        * the new location and use gtk_tree_view_scroll_to_point.
+        * If the widget is a pinhead, calling gtk_tree_view_scroll_to_point
+        * will have no effect. Therefore, it is still neccessary to call
+        * gtk_tree_view_scroll_to_cell.
+        */
+        OS.gtk_widget_realize (handle);
+        GdkRectangle cellRect;
+        OS.gtk_tree_view_get_cell_area (handle, path, null, &cellRect);
+        int tx, ty;
+        OS.gtk_tree_view_widget_to_tree_coords(handle, cellRect.x, cellRect.y, &tx, &ty);
+        OS.gtk_tree_view_scroll_to_point (handle, -1, ty);
+    }
+    OS.gtk_tree_path_free (path);
+}
+
+/**
+ * Shows the column.  If the column is already showing in the receiver,
+ * this method simply returns.  Otherwise, the columns are scrolled until
+ * the column is visible.
+ *
+ * @param column the column to be shown
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void showColumn (TreeColumn column) {
+    checkWidget ();
+    if (column is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (column.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
+    if (column.parent !is this) return;
+    /*
+    * This code is intentionally commented. According to the
+    * documentation, gtk_tree_view_scroll_to_cell should scroll the
+    * minimum amount to show the column but instead it scrolls strangely.
+    */
+    //OS.gtk_tree_view_scroll_to_cell (handle, 0, column.handle, false, 0, 0);
+    OS.gtk_widget_realize (handle);
+    GdkRectangle cellRect;
+    OS.gtk_tree_view_get_cell_area (handle, null, column.handle, &cellRect);
+    GdkRectangle visibleRect;
+    OS.gtk_tree_view_get_visible_rect (handle, &visibleRect);
+    if (cellRect.x < visibleRect.x) {
+        OS.gtk_tree_view_scroll_to_point (handle, cellRect.x, -1);
+    } else {
+        int width = Math.min (visibleRect.width, cellRect.width);
+        if (cellRect.x + width > visibleRect.x + visibleRect.width) {
+            int tree_x = cellRect.x + width - visibleRect.width;
+            OS.gtk_tree_view_scroll_to_point (handle, tree_x, -1);
+        }
+    }
+}
+
+bool showFirstColumn () {
+    /*
+    * Bug in GTK.  If no columns are visible, changing the selection
+    * will fail.  The fix is to temporarily make a column visible.
+    */
+    int columnCount = Math.max (1, this.columnCount);
+    for (int i=0; i<columnCount; i++) {
+        auto column = OS.gtk_tree_view_get_column (handle, i);
+        if (OS.gtk_tree_view_column_get_visible (column)) return false;
+    }
+    auto firstColumn = OS.gtk_tree_view_get_column (handle, 0);
+    OS.gtk_tree_view_column_set_visible (firstColumn, true);
+    return true;
+}
+
+/**
+ * Shows the selection.  If the selection is already showing in the receiver,
+ * this method simply returns.  Otherwise, the items are scrolled until
+ * the selection is visible.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Tree#showItem(TreeItem)
+ */
+public void showSelection () {
+    checkWidget();
+    TreeItem [] items = getSelection ();
+    if (items.length !is 0 && items [0] !is null) showItem (items [0]);
+}
+
+void showItem (GtkTreePath* path, bool scroll) {
+    int depth = OS.gtk_tree_path_get_depth (path);
+    if (depth > 1) {
+        auto indicesPtr = OS.gtk_tree_path_get_indices (path);
+        int [] indices = indicesPtr[ 0 .. depth - 1];
+        auto tempPath = OS.gtk_tree_path_new ();
+        for (int i=0; i<indices.length; i++) {
+            OS.gtk_tree_path_append_index (tempPath, indices [i]);
+            OS.gtk_tree_view_expand_row (handle, tempPath, false);
+        }
+        OS.gtk_tree_path_free (tempPath);
+    }
+    if (scroll) {
+        OS.gtk_widget_realize (handle);
+        GdkRectangle cellRect;
+        OS.gtk_tree_view_get_cell_area (handle, path, null, &cellRect);
+        bool isHidden = cellRect.y is 0 && cellRect.height is 0;
+        int tx, ty;
+        OS.gtk_tree_view_widget_to_tree_coords (handle, cellRect.x, cellRect.y, &tx, &ty);
+        GdkRectangle visibleRect;
+        OS.gtk_tree_view_get_visible_rect (handle, &visibleRect);
+        if (!isHidden) {
+            if (ty < visibleRect.y || ty + cellRect.height > visibleRect.y + visibleRect.height) {
+                isHidden = true;
+            }
+        }
+        if (isHidden) {
+            /*
+            * This code intentionally commented.
+            * Bug in GTK.  According to the documentation, gtk_tree_view_scroll_to_cell
+            * should scroll the minimum amount to show the cell if use_align is false.
+            * However, what actually happens is the cell is scrolled to the top.
+            * The fix is to determine the new location and use gtk_tree_view_scroll_to_point.
+            * If the widget is a pinhead, calling gtk_tree_view_scroll_to_point
+            * will have no effect. Therefore, it is still neccessary to
+            * call gtk_tree_view_scroll_to_cell.
+            */
+            //  OS.gtk_tree_view_scroll_to_cell (handle, path, 0, depth !is 1, 0.5f, 0.0f);
+            if (depth !is 1) {
+                OS.gtk_tree_view_scroll_to_cell (handle, path, null, true, 0.5f, 0.0f);
+            } else {
+                if (ty < visibleRect.y ) {
+                    OS.gtk_tree_view_scroll_to_point (handle, -1, ty);
+                } else {
+                    int height = Math.min (visibleRect.height, cellRect.height);
+                    if (ty + height > visibleRect.y + visibleRect.height) {
+                        OS.gtk_tree_view_scroll_to_point (handle, -1, ty + cellRect.height - visibleRect.height);
+                    }
+                }
+            }
+        }
+    }
+}
+
+/**
+ * Shows the item.  If the item is already showing in the receiver,
+ * this method simply returns.  Otherwise, the items are scrolled
+ * and expanded until the item is visible.
+ *
+ * @param item the item to be shown
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Tree#showSelection()
+ */
+public void showItem (TreeItem item) {
+    checkWidget ();
+    if (item is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (item.isDisposed ()) error(SWT.ERROR_INVALID_ARGUMENT);
+    if (item.parent !is this) return;
+    auto path = OS.gtk_tree_model_get_path (modelHandle, item.handle);
+    showItem (path, true);
+    OS.gtk_tree_path_free (path);
+}
+
+override void treeSelectionProc (
+    GtkTreeModel *model,
+    GtkTreePath *path,
+    GtkTreeIter *iter,
+    int[] selection,
+    int length_)
+{
+    if (selection !is null) {
+        int index;
+        OS.gtk_tree_model_get1 (modelHandle, iter, ID_COLUMN, cast(void**)&index);
+        selection [length_] = index;
+    }
+    return 0;
+}
+
+override void updateScrollBarValue (ScrollBar bar) {
+    super.updateScrollBarValue (bar);
+    /*
+    * Bug in GTK. Scrolling changes the XWindow position
+    * and makes the child widgets appear to scroll even
+    * though when queried their position is unchanged.
+    * The fix is to queue a resize event for each child to
+    * force the position to be corrected.
+    */
+    auto parentHandle = parentingHandle ();
+    auto list = OS.gtk_container_get_children (parentHandle);
+    if (list is null) return;
+    auto temp = list;
+    while (temp !is null) {
+        auto widget = OS.g_list_data (temp);
+        if (widget !is null) OS.gtk_widget_queue_resize  (widget);
+        temp = OS.g_list_next (temp);
+    }
+    OS.g_list_free (list);
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/TreeColumn.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,680 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.TreeColumn;
+
+import java.lang.all;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.ImageList;
+import org.eclipse.swt.widgets.TypedListener;
+
+
+/**
+ * Instances of this class represent a column in a tree widget.
+ * <p><dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>LEFT, RIGHT, CENTER</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd> Move, Resize, Selection</dd>
+ * </dl>
+ * </p><p>
+ * Note: Only one of the styles LEFT, RIGHT and CENTER may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#tree">Tree, TreeItem, TreeColumn snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ * 
+ * @since 3.1
+ */
+public class TreeColumn : Item {
+    GtkWidget* labelHandle, imageHandle, buttonHandle;
+    Tree parent;
+    int modelIndex, lastButton, lastTime, lastX, lastWidth;
+    bool customDraw, useFixedWidth;
+    String toolTipText;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Tree</code>) and a style value
+ * describing its behavior and appearance. The item is added
+ * to the end of the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#LEFT
+ * @see SWT#RIGHT
+ * @see SWT#CENTER
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Tree parent, int style) {
+    super (parent, checkStyle (style));
+    this.parent = parent;
+    createWidget (parent.getColumnCount ());
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Tree</code>), a style value
+ * describing its behavior and appearance, and the index
+ * at which to place it in the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ * <p>
+ * Note that due to a restriction on some platforms, the first column
+ * is always left aligned.
+ * </p>
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ * @param index the zero-relative index to store the receiver in its parent
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the parent (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#LEFT
+ * @see SWT#RIGHT
+ * @see SWT#CENTER
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Tree parent, int style, int index) {
+    super (parent, checkStyle (style));
+    this.parent = parent;
+    createWidget (index);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the control is moved or resized, by sending
+ * it one of the messages defined in the <code>ControlListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ControlListener
+ * @see #removeControlListener
+ */
+public void addControlListener(ControlListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Resize,typedListener);
+    addListener (SWT.Move,typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the control is selected by the user, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * <code>widgetSelected</code> is called when the column header is selected.
+ * <code>widgetDefaultSelected</code> is not called.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the control is selected by the user
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener (SelectionListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Selection,typedListener);
+    addListener (SWT.DefaultSelection,typedListener);
+}
+
+static int checkStyle (int style) {
+    return checkBits (style, SWT.LEFT, SWT.CENTER, SWT.RIGHT, 0, 0, 0);
+}
+
+protected void checkSubclass () {
+    if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+void createWidget (int index) {
+    parent.createItem (this, index);
+    setOrientation ();
+    hookEvents ();
+    register ();
+    text = "";
+}
+
+void deregister() {
+    super.deregister ();
+    display.removeWidget (handle);
+    if (buttonHandle !is null) display.removeWidget (buttonHandle);
+    if (labelHandle !is null) display.removeWidget (labelHandle);
+}
+
+void destroyWidget () {
+    parent.destroyItem (this);
+    releaseHandle ();
+}
+
+/**
+ * Returns a value which describes the position of the
+ * text or image in the receiver. The value will be one of
+ * <code>LEFT</code>, <code>RIGHT</code> or <code>CENTER</code>.
+ *
+ * @return the alignment
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getAlignment () {
+    checkWidget();
+    if ((style & SWT.LEFT) !is 0) return SWT.LEFT;
+    if ((style & SWT.CENTER) !is 0) return SWT.CENTER;
+    if ((style & SWT.RIGHT) !is 0) return SWT.RIGHT;
+    return SWT.LEFT;
+}
+
+/**
+ * Gets the moveable attribute. A column that is
+ * not moveable cannot be reordered by the user
+ * by dragging the header but may be reordered
+ * by the programmer.
+ *
+ * @return the moveable attribute
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Tree#getColumnOrder()
+ * @see Tree#setColumnOrder(int[])
+ * @see TreeColumn#setMoveable(bool)
+ * @see SWT#Move
+ *
+ * @since 3.2
+ */
+public bool getMoveable() {
+    checkWidget();
+    return cast(bool)OS.gtk_tree_view_column_get_reorderable (handle);
+}
+
+/**
+ * Returns the receiver's parent, which must be a <code>Tree</code>.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Tree getParent () {
+    checkWidget();
+    return parent;
+}
+
+/**
+ * Gets the resizable attribute. A column that is
+ * not resizable cannot be dragged by the user but
+ * may be resized by the programmer.
+ *
+ * @return the resizable attribute
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool getResizable () {
+    checkWidget();
+    return cast(bool)OS.gtk_tree_view_column_get_resizable (handle);
+}
+
+/**
+ * Returns the receiver's tool tip text, or null if it has
+ * not been set.
+ *
+ * @return the receiver's tool tip text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public String getToolTipText () {
+    checkWidget();
+    return toolTipText;
+}
+
+/**
+ * Gets the width of the receiver.
+ *
+ * @return the width
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getWidth () {
+    checkWidget();
+    if (!OS.gtk_tree_view_column_get_visible (handle)) {
+        return 0;
+    }
+    if (useFixedWidth) return OS.gtk_tree_view_column_get_fixed_width (handle);
+    return OS.gtk_tree_view_column_get_width (handle);
+}
+
+override int gtk_clicked (GtkWidget* widget) {
+    /*
+    * There is no API to get a double click on a table column.  Normally, when
+    * the mouse is double clicked, this is indicated by GDK_2BUTTON_PRESS
+    * but the table column sends the click signal on button release.  The fix is to
+    * test for double click by remembering the last click time and mouse button
+    * and testing for the double click interval.
+    */
+    bool doubleClick = false;
+    bool postEvent_ = true;
+    auto eventPtr = OS.gtk_get_current_event ();
+    if (eventPtr !is null) {
+        GdkEventButton* gdkEvent = cast(GdkEventButton*)eventPtr;
+        scope(exit) OS.gdk_event_free (eventPtr);
+        switch (gdkEvent.type) {
+            case OS.GDK_BUTTON_RELEASE: {
+                int clickTime = display.getDoubleClickTime ();
+                int eventTime = gdkEvent.time, eventButton = gdkEvent.button;
+                if (lastButton is eventButton && lastTime !is 0 && Math.abs (lastTime - eventTime) <= clickTime) {
+                    doubleClick = true;
+                }
+                lastTime = eventTime is 0 ? 1: eventTime;
+                lastButton = eventButton;
+                break;
+            }
+            case OS.GDK_MOTION_NOTIFY: {
+                /*
+                * Bug in GTK.  Dragging a column in a GtkTreeView causes a clicked
+                * signal to be emitted even though the mouse button was never released.
+                * The fix to ignore the signal if the current GDK event is a motion notify.
+                * The GTK bug was fixed in version 2.6
+                */
+                if (OS.GTK_VERSION < OS.buildVERSION (2, 6, 0)) postEvent_ = false;
+                break;
+            }
+            default:
+        }
+    }
+    if (postEvent_) postEvent (doubleClick ? SWT.DefaultSelection : SWT.Selection);
+    return 0;
+}
+
+override int gtk_mnemonic_activate (GtkWidget* widget, int /*long*/ arg1) {
+    return parent.gtk_mnemonic_activate (widget, arg1);
+}
+
+override int gtk_size_allocate (GtkWidget* widget, int allocation) {
+    useFixedWidth = false;
+    int x = OS.GTK_WIDGET_X (widget);
+    int width = OS.GTK_WIDGET_WIDTH (widget);
+    if (x !is lastX) {
+        lastX = x;
+        sendEvent (SWT.Move);
+    }
+    if (width !is lastWidth) {
+        lastWidth = width;
+        sendEvent (SWT.Resize);
+    }
+    return 0;
+}
+
+void hookEvents () {
+    super.hookEvents ();
+    OS.g_signal_connect_closure (handle, OS.clicked.ptr, display.closures [CLICKED], false);
+    if (buttonHandle !is null) OS.g_signal_connect_closure_by_id (buttonHandle, display.signalIds [SIZE_ALLOCATE], 0, display.closures [SIZE_ALLOCATE], false);
+    if (labelHandle !is null) OS.g_signal_connect_closure_by_id (labelHandle, display.signalIds [MNEMONIC_ACTIVATE], 0, display.closures [MNEMONIC_ACTIVATE], false);
+}
+
+/**
+ * Causes the receiver to be resized to its preferred size.
+ * For a composite, this involves computing the preferred size
+ * from its layout, if there is one.
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ */
+public void pack () {
+    checkWidget();
+    int width = 0;
+    if (buttonHandle !is null) {
+        GtkRequisition requisition;
+        OS.gtk_widget_size_request (buttonHandle, &requisition);
+        width = requisition.width;
+    }
+    if ((parent.style & SWT.VIRTUAL) !is 0) {
+        //NOT DONE
+    } else {
+        GtkTreeIter iter;
+        if (OS.gtk_tree_model_get_iter_first (parent.modelHandle, &iter)) {
+            do {
+                width = Math.max (width, parent.calculateWidth (cast(GtkTreeViewColumn*)handle, &iter, true));
+            } while (OS.gtk_tree_model_iter_next(parent.modelHandle, &iter));
+        }
+    }
+    setWidth(width);
+}
+
+void register () {
+    super.register ();
+    display.addWidget (handle, this);
+    if (buttonHandle !is null) display.addWidget (buttonHandle, this);
+    if (labelHandle !is null) display.addWidget (labelHandle, this);
+}
+
+void releaseHandle () {
+    super.releaseHandle ();
+    handle = buttonHandle = labelHandle = imageHandle = null;
+    modelIndex = -1;
+    parent = null;
+}
+
+void releaseParent () {
+    super.releaseParent ();
+    if (parent.sortColumn is this) {
+        parent.sortColumn = null;
+    }
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is moved or resized.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ControlListener
+ * @see #addControlListener
+ */
+public void removeControlListener (ControlListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Move, listener);
+    eventTable.unhook (SWT.Resize, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is selected by the user.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener(SelectionListener listener) {
+    checkWidget();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Selection, listener);
+    eventTable.unhook (SWT.DefaultSelection,listener);
+}
+
+/**
+ * Controls how text and images will be displayed in the receiver.
+ * The argument should be one of <code>LEFT</code>, <code>RIGHT</code>
+ * or <code>CENTER</code>.
+ * <p>
+ * Note that due to a restriction on some platforms, the first column
+ * is always left aligned.
+ * </p>
+ * @param alignment the new alignment
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setAlignment (int alignment) {
+    checkWidget();
+    if ((alignment & (SWT.LEFT | SWT.RIGHT | SWT.CENTER)) is 0) return;
+    int index = parent.indexOf (this);
+    if (index is -1 || index is 0) return;
+    style &= ~(SWT.LEFT | SWT.RIGHT | SWT.CENTER);
+    style |= alignment & (SWT.LEFT | SWT.RIGHT | SWT.CENTER);
+    parent.createRenderers (cast(GtkTreeViewColumn*)handle, modelIndex, index is 0, style);
+}
+
+void setFontDescription (PangoFontDescription* font) {
+    OS.gtk_widget_modify_font (labelHandle, font);
+    OS.gtk_widget_modify_font (imageHandle, font);
+}
+
+public override void setImage (Image image) {
+    checkWidget ();
+    super.setImage (image);
+    if (image !is null) {
+        ImageList headerImageList = parent.headerImageList;
+        if (headerImageList is null) {
+            headerImageList = parent.headerImageList = new ImageList ();
+        }
+        int imageIndex = headerImageList.indexOf (image);
+        if (imageIndex is -1) imageIndex = headerImageList.add (image);
+        auto pixbuf = headerImageList.getPixbuf (imageIndex);
+        OS.gtk_image_set_from_pixbuf (imageHandle, pixbuf);
+        OS.gtk_widget_show (imageHandle);
+    } else {
+        OS.gtk_image_set_from_pixbuf (imageHandle, null);
+        OS.gtk_widget_hide (imageHandle);
+    }
+}
+
+/**
+ * Sets the moveable attribute.  A column that is
+ * moveable can be reordered by the user by dragging
+ * the header. A column that is not moveable cannot be
+ * dragged by the user but may be reordered
+ * by the programmer.
+ *
+ * @param moveable the moveable attribute
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Tree#setColumnOrder(int[])
+ * @see Tree#getColumnOrder()
+ * @see TreeColumn#getMoveable()
+ * @see SWT#Move
+ *
+ * @since 3.2
+ */
+public void setMoveable (bool moveable) {
+    checkWidget();
+    OS.gtk_tree_view_column_set_reorderable (handle, moveable);
+}
+
+void setOrientation() {
+    if ((parent.style & SWT.RIGHT_TO_LEFT) !is 0) {
+        if (buttonHandle !is null) {
+            OS.gtk_widget_set_direction (buttonHandle, OS.GTK_TEXT_DIR_RTL);
+            display.doSetDirectionProc(buttonHandle, OS.GTK_TEXT_DIR_RTL);
+        }
+    }
+}
+
+/**
+ * Sets the resizable attribute.  A column that is
+ * not resizable cannot be dragged by the user but
+ * may be resized by the programmer.
+ *
+ * @param resizable the resize attribute
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setResizable (bool resizable) {
+    checkWidget();
+    OS.gtk_tree_view_column_set_resizable (handle, resizable);
+}
+
+public override void setText (String string) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    super.setText (string);
+    char [] chars = fixMnemonic (string);
+    OS.gtk_label_set_text_with_mnemonic (labelHandle, chars.toStringzValidPtr());
+    if (string.length !is 0) {
+        OS.gtk_widget_show (labelHandle);
+    } else {
+        OS.gtk_widget_hide (labelHandle);
+    }
+}
+
+/**
+ * Sets the receiver's tool tip text to the argument, which
+ * may be null indicating that no tool tip text should be shown.
+ *
+ * @param string the new tool tip text (or null)
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setToolTipText (String string) {
+    checkWidget();
+    Shell shell = parent._getShell ();
+    setToolTipText (shell, string);
+    toolTipText = string;
+}
+
+void setToolTipText (Shell shell, String newString) {
+    shell.setToolTipText (buttonHandle, newString);
+}
+
+/**
+ * Sets the width of the receiver.
+ *
+ * @param width the new width
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setWidth (int width) {
+    checkWidget();
+    if (width < 0) return;
+    if (width is lastWidth) return;
+    if (width > 0) {
+        useFixedWidth = true;
+        OS.gtk_tree_view_column_set_fixed_width (handle, width);
+    }
+    /*
+     * Bug in GTK.  For some reason, calling gtk_tree_view_column_set_visible()
+     * when the parent is not realized fails to show the column. The fix is to
+     * ensure that the table has been realized.
+     */
+    if (width !is 0) OS.gtk_widget_realize (parent.handle);
+    OS.gtk_tree_view_column_set_visible (handle, width !is 0);
+    lastWidth = width;
+    sendEvent (SWT.Resize);
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/TreeItem.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,1759 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.TreeItem;
+
+import java.lang.all;
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.ImageList;
+
+
+/**
+ * Instances of this class represent a selectable user interface object
+ * that represents a hierarchy of tree items in a tree widget.
+ *
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>(none)</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#tree">Tree, TreeItem, TreeColumn snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class TreeItem : Item {
+    Tree parent;
+    Font font;
+    Font[] cellFont;
+    bool cached, grayed;
+    static final int EXPANDER_EXTRA_PADDING = 4;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Tree</code> or a <code>TreeItem</code>)
+ * and a style value describing its behavior and appearance.
+ * The item is added to the end of the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a tree control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Tree parent, int style) {
+    this (checkNull (parent), null, style, -1, true);
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Tree</code> or a <code>TreeItem</code>),
+ * a style value describing its behavior and appearance, and the index
+ * at which to place it in the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a tree control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ * @param index the zero-relative index to store the receiver in its parent
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the parent (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (Tree parent, int style, int index) {
+    this (checkNull (parent), null, style, checkIndex (index), true);
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Tree</code> or a <code>TreeItem</code>)
+ * and a style value describing its behavior and appearance.
+ * The item is added to the end of the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parentItem a tree control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (TreeItem parentItem, int style) {
+    this (checkNull (parentItem).parent, cast(GtkTreeIter*)parentItem.handle, style, -1, true);
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Tree</code> or a <code>TreeItem</code>),
+ * a style value describing its behavior and appearance, and the index
+ * at which to place it in the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parentItem a tree control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ * @param index the zero-relative index to store the receiver in its parent
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the parent (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public this (TreeItem parentItem, int style, int index) {
+    this (checkNull (parentItem).parent, cast(GtkTreeIter*)parentItem.handle, style, checkIndex (index), true);
+}
+
+this (Tree parent, GtkTreeIter* parentIter, int style, int index, bool create) {
+    super (parent, style);
+    this.parent = parent;
+    if (create) {
+        parent.createItem (this, parentIter, index);
+    } else {
+        handle = cast(GtkWidget*)OS.g_malloc (GtkTreeIter.sizeof);
+        OS.gtk_tree_model_iter_nth_child (parent.modelHandle, handle, parentIter, index);
+    }
+}
+
+static int checkIndex (int index) {
+    if (index < 0) SWT.error (SWT.ERROR_INVALID_RANGE);
+    return index;
+}
+
+static TreeItem checkNull (TreeItem item) {
+    if (item is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    return item;
+}
+
+static Tree checkNull (Tree control) {
+    if (control is null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+    return control;
+}
+
+protected override void checkSubclass () {
+    if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+Color _getBackground () {
+    void* ptr;
+    OS.gtk_tree_model_get1 (parent.modelHandle, handle, Tree.BACKGROUND_COLUMN, &ptr);
+    if (ptr is null) return parent.getBackground ();
+    GdkColor* gdkColor = new GdkColor ();
+    *gdkColor = *cast(GdkColor*) ptr;
+    return Color.gtk_new (display, gdkColor);
+}
+
+Color _getBackground (int index) {
+    int count = Math.max (1, parent.columnCount);
+    if (0 > index || index > count - 1) return _getBackground ();
+    void* ptr;
+    int modelIndex = parent.columnCount is 0 ? Tree.FIRST_COLUMN : parent.columns [index].modelIndex;
+    OS.gtk_tree_model_get1 (parent.modelHandle, handle, modelIndex + Tree.CELL_BACKGROUND, &ptr);
+    if (ptr is null) return _getBackground ();
+    GdkColor* gdkColor = new GdkColor ();
+    *gdkColor = *cast(GdkColor*) ptr;
+    return Color.gtk_new (display, gdkColor);
+}
+
+bool _getChecked () {
+    void* ptr;
+    OS.gtk_tree_model_get1 (parent.modelHandle, handle, Tree.CHECKED_COLUMN, &ptr);
+    return ptr !is null;
+}
+
+Color _getForeground () {
+    void* ptr;
+    OS.gtk_tree_model_get1 (parent.modelHandle, handle, Tree.FOREGROUND_COLUMN, &ptr);
+    if (ptr is null) return parent.getForeground ();
+    GdkColor* gdkColor = new GdkColor ();
+    *gdkColor = *cast(GdkColor*) ptr;
+    return Color.gtk_new (display, gdkColor);
+}
+
+Color _getForeground (int index) {
+    int count = Math.max (1, parent.columnCount);
+    if (0 > index || index > count - 1) return _getForeground ();
+    void* ptr;
+    int modelIndex =  parent.columnCount is 0 ? Tree.FIRST_COLUMN : parent.columns [index].modelIndex;
+    OS.gtk_tree_model_get1 (parent.modelHandle, handle, modelIndex + Tree.CELL_FOREGROUND, &ptr);
+    if (ptr is null) return _getForeground ();
+    GdkColor* gdkColor = new GdkColor ();
+    *gdkColor = *cast(GdkColor*) ptr;
+    return Color.gtk_new (display, gdkColor);
+}
+
+Image _getImage (int index) {
+    int count = Math.max (1, parent.getColumnCount ());
+    if (0 > index || index > count - 1) return null;
+    void* ptr;
+    int modelIndex = parent.columnCount is 0 ? Tree.FIRST_COLUMN : parent.columns [index].modelIndex;
+    OS.gtk_tree_model_get1 (parent.modelHandle, handle, modelIndex + Tree.CELL_PIXBUF, &ptr);
+    if (ptr is null) return null;
+    ImageList imageList = parent.imageList;
+    int imageIndex = imageList.indexOf (ptr);
+    if (imageIndex is -1) return null;
+    return imageList.get (imageIndex);
+}
+
+String _getText (int index) {
+    int count = Math.max (1, parent.getColumnCount ());
+    if (0 > index || index > count - 1) return "";
+    void* ptr;
+    int modelIndex = parent.columnCount is 0 ? Tree.FIRST_COLUMN : parent.columns [index].modelIndex;
+    OS.gtk_tree_model_get1 (parent.modelHandle, handle, modelIndex + Tree.CELL_TEXT, &ptr);
+    if (ptr is null) return ""; //$NON-NLS-1$
+    char[] buffer = fromStringz( cast(char*)ptr).dup;
+    OS.g_free (ptr);
+    return buffer;
+}
+
+void clear () {
+    if (parent.currentItem is this) return;
+    if (cached || (parent.style & SWT.VIRTUAL) is 0) {
+        int columnCount = OS.gtk_tree_model_get_n_columns (parent.modelHandle);
+        for (int i=Tree.CHECKED_COLUMN; i<columnCount; i++) {
+            OS.gtk_tree_store_set1(parent.modelHandle, cast(GtkTreeIter*)handle, i, null);
+        }
+        /*
+        * Bug in GTK.  When using fixed-height-mode,
+        * row changes do not cause the row to be repainted.  The fix is to
+        * invalidate the row when it is cleared.
+        */
+        if ((parent.style & SWT.VIRTUAL) !is 0) {
+            if (OS.GTK_VERSION >= OS.buildVERSION (2, 3, 2) && OS.GTK_VERSION < OS.buildVERSION (2, 6, 3)) {
+                redraw ();
+            }
+        }
+    }
+    cached = false;
+    font = null;
+    cellFont = null;
+}
+
+/**
+ * Clears the item at the given zero-relative index in the receiver.
+ * The text, icon and other attributes of the item are set to the default
+ * value.  If the tree was created with the <code>SWT.VIRTUAL</code> style,
+ * these attributes are requested again as needed.
+ *
+ * @param index the index of the item to clear
+ * @param all <code>true</code> if all child items of the indexed item should be
+ * cleared recursively, and <code>false</code> otherwise
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT#VIRTUAL
+ * @see SWT#SetData
+ *
+ * @since 3.2
+ */
+public void clear (int index, bool all) {
+    checkWidget ();
+    parent.clear (cast(GtkTreeIter*)handle, index, all);
+}
+
+/**
+ * Clears all the items in the receiver. The text, icon and other
+ * attributes of the items are set to their default values. If the
+ * tree was created with the <code>SWT.VIRTUAL</code> style, these
+ * attributes are requested again as needed.
+ *
+ * @param all <code>true</code> if all child items should be cleared
+ * recursively, and <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT#VIRTUAL
+ * @see SWT#SetData
+ *
+ * @since 3.2
+ */
+public void clearAll (bool all) {
+    checkWidget ();
+    parent.clearAll (all, cast(GtkTreeIter*)handle);
+}
+
+override void destroyWidget () {
+    parent.releaseItem (this, false);
+    parent.destroyItem (this);
+    releaseHandle ();
+}
+
+/**
+ * Returns the receiver's background color.
+ *
+ * @return the background color
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ *
+ */
+public Color getBackground () {
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    return _getBackground ();
+}
+
+/**
+ * Returns the background color at the given column index in the receiver.
+ *
+ * @param index the column index
+ * @return the background color
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public Color getBackground (int index) {
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    return _getBackground (index);
+}
+
+/**
+ * Returns a rectangle describing the receiver's size and location
+ * relative to its parent at a column in the tree.
+ *
+ * @param index the index that specifies the column
+ * @return the receiver's bounding column rectangle
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public Rectangle getBounds (int index) {
+    // TODO fully test on early and later versions of GTK
+    checkWidget();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    auto parentHandle = parent.handle;
+    GtkTreeViewColumn* column;
+    if (index >= 0 && index < parent.columnCount) {
+        column = cast(GtkTreeViewColumn*)parent.columns [index].handle;
+    } else {
+        column = OS.gtk_tree_view_get_column (parentHandle, index);
+    }
+    if (column is null) return new Rectangle (0, 0, 0, 0);
+    auto path = OS.gtk_tree_model_get_path (parent.modelHandle, handle);
+    OS.gtk_widget_realize (parentHandle);
+    GdkRectangle rect;
+    OS.gtk_tree_view_get_cell_area (parentHandle, path, column, &rect);
+    if ((parent.getStyle () & SWT.MIRRORED) !is 0) rect.x = parent.getClientWidth () - rect.width - rect.x;
+
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 8, 18) && OS.gtk_tree_view_get_expander_column (parentHandle) is column) {
+        int buffer;
+        OS.gtk_widget_style_get1 (parentHandle, OS.expander_size.ptr, &buffer);
+        rect.x += buffer + TreeItem.EXPANDER_EXTRA_PADDING;
+        rect.width -= buffer + TreeItem.EXPANDER_EXTRA_PADDING;
+        OS.gtk_widget_style_get1 (parentHandle, OS.horizontal_separator.ptr, &buffer);
+        rect.x += buffer;
+        //rect.width -= buffer [0]; // TODO Is this required for some versions?
+    }
+    /*
+    * Bug in GTK. In GTK 2.8.x, the cell area is left aligned even
+    * when the widget is mirrored. The fix is to sum up the indentation
+    * of the expanders.
+    */
+    if ((parent.getStyle () & SWT.MIRRORED) !is 0 && (OS.GTK_VERSION < OS.buildVERSION (2, 10, 0))) {
+        int depth = OS.gtk_tree_path_get_depth (path);
+        int  expanderSize;
+        OS.gtk_widget_style_get1 (parentHandle, OS.expander_size.ptr, &expanderSize);
+        rect.x += depth * (expanderSize + TreeItem.EXPANDER_EXTRA_PADDING);
+    }
+    OS.gtk_tree_path_free (path);
+
+    if (index is 0 && (parent.style & SWT.CHECK) !is 0) {
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 1, 3)) {
+            int  x, w;
+            OS.gtk_tree_view_column_cell_get_position (column, parent.checkRenderer, &x, &w);
+            rect.x += x + w;
+            rect.width -= x + w;
+        } else {
+            int w;
+            OS.gtk_cell_renderer_get_size (parent.checkRenderer, parentHandle, null, null, null, &w, null);
+            int buffer;
+            OS.gtk_widget_style_get1 (parentHandle, OS.horizontal_separator.ptr, &buffer);
+            rect.x += w  + buffer;
+            rect.width -= w  + buffer;
+        }
+    }
+    int width = OS.gtk_tree_view_column_get_visible (column) ? rect.width + 1 : 0;
+    return new Rectangle (rect.x, rect.y, width, rect.height + 1);
+}
+
+/**
+ * Returns a rectangle describing the receiver's size and location
+ * relative to its parent.
+ *
+ * @return the receiver's bounding rectangle
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Rectangle getBounds () {
+    // TODO fully test on early and later versions of GTK
+    // shifted a bit too far right on later versions of GTK - however, old Tree also had this problem
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    auto parentHandle = parent.handle;
+    auto column = OS.gtk_tree_view_get_column (parentHandle, 0);
+    if (column is null) return new Rectangle (0, 0, 0, 0);
+    auto textRenderer = parent.getTextRenderer (column);
+    auto pixbufRenderer = parent.getPixbufRenderer (column);
+    if (textRenderer is null || pixbufRenderer is null)  return new Rectangle (0, 0, 0, 0);
+
+    auto path = OS.gtk_tree_model_get_path (parent.modelHandle, handle);
+    OS.gtk_widget_realize (parentHandle);
+
+    bool isExpander = OS.gtk_tree_model_iter_n_children (parent.modelHandle, handle) > 0;
+    bool isExpanded = cast(bool)OS.gtk_tree_view_row_expanded (parentHandle, path);
+    OS.gtk_tree_view_column_cell_set_cell_data (column, parent.modelHandle, handle, isExpander, isExpanded);
+
+    GdkRectangle rect;
+    OS.gtk_tree_view_get_cell_area (parentHandle, path, column, &rect);
+    if ((parent.getStyle () & SWT.MIRRORED) !is 0) rect.x = parent.getClientWidth () - rect.width - rect.x;
+    int right = rect.x + rect.width;
+
+    int x, w;
+    parent.ignoreSize = true;
+    OS.gtk_cell_renderer_get_size (textRenderer, parentHandle, null, null, null, &w, null);
+    parent.ignoreSize = false;
+    rect.width = w;
+    int buffer;
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 8, 18) && OS.gtk_tree_view_get_expander_column (parentHandle) is column) {
+        OS.gtk_widget_style_get1 (parentHandle, OS.expander_size.ptr, &buffer);
+        rect.x += buffer + TreeItem.EXPANDER_EXTRA_PADDING;
+    }
+    /*
+    * Bug in GTK. In GTK 2.8.x, the cell area is left aligned even
+    * when the widget is mirrored. The fix is to sum up the indentation
+    * of the expanders.
+    */
+    if ((parent.getStyle () & SWT.MIRRORED) !is 0 && (OS.GTK_VERSION < OS.buildVERSION (2, 10, 0))) {
+        int depth = OS.gtk_tree_path_get_depth (path);
+        int expanderSize;
+        OS.gtk_widget_style_get1 (parentHandle, OS.expander_size.ptr, &expanderSize);
+        rect.x += depth * (expanderSize + TreeItem.EXPANDER_EXTRA_PADDING);
+    }
+    OS.gtk_tree_path_free (path);
+
+    OS.gtk_widget_style_get1 (parentHandle, OS.horizontal_separator.ptr, &buffer);
+    int horizontalSeparator = buffer;
+    rect.x += horizontalSeparator;
+
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 1, 3)) {
+        OS.gtk_tree_view_column_cell_get_position (column, textRenderer, &x, null);
+        rect.x += x;
+    } else {
+        if ((parent.style & SWT.CHECK) !is 0) {
+            OS.gtk_cell_renderer_get_size (parent.checkRenderer, parentHandle, null, null, null, &w, null);
+            rect.x += w + horizontalSeparator;
+        }
+        OS.gtk_cell_renderer_get_size (pixbufRenderer, parentHandle, null, null, null, &w, null);
+        rect.x += w + horizontalSeparator;
+    }
+    if (parent.columnCount > 0) {
+        if (rect.x + rect.width > right) {
+            rect.width = Math.max (0, right - rect.x);
+        }
+    }
+    int width = OS.gtk_tree_view_column_get_visible (column) ? rect.width + 1 : 0;
+    return new Rectangle (rect.x, rect.y, width, rect.height + 1);
+}
+
+/**
+ * Returns <code>true</code> if the receiver is checked,
+ * and false otherwise.  When the parent does not have
+ * the <code>CHECK style, return false.
+ * <p>
+ *
+ * @return the checked state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool getChecked () {
+    checkWidget();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    if ((parent.style & SWT.CHECK) is 0) return false;
+    return _getChecked ();
+}
+
+/**
+ * Returns <code>true</code> if the receiver is expanded,
+ * and false otherwise.
+ * <p>
+ *
+ * @return the expanded state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool getExpanded () {
+    checkWidget();
+    auto path = OS.gtk_tree_model_get_path (parent.modelHandle, handle);
+    bool answer = cast(bool)OS.gtk_tree_view_row_expanded (parent.handle, path);
+    OS.gtk_tree_path_free (path);
+    return answer;
+}
+
+/**
+ * Returns the font that the receiver will use to paint textual information for this item.
+ *
+ * @return the receiver's font
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public Font getFont () {
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    return font !is null ? font : parent.getFont ();
+}
+
+/**
+ * Returns the font that the receiver will use to paint textual information
+ * for the specified cell in this item.
+ *
+ * @param index the column index
+ * @return the receiver's font
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public Font getFont (int index) {
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    int count = Math.max (1, parent.columnCount);
+    if (0 > index || index > count - 1) return getFont ();
+    if (cellFont is null || cellFont [index] is null) return getFont ();
+    return cellFont [index];
+}
+
+
+/**
+ * Returns the foreground color that the receiver will use to draw.
+ *
+ * @return the receiver's foreground color
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ *
+ */
+public Color getForeground () {
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    return _getForeground ();
+}
+
+/**
+ *
+ * Returns the foreground color at the given column index in the receiver.
+ *
+ * @param index the column index
+ * @return the foreground color
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public Color getForeground (int index) {
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    return _getForeground (index);
+}
+
+/**
+ * Returns <code>true</code> if the receiver is grayed,
+ * and false otherwise. When the parent does not have
+ * the <code>CHECK style, return false.
+ * <p>
+ *
+ * @return the grayed state of the checkbox
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public bool getGrayed () {
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    if ((parent.style & SWT.CHECK) is 0) return false;
+    return grayed;
+}
+
+public override Image getImage () {
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    return getImage (0);
+}
+
+/**
+ * Returns the image stored at the given column index in the receiver,
+ * or null if the image has not been set or if the column does not exist.
+ *
+ * @param index the column index
+ * @return the image stored at the given column index in the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public Image getImage (int index) {
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    return _getImage (index);
+}
+
+/**
+ * Returns a rectangle describing the size and location
+ * relative to its parent of an image at a column in the
+ * tree.
+ *
+ * @param index the index that specifies the column
+ * @return the receiver's bounding image rectangle
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public Rectangle getImageBounds (int index) {
+    // TODO fully test on early and later versions of GTK
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    auto parentHandle = parent.handle;
+    GtkTreeViewColumn* column;
+    if (index >= 0 && index < parent.getColumnCount ()) {
+        column = cast(GtkTreeViewColumn*)parent.columns [index].handle;
+    } else {
+        column = OS.gtk_tree_view_get_column (parentHandle, index);
+    }
+    if (column is null) return new Rectangle (0, 0, 0, 0);
+    auto pixbufRenderer = parent.getPixbufRenderer (column);
+    if (pixbufRenderer is null)  return new Rectangle (0, 0, 0, 0);
+    GdkRectangle rect;
+    auto path = OS.gtk_tree_model_get_path (parent.modelHandle, handle);
+    OS.gtk_widget_realize (parentHandle);
+    OS.gtk_tree_view_get_cell_area (parentHandle, path, column, &rect);
+    if ((parent.getStyle () & SWT.MIRRORED) !is 0) rect.x = parent.getClientWidth () - rect.width - rect.x;
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 8, 18) && OS.gtk_tree_view_get_expander_column (parentHandle) is column) {
+        int buffer;
+        OS.gtk_widget_style_get1 (parentHandle, OS.expander_size.ptr, &buffer);
+        rect.x += buffer + TreeItem.EXPANDER_EXTRA_PADDING;
+        rect.width -= buffer + TreeItem.EXPANDER_EXTRA_PADDING;
+        //OS.gtk_widget_style_get (parentHandle, OS.horizontal_separator, buffer, 0);
+        //int horizontalSeparator = buffer[0];
+        //rect.x += horizontalSeparator;
+    }
+    /*
+    * Bug in GTK. In GTK 2.8.x, the cell area is left aligned even
+    * when the widget is mirrored. The fix is to sum up the indentation
+    * of the expanders.
+    */
+    if ((parent.getStyle () & SWT.MIRRORED) !is 0 && (OS.GTK_VERSION < OS.buildVERSION (2, 10, 0))) {
+        int depth = OS.gtk_tree_path_get_depth (path);
+        int expanderSize;
+        OS.gtk_widget_style_get1 (parentHandle, OS.expander_size.ptr, &expanderSize);
+        rect.x += depth * (expanderSize + TreeItem.EXPANDER_EXTRA_PADDING);
+    }
+    OS.gtk_tree_path_free (path);
+
+    /*
+    * The OS call gtk_cell_renderer_get_size() provides the width of image to be drawn
+    * by the cell renderer.  If there is no image in the cell, the width is zero.  If the table contains
+    * images of varying widths, gtk_cell_renderer_get_size() will return the width of the image,
+    * not the width of the area in which the image is drawn.
+    * New API was added in GTK 2.1.3 for determining the full width of the renderer area.
+    * For earlier versions of GTK, the result is only correct if all rows have images of the same
+    * width.
+    */
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 1, 3)) {
+        int x, w;
+        OS.gtk_tree_view_column_cell_get_position (column, pixbufRenderer, &x, &w);
+        rect.x += x;
+        rect.width = w;
+    } else {
+        int w;
+        OS.gtk_tree_view_column_cell_set_cell_data (column, parent.modelHandle, handle, false, false);
+        OS.gtk_cell_renderer_get_size (pixbufRenderer, parentHandle, null, null, null, &w, null);
+        rect.width = w;
+    }
+    int width = OS.gtk_tree_view_column_get_visible (column) ? rect.width : 0;
+    return new Rectangle (rect.x, rect.y, width, rect.height + 1);
+}
+
+/**
+ * Returns the number of items contained in the receiver
+ * that are direct item children of the receiver.
+ *
+ * @return the number of items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemCount () {
+    checkWidget();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    return OS.gtk_tree_model_iter_n_children (parent.modelHandle, handle);
+}
+
+/**
+ * Returns the item at the given, zero-relative index in the
+ * receiver. Throws an exception if the index is out of range.
+ *
+ * @param index the index of the item to return
+ * @return the item at the given index
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public TreeItem getItem (int index) {
+    checkWidget();
+    if (index < 0) error (SWT.ERROR_INVALID_RANGE);
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    int itemCount = OS.gtk_tree_model_iter_n_children (parent.modelHandle, handle);
+    if (index >= itemCount)  error (SWT.ERROR_INVALID_RANGE);
+    return  parent._getItem (cast(GtkTreeIter*)handle, index);
+}
+
+/**
+ * Returns a (possibly empty) array of <code>TreeItem</code>s which
+ * are the direct item children of the receiver.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the receiver's items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TreeItem [] getItems () {
+    checkWidget();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    return parent.getItems (cast(GtkTreeIter*)handle);
+}
+
+override String getNameText () {
+    if ((parent.style & SWT.VIRTUAL) !is 0) {
+        if (!cached) return "*virtual*"; //$NON-NLS-1$
+    }
+    return super.getNameText ();
+}
+
+/**
+ * Returns the receiver's parent, which must be a <code>Tree</code>.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Tree getParent () {
+    checkWidget ();
+    return parent;
+}
+
+/**
+ * Returns the receiver's parent item, which must be a
+ * <code>TreeItem</code> or null when the receiver is a
+ * root.
+ *
+ * @return the receiver's parent item
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TreeItem getParentItem () {
+    checkWidget();
+    auto path = OS.gtk_tree_model_get_path (parent.modelHandle, handle);
+    TreeItem item = null;
+    int depth = OS.gtk_tree_path_get_depth (path);
+    if (depth > 1) {
+        OS.gtk_tree_path_up (path);
+        GtkTreeIter iter;
+        if (OS.gtk_tree_model_get_iter (parent.modelHandle, &iter, path)) {
+            item = parent._getItem (&iter);
+        }
+    }
+    OS.gtk_tree_path_free (path);
+    return item;
+}
+
+public override String getText () {
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    return getText (0);
+}
+
+/**
+ * Returns the text stored at the given column index in the receiver,
+ * or empty string if the text has not been set.
+ *
+ * @param index the column index
+ * @return the text stored at the given column index in the receiver
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public String getText (int index) {
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    return _getText (index);
+}
+
+/**
+ * Returns a rectangle describing the size and location
+ * relative to its parent of the text at a column in the
+ * tree.
+ *
+ * @param index the index that specifies the column
+ * @return the receiver's bounding text rectangle
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.3
+ */
+public Rectangle getTextBounds (int index) {
+    checkWidget ();
+    if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
+    int count = Math.max (1, parent.getColumnCount ());
+    if (0 > index || index > count - 1) return new Rectangle (0, 0, 0, 0);
+    // TODO fully test on early and later versions of GTK
+    // shifted a bit too far right on later versions of GTK - however, old Tree also had this problem
+    auto parentHandle = parent.handle;
+    GtkTreeViewColumn* column;
+    if (index >= 0 && index < parent.columnCount) {
+        column = cast(GtkTreeViewColumn*)parent.columns [index].handle;
+    } else {
+        column = OS.gtk_tree_view_get_column (parentHandle, index);
+    }
+    if (column is null) return new Rectangle (0, 0, 0, 0);
+    auto textRenderer = parent.getTextRenderer (column);
+    auto pixbufRenderer = parent.getPixbufRenderer (column);
+    if (textRenderer is null || pixbufRenderer is null)  return new Rectangle (0, 0, 0, 0);
+
+    auto path = OS.gtk_tree_model_get_path (parent.modelHandle, handle);
+    OS.gtk_widget_realize (parentHandle);
+
+    bool isExpander = OS.gtk_tree_model_iter_n_children (parent.modelHandle, handle) > 0;
+    bool isExpanded = cast(bool)OS.gtk_tree_view_row_expanded (parentHandle, path);
+    OS.gtk_tree_view_column_cell_set_cell_data (column, parent.modelHandle, handle, isExpander, isExpanded);
+
+    GdkRectangle rect;
+    OS.gtk_tree_view_get_cell_area (parentHandle, path, column, &rect);
+    if ((parent.getStyle () & SWT.MIRRORED) !is 0) rect.x = parent.getClientWidth () - rect.width - rect.x;
+    int right = rect.x + rect.width;
+
+    int x, w;
+    parent.ignoreSize = true;
+    OS.gtk_cell_renderer_get_size (textRenderer, parentHandle, null, null, null, &w, null);
+    parent.ignoreSize = false;
+    int buffer;
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 8, 18) && OS.gtk_tree_view_get_expander_column (parentHandle) is column) {
+        OS.gtk_widget_style_get1 (parentHandle, OS.expander_size.ptr, &buffer);
+        rect.x += buffer + TreeItem.EXPANDER_EXTRA_PADDING;
+    }
+    /*
+    * Bug in GTK. In GTK 2.8.x, the cell area is left aligned even
+    * when the widget is mirrored. The fix is to sum up the indentation
+    * of the expanders.
+    */
+    if ((parent.getStyle () & SWT.MIRRORED) !is 0 && (OS.GTK_VERSION < OS.buildVERSION (2, 10, 0))) {
+        int depth = OS.gtk_tree_path_get_depth (path);
+        int expanderSize;
+        OS.gtk_widget_style_get1 (parentHandle, OS.expander_size.ptr, &expanderSize);
+        rect.x += depth * (expanderSize + TreeItem.EXPANDER_EXTRA_PADDING);
+    }
+    OS.gtk_tree_path_free (path);
+
+    OS.gtk_widget_style_get1 (parentHandle, OS.horizontal_separator.ptr, &buffer);
+    int horizontalSeparator = buffer;
+    rect.x += horizontalSeparator;
+    if (OS.GTK_VERSION >= OS.buildVERSION (2, 1, 3)) {
+        OS.gtk_tree_view_column_cell_get_position (column, textRenderer, &x, null);
+        rect.x += x;
+    } else {
+        if ((parent.style & SWT.CHECK) !is 0) {
+            OS.gtk_cell_renderer_get_size (parent.checkRenderer, parentHandle, null, null, null, &w, null);
+            rect.x += w + horizontalSeparator;
+        }
+        OS.gtk_cell_renderer_get_size (pixbufRenderer, parentHandle, null, null, null, &w, null);
+        rect.x += w + horizontalSeparator;
+    }
+    if (parent.columnCount > 0) {
+        if (rect.x + rect.width > right) {
+            rect.width = Math.max (0, right - rect.x);
+        }
+    }
+    int width = OS.gtk_tree_view_column_get_visible (column) ? rect.width + 1 : 0;
+    return new Rectangle (rect.x, rect.y, width, rect.height + 1);
+}
+
+/**
+ * Searches the receiver's list starting at the first item
+ * (index 0) until an item is found that is equal to the
+ * argument, and returns the index of that item. If no item
+ * is found, returns -1.
+ *
+ * @param item the search item
+ * @return the index of the item
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public int indexOf (TreeItem item) {
+    checkWidget();
+    if (item is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (item.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
+    int index = -1;
+    bool isParent = false;
+    auto currentPath = OS.gtk_tree_model_get_path (parent.modelHandle, handle);
+    auto parentPath = OS.gtk_tree_model_get_path (parent.modelHandle, item.handle);
+    int depth = OS.gtk_tree_path_get_depth (parentPath);
+    if (depth > 1 && OS.gtk_tree_path_up(parentPath)) {
+        if (OS.gtk_tree_path_compare(currentPath, parentPath) is 0) isParent = true;
+    }
+    OS.gtk_tree_path_free (currentPath);
+    OS.gtk_tree_path_free (parentPath);
+    if (!isParent) return index;
+    auto path = OS.gtk_tree_model_get_path (parent.modelHandle, item.handle);
+    if (depth > 1) {
+        auto indices = OS.gtk_tree_path_get_indices (path);
+        if (indices !is null) {
+            int[] temp = indices[ 0 .. depth];
+            index = temp[temp.length - 1];
+        }
+    }
+    OS.gtk_tree_path_free (path);
+    return index;
+}
+
+void redraw () {
+    auto parentHandle = parent.handle;
+    if ((OS.GTK_WIDGET_FLAGS (parentHandle) & OS.GTK_REALIZED) !is 0) {
+        auto path = OS.gtk_tree_model_get_path (parent.modelHandle, handle);
+        GdkRectangle rect;
+        OS.gtk_tree_view_get_cell_area (parentHandle, path, null, &rect);
+        OS.gtk_tree_path_free (path);
+        auto window = OS.gtk_tree_view_get_bin_window (parentHandle);
+        rect.x = 0;
+        int w, h;
+        OS.gdk_drawable_get_size (window, &w, &h);
+        rect.width = w;
+        OS.gdk_window_invalidate_rect (window, &rect, false);
+    }
+}
+
+override void releaseChildren (bool destroy) {
+    if (destroy) {
+        parent.releaseItems (cast(GtkTreeIter*)handle);
+    }
+    super.releaseChildren (destroy);
+}
+
+override void releaseHandle () {
+    if (handle !is null) OS.g_free (handle);
+    handle = null;
+    super.releaseHandle ();
+    parent = null;
+}
+
+override void releaseWidget () {
+    super.releaseWidget ();
+    font = null;
+    cellFont = null;
+}
+
+/**
+ * Removes all of the items from the receiver.
+ * <p>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void removeAll () {
+    checkWidget ();
+    int length = OS.gtk_tree_model_iter_n_children (parent.modelHandle, handle);
+    if (length is 0) return;
+    GtkTreeIter iter;
+    int index;
+    while (OS.gtk_tree_model_iter_children (parent.modelHandle, &iter, handle)) {
+        OS.gtk_tree_model_get1 (parent.modelHandle, &iter, Tree.ID_COLUMN, cast(void**)&index);
+        if (index !is -1) {
+            TreeItem item = parent.items [index];
+            if (item !is null && !item.isDisposed ()) {
+                item.dispose ();
+            }
+        }
+    }
+}
+
+/**
+ * Sets the receiver's background color to the color specified
+ * by the argument, or to the default system color for the item
+ * if the argument is null.
+ *
+ * @param color the new color (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ *
+ */
+public void setBackground (Color color) {
+    checkWidget ();
+    if (color !is null && color.isDisposed ()) {
+        SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (_getBackground ().opEquals (color)) return;
+    GdkColor* gdkColor = color !is null ? color.handle : null;
+    OS.gtk_tree_store_set1 (parent.modelHandle, cast(GtkTreeIter*)handle, Tree.BACKGROUND_COLUMN, gdkColor);
+    /*
+    * Bug in GTK.  When using fixed-height-mode,
+    * row changes do not cause the row to be repainted.  The fix is to
+    * invalidate the row when it is cleared.
+    */
+    if ((parent.style & SWT.VIRTUAL) !is 0) {
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 3, 2) && OS.GTK_VERSION < OS.buildVERSION (2, 6, 3)) {
+            redraw ();
+        }
+    }
+    cached = true;
+}
+
+/**
+ * Sets the background color at the given column index in the receiver
+ * to the color specified by the argument, or to the default system color for the item
+ * if the argument is null.
+ *
+ * @param index the column index
+ * @param color the new color (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ *
+ */
+public void setBackground (int index, Color color) {
+    checkWidget ();
+    if (color !is null && color.isDisposed ()) {
+        SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (_getBackground (index).opEquals (color)) return;
+    int count = Math.max (1, parent.getColumnCount ());
+    if (0 > index || index > count - 1) return;
+    int modelIndex = parent.columnCount is 0 ? Tree.FIRST_COLUMN : parent.columns [index].modelIndex;
+    GdkColor* gdkColor = color !is null ? color.handle : null;
+    OS.gtk_tree_store_set1 (parent.modelHandle, cast(GtkTreeIter*)handle, modelIndex + Tree.CELL_BACKGROUND, gdkColor);
+    /*
+    * Bug in GTK.  When using fixed-height-mode,
+    * row changes do not cause the row to be repainted.  The fix is to
+    * invalidate the row when it is cleared.
+    */
+    if ((parent.style & SWT.VIRTUAL) !is 0) {
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 3, 2) && OS.GTK_VERSION < OS.buildVERSION (2, 6, 3)) {
+            redraw ();
+        }
+    }
+    cached = true;
+
+    if (color !is null) {
+        bool customDraw = (parent.columnCount is 0)  ? parent.firstCustomDraw : parent.columns [index].customDraw;
+        if (!customDraw) {
+            if ((parent.style & SWT.VIRTUAL) is 0) {
+                auto parentHandle = parent.handle;
+                GtkTreeViewColumn* column;
+                if (parent.columnCount > 0) {
+                    column = cast(GtkTreeViewColumn*)parent.columns [index].handle;
+                } else {
+                    column = OS.gtk_tree_view_get_column (parentHandle, index);
+                }
+                if (column is null) return;
+                auto textRenderer = parent.getTextRenderer (column);
+                auto imageRenderer = parent.getPixbufRenderer (column);
+                display.doCellDataProc( parentHandle, cast(GtkTreeViewColumn*)column, cast(GtkCellRenderer*)textRenderer );
+                display.doCellDataProc( parentHandle, cast(GtkTreeViewColumn*)column, cast(GtkCellRenderer*)imageRenderer );
+            }
+            if (parent.columnCount is 0) {
+                parent.firstCustomDraw = true;
+            } else {
+                parent.columns [index].customDraw = true;
+            }
+        }
+    }
+}
+
+/**
+ * Sets the checked state of the receiver.
+ * <p>
+ *
+ * @param checked the new checked state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setChecked (bool checked) {
+    checkWidget();
+    if ((parent.style & SWT.CHECK) is 0) return;
+    if (_getChecked () is checked) return;
+    OS.gtk_tree_store_set1 (parent.modelHandle, cast(GtkTreeIter*)handle, Tree.CHECKED_COLUMN, cast(void*)cast(int)checked);
+    /*
+    * GTK+'s "inconsistent" state does not match SWT's concept of grayed.  To
+    * show checked+grayed differently from unchecked+grayed, we must toggle the
+    * grayed state on check and uncheck.
+    */
+    OS.gtk_tree_store_set1 (parent.modelHandle, cast(GtkTreeIter*)handle, Tree.GRAYED_COLUMN, cast(void*)cast(int)( !checked ? false : grayed));
+    cached = true;
+}
+
+/**
+ * Sets the expanded state of the receiver.
+ * <p>
+ *
+ * @param expanded the new expanded state
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setExpanded (bool expanded) {
+    checkWidget();
+    auto path = OS.gtk_tree_model_get_path (parent.modelHandle, handle);
+    if (expanded) {
+        OS.g_signal_handlers_block_matched (parent.handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udTEST_EXPAND_ROW);
+        OS.gtk_tree_view_expand_row (parent.handle, path, false);
+        OS.g_signal_handlers_unblock_matched (parent.handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udTEST_EXPAND_ROW);
+    } else {
+        OS.g_signal_handlers_block_matched (parent.handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udTEST_COLLAPSE_ROW);
+        OS.gtk_widget_realize (parent.handle);
+        OS.gtk_tree_view_collapse_row (parent.handle, path);
+        OS.g_signal_handlers_unblock_matched (parent.handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udTEST_COLLAPSE_ROW);
+    }
+    OS.gtk_tree_path_free (path);
+    cached = true;
+}
+
+
+/**
+ * Sets the font that the receiver will use to paint textual information
+ * for this item to the font specified by the argument, or to the default font
+ * for that kind of control if the argument is null.
+ *
+ * @param font the new font (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setFont (Font font){
+    checkWidget ();
+    if (font !is null && font.isDisposed ()) {
+        SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+    }
+    Font oldFont = this.font;
+    if (oldFont is font) return;
+    this.font = font;
+    if (oldFont !is null && oldFont.opEquals (font)) return;
+    void* fontHandle = font !is null ? font.handle : null;
+    OS.gtk_tree_store_set1 (parent.modelHandle, cast(GtkTreeIter*)handle, Tree.FONT_COLUMN, fontHandle);
+    /*
+    * Bug in GTK.  When using fixed-height-mode,
+    * row changes do not cause the row to be repainted.  The fix is to
+    * invalidate the row when it is cleared.
+    */
+    if ((parent.style & SWT.VIRTUAL) !is 0) {
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 3, 2) && OS.GTK_VERSION < OS.buildVERSION (2, 6, 3)) {
+            redraw ();
+        }
+    }
+    cached = true;
+}
+
+/**
+ * Sets the font that the receiver will use to paint textual information
+ * for the specified cell in this item to the font specified by the
+ * argument, or to the default font for that kind of control if the
+ * argument is null.
+ *
+ * @param index the column index
+ * @param font the new font (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void setFont (int index, Font font) {
+    checkWidget ();
+    if (font !is null && font.isDisposed ()) {
+        SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+    }
+    int count = Math.max (1, parent.getColumnCount ());
+    if (0 > index || index > count - 1) return;
+    if (cellFont is null) {
+        if (font is null) return;
+        cellFont = new Font [count];
+    }
+    Font oldFont = cellFont [index];
+    if (oldFont is font) return;
+    cellFont [index] = font;
+    if (oldFont !is null && oldFont.opEquals (font)) return;
+
+    int modelIndex = parent.columnCount is 0 ? Tree.FIRST_COLUMN : parent.columns [index].modelIndex;
+    auto fontHandle  = font !is null ? font.handle : null;
+    OS.gtk_tree_store_set1 (parent.modelHandle, cast(GtkTreeIter*)handle, modelIndex + Tree.CELL_FONT, fontHandle);
+    /*
+    * Bug in GTK.  When using fixed-height-mode,
+    * row changes do not cause the row to be repainted.  The fix is to
+    * invalidate the row when it is cleared.
+    */
+    if ((parent.style & SWT.VIRTUAL) !is 0) {
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 3, 2) && OS.GTK_VERSION < OS.buildVERSION (2, 6, 3)) {
+            redraw ();
+        }
+    }
+    cached = true;
+
+    if (font !is null) {
+        bool customDraw = (parent.columnCount is 0)  ? parent.firstCustomDraw : parent.columns [index].customDraw;
+        if (!customDraw) {
+            if ((parent.style & SWT.VIRTUAL) is 0) {
+                auto parentHandle = parent.handle;
+                GtkTreeViewColumn* column;
+                if (parent.columnCount > 0) {
+                    column = cast(GtkTreeViewColumn*)parent.columns [index].handle;
+                } else {
+                    column = OS.gtk_tree_view_get_column (parentHandle, index);
+                }
+                if (column is null) return;
+                auto textRenderer = parent.getTextRenderer (column);
+                auto imageRenderer = parent.getPixbufRenderer (column);
+                display.doCellDataProc( parentHandle, cast(GtkTreeViewColumn*)column, cast(GtkCellRenderer*)textRenderer );
+                display.doCellDataProc( parentHandle, cast(GtkTreeViewColumn*)column, cast(GtkCellRenderer*)imageRenderer );
+            }
+            if (parent.columnCount is 0) {
+                parent.firstCustomDraw = true;
+            } else {
+                parent.columns [index].customDraw = true;
+            }
+        }
+    }
+}
+
+/**
+ * Sets the receiver's foreground color to the color specified
+ * by the argument, or to the default system color for the item
+ * if the argument is null.
+ *
+ * @param color the new color (or null)
+ *
+ * @since 2.0
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ *
+ */
+public void setForeground (Color color){
+    checkWidget ();
+    if (color !is null && color.isDisposed ()) {
+        SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (_getForeground ().opEquals (color)) return;
+    GdkColor *gdkColor = color !is null ? color.handle : null;
+    OS.gtk_tree_store_set1 (parent.modelHandle, cast(GtkTreeIter*)handle, Tree.FOREGROUND_COLUMN, gdkColor);
+    /*
+    * Bug in GTK.  When using fixed-height-mode,
+    * row changes do not cause the row to be repainted.  The fix is to
+    * invalidate the row when it is cleared.
+    */
+    if ((parent.style & SWT.VIRTUAL) !is 0) {
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 3, 2) && OS.GTK_VERSION < OS.buildVERSION (2, 6, 3)) {
+            redraw ();
+        }
+    }
+    cached = true;
+}
+
+/**
+ * Sets the foreground color at the given column index in the receiver
+ * to the color specified by the argument, or to the default system color for the item
+ * if the argument is null.
+ *
+ * @param index the column index
+ * @param color the new color (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ *
+ */
+public void setForeground (int index, Color color){
+    checkWidget ();
+    if (color !is null && color.isDisposed ()) {
+        SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (_getForeground (index).opEquals (color)) return;
+    int count = Math.max (1, parent.getColumnCount ());
+    if (0 > index || index > count - 1) return;
+    int modelIndex = parent.columnCount is 0 ? Tree.FIRST_COLUMN : parent.columns [index].modelIndex;
+    GdkColor *gdkColor = color !is null ? color.handle : null;
+    OS.gtk_tree_store_set1 (parent.modelHandle, cast(GtkTreeIter*)handle, modelIndex + Tree.CELL_FOREGROUND, gdkColor);
+    /*
+    * Bug in GTK.  When using fixed-height-mode,
+    * row changes do not cause the row to be repainted.  The fix is to
+    * invalidate the row when it is cleared.
+    */
+    if ((parent.style & SWT.VIRTUAL) !is 0) {
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 3, 2) && OS.GTK_VERSION < OS.buildVERSION (2, 6, 3)) {
+            redraw ();
+        }
+    }
+    cached = true;
+
+    if (color !is null) {
+        bool customDraw = (parent.columnCount is 0)  ? parent.firstCustomDraw : parent.columns [index].customDraw;
+        if (!customDraw) {
+            if ((parent.style & SWT.VIRTUAL) is 0) {
+                auto parentHandle = parent.handle;
+                GtkTreeViewColumn* column;
+                if (parent.columnCount > 0) {
+                    column = cast(GtkTreeViewColumn*)parent.columns [index].handle;
+                } else {
+                    column = OS.gtk_tree_view_get_column (parentHandle, index);
+                }
+                if (column is null) return;
+                auto textRenderer = parent.getTextRenderer (column);
+                auto imageRenderer = parent.getPixbufRenderer (column);
+                display.doCellDataProc( parentHandle, cast(GtkTreeViewColumn*)column, cast(GtkCellRenderer*)textRenderer );
+                display.doCellDataProc( parentHandle, cast(GtkTreeViewColumn*)column, cast(GtkCellRenderer*)imageRenderer );
+            }
+            if (parent.columnCount is 0) {
+                parent.firstCustomDraw = true;
+            } else {
+                parent.columns [index].customDraw = true;
+            }
+        }
+    }
+}
+
+/**
+ * Sets the grayed state of the checkbox for this item.  This state change
+ * only applies if the Tree was created with the SWT.CHECK style.
+ *
+ * @param grayed the new grayed state of the checkbox
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setGrayed (bool grayed) {
+    checkWidget();
+    if ((parent.style & SWT.CHECK) is 0) return;
+    if (this.grayed is grayed) return;
+    this.grayed = grayed;
+    /*
+    * GTK+'s "inconsistent" state does not match SWT's concept of grayed.
+    * Render checked+grayed as "inconsistent", unchecked+grayed as blank.
+    */
+    void* ptr;
+    OS.gtk_tree_model_get1 (parent.modelHandle, handle, Tree.CHECKED_COLUMN, &ptr);
+    OS.gtk_tree_store_set1 (parent.modelHandle, cast(GtkTreeIter*)handle, Tree.GRAYED_COLUMN, cast(void*)cast(int)( ptr is null ? false : grayed));
+    cached = true;
+}
+
+/**
+ * Sets the receiver's image at a column.
+ *
+ * @param index the column index
+ * @param image the new image
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void setImage (int index, Image image) {
+    checkWidget ();
+    if (image !is null && image.isDisposed()) {
+        error(SWT.ERROR_INVALID_ARGUMENT);
+    }
+    if (image !is null && image.type is SWT.ICON) {
+        if (image.opEquals (_getImage (index))) return;
+    }
+    int count = Math.max (1, parent.getColumnCount ());
+    if (0 > index || index > count - 1) return;
+    GdkPixbuf* pixbuf;
+    if (image !is null) {
+        ImageList imageList = parent.imageList;
+        if (imageList is null) imageList = parent.imageList = new ImageList ();
+        int imageIndex = imageList.indexOf (image);
+        if (imageIndex is -1) imageIndex = imageList.add (image);
+        pixbuf = imageList.getPixbuf (imageIndex);
+    }
+    int modelIndex = parent.columnCount is 0 ? Tree.FIRST_COLUMN : parent.columns [index].modelIndex;
+    OS.gtk_tree_store_set1 (parent.modelHandle, cast(GtkTreeIter*)handle, modelIndex + Tree.CELL_PIXBUF, pixbuf);
+    /*
+    * Bug in GTK.  When using fixed-height-mode,
+    * row changes do not cause the row to be repainted.  The fix is to
+    * invalidate the row when the image changes.
+    */
+    if ((parent.style & SWT.VIRTUAL) !is 0) {
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 3, 2) && OS.GTK_VERSION < OS.buildVERSION (2, 6, 3)) {
+            if (parent.columnCount is 0) {
+                redraw ();
+            }
+        }
+    }
+    /*
+    * Bug in GTK.  When using fixed-height-mode, GTK does not recalculate the cell renderer width
+    * when the image is changed in the model.  The fix is to force it to recalculate the width if
+    * more space is required.
+    */
+    if ((parent.style & SWT.VIRTUAL) !is 0 && parent.currentItem is null) {
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 3, 2)) {
+            if (image !is null) {
+                auto parentHandle = parent.handle;
+                auto column = OS.gtk_tree_view_get_column (parentHandle, index);
+                int w;
+                auto pixbufRenderer = parent.getPixbufRenderer(column);
+                OS.gtk_tree_view_column_cell_get_position (column, pixbufRenderer, null, &w);
+                if (w < image.getBounds().width) {
+                    /*
+                     * There is no direct way to clear the cell renderer width so we
+                     * are relying on the fact that it is done as part of modifying
+                     * the style.
+                     */
+                    auto style = OS.gtk_widget_get_modifier_style (parentHandle);
+                    parent.modifyStyle (parentHandle, style);
+                }
+            }
+        }
+    }
+    cached = true;
+}
+
+public override void setImage (Image image) {
+    checkWidget ();
+    setImage (0, image);
+}
+
+/**
+ * Sets the image for multiple columns in the tree.
+ *
+ * @param images the array of new images
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_INVALID_ARGUMENT - if one of the images has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void setImage (Image [] images) {
+    checkWidget ();
+    // SWT extension: allow null for zero length string
+    //if (images is null) error (SWT.ERROR_NULL_ARGUMENT);
+    for (int i=0; i<images.length; i++) {
+        setImage (i, images [i]);
+    }
+}
+
+/**
+ * Sets the number of child items contained in the receiver.
+ *
+ * @param count the number of items
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setItemCount (int count) {
+    checkWidget ();
+    count = Math.max (0, count);
+    parent.setItemCount (cast(GtkTreeIter*)handle, count);
+}
+
+/**
+ * Sets the receiver's text at a column
+ *
+ * @param index the column index
+ * @param string the new text
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void setText (int index, String string) {
+    checkWidget ();
+    // SWT extension: allow null for zero length string
+    //if (string is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (_getText (index).equals (string)) return;
+    int count = Math.max (1, parent.getColumnCount ());
+    if (0 > index || index > count - 1) return;
+    char* buffer = toStringz(string);
+    int modelIndex = parent.columnCount is 0 ? Tree.FIRST_COLUMN : parent.columns [index].modelIndex;
+    OS.gtk_tree_store_set1 (parent.modelHandle, cast(GtkTreeIter*)handle, modelIndex + Tree.CELL_TEXT, buffer);
+    /*
+    * Bug in GTK.  When using fixed-height-mode,
+    * row changes do not cause the row to be repainted.  The fix is to
+    * invalidate the row when the text changes.
+    */
+    if ((parent.style & SWT.VIRTUAL) !is 0) {
+        if (OS.GTK_VERSION >= OS.buildVERSION (2, 3, 2) && OS.GTK_VERSION < OS.buildVERSION (2, 6, 3)) {
+            redraw ();
+        }
+    }
+    cached = true;
+}
+
+public override void setText (String string) {
+    checkWidget ();
+    setText (0, string);
+}
+
+/**
+ * Sets the text for multiple columns in the tree.
+ *
+ * @param strings the array of new strings
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void setText (String [] strings) {
+    checkWidget ();
+    // SWT extension: allow null for zero length string
+    //if (strings is null) error (SWT.ERROR_NULL_ARGUMENT);
+    for (int i=0; i<strings.length; i++) {
+        String string = strings [i];
+        if (string !is null) setText (i, string);
+    }
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/TypedListener.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,304 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.TypedListener;
+
+import java.lang.all;
+
+
+import org.eclipse.swt.internal.SWTEventListener;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.events.ArmEvent;
+import org.eclipse.swt.events.ArmListener;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.DragDetectEvent;
+import org.eclipse.swt.events.DragDetectListener;
+import org.eclipse.swt.events.ExpandEvent;
+import org.eclipse.swt.events.ExpandListener;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.events.HelpEvent;
+import org.eclipse.swt.events.HelpListener;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.MenuEvent;
+import org.eclipse.swt.events.MenuListener;
+import org.eclipse.swt.events.MenuDetectEvent;
+import org.eclipse.swt.events.MenuDetectListener;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.MouseMoveListener;
+import org.eclipse.swt.events.MouseTrackListener;
+import org.eclipse.swt.events.MouseWheelListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.ShellEvent;
+import org.eclipse.swt.events.ShellListener;
+import org.eclipse.swt.events.TraverseEvent;
+import org.eclipse.swt.events.TraverseListener;
+import org.eclipse.swt.events.TreeEvent;
+import org.eclipse.swt.events.TreeListener;
+import org.eclipse.swt.events.VerifyEvent;
+import org.eclipse.swt.events.VerifyListener;
+import org.eclipse.swt.graphics.GC;
+
+
+/**
+ * Instances of this class are <em>internal SWT implementation</em>
+ * objects which provide a mapping between the typed and untyped
+ * listener mechanisms that SWT supports.
+ * <p>
+ * <b>IMPORTANT:</b> This class is <em>not</em> part of the SWT
+ * public API. It is marked public only so that it can be shared
+ * within the packages provided by SWT. It should never be
+ * referenced from application code.
+ * </p>
+ *
+ * @see Listener
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public class TypedListener : Listener {
+
+    /**
+     * The receiver's event listener
+     */
+    protected SWTEventListener eventListener;
+
+/**
+ * Constructs a new instance of this class for the given event listener.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the SWT
+ * public API. It is marked public only so that it can be shared
+ * within the packages provided by SWT. It should never be
+ * referenced from application code.
+ * </p>
+ *
+ * @param listener the event listener to store in the receiver
+ */
+public this (SWTEventListener listener) {
+    eventListener = listener;
+}
+
+/**
+ * Returns the receiver's event listener.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the SWT
+ * public API. It is marked public only so that it can be shared
+ * within the packages provided by SWT. It should never be
+ * referenced from application code.
+ * </p>
+ *
+ * @return the receiver's event listener
+ */
+public SWTEventListener getEventListener () {
+    return eventListener;
+}
+
+/**
+ * Handles the given event.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the SWT
+ * public API. It is marked public only so that it can be shared
+ * within the packages provided by SWT. It should never be
+ * referenced from application code.
+ * </p>
+ * @param e the event to handle
+ */
+public void handleEvent (Event e) {
+    switch (e.type) {
+        case SWT.Activate: {
+            (cast(ShellListener) eventListener).shellActivated(new ShellEvent(e));
+            break;
+        }
+        case SWT.Arm: {
+            (cast(ArmListener) eventListener).widgetArmed (new ArmEvent (e));
+            break;
+        }
+        case SWT.Close: {
+            /* Fields set by Decorations */
+            ShellEvent event = new ShellEvent (e);
+            (cast(ShellListener) eventListener).shellClosed(event);
+            e.doit = event.doit;
+            break;
+        }
+        case SWT.Collapse: {
+            if ( auto l = cast(TreeListener)eventListener ) {
+                l.treeCollapsed(new TreeEvent(e));
+            } else {
+                (cast(ExpandListener) eventListener).itemCollapsed(new ExpandEvent(e));
+            }
+            break;
+        }
+        case SWT.Deactivate: {
+            (cast(ShellListener) eventListener).shellDeactivated(new ShellEvent(e));
+            break;
+        }
+        case SWT.Deiconify: {
+            (cast(ShellListener) eventListener).shellDeiconified(new ShellEvent(e));
+            break;
+        }
+        case SWT.DefaultSelection: {
+            (cast(SelectionListener)eventListener).widgetDefaultSelected(new SelectionEvent(e));
+            break;
+        }
+        case SWT.Dispose: {
+            (cast(DisposeListener) eventListener).widgetDisposed(new DisposeEvent(e));
+            break;
+        }
+        case SWT.DragDetect: {
+            (cast(DragDetectListener) eventListener).dragDetected(new DragDetectEvent(e));
+            break;
+        }
+        case SWT.Expand: {
+            if (auto l = cast(TreeListener)eventListener ) {
+                l.treeExpanded(new TreeEvent(e));
+            } else {
+                (cast(ExpandListener) eventListener).itemExpanded(new ExpandEvent(e));
+            }
+            break;
+        }
+        case SWT.FocusIn: {
+            (cast(FocusListener) eventListener).focusGained(new FocusEvent(e));
+            break;
+        }
+        case SWT.FocusOut: {
+            (cast(FocusListener) eventListener).focusLost(new FocusEvent(e));
+            break;
+        }
+        case SWT.Help: {
+            (cast(HelpListener) eventListener).helpRequested (new HelpEvent (e));
+            break;
+        }
+        case SWT.Hide: {
+            (cast(MenuListener) eventListener).menuHidden(new MenuEvent(e));
+            break;
+        }
+        case SWT.Iconify: {
+            (cast(ShellListener) eventListener).shellIconified(new ShellEvent(e));
+            break;
+        }
+        case SWT.KeyDown: {
+            /* Fields set by Control */
+            KeyEvent event = new KeyEvent(e);
+            (cast(KeyListener) eventListener).keyPressed(event);
+            e.doit = event.doit;
+            break;
+        }
+        case SWT.KeyUp: {
+            /* Fields set by Control */
+            KeyEvent event = new KeyEvent(e);
+            (cast(KeyListener) eventListener).keyReleased(event);
+            e.doit = event.doit;
+            break;
+        }
+        case SWT.Modify: {
+            (cast(ModifyListener) eventListener).modifyText(new ModifyEvent(e));
+            break;
+        }
+        case SWT.MenuDetect: {
+            MenuDetectEvent event = new MenuDetectEvent(e);
+            (cast(MenuDetectListener) eventListener).menuDetected(event);
+            e.x = event.x;
+            e.y = event.y;
+            e.doit = event.doit;
+            break;
+        }
+        case SWT.MouseDown: {
+            (cast(MouseListener) eventListener).mouseDown(new MouseEvent(e));
+            break;
+        }
+        case SWT.MouseDoubleClick: {
+            (cast(MouseListener) eventListener).mouseDoubleClick(new MouseEvent(e));
+            break;
+        }
+        case SWT.MouseEnter: {
+            (cast(MouseTrackListener) eventListener).mouseEnter (new MouseEvent (e));
+            break;
+        }
+        case SWT.MouseExit: {
+            (cast(MouseTrackListener) eventListener).mouseExit (new MouseEvent (e));
+            break;
+        }
+        case SWT.MouseHover: {
+            (cast(MouseTrackListener) eventListener).mouseHover (new MouseEvent (e));
+            break;
+        }
+        case SWT.MouseMove: {
+            (cast(MouseMoveListener) eventListener).mouseMove(new MouseEvent(e));
+            return;
+        }
+        case SWT.MouseWheel: {
+            (cast(MouseWheelListener) eventListener).mouseScrolled(new MouseEvent(e));
+            return;
+        }
+        case SWT.MouseUp: {
+            (cast(MouseListener) eventListener).mouseUp(new MouseEvent(e));
+            break;
+        }
+        case SWT.Move: {
+            (cast(ControlListener) eventListener).controlMoved(new ControlEvent(e));
+            break;
+        }
+        case SWT.Paint: {
+            /* Fields set by Control */
+            PaintEvent event = new PaintEvent (e);
+            (cast(PaintListener) eventListener).paintControl (event);
+            e.gc = event.gc;
+            break;
+        }
+        case SWT.Resize: {
+            (cast(ControlListener) eventListener).controlResized(new ControlEvent(e));
+            break;
+        }
+        case SWT.Selection: {
+            /* Fields set by Sash */
+            SelectionEvent event = new SelectionEvent (e);
+            (cast(SelectionListener) eventListener).widgetSelected (event);
+            e.x = event.x;
+            e.y = event.y;
+            e.doit = event.doit;
+            break;
+        }
+        case SWT.Show: {
+            (cast(MenuListener) eventListener).menuShown(new MenuEvent(e));
+            break;
+        }
+        case SWT.Traverse: {
+            /* Fields set by Control */
+            TraverseEvent event = new TraverseEvent (e);
+            (cast(TraverseListener) eventListener).keyTraversed (event);
+            e.detail = event.detail;
+            e.doit = event.doit;
+            break;
+        }
+        case SWT.Verify: {
+            /* Fields set by Text, RichText */
+            VerifyEvent event = new VerifyEvent (e);
+            (cast(VerifyListener) eventListener).verifyText (event);
+            e.text = event.text;
+            e.doit = event.doit;
+            break;
+        }
+        default:
+    }
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Widget.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,1856 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module org.eclipse.swt.widgets.Widget;
+
+import org.eclipse.swt.SWT;
+import java.lang.all;
+
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.internal.Converter;
+import org.eclipse.swt.internal.SWTEventListener;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.EventTable;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.TypedListener;
+
+import tango.stdc.string;
+import tango.core.Thread;
+
+
+/**
+ * This class is the abstract superclass of all user interface objects.
+ * Widgets are created, disposed and issue notification to listeners
+ * when events occur which affect them.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>(none)</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Dispose</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation. However, it has not been marked
+ * final to allow those outside of the SWT development team to implement
+ * patched versions of the class in order to get around specific
+ * limitations in advance of when those limitations can be addressed
+ * by the team.  Any class built using subclassing to access the internals
+ * of this class will likely fail to compile or run between releases and
+ * may be strongly platform specific. Subclassing should not be attempted
+ * without an intimate and detailed understanding of the workings of the
+ * hierarchy. No support is provided for user-written classes which are
+ * implemented as subclasses of this class.
+ * </p>
+ *
+ * @see #checkSubclass
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ */
+public abstract class Widget {
+    /**
+     * the handle to the OS resource
+     * (Warning: This field is platform dependent)
+     * <p>
+     * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+     * public API. It is marked 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 accessed from application code.
+     * </p>
+     */
+    public GtkWidget* handle;
+    int style, state;
+    Display display;
+    EventTable eventTable;
+    Object data;
+
+    /* Global state flags */
+    static const int DISPOSED = 1<<0;
+    static const int CANVAS = 1<<1;
+    static const int KEYED_DATA = 1<<2;
+    static const int HANDLE = 1<<3;
+    static const int DISABLED = 1<<4;
+    static const int MENU = 1<<5;
+    static const int OBSCURED = 1<<6;
+    static const int MOVED = 1<<7;
+    static const int RESIZED = 1<<8;
+    static const int ZERO_WIDTH = 1<<9;
+    static const int ZERO_HEIGHT = 1<<10;
+    static const int HIDDEN = 1<<11;
+    static const int FOREGROUND = 1<<12;
+    static const int BACKGROUND = 1<<13;
+    static const int FONT = 1<<14;
+    static const int PARENT_BACKGROUND = 1<<15;
+    static const int THEME_BACKGROUND = 1<<16;
+
+    /* A layout was requested on this widget */
+    static const int LAYOUT_NEEDED  = 1<<17;
+
+    /* The preferred size of a child has changed */
+    static const int LAYOUT_CHANGED = 1<<18;
+
+    /* A layout was requested in this widget hierachy */
+    static const int LAYOUT_CHILD = 1<<19;
+
+    /* More global state flags */
+    static const int RELEASED = 1<<20;
+    static const int DISPOSE_SENT = 1<<21;
+    static const int FOREIGN_HANDLE = 1<<22;
+    static const int DRAG_DETECT = 1<<23;
+
+    /* Default size for widgets */
+    static const int DEFAULT_WIDTH  = 64;
+    static const int DEFAULT_HEIGHT = 64;
+
+    /* GTK signals data */
+    static const int ACTIVATE = 1;
+    static const int BUTTON_PRESS_EVENT = 2;
+    static const int BUTTON_PRESS_EVENT_INVERSE = 3;
+    static const int BUTTON_RELEASE_EVENT = 4;
+    static const int BUTTON_RELEASE_EVENT_INVERSE = 5;
+    static const int CHANGED = 6;
+    static const int CHANGE_VALUE = 7;
+    static const int CLICKED = 8;
+    static const int COMMIT = 9;
+    static const int CONFIGURE_EVENT = 10;
+    static const int DELETE_EVENT = 11;
+    static const int DELETE_RANGE = 12;
+    static const int DELETE_TEXT = 13;
+    static const int ENTER_NOTIFY_EVENT = 14;
+    static const int EVENT = 15;
+    static const int EVENT_AFTER = 16;
+    static const int EXPAND_COLLAPSE_CURSOR_ROW = 17;
+    static const int EXPOSE_EVENT = 18;
+    static const int EXPOSE_EVENT_INVERSE = 19;
+    static const int FOCUS = 20;
+    static const int FOCUS_IN_EVENT = 21;
+    static const int FOCUS_OUT_EVENT = 22;
+    static const int GRAB_FOCUS = 23;
+    static const int HIDE = 24;
+    static const int INPUT = 25;
+    static const int INSERT_TEXT = 26;
+    static const int KEY_PRESS_EVENT = 27;
+    static const int KEY_RELEASE_EVENT = 28;
+    static const int LEAVE_NOTIFY_EVENT = 29;
+    static const int MAP = 30;
+    static const int MAP_EVENT = 31;
+    static const int MNEMONIC_ACTIVATE = 32;
+    static const int MOTION_NOTIFY_EVENT = 33;
+    static const int MOTION_NOTIFY_EVENT_INVERSE = 34;
+    static const int MOVE_FOCUS = 35;
+    static const int OUTPUT = 36;
+    static const int POPULATE_POPUP = 37;
+    static const int POPUP_MENU = 38;
+    static const int PREEDIT_CHANGED = 39;
+    static const int REALIZE = 40;
+    static const int ROW_ACTIVATED = 41;
+    static const int SCROLL_CHILD = 42;
+    static const int SCROLL_EVENT = 43;
+    static const int SELECT = 44;
+    static const int SHOW = 45;
+    static const int SHOW_HELP = 46;
+    static const int SIZE_ALLOCATE = 47;
+    static const int STYLE_SET = 48;
+    static const int SWITCH_PAGE = 49;
+    static const int TEST_COLLAPSE_ROW = 50;
+    static const int TEST_EXPAND_ROW = 51;
+    static const int TEXT_BUFFER_INSERT_TEXT = 52;
+    static const int TOGGLED = 53;
+    static const int UNMAP = 54;
+    static const int UNMAP_EVENT = 55;
+    static const int UNREALIZE = 56;
+    static const int VALUE_CHANGED = 57;
+    static const int VISIBILITY_NOTIFY_EVENT = 58;
+    static const int WINDOW_STATE_EVENT = 59;
+    static const int ACTIVATE_INVERSE = 60;
+    static const int DAY_SELECTED = 61;
+    static const int MONTH_CHANGED = 62;
+    static const int LAST_SIGNAL = 63;
+
+    template UD_Getter( String name ){
+        const String UD_Getter = "void* ud"~name~"(){ return getDisplay().getWindowProcUserData( "~name~"); }\n";
+    }
+
+    mixin ( UD_Getter!( "ACTIVATE" ));
+    mixin ( UD_Getter!( "BUTTON_PRESS_EVENT" ));
+    mixin ( UD_Getter!( "BUTTON_PRESS_EVENT_INVERSE" ));
+    mixin ( UD_Getter!( "BUTTON_RELEASE_EVENT" ));
+    mixin ( UD_Getter!( "BUTTON_RELEASE_EVENT_INVERSE" ));
+    mixin ( UD_Getter!( "CHANGED" ));
+    mixin ( UD_Getter!( "CHANGE_VALUE" ));
+    mixin ( UD_Getter!( "CLICKED" ));
+    mixin ( UD_Getter!( "COMMIT" ));
+    mixin ( UD_Getter!( "CONFIGURE_EVENT" ));
+    mixin ( UD_Getter!( "DELETE_EVENT" ));
+    mixin ( UD_Getter!( "DELETE_RANGE" ));
+    mixin ( UD_Getter!( "DELETE_TEXT" ));
+    mixin ( UD_Getter!( "ENTER_NOTIFY_EVENT" ));
+    mixin ( UD_Getter!( "EVENT" ));
+    mixin ( UD_Getter!( "EVENT_AFTER" ));
+    mixin ( UD_Getter!( "EXPAND_COLLAPSE_CURSOR_ROW" ));
+    mixin ( UD_Getter!( "EXPOSE_EVENT" ));
+    mixin ( UD_Getter!( "EXPOSE_EVENT_INVERSE" ));
+    mixin ( UD_Getter!( "FOCUS" ));
+    mixin ( UD_Getter!( "FOCUS_IN_EVENT" ));
+    mixin ( UD_Getter!( "FOCUS_OUT_EVENT" ));
+    mixin ( UD_Getter!( "GRAB_FOCUS" ));
+    mixin ( UD_Getter!( "HIDE" ));
+    mixin ( UD_Getter!( "INPUT" ));
+    mixin ( UD_Getter!( "INSERT_TEXT" ));
+    mixin ( UD_Getter!( "KEY_PRESS_EVENT" ));
+    mixin ( UD_Getter!( "KEY_RELEASE_EVENT" ));
+    mixin ( UD_Getter!( "LEAVE_NOTIFY_EVENT" ));
+    mixin ( UD_Getter!( "MAP" ));
+    mixin ( UD_Getter!( "MAP_EVENT" ));
+    mixin ( UD_Getter!( "MNEMONIC_ACTIVATE" ));
+    mixin ( UD_Getter!( "MOTION_NOTIFY_EVENT" ));
+    mixin ( UD_Getter!( "MOTION_NOTIFY_EVENT_INVERSE" ));
+    mixin ( UD_Getter!( "MOVE_FOCUS" ));
+    mixin ( UD_Getter!( "OUTPUT" ));
+    mixin ( UD_Getter!( "POPULATE_POPUP" ));
+    mixin ( UD_Getter!( "POPUP_MENU" ));
+    mixin ( UD_Getter!( "PREEDIT_CHANGED" ));
+    mixin ( UD_Getter!( "REALIZE" ));
+    mixin ( UD_Getter!( "ROW_ACTIVATED" ));
+    mixin ( UD_Getter!( "SCROLL_CHILD" ));
+    mixin ( UD_Getter!( "SCROLL_EVENT" ));
+    mixin ( UD_Getter!( "SELECT" ));
+    mixin ( UD_Getter!( "SHOW" ));
+    mixin ( UD_Getter!( "SHOW_HELP" ));
+    mixin ( UD_Getter!( "SIZE_ALLOCATE" ));
+    mixin ( UD_Getter!( "STYLE_SET" ));
+    mixin ( UD_Getter!( "SWITCH_PAGE" ));
+    mixin ( UD_Getter!( "TEST_COLLAPSE_ROW" ));
+    mixin ( UD_Getter!( "TEST_EXPAND_ROW" ));
+    mixin ( UD_Getter!( "TEXT_BUFFER_INSERT_TEXT" ));
+    mixin ( UD_Getter!( "TOGGLED" ));
+    mixin ( UD_Getter!( "UNMAP" ));
+    mixin ( UD_Getter!( "UNMAP_EVENT" ));
+    mixin ( UD_Getter!( "UNREALIZE" ));
+    mixin ( UD_Getter!( "VALUE_CHANGED" ));
+    mixin ( UD_Getter!( "VISIBILITY_NOTIFY_EVENT" ));
+    mixin ( UD_Getter!( "WINDOW_STATE_EVENT" ));
+    mixin ( UD_Getter!( "ACTIVATE_INVERSE" ));
+    mixin ( UD_Getter!( "DAY_SELECTED" ));
+    mixin ( UD_Getter!( "MONTH_CHANGED" ));
+    mixin ( UD_Getter!( "LAST_SIGNAL" ));
+
+/**
+ * Prevents uninitialized instances from being created outside the package.
+ */
+this () {}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a widget which will be the parent of the new instance (cannot be null)
+ * @param style the style of widget to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the parent is disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see #checkSubclass
+ * @see #getStyle
+ */
+public this (Widget parent, int style) {
+    checkSubclass ();
+    checkParent (parent);
+    this.style = style;
+    display = parent.display;
+}
+
+void _addListener (int eventType, Listener listener) {
+    if (eventTable is null) eventTable = new EventTable ();
+    eventTable.hook (eventType, listener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when an event of the given type occurs. When the
+ * event does occur in the widget, the listener is notified by
+ * sending it the <code>handleEvent()</code> message. The event
+ * type is one of the event constants defined in class <code>SWT</code>.
+ *
+ * @param eventType the type of event to listen for
+ * @param listener the listener which should be notified when the event occurs
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Listener
+ * @see SWT
+ * @see #getListeners(int)
+ * @see #removeListener(int, Listener)
+ * @see #notifyListeners
+ */
+public void addListener (int eventType, Listener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    _addListener (eventType, listener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the widget is disposed. When the widget is
+ * disposed, the listener is notified by sending it the
+ * <code>widgetDisposed()</code> message.
+ *
+ * @param listener the listener which should be notified when the receiver is disposed
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see DisposeListener
+ * @see #removeDisposeListener
+ */
+public void addDisposeListener (DisposeListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    TypedListener typedListener = new TypedListener (listener);
+    addListener (SWT.Dispose, typedListener);
+}
+
+GdkWindow* paintWindow () {
+    return null;
+}
+
+static int checkBits (int style, int int0, int int1, int int2, int int3, int int4, int int5) {
+    int mask = int0 | int1 | int2 | int3 | int4 | int5;
+    if ((style & mask) is 0) style |= int0;
+    if ((style & int0) !is 0) style = (style & ~mask) | int0;
+    if ((style & int1) !is 0) style = (style & ~mask) | int1;
+    if ((style & int2) !is 0) style = (style & ~mask) | int2;
+    if ((style & int3) !is 0) style = (style & ~mask) | int3;
+    if ((style & int4) !is 0) style = (style & ~mask) | int4;
+    if ((style & int5) !is 0) style = (style & ~mask) | int5;
+    return style;
+}
+
+void cellDataProc (
+    GtkTreeViewColumn *tree_column,
+    GtkCellRenderer *cell,
+    GtkTreeModel *tree_model,
+    GtkTreeIter *iter,
+    void* data)
+{
+}
+
+void checkOpen () {
+    /* Do nothing */
+}
+
+void checkOrientation (Widget parent) {
+    style &= ~SWT.MIRRORED;
+    if ((style & (SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT)) is 0) {
+        if (parent !is null) {
+            if ((parent.style & SWT.LEFT_TO_RIGHT) !is 0) style |= SWT.LEFT_TO_RIGHT;
+            if ((parent.style & SWT.RIGHT_TO_LEFT) !is 0) style |= SWT.RIGHT_TO_LEFT;
+        }
+    }
+    style = checkBits (style, SWT.LEFT_TO_RIGHT, SWT.RIGHT_TO_LEFT, 0, 0, 0, 0);
+    /* Versions of GTK prior to 2.8 do not render RTL text properly */
+    if (OS.GTK_VERSION < OS.buildVERSION (2, 8, 0)) {
+        style &= ~SWT.RIGHT_TO_LEFT;
+        style |= SWT.LEFT_TO_RIGHT;
+    }
+}
+
+/**
+ * Throws an exception if the specified widget can not be
+ * used as a parent for the receiver.
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ *    <li>ERROR_INVALID_ARGUMENT - if the parent is disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ */
+void checkParent (Widget parent) {
+    if (parent is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (parent.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+    parent.checkWidget ();
+    parent.checkOpen ();
+}
+
+/**
+ * Checks that this class can be subclassed.
+ * <p>
+ * The SWT class library is intended to be subclassed
+ * only at specific, controlled points (most notably,
+ * <code>Composite</code> and <code>Canvas</code> when
+ * implementing new widgets). This method enforces this
+ * rule unless it is overridden.
+ * </p><p>
+ * <em>IMPORTANT:</em> By providing an implementation of this
+ * method that allows a subclass of a class which does not
+ * normally allow subclassing to be created, the implementer
+ * agrees to be fully responsible for the fact that any such
+ * subclass will likely fail between SWT releases and will be
+ * strongly platform specific. No support is provided for
+ * user-written classes which are implemented in this fashion.
+ * </p><p>
+ * The ability to subclass outside of the allowed SWT classes
+ * is intended purely to enable those not on the SWT development
+ * team to implement patches in order to get around specific
+ * limitations in advance of when those limitations can be
+ * addressed by the team. Subclassing should not be attempted
+ * without an intimate and detailed understanding of the hierarchy.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ */
+protected void checkSubclass () {
+    if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+/**
+ * Throws an <code>SWTException</code> if the receiver can not
+ * be accessed by the caller. This may include both checks on
+ * the state of the receiver and more generally on the entire
+ * execution context. This method <em>should</em> be called by
+ * widget implementors to enforce the standard SWT invariants.
+ * <p>
+ * Currently, it is an error to invoke any method (other than
+ * <code>isDisposed()</code>) on a widget that has had its
+ * <code>dispose()</code> method called. It is also an error
+ * to call widget methods from any thread that is different
+ * from the thread that created the widget.
+ * </p><p>
+ * In future releases of SWT, there may be more or fewer error
+ * checks and exceptions may be thrown for different reasons.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void checkWidget () {
+    Display display = this.display;
+    if (display is null) error (SWT.ERROR_WIDGET_DISPOSED);
+    if (display.thread !is Thread.getThis ()) error (SWT.ERROR_THREAD_INVALID_ACCESS);
+    if ((state & DISPOSED) !is 0) error (SWT.ERROR_WIDGET_DISPOSED);
+}
+
+void createHandle (int index) {
+}
+
+void createWidget (int index) {
+    createHandle (index);
+    setOrientation ();
+    hookEvents ();
+    register ();
+}
+
+void deregister () {
+    if (handle is null) return;
+    if ((state & HANDLE) !is 0) display.removeWidget (handle);
+}
+
+void destroyWidget () {
+    GtkWidget* h = topHandle ();
+    releaseHandle ();
+    if (h !is null && (state & HANDLE) !is 0) {
+        OS.gtk_widget_destroy (h);
+    }
+}
+
+/**
+ * Disposes of the operating system resources associated with
+ * the receiver and all its descendants. After this method has
+ * been invoked, the receiver and all descendants will answer
+ * <code>true</code> when sent the message <code>isDisposed()</code>.
+ * Any internal connections between the widgets in the tree will
+ * have been removed to facilitate garbage collection.
+ * <p>
+ * NOTE: This method is not called recursively on the descendants
+ * of the receiver. This means that, widget implementers can not
+ * detect when a widget is being disposed of by re-implementing
+ * this method, but should instead listen for the <code>Dispose</code>
+ * event.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #addDisposeListener
+ * @see #removeDisposeListener
+ * @see #checkWidget
+ */
+public void dispose () {
+    /*
+    * Note:  It is valid to attempt to dispose a widget
+    * more than once.  If this happens, fail silently.
+    */
+    if (isDisposed ()) return;
+    if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS);
+    release (true);
+}
+
+void error (int code) {
+    SWT.error (code);
+}
+
+/**
+ * Returns the application defined widget data associated
+ * with the receiver, or null if it has not been set. The
+ * <em>widget data</em> is a single, unnamed field that is
+ * stored with every widget.
+ * <p>
+ * Applications may put arbitrary objects in this field. If
+ * the object stored in the widget data needs to be notified
+ * when the widget is disposed of, it is the application's
+ * responsibility to hook the Dispose event on the widget and
+ * do so.
+ * </p>
+ *
+ * @return the widget data
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - when the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - when called from the wrong thread</li>
+ * </ul>
+ *
+ * @see #setData(Object)
+ */
+public Object getData () {
+    checkWidget();
+    return (state & KEYED_DATA) !is 0 ? (cast(ArrayWrapperObject)data).array[0] : data;
+}
+public String getDataStr () {
+    return stringcast( getData() );
+}
+
+/**
+ * Returns the application defined property of the receiver
+ * with the specified name, or null if it has not been set.
+ * <p>
+ * Applications may have associated arbitrary objects with the
+ * receiver in this fashion. If the objects stored in the
+ * properties need to be notified when the widget is disposed
+ * of, it is the application's responsibility to hook the
+ * Dispose event on the widget and do so.
+ * </p>
+ *
+ * @param   key the name of the property
+ * @return the value of the property or null if it has not been set
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setData(String, Object)
+ */
+public Object getData (String key) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (key is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if ((state & KEYED_DATA) !is 0) {
+        Object[] table = (cast(ArrayWrapperObject) data).array;
+        for (int i=1; i<table.length; i+=2) {
+            String tablekey = (cast(ArrayWrapperString) table[i]).array;
+            if (key ==/*eq*/ tablekey ) return table [i+1];
+        }
+    }
+    return null;
+}
+public String getDataStr (String key) {
+    return stringcast( getData(key) );
+}
+
+/**
+ * Returns the <code>Display</code> that is associated with
+ * the receiver.
+ * <p>
+ * A widget's display is either provided when it is created
+ * (for example, top level <code>Shell</code>s) or is the
+ * same as its parent's display.
+ * </p>
+ *
+ * @return the receiver's display
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Display getDisplay () {
+    Display display = this.display;
+    if (display is null) error (SWT.ERROR_WIDGET_DISPOSED);
+    return display;
+}
+
+/**
+ * Returns an array of listeners who will be notified when an event
+ * of the given type occurs. The event type is one of the event constants
+ * defined in class <code>SWT</code>.
+ *
+ * @param eventType the type of event to listen for
+ * @return an array of listeners that will be notified when the event occurs
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Listener
+ * @see SWT
+ * @see #addListener(int, Listener)
+ * @see #removeListener(int, Listener)
+ * @see #notifyListeners
+ *
+ * @since 3.4
+ */
+public Listener[] getListeners (int eventType) {
+    checkWidget();
+    if (eventTable is null) return new Listener[0];
+    return eventTable.getListeners(eventType);
+}
+
+String getName () {
+//  String str = getClass ().getName ();
+//  int index = str.lastIndexOf ('.');
+//  if (index is -1) return str;
+    String str = this.classinfo.name;
+    int index = str.length;
+    while ((--index > 0) && (str[index] !is '.')) {}
+    return str[index + 1 .. $ ];
+}
+
+String getNameText () {
+    return "";
+}
+
+/**
+ * Returns the receiver's style information.
+ * <p>
+ * Note that the value which is returned by this method <em>may
+ * not match</em> the value which was provided to the constructor
+ * when the receiver was created. This can occur when the underlying
+ * operating system does not support a particular combination of
+ * requested styles. For example, if the platform widget used to
+ * implement a particular SWT widget always has scroll bars, the
+ * result of calling this method would always have the
+ * <code>SWT.H_SCROLL</code> and <code>SWT.V_SCROLL</code> bits set.
+ * </p>
+ *
+ * @return the style bits
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getStyle () {
+    checkWidget ();
+    return style;
+}
+
+
+int /*long*/ gtk_activate (GtkWidget* widget) {
+    return 0;
+}
+
+int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* event) {
+    return 0;
+}
+
+int /*long*/ gtk_button_release_event (GtkWidget* widget, GdkEventButton* event) {
+    return 0;
+}
+
+int /*long*/ gtk_changed (GtkWidget* widget) {
+    return 0;
+}
+
+int /*long*/ gtk_change_value (GtkWidget* widget, int /*long*/ scroll, int /*long*/ value1, int /*long*/ value2) {
+    return 0;
+}
+
+int /*long*/ gtk_clicked (GtkWidget* widget) {
+    return 0;
+}
+
+int /*long*/ gtk_commit (GtkIMContext* imcontext, char* text) {
+    return 0;
+}
+
+int /*long*/ gtk_configure_event (GtkWidget* widget, int /*long*/ event) {
+    return 0;
+}
+
+int /*long*/ gtk_day_selected (GtkWidget* widget) {
+    return 0;
+}
+
+int /*long*/ gtk_delete_event (GtkWidget* widget, int /*long*/ event) {
+    return 0;
+}
+
+int /*long*/ gtk_delete_range (GtkWidget* widget, int /*long*/ iter1, int /*long*/ iter2) {
+    return 0;
+}
+
+int /*long*/ gtk_delete_text (GtkWidget* widget, int /*long*/ start_pos, int /*long*/ end_pos) {
+    return 0;
+}
+
+int /*long*/ gtk_enter_notify_event (GtkWidget* widget, GdkEventCrossing* event) {
+    return 0;
+}
+
+int /*long*/ gtk_event (GtkWidget* widget, GdkEvent* event) {
+    return 0;
+}
+
+int /*long*/ gtk_event_after (GtkWidget* widget, GdkEvent* event) {
+    return 0;
+}
+
+int /*long*/ gtk_expand_collapse_cursor_row (GtkWidget* widget, int /*long*/ logical, int /*long*/ expand, int /*long*/ open_all) {
+    return 0;
+}
+
+int /*long*/ gtk_expose_event (GtkWidget* widget, GdkEventExpose* event) {
+    return 0;
+}
+
+int /*long*/ gtk_focus (GtkWidget* widget, int directionType) {
+    return 0;
+}
+
+int /*long*/ gtk_focus_in_event (GtkWidget* widget, GdkEventFocus* event) {
+    return 0;
+}
+
+int /*long*/ gtk_focus_out_event (GtkWidget* widget, GdkEventFocus* event) {
+    return 0;
+}
+
+int /*long*/ gtk_grab_focus (GtkWidget* widget) {
+    return 0;
+}
+
+int /*long*/ gtk_hide (GtkWidget* widget) {
+    return 0;
+}
+
+int /*long*/ gtk_input (GtkWidget* widget, int /*long*/ arg1) {
+    return 0;
+}
+
+int /*long*/ gtk_insert_text (GtkEditable* widget, char* new_text, int new_text_length, int position) {
+    return 0;
+}
+
+int /*long*/ gtk_key_press_event (GtkWidget* widget, GdkEventKey* event) {
+    return sendKeyEvent (SWT.KeyDown, event) ? 0 : 1;
+}
+
+int /*long*/ gtk_key_release_event (GtkWidget* widget, GdkEventKey* event) {
+    return sendKeyEvent (SWT.KeyUp, event) ? 0 : 1;
+}
+
+int /*long*/ gtk_leave_notify_event (GtkWidget* widget, GdkEventCrossing* event) {
+    return 0;
+}
+
+int /*long*/ gtk_map (GtkWidget* widget) {
+    return 0;
+}
+
+int /*long*/ gtk_map_event (GtkWidget* widget, int /*long*/ event) {
+    return 0;
+}
+
+int /*long*/ gtk_mnemonic_activate (GtkWidget* widget, int /*long*/ arg1) {
+    return 0;
+}
+
+int /*long*/ gtk_month_changed (GtkWidget* widget) {
+    return 0;
+}
+
+int /*long*/ gtk_motion_notify_event (GtkWidget* widget, GdkEventMotion* event) {
+    return 0;
+}
+
+int /*long*/ gtk_move_focus (GtkWidget* widget, int directionType) {
+    return 0;
+}
+
+int /*long*/ gtk_output (GtkWidget* widget) {
+    return 0;
+}
+
+int /*long*/ gtk_populate_popup (GtkWidget* widget, GtkWidget* menu) {
+    return 0;
+}
+
+int /*long*/ gtk_popup_menu (GtkWidget* widget) {
+    return 0;
+}
+
+int /*long*/ gtk_preedit_changed (GtkIMContext* imcontext) {
+    return 0;
+}
+
+int /*long*/ gtk_realize (GtkWidget* widget) {
+    return 0;
+}
+
+void gtk_row_activated (GtkTreeView* tree, GtkTreePath* path, GtkTreeViewColumn* column) {
+}
+
+int /*long*/ gtk_scroll_child (GtkWidget* widget, int /*long*/ scrollType, int /*long*/ horizontal) {
+    return 0;
+}
+
+int /*long*/ gtk_scroll_event (GtkWidget* widget, GdkEventScroll*  event) {
+    return 0;
+}
+
+int /*long*/ gtk_select (int /*long*/ item) {
+    return 0;
+}
+
+int /*long*/ gtk_show (GtkWidget* widget) {
+    return 0;
+}
+
+int /*long*/ gtk_show_help (GtkWidget* widget, int /*long*/ helpType) {
+    return 0;
+}
+
+int /*long*/ gtk_size_allocate (GtkWidget* widget, int /*long*/ allocation) {
+    return 0;
+}
+
+int /*long*/ gtk_style_set (GtkWidget* widget, int /*long*/ previousStyle) {
+    return 0;
+}
+
+int /*long*/ gtk_switch_page (GtkWidget* widget, int /*long*/ page, int /*long*/ page_num) {
+    return 0;
+}
+
+int gtk_test_collapse_row (
+    GtkTreeView *tree_view,
+    GtkTreeIter *iter,
+    GtkTreePath *path)
+{
+    return 0;
+}
+
+int /*long*/ gtk_test_expand_row (
+    GtkTreeView *tree_view,
+    GtkTreeIter *iter,
+    GtkTreePath *path)
+{
+    return 0;
+}
+
+int /*long*/ gtk_text_buffer_insert_text (GtkTextBuffer *buffer, GtkTextIter *iter, char *text, int len) {
+    return 0;
+}
+
+int /*long*/ gtk_timer () {
+    return 0;
+}
+
+int /*long*/ gtk_toggled (int /*long*/ renderer, char* pathStr) {
+    return 0;
+}
+
+int /*long*/ gtk_unmap (GtkWidget* widget) {
+    return 0;
+}
+
+int /*long*/ gtk_unmap_event (GtkWidget* widget, int /*long*/ event) {
+    return 0;
+}
+
+int /*long*/ gtk_unrealize (GtkWidget* widget) {
+    return 0;
+}
+
+int /*long*/ gtk_value_changed (int /*long*/ adjustment) {
+    return 0;
+}
+
+int /*long*/ gtk_visibility_notify_event (GtkWidget* widget, GdkEventVisibility* event) {
+    return 0;
+}
+
+int /*long*/ gtk_window_state_event (GtkWidget* widget, GdkEventWindowState* event) {
+    return 0;
+}
+
+int fontHeight ( PangoFontDescription* font, GtkWidget* widgetHandle ) {
+    auto context = OS.gtk_widget_get_pango_context (widgetHandle);
+    auto lang = OS.pango_context_get_language (context);
+    auto metrics = OS.pango_context_get_metrics (context, font, lang);
+    int ascent = OS.pango_font_metrics_get_ascent (metrics);
+    int descent = OS.pango_font_metrics_get_descent (metrics);
+    OS.pango_font_metrics_unref (metrics);
+    return OS.PANGO_PIXELS (ascent + descent);
+}
+
+int filterProc (XEvent* xEvent, GdkEvent* gdkEvent, void* data) {
+    return 0;
+}
+
+bool filters (int eventType) {
+    return display.filters (eventType);
+}
+
+int /*long*/ fixedMapProc (GtkWidget* widget) {
+    return 0;
+}
+
+void fixedSizeAllocateProc(GtkWidget* widget, GtkAllocation* allocationPtr) {
+    return Display.oldFixedSizeAllocateProc(widget, allocationPtr);
+}
+
+char [] fixMnemonic (String str) {
+    return fixMnemonic (str, true);
+}
+
+char [] fixMnemonic (String str, bool replace) {
+    int len = str.length;
+    String text = str[0 .. len].dup;
+    int i = 0, j = 0;
+    char [] result = new char [len * 2];
+    while (i < len) {
+        switch (text [i]) {
+            case '&':
+                if (i + 1 < len && text [i + 1] is '&') {
+                    i++;
+                } else {
+                    if (replace) {
+                        text [i] = '_';
+                    } else {
+                        i++;
+                    }
+                }
+                break;
+            case '_':
+                if (replace) result [j++] = '_';
+                break;
+            default:
+        }
+        result [j++] = text [i++];
+    }
+    return result[0..j];
+}
+
+/**
+ * Returns <code>true</code> if the widget has been disposed,
+ * and <code>false</code> otherwise.
+ * <p>
+ * This method gets the dispose state for the widget.
+ * When a widget has been disposed, it is an error to
+ * invoke any other method using the widget.
+ * </p>
+ *
+ * @return <code>true</code> when the widget is disposed and <code>false</code> otherwise
+ */
+public bool isDisposed () {
+    return (state & DISPOSED) !is 0;
+}
+
+/**
+ * Returns <code>true</code> if there are any listeners
+ * for the specified event type associated with the receiver,
+ * and <code>false</code> otherwise. The event type is one of
+ * the event constants defined in class <code>SWT</code>.
+ *
+ * @param eventType the type of event
+ * @return true if the event is hooked
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT
+ */
+public bool isListening (int eventType) {
+    checkWidget ();
+    return hooks (eventType);
+}
+
+bool isValidThread () {
+    return getDisplay ().isValidThread ();
+}
+
+bool isValidSubclass() {
+    return true;//Display.isValidClass(getClass());
+}
+
+void hookEvents () {
+}
+
+/*
+ * Returns <code>true</code> if the specified eventType is
+ * hooked, and <code>false</code> otherwise. Implementations
+ * of SWT can avoid creating objects and sending events
+ * when an event happens in the operating system but
+ * there are no listeners hooked for the event.
+ *
+ * @param eventType the event to be checked
+ *
+ * @return <code>true</code> when the eventType is hooked and <code>false</code> otherwise
+ *
+ * @see #isListening
+ */
+bool hooks (int eventType) {
+    if (eventTable is null) return false;
+    return eventTable.hooks (eventType);
+}
+
+int /*long*/ hoverProc (GtkWidget* widget) {
+    return 0;
+}
+
+void menuPositionProc (GtkMenu* menu, int* x, int* y, int* push_in, void* user_data) {
+}
+
+bool mnemonicHit (GtkWidget* mnemonicHandle, wchar key) {
+    if (!mnemonicMatch (mnemonicHandle, key)) return false;
+    OS.g_signal_handlers_block_matched ( cast(void*)mnemonicHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udMNEMONIC_ACTIVATE);
+    bool result = cast(bool)OS.gtk_widget_mnemonic_activate (cast(GtkWidget*)mnemonicHandle, false);
+    OS.g_signal_handlers_unblock_matched (cast(void*)mnemonicHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udMNEMONIC_ACTIVATE);
+    return result;
+}
+
+bool mnemonicMatch (GtkWidget* mnemonicHandle, wchar key) {
+    int keyval1 = OS.gdk_keyval_to_lower (OS.gdk_unicode_to_keyval (key));
+    int keyval2 = OS.gdk_keyval_to_lower (OS.gtk_label_get_mnemonic_keyval (cast(GtkLabel*)mnemonicHandle));
+    return keyval1 is keyval2;
+}
+
+void modifyStyle (GtkWidget* handle, GtkRcStyle* style) {
+    OS.gtk_widget_modify_style (handle, style);
+}
+
+/**
+ * Notifies all of the receiver's listeners for events
+ * of the given type that one such event has occurred by
+ * invoking their <code>handleEvent()</code> method.  The
+ * event type is one of the event constants defined in class
+ * <code>SWT</code>.
+ *
+ * @param eventType the type of event which has occurred
+ * @param event the event data
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see #addListener
+ * @see #getListeners(int)
+ * @see #removeListener(int, Listener)
+ */
+public void notifyListeners (int eventType, Event event) {
+    checkWidget();
+    if (event is null) event = new Event ();
+    sendEvent (eventType, event);
+}
+
+void postEvent (int eventType) {
+    sendEvent (eventType, null, false);
+}
+
+void postEvent (int eventType, Event event) {
+    sendEvent (eventType, event, false);
+}
+
+void register () {
+    if (handle is null) return;
+    if ((state & HANDLE) !is 0) display.addWidget (handle, this);
+}
+
+void release (bool destroy) {
+    if ((state & DISPOSE_SENT) is 0) {
+        state |= DISPOSE_SENT;
+        sendEvent (SWT.Dispose);
+    }
+    if ((state & DISPOSED) is 0) {
+        releaseChildren (destroy);
+    }
+    if ((state & RELEASED) is 0) {
+        state |= RELEASED;
+        if (destroy) {
+            releaseParent ();
+            releaseWidget ();
+            destroyWidget ();
+        } else {
+            releaseWidget ();
+            releaseHandle ();
+        }
+    }
+}
+
+void releaseChildren (bool destroy) {
+}
+
+void releaseHandle () {
+    handle = null;
+    state |= DISPOSED;
+    display = null;
+}
+
+void releaseParent () {
+    /* Do nothing */
+}
+
+void releaseWidget () {
+    deregister ();
+    eventTable = null;
+    data = null;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when an event of the given type occurs. The event
+ * type is one of the event constants defined in class <code>SWT</code>.
+ *
+ * @param eventType the type of event to listen for
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Listener
+ * @see SWT
+ * @see #addListener
+ * @see #getListeners(int)
+ * @see #notifyListeners
+ */
+public void removeListener (int eventType, Listener handler) {
+    checkWidget ();
+    if (handler is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (eventType, handler);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when an event of the given type occurs.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the SWT
+ * public API. It is marked public only so that it can be shared
+ * within the packages provided by SWT. It should never be
+ * referenced from application code.
+ * </p>
+ *
+ * @param eventType the type of event to listen for
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Listener
+ * @see #addListener
+ */
+protected void removeListener (int eventType, SWTEventListener handler) {
+    checkWidget ();
+    if (handler is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (eventType, handler);
+}
+
+void rendererGetSizeProc (
+    GtkCellRenderer      *cell,
+    GtkWidget            *widget,
+    GdkRectangle         *cell_area,
+    int                  *x_offset,
+    int                  *y_offset,
+    int                  *width,
+    int                  *height)
+{
+}
+
+void rendererRenderProc (
+    GtkCellRenderer * cell,
+    GdkDrawable * window,
+    GtkWidget * widget,
+    GdkRectangle *background_area,
+    GdkRectangle *cell_area,
+    GdkRectangle *expose_area,
+    int flags)
+{
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the widget is disposed.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see DisposeListener
+ * @see #addDisposeListener
+ */
+public void removeDisposeListener (DisposeListener listener) {
+    checkWidget ();
+    if (listener is null) error (SWT.ERROR_NULL_ARGUMENT);
+    if (eventTable is null) return;
+    eventTable.unhook (SWT.Dispose, listener);
+}
+
+
+void sendEvent (Event event) {
+    Display display = event.display;
+    if (!display.filterEvent (event)) {
+        if (eventTable !is null) eventTable.sendEvent (event);
+    }
+}
+
+void sendEvent (int eventType) {
+    sendEvent (eventType, null, true);
+}
+
+void sendEvent (int eventType, Event event) {
+    sendEvent (eventType, event, true);
+}
+
+void sendEvent (int eventType, Event event, bool send) {
+    if (eventTable is null && !display.filters (eventType)) {
+        return;
+    }
+    if (event is null) event = new Event ();
+    event.type = eventType;
+    event.display = display;
+    event.widget = this;
+    if (event.time is 0) {
+        event.time = display.getLastEventTime ();
+    }
+    if (send) {
+        sendEvent (event);
+    } else {
+        display.postEvent (event);
+    }
+}
+
+bool sendKeyEvent (int type, GdkEventKey* keyEvent) {
+    int len = keyEvent.length;
+    if (keyEvent.string is null || OS.g_utf8_strlen (keyEvent.string, len) <= 1) {
+        Event event = new Event ();
+        event.time = keyEvent.time;
+        if (!setKeyState (event, keyEvent)) return true;
+        sendEvent (type, event);
+        // widget could be disposed at this point
+
+        /*
+        * It is possible (but unlikely), that application
+        * code could have disposed the widget in the key
+        * events.  If this happens, end the processing of
+        * the key by returning false.
+        */
+        if (isDisposed ()) return false;
+        return event.doit;
+    }
+    char [] chars = fromStringz( keyEvent.string );
+    return sendIMKeyEvent (type, keyEvent, chars) !is null;
+}
+
+char [] sendIMKeyEvent (int type, GdkEventKey* keyEvent, char [] chars) {
+    int index = 0, count = 0, state = 0;
+    GdkEvent*  ptr = null;
+    if (keyEvent is null) {
+        ptr = OS.gtk_get_current_event ();
+        if (ptr !is null) {
+            keyEvent = cast(GdkEventKey*)ptr;
+            switch (cast(int)keyEvent.type) {
+                case OS.GDK_KEY_PRESS:
+                case OS.GDK_KEY_RELEASE:
+                    state = keyEvent.state;
+                    break;
+                default:
+                    keyEvent = null;
+                    break;
+            }
+        }
+    }
+    if (keyEvent is null) {
+        int buffer;
+        OS.gtk_get_current_event_state (&buffer);
+        state = buffer;
+    }
+    while (index < chars.length) {
+        Event event = new Event ();
+        //PORTING take care of utf8
+        if (keyEvent !is null && chars.codepointCount() <= 1) {
+            setKeyState (event, keyEvent);
+        } else {
+            setInputState (event, state);
+        }
+        //PORTING take care of utf8
+        int incr;
+        event.character = firstCodePoint( chars [index..$], incr );
+        sendEvent (type, event);
+
+        /*
+        * It is possible (but unlikely), that application
+        * code could have disposed the widget in the key
+        * events.  If this happens, end the processing of
+        * the key by returning null.
+        */
+        if (isDisposed ()) {
+            if (ptr !is null) OS.gdk_event_free (ptr);
+            return null;
+        }
+
+        //PORTING take care of utf8
+        if (event.doit) {
+            for( int i = 0; i < incr; i++ ){
+                chars [count+i] = chars [index+i];
+            }
+            count+=incr;
+        }
+        index+=incr;
+    }
+    if (ptr !is null) OS.gdk_event_free (ptr);
+    if (count is 0) return null;
+    if (index !is count) {
+        char [] result = new char [count];
+        System.arraycopy (chars, 0, result, 0, count);
+        return result;
+    }
+    return chars;
+}
+
+/**
+ * Sets the application defined widget data associated
+ * with the receiver to be the argument. The <em>widget
+ * data</em> is a single, unnamed field that is stored
+ * with every widget.
+ * <p>
+ * Applications may put arbitrary objects in this field. If
+ * the object stored in the widget data needs to be notified
+ * when the widget is disposed of, it is the application's
+ * responsibility to hook the Dispose event on the widget and
+ * do so.
+ * </p>
+ *
+ * @param data the widget data
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - when the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - when called from the wrong thread</li>
+ * </ul>
+ *
+ * @see #getData()
+ */
+public void setData (Object data) {
+    checkWidget();
+    if ((state & KEYED_DATA) !is 0) {
+        (cast(ArrayWrapperObject) this.data).array[0] = data;
+    } else {
+        this.data = data;
+    }
+}
+public void setDataStr (String data) {
+    setData( stringcast(data));
+}
+
+/**
+ * Sets the application defined property of the receiver
+ * with the specified name to the given value.
+ * <p>
+ * Applications may associate arbitrary objects with the
+ * receiver in this fashion. If the objects stored in the
+ * properties need to be notified when the widget is disposed
+ * of, it is the application's responsibility to hook the
+ * Dispose event on the widget and do so.
+ * </p>
+ *
+ * @param key the name of the property
+ * @param value the new value for the property
+ *
+ * @exception SWTException <ul>
+ *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getData(String)
+ */
+public void setData (String key, Object value) {
+    checkWidget();
+    // SWT extension: allow null for zero length string
+    //if (key is null) error (SWT.ERROR_NULL_ARGUMENT);
+    int index = 1;
+    Object [] table = null;
+    if ((state & KEYED_DATA) !is 0) {
+        table = (cast(ArrayWrapperObject) data).array;
+        while (index < table.length) {
+            String tablekey = (cast(ArrayWrapperString)table[index]).array;
+            if (key.equals (tablekey) ) break;
+            index += 2;
+        }
+    }
+    if (value !is null) {
+        if ((state & KEYED_DATA) !is 0) {
+            if (index is table.length) {
+                Object [] newTable = new Object [table.length + 2];
+                System.arraycopy (table, 0, newTable, 0, table.length);
+                table = newTable;
+                data = new ArrayWrapperObject( table );
+            }
+        } else {
+            table = new Object [3];
+            table [0] = data;
+            data = new ArrayWrapperObject( table );
+            state |= KEYED_DATA;
+        }
+        table [index] = new ArrayWrapperString( key );
+        table [index + 1] = value;
+    } else {
+        if ((state & KEYED_DATA) !is 0) {
+            if (index !is table.length) {
+                int len = table.length - 2;
+                if (len is 1) {
+                    data = table [0];
+                    state &= ~KEYED_DATA;
+                } else {
+                    Object [] newTable = new Object [len];
+                    System.arraycopy (table, 0, newTable, 0, index);
+                    System.arraycopy (table, index + 2, newTable, index, len - index);
+                    data = new ArrayWrapperObject( newTable );
+                }
+            }
+        }
+    }
+}
+public void setDataStr (String key, String value) {
+    setData(key, stringcast(value));
+}
+
+void setForegroundColor (GtkWidget* handle, GdkColor* color) {
+    auto style = OS.gtk_widget_get_modifier_style (handle);
+    OS.gtk_rc_style_set_fg (style, OS.GTK_STATE_NORMAL, color);
+    OS.gtk_rc_style_set_fg (style, OS.GTK_STATE_ACTIVE, color);
+    OS.gtk_rc_style_set_fg (style, OS.GTK_STATE_PRELIGHT, color);
+    int flags = OS.gtk_rc_style_get_color_flags (style, OS.GTK_STATE_NORMAL);
+    flags = (color is null) ? flags & ~OS.GTK_RC_FG: flags | OS.GTK_RC_FG;
+    OS.gtk_rc_style_set_color_flags (style, OS.GTK_STATE_NORMAL, flags);
+    flags = OS.gtk_rc_style_get_color_flags (style, OS.GTK_STATE_ACTIVE);
+    flags = (color is null) ? flags & ~OS.GTK_RC_FG: flags | OS.GTK_RC_FG;
+    OS.gtk_rc_style_set_color_flags (style, OS.GTK_STATE_ACTIVE, flags);
+    flags = OS.gtk_rc_style_get_color_flags (style, OS.GTK_STATE_PRELIGHT);
+    flags = (color is null) ? flags & ~OS.GTK_RC_FG: flags | OS.GTK_RC_FG;
+    OS.gtk_rc_style_set_color_flags (style, OS.GTK_STATE_PRELIGHT, flags);
+
+    OS.gtk_rc_style_set_text (style, OS.GTK_STATE_NORMAL, color);
+    OS.gtk_rc_style_set_text (style, OS.GTK_STATE_ACTIVE, color);
+    OS.gtk_rc_style_set_text (style, OS.GTK_STATE_PRELIGHT, color);
+    flags = OS.gtk_rc_style_get_color_flags (style, OS.GTK_STATE_NORMAL);
+    flags = (color is null) ? flags & ~OS.GTK_RC_TEXT: flags | OS.GTK_RC_TEXT;
+    OS.gtk_rc_style_set_color_flags (style, OS.GTK_STATE_NORMAL, flags);
+    flags = OS.gtk_rc_style_get_color_flags (style, OS.GTK_STATE_PRELIGHT);
+    flags = (color is null) ? flags & ~OS.GTK_RC_TEXT: flags | OS.GTK_RC_TEXT;
+    OS.gtk_rc_style_set_color_flags (style, OS.GTK_STATE_PRELIGHT, flags);
+    flags = OS.gtk_rc_style_get_color_flags (style, OS.GTK_STATE_ACTIVE);
+    flags = (color is null) ? flags & ~OS.GTK_RC_TEXT: flags | OS.GTK_RC_TEXT;
+    OS.gtk_rc_style_set_color_flags (style, OS.GTK_STATE_ACTIVE, flags);
+    modifyStyle (handle, style);
+}
+
+bool setInputState (Event event, int state) {
+    if ((state & OS.GDK_MOD1_MASK) !is 0) event.stateMask |= SWT.ALT;
+    if ((state & OS.GDK_SHIFT_MASK) !is 0) event.stateMask |= SWT.SHIFT;
+    if ((state & OS.GDK_CONTROL_MASK) !is 0) event.stateMask |= SWT.CONTROL;
+    if ((state & OS.GDK_BUTTON1_MASK) !is 0) event.stateMask |= SWT.BUTTON1;
+    if ((state & OS.GDK_BUTTON2_MASK) !is 0) event.stateMask |= SWT.BUTTON2;
+    if ((state & OS.GDK_BUTTON3_MASK) !is 0) event.stateMask |= SWT.BUTTON3;
+    return true;
+}
+
+bool setKeyState (Event event, GdkEventKey* keyEvent) {
+    if (keyEvent.string !is null && OS.g_utf8_strlen (keyEvent.string, keyEvent.length) > 1) return false;
+    bool isNull = false;
+    event.keyCode = Display.translateKey (keyEvent.keyval);
+    switch (keyEvent.keyval) {
+        case OS.GDK_BackSpace:      event.character = SWT.BS; break;
+        case OS.GDK_Linefeed:       event.character = SWT.LF; break;
+        case OS.GDK_KP_Enter:
+        case OS.GDK_Return:         event.character = SWT.CR; break;
+        case OS.GDK_KP_Delete:
+        case OS.GDK_Delete:         event.character = SWT.DEL; break;
+        case OS.GDK_Escape:         event.character = SWT.ESC; break;
+        case OS.GDK_Tab:
+        case OS.GDK_ISO_Left_Tab:   event.character = SWT.TAB; break;
+        default: {
+            if (event.keyCode is 0) {
+                uint keyval;
+                int effective_group, level;
+                int consumed_modifiers;
+                if (OS.gdk_keymap_translate_keyboard_state(OS.gdk_keymap_get_default (), keyEvent.hardware_keycode, 0, keyEvent.group, &keyval, &effective_group, &level, &consumed_modifiers)) {
+                    event.keyCode = OS.gdk_keyval_to_unicode (keyval );
+                }
+            }
+            int key = keyEvent.keyval;
+            if ((keyEvent.state & OS.GDK_CONTROL_MASK) !is 0 && (0 <= key && key <= 0x7F)) {
+                if ('a'  <= key && key <= 'z') key -= 'a' - 'A';
+                if (64 <= key && key <= 95) key -= 64;
+                event.character = cast(char) key;
+                isNull = keyEvent.keyval is '@' && key is 0;
+            } else {
+                event.character = cast(char) OS.gdk_keyval_to_unicode (key);
+            }
+        }
+    }
+    if (event.keyCode is 0 && event.character is 0) {
+        if (!isNull) return false;
+    }
+    return setInputState (event, keyEvent.state);
+}
+
+void setOrientation () {
+}
+
+int /*long*/ shellMapProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
+    return 0;
+}
+
+int /*long*/ sizeAllocateProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
+    return 0;
+}
+
+int /*long*/ sizeRequestProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
+    return 0;
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the receiver
+ */
+public override String toString () {
+    String str = "*Disposed*";
+    if (!isDisposed ()) {
+        str = "*Wrong Thread*";
+        if (isValidThread ()) str = getNameText ();
+    }
+    return getName () ~ " {" ~ str ~ "}";
+}
+
+GtkWidget* topHandle () {
+    return handle;
+}
+
+int /*long*/ timerProc (GtkWidget* widget) {
+    return 0;
+}
+
+void treeSelectionProc (
+    GtkTreeModel *model,
+    GtkTreePath *path,
+    GtkTreeIter *iter,
+    int[] selection,
+    int length)
+{
+}
+
+bool translateTraversal (int event) {
+    return false;
+}
+
+int /*long*/ windowProc (GtkWidget* handle, int /*long*/ user_data) {
+    void trace( String str ){
+        version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Widget windowProc {}", str ).flush;
+    }
+
+    switch (cast(int)/*64*/user_data) {
+        case ACTIVATE:
+            trace( "ACTIVATE" );
+            return gtk_activate (handle);
+        case CHANGED:
+            trace( "CHANGED" );
+            return gtk_changed (handle);
+        case CLICKED:
+            trace( "CLICKED" );
+            return gtk_clicked (handle);
+        case DAY_SELECTED:
+            trace( "DAY_SELECTED" );
+            return gtk_day_selected (handle);
+        case HIDE:
+            trace( "HIDE" );
+            return gtk_hide (handle);
+        case GRAB_FOCUS:
+            trace( "GRAB_FOCUS" );
+            return gtk_grab_focus (handle);
+        case MAP:
+            trace( "MAP" );
+            return gtk_map (handle);
+        case MONTH_CHANGED:
+            trace( "MONTH_CHANGED" );
+            return gtk_month_changed (handle);
+        case OUTPUT:
+            trace( "OUTPUT" );
+            return gtk_output (handle);
+        case POPUP_MENU:
+            trace( "POPUP_MENU" );
+            return gtk_popup_menu (handle);
+        case PREEDIT_CHANGED:
+            trace( "PREEDIT_CHANGED" );
+            return gtk_preedit_changed (cast(GtkIMContext*)handle);
+        case REALIZE:
+            trace( "REALIZE" );
+            return gtk_realize (handle);
+        case SELECT:
+            trace( "SELECT" );
+            return gtk_select (cast(int)handle);
+        case SHOW:
+            trace( "SHOW" );
+            return gtk_show (handle);
+        case VALUE_CHANGED:
+            trace( "VALUE_CHANGED" );
+            return gtk_value_changed (cast(int)handle);
+        case UNMAP:
+            trace( "UNMAP" );
+            return gtk_unmap (handle);
+        case UNREALIZE:
+            trace( "UNREALIZE" );
+            return gtk_unrealize (handle);
+        default:
+            trace( "default" );
+            return 0;
+    }
+}
+
+int /*long*/ windowProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
+    void trace( String str ){
+        version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Widget windowProc1 {}", str ).flush;
+    }
+
+    switch (cast(int)/*64*/user_data) {
+        case EXPOSE_EVENT_INVERSE: {
+            trace( "EXPOSE_EVENT_INVERSE" );
+            GdkEventExpose* gdkEvent = cast(GdkEventExpose*) arg0;
+            auto paintWindow = paintWindow();
+            auto window = gdkEvent.window;
+            if (window !is paintWindow) return 0;
+            return (state & OBSCURED) !is 0 ? 1 : 0;
+        }
+        case BUTTON_PRESS_EVENT_INVERSE:
+        case BUTTON_RELEASE_EVENT_INVERSE:
+        case MOTION_NOTIFY_EVENT_INVERSE: {
+            trace( "BUTTON_PRESS_EVENT_INVERSE BUTTON_RELEASE_EVENT_INVERSE MOTION_NOTIFY_EVENT_INVERSE" );
+            return 1;
+        }
+        case BUTTON_PRESS_EVENT:
+            trace( "BUTTON_PRESS_EVENT" );
+            return gtk_button_press_event (handle, cast(GdkEventButton*)arg0);
+        case BUTTON_RELEASE_EVENT:
+            trace( "BUTTON_RELEASE_EVENT" );
+            return gtk_button_release_event (handle, cast(GdkEventButton*)arg0);
+        case COMMIT:
+            trace( "COMMIT" );
+            return gtk_commit (cast(GtkIMContext*)handle, cast(char*)arg0);
+        case CONFIGURE_EVENT:
+            trace( "CONFIGURE_EVENT" );
+            return gtk_configure_event (handle, arg0);
+        case DELETE_EVENT:
+            trace( "DELETE_EVENT" );
+            return gtk_delete_event (handle, arg0);
+        case ENTER_NOTIFY_EVENT:
+            trace( "ENTER_NOTIFY_EVENT" );
+            return gtk_enter_notify_event (handle, cast(GdkEventCrossing*)arg0);
+        case EVENT:
+            trace( "EVENT" );
+            return gtk_event (handle, cast(GdkEvent*)arg0);
+        case POPULATE_POPUP:
+            trace( "POPULATE_POPUP" );
+            return gtk_populate_popup (handle, cast(GtkWidget*)arg0);
+        case EVENT_AFTER:
+            trace( "EVENT_AFTER" );
+            return gtk_event_after (handle, cast(GdkEvent*)arg0);
+        case EXPOSE_EVENT:
+            trace( "EXPOSE_EVENT" );
+            return gtk_expose_event (handle, cast(GdkEventExpose*)arg0);
+        case FOCUS:
+            trace( "FOCUS" );
+            return gtk_focus (handle, arg0);
+        case FOCUS_IN_EVENT:
+            trace( "FOCUS_IN_EVENT" );
+            return gtk_focus_in_event (handle, cast(GdkEventFocus*)arg0);
+        case FOCUS_OUT_EVENT:
+            trace( "FOCUS_OUT_EVENT" );
+            return gtk_focus_out_event (handle, cast(GdkEventFocus*)arg0);
+        case KEY_PRESS_EVENT:
+            trace( "KEY_PRESS_EVENT" );
+            return gtk_key_press_event (handle, cast(GdkEventKey*)arg0);
+        case KEY_RELEASE_EVENT:
+            trace( "KEY_RELEASE_EVENT" );
+            return gtk_key_release_event (handle, cast(GdkEventKey*)arg0);
+        case INPUT:
+            trace( "INPUT" );
+            return gtk_input (handle, arg0);
+        case LEAVE_NOTIFY_EVENT:
+            trace( "LEAVE_NOTIFY_EVENT" );
+            return gtk_leave_notify_event (handle, cast(GdkEventCrossing*)arg0);
+        case MAP_EVENT:
+            trace( "MAP_EVENT" );
+            return gtk_map_event (handle, arg0);
+        case MNEMONIC_ACTIVATE:
+            trace( "MNEMONIC_ACTIVATE" );
+            return gtk_mnemonic_activate (handle, arg0);
+        case MOTION_NOTIFY_EVENT:
+            trace( "MOTION_NOTIFY_EVENT" );
+            return gtk_motion_notify_event (handle, cast(GdkEventMotion*)arg0);
+        case MOVE_FOCUS:
+            trace( "MOVE_FOCUS" );
+            return gtk_move_focus (handle, arg0);
+        case SCROLL_EVENT:
+            trace( "SCROLL_EVENT" );
+            return gtk_scroll_event (handle, cast(GdkEventScroll*)arg0);
+        case SHOW_HELP:
+            trace( "SHOW_HELP" );
+            return gtk_show_help (handle, arg0);
+        case SIZE_ALLOCATE:
+            trace( "SIZE_ALLOCATE" );
+            return gtk_size_allocate (handle, arg0);
+        case STYLE_SET:
+            trace( "STYLE_SET" );
+            return gtk_style_set (handle, arg0);
+        case TOGGLED:
+            trace( "TOGGLED" );
+            return gtk_toggled (cast(int)handle, cast(char*)arg0);
+        case UNMAP_EVENT:
+            trace( "UNMAP_EVENT" );
+            return gtk_unmap_event (handle, arg0);
+        case VISIBILITY_NOTIFY_EVENT:
+            trace( "VISIBILITY_NOTIFY_EVENT" );
+            return gtk_visibility_notify_event (handle, cast(GdkEventVisibility*)arg0);
+        case WINDOW_STATE_EVENT:
+            trace( "WINDOW_STATE_EVENT" );
+            return gtk_window_state_event (handle, cast(GdkEventWindowState*)arg0);
+        default:
+            trace( "default" );
+            return 0;
+    }
+}
+
+int /*long*/ windowProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ user_data) {
+    void trace( String str ){
+        version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Widget windowProc2 {}", str ).flush;
+    }
+
+    switch (cast(int)/*64*/user_data) {
+        case DELETE_RANGE:
+            trace( "DELETE_RANGE" );
+            return gtk_delete_range (handle, arg0, arg1);
+        case DELETE_TEXT:
+            trace( "DELETE_TEXT" );
+            return gtk_delete_text (handle, arg0, arg1);
+        case ROW_ACTIVATED:
+            trace( "ROW_ACTIVATED" );
+            gtk_row_activated (cast(GtkTreeView*)handle, cast(GtkTreePath*)arg0, cast(GtkTreeViewColumn*)arg1);
+            return 0;
+        case SCROLL_CHILD:
+            trace( "SCROLL_CHILD" );
+            return gtk_scroll_child (handle, arg0, arg1);
+        case SWITCH_PAGE:
+            trace( "SWITCH_PAGE" );
+            return gtk_switch_page (handle, arg0, arg1);
+        case TEST_COLLAPSE_ROW:
+            trace( "TEST_COLLAPSE_ROW" );
+            return gtk_test_collapse_row (cast(GtkTreeView*)handle, cast(GtkTreeIter*)arg0, cast(GtkTreePath*)arg1);
+        case TEST_EXPAND_ROW:
+            trace( "TEST_EXPAND_ROW" );
+            return gtk_test_expand_row(cast(GtkTreeView*)handle, cast(GtkTreeIter*)arg0, cast(GtkTreePath*)arg1);
+        default:
+            trace( "default" );
+            return 0;
+    }
+}
+
+int /*long*/ windowProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ arg2, int /*long*/ user_data) {
+    void trace( String str ){
+        version(LOG) getDwtLogger().error( __FILE__, __LINE__,  "Widget windowProc3 {}", str ).flush;
+    }
+
+    switch (cast(int)/*64*/user_data) {
+        case CHANGE_VALUE:
+            trace( "CHANGE_VALUE" );
+            return gtk_change_value (handle, arg0, arg1, arg2);
+        case EXPAND_COLLAPSE_CURSOR_ROW:
+            trace( "EXPAND_COLLAPSE_CURSOR_ROW" );
+            return gtk_expand_collapse_cursor_row (handle, arg0, arg1, arg2);
+        case INSERT_TEXT:
+            trace( "INSERT_TEXT" );
+            return gtk_insert_text (cast(GtkEditable*)handle, cast(char*)arg0, arg1, arg2);
+        case TEXT_BUFFER_INSERT_TEXT:
+            trace( "TEXT_BUFFER_INSERT_TEXT" );
+            return gtk_text_buffer_insert_text (cast(GtkTextBuffer*)handle, cast(GtkTextIter*)arg0, cast(char*)arg1, arg2);
+        default:
+            trace( "default" );
+            return 0;
+    }
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/all.d	Fri Mar 20 23:03:58 2009 +0100
@@ -0,0 +1,66 @@
+module org.eclipse.swt.widgets.all;
+
+import java.lang.all;
+
+public import org.eclipse.swt.widgets.Button;
+public import org.eclipse.swt.widgets.Canvas;
+public import org.eclipse.swt.widgets.Caret;
+public import org.eclipse.swt.widgets.ColorDialog;
+public import org.eclipse.swt.widgets.Combo;
+public import org.eclipse.swt.widgets.Composite;
+public import org.eclipse.swt.widgets.Control;
+public import org.eclipse.swt.widgets.CoolBar;
+public import org.eclipse.swt.widgets.CoolItem;
+public import org.eclipse.swt.widgets.DateTime;
+public import org.eclipse.swt.widgets.Decorations;
+public import org.eclipse.swt.widgets.Dialog;
+public import org.eclipse.swt.widgets.DirectoryDialog;
+public import org.eclipse.swt.widgets.Display;
+public import org.eclipse.swt.widgets.Event;
+public import org.eclipse.swt.widgets.EventTable;
+public import org.eclipse.swt.widgets.ExpandBar;
+public import org.eclipse.swt.widgets.ExpandItem;
+public import org.eclipse.swt.widgets.FileDialog;
+public import org.eclipse.swt.widgets.FontDialog;
+public import org.eclipse.swt.widgets.Group;
+public import org.eclipse.swt.widgets.IME;
+public import org.eclipse.swt.widgets.ImageList;
+public import org.eclipse.swt.widgets.Item;
+public import org.eclipse.swt.widgets.Label;
+public import org.eclipse.swt.widgets.Layout;
+public import org.eclipse.swt.widgets.Link;
+public import org.eclipse.swt.widgets.List;
+public import org.eclipse.swt.widgets.Listener;
+public import org.eclipse.swt.widgets.Menu;
+public import org.eclipse.swt.widgets.MenuItem;
+public import org.eclipse.swt.widgets.MessageBox;
+public import org.eclipse.swt.widgets.Monitor;
+public import org.eclipse.swt.widgets.ProgressBar;
+public import org.eclipse.swt.widgets.RunnableLock;
+public import org.eclipse.swt.widgets.Sash;
+public import org.eclipse.swt.widgets.Scale;
+public import org.eclipse.swt.widgets.ScrollBar;
+public import org.eclipse.swt.widgets.Scrollable;
+public import org.eclipse.swt.widgets.Shell;
+public import org.eclipse.swt.widgets.Slider;
+public import org.eclipse.swt.widgets.Spinner;
+public import org.eclipse.swt.widgets.Synchronizer;
+public import org.eclipse.swt.widgets.TabFolder;
+public import org.eclipse.swt.widgets.TabItem;
+public import org.eclipse.swt.widgets.Table;
+public import org.eclipse.swt.widgets.TableColumn;
+public import org.eclipse.swt.widgets.TableItem;
+public import org.eclipse.swt.widgets.Text;
+public import org.eclipse.swt.widgets.ToolBar;
+public import org.eclipse.swt.widgets.ToolItem;
+public import org.eclipse.swt.widgets.ToolTip;
+public import org.eclipse.swt.widgets.Tracker;
+public import org.eclipse.swt.widgets.Tray;
+public import org.eclipse.swt.widgets.TrayItem;
+public import org.eclipse.swt.widgets.Tree;
+public import org.eclipse.swt.widgets.TreeColumn;
+public import org.eclipse.swt.widgets.TreeItem;
+public import org.eclipse.swt.widgets.TypedListener;
+public import org.eclipse.swt.widgets.Widget;
+
+
--- a/rakefile	Fri Mar 20 14:09:41 2009 +0100
+++ b/rakefile	Fri Mar 20 23:03:58 2009 +0100
@@ -14,7 +14,11 @@
 RSPNAME="rsp"
 ALL_RESDIRS= [ "java/res", "res" ]
 
-if Rake::Win32.windows?
+def isWindows
+    Config::CONFIG['host_os'] =~ /mswin/
+end
+
+if isWindows
     ALL_RESDIRS << "org.eclipse.swt.win32.win32.x86/res"
 else
     ALL_RESDIRS << "org.eclipse.swt.gtk.linux.x86/res"
@@ -22,7 +26,11 @@
 
 class String
     def to_path
-        self.gsub( '/', '\\' );
+        if isWindows
+            self.gsub( '/', '\\' );
+        else
+            self
+        end
     end
 end
 
@@ -59,8 +67,12 @@
     rsp.close
 
     Dir.chdir(basedir) do
-        sh "#{DMD} @#{rspfile_abs.to_path}" do |ok, res|
-
+        if isWindows
+            cmd = "#{DMD} @#{rspfile_abs.to_path}"
+        else
+            cmd = "cat #{rspfile_abs.to_path} | xargs #{DMD}"
+        end
+        sh cmd, :verbose => false do |ok, res|
             if !ok then
                 Find.find( srcdir_abs ) do |path|
                     if FileTest.file?(path) && path =~ /\.di$/ then
@@ -106,7 +118,7 @@
 
 desc "Build SWT"
 task :swt do
-    if Rake::Win32.windows?
+    if isWindows
         buildTree( "org.eclipse.swt.win32.win32.x86", "src", "res" )
     else
         buildTree( "org.eclipse.swt.gtk.linux.x86", "src", "res" )